query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Computes the maximum of the given values @param {Array<number>} input @return {number}
[ "function max(input) {\n if (!Array.isArray(input)) {\n throw new Error('input must be an array');\n }\n\n if (input.length === 0) {\n throw new Error('input must not be empty');\n }\n\n var max = input[...
[ "protected static <A> double[] ranks(final NumberArrayAdapter<?, A> adapter, final A data, int len) {\n return ranks(adapter, data, sortedIndex(adapter, data, len));\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Mathematics:" }
Set the date as a date @param date the date to set
[ "public void setDate(Date date) {\n DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n df.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n setDate(df.format(date));\n }" ]
[ "@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n...
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
// SetStackInstanceAccount sets the StackInstanceAccount field's value.
[ "func (s *ListStackInstancesInput) SetStackInstanceAccount(v string) *ListStackInstancesInput {\n\ts.StackInstanceAccount = &v\n\treturn s\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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// GetObjectInfo - reads object metadata and replies back ObjectInfo.
[ "func (fs *FSObjects) GetObjectInfo(ctx context.Context, bucket, object string, opts ObjectOptions) (oi ObjectInfo, e error) {\n\toi, err := fs.getObjectInfoWithLock(ctx, bucket, object)\n\tif err == errCorruptedFormat || err == io.EOF {\n\t\tobjectLock := fs.nsMutex.NewNSLock(bucket, object)\n\t\tif err = objectLo...
[ "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 AWS S3:", "pos": "Represent the Github code about AWS S3:", "neg": "Represent the Github code about programming:" }
Get the displayer instance. @param Request $request @param \Exception $original @param \Exception $transformed @param int $code @return DisplayerInterface
[ "protected function getDisplayer( Request $request, Exception $original, Exception $transformed, $code )\n\t{\n\t\t$displayers = $this->make( $this->getConfig( 'displayers', [] ) );\n\n\t\tif ( $filtered = $this->getFiltered( $displayers, $request, $original, $transformed, $code ) )\n\t\t\treturn $filtered[0];\n\n\...
[ "public function onAnyException(\\Exception $exception)\n {\n $exception = FlattenException::create($exception);\n\n return $this->logException($exception, new Request());\n }" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Matches any Java bean setter method which takes an argument the given type. @param type The required setter type. @param <T> The type of the matched object. @return A matcher that matches a setter method with the specified argument type.
[ "public static <T extends MethodDescription> ElementMatcher.Junction<T> isSetter(TypeDescription type) {\n return isSetter(is(type));\n }" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Validate given arguments models @param array $models @return array
[ "protected function validateArgs(array $models) : array\n {\n $validModels = [];\n\n foreach ($models as $model) {\n if (!class_exists($model)) {\n $this->error('Class \"' . $model . '\"\" does not exist');\n $this->line('');\n } elseif (!(new \\R...
[ "def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Makes sure only allowed parameters are accepted, and merges them with the $params property. @param array $params Associative array containing image manipulation parameters @return void
[ "protected function _setInputParams(array &$params) {\n foreach ($params as $paramKey => $paramValue) {\n if (in_array($paramKey, $this->args, true)\n && !is_null($paramValue)\n ) {\n $this->_inputParams[$paramKey] = $paramValue;\n }\n }\n...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
/*! Goes trough all to codes in the mapping table \a $unicodeMap and maps those that match \a $fromCode into \a $toCode. \return \a $unicodeMap
[ "protected function mapExistingCodes( $unicodeMap, $fromCode, $toCode )\n {\n foreach ( $unicodeMap as $from => $to )\n {\n if ( is_array( $to ) )\n {\n $newTo = array();\n foreach ( $to as $ordinal )\n {\n if ( $...
[ "def forward_char(self, e): # (C-f)\r\n \"\"\"\r\n self.l_buffer.forward_char(self.argument_reset)\r\n self.finalize()" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
The main method. @param args the arguments
[ "public static void main(String [] args){\r\n\t\tdisplayCopyright(); \r\n if (!checkArgs(args)) {\r\n displayHelp();\r\n return;\r\n }\r\n \r\n //get model dir\r\n String modelDir = args[1];\r\n CRFSegmenter segmenter = new CRFSegmenter(modelDir);...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
if h<=360: h=360 self.resize(w,h) if w<=640: w = 640 self.resize(w, h)
[ "def resizeEvent(self, evt=None):\n\n w = self.width()\n h = self.height()\n '''\n \n '''\n\n step = (w * 94 / 100) / 5\n foot = h * 3 / 48" ]
[ "def do_region(self, x, y, w, h):\n \"\"\"\"\"\"\n if (x is None):\n self.logger.debug(\"region: full (nop)\")\n else:\n self.logger.debug(\"region: (%d,%d,%d,%d)\" % (x, y, w, h))\n self.image = self.image.crop((x, y, x + w, y + h))\n self.width = w\...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
// policyEvents builds a map of events (by type), for all the events in this set of // updates. There will be one event per type, containing all workload ids // affected by that event. e.g. all automated workload will share an event.
[ "func policyEvents(us policy.Updates, now time.Time) map[string]event.Event {\n\teventsByType := map[string]event.Event{}\n\tfor workloadID, update := range us {\n\t\tfor _, eventType := range policyEventTypes(update) {\n\t\t\te, ok := eventsByType[eventType]\n\t\t\tif !ok {\n\t\t\t\te = event.Event{\n\t\t\t\t\tSer...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Silent error handler catching WARNINGS & NOTICIES
[ "public function setSilentErrorHandler() {\n\n set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) {\n if (0 === error_reporting()) {\n return false;\n }\n\n if($this->logger != null) {\n // logging all warnings & n...
[ "public function write(string $fileName) : void\n {\n file_put_contents(\n $fileName,\n // str_replace here is to convert empty arrays into empty JS objects, which is expected by\n // codecov.io. Owner of the service said he was going to patch it, haven't tested since\n ...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Reverse the data structure for horizontal charts - reverse labels and every array inside datasets @param {object} data datasets and labels for the chart @return return the reversed data
[ "function reverseData(data) {\n\t\tdata.labels = data.labels.reverse();\n\t\tfor (var i = 0; i < data.datasets.length; i++) {\n\t\t\tfor (var key in data.datasets[i]) {\n\t\t\t\tif (Array.isArray(data.datasets[i][key])) {\n\t\t\t\t\tdata.datasets[i][key] = data.datasets[i][key].reverse();\n\t\t\t\t}\n\t\t\t}\n\t\t}...
[ "function(c, i, array) {\n if (c === undefined || c === null) return;\n // c is the component, type is dimension|attribute,\n // level is dataset|series|observation, i is index,\n // array is the component array\n failed += !iterator.call(context, c, type, level, i, array);\n }" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Import a .mat file with single potentials (a b m) into a pandas DataFrame Also export some variables of the MD struct into a separate structure
[ "def _read_mat_mnu0(filename):\n \n print('read_mag_single_file: {0}'.format(filename))\n\n mat = sio.loadmat(filename, squeeze_me=True)\n # check the version\n version = mat['MP']['Version'].item()\n if version != 'FZJ-EZ-2017':\n raise Exception(\n 'This data format is not supp...
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Normalize attr state
[ "def norm_attr(self):\n \n if not self.HAS_ATTR:\n return\n\n self.HAS_ATTR = False\n self.emit('call', 'COPY_ATTR', 0)\n backend.REQUIRES.add('copy_attr.asm')" ]
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
List all `deelgemeenten` in a `gewest`. :param gewest: The :class:`Gewest` for which the \ `deelgemeenten` are wanted. Currently only Flanders is supported. :rtype: A :class:`list` of :class:`Deelgemeente`.
[ "def list_deelgemeenten(self, gewest=2):\n '''\n \n '''\n try:\n gewest_id = gewest.id\n except AttributeError:\n gewest_id = gewest\n\n if gewest_id != 2:\n raise ValueError('Currently only deelgemeenten in Flanders are known.')\n\n ...
[ "def get_deelgemeente_by_id(self, id):\n '''\n \n '''\n def creator():\n if id in self.deelgemeenten:\n dg = self.deelgemeenten[id]\n return Deelgemeente(dg['id'], dg['naam'], dg['gemeente_niscode'])\n else:\n return None...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Append to a string buffer. @param buf Buffer @param meta Relation metadata (for labels) @return String buffer for chaining.
[ "public StringBuilder appendTo(StringBuilder buf, VectorFieldTypeInformation<BitVector> meta) {\n this.antecedent.appendTo(buf, meta);\n buf.append(\" --> \");\n this.consequent.appendItemsTo(buf, meta);\n buf.append(\": \");\n buf.append(union.getSupport());\n buf.append(\" : \");\n buf.append...
[ "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 post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
//export go_connection_error
[ "func go_connection_error(spSession unsafe.Pointer, spErr C.sp_error) {\n\tsessionCall(spSession, func(s *Session) {\n\t\ts.cbConnectionError(spError(spErr))\n\t})\n}" ]
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Set NLP Settings @see https://developers.facebook.com/docs/messenger-platform/built-in-nlp @return array
[ "public function setNLP($nlp_enabled = true, $model = 'ENGLISH', $custom_token = null, $verbose = false, $n_best = 1){\n return $this->call('me/nlp_configs', [\n 'nlp_enabled' => $nlp_enabled,\n 'model' => $model,\n 'custom_token' => $custom_token,\n 'verbose' => $...
[ "def open(self, user):\n \n self.params.update({\n 'user': user,\n })\n return FromUrl('https://slack.com/api/im.open', self._requests)(data=self.params).post()" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// New returns a new instance of translator for the 'gsw_FR' locale
[ "func New() locales.Translator {\n\treturn &gsw_FR{\n\t\tlocale: \"gsw_FR\",\n\t\tpluralsCardinal: []locales.PluralRule{2, 6},\n\t\tpluralsOrdinal: []locales.PluralRule{6},\n\t\tpluralsRange: []locales.PluralRule{2, 6},\n\t\tdecimal: \".\",\n\t\tgroup: ...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
/* Checks if Cordova 3D touch is present and loaded @return promise
[ "function () {\n var deferred = $q.defer();\n if (!window.cordova) {\n deferred.reject('Not supported in browser');\n } else {\n if (!window.ThreeDeeTouch) {\n deferred.reject('Could not find 3D touch plugin');...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Подключение к источнику данных @throws Eresus_Exception_ComponentCorrupted
[ "private function initDataSource()\n\t{\n $className = $this->conf['db']['engine'];\n\t\tif (class_exists($className))\n\t\t{\n\t\t\t$this->db = new $className;\n\t\t\t$this->db->init($this->conf['db']['host'], $this->conf['db']['user'],\n\t\t\t\t$this->conf['db']['password'], $this->conf['db']['name'],\n ...
[ "private function nameFull() {return dfc($this, function() {return\n\t\t$this->isTop()\n\t\t? df_trim_text_right($this->getName(), '[value]')\n\t\t// Анонимные филдсеты не добавляют своё имя в качестве префикса имён полей.\n\t\t: (!$this->_anonymous ? $this->getId() : $this->_parent->nameFull())\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github post about software development:", "pos": "Represent the Github code about software development:", "neg": "Represent the Github code about programming:" }
// ApplyRouteTable applies the given Router middleware to the given Router.
[ "func ApplyRouteTable(r transport.RouteTable, m Router) transport.RouteTable {\n\tif m == nil {\n\t\treturn r\n\t}\n\treturn routeTableWithMiddleware{r: r, m: m}\n}" ]
[ "public Javalin addHandler(@NotNull HandlerType httpMethod, @NotNull String path, @NotNull Handler handler) {\n return addHandler(httpMethod, path, handler, new HashSet<>()); // no roles set for this route (open to everyone with default access manager)\n }" ]
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Translates @first @last @1 @-1 expressions into an actual array index. :param str array_path: Array path in XJ notation. :rtype: int :return: Array index.
[ "def _get_array_index(array_path):\n \n\n if not array_path.startswith('@'):\n raise XJPathError('Array index must start from @ symbol.')\n array_path = array_path[1:]\n if array_path == 'last':\n return -1\n if array_path == 'first':\n return 0\n if array_path.isdigit() or (a...
[ "def _extract_lookup(self, key):\n \"\"\"\"\"\"\n parts = key.split('__')\n # 'exact' is the default lookup if there was no explicit comparison op in `key`\n # Assume there is only one `__` in the key.\n # FIXME Change for child attribute query support\n op = 'exact' if...
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
convert time from long to formatted string. @param time @return
[ "private String convertTime(final long time) {\n final Date date = new Date(time);\n return FORMAT.format(date);\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Get the weekday of date @param date current date @return day of week
[ "public static int getWeekdayOfDate(String date) {\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tint weekday = 0;\n\t\tCalendar c = Calendar.getInstance();\n\t\ttry {\n\t\t\tc.setTime(formatter.parse(date));\n\t\t\tweekday = c.get(Calendar.DAY_OF_WEEK);\n\t\t} catch (ParseException e)...
[ "def resolve(self, year: int = YEAR_ANY) -> MDate:\n \n year = year or self.year\n if year:\n return self._resolve(year)\n raise ValueError('Unable resolve the date without a specified year.')" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Sets the minimum value of the metric to be built. @param value the minimum value of the metric @param prettyPrintFormat the format of the output (@see {@link DecimalFormat}) @return this
[ "public MetricBuilder withMinValue(Number value, String prettyPrintFormat) {\n min = new MetricValue(value.toString(), prettyPrintFormat); \n return this;\n }" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
Get the attribute value.
[ "public AlgorithmId get(String name) throws IOException {\n if (name.equalsIgnoreCase(ALGORITHM)) {\n return (algId);\n } else {\n throw new IOException(\"Attribute name not recognized by \" +\n \"CertAttrSet:CertificateAlgorithmId.\");\n }\n ...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github instruction about CSS:", "pos": "Represent the Github code about CSS:", "neg": "Represent the Github code:" }
// Print formats the `*MigrateInfoEntry`'s in the set and prints them to the // given io.Writer, "to", returning "n" the number of bytes written, and any // error, if one occurred.
[ "func (e EntriesBySize) Print(to io.Writer) (int, error) {\n\tif len(e) == 0 {\n\t\treturn 0, nil\n\t}\n\n\textensions := make([]string, 0, len(e))\n\tsizes := make([]string, 0, len(e))\n\tstats := make([]string, 0, len(e))\n\tpercentages := make([]string, 0, len(e))\n\n\tfor _, entry := range e {\n\t\tbytesAbove :...
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Computer Science:" }
Gets human readable value for a given card. @return string
[ "public function shortName()\n {\n if ($this->isAce()) {\n return self::ACE_SYMBOL;\n }\n if ($this->isKing()) {\n return self::KING_SYMBOL;\n }\n if ($this->isQueen()) {\n return self::QUEEN_SYMBOL;\n }\n if ($this->isJack()) {\n ...
[ "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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Marshall the given parameter object.
[ "public void marshall(SubscriptionDefinitionVersion subscriptionDefinitionVersion, ProtocolMarshaller protocolMarshaller) {\n\n if (subscriptionDefinitionVersion == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protoc...
[ "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:" }
Retrieves the linked file entry, e.g. for a symbolic link. Returns: TSKFileEntry: linked file entry or None.
[ "def GetLinkedFileEntry(self):\n \n link = self._GetLink()\n if not link:\n return None\n\n # TODO: is there a way to determine the link inode number here?\n link_inode = None\n\n parent_path_spec = getattr(self.path_spec, 'parent', None)\n path_spec = tsk_path_spec.TSKPathSpec(\n l...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Formatting content for Dialog List and Notifications @param senderId sender of message (used in service messages) @param contentType type of content @param text text of message @param relatedUid optional related uid @return formatted content
[ "@ObjectiveCName(\"formatContentTextWithSenderId:withContentType:withText:withRelatedUid:withIsChannel:\")\n public String formatContentText(int senderId, ContentType contentType, String text, int relatedUid,\n boolean isChannel) {\n\n String groupKey = isChannel ? \"cha...
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Determines which core genes from a pre-calculated database are present in each strain
[ "def cdsthreads(self):\n \n # Create and start threads\n for i in range(self.cpus):\n # Send the threads to the appropriate destination function\n threads = Thread(target=self.cds, args=())\n # Set the daemon to true - something to do with thread management\n ...
[ "def seq_dup_levels_plot (self):\n \n\n data = dict()\n max_dupval = 0\n for s_name in self.fastqc_data:\n try:\n thisdata = {}\n for d in self.fastqc_data[s_name]['sequence_duplication_levels']:\n thisdata[d['duplication_level'...
codesearchnet
{ "query": "Represent the sentence about Bioinformatics:", "pos": "Represent the code about Bioinformatics:", "neg": "Represent the code:" }
// AddCollection appends the resource into the list of embedded // resources with the specified relation. // r should be a ResourceCollection
[ "func (e Embedded) AddCollection(rel Relation, r ResourceCollection) {\n\tn := e[rel]\n\tif n == nil {\n\t\t//new embed\n\t\te[rel] = r\n\t\treturn\n\t}\n\n\tif nc, ok := n.([]*Resource); ok {\n\t\te[rel] = append(nc, r...)\n\t\treturn\n\t}\n\n\tif nr, ok := n.(*Resource); ok {\n\t\te[rel] = append([]*Resource{nr},...
[ "@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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return Nginx service Data @param array $params @return array
[ "public function getServiceDataDatabaseConnections(array $params) {\n\n $dataPostgresql = new \\Cityware\\Monitoring\\Models\\Services\\DataPostgreSql($params);\n\n $connectionsDatabases = $dataPostgresql->getDataPgSqlDatabasesConnections();\n\n $return = Array();\n \n $geoipV1 = ...
[ "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 PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
Returns a MinimizedCondition that represents the condition node after minimization.
[ "static MinimizedCondition fromConditionNode(Node n) {\n checkState(n.getParent() != null);\n switch (n.getToken()) {\n case NOT:\n case AND:\n case OR:\n case HOOK:\n case COMMA:\n return computeMinimizedCondition(n);\n default:\n return unoptimized(n);\n }\n }...
[ "@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the...
codesearchnet
{ "query": "Represent the Github sentence about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Programming:" }
Returns the SQL clause for creating a column in a table alteration. @param Column $column The column to add. @return string
[ "protected function getAlterTableAddColumnClause(Column $column)\n {\n return 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());\n }" ]
[ "public function beforeGetFinalisedQuery(DataQuery $dataQuery, $queriedColumns = [], SQLSelect $sqlSelect)\n {\n // Get metadata and SQL from join table\n $hasManyRelation = $this->getParentRelationship($dataQuery);\n $joinTableSQLSelect = $hasManyRelation->dataQuery()->query();\n $jo...
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:" }
获取变量 自内向外在作用域栈中查找变量,返回最先找到的变量
[ "public Object get(Object key) {\r\n\t\tfor (Scope cur=this; cur!=null; cur=cur.parent) {\r\n//\t\t\tif (cur.data != null && cur.data.containsKey(key)) {\r\n//\t\t\t\treturn cur.data.get(key);\r\n//\t\t\t}\r\n\t\t\t\r\n\t\t\tif (cur.data != null) {\r\n\t\t\t\tObject ret = cur.data.get(key);\r\n\t\t\t\tif (ret != nu...
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about text processing:" }
返回目录中的内容 @param string $directory @param bool $recursive @return array
[ "public function listContents(string $directory = '', bool $recursive = false): array\n {\n $list = [];\n $location = $this->applyBasePath($directory);\n\n if (! is_dir($location)) {\n return $list;\n }\n\n $iterator = $recursive ?\n $this->getRecu...
[ "static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Reads the content score. @param node @return
[ "private static int getContentScore(Element node) {\n try {\n return Integer.parseInt(node.attr(CONTENT_SCORE));\n } catch (NumberFormatException e) {\n return 0;\n }\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Run a remote command. This is called via py3-cmd utility. We look for any uds sockets with the correct name prefix and send our command to all that we find. This allows us to communicate with multiple py3status instances.
[ "def send_command():\n \n\n def verbose(msg):\n \"\"\"\n print output if verbose is set.\n \"\"\"\n if options.verbose:\n print(msg)\n\n options = command_parser()\n msg = json.dumps(vars(options)).encode(\"utf-8\")\n if len(msg) > MAX_SIZE:\n verbose(\"M...
[ "def work_on_machine(context):\n \n print(\"Created context. Context ID is\", context.context_id)\n\n # You don't need to understand any/all of this, but it's helpful to grok\n # the whole chain:\n\n # - Context.call() is a light wrapper around .call_async(), the wrapper\n # simply blocks the ca...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
returns the oauth2 class
[ "def oauth2(self):\n \n if self._url.endswith(\"/oauth2\"):\n url = self._url\n else:\n url = self._url + \"/oauth2\"\n return _oauth2.oauth2(oauth_url=url,\n securityHandler=self._securityHandler,\n proxy_ur...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Yields to each element of specified node_type All elements if e_node_type is nil.
[ "def each_element(e_node_type=nil, &block) \n\t\t@children.each do |c| \n\t\t\tif c.kind_of? MDElement\n\t\t\t\tif (not e_node_type) || (e_node_type == c.node_type)\n\t\t\t\t\tblock.call c\n\t\t\t\tend\n\t\t\t\tc.each_element(e_node_type, &block)\n\t\t\tend\n\t\tend\n\tend" ]
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Marshall the given parameter object.
[ "public void marshall(GetRelationalDatabaseMasterUserPasswordRequest getRelationalDatabaseMasterUserPasswordRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (getRelationalDatabaseMasterUserPasswordRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Установить тип платежа. Из констант @param int $paymentType throws SdkException @return CreateDocumentRequest
[ "public function addPaymentType($paymentType){\n if(!in_array($paymentType, $this->getPaymentTypes())){\n throw new SdkException('Wrong payment type');\n }\n \n $this->paymentType = $paymentType;\n return $this;\n }" ]
[ "private function nameFull() {return dfc($this, function() {return\n\t\t$this->isTop()\n\t\t? df_trim_text_right($this->getName(), '[value]')\n\t\t// Анонимные филдсеты не добавляют своё имя в качестве префикса имён полей.\n\t\t: (!$this->_anonymous ? $this->getId() : $this->_parent->nameFull())\n\t;});}" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *ExecutionDetails) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"ExecutionDetails\"}\n\tif s.ExternalExecutionId != nil && len(*s.ExternalExecutionId) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ExternalExecutionId\", 1))\n\t}\n\tif s.Summary != nil && len(*s.Summa...
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Adds an admin tool at the given position.<p> @param adminTool the admin tool @param position the position @see org.opencms.workplace.tools.CmsIdentifiableObjectContainer#addIdentifiableObject(String, Object, float)
[ "public void addAdminTool(CmsTool adminTool, float position) {\n\n m_container.addIdentifiableObject(adminTool.getId(), adminTool, position);\n }" ]
[ "@Override\n public void afterInitialized(BaseComponent comp) {\n super.afterInitialized(comp);\n propertyGrid = PropertyGrid.create(null, comp, true);\n getPlugin().registerProperties(this, \"provider\", \"group\");\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
The category axis of this chart. In the case of an XY or Bubble chart, this is the X axis. Raises |ValueError| if no category axis is defined (as is the case for a pie chart, for example).
[ "def category_axis(self):\n \n catAx_lst = self._chartSpace.catAx_lst\n if catAx_lst:\n return CategoryAxis(catAx_lst[0])\n\n dateAx_lst = self._chartSpace.dateAx_lst\n if dateAx_lst:\n return DateAxis(dateAx_lst[0])\n\n valAx_lst = self._chartSpace.va...
[ "def _is_axis_allowed(self, axis):\n \n if axis is None:\n # If table direction was requested, we must ensure that each slice\n # doesn't have the CA items dimension (thus the [-2:] part). It's\n # OK for the 0th dimension to be items, since no calculation is\n ...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Logs a response.
[ "protected final <R extends Response> R logResponse(R response) {\n LOGGER.trace(\"{} - Sending {}\", context.getCluster().member().address(), response);\n return response;\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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Remove the action $name from the actions container @param $name @return $this
[ "public function removeAction($name)\n {\n\n if (isset($this->actions[$name])) {\n unset($this->actions[$name]);\n }\n\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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Add new data to this provider. If there is already data for that namespace it will get appended. If you want to prepend it, use self::prepend(). @param array|ArrayAccess $data @param string $namespace (default:'default') @return $this
[ "public function add($data, $namespace='default')\n {\n Type::force($data, ArrayAccess::class);\n\n if (!isset($this->addedData[$namespace])) {\n $this->addedData[$namespace] = [];\n }\n\n $this->addedData[$namespace][] = $data;\n\n return $this;\n }" ]
[ "public function validate() {\n if ($this->initializer) {\n Ensure::isFalse($this->initializer->getRepository() && $this->initializer->getValue(), 'It makes no sense to define initializer repository and value simultaneously for column [%s]', $this->name);\n }\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// buildMaxMin builds the AggFunc implementation for function "MAX" and "MIN".
[ "func buildMaxMin(aggFuncDesc *aggregation.AggFuncDesc, ordinal int, isMax bool) AggFunc {\n\tbase := baseMaxMinAggFunc{\n\t\tbaseAggFunc: baseAggFunc{\n\t\t\targs: aggFuncDesc.Args,\n\t\t\tordinal: ordinal,\n\t\t},\n\t\tisMax: isMax,\n\t}\n\n\tevalType, fieldType := aggFuncDesc.RetTp.EvalType(), aggFuncDesc.Ret...
[ "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 Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Encodes an incremental cardinality constraint and returns its encoding. @param cc the cardinality constraint @return the encoding of the constraint and the incremental data
[ "public Pair<ImmutableFormulaList, CCIncrementalData> encodeIncremental(final PBConstraint cc) {\n final EncodingResult result = EncodingResult.resultForFormula(f);\n final CCIncrementalData incData = this.encodeIncremental(cc, result);\n return new Pair<>(new ImmutableFormulaList(FType.AND, result.result(...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Parses a format pattern and produces a generic token from it. This token can be used by writers for rendering log entries. @param pattern Format pattern @return Produced root token
[ "public static Token parse(final String pattern) {\n\t\tList<Token> tokens = new ArrayList<Token>();\n\n\t\tint start = 0;\n\t\tint count = 0;\n\n\t\tfor (int i = 0; i < pattern.length(); ++i) {\n\t\t\tchar character = pattern.charAt(i);\n\n\t\t\tif (character == '{') {\n\t\t\t\tif (count == 0) {\n\t\t\t\t\tif (sta...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
@param BoletoContract $boleto @return $this @throws \Exception
[ "public function addBoleto(BoletoContract $boleto)\n {\n $this->boletos[] = $boleto;\n $this->iniciaDetalhe();\n\n $this->add(1, 1, '1');\n $this->add(2, 6, '');\n $this->add(7, 7, '');\n $this->add(8, 12, '');\n $this->add(13, 19, '');\n $this->add(20, 20,...
[ "public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }" ]
codesearchnet
{ "query": "Represent the sentence about API documentation:", "pos": "Represent the code about API documentation:", "neg": "Represent the code about Software development:" }
Returns an identity matrix
[ "public static Info eye( final Variable A , ManagerTempVariables manager) {\n Info ret = new Info();\n final VariableMatrix output = manager.createMatrix();\n ret.output = output;\n\n if( A instanceof VariableMatrix ) {\n ret.op = new Operation(\"eye-m\") {\n @O...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Creates the canvas DOM Element and appends it to the document body @return {CanvasElement} The newly created canvas element.
[ "function(id) {\n\t\tvar canvasContainer = document.createElement(\"div\");\n\t\tcanvasContainer.id = id;\n\t\tcanvasContainer.width = window.innerWidth;\n\t\tcanvasContainer.height = window.innerHeight;\n\t\tthis.addCanvasContainerToDOMBody(canvasContainer);\n\t\tthis.setDOMMode(canvasContainer, this.domMode);\n\t...
[ "public static HTML embedFlashObject (Panel container, String htmlString)\n {\n // Please note: the following is a work-around for an IE7 bug. If we create a Flash object\n // node *before* attaching it to the DOM tree, IE will silently fail to register\n // the Flash object's callback funct...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// SplitPath splits a path by its driver and respective volume. Returns // error if the driver is not initialized.
[ "func SplitPath(volumePath string) (string, string, error) {\n\t// Validate the path\n\trootDir := filepath.Clean(volumePath)\n\tif !filepath.IsAbs(rootDir) {\n\t\t// must be absolute\n\t\treturn \"\", \"\", ErrPathIsNotAbs\n\t}\n\tif _, ok := driversByRoot[rootDir]; ok {\n\t\treturn volumePath, \"\", nil\n\t}\n\tf...
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Error level message.
[ "func (e *Entry) Error(msg string) {\n\te.Logger.log(ErrorLevel, e, msg)\n}" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the instruction about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code:" }
Resolve a sub type of the given super type. @param superType the super type @param subType the sub type to resolve @return resolved type @see TypeResolver#resolveSubtype(ResolvedType, Class)
[ "@NonNull\n\tpublic static ResolvedType resolveSubtype(@NonNull ResolvedType superType, @NonNull Class<?> subType)\n\t{\n\t\treturn typeResolver.resolveSubtype(superType, subType);\n\t}" ]
[ "<T> void addProvider(BindingAmp<T> binding)\n {\n // TypeRef typeRef = TypeRef.of(producer.key().type());\n\n Class<T> type = (Class) binding.key().rawClass();\n\n addBinding(type, binding);\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Decide if the cache file is sufficient enough to not parse the ids files.
[ "private function _is_cache_worthy()\n {\n $pci_good = true;\n foreach (array_keys($this->_pci_entries) as $vendor) {\n foreach (array_keys($this->_pci_entries[$vendor]) as $dever) {\n if (!isset($this->_existing_cache_vals['hw']['pci'][$vendor][$dever])) {\n ...
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
// SetGroupName sets the GroupName field's value.
[ "func (s *AddUserToGroupInput) SetGroupName(v string) *AddUserToGroupInput {\n\ts.GroupName = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Ask the current {@link #adtExtender} for a potential extension. @param ads the temporary ADS based on the inferred distinguishing suffix @return a validated ADT that can be used to distinguish the states referenced in the given temporary ADS
[ "private ADTNode<ADTState<I, O>, I, O> evaluateAdtExtension(final ADTNode<ADTState<I, O>, I, O> ads) {\n\n final ExtensionResult<ADTState<I, O>, I, O> potentialExtension =\n this.adtExtender.computeExtension(this.hypothesis, this, ads);\n\n if (potentialExtension.isCounterExample()) {\n...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// GetDomainsByNameAndOrganization returns back a list of domains given a list // of domains names and the organization GUID. If no domains are given, than this // command will not lookup any domains.
[ "func (actor Actor) GetDomainsByNameAndOrganization(domainNames []string, orgGUID string) ([]Domain, Warnings, error) {\n\tif len(domainNames) == 0 {\n\t\treturn nil, nil, nil\n\t}\n\n\tvar domains []Domain\n\tvar allWarnings Warnings\n\n\t// TODO: If the following causes URI length problems, break domainNames into...
[ "def set_schema(self, schema_name, include_public=True):\n \n self.tenant = FakeTenant(schema_name=schema_name)\n self.schema_name = schema_name\n self.include_public_schema = include_public\n self.set_settings_schema(schema_name)\n self.search_path_set = False\n # C...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Creates and adds a single subfield from the MARCspecParser result. @param array $_subfield The MARCspecParser result array
[ "private function addSubfield($_subfield)\n {\n if (array_key_exists('subfieldtagrange', $_subfield)) {\n $_subfieldRange = $this->handleSubfieldRanges($_subfield['subfieldtagrange']);\n } else {\n $_subfieldRange[] = $_subfield['subfieldtag'];\n }\n\n foreach ($...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
First check system properties, then the variables given
[ "private Integer getPortFromProjectOrSystemProperty(String var) {\n String sysProp = System.getProperty(var);\n if (sysProp != null) {\n return getAsIntOrNull(sysProp);\n }\n if (projProperties.containsKey(var)) {\n return getAsIntOrNull(projProperties.getProperty(v...
[ "def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
*join all file names, driectory names and text content together*
[ "def _join_all_filenames_and_text(\n self):\n \n self.log.info('starting the ``_join_all_filenames_and_text`` method')\n\n contentString = u\"\"\n for i in self.directoryContents:\n contentString += u\"%(i)s\\n\" % locals()\n if os.path.isfile(os.path.joi...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Move down current position @param int $count Move count @return CursorObject Self instance
[ "public function down ( $count = 0 ) {\n $this->_currentPosition = array(\n $this->_currentPosition[0],\n $this->_currentPosition[1] + $count,\n );\n return $this;\n }" ]
[ "public void setPage(int page) {\n if(page < 0)\n throw new IllegalArgumentException(Bundle.getErrorString(\"PagerModel_IllegalPage\"));\n\n /* todo: need to check that the new 'current' page is in range given the first/last boundaries */\n _currentRow = new Integer(page * getPageSiz...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Force adminobjects with new content. This method is thread safe @param newContent the list of new properties
[ "public synchronized void forceAdminObjects(List<AdminObject> newContent)\n {\n if (newContent != null)\n {\n this.adminobjects = new ArrayList<AdminObject>(newContent);\n }\n else\n {\n this.adminobjects = new ArrayList<AdminObject>(0);\n }\n }" ]
[ "def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Creates a new {@link Entity} with provided identifier and label @param id a {@link QualifiedName} for the entity @param label a String for the label property (see {@link HasLabel#getLabel()} @return an object of type {@link Entity}
[ "public Entity newEntity(QualifiedName id, String label) {\n\tEntity res = newEntity(id);\n\tif (label != null)\n\t res.getLabel().add(newInternationalizedString(label));\n\treturn res;\n }" ]
[ "@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// Assign multi file keys
[ "func (m *Master) AssignN(count int) (fid string, err error) {\n\targs := url.Values{}\n\tif count > 0 {\n\t\targs.Set(\"count\", strconv.Itoa(count))\n\t}\n\n\treturn m.AssignArgs(args)\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the sentence about File management:", "pos": "Represent the code about File management:", "neg": "Represent the code about programming:" }
// NewControllerAPIv6 creates a new ControllerAPIv6.
[ "func NewControllerAPIv6(ctx facade.Context) (*ControllerAPIv6, error) {\n\tv7, err := NewControllerAPIv7(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\treturn &ControllerAPIv6{v7}, nil\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 summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Promise internals Below this, everything is @private Get an appropriate handler for x, without checking for cycles @param {*} x @returns {object} handler
[ "function getHandler(x) {\n\t\t\tif(isPromise(x)) {\n\t\t\t\treturn x._handler.join();\n\t\t\t}\n\t\t\treturn maybeThenable(x) ? getHandlerUntrusted(x) : new Fulfilled(x);\n\t\t}" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Get and validates the type given @param string $input Any format int[], boolean, null|string etc @return string @throws Exception\ClassFile When the type/class cannot be found
[ "public function getType($input)\n {\n // Make an array to loop through\n $inputs = explode('|', $input);\n\n foreach ($inputs as $index => $input) {\n $list = (bool) preg_match('/\\[\\]$/', $input);\n if ($list === true) {\n $input = substr($input, 0, -2...
[ "function run(booleanOrString, anyDataType, functionOrObject, aNumber, anArray) {\n /*\n * if expectations aren't met, args checker will throw appropriate exceptions\n * notifying the user regarding the errors of the arguments.\n * */\n \targs.expect(arguments, ['boolean|string', '*',...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Pour une variable, fonction qui calcule la moyenne pondérée au sein de chaque groupe.
[ "def collapse(dataframe, groupe, var):\n '''\n \n '''\n grouped = dataframe.groupby([groupe])\n var_weighted_grouped = grouped.apply(lambda x: wavg(groupe = x, var = var))\n return var_weighted_grouped" ]
[ "public function toMail()\n {\n return (new MailMessage)\n ->subject(config('app.name').' : Ré-initialisation de votre mot de passe')\n ->line([\n 'Vous recevez cet email car nous avons reçu une demande de ré-initialisation de mot de passe pour votre compte.',\n ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
// GetBySuffix gets a output format given as suffix, e.g. "html". // It will return false if no format could be found, or if the suffix given // is ambiguous. // The lookup is case insensitive.
[ "func (formats Formats) GetBySuffix(suffix string) (f Format, found bool) {\n\tfor _, ff := range formats {\n\t\tif strings.EqualFold(suffix, ff.MediaType.Suffix()) {\n\t\t\tif found {\n\t\t\t\t// ambiguous\n\t\t\t\tfound = false\n\t\t\t\treturn\n\t\t\t}\n\t\t\tf = ff\n\t\t\tfound = true\n\t\t}\n\t}\n\treturn\n}" ]
[ "def reset(self):\n \n\n # Use first matching element as title (0 or more xpath expressions)\n self.title = OrderedSet()\n\n # Use first matching element as body (0 or more xpath expressions)\n self.body = OrderedSet()\n\n # Use first matching element as author (0 or more x...
codesearchnet
{ "query": "Represent the description about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code about programming:" }
/* (non-Javadoc) @see org.activiti.engine.impl.history.HistoryManagerInterface# recordProcessDefinitionChange(java.lang.String, java.lang.String)
[ "@Override\n public void recordProcessDefinitionChange(String processInstanceId, String processDefinitionId) {\n if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {\n HistoricProcessInstanceEntity historicProcessInstance = getHistoricProcessInstanceEntityManager().findById(processInstanceId);\n if (hi...
[ "@Override\n public Collection<org.jbpm.services.api.model.NodeInstanceDesc> getActiveNodesForCase(String caseId, QueryContext queryContext) {\n Map<String, Object> params = new HashMap<String, Object>();\n params.put(\"caseId\", caseId + \"%\");\n applyQueryContext(params, queryContext);\n ...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Copies the file from source to target Args: startimage (str): name of the image to stage these files into newimage (str): name of the created image
[ "def stage(self, startimage, newimage):\n \n client = utils.get_client()\n cprint(' Copying file from \"%s:/%s\" \\n to \"%s://%s/\"'\n % (self.sourceimage, self.sourcepath, startimage, self.destpath),\n 'blue')\n\n # copy build artifacts from...
[ "def is_multifile_object_without_children(self, location: str) -> bool:\n \n # (1) Find the base directory and base name\n if isdir(location): # special case: parent location is the root folder where all the files are.\n return len(self.find_multifile_object_children(location)) == 0...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
(required) This method is executed after interact() and initialize(). It contains the logic you want the command to execute. @param InputInterface $input @param OutputInterface $output
[ "protected function execute(InputInterface $input, OutputInterface $output)\n\t{\n\t\t$output->writeln([ // outputs multiple lines to the console (adding \"\\n\" at the end of each line)\n\t\t\t'MyAdmin DocBlock Parser',\n\t\t\t'=======================',\n\t\t\t''\n\t\t\t\t\t\t ]);\n\t\t$output->writeln('<info>foo<...
[ "def _enter(self):\n \"\"\"\"\"\"\n command = self.command\n logger.log(5, \"Snippet keystroke `Enter`.\")\n # NOTE: we need to set back the actions (mode_off) before running\n # the command.\n self.mode_off()\n self.run(command)" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
{@inheritDoc} @see jp.co.future.uroborosql.filter.AbstractSqlFilter#doQuery(jp.co.future.uroborosql.context.SqlContext, java.sql.PreparedStatement, java.sql.ResultSet)
[ "@Override\n\tpublic ResultSet doQuery(final SqlContext sqlContext, final PreparedStatement preparedStatement,\n\t\t\tfinal ResultSet resultSet) {\n\t\tLOG.debug(\"SQL:{} executed.\", sqlContext.getSqlName());\n\t\treturn resultSet;\n\t}" ]
[ "public static void useAsDataTransfer(Dialect dialect, IContainerFactory containerFactory) {\r\n\t\tuseAsDataTransfer(dialect, containerFactory, new com.jfinal.plugin.activerecord.cache.EhCache());\r\n\t}" ]
codesearchnet
{ "query": "Represent the description about org.archive.wayback.resourceindex:", "pos": "Represent the code about org.archive.wayback.resourceindex:", "neg": "Represent the code:" }
// SetDescription sets the Description field's value.
[ "func (s *PutBotAliasOutput) SetDescription(v string) *PutBotAliasOutput {\n\ts.Description = &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 instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// ServeHTTP dispatches the request to the internal Router.
[ "func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tiw := newResponseWriter(w)\n\n\tcreateRequestContext(r)\n\tdefer deleteRequestContext(r)\n\n\ts.serveHTTP(iw, r)\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Creates a string on phrases. @param array $fields @param array & $messagesToRegister @return string
[ "protected function getLangPhrases(array $labels, array &$messagesToRegister)\n {\n $messages = [];\n\n foreach ($labels as $label) {\n if (!$this->isMessageExists($label->localeGroup, $label->lang) || $this->option('force')) {\n $messages[] = $this->getMessage($label);\n ...
[ "func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}" ]
codesearchnet
{ "query": "Represent the instruction about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
Search for and return the file and line number from the log collector. Returns: (pathname, lineno, func_name) The full path, line number, and function name for the logpoint location.
[ "def GetLoggingLocation():\n \n frame = inspect.currentframe()\n this_file = frame.f_code.co_filename\n frame = frame.f_back\n while frame:\n if this_file == frame.f_code.co_filename:\n if 'cdbg_logging_location' in frame.f_locals:\n ret = frame.f_locals['cdbg_logging_location']\n if len(...
[ "def stack_sources():\n \"\"\"\"\"\"\n # lazy imports\n import linecache\n result = []\n for frame_info in reversed(inspect.stack()):\n _frame, filename, line_number, _function, _context, _index = frame_info\n linecache.lazycache(filename, {})\n _line = linecache.getline(filename...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// set the request body as an io.Reader
[ "func Body(r io.Reader) RequestOption {\n\treturn func(req *http.Request) (*http.Request, error) {\n\t\tif r == nil {\n\t\t\treq.Body = http.NoBody\n\t\t\treq.ContentLength = 0\n\t\t\treturn req, nil\n\t\t}\n\n\t\tif rc, ok := r.(io.ReadCloser); ok {\n\t\t\treq.Body = rc\n\t\t} else {\n\t\t\treq.Body = ioutil.NopCl...
[ "@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 sentence about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Optionally performs gripper visualization after the actions.
[ "def _post_action(self, action):\n \"\"\"\"\"\"\n ret = super()._post_action(action)\n self._gripper_visualization()\n return ret" ]
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Outputs a summary for the given Log. @param logId The Log Id. @param m The Log Metadata for the given Log Id.
[ "protected void outputLogSummary(int logId, ReadOnlyLogMetadata m) {\n if (m == null) {\n output(\"Log %d: No metadata.\", logId);\n } else {\n output(\"Log %d: Epoch=%d, Version=%d, Enabled=%s, Ledgers=%d, Truncation={%s}\", logId,\n m.getEpoch(), m.getUpdateV...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Return the Pod information for the specified taxonomy, or null if the taxonomy isn't a Pod @return array|bool|mixed|null
[ "private function get_pod_info() {\n\n\t\t$pod_info = null;\n\n\t\tif ( pods_api()->pod_exists( $this->taxonomy ) ) {\n\n\t\t\t// Load the taxonomy Pod\n\t\t\t$params = array(\n\t\t\t\t'name' => $this->taxonomy,\n\t\t\t\t'table_info' => true,\n\t\t\t);\n\t\t\t$pod_info = pods_api()->load_pod( $params, false...
[ "@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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
// scanTags examines all the tags in a Point, keeping track of and // returning the updated indices slice, number of commas and location // in buf where to start examining the Point fields.
[ "func scanTags(buf []byte, i int, indices []int) (int, int, []int, error) {\n\tvar (\n\t\terr error\n\t\tcommas int\n\t\tstate = tagKeyState\n\t)\n\n\tfor {\n\t\tswitch state {\n\t\tcase tagKeyState:\n\t\t\t// Grow our indices slice if we have too many tags.\n\t\t\tif commas >= len(indices) {\n\t\t\t\tnewIndics...
[ "private static PortablePosition navigateToPathTokenWithoutQuantifier(\n PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {\n if (path.isLastToken()) {\n // if it's a token that's on the last position we calculate its direct access position and return it for\n ...
codesearchnet
{ "query": "Represent the text about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
// shouldTransfer checks the primaries of zone, retrieves the SOA record, checks the current serial // and the remote serial and will return true if the remote one is higher than the locally configured one.
[ "func (z *Zone) shouldTransfer() (bool, error) {\n\tc := new(dns.Client)\n\tc.Net = \"tcp\" // do this query over TCP to minimize spoofing\n\tm := new(dns.Msg)\n\tm.SetQuestion(z.origin, dns.TypeSOA)\n\n\tvar Err error\n\tserial := -1\n\nTransfer:\n\tfor _, tr := range z.TransferFrom {\n\t\tErr = nil\n\t\tret, _, e...
[ "boolean isLogUpToDate(long lastIndex, long lastTerm, Request request) {\n // If the log is empty then vote for the candidate.\n if (context.getLog().isEmpty()) {\n LOGGER.trace(\"{} - Accepted {}: candidate's log is up-to-date\", context.getCluster().member().address(), request);\n return true;\n ...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get a stored value by it's key @param string $key @return mixed
[ "public function get($key)\n {\n $file = $this->cacheDir . $this->getDir($key) . $this->getFile($key);\n if (file_exists($file) && is_readable($file)) {\n if (filemtime($file) > time()) {\n return file_get_contents($file);\n }\n }\n\n return false;...
[ "private static function resource($resource)\n {\n exception_if(($resource != 'session' && $resource != 'cookie'), LogicException::class, 'The resource name of \\''.$resource.'\\' is not supported by Vinala, only session or cookie');\n\n return Hash::make(config('auth.'.$resource));\n\n // F...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
GetContactType Method.
[ "public ContactType getContactType(Person recPerson)\n {\n if (m_recContactType == null)\n {\n m_recContactType = (ContactType)Record.makeRecordFromClassName(ContactTypeModel.CONTACT_TYPE_FILE, this.getOwner().getRecord().findRecordOwner());\n if (((Record)m_recContactType).ge...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code about File management:" }
// GetURL returns the URL field if it's non-nil, zero value otherwise.
[ "func (u *UserLDAPMapping) GetURL() string {\n\tif u == nil || u.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.URL\n}" ]
[ "def _wrap_field(field):\n \"\"\"\"\"\"\n class WrappedField(field):\n def output(self, key, obj):\n value = _fields.get_value(key if self.attribute is None else self.attribute, obj)\n\n # For all fields, when its value was null (None), return null directly,\n # instea...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Add the where statement for this filter to the query. @param ProxyQuery $proxy
[ "protected function getWhere(ProxyQuery $proxy)\n {\n $queryBuilder = $proxy->getQueryBuilder();\n if (self::CONDITION_OR == $this->getCondition()) {\n return $queryBuilder->orWhere();\n }\n\n return $queryBuilder->andWhere();\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// Cleanup unmounts the home directory.
[ "func (d *Driver) Cleanup() error {\n\terr := d.subvolDisableQuota()\n\tumountErr := mount.Unmount(d.home)\n\n\t// in case we have two errors, prefer the one from disableQuota()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif umountErr != nil {\n\t\treturn umountErr\n\t}\n\n\treturn nil\n}" ]
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Compares double fields with these explicitly specified fields using the provided absolute tolerance. @param tolerance A finite, non-negative tolerance.
[ "public MapWithProtoValuesFluentAssertion<M> usingDoubleToleranceForFieldDescriptorsForValues(\n double tolerance, Iterable<FieldDescriptor> fieldDescriptors) {\n return usingConfig(config.usingDoubleToleranceForFieldDescriptors(tolerance, fieldDescriptors));\n }" ]
[ "private int dimensionality(Relation<O> rel) {\n // Explicit:\n if(idim >= 0) {\n return idim;\n }\n // Cast to vector field relation.\n @SuppressWarnings(\"unchecked\")\n final Relation<NumberVector> frel = (Relation<NumberVector>) rel;\n int dim = RelationUtil.dimensionality(frel);\n ...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Lazily checks and answers whether the Aqua look&amp;feel is active. @return {@code true} if the current look&amp;feel is Aqua
[ "public static boolean isLafAqua() {\n ensureValidCache();\n if (cachedIsLafAqua == null) {\n cachedIsLafAqua = Boolean.valueOf(computeIsLafAqua());\n }\n return cachedIsLafAqua.booleanValue();\n }" ]
[ "function(terria) {\n ImageryLayerCatalogItem.call(this, terria);\n\n this._rawMetadata = undefined;\n this._thisLayerInRawMetadata = undefined;\n this._allLayersInRawMetadata = undefined;\n\n this._metadata = undefined;\n this._getCapabilitiesUrl = undefined;\n\n this._rectangle = undefined;\n this._rectan...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Retrieve the variant region BED file from a population of items. If tumor/normal, return the tumor BED file. If a population, return the BED file covering the most bases.
[ "def population_variant_regions(items, merged=False):\n \n def _get_variant_regions(data):\n out = dd.get_variant_regions(data) or dd.get_sample_callable(data)\n # Only need to merge for variant region inputs, not callable BED regions which don't overlap\n if merged and dd.get_variant_reg...
[ "def record_is_valid(record):\n \"\"\n\n # No random contigs\n if record.CHROM.startswith('GL'):\n return False\n\n # Skip results with a read depth < 5. If no read depth is specified then\n # we have no choice but to consider this record as being valid.\n if 'DP' in record.INFO and record....
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }