query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
LOF算出は行わず、学習データモデルへのデータ追加のみを行う。
@param recievedPoint 受信データ
@param dataSet 学習モデルデータ | [
"protected void addDataWithoutCalculate(LofPoint recievedPoint, LofDataSet dataSet)\n {\n dataSet.addData(recievedPoint);\n\n // 中間データを保持する場合はデータ追加時に中間データの生成を行う。\n if (this.hasIntermediate)\n {\n LofCalculator.initDataSet(this.kn, dataSet);\n }\n }"
] | [
"public static double calculateLofWithUpdate(int kn, int max, LofPoint addedPoint,\n LofDataSet dataSet)\n {\n // データ数が最大に達している場合には古い方からデータの削除を行う\n String deleteId = addPointToDataSet(max, addedPoint, dataSet);\n\n // K距離、K距離近傍、局所到達可能密度の更新を行う対象点の一覧を取得する。\n Set<String> updat... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Grab IP from host
http://www.php.net/manual/en/function.gethostbyname.php#78965
@param string $address
@return mixed | [
"public static function lookUpHostIp($address)\n {\n\n $ipAddress = null;\n if (function_exists('dns_get_record')) {\n $records = dns_get_record(trim($address));\n foreach ($records as $record) {\n if ($record['type'] == 'A') {\n $ipAddress = ... | [
"final protected function fc($k = null, $d = null) {return dfak(\n\t\t/** 2017-12-12 @todo Should we care of a custom `config_path` or not? https://mage2.pro/t/5148 */\n\t\tdf_config_field($this->getPath())->getData(), $k, $d\n\t);}"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
// UnmarshalJSON sets the object from the provided JSON representation | [
"func (l *Route53HealthCheckAlarmIDentifierList) UnmarshalJSON(buf []byte) error {\n\t// Cloudformation allows a single object when a list of objects is expected\n\titem := Route53HealthCheckAlarmIDentifier{}\n\tif err := json.Unmarshal(buf, &item); err == nil {\n\t\t*l = Route53HealthCheckAlarmIDentifierList{item}... | [
"@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:"
} |
Websocket upgrade as ``on_headers`` event. | [
"def on_headers(self, response, exc=None):\n ''''''\n\n if response.status_code == 101:\n connection = response.connection\n request = response.request\n handler = request.websocket_handler\n if not handler:\n handler = WS()\n parse... | [
"def push(self):\r\n \"\"\"\"\"\"\r\n print `request.body`\r\n yield request.environ['cogen.call'](pubsub.publish)(\r\n \"%s: %s\" % (session['client'].name, request.body)\r\n )\r\n # the request.environ['cogen.*'] objects are the the asynchronous\r\n # make the ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
@param string $structure
@return bool | [
"public static function validate($structure)\n {\n if (12 !== strlen($structure)\n ) {\n return false;\n }\n\n $sequences = substr($structure, 0, 10);\n $key = substr($structure, -2);\n $control = $sequences % 97; // final control must be a 2-digits:\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns an OrderedDict containing observations [(name_string, np.array), ...].
Important keys:
robot-state: contains robot-centric information. | [
"def _get_observation(self):\n \n di = super()._get_observation()\n # proprioceptive features\n di[\"joint_pos\"] = np.array(\n [self.sim.data.qpos[x] for x in self._ref_joint_pos_indexes]\n )\n di[\"joint_vel\"] = np.array(\n [self.sim.data.qvel[x] fo... | [
"function(dvi, di) {\n var dim = msg.structure.dimensions.observation[di];\n // Calculate the key position for the dimension index\n var pos = dimPosition(dim);\n // Update the obskey with the dimension value\n obsKey[pos] = dim.values[dvi].id;\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
This method will try to find a price based on the unique constraint defined in price.
@param PriceInterface $searchPrice
@return PriceInterface|null | [
"protected function findPrice(PriceInterface $searchPrice): ?PriceInterface\n {\n foreach ($this->prices as $price) {\n if ($price->getAmount() == $searchPrice->getAmount() && $price->getB2bGroupId() == $searchPrice->getB2bGroupId() && $price->getCurrency()->getId() == $searchPrice->getCurrency... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
// FromEnv uses the environment to create a new Me.
//
// To use this, a client MUST be running inside of a Pod environment. It uses
// a combination of environment variables and file paths to determine
// information about the cluster. | [
"func FromEnv() (*Me, error) {\n\thost := os.Getenv(\"KUBERNETES_SERVICE_HOST\")\n\tport := os.Getenv(\"KUBERNETES_SERVICE_PORT\")\n\tname := NameFromEnv()\n\n\t// FIXME: Better way? Probably scanning secrets for\n\t// an SSL cert would help?\n\tproto := \"https\"\n\n\turl := proto + \"://\" + host + \":\" + port\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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Returns all <code>application-exception</code> elements
@return list of <code>application-exception</code> | [
"public List<ApplicationExceptionType<AssemblyDescriptorType<T>>> getAllApplicationException()\n {\n List<ApplicationExceptionType<AssemblyDescriptorType<T>>> list = new ArrayList<ApplicationExceptionType<AssemblyDescriptorType<T>>>();\n List<Node> nodeList = childNode.get(\"application-exception\");\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
$ANTLR start "COMMENT" | [
"public final void mCOMMENT() throws RecognitionException {\n try {\n int _type = COMMENT;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /home/victor/srec/core/src/main/antlr/srec.g:155:2: ( '#' ( . )* NEWLINE )\n // /home/victor/srec/core/src/main/antlr/srec.g:155:... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// processResponse processes header download request responses, returns true if successful | [
"func (f *lightFetcher) processResponse(req fetchRequest, resp fetchResponse) bool {\n\tif uint64(len(resp.headers)) != req.amount || resp.headers[0].Hash() != req.hash {\n\t\treq.peer.Log().Debug(\"Response content mismatch\", \"requested\", len(resp.headers), \"reqfrom\", resp.headers[0], \"delivered\", req.amoun... | [
"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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about File management:"
} |
can either start with "(" or anything else if it started with "(" it ends with ")" if it didn't start with "(" it ends with undefined | [
"function pathExpressions (token, tokens) {\n const expressions = []\n token = tokens.shift()\n while (true) {\n if (!token) {\n throw new Error(`A path expression should end with \")\"`)\n }\n if (token === ')') {\n break\n }\n expressions.push(pathExpression(token, tokens))\n token ... | [
"def get_quoted_strings(quoted_string):\n '''\n \n '''\n try:\n # This regex grabs all quoted data from string.\n # Note that this gets everything in between the first and last double quote.\n # This is intentional, as printed (and quoted) strings from a target file may contain\n ... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
// SetLogBucket sets the LogBucket field's value. | [
"func (s *AssociateDRTLogBucketInput) SetLogBucket(v string) *AssociateDRTLogBucketInput {\n\ts.LogBucket = &v\n\treturn s\n}"
] | [
"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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Return the attribute name part without device name It is able to resolve attribute alias before
@param fullname
@return
@throws DevFailed | [
"public static String getAttributeName(final String fullname) throws DevFailed {\n final String s = TangoUtil.getfullAttributeNameForAttribute(fullname);\n return s.substring(s.lastIndexOf('/') + 1);\n }"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// Lookup an implicit team by name like "alice,bob+bob@twitter (conflicted copy 2017-03-04 #1)"
// Resolves social assertions. | [
"func LookupImplicitTeamAndConflicts(ctx context.Context, g *libkb.GlobalContext, displayName string, public bool, opts ImplicitTeamOptions) (\n\tteam *Team, teamName keybase1.TeamName, impTeamName keybase1.ImplicitTeamDisplayName, conflicts []keybase1.ImplicitTeamConflictInfo, err error) {\n\timpName, err := Resol... | [
"def check(path=None, env='default'):\n \n # TODO: add files=<list of files> to check only a subset...\n # also useful for 'quilt build' to exclude certain files?\n # (if not, then require dry_run=True if files!=None/all)\n build(\"dry_run/dry_run\", path=path, dry_run=True, env=env)"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Adds full new case. | [
"public final PCB aCase(@Nonnull Case<P, F> theCase) {\n cases.add(theCase);\n return self();\n }"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// SetFields sets the Fields field's value. | [
"func (s *DescribeDocumentVersionsInput) SetFields(v string) *DescribeDocumentVersionsInput {\n\ts.Fields = &v\n\treturn s\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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// hasObservers checks the provided address to see if it has observers.
// If so, it returns the voting server address, the observer address, and true.
// Otherwise, it returns false. | [
"func hasObservers(serverAddr string) (string, string, bool) {\n\tif i := strings.Index(serverAddr, \"|\"); i != -1 {\n\t\treturn serverAddr[:i], serverAddr[i+1:], true\n\t}\n\treturn \"\", \"\", false\n}"
] | [
"function createGraph(options) {\n // Graph structure is maintained as dictionary of nodes\n // and array of links. Each node has 'links' property which\n // hold all links related to that node. And general links\n // array is used to speed up all links enumeration. This is inefficient\n // in terms of memory,... | codesearchnet | {
"query": "Represent the Github summarization about Networking:",
"pos": "Represent the Github code about Networking:",
"neg": "Represent the Github code:"
} |
/*
Returns true if these two automata accept exactly the same language.
This is a costly computation! Note also that a1 and a2 will be
determinized as a side effect.
*/ | [
"func sameLanguage(a1, a2 *Automaton) bool {\n\tif a1 == a2 {\n\t\treturn true\n\t}\n\treturn subsetOf(a2, a1) && subsetOf(a1, a2)\n}"
] | [
"def check_next_match(self, match, new_relations, subject_graph, one_match):\n \"\"\"\"\"\"\n # only returns true for ecaxtly one set of new_relations from all the\n # ones that are symmetrically equivalent\n if not (self.criteria_sets is None or one_match):\n for check in sel... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get CSRF cookie value
@return string
@throws SecureRequestHelper\CSRFException Thrown if the CSRF layer has not been initialized | [
"public function getCSRFCookie()\n\t{\n\t\t$cookie = $this->_browserInterface->getCookie($this->_csrf_cookiename);\n\t\tif ( !$cookie )\n\t\t\tthrow new SecureRequestHelper\\CSRFException('CSRF cookie has not been initialized');\n\t\t\n\t\treturn $cookie;\n\t}"
] | [
"public function getRefreshToken()\n {\n if ($this->has('refresh_token')) {\n $token = $this->get('refresh_token');\n\n return Crypt::decrypt($token);\n }\n\n throw new MissingRefreshTokenException(sprintf('No refresh token stored in current session. Verify you have add... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Adds Lineages to Skill
@param mixed $id
@param mixed $data
@return PayloadInterface | [
"public function addLineages($id, $data) {\n\t\t// find\n\t\t$model = $this->get($id);\n\n\t\tif ($model === null) {\n\t\t\treturn new NotFound(['message' => 'Skill not found.']);\n\t\t}\n\n\t\t// pass add to internal logic\n\t\ttry {\n\t\t\t$this->doAddLineages($model, $data);\n\t\t} catch (ErrorsException $e) {\n... | [
"protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// TooManyRequests writes a response with status code 429. | [
"func TooManyRequests(w http.ResponseWriter, response interface{}) {\n\tRespond(w, http.StatusTooManyRequests, response)\n}"
] | [
"private boolean isCloudantAuthError(Response response) {\n String server = response.header(\"Server\");\n // Cloudant could send `CouchDB/ad97a06 (Erlang OTP/17)` as Server header value\n // Another cloudant server value example: `CouchDB/1.0.2`\n if (server == null || server.indexOf(\"... | codesearchnet | {
"query": "Represent the Github summarization about Web development:",
"pos": "Represent the Github code about Web development:",
"neg": "Represent the Github code:"
} |
Given a string and its encoding, decodes the string into Unicode.
%encoding is a string recognized by encodings.aliases | [
"def _to_unicode(self, data, encoding, errors='strict'):\n ''''''\n\n # strip Byte Order Mark (if present)\n if (len(data) >= 4) and (data[:2] == '\\xfe\\xff') and (data[2:4] != '\\x00\\x00'):\n encoding = 'utf-16be'\n data = data[2:]\n elif (len(data) >= 4) and (data[:2] == '\\xff\\xfe') ... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// modelConfigSources returns a slice of named model config
// sources, in hierarchical order. Starting from the first source,
// config is retrieved and each subsequent source adds to the
// overall config values, later values override earlier ones. | [
"func modelConfigSources(st *State, regionSpec *environs.CloudRegionSpec) []modelConfigSource {\n\treturn []modelConfigSource{\n\t\t{config.JujuDefaultSource, st.defaultInheritedConfig(regionSpec.Cloud)},\n\t\t{config.JujuControllerSource, st.controllerInheritedConfig(regionSpec.Cloud)},\n\t\t{config.JujuRegionSour... | [
"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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Convert Unicode to Wylie: one tsekbar | [
"function toWylieOneTsekbar(str, len, i) {\n\tvar orig_i = i;\n\tvar warns = [];\n\tvar stacks = [];// ArrayList<ToWylieStack>;\n\tITER: \n\twhile (true) {\n\t\tvar st = toWylieOneStack(str, len, i);\n\t\tstacks.push(st);\n\t\twarns = warns.concat(st.warns);\n\t\ti += st.tokens_used;\n\t\tif (st.visarga) break ITER... | [
"public static function getFingerprint($hashAlgo = 'sha256') {\n return hash($hashAlgo,\n '#QramRAN7*s%6n%@x*53jVVPsnrz@5MY$49o^mhJ8HqY%3a09yJnSWg9lBl$O4CKUb&&S%EgYBjhUZEbhquw$keCjR6I%zMcA!Qr' .\n self::get($_SERVER['HTTP_USER_AGENT']) .\n ... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Checks if all the proper config has been prvided. | [
"private function _checkLayerConfig()\n {\n $errorString = array();\n if ($this->_providerID == '') {\n array_push($errorString, 'LAYER_PROVIDER_ID');\n }\n\n if ($this->_keyID == '') {\n array_push($errorString, 'LAYER_PRIVATE_KEY_ID');\n }\n\n if ... | [
"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 Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Add attribute.
@param name Attribute name
@param value Attribute value | [
"public T attr(String name, String value) throws IOException {\r\n\t\tif (value != null) {\r\n\t\t\twriter.write(' ');\r\n\t\t\twriter.write(name);\r\n\t\t\twriter.write(\"=\\\"\");\r\n\t\t\twriter.write(value);\r\n\t\t\twriter.write('\\\"');\r\n\t\t}\r\n\t\treturn (T) this;\r\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 Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Process a server request and return a response.
@param ServerRequestInterface $request
@param DelegateInterface $delegate
@return ResponseInterface | [
"public function process(ServerRequestInterface $request, DelegateInterface $delegate)\n {\n $uriPath = $request->getUri()->getPath();\n\n /** @var Description $description */\n foreach ($this->repository as $description) {\n\n $basePath = $description->getBasePath() ? \"{$descrip... | [
"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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Executes a task within a read-only transaction. Any exception rolls back the transaction and gets rethrown as a RuntimeException. | [
"public <T, F> T doReadOnly(F facility, Task<T, F> task) {\r\n return doTransaction(facility, task, _readonly);\r\n }"
] | [
"@Override\n public DataFrameRecord<T> getNext() throws DataCorruptionException, DurableDataLogException {\n Exceptions.checkNotClosed(this.closed, closed);\n\n try {\n while (!this.dataFrameInputStream.isClosed()) {\n try {\n if (!this.dataFrameInputStr... | codesearchnet | {
"query": "Represent the instruction about Database management:",
"pos": "Represent the code about Database management:",
"neg": "Represent the code about Software development:"
} |
Get the previous item in any particular category | [
"def _previous(self, **kwargs):\n \n spec = self._pagination_default_spec(kwargs)\n spec.update(kwargs)\n\n query = queries.build_query(spec)\n query = queries.where_before_entry(query, self._record)\n\n for record in query.order_by(orm.desc(model.Entry.local_date),\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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param array ...$args
@throws \BadMethodCallException
@return mixed | [
"private function eval(...$args)\n {\n $return = $this->client->eval(...$args);\n\n if ($this->client->getLastError()) {\n throw new \\BadMethodCallException($this->client->getLastError());\n }\n\n return $return;\n }"
] | [
"static function parseWith($optionsResource, array $_ = null)\n {\n if (!static::isConfigurableWith($optionsResource))\n throw new \\InvalidArgumentException(sprintf(\n 'Invalid Configuration Resource provided on (%s); given: (%s).'\n , static::class, \\Poirot\\Std... | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
This method will return a list of records for a specific page.
@param pageNumber page number to return. This is indexed at 1, not 0. Any value below 1 is illegal and will
be rejected.
@return list of records that match a query make up a "page". | [
"public LazyList<T> getPage(int pageNumber) {\n\n if (pageNumber < 1) throw new IllegalArgumentException(\"minimum page index == 1\");\n\n try {\n LazyList<T> list = find(query, params).offset((pageNumber - 1) * pageSize).limit(pageSize);\n if (orderBys != null) {\n ... | [
"def count(self):\n \n # Save the existing rows and start parameters to see how many results were actually expected\n _rows = self._solr_params.get('rows', None)\n _start = self._solr_params.get('start', 0)\n if not self._solr_cache:\n # Get the count for everything\n ... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Set lastUser.
@param int|object $lastUser
@return $this | [
"public function setLastUser($lastUser)\n {\n if (\\is_object($lastUser)) {\n $this->lastUserObject = $lastUser;\n $this->lastUser = $lastUser->getId();\n } else {\n $this->lastUserObject = null;\n $this->lastUser = $lastUser;\n }\n\n ... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
A negated query is one in which every clause has a presence of
prohibited. These queries require some special processing to return
the expected results. | [
"def is_negated(self):\n \n return all(\n clause.presence == QueryPresence.PROHIBITED for clause in self.clauses\n )"
] | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
GdDriver::save
Save an image.
@param string $imageTargetFilePath
@param int $quality
@return bool | [
"public function save($imageTargetFilePath, $quality = 100)\r\n {\r\n $resampleImageResource =& $this->getResampleImageResource();\r\n\r\n $extension = pathinfo($imageTargetFilePath, PATHINFO_EXTENSION);\r\n\r\n switch ($extension) {\r\n case 'jpg':\r\n case 'jpeg':\r\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 comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
// GetScancodeFromName returns a scancode from a human-readable name.
// (https://wiki.libsdl.org/SDL_GetScancodeFromName) | [
"func GetScancodeFromName(name string) Scancode {\n\t_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(_name))\n\treturn (Scancode)(C.SDL_GetScancodeFromName(_name))\n}"
] | [
"func GameControllerGetStringForButton(btn GameControllerButton) string {\n\treturn C.GoString(C.SDL_GameControllerGetStringForButton(btn.c()))\n}"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Return a list of external values that are read by the definition.
@param def
@param ctxt
The context in which to evaluate the expressions.
@return A list of values read. | [
"public ValueList getValues(PDefinition def, ObjectContext ctxt)\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn def.apply(af.getValuesDefinitionLocator(), ctxt);\n\t\t} catch (AnalysisException e)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t}"
] | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
adheres to the list of given choices for the param in the options (if any are defined) | [
"private void checkChoices(Option o, Map<String, String> data) throws RequiredParametersException {\n\t\tif (o.getChoices().size() > 0 && !o.getChoices().contains(data.get(o.getName()))) {\n\t\t\tthrow new RequiredParametersException(\"Value \" + data.get(o.getName()) +\n\t\t\t\t\t\" is not in the list of valid cho... | [
"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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Get information about all Koji channels.
:param **kwargs: keyword args to pass through to listChannels RPC.
:returns: deferred that when fired returns a list of Channel objects. | [
"def listChannels(self, **kwargs):\n \n data = yield self.call('listChannels', **kwargs)\n channels = []\n for cdata in data:\n channel = Channel.fromDict(cdata)\n channel.connection = self\n channels.append(channel)\n defer.returnValue(channels)"
... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
<p>
Encryption context to use when the data is reencrypted.
</p>
@param destinationEncryptionContext
Encryption context to use when the data is reencrypted.
@return Returns a reference to this object so that method calls can be chained together. | [
"public ReEncryptRequest withDestinationEncryptionContext(java.util.Map<String, String> destinationEncryptionContext) {\n setDestinationEncryptionContext(destinationEncryptionContext);\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 Encryption:",
"pos": "Represent the code about Encryption:",
"neg": "Represent the code about Software development:"
} |
Based on cqlengine.models.BaseModel._get_column.
But to work with 'pk' | [
"def _get_column(cls, name):\n \n if name == 'pk':\n return cls._meta.get_field(cls._meta.pk.name)\n return cls._columns[name]"
] | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Generate domain date in format <code>'yyyy-MM'</code>.
@param domainDate
the domain date
@return generated domain date in format <code>'yyyy-MM'</code>; e.g. <code>'2010-04'</code> | [
"public static String generateDomainDate(final Date domainDate) {\n if (domainDate == null) {\n throw new SwidException(\"domainDate isn't defined\");\n }\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM\");\n return dateFormat.format(domainDate);\n }"
] | [
"def validate_format_iso8601(validator, fieldname, value, format_option):\n \n try:\n iso8601.parse_date(value)\n except ValueError:\n raise ValidationError(\n \"Value %(value)r of field '%(fieldname)s' is not in \"\n \"'iso8601 YYYY-MM-DDThh:mm:ss(+/-)hh:mm' format\" % ... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
This method is called by CAS_Client::CAS_Client() when running in callback
mode. It stores the PGT and its PGT Iou, prints its output and halts.
@return void | [
"private function _callback()\n {\n phpCAS::traceBegin();\n if (preg_match('/^PGTIOU-[\\.\\-\\w]+$/', $_GET['pgtIou'])) {\n if (preg_match('/^[PT]GT-[\\.\\-\\w]+$/', $_GET['pgtId'])) {\n $this->printHTMLHeader('phpCAS callback');\n $pgt_iou = $_GET['pgtIou']... | [
"@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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
remove an event listener for progress or seeded-ness | [
"function (name, cb) {\n var i, j, cbs=this._callbacks[name], jsTemp=[];\n\n /* I'm not sure if this is necessary; in C++, iterating over a\n * collection and modifying it at the same time is a no-no.\n */\n\n for (j in cbs) {\n if (cbs.hasOwnProperty(j) && cbs[j] === cb) {\n jsTemp.pus... | [
"def buffer_leave(self, filename):\n \"\"\"\"\"\"\n self.log.debug('buffer_leave: %s', filename)\n # TODO: This is questionable, and we should use location list for\n # single-file errors.\n self.editor.clean_errors()"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
parse spec
@param {any} spec
@returns | [
"function parseSwitch (spec) {\n const select = spec.select\n const defaultStatement = parseDefaultStatement(spec.id, select)\n return {\n cases: parseCaseStatements(select),\n default: createReducer(defaultStatement)\n }\n}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
@param string $interfaceName
@param bool $includeSelf
@return bool | [
"function extendsOrImplementsInterface($interfaceName, $includeSelf) {\n $interfacesAll = $this->getAllInterfaces($includeSelf);\n return isset($interfacesAll[$interfaceName]);\n }"
] | [
"static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
initialize values.
@param factory constraint validator factory to set
@param messageInterpolator message interpolator to set
@param traversableResolver traversable resolver to set
@param pparameterNameProvider parameter resolver to set | [
"public void init(final ConstraintValidatorFactory factory,\n final MessageInterpolator messageInterpolator, final TraversableResolver traversableResolver,\n final ParameterNameProvider pparameterNameProvider) {\n contraintValidatorFactory = factory;\n this.messageInterpolator = messageInterpolator;... | [
"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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Format the date when, e.g. Friday 14th of April 2011 | [
"def dateFormat(when):\n \n retval = \"\"\n if when is not None:\n dow = dateformat.format(when, \"l\")\n dom = dateformat.format(when, \"jS\")\n month = dateformat.format(when, \"F\")\n if when.year != dt.date.today().year:\n retval = _(\"{weekday} {day} of {month} {... | [
"def gt=(gt)\n @gt = Array(gt).empty? ? [\"7:00 PM\"] : Array(gt)\n @gt.collect! do |gt|\n begin\n DateTime.parse(gt)\n rescue\n raise \"game times must be valid time representations in the string form (e.g. 3:00 PM, 11:00 AM, 18:20, etc)\"\n end\n end\n end... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Write to the standard output device with an end of line.
@param string $str
@return void | [
"public static function line( $str, $color = null, $background = null ) \n\t{\n\t\tif ( is_array( $str ) ) \n\t\t{\n\t\t\t$str = implode( PHP_EOL, $str );\n\t\t}\n\t\t\n\t\tstatic::write( $str.PHP_EOL, $color, $background );\n\t}"
] | [
"def append_line(self, new_line):\n \"\"\"\"\"\"\n # TODO: The user still has to write the raw line, this is error prone.\n self._write(('PGM', [Integer, String]), self.idx, new_line)"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Seek without raising any exception. This is for use in
{@code finally} clauses
@param positiveTargetPos a target position which must be positive | [
"private void seekQuietly(long positiveTargetPos) {\n try {\n seek(positiveTargetPos);\n } catch (IOException ioe) {\n LOG.debug(\"Ignoring IOE on seek of {} to {}\",\n uri, positiveTargetPos, ioe);\n }\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 description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Executes a set of actions, defined in pairs.
@param array actions
@return boolean | [
"public function execute($actions)\n\t{\n\t\tforeach ($actions as $func => $args)\n\t\t{\n\t\t\tif ( ! $this->$func($args))\n\t\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
{@inheritDoc}
@see jcifs.Encodable#encode(byte[], int) | [
"@Override\n public int encode ( byte[] dst, int dstIndex ) {\n int start = dstIndex;\n SMBUtil.writeInt8(this.allocationSize, dst, dstIndex);\n dstIndex += 8;\n SMBUtil.writeInt8(this.endOfFile, dst, dstIndex);\n dstIndex += 8;\n SMBUtil.writeInt4(this.numberOfLinks, ds... | [
"public PythonDataStream add_java_source(SourceFunction<Object> src) {\n\t\treturn new PythonDataStream<>(env.addSource(src).map(new AdapterMap<>()));\n\t}"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Enable one or several plugins. Will properly handle being passed a plugin that is already disabled
@param string|array $plugin,... a string, or several strings, or a single array of strings - The plugins to enable
@return $this | [
"public function disablePlugins($plugin)\n {\n $plugins = func_get_args();\n if (is_array(current($plugins))) {\n $plugins = current($plugins);\n }\n foreach ($plugins as $name) {\n unset($this->plugins[$name]);\n }\n return $this;\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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// Sets the is_mainchain field to false for the given block in the database. | [
"func (db *DB) setHeightToSideChain(height int64) error {\n\t_, err := db.Exec(db.setHeightToSideChainSQL, height)\n\treturn db.filterError(err)\n}"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Execute the content queries.
This is tightly coupled to $this->getContent()
@see $this->getContent()
@param array $decoded
@param array $parameters
@return array | [
"protected function executeGetContentSearch($decoded, $parameters)\n {\n $limit = 2000;\n $offset = 0;\n\n // set correct limit and offset if these are set.\n if (isset($decoded['parameters']['limit'])) {\n $limit = $decoded['parameters']['limit'];\n }\n\n if ... | [
"public function onDelete()\n {\n $this->validateRequestTheme();\n\n $type = Request::input('templateType');\n\n $this->loadTemplate($type, trim(Request::input('templatePath')))->delete();\n\n /*\n * Extensibility - documented above\n */\n $this->fireSystemEvent... | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Programming:"
} |
Check credentials against the RADIUS server identified by `realm` and
return a User object or None. If no argument is supplied, Django will
skip this backend and try the next one (as a TypeError will be raised
and caught). | [
"def authenticate(self, request, username=None, password=None, realm=None):\n \n if isinstance(username, basestring):\n username = username.encode('utf-8')\n\n if isinstance(password, basestring):\n password = password.encode('utf-8')\n\n server = self.get_server(re... | [
"def get_entity(ent_type, **kwargs):\n '''\n \n '''\n try:\n func = 'keystoneng.{}_get'.format(ent_type)\n ent = __salt__[func](**kwargs)\n except OpenStackCloudException as e:\n # NOTE(SamYaple): If this error was something other than Forbidden we\n # reraise the issue si... | codesearchnet | {
"query": "Represent the description about Software Engineering:",
"pos": "Represent the code about Software Engineering:",
"neg": "Represent the code:"
} |
Convert a string to a bytes string (if necessary, encode in utf8) | [
"def utf8_bytes_string(s):\n \"\"\"\"\"\"\n if sys.version_info[0] == 2:\n if isinstance(s, str):\n return s\n else:\n return s.encode('utf8')\n else:\n if isinstance(s, str):\n return bytes(s, encoding='utf8')\n else:\n return s"
] | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
create all bundles schema. | [
"public function createBundlesSchema()\n {\n foreach ($this->_application->getBundles() as $bundle) {\n $this->createBundleSchema($bundle->getId());\n }\n }"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
modified from http://jsfiddle.net/justin_c_rounds/Gd2S2/light/ | [
"function lineIntersects(line1StartX, line1StartY, line1EndX, line1EndY, line2StartX, line2StartY, line2EndX, line2EndY) {\n // if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point\n ... | [
"def _load_secret(self, creds_file):\n ''''''\n try:\n with open(creds_file) as fp:\n creds = json.load(fp)\n return creds\n except Exception as e:\n sys.stderr.write(\"Error loading oauth secret from local file called '{0}'\\n\".format(creds_file... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Average the per-node models (for elastic averaging, already wrote them to DKV in postLocal())
This is a no-op between F/J worker threads (operate on the same weights/biases)
@param other | [
"@Override public void reduce(DeepLearningTask other){\n if (_localmodel != null && other._localmodel != null && other._localmodel.get_processed_local() > 0 //other DLTask was active (its model_info should be used for averaging)\n && other._localmodel != _localmodel) //other DLTask worked on a different m... | [
"public void setLossVariables(String... lossVariableNames){\n this.lossVariables.clear();\n for(String s : lossVariableNames){\n addLossVariable(s);\n }\n //After changing loss function variables, we (probably) need to recreate gradient function - as gradient\n // funct... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Mark a node name as no longer in use.
It could thus be recycled to name a new node. | [
"def free(self, kind, name):\n \n try:\n params = self._parse(name)\n index = int(params['index'], 10)\n self._free[kind].add(index)\n assert index <= self._top[kind]\n if index == self._top[kind]:\n self._top[kind] -= 1\n ex... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Writes some comment.
<P>
This method writes some comment.
@param comment the comment that has to be written
@throws IOException | [
"protected void writeComment(String comment) throws IOException {\n addTabs(2);\n os.write(BEGINCOMMENT);\n write(comment);\n os.write(ENDCOMMENT);\n }"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the post about writing:",
"pos": "Represent the code about writing:",
"neg": "Represent the code about programming:"
} |
Utility method to reduce unchecked area. | [
"@SuppressWarnings(\"unchecked\")\n\tprivate static Enumeration<LogEntry> getLogEntries(LogReaderService lrs)\n\t{\n\t\treturn (Enumeration<LogEntry>)lrs.getLog();\n\t}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
エラー
@method callback
@param {String} prefix
@param {String|Array} name
@param {String} message
@return {Boolean} isErr | [
"function callback (prefix, name, message) {\n if (!message) {\n return false;\n }\n count++;\n var msg = errMsg(prefix, name, message);\n switch(action) {\n case 'show':\n console.log(msg);\n break;\n case 'hide':\n break;\n case 'throw':\n ... | [
"function Flow(waits, // @arg Integer: Number of wait for processes\n callback, // @arg Function/FunctionHash/Flow/FlowHash: callback and forks\n // callback on completion of processes.\n // callback(err:Error, args:MixArray)\n ... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Compile the extends statements into valid PHP.
@param string $expression
@return string | [
"protected function compileExtends($expression)\n {\n $expression = $this->stripParentheses($expression);\n\n $data = \"<?php echo \\$__env->make($expression, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>\";\n\n $this->footer[] = $data;\n\n return '';\n ... | [
"public static function insertTemplatePF ($parser, $template, $spot=''){\n //process additional arguments into a usable array\n $params = array();\n //sanitize the template name\n $template = preg_replace('/[^A-Za-z0-9_\\-]/', '_', $template);\n //this will be stripped out, assuming the skin is based... | codesearchnet | {
"query": "Represent the instruction about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about programming:"
} |
Get similar images by vector
@param vector
@param threshold
@return | [
"public JsonResultSet getSimilarImagesAndIndex(String id, double[] vector, double threshold) {\n\n \tJsonResultSet similar = new JsonResultSet();\n\n byte[] vectorInBytes = new byte[8 * vector.length];\n ByteBuffer bbuf = ByteBuffer.wrap(vectorInBytes);\n for (double value : vector) {\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Invoke receiver functions according topic, it'll invoke receiver functions one by one,
and it'll not return anything, so if you want to return a value, you should
use get function. | [
"def call(sender, topic, *args, **kwargs):\r\n \r\n if not topic in _receivers:\r\n return\r\n items = _receivers[topic]\r\n def _cmp(x, y):\r\n return cmp(x[0], y[0])\r\n \r\n items.sort(_cmp)\r\n i = 0\r\n while i<len(items):\r\n nice, f = items[i]\r\n i = i + 1... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Install deprecated ArcFour ciphers
@param ciphers | [
"public void installArcFourCiphers(ComponentFactory ciphers) {\n\t\t\n\t\tif (testJCECipher(\"arcfour\", ArcFour.class)) {\n\t\t\tciphers.add(\"arcfour\", ArcFour.class);\n\t\t}\n\n\t\tif (testJCECipher(\"arcfour128\", ArcFour128.class)) {\n\t\t\tciphers.add(\"arcfour128\", ArcFour128.class);\n\t\t}\n\n\t\tif (test... | [
"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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
清除指定HTML标签,不包括内容<br>
不区分大小写
@param content 文本
@param tagNames 要清除的标签
@return 去除标签后的文本 | [
"public static String unwrapHtmlTag(String content, String... tagNames) {\r\n\t\treturn removeHtmlTag(content, false, tagNames);\r\n\t}"
] | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about text processing:"
} |
Collect data
@return array data | [
"public function collectData() {\n\t\t$userAgentsWithDeviceId = array();\t\t\n\t\tforeach ($this->_userAgentHandlers as $userAgentHandler) {\n\t\t\t/**\n\t\t\t * @see WURFL_Handlers_Handler::getUserAgentsWithDeviceId()\n\t\t\t */\n\t\t\t$current = $userAgentHandler->getUserAgentsWithDeviceId();\n\t\t\tif(!empty($cu... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Removes a lock from a uri.
@param string $uri
@param LockInfo $lockInfo
@return bool | [
"public function unlock($uri, LockInfo $lockInfo)\n {\n $stmt = $this->pdo->prepare('DELETE FROM '.$this->tableName.' WHERE uri = ? AND token = ?');\n $stmt->execute([$uri, $lockInfo->token]);\n\n return 1 === $stmt->rowCount();\n }"
] | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param aClass the class name
@param key the configuration key
@param aBool default value
@return aBool if the configuration value for the key is blank | [
"public static Boolean getPropertyBoolean(Class<?> aClass, String key,\r\n\t\t\tboolean aBool)\r\n\t{\r\n\t\treturn getSettings().getPropertyBoolean(aClass, key, aBool);\r\n\t}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
The range in which find/replace happened, receive from user selection prior. | [
"function getSearchRange( isDefault ) {\r\n\t\t\t\tvar searchRange,\r\n\t\t\t\t\tsel = editor.getSelection(),\r\n\t\t\t\t\teditable = editor.editable();\r\n\r\n\t\t\t\tif ( sel && !isDefault ) {\r\n\t\t\t\t\tsearchRange = sel.getRanges()[ 0 ].clone();\r\n\t\t\t\t\tsearchRange.collapse( true );\r\n\t\t\t\t} else {\r... | [
"def handle_key ch\n $log.debug \" KeyDispatcher GOT KEY #{ch} \"\n @keyint = ch\n @keychr = nil\n chr = nil\n chr = ch.chr if ch > 32 and ch < 127\n @keychr = chr\n\n ret = process_key ch\n # revert to the basic handling of key_map and refreshing pad.\n #####\n # ... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Extract each archive from the list of filenames.
Normal files stay untouched.
Add all files to the Recent Files.
:type file_names: list of str
:type temp_dir: str
:rtype: list of str | [
"def uncompress_archives(file_names, temp_dir):\n \n result = []\n for filename in file_names:\n if filename.endswith(\".tar\") or filename.endswith(\".tar.gz\") or filename.endswith(\".tar.bz2\"):\n obj = tarfile.open(filename, \"r\")\n extracted_file_names = []\n f... | [
"def scripts( self, mydict ):\n \"\"\"\"\"\"\n\n if isinstance( mydict, dict ):\n for src, type in list( mydict.items( ) ):\n self.script( '', src=src, type='text/%s' % type )\n else:\n try:\n for src in mydict:\n self.scrip... | codesearchnet | {
"query": "Represent the text about computer science:",
"pos": "Represent the code about computer science:",
"neg": "Represent the code about programming:"
} |
Retrieve the secondary menu group factory.
@throws RuntimeException If the secondary menu group factory was not previously set.
@return FactoryInterface | [
"protected function secondaryMenu()\n {\n if (!isset($this->secondaryMenu)) {\n throw new RuntimeException(sprintf(\n 'Secondary Menu Group Factory is not defined for \"%s\"',\n get_class($this)\n ));\n }\n\n return $this->secondaryMenu;\n ... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
remove event listeners | [
"function(target, events) {\n for (var i = 0, l = events.length, e; (i < l) && (e = events[i]); i++) {\n this.removeEvent(target, e);\n }\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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Defining Methods | [
"function defineMethods(sugarNamespace, methods, type, args, flags) {\n forEachProperty(methods, function(method, methodName) {\n var instanceMethod, staticMethod = method;\n if (args) {\n staticMethod = wrapMethodWithArguments(method);\n }\n if (flags) {\n staticMethod.flags = flags;\n }\... | [
"public File getExistingDirectory(final String param) {\n return get(param, new StringToFile(),\n new And<>(new FileExists(), new IsDirectory()),\n \"existing directory\");\n }"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
dump vtkjs normal vectors | [
"def dump_normals(dataset_dir, data_dir, dataset, root=None, compress=True):\n \"\"\"\"\"\"\n if root is None:\n root = {}\n normals = dataset.GetPointData().GetNormals()\n if normals:\n dumped_array = dump_data_array(dataset_dir, data_dir, normals, {}, compress)\n root['pointData']... | [
"def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
/* [MS-OLEDS] 2.3.8 CompObjStream | [
"function parse_compobj(obj/*:CFBEntry*/) {\n\tvar v = {};\n\tvar o = obj.content;\n\t/*:: if(o == null) return; */\n\n\t/* [MS-OLEDS] 2.3.7 CompObjHeader -- All fields MUST be ignored */\n\to.l = 28;\n\n\tv.AnsiUserType = o.read_shift(0, \"lpstr-ansi\");\n\tv.AnsiClipboardFormat = parse_ClipboardFormatOrAnsiString... | [
"def DeserializeExclusiveData(self, reader):\n \n\n self.Type = TransactionType.IssueTransaction\n\n if self.Version > 1:\n raise Exception('Invalid TX Type')"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
In general if we need to put a file on a folder, we use this method | [
"def generic_insert_with_folder(folder_name, file_name, template_name, args):\n \n # First we make sure views are a package instead a file\n if not os.path.isdir(\n os.path.join(\n args['django_application_folder'],\n folder_name\n )\n ):\n os.mkdir(os.path.joi... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Zones returns an implementation of dnsprovider.Zones | [
"func (d *DNS) Zones() (dnsprovider.Zones, bool) {\n\treturn &zones{\n\t\tclient: d.client,\n\t}, true\n}"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github description about AWS Route 53:",
"pos": "Represent the Github code about AWS Route 53:",
"neg": "Represent the Github code:"
} |
// Sends a generic request that gets back a generic response, or error. This returns a ChromeResponse
// object. | [
"func SendDefaultRequest(target ChromeTargeter, sendCh chan<- *Message, paramRequest *ParamRequest) (*ChromeResponse, error) {\n\treq := &ChromeRequest{Id: paramRequest.Id, Method: paramRequest.Method, Params: paramRequest.Params}\n\tdata, err := json.Marshal(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tr... | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Reduces multiple queries into a single usable query | [
"def generate_query(self):\n \n query = Q()\n ORed = []\n for form in self._non_deleted_forms:\n if not hasattr(form, 'cleaned_data'):\n continue\n if form.cleaned_data['field'] == \"_OR\":\n ORed.append(query)\n query = ... | [
"@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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Yield :class:`ComponentStub` of dependencies of this component. | [
"def dependencies(self):\n\t\n\t\t\n\t\t\n\t\ttry:\n\t\t\tfor dep_name in self.__prof.dependencies(self.name()):\n\t\t\t\tyield self.__comp_stub_reg.get(dep_name)\n\t\texcept TypeError:\n\t\t\tyield from ()"
] | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// InsertAfter inserts e after b. | [
"func (l *List) InsertAfter(b, e Element) {\n\ta := ElementMapper{}.linkerFor(b).Next()\n\tElementMapper{}.linkerFor(e).SetNext(a)\n\tElementMapper{}.linkerFor(e).SetPrev(b)\n\tElementMapper{}.linkerFor(b).SetNext(e)\n\n\tif a != nil {\n\t\tElementMapper{}.linkerFor(a).SetPrev(e)\n\t} else {\n\t\tl.tail = e\n\t}\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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Return random proxy | [
"def get_random_proxy(self):\n \"\"\"\"\"\"\n idx = randint(0, len(self._list) - 1)\n return self._list[idx]"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Notification handler when node is removed from k8s cluster. | [
"func (vs *VSphere) NodeDeleted(obj interface{}) {\n\tnode, ok := obj.(*v1.Node)\n\tif node == nil || !ok {\n\t\tklog.Warningf(\"NodeDeleted: unrecognized object %+v\", obj)\n\t\treturn\n\t}\n\n\tklog.V(4).Infof(\"Node deleted: %+v\", node)\n\tif err := vs.nodeManager.UnRegisterNode(node); err != nil {\n\t\tklog.Er... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// GetDroplet returns a droplet with the given GUID. | [
"func (client *Client) GetDroplet(dropletGUID string) (Droplet, Warnings, error) {\n\trequest, err := client.newHTTPRequest(requestOptions{\n\t\tRequestName: internal.GetDropletRequest,\n\t\tURIParams: map[string]string{\"droplet_guid\": dropletGUID},\n\t})\n\tif err != nil {\n\t\treturn Droplet{}, nil, err\n\t}\... | [
"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 comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about AWS S3:"
} |
Calculate the inverse of the range.
Returns:
New VersionRange object representing the inverse of this range, or
None if there is no inverse (ie, this range is the any range). | [
"def inverse(self):\n \n if self.is_any():\n return None\n else:\n bounds = self._inverse(self.bounds)\n range = VersionRange(None)\n range.bounds = bounds\n return range"
] | [
"def _is_axis_allowed(self, axis):\n \n if axis is None:\n # If table direction was requested, we must ensure that each slice\n # doesn't have the CA items dimension (thus the [-2:] part). It's\n # OK for the 0th dimension to be items, since no calculation is\n ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Convert a column to a bigquery schema object. | [
"def column_to_bq_schema(self):\n \n kwargs = {}\n if len(self.fields) > 0:\n fields = [field.column_to_bq_schema() for field in self.fields]\n kwargs = {\"fields\": fields}\n\n return google.cloud.bigquery.SchemaField(self.name, self.dtype,\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Retrieve values for graphs. | [
"def retrieveVals(self):\n \"\"\"\"\"\"\n proc_info = ProcessInfo()\n stats = {}\n for (prefix, is_thread) in (('proc', False), \n ('thread', True)):\n graph_name = '%s_status' % prefix\n if self.hasGraph(graph_name):\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 sentence about Data processing:",
"pos": "Represent the code about Data processing:",
"neg": "Represent the code:"
} |
// SetFromPort sets the FromPort field's value. | [
"func (s *IpPermission) SetFromPort(v int64) *IpPermission {\n\ts.FromPort = &v\n\treturn s\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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// ReadBlob retrieves the entire contents of the blob from the provider.
//
// Avoid using this for large blobs, such as layers. | [
"func ReadBlob(ctx context.Context, provider Provider, desc ocispec.Descriptor) ([]byte, error) {\n\tra, err := provider.ReaderAt(ctx, desc)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer ra.Close()\n\n\tp := make([]byte, ra.Size())\n\n\t_, err = ra.ReadAt(p, 0)\n\treturn p, err\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 instruction about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software development:"
} |
// SetClusterId sets the ClusterId field's value. | [
"func (s *ClusterMetadata) SetClusterId(v string) *ClusterMetadata {\n\ts.ClusterId = &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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Init logging
:param log_level: An integer representing the log level or a string representing one | [
"def init_logging(log_level=logging.DEBUG):\n \n logging.root.handlers = [] # remove possible side-effects from other libs\n logger = logging.getLogger(\"inginious\")\n logger.setLevel(log_level)\n ch = logging.StreamHandler()\n ch.setLevel(log_level)\n formatter = logging.Formatter(\"%(asctim... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Takes the path to a FeatureIDE model.xml file and extracts the feature order.
:param file_path: path to the model file
:return: list of features as strings | [
"def extract_feature_order_from_model_xml(file_path):\n \n\n root = xml.etree.ElementTree.parse(file_path).getroot()\n feature_order_node = root.find('featureOrder')\n\n features = []\n for child in feature_order_node:\n features.append(child.attrib['name'])\n\n return features"
] | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Change the owner of an array of files.
@param (string) $source Name of file or directory with path.
@param (array) $files Files to be copy.
@param (mixed) $user The new owner user name.
@since 3.0.0
@return bool | [
"public function chown($source, $files, $user)\n {\n foreach ($files as $file => $value) {\n if (file_exists($source.$value)) {\n @chown($file, $user);\n }\n }\n }"
] | [
"public function check()\n {\n $result = false;\n\n $version = $this->dataService->getVersion();\n\n // Check the version. If this is > 0 then it seems to be a version number like 1.2.3\n // Because the getVersion method can return an error like\n // Warning: Identity file... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about NLP:"
} |
Rename a key while maintaining position
@param array $array array to update
@param string $from existing key
@param string $to new key
@return void | [
"public static function keyRename(&$array, $from, $to)\n {\n if (\\is_array($array) && $from !== $to) {\n $keys = \\array_keys($array);\n $pos = \\array_search($from, $keys, true);\n if ($pos !== false) {\n $nextKey = isset($keys[$pos+1])\n ... | [
"public static function modelize($key, $value)\n {\n switch (gettype($value)) {\n case 'object':\n\n $namespaces = ['\\Connect\\\\', '\\Connect\\Usage\\\\'];\n\n /**\n * if the item is an object search if there are any model that match with it:\n ... | codesearchnet | {
"query": "Represent the post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Programming:"
} |
Get the parent cID of a page given its cID.
@param int $cID
@return int|null | [
"public static function getCollectionParentIDFromChildID($cID)\n {\n $db = Database::connection();\n $q = 'select cParentID from Pages where cID = ?';\n $cParentID = $db->fetchColumn($q, [$cID]);\n\n return $cParentID;\n }"
] | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetRepositoryName sets the RepositoryName field's value. | [
"func (s *PullRequestMergedStateChangedEventMetadata) SetRepositoryName(v string) *PullRequestMergedStateChangedEventMetadata {\n\ts.RepositoryName = &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 comment about Programming:",
"pos": "Represent the Github code about Programming:",
"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.