query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Remove a previously defined property by name @param name property name @return this builder
[ "public DescriptionBuilder removeProperty(final String name) {\n final Property found = findProperty(name);\n if (null != found) {\n properties.remove(found);\n }\n return this;\n }" ]
[ "@Override\n public boolean setProperty(String name, Object value)\n {\n /* Note: can not call local method, since it'll return false for\n * recognized but non-mutable properties\n */\n return mConfig.setProperty(name, value);\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Sets file manager messages @param string $message @param string $severity @param bool $once
[ "protected function setMessageFileManager($message, $severity, $once = false)\n {\n if ($once) {\n $this->session->setMessage($message, $severity, 'file_manager_messages');\n } else {\n $messages = $this->getData(\"messages.$severity\", array());\n $messages[] = $me...
[ "private function notify_success(stdClass $info) {\n $filedesc = $this->describe_alias($info);\n $this->log('successfully restored alias', backup::LOG_DEBUG, $filedesc, 1);\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software Development:" }
Gives an array of indices indicating where the attributes of this record gets its values from in the comma separated string which the instance is created from. @param [Integer] length the number of elements to create in the indices array
[ "def import_indices(length)\n # Note that this method is defined in the parent Record class, where it is\n # used for most record types. However, because this record has two attributes\n # which contain an array of values, we use a custom import_indices method.\n #\n # Furthermore, as of Mo...
[ "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 comment about Documentation:", "pos": "Represent the code about Documentation:", "neg": "Represent the code:" }
Reset the state of all cells. This is normally used between sequences while training. All internal states are reset to 0.
[ "def reset(self,):\n \n\n self.activeState['t-1'].fill(0)\n self.activeState['t'].fill(0)\n self.predictedState['t-1'].fill(0)\n self.predictedState['t'].fill(0)\n self.learnState['t-1'].fill(0)\n self.learnState['t'].fill(0)\n self.confidence['t-1'].fill(0)\n self.confidence['t'].fill(0)...
[ "function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element i...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Generate the gallery reStructuredText for an example directory
[ "def generate_dir_rst(src_dir, target_dir, gallery_conf, seen_backrefs):\n \"\"\"\"\"\"\n\n head_ref = os.path.relpath(target_dir, gallery_conf['src_dir'])\n fhindex = \"\"\"\\n\\n.. _sphx_glr_{0}:\\n\\n\"\"\".format(\n head_ref.replace(os.path.sep, '_'))\n\n with codecs.open(os.path.join(src_dir...
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code:" }
<p>Additional check document for ready to account (make acc.entries).</p> @param pReqVars additional param @param pEntity entity @param pRequestData Request Data @throws Exception - an exception if don't
[ "@Override\n public final void addCheckIsReadyToAccount(\n final Map<String, Object> pReqVars,\n final PurchaseInvoice pEntity,\n final IRequestData pRequestData) throws Exception {\n // nothing\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 about PHP:", "pos": "Represent the code about PHP:", "neg": "Represent the code:" }
Create a too many requests http exception. @param string $key @param int $limit @param bool $headers @return \AltThree\Throttle\ThrottlingException
[ "protected function buildException(string $key, int $limit, bool $headers)\n {\n $after = $this->limiter->availableIn($key);\n\n $exception = new ThrottlingException($after, 'Rate limit exceeded.');\n\n $headers = $this->getHeaders($key, $limit, $headers, $after, $exception->getHeaders());\n...
[ "public function canDisplay(Exception $original, Exception $transformed, int $code)\n {\n return $transformed instanceof TooManyRequestsHttpException && $this->request->is('auth*');\n }" ]
codesearchnet
{ "query": "Represent the instruction about PHP:", "pos": "Represent the code about PHP:", "neg": "Represent the code about Software development:" }
creates the property file lines for the given comments array @param array $comments @return string
[ "public function createPropertyPathsFromCommentArray($comments)\n {\n $out = '';\n\n foreach ($comments as $mainKey => $subKeys) {\n foreach ($subKeys as $subKey => $comment) {\n // uncommented entries are undocumented & for internal use only (I guess)\n if ...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get a list of chromosomes to target and new updated ref_file header. Could potentially handle remapping from chr1 -> 1 but currently disabled due to speed issues.
[ "def _target_chroms_and_header(bam_file, data):\n \n special_remaps = {\"chrM\": \"MT\", \"MT\": \"chrM\"}\n target_chroms = dict([(x.name, i) for i, x in enumerate(ref.file_contigs(dd.get_ref_file(data)))\n if chromhacks.is_autosomal_or_sex(x.name)])\n out_chroms = []\n with...
[ "def set_identifiers(self, data):\n \n for id_info in self._details.identifiers:\n var_name = id_info['var_name']\n self._data[var_name] = data.get(var_name)\n\n # FIXME: This needs to likely kick off invalidating/rebuilding\n # relations.\n # F...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Draws the given text at x,y.
[ "def draw_text(self, text:str, x:float, y:float, *,\n font_name:str, font_size:float, fill:Color) -> None:\n \"\"\"\"\"\"\n pass" ]
[ "def setTopRight(self, loc):\n \n offset = self.getTopRight().getOffset(loc) # Calculate offset from current top right\n return self.setLocation(self.getTopLeft().offset(offset)) # Move top left corner by the same offset" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get the bandgap from the DOSCAR file
[ "def _get_bandgap_doscar(filename):\n \"\"\"\"\"\"\n with open(filename) as fp:\n for i in range(6):\n l = fp.readline()\n efermi = float(l.split()[3])\n step1 = fp.readline().split()[0]\n step2 = fp.readline().split()[0]\n step_siz...
[ "def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Prepare form fields @SuppressWarnings(PHPMD.CamelCaseMethodName) @return Form
[ "protected function _prepareForm()\n {\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create(\n ['data' => ['id' => 'edit_form', 'action' => $this->getData('action')]]\n );\n\n $thesaurusTypes = [\n ['value' => ThesaurusInterf...
[ "@SuppressWarnings(\"unchecked\") public Class<T> getAnnotationHandledByThisHandler() {\n\t\treturn (Class<T>) SpiLoadUtil.findAnnotationClass(getClass(), EclipseAnnotationHandler.class);\n\t}" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// ChannelOrderers returns a list of channel orderers
[ "func (c *MockConfig) ChannelOrderers(name string) []fab.OrdererConfig {\n\tif name == \"Invalid\" {\n\t\treturn nil\n\t}\n\n\toConfig, _ := c.OrdererConfig(\"\")\n\n\treturn []fab.OrdererConfig{*oConfig}\n}" ]
[ "func getEnterpriseResourceIter(context structs.Context, _ *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {\n\t// If we have made it here then it is an error since we have exhausted all\n\t// open source contexts.\n\treturn nil, fmt.Errorf(\"context mus...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Removes the counter for the given {@code serviceName} and {@code dataStructureName}.
[ "public void removeCounter(String serviceName, String dataStructureName) {\n for (WanPublisherEventCounters publisherWanCounterContainer : eventCounterMap.values()) {\n publisherWanCounterContainer.removeCounter(serviceName, dataStructureName);\n }\n }" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
Performs the retrieval of the resource @param string $key @param string $id @param array|null $options @return array
[ "protected function performGet(string $key, string $id, array $options = null)\n {\n return $this->flow->send(\n 'get',\n $this->endpoint . '/' . ($options['method'] ?? $this->verbsMap['get'] ?? 'get'),\n [$key => $id]\n );\n }" ]
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Ensure we are using the latest revision in the hg repository
[ "def update(self, branch='default'):\n '''\n \n '''\n log.debug('Updating hg repo from hg_pillar module (pull)')\n self.repo.pull()\n log.debug('Updating hg repo from hg_pillar module (update)')\n self.repo.update(branch, clean=True)" ]
[ "def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// bindFile binds file parameter File. // // The only supported validations on files are MinLength and MaxLength
[ "func (o *PetUploadImageParams) bindFile(file multipart.File, header *multipart.FileHeader) error {\n\treturn nil\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the description about File management:", "pos": "Represent the code about File management:", "neg": "Represent the code about programming:" }
// Updates the server's Info object with the given array of URLs and re-generate // the infoJSON byte array, then send an (async) INFO protocol to clients that // support it.
[ "func (s *Server) updateServerINFOAndSendINFOToClients(urls []string, add bool) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\t// Will be set to true if we alter the server's Info object.\n\twasUpdated := false\n\tremove := !add\n\tfor _, url := range urls {\n\t\t_, present := s.clientConnectURLsMap[url]\n\t\tif add ...
[ "function execute(exec, req, res) {\n\n // start timing slow logs before execution\n // validation time is not included nor i/o\n this.state.slowlog.start(req.cmd, req.raw);\n\n // ensure the slowlog stop is called\n // before encoding and sending the response\n res.before = this.state.slowlog.stop;\n\n // e...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Get friend name. @param \simplehtmldom_1_5\simple_html_dom $f @return string
[ "private function getName($f)\n {\n $name_temp = $f->find('a', 0)->href;\n $name_temp = explode('/', $name_temp);\n\n return $name_temp[4];\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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// NewUserinfoController creates a userinfo controller.
[ "func NewUserinfoController(service *goa.Service, app application.Application, tokenManager manager.TokenManager) *UserinfoController {\n\treturn &UserinfoController{\n\t\tController: service.NewController(\"UserinfoController\"),\n\t\tapp: app,\n\t\ttokenManager: tokenManager,\n\t}\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// See also https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetUUID
[ "func (n *Network) GetUUID() ([]byte, error) {\n\tvar cUuid [C.VIR_UUID_BUFLEN](byte)\n\tcuidPtr := unsafe.Pointer(&cUuid)\n\tvar err C.virError\n\tresult := C.virNetworkGetUUIDWrapper(n.ptr, (*C.uchar)(cuidPtr), &err)\n\tif result != 0 {\n\t\treturn []byte{}, makeError(&err)\n\t}\n\treturn C.GoBytes(cuidPtr, C.VIR...
[ "func (b *serverBuilder) ClearNICConnections() {\n\tb.nicConnections = nil\n\tb.disk.SetIPAddress(\"\")\n\tb.disk.SetNetworkMaskLen(0)\n\tb.disk.SetDefaultRoute(\"\")\n}" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
LocationHashbangUrl represents url This object is exposed as $location service when html5 history api is disabled or not supported @constructor @param {string} url Legacy url @param {string} hashPrefix Prefix for hash part (containing path and search)
[ "function LocationHashbangUrl(url, hashPrefix, appBaseUrl) {\n var basePath;\n\n /**\n * Parse given hashbang url into properties\n * @param {string} url Hashbang url\n * @private\n */\n this.$$parse = function(url) {\n var match = matchUrl(url, this);\n\n\n if (match.hash && match.hash.indexOf(has...
[ "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 about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// Format implements Format interface.
[ "func (f *flatFormatter) Format(format string, args ...interface{}) (n int, errno error) {\n\treturn (*indentFormatter)(f).format(true, format, args...)\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
Limit image size to maximum allowed image size. @param integer $width The image width. @param integer $height The image height. @return integer[] The limited width and height.
[ "public function limitImageSize($width, $height)\n {\n if ($this->maxImageSize !== null) {\n $imageSize = $width * $height;\n\n if ($imageSize > $this->maxImageSize) {\n $width = $width / sqrt($imageSize / $this->maxImageSize);\n $height = $height / sqrt...
[ "function get_margin_width()\n {\n //ignore image width, use same width as on predefined bullet ListBullet\n //for proper alignment of bullet image and text. Allow image to not fitting on left border.\n //This controls the extra indentation of text to make room for the bullet image.\n ...
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
延迟获取关联数据 @param string $subRelation 子关联名 @param \Closure $closure 闭包查询条件 @return Collection
[ "public function getRelation($subRelation = '', $closure = null)\n {\n if ($closure) {\n $closure($this->query);\n }\n\n $result = $this->buildQuery()->relation($subRelation)->select();\n $this->hydratePivot($result);\n\n return $result;\n }" ]
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Reimplement Qt method
[ "def moveEvent(self, event):\r\n \"\"\"\"\"\"\r\n if not self.isMaximized() and not self.fullscreen_flag:\r\n self.window_position = self.pos()\r\n QMainWindow.moveEvent(self, event)\r\n\r\n # To be used by the tour to be able to move\r\n self.sig_moved.emit(event)" ]
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Execute this method in a multiprocess or thread
[ "def handle_func(self, multiprocessing_enabled, func, data):\n '''\n \n '''\n if salt.utils.platform.is_windows() \\\n or self.opts.get('transport') == 'zeromq':\n # Since function references can't be pickled and pickling\n # is required when spawning...
[ "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:" }
Returns an array of cities for the given country and state ID @return array
[ "public function searchCityAjax()\n {\n $country = $this->getPosted('country');\n $state_id = $this->getPosted('state_id');\n\n if (empty($country) || empty($state_id)) {\n return array();\n }\n\n $conditions = array(\n 'status' => 1,\n 'state_s...
[ "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:" }
/* (non-Javadoc) @see mtas.solr.handler.component.util.MtasSolrComponent#modifyRequest(org.apache .solr.handler.component.ResponseBuilder, org.apache.solr.handler.component.SearchComponent, org.apache.solr.handler.component.ShardRequest)
[ "public void modifyRequest(ResponseBuilder rb, SearchComponent who,\n ShardRequest sreq) {\n if (sreq.params.getBool(MtasSolrSearchComponent.PARAM_MTAS, false)\n && sreq.params.getBool(PARAM_MTAS_LIST, false)) {\n // compute keys\n Set<String> keys = MtasSolrResultUtil\n .getIdsFro...
[ "@Override\n public void removeSSOCookieFromResponse(HttpServletResponse resp) {\n if (resp instanceof com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) {\n ((com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) resp).removeCookie(getSSOCookiename());\n removeJwtSSOCookies((com....
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
File exists? @param {String} filepath @returns {boolean}
[ "function exists(filepath) {\n\t\tvar does = grunt.file.exists(filepath);\n\t\tif (!does) {\n\t\t\tgrunt.log.error(\n\t\t\t\t'Human error: ' + chalk.cyan(filepath) + ' not found.'\n\t\t\t);\n\t\t\tgrunt.fail.errorcount++;\n\t\t}\n\t\treturn does;\n\t}" ]
[ "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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Initializes this relation with the given database, field, and options. @param {Rekord.Database} database [description] @param {String} field [description] @param {Object} options [description]
[ "function(database, field, options)\n {\n applyOptions( this, options, this.getDefaults( database, field, options ) );\n\n this.database = database;\n this.name = field;\n this.options = options;\n this.initialized = false;\n this.property = this.property || (indexOf( database.fields, this.name )...
[ "function factoryGraph(ParentClass){if(!ParentClass){var ParentClass=function ParentClass(){_classCallCheck(this,ParentClass)}}/**\n * Class to inherit. Class with methods for control links in graph.\n * Must be completed for adaptation to a particular database.\n * \n * @class\n * @description `import { ...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Parse a variable line @param string $varLine @return Variable
[ "public static function parse($varLine)\n {\n $parts = explode('=', $varLine, 2);\n if (!$parts || count($parts) !== 2) {\n throw new \\InvalidArgumentException(\"Line does not appear to contain a variable\");\n }\n\n $variable = new Variable();\n $variable->setName(...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// Implements checks if the value implements the expected value
[ "func Implements(expectedValue interface{}) *implementsMatcher {\n\tm := new(implementsMatcher)\n\tm.expectedValue = expectedValue\n\treturn m\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Default memcache timeout policy. This defers to _memcache_timeout on the Model class. Args: key: Key instance. Returns: Memcache timeout to use (integer), or None.
[ "def default_memcache_timeout_policy(key):\n \n timeout = None\n if key is not None and isinstance(key, model.Key):\n modelclass = model.Model._kind_map.get(key.kind())\n if modelclass is not None:\n policy = getattr(modelclass, '_memcache_timeout', None)\n if policy is not None:\n ...
[ "def get(self, key, namespace=None):\n \"\"\"\"\"\"\n full_key = generate_uppercase_key(key, namespace)\n full_key = full_key.lower()\n\n logger.debug('Searching %s for %s', self, full_key)\n\n # Build a map of lowercase -> actual key\n obj_keys = {\n item.lower(...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
///////////////// Checks
[ "private void checkColorIndex(int index) {\n if (index < 0 || index >= mColors.length) {\n throw new IllegalArgumentException(String.format(Locale.US, \"Index %d not valid\", index));\n }\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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Find .fastq files for each sample and move them to an appropriately named folder
[ "def movefastq(self):\n \"\"\"\"\"\"\n logging.info('Moving FASTQ files')\n # Iterate through each sample\n for sample in self.metadata.runmetadata.samples:\n # Retrieve the output directory\n outputdir = os.path.join(self.path, sample.name)\n # Find any ...
[ "def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Parse the output of 'df', building a list of results per FS volume. @param string $dfOutput @param string $appDir @param array $mountPaths @return array
[ "private function parseDf($dfOutput, $appDir, array $mountPaths)\n {\n $results = [];\n foreach (explode(\"\\n\", $dfOutput) as $i => $line) {\n if ($i === 0) {\n continue;\n }\n try {\n $path = $this->getDfColumn($line, 'path');\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 Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Return queue instances from specified queue names. All instances must use the same Redis connection.
[ "def get_queues(*queue_names, **kwargs):\n \n from .settings import QUEUES\n\n if len(queue_names) <= 1:\n # Return \"default\" queue if no queue name is specified\n # or one queue with specified name\n return [get_queue(*queue_names, **kwargs)]\n\n # will return more than one queue...
[ "def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne...
codesearchnet
{ "query": "Represent the post about AWS Route 53:", "pos": "Represent the code about AWS Route 53:", "neg": "Represent the code about AWS S3:" }
Region's World Factbook Entry. Returns ------- an :class:`ApiQuery` of str
[ "async def factbook(self, root):\n \n # This lib might have been a mistake, but the line below\n # definitely isn't.\n return html.unescape(html.unescape(root.find('FACTBOOK').text))" ]
[ "def usufyToCsvExport(d, fPath):\n \n\n from pyexcel_io import get_data\n try:\n oldData = {\"OSRFramework\": get_data(fPath) }\n except:\n # No information has been recovered\n oldData = {\"OSRFramework\":[]}\n\n # Generating the new tabular data.\n tabularData = _generateTab...
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Adds comment about the attribute (variable) that stores column values. @param string &$script @param Column $column
[ "protected function addColumnAttributeComment(&$script, Column $column)\n {\n if ($column->isTemporalType()) {\n $cptype = $this->getDateTimeClass($column);\n } else {\n $cptype = $column->getPhpType();\n }\n $clo = $column->getLowercasedName();\n\n $scrip...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// releaseProxyPort() decreases the use count and frees the port if no users remain // Must be called with proxyPortsMutex held!
[ "func (p *Proxy) releaseProxyPort(name string) error {\n\tpp := findProxyPort(name)\n\tif pp == nil {\n\t\treturn fmt.Errorf(\"Can't find proxy port %s\", name)\n\t}\n\tif pp.nRedirects == 0 {\n\t\treturn fmt.Errorf(\"Can't release proxy port: proxy %s on %d has refcount 0\", name, pp.proxyPort)\n\t}\n\n\tpp.nRedir...
[ "boolean setReplica( H2ONode h2o ) {\n assert _key.home(); // Only the HOME node for a key tracks replicas\n assert h2o != H2O.SELF; // Do not track self as a replica\n if( !read_lock() ) return false; // Write-locked; no new replications. Read fails to read *this* value\n // Narrow non-race here. ...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Function to extract the order and order items from the $ipnData
[ "public function extractOrder()\n {\n $this->order = new $this->clsIpnOrders;\n // First extract the actual order record itself\n foreach ($this->ipnData as $key=>$value) {\n // This is very simple: the order fields are any fields which do not end in a number\n // (beca...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
{@inheritDoc} @see java.sql.ResultSet#getString(java.lang.String)
[ "@Override\n\tpublic String getString(final String columnLabel) throws SQLException {\n\t\tString val = getWrapped().getString(columnLabel);\n\t\tif (this.cryptColumnNames.contains(CaseFormat.UPPER_SNAKE_CASE.convert(columnLabel))) {\n\t\t\treturn decode.apply(val);\n\t\t} else {\n\t\t\treturn val;\n\t\t}\n\t}" ]
[ "public void registerOutParameter(int parameterIndex, int sqlType, String typeName) {\n record(parameterIndex, getDeclaredMethod(CallableStatement.class, \"registerOutParameter\", int.class, int.class, int.class), parameterIndex, sqlType, typeName);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Gets and sets purifier configuration sets. @param string $configName @param string $config @throws \InvalidArgumentException @return \HTMLPurifier
[ "public static function config($configName, $config = null)\n {\n $_this = Purifier::getInstance();\n\n if (empty($config)) {\n if (!isset($_this->_configs[$configName])) {\n throw new \\InvalidArgumentException(sprintf('Purifier configuration `%s` does not exist!', $confi...
[ "protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
perform URL encoding <p> TODO: this whole thing is kinda crappy. @return
[ "private static String encodeUrlPart(final String part) throws UnsupportedEncodingException {\n //we need to go through and check part by part that a section does not need encoding\n\n int pos = 0;\n for (int i = 0; i < part.length(); ++i) {\n char c = part.charAt(i);\n if...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
validate transition from current to newClusterVersion is allowed
[ "private void validateClusterVersionChange(Version newClusterVersion) {\n if (!clusterVersion.isUnknown() && clusterVersion.getMajor() != newClusterVersion.getMajor()) {\n throw new IllegalArgumentException(\"Transition to requested version \" + newClusterVersion\n + \" not allo...
[ "@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 instruction about container management:", "pos": "Represent the Github code about container management:", "neg": "Represent the Github code about Programming:" }
Evaluate the result of executing the specified xpath syntax <code>select</code> expression on the specified document @param select @param document @return evaluated result
[ "public String evaluate(String select, Document document)\n throws ConfigurationException, XpathException {\n try {\n StringWriter writer = new StringWriter();\n StreamResult result = new StreamResult(writer);\n performTransform(getValueTransformation(select), document...
[ "public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }" ]
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Documentation:" }
保存到路径 @param modelFile @throws IOException
[ "public void save(String modelFile) throws IOException\n {\n DataOutputStream out = new DataOutputStream(new BufferedOutputStream(IOUtil.newOutputStream(modelFile)));\n save(out);\n out.close();\n }" ]
[ "public static SqlInfo getSqlInfoSimply(String nsAtZealotId, Object paramObj) {\n String[] arr = nsAtZealotId.split(ZealotConst.SP_AT);\n if (arr.length != LEN) {\n throw new ValidFailException(\"nsAtZealotId参数的值必须是xml文件中的 nameSpace + '@@' + zealotId 节点的值,\"\n + \"如:'stu...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software Development:" }
Get bugs that match this line in the Bug Suggestions artifact for this job.
[ "def unstructured_bugs(self):\n \n components = self._serialized_components()\n if not components:\n return []\n\n from treeherder.model.error_summary import get_useful_search_results\n job = Job.objects.get(guid=self.job_guid)\n rv = []\n ids_seen = set()...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
除去数组中的空值和签名参数 @param $para 签名参数组 return 去掉空值与签名参数后的新签名参数组
[ "public static function paraFilter($para)\n {\n $para_filter = array();\n while (list ($key, $val) = each($para)) {\n if (strtolower(trim($key)) === \"sign\" || trim($val) === \"\")\n continue;\n else\n $para_filter[$key] = $para[$key];\n }...
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about text processing:" }
Returns the current version string for a specified update channel. $channel must be set to one of the following values: - stable - beta - alpha - server @param string $channel @throws TeamSpeak3_Adapter_Update_Exception @return integer
[ "public function getVersion($channel = \"stable\")\r\n {\r\n switch($channel)\r\n {\r\n case \"stable\":\r\n return isset($this->version_strings[0]) ? $this->version_strings[0] : null;\r\n\r\n case \"beta\":\r\n return isset($this->version_strings[1]) ? $this->version_strings[1] : nul...
[ "public function setNotificationType($s) {\n if (is_string($s)){\n $this->options['Subscription.NotificationType'] = $s;\n $this->options['NotificationType'] = $s;\n } else {\n return false;\n }\n /*\n * List of valid Notification Types:\n ...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Error can be either of the following types: // // - InvalidObjectFault // - RuntimeFault
[ "func (service *VboxPortType) IStorageControllersetControllerType(request *IStorageControllersetControllerType) (*IStorageControllersetControllerTypeResponse, error) {\n\tresponse := new(IStorageControllersetControllerTypeResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\tretur...
[ "@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 description about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Updates parent and positiong properties of all records of current content type @param array $sorting array [recordId=>parentId]
[ "public function sortRecords(array $sorting)\n {\n $this->flushCacheBeforeChange();\n\n $result = parent::sortRecords($sorting);\n $this->flushCacheAfterChange();\n\n return $result;\n }" ]
[ "def search_prod_type_tags(self, ins, type, tags, pipeline):\n ''''''\n return StoredProduct(id=100, content='null.fits', tags={})" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Adds a parameter with multiple values to this upload request. @param paramName parameter name @param array values @return self instance
[ "public B addArrayParameter(final String paramName, final String... array) {\n for (String value : array) {\n httpParams.addParameter(paramName, value);\n }\n return self();\n }" ]
[ "@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 Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
@param $uri @param array $headers @return mixed|void
[ "public function get($uri,array $headers)\n {\n return $this->prepareRequest(self::GET,$uri,$headers,null);\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 PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
// ZAdd adds a score,member to a sorted set.
[ "func (m *Miniredis) ZAdd(k string, score float64, member string) (bool, error) {\n\treturn m.DB(m.selectedDB).ZAdd(k, score, member)\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// CheckpointList returns the checkpoints of the given container in the docker host
[ "func (cli *Client) CheckpointList(ctx context.Context, container string, options types.CheckpointListOptions) ([]types.Checkpoint, error) {\n\tvar checkpoints []types.Checkpoint\n\n\tquery := url.Values{}\n\tif options.CheckpointDir != \"\" {\n\t\tquery.Set(\"dir\", options.CheckpointDir)\n\t}\n\n\tresp, err := cl...
[ "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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Initializes the Engine
[ "private void init(SSLContextImpl ctx) {\n if (debug != null && Debug.isOn(\"ssl\")) {\n System.out.println(\"Using SSLEngineImpl.\");\n }\n\n sslContext = ctx;\n sess = SSLSessionImpl.nullSession;\n handshakeSession = null;\n\n /*\n * State is cs_START u...
[ "@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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
/* getNodeAndParentAngle Returns the _parent_ of the given node, also calculating its angle span.
[ "function(id){\n var theta = false;\n var n = this.graph.getNode(id);\n var ps = n.getParents();\n var p = (ps.length > 0)? ps[0] : false;\n if (p) {\n var posParent = p.pos.getc(), posChild = n.pos.getc();\n var newPos = posParent.add(posChild.scale(-1));\n theta = Math.atan2(newPos.y...
[ "function _detectPreciseCollisionsFromCollisions(collisions) {\n return collisions.filter(collision => {\n // TODO:\n // - Use temporal bisection with discrete sub-time steps to find time of collision (use\n // x-vs-y-specific intersection detection methods).\n // - Make sure the collision object...
codesearchnet
{ "query": "Represent the Github text about mathematics:", "pos": "Represent the Github code about mathematics:", "neg": "Represent the Github code about Computer Science:" }
Validate each field @returns {Boolean} true if all fields validate and required fields are not empty
[ "function() {\n var response = true;\n \n // Validate all the sub fields\n for (var i = 0 ; i < this.inputs.length ; i++) {\n \t var input = this.inputs[i];\n \t input.setClassFromState(); // update field classes (mark invalid fields...)\n \t var state = input.getState();\n \t if...
[ "function inflate(object) {\n // check if the object is an object and isn't empty\n if (is(object) && !empty(object)) {\n // create a new object for the result\n let result = {};\n\n // for each key in the object\n Object.keys(object).forEach((path) => {\n // get value from the object\n cons...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Returns user configuration from the repository. It will be stored in repository if it has not been stored yet. @param User $user @param AreaContract $area @return \Antares\Modules\TwoFactorAuth\Contracts\UserConfig
[ "protected function getUserConfig(User $user, AreaContract $area)\n {\n $provider = $this->twoFactorProvidersService->getEnabledInArea($area);\n $userConfig = $this->userConfigRepository->findByUserIdAndProviderId($user->id, $provider->getId());\n\n if ($userConfig) {\n return $...
[ "public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Define the primary key in the database. @param string $name The name of the column. @param string $type The datatype for the column. @return TableDef
[ "public function setPrimaryKey($name, $type = 'int') {\n $column = $this->createColumnDef($type, false);\n $column['autoIncrement'] = true;\n $column['primary'] = true;\n\n $this->columns[$name] = $column;\n\n // Add the pk index.\n $this->addIndex(Db::INDEX_PK, $name);\n\n...
[ "public static function insert(array $data)\n {\n $self = static::getInstance();\n\n $data = static::filterColumns($data);\n\n if (!\\count($data)) {\n throw new DbException(\n \"Invalid field names of table `{$self->name}`. Please check use of `insert()` method\"\n...
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Programming:" }
@author Vova Feldman (@svovaf) @since 2.0.0 @param int|null|bool $network_level_or_blog_id @param bool $flush
[ "function clear( $network_level_or_blog_id = null, $flush = false ) {\r\n if ( ! $this->_is_multisite ||\r\n false === $network_level_or_blog_id ||\r\n is_null( $network_level_or_blog_id ) ||\r\n is_numeric( $network_level_or_blog_id )\r\n ) {\r\...
[ "final protected function fc($k = null, $d = null) {return dfak(\n\t\t/** 2017-12-12 @todo Should we care of a custom `config_path` or not? https://mage2.pro/t/5148 */\n\t\tdf_config_field($this->getPath())->getData(), $k, $d\n\t);}" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Load the specified file, or the last opened file if None.
[ "def loadFile(self, filePath=None):\n \"\"\"\"\"\"\n self.resetState()\n self.canvas.setEnabled(False)\n if filePath is None:\n filePath = self.settings.get(SETTING_FILENAME)\n\n # Make sure that filePath is a regular python string, rather than QString\n filePath...
[ "def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt...
codesearchnet
{ "query": "Represent the Github sentence about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code:" }
// Close mocks base method
[ "func (m *MockUpgradeMachineSeriesAPI) Close() error {\n\tret := m.ctrl.Call(m, \"Close\")\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}" ]
[ "public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// NamedExec uses BindStruct to get a query executable by the driver and // then runs Exec on the result. Returns an error from the binding // or the query execution itself.
[ "func NamedExec(e Ext, query string, arg interface{}) (sql.Result, error) {\n\tq, args, err := bindNamedMapper(BindType(e.DriverName()), query, arg, mapperFor(e))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn e.Exec(q, args...)\n}" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
// SetMode sets the Mode field's value.
[ "func (s *DefaultRetention) SetMode(v string) *DefaultRetention {\n\ts.Mode = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Set the param. @param resource|string $video If string, sets the URL of the file. Pass a resource (e.g. fopen()) to upload the file.
[ "public function setVideoNote($video)\n\t{\n\t\tif (is_string($video)) {\n\t\t\t$this->videoNote = $video;\n\t\t} else if (is_resource($video)) {\n\t\t\t$this->addMultipart(\"video\", $video);\n\t\t\t$this->videoNote = \"attach://video\";\n\t\t} else if ($video instanceof InputFile) {\n\t\t\t$this->addMultipart(\"v...
[ "def handle_request_files_upload(request):\n \n # FILES is a dictionary in Django but Ajax Upload gives the uploaded file\n # an ID based on a random number, so it cannot be guessed here in the code.\n # Rather than editing Ajax Upload to pass the ID in the querystring,\n # note that each upload is a...
codesearchnet
{ "query": "Represent the Github text about File uploading:", "pos": "Represent the Github code about File uploading:", "neg": "Represent the Github code about Programming:" }
Save notebook as.
[ "def save_as(self, name=None, close=False):\r\n \"\"\"\"\"\"\r\n current_client = self.get_current_client()\r\n current_client.save()\r\n original_path = current_client.get_filename()\r\n if not name:\r\n original_name = osp.basename(original_path)\r\n else:\r\n ...
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Decorate expression text with a call to a guard function.
[ "function addGuard(guard, expr) {\n let safeExpr = null;\n if (!isWellFormed(expr)) {\n expr = '{/*Malformed Expression*/}';\n }\n needsRuntime = true;\n safeExpr = ` rt_${ unpredictableSuffix }.${ guard }(${ expr }) `;\n return safeExpr;\n }" ]
[ "def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Disable an existing domain @param string $domainName @return bool|int
[ "public function disableDomain(string $domainName)\n {\n $domainClassCode = $this->fileMan->loadDomainCode($domainName);\n\n $domainClassCode = str_replace(\n \"@SET\\DomainEnabled(true)\",\n \"@SET\\DomainEnabled(false)\",\n $domainClassCode\n );\n\n ...
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Create pcm volume controller. @function
[ "function gain(options) {\n\t// gain()\n\tif (options == null) options = {volume: 1};\n\n\t// gain(Function)\n\t// gain(Number)\n\telse if (typeof options === 'function' || typeof options === 'number') options = {volume: options};\n\n\tvar volume;\n\tif (options.mode === 'tan') {\n\t\tvolume = Math.tan(options.vol...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
An attribute directive which displays a popup for this element.
[ "function SemanticPopup(SemanticPopupLink)\n {\n return {\n\n restrict: 'A',\n\n scope: {\n /* Required */\n smPopup: '=',\n /* Optional */\n smPopupTitle: '=',\n smPopupHtml: '=',\n smPopupPosition: '@',\n smPopupVariation: '@',\n smPopupSetting...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
解析字符串生成 Task 对象 @param string $json @return \Ws\Http\Automated\Task
[ "public static function parse($json)\r\n\t{\r\n\t\t// 验证json格式\r\n\r\n\t\t$params = json_decode($json, true);\r\n\r\n\t\t$obj = new Task();\r\n\t\t$obj->id = $params['id'];\r\n\t\t$obj->name = $params['name'];\r\n\t\t$obj->type = (int) $params['type'];\r\n\t\t$obj->body = TaskBody::parse($params['body']);\r\n\r\n\t...
[ "def get(self):\n ''''''\n request = TOPRequest('xxxxx.xxxxx.campaign.areaoptions.get')\n self.create(self.execute(request), fields=['success','result'], models={'result':AreaOption})\n return self.result" ]
codesearchnet
{ "query": "Represent the comment about PHP:", "pos": "Represent the code about PHP:", "neg": "Represent the code:" }
Calculates CRC from an int
[ "public static int generateInt32(int crc, int value)\n {\n crc = next(crc, (value >> 24));\n crc = next(crc, (value >> 16));\n crc = next(crc, (value >> 8));\n crc = next(crc, (value >> 0));\n\n return crc;\n }" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Return all published messages that have yet to be acked, nacked, or returned. :return: [(int, Published)]
[ "def pending_confirmations(self):\n \n return sorted([(idx, msg)\n for idx, msg in enumerate(self.published_messages)\n if not msg.future.done()],\n key=lambda x: x[1].delivery_tag)" ]
[ "def request_raw_reverse(self, req, msg):\n \n # msg is a katcp.Message.request object\n reversed_args = msg.arguments[::-1]\n # req.make_reply() makes a katcp.Message.reply using the correct request\n # name and message ID\n return req.make_reply(*reversed_args)" ]
codesearchnet
{ "query": "Represent the sentence about Messaging:", "pos": "Represent the code about Messaging:", "neg": "Represent the code about Software development:" }
Get DBInstance database version. @return array
[ "public function getServerVersion()\n {\n $di = new DBInstance($this->rawConfig);\n $version = $di->getServerVersion();\n unset($di);\n\n return array(\n 'version' => $version,\n );\n }" ]
[ "def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])" ]
codesearchnet
{ "query": "Represent the Github comment about database:", "pos": "Represent the Github code about database:", "neg": "Represent the Github code:" }
Pass report file on to admin users
[ "public static function enable_direct_download() {\n global $pagenow;\n\n // This check fires on every page load, so keep the scope small\n if ( $pagenow === 'tools.php' && isset( $_GET['report'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification.NoNonceVerification\n\n // Next check if the reques...
[ "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:" }
Use service discovery to get the host zone name from the default stack :return: Host zone name as string
[ "def _retrieve_stack_host_zone_name(awsclient, default_stack_name=None):\n \n global _host_zone_name\n\n if _host_zone_name is not None:\n return _host_zone_name\n\n env = get_env()\n\n if env is None:\n print(\"Please set environment...\")\n # TODO: why is there a sys.exit in li...
[ "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 post about AWS Route 53:", "pos": "Represent the code about AWS Route 53:", "neg": "Represent the code about Technology:" }
Execute the chain. @param array $args @return mixed
[ "public function run(array $args) {\n\t\tforeach($this->calls as $call) {\n\t\t\tif($call instanceof \\SuperClosure\\SerializableClosure)\n\t\t\t\t$call = $call->getClosure();\n\t\t\t$res = call_user_func_array($call, array_merge([$this], $args));\n\t\t\t$this->executed++;\n\t\t\tif($res !== null)\n\t\t\t\treturn $...
[ "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:" }
@param string $class @param string $property @return string
[ "public static function reflectClassProperty($class, $property, $output = true)\n {\n $data = '';\n\n $reflectionClass = new \\ReflectionClass($class);\n $reflectionProperty = new \\ReflectionProperty($class, $property);\n\n $defaultPropertyValues = $reflectionClass->getDefaultProp...
[ "static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Remove respective core element of handed transition model :param TransitionModel model: Transition model which core element should be removed :return:
[ "def remove_core_element(self, model):\n \n assert model.transition.parent is self.model.state or model.transition.parent is self.model.parent.state\n gui_helper_state_machine.delete_core_element_of_model(model)" ]
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
2016-07-18 @used-by responseF() @used-by responseL() @uses df_first() @uses df_last() @param string[] ...$k @return Ev|string|null
[ "private function response(...$k) {\n\t\t$ev = dfc($this, function($f) {return\n \t\t\tcall_user_func($f, $this->responses())\n\t\t;}, [dfa(['L' => 'df_last', 'F' => 'df_first'], substr(df_caller_f(), -1))]); /** @var Ev|null $ev */\n\t\treturn/** @var int $c */!($c = count($k)) || !$ev ? $ev : $ev->r(1 < $c ? $k :...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// GTE computes x >= y.
[ "func (as ArraySpec) GTE(val Input) Input {\n\treturn as.proc(func(i Input) Input {\n\t\treturn i.GTE(val)\n\t})\n}" ]
[ "def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Natural Language Processing:" }
Add an attribute to the element
[ "def attr(self, *args, **kwargs):\n \"\"\"\"\"\"\n kwargs.update({k: bool for k in args})\n for key, value in kwargs.items():\n if key == \"klass\":\n self.attrs[\"klass\"].update(value.split())\n elif key == \"style\":\n if isinstance(value, ...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Inspired by <http://code.seebz.net/p/minify-js/>
[ "public static function minify($input)\n {\n $output = '';\n $input = self::merge($input);\n\n $inQuotes = array();\n $noSpacesAround = '{}()[]<>|&!?:;,+-*/=\"\\'';\n\n $input = preg_replace(\"`(\\r\\n|\\r)`\", \"\\n\", $input);\n $inputs = str_split($input);\n ...
[ "function(inlines) {\n var m;\n var dest;\n if ((m = this.match(/^<([a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/))) { // email autolink\n dest = m.slice(1,-1);\n inlines.push({ t: 'Link', label: [{ t: 'Str', c: des...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
flow for subscription.
[ "public void onInfiniteGasButtonClicked(View arg0) {\n if (setupDone == null) {\n complain(\"Billing Setup is not completed yet\");\n return;\n }\n\n if (!setupDone) {\n complain(\"Billing Setup failed\");\n return;\n }\n\n if (!mHelper....
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Traverse all target elements and address presentational corrections if any two of them are adjacent to each other.
[ "function( context, target ) {\n var $$target = $.qsa( target || 'u, ins', context )\n var i = $$target.length\n\n traverse: while ( i-- ) {\n var $this = $$target[ i ]\n var $prev = null\n\n // Ignore all `<wbr>` and comments in between,\n // and add class `.adjacent` once two targets\...
[ "function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element i...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Prepends one or more items to the include path of the class loader and the php include path. @param mixed $items Path or paths as string or array
[ "public function includePaths($path)\n\t{\n\t\t$paths = is_array($path) ? $path : array($path);\n\t\t$this->_paths = array_merge($paths,$this->_paths);\n\t\treturn $this;\n\t}" ]
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Returns collection name used by this fixture. @return array|string related collection name
[ "protected function getCollectionName()\n {\n if ($this->collectionName) {\n return $this->collectionName;\n }\n\n /* @var $modelClass ActiveRecord */\n $modelClass = $this->modelClass;\n return $modelClass::collectionName();\n }" ]
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software Development:" }
Returns a list of packages to be scanned for resources and components @return
[ "@Override\n public List<String> getPackages() {\n List<String> list = new ArrayList<>();\n\n Consumer<JsonArray> reader = array -> {\n if ((array != null && !array.isEmpty())) {\n for (int i = 0; i < array.size(); i++) {\n list.add(array.getString(i));\...
[ "def determine_target_roots(self, goal_name):\n \n if not self.context.target_roots:\n print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.stderr)\n\n # For the v2 path, e.g. `./pants list` is a functional no-op. This matches the v2 mode behavior\n # of e.g. `./pants ...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Formats the target and applies to texts of annotations @param target - the array of texts to be formatted @returns string - the formatted text
[ "function (target) {\n\t\t\tvar result = \"\";\n\n\t\t\tif (target) {\n\t\t\t\ttarget.forEach(function (element) {\n\t\t\t\t\tresult += element + '<br>';\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tresult = this._preProcessLinksInTextBlock(result);\n\t\t\treturn result;\n\t\t}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// GetChaincodeCodePackage gets the code package bytes for a chaincode given // the name and version. It first searches through the persisted // ChaincodeInstallPackages and then falls back to searching for // ChaincodeDeploymentSpecs
[ "func (p *PackageProvider) GetChaincodeCodePackage(name, version string) ([]byte, error) {\n\tcodePackage, err := p.getCodePackageFromStore(name, version)\n\tif err == nil {\n\t\treturn codePackage, nil\n\t}\n\tif _, ok := err.(*CodePackageNotFoundErr); !ok {\n\t\t// return the error if the hash cannot be retrieved...
[ "func validateChaincodeProposalMessage(prop *pb.Proposal, hdr *common.Header) (*pb.ChaincodeHeaderExtension, error) {\n\tif prop == nil || hdr == nil {\n\t\treturn nil, errors.New(\"nil arguments\")\n\t}\n\n\tputilsLogger.Debugf(\"validateChaincodeProposalMessage starts for proposal %p, header %p\", prop, hdr)\n\n\...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns Ring set based on Hanser Ring Finding method @param molecule @return report collected the rings @see org.openscience.cdk.smsd.ring.RingFinder#getRingSet(org.openscience.cdk.interfaces.IAtomContainer)
[ "@Override\n public IRingSet getRingSet(IAtomContainer molecule) throws CDKException {\n\n Collection<List<IAtom>> cycles = findRings(molecule);\n\n IRingSet ringSet = molecule.getBuilder().newInstance(IRingSet.class);\n\n for (List<IAtom> ringAtoms : cycles) {\n IRing ring = mole...
[ "public Structure getStructureForCathDomain(StructureName structureName) throws IOException, StructureException {\n\t\treturn getStructureForCathDomain(structureName, CathFactory.getCathDatabase());\n\t}" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Computes the minimum for each pixel across all bands in the {@link Planar} image. @param input Planar image @param output Gray scale image containing minimum pixel values
[ "public static void minimum(Planar<GrayF64> input, GrayF64 output) {\n\t\toutput.reshape(input.width,input.height);\n\t\tif (BoofConcurrency.USE_CONCURRENT) {\n\t\t\tImplImageBandMath_MT.minimum(input, output, 0, input.getNumBands() - 1);\n\t\t} else {\n\t\t\tImplImageBandMath.minimum(input, output, 0, input.getNum...
[ "@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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Extracts size, precision and scale information from column's DB type. @param string $dbType the column's DB type
[ "protected function extractLimit($dbType)\n\t{\n\t\tif (strncmp($dbType, 'enum', 4)===0 && preg_match('/\\(([\\'\"])(.*)\\\\1\\)/',$dbType,$matches))\n\t\t{\n\t\t\t// explode by (single or double) quote and comma (ENUM values may contain commas)\n\t\t\t$values = explode($matches[1].','.$matches[1], $matches[2]);\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:" }
// Valid checks if the resource type is a member of the ResourceType enum.
[ "func (t ResourceType) Valid() (err error) {\n\tswitch t {\n\tcase AuthorizationsResourceType: // 0\n\tcase BucketsResourceType: // 1\n\tcase DashboardsResourceType: // 2\n\tcase OrgsResourceType: // 3\n\tcase TasksResourceType: // 4\n\tcase TelegrafsResourceType: // 5\n\tcase SourcesResourceType: // 6\n\tcase User...
[ "@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:" }
Created by Tivie on 13-07-2015.
[ "function getDefaultOpts(simple) {\n 'use strict';\n\n var defaultOptions = {\n omitExtraWLInCodeBlocks: {\n defaultValue: false,\n describe: 'Omit the default extra whiteline added to code blocks',\n type: 'boolean'\n },\n noHeaderId: {\n defaultValue: false,\n describe: 'Turn o...
[ "def new_station(self, _id, callSign, name, affiliate, fccChannelNumber):\n \"\"\"\"\"\"\n\n if self.__v_station:\n # [Station: 11440, WFLX, WFLX, Fox Affiliate, 29]\n # [Station: 11836, WSCV, WSCV, TELEMUNDO (HBC) Affiliate, 51]\n # [Station: 11867, TBS, Turner Broadc...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Computes a basis (the principle components) from the most dominant eigenvectors.
[ "public void computeBasis() {\r\n\t\tif (sampleIndex != numSamples)\r\n\t\t\tthrow new IllegalArgumentException(\"Not all the data has been added\");\r\n\t\tif (numComponents > numSamples)\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"More data needed to compute the desired number of components\");\r\...
[ "def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Natural Language Processing:" }
Implemented for backwards compatibility only. Returns the creation context. @deprecated since 3.0.0. The creation context should be passed during instantiation instead. @param ContainerInterface $container @return void
[ "public function setServiceLocator(ContainerInterface $container)\n {\n trigger_error(sprintf(\n 'Usage of %s is deprecated since v3.0.0; please pass the container to the constructor instead',\n __METHOD__\n ), E_USER_DEPRECATED);\n $this->creationContext = $container;\...
[ "protected function processConfig(array $config)\n {\n // set defaults as an array if not provided\n if (!isset($config['defaults'])) {\n $config['defaults'] = [];\n }\n\n // Add the handlers based on the configuration option\n $stack = $this->getHandlerStack();\n\n ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }