query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Process the directory of JSON files using the collected pattern ids
@param string[] $coveredIds | [
"public function process(array $coveredIds) : void\n {\n $this->setCoveredPatternIds($coveredIds);\n\n $finder = new Finder();\n $finder->files();\n $finder->name('*.json');\n $finder->ignoreDotFiles(true);\n $finder->ignoreVCS(true);\n $finder->sortByName();\n ... | [
"def _get_result_paths(self, data):\n \n\n # Swarm OTU map (mandatory output)\n return {'OtuMap': ResultPath(Path=self.Parameters['-o'].Value,\n IsWritten=True)}"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Gets the rdns String name
:param rdns: RDNS object
:type rdns: cryptography.x509.RelativeDistinguishedName
:return: RDNS name | [
"def get_rdns_name(rdns):\n \n name = ''\n for rdn in rdns:\n for attr in rdn._attributes:\n if len(name) > 0:\n name = name + ','\n if attr.oid in OID_NAMES:\n name = name + OID_NAMES[attr.oid]\n else:\n name = name + att... | [
"def certificate_issuer(self, value):\n \n\n if value is not None:\n is_oscrypto = isinstance(value, asymmetric.Certificate)\n if not is_oscrypto and not isinstance(value, x509.Certificate):\n raise TypeError(_pretty_message(\n '''\n ... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// MountHealthController "mounts" a Health resource controller on the given service. | [
"func MountHealthController(service *goa.Service, ctrl HealthController) {\n\tinitService(service)\n\tvar h goa.Handler\n\tservice.Mux.Handle(\"OPTIONS\", \"/cellar/_ah/health\", ctrl.MuxHandler(\"preflight\", handleHealthOrigin(cors.HandlePreflight()), nil))\n\n\th = func(ctx context.Context, rw http.ResponseWrite... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SendAudioWithKeyboardHide send a audio with explicit Keyboard Hide. | [
"func (bot TgBot) SendAudioWithKeyboardHide(cid int, audio string, duration *int, performer *string, title *string, rmi *int, rm ReplyKeyboardHide) ResultWithMessage {\n\tvar rkm ReplyMarkupInt = rm\n\treturn bot.SendAudio(cid, audio, duration, performer, title, rmi, &rkm)\n}"
] | [
"def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
<p>
set data-* attribute
</p>
<pre>
Div div = new Div();
div.setData("foo", "bar");
// you get <div data-foo="bar"></div>
</pre>
@param key
data-"key" | [
"public void setData(String key, String value) {\n QName qn = new QName(\"data-\" + key);\n this.getOtherAttributes().put(qn, value);\n }"
] | [
"def html(self):\n \n return \"\"\"\n <div class=\"property\"><i>{name}</i><br/>\n <pre>{value}</pre></div>\n \"\"\".format(name=tag.text(self.name), value=tag.text(self.value))"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Unserialize an embedded collection
Return a collection of serialized objects (arrays)
@param MapperInterface $mapper
@param array $data
@return array | [
"protected function unserializeEmbeddedCollection(MapperInterface $mapper, array $data)\n {\n $collection = array();\n foreach ($data as $document) {\n $collection[] = $mapper->unserialize($document);\n }\n\n return $collection;\n }"
] | [
"public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
stops the timer with a given name.
:param name: the name of the timer
:type name: string | [
"def stop(cls, name):\n \n cls.timer_end[name] = time.time()\n if cls.debug:\n print(\"Timer\", name, \"stopped ...\")"
] | [
"def interface_required(interface):\n \n def _interface_required(func):\n \"\"\"Internal decorator that wraps around the decorated function.\n\n Args:\n func (function): function being decorated\n\n Returns:\n The wrapper function.\n ... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Gets an object using a from clause.
@param type The type of the desired object.
@param clause The WHERE clause.
@param args The arguments for the WHERE clause.
@param <T> The type of the object.
@return The object or {@code null} | [
"public static <T> T objectFromClause(Class<T> type, String clause, Object... args)\n {\n return SqlClosure.sqlExecute(c -> OrmElf.objectFromClause(c, type, clause, args));\n }"
] | [
"public static IGroupMember getGroupMember(String key, Class<?> type) throws GroupsException {\n /*\n * WARNING: The 'type' parameter is not the leafType; you're obligated\n * to say whether you want a group or a non-group (i.e. some type of\n * entity). In fact, the underlying imp... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
pickedPage można podać wcześniej przy konstruktorze
@param int $pickedPage
@return SqlPaginateParams | [
"public function getSqlPaginateParams($pickedPage = false) {\r\n $p = new SqlPaginateParams();\r\n if ($pickedPage) {\r\n $this->pickedPage = $pickedPage;\r\n }\r\n if ($this->pages == 0) {\r\n $p->setOffset(0);\r\n $p->setLimit(20);\r\n return... | [
"public function dispatch()\n {\n //wpięcie dla pluginów przed routingiem\n $this->routeStartup();\n $frontController = FrontController::getInstance();\n //ustawianie requestu po zdekodowaniu żądania przez router\n $frontController->getRequest()\n ->setParams($frontC... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Query for intersections of terms in two lists
Return a list of intersection result objects with keys:
- x : term from x
- y : term from y
- c : count of intersection
- j : jaccard score | [
"def query_intersections(self, x_terms=None, y_terms=None, symmetric=False):\n \n if x_terms is None:\n x_terms = []\n if y_terms is None:\n y_terms = []\n xset = set(x_terms)\n yset = set(y_terms)\n zset = xset.union(yset)\n\n # first built map... | [
"def set_prop(self, prop, value, ef=None):\n \n if ef:\n # prop should be restricted to n_decoys, an int, the no. of decoys corresponding to a given FPF.\n # value is restricted to the corresponding enrichment factor and should be a float\n self.ef[prop] = value\n ... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
readFile fs promise wrapped
@param {string} path
@param {string} fileName | [
"function readFile(path, fileName) {\n return new Promise((resolve, reject) => {\n fs.readFile(`${path}/${fileName}`, 'utf8', (err, content) => {\n if (err) {\n return reject(err)\n }\n\n return resolve(content)\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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitBuildSource. | [
"func (in *GitBuildSource) DeepCopy() *GitBuildSource {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(GitBuildSource)\n\tin.DeepCopyInto(out)\n\treturn out\n}"
] | [
"func (resource *Bundle) MarshalJSON() ([]byte, error) {\n\tresource.ResourceType = \"Bundle\"\n\t// Dereferencing the pointer to avoid infinite recursion.\n\t// Passing in plain old x (a pointer to Bundle), would cause this same\n\t// MarshallJSON function to be called again\n\treturn json.Marshal(*resource)\n}"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
:sockets:: socket list
:clean:: clean UTF8 strings or provide block to run on every read string
:pool:: ActionPool to use
Creates a new watcher for sockets
start the watcher | [
"def start\n if(@sockets.size < 0)\n raise 'No sockets available for listening'\n elsif(!@runner.nil? && @runner.alive?)\n raise AlreadyRunning.new\n else\n @stop = false\n @runner = Thread.new{watch}\n end\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 Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Registers action aliases for current task
@param array $map Alias-to-filename hash array | [
"public function register_action_map($map)\n {\n if (is_array($map)) {\n foreach ($map as $idx => $val) {\n $this->action_map[$idx] = $val;\n }\n }\n }"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the sentence about Data management:",
"pos": "Represent the code about Data management:",
"neg": "Represent the code:"
} |
Create permission request
The call is idempotent; that is, if one posts the same pos_id and
pos_tid twice, only one Permission request is created. | [
"def create_permission_request(self, customer, pos_id, pos_tid, scope,\n ledger=None, text=None, callback_uri=None,\n expires_in=None):\n \n arguments = {'customer': customer,\n 'pos_id': pos_id,\n ... | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// readv returns the tokens starting from the current position until the first
// match of t. A match is made only of t.typ and t.val are equal to the examined
// token. | [
"func (p *parser) readv(t token) ([]token, error) {\n\tvar tokens []token\n\tfor {\n\t\tread, err := p.readt(t.typ)\n\t\ttokens = append(tokens, read...)\n\t\tif err != nil {\n\t\t\treturn tokens, err\n\t\t}\n\t\tif len(read) > 0 && read[len(read)-1].val == t.val {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn tokens, nil\n}"... | [
"private static PortablePosition navigateToPathTokenWithoutQuantifier(\n PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {\n if (path.isLastToken()) {\n // if it's a token that's on the last position we calculate its direct access position and return it for\n ... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Retrieve the pattern for the given package.
@param \Composer\Package\PackageInterface $package
@return string | [
"public function getPattern(PackageInterface $package)\n {\n if (isset($this->packages[$package->getName()])) {\n return $this->packages[$package->getName()];\n } elseif (isset($this->packages[$package->getPrettyName()])) {\n return $this->packages[$package->getPrettyName()];\... | [
"function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Add all the components to this calendar panel.
@param dateTarget This date needs to be in the calendar. | [
"public void layoutCalendar(Date timeTarget)\n {\n calendar.setTime(timeTarget);\n \n int hour = calendar.get(Calendar.HOUR_OF_DAY);\n int minute = calendar.get(Calendar.MINUTE);\n \n String[] array = new String[24 * 2];\n calendar.set(Calendar.HOUR_OF_DAY... | [
"@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
/* [MS-OSHARED] 2.3.3.1.4 Lpstr | [
"function parse_lpstr(blob, type, pad) {\n\tvar start = blob.l;\n\tvar str = blob.read_shift(0, 'lpstr-cp');\n\tif(pad) while((blob.l - start) & 3) ++blob.l;\n\treturn str;\n}"
] | [
"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 sentence about MS-XLSB:",
"pos": "Represent the Github code about MS-XLSB:",
"neg": "Represent the Github code:"
} |
Validate this measurement and update its 'outcome' field. | [
"def validate(self):\n \"\"\"\"\"\"\n # PASS if all our validators return True, otherwise FAIL.\n try:\n if all(v(self.measured_value.value) for v in self.validators):\n self.outcome = Outcome.PASS\n else:\n self.outcome = Outcome.FAIL\n return self\n except Exception as e: ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
This method gets the singleton instance of this {@link CollectionReflectionUtilImpl}. <br>
<b>ATTENTION:</b><br>
Please prefer dependency-injection instead of using this method.
@return the singleton instance. | [
"public static CollectionReflectionUtilImpl getInstance() {\n\n if (instance == null) {\n synchronized (CollectionReflectionUtilImpl.class) {\n if (instance == null) {\n CollectionReflectionUtilImpl util = new CollectionReflectionUtilImpl();\n util.initialize();\n instance ... | [
"private <T> T create(Class<T> pluginType, String className) {\n if (className == null) {\n throw new IllegalStateException(\n \"No default implementation for requested Mockito plugin type: \" + pluginType.getName() + \"\\n\"\n + \"Is this a valid Mockito plugin t... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Add an 'OPTIONS' method supported on all routes for the pre-flight CORS request.
@param server a RestExpress server instance. | [
"private void addPreflightOptionsRequestSupport(RestExpress server, CorsOptionsController corsOptionsController)\n {\n\t RouteBuilder rb;\n\n\t for (String pattern : methodsByPattern.keySet())\n\t {\n\t \trb = server.uri(pattern, corsOptionsController)\n\t\t \t.action(\"options\", HttpMethod.OPTIO... | [
"public Javalin addHandler(@NotNull HandlerType httpMethod, @NotNull String path, @NotNull Handler handler) {\n return addHandler(httpMethod, path, handler, new HashSet<>()); // no roles set for this route (open to everyone with default access manager)\n }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
/*
String[] validTypes = new String[]
{ "application/xhtml+xml",
"application/x-dtbncx+xml", "text/css" }; | [
"void buildCSSTypesDictionary()\n {\n String description;\n String value;\n TextSearchDictionaryEntry de;\n\n\n //search eval() expression\n description = \"text/css\";\n value = \"text/css\";\n de = new TextSearchDictionaryEntry(description, value, MessageId.CSS_009);\n v.add(de);\n\n\n }... | [
"function () {\n $(\"#addtrack\").css(\"visibility\",\"hidden\");\n var element = document.getElementsByTagName('path')[0];\n element.setAttribute(\"stroke\" , \"black\"); \n element.setAttribute(\"fill\" , \"none\");\n element = document.getElementsByTagName('line');\n for( var i=0 ; ... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// TODO: This is hacky. Look into using a library like gojsonpointer[1] instead.
//
// [1] https://github.com/xeipuuv/gojsonpointer | [
"func (s *Schema) refToSchema(str string, rootSchema Schema, loadExternal bool) (*Schema, error) {\n\tparentURL, err := url.Parse(s.parentId)\n\tif err == nil && parentURL.IsAbs() {\n\t\tsURL, err := url.Parse(str)\n\t\tif err == nil && !sURL.IsAbs() && !strings.HasPrefix(str, \"#\") {\n\t\t\tstr = parentURL.Resolv... | [
"func IsNotFoundError(err error) bool {\n\tes := err.Error()\n\tif strings.Contains(es, \"does not exist\") {\n\t\t// set with the same name already exists\n\t\t// xref: https://github.com/Olipro/ipset/blob/master/lib/errcode.c#L32-L33\n\t\treturn true\n\t}\n\tif strings.Contains(es, \"element is missing\") {\n\t\t... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// Load loads data from Dump. If the input is not the same as the output from Dump() then it will return a error. | [
"func (s *AtomicSequence) Load(data []byte) error {\n\tif s.initialized {\n\t\treturn errors.New(\"cannot load into an initialized sequence\")\n\t}\n\n\tvals := make(map[string]uint64)\n\tif err := json.Unmarshal(data, &vals); err != nil {\n\t\treturn err\n\t}\n\n\tif val, ok := vals[\"current\"]; !ok {\n\t\treturn... | [
"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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Exports one instance of custom field data
@param data_controller $data
@param array $subcontext subcontext to pass to content_writer::export_data | [
"public static function export_customfield_data(data_controller $data, array $subcontext) {\n $context = $data->get_context();\n\n $exportdata = $data->to_record();\n $exportdata->fieldtype = $data->get_field()->get('type');\n $exportdata->fieldshortname = $data->get_field()->get('shortn... | [
"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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Unlock the account.
:param account: Account
:return: | [
"def unlock_account(account):\n \n return Web3Provider.get_web3().personal.unlockAccount(account.address, account.password)"
] | [
"def Call(self, Id=0):\n \n o = Call(self, Id)\n o.Status # Test if such a call exists.\n return o"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Set button as HTML link object <a href="">.
@param string $page
@param array $args
@return $this | [
"public function link($page, $args = array())\n {\n $this->setElement('a');\n $this->setAttr('href', $this->app->url($page, $args));\n\n return $this;\n }"
] | [
"static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}"
] | codesearchnet | {
"query": "Represent the sentence about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about programming:"
} |
// connect connects to the SSH server, unless a AuthMethod was set with
// SetAuth method, by default uses an auth method based on PublicKeysCallback,
// it connects to a SSH agent, using the address stored in the SSH_AUTH_SOCK
// environment var. | [
"func (c *command) connect() error {\n\tif c.connected {\n\t\treturn transport.ErrAlreadyConnected\n\t}\n\n\tif c.auth == nil {\n\t\tif err := c.setAuthFromEndpoint(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvar err error\n\tconfig, err := c.auth.ClientConfig()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\to... | [
"func tagUserCredentials(conf agent.Config) (string, string, error) {\n\tusername := conf.Tag().String()\n\tvar password string\n\t// TODO(perrito) we might need an accessor for the actual state password\n\t// just in case it ever changes from the same as api password.\n\tapiInfo, ok := conf.APIInfo()\n\tif ok {\n\... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Helper method to actually perform the subdoc get count operation. | [
"private Observable<DocumentFragment<Lookup>> getCountIn(final String id, final LookupSpec spec,\n final long timeout, final TimeUnit timeUnit) {\n return Observable.defer(new Func0<Observable<DocumentFragment<Lookup>>>() {\n @Override\n public Observable<DocumentFragment<Lookup>... | [
"@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:"
} |
The method prints the structure of all meta_signal-notifications as log-messages. | [
"def observe_meta_signal_changes(self, changed_model, prop_name, info):\n \"\n self.logger.info(NotificationOverview(info))"
] | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Clear element ID list in cache | [
"protected function clearIDList()\n {\n $arCacheTags = $this->getCacheTagList();\n $sCacheKey = $this->getCacheKey();\n\n CCache::clear($arCacheTags, $sCacheKey);\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:"
} |
Gets a Site Role by his Id.
@param mixed $nb_site_role A CNabuDataObject containing a field named nb_role_id or a valid Id.
@return CNabuSiteRole|bool Returns the Site Role instance if exists or false if not. | [
"public function getSiteRole($nb_site_role)\n {\n if (is_numeric($nb_role_id = nb_getMixedValue($nb_site_role, NABU_ROLE_FIELD_ID))) {\n $retval = $this->getSiteRoles()->getItem($nb_role_id);\n } else {\n $retval = false;\n }\n\n return $retval;\n }"
] | [
"private function guardValidModelAndIdentifier($model, $identifier)\n {\n if (empty($model) || (!is_object($model) && (null === $identifier || '' === $identifier))) {\n throw new ResolveComponentDataException('Model has to be an object or (a scalar + an identifier in 2nd argument)');\n }... | codesearchnet | {
"query": "Represent the summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Software development:"
} |
Move partition to under-loaded replication-group if possible. | [
"def move_partition_replica(self, under_loaded_rg, eligible_partition):\n \"\"\"\"\"\"\n # Evaluate possible source and destination-broker\n source_broker, dest_broker = self._get_eligible_broker_pair(\n under_loaded_rg,\n eligible_partition,\n )\n if source_... | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
Set the value of Hash / hash
@param $value string
@return User | [
"public function setHash(string $value) : User\n {\n\n if ($this->data['hash'] !== $value) {\n $this->data['hash'] = $value;\n $this->setModified('hash');\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Create the next block to propose and return it.
// We really only need to return the parts, but the block
// is returned for convenience so we can log the proposal block.
// Returns nil block upon error.
// NOTE: keep it side-effect free for clarity. | [
"func (cs *ConsensusState) createProposalBlock() (block *types.Block, blockParts *types.PartSet) {\n\tvar commit *types.Commit\n\tif cs.Height == 1 {\n\t\t// We're creating a proposal for the first block.\n\t\t// The commit is empty, but not nil.\n\t\tcommit = types.NewCommit(types.BlockID{}, nil)\n\t} else if cs.L... | [
"func (md *RootMetadataV3) SignWriterMetadataInternally(\n\tctx context.Context, codec kbfscodec.Codec,\n\tsigner kbfscrypto.Signer) error {\n\t// Nothing to do.\n\t//\n\t// TODO: Set a flag, and a way to check it so that we can\n\t// verify that this is called before sending to the server.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Write an item to the cache for a given number of minutes.
@param string $key
@param mixed $value
@param int $minutes | [
"public function put($key, $value, $minutes)\n {\n $this->forever($key, $value);\n $this->redis->expire($key, $minutes * 60);\n }"
] | [
"public function setDirectives($directives)\n {\n parent::setDirectives($directives);\n $lifetime = $this->getLifetime(false);\n if ($lifetime > 2592000) {\n // #ZF-3490 : For the memcached backend, there is a lifetime limit of 30 days (2592000 seconds)\n $this->_log('m... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Component factory. Delegates the creation of components to a createComponent<Name> method.
@param string $name | [
"protected function createComponent($name): ?IComponent\n {\n $method = 'createComponent'.ucfirst($name);\n if (method_exists($this, $method)) {\n $this->checkRequirements(self::getReflection()->getMethod($method));\n }\n\n return parent::createComponent($name);\n }"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
get schema info
@param Request $request request
@return Response | [
"public function schemaAction(Request $request)\n {\n $api = $this->decideApiAndEndpoint($request->getUri());\n $this->registerProxySources($api['apiName']);\n $this->apiLoader->addOptions($api);\n\n $schema = $this->apiLoader->getEndpointSchema(urldecode($api['endpoint']));\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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// Run all jobs with delay seconds | [
"func (s *Scheduler) RunAllwithDelay(d int) {\n\tfor i := 0; i < s.size; i++ {\n\t\ts.jobs[i].run()\n\t\ttime.Sleep(time.Duration(d))\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 Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Get the string representation of the full path name
@param parent the parent path
@return the full path in string | [
"final public String getFullName(final String parent) {\n if (isEmptyLocalName()) {\n return parent;\n }\n \n StringBuilder fullName = new StringBuilder(parent);\n if (!parent.endsWith(Path.SEPARATOR)) {\n fullName.append(Path.SEPARATOR);\n }\n fullName.append(getLocalName());\n re... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Extracts all files from the "master" language and takes them as translation groups.
@param string $lang
@return void | [
"private function getTranslationGroups($lang = 'en'): void\n {\n $dir = resource_path('lang/'. $lang . '/');\n $files = array_diff(scandir($dir), array('..', '.'));\n\n foreach($files as $index => $filename){\n $groupname = str_replace(\".php\", \"\", $filename);\n $thi... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github summarization about Text translation:",
"pos": "Represent the Github code about Text translation:",
"neg": "Represent the Github code:"
} |
Check if a route is localized in a given language
@param string $name
@param string $lang
@return bool | [
"function isLocalized($name,$lang=NULL) {\n\t\tif (!isset($lang))\n\t\t\t$lang=$this->current;\n\t\treturn !$this->isGlobal($name) && array_key_exists($name,$this->_aliases) &&\n\t\t\t\t(!isset($this->rules[$lang][$name]) || $this->rules[$lang][$name]!==FALSE);\n\t}"
] | [
"private static function resource($resource)\n {\n exception_if(($resource != 'session' && $resource != 'cookie'), LogicException::class, 'The resource name of \\''.$resource.'\\' is not supported by Vinala, only session or cookie');\n\n return Hash::make(config('auth.'.$resource));\n\n // F... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Apply the include and exclude filters to those files in *unmatched*,
moving those that are included, but not excluded, into the *matched*
set.
Both *matched* and *unmatched* are sets of unqualified file names. | [
"def match_files(self, matched, unmatched):\n \"\"\"\"\"\"\n for pattern in self.iter():\n pattern.match_files(matched, unmatched)\n if not unmatched:\n # Optimization: If we have matched all files already\n # simply return at this point - nothing el... | [
"def find_matches(self, content, file_to_handle):\n \n # look for all match groups in the content\n groups = [match.groupdict() for match in\n self.match_expression.finditer(content)]\n # filter out content not in the matchgroup\n matches = [group['matchgroup'] fo... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// NewOTP takes a new key, a starting time, a step, the number of
// digits of output (typically 6 or 8) and the hash algorithm to
// use, and builds a new OTP. | [
"func NewTOTP(key []byte, start uint64, step uint64, digits int, algo crypto.Hash) *TOTP {\n\th := hashFromAlgo(algo)\n\tif h == nil {\n\t\treturn nil\n\t}\n\n\treturn &TOTP{\n\t\tOATH: &OATH{\n\t\t\tkey: key,\n\t\t\tcounter: start,\n\t\t\tsize: digits,\n\t\t\thash: h,\n\t\t\talgo: algo,\n\t\t},\n\t\ts... | [
"protected function computeEncryptionKey($password = '')\n {\n $revision = $this->revision;\n\n // TODO: The password string is generated from OS codepage characters by first\n // converting the string to PDFDocEncoding. If the input is Unicode, first convert\n // to a codepage encodi... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
返回对应的termin root path(不依赖对应的config信息) | [
"public static String getTerminRoot(Long channelId, Long pipelineId) {\n // 根据channelId , pipelineId构造path\n return MessageFormat.format(ArbitrateConstants.NODE_TERMIN_ROOT,\n String.valueOf(channelId),\n String.valueOf(pipelineId));\n }"
] | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Parses a Disgenet file ad the one that can be downloaded from
http://www.disgenet.org/ds/DisGeNET/results/all_gene_disease_associations.tar.gz and writes corresponding json
objects. | [
"public void parse() {\n Map<String, Disgenet> disgenetMap = new HashMap<>();\n\n BufferedReader reader;\n try {\n // Disgenet file is usually downloaded as a .tar.gz file\n if (disgenetFilePath.toFile().getName().endsWith(\"tar.gz\")) {\n TarArchiveInputStr... | [
"def main():\n \"\"\"\"\"\"\n # Load study, population, associations, and GoDag. Run GOEA.\n obj = GoeaCliFnc(GoeaCliArgs().args)\n # Reduce results to significant results (pval<value)\n results_specified = obj.get_results()\n # Print results in a flat list\n obj.prt_results(results_specified)"... | codesearchnet | {
"query": "Represent the Github description about Data processing:",
"pos": "Represent the Github code about Data processing:",
"neg": "Represent the Github code:"
} |
@param $postId
@param bool $form
@return Response | [
"public function addCommentFormAction($postId, $form = false)\n {\n $action = $this->container->get(CreateCommentFormAction::class);\n\n return $action($postId, $form);\n }"
] | [
"static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// State returns the monitor status. | [
"func (nm *NodeMonitor) State() *models.MonitorStatus {\n\tnm.Mutex.RLock()\n\tstate := nm.state\n\tnm.Mutex.RUnlock()\n\treturn state\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 sentence about Networking:",
"pos": "Represent the code about Networking:",
"neg": "Represent the code:"
} |
Solve A*X = b
@param b A column vector with as many rows as A.
@return X so that L*L^T*X = b
@exception IllegalArgumentException Matrix row dimensions must agree.
@exception RuntimeException Matrix is not symmetric positive definite. | [
"public double[] solve(double[] b) {\n if(b.length != L.length) {\n throw new IllegalArgumentException(ERR_MATRIX_DIMENSIONS);\n }\n if(!isspd) {\n throw new ArithmeticException(ERR_MATRIX_NOT_SPD);\n }\n // Work on a copy!\n return solveLtransposed(solveLInplace(copy(b)));\n }"
] | [
"def _check_L(self, L):\n \"\"\"\"\"\"\n # TODO: Take this out?\n if issparse(L):\n L = L.todense()\n\n # Check for correct values, e.g. warning if in {-1,0,1}\n if np.any(L < 0):\n raise ValueError(\"L must have values in {0,1,...,k}.\")"
] | codesearchnet | {
"query": "Represent the sentence about Mathematics:",
"pos": "Represent the code about Mathematics:",
"neg": "Represent the code:"
} |
Get all running (unfinished) flows from database. {@inheritDoc} | [
"@Override\n public List<ExecutableFlow> getRunningFlows() {\n final ArrayList<ExecutableFlow> flows = new ArrayList<>();\n try {\n getFlowsHelper(flows, this.executorLoader.fetchUnfinishedFlows().values());\n } catch (final ExecutorManagerException e) {\n logger.error(\"Failed to get running fl... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Checks whether there is already an existing pending/in-progress data request for a user for a given request type.
@param int $userid The user ID.
@param int $type The request type.
@return bool
@throws coding_exception
@throws dml_exception | [
"public static function has_ongoing_request($userid, $type) {\n global $DB;\n\n // Check if the user already has an incomplete data request of the same type.\n $nonpendingstatuses = [\n self::DATAREQUEST_STATUS_COMPLETE,\n self::DATAREQUEST_STATUS_CANCELLED,\n s... | [
"public static function all($params = null, $opts = null)\n {\n $msg = \"Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. \" .\n \"List those using \\$schedule->allRevisions('revision_id') instead.\";\n throw new Error\\InvalidRequest($msg, null);\n... | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about PHP:"
} |
// Prev returns the previous Page relative to the given Page in
// this weighted page set. | [
"func (wp WeightedPages) Prev(cur Page) Page {\n\tfor x, c := range wp {\n\t\tif c.Page == cur {\n\t\t\tif x == 0 {\n\t\t\t\treturn wp[len(wp)-1].Page\n\t\t\t}\n\t\t\treturn wp[x-1].Page\n\t\t}\n\t}\n\treturn nil\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Get available locales
@param string|null|true $domain If provided, locales for the given domain will be returned.
If true, then the current state domain will be used (if in domain mode).
@return ArrayList | [
"public static function getLocales($domain = null)\n {\n // Optionally filter by domain\n $domainObj = Domain::getByDomain($domain);\n if ($domainObj) {\n return $domainObj->getLocales();\n }\n\n return Locale::getCached();\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 Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
>>> p = Preso()
>>> z = p.to_file('/tmp/foo.odp')
>>> sorted(z.ls('/'))
['META-INF/manifest.xml', 'content.xml', 'meta.xml', 'mimetype', 'settings.xml', 'styles.xml'] | [
"def to_file(self, filename=None, write_style=True):\n \n out = zipwrap.Zippier(filename, \"w\")\n out.write(\"mimetype\", self.mime_type)\n for p in self._pictures:\n out.write(\"Pictures/%s\" % p.internal_name, p.get_data())\n out.write(\"content.xml\", self.to_xml())... | [
"def _find_tpls(self, name):\n \n return self._find_tpl(name, extension='.txt'), self._find_tpl(name, extension='.html')"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software Engineering:"
} |
TODO
@param $config
@return bool | [
"public function save($config)\n {\n if (!file_put_contents($this->filename, Yaml::dump($config))) {\n return false;\n }\n return true;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
A decorator for flags classes to forbid declaring flags with overlapping bits. | [
"def unique_bits(flags_class):\n \n flags_class = unique(flags_class)\n other_bits = 0\n for name, member in flags_class.__members_without_aliases__.items():\n bits = int(member)\n if other_bits & bits:\n for other_name, other_member in flags_class.__members_without_aliases__.it... | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Handles the optional labelling of the plot with relevant quantities
Args:
plt (plt): Plot of the locpot vs c axis
label_fontsize (float): Fontsize of labels
Returns Labelled plt | [
"def get_labels(self, plt, label_fontsize=10):\n \n\n # center of vacuum and bulk region\n if len(self.slab_regions) > 1:\n label_in_vac = (self.slab_regions[0][1] + self.slab_regions[1][0])/2\n if abs(self.slab_regions[0][0]-self.slab_regions[0][1]) > \\\n ... | [
"def getPDF(self):\n '''\n '''\n\n if hasattr(self, '_qplot'):\n\n return self._qplot, self._hplot, self._tplot\n\n else:\n raise ValueError('''The metric has not been evaluated at any\n design point so the PDF cannot get obtained''')"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
is the host any of the registered URLs for this website? | [
"public static function isHostKnownAliasHost($urlHost, $idSite)\n {\n $websiteData = Cache::getCacheWebsiteAttributes($idSite);\n\n if (isset($websiteData['hosts'])) {\n $canonicalHosts = array();\n foreach ($websiteData['hosts'] as $host) {\n $canonicalHosts[] ... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
List server id and scripts file name | [
"function list(scriptModule, agent, msg, cb) {\n const servers = [];\n const scripts = [];\n const idMap = agent.idMap;\n\n for (const sid in idMap) {\n if (idMap.hasOwnProperty(sid)) {\n servers.push(sid);\n }\n }\n\n fs.readdir(scriptModule.root, (err, filenames) => {\n ... | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Technology:"
} |
Updates the commerce wish list item in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
@param commerceWishListItem the commerce wish list item
@return the commerce wish list item that was updated | [
"public static com.liferay.commerce.wish.list.model.CommerceWishListItem updateCommerceWishListItem(\n\t\tcom.liferay.commerce.wish.list.model.CommerceWishListItem commerceWishListItem) {\n\t\treturn getService().updateCommerceWishListItem(commerceWishListItem);\n\t}"
] | [
"function DefaultChangeRequestInterceptor(saveContext, saveBundle) {\n /**\n Prepare and return the save data for an entity change-set.\n\n The adapter calls this method for each entity in the change-set,\n after it has prepared a \"change request\" for that object.\n\n The method can do anything... | codesearchnet | {
"query": "Represent the instruction about Aimeos:",
"pos": "Represent the code about Aimeos:",
"neg": "Represent the code:"
} |
*
This method is used to clear KeyStore configurations when the entire config
is being reloaded.
* | [
"public void clearKSMap() {\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())\n Tr.debug(tc, \"Clearing keystore maps\");\n synchronized (keyStoreMap) {\n keyStoreMap.clear();\n }\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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// List runs the list action. | [
"func (c *SpaceController) List(ctx *app.ListSpaceContext) error {\n\t_, err := login.ContextIdentity(ctx)\n\tif err != nil {\n\t\treturn jsonapi.JSONErrorResponse(ctx, goa.ErrUnauthorized(err.Error()))\n\t}\n\toffset, limit := computePagingLimits(ctx.PageOffset, ctx.PageLimit)\n\n\tvar response app.SpaceList\n\ttx... | [
"@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 about Agent Identity Management:",
"pos": "Represent the Github code about Agent Identity Management:",
"neg": "Represent the Github code about programming:"
} |
// add inserts or updates "r" in the cache for the replica with the key "r.Key". | [
"func (c *replicationLagCache) add(r replicationLagRecord) {\n\tif !r.Up {\n\t\t// Tablet is down. Do no longer track it.\n\t\tdelete(c.entries, r.Key)\n\t\tdelete(c.ignoredSlowReplicasInARow, r.Key)\n\t\treturn\n\t}\n\n\tentry, ok := c.entries[r.Key]\n\tif !ok {\n\t\tentry = newReplicationLagHistory(c.historyCapac... | [
"function completeQuery(err) {\n if (err) return cb(err);\n db.eval(zahd, 2, 'expiring_domains', 'querying_domains',\n expiration, domain, next);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Run any git command, like "status" or "checkout -b mybranch origin/mybranch"
@throws RuntimeException
@param string $commandString
@return string $output | [
"public function git($commandString)\n {\n // clean commands that begin with \"git \"\n $commandString = preg_replace('/^git\\s/', '', $commandString);\n\n $commandString = $this->options['git_executable'].' '.$commandString;\n\n $command = new $this->options['command_class']($this->d... | [
"func (r *printRun) RegisterIDFlag() {\n\tr.Flags.BoolVar(&r.id, \"id\", false, doc(`\n\t\tPrint only build ids.\n\n\t\tIntended for piping the output into another bb subcommand:\n\t\t\tbb ls -cl myCL -id | bb cancel\n\t`))\n}"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software Development:"
} |
can lead to classcastexception if comparator is not of the right type | [
"@SuppressWarnings(\"unchecked\")\n\tpublic <T> void sort(Arr arr, Comparator<T> c) {\n\t\tint l = arr.getLength();\n\t\tObject[] objs = new Object[l];\n\t\tfor (int i=0; i<l; i++) {\n\t\t\tobjs[i] = arr.get(i);\n\t\t}\n\t\tArrays.sort((T[])objs, c);\n\t\tfor (int i=0; i<l; i++) {\n\t\t\tarr.put(i, objs[i]);\n\t\t}... | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Create a new cell at the specified coordinate
@param string $pCoordinate Coordinate of the cell
@return PHPExcel_Cell Cell that was created | [
"private function _createNewCell($pCoordinate)\n\t{\n\t\t$cell = $this->_cellCollection->addCacheData(\n\t\t\t$pCoordinate,\n\t\t\tnew PHPExcel_Cell(\n\t\t\t\tNULL, \n\t\t\t\tPHPExcel_Cell_DataType::TYPE_NULL, \n\t\t\t\t$this\n\t\t\t)\n\t\t);\n $this->_cellCollectionIsSorted = false;\n\n // Coordinate... | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Determine if the browser is among the custom browser rules or not. Rules are checked in the order they were
added.
@access protected
@return boolean Returns true if we found the browser we were looking for in the custom rules, false otherwise. | [
"protected function checkBrowserCustom()\n {\n foreach ($this->_customBrowserDetection as $browserName => $customBrowser) {\n $uaNameToLookFor = $customBrowser['uaNameToLookFor'];\n $isMobile = $customBrowser['isMobile'];\n $isRobot = $customBrowser['isRobot'];\n ... | [
"public function validate(&$values, $action) {\n $this->errors = array();\n $this->values = $values;\n $valid = true;\n foreach ($this->rules as $rule) {\n $forActions = isset($rule['on']) ? explode(',', $rule['on']) : array();\n array_walk($forActions, function (&$... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Find related object on the database and updates it with attributes in self, if it didn't
find it on database it creates a new one. | [
"def convert(attribute=\"id\")\n klass = persistence_class\n object = klass.where(attribute.to_sym => self.send(attribute)).first\n\n object ||= persistence_class.new\n\n attributes = self.attributes.select{ |key, value| self.class.serialized_attributes.include?(key.to_s) }\n\n at... | [
"def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Finish establishing section
Wrap up title node, but stick in the section node. Add the section names
based on all the text nodes added to the title. | [
"def depart_heading(self, _):\n \n assert isinstance(self.current_node, nodes.title)\n # The title node has a tree of text nodes, use the whole thing to\n # determine the section id and names\n text = self.current_node.astext()\n if self.translate_section_name:\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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
верификация номер телефона
@return bool
@throws Exception | [
"public function verifyPhone(): bool\n {\n $phone = new UserMetaPhone($this->notification_phone);\n $phone->verifyPhone();\n $this->notification_phone = $phone;\n return $this->updateModel();\n }"
] | [
"final function handle() {\n\t\ttry {\n\t\t\tif ($this->m()->s()->log()) {\n\t\t\t\t$this->log();\n\t\t\t}\n\t\t\t$this->_e->validate();\n\t\t\tif ($c = $this->strategyC()) { /** @var string|null $c */\n\t\t\t\tStrategy::handle($c, $this);\n\t\t\t}\n\t\t}\n\t\t/** 2017-09-15 @uses NotForUs is thrown from @see \\Df\... | codesearchnet | {
"query": "Represent the Github description about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code:"
} |
Expert users can override this method for more complete control over the
execution of the Mapper.
@param context
@throws IOException | [
"public void run(Context context) throws IOException, InterruptedException {\n setup(context);\n while (context.nextKeyValue()) {\n map(context.getCurrentKey(), context.getCurrentValue(), context);\n }\n cleanup(context);\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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Add a response to the list.
@param int $key
@param array|null $response | [
"public function addResponse($key, array $response)\n {\n $originalRequest = isset($this->request[$key]) ? $this->request[$key] : null;\n $responseBody = isset($response['body']) ? $response['body'] : null;\n $responseError = isset($response['error']) ? $response['error'] : null;\n $r... | [
"protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }"
] | codesearchnet | {
"query": "Represent the sentence about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about Software development:"
} |
Copy temporary project data to persistent storage.
@param string[] $with
@throws ReadException | [
"private function updateStorage($with = [])\n {\n $data = array_merge($this->data, $with);\n $this->fs->create($this->fsPath, json_encode($data));\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 instruction about file transfer:",
"pos": "Represent the code about file transfer:",
"neg": "Represent the code:"
} |
// drawCondFmtCellIs provides a function to create conditional formatting rule
// for cell value (include between, not between, equal, not equal, greater
// than and less than) by given priority, criteria type and format settings. | [
"func drawCondFmtCellIs(p int, ct string, format *formatConditional) *xlsxCfRule {\n\tc := &xlsxCfRule{\n\t\tPriority: p + 1,\n\t\tType: validType[format.Type],\n\t\tOperator: ct,\n\t\tDxfID: &format.Format,\n\t}\n\t// \"between\" and \"not between\" criteria require 2 values.\n\t_, ok := map[string]bool{\"b... | [
"function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Trims every string in the specified strings array.
@param strings the specified strings array, returns {@code null} if the
specified strings is {@code null}
@return a trimmed strings array | [
"public static String[] trimAll(final String[] strings) {\n if (null == strings) {\n return null;\n }\n\n return Arrays.stream(strings).map(StringUtils::trim).toArray(size -> new String[size]);\n }"
] | [
"@Override\n public Object[] swapParameters(final Object[] emptyReplacement) {\n Object[] result;\n if (varargs == null) {\n result = params;\n if (emptyReplacement.length >= MAX_PARMS) {\n params = emptyReplacement;\n } else {\n // Bad... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Sobel method to generate bump map from a height map
@param input - A height map
@return bump map | [
"@Override\n public ImageSource apply(ImageSource input) {\n int w = input.getWidth();\n int h = input.getHeight();\n\n MatrixSource output = new MatrixSource(input);\n\n Vector3 n = new Vector3(0, 0, 1);\n\n for (int y = 0; y < h; y++) {\n for (int x = 0; x < w; x++... | [
"@Override\n\tprotected void processImage(ImageBase image) {\n\t\t// The data type of 'image' was specified in onCreate() function\n\t\t// The line below will compute the gradient and store it in two images. One for the\n\t\t// gradient along the x-axis and the other along the y-axis\n\t\tgradient.process((GrayU8)i... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Modify the inner parameters of the Kepler propagator in order to place
the spacecraft in the right Sphere of Influence | [
"def _change_soi(self, body):\n \n\n if body == self.central:\n self.bodies = [self.central]\n self.step = self.central_step\n self.active = self.central.name\n self.frame = self.central.name\n else:\n soi = self.SOI[body.name]\n ... | [
"def get_target_volume(self, etheta=0.0, scaled=False):\n \n # TODO: make this a function of d instead of etheta?\n logger.debug(\"determining target volume at t={}, theta={}\".format(self.time, etheta))\n\n # TODO: eventually this could allow us to \"break\" volume conservation\n ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about mathematics:"
} |
Creates the signed license at the defined output path
@throws BuildException
@return void | [
"protected function generateLicense()\n {\n $command = $this->prepareSignCommand() . ' 2>&1';\n\n $this->log('Creating license at ' . $this->outputFile);\n\n $this->log('Running: ' . $command, Project::MSG_VERBOSE);\n $tmp = exec($command, $output, $return_var);\n\n // Check fo... | [
"@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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Indicates whether activity is for compensation.
@return true if this activity is for compensation. | [
"public boolean isCompensationHandler() {\n Boolean isForCompensation = (Boolean) getProperty(BpmnParse.PROPERTYNAME_IS_FOR_COMPENSATION);\n return Boolean.TRUE.equals(isForCompensation);\n }"
] | [
"function(code, name, concept) {\n Concept.call(this, name);\n /**\n * Gets or sets the value of the abs code.\n * @type {String}\n */\n this.code = code;\n\n /**\n * Gets the list of abs codes contained in this group. This property is observable.\n * @type {AbsCode[]}\n */\n this.items = [];\n\n ... | codesearchnet | {
"query": "Represent the Github comment about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code about programming:"
} |
@param array $elements
@return \marvin255\serviform\interfaces\HasChildren | [
"public function setElements(array $elements)\n {\n $this->elements = [];\n foreach ($elements as $name => $element) {\n $this->setElement($name, $element);\n }\n\n return $this;\n }"
] | [
"public function createUiComponent(\\n2n\\impl\\web\\ui\\view\\html\\HtmlView $view, \\rocket\\ei\\util\\Eiu $eiu) {\r\n\t\treturn $view->getHtmlBuilder()->getEsc($eiu->field()->getValue());\r\n\t}"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Sets which partial view script to use for rendering tweets
@param string|array $partial
@return \UthandoTwitter\View\TweetFeed | [
"public function setPartial($partial)\n {\n if (null === $partial || is_string($partial) || is_array($partial)) {\n $this->partial = $partial;\n }\n\n return $this;\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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Add migrations to be applied.
Args:
migrations: a list of migrations to add of the form [(app, migration_name), ...]
Raises:
MigrationSessionError if called on a closed MigrationSession | [
"def add_migrations(self, migrations):\n \n if self.__closed:\n raise MigrationSessionError(\"Can't change applied session\")\n self._to_apply.extend(migrations)"
] | [
"def _find_entity_in_records_by_class_name(self, entity_name):\n \"\"\"\"\"\"\n records = {\n key: value for (key, value)\n in self._registry.items()\n if value.name == entity_name\n }\n # If more than one record was found, we are dealing with the case of... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns base basket price for payment cost calculations. Price depends on
payment setup (payment administration)
@param \OxidEsales\Eshop\Application\Model\Basket $oBasket oxBasket object
@return double | [
"public function getBaseBasketPriceForPaymentCostCalc($oBasket)\n {\n $dBasketPrice = 0;\n $iRules = $this->oxpayments__oxaddsumrules->value;\n\n // products brutto price\n if (!$iRules || ($iRules & self::PAYMENT_ADDSUMRULE_ALLGOODS)) {\n $dBasketPrice += $oBasket->getProd... | [
"public function setPersParams($aParams)\n {\n $this->_aPersParam = $aParams;\n\n // serializing persisten info stored while ordering\n $this->oxorderarticles__oxpersparam = new \\OxidEsales\\Eshop\\Core\\Field(serialize($aParams), \\OxidEsales\\Eshop\\Core\\Field::T_RAW);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about invoice calculation:",
"pos": "Represent the Github code about invoice calculation:",
"neg": "Represent the Github code about programming:"
} |
*********************************************************************************** | [
"@Override\n\tpublic boolean removeArc(int x, int y, ICause cause) throws ContradictionException {\n\t\tassert cause != null;\n\t\tif (LB.arcExists(x, y)) {\n\t\t\tthis.contradiction(cause, \"remove mandatory arc \" + x + \"->\" + y);\n\t\t\treturn false;\n\t\t}\n\t\tif (UB.removeArc(x, y)) {\n\t\t\tif (reactOnModi... | [
"private void populateMilestone(Row row, Task task)\n {\n task.setMilestone(true);\n //PROJID\n task.setUniqueID(row.getInteger(\"MILESTONEID\"));\n task.setStart(row.getDate(\"GIVEN_DATE_TIME\"));\n task.setFinish(row.getDate(\"GIVEN_DATE_TIME\"));\n //PROGREST_PERIOD\n //SYMBO... | codesearchnet | {
"query": "Represent the Github text about N/A:",
"pos": "Represent the Github code about N/A:",
"neg": "Represent the Github code about Data management:"
} |
// GetAvatarURL gets the user's avatar URL. See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-profile-userid-avatar-url | [
"func (cli *Client) GetAvatarURL() (url string, err error) {\n\turlPath := cli.BuildURL(\"profile\", cli.UserID, \"avatar_url\")\n\ts := struct {\n\t\tAvatarURL string `json:\"avatar_url\"`\n\t}{}\n\n\t_, err = cli.MakeRequest(\"GET\", urlPath, nil, &s)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn s.Av... | [
"def set_profile_picture(self, filename):\n \n log.info(\"[+] Setting the profile picture to file '{}'\".format(filename))\n profile_pictures.set_profile_picture(filename, self.kik_node + '@talk.kik.com', self.username, self.password)"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// ParseToRawMap takes the filename as a string and returns a RawMap. | [
"func ParseToRawMap(fileName string) (cfg RawMap, err error) {\n\tvar file *os.File\n\n\tcfg = make(RawMap, 0)\n\tfile, err = os.Open(fileName)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer file.Close()\n\tscanner := bufio.NewScanner(file)\n\n\tvar currentSection string\n\tfor scanner.Scan() {\n\t\tline := scanner.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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Loops through the output buffer, flushing each, before emitting
the response.
@param int|null $maxBufferLevel Flush up to this buffer level.
@return void | [
"protected function flush($maxBufferLevel = null)\n {\n if (null === $maxBufferLevel) {\n $maxBufferLevel = ob_get_level();\n }\n\n while (ob_get_level() > $maxBufferLevel) {\n ob_end_flush();\n }\n }"
] | [
"public function flush(): void\n {\n if (empty($this->buffers)) {\n return;\n }\n\n foreach ($this->buffers as $buffer) {\n try {\n $this->sender->sendTo($buffer[0], $buffer[1], $buffer[2]);\n } catch (SenderException $e) {\n if ... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Technology:"
} |
Scalar multiplies each item with c
@param c | [
"public void scalarMultiply(double c)\r\n {\r\n int m = rows;\r\n int n = cols;\r\n for (int i = 0; i < m; i++)\r\n {\r\n for (int j = 0; j < n; j++)\r\n {\r\n consumer.set(i, j, c * supplier.get(i, j));\r\n }\r\n }\r\n }"
] | [
"def ystep(self):\n \n \"\"\"\n\n self.Y = self.Pcn(self.AX + self.U)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
allocateSpace(). | [
"private void freeAllocatedSpace(java.util.Collection sortedFreeSpaceList)\n {\n if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())\n trace.entry(this,\n cclass,\n \"freeAllocatedSpace\",\n new Object[] { new Integer... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Aligns the structures, duplicating ca2 regardless of
{@link CECPParameters.getDuplicationHint() param.getDuplicationHint}.
@param ca1
@param ca2
@param cpparams
@return
@throws StructureException | [
"private AFPChain alignRight(Atom[] ca1, Atom[] ca2, CECPParameters cpparams)\n\t\t\tthrows StructureException {\n\t\tlong startTime = System.currentTimeMillis();\n\n\t\tAtom[] ca2m = StructureTools.duplicateCA2(ca2);\n\n\t\tif(debug) {\n\t\t\tSystem.out.format(\"Duplicating ca2 took %s ms\\n\",System.currentTimeMi... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Checks if discount should be skipped for this article in basket. Returns true if yes.
@return bool | [
"public function skipDiscounts()\n {\n // already loaded skip discounts config\n if ($this->_blSkipDiscounts !== null) {\n return $this->_blSkipDiscounts;\n }\n\n if ($this->oxarticles__oxskipdiscounts->value) {\n return true;\n }\n\n\n $this->_blSk... | [
"public function getStockQuantity(string $sku) {\n $stock = $this->getStock($sku);\n\n if (empty($stock['status'])) {\n return 0;\n }\n\n // @TODO: For now there is no scenario in which we have quantity in float.\n // We have kept the database field to match what is there in MDC and code\n //... | codesearchnet | {
"query": "Represent the Github comment about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code about programming:"
} |
Returns the product of each numerical column or row.
Return:
A new QueryCompiler object with the product of each numerical column or row. | [
"def prod(self, **kwargs):\n \n if self._is_transposed:\n kwargs[\"axis\"] = kwargs.get(\"axis\", 0) ^ 1\n return self.transpose().prod(**kwargs)\n return self._process_sum_prod(\n self._build_mapreduce_func(pandas.DataFrame.prod, **kwargs), **kwargs\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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Switches the corners of the Tiles between rounded and rectangular
@param ROUNDED | [
"public void setRoundedCorners(final boolean ROUNDED) {\n if (null == roundedCorners) {\n _roundedCorners = ROUNDED;\n fireTileEvent(REDRAW_EVENT);\n } else {\n roundedCorners.set(ROUNDED);\n }\n }"
] | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Generates control's HTML element.
@return Html | [
"public function getControl()\n\t{\n\t\t$control = parent::getControl();\n\t\t$control->type = $this->htmlType;\n\t\t$control->addClass($this->htmlType);\n\n\t\tlist($min, $max) = $this->extractRangeRule($this->getRules());\n\t\tif ($min instanceof DateTimeInterface) {\n\t\t\t$control->min = $min->format($this->htm... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetTimeoutInMinutesOverride sets the TimeoutInMinutesOverride field's value. | [
"func (s *StartBuildInput) SetTimeoutInMinutesOverride(v int64) *StartBuildInput {\n\ts.TimeoutInMinutesOverride = &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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(MethodSnapshot methodSnapshot, ProtocolMarshaller protocolMarshaller) {\n\n if (methodSnapshot == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(methodSnapshot.getAutho... | [
"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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Fetches the metric object corresponding to the given name. | [
"def _GetMetric(self, metric_name):\n \"\"\"\"\"\"\n if metric_name in self._counter_metrics:\n return self._counter_metrics[metric_name]\n elif metric_name in self._event_metrics:\n return self._event_metrics[metric_name]\n elif metric_name in self._gauge_metrics:\n return self._gauge_me... | [
"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 text about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about programming:"
} |
Download the specified feed item
@param models\Download\Feed\DownloadFeedItem $DownloadFeedItem
@return bool
@throws \GuzzleHttp\Exception\GuzzleException
@throws \alphayax\freebox\Exception\FreeboxApiException | [
"public function downloadFeedItem(models\\Download\\Feed\\DownloadFeedItem $DownloadFeedItem)\n {\n $service = sprintf(self::API_DOWNLOAD_FEEDS_ITEMS_ITEM_DOWNLOAD, $DownloadFeedItem->getFeedId(), $DownloadFeedItem->getId());\n $rest = $this->callService('POST', $service, $DownloadFeedItem);\n\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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Programming:"
} |
Perform session cleanup, since the end method should always be
called explicitely by the calling code, this works better than the
destructor.
Set close_fileobj to False so fileobj can be returned open. | [
"def end(self, close_fileobj=True):\n \"\"\"\"\"\"\n log.debug(\"in TftpContext.end - closing socket\")\n self.sock.close()\n if close_fileobj and self.fileobj is not None and not self.fileobj.closed:\n log.debug(\"self.fileobj is open - closing\")\n self.fileobj.cl... | [
"def _destroy(self):\n \"\"\"\"\"\"\n self.unuse_region()\n\n if self._rlist is not None:\n # Actual client count, which doesn't include the reference kept by the manager, nor ours\n # as we are about to be deleted\n try:\n if len(self._rlist) == ... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.