query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Ensure the input the user gave is of a valid format | [
"def valid_input(val):\n \n # looks for 3 nums followed by a dot 3 times and then ending with\n # 3 nums, can be proceeded by any number of spaces\n ip_value = re.compile(r'(\\d{1,3}\\.){3}\\d{1,3}$')\n # looks for only numbers and commas (because priorities can have commas\n ... | [
"protected function validSecret()\n {\n // this method is intentionally broken in two pieces\n // so the logic will be loud and clear.\n\n // is the secret empty?\n if (empty($this->secret)) {\n return false;\n }\n\n // created a hex representation of the secr... | codesearchnet | {
"query": "Represent the post about Natural Language Processing:",
"pos": "Represent the code about Natural Language Processing:",
"neg": "Represent the code about programming:"
} |
Get a random point from the {@link Cluster} with the largest distance variance.
@param clusters the {@link Cluster}s to search
@return a random point from the selected cluster
@throws ConvergenceException if clusters are all empty | [
"function getPointFromLargestVarianceCluster(clusters) {\n var maxVariance = -Number.MAX_VALUE;\n var selected = null;\n for (var clusterIndex = 0; clusterIndex < clusters.length; clusterIndex++) {\n var cluster = clusters[clusterIndex];\n\n if (cluster.getPoints().length > 0) {\n\n // com... | [
"private Collection<IndexedInstance> getInstancesForVertex(Map<String, AttributeValueMap> map, AtlasVertex foundVertex) {\n\n //loop through the unique attributes. For each attribute, check to see if the vertex property that\n //corresponds to that attribute has a value from one or more of the instan... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Merges in the authorization information in this authority for the
given user.
@param [Aker::User] user the target user
@return [Aker::User] the input user, modified | [
"def amplify!(user)\n base = self.find_user(user.username)\n return user unless base\n\n user.extend UserExt\n user.ldap_attributes = base.ldap_attributes\n\n user.merge!(base)\n end"
] | [
"def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about AWS Auto Scaling:"
} |
A call of this method should validate the positions of the panels
components. | [
"@Override\n\tpublic void relocate()\n\t{\n\n\t\tint w = 550, h = 210;\n\n\t\tint x = (this.getWidth() - w) / 2;\n\t\tint y = (this.getHeight() - h) / 2;\n\n\t\t// 10, 10 <-> 580, 185\n\t\texecutablePathLabel.setLocation(x, y);\n\n\t\tsevenZipEnableBox.setLocation(x, y + 35);\n\t\tsevenZipLabel.setLocation(x + 30, ... | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
filter positive float
@param $value
@param array $options
@return float | [
"public static function ufloat(&$value, $options = ['max'=>null, 'min'=>null, 'default'=>null])\n {\n $value = (float)$value;\n self::processUNum($value, $options);\n return $value;\n }"
] | [
"final static function f($m, array $stages = []) {return dfcf(function(M $m, array $stages) {\n\t\t/** @var string $c */$c = df_con_hier($m, __CLASS__); return new $c($m, $stages ?: ['', '']);\n\t}, [dfpm($m), $stages]);}"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Parse the command line arguments | [
"def parse_args():\n \n parser = argparse.ArgumentParser(description = \"Generate secrets for YubiKeys using YubiHSM\",\n add_help=True,\n formatter_class = argparse.ArgumentDefaultsHelpFormatter,\n )\n... | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Executes an HTTP request to create message on the queue.
Creates queue if not existed.
Arguments:
messages -- An array of messages to be added to the queue. | [
"def post(self, *messages):\n \n url = \"queues/%s/messages\" % self.name\n\n msgs = [{'body': msg} if isinstance(msg, basestring) else msg\n for msg in messages]\n data = json.dumps({'messages': msgs})\n\n result = self.client.post(url=url, body=data,\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 software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code about Software development:"
} |
// SetWebProfile sets a web experience profile in Paypal with given id
//
// Endpoint: PUT /v1/payment-experience/web-profiles | [
"func (c *Client) SetWebProfile(wp WebProfile) error {\n\n\tif wp.ID == \"\" {\n\t\treturn fmt.Errorf(\"paypalsdk: no ID specified for WebProfile\")\n\t}\n\n\turl := fmt.Sprintf(\"%s%s%s\", c.APIBase, \"/v1/payment-experience/web-profiles/\", wp.ID)\n\n\treq, err := c.NewRequest(\"PUT\", url, wp)\n\n\tif err != nil... | [
"public JSONObject actions(String reference, HashMap<String, String> params) throws JSONException {\n return oClient.post(\"/offers/v1/contractors/offers/\" + reference, params);\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about text processing:"
} |
class Match
Match result. Single element of array, returned by [[LinkifyIt#match]] | [
"function Match(self, shift) {\n var start = self.__index__,\n end = self.__last_index__,\n text = self.__text_cache__.slice(start, end);\n\n /**\n * Match#schema -> String\n *\n * Prefix (protocol) for matched string.\n **/\n this.schema = self.__schema__.toLowerCase();\n /**\n * Matc... | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
If the file can't be found -- it will be retrieved from the server. | [
"def get_file(self, latitude, longitude):\n \n file_name = self.get_file_name(latitude, longitude)\n\n if not file_name:\n return None\n\n if (file_name in self.files):\n return self.files[file_name]\n else:\n data = self.retrieve_or_load_file_data... | [
"private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n // Get default form\n in.defaultReadObject();\n\n // Create new Archive\n final String name = this.name;\n final ZipImporter archive = ShrinkWrap.create(ZipImporter.class, name);\n\... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
restore the last block hierarchy variable map from archive to working.
@return true if restored successfully else false | [
"public boolean restoreLastMapFromArchive() {\n\t\tboolean success = false;\n\t\tList<Map<Object, Object>> object = null;\n\t\tif (oldBlockHierarchy.size() > 0) {\n\t\t\tobject = oldBlockHierarchy.remove(oldBlockHierarchy.size() - 1);\n\t\t\tif (object != null) {\n\t\t\t\tworking = object;\n\t\t\t\tsuccess = true;\... | [
"def set_form form\n raise \"Form is nil in set_form\" if form.nil?\n @form = form\n @id = form.add_widget(self) if !form.nil? and form.respond_to? :add_widget\n # 2009-10-29 15:04 use form.window, unless buffer created\n # should not use form.window so explicitly everywhere.\n # added... | codesearchnet | {
"query": "Represent the description about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
// GenerateGoogleTOTP produces a new TOTP token with the defaults expected by
// Google Authenticator. | [
"func GenerateGoogleTOTP() *TOTP {\n\tkey := make([]byte, sha1.Size)\n\tif _, err := io.ReadFull(PRNG, key); err != nil {\n\t\treturn nil\n\t}\n\treturn NewTOTP(key, 0, 30, 6, crypto.SHA1)\n}"
] | [
"func valid(authorization []string) bool {\n\tif len(authorization) < 1 {\n\t\treturn false\n\t}\n\ttoken := strings.TrimPrefix(authorization[0], \"Bearer \")\n\t// Perform the token validation here. For the sake of this example, the code\n\t// here forgoes any of the usual OAuth2 token validation and instead check... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// doCommand executes a client command which is processed through the raft pipeline. | [
"func (n *Node) doCommand(conn redcon.Conn, cmd redcon.Command) (interface{}, error) {\n\tif len(cmd.Args) == 0 {\n\t\treturn nil, nil\n\t}\n\tvar val interface{}\n\tvar err error\n\tswitch strings.ToLower(string(cmd.Args[0])) {\n\tdefault:\n\t\tval, err = n.handler.Command((*nodeApplier)(n), conn, cmd)\n\t\tif err... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Updates the response content
@param Response $response
@param array $data
@return JsonResponse|Response | [
"protected function setResponseData(Response $response, array $data)\n {\n if ($response instanceof JsonResponse) {\n /** @var $response JsonResponse */\n return $response->setData($data);\n }\n\n $content = json_encode($data, JsonResponse::DEFAULT_ENCODING_OPTIONS);\n\... | [
"public static function bindToObject(TelegramResponse $data, LoggerInterface $logger): TelegramTypes\n {\n return new File($data->getResult(), $logger);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Software development:"
} |
Return a list of compiled regex patterns used to search for the title
of the section after the reference section in a full-text document.
@return: (list) of compiled regex patterns. | [
"def get_post_reference_section_title_patterns():\n \n compiled_patterns = []\n thead = ur'^\\s*([\\{\\(\\<\\[]?\\s*(\\w|\\d)\\s*[\\)\\}\\>\\.\\-\\]]?\\s*)?'\n ttail = ur'(\\s*\\:\\s*)?'\n numatn = ur'(\\d+|\\w\\b|i{1,3}v?|vi{0,3})[\\.\\,]{0,2}\\b'\n roman_numbers = ur'[LVIX]'\n patterns = [\n ... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Main function of the module. Outputs all content directly instead of collecting it and doing the output later.
@return void | [
"public function main()\n {\n LibraryLoader::includeAll();\n\n $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);\n $this->doc->backPath = $GLOBALS['BACK_PATH'];\n\n if ($GLOBALS['BE_USER']->user['admin']) {\n $this->doc->bodyTagAdditions = 'id=\"doc3\"';\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 Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// SetAttachToIndex sets the AttachToIndex field's value. | [
"func (s *BatchWriteOperation) SetAttachToIndex(v *BatchAttachToIndex) *BatchWriteOperation {\n\ts.AttachToIndex = v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns if an object is oriental or
occidental to the sun. | [
"def orientality(obj, sun):\n \n dist = angle.distance(sun.lon, obj.lon)\n return OCCIDENTAL if dist < 180 else ORIENTAL"
] | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Enable the NodePublicationFilter when not in the backoffice.. | [
"public function onKernelRequest()\n {\n $token = $this->tokenStorage->getToken();\n if (!$token) {\n return;\n }\n\n if (!$token instanceof UsernamePasswordToken) {\n return;\n }\n\n if ($token->getProviderKey() != 'backoffice') {\n retu... | [
"@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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Get event data from an emitter. Lazily create it if it isn't there. | [
"function eventData(emitter) {\n\treturn emitter[eventEmitter.EVENT_DATA_PROPERTY] || Object.defineProperty(emitter, eventEmitter.EVENT_DATA_PROPERTY, {\n\t\tvalue: {},\n\t\tenumerable: false\n\t})[eventEmitter.EVENT_DATA_PROPERTY];\n}"
] | [
"function DependentArraysObserver(callbacks, cp, instanceMeta, context, propertyName, sugarMeta) {\n // user specified callbacks for `addedItem` and `removedItem`\n this.callbacks = callbacks;\n\n // the computed property: remember these are shared across instances\n this.cp = cp;\n\n // th... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
The response for index action, which can be a pagination of a
record collection or a grouped count of attributes | [
"def index_json\n if params[:group].present?\n @records.group(params[:group][:by].split(','))\n .send(:calculate,\n params[:group][:calculate],\n params[:group][:field])\n else\n collection_response\n end\n end"
] | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Outputs its parameters to users stdout. | [
"def out(*args):\n \n for value in args:\n sys.stdout.write(value)\n\n sys.stdout.write(os.linesep)"
] | [
"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 Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
// create alter sql string. | [
"func getColumnAddQuery(al *alias, fi *fieldInfo) string {\n\tQ := al.DbBaser.TableQuote()\n\ttyp := getColumnTyp(al, fi)\n\n\tif fi.null == false {\n\t\ttyp += \" \" + \"NOT NULL\"\n\t}\n\n\treturn fmt.Sprintf(\"ALTER TABLE %s%s%s ADD COLUMN %s%s%s %s %s\",\n\t\tQ, fi.mi.table, Q,\n\t\tQ, fi.column, Q,\n\t\ttyp, g... | [
"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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// List return all resource type scopes | [
"func (m *GormResourceTypeScopeRepository) List(ctx context.Context, resourceType *ResourceType) ([]ResourceTypeScope, error) {\n\tdefer goa.MeasureSince([]string{\"goa\", \"db\", \"resource_type_scope\", \"list\"}, time.Now())\n\tvar rows []ResourceTypeScope\n\n\tvar err error\n\tif resourceType != nil {\n\t\terr ... | [
"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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetAdaptiveQuantization sets the AdaptiveQuantization field's value. | [
"func (s *H265Settings) SetAdaptiveQuantization(v string) *H265Settings {\n\ts.AdaptiveQuantization = &v\n\treturn s\n}"
] | [
"public ParseSetup guessSetup(ByteVec v, byte[] bits, byte sep, int ncols, boolean singleQuotes, int checkHeader, String[] columnNames, byte[] columnTypes, String[][] domains, String[][] naStrings) {\n throw new UnsupportedOperationException(\"Not implemented. This method is kept only for backwards compatibility... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Caches the cp definition grouped entries in the entity cache if it is enabled.
@param cpDefinitionGroupedEntries the cp definition grouped entries | [
"@Override\n\tpublic void cacheResult(\n\t\tList<CPDefinitionGroupedEntry> cpDefinitionGroupedEntries) {\n\t\tfor (CPDefinitionGroupedEntry cpDefinitionGroupedEntry : cpDefinitionGroupedEntries) {\n\t\t\tif (entityCache.getResult(\n\t\t\t\t\t\tCPDefinitionGroupedEntryModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tCPD... | [
"@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 Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code:"
} |
// Block returns a block with the following number,
// or nil if such a block doesn't exist. | [
"func (cs *ChainSupport) Block(number uint64) *cb.Block {\n\tif cs.Height() <= number {\n\t\treturn nil\n\t}\n\treturn blockledger.GetBlock(cs.Reader(), number)\n}"
] | [
"public static long createFileId(long containerId) {\n long id = BlockId.createBlockId(containerId, BlockId.getMaxSequenceNumber());\n if (id == INVALID_FILE_ID) {\n // Right now, there's not much we can do if the file id we're returning is -1, since the file\n // id is completely determined by the ... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Visits this node, then the test-expression, the true-expression,
and the false-expression. | [
"@Override\n public void visit(NodeVisitor v) {\n if (v.visit(this)) {\n testExpression.visit(v);\n trueExpression.visit(v);\n falseExpression.visit(v);\n }\n }"
] | [
"def generic_visit(self, node):\n \"\"\"\"\"\"\n # [[[cog\n # cog.out(\"print(pcolor('Enter generic visitor', 'magenta'))\")\n # ]]]\n # [[[end]]]\n # A generic visitor that potentially closes callables is needed to\n # close enclosed callables that are not at the en... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Changes the "changed" state of the button.<p>
@param changed the new value for the "changed" state | [
"public void setChanged(boolean changed) {\r\n\r\n m_changedStyleVar.setValue(\r\n changed\r\n ? I_CmsToolbarButtonLayoutBundle.INSTANCE.toolbarButtonCss().elementInfoChanged()\r\n : I_CmsToolbarButtonLayoutBundle.INSTANCE.toolbarButtonCss().elementInfoUnchanged());\r\n }"... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
生成查询SQL
@access public
@param array $options 表达式
@return string | [
"public function buildSelectSql($options=array()) {\n if(isset($options['page'])) {\n // 根据页数计算limit\n list($page,$listRows) = $options['page'];\n $page = $page>0 ? $page : 1;\n $listRows= $listRows>0 ? $listRows : (is_numeric($options['limit'])?$options['... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Apply account limits
// Lock is held on entry.
// FIXME(dlc) - Should server be able to override here? | [
"func (c *client) applyAccountLimits() {\n\tif c.acc == nil || (c.kind != CLIENT && c.kind != LEAF) {\n\t\treturn\n\t}\n\n\t// Set here, will need to fo checks for NoLimit.\n\tif c.acc.msubs != jwt.NoLimit {\n\t\tc.msubs = c.acc.msubs\n\t}\n\tif c.acc.mpay != jwt.NoLimit {\n\t\tc.mpay = c.acc.mpay\n\t}\n\n\topts :=... | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Return validator for `maxFileSize` keyword
@param {string} pluginDir
@return {function(number, string): boolean} | [
"function validateMaxFileSize(pluginDir) {\n return (maxBytes, filePath) => {\n try {\n const stat = fs.statSync(path.join(pluginDir, filePath));\n return stat.size <= maxBytes;\n } catch (e) {\n return false;\n }\n };\n}"
] | [
"function function_ (options) {\n options.hash.kind = 'function'\n var result = ddata._identifier(options)\n return result ? options.fn(result) : 'ERROR, Cannot find function.'\n}"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Set the mapper current tab.
@param string $name
@param string|callable $mapper
@access public
@return void | [
"public function tab($name, $mapper)\n\t{\n\t\t$this->tab = $name;\n\n\t\tif ($mapper instanceof Closure) {\n\t\t\t$mapper($this);\n\t\t}\n\t}"
] | [
"function openTable()\n {\n $this->examples = [];\n $this->markdown = ''; // Clear table\n $this->declareAbstraction = true;\n $this->add('| Visibility | Function |');\n $this->add('|:-----------|:---------|');\n }"
] | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Add an image style at once | [
"protected function submitAddImageStyle()\n {\n $this->setSubmitted(null, $this->getParam());\n $this->setSubmittedList('actions');\n $this->validateComponent('image_style');\n $this->addImageStyle();\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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Extract info from mapper summary to be displayed below the graph plot | [
"def get_kmgraph_meta(mapper_summary):\r\n \r\n d = mapper_summary[\"custom_meta\"]\r\n meta = (\r\n \"<b>N_cubes:</b> \"\r\n + str(d[\"n_cubes\"])\r\n + \" <b>Perc_overlap:</b> \"\r\n + str(d[\"perc_overlap\"])\r\n )\r\n meta += (\r\n \"<br><b>Nodes:</b> \"\r\n ... | [
"public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Map the indices of the array to the respective elements.
Parameters
-----------
arr : list(a)
The array to process, of generic type a
Returns
-----------
dict(int -> a), a dictionary corresponding the index to the element | [
"def index_element_map(arr):\n \n index_to_element = {}\n for index, element in enumerate(arr):\n index_to_element[index] = element\n return index_to_element"
] | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Compute the distance of a point to a line (not the segment) defined by `p1` and `p2`. | [
"def pointToLineDistance(p, p1, p2):\n \"\"\"\"\"\"\n d = np.sqrt(vtk.vtkLine.DistanceToLine(p, p1, p2))\n return d"
] | [
"def radiansBetween(self, other):\n '''\n \n\n '''\n # a dot b = |a||b| * cos(theta)\n # a dot b / |a||b| = cos(theta)\n # cos-1(a dot b / |a||b|) = theta\n\n # translate each line so that it passes through the origin and\n # produce a new point whose distance... | codesearchnet | {
"query": "Represent the Github instruction about mathematics:",
"pos": "Represent the Github code about mathematics:",
"neg": "Represent the Github code about mathematics:"
} |
Show image (item is a PIL image) | [
"def show_image(self, name):\r\n \"\"\"\"\"\"\r\n command = \"%s.show()\" % name\r\n sw = self.shellwidget\r\n if sw._reading:\r\n sw.kernel_client.input(command)\r\n else:\r\n sw.execute(command)"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Parse a regular expression. Some context-awareness is necessary, since a '/' inside a '[]' set does not end the expression. | [
"function tryCreateRegexp(src, flags, throwErrorAt, parser) {\n try {\n return new RegExp(src, flags);\n } catch (e) {\n if (throwErrorAt !== undefined) {\n if (e instanceof SyntaxError) parser.raise(throwErrorAt, \"Error parsing regular expression: \" + e.message);\n throw e;\n }\n }\n}"
] | [
"private function param($key, $string, $value) {\n\n $field_required = false;\n\n // If the field name ends with a '*', the parameter is considered as required\n if (preg_match('/^(.+)\\*$/', $key, $bits)) {\n\n $key = $bits[1];\n $field_required = true;\n\n }\n\n ... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Get the supported services of the reference sample | [
"def get_supported_services_uids(self, referencesample):\n \n uids = referencesample.getSupportedServices(only_uids=True)\n return list(set(uids))"
] | [
"@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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// DeserializeIdentity returns an Identity given the byte-level
// representation of a SerializedIdentity struct | [
"func (msp *bccspmsp) DeserializeIdentity(serializedID []byte) (Identity, error) {\n\tmspLogger.Debug(\"Obtaining identity\")\n\n\t// We first deserialize to a SerializedIdentity to get the MSP ID\n\tsId := &m.SerializedIdentity{}\n\terr := proto.Unmarshal(serializedID, sId)\n\tif err != nil {\n\t\treturn nil, erro... | [
"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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Convert Unix timestamp to Julian Day.
Shim implementation of unixtojd()
@link https://php.net/unixtojd
@param int $timestamp
@return false|int | [
"public static function unixToJd($timestamp)\n {\n if ($timestamp < 0) {\n return false;\n } else {\n // Convert timestamp based on local timezone\n return self::GregorianToJd(gmdate('n', $timestamp), gmdate('j', $timestamp), gmdate('Y', $timestamp));\n }\n ... | [
"public function getTimestamp($returnType = 'string')\n {\n if (in_array($returnType, ['array', 'float', 'string'])) {\n return $this->getTimestampRaw($returnType);\n }\n return sprintf($this->lclMsgCmn('i18n_Error_UnknownReturnType'), $returnType);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about PHP programming:"
} |
Get the doctype from the document.
Returns:
str, None | [
"def parse_doctype(cls, file, encoding=None):\n '''\n '''\n if encoding:\n lxml_encoding = to_lxml_encoding(encoding) or 'latin1'\n else:\n lxml_encoding = encoding\n\n try:\n parser = lxml.etree.XMLParser(encoding=lxml_encoding, recover=True)\n ... | [
"def _type_description(self):\n \"\"\"\"\"\"\n #This is a little tricker because the docstring is housed\n #inside of the module that contains the actual executable.\n #These TypeExecutables are just pointers.\n iexec = self._element.target\n if iexec is not None:\n ... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Re balance tree. After inserting or deleting a node, | [
"def re_balance(self):\n \n self.update_heights(recursive=False)\n self.update_balances(False)\n\n while self.balance < -1 or self.balance > 1:\n if self.balance > 1:\n if self.node.left.balance < 0:\n self.node.left.rotate_left()\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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception\r\n\t{\r\n\t\tns_config_diff_responses result = (ns_config_diff_responses) service.get_payload_formatter().string_to_resource(ns_config_diff_responses.class, response);\r\n\t\tif(result.errorcode != 0)\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get a list of all Accounts authorized for the provided token.
Args:
Returns:
v20.response.Response containing the results from submitting the
request | [
"def list(\n self,\n **kwargs\n ):\n \n\n request = Request(\n 'GET',\n '/v3/accounts'\n )\n\n response = self.ctx.request(request)\n\n\n if response.content_type is None:\n return response\n\n if not response.content_type.s... | [
"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 post about Twilio:",
"pos": "Represent the Github code about Twilio:",
"neg": "Represent the Github code about programming:"
} |
/*@param char {number} | [
"function type(char) {\n switch (char) {\n case c.letter.d: // d\n return c.type.DICT\n case c.letter.l: // l\n return c.type.LIST\n case c.letter.i: // i\n return c.type.INT\n case c.letter.e: // e\n return c.type.END\n case c.digit.NUM0:\n case c.digit.NUM1:\n case c.digi... | [
"final static function sn(M $m) {return dfcf(function(M $m) {return df_new(\n\t\tdf_con_heir($m, __CLASS__), $m\n\t);}, [$m]);}"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// ProxyConfig returns the proxy settings for the current model. | [
"func (api *APIBase) ProxyConfig(args params.Entities) params.ProxyConfigResults {\n\tvar result params.ProxyConfigResult\n\terrors, ok := api.authEntities(args)\n\n\tif ok {\n\t\tresult = api.proxyConfig()\n\t}\n\n\tresults := params.ProxyConfigResults{\n\t\tResults: make([]params.ProxyConfigResult, len(args.Entit... | [
"@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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Sets pager
@return array | [
"protected function setPagerListAlias()\n {\n $conditions = $this->query_filter;\n $conditions['count'] = true;\n\n $pager = array(\n 'query' => $this->query_filter,\n 'total' => (int) $this->alias->getList($conditions)\n );\n\n return $this->data_limit = ... | [
"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:"
} |
// OpenSession opens a session between an application and a token. | [
"func (c *Ctx) OpenSession(slotID uint, flags uint) (SessionHandle, error) {\n\tvar s C.CK_SESSION_HANDLE\n\te := C.OpenSession(c.ctx, C.CK_ULONG(slotID), C.CK_ULONG(flags), C.CK_SESSION_HANDLE_PTR(&s))\n\treturn SessionHandle(s), toError(e)\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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
@param Driver $driver
@param array $columns
@return StreamedResponse | [
"public function exportToExcel(Driver $driver, array $columns)\n {\n $csvData = $this->findAllRecords($driver, $columns);\n $response = new StreamedResponse(function () use ($csvData) {\n $resources = fopen('php://output', 'w');\n\n foreach ($csvData as $item) {\n ... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Modify param array for method call
@param array $params
@return string
@throws CompileErrorException | [
"private function decorateParamsForMethodCall(array $params) : string\n {\n $params_out = [];\n foreach($params as $param) {\n $params_out[] = $this->decorateValue($param);\n }\n return implode(',',$params_out);\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
try to select an ontology NP: the actual load from FS is in <_load_ontology> | [
"def _select_ontology(self, line):\n \n try:\n var = int(line) # it's a string\n if var in range(1, len(self.all_ontologies)+1):\n self._load_ontology(self.all_ontologies[var-1])\n except ValueError:\n out = []\n for each in self.all_o... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
@param string $title
@return $this | [
"public function setRightTitle($title)\n {\n foreach ($this->getChildren() as $field) {\n /** @var FormField $field */\n $field->setRightTitle($title);\n }\n\n return $this;\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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Find changes to the model and save them as AuditField records.
Do not call this method directly, it will be called after the model is deleted.
@param CModelEvent $event | [
"public function afterDelete($event)\n {\n if (!$this->enableAuditField) {\n parent::afterDelete($event);\n return;\n }\n\n $date = time();\n $auditModels = $this->getAuditModels();\n $auditRequestId = $this->getAuditRequestId();\n $userId = Yii::ap... | [
"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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Determine if the current AccountControl object contains the given UAC flag(s).
@param int $flag
@return bool | [
"public function has($flag)\n {\n // We'll extract the given flag into an array of possible flags, and\n // see if our AccountControl object contains any of them.\n $flagsUsed = array_intersect($this->extractFlags($flag), $this->values);\n\n return in_array($flag, $flagsUsed);\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 Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Specifies the starting_text table if none has been specified earlier.
@param string $text | [
"private function setStartFromText($text) {\r\n if ($this->starting_text === null) {\r\n // If we have a forced table at the start, we get that one...\r\n if (is_array($text)) {\r\n if (is_array($text[0])) {\r\n // Code like array(array(ENCODING, ''))\r... | [
"def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Provide vendors info
:param limit:
:param offset:
:return: | [
"def get_vendors_info(self, limit=10, offset=10):\n \n params = {}\n if offset:\n params['offset'] = offset\n if limit:\n params['limit'] = limit\n url = 'rest/1.0/vendors'\n return (self.get(url, params=params) or {}).get('vendors')"
] | [
"def get_user(self, user_id):\n \n if user_id in self._users:\n return self._users.get(user_id)\n else:\n # Load user\n # Save user in cache\n return"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Get the estimated saving of this code in bytes when RAIDing is done
@return The saving in bytes | [
"public long getDoneSaving(Configuration conf) {\n try {\n DFSClient dfs = ((DistributedFileSystem)FileSystem.get(conf)).getClient();\n Counters raidedCounters = stateToSourceCounters.get(RaidState.RAIDED);\n Counters shouldRaidCounters =\n stateToSourceCounters.get(RaidState.NOT_RAIDED_B... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Error can be either of the following types:
//
// - InvalidObjectFault
// - RuntimeFault | [
"func (service *VboxPortType) IParallelPortgetEnabled(request *IParallelPortgetEnabled) (*IParallelPortgetEnabledResponse, error) {\n\tresponse := new(IParallelPortgetEnabledResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn response, nil\n}"
] | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Performs a vertical 1D normalized convolution across the image.
@param src The original image. Not modified.
@param dst Where the resulting image is written to. Modified.
@param kernel The kernel that is being convolved. Not modified. | [
"public static void vertical(Kernel1D_S32 kernel, InterleavedU16 src, InterleavedI16 dst ) {\n\t\tInputSanityCheck.checkSameShapeB(src, dst);\n\n\t\tboolean processed = BOverrideConvolveImageNormalized.invokeNativeVertical(kernel,src,dst);\n\t\t\n\t\tif( !processed ) {\n\t\t\tif( kernel.width >= src.height ) {\n\t\... | [
"def _create_features(self, constraints):\n \"\"\"\"\"\"\n affine_warp_constraints = constraints\n if not isinstance(affine_warp_constraints, AffineWarpConstraints):\n affine_warp_constraints = AffineWarpConstraints(affine_warp_constraints)\n mask = affine_warp_constraints.mask\n psi = _create_a... | codesearchnet | {
"query": "Represent the Github post about Image processing:",
"pos": "Represent the Github code about Image processing:",
"neg": "Represent the Github code:"
} |
// Convert_v1_ResourceRule_To_authorization_ResourceRule is an autogenerated conversion function. | [
"func Convert_v1_ResourceRule_To_authorization_ResourceRule(in *v1.ResourceRule, out *authorization.ResourceRule, s conversion.Scope) error {\n\treturn autoConvert_v1_ResourceRule_To_authorization_ResourceRule(in, out, s)\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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Adapt the bias according to the current code point and position
@param int $delta
@param int $nPoints
@param int $isFirst
@return int | [
"protected function adapt($delta, $nPoints, $isFirst): int\n {\n $delta = intval($isFirst ? ($delta / self::damp) : ($delta / 2));\n $delta += intval($delta / $nPoints);\n for ($k = 0; $delta > ((self::base - self::tMin) * self::tMax) / 2; $k += self::base) {\n $delta = intval($de... | [
"@SuppressWarnings(\"unused\")\n private void opSetOptionPush() {\n // option = code[ip++]; // final for now\n pushAlt(ip, s, sprev, pkeep);\n ip += OPSize.SET_OPTION + OPSize.FAIL;\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetDelete sets the Delete field's value. | [
"func (s *GlobalSecondaryIndexUpdate) SetDelete(v *DeleteGlobalSecondaryIndexAction) *GlobalSecondaryIndexUpdate {\n\ts.Delete = v\n\treturn s\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Checks if Resource has all fields passed
@param string[] $fields List of fields to test
@return true On success
@return string On failure, with error message | [
"public function hasFields(array $fields)\n {\n try {\n $this->model_class::checkUnknownColumn($fields);\n } catch (UnknownColumnException $e) {\n return \"Resource '$this->name' \"\n . explode(' ', $e->getMessage(), 2)[1];\n }\n return true;\n ... | [
"public function determineValidationRules(ModelRelationData $relation, ModelFormFieldData $field)\n {\n $rules = [];\n\n if ($field->required() && ! $field->translated()) {\n $rules[] = 'required';\n } else {\n // Anything that is not required should by default be expli... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software Development:"
} |
// ConvertDocx converts an MS Word docx file to text. | [
"func ConvertDocx(r io.Reader) (string, map[string]string, error) {\n\tmeta := make(map[string]string)\n\tvar textHeader, textBody, textFooter string\n\n\tb, err := ioutil.ReadAll(r)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\tzr, err := zip.NewReader(bytes.NewReader(b), int64(len(b)))\n\tif err != nil {\... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Build and construct the given services.
@param services a map of required services and their minimum version
@return list of services actually created | [
"private Map<ScopeService, Service> createServices(final Set<ScopeService> services) {\n Map<ScopeService, Service> actualServices = Maps.newTreeMap();\n\n for (ScopeService requiredService : services) {\n if (availableServices.containsKey(requiredService)) {\n for (ScopeService availableService :... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// function that lists all the xattrs for an object, since xattrs are
// a k-v pair, this function returns a map of k-v pairs on
// success, error code on failure | [
"func (ioctx *IOContext) ListXattrs(oid string) (map[string][]byte, error) {\n\tc_oid := C.CString(oid)\n\tdefer C.free(unsafe.Pointer(c_oid))\n\n\tvar it C.rados_xattrs_iter_t\n\n\tret := C.rados_getxattrs(ioctx.ioctx, c_oid, &it)\n\tif ret < 0 {\n\t\treturn nil, GetRadosError(ret)\n\t}\n\tdefer func() { C.rados_g... | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
:returns: ``True`` if the node is a child of another node given as an
argument, else, returns ``False``
:param node:
The node that will be checked as a parent | [
"def is_child_of(self, node):\n \n return node.get_children().filter(pk=self.pk).exists()"
] | [
"def persistent_id(self, obj):\n \"\"\"\"\"\"\n if isinstance(obj, Element):\n # Here, our persistent ID is simply a tuple, containing a tag and\n # a key\n return obj.__class__.__name__, obj.symbol\n else:\n # If obj does not have a persistent ID, re... | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Serializes this StickerSet to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"def to_array(self):\n \n array = super(StickerSet, self).to_array()\n array['name'] = u(self.name) # py2: type unicode, py3: type str\n\n array['title'] = u(self.title) # py2: type unicode, py3: type str\n\n array['contains_masks'] = bool(self.contains_masks) # type bool\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 Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Update what we know about the cluter based on MetadataResponse
@param [MetadataResponse] topic_metadata_response
@return nil | [
"def update(topic_metadata_response)\n update_brokers(topic_metadata_response.brokers)\n update_topics(topic_metadata_response.topics)\n\n @last_refreshed_at = Time.now\n nil\n end"
] | [
"def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Generate classes with loaders for the given Schema Salad description. | [
"def codegen(lang, # type: str\n i, # type: List[Dict[Text, Any]]\n schema_metadata, # type: Dict[Text, Any]\n loader # type: Loader\n ): # type: (...) -> None\n \"\"\"\"\"\"\n\n j = schema.extend_and_specialize(i, loader)\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 Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// EnforcePolicy drops any part of the event that doesn't conform to a policy level
// or omitStages and sets the event level accordingly | [
"func EnforcePolicy(event *audit.Event, level audit.Level, omitStages []audit.Stage) (*audit.Event, error) {\n\tfor _, stage := range omitStages {\n\t\tif event.Stage == stage {\n\t\t\treturn nil, nil\n\t\t}\n\t}\n\treturn enforceLevel(event, level)\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Watch is exported | [
"func (s *Discovery) Watch(stopCh <-chan struct{}) (<-chan discovery.Entries, <-chan error) {\n\tch := make(chan discovery.Entries)\n\terrCh := make(chan error)\n\tticker := time.NewTicker(s.heartbeat)\n\n\tgo func() {\n\t\tdefer close(errCh)\n\t\tdefer close(ch)\n\n\t\t// Send the initial entries if available.\n\t... | [
"function (err, collection) {\n if (err) {\n return callback(err);\n }\n\n // ensure that the collection option is present before starting a run\n if (!_.isObject(collection)) {\n return callback(new Error(COLLECTION_L... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
count datetime before `base` time
:param base: minuend -> str/datetime/date
:param diff: str
:return: datetime | [
"def before(base=_datetime, diff=None):\n \n _base = parse(base)\n if isinstance(_base, datetime.date):\n _base = midnight(_base)\n if not diff:\n return _base\n result_dict = dp(diff)\n # weeks already convert to days in diff_parse function(dp)\n for unit in result_dict:\n ... | [
"def normalize(self, timestamp, steps=0):\n '''\n \n '''\n # So far, the only commonality with RelativeTime\n return self.from_bucket( self.to_bucket(timestamp, steps) )"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Extracts the file information as flat array.
@param array $files File array to parse
@author Benjamin Carl <opensource@clickalicious.de>
@return array Resulting array | [
"protected function extract(array $files)\n {\n foreach ($files as $key => $file) {\n if ($file instanceof Doozr_Request_File) {\n\n // Simple security layer\n $filename = $this->cleanFilename($file->getClientFilename());\n\n // @todo Move to a basic... | [
"public function importFile( stdClass $params )\n\t{\n\t\t$this->_checkParams( $params, array( 'site', 'items' ) );\n\t\t$this->_setLocale( $params->site );\n\n\t\t$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );\n\n\t\tforeach( $items as $path )\n\t\t{\n\t\t\t/** controller/extj... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Executes a prepared statement
@param array $inputParams
@return bool | [
"public function execute($inputParams = [])\n {\n $bingID = $this->pdo->getBingId();\n $pool = $this->pdo->pool;\n if(!empty($inputParams)){\n $this->_boundColumns = $inputParams;\n }\n if(!empty($this->_boundColumns)){\n $this->prepareParamName();\n ... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Render a specified view
@param string $page
@param array|null $params
@return mixed
@throws $e | [
"public function render($page, array $params = null)\n {\n $this->setFile($page);\n\n try {\n if (! file_exists($file = $this->getFile())) {\n throw new NotFoundException(\"Template file couldn't be found: \" . $file);\n }\n\n if (! empty($params)) {\... | [
"protected function set_view()\n\t{\n\t\t$this->_view instanceOf View or $this->_view = \\View::forge($this->_view);\n\t}"
] | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
同步调用
@param request 请求对象
@param invokeContext 调用上下文
@param timeoutMillis 超时时间(毫秒)
@return 返回对象
@throws RemotingException 远程调用异常
@throws InterruptedException 中断异常
@since 5.2.0 | [
"protected SofaResponse doInvokeSync(SofaRequest request, InvokeContext invokeContext, int timeoutMillis)\n throws RemotingException, InterruptedException {\n return (SofaResponse) RPC_CLIENT.invokeSync(url, request, invokeContext, timeoutMillis);\n }"
] | [
"protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}"
] | codesearchnet | {
"query": "Represent the Github description about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Programming:"
} |
Builds rewrite domain from backend route url.
@param backendRoute Backend route.
@param subzone Subzone
@return Rewrite domain.
@throws MalformedURLException if backendRoute parameter has invalid format. | [
"public static String buildRewriteDomain(String backendRoute, String subzone) throws MalformedURLException {\n if (backendRoute == null || backendRoute.isEmpty()) {\n logger.error(\"Backend route can't be null.\");\n return null;\n }\n\n String applicationRoute = backendRo... | [
"@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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Create instances of a parser containing common arguments shared among
all the commands.
When overwritting `-q` or `-v`, you need to instantiate a new object
in order to prevent some weird behavior. | [
"def get_parent_parser():\n \n parent_parser = argparse.ArgumentParser(add_help=False)\n\n log_level_group = parent_parser.add_mutually_exclusive_group()\n log_level_group.add_argument(\n \"-q\", \"--quiet\", action=\"store_true\", default=False, help=\"Be quiet.\"\n )\n log_level_group.add... | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the sentence about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Returns raw string type format from the var annotation
@param \ReflectionProperty $property
@return string | [
"private function getRawType(\\ReflectionProperty $property)\n {\n $matches = [];\n if (preg_match('/@var\\s+([^\\s]+)/', $property->getDocComment(), $matches)) {\n list(, $rawType) = $matches;\n } else {\n $rawType = 'mixed';\n }\n return $rawType;\n }... | [
"func (m *NamedMethod) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m.Name != \"\" {\n\t\tinfo = append(info, yaml.MapItem{Key: \"name\", Value: m.Name})\n\t}\n\t// &{Name:value Type:Method StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value}\n\treturn info\n}"... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
// MapCacher Set a table use a special cacher | [
"func (engine *Engine) MapCacher(bean interface{}, cacher core.Cacher) error {\n\tengine.setCacher(engine.TableName(bean, true), cacher)\n\treturn nil\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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// NewTimer creates a new Timer object | [
"func NewTimer(interval time.Duration) *Timer {\n\ttm := &Timer{\n\t\tmsg: make(chan typeAction),\n\t}\n\ttm.interval.Set(interval)\n\treturn tm\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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
@param Parser\Common\MangaCardParser $parser
@param MangaCard $instance
@throws \InvalidArgumentException
@throws \RuntimeException | [
"protected static function setProperties(Parser\\Common\\MangaCardParser $parser, $instance): void\n {\n $instance->malId = $parser->getMalId();\n $instance->url = $parser->getMangaUrl();\n $instance->title = $parser->getTitle();\n $instance->imageUrl = $parser->getMangaImage();\n ... | [
"private function handleErrorUnit(Invoke\\Error $unit): Result\\AbstractResult\n {\n return new Result\\Error(null, $unit->getBaseException());\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:"
} |
@param DateTimeOfDay $object
@return bool | [
"public function earlierThan($object)\n {\n if (!$this->sameTypeAs($object)) {\n throw new NotMatchTypeException($this);\n }\n\n return $this->date()->earlierThan($object->date()) || ($this->date()->equalsTo($object->date()) && $this->time()->earlierThan($object->time()));\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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Create an appropriately named folder in which the database is to be stored
:param databasepath: path to use to save the database
:param database: the name of the database folder to create
:return: the absolute path of the folder | [
"def create_database_folder(databasepath, database):\n \n logging.info('Setting up {} database'.format(database))\n # Define the path to store the database files\n databasepath = os.path.join(databasepath, database)\n # Create the path as required\n make_path(databasepath)\... | [
"def create(location: str, simpleobjects_found = None, complexobject_attributes_found = None): # -> ObjectNotFoundOnFileSystemError:\n \n if len(complexobject_attributes_found) > 0 or len(simpleobjects_found) > 0:\n return ObjectNotFoundOnFileSystemError('Mandatory object : ' + location + ... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// putUnspentCredit puts a credit record for an unspent credit. It may only be
// used when the credit is already know to be unspent, or spent by an
// unconfirmed transaction. | [
"func putUnspentCredit(ns walletdb.ReadWriteBucket, cred *credit) error {\n\tk := keyCredit(&cred.outPoint.Hash, cred.outPoint.Index, &cred.block)\n\tv := valueUnspentCredit(cred)\n\treturn putRawCredit(ns, k, v)\n}"
] | [
"def begin_commit():\n \n\n session_token = request.headers['session_token']\n repository = request.headers['repository']\n\n #===\n current_user = have_authenticated_user(request.environ['REMOTE_ADDR'], repository, session_token)\n if current_user is False: return fail(user_auth_fail_msg)\n\n ... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Gets full class or function name. | [
"def get_full_name(src):\n \"\"\"\"\"\"\n\n if hasattr(src, \"_full_name_\"):\n return src._full_name_\n if hasattr(src, \"is_decorator\"):\n # Our own decorator or binder\n if hasattr(src, \"decorator\"):\n # Our own binder\n _full_name_ = str(src.decorator)\n ... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Register callbacks needed by the interface object | [
"def set_callbacks(self, **dic_functions):\n \"\"\"\"\"\"\n for action in self.interface.CALLBACKS:\n try:\n f = dic_functions[action]\n except KeyError:\n pass\n else:\n setattr(self.interface.callbacks, action, f)\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
DELETE /pages/1
DELETE /pages/1.xml | [
"def destroy\n @page = ::Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(cmtool.pages_path) }\n format.xml { head :ok }\n end\n end"
] | [
"def tempo_account_add_account(self, data=None):\n \n url = 'rest/tempo-accounts/1/account/'\n if data is None:\n return \"\"\"Please, provide data e.g.\n {name: \"12312312321\",\n key: \"1231231232\",\n lead: {name: \... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
@param string $data
@return string | [
"public static function getHeaders(string $data): string\n {\n $pos = strpos($data, \"\\r\\n\\r\\n\");\n\n return $pos === false ? '' : substr($data, 0, $pos);\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 post about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about programming:"
} |
Animate in the new series from the clicked point in the old series.
Depends on the drilldown.js module | [
"function (init) {\n\t\t\tvar toBox = this.chart.plotBox,\n\t\t\t\tlevel = this.chart.drilldownLevels[this.chart.drilldownLevels.length - 1],\n\t\t\t\tfromBox = level.bBox,\n\t\t\t\tanimationOptions = this.chart.options.drilldown.animation,\n\t\t\t\tscale;\n\t\t\t\t\n\t\t\tif (!init) {\n\n\t\t\t\tscale = Math.min(f... | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Responsible for handling events and each tick of the interval | [
"function (event){\n\t\t//IE compatibility\n\t\tevent = event || window.event;\n\t\t//Mozilla, Opera, & Legacy\n\t\tif(event && event.type && (/DOMContentLoaded|load/).test(event.type)) {\n\t\t\tfireDOMReady();\n\t\t//Legacy\t\n\t\t} else if(document.readyState) {\n\t\t\tif ((/loaded|complete/).test(doc.readyState)... | [
"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:"
} |
Number of rows in the result set
@return int | [
"public function num_rows()\n\t{\n\t\t// sqlsrv_num_rows() doesn't work with the FORWARD and DYNAMIC cursors (FALSE is the same as FORWARD)\n\t\tif ( ! in_array($this->scrollable, array(FALSE, SQLSRV_CURSOR_FORWARD, SQLSRV_CURSOR_DYNAMIC), TRUE))\n\t\t{\n\t\t\treturn parent::num_rows();\n\t\t}\n\n\t\treturn is_int(... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Returns true if the file path equals other file path, false otherwise.
@since 1.2.0
@param FilePathInterface $filePath The other file path.
@return bool True if the file path equals other file path, false otherwise. | [
"public function equals(FilePathInterface $filePath): bool\n {\n return $this->getDrive() === $filePath->getDrive() && $this->isAbsolute() === $filePath->isAbsolute() && $this->getDirectoryParts() === $filePath->getDirectoryParts() && $this->getFilename() === $filePath->getFilename();\n }"
] | [
"function Pointer ($ref, path, friendlyPath) {\n /**\n * The {@link $Ref} object that contains this {@link Pointer} object.\n * @type {$Ref}\n */\n this.$ref = $ref;\n\n /**\n * The file path or URL, containing the JSON pointer in the hash.\n * This path is relative to the path of the main JSON schema ... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Get edition info linked with Framework Core
@return \stdClass edition infos
@throws Server500 | [
"final public static function getEditionInfo():\\stdClass\n {\n $file = JL::open(FEnv::get(\"framework.config.core.config.file\"));\n JL::close(FEnv::get(\"framework.config.core.config.file\"));\n self::$edition = $file;\n return ($file);\n }"
] | [
"public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Expand controller actions into Mux object
@return Mux | [
"public function expand(array $options = array(), $dynamic = false)\n {\n $mux = new Mux();\n $target = $dynamic ? $this : $this->getClass();\n $mux->add('/:id', [$target, 'updateAction'], array_merge($options, array('method' => REQUEST_METHOD_POST )));\n $mux->add('/:id', [$targe... | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Reset the API object on server and replaces with current attributes
(We can do this brute-force thing because we have local state.) | [
"def update\n url = single_url\n payload = attributes_to_payload\n payload[:reset_data] = true\n to_server url, payload\n end"
] | [
"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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Registers a set of classes, merging with any others previously set.
@param string $prefix the classes prefix
@param array|string $paths the location(s) of the classes
@param bool $prepend prepend the location(s) | [
"public function add($prefix, $paths, $prepend = false) {\n\t\tif (!$prefix) {\n\t\t\tif ($prepend) {\n\t\t\t\t$this->fallbackDirs = array_merge(\n\t\t\t\t\t(array) $paths,\n\t\t\t\t\t$this->fallbackDirs\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->fallbackDirs = array_merge(\n\t\t\t\t\t$this->fallbackDirs,\n... | [
"public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key.... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"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.