query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Validate input string with many options
@param string
@param string|array either a named filter or combination of flags
@return bool | [
"public function _validation_valid_string($val, $flags = array('alpha', 'utf8'))\n\t{\n\t\tif ($this->_empty($val))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! is_array($flags))\n\t\t{\n\t\t\tif ($flags == 'alpha')\n\t\t\t{\n\t\t\t\t$flags = array('alpha', 'utf8');\n\t\t\t}\n\t\t\telseif ($flags == 'alpha_numer... | [
"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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Remove multiple tag.
@param Model $tag
@return Response | [
"public function delete(TagRequest $request, $type)\n {\n try {\n $ids = hashids_decode($request->input('ids'));\n\n if ($type == 'purge') {\n $this->repository->purge($ids);\n } else {\n $this->repository->delete($ids);\n }\n\n ... | [
"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:"
} |
Reset everything but the model.
@return self | [
"public function reset()\n {\n if ($this->source) {\n $this->source()->reset();\n }\n\n $this->callback = null;\n $this->dynamicTypeField = null;\n\n return $this;\n }"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Use this API to fetch location resource of given name . | [
"public static location get(nitro_service service, String ipfrom) throws Exception{\n\t\tlocation obj = new location();\n\t\tobj.set_ipfrom(ipfrom);\n\t\tlocation response = (location) obj.get_resource(service);\n\t\treturn response;\n\t}"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// RegisterRoutes sets up the http request handlers with Echo | [
"func RegisterRoutes(e *echo.Echo, db *mgo.Database, basePieURL string, service service.RiskService, fnDelayer *FunctionDelayer) {\n\te.Get(\"/pies/:id\", func(c *echo.Context) (err error) {\n\t\tpie := &plugin.Pie{}\n\t\tid := c.Param(\"id\")\n\t\tif bson.IsObjectIdHex(id) {\n\t\t\tquery := db.C(\"pies\").FindId(b... | [
"function injectDependencies(serviceLoader) {\n\n var EventEmitter = require('events').EventEmitter;\n serviceLoader.inject('events', new EventEmitter());\n\n //inject itself so that services can directly use the service loader\n serviceLoader.inject('serviceLoader', serviceLoader);\n\n //app will be... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Execute query
@param bool $cache Enable cache (for queries)
@return mixed | [
"public function execute($cache = true) {\n // @todo Execute sql here\n if (strlen($this->_sql_query)) {\n // Get cache key\n $cache_key = sha1($this->_sql_query);\n \n // If cache exists and cache is enable\n $config = Config::get('db');\n ... | [
"def db_check( block_id, opcode, op, txid, vtxindex, checked, db_state=None ):\n \n print \"\\nreference implementation of db_check\\n\"\n return False"
] | codesearchnet | {
"query": "Represent the Github text about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Blockchain:"
} |
Return human-readable type string of an item | [
"def get_human_readable_type(item):\n \"\"\"\"\"\"\n if isinstance(item, (ndarray, MaskedArray)):\n return item.dtype.name\n elif isinstance(item, Image):\n return \"Image\"\n else:\n text = get_type_string(item)\n if text is None:\n text = to_text_string('unknown'... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github comment about Documentation:",
"pos": "Represent the Github code about Documentation:",
"neg": "Represent the Github code:"
} |
生成路由
@author nash.tang <112614251@qq.com>
@param $group
@param $module
@param $model
@param $mode
@param $output
@param string $file
@param string $customTemplate | [
"public function generateRoute($group, $module, $model, $mode, $output, $file = \"\", $customTemplate = \"\")\n {\n $generator = new RouteGenerator($group, $module, $model, $mode, $output, $file, $customTemplate);\n $generator->run();\n }"
] | [
"public static function build($component_name){\n if(is_null(self::$instance)){\n self::$instance = new self;\n }\n self::$set['component_name'] = $component_name;\n //组件的唯一id\n self::$uniqid_id = $component_name.'_'.self::$run_time;\n //当前页面的调用的次数\n self:... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Deserializer factory for types which state can be natively serialized.
Arguments:
make (callable): type constructor.
Returns:
callable: deserializer (`peek` routine) | [
"def peek_native(make):\n \n def peek(service, container, _stack=None):\n return make(service.peekNative(container))\n return peek"
] | [
"def Validate(self, value, **_):\n \"\"\"\"\"\"\n # Assigning from same kind can allow us to skip verification since all\n # elements in a RepeatedFieldHelper already are coerced to the delegate\n # type. In that case we just make a copy. This only works when the value\n # wraps the same type as us.\... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
@param $hasMany
@return HasMany | [
"public function hasMany($hasMany, callable $callback = null, $alias = null)\n {\n return $this->returnRelation(HasMany::class, $hasMany, $callback, $alias);\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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Show runs the show action, used in the OAuth/OpenID connect authentication flow | [
"func (c *UserinfoController) Show(ctx *app.ShowUserinfoContext) error {\n\tidentityID, err := c.tokenManager.Locate(ctx)\n\tif err != nil {\n\t\tlog.Error(ctx, map[string]interface{}{\n\t\t\t\"err\": err,\n\t\t}, \"Bad Token\")\n\t\treturn jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError(\"bad or missing... | [
"function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Read a config file
@param string $path
@return string
@throws UnableToRead | [
"protected static function readFile($pathRaw) {\n\t\t$path = realpath($pathRaw);\n\t\t\n\t\tif ($path === false) {\n\t\t\tthrow new UnableToRead('File \"' . $pathRaw . '\" not found or inaccessible');\n\t\t}\n\t\t\n\t\t$content = file_get_contents($path);\n\t\t\n\t\tif ($content === false) {\n\t\t\tthrow new Unable... | [
"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 Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
isDate returns true if string arguments year, month, and day form a valid date. | [
"public static boolean isDate(String year, String month, String day) {\r\n // catch invalid years(not 2- or 4-digit) and invalid months and days.\r\n if (!(isYear(year) && isMonth(month) && isDay(day))) return false;\r\n\r\n int intYear = Integer.parseInt(year);\r\n int intMonth = Intege... | [
"def valid_date(date):\n \"\"\n # We want something that acts like a datetime. In particular,\n # strings indicate a failure to parse down to an object and ints are\n # nonstandard and ambiguous at best.\n if not hasattr(date, 'tzinfo'):\n return False\n # Relevant RFCs define UTC as 'close... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Get the options to run Bower with.
@param string $command
@return array | [
"protected function getInstallationOptions($command)\n {\n $flags = (array) $this->getFlags($command);\n $credentials = $this->credentials->getServerCredentials();\n if (Arr::get($credentials, 'username') === 'root') {\n return array_merge($flags, ['--allow-root' => null]);\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Breaks a URL up into a nice object
@method parseUrl
@for Core
@static
@param url
@returns object | [
"function parseUrl(url) {\n if (Core.isBlank(url)) {\n return null;\n }\n var matches = url.match(httpRegex);\n if (matches === null) {\n return null;\n }\n //log.debug(\"matches: \", matches);\n var scheme = matches[1];\n var host = matc... | [
"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:"
} |
Update order payment / transaction data
@param OrderModel $order
@param null|\stdClass $transaction
@param null|string $reference
@param null $hookType
@throws \Exception
@throws LocalizedException
@throws Zend_Http_Client_Exception | [
"public function updateOrderPayment($order, $transaction = null, $reference = null, $hookType = null)\n {\n // Fetch transaction info if transaction is not passed as a parameter\n if ($reference && !$transaction) {\n $transaction = $this->fetchTransactionInfo($reference);\n } else... | [
"public function setSubscriptionAddon(SetAddon\\RequestData $requestData)\n {\n $request = new SetAddon\\Request($requestData);\n\n return $this->sendRequest($request, SetAddon\\ApiResponse::class);\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
hash of queues to manage multiple requests
@property queues
@private | [
"function(id) {\n var q = queues[id], msg, sc;\n if (q.timer) {\n // q.timer.cancel();\n clearTimeout(q.timer);\n }\n q.finished = true;\n\n if (q.aborted) {\n msg = \"transaction \" + id + \" was aborted\";\n _fail(id, msg);\n ... | [
"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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Doctrine needs to cross reference fks.
{@inheritdoc} | [
"public function setZones(ZoneCollection $components)\n {\n return parent::setZones($components->map(function (Zone $zone) {\n return $zone->setTemplate($this);\n }));\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Aborts the current job.<p>
This can only be done until the publish job started event is fired.<p>
@throws CmsPublishException if the current publish can not be aborted | [
"protected void abort() throws CmsPublishException {\n\n if (m_started) {\n throw new CmsPublishException(Messages.get().container(Messages.ERR_PUBLISH_ENGINE_MISSING_PUBLISH_JOB_0));\n }\n m_abort = true;\n }"
] | [
"protected void destroyRequest(AsyncResourceRequest<V> resourceRequest) {\n if(resourceRequest != null) {\n try {\n // To hand control back to the owner of the\n // AsyncResourceRequest, treat \"destroy\" as an exception since\n // there is no resource ... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Find first key in index using optimistic locking
@param stack The stack to use to record the traversal | [
"private boolean optimisticFindFirst(\n DeleteStack stack)\n {\n Object q = null;\n\n int v1 = _index.vno();\n int x1 = _index.xno();\n\n if ((v1&1) != 0)\n return pessimisticNeeded;\n synchronized(this)\n {\n }\... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
-------------------------- OTHER METHODS -------------------------- | [
"public <R> BaasResult<R> execute(Task<R> request) {\n try {\n R r = request.asyncCall();\n return BaasResult.success(r);\n } catch (BaasException e) {\n return BaasResult.failure(e);\n }\n }"
] | [
"@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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
JWT Authentication middleware for Guzzle
@param string $issuer Add-on key in most cases
@param string $secret Shared secret
@return callable | [
"public static function authTokenMiddleware(string $issuer, string $secret): callable\n {\n return Middleware::mapRequest(\n function (RequestInterface $request) use ($issuer, $secret) {\n return new Request(\n $request->getMethod(),\n $reque... | [
"private static function resource($resource)\n {\n exception_if(($resource != 'session' && $resource != 'cookie'), LogicException::class, 'The resource name of \\''.$resource.'\\' is not supported by Vinala, only session or cookie');\n\n return Hash::make(config('auth.'.$resource));\n\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:"
} |
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | [
"func (in *OAuthClientAuthorizationList) DeepCopyInto(out *OAuthClientAuthorizationList) {\n\t*out = *in\n\tout.TypeMeta = in.TypeMeta\n\tout.ListMeta = in.ListMeta\n\tif in.Items != nil {\n\t\tin, out := &in.Items, &out.Items\n\t\t*out = make([]OAuthClientAuthorization, len(*in))\n\t\tfor i := range *in {\n\t\t\t(... | [
"func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Creates new {@link SparseVector} from given index-value map
@param map
@return | [
"public static SparseVector fromMap(Map<Integer, ? extends Number> map, int length) {\n return CompressedVector.fromMap(map, length);\n }"
] | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Checks single line of rpm-ql for correct keys
:param line_str: line to process
:param allowed_keys: list of allowed keys
:return: bool | [
"def process_rpm_ql_line(line_str, allowed_keys):\n \n try:\n name, key_str = line_str.split(' ', 1)\n except ValueError:\n logger.error(\"Failed to split line '{0}\".format(repr(line_str)))\n return False\n if name in no_key_pkgs:\n return True\n if key_str == NONE_KEY:\n... | [
"def arguments(self, args=None):\n '''\n \n '''\n # permits deleting elements rather than using slices\n args = args and list(args) or []\n\n # match against all known/supported subcmds\n if self.subcmd == 'apply':\n # apply subcommand requires a manifest ... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// SetProtocol sets the Protocol field's value. | [
"func (s *PortMapping) SetProtocol(v string) *PortMapping {\n\ts.Protocol = &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 post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Shuffle
Shuffles the words, forcing "Lorem ipsum..." at the beginning if it is
the first time we are generating the text.
@access private | [
"private function shuffle()\n {\n if ($this->first) {\n $this->first = array_slice($this->words, 0, 8);\n $this->words = array_slice($this->words, 8);\n\n shuffle($this->words);\n\n $this->words = $this->first + $this->words;\n\n $this->first = false;... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Writer a single attribute to the specified {@link XMLStreamWriter} using the supplied name
@param writer the writer
@param def the Attribute definition
@param name the XML tag name for the attribute
@throws XMLStreamException | [
"public void write(XMLStreamWriter writer, AttributeDefinition<?> def, Enum<?> name) throws XMLStreamException {\n write(writer, def, name.toString());\n }"
] | [
"public Element tagName(String tagName) {\n Validate.notEmpty(tagName, \"Tag name must not be empty.\");\n tag = Tag.valueOf(tagName, NodeUtils.parser(this).settings()); // maintains the case option of the original parse\n return this;\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
@param array<string, array<string, array{Type\Union}>> $template_types
@param array<string, array<string, array{Type\Union, 1?:int}>> $generic_params
@param Atomic|null $input_type
@return void | [
"public function replaceTemplateTypesWithStandins(\n array &$template_types,\n array &$generic_params,\n Codebase $codebase = null,\n Atomic $input_type = null,\n bool $replace = true,\n bool $add_upper_bound = false,\n int $depth = 0\n ) {\n if ($this->par... | [
"final static function f($m, array $stages = []) {return dfcf(function(M $m, array $stages) {\n\t\t/** @var string $c */$c = df_con_hier($m, __CLASS__); return new $c($m, $stages ?: ['', '']);\n\t}, [dfpm($m), $stages]);}"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Cached compiled binary of the Generic_Code class.
To clear cache invoke :meth:`clear_mod_cache`. | [
"def mod(self):\n \n if self._mod is None:\n self._mod = self.compile_and_import_binary()\n return self._mod"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Preprocess the key type of the given bean definition
@private
@param {aria.core.BaseTypes:Bean} beanDef bean to be preprocessed
@param {String} beanName fully qualified name for this bean
@param {aria.core.BaseTypes:Package} packageDef reference package | [
"function (beanDef, beanName, packageDef) {\n var keyType = beanDef.$keyType;\n var parentKeyType = null;\n var parent = beanDef[jv._MD_PARENTDEF];\n if (!parent[jv._MD_BUILTIN]) {\n parentKeyType = parent.$keyType;\n if (keyType == null) {\n beanDef.... | [
"public void addClass(ClassDescriptorDef classDef)\r\n {\r\n classDef.setOwner(this);\r\n // Regardless of the format of the class name, we're using the fully qualified format\r\n // This is safe because of the package & class naming constraints of the Java language\r\n _classDefs.put... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Pulled from DJ-Cache-URL, parse an arbitrary Cache URL.
:param url:
:param backend:
:return: | [
"def cache_url_config(cls, url, backend=None):\n \n url = urlparse(url) if not isinstance(url, cls.URL_CLASS) else url\n\n location = url.netloc.split(',')\n if len(location) == 1:\n location = location[0]\n\n config = {\n 'BACKEND': cls.CACHE_SCHEMES[url.sch... | [
"def get_value_from_content(key):\n \n def value_from_content_function(service, message):\n \"\"\"Actual implementation of get_value_from_content function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(messa... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Invalidate the cache
@return bool | [
"public function invalidateCache(): bool\n {\n if ($this->cache !== null) {\n $this->cache->delete($this->cacheKey);\n $this->items = null;\n }\n\n return true;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Requests that the currently used token becomes invalid. Call this should a user logout. | [
"def revoke_access(self):\n \n if self.token is None:\n return True\n #Don't try to revoke if token is invalid anyway, will cause an error response anyway.\n if self.validate():\n data = {}\n data['token'] = self.token['access_token']\n self.re... | [
"func (p *provisioningIdentityMapper) UserFor(info authapi.UserIdentityInfo) (kuser.Info, error) {\n\t// Retrying up to three times lets us handle race conditions with up to two conflicting identity providers without returning an error\n\t// * A single race is possible on user creation for every conflicting identit... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
WRITE: write or rewrite directory entry. | [
"def writeEntry(bs)\r\n return if not @dirty\r\n cluster = @parentCluster; offset = @parentOffset\r\n buf = bs.getCluster(cluster)\r\n if @lfn_ents\r\n @lfn_ents.each {|ent|\r\n buf[offset...(offset + DIR_ENT_SIZE)] = BinaryStruct.encode(ent, DIR_ENT_LFN)\r\n offset += D... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns a result set from the database.
@return \mako\database\midgard\ResultSet | [
"public function all()\n\t{\n\t\t$results = $this->fetchAll(false, PDO::FETCH_ASSOC);\n\n\t\tif(!empty($results))\n\t\t{\n\t\t\t$results = $this->hydrateModelsAndLoadIncludes($results);\n\t\t}\n\n\t\treturn $this->createResultSet($results);\n\t}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description about database:",
"pos": "Represent the Github code about database:",
"neg": "Represent the Github code:"
} |
Resets the votable stats.
AnCommandContext $context Context | [
"protected function _afterEntityInsert(AnCommandContext $context)\n {\n $this->votee->getRepository()\n ->getBehavior('votable')\n ->resetStats(array($this->votee));\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// logSkippedDeps logs any dependencies which are also skipped as a result of
// skipping a transaction while generating a block template at the trace level. | [
"func logSkippedDeps(tx *btcutil.Tx, deps map[chainhash.Hash]*txPrioItem) {\n\tif deps == nil {\n\t\treturn\n\t}\n\n\tfor _, item := range deps {\n\t\tlog.Tracef(\"Skipping tx %s since it depends on %s\\n\",\n\t\t\titem.tx.Hash(), tx.Hash())\n\t}\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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
The color of the clicked version of the MenuElement. Darker than the normal one. | [
"def get_darker_color(self):\n \"\"\"\"\"\"\n # we change a bit the color in one direction\n if bw_contrasted(self._true_color, 30) == WHITE:\n color = mix(self._true_color, WHITE, 0.9)\n else:\n color = mix(self._true_color, BLACK, 0.9)\n\n return color"
] | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Called when repo tree item has changed (the item itself, not a new selection)
If the item is the currently selected item, the the collector (inspector) and
metadata widgets are updated. | [
"def repoTreeItemChanged(self, rti):\n \n logger.debug(\"onItemChanged: {}\".format(rti))\n currentItem, _currentIndex = self.getCurrentItem()\n\n if rti == currentItem:\n self.currentRepoTreeItemChanged()\n else:\n logger.debug(\"Ignoring changed item as is ... | [
"def rowsInserted(self, parent, start, end):\n \n\n super(LogView, self).rowsInserted(parent, start, end)\n\n # IMPORTANT: This must be done *after* the superclass to get\n # an accurate value of the delegate's height.\n self.scrollToBottom()"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
For easier reading, convert this document to have footnotes at the bottom rather than inline links.
@see http://www.roughtype.com/archives/2010/05/experiments_in.php
@param \DOMElement $articleContent | [
"public function addFootnotes(\\DOMElement $articleContent)\n {\n $footnotesWrapper = $this->dom->createElement('footer');\n $footnotesWrapper->setAttribute('class', 'readability-footnotes');\n $footnotesWrapper->setInnerHtml('<h3>References</h3>');\n $articleFootnotes = $this->dom->c... | [
"def loading_failed(self, rdf_format_opts, uri=\"\"):\n \"\"\"\"\"\"\n if uri:\n uri = \" <%s>\" % str(uri)\n printDebug(\n \"----------\\nFatal error parsing graph%s\\n(using RDF serializations: %s)\"\n % (uri, str(rdf_format_opts)), \"red\")\n printDebu... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Return the newest REST API version supported by target array. | [
"def _choose_rest_version(self):\n \"\"\"\"\"\"\n versions = self._list_available_rest_versions()\n versions = [LooseVersion(x) for x in versions if x in self.supported_rest_versions]\n if versions:\n return max(versions)\n else:\n raise PureError(\n ... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
/*!
\static
Removes all temporary versions.
\note Transaction unsafe. If you call several transaction unsafe methods you must enclose
the calls within a db transaction; thus within db->begin and db->commit. | [
"static function removeTemporary()\n {\n $version = 1;\n $temporaryWorkflows = eZWorkflow::fetchList( $version, null, true );\n\n $db = eZDB::instance();\n $db->begin();\n foreach ( $temporaryWorkflows as $workflow )\n {\n $workflow->removeThis( true );\n ... | [
"public void rollbackBreakIteration(List objectsToStore)\r\n {\r\n // now we mix up different api's and use PB-api too\r\n log.info(\"rollbackBreakIteration\");\r\n /*\r\n store list of objects, then get these objects with Iterator, start\r\n iteration, then break\r\n */... | codesearchnet | {
"query": "Represent the Github sentence about Database management:",
"pos": "Represent the Github code about Database management:",
"neg": "Represent the Github code about Technology:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *CaptionSource) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CaptionSource\"}\n\tif s.Key != nil && len(*s.Key) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Key\", 1))\n\t}\n\tif s.Label != nil && len(*s.Label) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen... | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get the guzzle client.
@return ClientInterface | [
"public function getClient(): ClientInterface\n {\n if ($this->client === null) {\n $this->client = new Client();\n }\n\n return $this->client;\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 instruction about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
Get the single named element.
@param el Node
@param name String tag name of required node
@return Node node value or null
@throws SAXException | [
"public static Node getOneTaggedNode(final Node el,\n final String name)\n throws SAXException {\n if (!el.hasChildNodes()) {\n return null;\n }\n\n final NodeList children = el.getChildNodes();\n\n for (int i = 0; i < children.getLength(); i++) {\n ... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
/* global __SCRIPT_URI_SPEC__, Feature, studyUtils, config /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "(startup|shutdown|install|uninstall)" }] | [
"async function getTelemetryPings(options) {\n // type is String or Array\n const { n, timestamp, headersOnly } = options;\n let { type } = options;\n Components.utils.import(\"resource://gre/modules/TelemetryArchive.jsm\");\n // {type, id, timestampCreated}\n let pings = await TelemetryArchive.promiseArchive... | [
"function() {\n\t\t\tif(resolve.isCore(path)) throw new Error();\n\t\t\tdebug(' - standard');\n\t\t\treturn resolve.sync(getPath(options.alternative && options.alternative[parts[0]]),resolverOptions);\n\t\t}"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Analytic signal, using the Hilbert transform | [
"def hilbert(ts):\n \"\"\"\"\"\"\n output = signal.hilbert(signal.detrend(ts, axis=0), axis=0)\n return Timeseries(output, ts.tspan, labels=ts.labels)"
] | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Doesn't change anything, just formats passed date as string according to widget's current settings. | [
"public String formatDate(Date d) {\n if (d == null) return null;\n JsDate jsd = JsDate.create(d.getTime());\n return internFormat(input.getElement(), getActiveDateFormat(), jsd);\n }"
] | [
"@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// getCmpTp4MinMax gets compare type for GREATEST and LEAST. | [
"func getCmpTp4MinMax(args []Expression) (argTp types.EvalType) {\n\tdatetimeFound, isAllStr := false, true\n\tcmpEvalType, isStr, isTemporalWithDate := temporalWithDateAsNumEvalType(args[0].GetType())\n\tif !isStr {\n\t\tisAllStr = false\n\t}\n\tif isTemporalWithDate {\n\t\tdatetimeFound = true\n\t}\n\tlft := args... | [
"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 text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Returns the message, if the check succeeded
@return string | [
"public function getSuccessMessage()\n {\n $message = 'PHP-Extensions \"PDO\" (v%s) and \"pdo_mysql\" (v%s) are installed and usable.';\n $message = sprintf($message, $this->pdoVersion, $this->pdoMySqlVersion);\n return $message;\n }"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the text about NLP:",
"pos": "Represent the code about NLP:",
"neg": "Represent the code about Programming:"
} |
Obtém uma string com um mapa em JSON de todas as mensagens. | [
"public String getJSONMessages() {\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\"{\");\n\t\t\n\t\tboolean first = true;\n\t\tEnumeration<String> keys = this.bundle.getKeys();\n\t\twhile (keys.hasMoreElements()) {\n\t\t\tif (!first)\n\t\t\t\tbuilder.append(\",\");\n\t\t\telse\n\t\t\t\tfirst... | [
"def associar_assinatura(self, sequencia_cnpj, assinatura_ac):\n \n retorno = super(ClienteSATLocal, self).\\\n associar_assinatura(sequencia_cnpj, assinatura_ac)\n # (!) resposta baseada na redação com efeitos até 31-12-2016\n return RespostaSAT.associar_assinatura(retorn... | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Cascade relations through saves on a model.
@param \Illuminate\Database\Eloquent\Relations\Relation $relation
@param array $input
@param \Illuminate\Database\Eloquent\Model $parent
@return void | [
"protected function cascadeRelation(Relation $relation, array $input, Model $parent = null)\n\t{\n\t\t// Make a child repository for containing the cascaded relationship through saves\n\t\t$target_model_class = get_class($relation->getQuery()->getModel());\n\t\t$relation_repository = (new self)->setModelClass($targ... | [
"public function setModelClass($model_class): Repository\n\t{\n\t\tif ( !is_subclass_of($model_class, Model::class)) {\n\t\t\tthrow new InvalidArgumentException('Specified model class must be an instance of ' . Model::class);\n\t\t}\n\n\t\t$this->model_class = $model_class;\n\n\t\t/** @var \\Illuminate\\Database\\E... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Checks if the two passed objects are "the same" but possibly in different states. Returns the second argument if they are the same, else the first
@param type $entity
@param type $flushEntity
@return type | [
"private function getEntityOnFlush($entity, $flushEntity)\n {\n if (ClassUtils::getClass($entity) == ClassUtils::getClass($flushEntity) && $entity->getId() === $flushEntity->getId()) {\n return $flushEntity;\n } else {\n return $entity;\n }\n }"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the summarization about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software development:"
} |
Parameters
----------
index_name : str
Name of the index to be created
**kwargs
Arguments to pass to Elasticsearch instance.
Returns
-------
Index | [
"def create_index(index_name, **kwargs):\n \n es = elasticsearch.Elasticsearch(**kwargs)\n es.indices.create(index=index_name, body=mapping)\n return connect(index_name, **kwargs)"
] | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the sentence about Elasticsearch:",
"pos": "Represent the code about Elasticsearch:",
"neg": "Represent the code about programming:"
} |
Dump the typed data structure into its
untyped equivalent. | [
"def dump(self, value: Any) -> Any:\n \n index = self.index(value)\n func = self.handlers[index][1]\n return func(self, value)"
] | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
deploy middleware and initialize watches note: this may be called before scanAll() completes | [
"function serveRoutes(server) {\n self.server = server;\n server.app.use(serve);\n server.app.get('/admin/statics', function(req, res) { res.send(Object.keys(self.file$)); });\n watchAll();\n return self; // chainable\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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
If this is the user's first login, the create_or_login function
will redirect here so that the user can set up his profile. | [
"def create_profile():\n \n if g.user is not None or 'openid' not in session:\n return redirect(url_for('index'))\n if request.method == 'POST':\n name = request.form['name']\n email = request.form['email']\n if not name:\n flash(u'Error: you have to provide a name')\... | [
"def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Determines if the file can be analyzed by the analyzer.
@param pathname the path to the file
@return true if the file can be analyzed by the given analyzer; otherwise
false | [
"@Override\n public boolean accept(File pathname) {\n boolean accept = super.accept(pathname);\n if (accept) {\n try {\n accept &= shouldProcess(pathname);\n } catch (AnalysisException ex) {\n throw new UnexpectedAnalysisException(ex.getMessage(),... | [
"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:"
} |
Creates a Resource from a JSON string
@param string $input The JSON object
@param string $locale The locale
@return Resource | [
"public static function fromString(string $input, string $locale): Resource\n {\n $data = json_decode($input, true);\n if (json_last_error() !== \\JSON_ERROR_NONE) {\n if (function_exists('json_last_error_msg')) {\n throw new \\InvalidArgumentException(json_last_error_msg(... | [
"public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Documentation:"
} |
// PostForm panics. | [
"func (c *HTTPClient) PostForm(url string, data url.Values) (*http.Response, error) {\n\tpanic(\"Use Do\")\n}"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Extracts the tag from the current stack trace.
@return the qualified name of the first non escaped class on the stack. | [
"public static String getCaller() {\n StackTraceElement[] stacks = Thread.currentThread().getStackTrace();\n if (stacks != null) {\n for (int i = 0; i < stacks.length; i++) {\n String cn = stacks[i].getClassName();\n if (cn != null && !Constants.CLASSNAME_TO_ES... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
To push in the caller stated classes name stack
the class of the current object.
@param StateInterface $state
@return ProxyInterface | [
"private function pushCallerStatedClassName(StateInterface $state): ProxyInterface\n {\n $stateClass = \\get_class($state);\n\n if (!isset($this->classesByStates[$stateClass])) {\n throw new \\RuntimeException(\"Error, no original class name defined for $stateClass\");\n }\n\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Run WES on Illumina stratus endpoint server, which wes-client doesn't support.
https://stratus-docs.readme.io/docs/quick-start-4 | [
"def _run_wes_stratus(args, main_file, json_file):\n \n import requests\n base_url = args.host\n if not base_url.startswith(\"http\"):\n base_url = \"https://%s\" % base_url\n with open(main_file) as in_handle:\n r = requests.post(\"%s/v1/workflows\" % base_url,\n ... | [
"def cli(verbose):\n \n floyd.floyd_host = floyd.floyd_web_host = \"https://dev.floydhub.com\"\n floyd.tus_server_endpoint = \"https://upload-v2-dev.floydhub.com/api/v1/upload/\"\n configure_logger(verbose)\n check_cli_version()"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// parseCamliPath looks for "/camli/" in the path and returns
// what follows it (the action). | [
"func parseCamliPath(path string) (action string, err error) {\n\tcamIdx := strings.Index(path, camliPrefix)\n\tif camIdx == -1 {\n\t\treturn \"\", ErrCamliPath\n\t}\n\taction = path[camIdx+len(camliPrefix):]\n\treturn\n}"
] | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Asserts that two shorts are equal. If they are not
an AssertionFailedError is thrown with the given message. | [
"static public void assertEquals(String message, short expected, short actual) {\n \t\tassertEquals(message, new Short(expected), new Short(actual));\n \t}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Write the various styles in the automatic styles.
@param util an XML util
@param appendable the destination
@throws IOException if the styles can't be written | [
"public void writeContentAutomaticStyles(final XMLUtil util, final Appendable appendable)\n throws IOException {\n final Iterable<ObjectStyle> styles = this.objectStylesContainer\n .getValues(Dest.CONTENT_AUTOMATIC_STYLES);\n for (final ObjectStyle style : styles)\n ... | [
"public void writeOut(Writer out) throws IOException {\n\t if (writer == null) {\n\t out.write(strBuffer.toString()); // PK33136\n\t // Flush not called as the writer passed could be a BodyContent and\n\t // it doesn't allow to flush.\n\t }\n }"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about writing:"
} |
counts the number of nodes
@return int | [
"public function size() {\n /** @var Node $node */\n $node = $this->next;\n $size = 1;\n\n while ($node !== null) {\n $size++;\n $node = $node->getNext();\n }\n return $size;\n }"
] | [
"def BIF_templates(self):\n \n network_template = Template('network $name {\\n}\\n')\n # property tag may or may not be present in model,and since no of properties\n # can be more than one , will replace them accoriding to format otherwise null\n variable_template = Template(\"\"\... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// GetTags returns a json list of tags for a specific image name. | [
"func (th *tagsHandler) GetTags(w http.ResponseWriter, r *http.Request) {\n\tdefer r.Body.Close()\n\n\ttagService := th.Repository.Tags(th)\n\ttags, err := tagService.All(th)\n\tif err != nil {\n\t\tswitch err := err.(type) {\n\t\tcase distribution.ErrRepositoryUnknown:\n\t\t\tth.Errors = append(th.Errors, v2.Error... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes. | [
"func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.GroupResource)(nil), (*v1.GroupResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_GroupResource_To_v1_GroupResource(a.(*v1alpha1.GroupResource), b.(*v1.GroupReso... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// CopyAndReset creates and returns an exact copy of a histogram,
// and resets it to default empty values. | [
"func (h *Histogram) CopyAndReset() *Histogram {\n\tnewhist := h.Copy()\n\th.FullReset()\n\treturn newhist\n}"
] | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get people voice actor list.
@return array | [
"private function getVa()\n {\n $va = [];\n $va_index = 0;\n $html = $this->_parser->find('#content table tr', 0)->find('td', 0)->next_sibling();\n $va_area = $html->find('.normal_header', 0)->next_sibling();\n if ($va_area->tag == 'table') {\n if ($va_area->find('tr... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(Artwork artwork, ProtocolMarshaller protocolMarshaller) {\n\n if (artwork == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(artwork.getInputKey(), INPUTKEY_BINDING);\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 Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Called by {@code init} to set the remote path. May be an empty string
for the root path, or any other valid path on the remote server.
Default is {@code ""}.
@param pRemotePath | [
"public void setRemotePath(String pRemotePath) {\r\n if (StringUtil.isEmpty(pRemotePath)) {\r\n pRemotePath = \"\";\r\n }\r\n else if (pRemotePath.charAt(0) != '/') {\r\n pRemotePath = \"/\" + pRemotePath;\r\n }\r\n\r\n remotePath = pRemotePath;\r\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 instruction about file transfer:",
"pos": "Represent the Github code about file transfer:",
"neg": "Represent the Github code about programming:"
} |
Invokes postRemove callbacks and events for given document.
@param ClassMetadata $class
@param object $document | [
"public function postRemove(ClassMetadata $class, $document)\n {\n $class->invokeLifecycleCallbacks(Event::postRemove, $document, [new LifecycleEventArgs($document, $this->dm)]);\n $this->evm->dispatchEvent(Event::postRemove, new LifecycleEventArgs($document, $this->dm));\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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Remove `directory` if it exists, then create it if it doesn't exist. | [
"def reset_directory(directory):\n \n if os.path.isdir(directory): shutil.rmtree(directory)\n if not os.path.isdir(directory): os.makedirs(directory)"
] | [
"def _is_path(instance, attribute, s, exists=True):\n \"\"\n if not s:\n # allow False as a default\n return\n if exists:\n if os.path.exists(s):\n return\n else:\n raise OSError(\"path does not exist\")\n else:\n # how do we tell if it's a path i... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Load the FlipClock.Lang object
@param object The name of the language to load | [
"function(name) {\t\n\t\t\tvar lang;\n\t\t\t\n\t\t\tif(FlipClock.Lang[name.ucfirst()]) {\n\t\t\t\tlang = FlipClock.Lang[name.ucfirst()];\n\t\t\t}\n\t\t\telse if(FlipClock.Lang[name]) {\n\t\t\t\tlang = FlipClock.Lang[name];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlang = FlipClock.Lang[this.defaultLanguage];\n\t\t\t}\n\t\t\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Remove an allowed mime type from the list.
@param string $type
@return boolean true if found and removed, false otherwise | [
"public function removeAllowedMimeType($type)\n {\n $key = array_search($type, $this->allowedMimeTypes);\n if ($key !== false) {\n unset($this->allowedMimeTypes[$key]);\n return true;\n }\n\n\n return false;\n }"
] | [
"public function item()\n {\n if (!empty($this->response['data'])) {\n return new Fluent($this->resource, $this->response['data']);\n }\n\n // On a valid response that does not have a data field, we can assume that\n // the request is an update/delete type of request that d... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Shortcut to render CSS as a print stylesheet.
Usage::
{% css_print "myfile.css" %}
Which is equivalent to
{% css "myfile.css" "print" %} | [
"def css_print_tag(parser, token):\n \n path = get_path_from_tokens(token)\n # Hard wired media type, since this is for media type of 'print'.\n media_type = \"print\"\n\n return CssTagNode(path, media_type=media_type)"
] | [
"def index(self):\n \n root_dir = os.path.dirname(__file__)\n template_dir = os.path.join(root_dir, \"templates\", \"gnotty\")\n with open(os.path.join(template_dir, \"base.html\"), \"r\") as f:\n base = f.read()\n with open(os.path.join(template_dir, \"chat.html\"), \"... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the collection name for a given document class.
:param cls: The document class for which to return the collection name.
:returns: The collection name for the given class. | [
"def get_collection_for_cls(self, cls):\n \n if cls not in self.classes:\n if issubclass(cls, Document) and cls not in self.classes and cls not in self.deprecated_classes:\n self.autoregister(cls)\n else:\n raise AttributeError(\"Unknown object type:... | [
"def persistent_id(self, obj):\n \"\"\"\"\"\"\n if isinstance(obj, Element):\n # Here, our persistent ID is simply a tuple, containing a tag and\n # a key\n return obj.__class__.__name__, obj.symbol\n else:\n # If obj does not have a persistent ID, re... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Cuts a node from its parent. If the parent was already marked, recursively
cuts that node from its parent as well.
@param entry The node to cut from its parent. | [
"private void cutNode(Entry<T> entry) {\n /* Begin by clearing the node's mark, since we just cut it. */\n entry.mIsMarked = false;\n\n /* Base case: If the node has no parent, we're done. */\n if (entry.mParent == null) return;\n\n /* Rewire the node's siblings around it, if it h... | [
"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 post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// Remove removes the provided key from the cache. | [
"func (c *Cache) Remove(key Key) {\n\tif c.cache == nil {\n\t\treturn\n\t}\n\tif ele, hit := c.cache[key]; hit {\n\t\tc.removeElement(ele)\n\t}\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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Fetch data from the database
@param string $xref
@param int $tree_id
@return string|null | [
"protected static function fetchGedcomRecord(string $xref, int $tree_id): ?string\n {\n return DB::table('families')\n ->where('f_id', '=', $xref)\n ->where('f_file', '=', $tree_id)\n ->value('f_gedcom');\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:"
} |
Answers an Address for an Actor. If maybeAddress is allocated answer it; otherwise
answer a newly allocated Address. (INTERNAL ONLY)
@param definition the Definition of the newly created Actor
@param maybeAddress the possible Address
@return Address | [
"private Address allocateAddress(final Definition definition, final Address maybeAddress) {\n final Address address = maybeAddress != null ?\n maybeAddress : world.addressFactory().uniqueWith(definition.actorName());\n return address;\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 post about consul address:",
"pos": "Represent the Github code about consul address:",
"neg": "Represent the Github code:"
} |
Gets a list of all the groups this group provides effective membership to. | [
"def effective_groups\n ret = [ self ]\n memberships.each do |m|\n unless ret.include?(m) # prevent infinite recursion\n tmp = m.effective_groups\n tmp.each do |g|\n ret << g unless ret.include?(g)\n end\n end\n end\n ret.sort{|a,b| a.name <=>... | [
"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 text about permissions:",
"pos": "Represent the code about permissions:",
"neg": "Represent the code about Software development:"
} |
Generate a new Fernet Key, optionally write it to ~/.habu.json
Example:
\b
$ habu.fernet.genkey
xgvWCIvjwe9Uq7NBvwO796iI4dsGD623QOT9GWqnuhg= | [
"def cmd_fernet_genkey(writecfg):\n \n\n key = Fernet.generate_key()\n print(key.decode())\n\n if writecfg:\n habucfg = loadcfg(environment=False)\n habucfg['FERNET_KEY'] = key.decode()\n with Path('~/.habu.json').expanduser().open('w') as f:\n f.write(json.dumps(habucfg,... | [
"def create(cls, destination):\n \"\"\"\"\"\"\n mdb_gz_b64 = \"\"\"\\\n H4sICIenn1gC/25ldzIwMDMubWRiAO2de2wcRx3Hf7O7Pt/d3u6eLyEtVaOaqg+EkjQvuVVDwa9a\n jWXHdZxQQlCJ7fOrfp3OTpqkhVxTItFWIhVQVFBRVNIKRaColVpAUKGKRwwFqUAhKiBIpUaoVWP+\n qKgIIHL8Znb39u72znWJiWP3+9l473fzm/nNY3cdf2fmbBJEPdO... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param Configuration $configuration
@param Parameter $parameter
@return $this | [
"protected function prepareArray(Configuration $configuration, Parameter $parameter)\n {\n $this->dispatcher->dispatch(\n TransformerEvents::PREPARE_ARRAY,\n new TransformerEvent($configuration, $parameter)\n );\n\n $return = self::BUILD_ARRAY;\n\n if (count($configuration->getChildren()) > 0... | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// GetCommentsByRepoIDSince returns a list of comments for all issues in a repo since a given time point. | [
"func GetCommentsByRepoIDSince(repoID, since int64) ([]*Comment, error) {\n\treturn getCommentsByRepoIDSince(x, repoID, since)\n}"
] | [
"public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
If any of event subscriber interested in hook for item, then return true
By default, push hook subscriber is interested in job with gh-push-trigger
@return predicate with true if item alive and should have hook | [
"public static <ITEM extends Item> Predicate<ITEM> isAlive() {\n return new Predicate<ITEM>() {\n @Override\n public boolean apply(ITEM item) {\n return !from(GHEventsSubscriber.all()).filter(isApplicableFor(item)).toList().isEmpty();\n }\n };\n }"
] | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// New Creates a challenge. | [
"func (c *ChallengeService) New(chlgURL string) (acme.ExtendedChallenge, error) {\n\tif len(chlgURL) == 0 {\n\t\treturn acme.ExtendedChallenge{}, errors.New(\"challenge[new]: empty URL\")\n\t}\n\n\t// Challenge initiation is done by sending a JWS payload containing the trivial JSON object `{}`.\n\t// We use an empt... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about File management:"
} |
// getBytes converts a string in the format "[0 224 230 ...]" into a byte array | [
"func getBytes(raw string) []byte {\n\trawSlice := strings.FieldsFunc(raw, isArray)\n\tresult := make([]byte, len(rawSlice))\n\n\ti := 0\n\tfor _, b := range rawSlice {\n\t\tfmt.Sscan(b, &result[i])\n\t\ti++\n\t}\n\treturn result\n}"
] | [
"def create_response_pdu(self, data):\n \n log.debug('Create single bit response pdu {0}.'.format(data))\n bytes_ = [data[i:i + 8] for i in range(0, len(data), 8)]\n\n # Reduce each all bits per byte to a number. Byte\n # [0, 0, 0, 0, 0, 1, 1, 1] is intepreted as binary en is deci... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Roll back one or ore migration(s)
@param int $stepsDown
@throws DbException
@throws Exception
@throws QueryException
@throws \Koldy\Config\Exception
@throws \Koldy\Db\Adapter\Exception
@throws \Koldy\Exception | [
"public static function rollBack(int $stepsDown = 1): void\n {\n if ($stepsDown < 1) {\n throw new \\InvalidArgumentException(\"Invalid \\$stepsDown argument, expected positive int, got {$stepsDown}\");\n }\n\n /** @var KoldyMigration $class */\n $class = static::getMigrati... | [
"public function GetListOfTablesInDatabase() {\n $dbConfig = new \\Puzzlout\\Framework\\Dal\\DbStatementConfig(null, \\Puzzlout\\Framework\\Dal\\DbExecutionType::SHOWTABLES, new \\Puzzlout\\Framework\\Dal\\DbQueryFilters());\n $dbConfig->setQuery(\"SHOW TABLES;\");\n $this->addDbConfigItem($dbC... | codesearchnet | {
"query": "Represent the Github summarization about Database management:",
"pos": "Represent the Github code about Database management:",
"neg": "Represent the Github code about database:"
} |
Converts a String array to a String with coma separator
example: String["a.soy", "b.soy"] - output: a.soy,b.soy
@param array - array
@return comma separated list | [
"public static String arrayToPath(final String[] array) {\n if (array == null) {\n return \"\";\n }\n\n return Joiner.on(\",\").skipNulls().join(array);\n }"
] | [
"public String getMessage()\n {\n String.format(\"Wrong Syntax for [%s]: %s\", name,message);\n return String.format(\"Wrong Syntax for [%s]: %s\", name,message);\n }"
] | codesearchnet | {
"query": "Represent the sentence about Documentation:",
"pos": "Represent the code about Documentation:",
"neg": "Represent the code about text processing:"
} |
Get the number of nodes in this node list. The function is probably ill
named?
@param xctxt The XPath runtime context.
@return the number of nodes in this node list. | [
"public int getLastPos(XPathContext xctxt)\n {\n\n int count = 0;\n AxesWalker savedWalker = wi().getLastUsedWalker();\n\n try\n {\n ReverseAxesWalker clone = (ReverseAxesWalker) this.clone();\n\n clone.setRoot(this.getRoot());\n\n clone.setPredicateCount(m_predicateIndex);\n\n clon... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Create a batch of instances of the given class, with overriden attrs.
Args:
size (int): the number of instances to create
Returns:
object list: the created instances | [
"def create_batch(cls, size, **kwargs):\n \n return [cls.create(**kwargs) for _ in range(size)]"
] | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
A<B then A>B A上穿B B下穿A
Arguments:
A {[type]} -- [description]
B {[type]} -- [description]
Returns:
[type] -- [description] | [
"def CROSS(A, B):\n \n\n var = np.where(A < B, 1, 0)\n return (pd.Series(var, index=A.index).diff() < 0).apply(int)"
] | [
"def A(self):\n \n \"\"\"\n if self._A is None:\n self._A = self.W > 0\n return self._A"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Transform a gateway list to table output. | [
"def transform_gateway(result):\n \n return OrderedDict([('Name', result.get('name')),\n ('ResourceGroup', result.get('resourceGroup')),\n ('Location', result.get('location')),\n ('ProvisioningState', result.get('provisioningState')),\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 about data processing:",
"pos": "Represent the code about data processing:",
"neg": "Represent the code:"
} |
Convert to snake case.
"FooBar".snake_case #=> "foo_bar"
"HeadlineCNNNews".snake_case #=> "headline_cnn_news"
"CNN".snake_case #=> "cnn"
@return [String] Receiver converted to snake case.
@api public | [
"def snake_case(str)\n return str.downcase if str.match(/\\A[A-Z]+\\z/)\n str.gsub(/([A-Z]+)([A-Z][a-z])/, '\\1_\\2').\n gsub(/([a-z])([A-Z])/, '\\1_\\2').\n downcase\n end"
] | [
"def match_type=(match_type)\n validator = EnumAttributeValidator.new('String', [\"Exact\", \"StartsWith\", \"EndsWith\", \"Contains\"])\n if match_type.to_i == 0\n unless validator.valid?(match_type)\n raise ArgumentError, \"invalid value for 'match_type', must be one of #{validator.allow... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Calculates Audit Response for a given dashboard
@param beginDate
@param endDate
@return BuildAuditResponse for the build job for a given dashboard, begin and end date | [
"private BuildAuditResponse getBuildJobAuditResponse(CollectorItem buildItem, long beginDate, long endDate, List<CollectorItem> repoItems) {\n\n\n BuildAuditResponse buildAuditResponse = new BuildAuditResponse();\n List<CollectorItemConfigHistory> jobConfigHists = collItemConfigHistoryRepository.findB... | [
"function initialize () {\n return pullTaskRunner.run(function() {\n return store.defineTable({\n name: pulltimeTableName,\n columnDefinitions: {\n id: 'string', // column for storing queryId\n tableName: 'string', // column for s... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
/*
Set the value of the Reliability field in the message header.
Javadoc description supplied by SIBusMessage interface.
This method is not final as it is overridden in JsApiMessageImpl | [
"public void setReliability(Reliability value) {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(this, tc, \"setReliability\", value);\n /* Set the cached value */\n cachedReliability = value;\n /* Get the int value of the Reliability instance ... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github post about Java programming:",
"pos": "Represent the Github code about Java 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.