query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Gets the list of <em>instances</em> associated to a virtual host name. @param virtualHostName the virtual hostname for which the instances need to be returned. @return list of <em>instances</em>.
[ "public List<InstanceInfo> getInstancesByVirtualHostName(String virtualHostName) {\n return Optional.ofNullable(this.virtualHostNameAppMap.get(virtualHostName.toUpperCase(Locale.ROOT)))\n .map(VipIndexSupport::getVipList)\n .map(AtomicReference::get)\n .orElseGet(Collections:...
[ "func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Handle the deleted event for the Ban model. @param \Cog\Contracts\Ban\Ban $ban @return void
[ "public function deleted(BanContract $ban): void\n {\n $bannable = $ban->bannable()->withBanned()->first();\n if ($bannable->bans->count() === 0) {\n $bannable->unsetBannedFlag()->save();\n\n event(new ModelWasUnbanned($bannable));\n }\n }" ]
[ "public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }" ]
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software development:" }
Clear sequence numbers in column 1-6 and anything beyond column 72. @param line the line of code @return a line of code without sequence numbers
[ "public String cleanFixedLine(final String line) {\n\n StringBuilder cleanedLine = new StringBuilder();\n int length = line.length();\n\n /* Clear sequence numbering */\n for (int i = 0; i < _startColumn - 1; i++) {\n cleanedLine.append(\" \");\n }\n\n /* Trim an...
[ "private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// DisableVanityNameServers Vanity Name Servers for the given domain // // See https://developer.dnsimple.com/v2/vanity/#disable
[ "func (s *VanityNameServersService) DisableVanityNameServers(accountID string, domainIdentifier string) (*vanityNameServerResponse, error) {\n\tpath := versioned(vanityNameServerPath(accountID, domainIdentifier))\n\tvanityNameServerResponse := &vanityNameServerResponse{}\n\n\tresp, err := s.client.delete(path, nil,...
[ "def delete_domain(self, domain, params=None):\n ''' \n '''\n params = update_params(params, {'domain': domain})\n return self.request('/v1/dns/delete_domain', params, 'POST')" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
/* eslint-disable
[ "function adaptor(prompt) {\n prompt = { ...prompt }\n switch (prompt.type) {\n case 'confirm':\n prompt.type = 'checkbox'\n prompt.transformType = 'confirm'\n prompt.value = [prompt.value]\n prompt.choices = [\n { label: 'Yes?', value: true }\n ]\n break\n case 'list':\...
[ "function printDebugWithCode(msg, code) {\n // eslint-disable-next-line no-console\n console.log(`\\n\\n${msg}:\\n`);\n // eslint-disable-next-line no-console\n console.log(`${highlightFn(code)}\\n`);\n}" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Create new array <p>Stack: ..., count =&gt; ..., arrayref @param name @param aClass @param size @throws IOException
[ "public void addNewArray(String name, Class<?> aClass, int size) throws IOException\r\n {\r\n addNewArray(name, Typ.getTypeFor(aClass), size);\r\n }" ]
[ "def backward_word(self, e): # (M-b)\r\n \"\"\"\r\n self.l_buffer.backward_word(self.argument_reset)\r\n self.finalize()" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)\n {\n switch (featureID)\n {\n case SimpleAntlrPackage.OPTIONS__OPTION_VALUES:\n return ((InternalEList<?>)getOptionValues()).basicRemove(otherEnd, msgs);\n }\n return supe...
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the Github instruction about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
// IsValidOsArch checks if a OS-architecture combination is valid given a map // of valid OS-architectures
[ "func IsValidOSArch(labels map[ACIdentifier]string, validOSArch map[string][]string) error {\n\tif os, ok := labels[\"os\"]; ok {\n\t\tif validArchs, ok := validOSArch[os]; !ok {\n\t\t\t// Not a whitelisted OS. TODO: how to warn rather than fail?\n\t\t\tvalidOses := make([]string, 0, len(validOSArch))\n\t\t\tfor va...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// ListEmailForwards lists the email forwards for a domain. // // See https://developer.dnsimple.com/v2/domains/email-forwards/#list
[ "func (s *DomainsService) ListEmailForwards(accountID string, domainIdentifier string, options *ListOptions) (*emailForwardsResponse, error) {\n\tpath := versioned(emailForwardPath(accountID, domainIdentifier, 0))\n\tforwardsResponse := &emailForwardsResponse{}\n\n\tpath, err := addURLQueryOptions(path, options)\n\...
[ "def _generate_api_gateway(self):\n \n self.tf_conf['resource']['aws_api_gateway_rest_api']['rest_api'] = {\n 'name': self.resource_name,\n 'description': self.description\n }\n self.tf_conf['output']['rest_api_id'] = {\n 'value': '${aws_api_gateway_rest_...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// RoundDown will round tp down to next "full" d.
[ "func RoundDown(t time.Time, d TimeDelta) time.Time {\n\ttd := d.RoundDown(t)\n\tDebugLogger.Printf(\"RoundDown( %s, %s ) --> %s\", t.Format(\"2006-01-02 15:04:05 (Mon)\"), d.String(),\n\t\ttd.Format(\"2006-01-02 15:04:05 (Mon)\"))\n\treturn td\n}" ]
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Add method info. @param methodInfoList the method info list @param classNameToClassInfo the map from class name to class info
[ "void addMethodInfo(final MethodInfoList methodInfoList, final Map<String, ClassInfo> classNameToClassInfo) {\n for (final MethodInfo mi : methodInfoList) {\n // Index method annotations\n addFieldOrMethodAnnotationInfo(mi.annotationInfo, /* isField = */ false, classNameToClassInfo);\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 comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
send the transaction using the API @param string|array $signed @param string[] $paths @param bool $checkFee @return string the complete raw transaction @throws \Exception
[ "protected function sendTransaction($signed, $paths, $checkFee = false) {\n return $this->sdk->sendTransaction($this->identifier, $signed, $paths, $checkFee);\n }" ]
[ "public static function createNotMerged(Envelope $envelope, \\Exception $e = null)\n {\n $message = 'The given DigiDoc envelope must be merged with Api (using Api::merge) before calling this method.';\n\n return new static($message, null, $e);\n }" ]
codesearchnet
{ "query": "Represent the sentence about API documentation:", "pos": "Represent the code about API documentation:", "neg": "Represent the code about API documentation:" }
Register application provider Workaround for BC break in https://github.com/laravel/framework/pull/25028 @param string $providerName @param bool $force
[ "protected function appRegister($providerName, $force = false)\n {\n if (!$this->appRegisterParameters) {\n $method = new \\ReflectionMethod(get_class($this->app), 'register');\n $this->appRegisterParameters = count($method->getParameters());\n }\n\n if ($this->appRegis...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Sets or resets the order of the existing schemas in the current search path of the user. This is a PostgreSQL only function. @return void
[ "public function determineExistingSchemaSearchPaths()\n {\n $names = $this->getSchemaNames();\n $paths = $this->getSchemaSearchPaths();\n\n $this->existingSchemaPaths = array_filter($paths, static function ($v) use ($names) {\n return in_array($v, $names);\n });\n }" ]
[ "@Override\n protected List<SuperColumn> loadSuperColumns(String keyspace, String columnFamily, String rowId,\n String... superColumnNames) {\n throw new UnsupportedOperationException(\n \"Support for super columns is not available with DS java driver. Either use Thrift or pelops for the...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
/* (non-Javadoc) @see javax.security.enterprise.authentication.mechanism.http.HttpMessageContext#forward(java.lang.String)
[ "@Override\n public AuthenticationStatus forward(String path) {\n try {\n RequestDispatcher requestDispatcher = request.getRequestDispatcher(path);\n requestDispatcher.forward(request, response);\n } catch (Exception e) {\n // TODO: Add serviceability message\n ...
[ "@Override\n public void removeSSOCookieFromResponse(HttpServletResponse resp) {\n if (resp instanceof com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) {\n ((com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) resp).removeCookie(getSSOCookiename());\n removeJwtSSOCookies((com....
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
@param Shopgate_Model_XmlResultObject $itemNode @return Shopgate_Model_XmlResultObject
[ "public function asXml(Shopgate_Model_XmlResultObject $itemNode)\n {\n /**\n * @var Shopgate_Model_XmlResultObject $stockNode\n */\n $identifierNode = $itemNode->addChildWithCDATA('identifier', $this->getValue());\n $identifierNode->addAttribute('uid', $this->getUid());\n ...
[ "public function getFromId( $FileUploadId){\n $rest = $this->getService( self::API_UPLOAD . $FileUploadId);\n $rest->GET();\n\n return $rest->getResult( models\\FileSystem\\FileUpload::class);\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
创建BeanCopier @param <T> 目标Bean类型 @param source 来源对象,可以是Bean或者Map @param dest 目标Bean对象 @param copyOptions 拷贝属性选项 @return BeanCopier
[ "public static <T> BeanCopier<T> create(Object source, T dest, CopyOptions copyOptions) {\r\n\t\treturn create(source, dest, dest.getClass(), copyOptions);\r\n\t}" ]
[ "public static XmlTypeConvert resolve(BeanUtils.CustomPropertyDescriptor filed) {\n XmlTypeConvert convert;\n if (filed.isGeneralType() || filed.isBasic()) {\n convert = XmlTypeConverterUtil.converters.get(filed.getTypeName());\n } else if (String.class.equals(filed.getRealType())) {...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// SetCertificate sets the Certificate field's value.
[ "func (s *SslConfiguration) SetCertificate(v string) *SslConfiguration {\n\ts.Certificate = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
/* (non-Javadoc) @see org.joml.Matrix4x3fc#rotateX(float, org.joml.Matrix4x3f)
[ "public Matrix4x3f rotateX(float ang, Matrix4x3f dest) {\n if ((properties & PROPERTY_IDENTITY) != 0)\n return dest.rotationX(ang);\n\n float sin, cos;\n if (ang == (float) Math.PI || ang == -(float) Math.PI) {\n cos = -1.0f;\n sin = 0.0f;\n } else if (an...
[ "public static double dot(@javax.annotation.Nonnull final List<double[]> a, @javax.annotation.Nonnull final List<double[]> b) {\n return com.simiacryptus.util.ArrayUtil.sum(com.simiacryptus.util.ArrayUtil.multiply(a, b));\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
get the activity that is started by the first instruction, if exists; return null if the first instruction is a start-transition instruction
[ "protected ActivityImpl determineFirstActivity(ProcessDefinitionImpl processDefinition,\n ProcessInstanceModificationBuilderImpl modificationBuilder) {\n AbstractProcessInstanceModificationCommand firstInstruction = modificationBuilder.getModificationOperations().get(0);\n\n if (firstInstruction instance...
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
生成文件 @param template 模板 @param context 模板上下文 @param destPath 目标路径(绝对)
[ "public static void toFile(Template template, VelocityContext context, String destPath) {\r\n\t\tPrintWriter writer = null;\r\n\t\ttry {\r\n\t\t\twriter = FileUtil.getPrintWriter(destPath, Velocity.getProperty(Velocity.INPUT_ENCODING).toString(), false);\r\n\t\t\tmerge(template, context, writer);\r\n\t\t} catch (IO...
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the Github instruction about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
Read cookie data from the request's cookie data. @param string $key The key you want to read. @return null|string Either the cookie value, or null if the value doesn't exist. @deprecated 3.4.0 Use getCookie() instead.
[ "public function cookie($key)\n {\n deprecationWarning(\n 'ServerRequest::cookie() is deprecated. ' .\n 'Use getCookie() instead.'\n );\n\n if (isset($this->cookies[$key])) {\n return $this->cookies[$key];\n }\n\n return null;\n }" ]
[ "function destroy()\n {\n /*\n * Cookies must be deleted with the same parameters as they were set with.\n * If the value argument is an empty string, or FALSE, and all other\n * arguments match a previous call to setcookie, then the cookie with the\n * specified name will ...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Database management:" }
Command line interface
[ "def main():\n \n parser = argparse.ArgumentParser(\n description='Extract the raw gps communication from an ULog file')\n parser.add_argument('filename', metavar='file.ulg', help='ULog input file')\n\n def is_valid_directory(parser, arg):\n \"\"\"Check if valid directory\"\"\"\n if...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Write the extension to the OutputStream. @param out the OutputStream to write the extension to @exception IOException on encoding errors
[ "public void encode(OutputStream out) throws IOException {\n DerOutputStream tmp = new DerOutputStream();\n if (extensionValue == null) {\n extensionId = PKIXExtensions.CertificateIssuer_Id;\n critical = true;\n encodeThis();\n }\n super.encode(tmp);\n ...
[ "@Override\n public XMLStreamReader2 createXMLStreamReader(File f)\n throws XMLStreamException\n {\n /* true for auto-close, since caller has no access to the underlying\n * input stream created from the File\n */\n return createSR(f, false, true);\n }" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Expires the given session.
[ "private void expireSession(RaftSession session) {\n if (expiring.add(session.sessionId())) {\n log.debug(\"Expiring session due to heartbeat failure: {}\", session);\n appendAndCompact(new CloseSessionEntry(raft.getTerm(), System.currentTimeMillis(), session.sessionId().id(), true, false))\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 post about Technology:", "pos": "Represent the code about Technology:", "neg": "Represent the code:" }
Unserializes in instance from an ASCII safe string representation produced by __toString. @param string $string String representation @return BloomFilter Unserialized instance
[ "public static function unserializeFromStringRepresentation($string)\n {\n if (!preg_match('~k:(?P<k>\\d+)/m:(?P<m>\\d+)\\((?P<bitfield>[0-9a-zA-Z+/=]+)\\)~', $string, $matches)) {\n throw new InvalidArgumentException('Invalid string representation');\n }\n $bf = new self((int) $m...
[ "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 Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
{@inheritDoc} @see \rocket\ei\manage\gui\GuiFieldEditable::createMag($propertyName)
[ "public function getMag(): Mag {\r\n\t\t$this->contentItemMag = new ContentItemMag($this->label, $this->panelConfigs,\r\n\t\t\t\t$this->targetReadEiFrame, $this->targetEditEiFrame);\r\n\t\t$this->contentItemMag->setNewMappingFormUrl($this->newMappingFormUrl);\r\n\t\t$this->contentItemMag->setValue($this->toManyEiFi...
[ "protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Convert a string to a byte array, no encoding is used. String must only contain characters <256.
[ "public static byte[] str2bytes(String str) throws IOException {\r\n\t\tbyte[] b=new byte[str.length()];\r\n\t\tfor(int i=0; i<str.length(); ++i) {\r\n\t\t\tchar c=str.charAt(i);\t\r\n\t\t\tif(c>255) throw new UnsupportedEncodingException(\"string contained a char > 255, cannot convert to bytes\");\r\n\t\t\tb[i]=(b...
[ "public static String pathEncode(String path, Charset charset) {\n return encodeReserved(path, FragmentType.PATH_SEGMENT, charset);\n\n /*\n * path encoding is not equivalent to query encoding, there are few differences, namely dealing\n * with spaces, !, ', (, ), and ~ characters. we will need to man...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Convenient Method for the vibrato effekt @param aktMemo
[ "protected void doVibratoEffekt(ChannelMemory aktMemo)\n\t{\n\t\tint periodAdd;\n\t\tswitch (aktMemo.vibratoType & 0x03)\n\t\t{\n\t\t\tcase 1: periodAdd = (Helpers.ModRampDownTable[aktMemo.vibratoTablePos]);\t// Sawtooth\n\t\t\t\t\tbreak;\n\t\t\tcase 2: periodAdd = (Helpers.ModSquareTable [aktMemo.vibratoTablePos]...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get the value of a cookie. @param $name @param null $default @return null|string
[ "public static function get($name, $default = null)\n {\n if (isset(static::$jar[$name])) {\n return static::parse(static::$jar[$name]['value']);\n }\n\n $cookie = Request::$cookieData;\n\n if (!is_null($value = $cookie->get($name))) {\n return static::parse($val...
[ "private function getFormOptionsDeclaration()\n {\n\n // we got a max instances allowed in normality tags\n $formOptions = json_encode( $this->formOptions );\n $formOptions = Php::varExport( $formOptions, true );\n\n $this->class->classComponents[] = new VariableDeclaration(\n ...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Rails controller stuff ========================
[ "def setup\n set_descriptor :default \n\n get_mxit_info\n\n @_mxit = descriptor\n @_mxit_validated = true\n @_mxit_validation_types = []\n @_mxit_validation_messages = []\n @_mxit_emulator = request.headers['X-Mxit-UserId-R'].nil?\n\n clean_session\n\n # Tidy multi-selec...
[ "public static function ws()\n {\n if (!isset(self::core()->soap)) {\n //====================================================================//\n // WEBSERVICE INITIALISATION\n //====================================================================//\n // Initial...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@param \Spryker\Yves\Kernel\Container $container @return \Spryker\Yves\Kernel\Container
[ "public function provideDependencies(Container $container)\n {\n $container[self::CLIENT_PAYONE] = function (Container $container) {\n return $container->getLocator()->payone()->client();\n };\n\n $container[self::CLIENT_CUSTOMER] = function (Container $container) {\n r...
[ "public function boot(\\Neos\\Flow\\Core\\Bootstrap $bootstrap)\n {\n $bootstrap->registerRequestHandler(new \\Neos\\Setup\\Core\\RequestHandler($bootstrap));\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
State for handling dateto:foo constructs. Potentially emits a token.
[ "function indateto($content){\n if (strlen($content) < 8) { // State exit or missing parameter.\n return true;\n }\n // Strip off the dateto: part and add the reminder to the parsed token array\n $param = trim(substr($content,7));\n $this->tokens[] = new search_token(TO...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// WithAnnotations appends or replaces the annotations on the spec with the // provided annotations
[ "func WithAnnotations(annotations map[string]string) SpecOpts {\n\treturn func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {\n\t\tif s.Annotations == nil {\n\t\t\ts.Annotations = make(map[string]string)\n\t\t}\n\t\tfor k, v := range annotations {\n\t\t\ts.Annotations[k] = v\n\t\t}\n\t\tretu...
[ "@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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Array to mapper criteria @param array $values @param boolean $qmMode force question mark placeholder @return string
[ "public static function buildCriteria(array $values, $qmMode = false)\n {\n reset($values);\n $qmMode = $qmMode ?: is_numeric(key($values));\n\n if ($qmMode) {\n $result = array_values($values);\n array_unshift($result, str_repeat('?,', count($values)-1).'?');\n\n ...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// NewKey returns a new key that can be used to encrypt and decrypt messages.
[ "func NewKey() (*[SecretKeyLength]byte, error) {\n\t// get 32-bytes of random from /dev/urandom\n\tbytes, err := randomProvider.Bytes(SecretKeyLength)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to generate random: %v\", err)\n\t}\n\n\treturn KeySliceToArray(bytes)\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 post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Write data to the connection @param string $data
[ "protected function write(string $data)\n {\n $this->clearTimeout();\n $this->conn->write($data . static::NEW_LINE);\n $this->log('<-' . $data);\n $this->setTimeout();\n }" ]
[ "def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Drops the user into an interactive Python session with the ``sess`` variable set to the current session instance. If keyword arguments are supplied, these names will also be available within the session.
[ "def interact(self, **local):\n \n import code\n code.interact(local=dict(sess=self, **local))" ]
[ "def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Set a new state to the underlying object @param string $state @throws SMException
[ "protected function setState($state)\n {\n if (!in_array($state, $this->config['states'])) {\n throw new SMException(sprintf(\n 'Cannot set the state to \"%s\" to object \"%s\" with graph %s because it is not pre-defined.',\n $state,\n get_class($thi...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
EVENTS Event handler for a touch start event. Stops the default click event from triggering and stores where we touched @inner @param {object} jqEvent The normalised jQuery event object.
[ "function touchStart(jqEvent) {\n\t\t\t//If we already in a touch event (a finger already in use) then ignore subsequent ones..\n\t\t\tif( getTouchInProgress() )\n\t\t\t\treturn;\n\t\t\t\n\t\t\t//Check if this element matches any in the excluded elements selectors, or its parent is excluded, if so, DON'T swipe\n\t...
[ "function() {\n var events = this.eventDelegates;\n log.events && (Object.keys(events).length > 0) && console.log('[%s] addHostListeners:', this.localName, events);\n // NOTE: host events look like bindings but really are not;\n // (1) we don't want the attribute to be set and (2) we want to sup...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetTagList sets the TagList field's value.
[ "func (s *TagListMessage) SetTagList(v []*Tag) *TagListMessage {\n\ts.TagList = 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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// 修改默认或者说全局 appname(应用名)
[ "func (l *Live) SetAppName(appname string) *Live {\n\tl.liveReq.AppName = appname\n\treturn l\n}" ]
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
/*[deutsch] <p>Rollt dieses zyklische Jahr um den angegebenen Betrag. </p> @param amount determines how many years/units this instance should be rolled @return changed copy of this instance
[ "public CyclicYear roll(int amount) {\n\n if (amount == 0) {\n return this;\n }\n\n return CyclicYear.of(MathUtils.floorModulo(MathUtils.safeAdd(this.year - 1, amount), 60) + 1);\n\n }" ]
[ "protected function processEntityFormRequest(Entity $entity, FormData $requestData, $revision) {\n $dataName = 'layoutManager';\n \n if (isset($requestData->$dataName) && count($requestData->$dataName) > 0) {\n $serialized = $requestData->$dataName;\n } /*else {\n throw $this->err->validationE...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Add a task to the executor, it is expected that this method is called on the ResultReceiver thread.
[ "public void addTask (ExecutorTask task)\n {\n for (int ii=0, nn=_queue.size(); ii < nn; ii++) {\n ExecutorTask taskOnQueue = _queue.get(ii);\n if (taskOnQueue.merge(task)) {\n return;\n }\n }\n\n // otherwise, add it on\n _queue.add(tas...
[ "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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// List lists the buildclient using the OpenShift client.
[ "func (c *ClientBuildConfigLister) List(label labels.Selector) ([]*buildv1.BuildConfig, error) {\n\tlist, err := c.client.BuildConfigs(metav1.NamespaceAll).List(metav1.ListOptions{LabelSelector: label.String()})\n\treturn buildConfigListToPointerArray(list), err\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Return True if the media type is a valid form media type.
[ "def is_form_media_type(media_type):\n \n base_media_type, params = parse_header(media_type.encode(HTTP_HEADER_ENCODING))\n return (base_media_type == 'application/x-www-form-urlencoded' or\n base_media_type == 'multipart/form-data')" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Saves relation between optimizer and search container @param \Magento\Framework\Model\AbstractModel $object Optimizer to save @return void
[ "private function saveSearchContainerRelation(\\Magento\\Framework\\Model\\AbstractModel $object)\n {\n $searchContainers = $object->getSearchContainer();\n\n if (is_array($searchContainers) && (count($searchContainers) > 0)) {\n $searchContainerLinks = [];\n $deleteCondition ...
[ "protected function process()\n {\n\n // add the SKU => entity ID/store view code mapping\n $this->addSkuEntityIdMapping($sku = $this->getValue(ColumnKeys::SKU));\n $this->addSkuStoreViewCodeMapping($sku, $this->getSubject()->getStoreViewCode(StoreViewCodes::ADMIN));\n\n // clean-up t...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// SetProcessingConfiguration sets the ProcessingConfiguration field's value.
[ "func (s *ExtendedS3DestinationUpdate) SetProcessingConfiguration(v *ProcessingConfiguration) *ExtendedS3DestinationUpdate {\n\ts.ProcessingConfiguration = 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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Pass through to provider CommentLookupSession.use_federated_book_view
[ "def use_federated_book_view(self):\n \"\"\"\"\"\"\n self._book_view = FEDERATED\n # self._get_provider_session('comment_lookup_session') # To make sure the session is tracked\n for session in self._get_provider_sessions():\n try:\n session.use_federated_book_vi...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
/*JWTBearerInterface
[ "public function getClientKey($client_id, $subject)\n {\n if (isset($this->jwt[$client_id])) {\n $jwt = $this->jwt[$client_id];\n if ($jwt) {\n if ($jwt[\"subject\"] == $subject) {\n return $jwt[\"key\"];\n }\n }\n }\...
[ "public Descriptor withExceptionSerializer(ExceptionSerializer exceptionSerializer) {\n return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Return URL string of Atom link element under parent element. Link with no rel attribute is considered to be rel="alternate" @param parent Consider only children of this parent element @param rel Consider only links with this relationship
[ "private String findAtomLink(final Element parent, final String rel) {\n String ret = null;\n final List<Element> linksList = parent.getChildren(\"link\", ATOM_10_NS);\n if (linksList != null) {\n for (final Element element : linksList) {\n final Element link = element...
[ "def reset(self):\n \n\n # Use first matching element as title (0 or more xpath expressions)\n self.title = OrderedSet()\n\n # Use first matching element as body (0 or more xpath expressions)\n self.body = OrderedSet()\n\n # Use first matching element as author (0 or more x...
codesearchnet
{ "query": "Represent the Github post about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about programming:" }
Render page with assessment(s) result. @throws \common_exception_Error @throws \common_exception_MissingParameter @throws \oat\oatbox\service\ServiceNotFoundException
[ "public function printReport()\n {\n if (!$this->hasRequestParameter('id')) {\n throw new \\common_exception_MissingParameter('id');\n }\n $idList = $this->getRequestParameter('id');\n $context = $this->getRequestParameter('context');\n if (!is_array($idList)) {\n ...
[ "public static function init(common_ext_Extension $extension, $langCode)\n {\n \t// if the langCode is empty do nothing\n \tif (empty($langCode)){\n \t\tthrow new Exception(\"Language is not defined\");\n \t}\n \t\n\t\t//init the ClearFw l10n tools\n $translations = tao_models_classes_Langu...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// Provide returns the result of executing the constructor with argument values resolved from a dependency graph
[ "func (p provider) Provide(g Graph) reflect.Value {\n\tfnType := reflect.TypeOf(p.constructor)\n\n\targCount := fnType.NumIn()\n\tif fnType.IsVariadic() {\n\t\targCount = len(p.argPtrs)\n\t}\n\n\targs := make([]reflect.Value, argCount, argCount)\n\tvar inType reflect.Type\n\tfor i := 0; i < argCount; i++ {\n\t\targ...
[ "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:" }
@param Request $request @param integer $id @return \Symfony\Component\HttpFoundation\JsonResponse @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
[ "public function updateAction(Request $request, $id)\n {\n $this->checkCsrf();\n\n $transUnit = $this->get('lexik_translation.data_grid.request_handler')->updateFromRequest($id, $request);\n\n return $this->get('lexik_translation.data_grid.formatter')->createSingleResponse($transUnit);\n ...
[ "protected function redefineErrorHandlers(&$container)\n {\n // Redefine - errors\n $container['errorHandler'] = BuilderJsonErrorResponses::jsonError();\n $container['phpErrorHandler'] = BuilderJsonErrorResponses::jsonPhpError();\n $container['notFoundHandler'] = BuilderJsonErrorRespo...
codesearchnet
{ "query": "Represent the Github text about Symfony:", "pos": "Represent the Github code about Symfony:", "neg": "Represent the Github code about programming:" }
// Ensure the directory exists or create it if needed.
[ "func EnsureDir(dir string, mode os.FileMode) error {\n\tif fileOptions, err := os.Stat(dir); os.IsNotExist(err) {\n\t\tif errMake := os.MkdirAll(dir, mode); errMake != nil {\n\t\t\treturn fmt.Errorf(\"Could not create directory %s. %v\", dir, err)\n\t\t}\n\t} else if err != nil {\n\t\treturn fmt.Errorf(\"Error ass...
[ "def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Update the given MySQL User. @param array $data @return MysqlUser
[ "public function update(array $data)\n {\n return $this->forge->updateMysqlUser($this->serverId, $this->id, $data);\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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// SetActivityFailedEventDetails sets the ActivityFailedEventDetails field's value.
[ "func (s *HistoryEvent) SetActivityFailedEventDetails(v *ActivityFailedEventDetails) *HistoryEvent {\n\ts.ActivityFailedEventDetails = 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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Flushes the data buffers to disk. @param force force a synchronous flush (otherwise if the environment has the MDB_NOSYNC flag set the flushes will be omitted, and with MDB_MAPASYNC they will be asynchronous)
[ "public void sync(final boolean force) {\n if (closed) {\n throw new AlreadyClosedException();\n }\n final int f = force ? 1 : 0;\n checkRc(LIB.mdb_env_sync(ptr, f));\n }" ]
[ "def connect(self, host, port):\n '''\n \n '''\n # Clear the connect state immediately since we're no longer connected\n # at this point.\n self._connected = False\n\n # Only after the socket has connected do we clear this state; closed\n # must be False so th...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Handle the command. @var string
[ "public function handle()\n {\n $indexConfigurator = $this->getIndexConfigurator();\n\n if ($indexConfigurator && ! $this->alreadyExists($indexConfigurator)) {\n $this->call('make:index-configurator', [\n 'name' => $indexConfigurator,\n ]);\n }\n\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Performs a search and returns the match, or null if no match was found or more than one match was found. @since 1.527
[ "public static SuggestedItem find(SearchIndex index, String query, SearchableModelObject searchContext) {\n List<SuggestedItem> r = find(Mode.FIND, index, query, searchContext);\n if(r.isEmpty()){ \n return null;\n }\n else if(1==r.size()){\n return r.get(0);\n ...
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
r""" Initialize the solution vector (self.petsc_x), which is a dense matrix (1D vector) and defines the rhs vector (self.petsc_b) from the existing data.
[ "def _initialize_b_x(self):\n \n \"\"\"\n # Get vector(s) compatible with the matrix,\n # i.e., with the same parallel layout.\n self.petsc_x, self.petsc_b = self.petsc_A.getVecs()\n\n # Set the solution vector to zeros.\n self.petsc_x.set(0)\n\n # Define the...
[ "def uinit(self, ushape):\n \"\"\"\"\"\"\n\n if self.opt['Y0'] is None:\n return np.zeros(ushape, dtype=self.dtype)\n else:\n # If initial Y is non-zero, initial U is chosen so that\n # the relevant dual optimality criterion (see (3.10) in\n # boyd-20...
codesearchnet
{ "query": "Represent the comment about Mathematics:", "pos": "Represent the code about Mathematics:", "neg": "Represent the code about programming:" }
Handles the creating or updating of a stack in CloudFormation. Also makes sure that we don't try to create or update a stack while it is already updating or creating.
[ "def _launch_stack(self, stack, **kwargs):\n \n old_status = kwargs.get(\"status\")\n wait_time = 0 if old_status is PENDING else STACK_POLL_TIME\n if self.cancel.wait(wait_time):\n return INTERRUPTED\n\n if not should_submit(stack):\n return NotSubmittedStat...
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Convert to EEML. Optional parameter describes the version of EEML to generate. Default (and currently only version implemented) is version 5.
[ "def to_eeml(version = nil)\n if version.nil? || version == 5\n # Check that we have some data items\n if size < 1\n raise EEML::NoData.new('EEML requires at least one data item')\n end\n # Create EEML\n eeml = Builder::XmlMarkup.new\n eeml.instruct!\n ...
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Returns the calculated age the time of event. @param int $age The age from the database record @return string
[ "private function calculateAge(int $age): string\n {\n if ((int) ($age / 365.25) > 0) {\n $result = (int) ($age / 365.25) . 'y';\n } elseif ((int) ($age / 30.4375) > 0) {\n $result = (int) ($age / 30.4375) . 'm';\n } else {\n $result = $age . 'd';\n }\...
[ "def normalize(self, timestamp, steps=0):\n '''\n \n '''\n # So far, the only commonality with RelativeTime\n return self.from_bucket( self.to_bucket(timestamp, steps) )" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Option for the user to revert the changes made since it was last published
[ "public function revert() {\n\t\tif ($this->data()->IsModifiedOnStage) {\n\t\t\t$this->data()->doRevertToLive();\n\t\t}\n\t\treturn $this->redirect($this->data()->Link() . '?stage=Live');\n\t}" ]
[ "public static function get_contexts_for_userid(int $userid) : \\core_privacy\\local\\request\\contextlist {\n // We cannot associate files with a particular user as it would require to know all the details about\n // the source file, which only the component owning it knows about. And, the 'usermodif...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// SetOperation sets the Operation field's value.
[ "func (s *DynamoDBAction) SetOperation(v string) *DynamoDBAction {\n\ts.Operation = &v\n\treturn s\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Queue an "event" to be run on the GL rendering thread. @param r the runnable to be run on the GL rendering thread.
[ "public void queueEvent(Runnable r) {\n synchronized (this) {\n mEventQueue.add(r);\n synchronized (sGLThreadManager) {\n mEventsWaiting = true;\n sGLThreadManager.notifyAll();\n ...
[ "public final T execute(ComThread t) {\n if(Thread.currentThread()==t)\n // if invoked from within ComThread, execute it at once\n return call();\n else\n // otherwise schedule the execution and block\n return t.execute(this);\n }" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
path doesnt handle ~ resolution, fallback to env variables, solution taken from https://github.com/nodejs/node-v0.x-archive/issues/2857
[ "function tilda(cwd) {\n if (cwd.substring(0, 1) === '~') {\n cwd = (process.env.HOME || process.env.HOMEPATH || process.env.HOMEDIR || process.cwd()) + cwd.substr(1);\n }\n return path.resolve(cwd);\n}" ]
[ "function ParsePath(u) {\n //Parse the url\n let p = url.parse(u);\n //Get the path name\n let pname = p.pathname;\n //Check for Windows\n if( process.platform === \"win32\") {\n //Remove the first / from the path\n //https://github.com/jmjuanes/electron-ejs/pull/4#issuecomment-21925...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
This method finds the first parent class which is within the buildbot namespace it prepends the name with as many ">" as the class is subclassed
[ "def getName(obj):\n \n # elastic search does not like '.' in dict keys, so we replace by /\n def sanitize(name):\n return name.replace(\".\", \"/\")\n if isinstance(obj, _BuildStepFactory):\n klass = obj.factory\n else:\n klass = type(obj)\n name = \"\"\n klasses = (klass,...
[ "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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Returns "a mark" to the current position of this node Cassandra log. This is for use with the from_mark parameter of watch_log_for_* methods, allowing to watch the log from the position when this method was called.
[ "def mark_log(self, filename='system.log'):\n \n log_file = os.path.join(self.get_path(), 'logs', filename)\n if not os.path.exists(log_file):\n return 0\n with open(log_file) as f:\n f.seek(0, os.SEEK_END)\n return f.tell()" ]
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about File management:" }
A safe function for creating a directory tree.
[ "def safe_makedirs(path):\n \"\"\"\"\"\"\n try:\n os.makedirs(path)\n except OSError as err:\n if err.errno == errno.EEXIST:\n if not os.path.isdir(path):\n raise\n else:\n raise" ]
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
It's kind of redundant to have the server return the foreign keys corresponding to the belongs_to associations (since they'll be in the URL anyway), so we'll try to inject them based on the attributes of the object we just used.
[ "def load(attributes, remove_root=false)\n attributes = attributes ? attributes.stringify_keys : {}\n self.class.belongs_to_with_parents.each do |belongs_to_param|\n attributes[\"#{belongs_to_param}_id\"] ||= prefix_options[\"#{belongs_to_param}_id\".intern]\n\n # also set prefix attributes ...
[ "def new_collection(query, resources = nil, &block)\n if loaded?\n resources ||= filter(query)\n end\n\n # TOOD: figure out a way to pass not-yet-saved Resources to this newly\n # created Collection. If the new resource matches the conditions, then\n # it should be added to the coll...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Count records of model. @param string $alias Optional alias of count result @return int
[ "public function count($alias = null)\n {\n if ($this->controller && $this->controller->hasMethod('count')) {\n return $this->controller->count($this, $alias);\n }\n throw $this->exception('The controller doesn\\'t support count', 'NotImplemented')\n ->addMoreInfo('cont...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Sets the StructTypeInfo that declares the total schema of the file in the configuration
[ "public static void setSchemaTypeInfo(Configuration conf, StructTypeInfo schemaTypeInfo) {\n if (schemaTypeInfo != null) {\n conf.set(SCHEMA_TYPE_INFO, schemaTypeInfo.getTypeName());\n LOG.debug(\"Set schema typeInfo on conf: {}\", schemaTypeInfo);\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 description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
where 语法见 @see WhereRule @param array|string|callable|null $conditions @param string $_ @return \PhpBoot\DB\rules\select\WhereRule
[ "public function findWhere($conditions=null, $_=null)\n {\n $query = $this->db->select($this->getColumns())\n ->from($this->entity->getTable());\n $query->context->resultHandler = function ($result){\n foreach ($result as &$i){\n $i = $this->entity->make($i, fa...
[ "public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD...
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Source configuration file.
[ "def source_file(pymux, variables):\n \n filename = os.path.expanduser(variables['<filename>'])\n try:\n with open(filename, 'rb') as f:\n for line in f:\n line = line.decode('utf-8')\n handle_command(pymux, line)\n except IOError as e:\n raise Comm...
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Modifies the result of each promise from a scalar value to a object containing its fieldname
[ "function wrap(fieldName, promise, args) {\n return promise(args).then((result) => ({\n [fieldName]: result,\n }));\n}" ]
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about File management:" }
Send `post_dict` to the :attr:`.ALEPH_EXPORT_URL`. Args: post_dict (dict): dictionary from :class:`PostData.get_POST_data()` Returns: str: Reponse from webform.
[ "def _sendPostDict(post_dict):\n \n downer = Downloader()\n downer.headers[\"Referer\"] = settings.EDEPOSIT_EXPORT_REFERER\n data = downer.download(settings.ALEPH_EXPORT_URL, post=post_dict)\n rheaders = downer.response_headers\n\n error_msg = rheaders.get(\"aleph-info\", \"\").lower().strip()\n ...
[ "def get_driver_config(driver): # noqa: E501\n \n\n response = errorIfUnauthorized(role='admin')\n if response:\n return response\n else:\n response = ApitaxResponse()\n\n # TODO: This needs an implementation, but likely requires a change to configs in apitaxcore\n\n return Response...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Technical documentation:" }
// buildKubeletConfig is responsible for creating the kubelet configuration
[ "func (b *KubeletBuilder) buildKubeletConfig() (*kops.KubeletConfigSpec, error) {\n\tif b.InstanceGroup == nil {\n\t\tglog.Fatalf(\"InstanceGroup was not set\")\n\t}\n\n\tkubeletConfigSpec, err := b.buildKubeletConfigSpec()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building kubelet config: %v\", err)\n...
[ "func (c *agentConf) AddFlags(f *gnuflag.FlagSet) {\n\t// TODO(dimitern) 2014-02-19 bug 1282025\n\t// We need to pass a config location here instead and\n\t// use it to locate the conf and the infer the data-dir\n\t// from there instead of passing it like that.\n\tf.StringVar(&c.dataDir, \"data-dir\", util.DataDir,...
codesearchnet
{ "query": "Represent the sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Verify credentials
[ "def login(self, request):\n \n try:\n user = authenticate(request)\n\n if not user:\n raise AuthenticationFailed(\"User not authenticated.\")\n\n if not user.is_active:\n raise AuthenticationFailed(\"This user has been disabled.\")\n\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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Removes a key by adding a remove entry to the row. The remove is represented as a delta entry so checkpoints can be written asynchronously. @return false if the new record cannot fit into the block.
[ "boolean remove(RowCursor cursor)\n {\n int rowHead = _rowHead;\n int blobTail = _blobTail;\n \n rowHead -= cursor.removeLength();\n\n if (rowHead < blobTail) {\n return false;\n }\n \n byte []buffer = _buffer;\n \n // buffer[rowHead] = REMOVE;\n \n cursor.getRemove(buffer,...
[ "boolean setReplica( H2ONode h2o ) {\n assert _key.home(); // Only the HOME node for a key tracks replicas\n assert h2o != H2O.SELF; // Do not track self as a replica\n if( !read_lock() ) return false; // Write-locked; no new replications. Read fails to read *this* value\n // Narrow non-race here. ...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Retrieve model for route model binding @param mixed $value @return \Illuminate\Database\Eloquent\Model|null
[ "public function resolveRouteBinding($value)\n {\n if (! (ctype_digit($value) || is_int($value))) {\n return null;\n }\n\n try {\n $value = App::make('fakeid')->decode((int) $value);\n } catch (Exception $e) {\n return null;\n }\n\n retur...
[ "public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// NewGrip takes the name for a logging instance and creates a new // Grip instance with configured with a local, standard output logging. // The default level is "Notice" and the threshold level is "info."
[ "func NewGrip(name string) *Grip {\n\tsender, _ := send.NewNativeLogger(name,\n\t\tsend.LevelInfo{\n\t\t\tThreshold: level.Trace,\n\t\t\tDefault: level.Trace,\n\t\t})\n\n\treturn &Grip{impl: sender}\n}" ]
[ "func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Computer Science:" }
Set the state of the BFD session.
[ "def _set_state(self, new_state, diag=None):\n \n old_state = self._session_state\n\n LOG.info(\"[BFD][%s][STATE] State changed from %s to %s.\",\n hex(self._local_discr),\n bfd.BFD_STATE_NAME[old_state],\n bfd.BFD_STATE_NAME[new_state])\n ...
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
/* TODO: Too general; this should be split into overloaded methods. Is that possible?
[ "XmlNode.QName toNodeQName(Context cx, Object nameValue, boolean attribute) {\n if (nameValue instanceof XMLName) {\n return ((XMLName)nameValue).toQname();\n } else if (nameValue instanceof QName) {\n QName qname = (QName)nameValue;\n return qname.getDelegate();\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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Check whether order is cancelled. $param boolean $strict @return boolean
[ "public function isCancelled( $strict = true ) {\n\n\t\tif( $strict ) {\n\n\t\t\treturn $this->status == self::STATUS_CANCELLED;\n\t\t}\n\n\t\treturn $this->status >= self::STATUS_CANCELLED;\n\t}" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Internally called to reallocate the indexes. This method should be called when the filtered model changes its element size
[ "protected void reallocateIndexes() {\n if (this.indexes == null || this.indexes.length != getFilteredModel().getSize()) {\n this.indexes = new int[getFilteredModel().getSize()];\n }\n applyConstraint();\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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Convenience method, calls {@link #view(String, Object)} internally. The keys in the map are converted to String values. @param values map with values to pass to view.
[ "protected void view(Map<String, Object> values){\n for(String key:values.keySet() ){\n view(key, values.get(key));\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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
handle commands from user
[ "def process_stdin(line):\n ''''''\n if line is None:\n sys.exit(0)\n\n line = line.strip()\n if not line:\n return\n\n args = shlex.split(line)\n cmd = args[0]\n if cmd == 'help':\n k = command_map.keys()\n k.sort()\n for cmd in k:\n (fn, help) = c...
[ "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:" }
List all active quotes on an account
[ "def cli(env):\n \"\"\"\"\"\"\n table = formatting.Table([\n 'Id', 'Name', 'Created', 'Expiration', 'Status', 'Package Name', 'Package Id'\n ])\n table.align['Name'] = 'l'\n table.align['Package Name'] = 'r'\n table.align['Package Id'] = 'l'\n\n manager = ordering.OrderingManager(env.cli...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
/* Check if reduced-form input >= 2^255-19
[ "private static final boolean is_overflow(long10 x) {\n\t\treturn (\n\t\t\t((x._0 > P26-19)) &&\n\t\t\t((x._1 & x._3 & x._5 & x._7 & x._9) == P25) &&\n\t\t\t((x._2 & x._4 & x._6 & x._8) == P26)\n\t\t\t) || (x._9 > P25);\n\t}" ]
[ "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 comment about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code about Natural Language Processing:" }
put @param key @param value @return V
[ "public V put(K key, V value) {\n if (isHighPrioEnabled) {\n return highPrioMap.put(key, value);\n } else {\n return lowPrioMap.put(key, value);\n }\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
////////////////////////////////////////////////// Converts a single value into its Postgres format.
[ "function formatValue(value, fm, cc) {\n\n if (typeof value === 'function') {\n return formatValue(resolveFunc(value, cc), fm, cc);\n }\n\n const ctf = getCTF(value); // Custom Type Formatting\n if (ctf) {\n fm |= ctf.rawType ? fmFlags.raw : 0;\n return formatValue(resolveFunc(ctf.t...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github description about Database Management:", "pos": "Represent the Github code about Database Management:", "neg": "Represent the Github code about programming:" }
Парсит элемент и извлекает из него аргументы @param DOMElement $element @return void
[ "protected function parseArgs(DOMElement $element)\n {\n $args = XmlUtil::getChildElements($element, 'arg');\n foreach ($args as $arg) {\n $name = XmlUtil::getRequiredAttributeValue($arg, 'name');\n $this->args[$name] = XmlUtil::getText($arg);\n }\n }" ]
[ "final protected function v($name = null) {return dfak($this, function() {\n\t\t$result = dfa($this->_data, 'value', []);\n\t\t/**\n\t\t * 2016-06-29\n\t\t * Что интересно, при смене области действия настроек с глобальной на другую (сайт или магазин)\n\t\t * поле «value» может почему-то содержать не массив,\n\t\t *...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Returns a line formatted as comment. @param string $text @param array $style @return string
[ "public function error(string $text, array $style = []): string\n {\n return $this->line($text, ['fg' => static::RED] + $style);\n }" ]
[ "protected static function parsePrintableString(&$data, &$result)\n {\n // Printable string type\n $data = self::parseCommon($data, $stringData);\n $result[] = [\n 'Printable String (' . self::$len . ')',\n $stringData, ];\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Returns the current paths unique ID. @return string|null
[ "public function getId()\n {\n if ($output = $this->execute('fsutil file queryfileid', $this->path)) {\n if ((bool) preg_match('/(\\d{1}[x].*)/', $output[0], $matches)) {\n return $matches[0];\n }\n }\n }" ]
[ "def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Register a new model (models)
[ "def post(self):\n \"\"\"\"\"\"\n self.set_header(\"Content-Type\", \"application/json\")\n key = uuid.uuid4().hex\n metadata = json.loads(self.request.body.decode())\n metadata[\"uuid\"] = key\n self.database[key] = metadata\n result = json.dumps({\"uuid\": key})\n ...
[ "def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')" ]
codesearchnet
{ "query": "Represent the description about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code about Natural Language Processing:" }
// SetName sets the Name field's value.
[ "func (s *CreateRemoteAccessSessionInput) SetName(v string) *CreateRemoteAccessSessionInput {\n\ts.Name = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// Metadata returns meta data about the overlay driver such as // LowerDir, UpperDir, WorkDir and MergeDir used to store data.
[ "func (d *Driver) Metadata(id string) (map[string]string, error) {\n\tdir := d.dir(id)\n\tif _, err := os.Stat(dir); err != nil {\n\t\treturn nil, err\n\t}\n\n\tmetadata := map[string]string{\n\t\t\"WorkDir\": path.Join(dir, \"work\"),\n\t\t\"MergedDir\": path.Join(dir, \"merged\"),\n\t\t\"UpperDir\": path.Join(...
[ "@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 File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code:" }
@param WKBBuffer $buffer @param int $srid @return Geometry @throws GeometryIOException
[ "protected function readGeometry(WKBBuffer $buffer, int $srid) : Geometry\n {\n $buffer->readByteOrder();\n\n $this->readGeometryHeader($buffer, $geometryType, $hasZ, $hasM, $srid);\n\n $cs = new CoordinateSystem($hasZ, $hasM, $srid);\n\n switch ($geometryType) {\n case Geo...
[ "protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }