query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
@param RuleInterface|null $next @return RuleInterface
[ "public static function roleId(RuleInterface $next = null): RuleInterface\n {\n return self::asSanitizedString(self::readable(RolesApi::class, $next));\n }" ]
[ "public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
:param dict j: JSON response from TryHaskell. :rtype: TryHaskell.Result
[ "def parse(cls, j):\n \n error = j.get('error')\n if error:\n return cls._bad_result(error)\n success = j.get('success')\n if success:\n try:\n return cls.Result(ok=True, **j.get('success'))\n except (TypeError, ValueError) as e:\n ...
[ "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:" }
Creates an admin user @param Arguments $args The command arguments @param ConsoleIo $io The console io @return null|int The exit code or null for success
[ "public function execute(Arguments $args, ConsoleIo $io)\n {\n $command = new AddUserCommand;\n\n return $command->run(['--group', 1] + $args->getOptions(), $io);\n }" ]
[ "protected function executeCliAction(Config\\Action $action) : void\n {\n // since the cli has no straight way to communicate back to php\n // cli hooks have to handle sync stuff by them self\n // so no 'beforeAction' or 'afterAction' is called here\n $runner = new Action\\Cli();\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:" }
获取cookie值并过滤 @param string $name @param mixed $default @return mixed
[ "public static function getF($name, $filter = array(), $default = false)\r\n\t{\r\n\t\tif (isset($_COOKIE[$name]))\r\n\t\t{\r\n\t\t\treturn execFilter($_COOKIE[$name], $filter);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $default;\r\n\t\t}\r\n\t}" ]
[ "private static function _parseIfXxxWith1Param1Str($paramstr, $validatorName)\n {\n $params = explode(',', $paramstr);\n if (count($params) != 2)\n return false;\n\n $varName = $params[0];\n// $value = $params[1];\n if (strlen($varName) == 0) // 简单检测\n thr...
codesearchnet
{ "query": "Represent the Github sentence about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about programming:" }
FIX: this is a bit silly, refactor out
[ "function good(args, err, cb) {\n if (err) {\n cb(error('entity_error', { store: name, error: err, args: args }))\n return false\n } else return true\n }" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Translates char list into keystroke sequence. @param mixed $charList @return array @throws WebDriver_Exception
[ "public static function prepareKeyStrokes($charList)\n {\n $keyStrokes = [];\n foreach ((array) $charList as $char) {\n if (is_int($char)) {\n // treat int as 16-bit little-endian Unicode\n if (false === $symbol = iconv('UTF-16LE', 'UTF-8', pack('v', $char))...
[ "def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// condMonitor, returns a Monitor that broadcasts on cond on each update.
[ "func condMonitor(freq time.Duration, cond *sync.Cond) (*Monitor, error) {\n\tm := &Monitor{\n\t\ttick: time.NewTicker(freq),\n\t\tinited: true,\n\t\tcond: cond,\n\t}\n\tm.state.Set(stateRunning)\n\tif err := m.monitorLoop(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn m, nil\n}" ]
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the Github instruction about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
What to do if the entry point is not recognized. @param string $unrecognizedPath @return Response
[ "public function unrecognizedCall($unrecognizedPath = '')\n {\n $this->start();\n\n if ($unrecognizedPath === '') {\n $message = t('Resource not specified');\n } else {\n $message = t(/*i18n: %1$s is a path, %2$s is an HTTP method*/'Unknown resource %1$s for %2$s method...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Returns the average KAM node in degree. Zero is returned if the average is undefined (in case the number of KAM nodes is zero).
[ "public double getAverageKamNodeInDegree(String kamName) {\n final int nodes = getKamNodeCount(kamName);\n return (nodes != 0 ? ((double) getKamEdgeCount(kamName)) / nodes : 0.0);\n }" ]
[ "def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Restore block volume using a given snapshot
[ "def cli(env, volume_id, snapshot_id):\n \"\"\"\"\"\"\n block_manager = SoftLayer.BlockStorageManager(env.client)\n success = block_manager.restore_from_snapshot(volume_id, snapshot_id)\n\n if success:\n click.echo('Block volume %s is being restored using snapshot %s'\n % (volum...
[ "@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:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns an array of HTTP headers $_SERVER is not entirely complete (e.g doesn't contain Authorization header) so first it tries to use getallheaders() function which works only on Apache server @return array
[ "public function headers()\n {\n if (function_exists('getallheaders')) {\n $headers = getallheaders();\n return empty($headers) ? array() : $headers;\n }\n\n $headers = array();\n\n foreach ($_SERVER as $name => $value) {\n if (substr($name, 0, 5) == '...
[ "public function body($payload, $mimeType = null)\n {\n $this->mime($mimeType);\n $this->payload = $payload;\n // Iserntentially don't call _serializePayload yet. Wait until\n // we actually send off the request to convert payload to string.\n // At that time, the `serialized_...
codesearchnet
{ "query": "Represent the description about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about Programming:" }
add JFXDrawer to the stack <p> NOTE: this method is also called inside {@link JFXDrawersStack#toggle(JFXDrawer)} to add the drawer if not added @param drawer
[ "public void addDrawer(JFXDrawer drawer) {\n if (drawer == null) {\n return;\n }\n\n if (drawer.getCachePolicy().equals(CachePolicy.IMAGE)) {\n throw new RuntimeException(\"Drawer is using unsupported cache strategy inside JFXDrawerStack\");\n }\n\n if (drawe...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Creates the configuration hierarchy for the provided configuration. @param aConfig @return configuration hierarchy
[ "@Nonnull\n private static CalendarHierarchy _createConfigurationHierarchy (@Nonnull final Configuration aConfig,\n @Nullable final CalendarHierarchy aParent)\n {\n final ECountry eCountry = ECountry.getFromIDOrNull (aConfig.getHierarchy ());\n ...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
This method may only be triggered with valid WAL filenames, as the passed file is deleted!
[ "final void _deleteWALFileAfterProcessing (@Nonnull @Nonempty final String sWALFilename)\n {\n ValueEnforcer.notEmpty (sWALFilename, \"WALFilename\");\n final File aWALFile = m_aIO.getFile (sWALFilename);\n if (FileOperationManager.INSTANCE.deleteFile (aWALFile).isFailure ())\n {\n if (LOGGER.isEr...
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
push new data for the next WAA dinner
[ "function push (chunk) {\n\t\tif (!isAudioBuffer(chunk)) {\n\t\t\tchunk = util.create(chunk, channels)\n\t\t}\n\n\t\tdata.append(chunk)\n\n\t\tisEmpty = false;\n\t}" ]
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Creates a new content type create struct. If the identifier is not specified, a custom one is given. @return ContentTypeCreateStruct
[ "public function newContentTypeCreateStruct($identifier = null)\n {\n return $this->contentTypeService->newContentTypeCreateStruct(\n $identifier ?: $identifier = str_replace('.', '', uniqid('content_type_', true))\n );\n }" ]
[ "def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Natural Language Processing:" }
Return a name for the given key Argument: key -- Pokemon number id (int)
[ "def get_name(self, key):\n '''\n '''\n try:\n return self.nameDict[key]\n except IndexError as e:\n print 'IndexError {0}: {1}'.format(e.errno, e.strerror)" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// SetFrameRate sets the FrameRate field's value.
[ "func (s *DetectedProperties) SetFrameRate(v string) *DetectedProperties {\n\ts.FrameRate = &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 comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
check for isEnabled
[ "public boolean readHistoryEnabledForField(String index, String field) {\n \n if(!this.enabled) {\n return false;\n }\n \n if(searchguardIndex.equals(index)) {\n return logInternalConfig;\n }\n \n try {\n final Set<String> fiel...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Unparses a single Header. @param {String} header @returns {String}
[ "function (header) {\n if (!_.isObject(header)) { return E; }\n return header.key + HEADER_KV_SEPARATOR + SPC + header.value;\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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Documentation:" }
Find a <b>widget</b> with given name in hierarchy of this view's parents @param {string} name Name of the widget @returns {Lava.widget.Standard}
[ "function(name) {\n\n\t\tif (Lava.schema.DEBUG && !name) Lava.t();\n\n\t\tvar result = this._widget;\n\n\t\twhile (result && result.name != name) {\n\n\t\t\tresult = result.getParentWidget();\n\n\t\t}\n\n\t\treturn result;\n\n\t}" ]
[ "public void visitEnd() {\n String classname = workbench.getType().getClassName();\n\n component.addAttribute(new Attribute(\"classname\", classname));\n\n // Generates the provides attribute.\n component.addElement(ElementHelper.getProvidesElement(specifications));\n\n if (workbe...
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Schedule an event callback that will execute once, then unsubscribe itself. @method _oneTimeCallback @param o {EventProvider} Object to attach the event to @param evt {string} Name of the event @param fn {Function} function to execute once @private
[ "function (o,evt,fn) {\n var sub = function () {\n // Unsubscribe myself\n o.unsubscribe(evt, sub);\n // Pass the event handler arguments to the one time callback\n fn.apply({},arguments);\n };\n o.subscribe(evt,sub);\n }" ]
[ "function() {\n var events = this.eventDelegates;\n log.events && (Object.keys(events).length > 0) && console.log('[%s] addHostListeners:', this.localName, events);\n // NOTE: host events look like bindings but really are not;\n // (1) we don't want the attribute to be set and (2) we want to sup...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Search element and wait until it is clickable :param timeout: max time to wait :returns: page element instance
[ "def wait_until_clickable(self, timeout=None):\n \n try:\n self.utils.wait_until_element_clickable(self, timeout)\n except TimeoutException as exception:\n parent_msg = \" and parent locator '{}'\".format(self.parent) if self.parent else ''\n msg = \"Page elemen...
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// FilterStringSet accepts a string set `s` (in the form of `map[string]bool`) and a filtering function `f` // and returns a string set containing only the strings `x` for which `f(x) == true`
[ "func FilterStringSet(s map[string]bool, f func(x string) bool) map[string]bool {\n\tresult := map[string]bool{}\n\tfor k := range s {\n\t\tif f(k) {\n\t\t\tresult[k] = true\n\t\t}\n\t}\n\treturn result\n}" ]
[ "def _validate_fold_has_outputs_or_count_filter(fold_scope_location, fold_has_count_filter, outputs):\n \"\"\"\"\"\"\n # This function makes sure that the @fold scope has an effect.\n # Folds either output data, or filter the data enclosing the fold based on the size of the fold.\n if fold_has_count_fil...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
获取文件的哈希散列值 @param string $type @return mixed $string
[ "public function hash($type = 'sha1') {\n\t\tif (!isset($this->hash[$type])) {\n\t\t\t$this->hash[$type] = hash_file($type, $this->filename);\n\t\t}\n\t\treturn $this->hash[$type];\n\t}" ]
[ "public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}" ]
codesearchnet
{ "query": "Represent the description about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code:" }
Finds out if activation token is valid. @param string $token activation token @return bool
[ "public static function isActivationTokenValid($token)\n {\n $expire = Podium::getInstance()->podiumConfig->get('activation_token_expire');\n if ($expire === null) {\n $expire = 3 * 24 * 60 * 60;\n }\n return static::isTokenValid($token, $expire);\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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Run Friedman's test of fixed-span smoothers from Figure 2b.
[ "def run_friedman82_super():\n \"\"\"\"\"\"\n x, y = smoother_friedman82.build_sample_smoother_problem_friedman82()\n plt.figure()\n smooth = SuperSmoother()\n smooth.specify_data_set(x, y, sort_data=True)\n smooth.compute()\n plt.plot(x, y, '.', label='Data')\n plt.plot(smooth.x, smooth.smo...
[ "def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// GetGobBytes searches cache on memory by given key and returns gob-encoded value.
[ "func (c *CacheTTL) GetGobBytes(key string) ([]byte, bool) {\n\tc.itemsMu.RLock()\n\tdefer c.itemsMu.RUnlock()\n\n\tif item, ok := c.items[key]; ok {\n\t\tif c.isValidItem(item) {\n\t\t\tvar buf bytes.Buffer\n\t\t\tenc := gob.NewEncoder(&buf)\n\t\t\terr := enc.Encode(item.Value)\n\t\t\tif err == nil {\n\t\t\t\tretu...
[ "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 instruction about AWS S3:", "pos": "Represent the Github code about AWS S3:", "neg": "Represent the Github code about programming:" }
Returns the correlation coefficient between two vectors.
[ "public static double cor(int[] x, int[] y) {\n if (x.length != y.length) {\n throw new IllegalArgumentException(\"Arrays have different length.\");\n }\n\n if (x.length < 3) {\n throw new IllegalArgumentException(\"array length has to be at least 3.\");\n }\n\n ...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns true if any one of the channel, height, or width ranges of this shape allow more than one input value.
[ "def isFlexible(self):\n \n for key, value in self.arrayShapeRange.items():\n if key in _CONSTRAINED_KEYS:\n if value.isFlexible:\n return True\n\n return False" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code:" }
An extension point so we can control how the query gets executed. This exists for testing purposes, not because we believe it will actually be used for real.
[ "public SparqlResult runQuery(String endpoint, String query) {\n return SparqlClient.execute(endpoint, query, username, password);\n }" ]
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// WithEndpoint sets a config Endpoint value returning a Config pointer for // chaining.
[ "func (c *Config) WithEndpoint(endpoint string) *Config {\n\tc.Endpoint = &endpoint\n\treturn c\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:" }
// Debug emits a log entry at the DEBUG level.
[ "func Debug(ctx context.Context, msg string, args ...interface{}) {\n\tsendToAppender(ctx, DebugLevel, nil, msg, args...)\n}" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Set Template Extension file @param string $extension
[ "public function setTemplateExtension($extension)\n {\n $extension = (string) $extension;\n $extension = trim($extension);\n if ('.' == $extension[0]) {\n $extension = substr($extension, 1);\n }\n\n $this->extension = $extension;\n }" ]
[ "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:" }
Refill item field from source. @param Item $item @param string $field @return Item
[ "public function refill(Item $item, $field)\n {\n if (!($url = $this->getSourceForFill($item))) {\n return $item;\n }\n\n // get data\n preg_match(Filler::REG_ITEM_ID, $url, $match);\n $path = str_replace('#ID#', $match['id'], Filler::FILL_URL);\n $body = $thi...
[ "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 Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Given an existing command line and parameterization this will return the same command line wrapped with the necessary calls to ``ssh-agent``
[ "def wrap_args_with_ssh_agent(self, args, ssh_key_path, ssh_auth_sock=None, silence_ssh_add=False):\n \n if ssh_key_path:\n ssh_add_command = args2cmdline('ssh-add', ssh_key_path)\n if silence_ssh_add:\n ssh_add_command = ' '.join([ssh_add_command, '2>/dev/null'])\...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
Get Graphite URL.
[ "def get_graph_url(self, target, graphite_url=None):\n \"\"\"\"\"\"\n return self._graphite_url(target, graphite_url=graphite_url, raw_data=False)" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Serialize a list of objects to a JsonGenerator. @param map The map of objects to serialize. @param jsonGenerator The JsonGenerator to which the list should be serialized
[ "public void serialize(Map<String, T> map, JsonGenerator jsonGenerator) throws IOException {\n jsonGenerator.writeStartObject();\n for (Map.Entry<String, T> entry : map.entrySet()) {\n jsonGenerator.writeFieldName(entry.getKey());\n if (entry.getValue() == null) {\n ...
[ "@Override\n public ExpandableField<?> deserialize(JsonElement json, Type typeOfT,\n JsonDeserializationContext context) throws JsonParseException {\n if (json.isJsonNull()) {\n return null;\n }\n\n ExpandableField<?> expandableField;\n\n // Check if json is a String ID. If so, the field has ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Create a new pivot model instance. @param \Fly\Database\ActiveRecord\Model $parent @param array $attributes @param string $table @param bool $exists @return \Fly\Database\ActiveRecord\Relations\Pivot
[ "public function newPivot(Model $parent, array $attributes, $table, $exists)\n\t{\n\t\treturn new Pivot($parent, $attributes, $table, $exists);\n\t}" ]
[ "public function GetTableColumnNames($tableName) {\n $this->setDbConfigList(array());\n $dbConfig = new \\Puzzlout\\Framework\\Dal\\DbStatementConfig(null, \\Puzzlout\\Framework\\Dal\\DbExecutionType::COLUMNNAMES, new \\Puzzlout\\Framework\\Dal\\DbQueryFilters());\n $dbConfig->setQuery(\"DESCRI...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Execute the console command. @throws \Doctrine\DBAL\DBALException @return bool|null
[ "public function handle()\n {\n $this->tables = $this->getTablesFromMWBFile();\n if ($this->tables === false) {\n return false;\n }\n $this->getAppJson();\n\n $this->databaseService = new DatabaseService($this->config, $this->files);\n $this->databaseService->...
[ "public function GetListOfTablesInDatabase() {\n $dbConfig = new \\Puzzlout\\Framework\\Dal\\DbStatementConfig(null, \\Puzzlout\\Framework\\Dal\\DbExecutionType::SHOWTABLES, new \\Puzzlout\\Framework\\Dal\\DbQueryFilters());\n $dbConfig->setQuery(\"SHOW TABLES;\");\n $this->addDbConfigItem($dbC...
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about database:" }
Render a video player. @param Garp_Db_Table_Row $video A record from a video table @param array $options Various rendering options @return mixed
[ "public function render($video, $options = array()) {\n $helper = $this->_getSpecializedHelper($video);\n return $helper->render($video, $options);\n }" ]
[ "def set_note_attribute(data):\n \n na = False\n if data.get('link'):\n na = Types.NoteAttributes()\n # add the url\n na.sourceURL = data.get('link')\n # add the object to the note\n return na" ]
codesearchnet
{ "query": "Represent the sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Transpose array or list of arrays if they are 2D.
[ "def _check_and_flip(arr):\n \"\"\"\"\"\"\n if hasattr(arr, 'ndim'):\n if arr.ndim >= 2:\n return arr.T\n else:\n return arr\n elif not is_string_like(arr) and iterable(arr):\n return tuple(_check_and_flip(a) for a in arr)\n else:\n return arr" ]
[ "def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Maintain unique name within parent_id scope. If name is not unique add numeric postfix.
[ "def maintain_name\n postfix = nil\n total_count = 0\n\n while self.class.where(parent_id: parent_id, name: \"#{name}#{postfix}\").where(\"id != ?\", id.to_i).exists? do\n total_count += 1\n postfix = \"(#{total_count})\"\n end\n\n if postfix\n self.name...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Delete a subscription. @param name Subscription name @param database Database to use
[ "public void delete(String name, String database) {\n RequestExecutor requestExecutor = _store.getRequestExecutor(ObjectUtils.firstNonNull(database, _store.getDatabase()));\n\n DeleteSubscriptionCommand command = new DeleteSubscriptionCommand(name);\n requestExecutor.execute(command);\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 Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about AWS Auto Scaling:" }
This calculated the average value of the time series over the given time range from `start` to `end`, when `mask` is truthy.
[ "def mean(self, start=None, end=None, mask=None):\n \n return self.distribution(start=start, end=end, mask=mask).mean()" ]
[ "def assert_daily(var):\n \"\"\"\n\n t0, t1 = var.time[:2]\n\n # This won't work for non-standard calendars. Needs to be implemented in xarray. Comment for now\n if isinstance(t0.values, np.datetime64):\n if pd.infer_freq(var.time.to_pandas()) != 'D':\n raise ValueError(\"time series i...
codesearchnet
{ "query": "Represent the Github comment about Mathematics:", "pos": "Represent the Github code about Mathematics:", "neg": "Represent the Github code:" }
Splits an author string into its component parts @param string author The raw author string to split @return array An array composed of lastname, initial/name
[ "function splitAuthor(author) {\n\treturn author\n\t\t.split(/\\s*[,\\.\\s]\\s*/)\n\t\t.filter(function(i) { return !!i }) // Strip out blanks\n\t\t.filter(function(i) { return !/^[0-9]+(st|nd|rd|th)$/.test(i) }); // Strip out decendent numerics (e.g. '1st', '23rd')\n}" ]
[ "def build_references(citations, reference_format=False):\n \n # Now, run the method which will take as input:\n # 1. A list of lists of dictionaries, where each dictionary is a piece\n # of citation information corresponding to a tag in the citation.\n # 2. The line marker for this entire citation l...
codesearchnet
{ "query": "Represent the Github text about Documentation:", "pos": "Represent the Github code about Documentation:", "neg": "Represent the Github code:" }
replace :ceiling and :floor rounding modes by :up/:down (depending on sign of the number to be rounded)
[ "def simplified_round_mode(round_mode, negative)\n if negative\n if round_mode == :ceiling\n round_mode = :floor\n elsif round_mode == :floor\n round_mode = :ceiling\n end\n end\n if round_mode == :ceiling\n round_mode = :up\n elsif round_mode == :fl...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
/* @see com.ibm.wsspi.udpchannel.UDPContext#getLocalPort()
[ "@Override\n public int getLocalPort() {\n int port = 0;\n\n if (udpNetworkLayer != null) {\n port = udpNetworkLayer.getDatagramSocket().getLocalPort();\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {\n if (port == 0) {\n ...
[ "protected void sendMergeResponse(Address sender, View view, Digest digest, MergeId merge_id) {\n Message msg=new Message(sender).setBuffer(GMS.marshal(view, digest)).setFlag(Message.Flag.OOB,Message.Flag.INTERNAL)\n .putHeader(gms.getId(), new GMS.GmsHeader(GMS.GmsHeader.MERGE_RSP).mergeId(merge_id...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
at @param string $string @param int $pos @param string $encoding @return string
[ "public static function getChar($string, $pos, $encoding = null)\n {\n $encoding = $encoding === null ? mb_internal_encoding() : $encoding;\n\n if (Mbstring::strlen($string, $encoding) < abs($pos)) {\n return '';\n }\n\n return Mbstring::substr($string, $pos, 1);\n }" ]
[ "protected static function parsePrintableString(&$data, &$result)\n {\n // Printable string type\n $data = self::parseCommon($data, $stringData);\n $result[] = [\n 'Printable String (' . self::$len . ')',\n $stringData, ];\n }" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Get the raw bytes and the last modification millis for this JobFile @return the contents of the job file. @throws IOException when bad things happen during reading
[ "private byte[] readJobFile(FileStatus fileStatus) throws IOException {\n byte[] rawBytes = null;\n FSDataInputStream fsdis = null;\n try {\n long fileLength = fileStatus.getLen();\n int fileLengthInt = (int) fileLength;\n rawBytes = new byte[fileLengthInt];\n fsdis = hdfs.open(fileStat...
[ "def verify(build)\n # TODO might as well cache this and store in the db so we dont have to\n # convert every time\n pkey = to_rsa_pkey\n signature = Base64.decode64(build.signature)\n digest = OpenSSL::Digest::SHA256.new\n\n # If the user submits html were going to expect the\n #...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// SetIndexField sets the IndexField field's value.
[ "func (s *DeleteIndexFieldOutput) SetIndexField(v *IndexFieldStatus) *DeleteIndexFieldOutput {\n\ts.IndexField = v\n\treturn s\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Accepts the raw email as a string, including headers and body. Has to be called before the other functions are available. @param string $mail @return ParsedMail
[ "public function parse($mail)\n {\n // Initial\n /** @var Part $mailPart */\n $mailPart = $this->workAroundMissingBoundary(\n $this->partFactory->getPart($mail),\n $mail\n );\n\n $partTreeFactory = new PartTreeFactory($this->partFactory);\n $partTre...
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the sentence about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public EClass getIfcPropertyListValue() {\r\n\t\tif (ifcPropertyListValueEClass == null) {\r\n\t\t\tifcPropertyListValueEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)\r\n\t\t\t\t\t.getEClassifiers().get(404);\r\n\t\t}\r\n\t\treturn ifcPropertyListValueEClass;\r\n\t}" ]
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the sentence about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
saveTable @param string $name @param callable $callback @param bool $ifNotExists @param array $options @return AbstractTable
[ "public function saveTable($name, callable $callback, $ifNotExists = true, $options = [])\n {\n $options = $this->prepareBCOptions($options);\n\n return $this->getTable($name)->save($callback, $ifNotExists, $options);\n }" ]
[ "public static function MakeInsertRow (array $merge_row = [], $forced_obtain = false, $options = []) {\n\t\t$options += $options + static::GetDefaultOptions();\n\t\treturn DBI::MakeInsertRow($options, static::GetName(), $merge_row, $forced_obtain);\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:" }
Args: duration (float): start coordinate press duration (seconds) [[FBRoute POST:@"/wda/dragfromtoforduration"] respondWithTarget:self action:@selector(handleDragCoordinate:)],
[ "def swipe(self, x1, y1, x2, y2, duration=0):\n \n data = dict(fromX=x1, fromY=y1, toX=x2, toY=y2, duration=duration)\n return self.http.post('/wda/dragfromtoforduration', data=data)" ]
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
set IPv4 regexp and invalid string @param {Object} options Options object as passed to the constructor
[ "function(options) {\n inputEx.IPv4Field.superclass.setOptions.call(this, options);\n this.options.messages.invalid = inputEx.messages.invalidIPv4;\n this.options.regexp = /^(?:1\\d?\\d?|2(?:[0-4]\\d?|[6789]|5[0-5]?)?|[3-9]\\d?|0)(?:\\.(?:1\\d?\\d?|2(?:[0-4]\\d?|[6789]|5[0-5]?)?|[3-9]\\d?|0)){3}$/;\n...
[ "def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Submits request via curl, sets the response, then returns the response
[ "private function queryGoogle($url, $parameters)\n {\n if ($this->pagetoken !== null)\n {\n $parameters['pagetoken'] = $this->pagetoken;\n sleep($this->sleep);\n }\n\n // Couldn't seem to get http_build_query() to work right so...\n $querystring = '';\n\n ...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github summarization about Web development:", "pos": "Represent the Github code about Web development:", "neg": "Represent the Github code about programming:" }
// AddEntry adds a new entry to the bundle. It automatically adds additional transactions if the signature // message fragments don't fit into one transaction.
[ "func AddEntry(txs Bundle, bndlEntry BundleEntry) Bundle {\n\tbndlEntry = getBundleEntryWithDefaults(bndlEntry)\n\tprevLastIndex := uint64(len(txs))\n\tlastIndex := uint64(len(txs)-1) + bndlEntry.Length\n\ttag := PadTag(bndlEntry.Tag)\n\n\t// set new last index on existing txs\n\tfor i := range txs {\n\t\ttxs[i].La...
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Returns an Expression that evaluates this statement followed by the given expression.
[ "final Expression then(final Expression expression) {\n return new Expression(expression.resultType(), expression.features()) {\n @Override\n protected void doGen(CodeBuilder adapter) {\n Statement.this.gen(adapter);\n expression.gen(adapter);\n }\n };\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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// NewGetTaskDetails creates a new http.Handler for the get task details operation
[ "func NewGetTaskDetails(ctx *middleware.Context, handler GetTaskDetailsHandler) *GetTaskDetails {\n\treturn &GetTaskDetails{Context: ctx, Handler: handler}\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 description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Writes a reference :param ref_index: Local index (0-based) to the reference
[ "def write_reference(self, ref_index):\n \n self._writeStruct(\n \">BL\", 1, (self.TC_REFERENCE, ref_index + self.BASE_REFERENCE_IDX)\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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Creates abstraction using HTML :param str html: HTML :return: TreeOfContents object
[ "def fromHTML(html, *args, **kwargs):\n \n source = BeautifulSoup(html, 'html.parser', *args, **kwargs)\n return TOC('[document]',\n source=source,\n descendants=source.children)" ]
[ "def getElementsBy(self, cond: Callable[[Element], bool]) -> NodeList:\n \"\"\"\"\"\"\n return getElementsBy(self, cond)" ]
codesearchnet
{ "query": "Represent the summarization about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Validates self.server_url
[ "def _validate_server_url(self):\n \"\"\"\"\"\"\n try:\n request = requests.head(self.server_url)\n if request.status_code >= 400:\n raise InvenioConnectorServerError(\n \"Unexpected status code '%d' accessing URL: %s\"\n % (re...
[ "def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// AddInvVect adds an inventory vector to the message.
[ "func (msg *MsgGetData) AddInvVect(iv *InvVect) error {\n\tif len(msg.InvList)+1 > MaxInvPerMsg {\n\t\tstr := fmt.Sprintf(\"too many invvect in message [max %v]\",\n\t\t\tMaxInvPerMsg)\n\t\treturn messageError(\"MsgGetData.AddInvVect\", str)\n\t}\n\n\tmsg.InvList = append(msg.InvList, iv)\n\treturn nil\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Streams the input stream to the response.<p> @param response the response @param is the input stream @throws IOException in case writing to the response fails
[ "private void streamContent(HttpServletResponse response, InputStream is) throws IOException {\n\n OutputStream os = response.getOutputStream();\n try {\n byte buffer[] = new byte[DEFAULT_BUFFER_SIZE];\n int bytes;\n while ((bytes = is.read(buffer)) >= 0) {\n ...
[ "public void disconnect() {\n if (this.connection == null) {\n return;\n }\n\n try {\n if (this.rawInputStream == null) {\n this.rawInputStream = this.connection.getInputStream();\n }\n\n // We need to manually read from the raw input s...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
/* (non-Javadoc) @see com.ibm.websphere.cache.CacheAdminMBean#getCacheIDsOnDisk(java.lang.String, java.lang.String)
[ "@Override\n public String[] getCacheIDsOnDisk(String cacheInstance, String pattern) throws javax.management.AttributeNotFoundException {\n\n // Get the cache for this cacheInstance\n DCache cache1 = getCache(cacheInstance);\n\n //Throw exception if disk caching is not enabled. \n if...
[ "@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Get the query builder of the 'friend' model @return \Illuminate\Database\Eloquent\Builder
[ "private function getMutualFriendsQueryBuilder(Model $other)\n {\n $user1['friendships'] = $this->findFriendships(Status::ACCEPTED)->get(['sender_id', 'recipient_id']);\n $user1['recipients'] = $user1['friendships']->pluck('recipient_id')->all();\n $user1['senders'] = $user1['friendships']->...
[ "public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Add a competency to this course. @param int $courseid The id of the course @param int $competencyid The id of the competency @return bool
[ "public static function add_competency_to_course($courseid, $competencyid) {\n static::require_enabled();\n // Check the user have access to the course.\n self::validate_course($courseid);\n\n // First we do a permissions check.\n $context = context_course::instance($courseid);\n\...
[ "public function can_access_group(stdClass $user, int $groupid) : bool {\n if ($this->can_access_all_groups($user)) {\n // This user has access to all groups.\n return true;\n }\n\n // This is a group discussion for a forum in separate groups mode.\n // Check if the...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Update the value of the entity. @param BusinessPage $entity @param string $field @param string $value @return mixed
[ "protected function setEntityAttributeValue($entity, $field, $value)\n {\n $functionName = 'set'.ucfirst($field);\n\n call_user_func([$entity, $functionName], $value);\n }" ]
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// needed to avoid meta-linter errors (too many if conditions)
[ "func (o *setter) set(current interface{}, check predicate, apply applier) {\n\tif current == nil && (check == nil || check()) {\n\t\tapply()\n\t\to.isSet = true\n\t}\n}" ]
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Decorate ScanFunction. Look for session in scan by SessionParamId // and add session object in the end. If session is not found then return Not Found.
[ "func (s *ScanService) TakeSession(fn SessionFunction) ScanFunction {\n\treturn func(req *restful.Request, resp *restful.Response, sc *scan.Scan) {\n\t\tid := req.PathParameter(SessionParamId)\n\t\tif !s.IsId(id) {\n\t\t\tresp.WriteServiceError(http.StatusBadRequest, services.IdHexErr)\n\t\t\treturn\n\t\t}\n\n\t\to...
[ "@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:" }
Gets the generic table primary key. The $primaryKey parameter must contain: - name - column_name @param array $primaryKey The primary key. @return \Fridge\DBAL\Schema\PrimaryKey|null The generic primary key.
[ "protected function getGenericPrimaryKey(array $primaryKey)\n {\n $genericPrimaryKey = new PrimaryKey($primaryKey[0]['name']);\n\n foreach ($primaryKey as $primaryKeyColumn) {\n $genericPrimaryKey->addColumnName($primaryKeyColumn['column_name']);\n }\n\n return $genericPrim...
[ "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 text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Seek an iterator to the desired position, using binary search. @param index Index to search @param iter Iterator @param val Distance to search to
[ "protected static void binarySearch(ModifiableDoubleDBIDList index, DoubleDBIDListIter iter, double val) {\n // Binary search. TODO: move this into the DoubleDBIDList class.\n int left = 0, right = index.size();\n while(left < right) {\n final int mid = (left + right) >>> 1;\n final double curd =...
[ "protected void aggregateSpecial(T value, int bin) {\n final T exist = getSpecial(bin);\n // Note: do not inline above accessor, as getSpecial will initialize the\n // special variable used below!\n special[bin] = aggregate(exist, value);\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software Development:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic void eSet(int featureID, Object newValue) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.BBC__BCDO_NAME:\n\t\t\t\tsetBCdoName((String)newValue);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackage.BBC__TRIPLETS:\n\t\t\t\tgetTriplets().clear();\n\t\t\t\tgetTripl...
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the comment about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
Load services from bundles
[ "private function loadService()\n {\n $this->getEventManager()->dispatch(self::EVENT_BEFORE_LOAD_SERVICE, $this);\n\n foreach ($this->registerBundles() as $bundle) {\n $bundle->loadService();\n }\n\n $this->getEventManager()->dispatch(self::EVENT_AFTER_LOAD_SERVICE, $this);...
[ "def execPath(self):\n \"\"\"\"\"\"\n vers = self.version.label if self.version else None # executables in Versions folder are stored by baseVersion (modified by game data patches)\n return self.installedApp.exec_path(vers)" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Decorator to skip this call if we're in one of the skipped states.
[ "def skip_status(*skipped):\n \"\"\"\"\"\"\n def decorator(func):\n @functools.wraps(func)\n def _skip_status(self, *args, **kwargs):\n if self.status not in skipped:\n return func(self, *args, **kwargs)\n return _skip_status\n return decorator" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Execute an aggregate function on the database. @param string $function @param array $columns @return mixed
[ "public function aggregate( $function, $columns = ['*'] )\n\t{\n\t\t// Postgres doesn't like ORDER BY when there's no GROUP BY clause\n\t\tif ( !isset( $this->groups ) )\n\t\t\t$this->reOrderBy( null );\n\n\t\t$this->aggregate = compact( 'function', 'columns' );\n\n\t\t$previousColumns = $this->columns;\n\n\t\t// W...
[ "@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ...
codesearchnet
{ "query": "Represent the Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Auto Generated Code
[ "def overlay_gateway_sflow_sflow_vlan_action(self, **kwargs):\n \n config = ET.Element(\"config\")\n overlay_gateway = ET.SubElement(config, \"overlay-gateway\", xmlns=\"urn:brocade.com:mgmt:brocade-tunnels\")\n name_key = ET.SubElement(overlay_gateway, \"name\")\n name_key.text =...
[ "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 sentence about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about File management:" }
// SetPassword sets the Password field's value.
[ "func (s *CreateEndpointInput) SetPassword(v string) *CreateEndpointInput {\n\ts.Password = &v\n\treturn s\n}" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Copies the temp stream;
[ "public TempStream copy()\n {\n TempStream newStream = new TempStream();\n\n TempBuffer ptr = _head;\n\n for (; ptr != null; ptr = ptr.next()) {\n TempBuffer newPtr = TempBuffer.create();\n \n if (newStream._tail != null)\n newStream._tail.next(newPtr);\n else\n newStream...
[ "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:" }
// SetRegexMatchSet sets the RegexMatchSet field's value.
[ "func (s *GetRegexMatchSetOutput) SetRegexMatchSet(v *RegexMatchSet) *GetRegexMatchSetOutput {\n\ts.RegexMatchSet = 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 instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
plugins list installed plugins Example: $ heroku plugins === Installed Plugins heroku-production-check@0.2.0
[ "def index\n validate_arguments!\n\n plugins = ::Heroku::Plugin.list\n\n if plugins.length > 0\n styled_header(\"Installed Plugins\")\n styled_array(plugins)\n end\n ::Heroku::JSPlugin.list\n end" ]
[ "def hibernate(app):\n \"\"\"\"\"\"\n log(\"The database backup URL is...\")\n backup_url = data.backup(app)\n log(backup_url)\n\n log(\"Scaling down the web servers...\")\n heroku_app = HerokuApp(app)\n heroku_app.scale_down_dynos()\n\n log(\"Removing addons...\")\n\n addons = [\n ...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Writing/editing:" }
// SetValue sets the Value field's value.
[ "func (s *AttributeValueUpdate) SetValue(v *AttributeValue) *AttributeValueUpdate {\n\ts.Value = v\n\treturn s\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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Gets the default element view for the explorer.<p> @return the default element view for the explorer
[ "@PrefMetadata(type = CmsExplorerElementViewPreference.class)\n public String getExplorerElementView() {\n\n return m_settings.getAdditionalPreference(CmsElementViewPreference.EXPLORER_PREFERENCE_NAME, false);\n }" ]
[ "function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Removes generated 'node' data_bag locally
[ "def remove_local_node_data_bag():\n \"\"\"\"\"\"\n node_data_bag_path = os.path.join('data_bags', 'node')\n if os.path.exists(node_data_bag_path):\n shutil.rmtree(node_data_bag_path)" ]
[ "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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Delete a key from the cache @param string $key Identifier for the data @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed
[ "public function delete($key)\n {\n $key = $this->_key($key);\n\n return $this->_Redis->delete($key) > 0;\n }" ]
[ "public function item()\n {\n if (!empty($this->response['data'])) {\n return new Fluent($this->resource, $this->response['data']);\n }\n\n // On a valid response that does not have a data field, we can assume that\n // the request is an update/delete type of request that d...
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Removes FeaturedTutorialSkills from Video @param mixed $id @param mixed $data @return PayloadInterface
[ "public function removeFeaturedTutorialSkills($id, $data) {\n\t\t// find\n\t\t$model = $this->get($id);\n\n\t\tif ($model === null) {\n\t\t\treturn new NotFound(['message' => 'Video not found.']);\n\t\t}\n\n\t\t// pass remove to internal logic\n\t\ttry {\n\t\t\t$this->doRemoveFeaturedTutorialSkills($model, $data);\...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Marshall the given parameter object.
[ "public void marshall(DeleteAppRequest deleteAppRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (deleteAppRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(deleteAppRequest....
[ "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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
This method should be used when you’re wanting to retrieve all of the images for a particular movie. @param movieId movieId @param language language @return @throws MovieDbException exception
[ "public ResultList<Artwork> getMovieImages(int movieId, String language) throws MovieDbException {\n return tmdbMovies.getMovieImages(movieId, language);\n }" ]
[ "@Help(help = \"Find the object of type {#} through the id\")\n public T findById(final String id) throws SDKException {\n return (T) requestGet(id, clazz);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// ListImages lists existing images.
[ "func (s *Server) ListImages(ctx context.Context, req *pb.ListImagesRequest) (resp *pb.ListImagesResponse, err error) {\n\tconst operation = \"list_images\"\n\tdefer func() {\n\t\trecordOperation(operation, time.Now())\n\t\trecordError(operation, err)\n\t}()\n\n\tlogrus.Debugf(\"ListImagesRequest: %+v\", req)\n\tfi...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Create ASTRA objects.
[ "def create_ids(self):\n \"\"\"\"\"\"\n # Create input and output arrays\n if self.geometry.motion_partition.ndim == 1:\n motion_shape = self.geometry.motion_partition.shape\n else:\n # Need to flatten 2- or 3-dimensional angles into one axis\n motion_sha...
[ "@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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Return the slide identifier associated with *slide_part* in this presentation.
[ "def slide_id(self, slide_part):\n \n for sldId in self._element.sldIdLst:\n if self.related_parts[sldId.rId] is slide_part:\n return sldId.id\n raise ValueError('matching slide_part not found')" ]
[ "def add_reference(self, reftype: str, label: str, target):\n \n\n # The self.data[reftype] dict springs into being during the\n # register_references event handler at startup, which looks in the\n # kb registry for all registered reference names.\n self.data[reftype][label] = tar...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// newEvictions returns a Evictions
[ "func newEvictions(c *PolicyV1beta1Client, namespace string) *evictions {\n\treturn &evictions{\n\t\tclient: c.RESTClient(),\n\t\tns: namespace,\n\t}\n}" ]
[ "public Descriptor replaceAllTopicCalls(PSequence<TopicCall<?>> topicCalls) {\n return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
throw_statement : THROW expr SEMI | THROW expr AUTOSEMI
[ "def p_throw_statement(self, p):\n \n p[0] = self.asttypes.Throw(expr=p[2])\n p[0].setpos(p)" ]
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Logs given throwable object (exception, error) in log output file @param \Throwable $throwable
[ "public function log(\\Throwable $throwable): void\n {\n $date = (new \\DateTime())->format('Y-m-d H:i:s');\n $log = \"[$date] {$throwable->getMessage()} at line {$throwable->getLine()} in {$throwable->getFile()}\" . PHP_EOL;\n $dirname = dirname($this->logPath);\n\n if (!is_dir($dirn...
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Get attribute value cross-browser. Returns the attribute as string if found, otherwise returns false @param {Object} obj @param {String} attr @return {boolean || string}
[ "function getAttr(obj, attr) {\n if (!obj || !isset(obj)) {\n return false;\n }\n var ret;\n if (obj.getAttribute) {\n ret = obj.getAttribute(attr);\n }\n else\n if (obj.getAttributeNode) {\n ret = obj.getAttributeNode(attr).value;\n }\n if (isset(ret) && ret !== '') ...
[ "function makeEventDispatcher(obj) {\n $.extend(obj, {\n on: on,\n off: off,\n one: one,\n trigger: trigger,\n _EventDispatcher: true\n });\n // Later, on() may add _eventHandlers: Object.<string, Array.<{event:string, namespace:?string,\n ...
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Update the total, if the tax is not inclusive the total gets altered @param float $total
[ "public function updateTotal(&$total) {\n $rate = (float)self::config()->get('tax_rate') / 100;\n $tax = $total * $rate;\n $this->setPriceModification($tax);\n if (!(bool)self::config()->get('inclusive')) {\n $total += $tax;\n }\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 text about invoice calculation:", "pos": "Represent the code about invoice calculation:", "neg": "Represent the code:" }
Creates a post request and return the response data
[ "def _create_delete_request(self, resource, billomat_id):\n \n assert (isinstance(resource, str))\n\n if isinstance(billomat_id, int):\n billomat_id = str(billomat_id)\n\n response = self.session.delete(\n url=self.api_url + resource + '/' + billomat_id,\n )\...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github description about Web development:", "pos": "Represent the Github code about Web development:", "neg": "Represent the Github code about programming:" }
function for looking up a specific portion of the navMap using a location array or a title
[ "function getNavMap(navMap, searchTerm, portion){\n\n\t\tlet returnMap = navMap;\n\n\n\t\tif (!isset(searchTerm) || is_array(searchTerm) && searchTerm.length === 0){\n\t\t\t//if the search term is an empty array, it will return the full nav map (excluding ROOT)\n\t\t\treturn returnMap;\n\t\t}\n\n\t\t//code for when...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Decode accepts a packed byte array and populates the fields of the AttitudeQuaternion
[ "func (m *AttitudeQuaternion) Decode(buf []byte) {\n\tdata := bytes.NewBuffer(buf)\n\tbinary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS)\n\tbinary.Read(data, binary.LittleEndian, &m.Q1)\n\tbinary.Read(data, binary.LittleEndian, &m.Q2)\n\tbinary.Read(data, binary.LittleEndian, &m.Q3)\n\tbinary.Read(data, binary...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }