query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Display a variable's contents using nice HTML formatting and will properly display the value of booleans as true or false @see recursiveVarDumpHelper() @param mixed $var The variable to dump @return string
[ "public static function var_dump($var, $return = false, $expandLevel = 1)\n {\n self::$hasArray = false;\n $toggScript = 'var colToggle = function(toggID) {var img = document.getElementById(toggID);if (document.getElementById(toggID + \"-collapsable\").style.display == \"none\") {document.getElemen...
[ "public function XML_val($field, $arguments = [], $cache = false)\n {\n $result = $this->obj($field, $arguments, $cache);\n // Might contain additional formatting over ->XML(). E.g. parse shortcodes, nl2br()\n return $result->forTemplate();\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Checks if the operated account is a direct child of effective account @param operatedAccount @return
[ "public boolean isDirectChildOfAccount(final Account effectiveAccount,\n final Account operatedAccount) {\n return operatedAccount.getParentSid().equals(effectiveAccount.getSid());\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 post:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
List all website config @throws AccessDeniedException If authenticate user is not allowed to access to this resource (minimum ROLE_ADMIN) @return \Symfony\Component\HttpFoundation\Response
[ "public function listAction()\n\t{\n\t\tif ( false === $this->get('security.authorization_checker')->isGranted('ROLE_ADMIN') )\n\t\t\tthrow new AccessDeniedException();\n\t\n\t\t// Set Datagrid source\n\t\t$source = new Entity($this->get('asf_website.config.manager')->getClassName());\n\t\t$tableAlias = $source->ge...
[ "public function configureRestler(Restler $restler)\n {\n if ($this->extensionConfiguration->isOnlineDocumentationEnabled()) {\n $restler->addAPIClass('Luracast\\\\Restler\\\\Explorer\\\\v2\\\\Explorer', $this->extensionConfiguration->getPathOfOnlineDocumentation());\n $restler->addA...
codesearchnet
{ "query": "Represent the Github comment about permissions:", "pos": "Represent the Github code about permissions:", "neg": "Represent the Github code:" }
// List all public, private, and privileged templates.
[ "func (c *Client) ListTemplates(p *ListTemplatesParameter) ([]*Template, error) {\n\tobj, err := c.Request(\"listTemplates\", convertParamToMap(p))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn obj.([]*Template), err\n}" ]
[ "def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Memorizies a parser error message
[ "def _onError(self, message):\n \"\"\"\"\"\"\n self.isOK = False\n if message.strip() != \"\":\n self.errors.append(message)" ]
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Creates an *express.js* application with given config but doesn't start it. @param {Object} config The config object for a service. See README.md for documentation about config files. @returns {Object} Express application instance.
[ "function(config) {\n var app = express();\n\n app.config = config;\n\n app.use(function(req, res, next) {\n // express.js seems to store the app in req.app already but it isn't\n // documented anywhere. Just to make sure we do it also.\n req.app = app;\n next();\n });\n\n if (app...
[ "function Virgilio(options) {\n if (!(this instanceof Virgilio)) {\n return new Virgilio(options);\n }\n EventEmitter.call(this);\n this.options$ = options = options || {};\n this.util$.validateArg('Virgilio', 'options', options, 'object');\n var logOptions = { level: 10, name: 'virgilio' }...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
/* Creates an internal channel that will be used to send results back to an IAsyncMessageClient.
[ "private void registerInternalChannelsFor(\n String functionalityName,\n IAsyncMessageClient client,\n String conversationID) throws ServiceGroundingException\n {\n InternalChannel ch = new InternalChannel(client);\n this.channelProducersHelper.addChannel(ch, functi...
[ "@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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Write out the formatted prompt
[ "protected function writePrompt()\n {\n $prompt = $this->parser->apply($this->promptFormatted());\n\n $this->output->sameLine()->write($prompt);\n }" ]
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Validation of email address @param Request $request The current request @return RedirectResponse
[ "public function registerConfirm(Request $request)\n {\n if (null === $code = $request->query->get('code')) {\n $this->app->addFlash('error', $this->app->trans('Invalid unlock link.'));\n\n return $this->app->redirectPath('homepage');\n }\n\n if (null === $token = $this...
[ "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 comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
Make 'links' between elements, like a host got a services list with all its services in it :return: None
[ "def linkify(self):\n \n\n self.services.optimize_service_search(self.hosts)\n\n # First linkify myself like for some global commands\n self.linkify_one_command_with_commands(self.commands, 'host_perfdata_command')\n self.linkify_one_command_with_commands(self.commands, 'service_p...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
Finds members of a certain type in obj. :param obj: A model instance or class. :param member_type: The type of the menber we are trying to find. :rtype: A :class:`list` of ``member_type`` found in ``obj``
[ "def _get_members_of_type(obj, member_type):\n \n\n if not issubclass(type(obj), ModelBase):\n obj = obj.__class__\n\n key_hash = []\n for key in dir(obj):\n try:\n attr = getattr(obj, key)\n except AttributeError as e:\n try:\n attr = obj.__dict...
[ "def validate_type_only(self, val):\n \n # Since the definition maintains the list of fields for serialization,\n # we're okay with a subclass that might have extra information. This\n # makes it easier to return one subclass for two routes, one of which\n # relies on the parent c...
codesearchnet
{ "query": "Represent the Github post about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about programming:" }
Create function exposed as a mongoose wrapper. @param model: A mongoose model. @param payload: Data used to create the model document/s. @param Log: A logging object. @returns {object} A promise for the resulting model document/s. @private
[ "function _create(model, payload, Log) {\n let request = { payload: payload }\n return _createHandler(model, request, Log)\n}" ]
[ "function loadUncached () {\n // debug\n debug('view:id:collection:loadUncached', this.idCacheKey)\n // create new select for only uncached ids without view applied\n var select = sql.select(this.query.model, {\n all: true,\n where: {id: this.ids},\n })\n // replace original select i...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Computer Science:" }
Get a Monolog formatter instance. @return \Monolog\Formatter\FormatterInterface
[ "protected function formatter()\n {\n $formatter = new LineFormatter(null, null, true, true);\n $formatter->includeStacktraces();\n\n return $formatter;\n }" ]
[ "protected function initDefaultInitialContext()\n {\n\n // initialize the configuration values for the initial context\n $description = new DescriptionNode(new NodeValue('The initial context configuration.'));\n $storage = new StorageNode('AppserverIo\\Storage\\StackableStorage');\n\n ...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Register a class alias with the registry. @param parent Parent class @param alias Alias name @param cname Class name
[ "protected static void registerAlias(Class<?> parent, String alias, String cname) {\n Entry e = data.get(parent);\n assert (e != null);\n e.addAlias(alias, cname);\n }" ]
[ "def _type_description(self):\n \"\"\"\"\"\"\n #This is a little tricker because the docstring is housed\n #inside of the module that contains the actual executable.\n #These TypeExecutables are just pointers.\n iexec = self._element.target\n if iexec is not None:\n ...
codesearchnet
{ "query": "Represent the comment about Data management:", "pos": "Represent the code about Data management:", "neg": "Represent the code:" }
Short helper to add an object ID value to the MIB subtree.
[ "def add_oid(self,oid,value,label=None):\n\t\t\"\"\"\"\"\"\n\t\tself.add_oid_entry(oid,'OBJECTID',value,label=label)" ]
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Store entry or value under key
[ "def add(entry_or_key, value = nil)\n if value.nil? and entry_or_key.is_a?(Entry) # treat as entry\n entry = entry_or_key\n else\n entry = Entry.new(entry_or_key)\n entry.password = value\n end\n\n entry.validate!\n\n @backend.transaction{\n timestamp!(:last_modi...
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Use this API to flush cacheobject.
[ "public static base_response flush(nitro_service client, cacheobject resource) throws Exception {\n\t\tcacheobject flushresource = new cacheobject();\n\t\tflushresource.locator = resource.locator;\n\t\tflushresource.url = resource.url;\n\t\tflushresource.host = resource.host;\n\t\tflushresource.port = resource.port...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github instruction about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Get server response info @param \Phalcon\Http\Client\Response $response @return array|mixed @throws BaseException
[ "public function getResponse(\\Phalcon\\Http\\Client\\Response $response)\n {\n // parse json response\n $data = json_decode($response->body, true);\n\n if (isset($data['errors']) === true || $response->header->statusCode > self::MAX_SUCCESS_CODE) {\n\n $error = $data['errors'][0]...
[ "public function run()\n {\n $this->loadMiddleware();\n\n //~ Default response\n $response = new HttpMessage\\Response();\n //$response->getBody()->write('-- static --');\n\n //~ Get response\n $stack = new HttpMiddleware\\Stack($response, $this->middleware);\n ...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Returns the table name in the class hierarchy which contains a given field column for a {@link DataObject}. If the field does not exist, this will return null. @param string $candidateClass @param string $fieldName @return string
[ "public function tableForField($candidateClass, $fieldName)\n {\n $class = $this->classForField($candidateClass, $fieldName);\n if ($class) {\n return $this->tableName($class);\n }\n return null;\n }" ]
[ "private Document indexDocument(EntityMetadata metadata, final MetamodelImpl metaModel, Object object,\n String parentId, Class<?> clazz)\n {\n\n if (log.isDebugEnabled())\n {\n log.debug(\"Indexing @Entity[{}],{} \", metadata.getEntityClazz().getName(), object);\n }\n\...
codesearchnet
{ "query": "Represent the Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Metadata management:" }
Returns a diff of the supplied date time. @param DateTimeBase $other @param bool $absolute @return \DateInterval
[ "public function diff(DateTimeBase $other, bool $absolute = false)\n {\n return $this->dateTime->diff($other->dateTime, $absolute);\n }" ]
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Takes an array of classes and returns the classes which are available with the current permissions/policy set. @param array $classes @return array
[ "public function getSubAdminClasses(array $classes)\n {\n $classCollection = [];\n\n foreach ($classes as $key => $class) {\n if ($this->usableClass($key)) {\n $classCollection[] = [$key => $this->getSubAdminClasses($class)];\n continue;\n }\n\n ...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Guess a specific time within the given span. span - The Chronic::Span object to calcuate a guess from. Returns a new Time object.
[ "def guess(span, mode = :middle)\n return span if not mode\n return span.begin + span.width / 2 if span.width > 1 and (mode == true or mode == :middle)\n return span.end if mode == :end\n span.begin\n end" ]
[ "@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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Check minimum requirements for Garden. @since 2.0.0 @access private @return bool Whether platform passes requirement check.
[ "private function _CheckPrerequisites() {\n // Make sure we are running at least PHP 5.1\n if (version_compare(phpversion(), ENVIRONMENT_PHP_VERSION) < 0)\n $this->Form->AddError(sprintf(T('You are running PHP version %1$s. Vanilla requires PHP %2$s or greater. You must upgrade PHP before you can ...
[ "def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
<p>removeSquareBrackets.</p> @param value a {@link java.lang.String} object. @return a {@link java.lang.String} object.
[ "protected String removeSquareBrackets( String value )\n {\n if (value.startsWith( \"[\" ) && value.endsWith( \"]\" ))\n return value.substring( 1, value.length() - 1 );\n else\n return value;\n }" ]
[ "public void setSubstitutions(java.util.Map<String, java.util.List<String>> substitutions) {\n this.substitutions = substitutions;\n }" ]
codesearchnet
{ "query": "Represent the Github text about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about Software development:" }
Tells if the parser can handle the feed or not @param Document $document @return boolean
[ "public function canHandle(Document $document) : bool\n {\n return false !== strpos($document->getDOMDocument()->documentElement->tagName, static::ROOT_NODE_TAGNAME);\n }" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Upload a picture to Cloudinary. @param SplFileInfo $file The file to upload. @param string $publicId Path where to upload in Cloudinary. @return array
[ "protected function uploadFileToCloudinary($file, $publicId)\n {\n $result = $this->uploader->upload(\n $file->getRealPath(),\n [\n 'public_id' => $publicId,\n ]\n );\n\n return $result;\n }" ]
[ "public function getImageFieldTypeProcessor(RouterInterface $router)\n {\n $variationsIdentifiers = array_keys($this->configResolver->getParameter('image_variations'));\n sort($variationsIdentifiers);\n\n return new FieldTypeProcessor\\ImageProcessor(\n // Config for local temp di...
codesearchnet
{ "query": "Represent the text about File uploading:", "pos": "Represent the code about File uploading:", "neg": "Represent the code:" }
Redirect controller to emit a HTTP 301.
[ "def redirect(req, _log=pymagic.get_lazy_logger(\"redirect\")):\n \n log = req.environ.get(\"wsgilog.logger\", _log)\n target = req.relative_url(req.urlvars.to)\n log.info(\"Redirecting '%s' to '%s'\" % (req.url, target))\n return exc.HTTPMovedPermanently(location=target)" ]
[ "async def get_object_proxy_location(self, client, pid):\n \n try:\n return (await client.describe(pid)).get(\"DataONE-Proxy\")\n except d1_common.types.exceptions.DataONEException:\n # Workaround for older GMNs that return 500 instead of 404 for describe()\n pa...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Computer Science:" }
// w is the destination; left and right are the delimiters; @ and $ are both // reasonable choices. // // c is used to make a function for every naming system, to which you can pass // a type and get the corresponding name.
[ "func NewSnippetWriter(w io.Writer, c *Context, left, right string) *SnippetWriter {\n\tsw := &SnippetWriter{\n\t\tw: w,\n\t\tcontext: c,\n\t\tleft: left,\n\t\tright: right,\n\t\tfuncMap: template.FuncMap{},\n\t}\n\tfor name, namer := range c.Namers {\n\t\tsw.funcMap[name] = namer.Name\n\t}\n\treturn sw\...
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Read text from a file to a list of lines. @param file the file to read. @return the list of lines. @throws IOException
[ "public static List<String> readFileToLinesList( File file ) throws IOException {\n List<String> lines = new ArrayList<>();\n try (BufferedReader br = new BufferedReader(new FileReader(file))) {\n String line;\n while( (line = br.readLine()) != null ) {\n lines.add...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Add cURL options related to the request body @param \Psr\Http\Message\RequestInterface $request Request object @param array $options cURL options
[ "protected function addRequestBodyOptions(RequestInterface $request, array $options)\n\t{\n\t\t/*\n\t\t * HTTP methods that cannot have payload:\n\t\t * - GET => cURL will automatically change method to PUT or POST if we\n\t\t * set CURLOPT_UPLOAD or CURLOPT_POSTFIELDS.\n\t\t * - HEAD => cURL treats H...
[ "static function of($resource)\n {\n if (!is_resource($resource) && get_resource_type($resource) !== 'stream-context')\n throw new \\InvalidArgumentException(sprintf(\n 'Invalid Context Resource Passed, given: \"%s\".'\n , \\Poirot\\Std\\flatten($resource)\n ...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
// UnmarshalJSON - decodes JSON data.
[ "func (r *JWKSArgs) UnmarshalJSON(data []byte) error {\n\t// subtype to avoid recursive call to UnmarshalJSON()\n\ttype subJWKSArgs JWKSArgs\n\tvar sr subJWKSArgs\n\n\t// IAM related envs.\n\tif jwksURL, ok := os.LookupEnv(\"MINIO_IAM_JWKS_URL\"); ok {\n\t\tu, err := xnet.ParseURL(jwksURL)\n\t\tif err != nil {\n\t\...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Deletes the resources for a given instance. @param instance an instance @throws IOException if resources could not be deleted
[ "public static void deleteInstanceResources( Instance instance )\tthrows IOException {\n\t\tFile dir = InstanceHelpers.findInstanceDirectoryOnAgent( instance );\n\t\tUtils.deleteFilesRecursively( dir );\n\t}" ]
[ "def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about AWS S3:" }
@param string $className @param string $methodName @param Exception $error @return self
[ "public static function catchUnexpectedError($className, $methodName, Exception $error)\n {\n return new self(\n sprintf(\n '%s:%s catch unexpected error:\\n%s',\n $className,\n $methodName,\n $error->getMessage()\n ),\n ...
[ "public static function DaftObjectRepositoryByDaftObject(\n SuitableForRepositoryType $object,\n ...$args\n ) : DaftObjectRepository {\n /**\n * @psalm-var class-string<TDbObj>\n */\n $className = get_class($object);\n\n return static::DaftObjectRepositoryByType($...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Send and receive data using RMCP interface. target: lun: netfn: cmdid: raw_bytes: IPMI message payload as bytestring Returns the received data as array.
[ "def _send_and_receive(self, target, lun, netfn, cmdid, payload):\n \n self._inc_sequence_number()\n\n header = IpmbHeaderReq()\n header.netfn = netfn\n header.rs_lun = lun\n header.rs_sa = target.ipmb_address\n header.rq_seq = self.next_sequence_number\n head...
[ "def _make_read_lob_request(self, readoffset, readlength):\n \n self._connection._check_closed()\n\n request = RequestMessage.new(\n self._connection,\n RequestSegment(\n message_types.READLOB,\n (ReadLobRequest(self._lob_header.locator_id, re...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about software development:" }
// cksum is an implementation of the POSIX CRC algorithm
[ "func cksum(r io.Reader) (uint32, int, error) {\n\tin := bufio.NewReader(r)\n\tcount := 0\n\tvar sum uint32\n\tf := func(b byte) {\n\t\tfor i := 7; i >= 0; i-- {\n\t\t\tmsb := sum & (1 << 31)\n\t\t\tsum = sum << 1\n\t\t\tif msb != 0 {\n\t\t\t\tsum = sum ^ posixPolynomial\n\t\t\t}\n\t\t}\n\t\tsum ^= uint32(b)\n\t}\n...
[ "def get_finished_record_bytes(cls, tls_version: TlsVersionEnum) -> bytes:\n \n # TODO(AD): The ROBOT poc script uses the same Finished record for all possible client hello (default, GCM,\n # etc.); as the Finished record contains a hashes of all previous records, it will be wrong and will caus...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Deletes the given role. @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to delete this role @param \eZ\Publish\API\Repository\Values\User\Role $role
[ "public function deleteRole(Role $role)\n {\n $returnValue = $this->service->deleteRole($role);\n $this->signalDispatcher->emit(\n new DeleteRoleSignal(\n array(\n 'roleId' => $role->id,\n )\n )\n );\n\n return $re...
[ "public function ensureContentTypeGroupExists($identifier)\n {\n /** @var \\eZ\\Publish\\API\\Repository\\ContentTypeService */\n $contentTypeService = $this->contentTypeService;\n\n $found = false;\n // verify if the content type group exists\n try {\n $contentTypeG...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Convert to array @return array
[ "public function toArray(): array\n {\n $result = [\n 'terms' => array_merge([\n 'field' => $this->field,\n 'size' => $this->size,\n ], $this->additionalParams),\n ];\n\n if ($this->subAggregations) {\n $result['aggs'] = $this->...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Initialize the singleton. @return AnsiToHtmlConverter
[ "private static function getInstance()\n {\n if (self::$converter === null) {\n self::$converter = new AnsiToHtmlConverter(null, false);\n }\n\n return self::$converter;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Construct the internal pattern to test the urls against @param string $path @param string $routePattern @return boolean @throws \Exception
[ "private function constructInternalRegularExpression($path, $routePattern)\n {\n if (empty($routePattern)) return false;\n\n $fullRoute = $path;\n\n if (substr($fullRoute, -1) == '/') {\n $fullRoute = substr($fullRoute, 0, -1);\n }\n\n $fullRoute .= $routePattern;\n\...
[ "private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about Software development:" }
Return text generated by this fragment for a PreparedStatement @param context A ControlBeanContext instance. @param m The annotated method. @param args The method's parameters @return Always returns a PREPARED_STATEMENT_SUB_MARK
[ "protected String getPreparedStatementText(ControlBeanContext context, Method m, Object[] args) {\n // this reflection fragment may resolve to a JdbcControl.ComplexSqlFragment\n // if so it changes the behavior a bit.\n Object val = getParameterValue(context, m, args);\n if (val instance...
[ "protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// SetRunConfiguration sets the RunConfiguration field's value.
[ "func (s *StartApplicationInput) SetRunConfiguration(v *RunConfiguration) *StartApplicationInput {\n\ts.RunConfiguration = 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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Binds a module. @param module the module
[ "@Bind(optional = true, aggregate = true)\n public synchronized void bindModule(Module module) {\n register(module);\n }" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Repack a record into a cleaner structure for consumption.
[ "def reformat_record(record):\n \"\"\"\"\"\"\n return {\n \"key\": record[\"dynamodb\"].get(\"Keys\", None),\n \"new\": record[\"dynamodb\"].get(\"NewImage\", None),\n \"old\": record[\"dynamodb\"].get(\"OldImage\", None),\n\n \"meta\": {\n \"created_at\": record[\"dynam...
[ "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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
// Time converts UUID Timestamp to UTC time.Time // Note some higher clock resolutions will lose accuracy if above 100 ns ticks
[ "func (o Timestamp) Time() time.Time {\n\treturn time.Unix(0, int64((o-gregorianToUNIXOffset)*100)).UTC()\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 about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Gets the direct message with the given id. https://dev.twitter.com/docs/api/1.1/get/direct_messages/show :param str id: (*required*) The ID of the direct message. :returns: A direct message dict.
[ "def direct_messages_show(self, id):\n \n params = {}\n set_str_param(params, 'id', id)\n d = self._get_api('direct_messages/show.json', params)\n d.addCallback(lambda dms: dms[0])\n return d" ]
[ "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 text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Stop signal by server.
[ "def external_stop(self, force):\n \n\n # only the master processes handles the regular stop signal from the server, sending a SIGINT to\n # all its child (means to us, non-master process)\n if not self.is_master_process():\n if force:\n # make sure even the sub...
[ "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 about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Authenticated user. @return User identity @throws IOException If fails
[ "public Identity identity() throws IOException {\n final Iterator<String> headers =\n new RqHeaders.Base(this).header(this.header).iterator();\n final Identity user;\n if (headers.hasNext()) {\n user = new CcPlain().decode(\n new Utf8String(headers.next()).a...
[ "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 programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Main operator lookup routine; lookup an operator (either unary or binary) in its corresponding map. If there's a matching operator, its resolve routine is called and the result is returned; otherwise the result of a fallback function is returned.
[ "private <O> OperatorSymbol resolve(Tag tag, Map<Name, List<O>> opMap, Predicate<O> opTestFunc,\n Function<O, OperatorSymbol> resolveFunc, Supplier<OperatorSymbol> noResultFunc) {\n return opMap.get(operatorName(tag)).stream()\n .filter(opTestFunc)\n .map(r...
[ "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:" }
Retrieves the requested column's data from the given row. @cat_time_ns: If the column_name has "_time" in it, will concatenate the column with any column having the same name but "_time_ns".
[ "def get_row_data(row, column_name, cat_time_ns = True):\n \n column_name_ns = re.sub(r'_time', r'_time_ns', column_name)\n try:\n rowattrs = [attr for attr in row.__slots__]\n except AttributeError:\n rowattrs = [attr for attr in row.__dict__.iterkeys()]\n\n if cat_time_ns and \"_time\...
[ "def _extract_lookup(self, key):\n \"\"\"\"\"\"\n parts = key.split('__')\n # 'exact' is the default lookup if there was no explicit comparison op in `key`\n # Assume there is only one `__` in the key.\n # FIXME Change for child attribute query support\n op = 'exact' if...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Uniform buffer objects. Handles blocks of uniform on the GPU. If WebGL 2 is not available, this class falls back on traditionnal setUniformXXX calls. For more information, please refer to : https://www.khronos.org/opengl/wiki/Uniform_Buffer_Object
[ "function UniformBuffer(engine, data, dynamic) {\n this._engine = engine;\n this._noUBO = !engine.supportsUniformBuffers;\n this._dynamic = dynamic;\n this._data = data || [];\n this._uniformLocations = {};\n this._uniformSizes = {};\n thi...
[ "function W3CWebSocket(uri, protocols) {\n\tvar native_instance;\n\n\tif (protocols) {\n\t\tnative_instance = new NativeWebSocket(uri, protocols);\n\t}\n\telse {\n\t\tnative_instance = new NativeWebSocket(uri);\n\t}\n\n\t/**\n\t * 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket\n\t * cl...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Retry sending request until timeout or until receiving a response.
[ "def _make_request_to_server(self, query_function, raise_for_status=True,\n time_limit_seconds=2, retry_delay_seconds=0.2):\n \n start_time = datetime.datetime.now()\n while datetime.datetime.now() - start_time < datetime.timedelta(\n 0, time_limit_...
[ "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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// Warn log content as Warn
[ "func (s *SyslogLogger) Warn(v ...interface{}) {\n\ts.w.Warning(fmt.Sprint(v...))\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 sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
-- Protected Methods ----------------------------------------------------
[ "function (query, results) {\n // Filter components out of the results.\n return YArray.filter(results, function (result) {\n return result.raw.resultType === 'component' ? false : result;\n });\n }" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Reverse any content :type contenttoreverse: string :param contenttoreverse: The content to be reversed :type reeval: boolean :param reeval: Wether or not to reconvert the object back into it's initial state. Default is "True".
[ "def reversetext(contenttoreverse, reconvert=True):\n \n\n # If reconvert is specified\n if reconvert is True:\n # Return the evalated form\n return eval(\n str(type(contenttoreverse)).split(\"'\")[1] + \"('\" +\n str(contenttoreverse)[::-1] + \"')\")\n\n # Return the...
[ "def _wrap_field(field):\n \"\"\"\"\"\"\n class WrappedField(field):\n def output(self, key, obj):\n value = _fields.get_value(key if self.attribute is None else self.attribute, obj)\n\n # For all fields, when its value was null (None), return null directly,\n # instea...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Get value for node or attribute. @param string $key @return string
[ "protected function getValue($key)\n {\n if (isset($key[0]) && $key[0] === self::CONST_PREFIX) {\n // If string starts with \"=\" symbol\n // then cut it and return plain string.\n return substr($key, 1);\n }\n\n // Get value using a dot notation\n $da...
[ "def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]" ]
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Delete the controllers for the module, given by its ID, from the storage. @param string $moduleId The ID of the module, for which we want to delete the controllers from the storage.
[ "public function remove($moduleId)\n {\n $controllerMap = $this->get();\n unset($controllerMap[strtolower($moduleId)]);\n\n $this->set($controllerMap);\n }" ]
[ "function DefaultChangeRequestInterceptor(saveContext, saveBundle) {\n /**\n Prepare and return the save data for an entity change-set.\n\n The adapter calls this method for each entity in the change-set,\n after it has prepared a \"change request\" for that object.\n\n The method can do anything...
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// Times returns all time-based sections in order.
[ "func (ce *CronEntry) Times(theTime time.Time) []TimeSectionMap {\n\treturn []TimeSectionMap{\n\t\tTimeSectionMap{\n\t\t\tTime: theTime.Minute(),\n\t\t\tSection: ce.Minute,\n\t\t},\n\t\tTimeSectionMap{\n\t\t\tTime: theTime.Hour(),\n\t\t\tSection: ce.Hour,\n\t\t},\n\t\tTimeSectionMap{\n\t\t\tTime: theTime.D...
[ "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 description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
给定时间,获取一年中的第几天。 @param date 时间({@link Date}) @return (Integer),如果date is null,将返回null
[ "public static Integer getDayOfYear(Date date) {\n\n if (date == null)\n return null;\n\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(date);\n\n return calendar.get(Calendar.DAY_OF_YEAR);\n }" ]
[ "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 text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about text processing:" }
Perform the given request and return the response. @param \GuzzleHttp\Psr7\Request $request @return \GuzzleHttp\Psr7\Response
[ "protected function send(Request $request)\n {\n try {\n $response = $this->client->send($request);\n } catch (ClientException $e) {\n $response = $e->getResponse();\n } catch (ServerException $e) {\n $response = $e->getResponse();\n }\n\n retur...
[ "public function run()\n {\n $this->loadMiddleware();\n\n //~ Default response\n $response = new HttpMessage\\Response();\n //$response->getBody()->write('-- static --');\n\n //~ Get response\n $stack = new HttpMiddleware\\Stack($response, $this->middleware);\n ...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// NamedExec a named query within a transaction. // Any named placeholder parameters are replaced with fields from arg.
[ "func (tx *Tx) NamedExec(query string, arg interface{}) (sql.Result, error) {\n\treturn NamedExec(tx, query, arg)\n}" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Special treatment for our guys in Redmond Windows-1252 is basically ISO-8859-1 -- with some exceptions, which get dealt with here @param string $string Your input in ISO-8859-1 @return string The resulting Win1252 string @since 0.0.1
[ "private function mapIso8859_1ToWindows1252($string = '')\n {\n $return = '';\n for ($i = 0; $i < strlen($string); ++$i) {\n $codePoint = ord($string{$i});\n switch ($codePoint) {\n case 196:\n $return .= chr(142);\n break;\...
[ "private String parseString(final ImageInputStream pInput, final int pLength) throws IOException {\n byte[] data = new byte[pLength];\n pInput.readFully(data);\n\n // NOTE: The IPTC specification says character data should use ISO 646 or ISO 2022 encoding.\n // UTF-8 contains all 646 cha...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Marshall the given parameter object.
[ "public void marshall(SubModule subModule, ProtocolMarshaller protocolMarshaller) {\n\n if (subModule == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(subModule.getCommitId(), COMMITID_BIND...
[ "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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
/* Encode and decode 64 bit integers
[ "public static int enc_uint64be ( long l, byte[] dst, int di ) {\n enc_uint32be((int) ( l & 0xFFFFFFFFL ), dst, di + 4);\n enc_uint32be((int) ( ( l >> 32L ) & 0xFFFFFFFFL ), dst, di);\n return 8;\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 instruction about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
This function can be used by workers to send a message to the master
[ "function(message) {\n var pack = {\n toMaster: true,\n toWorkers: false,\n toSource: false,\n message: message,\n source: process.pid\n }\n dispatch(pack)\n }" ]
[ "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:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Returns the table whoose name is tablename.
[ "def get_table(self, tablename):\n \n temp = filter(lambda x: x.name == tablename, self.tables)\n if temp == list():\n raise Exception(\"No such table\")\n return temp[0]" ]
[ "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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Create an instance of {@link JAXBElement }{@code <}{@link ArithType }{@code >}}
[ "@XmlElementDecl(namespace = \"http://www.w3.org/1998/Math/MathML\", name = \"divide\")\n public JAXBElement<ArithType> createDivide(ArithType value) {\n return new JAXBElement<ArithType>(_Divide_QNAME, ArithType.class, null, value);\n }" ]
[ "@SuppressWarnings(\"unchecked\")\n public Map<String, Field> getValueAsMap() {\n return (Map<String, Field>) type.convert(getValue(), Type.MAP);\n }" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
BELScript.g:81:1: unset_statement_group : 'UNSET' STATEMENT_GROUP_KEYWORD ;
[ "public final BELScriptParser.unset_statement_group_return unset_statement_group() throws RecognitionException {\n BELScriptParser.unset_statement_group_return retval = new BELScriptParser.unset_statement_group_return();\n retval.start = input.LT(1);\n\n Object root_0 = null;\n\n Token s...
[ "def t_ATOM(self, t):\n '\n t.type = PLLexer.reserved.get(t.value, 'ATOM') # Check for reserved words\n return t" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Regular expressions:" }
Converts private key to DER format. @param string $privateKey @param string $privateKyePassword @return string @throws PrivateKeyToDerConvertingException
[ "public function privateKeyToDer($privateKey, $privateKyePassword = '')\n {\n try {\n if (strlen($privateKyePassword) === 0) {\n return CryptoVirgilKeyPair::privateKeyToDER($privateKey);\n }\n\n return CryptoVirgilKeyPair::privateKeyToDER(\n $...
[ "def DeserializeExclusiveData(self, reader):\n \n if self.Version is not 0:\n raise Exception('Invalid format')\n\n self.PublicKey = ECDSA.Deserialize_Secp256r1(reader)" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Properly escapes an authorization string. The string can be quoted if desired. @param auth authorization string, as UTF-8 encoded bytes @param quote true to wrap escaped authorization in quotes @return escaped authorization string
[ "public static byte[] escape(byte[] auth, boolean quote) {\n int escapeCount = 0;\n\n for (int i = 0; i < auth.length; i++) {\n if (auth[i] == '\"' || auth[i] == '\\\\') {\n escapeCount++;\n }\n }\n\n if (escapeCount > 0 || quote) {\n byte[...
[ "def _safe_match_string(value):\n \"\"\"\"\"\"\n if not isinstance(value, six.string_types):\n if isinstance(value, bytes): # should only happen in py3\n value = value.decode('utf-8')\n else:\n raise GraphQLInvalidArgumentError(u'Attempting to convert a non-string into a s...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Replaces all the occurences which match the given pattern with the given replacement. @param Text $text @param string $pattern @param string $replacement @api
[ "public function replaceAll(Text $text, $pattern, $replacement)\n {\n $input = array(\n 'text' => $text,\n 'pattern' => $pattern,\n 'replacement' => $replacement,\n );\n $this->commandInvoker->run('replace_all', $input);\n }" ]
[ "function DocBlockParser(conf) {\n conf = conf || {};\n this.docBlockPattern = conf.docBlockPattern || '\\\\\\/\\\\\\*\\\\\\*[^]*?\\\\\\*\\\\\\/';\n this.docBlockStrip = '(^\\\\\\s*\\\\\\/\\\\\\*\\\\\\*)|(\\\\\\*\\\\\\/\\\\\\s*$)';\n\n this.docLineStrip = '^\\\\\\s*\\\\\\* ?';\n\n /**\n * Skip markdown parsi...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Computer Science:" }
Replies the node that is corresponding to the given zone. @param zone the zone. @return the child node for the given zone, or <code>null</code>
[ "@Pure\n\tpublic N getChildAt(IcosepOctTreeZone zone) {\n\t\tif (zone == IcosepOctTreeZone.ICOSEP) {\n\t\t\treturn this.nicosep;\n\t\t}\n\t\treturn getChildAt(zone.toOctTreeZone());\n\t}" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Get the affine matrix that will be applied by `refresh`.
[ "def affine_mat(self)->AffineMatrix:\n \"\"\n if self._affine_mat is None:\n self._affine_mat = torch.eye(3).to(self.device)\n return self._affine_mat" ]
[ "def axis_transform(pca_axes):\n \n from_ = N.identity(3)\n to_ = pca_axes\n\n # Find inverse transform for forward transform\n # y = M x -> M = y (x)^(-1)\n # We don't need to do least-squares since\n # there is a simple transformation\n trans_matrix = N.linalg.lstsq(from_,to_)[0]\n retu...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
/* (non-Javadoc) @see com.ibm.wsspi.injectionengine.InjectionBinding#merge(java.lang.annotation.Annotation, java.lang.Class, java.lang.reflect.Member)
[ "@Override\n public void merge(@Sensitive MailSessionDefinition annotation, Class<?> instanceClass, Member member) throws InjectionException {\n final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();\n if (isTraceOn && tc.isEntryEnabled())\n Tr.entry(tc, \"merge: name=\" + getJn...
[ "@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Allow the scheme to be set like a Hash.
[ "def []=( color_tag, constants )\n @scheme[to_key(color_tag)] = constants.respond_to?(:map) ?\n constants.map { |c| to_constant(c) }.join : to_constant(constants)\n end" ]
[ "@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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Creates an icon button.<p> @param name the name @param description the description @param icon the icon @return the created button
[ "public static Button createIconButton(String name, String description, Resource icon) {\n\n return createIconButton(name, description, icon, I_CmsAppButtonProvider.BUTTON_STYLE_TRANSPARENT);\n }" ]
[ "public String button (String name, String text, String extra)\n {\n return fixedInput(\"button\", name, text, extra);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
encrypt personal data and return an encrypted form @param PersonalData $data @param CryptographicDetails $crypto @throws CryptographicDetailsDoNotContainKey @throws CryptographicDetailsNotCompatibleWithEncryption @return EncryptedPersonalData
[ "function encrypt(PersonalData $data, CryptographicDetails $crypto): EncryptedPersonalData {\n\n if ( ! $crypto->encryption() == 'libsodium') {\n throw new CryptographicDetailsNotCompatibleWithEncryption(\"{$crypto->encryption()} received, expected 'libsodium'\");\n }\n\n $dataString...
[ "private function putGatewayResponseToHolder() {\n /* @var $gatewayResponseHolder GatewayResponseHolder */\n $gatewayResponseHolder = ObjectManager::getInstance()->get(GatewayResponseHolder::class);\n $gatewayResponseHolder->setGatewayResponse($this->gatewayResponse['response']['message']);\n ...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
// Handle triggers the collect-metrics hook and writes collected metrics // to the specified connection.
[ "func (l *handler) Handle(c net.Conn, abort <-chan struct{}) error {\n\tdefer c.Close()\n\n\t// TODO(fwereade): 2016-03-17 lp:1558657\n\terr := c.SetDeadline(time.Now().Add(spool.DefaultTimeout))\n\tif err != nil {\n\t\treturn errors.Annotate(err, \"failed to set the deadline\")\n\t}\n\n\terr = l.config.charmdir.Vi...
[ "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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
validates method signature as described at {@link Pact}
[ "private boolean conformsToSignature(Method m) {\n Pact pact = m.getAnnotation(Pact.class);\n boolean conforms =\n pact != null\n && MessagePact.class.isAssignableFrom(m.getReturnType())\n && m.getParameterTypes().length == 1\n && m.getParameterTypes()[0].is...
[ "@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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Check if directory exists (in current location)
[ "def directory_exists(self, directory):\n \"\"\"\"\"\"\n file_list = []\n self.session.retrlines('LIST', file_list.append)\n return any(f.split()[-1] == directory and f.upper().startswith('D') for f in file_list)" ]
[ "def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
/* (non-Javadoc) @see es.upm.dit.gsi.shanks.model.scenario.Scenario#generateFailures()
[ "public void generateNetworkElementsEvents(ShanksSimulation sim)\n throws ShanksException {\n super.generateNetworkElementEvents(sim);\n for (Scenario scenario : this.scenarios.keySet()) {\n scenario.generateNetworkElementEvents(sim);\n }\n }" ]
[ "private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
微信支付公共POST方法(不带证书) @param url 请求路径 @param key 商户KEY @param params 参数 @return
[ "@Override\n public NutMap postPay(String url, String key, Map<String, Object> params) {\n params.remove(\"sign\");\n String sign = WxPaySign.createSign(key, params);\n params.put(\"sign\", sign);\n Request req = Request.create(url, METHOD.POST);\n req.setData(Xmls.mapToXml(par...
[ "protected function genSign(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 Github text about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about programming:" }
// Called by higher layers to create the plugin SDN node instance
[ "func New(c *OsdnNodeConfig) (*OsdnNode, error) {\n\tvar policy osdnPolicy\n\tvar pluginId int\n\tvar minOvsVersion string\n\tvar useConnTrack bool\n\tswitch strings.ToLower(c.PluginName) {\n\tcase network.SingleTenantPluginName:\n\t\tpolicy = NewSingleTenantPlugin()\n\t\tpluginId = 0\n\tcase network.MultiTenantPlu...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Removes YAML frontmatter
[ "def strip_frontmatter(source)\n frontmatter = /\n # From the start of the string\n \\A\n # First-capture match --- followed by optional whitespace up\n # to a newline then 0 or more chars followed by an optional newline.\n # This matches the --- and the contents of the front...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code:" }
Adds a {@link FocusEvent} handler. @param handler the handler @return returns the handler registration
[ "@Override\n public HandlerRegistration addFocusHandler(FocusHandler handler) {\n\treturn ensureHandlers().addHandler(FocusEvent.getType(), handler);\n }" ]
[ "function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Loads an entire json configuration object which would mostly contain many sub-sections like "core-site.xml" and "hdfs-site.xml" @param json the json object to load @throws JSONException on error
[ "private void loadEntireJsonObject(JSONObject json) throws JSONException {\n Iterator<?> it = json.keys();\n while (it.hasNext()) {\n // This key is something like core-site.xml or hdfs-site.xml\n Object obj = it.next();\n if (!(obj instanceof String)) {\n LOG.warn(\"Object not instance ...
[ "def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about AWS Auto Scaling:" }
// MakeToken makes a distributor Token out of an Execution_ID. In this // implementation of a Distributor there's a 1:1 mapping between Execution_ID // and distributor task. This is not always the case for real distributor // implementations.
[ "func MakeToken(eid *dm.Execution_ID) distributor.Token {\n\treturn distributor.Token(fmt.Sprintf(\"fakeDistributor:%s|%d|%d\", eid.Quest,\n\t\teid.Attempt, eid.Id))\n}" ]
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Retrieve suggest collection for query @return Collection
[ "private function getSuggestCollection()\n {\n $queryCollection = $this->queryFactory->get()->getSuggestCollection();\n $queryCollection->addFieldToFilter('is_spellchecked', 'false')->setPageSize($this->getResultsPageSize());\n\n return $queryCollection;\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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// Parse returns a ConfigContainer with parsed json config map.
[ "func (js *JSONConfig) Parse(filename string) (Configer, error) {\n\tfile, err := os.Open(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\tcontent, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn js.ParseData(content)\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Load configs from packages. @return void
[ "private function loadConfigPackages()\n {\n $config = Container::getInstance()->get('config');\n $list = $config->get('global.package');\n\n if (empty($list) || !is_array($list)) {\n return;\n }\n\n foreach ($list as $name => $data) {\n if (!isset($data...
[ "def load_tasks(self, cmd, params, args):\n \"\"\"\"\"\"\n return generate_tasks('taskname that shows up in log', self._gen_tasks()), self.DOIT_CONFIG" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "func (in *StatusResponse) DeepCopyInto(out *StatusResponse) {\n\t*out = *in\n\tif in.Cilium != nil {\n\t\tin, out := &in.Cilium, &out.Cilium\n\t\t*out = new(Status)\n\t\t**out = **in\n\t}\n\tif in.Cluster != nil {\n\t\tin, out := &in.Cluster, &out.Cluster\n\t\t*out = new(ClusterStatus)\n\t\t(*in).DeepCopyInto(*out...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// CountStmtNode records the number of statements with the same type.
[ "func CountStmtNode(stmtNode ast.StmtNode, inRestrictedSQL bool) {\n\tif inRestrictedSQL {\n\t\treturn\n\t}\n\n\ttypeLabel := GetStmtLabel(stmtNode)\n\tswitch typeLabel {\n\tcase \"Use\":\n\t\tstmtNodeCounterUse.Inc()\n\tcase \"Show\":\n\t\tstmtNodeCounterShow.Inc()\n\tcase \"Begin\":\n\t\tstmtNodeCounterBegin.Inc(...
[ "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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Load layout options @param string $methodCalled @return Nexcessnet_Turpentine_Block_Core_Messages
[ "protected function _handleDirectCall($methodCalled) {\n // this doesn't actually do anything because _real_toHtml() won't be\n // called in this request context (unless the flash message isn't\n // actually supposed to be ajax/esi'd in)\n $this->_directCall = $methodCalled;\n if ...
[ "public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio...
codesearchnet
{ "query": "Represent the post about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
Get all your friends who are offline. @return A list of all your offline Friends
[ "public List<Friend> getOfflineFriends() {\n\t\treturn getFriends(new Filter<Friend>() {\n\n\t\t\tpublic boolean accept(Friend friend) {\n\t\t\t\treturn !friend.isOnline();\n\t\t\t}\n\t\t});\n\t}" ]
[ "public function lastOnlineDate() : ?\\DateTime\n {\n $isOnline = $this->info()->presences[0]->onlineStatus == \"online\";\n\n // They're online now, so just return the current DateTime.\n if ($isOnline) return new \\DateTime();\n\n // If they don't have a DateTime, just return null.\...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Setup JWT configuration.
[ "protected function setupConfig()\n {\n // setup time to live (in minutes), defaults to 60.\n $this->ttl = $this->config->get('jwt.ttl', 60);\n\n // setup refresh limit (in minutes), defaults to 7200 (5 days)\n $this->refreshLimit = $this->config->get('jwt.refresh_limit', 7200);\n\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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Adds the view directories defined in $viewDirs to the publish procedure. Can be overriden to adjust default functionality
[ "protected function bootViews()\n {\n if (isset($this->dir) and isset($this->viewDirs) and is_array($this->viewDirs)) {\n foreach ($this->viewDirs as $dirName => $namespace) {\n $viewPath = $this->getViewsPath($dirName);\n $viewsDestinationPath = Str::r...
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Closes selenium session when suite finished to run @see org.testng.ISuiteListener#onFinish(org.testng.ISuite)
[ "@Override\n public void onFinish(ISuite suite) {\n logger.entering(suite);\n if (ListenerManager.isCurrentMethodSkipped(this)) {\n logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);\n return;\n }\n LocalGridManager.shutDownHub();\n logger.exiting();\n ...
[ "public void run() {\n if (isCompleted()) {\n log.info(\"Not executing tests as application state is completed!\");\n return;\n }\n\n log.info(String.format(\"Running Citrus %s\", Citrus.getVersion()));\n setDefaultProperties(configuration);\n\n if (ClassUtil...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Add a routing resource. @param string $name @param string $bundle @param string $format @param string $path
[ "public function addResource($name, $bundle, $format, $path = 'routing')\n {\n $resource = '@'.$bundle.$path.'.'.$format;\n $yaml = $this->getContent();\n if (!isset($yaml[$name]) || $yaml[$name]['resource'] != $resource) {\n $yaml[$name] = ['resource' => $resource];\n ...
[ "protected function buildHomeRoute(Router $router)\n {\n $action = $this->normalizeRouteAction($this->getDefaultHomeAction());\n\n // Guarantee that the home route has the expected name\n $router->get('/', array_set($action, 'as', NamedRoute::HOME));\n }" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Configures the batch to transfer batches of requests. Associates a {@see \Guzzle\Http\BatchRequestTransfer} object as both the transfer and divisor strategy. @param int $batchSize Batch size for each batch of requests @return BatchBuilder
[ "public function transferRequests($batchSize = 50)\n {\n $className = self::$mapping['request'];\n $this->transferStrategy = new $className($batchSize);\n $this->divisorStrategy = $this->transferStrategy;\n\n return $this;\n }" ]
[ "@Override\n protected <T1, R extends Completes<?>> R dispatchQuery(BiFunction<P, T1, R> query, T1 routable1) {\n throw new UnsupportedOperationException(\"query protocols are not supported by this router by default\");\n }" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Add an route link. @return Html instance
[ "public function url($text, $url, $parameters = [], $secure = null)\n {\n return $this->addElement('a')->text($text)\n ->href(url($url, $parameters, $secure));\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github sentence about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
Marshall the given parameter object.
[ "public void marshall(UpdateRuleRequest updateRuleRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (updateRuleRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(updateRuleRequ...
[ "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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }