query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// NewLogger returns a new Logger filled with given Receivers
[ "func NewLogger(recs ...*Receiver) *Logger {\n\tl := &Logger{\n\t\tActive: true, // Every logger is active by default\n\t\tReceivers: recs,\n\t}\n\treturn l\n}" ]
[ "func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Computer Science:" }
// NewNetClassCollector returns a new Collector exposing network class stats.
[ "func NewNetClassCollector() (Collector, error) {\n\tfs, err := sysfs.NewFS(*sysPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to open sysfs: %v\", err)\n\t}\n\tpattern := regexp.MustCompile(*netclassIgnoredDevices)\n\treturn &netClassCollector{\n\t\tfs: fs,\n\t\tsubsystem: ...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
@param WP_Error $pError @throws Freemius_Exception
[ "private static function ThrowWPRemoteException( WP_Error $pError ) {\r\n\t\t\tif ( self::IsCurlError( $pError ) ) {\r\n\t\t\t\t$message = $pError->get_error_message( 'http_request_failed' );\r\n\r\n\t\t\t\t#region Check if there are any missing cURL methods.\r\n\r\n\t\t\t\t$curl_required_methods = array(\r\n\t\t\t...
[ "public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Main method. @param args the main arguments.
[ "public static void main(String[] args) {\n\n // WARNING: Be careful before you set sampler value to always sample, especially in\n // production environment. Trace data is often very large in size and is expensive to\n // collect. This is why rather than collecting traces for every request(i.e. alwaysSamp...
[ "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 programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Makes a ``HEAD`` requests to the URI. :returns: ``True`` if status code is 2xx.
[ "def dir_exists(self):\n \n\n r = requests.request(self.method if self.method else 'HEAD', self.url, **self.storage_args)\n try: r.raise_for_status()\n except Exception: return False\n\n return True" ]
[ "def delete_mockdata_url(service_name, implementation_name,\n url, headers,\n dir_base=dirname(__file__)):\n \n # Http response code 204 No Content:\n # The server has fulfilled the request but does not need to\n # return an entity-body\n response = MockH...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Returns the cached relations for a given parent model. @param $model @return array
[ "public static function all($parent)\n {\n is_eloquent_object($parent, true);\n $cache = static::getCache();\n if (isset($cache[$parent])) {\n return $cache[$parent];\n }\n\n return [];\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 sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Loads a resource. @param mixed $resource The resource @param string $type The resource type @return RouteCollection @throws \RuntimeException Loader is added twice
[ "public function load($resource, $type = null)\n {\n if ($this->loaded) {\n throw new \\RuntimeException('Do not add this loader twice');\n }\n\n $collection = new RouteCollection();\n\n foreach ($this->container->getParameter('smart_core_cms.modules') as $moduleName => $mo...
[ "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 Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Process "parameter" type argument @param Element $arg @return stdClass @throws InvalidConfig
[ "protected function processArgumentParameter(Element $arg) {\n\t\t$definition = new stdClass();\n\t\t$definition->type = 'parameter';\n\t\t\n\t\tif (! isset($arg->name)) {\n\t\t\tthrow new InvalidConfig('Definition of an argument type \"paramater\" must contain the \"name\" attribute', null, null, $arg);\n\t\t}\n\t...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code:" }
// IsError returns true if this response seems to indicate an error.
[ "func (r *Response) IsError() bool {\n\treturn r != nil && r.Data != nil && len(r.Data) == 1 && r.Data[\"error\"] != nil\n}" ]
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the sentence about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code about programming:" }
Updates the chart layout unless a plugin returns `false` to the `beforeLayout` hook, in which case, plugins will not be called on `afterLayout`. @private
[ "function() {\n\t\tvar me = this;\n\n\t\tif (plugins.notify(me, 'beforeLayout') === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tlayouts.update(this, this.width, this.height);\n\n\t\t/**\n\t\t * Provided for backward compatibility, use `afterLayout` instead.\n\t\t * @method IPlugin#afterScaleUpdate\n\t\t * @deprecated sin...
[ "function (renderer, nodeName) {\n\t\tvar wrapper = this;\n\t\twrapper.element = nodeName === 'span' ?\n\t\t\tcreateElement(nodeName) :\n\t\t\tdoc.createElementNS(SVG_NS, nodeName);\n\t\twrapper.renderer = renderer;\n\t\t/**\n\t\t * A collection of attribute setters. These methods, if defined, are called right befo...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Write the <a:gsLst> element.
[ "def write_a_gs_lst(gradient)\n positions = gradient[:positions]\n colors = gradient[:colors]\n\n @writer.tag_elements('a:gsLst') do\n (0..colors.size-1).each do |i|\n pos = (positions[i] * 1000).to_i\n\n attributes = [ ['pos', pos] ]\n @writer.tag_elements('a:gs'...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Retrieves the title of the embed url @param - $url: the url of the "player" @return - string @todo - do some real world testing.
[ "public function getTitle($url) {\n return Template::raw(VideoEmbedder::$plugin->service->getInfo($url)->title);\n }" ]
[ "def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
Serialize to hash @return [Hash{String => String}]
[ "def to_hash\n hash = {}\n\n hash['scale'] = \"#{scale}x\" unless scale.nil?\n\n (KNOWN_KEYS - [:scale]).each do |key|\n value = self.send(key)\n hash[key.to_s.dasherize] = value.to_s unless value.nil?\n end\n\n attributes.each do |key, value|\n hash[key.to_s] = value\n...
[ "func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
[ "func (in *UpdateOptions) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}" ]
[ "function customizer(destination, source) {\n // If we're not working with a plain object, copy the value as is\n // If source is an array, for instance, it will replace destination\n if (!isPlain(source)) {\n return source;\n }\n\n // If the new value is a plain object but the first object value is not\n ...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Redirects to another resource @param string $module @param string|null $controller @param string|null $action @param array $params @param string $hash
[ "final protected function redirect($module, $controller = null, $action = null, array $params = array(), $hash = null) {\n header('Location: ' . $this->view->url($module, $controller, $action, $params, $hash));\n exit;\n }" ]
[ "public function LinkingMode()\n {\n /** @var Page_Controller $controller */\n $controller = Controller::curr();\n $params = $controller->getURLParams();\n\n return $params['ID'] === $this->URLSegment ? 'current' : 'link';\n }" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about text processing:" }
Separates given string in key value parts. @param string $body @return array
[ "public function parseNewLineSeparatedBody($body)\n {\n $data = array();\n\n if (!$body) {\n return $data;\n }\n\n $parts = preg_split(\"/\\\\r?\\\\n/\", $body);\n foreach ($parts as $str) {\n if (!$str) {\n continue;\n }\n\n ...
[ "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 Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Documentation:" }
// Bytes returns the bytes
[ "func (m *Message) Bytes() []byte {\n\tif m.FPort == 0 && len(m.Payload) > 0 {\n\t\tm.FPort = 1\n\t}\n\tmacPayload := &lorawan.MACPayload{}\n\tmacPayload.FHDR = lorawan.FHDR{\n\t\tDevAddr: lorawan.DevAddr(m.devAddr),\n\t\tFCnt: uint32(m.FCnt),\n\t\tFCtrl: lorawan.FCtrl{\n\t\t\tACK: m.ack,\n\t\t},\n\t}\n\tmacPayl...
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Set the project's vendor directory, relative to `$this->_root_dir` @param string $path @return self @throws \InvalidArgumentException if the path doesn't exist
[ "public function setVendorDirectory($path)\n {\n $realpath = $this->getFullPath($path, null, true);\n if (@file_exists($realpath) && is_dir($realpath)) {\n $this->_vendor_dir = $path;\n } else {\n throw new InvalidArgumentException(\n sprintf('Vendor dire...
[ "public function validate(&$msg = null)\n {\n if ($this->frame instanceof ModificationSetInterface) {\n return true;\n }\n throw new MalformedConfigException($this->getName().\n ' must be inside of a \"modificationset\".');\n }" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *CreateCustomKeyStoreInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateCustomKeyStoreInput\"}\n\tif s.CloudHsmClusterId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"CloudHsmClusterId\"))\n\t}\n\tif s.CloudHsmClusterId != nil && len(*s.CloudHsmClusterId...
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Handles [[Widget::EVENT_BEFORE_RUN]] event, registering related client script. @param \yii\base\Event $event event instance.
[ "public function beforeRun($event)\n {\n $id = $this->owner->options['id'];\n $options = Json::htmlEncode($this->getClientOptions());\n $view = $this->owner->getView();\n GridViewAsset::register($view);\n $view->registerJs(\"jQuery('#$id').yiiGridView($options);\");\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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
@typedef {import('minimist').ParsedArgs} ParsedArgs @param {ParsedArgs} cliArgs @param {{ jsFlags: () => string }} nodeCachedDataDir
[ "function configureCommandlineSwitches(cliArgs, nodeCachedDataDir) {\n\n\t// Force pre-Chrome-60 color profile handling (for https://github.com/Microsoft/vscode/issues/51791)\n\tapp.commandLine.appendSwitch('disable-color-correct-rendering');\n\n\t// Support JS Flags\n\tconst jsFlags = resolveJSFlags(cliArgs, nodeC...
[ "function loadAndDescribeModuleInCwd() {\n// Hack: Trick node into changing process.mainScript to moduleToDebug\n moduleToDebug = Module._load(location, module, true);\n\n var sample = getSampleCommand();\n sampleLine = util.format('You can access your module as `m`%s.', sample);\n\n prompt = getModuleName() + ...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
TODO @return array
[ "public static function getArray()\n {\n $var = new Vars();\n $list = array();\n foreach ($var->get_all()->getModels() as $item) {\n $list[$item->key] = $item->value;\n }\n return $list;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github summarization about software development:", "pos": "Represent the Github code about software development:", "neg": "Represent the Github code:" }
Rename a job @param oldJobName existing job name. @param newJobName The new job name. @param crumbFlag <code>true</code> to add <b>crumbIssuer</b> <code>false</code> otherwise. @throws IOException In case of a failure.
[ "public JenkinsServer renameJob(String oldJobName, String newJobName, Boolean crumbFlag) throws IOException {\n renameJob(null, oldJobName, newJobName, crumbFlag);\n return this;\n }" ]
[ "def start_session(self, b_hold_session, sig_doc_xml=None, datafile=None):\n \n response = self.__invoke('StartSession', {\n 'bHoldSession': b_hold_session,\n 'SigDocXML': sig_doc_xml or SkipValue,\n 'datafile': datafile or SkipValue,\n\n # This parameter is...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Zero-extends a word to a larger width. It is an error to specify a smaller width (use ``extract`` instead to crop off the extra bits).
[ "def zext(self, width):\n \n width = operator.index(width)\n if width < self._width:\n raise ValueError('zero extending to a smaller width')\n return BinWord(width, self._val)" ]
[ "def signed_mult(a, b):\n \n a, b = as_wires(a), as_wires(b)\n final_len = len(a) + len(b)\n # sign extend both inputs to the final target length\n a, b = a.sign_extended(final_len), b.sign_extended(final_len)\n # the result is the multiplication of both, but truncated\n # TODO: this may make e...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
add one or more users to a particular role TODO should this work with multiple roles? @param usernames {string or string array} - list of names of users @param rolename {string} - the name of the role that the users should be added to
[ "function(usernames, rolename) {\n if (_.isEmpty(usernames)) {\n return Promise.reject(new Error('One or more usernames must be provided'));\n }\n\n if (!_.isArray(usernames)) {\n usernames = [usernames];\n }\n\n return Role.findOne({\n name: rolename\n }).populate('users').then(fun...
[ "def any_listname_of(resource)\n if resource::LIST_NAME.kind_of?(Array)\n resource::LIST_NAME.first # If is an array, any listname can be use\n else\n resource::LIST_NAME # If is not an array, just return the listname of resource\n end\n end" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
// AddDatapoints forwards points and will log any errors forwarding, but only one per LogThrottle // duration
[ "func (e *RateLimitErrorLogging) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint, next Sink) error {\n\terr := next.AddDatapoints(ctx, points)\n\te.throttleLog(err)\n\treturn err\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
configures this loader with a stream @param is stream used to read the configuration @throws IOException if reading or parsing the contents of the stream fails
[ "public void configure(InputStream is) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n int lineNumber = 0;\n\n while (true) {\n String line = reader.readLine();\n if (line == null) break;\n\n line = line.trim();\n ...
[ "private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n // Get default form\n in.defaultReadObject();\n\n // Create new Archive\n final String name = this.name;\n final ZipImporter archive = ShrinkWrap.create(ZipImporter.class, name);\n\...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Return the table identifier in the best fit depending on database type @param requestedTable Catalog and schema used @param tableName Table without quotes @param isH2 True if H2, false if PostGRES @return Find table identifier
[ "public static String caseIdentifier(TableLocation requestedTable, String tableName, boolean isH2) {\n return new TableLocation(requestedTable.getCatalog(), requestedTable.getSchema(),\n TableLocation.parse(tableName, isH2).getTable()).toString();\n }" ]
[ "def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about AWS Auto Scaling:" }
// ListImages is defined on the Storage interface.
[ "func (s *imageStorage) ListImages(filter ImageFilter) ([]*Metadata, error) {\n\tmetadataDocs, err := s.listImageMetadataDocs(s.modelUUID, filter.Kind, filter.Series, filter.Arch)\n\tif err != nil {\n\t\treturn nil, errors.Annotate(err, \"cannot list image metadata\")\n\t}\n\tresult := make([]*Metadata, len(metadat...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
@param string $path @param string $baseNamespace @param string $baseLocation @return array
[ "protected function extractNamespaceClasses($path, $baseNamespace, $baseLocation)\n {\n $classes = [];\n $finder = new Finder();\n foreach ($finder->in($path)->name('/.php$/')->getIterator() as $file) {\n $className = preg_replace('/.php$/', null, $file->getFilename());\n ...
[ "protected static function parseMethodExec($data = null){\n self::$input = AnnotationFun::replaceMethodStr(self::$body , AnnotationFun::createClosure(self::$body , self::$argv['methodName'], $data) , self::$input);\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about PHP:" }
Highlight inline changes in both lines.
[ "def _highlight_line_udiff(self, line, next):\n \n start = 0\n limit = min(len(line['line']), len(next['line']))\n while start < limit and line['line'][start] == next['line'][start]:\n start += 1\n end = -1\n limit -= start\n while -end <= limit and line['...
[ "protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Data synchronization:" }
// GetUintKey retrieves an element from the map under given integer key.
[ "func (m *HashMap) GetUintKey(key uintptr) (value interface{}, ok bool) {\n\t// inline getUintptrHash()\n\tbh := reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(&key)),\n\t\tLen: intSizeBytes,\n\t\tCap: intSizeBytes,\n\t}\n\tbuf := *(*[]byte)(unsafe.Pointer(&bh))\n\th := uintptr(siphash.Hash(sipHashKey1, s...
[ "@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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// TotalPlainSizeEstimate returns an estimate of the plaintext size of // this directory block.
[ "func (db *DirBlock) TotalPlainSizeEstimate(\n\tplainSize int, bsplit BlockSplitter) int {\n\tif !db.IsIndirect() || len(db.IPtrs) == 0 {\n\t\treturn plainSize\n\t}\n\n\t// If the top block is indirect, it's too costly to estimate the\n\t// sizes by checking the plain sizes of all the leafs. Instead\n\t// use the ...
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the sentence about File management:", "pos": "Represent the code about File management:", "neg": "Represent the code:" }
Generates API documentation @return void
[ "public function apiGenerate()\n {\n $paths = $this->getPaths();\n $this->stopOnFail(true);\n $this->info('Generating API documentation');\n $this->taskExec(sprintf('%s/sami', $paths['bin']))\n ->arg('update')\n ->arg(sprintf('%s/sami.php', $paths['build']))\n ...
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope...
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
将rootClass注入选择器中
[ "function _injectRootClass(selector, rootClass) {\n // 如果是page开头的选择器则注入到page之后,否则注入到开头\n if (selector.startsWith('page ')) {\n return selector.replace('page', `page .${rootClass}`);\n } else {\n return `.${rootClass} ${selector}`;\n }\n}" ]
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Refill item field from source. @param Item $item @param string $field @return Item
[ "public function refill(Item $item, $field)\n {\n $url = $this->getSourceForFill($item);\n if (!$url || !preg_match(Filler::REG_ITEM_ID, $url, $match)) {\n return $item;\n }\n\n // get data\n $body = $this->browser->get('anime', ['aid' => $match['id']]);\n\n s...
[ "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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Creates a new template of a given type @param string $type @return mixed
[ "protected function createTemplate($type)\n {\n $class = $this->resolveTypeClassName($type);\n\n if (!($template = $class::inTheme($this->theme))) {\n throw new ApplicationException(trans('cms::lang.template.not_found'));\n }\n\n return $template;\n }" ]
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github description about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about File management:" }
The CheckBox click function and wait for object to load
[ "public void click(String locator) {\n getDispatcher().beforeClick(this, locator);\n \n click();\n validatePresenceOfAlert();\n WebDriverWaitUtils.waitUntilElementIsPresent(locator);\n \n getDispatcher().afterClick(this, locator);\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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
returns 0 if it doesn't correspond to an uploaded container -1 if it corresponds to an uploaded container but it is corrupted 1 if it corresponds to an uploaded container and is OK
[ "def is_uploaded_container(self, msg_info):\n \n results = {\n 'BAD': -1,\n 'NOT_FCB': 0,\n 'OK': 1\n }\n\n for part in msg_info.msg_body.walk():\n if part.is_multipart():\n continue\n\n \"\"\"\n if part.get...
[ "boolean isNameUnique(String name, String currentJobName) {\n Item item = getItem(name);\n\n if(null==item) {\n // the candidate name didn't return any items so the name is unique\n return true;\n }\n else if(item.getName().equals(currentJobName)) {\n // ...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// IngressRules is specified on the environ.Firewaller interface.
[ "func (f Firewall) IngressRules(ctx context.ProviderCallContext) ([]network.IngressRule, error) {\n\treturn f.GlobalIngressRules(ctx)\n}" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
@param array $params @return mixed|null
[ "public function queueDeclare(array $params)\n {\n list(\n $queue,\n $passive,\n $durable,\n $exclusive,\n $auto_delete,\n $nowait,\n $arguments,\n $ticket\n ) = $params;\n\n return parent::queue_decl...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the post about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
@param Frame $frame @return bool
[ "public function frame_exists_in_cellmap(Frame $frame)\n {\n $key = $frame->get_id();\n\n return isset($this->_frames[$key]);\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:" }
// NewQbsStoreFromDSN creates a *QbsStore from a DSN; DSNs can be created // directly with ParamsToDSN or from the environment with GetDSNOrDie, via // the DATABASE_URL environment var.
[ "func NewQbsStoreFromDSN(dsn *qbs.DataSourceName) *QbsStore {\n\tqbs.RegisterWithDataSourceName(dsn)\n\tresult := &QbsStore{\n\t\tDsn: dsn,\n\t\tPolicy: NewQbsDefaultOrmTransactionPolicy(),\n\t}\n\treturn result\n}" ]
[ "func (f *Factory) BindFlags(flags *pflag.FlagSet) {\n\t// any flags defined by external projects (not part of pflags)\n\tflags.AddGoFlagSet(flag.CommandLine)\n\n\t// Merge factory's flags\n\tflags.AddFlagSet(f.flags)\n\n\t// Globally persistent flags across all subcommands.\n\t// TODO Change flag names to consts t...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetAsn sets the Asn field's value.
[ "func (s *VirtualInterface) SetAsn(v int64) *VirtualInterface {\n\ts.Asn = &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 summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Put `func` with `args` and `kwargs` in `self.flow_func` for later.
[ "def coord(self, func:CoordFunc, *args, **kwargs)->'ImagePoints':\n \"\"\n if 'invert' in kwargs: kwargs['invert'] = True\n else: warn(f\"{func.__name__} isn't implemented for {self.__class__}.\")\n self.flow_func.append(partial(func, *args, **kwargs))\n return self" ]
[ "def _get_target(self):\n \n if None in [self._func, self._func_kwargs, self._func_kwargs, self._every_kwargs]:\n raise ValueError('You must call the .every() and .run() methods on every tab.')\n return self._loop" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get stub templates. @return string
[ "public function getStub()\n {\n $parser = $this->getNameParser();\n\n if ($this->existing) {\n $this->name = 'create_'.str_plural($this->name).'_table';\n \n $parser = $this->getNameParser();\n \n $fields = (new TableDumper($parser->getTab...
[ "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:" }
Description: Get remote button list Returns an list of all available remote buttons
[ "def get_remote_button_list(self):\n \n remote_buttons = []\n for key in self.command['remote']:\n if self.command['remote'][key] != '':\n remote_buttons.append(key)\n return remote_buttons" ]
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Technology:" }
Explicitly drop this pointer. The memory will be deallocated via the drop_ffi_call_fn passed to the constructor.
[ "def drop(self):\n \n if self._ptr:\n LIBRARY.call(self._drop_ffi_fn, self._ptr)\n self._ptr = None" ]
[ "def _handle_byref_decl(self, node, scope, ctxt, stream):\n \n self._dlog(\"handling byref decl\")\n field = self._handle_node(node.type.type, scope, ctxt, stream)\n\n # this will not really be used (maybe except for introspection)\n # with byref function params\n # see iss...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about writing:" }
Specific setter for the 'default_options' option (with some additional tests) @param array $options Associative array @throws Zend_Cache_Exception @return void
[ "protected function _setDefaultOptions($options)\n {\n if (!is_array($options)) {\n Zend_Cache::throwException('default_options must be an array !');\n }\n foreach ($options as $key=>$value) {\n if (!is_string($key)) {\n Zend_Cache::throwException(\"inval...
[ "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 summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Check, whether client supports compressed data @return boolean @since 11.1 @note Replaces _clientEncoding method from 11.1 @deprecated 4.0 Use JApplicationWebClient instead
[ "protected static function clientEncoding()\n\t{\n\t\tif (!isset($_SERVER['HTTP_ACCEPT_ENCODING']))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$encoding = false;\n\n\t\tif (false !== strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))\n\t\t{\n\t\t\t$encoding = 'gzip';\n\t\t}\n\n\t\tif (false !== strpos($_SERVER['HTTP_...
[ "public void setHeader(String name, String s) {\n if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15\n logger.logp(Level.FINE, CLASS_NAME,\"setHeader\", \" name --> \" + name + \" value --> \" + PasswordNullifier.nullifyParams(s), \"[\"+this+\"...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
Add and put index to `code` column Use if identity an item alternatively to ID @param $tableName
[ "public function addCode($tableName, $columnName = 'code')\n {\n $this->addColumn('{{%' . $tableName . '}}', $columnName,\n $this->string(32)->comment('Code for this item, used identifying when needed. Another criteria to replace ID because ID is auto-increment'));\n $this->createIndex($...
[ "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 text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
// PutGitMetadata implements the KeybaseDaemon interface for // KeybaseServiceMeasured.
[ "func (k KeybaseServiceMeasured) PutGitMetadata(\n\tctx context.Context, folder keybase1.Folder, repoID keybase1.RepoID,\n\tmetadata keybase1.GitLocalMetadata) (err error) {\n\tk.putGitMetadataTimer.Time(func() {\n\t\terr = k.delegate.PutGitMetadata(ctx, folder, repoID, metadata)\n\t})\n\treturn err\n}" ]
[ "func (api *CoreAPI) getSession(ctx context.Context) *CoreAPI {\n\tsesApi := *api\n\n\t// TODO: We could also apply this to api.blocks, and compose into writable api,\n\t// but this requires some changes in blockservice/merkledag\n\tsesApi.dag = dag.NewReadOnlyDagService(dag.NewSession(ctx, api.dag))\n\n\treturn &s...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Flush flushes any buffered data to the underlying writer. // Calling Flush is not normally necessary; calling Close is sufficient.
[ "func (w *Writer) Flush() error {\n\treturn w.cw.w.(*bufio.Writer).Flush()\n}" ]
[ "void offerData(byte[] chunk) {\n if (chunk == null || chunk.length == 0) {\n throw new IllegalArgumentException(\"chunk must have at least one byte of data\");\n }\n\n if (closed) {\n return;\n }\n\n // Since this is an unbounded queue, offer() always succeeds. In addition, we don't make a...
codesearchnet
{ "query": "Represent the Github comment about writing:", "pos": "Represent the Github code about writing:", "neg": "Represent the Github code:" }
Quickly create a object-mode duplex stream @param {function?} transform(chunk, encoding, done) @param {function?} flush(done) @param {boolean} objectMode @return {DuplexStream}
[ "function through(transform, flush, objectMode) {\n const stream = new TransformStream({objectMode})\n stream._transform = transform || pass\n if (flush) stream._flush = flush\n return stream\n}" ]
[ "function () {\n var write = function (node, enc, cb) {\n node.value = encoder.encode(node.value, dag.valueEncoding)\n stream.node(node, cb)\n }\n\n stream.emit('live')\n pipe(dag.createReadStream({since: changes, live: true}), through.obj(write))\n }" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// TruncateScope returns success
[ "func (c *Connector) TruncateScope(ctx context.Context, scope string) 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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
If they ask for a <one two> :intitle, we're actually gonna do like google's own form does, and change it to <intitle:one intitle:two>. Internal phrases will be respected.
[ "def fielded_query(query, field)\n tokens = query.split(%r{\\s|(\"[^\"]+\")}).delete_if {|a| a.blank?}\n return tokens.collect {|token| \"#{field}:#{token}\"}.join(\" \")\n end" ]
[ "def harvest(self, text):\n \"\"\"\"\"\"\n for match in self.harvest_regex.finditer(text):\n # TODO: optionally validate before yielding?\n # TODO: keep a list of harvested but not validated?\n yield match.group().replace('..', '.')" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// Returns if the dirPath is a directory.
[ "func fsIsDir(ctx context.Context, dirPath string) bool {\n\tfi, err := fsStat(ctx, dirPath)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn fi.IsDir()\n}" ]
[ "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 Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Delete category function @param int $id
[ "public static function delete_category($id) {\n $category = core_customfield\\category_controller::create($id);\n $handler = $category->get_handler();\n self::validate_context($handler->get_configuration_context());\n if (!$handler->can_configure()) {\n throw new moodle_excep...
[ "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 summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Returns the pixel color of this Image. @param x The x-coordinate of the pixel. @param y The y-coordinate of the pixel. @return The color of the pixel.
[ "public final Color getColor(int x, int y) {\n int[] pixels = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();\n int idx = x + y * width;\n\n return new RGBColor((pixels[idx] >> 16 & 0x000000ff) / 255.0,\n (pixels[idx] >> 8 & 0x000000ff) / 255.0,\n ...
[ "public static Matrix copy(Matrix m) {\n\t\tif (m==null) throw new NullPointerException();\n\t\tMatrix copy=createMatrix(m.getRowCount(), m.getColumnCount());\n\t\tfor (int row=0; row<m.getRowCount(); row++) for (int col=0; col<m.getColumnCount(); col++)\n\t\t\tcopy.set(row, col, m.getQuick(row, col));\n\t\treturn ...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// Data returns a slice pointing to the unmanaged object memory. You must make // sure the object is referenced for at least as long as the slice is used.
[ "func (object *OdbObject) Data() (data []byte) {\n\tvar c_blob unsafe.Pointer = C.git_odb_object_data(object.ptr)\n\tvar blob []byte\n\n\tlen := int(C.git_odb_object_size(object.ptr))\n\n\tsliceHeader := (*reflect.SliceHeader)((unsafe.Pointer(&blob)))\n\tsliceHeader.Cap = len\n\tsliceHeader.Len = len\n\tsliceHeader...
[ "public long appendEntry(JournalEntry entry) {\n // TODO(gpang): handle bounding the queue if it becomes too large.\n\n /**\n * Protocol for appending entries\n *\n * This protocol is lock free, to reduce the overhead in critical sections. It uses\n * {@link AtomicLong} and {@link ConcurrentLi...
codesearchnet
{ "query": "Represent the instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about text processing:" }
ログを定義します。 ここで定義されたログ名を利用して、該当のログファイルにログを出力します。 @param string $name ログ名 @param string $file_path ログファイルパス @param string $lf_code 行の末尾に付与する改行コード 空文字を指定すると改行されなくなる
[ "public static function SetLogFilePath ($name, $file_path, $lf_code = Strings::LF) {\n\t\t$parent_dir = dirname($file_path);\n\t\tif ($parent_dir !== '' && !file_exists($parent_dir)) {\n\t\t\tif (!mkdir($parent_dir, 0777, true)) {\n\t\t\t\tthrow new \\Exception('ログ出力ディレクトリを作成できません。親ディレクトリに書き込み権限がありません。dir path:'. d...
[ "func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
altrimenti la update
[ "public function save()\n {\n \tif($this->exists())\n \t{\n\t\t\t// update\n\t\t\t$query = new Query(static::table());\n\t\t\t$query->update($this->getData(), $this->getIdentifyCondition());\n\t\t\treturn $query->execute();\n \t}\n \telse\n \t{\n \t\t// insert\n\t\t\t$query = new Query(static::...
[ "def create_card\n raise StandardError, 'Cliente null' if @client.nil?\n # la instancia de card recibe como parametro el @client al que se le va asociar la tarjeta\n card = PayuLatam::Card.new(@client)\n # hay un metodo card_params que genera el objeto a enviar con los datos correctos\n # s...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Execute the console command. @return mixed
[ "public function handle()\n {\n // Are we being asked to remove the scaffolding?\n $removal = $this->option('remove');\n\n // Determine the package file path\n $centaurFilename = with(new ReflectionClass('Centaur\\CentaurServiceProvider'))->getFileName();\n $centaurPath = dirna...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
restore noise to html content
[ "function restore_noise($text) {\n while(($pos=strpos($text, '___noise___'))!==false) {\n $key = '___noise___'.$text[$pos+11].$text[$pos+12].$text[$pos+13];\n if (isset($this->noise[$key]))\n $text = substr($text, 0, $pos).$this->noise[$key].substr($text, $pos+14);\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 Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Validate integer.
[ "protected void validateInteger(String field, String errorKey, String errorMessage) {\r\n\t\tvalidateIntegerValue(controller.getPara(field), errorKey, errorMessage);\r\n\t}" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code:" }
Return a list of grpc requests. Returns list from an input list of etcd3.transactions.{Put, Get, Delete, Txn} objects.
[ "def _ops_to_requests(self, ops):\n \n request_ops = []\n for op in ops:\n if isinstance(op, transactions.Put):\n request = self._build_put_request(op.key, op.value,\n op.lease, op.prev_kv)\n request_op = ...
[ "func (ProxyQueryServiceAsyncBridge) Check(context.Context) check.Response {\n\treturn check.Response{Name: \"Query Service\", Status: check.StatusPass}\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Append any specified parameters to the provided WebTarget. @param webTarget a web target used by the Jersey Client API, not null @return the WebTarget with any path and query parameters appended, not null
[ "public WebTarget appendPathAndQueryParameters(final WebTarget webTarget) {\n ArgumentChecker.notNull(webTarget, \"webTarget\");\n WebTarget resultTarget = webTarget;\n resultTarget = resultTarget.path(MULTI_SET_NAME + EXTENSION);\n resultTarget = resultTarget.queryParam(COLUMNS_PARAM, buildCodeList(_qu...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
--------------------------------------------------------- Deserialize
[ "function deserializeInnerMessage(spec, message, buffer, bufferOffset) {\n spec.fields.forEach(function(field) {\n var fieldValue = message[field.name];\n\n if (field.isArray) {\n var array = [];\n var arrayType = field.baseType;\n\n var arraySize;\n if (field.arrayLen !== null) {\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Parses a YAML source into a Python object. Args: text: A YAML source to parse. Returns: A Python data structure corresponding to the YAML source.
[ "def Parse(text):\n \n precondition.AssertType(text, Text)\n\n if compatibility.PY2:\n text = text.encode(\"utf-8\")\n\n return yaml.safe_load(text)" ]
[ "def assert_valid_execution_arguments(\n schema: GraphQLSchema,\n document: DocumentNode,\n raw_variable_values: Dict[str, Any] = None,\n) -> None:\n \n if not document:\n raise TypeError(\"Must provide document\")\n\n # If the schema used for execution is invalid, throw an error.\n asse...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
//Toast show toast message in browser
[ "func Toast(ws *websocket.Conn, message string, t uint) error {\n\tjs := fmt.Sprintf(\"Materialize.toast('%s', %d);\", message, t)\n\terr := ws.WriteMessage(websocket.TextMessage, []byte(js))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}" ]
[ "function(list){\n localStorage.setItem(localStorageKey, JSON.stringify(list));\n // if we used a real database, we would likely do the below in a callback\n this.list = list;\n this.trigger(list); // sends the updated list to all listening components (TodoApp)\n }...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// SigAlgo returns the RSA signer's signature algorithm.
[ "func (s *Signer) SigAlgo() x509.SignatureAlgorithm {\n\tif s.local != nil {\n\t\treturn s.local.SigAlgo()\n\t}\n\n\t// currently remote.SigAlgo just returns\n\t// x509.UnknownSignatureAlgorithm.\n\treturn s.remote.SigAlgo()\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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Origin returns the origin position of the view.
[ "func (v *View) Origin() (x, y int) {\n\treturn v.ox, v.oy\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about mathematics:", "pos": "Represent the Github code about mathematics:", "neg": "Represent the Github code:" }
connect polylines that are close and have a similar orientation o---o <-> o---o ==> o----o--o----o TODO: max_dist as function of cell size
[ "def connect(polylines, max_dist=10):\n \n ll = len(polylines)\n remove = []\n for n in range(ll - 1, -1, -1):\n c = polylines[n]\n if len(c) > 1:\n for d0, p0 in enumerate((c[0, 0], c[-1, 0])):\n for m in range(len(polylines) - 1, -1, -1):\n # ...
[ "def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Loads configuration from File. Later loads have lower priority. @param file File to load from @since 1.2.0
[ "public void load(File file) {\n try {\n PropertiesConfiguration config = new PropertiesConfiguration();\n // disabled to prevent accumulo classpath value from being shortened\n config.setDelimiterParsingDisabled(true);\n config.load(file);\n ((CompositeConfiguration) internalConfig).add...
[ "func newGnostic() *Gnostic {\n\tg := &Gnostic{}\n\t// Option fields initialize to their default values.\n\tg.usage = `\nUsage: gnostic SOURCE [OPTIONS]\n SOURCE is the filename or URL of an API description.\nOptions:\n --pb-out=PATH Write a binary proto to the specified location.\n --text-out=PATH Wri...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Make the XPath relative to the current context. The returned XPath will match elements matching the XPath inside the current crawler when running in the context of a node of the crawler.
[ "private function relativize(string $xpath): string\n {\n $expressions = [];\n\n // An expression which will never match to replace expressions which cannot match in the crawler\n // We cannot drop\n $nonMatchingExpression = 'a[name() = \"b\"]';\n\n $xpathLen = \\strlen($xpath)...
[ "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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
This is called by the EJB container server code to write a EJB method call preinvoke ends record to the trace log, if enabled.
[ "public static void tracePreInvokeEnds(EJSDeployedSupport s, EJSWrapperBase wrapper)\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())\n {\n StringBuffer sbuf = new StringBuffer();\n\n sbuf\n .append(MthdPreInvokeExit_Type_Str).a...
[ "@Override\n public void destroy() // PK20881\n {\n if (tc.isEntryEnabled())\n Tr.entry(tc, \"destroy\");\n\n // Dummy transactionWrappers may not be in any table and so\n // will not have a resourceCallback registered to remove them.\n if (_resourceCallback != null)\n ...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Database management:" }
/*Line 94 - 'AtomControl.js'
[ "function (e, v) {\n/*Line 95 - 'AtomControl.js' */ if (v) {\n/*Line 96 - 'AtomControl.js' */ if (/http\\:\\/\\//i.test(v)) {\n/*Line 97 - 'AtomControl.js' */ v = v.substr(5);\n/*Line 98 - 'AtomControl.js' */ }\n/*Line 99 - 'AtomControl.js' */ }\n/*Line 100 - 'Atom...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Releases the partition reader.
[ "@Override\n\tvoid releaseAllResources() throws IOException {\n\t\tif (!isReleased) {\n\t\t\tisReleased = true;\n\n\t\t\tResultSubpartitionView view = subpartitionView;\n\t\t\tif (view != null) {\n\t\t\t\tview.releaseAllResources();\n\t\t\t\tsubpartitionView = null;\n\t\t\t}\n\t\t}\n\t}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Return the amount of times the hook has been executed @param string $hook The hook name @return int The hook execution counter for this hook
[ "public static function getExecuteCount(string $hook)\n {\n return isset(self::$counters[$hook]) ? self::$counters[$hook] : 0;\n }" ]
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Deletes a set of files to an output @param array $files the files being written out @return array array of results
[ "public function delete(array $files)\n {\n $filesystem = $this->getFilesystem($this->field, $this->settings);\n $results = [];\n foreach ($files as $path) {\n $results[] = $this->deletePath($filesystem, $path);\n }\n\n return $results;\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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Slice each page of the original, to convert to "one real page per PDF page". Return the output filename.
[ "def slice_pdf(input_filename: str, output_filename: str,\n slice_horiz: int, slice_vert: int) -> str:\n \n if slice_horiz == 1 and slice_vert == 1:\n log.debug(\"No slicing required\")\n return input_filename # nothing to do\n log.info(\"Slicing each source page mv into {} hori...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@static @param $_view @param null|array $_data @return bool|mixed|string|void
[ "public static function get_template_part( $_view, $_data = null ) {\n\n\t\t/*\n\t\tTo be reviewed later, should have more checks and restrictions like a whitelist etc.\n\n\t\tif ( 0 === strpos( $_view, 'http://' ) || 0 === strpos( $_view, 'https://' ) ) {\n\t\t\t$_view = apply_filters( 'pods_view_url_include', $_v...
[ "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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Renders the given URI with Symfony stack @param string|\Symfony\Component\HttpKernel\Controller\ControllerReference $uri @param array $options @return string
[ "public static function renderUri( $uri, $options = array() )\n {\n $serviceContainer = ezpKernel::instance()->getServiceContainer();\n $fragmentHandler = $serviceContainer->get( 'fragment.handler' );\n\n $strategy = isset( $options['strategy'] ) ? $options['strategy'] : 'inline';\n u...
[ "public function beforeCompile(): void\n\t{\n\t\t// Skip if it's not CLI mode\n\t\tif (!$this->cliMode) return;\n\n\t\t$builder = $this->getContainerBuilder();\n\n\t\t// Lookup for Symfony Console Application\n\t\t$application = $builder->getDefinitionByType('Symfony\\Component\\Console\\Application');\n\n\t\t// Re...
codesearchnet
{ "query": "Represent the instruction about Symfony:", "pos": "Represent the code about Symfony:", "neg": "Represent the code:" }
Protect Crud functions of controller. @return string
[ "protected function protectMethods()\n {\n $request = $this->request;\n\n // available methods for resources.\n $resources = $this->crud['resources'];\n\n // protection methods being passed in a route.\n $methods = $this->getAction('protect_methods');\n\n // get method b...
[ "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:" }
Writing JSON content to HTML file @param writer @param templateReader @param jsonReport @throws IOException
[ "private void generateHTMLReport(BufferedWriter writer, BufferedReader templateReader, String jsonReport)\n throws IOException {\n\n logger.entering(new Object[] { writer, templateReader, jsonReport });\n\n String readLine = null;\n while ((readLine = templateReader.readLine()) != nu...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code:" }
Shortcut for (new Rut($rut, $dv)) and automatically detect @param string|integer $rut Rut Number with the verification number @return Rut
[ "public static function parse($rut)\n {\n list($rut, $vn) = self::split($rut);\n\n return (new self($rut, $vn));\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Get the whole tree of a part of the tree via an AJAX request. @param HTTPRequest $request @return HTTPResponse @throws Exception
[ "public function tree(HTTPRequest $request)\n {\n // Regular source specification\n $isSubTree = false;\n\n $this->search = $request->requestVar('search');\n $id = (is_numeric($request->latestParam('ID')))\n ? (int)$request->latestParam('ID')\n : (int)$request->r...
[ "@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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Splits the type attribute of a container into individual types.<p> @param containerTypeSpec the container type attribute @return the entries of the type attribute
[ "public static Set<String> splitType(String containerTypeSpec) {\n\n return Sets.newHashSet(Arrays.asList(containerTypeSpec.trim().split(\" *, *\")));\n\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 instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// compiledParse parses the specified text and returns a map with the results.
[ "func (g *Grok) compiledParse(gr *gRegexp, text string) (map[string]string, error) {\n\tcaptures := make(map[string]string)\n\tif match := gr.regexp.FindStringSubmatch(text); len(match) > 0 {\n\t\tfor i, name := range gr.regexp.SubexpNames() {\n\t\t\tif name != \"\" {\n\t\t\t\tif g.config.RemoveEmptyValues && match...
[ "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 text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// DescCol constructs a ne Column value from a text a column type, which is // configured as a sorted column in descending order.
[ "func DescCol(text string, colType ColumnType) Column {\n\treturn Column{Text: text, Type: colType, Sort: true, Desc: true}\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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Writes to file @param $string @return int | bool Returns the number of bytes written, or FALSE on error.
[ "public function write($string)\n {\n $handle = @fopen($this->filePath, $this->mode);\n if ($handle === false) {\n return $handle;\n }\n return @fwrite($handle, $string);\n\n\n }" ]
[ "private function writeToOutputNow($output)\n {\n if ($this->sendHttpCode() && \\Whoops\\Util\\Misc::canSendHeaders()) {\n $httpCode = $this->sendHttpCode();\n\n if (function_exists('http_response_code')) {\n http_response_code($httpCode);\n } else {\n ...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Gets element's direction. Supports both CSS 'direction' prop and 'dir' attr.
[ "function( useComputed )\r\n\t\t{\r\n\t\t\treturn useComputed ?\r\n\t\t\t\tthis.getComputedStyle( 'direction' )\r\n\t\t\t\t\t// Webkit: offline element returns empty direction (#8053).\r\n\t\t\t\t\t|| this.getDirection()\r\n\t\t\t\t\t|| this.getDocument().$.dir\r\n\t\t\t\t\t|| this.getDocument().getBody().getDirect...
[ "function (element, property) {\n var dom = element.dom();\n /*\n * IE9 and above per\n * https://developer.mozilla.org/en/docs/Web/API/window.getComputedStyle\n *\n * Not in numerosity, because it doesn't memoize and looking this up dynamically in performance critical code would b...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get images. @param string $tag @return collection
[ "public function images($tag = null)\n {\n $images = [];\n\n if (is_array($tag)) {\n foreach ($tag as $tagName) {\n $images = array_merge($images, $this->imageRepo->getImagesByTag($tag)->get()->toArray());\n }\n } elseif (is_null($tag)) {\n $im...
[ "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:" }
Hit the limit set for the given region. @param string $region @param int $count @return bool
[ "public function hitLimits($region, $count = 1)\n\t{\n\t\tforeach ($this->limits as $limit)\n\t\t{\n\t\t\tif ($limit->getRegion() == $region &&\n\t\t\t\t! $limit->hit($count)\n\t\t\t)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}" ]
[ "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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// SetIdentityAttributeOrder sets the IdentityAttributeOrder field's value.
[ "func (s *UpdateTypedLinkFacetInput) SetIdentityAttributeOrder(v []*string) *UpdateTypedLinkFacetInput {\n\ts.IdentityAttributeOrder = 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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Print the given {@link ProjectModel} as Graphviz .dot file to the given writer. If includeClasses is true, the individual classes are printed as well.
[ "public void print(ProjectModel project, Writer w, boolean includeClasses) {\n\t\tPrintWriter out = new PrintWriter(w);\n\n\t\tout.println(\"digraph ModuleGraph {\");\n\t\tif (includeClasses) {\n\t\t\tout.println(\"ratio=1;\");\n\t\t} else {\n\t\t\tout.println(\"overlap=false;\");\n\t\t\tout.println(\"spline=true;\...
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Must be called from synchronized block
[ "private void redistributeBuffers() throws IOException {\n\t\tassert Thread.holdsLock(factoryLock);\n\n\t\t// All buffers, which are not among the required ones\n\t\tfinal int numAvailableMemorySegment = totalNumberOfMemorySegments - numTotalRequiredBuffers;\n\n\t\tif (numAvailableMemorySegment == 0) {\n\t\t\t// in...
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
This method calls the PMML compiler to get PMMLResource objects which are used to create one or more PackageDescr objects @param resource @return @throws DroolsParserException @throws IOException
[ "private List<PackageDescr> getPackageDescrs(Resource resource) throws DroolsParserException, IOException {\n List<PMMLResource> resources = pmmlCompiler.precompile(resource.getInputStream(), null, null);\n if (resources != null && !resources.isEmpty()) {\n return generatedResourcesToPackag...
[ "@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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Gives all ROIs/POIs associated with this structure set which belongs to the specified Frame of Reference UID. @return [Array<ROI, POI>] the matching ROIs/POIs (an empty Array if no structures are matched)
[ "def structures_in_frame(uid)\n raise ArgumentError, \"Expected String, got #{uid.class}.\" unless uid.is_a?(String)\n frame_structures = Array.new\n @structures.each do |s|\n frame_structures << s if s.frame.uid == uid\n end\n return frame_structures\n end" ]
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Override the Serializable method. @param stream @throws IOException @throws ClassNotFoundException
[ "@SuppressWarnings(\"unchecked\")\n private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {\n stream.defaultReadObject();\n this.properties = (Map<Object, Object>) stream.readObject();\n }" ]
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }