query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Copies the whole set of predicates, by creating new instances of each one in the given set.
@return the new set of Predicate objects with different instance for each of the Predicate | [
"private Set<Predicate> copyPredicatesSet() {\n Set<Predicate> predicatesCopy = Sets.newLinkedHashSet();\n for (Predicate predicate : this.predicates) {\n Predicate copyPredicate = new Predicate();\n copyPredicate.setField(predicate.getField());\n copyPredicate.setOperator(predicate.getOperator... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Big user search method ! hell yeah ! | [
"public function searchPartialList($searches, $page, $limit, $count = false)\n {\n $baseFieldsName = User::getUserSearchableFields();\n $facetFields = $this->objectManager->getRepository('ClarolineCoreBundle:Facet\\FieldFacet')->findAll();\n $facetFieldsName = array();\n\n foreach ($f... | [
"public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
@private
Watches the project for filesystem changes so that the tree can be updated. | [
"function _watchProjectRoot(rootPath) {\n FileSystem.on(\"change\", _fileSystemChange);\n FileSystem.on(\"rename\", _fileSystemRename);\n\n FileSystem.watch(FileSystem.getDirectoryForPath(rootPath), ProjectModel._shouldShowName, ProjectModel.defaultIgnoreGlobs, function (err) {\n if ... | [
"function _doLaunchAfterServerReady(initialDoc) {\n // update status\n _setStatus(STATUS_CONNECTING);\n _createLiveDocumentForFrame(initialDoc);\n\n // start listening for requests\n _server.start();\n\n // Install a one-time event handler when connected to the launcher pag... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Transforms the response content as a string.<p>
@param content the content
@return the transformed content | [
"private String transformContent(String content) {\n\n try {\n List<CmsJsonPart> parts = CmsJsonPart.parseJsonParts(content);\n JSONArray keys = new JSONArray();\n JSONObject output = new JSONObject();\n for (CmsJsonPart part : parts) {\n if (output.... | [
"@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Store a EventualResult.
Return an integer, a unique identifier that can be used to retrieve
the object. | [
"def store(self, deferred_result):\n \n self._counter += 1\n self._stored[self._counter] = deferred_result\n return self._counter"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
null unless we do set one. | [
"function warn(str, code) {\n if (process.stdout.writable)\n process.stdout.write(str + '\\n');\n\n if (typeof code != 'undefined')\n process.exit(code);\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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Specialized version of .download_media() for photos | [
"async def _download_photo(self, photo, file, date, thumb, progress_callback):\n \"\"\"\"\"\"\n # Determine the photo and its largest size\n if isinstance(photo, types.MessageMediaPhoto):\n photo = photo.photo\n if not isinstance(photo, types.Photo):\n return\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return a connection. | [
"def _acquire_connection(self, host, port, use_ssl=False, tunnel=True):\n ''''''\n if hasattr(self._connection_pool, 'acquire_proxy'):\n connection = yield from \\\n self._connection_pool.acquire_proxy(host, port, use_ssl,\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 Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Initializes the repository's prepared statements.
@return void | [
"public function init()\n {\n\n // initialize the prepared statements\n $this->customerVarcharsStmt =\n $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_VARCHARS));\n $this->customerVarcharByAttributeCodeAndEntityTypeIdAndAndValueStmt =\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 sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Programming:"
} |
// SetFlags implements Command.SetFlags. | [
"func (c *addImageMetadataCommand) SetFlags(f *gnuflag.FlagSet) {\n\tc.cloudImageMetadataCommandBase.SetFlags(f)\n\n\tf.StringVar(&c.Region, \"region\", \"\", \"image cloud region\")\n\tf.StringVar(&c.Series, \"series\", \"\", \"image series\")\n\tf.StringVar(&c.Arch, \"arch\", \"amd64\", \"image architecture\")\n\... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about File management:"
} |
Returns the value of given configuration option.
@throws \UnexpectedValueException
@param string $option
@return mixed | [
"public function getConfigOption($option)\n {\n // An exception will be thrown instead of returning NULL or something similar.\n if ( ! array_key_exists($option, $this->config)) {\n throw new UnexpectedValueException(\"Unexpected option name: {$option}\");\n }\n\n return $t... | [
"function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi... | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
// Returns the lease configuration parameters | [
"func (b *backend) pathLeaseRead(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {\n\tlease, err := b.Lease(ctx, req.Storage)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif lease == nil {\n\t\treturn nil, nil\n\t}\n\n\tlease.TTL = lease.TTL / time.Second\n\tlease... | [
"@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 about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
// getName returns the local contact name corresponding to a phone number,
// or failing to find a contact the phone number itself | [
"func getName(tel string) string {\n\tif n, ok := telToName[tel]; ok {\n\t\treturn n\n\t}\n\treturn tel\n}"
] | [
"static String getHostString(InetSocketAddress socketAddress) {\n InetAddress address = socketAddress.getAddress();\n if (address == null) {\n // The InetSocketAddress was specified with a string (either a numeric IP or a host name). If\n // it is a name, all IPs for that name should be tried. If it... | codesearchnet | {
"query": "Represent the sentence about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code:"
} |
// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. | [
"func (s *Cluster) SetPreferredMaintenanceWindow(v string) *Cluster {\n\ts.PreferredMaintenanceWindow = &v\n\treturn s\n}"
] | [
"public final void start() {\n if (!enabled) {\n return;\n }\n\n long periodSeconds = properties.getSeconds(PERIOD_SECONDS);\n if (periodSeconds <= 0) {\n long defaultValue = Long.parseLong(PERIOD_SECONDS.getDefaultValue());\n logger.warning(\"Provided cl... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Resolves macros in all properties in a map.<p>
@param properties the map of properties in which macros should be resolved
@param resolver the macro resolver to use
@return a new map of properties with resolved macros | [
"public static Map<String, CmsXmlContentProperty> resolveMacrosInProperties(\n Map<String, CmsXmlContentProperty> properties,\n I_CmsMacroResolver resolver) {\n\n Map<String, CmsXmlContentProperty> result = new LinkedHashMap<String, CmsXmlContentProperty>();\n for (Map.Entry<String, CmsX... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Verify email global format
@param string $p_address
@return boolean | [
"public static function verifyFormatting($p_address)\n {\n if (strstr($p_address, \"@\") == false) {\n return false;\n } else {\n list($user, $domain) = explode('@', $p_address);\n if (strstr($domain, '.') == false) {\n return false;\n } el... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get first date from current year
@param d date
@return first date from current year | [
"public static Date getFirstDayFromCurrentYear(Date d) {\n Calendar cal = Calendar.getInstance();\n cal.setTime(d); \n cal.set(Calendar.MONTH, Calendar.JANUARY);\n cal.set(Calendar.DAY_OF_MONTH, 1);\n cal.set(Calendar.HOUR_OF_DAY, 0);\n cal.set(Calend... | [
"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 post about datetime:",
"pos": "Represent the code about datetime:",
"neg": "Represent the code about datetime:"
} |
// Determines if the log contains zero entries. | [
"func (l *Log) isEmpty() bool {\n\tl.mutex.RLock()\n\tdefer l.mutex.RUnlock()\n\treturn (len(l.entries) == 0) && (l.startIndex == 0)\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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetSharpness applies the input sharpness to the receiving Waveform struct. | [
"func (w *Waveform) SetSharpness(sharpness uint) error {\n\treturn w.SetOptions(Sharpness(sharpness))\n}"
] | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Get a QuerySet for all trigger log objects for the same connected model.
Args:
exclude_self (bool): Whether to exclude this log object from the result list | [
"def related(self, *, exclude_self=False):\n \n manager = type(self)._default_manager\n queryset = manager.related_to(self)\n if exclude_self:\n queryset = queryset.exclude(id=self.id)\n return queryset"
] | [
"def reflect_filter(sources, model, cache=None):\n '''\n '''\n targets = [reflect(source, model, cache=cache) for source in sources]\n # Some objects may not be available in target DB (not published), so we\n # have to exclude None from the list.\n return [target for target in targets if target is... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Determine if the input string (str) contains this. | [
"@Override\n public boolean containedBy(IValue str) {\n if (str.getClass() != ValueString.class)\n return false;\n return (((ValueString) str).value.indexOf(value) != -1);\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 summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
// Attr returns the value of an attribute.
// If you need to check for the existence of an attribute,
// use Attribute. | [
"func (xmlNode *XmlNode) Attr(name string) (val string) {\n\tif xmlNode.NodeType() != XML_ELEMENT_NODE {\n\t\treturn\n\t}\n\tnameBytes := GetCString([]byte(name))\n\tnamePtr := unsafe.Pointer(&nameBytes[0])\n\tvalPtr := C.xmlGetProp(xmlNode.Ptr, (*C.xmlChar)(namePtr))\n\tif valPtr == nil {\n\t\treturn\n\t}\n\tp := ... | [
"function Scope(context, parent, meta) {\n\t// The object that will be looked on for values.\n\t// If the type of context is TemplateContext, there will be special rules for it.\n\tthis._context = context;\n\t// The next Scope object whose context should be looked on for values.\n\tthis._parent = parent;\n\t// If t... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
(Optional) - If callback url is not set
(Required) - If callback url is set | [
"public function setShippingOptions($options)\n {\n if(!is_array($options)) {\n $options = array($options);\n }\n $this->_shippingOptions = $options;\n\n return $this;\n }"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Converts a word to its plural form.
@param string $name the word to be pluralized
@return string the pluralized word | [
"public function pluralize($name)\n\t{\n\t\t$rules=array(\n\t\t\t'/(m)ove$/i' => '\\1oves',\n\t\t\t'/(f)oot$/i' => '\\1eet',\n\t\t\t'/(c)hild$/i' => '\\1hildren',\n\t\t\t'/(h)uman$/i' => '\\1umans',\n\t\t\t'/(m)an$/i' => '\\1en',\n\t\t\t'/(s)taff$/i' => '\\1taff',\n\t\t\t'/(t)ooth$/i' => '\\1eeth',\n\t\t\t'/(p)erso... | [
"def stem(text):\n \"\"\"\"\"\"\n text = text.lower()\n \"\"\"Stem each word of the French text.\"\"\"\n\n stemmed_text = ''\n\n word_tokenizer = WordTokenizer('french')\n tokenized_text = word_tokenizer.tokenize(text)\n for word in tokenized_text:\n \"\"\"remove the simple endings from ... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetEncryptionKey sets the EncryptionKey field's value. | [
"func (s *ImportTerminologyInput) SetEncryptionKey(v *EncryptionKey) *ImportTerminologyInput {\n\ts.EncryptionKey = 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 sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// Fetch data from the pfconfig socket for a string payload
// Returns the bytes received from the socket | [
"func FetchSocket(ctx context.Context, payload string) []byte {\n\tc := connectSocket(ctx)\n\n\t// Send our query in the socket\n\tfmt.Fprintf(c, payload)\n\n\tvar buf bytes.Buffer\n\tbuf.ReadFrom(c)\n\n\t// First 4 bytes are a little-endian representing the length of the payload\n\tvar length uint32\n\tbinary.Read... | [
"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 instruction about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
Returns the verified forum.
@param int $categoryId forum category ID
@param int $id forum ID
@param string $slug forum slug
@param bool $guest whether caller is guest or registered user
@return Forum
@since 0.2 | [
"public static function verify($categoryId = null, $id = null, $slug = null, $guest = true)\r\n {\r\n if (!is_numeric($categoryId) || $categoryId < 1 || !is_numeric($id) || $id < 1 || empty($slug)) {\r\n return null;\r\n }\r\n return static::find()->joinWith(['category' => functio... | [
"public static function getDatabaseConfig($dbConfig = null)\n {\n $config = Config::getInstance();\n\n if (is_null($dbConfig)) {\n $dbConfig = $config->database;\n }\n\n /**\n * Triggered before a database connection is established.\n *\n * This even... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Returns the text representing this field's definition inside a create
table statement.
@return string - the string for defining this field in a mysql table. | [
"public function getFieldString()\n {\n $fieldString = \"`\" . $this->m_name . \"` \" . $this->m_type;\n \n if ($this->m_constraint != null)\n {\n $fieldString .= \" (\" . $this->m_constraint . \")\";\n }\n \n if ($this->isAutoIncrementing())\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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Validate image size, dimension or mimetypes
@return boolean | [
"protected function contraintsValidator()\n {\n /* check image for valid mime types and return mime */\n $this->getImageMime($this->_files['tmp_name']);\n /* validate image mime type */\n if (!in_array($this->mime, $this->mimeTypes)) {\n $this->error = sprintf($this->commonUploadErrors... | [
"def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Marshall the given parameter object. | [
"public void marshall(DescribeMyUserProfileRequest describeMyUserProfileRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (describeMyUserProfileRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n } catch (Exce... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Remove all trace of the extension
@since 3.2.0 | [
"public void removeExtension() {\n\n\t\tif (geoPackage.isTable(MetadataReference.TABLE_NAME)) {\n\t\t\tgeoPackage.dropTable(MetadataReference.TABLE_NAME);\n\t\t}\n\n\t\tif (geoPackage.isTable(Metadata.TABLE_NAME)) {\n\t\t\tgeoPackage.dropTable(Metadata.TABLE_NAME);\n\t\t}\n\n\t\ttry {\n\t\t\tif (extensionsDao.isTab... | [
"public function hookModuleInstallBefore(&$result)\n {\n $library = $this->library->get('jquery');\n\n if (empty($library['version']) || version_compare($library['version'], '1.8.0', '<')) {\n $result = gplcart_text('Jquery Mobile requires Jquery >= 1.8.0');\n }\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
/*
Apply effects from executing an actor behavior. | [
"function applyBehaviorEffect(effect) {\n if (effect.sent.length > 0) {\n options.enqueue(events, effect.sent);\n }\n initEffect(effect);\n }"
] | [
"function transformer (selection) {\n const type = quantum.isSelection(selection) ? selection.type() : undefined\n const entityTransform = transformMap[type] || defaultTransform\n return entityTransform(selection, transformer, meta) // bootstrap to itself to make the transformer accessible to children\n ... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Return true if there was no error, false if there was an error. | [
"function checkForDisallowedESSymbolOperand(operator) {\n var offendingSymbolOperand = maybeTypeOfKind(leftType, 512 /* ESSymbol */) ? left :\n maybeTypeOfKind(rightType, 512 /* ESSymbol */) ? right :\n undefined;\n if (offendingSymbolOperand) ... | [
"function callback(unknown) {\n // returns the cb if a cb\n // returns a noop function if undefined\n // throws an error if neither\n // -------------------------\n // assume it is a function to be returned\n var returnFunction = unknown;\n // check if it's undefined\n if (unknown === undefi... | codesearchnet | {
"query": "Represent the text about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code:"
} |
Rename a table in the database
:param dbconn: database connection
:param original: original table name
:param new: new table name | [
"def rename_table(dbconn, original, new):\n \n cur = dbconn.cursor()\n cur.execute(\"ALTER TABLE '{original}' RENAME TO '{new}'\".format(original=original, new=new))"
] | [
"def _find_datastream(self, name):\n \"\"\"\"\"\"\n for stream in self.data_streams: #search to see if this is a new datastream or a known one\n if stream.name == name:\n return stream\n return None"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Data processing:"
} |
Internal handler for the bash completion support. | [
"def _bashcomplete(cmd, prog_name, complete_var=None):\n \"\"\"\"\"\"\n if complete_var is None:\n complete_var = '_%s_COMPLETE' % (prog_name.replace('-', '_')).upper()\n complete_instr = os.environ.get(complete_var)\n if not complete_instr:\n return\n\n from ._bashcomplete import bashc... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Checkboxes template.
@param \Orchestra\Contracts\Html\Form\Field $field
@return \Illuminate\Contracts\Support\Htmlable | [
"public function checkboxes(FieldContract $field): Htmlable\n {\n return $this->form->checkboxes(\n $field->get('name'),\n $this->asArray($field->get('options')),\n $field->get('checked'),\n $field->get('attributes')\n );\n }"
] | [
"public function register()\n {\n $this->registerHtmlBuilder();\n\n $this->registerFormBuilder();\n\n $this->app->alias('html', 'Collective\\Html\\HtmlBuilder');\n $this->app->alias('form', 'Rokde\\LaravelBootstrap\\Html\\BootstrapFormBuilder');\n }"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
// Return function version from alias name, if alias not found, return the input | [
"func (f *Function) GetVersionFromAlias(alias string) (string, error) {\n\tvar version string = alias\n\taliases, err := f.GetAliases()\n\tif err != nil {\n\t\treturn version, err\n\t}\n\n\tfor _, fnAlias := range aliases.Aliases {\n\t\tif strings.Compare(version, *fnAlias.Name) == 0 {\n\t\t\tversion = *fnAlias.Fun... | [
"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 sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Get vat
If no "vat" value has been set, this method will
set and return a default "vat" value,
if any such value is available
@see getDefaultVat()
@return int|null vat or null if no vat has been set | [
"public function getVat() : ?int \n {\n if ( ! $this->hasVat()) {\n $this->setVat($this->getDefaultVat());\n }\n return $this->vat;\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// HandleEvent handles events. In particular, it handles certain key events
// to move the cursor or pan the view. | [
"func (a *CellView) HandleEvent(e tcell.Event) bool {\n\tif a.model == nil {\n\t\treturn false\n\t}\n\tswitch e := e.(type) {\n\tcase *tcell.EventKey:\n\t\tswitch e.Key() {\n\t\tcase tcell.KeyUp, tcell.KeyCtrlP:\n\t\t\ta.keyUp()\n\t\t\treturn true\n\t\tcase tcell.KeyDown, tcell.KeyCtrlN:\n\t\t\ta.keyDown()\n\t\t\tr... | [
"function getTargetInstForInputEventPolyfill(topLevelType, targetInst, nativeEvent) {\n if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {\n // On the selectionchange event, the target is just document which isn't\n // helpful for us so just check act... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// NewRandomBalancer returns a random proxy balancer. | [
"func NewRandomBalancer(targets []*ProxyTarget) ProxyBalancer {\n\tb := &randomBalancer{commonBalancer: new(commonBalancer)}\n\tb.targets = targets\n\treturn b\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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
The index action will render the main screen the users see when they log in in to the admin
@Route("/", name="KunstmaanAdminBundle_homepage")
@Template("@KunstmaanAdmin/Default/index.html.twig")
@return array | [
"public function indexAction()\n {\n if ($this->container->hasParameter('kunstmaan_admin.dashboard_route')) {\n return $this->redirect($this->generateUrl($this->getParameter('kunstmaan_admin.dashboard_route')));\n }\n\n /* @var DashboardConfiguration $dashboardConfiguration */\n ... | [
"public function resetProfileAction()\n {\n $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN');\n\n $em = $this->getDoctrine()->getManager();\n $em->getRepository('KunstmaanDashboardBundle:AnalyticsConfig')->resetProfileId();\n\n return $this->redirect($this->generateUrl('KunstmaanDas... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Sales Channel API:"
} |
Initializes transporter instance.
@param broker
parent ServiceBroker | [
"@Override\r\n\tpublic void started(ServiceBroker broker) throws Exception {\r\n\t\tsuper.started(broker);\r\n\r\n\t\t// Process config\r\n\t\tServiceBrokerConfig cfg = broker.getConfig();\r\n\t\tnamespace = cfg.getNamespace();\r\n\t\tif (namespace != null && !namespace.isEmpty()) {\r\n\t\t\tprefix = prefix + '-' +... | [
"@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 Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Programming:"
} |
@param mixed $val
@return int
@throws \frictionlessdata\tableschema\Exceptions\FieldValidationException; | [
"protected function validateCastValue($val)\n {\n if (isset($this->descriptor()->bareNumber) && $this->descriptor()->bareNumber === false) {\n return mb_ereg_replace('((^\\D*)|(\\D*$))', '', $val);\n } elseif (!is_numeric($val)) {\n throw $this->getValidationException('value m... | [
"public function GetTableColumnNames($tableName) {\n $this->setDbConfigList(array());\n $dbConfig = new \\Puzzlout\\Framework\\Dal\\DbStatementConfig(null, \\Puzzlout\\Framework\\Dal\\DbExecutionType::COLUMNNAMES, new \\Puzzlout\\Framework\\Dal\\DbQueryFilters());\n $dbConfig->setQuery(\"DESCRI... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Create a new {@link FutureResult} by taking care to wrap or cast the given {@link Throwable} to the right {@link SMTPException}
@param t
@return result | [
"@SuppressWarnings(\"rawtypes\")\n public static FutureResult create(Throwable t) {\n final SMTPException exception;\n if (t instanceof SMTPException) {\n exception = (SMTPException) t;\n } else if (t instanceof ConnectException) {\n exception = new SMTPConnectionExcept... | [
"public OptionalThing<Redirectable> getMappedRedirectable() { // exists after application exception handling\n final Class<?> exType = getClass();\n return OptionalThing.ofNullable(mappedRedirectable, () -> {\n throw new IllegalStateException(\"Not found the mapped redirectable in exception... | codesearchnet | {
"query": "Represent the post about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about Language and Writing:"
} |
Serializes Exercise parameters.
@param Exercise $exercise
@return array | [
"private function serializeParameters(Exercise $exercise)\n {\n $parameters = [\n 'type' => $exercise->getType(),\n 'maxAttempts' => $exercise->getMaxAttempts(),\n 'maxAttemptsPerDay' => $exercise->getMaxAttemptsPerDay(),\n 'maxPapers' => $exercise->getMaxPapers... | [
"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:"
} |
Sets the user's password to *raw_password*, hashed with bcrypt. | [
"def bcrypt_set_password(self, raw_password):\n \n if not is_enabled() or raw_password is None:\n _set_password(self, raw_password)\n else:\n salt = bcrypt.gensalt(get_rounds())\n self.password = 'bc$' + bcrypt.hashpw(smart_str(raw_password), salt)"
] | [
"def enable_root_f5(host)\n for tries in 1..10\n begin\n #This command is problematic as the F5 is not always done loading\n if host.exec(Command.new(\"modify sys db systemauth.disablerootlogin value false\"), :acceptable_exit_codes => [0,1]).exit_code == 0 \\\n and host.e... | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
This method will try to load and verify the token using the given key.
It returns a JWS and will populate the $signature variable in case of success, otherwise an exception is thrown.
@throws \Exception | [
"public function loadAndVerifyWithKey(string $token, JWK $key, ?int &$signature, ?string $payload = null): JWS\n {\n $keyset = JWKSet::createFromKeys([$key]);\n\n return $this->loadAndVerifyWithKeySet($token, $keyset, $signature, $payload);\n }"
] | [
"public function body($payload, $mimeType = null)\n {\n $this->mime($mimeType);\n $this->payload = $payload;\n // Iserntentially don't call _serializePayload yet. Wait until\n // we actually send off the request to convert payload to string.\n // At that time, the `serialized_... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Adds the loading mixin
@method constructor
@param args {Object} the arguments to the base constructor method | [
"function(args) {\n base.call(this, args);\n this.loadedOnceDeferred = new $.Deferred();\n this.loadedOnce = false;\n this.loadingCount = 0;\n // Loading is a convenience flag that is the equivalent of loadingCount > 0\n this.loading = false;\n }"
] | [
"function transformer (selection) {\n const type = quantum.isSelection(selection) ? selection.type() : undefined\n const entityTransform = transformMap[type] || defaultTransform\n return entityTransform(selection, transformer, meta) // bootstrap to itself to make the transformer accessible to children\n ... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
This method returns FlatGraph structure
@param configuration
@return | [
"public FlatGraph asFlatGraph(long graphId, ExecutorConfiguration configuration) {\n return FlatGraph.getRootAsFlatGraph(asFlatBuffers(graphId, configuration));\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Initialises table
@param int $group retrieve only users from this group (optional) | [
"protected function init($group = 0) {\n\n $tablecolumns = array('userpic', 'fullname', 'groups');\n $tableheaders = array(\n get_string('userpic'),\n get_string('fullnameuser'),\n get_string('groups')\n );\n\n $extrafields = get_extra_user_fields($this->... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
NEXT_MAJOR: add this method to the interface.
@param bool|true $loadChildren
@return CategoryInterface[] | [
"public function getAllRootCategories($loadChildren = true)\n {\n $class = $this->getClass();\n\n $rootCategories = $this->getObjectManager()->createQuery(sprintf('SELECT c FROM %s c WHERE c.parent IS NULL', $class))\n ->execute();\n\n $categories = [];\n\n foreach ($rootCa... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Adds a Record to the Zone
@param r The record to be added
@see Record | [
"public void\naddRecord(Record r) {\n\tName name = r.getName();\n\tint rtype = r.getRRsetType();\n\tsynchronized (this) {\n\t\tRRset rrset = findRRset(name, rtype);\n\t\tif (rrset == null) {\n\t\t\trrset = new RRset(r);\n\t\t\taddRRset(name, rrset);\n\t\t} else {\n\t\t\trrset.addRR(r);\n\t\t}\n\t}\n}"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Get current user info.
@return null|array | [
"public function getUserData()\n {\n if (!$this->tokenStorage->getToken()\n || !$this->authorizationChecker->isGranted('IS_AUTHENTICATED_REMEMBERED')\n ) {\n return null;\n }\n\n $user = $this->tokenStorage->getToken()->getUser();\n\n if (!$user) {\n ... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// AllocateService allocates all the network resources such as virtual
// IP and ports needed by the service. | [
"func (na *cnmNetworkAllocator) AllocateService(s *api.Service) (err error) {\n\tif err = na.portAllocator.serviceAllocatePorts(s); err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tna.DeallocateService(s)\n\t\t}\n\t}()\n\n\tif s.Endpoint == nil {\n\t\ts.Endpoint = &api.Endpoint{}\n\t}... | [
"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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Generate token
@param int $length
@return string | [
"private function generateToken($length)\n {\n $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"§$%&/()=[]{}';\n\n $useChars = array();\n // select some random chars:\n for ($i = 0; $i < $length; $i++) {\n $useChars[] = $characters[mt_rand(0, strlen($ch... | [
"static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}"
] | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
"<" [ "@" route ":" ] local-part "@" domain ">"
@return mixed Mailbox object, or false.
@throws Horde_Mail_Exception | [
"protected function _parseAngleAddr()\n {\n if ($this->_curr() != '<') {\n return false;\n }\n\n $this->_rfc822SkipLwsp(true);\n\n if ($this->_curr() == '@') {\n // Route information is ignored.\n $this->_parseDomainList();\n if ($this->_cur... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Fetches the content of the given url.
@param string $url
@param array $headers
@return \Psr\Http\Message\ResponseInterface | [
"protected function getResponse($url, array $headers = []): ResponseInterface\n {\n return $this->httpClient->sendRequest($this->buildRequest($url, $headers));\n }"
] | [
"public static function bindToObject(TelegramResponse $data, LoggerInterface $logger): TelegramTypes\n {\n return new File($data->getResult(), $logger);\n }"
] | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
// SetHost sets host config if not empty. | [
"func (c *configV7) setHost(alias string, cfg hostConfigV7) {\n\tif _, ok := c.Hosts[alias]; !ok {\n\t\tc.Hosts[alias] = cfg\n\t}\n}"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Turn a potential object into a dictionary that fully specifies the
state of the object.
Parameters
----------
potential : :class:`~gala.potential.PotentialBase`
The instantiated :class:`~gala.potential.PotentialBase` object. | [
"def to_dict(potential):\n \n from .. import potential as gp\n\n if isinstance(potential, gp.CompositePotential):\n d = dict()\n d['class'] = potential.__class__.__name__\n d['components'] = []\n for k, p in potential.items():\n comp_dict = _to_dict_help(p)\n ... | [
"def _evaluatelinearPotentials(Pot,x,t=0.):\n \"\"\"\"\"\"\n if isinstance(Pot,list):\n sum= 0.\n for pot in Pot:\n sum+= pot._call_nodecorator(x,t=t)\n return sum\n elif isinstance(Pot,linearPotential):\n return Pot._call_nodecorator(x,t=t)\n else: #pragma: no cov... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Handle on meta received
@param array $metaData The meta data
@return array New meta data | [
"protected function onMetaReceived($metaData)\n {\n $meta = $metaData;\n $meta[\"columns\"] = array();\n foreach ($this->params as $colname) {\n if (isset($metaData[\"columns\"][$colname])) {\n $meta[\"columns\"][$colname] = $metaData[\"columns\"][$colname];\n ... | [
"public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //... | codesearchnet | {
"query": "Represent the Github description about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about Software Development:"
} |
Create an instance of {@link JAXBElement }{@code <}{@link ArithType }{@code >}} | [
"@XmlElementDecl(namespace = \"http://www.w3.org/1998/Math/MathML\", name = \"root\")\n public JAXBElement<ArithType> createRoot(ArithType value) {\n return new JAXBElement<ArithType>(_Root_QNAME, ArithType.class, null, value);\n }"
] | [
"@SuppressWarnings(\"unchecked\")\n public Map<String, Field> getValueAsMap() {\n return (Map<String, Field>) type.convert(getValue(), Type.MAP);\n }"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Perform calibration | [
"def calibrate(self, counts, calibration, channel):\n \"\"\"\"\"\"\n # Convert 16bit counts from netCDF4 file to the original 10bit\n # GVAR counts by dividing by 32. See [FAQ].\n counts = counts / 32.\n\n coefs = CALIB_COEFS[self.platform_name][channel]\n if calibration ==... | [
"def set_mode_label_to_ifcw(self):\n \"\"\"\"\"\"\n self.setWindowTitle(self.ifcw_name)\n self.lblSubtitle.setText(tr(\n 'Use this wizard to run a guided impact assessment'))"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the name of the class namespace
The namespace will not have a leading forward-slash, eg "Headzoo\Core" instead
of "\Headzoo\Core". An empty string is returned when the class is in the
global namespace.
@return string | [
"public function getNamespaceName()\n {\n $caller = get_called_class();\n $parts = explode('\\\\', $caller);\n array_pop($parts);\n \n return join('\\\\', $parts);\n }"
] | [
"protected function normalizeEntity($fullName, $_namespace = null)\n {\n // split fullname into entity parts\n $entityParts = explode('.', $fullName);\n if (count($entityParts) > 1) {\n // templates don't have a custom namespace\n $entity = array_pop($entityParts);\n ... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software Development:"
} |
@name every
@kind function
@description
Checks if given exp is present in all members in the array | [
"function every(array, exp) {\n\n if(!isArray(array) || isUndefined(exp)) {\n return true;\n }\n\n return array.every(function(elm) {\n return (isObject(elm) || isFunction(exp))\n ? $parse(exp)(elm)\n : elm === exp;\n });\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// BlendLuv blends two colors in the CIE-L*u*v* color-space, which should result in a smoother blend.
// t == 0 results in c1, t == 1 results in c2 | [
"func (c1 Color) BlendLuv(c2 Color, t float64) Color {\n\tl1, u1, v1 := c1.Luv()\n\tl2, u2, v2 := c2.Luv()\n\treturn Luv(l1+t*(l2-l1),\n\t\tu1+t*(u2-u1),\n\t\tv1+t*(v2-v1))\n}"
] | [
"def get_hs_color(self):\n \n # Get the color from homematic. In general this is just the hue parameter.\n hm_color = self.getCachedOrUpdatedValue(\"COLOR\", channel=self._color_channel)\n\n if hm_color >= 200:\n # 200 is a special case (white), so we have a saturation of 0.\n... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
console.log("getOpenTabInfo: savedUrlMap : " + savedUrlMap.toJS()); | [
"function mergeTabItems(openItems, mergeSavedItems) {\n var savedItem = mergeSavedItems.get(0);\n return openItems.map(function (openItem) {\n return openItem.set('saved', true).set('savedBookmarkId', savedItem.savedBookmarkId).set('savedBookmarkIndex', savedItem.savedBookmarkIndex).set('savedTitle', sav... | [
"function (data) {\n var temp = removePath(validUrls, data.path);\n methods.sendUpdatedIfChanged(validUrls, temp, ui.socket);\n }"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Add data specifc to matching question types to a translator event.
@param [String => Mixed] $translatorevent
@param PHPObj $questionAttempt
@param PHPObj $question
@return [String => Mixed] | [
"public function matchStatement($translatorevent, $questionAttempt, $question) {\n\n $translatorevent['interaction_type'] = 'matching';\n\n $targets = [];\n $sources = [];\n $correctResponses = [];\n $responseTargetsPos = [];\n $responseSourcesPos = [];\n\n foreach (... | [
"function resolve(){\n\t\tLRState::clear_index();\n\t\tLRStation::clear_index();\n\t\t// create Root Set\n\t\t// we SHOULD have a single etransition to an intial state\n\t\treturn LRStateSet::init( $this->etransitions[0], $this->Grammar );\n\t}"
] | codesearchnet | {
"query": "Represent the Github text about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about Computer Science:"
} |
// fetch fetches the operating systems from the database. | [
"func (t *OSesTable) fetch(c context.Context) error {\n\tdb := database.Get(c)\n\trows, err := db.QueryContext(c, `\n\t\tSELECT id, name, description\n\t\tFROM oses\n\t`)\n\tif err != nil {\n\t\treturn errors.Annotate(err, \"failed to select operating systems\").Err()\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {... | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the Github post about Data processing:",
"pos": "Represent the Github code about Data processing:",
"neg": "Represent the Github code about Technology:"
} |
Offset to retrieve
@link http://php.net/manual/en/arrayaccess.offsetget.php
@param mixed $offset The offset to retrieve.
@return mixed Can return all argument types.
@throws InvalidArgumentException | [
"public function offsetGet($offset)\n {\n if (!is_scalar($offset)) {\n throw new InvalidArgumentException('scalar', 0);\n }\n if (!$this->offsetExists($offset)) {\n throw new \\DomainException(\"$offset is not set\");\n }\n return $this->children[$offset];... | [
"protected static function intervalHasTime(DateInterval $interval)\n {\n // The array_key_exists and get_object_vars are used as a workaround to check microsecond support.\n // Both isset and property_exists will fail on PHP 7.0.14 - 7.0.21 due to the following bug:\n // https://bugs.php.net... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
Computes the signature for an authorized request per {@link https://dev.twitter.com/oauth/overview/creating-signatures}
@param requestMethod
@param targetUrl
@param params
@param consumerSecret
@param tokenSecret
@return | [
"public String computeSignature(String requestMethod, String targetUrl, Map<String, String> params, @Sensitive String consumerSecret, @Sensitive String tokenSecret) {\n\n String signatureBaseString = createSignatureBaseString(requestMethod, targetUrl, params);\n\n // Hash the base string using the con... | [
"public Token postXAuth(final String email, final String password) {\n OAuthRequest request = constructXAuthPost(email, password);\n setToken(\"\", \"\"); // Empty token is required for Scribe to execute XAuth.\n sign(request);\n return clearXAuth(request.send());\n }"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
// AndOrderBy appends additional columns to the existing ORDER BY clause.
// Column names will be properly quoted. A column name can contain "ASC" or "DESC" to indicate its ordering direction. | [
"func (s *SelectQuery) AndOrderBy(cols ...string) *SelectQuery {\n\ts.orderBy = append(s.orderBy, cols...)\n\treturn s\n}"
] | [
"protected function compileAnsiOffset(Builder $query, $components)\n {\n // An ORDER BY clause is required to make this offset query work, so if one does\n // not exist we'll just create a dummy clause to trick the database and so it\n // does not complain about the queries for not having an... | codesearchnet | {
"query": "Represent the Github sentence about Cassandra database:",
"pos": "Represent the Github code about Cassandra database:",
"neg": "Represent the Github code about Software development:"
} |
Divide a tree branch to a forest,
each subtree of size at most chunksize | [
"def make_forest(self, chunksize):\n \n heap = []\n heappush(heap, (-self.size, self))\n while True:\n w, x = heappop(heap)\n if w == 0: \n heappush(heap, (0, x))\n break\n if x.less is None \\\n or (x.size < chunk... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
def search(self, cset: Set[ClassId]):
slice = self.mica_ic_df.loc[cset]
am = self.assocmodel
for i in am.subjects:
pass # TODO | [
"def search(self,\n id_list: Set,\n negated_classes: Set,\n method: Optional) -> List[SimResult]:\n \n raise NotImplementedError"
] | [
"def get_gsims(self, trt):\n \n if trt == '*' or trt == b'*': # fake logictree\n [trt] = self.values\n return sorted(self.values[trt])"
] | codesearchnet | {
"query": "Represent the sentence about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code:"
} |
Chunk the underlying collection array.
@param int $size
@return CollectionInterface | [
"public function chunk($size): CollectionInterface\n {\n if (!($size > 0)) {\n return $this::make([]);\n }\n return $this->wrap(function (Iterator $data) use ($size) {\n $chunk = [];\n $count = 0;\n foreach ($data as $key => $item) {\n ... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Returns a PropelConditionalProxy instance.
Allows for conditional statements in a fluid interface.
@param boolean $cond ignored
@return PropelConditionalProxy|$this|Criteria | [
"public function _elseif($cond)\n {\n if (!$this->conditionalProxy) {\n throw new LogicException(__METHOD__ .' must be called after _if()');\n }\n\n return $this->conditionalProxy->_elseif($cond);\n }"
] | [
"public FluentSelect selectByValue(final String value) {\n executeAndWrapReThrowIfNeeded(new SelectByValue(value), Context.singular(context, \"selectByValue\", null, value), true);\n return new FluentSelect(super.delegate, currentElement.getFound(), this.context, monitor, booleanInsteadOfNotFoundExcep... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Returns if this maps the specified cell.
@param cell the cell name
@return {@code true} if this maps the column, {@code false} otherwise | [
"public boolean mapsCell(String cell) {\n return mappedCells.stream().anyMatch(x -> x.equals(cell));\n }"
] | [
"public String getDescriptiveName()\n {\n StringBuilder sb = new StringBuilder(getDistributionName());\n sb.append(\"(\");\n String[] vars = getVariables();\n double[] vals = getCurrentVariableValues();\n \n sb.append(vars[0]).append(\" = \").append(vals[0]);\n \n... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
normalize an array of path components | [
"function normalizeArray (v, keepBlanks) {\n var L = v.length, dst = new Array(L), dsti = 0,\n i = 0, part, negatives = 0,\n isRelative = (L && v[0] !== '');\n for (; i<L; ++i) {\n part = v[i];\n if (part === '..') {\n if (dsti > 1) {\n --dsti;\n } else if (isRel... | [
"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:"
} |
// WriteTo write SQL to Writer | [
"func (like Like) WriteTo(w Writer) error {\n\tif _, err := fmt.Fprintf(w, \"%s LIKE ?\", like[0]); err != nil {\n\t\treturn err\n\t}\n\t// FIXME: if use other regular express, this will be failed. but for compatible, keep this\n\tif like[1][0] == '%' || like[1][len(like[1])-1] == '%' {\n\t\tw.Append(like[1])\n\t} ... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github text about writing:",
"pos": "Represent the Github code about writing:",
"neg": "Represent the Github code about programming:"
} |
This returns the position of the first real char in a list item
For example:
'*Hello' # => 1
'* Hello' # => 2
' * Hello' # => 3
' * Hello' # => 5
'1.Hello' # => 2
' 1. Hello' # => 5 | [
"def spaces_before_first_char(s)\n\t\tcase s.md_type\n\t\twhen :ulist\n\t\t\ti=0;\n\t\t\t# skip whitespace if present\n\t\t\twhile s[i,1] =~ /\\s/; i+=1 end\n\t\t\t# skip indicator (+, -, *)\n\t\t\ti+=1\n\t\t\t# skip optional whitespace\n\t\t\twhile s[i,1] =~ /\\s/; i+=1 end\n\t\t\treturn i\n\t\twhen :olist\n\t\t\t... | [
"def add_reg_with_block_format\n # ** Data Register 3 **\n # This is dreg\n add_reg :dreg, 0x1000, size: 16 do |reg|\n # This is dreg bit 15\n reg.bit 15, :bit15, reset: 1\n # **Bit 14** - This does something cool\n #\n # 0 | Coolness is disabled\n # 1 | C... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
<p>Set the value of the <code>footerClass</code> property.</p> | [
"public void setFooterClass(java.lang.String footerClass) {\n getStateHelper().put(PropertyKeys.footerClass, footerClass);\n }"
] | [
"function getJavaParameterListSimple(parameters, returnType) {\n var result = []\n\n result.push(\"<span class='type'>Channel</span> <span class='parameterName'>channel</span>\")\n\n parameters.forEach(function(parameter){\n if (parameter.out) return\n result.push(\"<span class='type'>\" + ge... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about language and writing:"
} |
// SetCreatedAt sets the body's CreatedAt | [
"func (b *BaseBody) SetCreatedAt(t *strfmt.DateTime) {\n\tif t == nil {\n\t\tb.StructCreatedAt = time.Now().UTC()\n\t} else {\n\t\tb.StructCreatedAt = time.Time(*t)\n\t}\n}"
] | [
"function initialize () {\n return pullTaskRunner.run(function() {\n return store.defineTable({\n name: pulltimeTableName,\n columnDefinitions: {\n id: 'string', // column for storing queryId\n tableName: 'string', // column for s... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Run to a position relative to the current `position` value.
The new position will be current `position` + `position_sp`.
When the new position is reached, the motor will stop using
the action specified by `stop_action`. | [
"def run_to_rel_pos(self, **kwargs):\n \n for key in kwargs:\n setattr(self, key, kwargs[key])\n self.command = self.COMMAND_RUN_TO_REL_POS"
] | [
"function step (context) {\n // call method again on next available frame\n context.frame = window.requestAnimationFrame(step.bind(window, context))\n const time = now()\n let elapsed = (time - context.startTime) / 468\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed\n // apply ... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Get the current writer position | [
"def get_writer_position(self, name):\n \"\"\"\"\"\"\n cursor = self.cursor\n cursor.execute('SELECT timestamp FROM gauged_writer_history '\n 'WHERE id = %s', (name,))\n result = cursor.fetchone()\n return result[0] if result else 0"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the sentence about writing:",
"pos": "Represent the code about writing:",
"neg": "Represent the code:"
} |
@name DatabaseUser._setProperties
@description Loads the properties of an object into this instance
@param {Object} details the details to load | [
"function(details) {\n var self = this;\n this.name = details.name;\n this.password = details.password;\n\n if (details.databases) {\n var dbs = [];\n\n for (var i = 0; i < details.databases.length; i++) {\n dbs.push(new rackspace.Database(self.instan... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Retrieve all table as a Map of (name, sql).
@param db
the db
@return the all tables | [
"public static Map<String, String> getAllTables(SQLiteDatabase db) {\n\t\tfinal Map<String, String> result = new LinkedHashMap<>();\n\n\t\tquery(db, null, QueryType.TABLE, new OnResultListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onRow(SQLiteDatabase db, String name, String sql) {\n\t\t\t\tif (StringUtils.hasT... | [
"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 description about database:",
"pos": "Represent the code about database:",
"neg": "Represent the code:"
} |
// SetTopicArn sets the TopicArn field's value. | [
"func (s *Snapshot) SetTopicArn(v string) *Snapshot {\n\ts.TopicArn = &v\n\treturn s\n}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Parses a collection of YAML nodes.
@param array $nodes The YAML nodes
@return array An array of values or Constraint instances | [
"protected function parseNodes(array $nodes)\n {\n $values = [];\n\n foreach ($nodes as $name => $childNodes) {\n if (is_numeric($name) && \\is_array($childNodes) && 1 === \\count($childNodes)) {\n $options = current($childNodes);\n\n if (\\is_array($options... | [
"public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software Development:"
} |
// SetHealthCheckSSLCertificate SSLサーバ証明書有効期限ヘルスチェック設定 | [
"func (s *SimpleMonitor) SetHealthCheckSSLCertificate(remainingDays int) {\n\t// set default\n\tif remainingDays < 0 {\n\t\tremainingDays = 30\n\t}\n\ts.Settings.SimpleMonitor.HealthCheck = &SimpleMonitorHealthCheck{\n\t\tProtocol: \"sslcertificate\",\n\t\tRemainingDays: remainingDays,\n\t}\n}"
] | [
"func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Check allowed file extensions | [
"def __allowed_extension(self, filename, extensions):\r\n \r\n allowed_extensions = current_app.config['UPLOADS']['EXTENSIONS']\r\n if extensions is not None:\r\n allowed_extensions = extensions\r\n return '.' in filename and filename.rsplit('.', 1)[1].lower() in \\\r\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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the migration fields of the model.
@param DOMXPath $rootPath
@return TableMigration | [
"protected function loadMigrationFields(DOMXPath $rootPath)\n {\n $fields = $rootPath->query(\n './value[@type=\"list\" and @key=\"columns\"]/value[@type=\"object\" and @struct-name=\"db.mysql.Column\"]'\n );\n\n if ($fields && $fields->length) {\n /** @var \\DOMNode $f... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Adds the text key and its associated object in this object.
@param text The text.
@param val The value object associated with the text. | [
"public TextTrieMap<V> put(CharSequence text, V val) {\n CharIterator chitr = new CharIterator(text, 0, _ignoreCase);\n _root.add(chitr, val);\n return this;\n }"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Drop-in replacement for healpy `~healpy.pixelfunc.pix2vec`. | [
"def pix2vec(nside, ipix, nest=False):\n \"\"\"\"\"\"\n lon, lat = healpix_to_lonlat(ipix, nside, order='nested' if nest else 'ring')\n return ang2vec(*_lonlat_to_healpy(lon, lat))"
] | [
"def ccmodmd_setcoef(k):\n \n\n # Set working coefficient maps for ccmod step and compute DFT of\n # coefficient maps Z\n mp_Zf[k] = sl.rfftn(mp_Z_Y1[k], mp_cri.Nv, mp_cri.axisN)"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get javascript to reflect new color selection in color picker preview for
name and description fields .
@param colorPickedPreview
changed color
@return javascript for the selected color. | [
"public static String changeToNewSelectedPreviewColor(final String colorPickedPreview) {\n return new StringBuilder().append(NEW_PREVIEW_COLOR_REMOVE_SCRIPT).append(NEW_PREVIEW_COLOR_CREATE_SCRIPT)\n .append(\"var newColorPreviewStyle = \\\".v-app .new-tag-name{ border: solid 3px \")\n ... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Swaps from the view fragment to the edit fragment.
@param target
the target
@param form
the form | [
"public void onSwapToEdit(final AjaxRequestTarget target, final Form<?> form)\n\t{\n\t\tswapFragments();\n\t\tif (target != null)\n\t\t{\n\t\t\tAnimate.slideUpAndDown(view, target);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tLOGGER.error(\n\t\t\t\t\"AjaxRequestTarget is null on method SwapFragmentPanel#onSwapToEdit(AjaxRequest... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Add multiple spacers to the output buffer.
@param int $count
@return Writer | [
"public function spacers(int $count = 1): Writer\n {\n for ($x = 0; $x < $count; $x++) {\n $this->spacer();\n }\n\n return $this;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Helper method to allow altering callback methods | [
"function(options, methods){\n options = options || {};\n\n // Wrap yes/no methods with a success method\n options['success'] = function(result){\n if ( methods['isValidResult'](result) ){\n if (typeof methods['yes'] === \"function\") methods['yes'](result);\n } else {\n ... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Convert stencil functions to GL constants.
@param function The function.
@return The resulting GL constant. | [
"public static int stencilFunctionToGL(\n final JCGLStencilFunction function)\n {\n switch (function) {\n case STENCIL_ALWAYS:\n return GL.GL_ALWAYS;\n case STENCIL_EQUAL:\n return GL.GL_EQUAL;\n case STENCIL_GREATER_THAN:\n return GL.GL_GREATER;\n case STENCIL_GREATE... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
character limit
Returns column type, either :primary_key, :string, :text, :integer, :float, :decimal, :datetime, :date, :binary, :boolean | [
"def column_type\n return @column_type if defined?(@column_type)\n ind = self.index\n table[1..500].each do |row|\n if row[ind] and row[ind].cell_type\n cel_column_type = row[ind].cell_type\n if !defined?(@column_type) or @column_type.nil?\n @column_type = cel_colu... | [
"def get_sql(self):\n \"\"\"\"\"\"\n test_method = [\n self.is_time,\n self.is_date,\n self.is_datetime,\n self.is_decimal,\n self.is_year,\n self.is_tinyint,\n self.is_smallint,\n self.is_mediumint,\n s... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Write a compressed file.
@param string $compressedFilepath
@param string $filepath
@return void | [
"public function writeCompressedFile($compressedFilepath, $filepath)\n\t{\n\t\t$filePointer = fopen($compressedFilepath, 'w');\n\t\tfwrite($filePointer, gzencode(file_get_contents($filepath), 9));\n\t\tfclose($filePointer);\n\t}"
] | [
"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 description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Error handler
@param $errno
@param $errstr
@param $errfile
@param $errline
@return Boolean
@throws ErrorException | [
"public function handleError($errno, $errstr, $errfile, $errline) {\n $errorIsEnabled = (bool)($errno & ini_get('error_reporting'));\n\n // FATAL ERROR\n if(isset(self::$fatalErrors[$errno]) && $errorIsEnabled) {\n throw new \\ErrorException($errstr, 0, $errno, $errfile, $errline);\n }\n\n // NO... | [
"final static function f($op) {return dfcf(function(OP $op) {\n\t\t$c = df_con_hier($m = df_ar(dfpm($op), M::class), __CLASS__); /** @var string $c */ /** @var M $m */\n\t\treturn new $c($m);\n\t}, [dfp($op)]);}"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.