query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
// setHost sets the host of this URI. | [
"func (u *URI) setHost(host string) error {\n\tm := hostRegexp.FindStringSubmatch(host)\n\tif m == nil {\n\t\treturn errors.New(\"invalid host\")\n\t}\n\tu.Host = host\n\treturn nil\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 sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
Get a album.
https://developer.spotify.com/documentation/web-api/reference/albums/get-album/
@param string $albumId ID or Spotify URI of the album.
@return array|object The requested album. Type is controlled by `SpotifyWebAPI::setReturnType()`. | [
"public function getAlbum($albumId)\n {\n $headers = $this->authHeaders();\n\n $albumId = $this->uriToId($albumId, 'album');\n $uri = '/v1/albums/' . $albumId;\n\n $this->lastResponse = $this->request->api('GET', $uri, [], $headers);\n\n return $this->lastResponse['body'];\n ... | [
"def get_note(self, noteid):\n\n \n\n if self.standard_grant_type is not \"authorization_code\":\n raise DeviantartError(\"Authentication through Authorization Code (Grant Type) is required in order to connect to this endpoint.\")\n\n response = self._req('/notes/{}'.format(noteid))\... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Compares two timestamp operands for point-in-time equivalence only. | [
"def _timestamp_instants_eq(a, b):\n \"\"\"\"\"\"\n assert isinstance(a, datetime)\n if not isinstance(b, datetime):\n return False\n # datetime's __eq__ can't compare a None offset and a non-None offset. For these equivalence semantics, a None\n # offset (unknown local offset) is treated equi... | [
"def diff_values(value_a, value_b, raw=False):\n \n\n if not raw:\n value_a = _process_value(value_a)\n value_b = _process_value(value_b)\n\n # No changes\n if value_a == value_b:\n return None\n\n diffs = []\n # N.B.: the choice for the tuple data structure is to enable in th... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// SetUsername sets the Username field's value. | [
"func (s *CreateUserInput) SetUsername(v string) *CreateUserInput {\n\ts.Username = &v\n\treturn s\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Get the username and password to use for the given uri.
@see org.eclipse.jgit.transport.CredentialsProvider#get(org.eclipse.jgit.transport.URIish,
org.eclipse.jgit.transport.CredentialItem[]) | [
"@Override\n\tpublic boolean get(URIish uri, CredentialItem... items)\n\t\t\tthrows UnsupportedCredentialItem {\n\t\tString codeCommitPassword;\n\t\tString awsAccessKey;\n\t\tString awsSecretKey;\n\t\ttry {\n\t\t\tAWSCredentials awsCredentials = retrieveAwsCredentials();\n\t\t\tStringBuilder awsKey = new StringBuil... | [
"private String decryptServerPassword(Server server) throws SecDispatcherException {\n //CSOFF: LineLength\n //The following fix was copied from:\n // https://github.com/bsorrentino/maven-confluence-plugin/blob/master/maven-confluence-reporting-plugin/src/main/java/org/bsc/maven/confluence/pl... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
package-private: Set the trace specification of the service to the input
value.
@param spec | [
"static void setTraceSpec(TraceSpecification spec) {\n if (spec == null)\n return;\n\n // We must have the lock to proceed\n allTraceComponentsLock.lock();\n try {\n // Since we have the lock, we must process any new trace components and\n // if we do it ... | [
"@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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Decode base64 encoded string
@param bool $webSafe Web sage decoding (replaces '-' with '+' and '_' with '/' before decoding)
@return $this | [
"public function base64Decode($webSafe = false)\n {\n $this->val(base64_decode($this->val()));\n\n if ($webSafe) {\n $this->replace('-', '+')->replace('_', '/');\n }\n\n return $this;\n }"
] | [
"public function generate() {\n $strong = false;\n $i = 0;\n\n while (!$strong && $this->maxTries > $i++) {\n $data = openssl_random_pseudo_bytes(32, $strong);\n }\n\n if (!$strong) {\n throw new RuntimeException('Could not generate private key');\n }\... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Defines an instanceof-conditional to be applied to following service definitions. | [
"final public function instanceof(string $fqcn): InstanceofConfigurator\n {\n $this->instanceof[$fqcn] = $definition = new ChildDefinition('');\n\n return new InstanceofConfigurator($this, $definition, $fqcn, $this->path);\n }"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Insert a number of rows after the given row. | [
"def insert_empty_rows(self, y: int, amount: int = 1) -> None:\n \"\"\"\"\"\"\n def transform_rows(\n column: Union[int, float],\n row: Union[int, float]\n ) -> Tuple[Union[int, float], Union[int, float]]:\n return column, row + (amount if row >= y else ... | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the Github text about SQL:",
"pos": "Represent the Github code about SQL:",
"neg": "Represent the Github code about programming:"
} |
Destroy the given session on registered SSO clients
@param \TYPO3\Flow\Session\SessionInterface $session
@return void | [
"public function destroyRegisteredSsoClientSessions(SessionInterface $session) {\n\t\tif (!$session->isStarted()) {\n\t\t\treturn;\n\t\t}\n\n\t\t$ssoClients = $this->getRegisteredSsoClients($session);\n\t\t$sessionId = $session->getId();\n\n\t\t$ssoServer = $this->ssoServerFactory->create();\n\t\t$this->ssoClientNo... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Heading Tag <h1>, <h2>, <h3> etc.
@param string $content
@param int $level
@param type $attributes | [
"public static function h(\n string $content, \n int $level = 1, \n $attributes = []\n ) : string\n {\n return self::tag(\"h\".$level, $content, $attributes);\n }"
] | [
"public function newSection($name, $text)\n\t{\n\t\treturn $this->setSection($text, $section = 'new', $summary = $name, $minor = false);\n\t}"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Sanitize a scalar or traversable data
@param mixed $data Value to be sanitized
@return mixed The sanitized value | [
"public function sanitize($data)\n {\n if(is_array($data) || $data instanceof Traversable)\n {\n foreach((array)$data as $key => $value)\n {\n if(is_array($data)) {\n $data[$key] = $this->sanitize($value);\n } else {\n ... | [
"public function setEmployees(\n array $employees)\n {\n $this->_employees = $employees;\n\n // We now need to construct a new, inner value for the property. Since\n // it's a \"mixed\" property, it only accepts basic PHP types.\n $newInnerValue = [];\n foreach ($this->_... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
update the log file name. If 'log_split' is not empty and manager running to long time. | [
"protected function updateLogFile()\n {\n // update file. $dtStr is '_Y-m-d' or '_Y-m-d_H'\n if ($this->fileIsChanged()) {\n fclose($this->fileHandle);\n\n $logFile = $this->genLogFile(true);\n $this->file = $logFile;\n $this->fileHandle = @fopen($logFile... | [
"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:"
} |
Converts the specified <code>date</code> with the specified {@code format} to a new instance of Time.
<code>null</code> is returned if the specified <code>date</code> is null or empty.
@param date
@param format
@param timeZone
@return | [
"public static Time parseTime(final String date, final String format, final TimeZone timeZone) {\r\n if (N.isNullOrEmpty(date) || (date.length() == 4 && \"null\".equalsIgnoreCase(date))) {\r\n return null;\r\n }\r\n\r\n return createTime(parse(date, format, timeZone));\r\n }"
] | [
"protected void createEventTimeStamp(RepositoryLogRecord record, StringBuilder buffer) {\n\t\tif (null == record) {\n\t\t\tthrow new IllegalArgumentException(\"Record cannot be null\");\n\t\t}\n\t\tif (null == buffer) {\n\t\t\tthrow new IllegalArgumentException(\"Buffer cannot be null\");\n\t\t}\n\t\t// Create the ... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Shutdown the AIO library. | [
"public static void shutdown() {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {\n Tr.entry(tc, \"shutdown\");\n }\n synchronized (oneAtATime) {\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {\n Tr.debug(tc, \"have l... | [
"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:"
} |
NOTE: preserved for performance testing | [
"int firstOneInRange(int from, int to) {\n\t\tif (from < 0) throw new IllegalArgumentException();\n\t\tif (to < from) throw new IllegalArgumentException();\n\t\tfrom += start;\n\t\tto += start;\n\t\tif (to > finish) throw new IllegalArgumentException();\n\t\treturn firstOneInRangeAdj(from, to) - start;\n\t}"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// MarshalBinary allocates a byte slice containing the data from a OptionRequestOption. | [
"func (oro OptionRequestOption) MarshalBinary() ([]byte, error) {\n\tb := buffer.New(nil)\n\tfor _, opt := range oro {\n\t\tb.Write16(uint16(opt))\n\t}\n\treturn b.Data(), nil\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Return the field values for the redo code.
<ul><li>0: do not redo</li>
<li>1: redo but do not copy answers</li>
<li>2: redo and copy answers</li></ul>
@staticvar array $data
@return array | [
"public function getRedoValues()\n {\n static $data;\n\n if (! $data) {\n $data = array(\n self::REDO_NONE => $this->_('No'),\n self::REDO_ONLY => $this->_('Yes (forget answers)'),\n self::REDO_COPY => $this->_('Yes (keep answers)'));\n ... | [
"protected function getControlKey($disconnect = false)\n {\n $key = '';\n\n if ($disconnect) {\n return \"*immed\";\n }\n\n /*\n if(?) *justproc\n if(?) *debug\n if(?) *debugproc\n if(?) *nostart\n if(?) *rpt*/\n\n // Idle timeout s... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Generates a response from a page url.
If seo redirect, return target.
@param string $uri
@param string $url
@param $locale
@param string|null $layout
@return Response | [
"public function renderPageByUrl($uri, $url, $locale, $layout = null)\n {\n $page = null;\n if ($viewReference = $this->viewReferenceRepository->getReferenceByUrl($url, $locale)) {\n $page = $this->findPageByReference($viewReference);\n $this->checkPageValidity($page, ['url' =... | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Creates a modification file from an array of modifications
@param Modification[] $modifications
@param number $numMods
Max number of modifications to search per peptide
@return string File path the newly created modification file | [
"public static function createModificationFile(array $modifications, $numMods = 2)\n {\n // TODO:\n // All array must be this class\n // NumMods must be uint\n $data = 'NumMods=' . $numMods . PHP_EOL;\n\n foreach ($modifications as $modification) {\n $entry = $modifi... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Extracts messages to be translated from source code.
This command will search through source code files and extract
messages that need to be translated in different languages.
@throws Exception on failure.
@return array | [
"public function extract()\n {\n if (!isset($this->config['sourcePath'], $this->config['languages'])) {\n throw new Exception('The configuration must specify \"sourcePath\" and \"languages\".');\n }\n\n foreach ($this->config['sourcePath'] as $sourcePath) {\n if (!is_di... | [
"def get_parser(parser):\n \n parser.description = textwrap.dedent(\"\"\"\n Segment the .po files in LOCALE(s) based on the segmenting rules in\n config.yaml.\n\n Note that segmenting is *not* idempotent: it modifies the input file, so\n be careful that you don't run it twice on th... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
/*
components.js
Components associate custom script functionality with a view. They can be
distributed as standalone modules containing templates, scripts, and styles.
They can also be used to modularize application functionality. | [
"function Component(parent, context, id, scope) {\n this.parent = parent;\n this.context = context;\n this.id = id;\n this._scope = scope;\n }"
] | [
"function Scope(context, parent, meta) {\n\t// The object that will be looked on for values.\n\t// If the type of context is TemplateContext, there will be special rules for it.\n\tthis._context = context;\n\t// The next Scope object whose context should be looked on for values.\n\tthis._parent = parent;\n\t// If t... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
发送单聊文件消息
:param sender: 发送人
:param receiver: 接收人成员 ID
:param media_id: 文件id,可以调用上传素材文件接口获取, 文件须大于4字节
:return: 返回的 JSON 数据包 | [
"def send_single_file(self, sender, receiver, media_id):\n \n return self.send_file(sender, 'single', receiver, media_id)"
] | [
"public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(DeliverConfigSnapshotRequest deliverConfigSnapshotRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (deliverConfigSnapshotRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolM... | [
"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:"
} |
MySQL hack to avoid the "VARCHAR requires a length" error. | [
"def _compile_varchar_mysql(element, compiler, **kw):\n \"\"\"\"\"\"\n if not element.length or element.length == 'max':\n return \"TEXT\"\n else:\n return compiler.visit_VARCHAR(element, **kw)"
] | [
"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:"
} |
// Note that it's important that the mask bytes are long literals,
// otherwise they'll default to ints, and when you shift an int left 56 bits,
// you just get a messed up int. | [
"func (p *TCompactProtocol) bytesToUint64(b []byte) uint64 {\n\treturn binary.LittleEndian.Uint64(b)\n}"
] | [
"public function generateInt($min = 0, $max = PHP_INT_MAX)\n {\n $tmp = (int) max($max, $min);\n $min = (int) min($max, $min);\n $max = $tmp;\n $range = $max - $min;\n if ($range == 0) {\n return $max;\n } elseif ($range > PHP_INT_MAX || is_float($range)... | codesearchnet | {
"query": "Represent the description about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Programming:"
} |
Read and process all the specialSubject elements
@param configAdmin
@param roleName
@param roleProps
@param pids TODO | [
"private void processSpecialSubjects(ConfigurationAdmin configAdmin,\n String roleName,\n Dictionary<String, Object> roleProps, Set<String> pids) {\n\n String[] specialSubjectPids = (String[]) roleProps.get(CFG_KEY_SPECIAL_SUBJECT)... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
place : num numkan | "同 " | [
"def parse_place\n s0 = @current_pos\n s1 = parse_num\n if s1 != :failed\n s2 = parse_numkan\n if s2 != :failed\n @reported_pos = s0\n s0 = { \"x\" => s1, \"y\" => s2 }\n else\n @current_pos = s0\n s0 = :failed\n end\n else\n ... | [
"def _init_prtfmt(self, key=\"fmta\"):\n \"\"\"\"\"\"\n prtfmt = self.gosubdag.prt_attr[key]\n return prtfmt.replace(\"{NS}\", \"{NS} {hdr1usr01:2} {num_usrgos:>4} uGOs\")"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Top level FW update function. | [
"def fw_update(self, data, fw_name=None):\n \n LOG.debug(\"FW Update %s\", data)\n self._fw_update(fw_name, data)"
] | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
The view model for the data catalog.
@param {Terria} terria The Terria instance.
@alias Catalog
@constructor | [
"function(terria) {\n if (!defined(terria)) {\n throw new DeveloperError(\"terria is required\");\n }\n\n this._terria = terria;\n this._shareKeyIndex = {};\n\n this._group = new CatalogGroup(terria);\n this._group.name = \"Root Group\";\n this._group.preserveOrder = true;\n\n /**\n * Gets or sets a fl... | [
"@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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Same as bcpowmod when bcpowmod is missing
@access private
@param int $base
@param int $exponent
@param int $modulus
@return int | [
"function _powmod($base, $exponent, $modulus)\n {\n $square = $this->mod($base, $modulus);\n $result = 1;\n while($this->cmp($exponent, 0) > 0) {\n if ($this->mod($exponent, 2)) {\n $result = $this->mod($this->mul($result, $square), $modulus);\n }\n ... | [
"public function check($provided, $name)\n {\n $provided = bindec($provided);\n return (bool)($provided & $this->getRight($name));\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Transforms any array into an array of {@code Character}.
@param src source array
@param srcPos start position
@param len length
@return Character array | [
"public static Character[] boxCharacters(Object src, int srcPos, int len) {\n return boxCharacters(array(src), srcPos, len);\n }"
] | [
"private void initialize(Map context) {\n // Guard against recursion.\n context.put(jsTypeTree, this);\n\n // Create temporary accumulators for the contents of the fields and variants instance\n // variables.\n List tmpFields = new ArrayList();\n List tmpVariants = new ArrayList();\n\n // Perfo... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
TODO: what if the ontology terms have multiple IDs? | [
"public String getId(OWLClass entity) {\n for (OWLAnnotationProperty owlObjectProperty : ontology.getAnnotationPropertiesInSignature()) {\n if (ifExistsAnnotation(owlObjectProperty.toString(), \"id\")) {\n Set<String> annotation = getAnnotation(entity, owlObjectProperty.getIRI().toString());\n ... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Check that the children we have are allowed here. | [
"def _validate_children(self):\n \"\"\"\"\"\"\n for child in self._children:\n if child.__class__ not in self._allowed_children:\n raise ValueError(\n \"Child %s is not allowed as a children for this %s type entity.\" % (\n child, sel... | [
"function showIntro() {\n write(\"Welcome to the Recognizer's Sample console application!\");\n write(\"To try the recognizers enter a phrase and let us show you the different outputs for each recognizer or just type 'exit' to leave the application.\");\n write();\n write(\"Here are some examples you co... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return the complete string from the tree root up to and including this node
i.e. The total string key for this node from root. | [
"def to_s\n st = @char\n node = self\n while node != nil\n node = node.up\n break if node==nil\n st = node.char+st\n end\n st\n end"
] | [
"function nodeClosed( ascent ) {\n\n emitNodeClosed( ascent);\n \n return tail( ascent) ||\n // If there are no nodes left in the ascent the root node\n // just closed. Emit a special event for this: \n emitRootClosed(nodeOf(head(ascent)));\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// NewStatusCheck generates an empty (valueless) StatusCheck | [
"func NewStatusCheck(Name string, Tags []string) *StatusCheck {\n\treturn &StatusCheck{InterMetric{Name: Name, Tags: Tags}}\n}"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Strip Juniper-specific output.
Juniper will also put a configuration context:
[edit]
and various chassis contexts:
{master:0}, {backup:1}
This method removes those lines. | [
"def strip_context_items(self, a_string):\n \n strings_to_strip = [\n r\"\\[edit.*\\]\",\n r\"\\{master:.*\\}\",\n r\"\\{backup:.*\\}\",\n r\"\\{line.*\\}\",\n r\"\\{primary.*\\}\",\n r\"\\{secondary.*\\}\",\n ]\n\n respon... | [
"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 Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Gets the MultilingualSection object for the current section of the site.
@return Section | [
"public static function getCurrentSection()\n {\n static $lang;\n if (!isset($lang)) {\n $c = Page::getCurrentPage();\n if ($c instanceof Page) {\n $lang = self::getBySectionOfSite($c);\n }\n }\n\n return $lang;\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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get list of permissions for a user
:param obj_id: int
:param permissions: str|list|tuple
:return: dict|str | [
"def check_permission(self, obj_id, permissions):\n \n response = self._client.session.post(\n '{url}/{id}/permissioncheck'.format(\n url=self.endpoint_url, id=obj_id\n ),\n data={'permissions': permissions}\n )\n return self.process_respon... | [
"def get_value_from_content(key):\n \n def value_from_content_function(service, message):\n \"\"\"Actual implementation of get_value_from_content function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(messa... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
called while holding class lock | [
"private void cacheClass(ClassSource classSource, String outerClassName) {\n if (classCacheMode != UserCodeDeploymentConfig.ClassCacheMode.OFF) {\n classSourceMap.put(outerClassName, classSource);\n } else {\n ThreadLocalClassCache.store(outerClassName, classSource);\n }\n... | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Execute executes a non-streaming query on the specified shards. | [
"func (stc *ScatterConn) Execute(\n\tctx context.Context,\n\tquery string,\n\tbindVars map[string]*querypb.BindVariable,\n\trss []*srvtopo.ResolvedShard,\n\ttabletType topodatapb.TabletType,\n\tsession *SafeSession,\n\tnotInTransaction bool,\n\toptions *querypb.ExecuteOptions,\n) (*sqltypes.Result, error) {\n\n\t//... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
LM loss for multiproblems. | [
"def aggregate_task_lm_losses(hparams,\n problem_hparams,\n logits,\n feature_name,\n feature):\n \"\"\"\"\"\"\n summaries = []\n vocab_size = problem_hparams.vocab_size[feature_name]\n if vocab_size ... | [
"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:"
} |
store some key/value pairs | [
"def mset(msg_id, values)\n values = values.inject([]){|a,(k,v)| a.concat([key(msg_id, k), v])}\n with_failover { redis.mset(*values) }\n end"
] | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Get returns a container from the store by id. | [
"func (c *memoryStore) Get(id string) *Container {\n\tvar res *Container\n\tc.RLock()\n\tres = c.s[id]\n\tc.RUnlock()\n\treturn res\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:"
} |
Compiles code for the {rdelim} tag
This tag does output the right delimiter.
@param array $args array with attributes from parser
@param object $compiler compiler object
@return string compiled code | [
"public function compile($args, $compiler)\n {\n $_attr = $this->getAttributes($compiler, $args);\n if ($_attr['nocache'] === true) {\n $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);\n }\n // this tag does not return compiled cod... | [
"public function XML_val($field, $arguments = [], $cache = false)\n {\n $result = $this->obj($field, $arguments, $cache);\n // Might contain additional formatting over ->XML(). E.g. parse shortcodes, nl2br()\n return $result->forTemplate();\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Gets a file relative to this file in the repository and sends it to the browser.
Checks the function repository::supports_relative_file() to make sure it can be used.
@param string $relativepath the relative path to the file we are trying to access | [
"public function send_relative_file($relativepath) {\n if ($this->repository && $this->repository->supports_relative_file()) {\n $relativepath = clean_param($relativepath, PARAM_PATH);\n $this->repository->send_relative_file($this, $relativepath);\n } else {\n send_fil... | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// C returns an expression for the specified list of columns. An error
// expression is created if any of the columns do not exist in the table. An
// error expression is created if no columns are specified. | [
"func (t *Table) C(cols ...string) ValExprBuilder {\n\tif len(cols) == 0 {\n\t\treturn ValExprBuilder{makeErrVal(\"no columns specified\")}\n\t}\n\n\tif len(cols) == 1 {\n\t\tname := cols[0]\n\t\tif _, ok := t.ColumnMap[name]; !ok {\n\t\t\treturn ValExprBuilder{makeErrVal(\"unknown column: %s\", name)}\n\t\t}\n\t\t... | [
"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 text about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Converts bytes expression to number of mebibytes.
If no unit is specified, ``MiB`` is used. | [
"def parse_memory(s):\n \"\"\"\"\"\"\n if isinstance(s, integer):\n out = s\n elif isinstance(s, float):\n out = math_ceil(s)\n elif isinstance(s, string):\n s = s.replace(' ', '')\n\n if not s:\n raise context.ValueError(\"Could not interpret %r as a byte unit\" %... | [
"def formatDecimalMark(value, decimalmark='.'):\n \n # We have to consider the possibility of working with decimals such as\n # X.000 where those decimals are important because of the precission\n # and significant digits matters\n # Using 'float' the system delete the extre desimals with 0 as a valu... | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
look for a certain key within a dictionary and nullify ti's contents, check within nested
dictionaries and lists as well. Certain attributes such as "generation" will change even
when there were no changes made to the entity. | [
"def _strip_key(dictionary, keyword):\n '''\n \n '''\n\n for key, value in six.iteritems(dictionary):\n if key == keyword:\n dictionary[key] = None\n elif isinstance(value, dict):\n _strip_key(value, keyword)\n elif isinstance(value, list):\n for ite... | [
"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 Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get informations about webHosting offers
REST: GET /order/cart/{cartId}/webHosting
@param cartId [required] Cart identifier | [
"public ArrayList<OvhWebHostingProductInformation> cart_cartId_webHosting_GET(String cartId) throws IOException {\n\t\tString qPath = \"/order/cart/{cartId}/webHosting\";\n\t\tStringBuilder sb = path(qPath, cartId);\n\t\tString resp = execN(qPath, \"GET\", sb.toString(), null);\n\t\treturn convertTo(resp, t4);\n\t}... | [
"def get_quotes(self):\n \n mask = \"mask[order[id,items[id,package[id,keyName]]]]\"\n quotes = self.client['Account'].getActiveQuotes(mask=mask)\n return quotes"
] | codesearchnet | {
"query": "Represent the instruction about Sales Channel API:",
"pos": "Represent the code about Sales Channel API:",
"neg": "Represent the code about API documentation:"
} |
Context related methods | [
"@Override\n\tpublic void reloadContext() throws DeploymentException\n\t{\n\t\tArchive<?> archive = mssContainer.getArchive();\n\t\tdeployableContainer.undeploy(archive);\n\t\tdeployableContainer.deploy(archive);\n\t}"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Integrate with gRPC. | [
"def trace_grpc(tracer=None):\n \"\"\"\"\"\"\n # Wrap google.cloud._helpers.make_secure_channel\n make_secure_channel_func = getattr(_helpers, MAKE_SECURE_CHANNEL)\n make_secure_channel_wrapped = wrap_make_secure_channel(\n make_secure_channel_func, tracer)\n setattr(\n _helpers,\n ... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
This will get a specific entry, it will call the missHandler if it is not found.
@param key the object to find
@return the found object (may be null) | [
"public V get(K key) {\n V value = _cacheImpl.get(key);\n _requests.incrementAndGet();\n if (value == null) {\n value = _missHandler.load(key);\n _cacheImpl.put(key, value);\n _misses.incrementAndGet();\n } else {\n _hits.incrementAndGet();\n }\n return value;\n }"
] | [
"def getLockByID(self, lockid):\n \n assert isinstance(lockid, (locks.MasterLock, locks.WorkerLock))\n if lockid not in self.locks:\n self.locks[lockid] = lockid.lockClass(lockid)\n # if the master.cfg file has changed maxCount= on the lock, the next\n # time a build is... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Retrieves the elevation of a single location.
@param context The {@link GeoApiContext} to make requests through.
@param location The location to retrieve the elevation for.
@return The elevation as a {@link PendingResult}. | [
"public static PendingResult<ElevationResult> getByPoint(GeoApiContext context, LatLng location) {\n return context.get(API_CONFIG, SingularResponse.class, \"locations\", location.toString());\n }"
] | [
"function(terria, url) {\n DataSourceCatalogItem.call(this, terria);\n\n this._dataSource = undefined;\n this._readyData = undefined;\n\n this.url = url;\n\n /**\n * Gets or sets the GeoJSON data, represented as a binary blob, object literal, or a Promise for one of those things.\n * If this property is se... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Compile Blade comments into valid PHP.
@param string $value
@return string | [
"protected function compileComments($value)\n {\n $pattern = sprintf('/%s--(.*?)--%s/s', $this->contentTags[0], $this->contentTags[1]);\n\n return preg_replace($pattern, '<?php /*$1*/ ?>', $value);\n }"
] | [
"func (s *StringCodeGenerator) Init() {\n\ts.Position = vm.Position{State: vm.NewState()}\n\ts.Lines = []string{\"(Exported by gocnc)\", \"G21G90\\n\"}\n}"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Draw draws this primitive onto the screen. | [
"func (t *Table) Draw(screen tcell.Screen) {\n\tt.Box.Draw(screen)\n\n\t// What's our available screen space?\n\tx, y, width, height := t.GetInnerRect()\n\tif t.borders {\n\t\tt.visibleRows = height / 2\n\t} else {\n\t\tt.visibleRows = height\n\t}\n\n\t// Return the cell at the specified position (nil if it doesn't... | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Resolve a plugin file to its full path.
@param string $file The theme file to find.
@throws RuntimeException when plugins are missing.
@return string The expanded path | [
"protected function _expandPlugin($file)\n {\n preg_match(self::PLUGIN_PATTERN, $file, $matches);\n if (empty($matches[1]) || empty($matches[2])) {\n throw new RuntimeException('Missing required parameters');\n }\n if (!CorePlugin::isLoaded($matches[1])) {\n thro... | [
"public static function autoload(string $className): void\n {\n $classPath = str_replace('\\\\', DS, $className);\n $path = $classPath . '.php';\n\n if ((@include $path) === false) {\n // if we fail to include a file, let's throw an exception so we can see where it happened - it'l... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Resolves token namespace.
@param RequestStack $requestStack
@return string | [
"private function resolveNamespace(RequestStack $requestStack = null)\n {\n if ($requestStack !== null && ($request = $requestStack->getMasterRequest())) {\n return $request->isSecure() ? 'https-' : '';\n }\n\n return !empty($_SERVER['HTTPS']) && 'off' !== strtolower($_SERVER['HTT... | [
"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 instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
set the value endtime The time when the scheduled task ends. Enter a value in seconds.
@param endtime value to set
@throws PageException | [
"public void setEndtime(Object endtime) throws PageException {\n\tif (StringUtil.isEmpty(endtime)) return;\n\tthis.endtime = DateCaster.toTime(pageContext.getTimeZone(), endtime);\n }"
] | [
"public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Converts a primitive data object into a primitive expression node.
@param primitiveData The primitive data object to convert. Must not be undefined.
@param location The node's source location.
@return The resulting primitive expression node. | [
"@Nullable\n public static PrimitiveNode convertPrimitiveDataToExpr(\n PrimitiveData primitiveData, SourceLocation location) {\n if (primitiveData instanceof StringData) {\n return new StringNode(primitiveData.stringValue(), QuoteStyle.SINGLE, location);\n } else if (primitiveData instanceof Boolea... | [
"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:"
} |
Deserialize this object from a POF stream.
@param reader POF reader to use
@throws IOException if an error occurs during deserialization | [
"public void readExternal(PofReader reader)\n throws IOException {\n super.readExternal(reader);\n setBinaryValue(\"value\", reader.readBinary(0));\n fReturnOld = reader.readBoolean(1);\n }"
] | [
"private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n // Get default form\n in.defaultReadObject();\n\n // Create new Archive\n final String name = this.name;\n final ZipImporter archive = ShrinkWrap.create(ZipImporter.class, name);\n\... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Apply a method on every element in the container, passing parameters to the call method one at a time, like `function.apply`. | [
"function(method, args){\n _.each(this._elements, function(elem){\n if (_.isFunction(elem[method])){\n elem[method].apply(elem, args || []);\n }\n });\n }"
] | [
"function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element i... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get the value for a code point as stored in the Trie2.
@param codePoint the code point
@return the value | [
"@Override\n public final int get(int codePoint) {\n int value;\n int ix;\n \n if (codePoint >= 0) {\n if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {\n // Ordinary BMP code point, excluding leading surrogates.\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Load shareDB entries from disk. Any entries held in memory are reset. | [
"func (s *shareDBV1) Load(filename string) *probe.Error {\n\ts.mutex.Lock()\n\tdefer s.mutex.Unlock()\n\n\t// Check if the db file exist.\n\tif _, e := os.Stat(filename); e != nil {\n\t\treturn probe.NewError(e)\n\t}\n\n\t// Initialize and load using quick package.\n\tqs, e := quick.NewConfig(newShareDBV1(), nil)\n... | [
"def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C... | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
This method is different in the two versions of _SharedRendererUtils. | [
"private static void log(FacesContext context, String msg, Exception e)\n {\n context.getExternalContext().log(msg, e);\n }"
] | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// New returns a new instance of ImageAPIServer from the given config. | [
"func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget) (*ImageAPIServer, error) {\n\tgenericServer, err := c.GenericConfig.New(\"image.openshift.io-apiserver\", delegationTarget)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ts := &ImageAPIServer{\n\t\tGenericAPIServer: genericServer,\... | [
"@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 comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
// UnmarshalMap is an alias for Unmarshal which unmarshals from
// a map of AttributeValues.
//
// The output value provided must be a non-nil pointer | [
"func UnmarshalMap(m map[string]*dynamodb.AttributeValue, out interface{}) error {\n\treturn NewDecoder().Decode(&dynamodb.AttributeValue{M: m}, out)\n}"
] | [
"func (re RawExtension) MarshalJSON() ([]byte, error) {\n\tif re.Raw == nil {\n\t\t// TODO: this is to support legacy behavior of JSONPrinter and YAMLPrinter, which\n\t\t// expect to call json.Marshal on arbitrary versioned objects (even those not in\n\t\t// the scheme). pkg/kubectl/resource#AsVersionedObjects and ... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 (step 1) | [
"func (r RouterJSR311) detectDispatcher(requestPath string, dispatchers []*WebService) (*WebService, string, error) {\n\tfiltered := &sortableDispatcherCandidates{}\n\tfor _, each := range dispatchers {\n\t\tmatches := each.pathExpr.Matcher.FindStringSubmatch(requestPath)\n\t\tif matches != nil {\n\t\t\tfiltered.ca... | [
"private static function setCapabilities($capabilities) {\n\n $supported_capabilities = array(\n 'xmlrpc' => array('http://www.xmlrpc.com/spec', 1),\n 'system.multicall' => array('http://www.xmlrpc.com/discuss/msgReader$1208', 1),\n 'introspection' => array('http://phpxmlrpc.... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Defines a Storable prepare method, which assumes that a support field
exists and a single-argument constructor exists which accepts a support
instance.
@param cf file to which to add the prepare method
@since 1.2 | [
"public static void definePrepareMethod(ClassFile cf,\r\n Class storableClass,\r\n TypeDesc supportCtorType,\r\n String supportFieldName,\r\n TypeDe... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *StatusCodes) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"StatusCodes\"}\n\tif s.Items == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Items\"))\n\t}\n\tif s.Items != nil && len(s.Items) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Items\", 1))\n\t}\... | [
"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:"
} |
Sets the pen color to be used when drawing this node as disabled.
:param color | <QColor> | [
"def setDisabledPenColor(self, color):\n \n color = QColor(color)\n if self._palette is None:\n self._palette = XNodePalette(self._scenePalette)\n \n self._palette.setColor(self._palette.Disabled,\n self._palette.NodeForeground,\n ... | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns true if all characters in the string are contained within the set. | [
"public boolean containsAll(CharSequence str) {\n final int n = str.length();\n for (int i = 0; i < n; ++i) {\n if (!contains(str.charAt(i))) {\n return false;\n }\n }\n return true;\n }"
] | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Store data
@param mixed $data Object to store
@param string $id Cache id
@param int $timeToLive Time to live in seconds
@return boolean true if no problem | [
"protected function _store($data, $id, $timeToLive)\n {\n if (zend_disk_cache_store($this->_options['namespace'] . '::' . $id,\n $data,\n $timeToLive) === false) {\n $this->_log('Store operation failed.');\n return fal... | [
"function MetaData() {\n\n // the key for the storing\n this.key = null;\n // data to store\n this.value = null;\n // temporary filename for the cached file because filenames cannot represend urls completely\n this.filename = null;\n // expirydate of the entry\n this.expires = null;\n // ... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
This method verifies that the given {@code value} is {@link #isContained(Object) contained in this range} .
@param value is the value to check.
@throws ValueOutOfRangeException if not {@link #isContained(Object) contained}. | [
"public void verifyContained(V value) throws ValueOutOfRangeException {\n\n if (!isContained(value)) {\n throw new ValueOutOfRangeException(null, value, this.min, this.max);\n }\n }"
] | [
"public void assertExactlyOneDefined(final String param1, final String param2) {\n // Asserting that exactly one is defined is the same as asserting that they do not have the same\n // value for definedness.\n if (isPresent(param1) == isPresent(param2)) {\n throw new ParameterException(\n Str... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Search "mapping from" for knowledge. | [
"def search_list(kb, from_=None, match_type=None,\n page=None, per_page=None, unique=False):\n \"\"\"\"\"\"\n # init\n page = page or 1\n per_page = per_page or 10\n\n if kb.kbtype == models.KnwKB.KNWKB_TYPES['written_as']:\n # get the base query\n ... | [
"def process(self, candidates):\n \n for c in candidates[:]:\n if c.locator not in self.good_locators:\n # TODO: search string, i.e. find \"EU_Street_Name\" in \"EU_Street_Name.GBR_StreetName\"\n candidates.remove(c)\n\n return candidates"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
类内方差
@param docs
@param centroid
@return | [
"private float calculateClusterQuality (ArrayList<Instance> docs,\r\n\t\t\tHashSparseVector centroid) {\r\n\t\tfloat quality = 0.0f;\r\n\t\tHashSparseVector c = centroid;\r\n\r\n\t\tfor (int i = 0; i < docs.size(); ++i) {\r\n\t\t\tInstance doc = docs.get(i);\r\n\r\n\t\t\tquality += c.distanceEuclidean((HashSparseVe... | [
"def forward_word(self, e): # (M-f)\r\n \"\"\"\r\n self.l_buffer.forward_word(self.argument_reset)\r\n self.finalize()"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Yields chunks of the response body to the block. | [
"def stream_body(response, &block)\n response.body.each(&block)\n rescue => exception\n request_error!(exception)\n ensure\n response.connection.close unless @client.persistent?\n end"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Execute the console command.
@param \Laravel\Horizon\SupervisorFactory $factory
@return int | [
"public function handle(SupervisorFactory $factory)\n {\n $supervisor = $factory->make(\n $this->supervisorOptions()\n );\n\n try {\n $supervisor->ensureNoDuplicateSupervisors();\n } catch (Exception $e) {\n $this->error('A supervisor with this name is... | [
"public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }"
] | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Construct an import object from a string. | [
"def from_str(cls, s):\n \"\"\"\"\"\"\n ast_obj = ast.parse(s).body[0]\n if not isinstance(ast_obj, cls._expected_ast_type):\n raise AssertionError(\n 'Expected ast of type {!r} but got {!r}'.format(\n cls._expected_ast_type,\n ast... | [
"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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get project name. | [
"def _get_project_name(args):\n \n name = args.get(0)\n puts(\"\")\n while not name:\n name = raw_input(\"What is the project's short directory name? (e.g. my_project) \")\n return name"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
SimpleXMLElement to array
@ignore | [
"private static function _toArray($data, $recursion = false)\n {\n $tmp = array();\n $data = (array) $data;\n foreach ($data as $k => $v) {\n $v = (array) $v;\n if (isset($v[0]) && is_string($v[0])) {\n $tmp[$k] = $v[0];\n } else {\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SerfDefaultConfig returns a Consul-flavored Serf default configuration,
// suitable as a basis for a LAN, WAN, segment, or area. | [
"func SerfDefaultConfig() *serf.Config {\n\tbase := serf.DefaultConfig()\n\n\t// This effectively disables the annoying queue depth warnings.\n\tbase.QueueDepthWarning = 1000000\n\n\t// This enables dynamic sizing of the message queue depth based on the\n\t// cluster size.\n\tbase.MinQueueDepth = 4096\n\n\t// This ... | [
"func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}"
] | codesearchnet | {
"query": "Represent the post about network configuration:",
"pos": "Represent the code about network configuration:",
"neg": "Represent the code about programming:"
} |
Creates the HTML for the error message if validation errors were found.<p>
@return the HTML for the error message if validation errors were found | [
"protected String createDialogErrorMessage() {\n\n if (getException() != null) {\n StringBuffer result = new StringBuffer(8);\n result.append(dialogBlockStart(\"\"));\n result.append(\"<table border=\\\"0\\\">\\n\");\n result.append(\"<tr><td><img src=\\\"\");\n ... | [
"function(){\n\n this.manifest = {\n apiEventType: '',\n apiModelId: '', // this is the id for this module \n routeBase: '', // this can be overwritten\n routes: [\n ],\n routeErrorMessages: {\n conditions: 'No query conditions were specified',\n query: 'Error querying for item(s): ',\... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
// NewUpdateRegistrationArgs initializes UpdateRegistrationArgs with the required arguments. | [
"func NewUpdateRegistrationArgs(scopeURL string) *UpdateRegistrationArgs {\n\targs := new(UpdateRegistrationArgs)\n\targs.ScopeURL = scopeURL\n\treturn args\n}"
] | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Simplified method form for invoking the ListTaskDefinitions operation with an AsyncHandler.
@see #listTaskDefinitionsAsync(ListTaskDefinitionsRequest, com.amazonaws.handlers.AsyncHandler) | [
"@Override\n public java.util.concurrent.Future<ListTaskDefinitionsResult> listTaskDefinitionsAsync(\n com.amazonaws.handlers.AsyncHandler<ListTaskDefinitionsRequest, ListTaskDefinitionsResult> asyncHandler) {\n\n return listTaskDefinitionsAsync(new ListTaskDefinitionsRequest(), asyncHandler);\... | [
"public Operation setSchedulingOptions(SchedulingOptions scheduling, OperationOption... options) {\n return compute.setSchedulingOptions(getInstanceId(), scheduling, options);\n }"
] | codesearchnet | {
"query": "Represent the sentence about Cloud Foundry API:",
"pos": "Represent the code about Cloud Foundry API:",
"neg": "Represent the code:"
} |
// ArgsFrom make arguments for command-line flag from configuration file. | [
"func ArgsFrom(conf string, positions ...string) ([]string, error) {\n\tif _, err := os.Stat(conf); err != nil {\n\t\treturn nil, err\n\t}\n\treturn parse(conf, positions...)\n}"
] | [
"def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi... | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Setup wilcard routing
@return void | [
"public function registerWildcard()\n {\n // Setup a wildcarded catch all route\n Route::any('{path}', ['as' => 'decoy::wildcard', function ($path) {\n\n // Remember the detected route\n App::make('events')->listen('wildcard.detection', function ($controller, $action) {\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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
/*
(non-Javadoc)
@see
org.exoplatform.services.jcr.ext.app.SessionProviderService#removeSessionProvider(java.lang
.Object) | [
"public void removeSessionProvider(Object key)\n {\n if (providers.containsKey(key))\n {\n getSessionProvider(key).close();\n providers.remove(key);\n }\n\n if (systemProviders.containsKey(key))\n {\n systemProviders.get(key).close();\n systemProviders.remo... | [
"@Override\n\t@Deprecated\n\tpublic DataSource dataSourceByName(String dbName) {\n\t\treturn new com.danidemi.jlubricant.embeddable.BasicDataSource(\n\t\t\t\tdbByName(dbName));\n\t}"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software Development:"
} |
@param string|array|PageInterface $page
@return PageInterface|null | [
"public function addPage($page)\n {\n if (is_array($page)) {\n $page = static::makePage($page);\n } elseif (is_string($page) or is_null($page)) {\n $title = $page;\n\n $page = app(PageInterface::class);\n $page->setTitle($title);\n }\n\n if ... | [
"function Render()\n {\n if (!self::Guard()->Allow(Action::Read(), $this->content))\n {\n return '';\n }\n ContentTranslator::Singleton()->SetContent($this->content);\n $module = ClassFinder::CreateFrontendModule($this->content->GetType());\n $module->SetTreeI... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// PrometheusCollectors satisfies the prom.PrometheusCollector interface. | [
"func (m *compactionMetrics) PrometheusCollectors() []prometheus.Collector {\n\treturn []prometheus.Collector{\n\t\tm.Compactions,\n\t\tm.CompactionsActive,\n\t\tm.CompactionDuration,\n\t\tm.CompactionQueue,\n\t}\n}"
] | [
"func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github instruction about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code:"
} |
Set the time at which the resource was last modified.
@param lastModified the lastModified value to set
@return the PoolListUsageMetricsHeaders object itself. | [
"public PoolListUsageMetricsHeaders withLastModified(DateTime lastModified) {\n if (lastModified == null) {\n this.lastModified = null;\n } else {\n this.lastModified = new DateTimeRfc1123(lastModified);\n }\n return this;\n }"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Args:
from_db (bool): Check changes against actual db data
Returns:
list: List of fields names which their values changed. | [
"def changed_fields(self, from_db=False):\n \n if self.exist:\n current_dict = self.clean_value()\n # `from_db` attr is set False as default, when a `ListNode` is\n # initialized just after above `clean_value` is called. `from_db` flags\n # in 'list node set... | [
"def reflect_filter(sources, model, cache=None):\n '''\n '''\n targets = [reflect(source, model, cache=cache) for source in sources]\n # Some objects may not be available in target DB (not published), so we\n # have to exclude None from the list.\n return [target for target in targets if target is... | codesearchnet | {
"query": "Represent the Github text about Data transformation:",
"pos": "Represent the Github code about Data transformation:",
"neg": "Represent the Github code about programming:"
} |
Primary method to handle logging.
@param mixed $message String or Exception object containing the message to log.
@param integer $severity The numeric severity. Defaults to null so that no
assumptions are made about the logging backend. | [
"public function log($message, $severity = null)\n {\n if (is_null($this->logger)) {\n $this->logger = LogManager::getLogger('propel');\n }\n\n switch ($severity) {\n case 'crit':\n $method = 'fatal';\n break;\n case 'err':\n ... | [
"function LoggerContext() {\n LifeCycle.call(this);\n\n /**\n * Context start time\n */\n this.startTime = new Date();\n\n /**\n * The list of trace levels that the logger context knows about\n */\n this.logLevel = new LogLevel();\n\n /**\n * Root logger, final ancestor of all ... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// Transact invokes the (paid) contract method with params as input values. | [
"func (c *BoundContract) Transact(opts *TransactOpts, method string, args *Interfaces) (tx *Transaction, _ error) {\n\trawTx, err := c.contract.Transact(&opts.opts, method, args.objects...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Transaction{rawTx}, 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:"
} |
Try to verify build tools | [
"def pre_build_check():\n \n if os.environ.get('CASS_DRIVER_NO_PRE_BUILD_CHECK'):\n return True\n\n try:\n from distutils.ccompiler import new_compiler\n from distutils.sysconfig import customize_compiler\n from distutils.dist import Distribution\n\n # base build_ext just... | [
"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:"
} |
// GetTokens returns all tokens (machine provisioning ones and user invitation tokens). Machine
// tokens usually have "node roles", like auth,proxy,node and user invitation tokens have 'signup' role | [
"func (s *AuthServer) GetTokens(opts ...services.MarshalOption) (tokens []services.ProvisionToken, err error) {\n\t// get node tokens:\n\ttokens, err = s.Provisioner.GetTokens()\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\t// get static tokens:\n\ttkns, err := s.GetStaticTokens()\n\tif err != nil && ... | [
"func getEnterpriseResourceIter(context structs.Context, _ *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {\n\t// If we have made it here then it is an error since we have exhausted all\n\t// open source contexts.\n\treturn nil, fmt.Errorf(\"context mus... | codesearchnet | {
"query": "Represent the Github post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Software development:"
} |
Return rels item XML for source with *source_uri* or None if no rels
item is present. | [
"def rels_xml_for(self, source_uri):\n \n try:\n rels_xml = self.blob_for(source_uri.rels_uri)\n except KeyError:\n rels_xml = None\n return rels_xml"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Deletes a piece of image from specific side.
For example, if side=top and size=100, 100px from top will be deleted.
@param string $side Side to cut
@param int $size Pixels
@return ImageEditor this object | [
"public function decreaseSide($side, $size) {\n\t\t$x = $y = 1;\n\t\t$x2 = $this->width;\n\t\t$y2 = $this->height;\n\t\tswitch ($side) {\n\t\t\tcase 'top':\n\t\t\t\t$y = $size;\n\t\t\t\tbreak;\n\t\t\tcase 'right':\n\t\t\t\t$x2 -= $size;\n\t\t\t\tbreak;\n\t\t\tcase 'bottom':\n\t\t\t\t$y2 -= $size;\n\t\t\t\tbreak;\n\... | [
"function get_margin_width()\n {\n //ignore image width, use same width as on predefined bullet ListBullet\n //for proper alignment of bullet image and text. Allow image to not fitting on left border.\n //This controls the extra indentation of text to make room for the bullet image.\n ... | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Create a match for a list of domain objects which were retrieved by another query
@param domainObjects a list of domain objects which were retrieved by another query
@param domainObjectType the type of those domain objects
@return a DomainObjectMatch | [
"protected <T> DomainObjectMatch<T> createMatchForInternal(List<T> domainObjects,\n\t\t\tClass<T> domainObjectType) {\n\t\tDomainObjectMatch<T> ret = APIAccess.createDomainObjectMatch(domainObjectType,\n\t\t\t\tthis.queryExecutor.getDomainObjectMatches().size(),\n\t\t\t\tthis.queryExecutor.getMappingInfo());\n\t\tt... | [
"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 text about database:",
"pos": "Represent the code about database:",
"neg": "Represent the code about Software Development:"
} |
// Seek returns an Enumerator positioned on a an item such that k >= item's
// key. ok reports if k == item.key The Enumerator's position is possibly
// after the last item in the tree. | [
"func (t *Tree) Seek(k []byte) (e *Enumerator, ok bool) {\n\tq := t.r\n\tif q == nil {\n\t\te = btEPool.get(nil, false, 0, k, nil, t, t.ver)\n\t\treturn\n\t}\n\n\tfor {\n\t\tvar i int\n\t\tif i, ok = t.find(q, k); ok {\n\t\t\tswitch x := q.(type) {\n\t\t\tcase *x:\n\t\t\t\tq = x.x[i+1].ch\n\t\t\t\tcontinue\n\t\t\tc... | [
"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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.