query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Load a Perseus processed data table
:param f: Source file
:return: Pandas dataframe of imported data | [
"def read_perseus(f):\n \n df = pd.read_csv(f, delimiter='\\t', header=[0,1,2,3], low_memory=False)\n df.columns = pd.MultiIndex.from_tuples([(x,) for x in df.columns.get_level_values(0)])\n return df"
] | [
"def usufyToCsvExport(d, fPath):\n \n\n from pyexcel_io import get_data\n try:\n oldData = {\"OSRFramework\": get_data(fPath) }\n except:\n # No information has been recovered\n oldData = {\"OSRFramework\":[]}\n\n # Generating the new tabular data.\n tabularData = _generateTab... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// sendHandshake sends handshake message to conn. | [
"func sendHandshake(conn *net.TCPConn, infoHash, peerID []byte) error {\n\tdata := make([]byte, 68)\n\tcopy(data[:28], handshakePrefix)\n\tcopy(data[28:48], infoHash)\n\tcopy(data[48:], peerID)\n\n\tconn.SetWriteDeadline(time.Now().Add(time.Second * 10))\n\t_, err := conn.Write(data)\n\treturn err\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 text about consul address:",
"pos": "Represent the Github code about consul address:",
"neg": "Represent the Github code:"
} |
Overloaded to track all templates used in the current request
{@inheritDoc} | [
"public function process($item, $arguments = null, $inheritedScope = null)\n {\n self::trackTemplateUsed($this->chosen);\n return parent::process($item, $arguments, $inheritedScope);\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:"
} |
// ClientPause stops the server processing commands from clients for some time. | [
"func (r *Redis) ClientPause(timeout uint64) error {\n\trp, err := r.ExecuteCommand(\"CLIENT\", \"PAUSE\", timeout)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn rp.OKValue()\n}"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about File management:"
} |
Send a private message to a player (specified in
Notification::$receiverName).
@param Notification $n
@deprecated since version 3.1.0 | [
"function postPrivateNotification(Notification $n)\n\t{\n\t\treturn $this->manialinkPublisher->postPrivateNotification($n->message, $n->receiverName, $n->link);\n\t}"
] | [
"final protected function fc($k = null, $d = null) {return dfak(\n\t\t/** 2017-12-12 @todo Should we care of a custom `config_path` or not? https://mage2.pro/t/5148 */\n\t\tdf_config_field($this->getPath())->getData(), $k, $d\n\t);}"
] | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
判断并生成最新的版本目录
@param getDir | [
"function existDir(getDir) {\n fs.exists(getDir, (exists) => {\n if (exists) {\n existDir(`${dir}/${getVersion()}`);\n } else {\n callBack(_baseVersion.join('.'));\n }\n });\n }"
] | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Calculates the RMSD value for superposition of y onto x. This requires
the coordinates to be precentered.
@param x
3d points of reference coordinate set
@param y
3d points of coordinate set for superposition | [
"private void calcRmsd(Point3d[] x, Point3d[] y) {\n\t\tif (centered) {\n\t\t\tinnerProduct(y, x);\n\t\t} else {\n\t\t\t// translate to origin\n\t\t\txref = CalcPoint.clonePoint3dArray(x);\n\t\t\txtrans = CalcPoint.centroid(xref);\n\t\t\tlogger.debug(\"x centroid: \" + xtrans);\n\t\t\txtrans.negate();\n\t\t\tCalcPo... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Sets the buttonmode
@param string $mode
@throws InvalidArgumentException
@return UiButton | [
"public function setMode($mode)\n {\n $modelist = [\n 'ajax',\n 'full'\n ];\n\n if (!in_array($mode, $modelist)) {\n Throw new ControlException('Wrong mode for UiButton.', 1000);\n }\n\n $this->mode = $mode;\n\n return $this;\n }"
] | [
"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 instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// If applies a filter func to a resource reducer; rejected resources are not processed by the receiving reducer. | [
"func (rf Reducer) If(f func(*mesos.Resource) bool) Reducer {\n\tif f == nil {\n\t\treturn rf\n\t}\n\treturn func(acc, x *mesos.Resource) *mesos.Resource {\n\t\tif f(x) {\n\t\t\treturn rf(acc, x)\n\t\t}\n\t\treturn acc\n\t}\n}"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the sentence about Technology:",
"pos": "Represent the code about Technology:",
"neg": "Represent the code about File management:"
} |
Sends server response.
@param response | [
"protected void sendServerResponse(HttpMessage response) {\n runner.http(action -> action.server(httpServer).send()\n .response(response.getStatusCode())\n .message(response));\n }"
] | [
"def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
{@inheritdoc}
@throws \InvalidArgumentException | [
"protected function doSet(string $key, $value, int $ttl = 0)\n {\n if ($ttl > 0) {\n $ttl = \\time() + $ttl;\n }\n\n $filename = $this->getFilename($key);\n $content = '<?php /* ' . Serialize::encode([\n 'value' => $value,\n 'expire' => $ttl,\n... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Receives a named route and returns true or false depending
if the current URL is equal to the named route provided.
@param string $route
@param string|NULL $active
@return string | [
"public function isRoute($route, $active = NULL)\n\t{\n\t\t$this->setActive($active);\n\t\treturn ($this->request->routeIs($route) ? $this->active : '');\n\t}"
] | [
"private function registerRoute($folders, $type, $class = null, array $parameters = []) {\n\n // The values associated with a route are as follows:\n // $route = new Route($this->router);\n $route = new Route();\n\n $this->updateRoute($route, $type, $class, $parameters);\n\n // $r... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Add colour scale to heatmap. | [
"def add_mpl_colorscale(fig, heatmap_gs, ax_map, params, title=None):\n \"\"\"\"\"\"\n # Set tick intervals\n cbticks = [params.vmin + e * params.vdiff for e in (0, 0.25, 0.5, 0.75, 1)]\n if params.vmax > 10:\n exponent = int(floor(log10(params.vmax))) - 1\n cbticks = [int(round(e, -expone... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@return array
@todo once we upgrade to PHP 5.6+ this can be moved to a constant. | [
"public static function map()\n {\n return [\n OrganizerCreated::class => 'application/vnd.cultuurnet.udb3-events.organizer-created+json',\n OrganizerCreatedWithUniqueWebsite::class => 'application/vnd.cultuurnet.udb3-events.organizer-created-with-unique-website+json',\n O... | [
"public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
To be called from lib/setup.php only! | [
"public static function store_default_php_timezone() {\n if ((defined('PHPUNIT_TEST') and PHPUNIT_TEST)\n or defined('BEHAT_SITE_RUNNING') or defined('BEHAT_TEST') or defined('BEHAT_UTIL')) {\n // We want all test sites to be consistent by default.\n self::$defaultphptimezone... | [
"def check_dependee_exists(self, depender, dependee, dependee_id):\n\t\t\n\t\tshutit_global.shutit_global_object.yield_to_draw()\n\t\t# If the module id isn't there, there's a problem.\n\t\tif dependee is None:\n\t\t\treturn 'module: \\n\\n' + dependee_id + '\\n\\nnot found in paths: ' + str(self.host['shutit_modul... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// GetEtcdAddress returns the address for etcd | [
"func (args MasterArgs) GetEtcdAddress() (*url.URL, error) {\n\tif args.EtcdAddr.Provided {\n\t\treturn args.EtcdAddr.URL, nil\n\t}\n\n\t// Etcd should be reachable on the same address that the master is (for simplicity)\n\tmasterAddr, err := args.GetMasterAddress()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\... | [
"func getEnterpriseResourceIter(context structs.Context, _ *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {\n\t// If we have made it here then it is an error since we have exhausted all\n\t// open source contexts.\n\treturn nil, fmt.Errorf(\"context mus... | codesearchnet | {
"query": "Represent the Github post about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Software development:"
} |
// AddDefaultAnimation adds an animation which is used when no other animation is playing. | [
"func (ac *AnimationComponent) AddDefaultAnimation(action *Animation) {\n\tac.AddAnimation(action)\n\tac.def = action\n}"
] | [
"function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element i... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Parse a GNU-style option string.
@param string $string the option string
@return Option[]
@throws \InvalidArgumentException | [
"public function parseString($string)\n {\n if (!mb_strlen($string)) {\n throw new \\InvalidArgumentException('Option string must not be empty');\n }\n $options = array();\n $eol = mb_strlen($string) - 1;\n $nextCanBeColon = false;\n for ($i = 0; $i <= $eol; +... | [
"public static function Strict(&$data, $key)\n {\n if ($data instanceof DataPacket)\n $data = $data->get();\n\n if (!(in_array($key, array_keys($data))))\n Throw New \\CatapultApiException(\"You must add $key to call this function\");\n }"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software Development:"
} |
// SetDataRearrangement sets the DataRearrangement field's value. | [
"func (s *DataSource) SetDataRearrangement(v string) *DataSource {\n\ts.DataRearrangement = &v\n\treturn s\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
onCall handler of plugin
@param {string} method Caller method, accept GET only.
@param {string} path Plugin URL path
@param {object} args parameters of this call
@return {object} Returns a Promise object or object containing the result | [
"function onProcCall(method, path /* devid , propname*/, args) {\n switch (method) {\n case 'GET':\n return onProcCallGet(method, path /* devid , propname*/, args);\n /* case 'POST' :\n if(devid!='settings' || args == undefined)\n return {error:'The format is wrong for settings.'};... | [
"function initCreate (args) {\n // method name is moduleNameCreate\n var methodName = `${this.name}Create`\n // method signature is moduleName.methodname\n var methodSignature = `${this.moduleName}.${methodName}`\n // capture model to pass to function\n var model = this\n // add create method t... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
@param ReflectionClass $controller
@param ReflectionMethod $method
@return string | [
"protected function getRouteGroup(ReflectionClass $controller, ReflectionMethod $method)\n {\n // @group tag on the method overrides that on the controller\n $docBlockComment = $method->getDocComment();\n if ($docBlockComment) {\n $phpdoc = new DocBlock($docBlockComment);\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 Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
/*
Method: compute
Computes nodes' positions. | [
"function(property, computeLevels) {\n var prop = property || 'start';\n var node = this.graph.getNode(this.root);\n $.extend(node, {\n 'drawn' : true,\n 'exist' : true,\n 'selected' : true\n });\n NodeDim.compute(this.graph, prop, this.config);\n if (!!computeLeve... | [
"public void setLossVariables(String... lossVariableNames){\n this.lossVariables.clear();\n for(String s : lossVariableNames){\n addLossVariable(s);\n }\n //After changing loss function variables, we (probably) need to recreate gradient function - as gradient\n // funct... | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Generates a hex X509_NAME hash (like openssl x509 -hash -in cert.pem)
Based on openssl's crypto/x509/x509_cmp.c line 321 | [
"protected static String openssl_X509_NAME_hash(X500Principal p) throws Exception {\n // This code replicates OpenSSL's hashing function\n // DER-encode the Principal, MD5 hash it, then extract the first 4 bytes and reverse their positions\n byte[] derEncodedSubject = p.getEncoded();\n b... | [
"def add_cert(self, cert):\n \n if not isinstance(cert, X509):\n raise TypeError(\"cert should be X509\")\n libcrypto.X509_STORE_add_cert(self.store, cert.cert)"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Analog of :func:`check_frequencies` for ``pfeed.meta`` | [
"def check_meta(pfeed, *, as_df=False, include_warnings=False):\n \n table = 'meta'\n problems = []\n\n # Preliminary checks\n if pfeed.meta is None:\n problems.append(['error', 'Missing table', table, []])\n else:\n f = pfeed.meta.copy()\n problems = check_for_required_column... | [
"def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Return (left,bottom,right,top) as a tuple. | [
"def lbrt(self):\n \"\"\"\"\"\"\n return self._left, self._bottom, self._right, self._top"
] | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
@param string|null $namespace
@param array<string> $aliased_classes
@param string|null $this_class
@param int $php_major_version
@param int $php_minor_version
@return null|string | [
"public function toPhpString(\n $namespace,\n array $aliased_classes,\n $this_class,\n $php_major_version,\n $php_minor_version\n ) {\n return $php_major_version >= 7 && $php_minor_version >= 1 ? $this->getKey() : null;\n }"
] | [
"public function addType(string $name, string $type): void{\n $this->types[$name] = new Type($type);\n }"
] | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Programming:"
} |
Render a model.
@param ModelInterface $model The model to render.
@param EnvironmentInterface $environment Current environment.
@return void | [
"protected function renderModel(ModelInterface $model, EnvironmentInterface $environment)\n {\n $event = new FormatModelLabelEvent($environment, $model);\n $environment->getEventDispatcher()->dispatch(\n DcGeneralEvents::FORMAT_MODEL_LABEL,\n $event\n );\n\n $mod... | [
"public function setTable($table)\n {\n if (!is_array($table)\n && !($table instanceof DataTableInterface)\n ) {\n throw new Exception(\"DataTable renderers renderer accepts only DataTable, Simple and Map instances, and arrays.\");\n }\n $this->table = $table;\n ... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
// Remove the specified filter. | [
"func (self *StandardFilterer) RemoveFilter(filter Filter) {\n\tif self.filters.SetContains(filter) {\n\t\tself.filters.SetRemove(filter)\n\t}\n}"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github text about Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code about programming:"
} |
Finds the first node with no incoming links. | [
"private DNode calculateSourceNode() {\r\n DNode result = DNode.NOT_FOUND;\r\n \r\n for (DNode node : nodes) {\r\n List<DLink> links = getLinksTo(node);\r\n if (links.size() == 0) {\r\n result = node;\r\n break;\r\n }\r\n }\r... | [
"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 instruction about Networking:",
"pos": "Represent the code about Networking:",
"neg": "Represent the code:"
} |
Get the group of nodes associated to a given node.
@param u the node
@return the associated group of nodes if exists. An empty set otherwise | [
"public Collection<Node> getAssociatedPGroup(Node u) {\n for (Collection<Node> pGrp : pGroups) {\n if (pGrp.contains(u)) {\n return pGrp;\n }\n }\n return Collections.emptySet();\n }"
] | [
"function createGraph(options) {\n // Graph structure is maintained as dictionary of nodes\n // and array of links. Each node has 'links' property which\n // hold all links related to that node. And general links\n // array is used to speed up all links enumeration. This is inefficient\n // in terms of memory,... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Handles NTPv4 extensions and MAC part (when authentication is used.) | [
"def guess_payload_class(self, payload):\n \n plen = len(payload)\n\n if plen > _NTP_AUTH_MD5_TAIL_SIZE:\n return NTPExtensions\n elif plen == _NTP_AUTH_MD5_TAIL_SIZE:\n return NTPAuthenticator\n\n return Packet.guess_payload_class(self, payload)"
] | [
"def get_finished_record_bytes(cls, tls_version: TlsVersionEnum) -> bytes:\n \n # TODO(AD): The ROBOT poc script uses the same Finished record for all possible client hello (default, GCM,\n # etc.); as the Finished record contains a hashes of all previous records, it will be wrong and will caus... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Session returns a VTGateSession that can be used to access V3 functions. | [
"func (conn *VTGateConn) Session(targetString string, options *querypb.ExecuteOptions) *VTGateSession {\n\treturn &VTGateSession{\n\t\tsession: &vtgatepb.Session{\n\t\t\tTargetString: targetString,\n\t\t\tOptions: options,\n\t\t\tAutocommit: true,\n\t\t},\n\t\timpl: conn.impl,\n\t}\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 post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SetRoleARN sets the RoleARN field's value. | [
"func (s *ScalableTarget) SetRoleARN(v string) *ScalableTarget {\n\ts.RoleARN = &v\n\treturn s\n}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Filter a set of records by the conditions
@param [Enumerable] records
The set of records to be filtered
@return [Enumerable]
Whats left of the given array after the matching
@api semipublic | [
"def match_records(records)\n conditions = self.conditions\n records.select { |record| conditions.matches?(record) }\n end"
] | [
"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 comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// Subscribe provides a mock function with given fields: _a0 | [
"func (_m *DiagnosticsMessageSubscriber) Subscribe(_a0 appinsights.DiagnosticsMessageHandler) appinsights.DiagnosticsMessageListener {\n\tret := _m.Called(_a0)\n\n\tvar r0 appinsights.DiagnosticsMessageListener\n\tif rf, ok := ret.Get(0).(func(appinsights.DiagnosticsMessageHandler) appinsights.DiagnosticsMessageLis... | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
We don't allow integer or float indexing on datetime-like when using
loc.
Parameters
----------
key : label of the slice bound
kind : {'ix', 'loc', 'getitem', 'iloc'} or None | [
"def _convert_scalar_indexer(self, key, kind=None):\n \n\n assert kind in ['ix', 'loc', 'getitem', 'iloc', None]\n\n # we don't allow integer/float indexing for loc\n # we don't allow float indexing for ix/getitem\n if is_scalar(key):\n is_int = is_integer(key)\n ... | [
"def convert_missing_indexer(indexer):\n \n\n if isinstance(indexer, dict):\n\n # a missing key (but not a tuple indexer)\n indexer = indexer['key']\n\n if isinstance(indexer, bool):\n raise KeyError(\"cannot use a single bool to index into setitem\")\n return indexer, T... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
stitch delta together in reverse | [
"private BlockedDelta reverseCompute() {\n int contentSize = getValue(_next).remaining();\n UUID correctChangeId = getChangeId(_next);\n int numBlocks = 1;\n\n if (_list == null) {\n _list = Lists.newArrayListWithCapacity(3);\n }\n\n _list.add(_next);\n\n\n ... | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Sets the property on the given object to the new value
@param object on which to set the property
@param newValue the new value of the property
@throws RuntimeException if the property could not be set | [
"public void setProperty(final Object object, Object newValue) {\n AccessPermissionChecker.checkAccessPermission(field);\n final Object goalValue = DefaultTypeTransformation.castToType(newValue, field.getType());\n\n if (isFinal()) {\n throw new GroovyRuntimeException(\"Cannot set th... | [
"protected static RuntimeException unsettable(String view, String attribute, boolean create) {\n // This matches the behavior of the real file system implementations: if the attempt to set the\n // attribute is being made during file creation, throw UOE even though the attribute is one\n // that cannot be ... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Computer Science:"
} |
qualifierType_2 : ':' dataType
| ':' dataType defaultValue | [
"def p_qualifierType_2(p):\n \n dv = None\n if len(p) == 4:\n dv = p[3]\n p[0] = (p[2], False, None, dv)"
] | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// DemoteMaster will gracefully demote a master mysql instance to read only.
// If the master is still alive, then we need to demote it gracefully
// make it read-only, flush the writes and get the position | [
"func (mysqld *Mysqld) DemoteMaster() (rp mysql.Position, err error) {\n\tcmds := []string{\n\t\t\"FLUSH TABLES WITH READ LOCK\",\n\t\t\"UNLOCK TABLES\",\n\t}\n\tif err = mysqld.ExecuteSuperQueryList(context.TODO(), cmds); err != nil {\n\t\treturn rp, err\n\t}\n\treturn mysqld.MasterPosition()\n}"
] | [
"boolean detectAndHandleBackupTimeout(long timeoutMillis) {\n // if the backups have completed, we are done; this also filters out all non backup-aware operations\n // since the backupsAcksExpected will always be equal to the backupsAcksReceived\n boolean backupsCompleted = backupsAcksExpected ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Receives a page in a different language tree, and tries to return the corresponding page in the current language tree.
@return int|null | [
"public function getTranslatedPageID($page)\n {\n $ids = static::getIDList();\n if (in_array($page->getCollectionID(), $ids)) {\n return $this->locale->getSiteTree()->getSiteHomePageID();\n }\n\n $mpRelationID = self::getMultilingualPageRelationID($page->getCollectionID());... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
/*
Compute and validate the offsets of the fields in the list and will set the fields computedOffset.
Will validate the blockLength of the fields encompassing <message> or <group> and recursively
descend into repeated groups. | [
"private static int computeAndValidateOffsets(final Node node, final List<Field> fields, final int blockLength)\n {\n boolean variableLengthBlock = false;\n int offset = 0;\n\n for (final Field field : fields)\n {\n if (0 != field.offset() && field.offset() < offset)\n ... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
@param ClassName $className
@return ClassName|null | [
"protected function usedClass(ClassName $className)\n {\n foreach ($this->usedClasses() as $tuple) {\n list($usedClass, $as) = $tuple;\n if ($this->comparator()->equals($as, $className)) {\n return $usedClass;\n }\n }\n\n return null;\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 instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about File management:"
} |
Output an progress message in whatever format.
@param string $message the message to output.
@param integer $depth indent depth for this message. | [
"public function output($message, $depth = 0) {\n foreach ($this->traces as $trace) {\n $trace->output($message, $depth);\n }\n }"
] | [
"function LogDraft(console, methodName) {\n this._stream = console._stdout\n this._styleFn = console[methodName]\n\n // Valid flag. If set to false, should NOT write anymore\n this.valid = true\n\n // Save line where content will be saved\n this.saveLine()\n}"
] | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Computer Science:"
} |
Search nodes in an interative way. Matches are being yield as
they are being found. This avoids to scan the full tree
topology before returning the first matches. Useful when
dealing with huge trees. | [
"def iter_search_nodes(self, **conditions):\n \n for n in self.traverse():\n conditions_passed = 0\n for key, value in six.iteritems(conditions):\n if hasattr(n, key) and getattr(n, key) == value:\n conditions_passed +=1\n if condition... | [
"def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Read data on a pipe
Used to capture stdout data produced by libiperf
:param pipe_out: The os pipe_out
:rtype: unicode string | [
"def read_pipe(pipe_out):\n \n out = b''\n while more_data(pipe_out):\n out += os.read(pipe_out, 1024)\n\n return out.decode('utf-8')"
] | [
"def service_start(name):\n '''\n \n '''\n cmd = 'start ' + name\n\n # Send the command to execute\n out, err = DETAILS['server'].sendline(cmd)\n\n # \"scrape\" the output and return the right fields as a dict\n return parse(out)"
] | codesearchnet | {
"query": "Represent the post about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Gets the client's user agent for API calls
@return string | [
"private function getUserAgent()\n {\n $curlinfo = curl_version();\n $uagent = array();\n $uagent[] = 'gocardless-pro-php/3.0.0';\n $uagent[] = 'schema-version/2015-07-06';\n $uagent[] = 'GuzzleHttp/' . \\GuzzleHttp\\Client::VERSION;\n $uagent[] = 'php/' . phpversion();\... | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
/*
@Override
public void onCloseRead()
{
super.onCloseRead();
_conn.closeRead();
}
@Override
public void onCloseConnection()
{
super.onCloseConnection();
}
@Override
public void onTimeout()
{
System.out.println("TIMEOUT: " + context);
} | [
"@Override\n public InRequest newInRequest()\n {\n RequestHttp2 request = _freeRequest.allocate();\n \n if (request == null) {\n request = new RequestHttp2(_httpProtocol);\n /*\n connTcp(),\n _httpContainer,\n ... | [
"public void onTimerEvent(TimerEvent event, ActivityContextInterface aci) {\n\t\t// time to refresh :)\n\t\t\n\t\tif (getSubscribeRequestTypeCMP() != null) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tDialogActivity da = (DialogActivity) aci.getActivity();\n\t\t\tRequest refreshSubscribe = createRefresh(da, getSubsc... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Language and Writing:"
} |
Faster than RecordType.valueof() | [
"private static RecordType typeFromChar(char recChar) {\n for (int i=0; i < numRecChars; i++) {\n if (recordChars[i] == recChar) {\n return recordTypes[i];\n }\n }\n \n throw new BitsyException(BitsyErrorCodes.INTERNAL_ERROR, \"Unrecognized record typ... | [
"def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Set scenario
@param string $scenario
@return SharedDataInterface | [
"public function setScenario($scenario) {\n $scenarios = [static::SCENARIO_OVERWRITE, static::SCENARIO_WRITE_ONCE, static::SCENARIO_MERGE];\n if (in_array($scenario, $scenarios)) {\n $this->scenario = $scenario;\n }\n return $this;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
set the email address of the author of the item who created the item
@param string $author author of rss feed item
@return \stubbles\xml\rss\RssFeedItem | [
"public function byAuthor(string $author): self\n {\n if (!strstr($author, '@')) {\n $this->author = 'nospam@example.com (' . $author . ')';\n } else {\n $this->author = $author;\n }\n\n return $this;\n }"
] | [
"def syncItems(self):\n \n if 'sync-target' not in self.provides:\n raise BadRequest('Requested syncList for device which do not provides sync-target')\n\n return self._server.syncItems(client=self)"
] | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
// MonthAbbreviated returns the locales abbreviated month given the 'month' provided | [
"func (ug *ug) MonthAbbreviated(month time.Month) string {\n\treturn ug.monthsAbbreviated[month]\n}"
] | [
"func parseDay(buff []byte, cursor *int, l int) (int, error) {\n\t// XXX : this is a relaxed constraint\n\t// XXX : we do not check if valid regarding February or leap years\n\t// XXX : we only checks that day is in range [01 -> 31]\n\t// XXX : in other words this function will not rant if you provide Feb 31th\n\tr... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about datetime:"
} |
Execute the console command. | [
"public function fire()\n {\n $this->line('Sending SMS via Twilio to: '.$this->argument('phone'));\n\n // Grab the text option if specified\n $text = $this->option('text');\n\n // If we havent specified a message, setup a default one\n if (is_null($text)) {\n $text =... | [
"def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// NewMasterParticipation is part of the topo.Server interface | [
"func (c *Conn) NewMasterParticipation(name, id string) (topo.MasterParticipation, error) {\n\tc.factory.mu.Lock()\n\tdefer c.factory.mu.Unlock()\n\n\t// Make sure the global path exists.\n\telectionPath := path.Join(electionsPath, name)\n\tif n := c.factory.getOrCreatePath(c.cell, electionPath); n == nil {\n\t\tre... | [
"@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 sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Calculate accuracy.
:param TP: true positive
:type TP : int
:param TN: true negative
:type TN : int
:param FP: false positive
:type FP : int
:param FN: false negative
:type FN : int
:return: accuracy as float | [
"def ACC_calc(TP, TN, FP, FN):\n \n try:\n result = (TP + TN) / (TP + TN + FN + FP)\n return result\n except ZeroDivisionError:\n return \"None\""
] | [
"def evaluation_metrics(predicted, actual, bow=True):\n \n if bow:\n p = set(predicted)\n a = set(actual)\n\n true_positive = 0\n for token in p:\n if token in a:\n true_positive += 1\n else:\n # shove actual into a hash, count up the unique occu... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
Initialize a OriginalClearSkyCondition from an analysis_period | [
"def from_analysis_period(cls, analysis_period, clearness=1,\n daylight_savings_indicator='No'):\n \"\"\"\"\"\"\"\n _check_analysis_period(analysis_period)\n return cls(analysis_period.st_month, analysis_period.st_day, clearness,\n daylight_savings_... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Set or remove the fragment part of this URI.
@param string $fragment
@return UriBuilder | [
"public function fragment($fragment)\n\t{\n\t\t$this->fragment = ($fragment === NULL || $fragment == '') ? NULL : (string)$fragment;\n\t\t\n\t\treturn $this;\n\t}"
] | [
"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 comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about File management:"
} |
Sets the omega parameter value, which controls the shape of the kernel
@param omega the positive parameter value | [
"public void setOmega(double omega)\n {\n if(omega <= 0 || Double.isNaN(omega) || Double.isInfinite(omega))\n throw new ArithmeticException(\"omega must be positive, not \" + omega);\n this.omega = omega;\n this.cnst = Math.sqrt(Math.pow(2, 1/omega)-1);\n }"
] | [
"def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Delete the MemberPassword objects that are associated to this user
@return $this | [
"protected function deletePasswordLogs()\n {\n foreach ($this->LoggedPasswords() as $password) {\n $password->delete();\n $password->destroy();\n }\n\n return $this;\n }"
] | [
"def _unlinkUser(self):\n \n KEY = \"linked_contact_uid\"\n\n # Nothing to do if no user is linked\n if not self.hasUser():\n return False\n\n user = self.getUser()\n username = user.getId()\n\n # Unset the UID from the User Property\n user.setMembe... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// NewLogger creates a new Logger. prefixes is a prefix-string-to-text-style
// mapping. The log prefix is colored using this table. If no entry is found in
// prefixes, defaultStyle is used.
//
// By default, no prefix is registered to any text style. | [
"func NewLogger(prefixes Prefixes, defaultStyle TextStyle) *Logger {\n\tprefixes[\"\"] = defaultStyle\n\treturn &Logger{Prefixes: prefixes, output: os.Stdout}\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 comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Computer Science:"
} |
Adds the module type option, if allowed
@param Select $select The select box
@param string $type The module type | [
"private function AddModuleTypeOption(Select $select, $type)\n {\n if ($type != 'BuiltIn-Container' ||\n (!Request::GetData('container') && Container::Schema()->Count() > 0))\n {\n $select->AddOption($type, Trans($type));\n }\n }"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Copies website to a location.
@param Website $orgWebsite
@return Website | [
"public function copyWebsite(Website $orgWebsite, Website $newWebsite)\n {\n $orgRoot = $orgWebsite->getRoot();\n $orgOptions = $orgWebsite->getOptions();\n $websitePages = $this->websitePageRepository->children($orgRoot);\n array_unshift($websitePages, $orgRoot);\n $newWebsite... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post about file transfer:",
"pos": "Represent the code about file transfer:",
"neg": "Represent the code:"
} |
The fragment component for this URI, normalized.
@return [String] The fragment component, normalized. | [
"def normalized_fragment\n return nil unless self.fragment\n return @normalized_fragment if defined?(@normalized_fragment)\n @normalized_fragment ||= begin\n component = Addressable::URI.normalize_component(\n self.fragment,\n Addressable::URI::CharacterClasses::FRAGMENT\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 summarization about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code:"
} |
Return low-level information on a container or image.
@param array $args
@param bool|false $raw
@param null $callback
@return mixed|\Symfony\Component\Process\Process
@throws \Exception | [
"public static function inspect(array $args, $raw = false, $callback = null)\n {\n $process = self::runCommand('inspect', $args, $callback);\n\n if ($process->isSuccessful() && !$raw) {\n $decoded = json_decode($process->getOutput());\n return reset($decoded);\n }\n\n ... | [
"static function parseWith($optionsResource, array $_ = null)\n {\n if (!static::isConfigurableWith($optionsResource))\n throw new \\InvalidArgumentException(sprintf(\n 'Invalid Configuration Resource provided on (%s); given: (%s).'\n , static::class, \\Poirot\\Std... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Append filtering interface | [
"public function createFilteringInterface()\n {\n //Check if section has filtering enabled\n $context = $this->getContext();\n $handle = $context['section_handle'];\n $section_id = SectionManager::fetchIDFromHandle($handle);\n $section = SectionManager::fetch($section_id);\n ... | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *CreateQualificationTypeInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateQualificationTypeInput\"}\n\tif s.Description == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Description\"))\n\t}\n\tif s.Name == nil {\n\t\tinvalidParams.Add(request.NewErrParamRe... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Returns the cleaned indexable content from the page's HTML markup.
The content is cleaned from HTML tags and control chars Solr could
stumble on.
@return string Indexable, cleaned content ready for indexing. | [
"public function getIndexableContent()\n {\n $content = self::cleanContent($this->content);\n $content = html_entity_decode($content, ENT_QUOTES, 'UTF-8');\n // after entity decoding we might have tags again\n $content = strip_tags($content);\n $content = trim($content);\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// ListUDF lists all packages containing user defined functions in the server.
// This method is only supported by Aerospike 3 servers.
// If the policy is nil, the default relevant policy will be used. | [
"func (clnt *Client) ListUDF(policy *BasePolicy) ([]*UDF, error) {\n\tpolicy = clnt.getUsablePolicy(policy)\n\n\tvar strCmd bytes.Buffer\n\t// errors are to remove errcheck warnings\n\t// they will always be nil as stated in golang docs\n\t_, err := strCmd.WriteString(\"udf-list\")\n\n\t// Send command to one node.... | [
"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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Parses the contents of the @template_path and sorts ready for template creation. | [
"def parse_template_dir\n @dir_list = []\n file_list = []\n @append_templates = []\n @line_templates = []\n @whole_templates = []\n Find.find(@template_path) do |x|\n case\n when File.file?(x) && x !~ /\\/jumpstart_config/ then\n file_list << x.... | [
"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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Private: append a nonce to the script/style directories if script_nonce
or style_nonce are provided. | [
"def populate_nonces(directive, source_list)\n case directive\n when SCRIPT_SRC\n append_nonce(source_list, @script_nonce)\n when STYLE_SRC\n append_nonce(source_list, @style_nonce)\n else\n source_list\n end\n end"
] | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// GetMemoryGB メモリ(GB) 取得 | [
"func (p *propPrivateHostPlan) GetMemoryGB() int {\n\tif p.Plan == nil {\n\t\treturn -1\n\t}\n\n\treturn p.Plan.GetMemoryGB()\n}"
] | [
"public static double calculateLofWithUpdate(int kn, int max, LofPoint addedPoint,\n LofDataSet dataSet)\n {\n // データ数が最大に達している場合には古い方からデータの削除を行う\n String deleteId = addPointToDataSet(max, addedPoint, dataSet);\n\n // K距離、K距離近傍、局所到達可能密度の更新を行う対象点の一覧を取得する。\n Set<String> updat... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// Creates a SHA256 HMAC of the given 'value' using the given 'key' and returns
// a hex encoded string. | [
"func createHMAC(key, value string) (string, error) {\n\tif key == \"\" {\n\t\treturn \"\", fmt.Errorf(\"invalid HMAC key\")\n\t}\n\thm := hmac.New(sha256.New, []byte(key))\n\thm.Write([]byte(value))\n\treturn hex.EncodeToString(hm.Sum(nil)), nil\n}"
] | [
"public static boolean validatePassword(char[] password, String goodHash) throws NoSuchAlgorithmException, InvalidKeySpecException {\n\n final String[] params = goodHash.split(\":\");\n final int iterations = Integer.parseInt(params[ITERATION_INDEX]);\n final byte[] salt = fromHex(params[SALT_INDEX]);\n ... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
{@inheritDoc}
@see \Seeren\View\AbstractView::attach() | [
"public function attach(ObserverInterface $observer): SubjectInterface\r\n {\r\n if ($observer instanceof PDFTemplate) {\r\n parent::attach($observer);\r\n }\r\n return $this;\r\n }"
] | [
"public function createUiComponent(\\n2n\\impl\\web\\ui\\view\\html\\HtmlView $view, \\rocket\\ei\\util\\Eiu $eiu) {\r\n\t\treturn $view->getHtmlBuilder()->getEsc($eiu->field()->getValue());\r\n\t}"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Returns the next property in the list of properties. If it's the last one, returns the first one. | [
"def nextProperty(self, propuri):\n \"\"\"\"\"\"\n if propuri == self.properties[-1].uri:\n return self.properties[0]\n flag = False\n for x in self.properties:\n if flag == True:\n return x\n if x.uri == propuri:\n flag = Tr... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Setup page with filter requirements and other prepare stuff.
@param moodle_page $page The page we are going to add requirements to.
@param context $context The context which contents are going to be filtered. | [
"public function setup($page, $context) {\n // This only requires execution once per request.\n static $jsinitialised = false;\n if ($jsinitialised) {\n return;\n }\n $jsinitialised = true;\n\n // Set up the media manager so that media plugins requiring JS are in... | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Language and programming:"
} |
Get cleaner other info.
@param \simplehtmldom_1_5\simple_html_dom $next_info
@param string $clean_info_type
@param string|array $clean_info_value
@return string|array | [
"private function getCleanerInfo2($next_info, $clean_info_type, $clean_info_value)\n {\n if ($clean_info_type == 'producers'\n || $clean_info_type == 'licensors'\n || $clean_info_type == 'studios'\n || $clean_info_type == 'genres'\n || $clean_info_type == 'autho... | [
"function render() {return df_cc_n(df_map_k($this->_blocks, function($selector, array $rules) {\n\t\t/** @var string $selector */ /** @var string[] $rules */\n\t\t$rulesS = df_tab_multiline(df_cc_n($rules)); /** @var string $rulesS */\n\t\treturn \"{$selector} {\\n{$rulesS}\\n}\";\n\t}));}"
] | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
append a data to the members list - not sorted | [
"public synchronized boolean add(SpdData data) {\n if (data == null) {\n return false;\n } else if (members.contains(data)) {\n return false;\n } else {\n return members.add(data);\n }\n }"
] | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Technology:"
} |
Searches for a file providing given module.
Returns the normalized module id and path of the file. | [
"def lookup(self, module_name):\n \n for search_path in self._paths:\n module_path = os.path.join(search_path, module_name)\n new_module_name, module_file = self._lookup(module_path, module_name)\n if module_file:\n return new_module_name, module_file\n ... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Registers the inputted addon to the class.
:param name | <str>
addon | <variant> | [
"def registerAddon(cls, name, addon, force=False):\n \n prop = '_{0}__addons'.format(cls.__name__)\n cmds = getattr(cls, prop, {})\n\n if name in cmds and not force:\n raise errors.AddonAlreadyExists(cls, name, addon)\n\n cmds[name] = addon\n try:\n if... | [
"def Call(self, Id=0):\n \n o = Call(self, Id)\n o.Status # Test if such a call exists.\n return o"
] | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// sadfOptions creates the correct options for the sadf utility. | [
"func (s *Sysstat) sadfOptions(activityOption string) []string {\n\toptions := []string{\n\t\t\"-p\",\n\t\t\"--\",\n\t\t\"-p\",\n\t}\n\n\topts := strings.Split(activityOption, \" \")\n\toptions = append(options, opts...)\n\toptions = append(options, s.tmpFile)\n\n\treturn options\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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Set a given attribute on the model.
@param string $key
@param mixed $value
@return $this | [
"public function setAttribute($key, $value)\n {\n if ($value !== null && $this->hasEnumCast($key)) {\n $enum = $this->enumCasts[$key];\n\n if ($value instanceOf $enum) {\n $this->attributes[$key] = $value->value;\n } else {\n $this->attributes... | [
"public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Add new fields to global filter
@param array $fields Array with fields
@param bool $recursiveMerge If true, $fields will be recursive merged with
other parameters (used array_merge_recursive()), otherwise not recursive merge (used array_merge()). | [
"public function addGlobalFilters(array $fields, $recursiveMerge = false)\n {\n if (is_array($fields) && !empty($fields))\n {\n if ($recursiveMerge)\n {\n $this->filterParams = array_merge_recursive($this->filterParams, $fields);\n }\n else... | [
"public function remove_field($name){\n\t\t$ind = $this->is_field($name);\n\t\tif ($ind==-1) throw new Exception('There was no such data field registered as: '.$name);\n\t\tarray_splice($this->text,$ind,1);\n\t\t//we not deleting field from $data collection, so it will not be included in data operation, but its dat... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Serialize the message to string.
@return string Serialized binary protobuf data. | [
"public function serializeToString()\n {\n $output = new CodedOutputStream($this->byteSize());\n $this->serializeToStream($output);\n return $output->getData();\n }"
] | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
// SetNetworkDestinationIpV4 sets the NetworkDestinationIpV4 field's value. | [
"func (s *AwsSecurityFindingFilters) SetNetworkDestinationIpV4(v []*IpFilter) *AwsSecurityFindingFilters {\n\ts.NetworkDestinationIpV4 = v\n\treturn s\n}"
] | [
"func (cip *cachedSelectorPolicy) Consume(owner policy.PolicyOwner, cache cache.IdentityCache) *policy.EndpointPolicy {\n\t// TODO: This currently computes the EndpointPolicy from SelectorPolicy\n\t// on-demand, however in future the cip is intended to cache the\n\t// EndpointPolicy for this Identity and emit datap... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
// mainCopy is the entry point for cp command. | [
"func mainCopy(ctx *cli.Context) error {\n\t// Parse encryption keys per command.\n\tencKeyDB, err := getEncKeys(ctx)\n\tfatalIf(err, \"Unable to parse encryption keys.\")\n\n\t// Parse metadata.\n\tuserMetaMap := make(map[string]string)\n\tif ctx.String(\"attr\") != \"\" {\n\t\tuserMetaMap, err = getMetaDataEntry(... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Update the $name $value of the $bundle
@no-permission
@param AbstractBundle $bundle
@param $name
@param $value
@return | [
"public function updateByBundle(AbstractBundle $bundle, $name, $value)\n {\n $query = $this->getNewQuery();\n $query = $bundle->makeQueryFiltered($query);\n return $query->where('name', $name)->update('value', $value);\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
update the Player list
@param string $login
@param string[] $blockedPlayerList | [
"final function updatePlayerList(array $blockedPlayerList, $setLocalAllyAction, $unsetLocalAllyAction, $maxAllyCount, $player = '')\r\n\t{\r\n\t\tif($player)\r\n\t\t{\r\n\t\t\t$playerLists = Windows\\PlayerList::Get($player);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$playerLists = Windows\\PlayerList::GetAll();\r\n\t... | [
"def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence"
] | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
/*
(non-Javadoc)
@see javax.jms.QueueSession#createReceiver(javax.jms.Queue, java.lang.String) | [
"@Override\n\tpublic QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException\n {\n \texternalAccessLock.readLock().lock();\n \ttry\n\t\t{\n\t checkNotClosed();\n\t \n\t RemoteQueueReceiver receiver = new RemoteQueueReceiver(idProvider.createID(),\n\t ... | [
"public javax.jms.Destination getDestination() throws ControlException {\n if (_destination == null) {\n _destination =\n (javax.jms.Destination) getJndiControl().getResource(getDestinationProperties().sendJndiName(),\n javax.jms.Destination.class);\n }\n ... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Drops variables (names) from metadata. | [
"def drop(self, names):\n \"\"\"\"\"\"\n \n # drop lower dimension data\n self._data = self._data.drop(names, axis=0)\n # drop higher dimension data\n for name in names:\n if name in self._ho_data:\n _ = self._ho_data.pop(name)"
] | [
"def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)"
] | codesearchnet | {
"query": "Represent the sentence about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// SetClassName sets the ClassName field's value. | [
"func (s *UserDefinedFunction) SetClassName(v string) *UserDefinedFunction {\n\ts.ClassName = &v\n\treturn s\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
A function to generate UDF symlink data from a Unix-like path.
Parameters:
symlink_target - The Unix-like path that is the symlink.
Returns:
The UDF data corresponding to the symlink. | [
"def symlink_to_bytes(symlink_target):\n # type: (str) -> bytes\n '''\n \n '''\n symlink_data = bytearray()\n for comp in symlink_target.split('/'):\n if comp == '':\n # If comp is empty, then we know this is the leading slash\n # and we should make an absolute entry (... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
{@link InputType} of the elements composed within complex type.
@param itemKey
@return | [
"public InputType getElementTypeUsingKey(String itemKey) {\n String type = this.getDataType().get(itemKey).getAsString().toUpperCase();\n return InputType.valueOf(type);\n }"
] | [
"public static OriginIdElement addOriginId(Message message) {\n OriginIdElement originId = new OriginIdElement();\n message.addExtension(originId);\n // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.\n // message.setStanzaId(originId.g... | codesearchnet | {
"query": "Represent the text about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about Software development:"
} |
@param string $content
@return string | [
"protected function putContentToTmpFile($content)\n {\n $path = $this->createTempFilePath(self::HTML_EXTENSION);\n\n $this->createFile($path, $content);\n\n return $path;\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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
// NewCompressReader wrap the io.Reader | [
"func NewCompressReader(r io.Reader) *compressReader {\n\tp := &compressReader{\n\t\treader: r,\n\t\theader: make([]byte, HeaderSize),\n\t}\n\tp.data = make([]byte, BlockMaxSize, BlockMaxSize)\n\n\tzlen := lz4.CompressBound(BlockMaxSize) + HeaderSize\n\tp.zdata = make([]byte, zlen, zlen)\n\n\tp.pos = len(p.data)\n\... | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Code also yanked from read-package-json. | [
"function stripBOM (content) {\n content = content.toString()\n // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n // because the buffer-to-string conversion in `fs.readFileSync()`\n // translates it to FEFF, the UTF-16 BOM.\n if (content.charCodeAt(0) === 0xFEFF) return content.sli... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// SetComment sets the Comment field's value. | [
"func (s *Column) SetComment(v string) *Column {\n\ts.Comment = &v\n\treturn s\n}"
] | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
deactivates all previously scheduled actions | [
"function() {\n\n\t\tvar actions = this._actions,\n\t\t\tnActions = this._nActiveActions,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = this._nActiveBindings;\n\n\t\tthis._nActiveActions = 0;\n\t\tthis._nActiveBindings = 0;\n\n\t\tfor ( var i = 0; i !== nActions; ++ i ) {\n\n\t\t\tactions[ i ].reset();\n\n\t... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Groups the containers by their keys
@param bitmaps input bitmaps
@return The containers from the bitmaps grouped by key | [
"public static SortedMap<Short, List<Container>> groupByKey(RoaringBitmap... bitmaps) {\n Map<Short, List<Container>> grouped = new HashMap<>();\n for (RoaringBitmap bitmap : bitmaps) {\n RoaringArray ra = bitmap.highLowContainer;\n for (int i = 0; i < ra.size; ++i) {\n Container container = ... | [
"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 Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Queues a message to be stored.
The message is only queued if it contained something and its level is
not less than the recording level (``self.level``). | [
"def add(self, level, message, extra_tags='', *args, **kwargs):\n \n if not message:\n return\n # Check that the message level is not less than the recording level.\n level = int(level)\n if level < self.level:\n return\n # Add the message.\n ... | [
"def getLockByID(self, lockid):\n \n assert isinstance(lockid, (locks.MasterLock, locks.WorkerLock))\n if lockid not in self.locks:\n self.locks[lockid] = lockid.lockClass(lockid)\n # if the master.cfg file has changed maxCount= on the lock, the next\n # time a build is... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(ArchiveOutputSettings archiveOutputSettings, ProtocolMarshaller protocolMarshaller) {\n\n if (archiveOutputSettings == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(ar... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.