query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic boolean eIsSet(int featureID)\n\t{\n\t\tswitch (featureID)\n\t\t{\n\t\t\tcase XtypePackage.XIMPORT_DECLARATION__WILDCARD:\n\t\t\t\treturn wildcard != WILDCARD_EDEFAULT;\n\t\t\tcase XtypePackage.XIMPORT_DECLARATION__EXTENSION:\n\t\t\t\treturn extension != EXTENSION_EDEFAULT;\n\t\t\tcase XtypePac... | [
"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 comment about Text generation:",
"pos": "Represent the code about Text generation:",
"neg": "Represent the code:"
} |
获取某个类锁指定的泛型参数数组
@param c
@return | [
"public final static Type[] getGenericTypes(Class<?> c) {\n\n Class<?> myClass = c;\n\n if (!(c.getGenericSuperclass() instanceof ParameterizedType)) {\n myClass = c.getSuperclass();\n }\n\n Type superClass = myClass.getGenericSuperclass();\n ParameterizedType type = (P... | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// RunConfigInspect inspects the given Swarm config. | [
"func RunConfigInspect(dockerCli command.Cli, opts InspectOptions) error {\n\tclient := dockerCli.Client()\n\tctx := context.Background()\n\n\tif opts.Pretty {\n\t\topts.Format = \"pretty\"\n\t}\n\n\tgetRef := func(id string) (interface{}, []byte, error) {\n\t\treturn client.ConfigInspectWithRaw(ctx, id)\n\t}\n\tf ... | [
"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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Use this method to unban a previously kicked user in a supergroup.
The bot must be an administrator in the group for this to work.
:param int user_id: Unique identifier of the target user | [
"def unban_chat_member(self, user_id):\n \n return self.bot.api_call(\"unbanChatMember\", chat_id=self.id, user_id=user_id)"
] | [
"def check_for_interest(self, client, recipient, message):\n \"\"\"\"\"\"\n for prefix in self.prefixes:\n if message.startswith(prefix):\n return True, message[len(prefix):]\n\n # Don't require a prefix if addressed in PM.\n # This comes after the prefix checks... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// See also https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetValue | [
"func (s *Secret) GetValue(flags uint32) ([]byte, error) {\n\tvar cvalue_size C.size_t\n\n\tvar err C.virError\n\tcvalue := C.virSecretGetValueWrapper(s.ptr, &cvalue_size, C.uint(flags), &err)\n\tif cvalue == nil {\n\t\treturn nil, makeError(&err)\n\t}\n\tdefer C.free(unsafe.Pointer(cvalue))\n\tret := C.GoBytes(uns... | [
"func (g *Generator) SetVMHypervisorParameters(parameters []string) {\n\tg.initConfigVMHypervisor()\n\tg.Config.VM.Hypervisor.Parameters = parameters\n}"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Find an object or list of objects in a collection
CLI Example:
.. code-block:: bash
salt '*' mongodb.find mycollection '[{"foo": "FOO", "bar": "BAR"}]' <user> <password> <host> <port> <database> | [
"def find(collection, query=None, user=None, password=None,\n host=None, port=None, database='admin', authdb=None):\n '''\n \n\n '''\n conn = _connect(user, password, host, port, database, authdb)\n if not conn:\n return 'Failed to connect to mongo database'\n\n try:\n query ... | [
"def returner(ret):\n '''\n \n '''\n conn, mdb = _get_conn(ret)\n\n if isinstance(ret['return'], dict):\n back = _remove_dots(ret['return'])\n else:\n back = ret['return']\n\n if isinstance(ret, dict):\n full_ret = _remove_dots(ret)\n else:\n full_ret = ret\n\n ... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
------------------------------ PRIVATE | [
"private static void checkValueInPossibilities(Object val, IConfigKey configKey) {\n\t\tif (val != null && configKey.getPossibleValues() != null && !configKey.getPossibleValues().contains(val)) {\n\t\t\tthrow new RuntimeException(String.format(\"Invalid value for key=[%s], possibles=%s\",\n\t\t\t\tconfigKey.getKey(... | [
"protected function prepareResponseHeaders()\n {\n $this->getResponse(true)->headers->set('Content-Type', 'text/html');\n $this->getResponse()->setCharset('utf-8');\n\n\n // FIX FOR IE SESSION COOKIE\n // CAO IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\n //... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about PHP programming:"
} |
Returns the low interval (inclusive) of the given bucket. | [
"private int bucketLowInterval(final int index) {\n if (index <= num_linear_buckets) {\n return index * interval;\n } else {\n return cutoff + (1 << (index - num_linear_buckets + exp_bucket_shift));\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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Creates a backup of this index for optimized re-indexing of the whole content.<p>
@return the path to the backup folder, or <code>null</code> in case no backup was created | [
"protected String createIndexBackup() {\n\n if (!isBackupReindexing()) {\n // if no backup is generated we don't need to do anything\n return null;\n }\n\n // check if the target directory already exists\n File file = new File(getPath());\n if (!file.exists()... | [
"function databaseInitialize() {\n var entries = db.getCollection(\"entries\");\n var messages = db.getCollection(\"messages\");\n\n // Since our LokiFsStructuredAdapter is partitioned, the default 'quickstart3.db'\n // file will actually contain only the loki database shell and each of the collections\n // wi... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
used by clacoForm Manager.
@deprecated
@todo remove me | [
"public function createField($name, $isRequired, $type, ResourceNode $resourceNode = null)\n {\n $fieldFacet = new FieldFacet();\n $fieldFacet->setLabel($name);\n $fieldFacet->setType($type);\n $fieldFacet->setRequired($isRequired);\n $fieldFacet->setResourceNode($resourceNode)... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Helper method. Retrieves invalid elements from fieldset the $element belongs to.
@param ElementInterface $element
@param FieldsetInterface $fieldset
@return array|\Traversable | [
"protected function getInvalidFieldsetElements(ElementInterface $element, FieldsetInterface $fieldset)\n {\n $elementName = $this->normalizeElementName($element->getName());\n $elements = $fieldset->getElements();\n\n if (isset($elements[$elementName]) && $elements[$elementName] === $element... | [
"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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Call the error callback of the app above.
@param inVC
@param ioe | [
"void callErrorCallback(VirtualConnection inVC, IOException ioe) {\n // otherwise pass the error along to the channel above us, or close\n // the connection if nobody is above\n setPersistent(false);\n if (this.bEarlyReads && null != getAppReadCallback()) {\n if (TraceComponen... | [
"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 summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Shows all system fonts that contain given character. | [
"def char(self, char):\n \n font_files = fc.query()\n if self._display['group']:\n font_files = self._getCharFont(font_files, char)\n font_families = self._groupFontByFamily(font_files)\n for font_family in sorted(font_families):\n print(font_fami... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Send data to graphite host
:param payload: Data to send to graphite | [
"def report_stats(self, payload, is_retry=False):\n \n if self.debug:\n if self.pickle_proto:\n print \"reporting pickled stats\"\n else:\n print \"reporting stats -> {\\n%s}\" % payload\n try:\n graphite = socket.socket()\n ... | [
"def get_default_config_help(self):\n \n config = super(HttpPostHandler, self).get_default_config_help()\n\n config.update({\n 'url': 'Fully qualified url to send metrics to',\n 'batch': 'How many to store before sending to the graphite server',\n })\n\n retu... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SetNextToken sets the NextToken field's value. | [
"func (s *GetAggregateConfigRuleComplianceSummaryOutput) SetNextToken(v string) *GetAggregateConfigRuleComplianceSummaryOutput {\n\ts.NextToken = &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 summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Encloses the passed field name with quotes according to the quoting type selected at class construct.
For fully qualtified field name (mytable.id) it separately quotes each part.
'*' is omitted if found.
@param string
@return string | [
"private function sanitize($name)\n {\n switch ( strtolower($this->quoting) )\n {\n case 'none':\n $ldelim = $rdelim = '';\n break;\n case 'mysql':\n $ldelim = $rdelim = '`';\n break;\n case 'sql':\n case 'sqlite':\n $ldelim = $rdelim = '\"';\n br... | [
"def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])"
] | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Lists up all the atoms contained in in this label.
@since 1.420 | [
"public Set<LabelAtom> listAtoms() {\n Set<LabelAtom> r = new HashSet<>();\n accept(ATOM_COLLECTOR,r);\n return r;\n }"
] | [
"function parse_drawing(data, rels) {\n\tif(!data) return \"??\";\n\t/*\n\t Chartsheet Drawing:\n\t - 20.5.2.35 wsDr CT_Drawing\n\t - 20.5.2.1 absoluteAnchor CT_AbsoluteAnchor\n\t - 20.5.2.16 graphicFrame CT_GraphicalObjectFrame\n\t - 20.1.2.2.16 graphic CT_GraphicalObject\n\t - 20.1.2.2.17 gr... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
returns the amount of data.
@param array $where
@param array $joinConditions
@param string $prefix
@return int | [
"public function getCount($where = [], $joinConditions = [], $prefix = 'u')\n {\n return $this->find($where, $prefix, true, $joinConditions);\n }"
] | [
"function delete() {\n\n // if this is an association result or it is limited,\n // create specific result for local rows and execute\n\n if ( $this->parent_ || isset( $this->limitCount ) ) {\n\n return $this->primaryResult()->delete();\n\n }\n\n return $this->db->delet... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Create a new user using his e-mail and phone. It uses USA country code by default.
@param email
@param phone
@return a User instance | [
"public com.authy.api.User createUser(String email, String phone) {\n\t\treturn createUser(email, phone, DEFAULT_COUNTRY_CODE);\n\t}"
] | [
"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 text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Natural Language Processing:"
} |
Get the url to view a discussion from a discussion id and post id.
@param int $discussionid The discussion id
@param int $postid The post id
@return moodle_url | [
"public function get_view_post_url_from_post_id(int $discussionid, int $postid) : moodle_url {\n $url = $this->get_discussion_view_url_from_discussion_id($discussionid);\n $url->set_anchor('p' . $postid);\n return $url;\n }"
] | [
"protected function get_reply_address($course, $forum, $discussion, $post, $cm, $context) {\n if ($this->can_post($course, $forum, $discussion, $post, $cm, $context)) {\n // Generate a reply-to address from using the Inbound Message handler.\n $this->inboundmanager->set_data($post->id);... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// BeginEvent is an event fired when a SMIL animation element begins.
//
// https://developer.mozilla.org/docs/Web/Events/beginEvent | [
"func BeginEvent(listener func(*vecty.Event)) *vecty.EventListener {\n\treturn &vecty.EventListener{Name: \"beginEvent\", Listener: listener}\n}"
] | [
"function watchForRender(node, handler) {\n\tvar expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\n\tvar proxy = expando.renderProxy = function(e) {\n\t\tif (e.animationName === CSS_RENDER_ANIMATION) {\n\t\t\thandler();\n\t\t}\n\t};\n\n\thelpers$1.each(ANIMATION_START_EVENTS, function(type) {\n\t\taddListen... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Submit a single or batch tensor to refine the streaming mean. | [
"def submit(self, value):\n \"\"\"\"\"\"\n # Add a batch dimension if necessary.\n if value.shape.ndims == self._sum.shape.ndims:\n value = value[None, ...]\n return tf.group(\n self._sum.assign_add(tf.reduce_sum(value, 0)),\n self._count.assign_add(tf.shape(value)[0]))"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the summarization about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code:"
} |
// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided | [
"func (lt *lt) WeekdayNarrow(weekday time.Weekday) string {\n\treturn lt.daysNarrow[weekday]\n}"
] | [
"func parseDay(buff []byte, cursor *int, l int) (int, error) {\n\t// XXX : this is a relaxed constraint\n\t// XXX : we do not check if valid regarding February or leap years\n\t// XXX : we only checks that day is in range [01 -> 31]\n\t// XXX : in other words this function will not rant if you provide Feb 31th\n\tr... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about datetime:"
} |
Public: Prefix a given path with the destination directory.
paths - (optional) path elements to a file or directory within the
destination directory
Returns a path which is prefixed with the destination directory. | [
"def in_dest_dir(*paths)\n paths.reduce(dest) do |base, path|\n Bunto.sanitized_path(base, path)\n end\n end"
] | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
get the json data response
:param responses: the json response
:return the json data without 'root' node | [
"async def handle_json_response(responses):\n \n json_data = {}\n if responses.status != 200:\n err_msg = HttpProcessingError(code=responses.status,\n message=await responses.json())\n logging.error(\"Wallabag: aiohttp error {err_ms... | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the instruction about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about Software development:"
} |
// GetSystemAttributePaths behaves as GetAttributePaths, and loads information
// only from the system gitattributes file, respecting the $PREFIX environment
// variable. | [
"func GetSystemAttributePaths(mp *gitattr.MacroProcessor, env Env) []AttributePath {\n\tprefix, _ := env.Get(\"PREFIX\")\n\tif len(prefix) == 0 {\n\t\tprefix = string(filepath.Separator)\n\t}\n\n\tpath := filepath.Join(prefix, \"etc\", \"gitattributes\")\n\n\tif _, err := os.Stat(path); os.IsNotExist(err) {\n\t\tre... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Verify attempts to verify this token using the given options.
// Returns a nil error if the token is valid. | [
"func (t *Token) Verify(verifyOpts VerifyOptions) error {\n\t// Verify that the Issuer claim is a trusted authority.\n\tif !contains(verifyOpts.TrustedIssuers, t.Claims.Issuer) {\n\t\tlog.Infof(\"token from untrusted issuer: %q\", t.Claims.Issuer)\n\t\treturn ErrInvalidToken\n\t}\n\n\t// Verify that the Audience cl... | [
"def verify(build)\n # TODO might as well cache this and store in the db so we dont have to\n # convert every time\n pkey = to_rsa_pkey\n signature = Base64.decode64(build.signature)\n digest = OpenSSL::Digest::SHA256.new\n\n # If the user submits html were going to expect the\n #... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Verify a message
@param Message $message
@param string $fingerprint
@return bool
@throws \Crypt_GPG_FileException
@throws GPGMailerException
@throws \PEAR_Exception | [
"public function verify(Message $message, string $fingerprint): bool\n {\n $gnupg = new \\Crypt_GPG($this->options);\n $gnupg->addSignKey($fingerprint);\n\n /**\n * @var \\Crypt_GPG_Signature[] $verified\n */\n try {\n $verified = $gnupg->verify($message->ge... | [
"private function handleErrorUnit(Invoke\\Error $unit): Result\\AbstractResult\n {\n return new Result\\Error(null, $unit->getBaseException());\n }"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
// N.B.:
// Since Go 1.5 these are not reliable; see the documentation around the memzero
// function. These are best-effort. | [
"func (k *Keyring) Zeroize(keysToo bool) {\n\tif k == nil {\n\t\treturn\n\t}\n\tif k.masterKey != nil {\n\t\tmemzero(k.masterKey)\n\t}\n\tif !keysToo || k.keys == nil {\n\t\treturn\n\t}\n\tfor _, key := range k.keys {\n\t\tmemzero(key.Value)\n\t}\n}"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
fill entries of the listbox.
@param pentries list of entries | [
"public final void fillEntryCollections(final Collection<? extends IdAndNameBean<T>> pentries) {\n this.entries.clear();\n this.entries.addAll(pentries);\n\n clear();\n for (final IdAndNameBean<T> entry : this.entries) {\n this.addItem(entry.getName(), Objects.toString(entry.getId()));\n }\n }"... | [
"def anim(host, seq, anim, d):\n \n at(host, 'ANIM', seq, [anim, d])"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the description of the parent ou.<p>
@return the description of the parent ou | [
"public String getAssignedOu() {\n\n try {\n CmsOrganizationalUnit ou = OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), getParamOufqn());\n return ou.getDisplayName(getLocale());\n } catch (CmsException e) {\n return null;\n }\n }"
] | [
"private void checkForValid(String paramName, Attribute<? super X, ?> attribute)\n {\n if (attribute == null)\n {\n throw new IllegalArgumentException(\n \"attribute of the given name and type is not present in the managed type, for name:\" + paramName);\n\n }\n... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// NewSystemsInfo creates a map of SystemDumps that are configured
// based on the installation settings fetched from ops manager | [
"func NewSystemsInfo(installationSettingsFile string, sshKey string, nfs string) SystemsInfo {\n\n\tconfigParser := NewConfigurationParser(installationSettingsFile)\n\tinstallationSettings := configParser.InstallationSettings\n\n\tconst (\n\t\tdefaultRemoteArchivePath = \"/tmp/archive.backup\"\n\t\tmysqlRemoteArchi... | [
"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 instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// Cancel aborts a fetch request, returning all pending hashes to the task queue. | [
"func (q *queue) cancel(request *fetchRequest, taskQueue *prque.Prque, pendPool map[string]*fetchRequest) {\n\tq.lock.Lock()\n\tdefer q.lock.Unlock()\n\n\tif request.From > 0 {\n\t\ttaskQueue.Push(request.From, -int64(request.From))\n\t}\n\tfor _, header := range request.Headers {\n\t\ttaskQueue.Push(header, -int64... | [
"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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about File management:"
} |
Finishes the installation
@return void | [
"public function finish()\n {\n $this->resolveRelations();\n $this->writeXmlFiles();\n $this->createTables();\n $this->import();\n $this->writeExtensionIni();\n }"
] | [
"private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Method: removeLayer
Handles the map's preremovelayer event
Parameters:
evt - {Object} The listener argument | [
"function(evt) {\n var layer = evt.layer;\n if (layer instanceof OpenLayers.Layer.Grid) {\n this.clearTileQueue({object: layer});\n if (layer.events) {\n layer.events.un({\n addtile: this.addTile,\n retile: this.clearTileQueue,... | [
"function makeEventDispatcher(obj) {\n $.extend(obj, {\n on: on,\n off: off,\n one: one,\n trigger: trigger,\n _EventDispatcher: true\n });\n // Later, on() may add _eventHandlers: Object.<string, Array.<{event:string, namespace:?string,\n ... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Get the size of element.
@return WebDriverDimension The dimension of the element. | [
"public function getSize()\n {\n $size = $this->executor->execute(\n DriverCommand::GET_ELEMENT_SIZE,\n [':id' => $this->id]\n );\n\n return new WebDriverDimension($size['width'], $size['height']);\n }"
] | [
"function getPositionByKey(\n opts: Options,\n // The current value\n containerNode: Node,\n // Key of the node in desired position\n key: string\n): TablePosition {\n return TablePosition.create(opts, containerNode, key);\n}"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Convert an instance of an object into a dict. | [
"def to_dict(obj):\n \n d = _to_json_type(obj)\n if isinstance(d, dict):\n return scrub_dict(d)\n else:\n raise ValueError(\"The value provided must be an object.\")"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Can be used to add a plugin
@param {String} name - The name of the plugin
@param {String} plugin - The object containing the plugin's data (callbacks, options, function1, function2, ...) | [
"function(name, plugin){\n Flotr.plugins[name] = plugin;\n Flotr.defaultOptions[name] = plugin.options || {};\n }"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Create a reference to "this" object or to the current type.
@return the reference. | [
"public XFeatureCall createReferenceToThis() {\n\t\tfinal XExpression expr = getXExpression();\n\t\tXtendTypeDeclaration type = EcoreUtil2.getContainerOfType(expr, XtendTypeDeclaration.class);\n\t\tJvmType jvmObject = getAssociatedElement(JvmType.class, type, expr.eResource());\n\t\tfinal XFeatureCall thisFeature =... | [
"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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Return the lower supported protocol version. Beta versions are omitted. | [
"def get_lower_supported(cls, previous_version):\n \n try:\n version = next(v for v in sorted(ProtocolVersion.SUPPORTED_VERSIONS, reverse=True) if\n v not in ProtocolVersion.BETA_VERSIONS and v < previous_version)\n except StopIteration:\n version... | [
"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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Output this screen using HTML. | [
"public void printHtmlIcon(PrintWriter out, String strTag, String strParams, String strData)\n {\n String strIcon = \"Menu\";\n strIcon = HtmlConstants.HTML_ROOT + HtmlConstants.ICON_DIR + strIcon + \".gif\";\n out.print(strIcon + \"\\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:"
} |
Attributes::render
@param array $options
@return string | [
"public function render(array $options = [])\n {\n $output = '';\n\n if ($this->count()) {\n foreach ($this->storage as $key => $value) {\n $output = trim($output);\n switch ($key) {\n case 'style':\n if (count($valu... | [
"protected function parseExpressionHtmlLine( Line$line ):self\n\t{\n\t\t$content= $line->slice(1);\n\n\t\treturn $this->openNode(new StringNode($this,$line))->appendLine(\"<?$content?>\");\n\t}"
] | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Replace the value of the given header by the value.
-param {String} name header name
-param {String} value header value | [
"function(name, value) {\n var header = { raw: value };\n this.headers[Utils.headerize(name)] = [header];\n }"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the post about Web development:",
"pos": "Represent the code about Web development:",
"neg": "Represent the code about programming:"
} |
Sets the currencies to return.
Expects either a list of arguments or
a single argument as array
@param array $currencies
@return Exchange | [
"public function symbols($currencies = null)\n {\n if (func_num_args() and !is_array(func_get_args()[0])) {\n $currencies = func_get_args();\n }\n\n $this->symbols = $currencies;\n\n return $this;\n }"
] | [
"public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Documentation:"
} |
Also only allow alphanumberic and dash "-" and underscore "_" | [
"private void validateName(String name) throws DDFException {\n Boolean isNameExisted;\n try {\n this.getManager().getDDFByName(name);\n isNameExisted = true;\n } catch (DDFException e) {\n isNameExisted = false;\n }\n if(isNameExisted) {\n throw new DDFException(String.format(\"D... | [
"def _get_after_tld_chars(self):\n \n after_tld_chars = set(string.whitespace)\n after_tld_chars |= {'/', '\\\"', '\\'', '<', '>', '?', ':', '.', ','}\n # get left enclosure characters\n _, right_enclosure = zip(*self._enclosure)\n # add right enclosure characters to be val... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Expressions
// VisitExpression implements corresponding Visitor interface method | [
"func (v *evalVisitor) VisitExpression(node *ast.Expression) interface{} {\n\tv.at(node)\n\n\tvar result interface{}\n\tdone := false\n\n\tv.pushExpr(node)\n\n\t// helper call\n\tif helperName := node.HelperName(); helperName != \"\" {\n\t\tif helper := v.findHelper(helperName); helper != zero {\n\t\t\tresult = v.c... | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the default flags for a Type-3 message created in response
to the given Type-2 message in the current environment.
@param tc
context to use
@param type2
The Type-2 message.
@return An <code>int</code> containing the default flags. | [
"public static int getDefaultFlags ( CIFSContext tc, Type2Message type2 ) {\n if ( type2 == null )\n return getDefaultFlags(tc);\n int flags = NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION;\n flags |= type2.getFlag(NTLMSSP_NEGOTIATE_UNICODE) ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP... | [
"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 text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Search for all connections between this and another port. | [
"def get_connections_by_dest(self, dest):\n ''''''\n with self._mutex:\n res = []\n for c in self.connections:\n if c.has_port(self) and c.has_port(dest):\n res.append(c)\n return res"
] | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Delete plugin's associated add-ons.
@author Vova Feldman (@svovaf)
@since 1.0.8
@param bool $store
@return bool | [
"private function _delete_account_addons( $store = true ) {\r\n $all_addons = self::get_all_account_addons();\r\n\r\n if ( ! isset( $all_addons[ $this->_plugin->id ] ) ) {\r\n return false;\r\n }\r\n\r\n unset( $all_addons[ $this->_plugin->id ] );\r\n\r\n ... | [
"public static function file()\n {\n if (!isset(self::core()->file)) {\n //====================================================================//\n // Initialize Tasks List\n self::core()->file = new FileManager();\n\n //=========================================... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Sets the replica members for the {@code partitionId}. | [
"void updateReplicas(int partitionId, PartitionReplica[] replicas) {\n InternalPartitionImpl partition = partitions[partitionId];\n partition.setReplicas(replicas);\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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// RecalculateCache rebuilds the cache regardless of invalidate time delay. | [
"func (f *fragment) RecalculateCache() {\n\tf.mu.Lock()\n\tf.cache.Recalculate()\n\tf.mu.Unlock()\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 comment about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Relative to the project root directory | [
"public function templatesDir(string $path): self\n {\n $this->validatePathIsRelativeToProject($path, __METHOD__);\n $this->templatesDir = rtrim($path, '/');\n\n return $this;\n }"
] | [
"protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Data synchronization:"
} |
Get the roles who have the given permission
@param $perm_id integer The ID of the permission
@return integer | [
"public function getRolesWithPermission($perm_id)\n {\n $roles = static::$app['db']->connection()\n ->table('roles_permissions')->where('permission_id', '=', $perm_id)->lists('role_id');\n\n $roles = array_map('intval', $roles);\n\n return $roles;\n }"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Verifies whether the current folder contains the expected directories.
@return bool | [
"private function areExpectedDirectoriesPresent(): bool\n {\n $actualDirectories = scandir(getcwd(), 0);\n\n $presentExpectedDirectories = array_intersect($this->expectedDirectories, $actualDirectories);\n sort($this->expectedDirectories);\n sort($presentExpectedDirectories);\n\n ... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// Acyclic tells if g has no cycles. | [
"func Acyclic(g Iterator) bool {\n\t_, acyclic := topsort(g, false)\n\treturn acyclic\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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Look at the next token. | [
"def look(self):\n \"\"\"\"\"\"\n old_token = next(self)\n result = self.current\n self.push(result)\n self.current = old_token\n return result"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// SetSupportUrl sets the SupportUrl field's value. | [
"func (s *CreateProductInput) SetSupportUrl(v string) *CreateProductInput {\n\ts.SupportUrl = &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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Função de calculo de largura da uma string de acordo com o tamanho da fonte
@copyright http://n4.nabble.com/Finding-width-of-a-drawText-Text-in-Zend-Pdf-td677978.html
@param $string
@param $font
@param $fontSize | [
"private function widthForStringUsingFontSize($string, $font, $fontSize = 8)\n {\n @$drawingString = \\iconv('', 'UTF-16BE', $string);\n $characters = array();\n for ($i = 0; $i < strlen($drawingString); $i++) {\n $characters[] = (ord($drawingString[$i++]) << 8) | ord($drawingStri... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Fill a shapely polygon with X number of points | [
"def fill_polygon_with_points(cls, goal=None, polygon=None):\n \n if goal is None:\n raise ValueError(\"Must specify the number of points (goal) to fill the polygon with\")\n\n if polygon is None or (not isinstance(polygon, Polygon) and not isinstance(polygon, MultiPolygon)):\n ... | [
"def data_class_detection(self, data):\n \n assert(isinstance(data, list) or isinstance(data, tuple))\n if not isinstance(self, (LineChart, BarChart, ScatterChart)):\n # From the link above:\n # Simple encoding is suitable for all other types of chart\n # re... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Logs data packets
Makes sure that only the last 1MB worth of packets will be logged
@param String $data
@access private | [
"function _append_log($message_number, $message)\r\n {\r\n switch (NET_SSH2_LOGGING) {\r\n // useful for benchmarks\r\n case NET_SSH2_LOG_SIMPLE:\r\n $this->message_number_log[] = $message_number;\r\n break;\r\n // the ... | [
"def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Finds the Set of Essential Rings.
These rings are contained in every possible SSSR.
The returned set is uniquely defined.
@return a RingSet containing the Essential Rings | [
"public IRingSet findEssentialRings() {\n if (atomContainer == null) {\n return null;\n }\n IRingSet ringSet = toRingSet(atomContainer, cycleBasis().essentialCycles());\n //\t\tatomContainer.setProperty(CDKConstants.ESSENTIAL_RINGS, ringSet);\n return ringSet;\n }"
] | [
"private int dimensionality(Relation<O> rel) {\n // Explicit:\n if(idim >= 0) {\n return idim;\n }\n // Cast to vector field relation.\n @SuppressWarnings(\"unchecked\")\n final Relation<NumberVector> frel = (Relation<NumberVector>) rel;\n int dim = RelationUtil.dimensionality(frel);\n ... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Before this call m_elementContext.m_elementURI is null,
which means it is not yet known. After this call it
is non-null, but possibly "" meaning that it is in the
default namespace.
@return The URI of the element, never null, but possibly "". | [
"private String getElementURI() {\n String uri = null;\n // At this point in processing we have received all the\n // namespace mappings\n // As we still don't know the elements namespace,\n // we now figure it out.\n\n String prefix = getPrefixPart(m_elemContext.m_elementN... | [
"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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
check if protocol is known
@param [String] protocol
@raise [ArgumentError] unknown protocol | [
"def check_protocol(protocol)\n klass = Header.get_header_class_by_name(protocol)\n raise ArgumentError, \"unknown #{protocol} protocol\" if klass.nil?\n\n klass\n end"
] | [
"def version\n v = KJess::Request::Version.new\n r = send_recv( v )\n return r.version if Response::Version === r\n raise KJess::ProtocolError, \"Unexpected Response from VERSION command\"\n end"
] | 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:"
} |
Removes all elements from the hash table. | [
"public void clear() {\n\t\tArrays.fill(m_bit_filter, 0);\n\t\tm_hashBuckets = new AttributeStreamOfInt32(m_hashBuckets.size(),\n\t\t\t\tnullNode());\n\t\tm_lists.clear();\n\n\t}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Quote a raw string.
@param mixed $value Raw string
@return string Quoted string | [
"protected function _quote($value)\n {\n if (is_int($value) || is_float($value)) {\n return $value;\n }\n $this->_connect();\n return \"'\" . $this->_connection->real_escape_string($value) . \"'\";\n }"
] | [
"public function normalizeRules($rules)\n {\n // If you want to use a pipe in a regex, custom message etc,\n // single-quote the string (escaping would be too confusing in regexes):\n //\n // This works with:\n //\n // 'foo?\\'my piped | string\\''\n // \"foo?'my ... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
@param Operation $operation
@param int $pos
@param string $placeholder
@param bool $stripWrappingTags
@return string | [
"protected function diffIsolatedPlaceholder($operation, $pos, $placeholder, $stripWrappingTags = true)\n {\n $oldText = implode('', $this->findIsolatedDiffTagsInOld($operation, $pos));\n $newText = implode('', $this->newIsolatedDiffTags[$pos]);\n\n if ($this->isListPlaceholder($placeholder))... | [
"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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// SetAccelerateConfiguration sets the AccelerateConfiguration field's value. | [
"func (s *PutBucketAccelerateConfigurationInput) SetAccelerateConfiguration(v *AccelerateConfiguration) *PutBucketAccelerateConfigurationInput {\n\ts.AccelerateConfiguration = v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Display pages selected with view
Also reverse lookup option, find pages with the current page selected
@param string $content
@param array $options
@return string | [
"public function display($content, $options = [])\r\n {\r\n $pages = [];\r\n $page_ids = [];\r\n if (isset($options['reverse'])) {\r\n // get page_ids on which current page is selected in this block\r\n $currentPageId = PageBuilder::pageId(true);\r\n if ($cur... | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
\param $skipDynamic if false, include dynamic VAT type to the list being returned. | [
"static function fetchList( $asObject = true, $skipDynamic = false )\n {\n // Fetch \"real\" VAT types, stored in DB.\n $VATTypes = eZPersistentObject::fetchObjectList( eZVatType::definition(),\n null, null, array( 'id' => false ), null,\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Retrieves all the event rows matching a single
{@link com.twitter.hraven.Flow}.
@param flowKey
@return | [
"public List<FlowEvent> getFlowEvents(FlowKey flowKey) throws IOException {\n byte[] startKey =\n Bytes.add(flowKeyConverter.toBytes(flowKey), Constants.SEP_BYTES);\n Scan scan = new Scan(startKey);\n scan.setFilter(new WhileMatchFilter(new PrefixFilter(startKey)));\n\n List<FlowEvent> results = ... | [
"public List<Audit> getAllNotifications(JPAEntity entity) {\n\t\treturn _auditService.findByEntityHostnameMessage(entity.getId(), null, \"Triggering event value:\");\n\t}"
] | codesearchnet | {
"query": "Represent the comment about getstream.io:",
"pos": "Represent the code about getstream.io:",
"neg": "Represent the code about Documentation:"
} |
// URI returns the *url.URL for this SPIFFE ID. | [
"func (id *SpiffeIDSigning) URI() *url.URL {\n\tvar result url.URL\n\tresult.Scheme = \"spiffe\"\n\tresult.Host = id.Host()\n\treturn &result\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 about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Takes ClassContext and checks that each property belongs to the given view.
@param \Represent\Context\ClassContext $classContext
@return ClassContext | [
"private function handleView(ClassContext $classContext)\n {\n $properties = $classContext->properties;\n $reader = $this->annotationReader;\n\n $classContext->properties = array_filter(\n $properties,\n function ($property) use ($reader, $classContext) {\n ... | [
"public @CheckForNull PropertyType getPropertyType(@Nonnull Object instance, @Nonnull String field) {\n // in global.jelly, instance==descriptor\n return instance==this ? getGlobalPropertyType(field) : getPropertyType(field);\n }"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// Fully reads the file named (specfile) and converts content
// to a []string. It is expected that the file is a simple list
// of redis commands, each on a single line. | [
"func readCommandsFromSpecFile(specfile string) ([]string, error) {\n\n\tspec, e := ioutil.ReadFile(specfile)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\tslen := len(spec)\n\tif spec[slen-1] == 0x0a {\n\t\tspec = spec[:slen-1]\n\t}\n\tcommands := strings.Split(string(spec), \"\\n\")\n\n\treturn commands, nil\n}"
] | [
"def file_or_token(value):\n \n if isfile(value):\n with open(value) as fd:\n return fd.read().strip()\n\n if any(char in value for char in '/\\\\.'):\n # This chars will never be in a token value, but may be in a path\n # The error message will be handled by the parser\n ... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
每次交易的pivot表
Returns:
pd.DataFrame
此处的pivot_table一定要用np.sum | [
"def trade(self):\n \n\n return self.history_table.pivot_table(\n index=['datetime',\n 'account_cookie'],\n columns='code',\n values='amount',\n aggfunc=np.sum\n ).fillna(0).sort_index()"
] | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Opens the support assistant with the given configuration | [
"function () {\n\t\t\tvar oModel = this._oDialog.getModel(\"view\"),\n\t\t\t\tsSelectedLocation = oModel.getProperty(\"/SelectedLocation\"),\n\t\t\t\tsStandardUrl = oModel.getProperty(\"/StandardBootstrapURL\"),\n\t\t\t\tsCustomUrl = oModel.getProperty(\"/CustomBootstrapURL\"),\n\t\t\t\taSupportedUrls = [],\n\t\t\t... | [
"@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:"
} |
@param string $role
@throws \InvalidArgumentException | [
"public function setRoleUnauthenticated($role)\n {\n $role = (string) $role;\n if ($role === '') {\n throw new \\InvalidArgumentException('$role cannot be empty');\n }\n\n $this->roleUnauthenticated = $role;\n }"
] | [
"public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get bounding box
@param ImageInterface $image
@return BoxInterface | [
"private function getBoundingBox(ImageInterface $image)\n {\n $box = $image->getSize()->widen($this->size->getWidth());\n if ($box->getHeight() >= $this->size->getHeight()) {\n return $box;\n }\n\n return $image->getSize()->heighten($this->size->getHeight());\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Adds a statement to add a geometry column
@param Blueprint $blueprint
@param Fluent $command
@return string | [
"protected function compileGeometry(Blueprint $blueprint, Fluent $command)\n {\n\n $dimensions = $command->dimensions ?: 2;\n $typmod = $command->typmod ? 'true' : 'false';\n $srid = $command->srid ?: 4326;\n\n return sprintf(\n \"SELECT AddGeometryColumn('%s', '%s', %d, '%... | [
"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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// SetS3BucketName sets the S3BucketName field's value. | [
"func (s *ApplicationSettingsResponse) SetS3BucketName(v string) *ApplicationSettingsResponse {\n\ts.S3BucketName = &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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// SetChangeSource sets the ChangeSource field's value. | [
"func (s *ResourceChangeDetail) SetChangeSource(v string) *ResourceChangeDetail {\n\ts.ChangeSource = &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 summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Retrieves all the view data
@return array | [
"public function getData()\n\t{\n\t\t$data = $this->data;\n\n\t\tforeach ($data as $key => $value)\n\t\t{\n\t\t\tif (is_object($value) and $this->isWhitelisted($value))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($this->shouldBeFiltered($key))\n\t\t\t{\n\t\t\t\tif ($value instanceof Sanitize)\n\t\t\t\t{\n\t\t... | [
"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:"
} |
Returns row as List<InlineKeyboardButtons>
@return list of keyboard buttons
@see InlineMenuButton#toKeyboardButton() | [
"public List<InlineKeyboardButton> toButtons() {\n return buttons.stream()\n .map(InlineMenuButton::toKeyboardButton)\n .collect(Collectors.toList());\n }"
] | [
"public void setMessageText(SendableTextMessage.SendableTextMessageBuilder messageBuilder) {\n SendableTextMessage message = messageBuilder.build();\n baseMessage.getBotInstance().editMessageText(baseMessage, message.getMessage(), message.getParseMode(),\n message.isDisableWebPagePrevie... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Localization:"
} |
Load up the previously stored payload tokens. | [
"private function loadPreviousPayloadAuthTokens()\n {\n if (!$this->previousPayloadAuthTokens) {\n $this->previousPayloadAuthTokens = $this->getAuthRepository()->getPreviousPayloadAuthTokensByContactClient(\n $this->contactClient->getId(),\n null,\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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Calculates the real differences between the two models of the given ModelDiff and saves them to the differences
field of the ModelDiff class. | [
"private static void calculateDifferences(ModelDiff diff) {\n Class<?> modelClass = diff.getBefore().getClass();\n for (Field field : modelClass.getDeclaredFields()) {\n if (field.getName().equals(ModelUtils.MODEL_TAIL_FIELD_NAME)) {\n continue;\n }\n tr... | [
"@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 text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
load single property. | [
"private function loadProperty(\\DOMXPath $xpath, \\DOMNode $node, &$tags)\n {\n $result = $this->loadValues(\n $xpath,\n $node,\n [\n 'name',\n 'type',\n 'minOccurs',\n 'maxOccurs',\n 'colspan',\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
InternalXtext.g:3122:1: ruleTerminalToken returns [EObject current=null] : (this_TerminalTokenElement_0= ruleTerminalTokenElement ( ( (lv_cardinality_1_1= '?' | lv_cardinality_1_2= '*' | lv_cardinality_1_3= '+' ) ) )? ) ; | [
"public final EObject ruleTerminalToken() throws RecognitionException {\n EObject current = null;\n\n Token lv_cardinality_1_1=null;\n Token lv_cardinality_1_2=null;\n Token lv_cardinality_1_3=null;\n EObject this_TerminalTokenElement_0 = null;\n\n\n\n \tenterRule();\n\n ... | [
"def visitPairDef(self, ctx: jsgParser.PairDefContext):\n \n if ctx.name(): # Options 1 or 3\n self.visitChildren(ctx)\n else:\n self._type_reference = as_token(ctx)\n if ctx.ebnfSuffix():\n self.visit(ctx.ebnfSuffix())"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Creates an alarm that binds this check with a notification plan. | [
"def create_alarm(self, notification_plan, criteria=None, disabled=False,\n label=None, name=None, metadata=None):\n \n return self.manager.create_alarm(self.entity, self, notification_plan,\n criteria=criteria, disabled=disabled, label=label, name=name,\n meta... | [
"@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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Computes the name to be used to reference the signing key in the cache. | [
"private final String computeSigningCacheKeyName(AWSCredentials credentials,\n AWS4SignerRequestParams signerRequestParams) {\n final StringBuilder hashKeyBuilder = new StringBuilder(\n credentials.getAWSSecretKey());\n\n return hashKeyBuilder.append(\"-\")\n .... | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Change account password.
@return \Illuminate\Http\RedirectResponse | [
"public function changePassword(Request $request)\n {\n $this->validate(\n $request,\n [\n 'old_password' => 'required',\n 'new_password' => 'required|min:8',\n ]\n );\n\n if (!Hash::check($request->input('old_password'), Auth::u... | [
"public function beforeSend(\\Mmi\\Http\\Request $request)\n {\n //pobranie odpowiedzi\n $response = \\Mmi\\App\\FrontController::getInstance()->getResponse();\n //zmiana contentu\n $response->setContent((new \\Cms\\Model\\ContentFilter($response->getContent()))->getFilteredContent())... | codesearchnet | {
"query": "Represent the summarization about Laravel:",
"pos": "Represent the code about Laravel:",
"neg": "Represent the code about Programming:"
} |
Writes the byte array to the OutputStream from the client.
@param output
the output
@throws IOException
Signals that an I/O exception has occurred.
@see org.apache.wicket.util.resource.IResourceStreamWriter#write(java.io.OutputStream) | [
"@Override\r\n\tpublic void write(final OutputStream output) throws IOException\r\n\t{\r\n\t\tinitialize();\r\n\t\tif (content == null)\r\n\t\t{\r\n\t\t\tcontent = new byte[0];\r\n\t\t}\r\n\t\toutput.write(content, 0, content.length);\r\n\t\toutput.flush();\r\n\t}"
] | [
"private S getInputStreamForFile(File file) throws IOException {\n assert file != null : \"File must be specified\";\n return this.getInputStreamForRawStream(new FileInputStream(file));\n }"
] | codesearchnet | {
"query": "Represent the sentence about Java programming:",
"pos": "Represent the code about Java programming:",
"neg": "Represent the code about Software development:"
} |
This takes an error vector and a correlation matrix and assembles the covariance | [
"def assemble_covariance(error, correlation):\n \n\n covariance = []\n for n in range(0, len(error)):\n covariance.append([])\n for m in range(0, len(error)):\n covariance[n].append(correlation[n][m]*error[n]*error[m])\n return _n.array(covariance)"
] | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Unsuppresses an email address by removing it from the the client's
suppression list | [
"def unsuppress(self, email):\n \"\"\"\"\"\"\n params = {\"email\": email}\n response = self._put(self.uri_for(\"unsuppress\"),\n body=\" \", params=params)"
] | [
"protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Data synchronization:"
} |
------------------------------------------------------------------------ | [
"public void setStateBackend(StateBackend backend) {\n\t\tif (backend != null) {\n\t\t\ttry {\n\t\t\t\tInstantiationUtil.writeObjectToConfig(backend, this.config, STATE_BACKEND);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new StreamTaskException(\"Could not serialize stateHandle provider.\", e);\n\t\t\t}\n\t\t}\... | [
"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 description about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code:"
} |
@param array $services
@return array | [
"protected function format(array $services): array\n {\n return Collection::make($services)->map(function (array $service) {\n return [\n 'id' => $service['ID'],\n 'name' => $service['Service'],\n 'host' => $service['Address'],\n 'po... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Insert a fragment, replacing the old value if the path exists.
@param path the path where to insert (or replace) a dictionary value.
@param fragment the new dictionary value to be applied. | [
"public <T> AsyncMutateInBuilder upsert(String path, T fragment) {\n if (StringUtil.isNullOrEmpty(path)) {\n throw new IllegalArgumentException(\"Path must not be empty for upsert\");\n }\n this.mutationSpecs.add(new MutationSpec(Mutation.DICT_UPSERT, path, fragment));\n retur... | [
"function inflate(object) {\n // check if the object is an object and isn't empty\n if (is(object) && !empty(object)) {\n // create a new object for the result\n let result = {};\n\n // for each key in the object\n Object.keys(object).forEach((path) => {\n // get value from the object\n cons... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return the intrinsic pore volume.
Returns
-------
:class:`float`
The intrinsic pore volume. | [
"def calculate_pore_volume(self):\n \n self.pore_volume = sphere_volume(self.calculate_pore_diameter() / 2)\n self.properties['pore_volume'] = self.pore_volume\n return self.pore_volume"
] | [
"def _check_cutoff(self):\n \n\n if self.cutoff is not None:\n\n cutoff = self.cutoff # Namespace shortcut for speed.\n\n def check_cutoff(distance):\n \"\"\"\n Stops the search of the investigated node of the ArciDispatch\n algorithm... | codesearchnet | {
"query": "Represent the Github text about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about Computer Science:"
} |
// NextSubnet returns the next available subnet of the desired mask size
// starting for the maximum IP of the offset subnet
// If the IP exceeds the maxium IP then the second return value is true | [
"func NextSubnet(network *net.IPNet, prefixLen int) (*net.IPNet, bool) {\n\t_, currentLast := AddressRange(network)\n\tmask := net.CIDRMask(prefixLen, 8*len(currentLast))\n\tcurrentSubnet := &net.IPNet{IP: currentLast.Mask(mask), Mask: mask}\n\t_, last := AddressRange(currentSubnet)\n\tlast = Inc(last)\n\tnext := &... | [
"int blockForReadSpace(int readLocation) {\n\n // sets the nextReadLocation my moving it on by 1, this may cause it it wrap back to the start.\n final int nextReadLocation = (readLocation + 1 == capacity) ? 0 : readLocation + 1;\n\n // in the for loop below, we are blocked reading unit another ... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
清除非必须的表
@param {Object} font font对象 | [
"function cleanTables(font) {\n delete font.readOptions;\n delete font.tables;\n delete font.hmtx;\n delete font.post.glyphNameIndex;\n delete font.post.names;\n delete font.subsetMap;\n\n // 删除无用的表\n var cff = font.CFF;\n ... | [
"public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returs mapper based on the content type. | [
"def get_mapper_by_content_type(self, content_type):\n \n\n content_type = util.strip_charset(content_type)\n return self._get_mapper(content_type)"
] | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// GetObject wrapper function that accepts a request context | [
"func (c Client) getObjectWithContext(ctx context.Context, bucketName, objectName string, opts GetObjectOptions) (*Object, error) {\n\t// Input validation.\n\tif err := s3utils.CheckValidBucketName(bucketName); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := s3utils.CheckValidObjectName(objectName); err != nil ... | [
"@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 text about AWS S3:",
"pos": "Represent the Github code about AWS S3:",
"neg": "Represent the Github code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.