query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
// Last returns the last element of a collection. | [
"func (q Query) Last() (r interface{}) {\n\tnext := q.Iterate()\n\n\tfor item, ok := next(); ok; item, ok = next() {\n\t\tr = item\n\t}\n\n\treturn\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Up the site only in certain conditions, eg. the site administrator of the IP.
@param callable $callback
@return void | [
"public static function ignoreif($callback)\n {\n if (is_callable($callback) === false) {\n throw new Exception('Invalid callback');\n }\n\n App::on('init', function () use ($callback) {\n if ($callback()) {\n App::env('maintenance', false);\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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Free all the resources belonging to this applet. If all applet screens are closed, shut down the applet. | [
"public void free()\n {\n if (m_messageStackOwner != null) // Always\n m_messageStackOwner.setMessageStack(null);\n m_messageStackOwner = null;\n if (m_bWaiting)\n {\n synchronized (m_thread)\n {\n if (m_bWaiting) // Inside the sync b... | [
"private void removeContext(final String contextID) {\n\n synchronized (this.contextStack) {\n\n if (!contextID.equals(this.contextStack.peek().getIdentifier())) {\n throw new IllegalStateException(\"Trying to close context with id `\" + contextID +\n \"`. But the top context has id `\" +\... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Registers a closure to run as normalization or an expression builder to build it if null is provided.
@return ExprBuilder|$this | [
"public function rule(\\Closure $closure = null)\n {\n if (null !== $closure) {\n $this->rules[] = $closure;\n\n return $this;\n }\n\n return $this->rules[] = new ExprBuilder($this->node);\n }"
] | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
@param ApiPayloadInterface $payload
@param string $path
@param string $verb
@return ApiRequest|FortifiApiRequestInterface | [
"protected function _createRequest(\n ApiPayloadInterface $payload = null, $path = null, $verb = HttpVerb::POST\n )\n {\n return parent::_createRequest($payload, $path, $verb);\n }"
] | [
"public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Asks User to enter Root-Path of Input and Output CMS
@return array with the two strings | [
"protected function getInputAndOutputDisk()\n {\n $validInputPath = FALSE;\n $validOutputPath = FALSE;\n\n //runs as long as user enters valid input root path\n while(!$validInputPath){\n $goBack = FALSE;\n $rootInput = $this->choice('Which input disk?', array_ke... | [
"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 summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Uses the qvar map to generate a XQuery string containing qvar constraints,
and the qvar map variable which maps qvar names to their respective formula ID's in the result. | [
"private void generateQvarConstraints() {\n final StringBuilder qvarConstrBuilder = new StringBuilder();\n final StringBuilder qvarMapStrBuilder = new StringBuilder();\n final Iterator<Map.Entry<String, ArrayList<String>>> entryIterator = qvar.entrySet().iterator();\n if (entryIterator.h... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the data for the requested file
@param WebRequest $request The http request
@return string
@throws Exceptions\HttpStatusError | [
"protected function getFile(WebRequest $request)\n {\n $path = realpath($this->dirRoot . DIRECTORY_SEPARATOR . $request->getPath());\n if (false === $path) {\n throw new Exceptions\\HttpStatusError(\n \"File not found.\",\n 404\n );\n }\n ... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the comment about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about Programming:"
} |
Thread entrypoint for doing low-level receive and dispatch
for a single pcap device. | [
"def _low_level_dispatch(pcapdev, devname, pktqueue):\n '''\n \n '''\n while LLNetReal.running:\n # a non-zero timeout value is ok here; this is an\n # independent thread that handles input for this\n # one pcap device. it throws any packets received\n ... | [
"@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Build a `Time` from a TDB Julian date.
Supply the Barycentric Dynamical Time (TDB) as a Julian date:
>>> t = ts.tdb_jd(2456675.56640625)
>>> t.tdb
2456675.56640625 | [
"def tdb_jd(self, jd):\n \n tdb = _to_array(jd)\n tt = tdb - tdb_minus_tt(tdb) / DAY_S\n t = Time(self, tt)\n t.tdb = tdb\n return t"
] | [
"def gemini_writer(self, f_handle):\n \n f_handle.write(GEMINI_HEADER)\n # Date__(UT)__HR:MN Date_________JDUT R.A.___(ICRF/J2000.0)___DEC dRA*cosD d(DEC)/dt\n # 1 2 3 4 5 6 7 8 9\n # 12345678901234567890... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
--//--//--//--//--//--//--//--// | [
"function processFragment(match) {\n var hpos = match.index;\n var hlen = match[0].length;\n\n currentFragment._txt += srctext.slice(0, hpos);\n\n if (pos || hpos) {\n currentFragment = new Fragment();\n fragments.push(currentFragment);\n }\n\n currentFragment._hdr = noHeaders ? '' : mat... | [
"@Override\n\tpublic void toPDB(StringBuffer buf){\n\t\t// 1 2 3 4 5 6 7\n\t\t//01234567890123456789012345678901234567890123456789012345678901234567890123456789\n\t\t//HEADER COMPLEX (SERINE PROTEASE/INHIBITORS) 06-FEB-98 1A4W\n\t\t//TITLE CRYSTAL... | codesearchnet | {
"query": "Represent the Github summarization about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code about Programming:"
} |
setPath :: [ String | Integer ] -> a -> (Object | Array) -> (Object | Array) | [
"function setPath(path, val, obj) {\n if(!isArray(path) || isEmpty(path)) {\n throw new TypeError(pathErr)\n }\n\n if(!isValid(obj)) {\n throw new TypeError(\n 'setPath: Object or Array required for third argument'\n )\n }\n\n const key = path[0]\n let newVal = val\n\n if(!(isString(key) && !is... | [
"function get_(key) {\n return B (function(obj) { return key in obj ? Just (obj[key]) : Nothing; })\n (toObject);\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Handle.
@return void
@throws \Psr\Container\ContainerExceptionInterface
@throws \Berlioz\Core\Exception\BerliozException | [
"public function handle(): void\n {\n // Log\n $this->getService('logging')->debug(sprintf('%s / Initialization', __METHOD__));\n\n // Event\n $this->getService('events')->trigger('_berlioz.core.app.handle.before', $this);\n\n // Get router\n /** @var \\Berlioz\\Core\\Se... | [
"public function register(Container $app): void\n {\n $this->registerWriters($app);\n $this->registerDependenciesOnXsltExtension($app);\n\n $app->register(new \\phpDocumentor\\Plugin\\Graphs\\ServiceProvider());\n $app->register(new \\phpDocumentor\\Plugin\\Twig\\ServiceProvider());\n... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
// List takes label and field selectors, and returns the list of Deployments that match those selectors. | [
"func (c *FakeDeployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &v1beta1.DeploymentList{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.Extrac... | [
"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 summarization about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
Return the filename of the AEAD for this public_id. | [
"def aead_filename(aead_dir, key_handle, public_id):\n \n parts = [aead_dir, key_handle] + pyhsm.util.group(public_id, 2) + [public_id]\n return os.path.join(*parts)"
] | [
"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:"
} |
Pick the most recent revision date.
`r_stmts` is a list of 'revision' statements. | [
"def current_revision(self, r_stmts):\n \n cur = max([[int(p) for p in r.arg.split(\"-\")] for r in r_stmts])\n return \"%4d-%02d-%02d\" % tuple(cur)"
] | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateSetMaxDowntime | [
"func (d *Domain) MigrateSetMaxDowntime(downtime uint64, flags uint32) error {\n\tvar err C.virError\n\tret := C.virDomainMigrateSetMaxDowntimeWrapper(d.ptr, C.ulonglong(downtime), C.uint(flags), &err)\n\tif ret == -1 {\n\t\treturn makeError(&err)\n\t}\n\n\treturn nil\n}"
] | [
"func (g *Generator) SetVMHypervisorParameters(parameters []string) {\n\tg.initConfigVMHypervisor()\n\tg.Config.VM.Hypervisor.Parameters = parameters\n}"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Constructor and Initialisation ------------------------------ | [
"public function init() {\n\n\t\tparent::init();\n\n\t\t// Views\n\t\t$this->setViewPath( '@cmsgears/module-core/admin/views/optiongroup/option/' );\n\n\t\t// Services\n\t\t$this->modelService\t\t= Yii::$app->factory->get( 'optionService' );\n\n\t\t$this->categoryService\t= Yii::$app->factory->get( 'categoryService... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
字符串截取,支持中文和其他编码
@static
@access public
@param string $str 需要转换的字符串
@param string $start 开始位置
@param string $length 截取长度
@param string $charset 编码格式
@param string $suffix 截断显示字符
@return string | [
"static public function msubstr($str, $start=0, $length, $charset=\"utf-8\", $suffix=true) {\n if(function_exists(\"mb_substr\"))\n $slice = mb_substr($str, $start, $length, $charset);\n elseif(function_exists('iconv_substr')) {\n $slice = iconv_substr($str,$start,$length,$charse... | [
"public function getSign(array $para)\n {\n /**\n * a.除sign 字段外,对所有传入参数按照字段名的ASCII 码从小到大排序(字典序)后,\n * 使用URL 键值对的格式(即key1=value1&key2=value2…)拼接成字符串string1,\n * 注意: 值为空的参数不参与签名 ;\n */\n // 过滤不参与签名的参数\n $paraFilter = Helpers::paraFilter($para);\n // 对数组进行... | codesearchnet | {
"query": "Represent the sentence about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about programming:"
} |
Format the log timestamp. | [
"def formatTime(self, record, datefmt=None):\n \"\"\"\"\"\"\n _seconds_fraction = record.created - int(record.created)\n _datetime_utc = time.mktime(time.gmtime(record.created))\n _datetime_utc += _seconds_fraction\n _created = self.converter(_datetime_utc)\n\n if datefmt:\... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param string $path
@return DriverInterface | [
"public function fit(string $path): DriverInterface\n {\n return new Adapters\\Fit(\n $this,\n $this->imagePath($path)\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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
/*
TRANSACTION METHODS | [
"public function begin() {\n\t\tif (!($this->connection instanceof \\mysqli))\n\t\t\tthrow new MySQLException(\"No valid MySQL connection available\");\n\t\n\t\tif (version_compare(PHP_VERSION, '5.5.0') >= 0)\n\t\t\treturn $this->connection->begin_transaction();\n\t\t\n\t\treturn $this->connection->query(\"START TR... | [
"private void populateMilestone(Row row, Task task)\n {\n task.setMilestone(true);\n //PROJID\n task.setUniqueID(row.getInteger(\"MILESTONEID\"));\n task.setStart(row.getDate(\"GIVEN_DATE_TIME\"));\n task.setFinish(row.getDate(\"GIVEN_DATE_TIME\"));\n //PROGREST_PERIOD\n //SYMBO... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Data management:"
} |
Increment model's filename until one is found that doesn't already exist.
@param \Plank\Mediable\Media $model
@return string | [
"private function generateUniqueFilename(Media $model)\n {\n $storage = $this->filesystem->disk($model->disk);\n $counter = 0;\n do {\n $filename = \"{$model->filename}\";\n if ($counter > 0) {\n $filename .= '-' . $counter;\n }\n $p... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// SetMaxResults sets the MaxResults field's value. | [
"func (s *DescribeImagesInput) SetMaxResults(v int64) *DescribeImagesInput {\n\ts.MaxResults = &v\n\treturn s\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Execute a statement, returning one row of results or null.
@param string $statement
@param array $params
@return null|array
@throws \Droid\Plugin\Mysql\Db\ClientException | [
"public function getSingleResult($statement, $params = array())\n {\n $result = $this->getResults($statement, $params);\n\n if (!sizeof($result)) {\n return null;\n }\n\n return $result[0];\n }"
] | [
"public function GetTableColumnNames($tableName) {\n $this->setDbConfigList(array());\n $dbConfig = new \\Puzzlout\\Framework\\Dal\\DbStatementConfig(null, \\Puzzlout\\Framework\\Dal\\DbExecutionType::COLUMNNAMES, new \\Puzzlout\\Framework\\Dal\\DbQueryFilters());\n $dbConfig->setQuery(\"DESCRI... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Returns the list of {@link Token}s for the given {@link JCTree}.
<p>This is moderately expensive (the source of the node has to be re-lexed), so it should only
be used if a fix is already going to be emitted. | [
"public List<ErrorProneToken> getTokensForNode(Tree tree) {\n return ErrorProneTokens.getTokens(getSourceForNode(tree), context);\n }"
] | [
"static ImmutableSet<ExecutableElement> abstractMethodsIn(\n ImmutableSet<ExecutableElement> methods) {\n Set<Name> noArgMethods = new HashSet<>();\n ImmutableSet.Builder<ExecutableElement> abstracts = ImmutableSet.builder();\n for (ExecutableElement method : methods) {\n if (method.getModifiers(... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// SetDescription sets the Description field's value. | [
"func (s *TerminologyProperties) SetDescription(v string) *TerminologyProperties {\n\ts.Description = &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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
/* (non-Javadoc)
@see org.joml.Vector4fc#hermite(org.joml.Vector4fc, org.joml.Vector4fc, org.joml.Vector4fc, float, org.joml.Vector4f) | [
"public Vector4f hermite(Vector4fc t0, Vector4fc v1, Vector4fc t1, float t, Vector4f dest) {\n float t2 = t * t;\n float t3 = t2 * t;\n dest.x = (x + x - v1.x() - v1.x() + t1.x() + t0.x()) * t3 + (3.0f * v1.x() - 3.0f * x - t0.x() - t0.x() - t1.x()) * t2 + x * t + x;\n dest.y = (y + y - ... | [
"@Pure\n\t@Inline(value = \"new Vector2ifx(Math.cos($1), Math.sin($1))\", imported = {Vector2ifx.class})\n\tpublic static Vector2ifx toOrientationVector(double angle) {\n\t\treturn new Vector2ifx(Math.cos(angle), Math.sin(angle));\n\t}"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about mathematics:"
} |
Provisions an LVM device-mapper thin device reflecting,
DM device id 'dm_id' in the docker pool. | [
"def _activate_thin_device(name, dm_id, size, pool):\n \n table = '0 %d thin /dev/mapper/%s %s' % (int(size) // 512, pool, dm_id)\n cmd = ['dmsetup', 'create', name, '--table', table]\n r = util.subp(cmd)\n if r.return_code != 0:\n raise MountError('Failed to create thi... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Technology:"
} |
Update cache. Need to clear parent also (its right key)
@return bool | [
"public function updateCache() {\n\t\tparent::updateCache();\n\t\t$bcache = \\Brilliant\\BFactory::getCache();\n\t\tif (empty($bcache)) {\n\t\t\treturn false;\n\t\t\t}\n\t\t$parentid = $this->{$this->parentKeyName};\n\t\tif (empty($parentid)) {\n\t\t\treturn true;\n\t\t\t}\n\t\t$cachekey = $this->tableName . ':item... | [
"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 about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Software development:"
} |
overrides the visitor to look for method calls to the emory backport concurrent library, or threeten bp library when the now built-in versions are
available
@param seen
the currently parsed opcode | [
"@Override\n public void sawOpcode(int seen) {\n stack.precomputation(this);\n\n switch (seen) {\n case Const.INVOKESTATIC: {\n String className = getClassConstantOperand();\n for (Backports backport : BACKPORTS) {\n if (className.startsWi... | [
"def determine_target_roots(self, goal_name):\n \n if not self.context.target_roots:\n print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.stderr)\n\n # For the v2 path, e.g. `./pants list` is a functional no-op. This matches the v2 mode behavior\n # of e.g. `./pants ... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
/*
{@inheritDoc} | [
"@Override\n public void save(Collection<T> items) {\n for (T item : items) {\n save(item);\n }\n }"
] | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the description about writing:",
"pos": "Represent the code about writing:",
"neg": "Represent the code:"
} |
获取第一个文件
@param home 进程目录
@param max 可接收的文件大小最大值
@param filenameReg 可接收的文件名正则表达式
@param contentTypeReg 可接收的ContentType正则表达式
@return 文件
@throws IOException IOException | [
"public File partsFirstFile(final File home, final long max, final String filenameReg, final String contentTypeReg) throws IOException {\r\n if (!isMultipart()) return null;\r\n File tmpfile = null;\r\n boolean has = false;\r\n for (MultiPart part : parts()) {\r\n if (has) con... | [
"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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about text processing:"
} |
// SetVaultName sets the VaultName field's value. | [
"func (s *UploadArchiveInput) SetVaultName(v string) *UploadArchiveInput {\n\ts.VaultName = &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 summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Retrieves the nhl html reports for the specified game and report code | [
"def __html_rep(self, game_key, rep_code):\n \"\"\"\"\"\"\n seas, gt, num = game_key.to_tuple()\n url = [ self.__domain, \"scores/htmlreports/\", str(seas-1), str(seas),\n \"/\", rep_code, \"0\", str(gt), (\"%04i\" % (num)), \".HTM\" ]\n url = ''.join(url)\n\n retur... | [
"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:"
} |
Exports assets version environment variable | [
"public static function exportAssetsVersion()\n {\n $process = new Process('git log -n 1');\n\n if (0 !== $process->run()) {\n return;\n }\n\n $output = $process->getOutput();\n\n if (empty($output)) {\n return;\n }\n\n putenv(self::ENV_ASSET... | [
"def execPath(self):\n \"\"\"\"\"\"\n vers = self.version.label if self.version else None # executables in Versions folder are stored by baseVersion (modified by game data patches)\n return self.installedApp.exec_path(vers)"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Marshall the given parameter object. | [
"public void marshall(DescribeThingGroupRequest describeThingGroupRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (describeThingGroupRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller... | [
"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:"
} |
Get theme JSON content as an array.
@return array|mixed | [
"public function getJsonContents()\n\t{\n\t\t$default = [];\n\n\t\t$path = $this->getJsonPath();\n\n\t\tif ($this->files->exists($path)) {\n\t\t\t$contents = $this->files->get($path);\n\n\t\t\treturn json_decode($contents, true);\n\t\t} else {\n\t\t\tthrow new UnknownFileException(\"The theme must have a valid them... | [
"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 Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
// SetId sets the Id field's value. | [
"func (s *GetCoreDefinitionVersionOutput) SetId(v string) *GetCoreDefinitionVersionOutput {\n\ts.Id = &v\n\treturn s\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Validate ensures that config is a valid configuration. If old is not nil,
// it holds the previous environment configuration for consideration when
// validating changes. | [
"func Validate(cfg, old *Config) error {\n\t// Check that all other fields that have been specified are non-empty,\n\t// unless they're allowed to be empty for backward compatibility,\n\tfor attr, val := range cfg.defined {\n\t\tif !isEmpty(val) {\n\t\t\tcontinue\n\t\t}\n\t\tif !allowEmpty(attr) {\n\t\t\treturn fmt... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Converts string to {@link ORecordId}
@param value string representation of a {@link ORID}
@param locale locale
@return {@link ORecordId} for a specified rid | [
"public OIdentifiable convertToOIdentifiable(String value, Locale locale)\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn new ORecordId(value);\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tthrow newConversionException(\"Cannot convert '\" + value + \"' to \"+getTargetType().getSimpleName(), value, locale);\n\t\t}\n\t}"
] | [
"public static IGroupMember getGroupMember(String key, Class<?> type) throws GroupsException {\n /*\n * WARNING: The 'type' parameter is not the leafType; you're obligated\n * to say whether you want a group or a non-group (i.e. some type of\n * entity). In fact, the underlying imp... | codesearchnet | {
"query": "Represent the Github instruction about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about Software development:"
} |
Internal function to get or create global BarrierTaskContext. We need to make sure
BarrierTaskContext is returned from here because it is needed in python worker reuse
scenario, see SPARK-25921 for more details. | [
"def _getOrCreate(cls):\n \n if not isinstance(cls._taskContext, BarrierTaskContext):\n cls._taskContext = object.__new__(cls)\n return cls._taskContext"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// Make a name that looks like a tlfname but is sorted by activity and missing myUsername.
// This is the less featureful version for convs that can't be unboxed. | [
"func (v conversationListView) convNameLite(g *libkb.GlobalContext, convErr chat1.ConversationErrorRekey, myUsername string) string {\n\tvar name string\n\tif convErr.TlfPublic {\n\t\tname = publicConvNamePrefix + strings.Join(convErr.WriterNames, \",\")\n\t} else {\n\t\tname = strings.Join(v.without(g, convErr.Wri... | [
"def set_identifiers(self, data):\n \n for id_info in self._details.identifiers:\n var_name = id_info['var_name']\n self._data[var_name] = data.get(var_name)\n\n # FIXME: This needs to likely kick off invalidating/rebuilding\n # relations.\n # F... | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Refresh the DataView from it's Enumerable | [
"function() {\n\n\t\tthis._data_names = this._data_source.getNames();\n\t\tthis._data_values = this._data_source.getValues();\n\t\tthis._data_uids = this._data_source.getUIDs();\n\t\tthis._count = this._data_uids.length;\n\t\tthis._fire('collection_changed');\n\n\t}"
] | [
"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:"
} |
Get binary string
@return string | [
"public function getBinnVal()\n {\n $this->calculateSize();\n\n $this->binnString = '';\n $this->binnString .= $this->pack(self::BINN_UINT8, $this->binnType);\n\n $this->binnString .= $this->packSize($this->size);\n\n $count = count($this->binnArr);\n $this->binnString .... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// getAllocsCh retrieves the allocations that are part of the deployment blocking
// at the given index. | [
"func (w *deploymentWatcher) getAllocsCh(index uint64) <-chan *allocUpdates {\n\tout := make(chan *allocUpdates, 1)\n\tgo func() {\n\t\tallocs, index, err := w.getAllocs(index)\n\t\tout <- &allocUpdates{\n\t\t\tallocs: allocs,\n\t\t\tindex: index,\n\t\t\terr: err,\n\t\t}\n\t}()\n\n\treturn out\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 instruction about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
shortcut for getPlaintext.
@deprecated use getPlaintext from now on
@param array $mf
@param $propname
@param null|string $fallback
@return mixed|null | [
"public static function get_prop( array $mf, $propname, $fallback = null ) {\n\t\treturn self::get_plaintext( $mf, $propname, $fallback );\n\t}"
] | [
"private function preconfigured() {return dfc($this, function() {\n\t\t$s = $this->s(); /** @var S $s */\n\t\t/** @var string $key */\n\t\t$key = 'actionFor' . (df_customer_is_new($this->o()->getCustomerId()) ? 'New' : 'Returned');\n\t\t/** @var string $result */\n\t\treturn $s->v($key, null, function() use($s) {re... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Verify conditional requirement, where either one of the fields are populated
@throws \Genesis\Exceptions\ErrorParameter | [
"protected function verifyConditionalFields()\n {\n if (isset($this->requiredFieldsOR)) {\n $fields = $this->requiredFieldsOR->getArrayCopy();\n\n $status = false;\n\n foreach ($fields as $fieldName) {\n if (isset($this->$fieldName) && !empty($this->$fieldNa... | [
"public Plugin.Factory.UsingReflection.ArgumentResolver toArgumentResolver() {\n return new Plugin.Factory.UsingReflection.ArgumentResolver.ForIndex.WithDynamicType(index, value);\n }"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Fill chunk data from user-supplied octet | [
"def fill(self, filler, size):\n \n return lib.zchunk_fill(self._as_parameter_, filler, size)"
] | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Publish failed event.
@param string $eventClass
@param ServiceBusContext $context
@return Promise | [
"private static function publishViolations(string $eventClass, ServiceBusContext $context): Promise\n {\n /**\n * @noinspection VariableFunctionsUsageInspection\n *\n * @var \\ServiceBus\\Services\\Contracts\\ValidationFailedEvent $event\n */\n $event = \\forward_sta... | [
"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 Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
// CreateDockNet Creates a network in docker daemon | [
"func CreateDockNet(tenantName, networkName, serviceName string, nwCfg *mastercfg.CfgNetworkState) error {\n\tvar nwID string\n\tvar subnetCIDRv6 = \"\"\n\n\tif nwCfg.IPv6Subnet != \"\" {\n\t\tsubnetCIDRv6 = fmt.Sprintf(\"%s/%d\", nwCfg.IPv6Subnet, nwCfg.IPv6SubnetLen)\n\t}\n\n\t// Trim default tenant name\n\tdockn... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Set all data set available columns (not only the current used ones)
@param acceptableValues Acceptable values for the editor. | [
"@Override\n public void setAcceptableValues(final List<DataColumnDef> acceptableValues) {\n\n clear();\n\n // Register column editor for each available column of the data set.\n this.acceptableColumns = new LinkedList<DataColumnDef>(acceptableValues);\n int index = 0;\n for (f... | [
"def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Return the memory information for AIX systems | [
"def _aix_memdata():\n '''\n \n '''\n grains = {'mem_total': 0, 'swap_total': 0}\n prtconf = salt.utils.path.which('prtconf')\n if prtconf:\n for line in __salt__['cmd.run'](prtconf, python_shell=True).splitlines():\n comps = [x for x in line.strip().split(' ') if x]\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Vel factory function | [
"def create(input_block: ModelFactory, rnn_type: str, hidden_layers: typing.List[int],\n output_dim: int, dropout=0.0):\n \n def instantiate(**_):\n return MultilayerRnnSequenceModel(\n input_block.instantiate(), rnn_type=rnn_type, hidden_layers=hidden_layers, output_dim=output_dim... | [
"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 Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Serialize textbox element. | [
"def serialize_textbox(ctx, document, txtbox, root):\n \"\"\"\"\"\"\n\n _div = etree.SubElement(root, 'div')\n _div.set('class', 'textbox')\n\n for elem in txtbox.elements:\n _ser = ctx.get_serializer(elem)\n\n if _ser:\n _ser(ctx, document, elem, _div)\n\n fire_hooks(ctx, do... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Takes one metric or a wildcard seriesList and a string in quotes.
Prints the string instead of the metric name in the legend.
Example::
&target=alias(Sales.widgets.largeBlue,"Large Blue Widgets") | [
"def alias(requestContext, seriesList, newName):\n \n try:\n seriesList.name = newName\n except AttributeError:\n for series in seriesList:\n series.name = newName\n return seriesList"
] | [
"def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Load errors strategy. | [
"private function errors()\n {\n if (env('DEV_MODE')) {\n $whoops = new \\Whoops\\Run();\n $whoops->pushHandler(new \\Whoops\\Handler\\PrettyPageHandler());\n $whoops->register();\n }\n }"
] | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Register a new entity for this document DTD external subset. | [
"def addDtdEntity(self, name, type, ExternalID, SystemID, content):\n \n ret = libxml2mod.xmlAddDtdEntity(self._o, name, type, ExternalID, SystemID, content)\n if ret is None:raise treeError('xmlAddDtdEntity() failed')\n __tmp = xmlEntity(_obj=ret)\n return __tmp"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Get a map.
@param integer $index the index number of the map to fetch
@return Map|null | [
"public function getMapByIndex($index)\n {\n $map = array_slice($this->maps, (int) $index, 1, false);\n\n return end($map);\n }"
] | [
"@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Mixin functions are sandboxed into their own instance.
@private | [
"function getSandboxedFunction(myMixId, Mix, func) {\n\tvar result = function() {\n\t\tvar mixInstances = nonenum(this, '__multiparentInstances__', []);\n\t\tvar mixInstance = mixInstances[myMixId];\n\t\tif (mixInstance == null) {\n\t\t\tif (typeof Mix === 'function') {\n\t\t\t\tmixInstance = new Mix();\n\t\t\t} el... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Update the children pages.
@param array $ids | [
"private function updateChildren(array $ids)\n {\n if (count($ids) < 1) {\n return;\n }\n\n foreach ($ids as $id) {\n $alias = $this->db->fetchColumn('SELECT alias FROM tl_page WHERE id=?', [$id]);\n $alias = $this->cleanAlias($alias);\n\n $this->d... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Export domain to graphviz format, see http://www.webgraphviz.com/
Mandatory elements are in red whereas potential elements are in black
@return a String encoding the domain of the variable | [
"public String graphVizExport() {\n\t\tboolean directed = isDirected();\n\t\tString arc = directed ? \" -> \" : \" -- \";\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(directed ? \"digraph \" : \"graph \").append(getName() + \"{\\n\");\n\t\tsb.append(\"node [color = red, fontcolor=red]; \");\n\t\tfor ... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// NewFromShareRoot uses shareBlobURL to set up and return a client that
// will be used to fetch shared blobs. | [
"func NewFromShareRoot(ctx context.Context, shareBlobURL string, opts ...ClientOption) (c *Client, target blob.Ref, err error) {\n\tvar root string\n\tm := shareURLRx.FindStringSubmatch(shareBlobURL)\n\tif m == nil {\n\t\treturn nil, blob.Ref{}, fmt.Errorf(\"Unknown share URL base\")\n\t}\n\tc, err = New(append(opt... | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Convert JSON to HTML Table format | [
"def convert(self, json=\"\", table_attributes='border=\"1\"', clubbing=True, encode=False, escape=True):\n \n # table attributes such as class, id, data-attr-*, etc.\n # eg: table_attributes = 'class = \"table table-bordered sortable\"'\n self.table_init_markup = \"<table %s>\" % table_... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the value stored in the field, None if the field doesn't exist.
:param name: str the name of the redis key
:param key: the member of the hash
:return: Future() | [
"def hget(self, name, key):\n \n with self.pipe as pipe:\n f = Future()\n res = pipe.hget(self.redis_key(name),\n self.memberparse.encode(key))\n\n def cb():\n f.set(self._value_decode(key, res.result))\n\n pipe.on_e... | [
"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 instruction about Redis command documentation:",
"pos": "Represent the code about Redis command documentation:",
"neg": "Represent the code:"
} |
<p>
Information about one or more allowed principals.
</p>
@return Information about one or more allowed principals. | [
"public java.util.List<AllowedPrincipal> getAllowedPrincipals() {\n if (allowedPrincipals == null) {\n allowedPrincipals = new com.amazonaws.internal.SdkInternalList<AllowedPrincipal>();\n }\n return allowedPrincipals;\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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Returns a QFrame formatted in a particular way | [
"def get_frame():\r\n \"\"\"\"\"\"\r\n ret = QFrame()\r\n ret.setLineWidth(1)\r\n ret.setMidLineWidth(0)\r\n ret.setFrameShadow(QFrame.Sunken)\r\n ret.setFrameShape(QFrame.Box)\r\n return ret"
] | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// sanitizeSlice returns a []string whose elements have been sanitized. | [
"func sanitizeSlice(names []string) []string {\n\tsanitized := []string{}\n\tfor _, n := range names {\n\t\tsanitized = append(sanitized, sanitize(n))\n\t}\n\treturn sanitized\n}"
] | [
"function _parseVertex(line) {\n var vertex = JSON.parse(line);\n assert.ok(_smellsLikeAnElement(vertex));\n // A vertex is an object, i.e. a key,value map.\n // We don't sort the keys of the object, leaving that to jsonStableStringify below.\n // But a vertex values contain `prop... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Returns all supported currency names include old and not used
@return array | [
"public static function allNames()\n {\n static $list;\n\n if ($list === null) {\n $list = [];\n $data = \\ResourceBundle::create(\\Locale::getDefault(), 'ICUDATA-curr')->get('Currencies');\n foreach ($data as $code => $values) {\n $list[$code] = $val... | [
"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 sentence about database:",
"pos": "Represent the Github code about database:",
"neg": "Represent the Github code about programming:"
} |
Parsing & Compiling | [
"function Parser(options) {\n options = options || {};\n this.tokens = [];\n this.token = null;\n this.options = options || defaults;\n this.options.renderer = this.options.renderer || new Renderer;\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.options.sanitize = fa... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
receive bytes
@param wsRequest wsRequest
@param bytes bytes
@param channelContext channelContext
@return anyObject
@throws Exception e | [
"@Override\n public Object onBytes(WsRequest wsRequest, byte[] bytes, ChannelContext channelContext) throws Exception {\n log.debug(\"onBytes\");\n TioWebsocketMethodMapper onBytes = methods.getOnBytes();\n if (onBytes != null) {\n onBytes.getMethod().invoke(onBytes.getInstance(),... | [
"public DeviceData command_inout(TacoTangoDevice tacoDevice, String command, DeviceData argin) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about N/A:"
} |
Return the namespace corresponding to a module or submodule.
Args:
mid: Module identifier.
Raises:
ModuleNotRegistered: If `mid` is not registered in the data model. | [
"def namespace(self, mid: ModuleId) -> YangIdentifier:\n \n try:\n mdata = self.modules[mid]\n except KeyError:\n raise ModuleNotRegistered(*mid) from None\n return mdata.main_module[0]"
] | [
"def _find_entity_in_records_by_class_name(self, entity_name):\n \"\"\"\"\"\"\n records = {\n key: value for (key, value)\n in self._registry.items()\n if value.name == entity_name\n }\n # If more than one record was found, we are dealing with the case of... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Recursively create some directories if needed so that the directory where
@filepath must be written exists, then open it in "w" mode and return the
file object. | [
"def file_w_create_directories(filepath):\n \n dirname = os.path.dirname(filepath)\n\n if dirname and dirname != os.path.curdir and not os.path.isdir(dirname):\n os.makedirs(dirname)\n\n return open(filepath, 'w')"
] | [
"def hasBeenRotated(self):\n \"\"\"\"\"\"\n try:\n # If the inodes don't match, it means the file has been replaced.\n # The inode number cannot be recycled as long as we hold the\n # filehandle open, so this test can be trusted.\n return os.stat(self._path).st_ino != self.... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
The date on which the Futures contract expires
:param expiry_date:
:return: | [
"def expiry_date(self, value):\n \n if value:\n self._expiry_date = parse(value).date() if isinstance(value, type_check) else value"
] | [
"def get_next_occurrence(self) -> date:\n \n result = get_next_occurrence(self.transaction)\n assert isinstance(result, date)\n return result"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// GetAllAWSBatchJobQueueResources retrieves all AWSBatchJobQueue items from an AWS CloudFormation template | [
"func (t *Template) GetAllAWSBatchJobQueueResources() map[string]*resources.AWSBatchJobQueue {\n\tresults := map[string]*resources.AWSBatchJobQueue{}\n\tfor name, untyped := range t.Resources {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *resources.AWSBatchJobQueue:\n\t\t\tresults[name] = resource\n\t\t}\n\t... | [
"public static List<InstanceStateChange> startInstances(final List<String> instanceIDs) {\n // pass any credentials as aws-mock does not authenticate them at all\n AWSCredentials credentials = new BasicAWSCredentials(\"foo\", \"bar\");\n AmazonEC2Client amazonEC2Client = new AmazonEC2Client(cre... | codesearchnet | {
"query": "Represent the sentence about Cloud Foundry API:",
"pos": "Represent the code about Cloud Foundry API:",
"neg": "Represent the code about programming:"
} |
Throws an error if module isn't in the required state | [
"function( required, startFunc ) {\n\t\tvar self = this;\n\n\t\tif ( required !== self.state ) {\n\t\t\tself._stateError( startFunc || self.requireState );\n\t\t}\n\n\t\treturn self;\n\t}"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github summarization about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about Software development:"
} |
Return the table column information for a given field.
@param field
Field to check for <code>@TableColumn</code> and <code>@Label</code> annotations.
@param locale
Locale to use.
@return Information or <code>null</code>. | [
"public static TableColumnInfo create(@NotNull final Field field, @NotNull final Locale locale) {\r\n\r\n Contract.requireArgNotNull(\"field\", field);\r\n Contract.requireArgNotNull(\"locale\", locale);\r\n\r\n final TableColumn tableColumn = field.getAnnotation(TableColumn.class);\r\n ... | [
"public function injectFieldOptions(InputDefinition $definition, $className)\n {\n list($fields, $associations) = $this->getConfigs($className);\n\n ObjectFieldUtil::addOptions($definition, $fields, 'The <comment>\"%s\"</comment> field');\n ObjectFieldUtil::addOptions($definition, $associati... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Custom descriptor for exclude since there is no get_exclude method to
be overridden | [
"def exclude(self):\n \n exclude = self.VERSIONED_EXCLUDE\n\n if super(VersionedAdmin, self).exclude is not None:\n # Force cast to list as super exclude could return a tuple\n exclude = list(super(VersionedAdmin, self).exclude) + exclude\n\n return exclude"
] | [
"def describe(self):\n \n result = {}\n #Because we created an Instance object, we already know that this object\n #is not one of the regular built-in types (except, perhaps, for list,\n #dict and set objects that can have their tracking turned on).\n\n #For objects that ar... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Converts a String into an Array of Integers containing the numeric Values of the Characters.
@access private
@static
@param string $string String to convert
@return array | [
"private static function strord( $string )\n\t{ \n\t\tfor( $i=0; $i<strlen( $string ); $i++ )\n\t\t{ \n\t\t\t$result[$i] = ord( $string{$i} );\n\t\t}\n\t\treturn $result;\n\t}"
] | [
"function SHA1(source) { // @arg String - source string\n // @ret SHA1HashHexString\n//{@dev\n $valid($type(source, \"String\"), SHA1, \"source\");\n//}@dev\n\n var sha1 = DataType[\"Array\"][\"toHexStringArray\"](\n SHA1_encode(\n DataType[\"Ui... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
/*
目前swoole不支持同键名的header 因此只能通过别的方式设置多个cookie | [
"public function setCookie($name, $value = null, $expire = null, $path = '/', $domain = '', $secure = false, $httponly = false){\n if(!$this->isEndResponse()){\n $this->withAddedCookie([\n $name,$value,$expire,$path,$domain,$secure,$httponly\n ]);\n return true... | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
@DI\Observe("resoure.icap_website.copy")
@param CopyResourceEvent $event | [
"public function onCopy(CopyResourceEvent $event)\n {\n $website = $event->getResource();\n\n $newWebsite = $this->container->get('icap.website.manager')->copyWebsite($website, $event->getCopy());\n\n $event->setCopy($newWebsite);\n $event->stopPropagation();\n }"
] | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Extracts the designation type of the stored routine. | [
"def _get_designation_type(self):\n \n positions = self._get_specification_positions()\n if positions[0] != -1 and positions[1] != -1:\n pattern = re.compile(r'^\\s*--\\s+type\\s*:\\s*(\\w+)\\s*(.+)?\\s*', re.IGNORECASE)\n for line_number in range(positions[0], positions[1... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Set Customer
@param string|Customers $customer
@return $this | [
"public function setCustomer($customer)\n {\n $this->client->addQueryString('new_customer', false);\n\n if ($customer instanceof Customers) {\n $code = $customer->code;\n } else {\n $code = $customer;\n }\n\n $this->data->customer = new stdClass;\n ... | [
"public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Executes ``ansible-playbook`` against the destroy playbook and returns
None.
:return: None | [
"def destroy(self):\n \n pb = self._get_ansible_playbook(self.playbooks.destroy)\n pb.execute()"
] | [
"def help\n puts\n puts \"chimp -- a RightScale Platform command-line tool\"\n puts\n puts \"To select servers using tags:\"\n puts \" --tag=<tag> example: --tag=service:dataservice=true\"\n puts \" --tag-use-and 'and' all tags when selecting... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Send a HEAD request to a URL
@param string $url URL to send the HEAD request to
@param array $headers additional headers to send
@param mixed $parameters parameters to send in the querystring
@return \Ws\Http\Response | [
"public static function head($url, $headers = [], $parameters = null)\n {\n return Request::create('default')->head($url, $headers, $parameters);\n }"
] | [
"public function prepareResponse(): void\n {\n // change default HTTP status code\n $this->response->setStatusCode(200);\n\n // clear default response headers\n $this->response->resetHeaders();\n\n // add your response headers\n $this->response->setCharset('UTF-8');\n ... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Register alert components. | [
"protected function registerAlertComponents()\n {\n $components = ['title', 'text', 'button'];\n\n foreach ($components as $component) {\n $class = 'LaravelAdminPanel\\\\Alert\\\\Components\\\\'.ucfirst(camel_case($component)).'Component';\n\n $this->app->bind(\"admin.alert.co... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Compare the two values by the constraint's operator.
@param mixed $a
@param mixed $b
@return bool | [
"protected function compare($a, $b)\n {\n switch ($this->operator) {\n case '=':\n case '==': return $a == $b;\n case '!=': return $a != $b;\n case '<': return $a < $b;\n case '>': return $a > $b;\n case '<=': return $a <= $b;\n ... | [
"private function isArrayConstraint(Constraint $constraint): bool\n {\n return $constraint instanceof Assert\\All // << Applied only on array\n || ($constraint instanceof Assert\\Choice\n && true === $constraint->multiple // << expect an array multiple choices\n );\n ... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Render a form from the provided $oForm. Needed to be overwritten completely due to missing getter calls
@see TwbBundleForm::render()
@param FormInterface $oForm
@param string $sFormLayout
@return string | [
"public function render(FormInterface $oForm, $sFormLayout = parent::LAYOUT_HORIZONTAL)\n {\n //Prepare form if needed\n if (method_exists($oForm, 'prepare')) {\n $oForm->prepare();\n }\n\t\t\n\t\t$sFormClass = $sFormLayout;\n\t\tif($sFormLayout === self::LAYOUT_VALUES || $sFormLa... | [
"public function initializeObject()\n {\n parent::initializeObject();\n\n $this->setPathsFromOptions();\n $this->setFormat('html');\n\n // Doesn't work without setting rendering context.\n // Even if StandaloneView works and we just extend it.\n $renderingContent = new R... | codesearchnet | {
"query": "Represent the Github sentence about Symfony:",
"pos": "Represent the Github code about Symfony:",
"neg": "Represent the Github code:"
} |
Writes a byte[] to a file | [
"public static boolean writeBytesToFile(byte[] bytes, File f) {\r\n try {\r\n FileOutputStream fout = new FileOutputStream(f);\r\n fout.write(bytes);\r\n fout.close();\r\n } catch (Exception e) {\r\n System.out.println(\"Error writing byte[] to file: \"\r\n ... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about File management:"
} |
// SetUnhealthyThresholdCount sets the UnhealthyThresholdCount field's value. | [
"func (s *TargetGroup) SetUnhealthyThresholdCount(v int64) *TargetGroup {\n\ts.UnhealthyThresholdCount = &v\n\treturn s\n}"
] | [
"func (p *propertySet) setTargetAttributeWithCount(targetAttribute string, allowedCount uint64, taskGroup string) {\n\t// Store that this is for a task group\n\tif taskGroup != \"\" {\n\t\tp.taskGroup = taskGroup\n\t}\n\n\t// Store the constraint\n\tp.targetAttribute = targetAttribute\n\n\tp.allowedCount = allowedC... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
Get the URL to be used to clone this remote repository. | [
"protected function getCloneUrl()\n {\n $key = trim($this->getProject()->getSshPrivateKey());\n\n if (!empty($key)) {\n return 'git@github.com:' . $this->getProject()->getReference() . '.git';\n } else {\n return 'https://github.com/' . $this->getProject()->getReference... | [
"public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Delete account of current user.
@param Pluf_HTTP_Request $request
@param array $match | [
"public function deleteAccount($request, $match)\n {\n $user = Pluf_Shortcuts_GetObjectOr404('User', $request->user->id);\n $request->user->delete();\n return $user;\n }"
] | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Set the array of pipes.
@param \Illuminate\Support\Collection|array $pipes
@return $this | [
"public function through($pipes)\n {\n if ($pipes instanceof Collection) {\n $pipes = $pipes->toArray();\n }\n\n return parent::through($pipes);\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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
// get all session from this session and all children recursively | [
"func (p *Scan) GetAllSessions() []*Session {\n\tresult := []*Session{}\n\tresult = append(result, p.Sessions...)\n\tfor _, child := range p.Sessions {\n\t\tresult = append(result, child.GetAllChildren()...)\n\t}\n\treturn result\n}"
] | [
"function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// SetParametersValidTo sets the ParametersValidTo field's value. | [
"func (s *GetParametersForImportOutput) SetParametersValidTo(v time.Time) *GetParametersForImportOutput {\n\ts.ParametersValidTo = &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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// NewHookRunner exists to satisfy the Factory interface. | [
"func (f *factory) NewHookRunner(hookInfo hook.Info) (Runner, error) {\n\tif err := hookInfo.Validate(); err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\n\tctx, err := f.contextFactory.HookContext(hookInfo)\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\trunner := NewRunner(ctx, f.paths)\n\tret... | [
"@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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Apply attribute 1 as argument to a function and return a new tuple with the substituted argument. | [
"public final <U1> Tuple3<U1, T2, T3> map1(Function<? super T1, ? extends U1> function) {\n return Tuple.tuple(function.apply(v1), v2, v3);\n }"
] | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// HasTag 指定のタグを持っているか判定 | [
"func (p *propTags) HasTag(target string) bool {\n\n\tfor _, tag := range p.Tags {\n\t\tif target == tag {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}"
] | [
"func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
get the information of all experiments | [
"def experiment_list(args):\n ''''''\n experiment_config = Experiments()\n experiment_dict = experiment_config.get_all_experiments()\n if not experiment_dict:\n print('There is no experiment running...')\n exit(1)\n update_experiment()\n experiment_id_list = []\n if args.all and a... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Removes the bookmark for an element with the given name and locale.<p>
@param path the lookup path to use for the bookmark
@param locale the locale of the element
@return the element removed from the bookmarks or null | [
"protected I_CmsXmlContentValue removeBookmark(String path, Locale locale) {\n\n // remove mapping of element name to locale\n Set<Locale> sl;\n sl = m_elementLocales.get(path);\n if (sl != null) {\n sl.remove(locale);\n }\n // remove mapping of locale to element... | [
"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 Github post:",
"pos": "Represent the Github code:",
"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.