query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Creates a new AvroNamedSchemata instance of this schemata instance
with the given $schema appended.
@param AvroNamedSchema $schema to add to this existing schemata
@return AvroNamedSchemata
@throws AvroSchemaParseException | [
"public function clone_with_new_schema($schema)\n {\n $name = $schema->fullname();\n if (AvroSchema::is_valid_type($name))\n throw new AvroSchemaParseException(\n sprintf('Name \"%s\" is a reserved type name', $name));\n else if ($this->has_name($name))\n throw new AvroSchemaParseExceptio... | [
"@Override\n public KeyComponent createClusteringColumnReferenceComponent(Facet parent, PojoBinding<?> pojoBinding, NamingStrategy namingStrategy) {\n throw new HecateException(\"@ClusteringColumn facet \\\"%s\\\" references class with composite keys\", parent.getName());\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about language and writing:"
} |
Returns the symbol formated to be searched by regular expression.
:param symbol: The symbol.
:type symbol: str
:return: The symbol formated.
:rtype: str | [
"def _get_formated_symbol(self, symbol):\n \n # pylint: disable=no-self-use\n\n old_symbols = [\n '\\\\',\n '.',\n '+',\n '*',\n '?',\n '^',\n '$',\n '[',\n ']',\n '{',\n '}'... | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// RefreshCache refreshes the cached list of favorites. | [
"func (f *Favorites) RefreshCache(ctx context.Context) {\n\tif f.disabled || f.hasShutdown() {\n\t\treturn\n\t}\n\t// This request is non-blocking, so use a throw-away done channel\n\t// and context.\n\treq := &favReq{\n\t\trefresh: true,\n\t\tdone: make(chan struct{}),\n\t\tctx: context.Background(),\n\t}\n... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Compare returns an integer comparing the Duration instant t to o.
// If d is after o, return 1, equal o, return 0, before o, return -1. | [
"func (d Duration) Compare(o Duration) int {\n\tif d.Duration > o.Duration {\n\t\treturn 1\n\t} else if d.Duration == o.Duration {\n\t\treturn 0\n\t} else {\n\t\treturn -1\n\t}\n}"
] | [
"def _RoundTowardZero(value, divider):\n \"\"\"\"\"\"\n # For some languanges, the sign of the remainder is implementation\n # dependent if any of the operands is negative. Here we enforce\n # \"rounded toward zero\" semantics. For example, for (-5) / 2 an\n # implementation may give -3 as the result with the ... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Returns the current handler for situations when interpolation argument
is missing. MissingInterpolationArgument will be raised by default. | [
"def missing_interpolation_argument_handler\n @@missing_interpolation_argument_handler ||= lambda do |missing_key, provided_hash, string|\n raise MissingInterpolationArgument.new(missing_key, provided_hash, string)\n end\n end"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// SetTimestampOffset sets the TimestampOffset field's value. | [
"func (s *TimecodeConfig) SetTimestampOffset(v string) *TimecodeConfig {\n\ts.TimestampOffset = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
https://developer.zendesk.com/rest_api/docs/core/resource_collections#retrieve-a-resource-collection | [
"def resource_collection_show(self, id, **kwargs):\n \"\"\n api_path = \"/api/v2/resource_collections/{id}.json\"\n api_path = api_path.format(id=id)\n return self.call(api_path, **kwargs)"
] | [
"def authorize_proxy_routes\n deny_access unless (authenticate || authenticate_client)\n\n route, params = Engine.routes.router.recognize(request) do |rte, parameters|\n break rte, parameters if rte.name\n end\n\n # route names are defined in routes.rb (:as => :name)\n case route.nam... | codesearchnet | {
"query": "Represent the Github description about developer.zendesk.com:",
"pos": "Represent the Github code about developer.zendesk.com:",
"neg": "Represent the Github code:"
} |
Public method that wraps the extraction of the content.
:param url: The resource to be processed.
:return: The response in a Json format. | [
"def getResponse(self, url):\n \n # Defining an empty object for the response\n response = {}\n try:\n # This receives only the parameters needed by this Tor Wrapper:\n # {\n # \"host\" : \"127.0.0.1\"\n # \"port\" : \"9150\"\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Indicates if the object or specified field has been validated.
@param string $key Optional key to check for specific validation.
@return boolean True if the object or specified field has been fully
validated successfully. | [
"public function isValidated($key= '') {\n $unvalidated = array_diff($this->_dirty, $this->_validated);\n if (empty($key)) {\n $validated = (count($unvalidated) > 0);\n } else {\n $validated = !in_array($this->getField($key), $unvalidated);\n }\n return $vali... | [
"public function validate( $input )\n {\n // Check if passed input is an object and instance of phpillowDocument\n // at all, otherwise we can exit immediately\n if ( !is_object( $input ) ||\n !( $input instanceof phpillowDocument ) )\n {\n throw new phpillowVal... | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about PHP programming:"
} |
Create a preset which help to convert media files on be played in a wide range of devices.
@param request The request object containing all options for deleting presets. | [
"public CreatePresetResponse createPreset(CreatePresetRequest request) {\n checkNotNull(request, \"The parameter request should NOT be null.\");\n \n InternalRequest internalRequest = createRequest(HttpMethodName.POST, request, PRESET);\n\n return invokeHttpClient(internalRequest, Create... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Creates or returns a singleton :class:`.Connection` object | [
"def connect(*args, **kwargs):\n \"\"\"\"\"\"\n global __CONNECTION\n if __CONNECTION is None:\n __CONNECTION = Connection(*args, **kwargs)\n\n return __CONNECTION"
] | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Set alias to room id
Args:
room_id (str): The room id.
room_alias (str): The room wanted alias name. | [
"def set_room_alias(self, room_id, room_alias):\n \n data = {\n \"room_id\": room_id\n }\n\n return self._send(\"PUT\", \"/directory/room/{}\".format(quote(room_alias)),\n content=data)"
] | [
"def initialize(self, action=None, comment=None, user=None,\n restricted=None):\n self.action = none_or(action, bool)\n \n\n self.comment = none_or(comment, bool)\n \"\"\"\n Is the comment of this revision deleted/suppressed? : `bool`\n \"\"\"\n\n s... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
parse name without directories | [
"private String getFileName(String name) {\n //check if the environment is linux or windows\n if (name.contains(Constants.FORWARD_SLASH)) {\n name = name.substring(name.lastIndexOf(Constants.FORWARD_SLASH) + 1, name.length());\n } else if (name.contains(Constants.BACK_SLASH)) {\n ... | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Adds the given value to the embeddeds. Will skip doing so if the value is {@literal null} or the content of a
{@link EntityModel} is {@literal null}.
@param source can be {@literal null}. | [
"public void add(@Nullable Object source) {\n\n\t\tEmbeddedWrapper wrapper = wrappers.wrap(source);\n\n\t\tif (wrapper == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tHalLinkRelation collectionRel = getDefaultedRelFor(wrapper, true);\n\t\tHalLinkRelation collectionOrItemRel = collectionRel;\n\n\t\tif (!embeddeds.containsKe... | [
"@Override\n public boolean setProperty(String name, Object value)\n {\n /* Note: can not call local method, since it'll return false for\n * recognized but non-mutable properties\n */\n return mConfig.setProperty(name, value);\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// UpdateIssuesCommit checks if issues are manipulated by commit message. | [
"func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit) error {\n\t// Commits are appended in the reverse order.\n\tfor i := len(commits) - 1; i >= 0; i-- {\n\t\tc := commits[i]\n\n\t\trefMarked := make(map[int64]bool)\n\t\tfor _, ref := range IssueReferenceKeywordsPat.FindAllString(c.Message,... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// Growing Persistent volumes is only allowed for PVCs for which their StorageClass
// explicitly allows it. | [
"func (pvcr *persistentVolumeClaimResize) allowResize(pvc, oldPvc *api.PersistentVolumeClaim) bool {\n\tpvcStorageClass := apihelper.GetPersistentVolumeClaimClass(pvc)\n\toldPvcStorageClass := apihelper.GetPersistentVolumeClaimClass(oldPvc)\n\tif pvcStorageClass == \"\" || oldPvcStorageClass == \"\" || pvcStorageCl... | [
"func (v *azureVolumeSource) ReleaseVolumes(ctx context.ProviderCallContext, volumeIds []string) ([]error, error) {\n\t// Releasing volumes is not supported, see azureStorageProvider.Releasable.\n\t//\n\t// When managed disks can be moved between resource groups, we may want to\n\t// support releasing unmanaged dis... | codesearchnet | {
"query": "Represent the post about container management:",
"pos": "Represent the code about container management:",
"neg": "Represent the code about programming:"
} |
Called in getTransaction
@param gtid | [
"public static final void removeTxn(Xid xid)\n {\n if (tc.isEntryEnabled()) Tr.entry(tc, \"removeTxn\", xid);\n\n final ByteArray key = new ByteArray(xid.getGlobalTransactionId());\n\n final JCATranWrapper wrapper;\n\n synchronized (txnTable)\n {\n wrapper = txnTable... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence about API documentation:",
"pos": "Represent the Github code about API documentation:",
"neg": "Represent the Github code:"
} |
Hàm kiểm tra dữ liệu đã tồn tại hay chưa, nếu chưa sẽ ghi mới, nếu tồn tại sẵn sẽ update
@author: 713uk13m <dev@nguyenanhung.com>
@time : 2019-04-07 04:01
@param array $dataInsert
@param array $dataUpdate
@param array $wheres
@return int | [
"public function checkExistsAndInsertOrUpdateData($dataInsert = [], $dataUpdate = [], $wheres = [])\n {\n $this->connection();\n $db = DB::table($this->table);\n if (is_array($wheres) && count($wheres) > 0) {\n foreach ($wheres as $field => $value) {\n if (is_array(... | [
"public function actionDeleteitems(){\r\n // Kieu item xoa\r\n $type = Yii::$app->request->post('type');\r\n \r\n // Id cua diy\r\n $diyId = Yii::$app->request->post('diyId');\r\n \r\n // Id cua container\r\n $containerId = Yii::$app->request->post('containerI... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
returns a function like initial / exp(n * alpha) | [
"def make_exponential_temperature(initial_temperature, alpha):\n ''''''\n def _function(n):\n try:\n return initial_temperature / math.exp(n * alpha)\n except OverflowError:\n return 0.01\n return _function"
] | [
"def ystep(self):\n \n \"\"\"\n\n self.Y = self.Pcn(self.AX + self.U)"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// ValidateUpdate is the default update validation for an end user. | [
"func (leaseStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {\n\treturn validation.ValidateLeaseUpdate(obj.(*coordination.Lease), old.(*coordination.Lease))\n}"
] | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// ls -l style output for a file, which is in the 'long output' section of a readdir response packet
// this is a very simple (lazy) implementation, just enough to look almost like openssh in a few basic cases | [
"func runLs(dirname string, dirent os.FileInfo) string {\n\tdsys := dirent.Sys()\n\tif dsys == nil {\n\t} else if statt, ok := dsys.(*syscall.Stat_t); !ok {\n\t} else {\n\t\treturn runLsStatt(dirent, statt)\n\t}\n\n\treturn path.Join(dirname, dirent.Name())\n}"
] | [
"func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \... | codesearchnet | {
"query": "Represent the summarization about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software development:"
} |
// addSidecars adds all sidecars to the pod spec of the step.
// Optionally volume mounts from the main container to the sidecar | [
"func addSidecars(pod *apiv1.Pod, tmpl *wfv1.Template) error {\n\tif len(tmpl.Sidecars) == 0 {\n\t\treturn nil\n\t}\n\tmainCtr := findMainContainer(pod)\n\tif mainCtr == nil {\n\t\tpanic(\"Unable to locate main container\")\n\t}\n\tfor _, sidecar := range tmpl.Sidecars {\n\t\tlog.Debugf(\"Adding sidecar container %... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Parse string (usually the accept header) and divide it in to
an array of parts that includes the mime type, quality and other
params.
@param string $accept
@return array | [
"public function parseHeader($accept)\n {\n // Array of supported mime types and their params\n $supported = [];\n\n // Separate the header into parts based on the comma (,) char\n $ranges = array_map('trim', explode(',', $accept));\n\n $index = 0;\n // Loop through all ... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
sing a song
hehe
:param a: I'm a
:param b: I'm b
:param c: I'm c
:param name: I'm name | [
"def sing(a, b, c=False, name='yetone'):\n \n print('test0.sing: <a: {}, b: {}, c: {}> by {}'.format(a, b, c, name))"
] | [
"def cmd(send, msg, args):\n \n if not msg:\n send(\"Choose what?\")\n return\n choices = msg.split(' or ')\n action = [\n 'draws a slip of paper from a hat and gets...', 'says eenie, menie, miney, moe and chooses...', 'picks a random number and gets...',\n 'rolls dice and ge... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Adds article to Vendor config | [
"public function addVendor()\n {\n $oConfig = \\OxidEsales\\Eshop\\Core\\Registry::getConfig();\n\n $aAddArticle = $this->_getActionIds('oxarticles.oxid');\n $soxId = $oConfig->getRequestParameter('synchoxid');\n\n if ($oConfig->getRequestParameter('all')) {\n $sArtTable = ... | [
"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:"
} |
// SetUnitResource sets the resource metadata for a specific unit. | [
"func (st resourceState) SetUnitResource(unitName, userID string, chRes charmresource.Resource) (_ resource.Resource, outErr error) {\n\tlogger.Tracef(\"adding resource %q for unit %q\", chRes.Name, unitName)\n\tvar empty resource.Resource\n\n\tapplicationID, err := names.UnitApplication(unitName)\n\tif 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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// SetTotalBytes sets the TotalBytes field's value. | [
"func (s *DataTransfer) SetTotalBytes(v int64) *DataTransfer {\n\ts.TotalBytes = &v\n\treturn s\n}"
] | [
"public static void reset(File directory, int processNumber) {\n try (DefaultProcessCommands processCommands = new DefaultProcessCommands(directory, processNumber, true)) {\n // nothing else to do than open file and reset the space of specified process\n }\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
return random paragraphs from word resource
@param [Fixnum] total count of paragraph
@return [String] paragraph | [
"def paragraphs(total, opts)\n list = []\n total.times do\n sentence_count = rand(sentence_count_range_in_a_paragraph)\n start_sep = opts[:start_sep].to_s\n end_sep = opts[:end_sep].to_s\n list << start_sep + self.sentences(sentence_count) + end_sep\n end\n return lis... | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Remove Tags from a Customer
@param mixed $tags,...
@return array | [
"public function removeTags($tags)\n {\n $result = $this->getClient()\n ->send('/v1/customers/'.$this->uuid.'/attributes/tags', 'DELETE', [\n 'tags' => func_get_args()\n ]);\n\n $this->attributes['tags'] = $result['tags'];\n return $result['tags'];\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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Creates a new commerce shipment item with the primary key. Does not add the commerce shipment item to the database.
@param commerceShipmentItemId the primary key for the new commerce shipment item
@return the new commerce shipment item | [
"public static com.liferay.commerce.model.CommerceShipmentItem createCommerceShipmentItem(\n\t\tlong commerceShipmentItemId) {\n\t\treturn getService().createCommerceShipmentItem(commerceShipmentItemId);\n\t}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
// Cascade indicates if loading sub Struct | [
"func (session *Session) Cascade(trueOrFalse ...bool) *Session {\n\tif len(trueOrFalse) >= 1 {\n\t\tsession.statement.UseCascade = trueOrFalse[0]\n\t}\n\treturn session\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 Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// ArrayCount - Count the number of elements in a JSON array. | [
"func (g *Container) ArrayCount(path ...string) (int, error) {\n\tif array, ok := g.Search(path...).Data().([]interface{}); ok {\n\t\treturn len(array), nil\n\t}\n\treturn 0, ErrNotArray\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
****************************************
遍历文件夹文件
**************************************** | [
"async function mapdir(src, callback) {\n let stats = await stat(src),\n result = [];\n\n // 判断是否存在文件夹\n if (stats) {\n let fullpath = path.cwd(src),\n data = assign(stats, { path: fullpath });\n\n\n // 执行回调\n result.push(callback ? callback(data) : data);\n\n ... | [
"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 Github summarization about N/A:",
"pos": "Represent the Github code about N/A:",
"neg": "Represent the Github code about programming:"
} |
// stripEmptyDimensions removes dimensions that are empty, such as "cores:". | [
"func stripEmptyDimensions(dims []string) []string {\n\tsource := strpair.ParseMap(dims)\n\tresult := strpair.Map{}\n\tfor k, ds := range source {\n\t\tfor _, dim := range ds {\n\t\t\tif dim != \"\" {\n\t\t\t\tresult.Add(k, dim)\n\t\t\t}\n\t\t}\n\t}\n\treturn result.Format()\n}"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Execute the request using the supplied client
@param client the client
@return The request | [
"public T execute(HyperionClient client)\n {\n EntityList<T> entityResponse = client.update(build());\n List<T> entries = entityResponse.getEntries();\n return entries.size() == 0 ? null : entries.get(0);\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 post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Programming:"
} |
// SetMeasuringsFilter implements the MonitorBackend interface. | [
"func (b *stdBackend) SetMeasuringsFilter(f IDFilter) IDFilter {\n\told := b.etmFilter\n\tb.etmFilter = f\n\treturn old\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 summarization about Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code about Programming:"
} |
extend that supports getters/setters only extends functions | [
"function extend( to, from ){\n var desc, key;\n for ( key in from ){\n desc = Object.getOwnPropertyDescriptor( from, key );\n if ( desc.get || desc.set ){\n\n Object.defineProperty( to, key, desc );\n\n } else if ( Physics.util.isFunction( desc.value ) ... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Handles typing @ symbols in input fields for internet explorer due to it failing when done normally.
:param text: desired string ot text to input
:param actions: ActionChains object
:return: ActionChains Object | [
"def handle_at_sign_for_ie(text, actions):\n \n text_list = text.split(\"@\")\n for entry in text_list:\n if entry is not text_list[0]:\n actions.key_down(Keys.CONTROL).\\\n key_down(Keys.ALT).\\\n send_keys(\"2\").\\\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 description about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code about programming:"
} |
Get the meta data store within an element either in the label or
id atributes
@param element The element to be processed
@return The meta data stored | [
"static String getMetaData(Element element) {\r\n\t\tString label = element.getAttributeNS(INKSCAPE, \"label\");\r\n\t\tif ((label != null) && (!label.equals(\"\"))) {\r\n\t\t\treturn label;\r\n\t\t}\r\n\t\t\r\n\t\treturn element.getAttribute(\"id\");\r\n\t}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Add a value to a property on this bean.
@param propertyName name of the property as defined by the bean's schema.
@param value final String representations of the property that conforms to
its type as defined by the bean's schema. | [
"public void addProperty(final String propertyName, final String value) {\n Preconditions.checkNotNull(propertyName);\n Preconditions.checkNotNull(value);\n List<String> values = properties.get(propertyName);\n if (values == null) {\n values = new ArrayList<>();\n v... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Set the hooks for the current stage | [
"private function set_stage_hooks( $hooks ) {\n\t\t$this->current_stage_hooks = $hooks;\n\t\t$pseudo_hook = \"{$hooks[0]}:before\";\n\t\t$this->loggers[ $pseudo_hook ] = new Logger( array( 'hook' => $pseudo_hook ) );\n\t\t$this->loggers[ $pseudo_hook ]->start();\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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
/*
@seecom.ibm.wsspi.channelfw.ChannelFramework#removeGroupEventListener(
ChainEventListener, String) | [
"@Override\n public synchronized void removeGroupEventListener(ChainEventListener cel, String groupName) throws ChainGroupException {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {\n Tr.entry(tc, \"removeGroupEventListener\");\n }\n if (TraceComponent.isAnyTr... | [
"public List<String> getScheduledNotificationMessage(ScheduledNotification notification) {\n return broker.callRPCList(\"RGCWXQ SCHMSG\", null, notification.getIen());\n }"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
デフォルトの次処理確定イベントです。 | [
"public function defaultNextEvent () {\n\t\tif ($this->isError()) {\n\t\t\t$this->setUrl($this->getErrorNextUrl());\n\t\t\t$this->nextRule\t\t= $this->getErrorNextRule();\n\t\t} else {\n\t\t\t$this->setUrl($this->getDefaultNextUrl());\n\t\t\t$this->nextRule\t\t= $this->getDefaultNextRule();\n\t\t}\n\t}"
] | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Recomputes the current term. | [
"private synchronized void recomputeTerm(PartitionGroupMembership membership) {\n if (membership == null) {\n return;\n }\n\n // Create a list of candidates based on the availability of members in the group.\n List<GroupMember> candidates = new ArrayList<>();\n for (MemberId memberId : membershi... | [
"@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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
获取键
@param $path
@return bool|array | [
"public function getKeys($path)\n {\n if (empty($path)) {\n return array_keys($this->map->getContainer());\n }\n $value = $this->map[$path];\n if (is_array($value)) {\n return array_keys($value);\n } else {\n return false;\n }\n\n }"
] | [
"static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Returns a list of matching points on the first image.
@return The list of matching points on the first image. | [
"public List<Point> getPoints1() {\n verifyPropertyPresence(POINTS1);\n //noinspection unchecked\n return ((List<Map<String, Object>>) getCommandResult().get(POINTS1)).stream()\n .map(ComparisonResult::mapToPoint)\n .collect(Collectors.toList());\n }"
] | [
"def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s... | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
check that data for given key was changed
@param string $key
@return bool | [
"public function keyDataChanged($key)\n {\n $data = $this->toArray($key);\n $originalData = $this->returnOriginalData($key);\n\n return $data !== $originalData;\n }"
] | [
"def db_check( block_id, opcode, op, txid, vtxindex, checked, db_state=None ):\n \n print \"\\nreference implementation of db_check\\n\"\n return False"
] | codesearchnet | {
"query": "Represent the post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Blockchain:"
} |
@param ContentInfo $contentInfo
@return LocationsDataset | [
"public function load(ContentInfo $contentInfo): self\n {\n $this->data = array_map(\n [$this->valueFactory, 'createLocation'],\n $this->locationService->loadLocations($contentInfo)\n );\n $this->data = $this->prioritizeMainLocation($this->data);\n\n return $this... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Model
@param string $route | [
"public function model($route) {\n\t\t// Sanitize the call\n\t\t$route = preg_replace('/[^a-zA-Z0-9_\\/]/', '', (string)$route);\n\n\t\tif (!$this->registry->has('model_' . str_replace('/', '_', $route))) {\n\t\t\t$file = DIR_APPLICATION . 'model/' . $route . '.php';\n\t\t\t$class = 'Model' . preg_replace('/[^a-zA-... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Copies the values from one option array to another.
@param array $names the items names to copy.
@param array $from the items to copy from.
@param array $to the items to copy to.
@return array with copied items. | [
"public static function copy($names, $from, &$to)\n {\n if (is_array($from) && is_array($to)) {\n foreach ($names as $key) {\n if (isset($from[$key]) && !isset($to[$key])) {\n $to[$key] = static::getValue($from, $key);\n }\n }\n ... | [
"public function getPrerequisites(string $pattern = ViewInterface::pattern): array {\n\t\t\n\t\t// by default, the $pattern for this method matches the one\n\t\t// for the applyTemplate() method above, and both match the\n\t\t// public constant from the ViewInterface. you can change the\n\t\t// pattern, but they'd... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// SetClientRequestToken sets the ClientRequestToken field's value. | [
"func (s *CreateStackInput) SetClientRequestToken(v string) *CreateStackInput {\n\ts.ClientRequestToken = &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 Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
// SetScriptId sets the ScriptId field's value. | [
"func (s *Script) SetScriptId(v string) *Script {\n\ts.ScriptId = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// SetIPAddresses sets up all the IP addresses for the processing unit | [
"func (r *PURuntime) SetIPAddresses(ipa ExtendedMap) {\n\tr.Lock()\n\tdefer r.Unlock()\n\n\tr.ips = ipa.Copy()\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 comment about consul address:",
"pos": "Represent the code about consul address:",
"neg": "Represent the code about programming:"
} |
Ensure that calibration parameters have allowed values | [
"def _validate_calibration_params(strategy='accuracy', min_rate=None,\n beta=1.):\n \"\"\"\"\"\"\n if strategy not in ('accuracy', 'f_beta', 'max_tpr',\n 'max_tnr'):\n raise ValueError('Strategy can either be \"accuracy\", \"f_beta\" or '\n ... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Apply filter like rate limiting
:param adapter_number: adapter number
:param port_number: port number
:param filters: Array of filter dictionnary | [
"def _ubridge_apply_filters(self, adapter_number, port_number, filters):\n \n bridge_name = \"IOL-BRIDGE-{}\".format(self.application_id + 512)\n location = '{bridge_name} {bay} {unit}'.format(\n bridge_name=bridge_name,\n bay=adapter_number,\n unit=port_number)... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the Github summarization about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code:"
} |
Get the post body - either JSON encoded or ready to be sent as a form post
@author: 713uk13m <dev@nguyenanhung.com>
@time : 10/7/18 02:19
@return array|false|string Data to be sent Request | [
"public function getPostBody()\n {\n $output = '';\n if ($this->isJson) {\n $jsonPretty = ($this->isJsonPretty ? JSON_PRETTY_PRINT : NULL);\n if (count($this->data) > 0) {\n $output = json_encode($this->data, $jsonPretty);\n }\n } elseif ($this... | [
"def index(request):\n session = Session(request.body)\n print 'request.body begin'\n print request.body\n print 'request.body end'\n t = Tropo()\n smsContent = session.initialText\n #t.call(to=session.parameters['callToNumber'], network='SIP')\n #t.say(session.parameters['message'])\n \n... | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Set the x, y and z components to match the supplied vector.
@param v
contains the values of x, y and z to set
@return this | [
"public Vector3i set(Vector3ic v) {\n x = v.x();\n y = v.y();\n z = v.z();\n return this;\n }"
] | [
"def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i... | codesearchnet | {
"query": "Represent the Github instruction about mathematics:",
"pos": "Represent the Github code about mathematics:",
"neg": "Represent the Github code:"
} |
// validatePolicySyntax verifies policy syntax is accepted by casbin | [
"func validatePolicySyntax(p *v1alpha1.AppProject) error {\n\terr := rbac.ValidatePolicy(p.ProjectPoliciesString())\n\tif err != nil {\n\t\treturn status.Errorf(codes.InvalidArgument, \"policy syntax error: %s\", err.Error())\n\t}\n\treturn nil\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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
eslint-disable-next-line no-inner-declarations | [
"function resolvePage () {\n try {\n if (body.waitForJS === true && !pageJSisDone) {\n setTimeout(function () {\n resolvePage()\n }, 100)\n\n return\n }\n\n var resultData = page.evaluate(function (rawFnSource, customArgs) {\n var fnSource = r... | [
"function es5Plugins(){\n return [\n require('babel-plugin-check-es2015-constants'),\n require('babel-plugin-transform-es2015-arrow-functions'),\n require('babel-plugin-transform-es2015-block-scoped-functions'),\n require('babel-plugin-transform-es2015-block-scoping'),\n require('babel-p... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Parse HTML snippet, download all found <img> tags into /OEBPS/assets/, return the HTML with changed <img> paths.
@param \DOMDocument $doc
@return \DOMDocument | [
"protected function scrapeAndKneadImages( \\DOMDocument $doc ) {\n\n\t\t$fullpath = $this->tmpDir . '/OEBPS/assets';\n\n\t\t$images = $doc->getElementsByTagName( 'img' );\n\t\tforeach ( $images as $image ) {\n\t\t\t/** @var \\DOMElement $image */\n\t\t\t// Fetch image, change src\n\t\t\t$url = $image->getAttribute(... | [
"public static function insertTemplatePF ($parser, $template, $spot=''){\n //process additional arguments into a usable array\n $params = array();\n //sanitize the template name\n $template = preg_replace('/[^A-Za-z0-9_\\-]/', '_', $template);\n //this will be stripped out, assuming the skin is based... | codesearchnet | {
"query": "Represent the Github description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
// SubChannel returns a new channel for reading published messages and a last published message.
// If published messages equals (==) finalMsg then channel is closed afer putting message into channel. | [
"func (p *Publisher) SubChannel(finalMsg interface{}) (msgChan <-chan interface{}, lastMsg interface{}) {\n\tlistener, cur := p.SubReader()\n\toutch := make(chan interface{})\n\tgo listen(listener, outch, finalMsg)\n\treturn outch, cur\n}"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the Github summarization about Messaging:",
"pos": "Represent the Github code about Messaging:",
"neg": "Represent the Github code about File management:"
} |
Converts a value to this type | [
"public Object convertToDefaultType(SessionInterface session, Object a) {\n\n if (a == null) {\n return a;\n }\n\n Type otherType;\n\n if (a instanceof Number) {\n if (a instanceof BigInteger) {\n a = new BigDecimal((BigInteger) a);\n } els... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
------------------------------- functions relating to handler class | [
"function calculateMD5(details, type) {\n\n /* get the text for one part of the type definition to compute the\n md5sum over */\n function getMD5text(part) {\n var message = '';\n var constants = part.constants.map(function(field) {\n return field.type + ' ' + field.name + '=' + field.raw;\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 sentence about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code:"
} |
------------------------------------------------------------------------------- | [
"public String decrypt64( final String encryptedText, final String password )\n throws PlexusCipherException\n {\n try\n {\n byte[] allEncryptedBytes = Base64.decodeBase64( encryptedText.getBytes() );\n \n int totalLen = allEncryptedBytes.length;\n \n ... | [
"public static function run($speech = null)\n\t{\n\t\tif ( ! isset($speech))\n\t\t{\n\t\t\t$speech = 'KILL ALL HUMANS!';\n\t\t}\n\n\t\t$eye = \\Cli::color(\"*\", 'red');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"{$speech}\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::col... | codesearchnet | {
"query": "Represent the comment about language and writing:",
"pos": "Represent the code about language and writing:",
"neg": "Represent the code about programming:"
} |
Retrieve data for the given ID.
@param $tokenId (int) auth_token_id to look up.
@return (array) PASS: contains data about the given ID
@return (exception) FAIL: exception contains error details. | [
"public function get_token_data($tokenId) {\n\t\ttry {\n\t\t\t$sql = \"SELECT *, (max_uses - total_uses) as remaining_uses, \"\n\t\t\t\t\t. \"(NOW() - expiration) as time_remaining \"\n\t\t\t\t\t. \"FROM \". $this->table .\" AS t1 INNER JOIN \n\t\t\t\t\t\tcswal_token_type_table AS t2 ON (t1.token_type_id=t2.token_t... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
The action to save the configuration.
@Action
@Logged
@Post | [
"public function saveConfig($selfedit = \"false\") {\r\n\t\t$this->selfedit = $selfedit;\r\n\t\t\r\n\t\tif ($selfedit == \"true\") {\r\n\t\t\t$this->moufManager = MoufManager::getMoufManager();\r\n\t\t} else {\r\n\t\t\t$this->moufManager = MoufManager::getMoufManagerHiddenInstance();\r\n\t\t}\r\n\t\t\r\n\t\t$this->... | [
"public void forward(String controllerName) throws Throwable {\n SilentGo instance = SilentGo.me();\n ((ActionChain) instance.getConfig().getActionChain().getObject()).doAction(instance.getConfig().getCtx().get().getActionParam());\n }"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Load assertion from the provided json or throw exception if not possible.
@param encodedAssertion the assertion as it was encoded in JSON. | [
"public AccessAssertion unmarshal(final JSONObject encodedAssertion) {\n final String className;\n try {\n className = encodedAssertion.getString(JSON_CLASS_NAME);\n final Class<?> assertionClass =\n Thread.currentThread().getContextClassLoader().loadClass(clas... | [
"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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Registers a callback with jQuery.
@param context
@param component
@param rw
@param jQueryExpressionOfTargetElement
@param additionalEventHandlers
@throws IOException | [
"public void generateBootsFacesAJAXAndJavaScriptForJQuery(FacesContext context, UIComponent component,\n\t\t\tResponseWriter rw, String jQueryExpressionOfTargetElement, Map<String, String> additionalEventHandlers)\n\t\t\tthrows IOException {\n\t\tgenerateBootsFacesAJAXAndJavaScriptForJQuery(context, component, rw, ... | [
"public static ChainableStatement hover(JsScope over, JsScope out)\n\t{\n\t\treturn new DefaultChainableStatement(\"hover\", over.render(), out.render());\n\t}"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
[VARIABLE "my_blob_name"] | [
"public Blob createBlobFromByteArray(String bucketName, String blobName) {\n // [START createBlobFromByteArray]\n BlobId blobId = BlobId.of(bucketName, blobName);\n BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType(\"text/plain\").build();\n Blob blob = storage.create(blobInfo, \"Hello, Wor... | [
"def _init_prtfmt(self, key=\"fmta\"):\n \"\"\"\"\"\"\n prtfmt = self.gosubdag.prt_attr[key]\n return prtfmt.replace(\"{NS}\", \"{NS} {hdr1usr01:2} {num_usrgos:>4} uGOs\")"
] | codesearchnet | {
"query": "Represent the description about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
ImageMagick based image properties read. | [
"private function identify()\n {\n $rcube = rcube::get_instance();\n\n // use ImageMagick in command line\n if ($cmd = $rcube->config->get('im_identify_path')) {\n $args = array('in' => $this->image_file, 'format' => \"%m %[fx:w] %[fx:h]\");\n $id = rcube::exec($cmd. ... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Support partial/short md5s, return the full md5 with this method | [
"def get_full_md5(self, partial_md5, collection):\n \"\"\"\"\"\"\n print 'Notice: Performing slow md5 search...'\n starts_with = '%s.*' % partial_md5\n sample_info = self.database[collection].find_one({'md5': {'$regex' : starts_with}},{'md5':1})\n return sample_info['md5'] if samp... | [
"def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Returns URI for {@code _changes} endpoint using passed
{@code query}. | [
"public URI changesUri(String queryKey, Object queryValue) {\n\n if(queryKey.equals(\"since\")){\n if(!(queryValue instanceof String)){\n //json encode the seq number since it isn't a string\n Gson gson = new Gson();\n queryValue = gson.toJson(queryValu... | [
"@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 post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
returns a string node that can safely be rendered inside /brackets/. | [
"private static Node makeForwardSlashBracketSafe(Node n) {\n String s = n.getString();\n // sb contains everything in s[0:pos]\n StringBuilder sb = null;\n int pos = 0;\n boolean isEscaped = false;\n boolean inCharset = false;\n for (int i = 0; i < s.length(); ++i) {\n char ch = s.charAt(i... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
Responds with HTTP status code and a message.
@param {Object} res - response object
@param {number} code - http response code
@param {string} message - message | [
"function respondWithCode(res, code, message) {\n /* eslint-disable */\n res._headers = {};\n res._headerNames = {};\n res.statusCode = code;\n /* eslint-enable */\n res.setHeader('Content-Type', 'text/plain; charset=UTF-8');\n res.setHead... | [
"function ServiceName(keys){\n if (!keys) return\n this.name = 'service_name'\n this.keys = keys\n\n this.initialize = function() {\n // Require npm package and pass any api keys or login credentials here\n //this.client = require('npm package here');\n }\n\n this.send = function(data, callback) {\n ... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Load the configuration files and allow them to be published.
@return void | [
"protected function loadConfiguration()\n {\n $configPath = __DIR__ . '/../config/onesky.php';\n\n $this->publishes([\n $configPath => config_path('onesky.php'),\n ], 'config');\n\n $this->mergeConfigFrom($configPath, 'onesky');\n }"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the sentence about Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code about programming:"
} |
Read the store dict from file | [
"def load(self):\n \"\"\"\"\"\"\n\n with open(self.store_file_path, 'r') as fh:\n self.store = json.loads(fh.read())"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
將 HTML 轉化為 Jsoup Document 物件
HTML的內容就使用Jsoup原生的 HTML Parser
@param html Html document
@return org.jsoup.nodes.Document | [
"public org.jsoup.nodes.Document htmlToJsoupDoc(String html){\n\n // 將 html(html/html5) 轉為 jsoup Document 物件\n Document jsoupDoc = Jsoup.parse(html, \"UTF-8\", Parser.htmlParser() );\n jsoupDoc.charset(StandardCharsets.UTF_8);\n\n return jsoupDoc;\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Rename all nodes with a certain name and a certain attribute name-value pair
@param oldName
@param newName
@param attributeName
@param attributeValue | [
"public void renameNodesWithAttributeValue(String oldName, String newName, String attributeName, String attributeValue) {\r\n\t\tList<Node> nodes = getNodesFromTreeByName(oldName);\r\n\t\tIterator i = nodes.iterator();\r\n\t\twhile (i.hasNext()) {\r\n\t\t\tNode n = (Node) i.next();\r\n\t\t\tn.setName(newName);\r\n\... | [
"def getExecuteStrings(self, parScope, parName):\n \n # The data structure of _allExecutes was chosen for how easily/quickly\n # this particular access can be made here.\n fullName = parScope+'.'+parName\n return self._allExecutes.get(fullName)"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Engineering:"
} |
// SetKeyRange sets the KeyRange optional argument. Key range. | [
"func (a *RequestDataArgs) SetKeyRange(keyRange KeyRange) *RequestDataArgs {\n\ta.KeyRange = &keyRange\n\treturn a\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:"
} |
Get the connection.
@return PDO Returns the connection.
@throws Exception Throws an exception if the connection failed. | [
"public function getConnection() {\n if (null === $this->connection) {\n $this->connection = $this->connect();\n }\n return $this->connection;\n }"
] | [
"public static function insert(array $data)\n {\n $self = static::getInstance();\n\n $data = static::filterColumns($data);\n\n if (!\\count($data)) {\n throw new DbException(\n \"Invalid field names of table `{$self->name}`. Please check use of `insert()` method\"\n... | codesearchnet | {
"query": "Represent the summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Programming:"
} |
Update user signup instance.
@param Request $request
@return Signup | [
"public function signupUpdate(Request $request)\n {\n $this->middleware('auth:api');\n $data = $request->all();\n $validator = Validator::make($data, [\n 'firstname' => 'sometimes|required|max:255',\n 'surname' => 'sometimes|required|max:255',\n '... | [
"public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Dict of lists --> Dict | [
"def listdict2envdict(listdict):\r\n \"\"\"\"\"\"\r\n for key in listdict:\r\n if isinstance(listdict[key], list):\r\n listdict[key] = os.path.pathsep.join(listdict[key])\r\n return listdict"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization about Data processing:",
"pos": "Represent the code about Data processing:",
"neg": "Represent the code:"
} |
Only update the session info url and name.
@param url New session info url
@param name New session name | [
"public void updateInfoUrlAndName(String url, String name) {\n this.info.url = url;\n this.info.name = name;\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Create a dispatcher that has all the configured middleware applied.
@return \Cake\Routing\Dispatcher | [
"public static function create()\n {\n $dispatcher = new Dispatcher();\n foreach (static::$_stack as $middleware) {\n $dispatcher->addFilter($middleware);\n }\n\n return $dispatcher;\n }"
] | [
"public function bootstrap()\n {\n\n // register the default autoloader\n require SERVER_AUTOLOADER;\n\n // synchronize the application instance and register the class loaders\n $application = $this->application;\n $application->registerClassLoaders();\n\n // register th... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Mangle self into an argument array | [
"def assemble(self):\n \"\"\"\"\"\"\n\n self.canonify()\n args = [sys.argv and sys.argv[0] or \"python\"]\n if self.mountpoint:\n args.append(self.mountpoint)\n for m, v in self.modifiers.items():\n if v:\n args.append(self.fuse_modifiers[m])\n... | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
Create empty edit log files.
Initialize the output stream for logging.
@throws IOException | [
"synchronized void open() throws IOException {\n if (syncer == null) {\n syncer = new SyncThread();\n syncThread = new Thread(syncer);\n syncThread.start();\n }\n if (state != State.BETWEEN_LOG_SEGMENTS)\n throw new IOException(\"Bad state: \" + state);\n\n startLogSegment(getLastWri... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Stop is used to stop the consul-template runner | [
"func (tm *TaskTemplateManager) Stop() {\n\ttm.shutdownLock.Lock()\n\tdefer tm.shutdownLock.Unlock()\n\n\tif tm.shutdown {\n\t\treturn\n\t}\n\n\tclose(tm.shutdownCh)\n\ttm.shutdown = true\n\n\t// Stop the consul-template runner\n\tif tm.runner != nil {\n\t\ttm.runner.Stop()\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 description about Container management:",
"pos": "Represent the code about Container management:",
"neg": "Represent the code about programming:"
} |
sets status code to 204 No Content
@return \stubbles\webapp\response\Status | [
"public function noContent(): self\n {\n $this->allowsPayload = false;\n $this->headers->add('Content-Length', 0);\n return $this->fixateCode(204);\n }"
] | [
"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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Called by initializePlugins, also used to load startup plugins.
@since 2.3 | [
"public static void loadPluginPath(final String plugin_path) {\n if (plugin_path != null && !plugin_path.isEmpty()) {\n try {\n PluginLoader.loadJARs(plugin_path);\n } catch (Exception e) {\n LOG.error(\"Error loading plugins from plugin path: \" + plugin_path, e);\n throw new Runt... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
<p>Performs the following operation:<br>
<br>
a = a - b <br>
a<sub>ij</sub> = a<sub>ij</sub> - b<sub>ij</sub> <br>
</p>
@param a A Matrix. Modified.
@param b A Matrix. Not modified. | [
"public static void subtractEquals( DMatrix2x2 a , DMatrix2x2 b ) {\n a.a11 -= b.a11;\n a.a12 -= b.a12;\n a.a21 -= b.a21;\n a.a22 -= b.a22;\n }"
] | [
"function copy_row(nnz,\n offset,\n A,\n /*int* index, // const int*\n double* value, // const double*\n */\n\n x) // x = sparseVector\n{\n for(var i=nnz-1; i>=0; --i) if(A.value[i + offset]){\n x.push_front(... | codesearchnet | {
"query": "Represent the Github instruction about Mathematics:",
"pos": "Represent the Github code about Mathematics:",
"neg": "Represent the Github code about programming:"
} |
Returns deflated, base64 encoded, unsigned AuthnRequest.
@param bool|null $deflate Whether or not we should 'gzdeflate' the request body before we return it.
@return string | [
"public function getRequest($deflate = null)\n {\n $subject = $this->_authnRequest;\n\n if (is_null($deflate)) {\n $deflate = $this->_settings->shouldCompressRequests();\n }\n\n if ($deflate) {\n $subject = gzdeflate($this->_authnRequest);\n }\n\n $... | [
"def decrypt payload, armor=false # a RubyMail::Message object\n return unknown_status(@not_working_reason) unless @not_working_reason.nil?\n\n gpg_opts = {:protocol => GPGME::PROTOCOL_OpenPGP}\n gpg_opts = HookManager.run(\"gpg-options\",\n {:operation => \"decrypt\", :option... | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about PHP programming:"
} |
Match provided description against genres, ignoring case.
@param description genre description
@return matching genre index or -1 | [
"public static int matchGenreDescription(String description) {\n\t\tif (description != null && description.length() > 0) {\n\t\t\tfor (int i = 0; i < ID3v1Genres.GENRES.length; i++) {\n\t\t\t\tif (ID3v1Genres.GENRES[i].equalsIgnoreCase(description)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\... | [
"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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Sets up the dock widgets. Must be called after the menu is setup. | [
"def __setupDockWidgets(self):\n \n #self.dockWidget(self.currentInspectorPane, \"Current Inspector\", Qt.LeftDockWidgetArea)\n\n self.inspectorSelectionPane = InspectorSelectionPane(self.execInspectorDialogAction,\n self.inspectorActi... | [
"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 Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetMinFloat Allows easy setting of the Min value for an rpc.FloatRule.
// Usage:
// AddNewFloatRule(ns, key, req, config.SetMinFloat(min)) | [
"func SetMinFloat(min float64) floatRuleOpt {\n\treturn func(i *rpc.FloatRule) {\n\t\ti.Minimum = min\n\t\ti.HasMin = true\n\t}\n}"
] | [
"func (lftri LFTri) Rate(rate int8) Input {\n\tCheckRate(rate)\n\t(&lftri).defaults()\n\treturn NewInput(\"LFTri\", rate, 0, 1, lftri.Freq, lftri.Iphase)\n}"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Computer Science:"
} |
Update FFDC service with new configuration values (based on injection via config
admin). The parameter map should be modified to match actual values used
(e.g. substitution in case of error).
@param newConfig | [
"public static synchronized void update(Map<String, Object> newConfig) {\n if (newConfig == null)\n throw new NullPointerException(\"Updated config must not be null\");\n\n // Update the logging configuration\n LogProviderConfig config = loggingConfig.get();\n if (config != nu... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Returns the handlers. | [
"@Override\n public Handler []getHandlers()\n {\n Handler []handlers = _localHandlers.get();\n \n if (handlers != null)\n return handlers;\n else\n return EMPTY_HANDLERS;\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 description about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code about programming:"
} |
Register social provider manager. | [
"private function registerSocialProviderManager()\n {\n $this->app->singleton(\\Acacha\\LaravelSocial\\Contracts\\Factory::class, function ($app) {\n return new SocialProviderManager($app);\n });\n }"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Returns the part associated with the passed mime type, at the passed
index, if it exists.
@param string $mimeType
@param int $index
@return MessagePart|null | [
"public function getPartByMimeType($mimeType, $index = 0)\n {\n $partFilter = $this->partFilterFactory->newFilterFromContentType($mimeType);\n return $this->getPart($index, $partFilter);\n }"
] | [
"function typecastPropertyValue ($name, $v)\n {\n if ($this->isScalar ($name) && $this->isEnum ($name))\n $this->validateEnum ($name, $v);\n\n $type = $this->getTypeOf ($name);\n if ($type && !type::validate ($type, $v))\n throw new ComponentException ($this->component,\n sprintf (\n ... | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
$where->not(['last_name' => $excludedLastName]); | [
"public function not(array $params)\n {\n foreach ($params as $columnName => $value) {\n $this->addCondition('notEqualTo', [$columnName, $value]);\n }\n return $this;\n }"
] | [
"protected function isNl()\n {\n return $this->countries->isNl($this->invoice[Tag::Customer][Tag::CountryCode]);\n }"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Load composer config from addon path
@param null $key
@return array|string | [
"protected function composer($key = null)\n {\n if (! $this->composerJson) {\n $composerFile = $this->realPath().'/composer.json';\n if (! file_exists($composerFile)) {\n return null;\n }\n $this->composerJson = json_decode(file_get_contents($comp... | [
"private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.