query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
NOTE: avoiding use of `class` here so that transpiled output does not try to do `Base.call` with a dom construtor.
[ "function(type, options) {\n var event = new Base(type, options);\n event.__composed = options && Boolean(options.composed);\n return event;\n }" ]
[ "def _handle_byref_decl(self, node, scope, ctxt, stream):\n \n self._dlog(\"handling byref decl\")\n field = self._handle_node(node.type.type, scope, ctxt, stream)\n\n # this will not really be used (maybe except for introspection)\n # with byref function params\n # see iss...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about writing:" }
self.__last_page_screenshot is only for pytest html report logs self.__last_page_screenshot_png is for all screenshot log files
[ "def __set_last_page_screenshot(self):\n \n if not self.__last_page_screenshot and (\n not self.__last_page_screenshot_png):\n try:\n element = self.driver.find_element_by_tag_name('body')\n if self.is_pytest and self.report_on:\n ...
[ "def buffer_leave(self, filename):\n \"\"\"\"\"\"\n self.log.debug('buffer_leave: %s', filename)\n # TODO: This is questionable, and we should use location list for\n # single-file errors.\n self.editor.clean_errors()" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Get the domain name from this URL. @param strDomain @return
[ "public static String getDomainFromURL(String strURL, String strContextPathAtEnd, boolean includePortNumber)\n {\n String strDomain = strURL;\n \n if (strDomain.indexOf(':') < 8)\n strDomain = strDomain.substring(strDomain.indexOf(':') + 1); // Get rid of protocol\n if (st...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Tax of the item. @param string|double $tax @return $this
[ "public function setTax($tax)\n {\n NumericValidator::validate($tax, \"Tax\");\n $tax = Formatter::formatToPrice($tax, $this->getCurrency());\n $this->tax = $tax;\n return $this;\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Hack to differentiate between the following two which have the same ast type T = { method: () => void }; type T = { method(): void };
[ "function isObjectTypePropertyAFunction(node, options) {\n return (\n (node.type === \"ObjectTypeProperty\" ||\n node.type === \"ObjectTypeInternalSlot\") &&\n node.value.type === \"FunctionTypeAnnotation\" &&\n !node.static &&\n !isFunctionNotation(node, options)\n );\n}" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public EClass getIfcExternallyDefinedHatchStyle() {\r\n\t\tif (ifcExternallyDefinedHatchStyleEClass == null) {\r\n\t\t\tifcExternallyDefinedHatchStyleEClass = (EClass) EPackage.Registry.INSTANCE\r\n\t\t\t\t\t.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(215);\r\n\t\t}\r\n\t\treturn ifcExternallyDefi...
[ "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:" }
Return a newly added ``<p:graphicFrame>`` element containing a table as specified by the parameters.
[ "def _add_graphicFrame_containing_table(self, rows, cols, x, y, cx, cy):\n \n _id = self._next_shape_id\n name = 'Table %d' % (_id-1)\n graphicFrame = self._spTree.add_table(\n _id, name, rows, cols, x, y, cx, cy\n )\n return graphicFrame" ]
[ "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:" }
Color generator for Bokeh plots Parameters ---------- colormap: str, sequence The name of the color map Returns ------- generator A generator for the color palette
[ "def color_gen(colormap='viridis', key=None, n=15):\n \n if colormap in dir(bpal):\n palette = getattr(bpal, colormap)\n\n if isinstance(palette, dict):\n if key is None:\n key = list(palette.keys())[0]\n palette = palette[key]\n\n elif callable(palett...
[ "def _process_cmap(cmap):\n '''\n \n '''\n option = {}\n if isinstance(cmap, str):\n option['scheme'] = cmap\n elif isinstance(cmap, list):\n option['colors'] = cmap\n else:\n raise ValueError('''`cmap` must be a string (name of a color scheme)\n or ...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Obtains a Symmetry010 local date-time from another date-time object. @param temporal the date-time object to convert, not null @return the Symmetry010 local date-time, not null @throws DateTimeException if unable to create the date-time
[ "@Override\n @SuppressWarnings(\"unchecked\")\n public ChronoLocalDateTime<Symmetry010Date> localDateTime(TemporalAccessor temporal) {\n return (ChronoLocalDateTime<Symmetry010Date>) super.localDateTime(temporal);\n }" ]
[ "private function to8601Utc(\\DateTimeInterface $dateTime): string\n {\n // Convert to UTC if we can\n if ($dateTime instanceof DateTime) {\n $dateTime->setTimezone(new \\DateTimeZone('UTC'));\n } elseif ($dateTime instanceof \\DateTimeImmutable && $dateTime->getOffset() > 0) {\n ...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// GetK returns the K value, or the number of standard deviations above and below // to band the simple moving average with. // Typical K value is 2.0.
[ "func (bbs BollingerBandsSeries) GetK(defaults ...float64) float64 {\n\tif bbs.K == 0 {\n\t\tif len(defaults) > 0 {\n\t\t\treturn defaults[0]\n\t\t}\n\t\treturn 2.0\n\t}\n\treturn bbs.K\n}" ]
[ "def _pdf_value(pdf, population, fitnesses, fitness_threshold):\n \n # Add the chance of obtaining a solution from the pdf\n # when the fitness for that solution exceeds a threshold\n value = 0.0\n for solution, fitness in zip(population, fitnesses):\n if fitness >= fitness_threshold:\n ...
codesearchnet
{ "query": "Represent the comment about Mathematics:", "pos": "Represent the code about Mathematics:", "neg": "Represent the code about programming:" }
<p class="changed_added_2_2">The default behavior of this method is to call {@link Flash#putNow(String, Object)} on the wrapped {@link Flash} object.</p> @since 2.2
[ "@Override\n public void putNow(String key, Object value) {\n getWrapped().putNow(key, value);\n }" ]
[ "@Override\n public boolean setProperty(String name, Object value)\n {\n /* Note: can not call local method, since it'll return false for\n * recognized but non-mutable properties\n */\n return mConfig.setProperty(name, value);\n }" ]
codesearchnet
{ "query": "Represent the post about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public EClass getCharacterRotation() {\n\t\tif (characterRotationEClass == null) {\n\t\t\tcharacterRotationEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(349);\n\t\t}\n\t\treturn characterRotationEClass;\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 post about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
This method replaces place holders embedded in the given value by either meta parameter or XPath expression operated on the given XML Bean. Meta parameter is identified by a "$" followed by the parameter name. @param value @param metainfo @return
[ "protected String placeHolderTranslation(String value,\n Map<String,String> metainfo, XmlObject xmlbean) {\n int k, i, n;\n StringBuffer sb = new StringBuffer();\n n = value.length();\n for (i=0; i<n; i++) {\n char ch = value.charAt(i);\n if (ch=='{') {\n...
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
获取属性,如果属性位于nodes中,在第一次获取对象时,如果不是Node 则使用S.all获取之,并且返回获得的node @param {String} key
[ "function get(key){ \n var type = this.getType(key);\n var ret = this[type][key];\n\n //对于node集合,如果是string,则设置node\n if (type === 'nodes' && util.isString(ret)) {\n ret = this._setNode(key);\n } \n\n return ret;\n }" ]
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Returns the grain functions .. code-block:: python import salt.config import salt.loader __opts__ = salt.config.minion_config('/etc/salt/minion') grainfuncs = salt.loader.grain_funcs(__opts__)
[ "def grain_funcs(opts, proxy=None):\n '''\n \n '''\n ret = LazyLoader(\n _module_dirs(\n opts,\n 'grains',\n 'grain',\n ext_type_dirs='grains_dirs',\n ),\n opts,\n tag='grains',\n )\n ret.pack['__utils__'] = utils(opts, proxy=...
[ "def template_str(tem, queue=False, **kwargs):\n '''\n \n '''\n conflict = _check_queue(queue, kwargs)\n if conflict is not None:\n return conflict\n\n opts = salt.utils.state.get_sls_opts(__opts__, **kwargs)\n\n try:\n st_ = salt.state.State(opts,\n ...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
@param array $ids @return null
[ "public function expireCampaigns($ids)\n {\n $bind = [\n 'send_status' => \\Dotdigitalgroup\\Email\\Model\\Campaign::SENT,\n 'message' => 'Check sending status in Engagement Cloud',\n 'updated_at' => $this->datetime->gmtDate()\n ];\n $this->getConnection()\n ...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Clears all loaded assets @return object
[ "public function clear()\n {\n $this->aCss = [];\n $this->aCssInline = [];\n $this->aJs = [];\n $this->aJsInlineHeader = [];\n $this->aJsInlineFooter = [];\n return $this;\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 text about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Split the given comma separated value to multiple integer values.
[ "def lengths_offsets(value):\n \n values = []\n for item in value.split(','):\n item = int(item)\n values.append(item)\n return values" ]
[ "private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Start executor process via running an async shell process
[ "@VisibleForTesting\n protected Process startExecutorProcess(int container, Set<PackingPlan.InstancePlan> instances) {\n return ShellUtils.runASyncProcess(\n getExecutorCommand(container, instances),\n new File(LocalContext.workingDirectory(config)),\n Integer.toString(container));\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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Write the specified byte value to the IODIR registor. If no value specified the current buffered value will be written.
[ "def _write_iodir(self, iodir=None):\n \n if iodir is not None:\n self.iodir = iodir\n self.i2c.write_list(self.IODIR, self.iodir)" ]
[ "def set_led(self, led, value):\n \n if led < 0 or led > 127:\n raise ValueError('LED must be value of 0 to 127.')\n # Calculate position in byte buffer and bit offset of desired LED.\n pos = led // 8\n offset = led % 8\n if not value:\n # Turn off the...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Wait until history is read but no more than 10 cycles in case a browser session is closed.
[ "def flush(self):\n \n i = 0\n while self._frame_data.is_dirty and i < 10:\n i += 1\n time.sleep(0.1)" ]
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Creates NDArray filled with zeros ``` zeros(2) // Creates array of zeros of length 2 zeros([2,2,2]) // Create 2x2x2 matrix of zeros zeros(2,'i16') // Creates array of 2 16-bit integers filled with zeros ```
[ "function zeros(arg0, datatype) {\n var A;\n if (Array.isArray(arg0)) {\n A = new ndarray_1.NDArray({ shape: arg0, datatype: datatype });\n }\n else {\n A = new ndarray_1.NDArray({ shape: [arg0], datatype: datatype });\n }\n A.fill(0);\n return A;\n}" ]
[ "def _check_periodic(periodic):\n ''''''\n periodic = np.array(periodic)\n\n # If it is a matrix\n if len(periodic.shape) == 2:\n assert periodic.shape[0] == periodic.shape[1], 'periodic shoud be a square matrix or a flat array'\n return np.diag(periodic)\n elif len(periodic.shape) == 1...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
// NewGRPCProviderServerShim wraps a terraform.ResourceProvider in a // proto.ProviderServer implementation. If the provided provider is not a // *schema.Provider, this will return nil,
[ "func NewGRPCProviderServerShim(p terraform.ResourceProvider) *GRPCProviderServer {\n\tsp, ok := p.(*schema.Provider)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn &GRPCProviderServer{\n\t\tprovider: sp,\n\t}\n}" ]
[ "func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Read credentials from the config file
[ "def read_config(self):\n \n with open(self.config_file) as cfg:\n try:\n self.config.read_file(cfg)\n except AttributeError:\n self.config.readfp(cfg)\n\n self.client_id = self.config.get('exist', 'client_id')\n self.client_secret = se...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Technology:" }
<p> Inner block mult add operation that takes in account the zeros and on in dataA, which is the top part of the Y block vector that has the householder vectors.<br> <br> C = C + A * B </p>
[ "public static void multBlockAdd_zerosone( double[] dataA, double []dataB, double []dataC,\n int indexA, int indexB, int indexC,\n final int heightA, final int widthA, final int widthC) {\n\n\n for( int i = 0; i < heigh...
[ "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 post about Mathematics:", "pos": "Represent the Github code about Mathematics:", "neg": "Represent the Github code:" }
Finds all objects recursively under a given directory. Optionally, a regular expression can be specified and used to filter the results returned.
[ "def find(dir_path, opts = {})\n regex = opts.key?(:regex) ? opts[:regex] : nil\n\n # We should always be doing GET because switching between methods is used\n # within this function.\n opts.delete(:head)\n\n begin\n exists = list_directory(dir_path, head: true).first\n rescue\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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Visualize data on a kegg pathway. :param df: :param pathway: :param a: :param b: :param ids_from: :param cmap: :param is_log2: :param fillna: :param z_score: :return:
[ "def kegg_pathway(df, pathway, a, b=None, ids_from=\"Proteins\", cmap=cm.PuOr_r, is_log2=False, fillna=None, z_score=1):\n \n\n df = df.copy()\n\n if np.any(df.values < 0) and not is_log2:\n warnings.warn(\"Input data has negative values. If data is log2 transformed, set is_log2=True.\")\n\n if f...
[ "def heatmap_seaborn(dfr, outfilename=None, title=None, params=None):\n \n # Decide on figure layout size: a minimum size is required for\n # aesthetics, and a maximum to avoid core dumps on rendering.\n # If we hit the maximum size, we should modify font size.\n maxfigsize = 120\n calcfigsize = d...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Data Science:" }
/ \copydoc ArrayAccess::offsetExists
[ "public function offsetExists($offset)\n {\n $res = @isset($this->items[$offset]) ||\n (array_search($offset, $this->items, true) !== false);\n return $res;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
compare pairs of sequences
[ "def compare_seqs(seqs):\n \n A, B, ignore_gaps = seqs\n a, b = A[1], B[1] # actual sequences\n if len(a) != len(b):\n print('# reads are not the same length', file=sys.stderr)\n exit()\n if ignore_gaps is True:\n pident = calc_pident_ignore_gaps(a, b)\n else:\n pident ...
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Return the list of comment moderators for the given collection.
[ "def get_collection_moderators(collection):\n \n from invenio_access.engine import acc_get_authorized_emails\n\n res = list(\n acc_get_authorized_emails(\n 'moderatecomments',\n collection=collection))\n if not res:\n return [CFG_WEBCOMMENT_DEFAULT_MODERATOR, ]\n r...
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// AddInterface NIC追加
[ "func (s *VPCRouterSetting) AddInterface(vip string, ipaddress []string, maskLen int) {\n\tif s.Interfaces == nil {\n\t\ts.Interfaces = []*VPCRouterInterface{nil}\n\t}\n\ts.Interfaces = append(s.Interfaces, &VPCRouterInterface{\n\t\tVirtualIPAddress: vip,\n\t\tIPAddress: ipaddress,\n\t\tNetworkMaskLen: mas...
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
The result from realising the future If the result is not available, block until done. :return: result of the future :raises: any exception encountered during realising the future
[ "def result(self):\n \n if self._result is None:\n self.await_result()\n chunks, exception = self._result\n if exception is None:\n return chunks\n raise exception" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Goes back to the master branch, deletes the current branch locally and remotely.
[ "def getback(config, force=False):\n \"\"\"\"\"\"\n repo = config.repo\n\n active_branch = repo.active_branch\n if active_branch.name == \"master\":\n error_out(\"You're already on the master branch.\")\n\n if repo.is_dirty():\n error_out(\n 'Repo is \"dirty\". ({})'.format(\...
[ "function (next) {\n console.info(colors.yellow.bold('Generating and publishing documentation for postman-collection'));\n\n try {\n // go to the out directory and create a *new* Git repo\n cd('out/docs');\n exec('git init');\n\n // i...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
GEN-LAST:event_tfJavaFieldNameKeyTyped
[ "private void tfJavaFieldNameFocusLost(java.awt.event.FocusEvent evt)//GEN-FIRST:event_tfJavaFieldNameFocusLost\r\n {//GEN-HEADEREND:event_tfJavaFieldNameFocusLost\r\n // Commit value if focus is lost\r\n aRelation.setFieldName(tfJavaFieldName.getText());\r\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns ------- adjustments : list[dict[int -> Adjustment]] A list, where each element corresponds to the `columns`, of mappings from index to adjustment objects to apply at that index.
[ "def load_pricing_adjustments(self, columns, dts, assets):\n \n out = [None] * len(columns)\n for i, column in enumerate(columns):\n adjs = {}\n for asset in assets:\n adjs.update(self._get_adjustments_in_range(\n asset, dts, column))\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns the lowest property defined on a class with visibility information.
[ "@Nullable static ObjectType getObjectType(\n @Nullable ObjectType referenceType,\n boolean isOverride,\n String propertyName) {\n if (referenceType == null) {\n return null;\n }\n\n // Find the lowest property defined on a class with visibility information.\n ObjectType current = is...
[ "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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// SetSyncStatus sets the sync status for a single key store address. This // may error if the address is not found in the key store. // // When marking an address as unsynced, only the type Unsynced matters. // The value is ignored.
[ "func (s *Store) SetSyncStatus(a btcutil.Address, ss SyncStatus) error {\n\ts.mtx.Lock()\n\tdefer s.mtx.Unlock()\n\n\twa, ok := s.addrMap[getAddressKey(a)]\n\tif !ok {\n\t\treturn ErrAddressNotFound\n\t}\n\twa.setSyncStatus(ss)\n\treturn nil\n}" ]
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Execute the lazy compilation. @return the compilation units that were dirty and got compiled @throws IOException When a resource cannot be read/written
[ "public Collection<CompilationUnit> execute() throws IOException {\n List<CompilationUnit> compiledUnits = new ArrayList<CompilationUnit>();\n logger.debug(\"CompilationTask: execute\");\n long start = System.currentTimeMillis();\n for (CompilationUnit unit : compilationUnits) {\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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Removes an already registered connection event listener from the ManagedConnection instance. @param listener already registered connection event listener to be removed
[ "@Override\n public void removeConnectionEventListener( ConnectionEventListener listener ) {\n if (listener == null) {\n throw new IllegalArgumentException(\"Listener is null\");\n }\n listeners.remove(listener);\n }" ]
[ "private void removeContext(final String contextID) {\n\n synchronized (this.contextStack) {\n\n if (!contextID.equals(this.contextStack.peek().getIdentifier())) {\n throw new IllegalStateException(\"Trying to close context with id `\" + contextID +\n \"`. But the top context has id `\" +\...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// NewHistorical returns a new HistoricalWeatherData pointer with //the supplied arguments.
[ "func NewHistorical(unit, key string, options ...Option) (*HistoricalWeatherData, error) {\n\th := &HistoricalWeatherData{\n\t\tSettings: NewSettings(),\n\t}\n\n\tunitChoice := strings.ToUpper(unit)\n\tif !ValidDataUnit(unitChoice) {\n\t\treturn nil, errUnitUnavailable\n\t}\n\th.Unit = DataUnits[unitChoice]\n\n\tva...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Data processing:", "pos": "Represent the Github code about Data processing:", "neg": "Represent the Github code:" }
// NewSharedContentRequestAccessType returns a new SharedContentRequestAccessType instance
[ "func NewSharedContentRequestAccessType(Description string) *SharedContentRequestAccessType {\n\ts := new(SharedContentRequestAccessType)\n\ts.Description = Description\n\treturn s\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 Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// SetAfdSignaling sets the AfdSignaling field's value.
[ "func (s *VideoDescription) SetAfdSignaling(v string) *VideoDescription {\n\ts.AfdSignaling = &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 summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Adds the inputed record to this logger tree widget. :param record | <logging.LogRecord>
[ "def addRecord(self, record):\r\n \r\n if self._destroyed:\r\n return\r\n \r\n if not self.uiRecordBTN.isChecked():\r\n return\r\n \r\n self._queue.append(record)" ]
[ "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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
* @param {sprd.model.Product} product @param {Object} [options] @param {Function} callback
[ "function(product, options, callback) {\n\n if (arguments.length === 2) {\n callback = options;\n options = null;\n }\n\n if (options && options.clone) {\n product = product.clone(options.clone);\n }\n\n var bus = th...
[ "function () {\n /**\n * Get a valid file path for a template file from a set of directories\n * @param {Object} opts Configurable options (see periodicjs.core.protocols for more details)\n * @param {string} [opts.extname] Periodic extension that may contain view file\n * @param {string} opts.viewna...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Returns the HTML string. @return string The HTML string.
[ "public function getHTML() {\r\n $tag = '<form';\r\n $q = $this->quoteType;\r\n\r\n //build attribute strings\r\n foreach( $this->attrs as $name=>$value ) {\r\n //if true, such as CHECKED, we just add the name\r\n if( $value === true )\r\n $tag .=...
[ "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 text about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
<code> .google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata text_entity_extraction_details = 13; </code>
[ "public com.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata\n getTextEntityExtractionDetails() {\n if (detailsCase_ == 13) {\n return (com.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata)\n details_;\n }\n return com.google.cloud....
[ "def _normalize_projection(projection):\n \"\"\"\"\"\"\n if projection is not None:\n\n fields = list(projection.fields)\n\n if not fields:\n field_ref = query_pb2.StructuredQuery.FieldReference(\n field_path=\"__name__\"\n )\n ...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Read var short short. @param optimal the optimal @return the short @throws IOException the io exception
[ "public short readVarShort(int optimal) throws IOException {\n int[] varShortDepths = {optimal, 16};\n final int type = (int) this.read(1).toLong();\n return (short) this.read(varShortDepths[type]).toLong();\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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Completes initialization of dsql() by adding fields and expressions. @param array $fields @return DB_dsql
[ "public function selectQuery($fields = null)\n {\n /**/$this->app->pr->start('selectQuery/getActualF');\n\n $actual_fields = $fields ?: $this->getActualFields();\n\n if ($this->fast && $this->_selectQuery) {\n return $this->_selectQuery();\n }\n\n $this->_selectQuery...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
@param string $type @param mixed[] $config @param mixed[] $parentConfig @return string
[ "protected function prepareLabel($type, array $config, array $parentConfig)\n {\n return $label = isset($config['label'])\n ? $config['label']\n : 'lug.'.$this->buildResource($parentConfig)->getName().'.'.$type.'.'.$config['name'];\n }" ]
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ...
codesearchnet
{ "query": "Represent the post about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about Software development:" }
// New create a new watcher which used to watch container info
[ "func New(s store.Store, ctx context.Context) (watcher.Watcher, error) {\n\tret := &ContainerWatcher{\n\t\tinvertsTable: make(map[string]string),\n\t}\n\tbase, err := watcher.New(s, ctx, KEY, ret.convert, ret.invertKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tret.BaseWatcher = *base\n\treturn ret, nil\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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Returns a {@link URI} of this endpoint as a string. The omitted values in the {@link URI} will be replaced with the specified default values, such as {@code defaultScheme}, {@code defaultHostname} and {@code defaultPort}.
[ "String toUriString(String defaultScheme, String defaultHostname, int defaultPort) {\n requireNonNull(defaultScheme, \"defaultScheme\");\n requireNonNull(defaultHostname, \"defaultHostname\");\n validatePort(defaultPort);\n\n final StringBuilder sb = new StringBuilder();\n sb.appe...
[ "public static URI getRequestURI(URI requestURI, String hostHeader, IoSession session) {\n boolean secure = SslUtils.isSecure(session);\n String authority = HttpUtils.getHostAndPort(hostHeader, secure);\n // Use getRawPath to get the un-decoded path; getPath returns the post-decode value.\n ...
codesearchnet
{ "query": "Represent the description about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
// SortBy 指定キーでのソート
[ "func (api *DiskAPI) SortBy(key string, reverse bool) *DiskAPI {\n\tapi.sortBy(key, reverse)\n\treturn api\n}" ]
[ "function GroupProfile(_id, _owner) {\n this._id = _id;\n this._owner = _owner;\n this._parent = null; //!< 親 GroupProfile インスタンス\n this._children = []; //!< 子 GroupProfile インスタンス\n this._expanded = false; //!< 開閉情報\n this._st...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
return innermsg chunk (dict)
[ "def __make_innermsg(resource, rtype, ref, action=None, payload=None, limit=None):\n \n if action is not None and not isinstance(action, (tuple, list)):\n raise TypeError('action must be None/tuple/list')\n p = {M_RESOURCE: resource,\n M_TYPE: int(rtype),\n M_...
[ "final static function sn(M $m) {return dfcf(function(M $m) {return df_new(\n\t\tdf_con_heir($m, __CLASS__), $m\n\t);}, [$m]);}" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// SetFlags implements part of the cmd.Command interface.
[ "func (c *defaultsCommand) SetFlags(f *gnuflag.FlagSet) {\n\tc.ControllerCommandBase.SetFlags(f)\n\n\tc.out.AddFlags(f, \"tabular\", map[string]cmd.Formatter{\n\t\t\"yaml\": cmd.FormatYaml,\n\t\t\"json\": cmd.FormatJson,\n\t\t\"tabular\": formatDefaultConfigTabular,\n\t})\n\tf.Var(cmd.NewAppendStringsValue(&c...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Derive the address from the given private key. @param \BitWasp\Bitcoin\Crypto\EcAdapter\Impl\PhpEcc\Key\PrivateKey $privateKey @param ArkEcosystem\Crypto\Networks\AbstractNetwork|null $network @return string
[ "public static function fromPrivateKey(EccPrivateKey $privateKey, AbstractNetwork $network = null): string\n {\n $digest = Hash::ripemd160($privateKey->getPublicKey()->getBuffer());\n\n return (new PayToPubKeyHashAddress($digest))->getAddress($network);\n }" ]
[ "def DeserializeExclusiveData(self, reader):\n \n if self.Version is not 0:\n raise Exception('Invalid format')\n\n self.PublicKey = ECDSA.Deserialize_Secp256r1(reader)" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Serialize a list of Transforms
[ "public String serializeTransformList(List<Transform> list) {\n ObjectMapper om = getObjectMapper();\n try {\n return om.writeValueAsString(new ListWrappers.TransformList(list));\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns the authors that can publish to the given section. @param Section $section @return User[]
[ "private function _getSectionAuthorOptions(Section $section): array\n {\n $authors = User::find()\n ->can('createEntries:'.$section->uid)\n ->all();\n return $this->_formatAuthorOptions($authors);\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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Installs things that need to be in place before installing the main package
[ "def other_dependancies(server, environment):\n \n print(' ** Other Dependancides, based on server', server, '**')\n server = server.lower()\n # Pillow is not on TestPyPI\n if server is \"local\":\n pass\n elif server in [\"testpypi\", \"pypitest\"]:\n # these are packages not avail...
[ "def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Error can be either of the following types: // // - InvalidObjectFault // - RuntimeFault
[ "func (service *VboxPortType) IMachinequerySavedGuestScreenInfo(request *IMachinequerySavedGuestScreenInfo) (*IMachinequerySavedGuestScreenInfoResponse, error) {\n\tresponse := new(IMachinequerySavedGuestScreenInfoResponse)\n\terr := service.client.Call(\"\", request, response)\n\tif err != nil {\n\t\treturn nil, e...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the post about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Generates a random number between two numbers @param {int} _min @param {int} _max @api public
[ "function randomBetween(_min, _max) {\n\tvar max, min;\n\t\n\tif(_min > _max){\n\t\tmin = _max;\t\n\t\tmax = _min;\n\t}\n\telse if(_min === _max){\n\t\treturn _min;\n\t}\n\telse{\n\t\tmax = _max;\n\t\tmin = _min;\n\t}\n \n var r = Math.floor(Math.random() * max) + min;\n \n if(r > max)\n \treturn max...
[ "function generate_simple_array (type, length) {\n\ttype = method.get(type) ? method.get(type).key : default_config.type;\n\tlength = parseInt(length, 10) || default_config.length;\n\tassert.number(length, 'Array length must be a number');\n\treturn gen[type](length);\n}" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Extracts the nested value specified by the sequence of idx objects by calling dig at each step, returning nil if any intermediate step is nil. @return CowProxy wrapped value from wrapped object
[ "def dig(key, *args)\n value = send(key)\n args.empty? ? value : value&.dig(*args)\n end" ]
[ "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 instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Load the view component @param bool $try @return void
[ "private function loadView(bool $try = false) : void\n {\n // configure view component\n Accessor::$viewsExtension = config('view.extension');\n Accessor::$viewsEngine = config('view.engine');\n Accessor::$viewsCache = config('app.dir') . config('view.compiled');\n Accessor::$viewsDirectory =...
[ "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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Add a field to this class.
[ "public FieldInfo addField(Modifiers modifiers,\n String fieldName,\n TypeDesc type) {\n FieldInfo fi = new FieldInfo(this, modifiers, fieldName, type);\n mFields.add(fi);\n return fi;\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 post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Returns all metadata extractable from the archive. Returns: dictionary containing metadata extracted from the archive
[ "def data_from_archive(self):\n \n archive_data = {}\n\n archive_data['runtime_deps'] = self.runtime_deps\n archive_data['build_deps'] = [\n ['BuildRequires', 'python2-devel']] + self.build_deps\n\n archive_data['py_modules'] = self.py_modules\n archive_data['scr...
[ "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 about computer science:", "pos": "Represent the code about computer science:", "neg": "Represent the code:" }
// getKey returns the key which is held in s by two brackets. // It also returns the next selector.
[ "func getKey(s string) (string, string) {\n\tselSegs := strings.SplitN(s, PathSeparator, 2)\n\tthisSel := selSegs[0]\n\tnextSel := \"\"\n\n\tif len(selSegs) > 1 {\n\t\tnextSel = selSegs[1]\n\t}\n\n\tmapMatches := mapAccessRegex.FindStringSubmatch(s)\n\tif len(mapMatches) > 0 {\n\t\tif _, err := strconv.Atoi(mapMatc...
[ "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 text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Reads into an array of bytes.
[ "@Override\n\tpublic int read (byte bytes[], int offset, int length) throws IOException {\n\t\tint\tr;\n\n\t\tif ((r = in.read(bytes, offset, length)) == -1) return -1;\n\n\t\tmd5.Update(bytes, offset, r);\n\n\t\treturn r;\n\t}" ]
[ "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:" }
// Get a record containing the current state of the given subject.
[ "func (_class SubjectClass) GetRecord(sessionID SessionRef, self SubjectRef) (_retval SubjectRecord, _err error) {\n\t_method := \"subject.get_record\"\n\t_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"session_id\"), sessionID)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_selfArg, _err...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Determine whether remote file descriptors are tty capable using std nailgunned env variables. :param dict env: A dictionary representing the environment. :returns: A tuple of boolean values indicating istty or not for (stdin, stdout, stderr).
[ "def isatty_from_env(cls, env):\n \n def str_int_bool(i):\n return i.isdigit() and bool(int(i)) # Environment variable values should always be strings.\n\n return tuple(\n str_int_bool(env.get(cls.TTY_ENV_TMPL.format(fd_id), '0')) for fd_id in STDIO_DESCRIPTORS\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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Unbundles a file composed of several certificates. http://www.benjiegillam.com/2012/06/node-dot-js-ssl-certificate-chain/
[ "function unbundleCert(bundle) {\n var chain = bundle.trim().split('\\n');\n\n var ca = [];\n var cert = [];\n\n for (var i = 0, len = chain.length; i < len; i++) {\n var line = chain[i].trim();\n if (!(line.length !== 0)) {\n continue;\n }\n cert.push(line);\n if (line.match(/-END CERTIFICA...
[ "def cli(verbose):\n \n floyd.floyd_host = floyd.floyd_web_host = \"https://dev.floydhub.com\"\n floyd.tus_server_endpoint = \"https://upload-v2-dev.floydhub.com/api/v1/upload/\"\n configure_logger(verbose)\n check_cli_version()" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Restore the main dataframe
[ "def restore(self):\n \n if self.backup_df is None:\n self.warning(\"No dataframe is backed up: nothing restore\")\n return\n self.df = self.backup_df\n self.ok(\"Dataframe is restored\")" ]
[ "@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:" }
render, with userinfo fun(kind, num) fun(kind, num, with_tag = val1) fun(kind, num, with_tag = val1, user_id = val2) fun(kind, num, with_tag = val1, user_id = val2, glyph = val3)
[ "def render_user(self, *args, **kwargs):\n '''\n \n '''\n\n kind = kwargs.get('kind', args[0])\n num = kwargs.get('num', args[1] if len(args) > 1 else 6)\n with_tag = kwargs.get('with_tag', False)\n user_id = kwargs.get('user_id', '')\n glyph = kwargs.get('gly...
[ "def weld_str_upper(array):\n \n obj_id, weld_obj = create_weld_object(array)\n\n weld_template = \"\"\"map(\n {array},\n |e: vec[i8]|\n result(\n for(e,\n appender[i8],\n |c: appender[i8], j: i64, f: i8|\n if(f > 96c && f < 123c,\n ...
codesearchnet
{ "query": "Represent the comment about Text processing:", "pos": "Represent the code about Text processing:", "neg": "Represent the code:" }
Asset Js @param $name @param $version @return bool|string
[ "public static function assetJs($name, $version = false)\n {\n // Get cache\n $cache = Cache::get('potion_assets', []);\n\n // Check for asset\n if (!isset($cache[$name])) {\n return false;\n }\n\n // Url\n $url = self::assetUrl($name, $version);\n\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Set the value of [function_id_version] column. @param int $v new value @return \Team\Model\PersonFunctionLinkVersion The current object (for fluent API support)
[ "public function setFunctionIdVersion($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->function_id_version !== $v) {\n $this->function_id_version = $v;\n $this->modifiedColumns[PersonFunctionLinkVersionTableMap::FUNCTION_ID_VERSION] = true;\n ...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
{@inheritDoc} @see jp.co.future.uroborosql.node.Node#passed(PassedRoute)
[ "@Override\n\tpublic void passed(final PassedRoute passed) {\n\t\tpassed.appendBranchState(getPosition(), getPosition() + getLength() - 1, this.getState());\n\t\tsuper.passed(passed);\n\t}" ]
[ "public PythonDataStream add_java_source(SourceFunction<Object> src) {\n\t\treturn new PythonDataStream<>(env.addSource(src).map(new AdapterMap<>()));\n\t}" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Sets the path of a configuration file for SonarQube Scanner. @param string $configuration @return void
[ "public function setConfiguration($configuration)\n {\n $this->configuration = (string) $configuration;\n\n $message = sprintf(\"Set configuration to [%s].\", $this->configuration);\n $this->log($message, Project::MSG_DEBUG);\n }" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
Adds a metric value to the metric value queue. @param metricValues bunch of values
[ "public void accumulate(List<? extends StandardMetricResult> metricValues) {\n if (metricValues == null || metricValues.isEmpty()) return;\n for (StandardMetricResult v : metricValues) {\n if (lastOffset < v.offset) values.put(v.value.intValue());\n }\n lastOffset = ListUtils....
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the Github comment about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
// NewBindTransceiver creates a new Bind PDU.
[ "func NewBindTransceiver() Body {\n\tb := newBind(&Header{ID: BindTransceiverID})\n\tb.init()\n\treturn b\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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
使用指定的配置,做一次临时的查询操作 适合执行完即结束的脚本操作 @param cfg @param sql @param args @param cb
[ "function queryOnce(cfg, sql, args, cb) {\n var client = new pg.Client(cfg);\n client.connect(function (err) {\n if (err) {\n return cb(err, null);\n }\n client.query(sql, args, function (err, result) {\n if (err) {\n cb(err, null);\n } else {\n client.end(function (err) {\n ...
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// FromValues parses the data in v and populates `c`
[ "func (c *GroupsUnarchiveCall) FromValues(v url.Values) error {\n\tvar tmp GroupsUnarchiveCall\n\tif raw := strings.TrimSpace(v.Get(\"channel\")); len(raw) > 0 {\n\t\ttmp.channel = raw\n\t}\n\t*c = tmp\n\treturn nil\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github text about Data processing:", "pos": "Represent the Github code about Data processing:", "neg": "Represent the Github code about programming:" }
r"""Checks if l is a numpy array of floats (any dimension
[ "def is_float_array(l):\n \n\n \"\"\"\n if isinstance(l, np.ndarray):\n if l.dtype.kind == 'f':\n return True\n return False" ]
[ "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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
// SetApprovedPatchesComplianceLevel sets the ApprovedPatchesComplianceLevel field's value.
[ "func (s *GetPatchBaselineOutput) SetApprovedPatchesComplianceLevel(v string) *GetPatchBaselineOutput {\n\ts.ApprovedPatchesComplianceLevel = &v\n\treturn s\n}" ]
[ "public void addValidator(Schema schema, ModeUsage modeUsage) {\n // adds the schema to this section schemas\n schemas.addElement(schema);\n // creates the validator\n Validator validator = createValidator(schema);\n // adds the validator to this section validators\n validators.addElem...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Add an Ed25519 signature to an HTTP request object. @param RequestInterface $request @param SigningSecretKey $secretKey @return RequestInterface
[ "public function signRequest(\n RequestInterface $request,\n SigningSecretKey $secretKey\n ): RequestInterface {\n $signature = \\ParagonIE_Sodium_Compat::crypto_sign_detached(\n (string) $request->getBody(),\n $secretKey->getString(true)\n );\n return $re...
[ "function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT...
codesearchnet
{ "query": "Represent the description about AWS S3:", "pos": "Represent the code about AWS S3:", "neg": "Represent the code:" }
@param AnalyticsOverview $overview @param $metrics @param $dimensions @return mixed
[ "private function requestGoalResults(AnalyticsOverview $overview, $metrics, $dimensions)\n {\n $timestamps = $this->getTimestamps($overview);\n\n // execute query\n $results = $this->query->getResultsByDate(\n $timestamps['begin'],\n $timestamps['end'],\n $me...
[ "protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Unique scoring procedure for SURFstar algorithm. Scoring based on nearest neighbors within defined radius, as well as 'anti-scoring' of far instances outside of radius of current target instance
[ "def SURFstar_compute_scores(inst, attr, nan_entries, num_attributes, mcmap, NN_near, NN_far, headers, class_type, X, y, labels_std, data_type):\r\n \r\n scores = np.zeros(num_attributes)\r\n for feature_num in range(num_attributes):\r\n if len(NN_near) > 0:\r\n scores[feature_num] += com...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Create the resources by the definitions @param array $definitions @return Resource\ResourceInterface[] @throws InvalidOptions
[ "static protected function createResources($definitions) {\n\t\t$resources = [];\n\t\t\n\t\tforeach ($definitions as $name => $options) {\n\t\t\tif (! isset($options['type'])) {\n\t\t\t\tthrow new InvalidOptions('Type of resource must be specified');\n\t\t\t}\n\t\t\t\n\t\t\t$class = self::NAMESPACE_RESOURCE . '\\\\...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Deletes any content imported by this module. @return $this
[ "public function deleteImportedContent() {\n $uuids = $this->state->get('govcms8_default_content_uuids', []);\n $by_entity_type = array_reduce(array_keys($uuids), function ($carry, $uuid) use ($uuids) {\n $entity_type_id = $uuids[$uuid];\n $carry[$entity_type_id][] = $uuid;\n return $carry;\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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Unlike a normal {@link LoadBalancer.Factory}, this accepts a full service config rather than the LoadBalancingConfig. @return null if no selection could be made.
[ "@Nullable\n ConfigOrError selectLoadBalancerPolicy(Map<String, ?> serviceConfig) {\n try {\n List<LbConfig> loadBalancerConfigs = null;\n if (serviceConfig != null) {\n List<Map<String, ?>> rawLbConfigs =\n ServiceConfigUtil.getLoadBalancingConfigsFromServiceConfig(serviceConfig);\n...
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp...
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
// SetVReplicationState updates the state in the _vt.vreplication table.
[ "func SetVReplicationState(dbClient DBClient, uid uint32, state, message string) error {\n\tquery := fmt.Sprintf(\"update _vt.vreplication set state='%v', message=%v where id=%v\", state, encodeString(message), uid)\n\tif _, err := dbClient.ExecuteFetch(query, 1); err != nil {\n\t\treturn fmt.Errorf(\"could not set...
[ "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:" }
Returns the field for the given field outline or <code>null</code> if no such field exists. @param fieldOutline field outline. @return The field for the given field outline or <code>null</code> if no such field exists.
[ "public static JFieldVar field(FieldOutline fieldOutline) {\n\t\tfinal JDefinedClass theClass = fieldOutline.parent().implClass;\n\t\treturn theClass.fields().get(\n\t\t\t\tfieldOutline.getPropertyInfo().getName(false));\n\t}" ]
[ "function(terria) {\n CatalogGroup.call(this, terria, \"csw\");\n\n /**\n * Gets or sets the URL of the CSW server. This property is observable.\n * @type {String}\n */\n this.url = \"\";\n\n /**\n * Gets or sets the template XML string to POST to the CSW server to query for catalog items. If this pro...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about AWS Redshift:" }
{@inheritDoc} @see jcifs.BufferCache#releaseBuffer(byte[])
[ "@Override\n public void releaseBuffer ( byte[] buf ) {\n // better safe than sorry: prevent leaks if there is some out of bound access\n Arrays.fill(buf, (byte) 0);\n synchronized ( this.cache ) {\n if ( this.freeBuffers < this.cache.length ) {\n for ( int i = 0; i...
[ "public PythonDataStream add_java_source(SourceFunction<Object> src) {\n\t\treturn new PythonDataStream<>(env.addSource(src).map(new AdapterMap<>()));\n\t}" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
IObjectActionDelegate
[ "public void setActivePart(IAction action, IWorkbenchPart targetPart)\n\t{\n\t\tsetAction(action);\n\t\tsetPart(targetPart);\n\t\tupdate();\n\t}" ]
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Adds a new identity of the requested entity to the discovered information. @param identity the discovered entity's identity
[ "public void addIdentity(Identity identity) {\n identities.add(identity);\n identitiesSet.add(identity.getKey());\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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Returns the Base Url of a given URL with based on its Vendors from the URL @param url Service URL @param logger Logger @return Base URL if service vendor was found otherwise the given URL
[ "public static String getBaseUrl(String url, Logger logger) {\n String answer = url;\n switch (identify(url)) {\n case COMPOSUM:\n answer = url.substring(0, url.indexOf(COMPOSUM_URL));\n break;\n case CRX:\n answer = url.substring(0, url.indexOf(CRX_URL));\n break;\n ...
[ "@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Graph API:", "pos": "Represent the Github code about Graph API:", "neg": "Represent the Github code about Programming:" }
parse given options to hash @return [Hash]
[ "def parse_service_data_from_options\n data = {}\n data[:strategy] = deploy_strategy if deploy_strategy\n data[:ports] = parse_ports(ports_list) unless ports_list.empty?\n data[:links] = parse_links(link_list) unless link_list.empty?\n data[:memory] = parse_memory(memory) if memory\n d...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Date picker. Return a selcetor with all the date components. @param string $name @param AnDate $date @param array $options
[ "public function picker($name, $options = array())\n {\n $options = new AnConfig($options);\n\n $options->append(array(\n 'date' => new AnDate(),\n ));\n\n $date = $options->date;\n\n $html = $this->getService('com:base.template.helper.html');\n\n if (is_strin...
[ "def create_widget(self):\n \n d = self.declaration\n self.widget = DatePicker(self.get_context(), None,\n d.style or \"@attr/datePickerStyle\")" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Add an error message into the $errors. @param string $key @param array $_errors
[ "public function add_error( $key, $_errors ) {\n\t\tif ( ! $_errors || ! $this->errors instanceof WP_Error ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $this->fields->has( $key ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( is_array( $_errors ) ? $_errors : [ $_errors ] as $message ) {\n\t\t\t$this->errors->add( $key, $me...
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Live Scoreboard generation. @param \Drupal\node\Entity\Node $node @return array|bool
[ "public function generateLiveScorecard(Node $node) {\n if ($node->bundle() != 'campaign') {\n return FALSE;\n }\n\n // Prepare dates of campaign.\n $campaignTimezone = new \\DateTime($node->get('field_campaign_timezone')->getString());\n $campaignTimezone = $campaignTimezone->getTimezone();\n\n ...
[ "public function logBanner($additions = null)\n {\n $this->addStatusMessage('FlexiBee '.str_replace('://',\n '://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\\Ease\\Atom::$frameworkVersion.' '.$additio...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Main entry point to running K3PO. @param args to run with @throws Exception if fails to run
[ "public static void main(String... args) throws Exception {\r\n Options options = createOptions();\r\n\r\n try {\r\n Parser parser = new PosixParser();\r\n CommandLine cmd = parser.parse(options, args);\r\n\r\n if (cmd.hasOption(\"version\")) {\r\n Syste...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Method: setPosition
[ "function (position) {\n var style = this.cvsDiv.style;\n style.left = position.x + \"px\";\n style.top = position.y + \"px\";\n\n this.position = position;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
recursive method.
[ "private static List<Field> getAllFieldsRec(Class clazz, List<Field> fieldList) {\n Class superClazz = clazz.getSuperclass();\n if (superClazz != null) {\n getAllFieldsRec(superClazz, fieldList);\n }\n fieldList.addAll(ArrayUtil.toList(clazz.getDeclaredFields(), Field.class));...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }