query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Calls the specified handler when this promise is fulfilled.
If the handler returns a promise,
@param callable $handler
@return PromiseInterface | [
"public function to($handler /*, $args… */)\n {\n $args = array_slice(func_get_args(), 1);\n\n return $this->then(\n function (Allocation $allocation) use ($handler, $args) {\n try {\n $result = call_user_func_array($handler, $args);\n ... | [
"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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Make JsonResponse
:param rv: Response: the object to encode, or tuple (response, status, headers)
:type rv: tuple|*
:rtype: JsonResponse | [
"def make_json_response(rv):\n \n # Tuple of (response, status, headers)\n rv, status, headers = normalize_response_value(rv)\n\n # JsonResponse\n if isinstance(rv, JsonResponse):\n return rv\n\n # Data\n return JsonResponse(rv, status, headers)"
] | [
"def get_value_from_content(key):\n \n def value_from_content_function(service, message):\n \"\"\"Actual implementation of get_value_from_content function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(messa... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Computes the bounding circle
@param geometry
@return | [
"public static Geometry computeBoundingCircle(Geometry geometry) {\n if (geometry == null) {\n return null;\n }\n return new MinimumBoundingCircle(geometry).getCircle();\n }"
] | [
"def ystep(self):\n \n \"\"\"\n\n self.Y = self.Pcn(self.AX + self.U)"
] | codesearchnet | {
"query": "Represent the comment about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
// NewMockClientFacade creates a new mock instance | [
"func NewMockClientFacade(ctrl *gomock.Controller) *MockClientFacade {\n\tmock := &MockClientFacade{ctrl: ctrl}\n\tmock.recorder = &MockClientFacadeMockRecorder{mock}\n\treturn mock\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Describes tget_grades_table return value.
@return external_single_structure
@since Moodle 2.9 | [
"public static function get_grades_table_returns() {\n return new external_single_structure(\n array(\n 'tables' => new external_multiple_structure(\n new external_single_structure(\n array(\n 'courseid' => new ext... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
/*
getWsagObject receives in serializedData the object information in xml
must returns a eu.atos.sla.parser.data.wsag.Agreement | [
"@Override\n public Agreement getWsagObject(String serializedData) throws ParserException{\n Agreement agreementXML = null;\n try{\n logger.info(\"Will parse {}\", serializedData);\n JAXBContext jaxbContext = JAXBContext.newInstance(Agreement.class);\n Unmarshaller ... | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Visit the given $query parameters into hash representation. | [
"private function visitParameters(Query $query, VisitorInterface $subVisitor): array\n {\n $parametersByLanguage = [\n $query->getLocale() => iterator_to_array(\n $this->visitTranslationParameters($query, $subVisitor)\n ),\n ];\n\n foreach ($query->getAva... | [
"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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Try to restore user from data in session.
@return void | [
"protected static function restoreFromSession()\n {\n $session = Http\\Session::getInstance();\n\n try {\n $mapper = new UserMapper(Database::get());\n $user = $mapper->findFromSession($session);\n } catch (\\Exception $exception) {\n $user = new Data\\User... | [
"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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// Init will initialize or reset a StringTree. | [
"func (t *StringTree) Init(flags byte) *StringTree {\n\tt.Tree.Init(stringCompare, flags)\n\treturn t\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 post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Resize the given BufferedImage.
@param originalImage
the original image
@param formatName
the format name
@param targetWidth
the target width
@param targetHeight
the target height
@return the byte[] | [
"public static byte[] resize(final BufferedImage originalImage, final String formatName,\n\t\tfinal int targetWidth, final int targetHeight)\n\t{\n\t\treturn resize(originalImage, Scalr.Method.QUALITY, Scalr.Mode.FIT_EXACT, formatName,\n\t\t\ttargetWidth, targetHeight);\n\t}"
] | [
"@SuppressWarnings(\"deprecation\")\n @Override\n public RenderedImage create(ParameterBlock paramBlock, RenderingHints renderHints) {\n ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);\n\n RenderedImage source = paramBlock.getRenderedSource(0);\n double scaleX = paramBlock.g... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Close a ResultSet
@param rs a database ResultSet object | [
"public static void closeResultSet(final ResultSet rs) {\n if (rs == null) {\n return;\n }\n\n try {\n rs.close();\n } catch (Exception e) {\n if (LOG.isWarnEnabled()) LOG.warn(\"Error closing ResultSet: \" + rs, e);\n }\n }"
] | [
"public void open() throws DBException\n {\n if (this.isOpen())\n return; // Ignore if already open\n this.getRecord().handleInitialKey(); // Set up the smaller key\n this.getRecord().handleEndKey(); // Set up the larger key\n // You can't ... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Recurse through the data tree and fill an array of paths that reference
the nodes in the decoded JSON data structure.
@param mixed $s Decoded JSON data (decoded with json_decode)
@param string $r The current path key (for example: '#children.0'). | [
"private function getPaths(&$s, $r = \"#\")\n {\n $this->paths[$r] = &$s;\n if (is_array($s) || is_object($s)) {\n foreach ($s as $k => &$v) {\n if ($k !== \"\\$ref\") {\n $this->getPaths($v, $r == \"#\" ? \"#{$k}\" : \"{$r}.{$k}\");\n }\n... | [
"function(json_data){\n bbop_rest_response.json.call(this, json_data);\n //console.log('_is_a', this._is_a);\n this._is_a = 'bbop-response-golr';\n //console.log('_is_a', this._is_a);\n\n // The setting of:\n // this._raw (as JSON)\n // this._raw_string (incoming arg)\n // this._okay (... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
TODO handler.addTo | [
"function (name, HandlerClass) {\n\t\tif (!HandlerClass) { return this; }\n\n\t\tvar handler = this[name] = new HandlerClass(this);\n\n\t\tthis._handlers.push(handler);\n\n\t\tif (this.options[name]) {\n\t\t\thandler.enable();\n\t\t}\n\n\t\treturn this;\n\t}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
expression : LNOT expression %prec ULNOT | [
"def p_expression_ulnot(self, p):\n ''\n p[0] = Ulnot(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Checks if the current user has the specified role.
@param roleNames the names of the required roles
@return true iff the current user has the specified role | [
"public static boolean hasRoles(List<String> roleNames) throws Throwable\n {\n DEADBOLT_HANDLER.beforeRoleCheck();\n\n RoleHolder roleHolder = getRoleHolder();\n\n return roleHolder != null &&\n roleHolder.getRoles() != null &&\n hasAllRoles(roleHolder,\n ... | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Create an instance of {@link JAXBElement }{@code <}{@link ArithType }{@code >}} | [
"@XmlElementDecl(namespace = \"http://www.w3.org/1998/Math/MathML\", name = \"abs\")\n public JAXBElement<ArithType> createAbs(ArithType value) {\n return new JAXBElement<ArithType>(_Abs_QNAME, ArithType.class, null, value);\n }"
] | [
"@SuppressWarnings(\"unchecked\")\n public Map<String, Field> getValueAsMap() {\n return (Map<String, Field>) type.convert(getValue(), Type.MAP);\n }"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// SetStatus sets the completion status of the Package. | [
"func (p *Package) SetStatus(inc JobStatus) {\n\tp.statusLock.Lock()\n\tdefer p.statusLock.Unlock()\n\n\tp.status = inc\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Returns warning according to GetSystemPowerStatus().BatteryLifeTime/BatteryLifePercent
@raise WindowsError if any underlying error occures. | [
"def get_low_battery_warning_level(self):\n \n power_status = SYSTEM_POWER_STATUS()\n if not GetSystemPowerStatus(pointer(power_status)):\n raise WinError()\n\n if POWER_TYPE_MAP[power_status.ACLineStatus] == common.POWER_TYPE_AC:\n return common.LOW_BATTERY_WARNING... | [
"public DeviceData command_inout(TacoTangoDevice tacoDevice, String command, DeviceData argin) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about N/A:"
} |
Create a CryptKey instance without permissions check.
@param string $key
@return \League\OAuth2\Server\CryptKey | [
"protected function makeCryptKey($type)\n {\n $key = str_replace('\\\\n', \"\\n\", $this->app->make(Config::class)->get('passport.'.$type.'_key'));\n\n if (! $key) {\n $key = 'file://'.Passport::keyPath('oauth-'.$type.'.key');\n }\n\n return new CryptKey($key, null, false);... | [
"private function registerOAuthApp()\n {\n $oauth = new OAuthApp();\n $this->app->instance(\\Acacha\\LaravelSocial\\Services\\OAuthApp::class, $oauth);\n }"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Gets a configuration.
@param key the configuration key
@return a map, or null if the key is not found | [
"public synchronized Map<String, Object> getConfiguration(String key) {\n\t\treturn Optional.ofNullable(inventory.get(key))\n\t\t\t\t.flatMap(v->v.getConfiguration())\n\t\t\t\t.map(v->v.getMap())\n\t\t\t\t.orElse(null);\n\t}"
] | [
"function(loader) {\n // public\n this.maxRecursion = 5;\n this.loader = (typeof loader === 'function') ? loader : null;\n\n // internal\n this._schemaRegistry = new SchemaRegistry();\n this._customFormatHandlers = {};\n\n // _refsRequested is an object where the key is the normalized ID\n // of the schema ... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// Start starts the scheduler | [
"func (s *scheduler) Start() error {\n\tif s.metricManager == nil {\n\t\tschedulerLogger.WithFields(log.Fields{\n\t\t\t\"_block\": \"start-scheduler\",\n\t\t\t\"_error\": ErrMetricManagerNotSet.Error(),\n\t\t}).Error(\"error on scheduler start\")\n\t\treturn ErrMetricManagerNotSet\n\t}\n\ts.state = schedulerStarted... | [
"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
A specific, existing tag can be deleted by making a DELETE request
on the URL for that tag.
Returns an empty data record.
@param tag The tag to delete.
@return response | [
"public function delete($tag, $params = array(), $options = array())\n {\n $path = sprintf(\"/tags/%s\", $tag);\n return $this->client->delete($path, $params, $options);\n }"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github description about Metadata management:",
"pos": "Represent the Github code about Metadata management:",
"neg": "Represent the Github code about Software development:"
} |
Validate a value
@param mixed $value Value to be validated
@return bool True when the variable is valid | [
"public function validate($value)\n {\n $result = false;\n\n if (is_string($value) && strlen($value))\n {\n if ($value[0] == '/' || $value[0] == '\\\\'\n || (strlen($value) > 3 && ctype_alpha($value[0])\n && $value[1] == ':'\n &... | [
"public function validate( $input )\n {\n // Check if passed input is an object and instance of phpillowDocument\n // at all, otherwise we can exit immediately\n if ( !is_object( $input ) ||\n !( $input instanceof phpillowDocument ) )\n {\n throw new phpillowVal... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about PHP programming:"
} |
Saves the service and types php code to file
@param PhpClass $service
@param array $types | [
"public function save(PhpClass $service, array $types)\n {\n $this->setOutputDirectory();\n\n $this->saveClassToFile($service);\n foreach ($types as $type) {\n $this->saveClassToFile($type);\n }\n\n $classes = array_merge(array($service), $types);\n $this->sav... | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the instruction about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code:"
} |
Gets the list of entries in the specified directory.
@param directory the directory to get the entries of.
@return the list of entries (never <code>null</code>).
@since 1.0 | [
"private synchronized List<Entry> getEntriesList( DirectoryEntry directory )\n {\n List<Entry> entries = contents.get( directory );\n if ( entries == null )\n {\n entries = new ArrayList<Entry>();\n contents.put( directory, entries );\n }\n return entries;... | [
"function (parameters) {\n\n /**\n * Job identifier.\n * @type {string}\n */\n this.hash = parameters.hash;\n\n /**\n * Array of hashes to {@link Artifact}s containing each requested result.\n * @type {string[]}\n */\n this.resultHashes = p... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Checks, that option exists in config.
@param string $name Option name.
@return void
@throws ConfigException Thrown when option with a given name doesn't exist. | [
"protected function assertOptionName($name)\n\t{\n\t\tif ( !isset($this->options[$name]) ) {\n\t\t\tthrow new ConfigException(\n\t\t\t\t'Option \"' . $name . '\" doesn\\'t exist in configuration',\n\t\t\t\tConfigException::TYPE_NOT_FOUND\n\t\t\t);\n\t\t}\n\t}"
] | [
"public function get($key, $default = null)\n {\n $this->hydrate();\n\n // Create an Element instance using the data for the key\n if ($this->has($key)) {\n return new $this->model(array_merge($this->items[$key], ['key' => $key]));\n }\n\n // If the key doesn't exist... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
// WeekdayShort returns the locales short weekday given the 'weekday' provided | [
"func (kkj *kkj_CM) WeekdayShort(weekday time.Weekday) string {\n\treturn kkj.daysShort[weekday]\n}"
] | [
"func parseDay(buff []byte, cursor *int, l int) (int, error) {\n\t// XXX : this is a relaxed constraint\n\t// XXX : we do not check if valid regarding February or leap years\n\t// XXX : we only checks that day is in range [01 -> 31]\n\t// XXX : in other words this function will not rant if you provide Feb 31th\n\tr... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about datetime:"
} |
// For any index defined by IndexFields, if a matcher can match only (a subset)
// of objects that return <value> for a given index, a pair (<index name>, <value>)
// wil be returned.
// TODO: Consider supporting also labels. | [
"func (s *SelectionPredicate) MatcherIndex() []MatchValue {\n\tvar result []MatchValue\n\tfor _, field := range s.IndexFields {\n\t\tif value, ok := s.Field.RequiresExactMatch(field); ok {\n\t\t\tresult = append(result, MatchValue{IndexName: field, Value: value})\n\t\t}\n\t}\n\treturn result\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetId sets the Id field's value. | [
"func (s *GetBucketAnalyticsConfigurationInput) SetId(v string) *GetBucketAnalyticsConfigurationInput {\n\ts.Id = &v\n\treturn s\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Overloaded to display the correctly formatted value for this data type
@param array $properties
@return string | [
"public function Field($properties = array())\n {\n if ($this->value) {\n $val = Convert::raw2xml($this->value);\n $val = DBCurrency::config()->get('currency_symbol')\n . number_format(preg_replace('/[^0-9.-]/', '', $val), 2);\n $valforInput = Convert::raw2a... | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
分词时查询到一个用户词典中的词语,此处控制是否接受它
@param begin 起始位置
@param end 终止位置
@param value 词性
@return true 表示接受
@deprecated 自1.6.7起废弃,强制模式下为最长匹配,否则按分词结果合并 | [
"protected boolean acceptCustomWord(int begin, int end, CoreDictionary.Attribute value)\n {\n return config.forceCustomDictionary || (end - begin >= 4 && !value.hasNatureStartsWith(\"nr\") && !value.hasNatureStartsWith(\"ns\") && !value.hasNatureStartsWith(\"nt\"));\n }"
] | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about text processing:"
} |
是否可以删除缓存
@param cacheDeleteKey CacheDeleteKey注解
@param arguments 参数
@param retVal 结果值
@return Can Delete
@throws Exception 异常 | [
"public boolean isCanDelete(CacheDeleteKey cacheDeleteKey, Object[] arguments, Object retVal) throws Exception {\r\n boolean rv = true;\r\n if (null != arguments && arguments.length > 0 && null != cacheDeleteKey.condition()\r\n && cacheDeleteKey.condition().length() > 0) {\r\n ... | [
"public static IPool getPool(String host, Integer port, String database, String... userPwd) {\n //暂未启用\n throw new RuntimeException(\"未找到指定的数据库连接池\");\n }"
] | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Factory function that creates a value.
:param value_id: id of the value, used to reference the value within this list.BaseException
:param value_class: The class of the value that should be created with this function. | [
"def add(self, value_id, name, value_class):\n \n item = value_class(\n name,\n value_id=self.controller.component_id + \".\" + value_id,\n is_input=self.is_input,\n index=self.count,\n spine = self.controller.spine\n )\n\n #if self.... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Updates the state machine context. | [
"void update(long index, Instant instant, Type type) {\n this.index = index;\n this.type = type;\n clock.set(instant);\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 post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Creates a {@link UTF8StreamJsonParser} from the inputstream with the supplied buf {@code inBuffer} to use. | [
"public static UTF8StreamJsonParser newJsonParser(InputStream in, byte[] buf,\r\n int offset, int limit) throws IOException\r\n {\r\n return newJsonParser(in, buf, offset, limit, false,\r\n new IOContext(DEFAULT_JSON_FACTORY._getBufferRecycler(), in,\r\n fa... | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// LoadGopmfile loads and returns given gopmfile. | [
"func LoadGopmfile(fileName string) (*goconfig.ConfigFile, error) {\n\tif !base.IsFile(fileName) {\n\t\treturn goconfig.LoadFromData([]byte(\"\"))\n\t}\n\n\tgf, err := goconfig.LoadConfigFile(fileName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Fail to load gopmfile: %v\", err)\n\t}\n\treturn gf, nil\n}"
] | [
"def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)"
] | codesearchnet | {
"query": "Represent the Github sentence about File management:",
"pos": "Represent the Github code about File management:",
"neg": "Represent the Github code:"
} |
Loads a collection from the database
@param array|int|string $condition
@return array | [
"public function get($condition)\n {\n $result = null;\n $this->hook->attach('collection.get.before', $condition, $result, $this);\n\n if (isset($result)) {\n return $result;\n }\n\n if (!is_array($condition)) {\n $condition = array('collection_id' => $con... | [
"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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Performs a forward pass using multiple GPUs. This is a simplification
of torch.nn.parallel.data_parallel to support the allennlp model
interface. | [
"def data_parallel(batch_group: List[TensorDict],\n model: Model,\n cuda_devices: List) -> Dict[str, torch.Tensor]:\n \n assert len(batch_group) <= len(cuda_devices)\n\n moved = [nn_util.move_to_device(batch, device)\n for batch, device in zip(batch_group, cuda... | [
"def get_variables(self, *args, **kwargs):\n \"\"\"\"\"\"\n tf.logging.warning(\n \"Calling Sequential.get_variables, which will always return an empty \"\n \"tuple. get_variables() can only return variables created directly by \"\n \"a Module, or created by submodules directly created in... | codesearchnet | {
"query": "Represent the Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Randomly augment a single image tensor.
# Arguments
sample: 3D or 4D tensor, single sample.
seed: random seed.
# Returns
A randomly transformed version of the input (same shape). | [
"def random_transform(self, sample, seed=None):\n \n img_row_axis = self.row_axis - 1\n img_col_axis = self.col_axis - 1\n img_channel_axis = self.channel_axis - 1\n\n transform_matrix = self.get_random_transform_matrix(sample, seed)\n\n if transform_matrix is not None:\n ... | [
"def _default_hparams():\n \"\"\"\"\"\"\n return hparam.HParams(\n # Use this parameter to get comparable perplexity numbers with different\n # tokenizations. This value should be set to the ratio of the number of\n # tokens in the test set according to the tokenization used to the number\n #... | codesearchnet | {
"query": "Represent the Github text about Image processing:",
"pos": "Represent the Github code about Image processing:",
"neg": "Represent the Github code:"
} |
Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<ResourceSkuInner> object | [
"public Observable<Page<ResourceSkuInner>> listAsync() {\n return listWithServiceResponseAsync()\n .map(new Func1<ServiceResponse<Page<ResourceSkuInner>>, Page<ResourceSkuInner>>() {\n @Override\n public Page<ResourceSkuInner> call(ServiceResponse<Page<ResourceSkuInne... | [
"@NotNull\n @ApiModelProperty(required = true, value = \"Key-value pairs to add as custom property into alert. You can refer here for example values\")\n public Map<String, String> getDetails() {\n return details;\n }"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
// Machine provides access to methods of a state.Machine through the facade. | [
"func (st *State) Machine(tag names.MachineTag) (*Machine, error) {\n\tlife, err := st.machineLife(tag)\n\tif err != nil {\n\t\treturn nil, errors.Annotate(err, \"can't get life for machine\")\n\t}\n\treturn &Machine{\n\t\ttag: tag,\n\t\tlife: life,\n\t\tst: st,\n\t}, nil\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 text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about programming:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic void eUnset(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.OBJECT_FUNCTION_SET_SPECIFICATION__OBJ_TYPE:\n\t\t\t\tsetObjType(OBJ_TYPE_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackage.OBJECT_FUNCTION_SET_SPECIFICATION__ARCH_VRSN:\n\t\t\t\tsetArchVrsn(ARCH_VRSN_EDEFAULT)... | [
"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 Github description about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
Tries to find a directory with a .git repository | [
"def find_git_repository(self, path):\n \n while path is not None:\n git_path = os.path.join(path,'.git')\n if os.path.exists(git_path) and os.path.isdir(git_path):\n return path\n path = os.path.dirname(path)\n return None"
] | [
"def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
指定したK値、対象点、データセットを基に局所外れ係数スコアを算出する。<br>
本メソッド呼び出しによってデータセットの更新は行われない。<br>
学習データの更新を伴わないため、高速に処理が可能となっている。
@param kn K値
@param targetPoint 対象点
@param dataSet 学習データセット
@return LOFスコア | [
"public static double calculateLofWithoutUpdate(int kn, LofPoint targetPoint, LofDataSet dataSet)\n {\n // 対象点のK距離、K距離近傍を算出する。\n KDistanceResult kResult = calculateKDistance(kn, targetPoint, dataSet);\n\n LofPoint tmpPoint = targetPoint.deepCopy();\n tmpPoint.setkDistance(kResult.getk... | [
"func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Sets the time zone for which this <code>Calendar</code> will be resolved.
@param \DateTimeZone $timeZone The time zone to use for this Calendar, null if default should be used | [
"public function setTimeZone(\\DateTimeZone $timeZone = null)\n {\n if ($timeZone) {\n $value = $timeZone->getName();\n } else {\n $value = null;\n }\n\n $this->setValue('timezone', $value);\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 summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Builds thumb uploader
@param string $dir Target directory
@param integer $quality Desired quality for thumbs
@param array $options
@return \Krystal\Image\Tool\Upload\Plugin\ThumbFactory | [
"public function build($dir, $quality, array $options = array())\n {\n // Alter default quality on demand\n if (isset($options['quality'])) {\n $quality = $options['quality'];\n }\n\n return new Thumb($dir, $options['dimensions'], $quality);\n }"
] | [
"protected function setGeneratorImages()\n {\n $this->logger->debug('Base:setGeneratorImages');\n $this->setParam('generator', 'images');\n $this->setParam('gimlimit', $this->getLimit());\n }"
] | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
Parses a PHP File and returns nested Array of collected Information.
@access public
@param string $fileName File Name of PHP File to parse
@param string $innerPath Base Path to File to be removed in Information
@return array | [
"public function parseFile( $fileName, $innerPath )\n\t{\n\t\t$content\t\t= FS_File_Reader::load( $fileName );\n\t\tif( !Alg_Text_Unicoder::isUnicode( $content ) )\n\t\t\t$content\t\t= Alg_Text_Unicoder::convertToUnicode( $content );\n\n\n\t\t$lines\t\t\t= explode( \"\\n\", $content );\n\t\t$fileBlock\t\t= NULL;\n\... | [
"private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Determine whether an array value is empty, taking into account casting.
@param string $key
@param array $value
@return mixed | [
"private function nullIfEmptyArray($key, $value)\n {\n if ($this->isJsonCastable($key) && ! empty($value)) {\n return $this->setJsonCastValue($value);\n }\n\n return empty($value) ? null : $value;\n }"
] | [
"private function isArrayConstraint(Constraint $constraint): bool\n {\n return $constraint instanceof Assert\\All // << Applied only on array\n || ($constraint instanceof Assert\\Choice\n && true === $constraint->multiple // << expect an array multiple choices\n );\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:"
} |
Parse an input stream containing a Fortran namelist. | [
"def _readstream(self, nml_file, nml_patch_in=None):\n \"\"\"\"\"\"\n nml_patch = nml_patch_in if nml_patch_in is not None else Namelist()\n\n tokenizer = Tokenizer()\n f90lex = []\n for line in nml_file:\n toks = tokenizer.parse(line)\n while tokenizer.prior... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Initializes curl resource with options.
@param string $url
@param string $postString
@param array $headers
@return $this | [
"protected function init($url, $postString, $headers)\n {\n $this->headers = $headers;\n\n $this->curl = curl_init($url);\n\n if (empty($this->cookieJar)) {\n $this->loadCookies();\n }\n\n curl_setopt_array($this->curl, $this->makeHttpOptions($postString));\n\n ... | [
"public function curlGETauth($curlUrl)\n {\n\n // Remove authentication until POST to /api/v1/auth/login is resolved\n if (!isset($this->auth)) {\n $this->authenticate();\n }\n\n $results = $this->curlGET($curlUrl, true);\n $this->statHat->ezCount('MB_Toolbox: MB_Toolbox_cURL: curlGETauth', 1);... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
Load executable code from a URL or a path | [
"def load_code(name, base_path=None, recurse=False):\n \"\"\"\"\"\"\n if '/' in name:\n return load_location(name, base_path, module=False)\n\n return importer.import_code(name, base_path, recurse=recurse)"
] | [
"function useRequest() {\n var request = Module['memoryInitializerRequest'];\n var response = request.response;\n if (request.status !== 200 && request.status !== 0) {\n var data = tryParseAsDataURI(Module['memoryInitializerRequestURL']);\n if (data) {\n response = ... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// NextMatcher gets the immediately following sibling of each element in the
// Selection filtered by a matcher. It returns a new Selection object
// containing the matched elements. | [
"func (s *Selection) NextMatcher(m Matcher) *Selection {\n\treturn filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), m)\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
_Really_ obtain the config for a named class
@param string $class The class to get the config for
@return \Weasel\JsonMarshaller\Config\ClassMarshaller The config, or null if not found | [
"protected function _getConfig($class)\n {\n $rClass = new \\ReflectionClass($class);\n\n // Delegate actually loading the config for the class to the ClassAnnotationDriver\n $classDriver = new ClassAnnotationDriver($rClass, $this->annotationReaderFactory, $this->annotationNamespace);\n\n ... | [
"private function _init()\n {\n // TODO: check if self::$instance is required here or if we can only set\n // decorated object\n\n // initialize and store the instance of template engine for further access\n self::$instance = Doozr_Loader_Serviceloader::load($this->library, $this->res... | codesearchnet | {
"query": "Represent the description about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
// SetCacheLength sets the CacheLength field's value. | [
"func (s *RtmpGroupSettings) SetCacheLength(v int64) *RtmpGroupSettings {\n\ts.CacheLength = &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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Initialize grid lines. | [
"private void initGridLines() {\n gridLines = new Line[base.getDimension() - 1][linesSlicing.length];\n\n int i2 = 0;\n\n for (int i = 0; i < base.getDimension() - 1; i++) {\n if (i2 == index) {\n i2++;\n }\n\n for (int j = 0; j < gridLines[i].len... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Modifies the given N1QL query (as a {@link JsonObject}) to reflect these {@link N1qlParams}.
@param queryJson the N1QL query | [
"public void injectParams(JsonObject queryJson) {\n if (this.serverSideTimeout != null) {\n queryJson.put(\"timeout\", this.serverSideTimeout);\n }\n if (this.consistency != null) {\n queryJson.put(\"scan_consistency\", this.consistency.n1ql());\n }\n if (thi... | [
"@Override\n public List find(List<IndexClause> ixClause, EntityMetadata m, boolean isRelation, List<String> relations,\n int maxResult, List<String> columns) {\n throw new UnsupportedOperationException(\"Support available only for thrift/pelops.\");\n }"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Send stat command to Memcached Server and return response lines.
@param cmd: Command string.
@return: Array of strings. | [
"def _sendStatCmd(self, cmd):\n \n try:\n self._conn.write(\"%s\\r\\n\" % cmd)\n regex = re.compile('^(END|ERROR)\\r\\n', re.MULTILINE)\n (idx, mobj, text) = self._conn.expect([regex,], self._timeout) #@UnusedVariable\n except:\n raise Exception(\"Co... | [
"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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
<p>readContent.</p>
@param in a {@link java.io.Reader} object.
@return a {@link java.lang.String} object.
@throws java.io.IOException if any. | [
"public static String readContent( Reader in ) throws IOException\n {\n char[] buffer = new char[2048];\n StringBuilder sb = new StringBuilder();\n int read;\n while ((read = in.read( buffer )) != -1)\n {\n sb.append( buffer, 0, read );\n }\n\n return s... | [
"public void call(String method, Object[] args)\n throws IOException\n {\n startCall(method);\n\n if (args != null) {\n for (int i = 0; i < args.length; i++)\n writeObject(args[i]);\n }\n\n completeCall();\n }\n\n /**\n * Starts the method ca... | codesearchnet | {
"query": "Represent the Github instruction about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about writing:"
} |
// AddNode add new node to directory (name must be unique in directory) | [
"func (d *Dir) AddNode(newNode os.FileInfo) error {\n\tfor _, node := range d.nodes {\n\t\tif newNode.Name() == node.Name() {\n\t\t\treturn fmt.Errorf(\"node named \" + newNode.Name() + \" exists\")\n\t\t}\n\t}\n\td.nodes = append(d.nodes, newNode)\n\treturn nil\n}"
] | [
"function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Load image from path.
@param path Path to image.
@return Image
@throws java.io.IOException
@throws NullPointerException if {@code path} is null. | [
"private Image loadImage(Resource path) throws IOException {\n\t\tURL url = path.getURL();\n\t\tif (url == null) {\n\t\t\tlogger.warn(\"Unable to locate splash screen in classpath at: \" + path);\n\t\t\treturn null;\n\t\t}\n\t\treturn Toolkit.getDefaultToolkit().createImage(url);\n\t}"
] | [
"protected void checkNull( Object... objects ) {\n for( Object object : objects ) {\n if (object == null) {\n throw new ModelsIllegalargumentException(\"Mandatory input argument is missing. Check your syntax...\",\n this.getClass().getSimpleName(), pm);\n ... | codesearchnet | {
"query": "Represent the text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software development:"
} |
/*
(non-Javadoc)
@see javax.persistence.EntityManager#createQuery(java.lang.String) | [
"@Override\n public Query createQuery(String qlString)\n {\n try\n {\n return ivEm.createQuery(qlString);\n } finally\n {\n if (!inJTATransaction())\n {\n ivEm.clear();\n }\n }\n }"
] | [
"@Bean\n\tpublic JpaModule jpaModule() {\n\t\tJpaModule module = JpaModule.newServerModule(em, transactionRunner);\n\n\t\t// directly expose entity\n\t\tmodule.addRepository(JpaRepositoryConfig.builder(ScheduleEntity.class).build());\n\n\t\t// additionally expose entity as a mapped dto\n\t\tmodule.addRepository(Jpa... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about Software Development:"
} |
// NewService creates an instance of a Service. | [
"func NewService() *Service {\n\ts := &Service{\n\t\tTokenGenerator: rand.NewTokenGenerator(64),\n\t\tIDGenerator: snowflake.NewIDGenerator(),\n\t\ttime: time.Now,\n\t}\n\ts.initializeSources(context.TODO())\n\treturn s\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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Loads PHPExcel from file
@param string $pFilename
@return PHPExcel
@throws PHPExcel_Reader_Exception | [
"public function load($pFilename)\r\n\t{\r\n\t\t// Read the OLE file\r\n\t\t$this->_loadOLE($pFilename);\r\n\r\n\t\t// Initialisations\r\n\t\t$this->_phpExcel = new PHPExcel;\r\n\t\t$this->_phpExcel->removeSheetByIndex(0); // remove 1st sheet\r\n\t\tif (!$this->_readDataOnly) {\r\n\t\t\t$this->_phpExcel->removeCell... | [
"public static function newDocumentPHP($markup = null, $contentType = \"text/html\") \n {\n // TODO pass charset to phpToMarkup if possible (use DOMDocumentWrapper function)\n $markup = phpQuery::phpToMarkup($markup, self::$defaultCharset);\n return self::newDocument($markup, $contentType);\... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Commit an http request.
@param string $method
@param string $url
@param array $params
@param array $options
@return \Shoperti\PayMe\Contracts\ResponseInterface | [
"public function commit($method, $url, $params = [], $options = [])\n {\n if (empty($this->connectionToken)) {\n $this->loginApplication();\n }\n\n $request = [\n 'exceptions' => false,\n 'timeout' => '80',\n 'connect_timeout' => '30',... | [
"public function create( models\\Call\\ContactUrl $ContactUrl){\n $rest = $this->getService( self::API_URL);\n $rest->POST( $ContactUrl);\n\n return $rest->getResult( models\\Call\\ContactUrl::class);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Compares the two Git trees (with caching). | [
"private List<DiffEntry> blockingCompareTrees(RevTree treeA, RevTree treeB) {\n if (cache == null) {\n return blockingCompareTreesUncached(treeA, treeB, TreeFilter.ALL);\n }\n\n final CacheableCompareTreesCall key = new CacheableCompareTreesCall(this, treeA, treeB);\n Completa... | [
"def determine_target_roots(self, goal_name):\n \n if not self.context.target_roots:\n print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.stderr)\n\n # For the v2 path, e.g. `./pants list` is a functional no-op. This matches the v2 mode behavior\n # of e.g. `./pants ... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Rewrite references to `local_path` with `remote_path` in job inputs. | [
"def rewrite_paths(self, local_path, remote_path):\n \n self.__rewrite_command_line(local_path, remote_path)\n self.__rewrite_config_files(local_path, remote_path)"
] | [
"def execPath(self):\n \"\"\"\"\"\"\n vers = self.version.label if self.version else None # executables in Versions folder are stored by baseVersion (modified by game data patches)\n return self.installedApp.exec_path(vers)"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the initial of given name.
For standard names: "First [Midddles] Last", returns capital "FL";
For others, returns substr(0, 2).
@param {string} name -
@return {string} - initial | [
"function getNameInitial(name) {\n\t\tvar namePart = name.split(' ');\n\t\tif (namePart.length >= 2) {\n\t\t\treturn (namePart[0].charAt(0) + namePart[namePart.length - 1].charAt(0)).toUpperCase();\n\t\t} else {\n\t\t\treturn name.substr(0, 2);\n\t\t}\n\t}"
] | [
"def lastname(self, value, case, gender=None):\n \n \"\"\"\n if not value:\n raise ValueError('Lastname cannot be empty.')\n\n return self.__inflect(value, case, 'lastname', gender)"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Sets the variables to the selected stage using cap rbenv set | [
"def set_vars_to_stage(stage, variables)\n # convert to array using VAR=value\n vars_array = variables.map{|k,v| \"#{k}=#{v}\" }\n Capistrano::Application.invoke(stage)\n Capistrano::Application.invoke(\"rbenv:vars:set\", *vars_array)\n end"
] | [
"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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Create a 500 response.
@param \Exception $exception The exception to log.
@return JsonResponse | [
"private function createInternalServerError(\\Exception $exception)\n {\n $message = sprintf(\n '%s: %s (uncaught exception) at %s line %s',\n get_class($exception),\n $exception->getMessage(),\n $exception->getFile(),\n $exception->getLine()\n ... | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
// SetAmznClientToken sets the AmznClientToken field's value. | [
"func (s *CreateConnectorDefinitionVersionInput) SetAmznClientToken(v string) *CreateConnectorDefinitionVersionInput {\n\ts.AmznClientToken = &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 description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
// SetApplicationVersionId sets the ApplicationVersionId field's value. | [
"func (s *AddApplicationInputProcessingConfigurationOutput) SetApplicationVersionId(v int64) *AddApplicationInputProcessingConfigurationOutput {\n\ts.ApplicationVersionId = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Writes out headers for $this->part and follows them with an empty line.
@param StreamInterface $stream | [
"public function writePartHeadersTo(StreamInterface $stream)\n {\n foreach ($this->getPartHeadersIterator() as $header) {\n $stream->write(\"${header[0]}: ${header[1]}\\r\\n\");\n }\n $stream->write(\"\\r\\n\");\n }"
] | [
"public function render($renderer)\n {\n $renderer->setCurrentStyle('footnotenum');\n $renderer->Write($renderer->getCurrentStyleHeight(), $this->numText, $this->addlink); //source link numbers after name\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:"
} |
Add all additional defined and undefined symbols. | [
"def __add_symbols(self, cmd):\n \n\n if self.__config.define_symbols:\n symbols = self.__config.define_symbols\n cmd.append(''.join(\n [' -D\"%s\"' % def_symbol for def_symbol in symbols]))\n\n if self.__config.undefine_symbols:\n un_symbols = se... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// CanCastle returns true if the given color and side combination
// can castle, otherwise returns false. | [
"func (cr CastleRights) CanCastle(c Color, side Side) bool {\n\tchar := \"k\"\n\tif side == QueenSide {\n\t\tchar = \"q\"\n\t}\n\tif c == White {\n\t\tchar = strings.ToUpper(char)\n\t}\n\treturn strings.Contains(string(cr), char)\n}"
] | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Finds all nodes that are after the ``min_line_number`` | [
"def filter_assert_nodes(nodes: List[ast.stmt], min_line_number: int) -> List[ast.stmt]:\n \n return [node for node in nodes if node.lineno > min_line_number]"
] | [
"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 Github description about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code:"
} |
Checks for valid uploaded file.
@param array $package
@return bool | [
"protected function isUploadedFile($package)\n {\n if (isset($package['name'], $package['tmp_name'], $package['type'], $package['size'])) {\n if (in_array($package['type'], ['application/zip', 'application/x-zip-compressed'])) {\n return true;\n }\n }\n\n ... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about File management:"
} |
Compare two attributes
@param control
@param test
@param listener
@throws DifferenceFoundException | [
"protected void compareRecognizedXMLSchemaInstanceAttribute(Attr control,\n Attr test,\n DifferenceListener listener)\n throws DifferenceFoundException {\n Attr nonNullNode = con... | [
"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:"
} |
Export this data so it can be used as the context for a mustache template.
@param \renderer_base $output
@return stdClass | [
"public function export_for_template(renderer_base $output) {\n global $USER, $OUTPUT;\n\n $data = new \\stdClass();\n\n if (!isset($this->config->display_picture) || $this->config->display_picture == 1) {\n $data->userpicture = $OUTPUT->user_picture($USER, array('class' => 'userpict... | [
"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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
// AddMultiple adds a list of cookies. | [
"func AddMultiple(cookies []*http.Cookie) p.Plugin {\n\treturn p.NewRequestPlugin(func(ctx *c.Context, h c.Handler) {\n\t\tfor _, cookie := range cookies {\n\t\t\tctx.Request.AddCookie(cookie)\n\t\t}\n\t\th.Next(ctx)\n\t})\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 App development:",
"pos": "Represent the code about App development:",
"neg": "Represent the code:"
} |
Gets the next match_temp_var. | [
"def get_temp_var(self):\n \"\"\"\"\"\"\n tempvar = match_temp_var + \"_\" + str(self.var_index)\n self.var_index += 1\n return tempvar"
] | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns true if the associate PushMode was selected in the configuration
@param Configuration $configuration
@return bool | [
"public function isMode( Configuration $configuration ) {\n\t\tif( $this->inServiceChecker->isInService($configuration) )\n\t\t\treturn false;\n\n\t\tif( $this->replaceUpgradeChecker->isReplaceUpgrade($configuration) )\n\t\t\treturn false;\n\n\t\treturn true;\n\t}"
] | [
"@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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Start healthcheck (status monitoring) for a peer
It also whitelists the address to answer invites and listen for messages | [
"def start_health_check(self, node_address):\n \n if self._stop_event.ready():\n return\n\n with self._health_lock:\n if self._address_mgr.is_address_known(node_address):\n return # already healthchecked\n\n node_address_hex = to_normalized_addre... | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Custom error handler that will throw an exception on any errors | [
"public function handleError()\n {\n // get error info\n list ($errno, $message, $file, $line) = func_get_args();\n\n // construct error message\n $msg = \"ERROR ($errno): $message\";\n if ($line !== null) {\n $file = \"$file:$line\";\n }\n\n if ($file ... | [
"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:"
} |
// details outputs details for a single transaction. | [
"func (w *walletAPIHandler) details(ctx context.Context, c Call, wr io.Writer) error {\n\tvar opts txIDOptions\n\tif err := unmarshalOptions(c, &opts); err != nil {\n\t\treturn w.encodeErr(c, err, wr)\n\t}\n\tdetail, err := w.cli.PaymentDetailCLILocal(ctx, opts.TxID)\n\tif err != nil {\n\t\treturn w.encodeErr(c, er... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the text about Database Management:",
"pos": "Represent the code about Database Management:",
"neg": "Represent the code:"
} |
Set dotted attr (like "a.b.c") on obj to val. | [
"def setattrdeep(obj, attr, val):\n ''\n attrs = attr.split('.')\n\n for a in attrs[:-1]:\n obj = getattr(obj, a)\n setattr(obj, attrs[-1], val)"
] | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
--------------------------------------------------------------------------- | [
"function replaceInFile (filename, regex, replacement) {\n let contents = fs.readFileSync (filename, 'utf8')\n const parts = contents.split (regex)\n const newContents = parts[0] + replacement + parts[1]\n fs.truncateSync (filename)\n fs.writeFileSync (filename, newContents)\n}"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github sentence about language and writing:",
"pos": "Represent the Github code about language and writing:",
"neg": "Represent the Github code:"
} |
Check so Locale settings (country, currency, language) are set.
@throws KlarnaException
@return void | [
"private function _checkLocale()\n {\n if (!is_int($this->_country)\n || !is_int($this->_language)\n || !is_int($this->_currency)\n ) {\n throw new Klarna_InvalidLocaleException;\n }\n }"
] | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
@param \PHP_CodeSniffer\Files\File $phpCsFile
@param int $stackPointer
@return bool | [
"protected function hasMethodAnnotation(File $phpCsFile, int $stackPointer): bool\n {\n $position = $phpCsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, $stackPointer);\n $tokens = $phpCsFile->getTokens();\n\n while ($position !== false) {\n $position = $phpCsFile->findPrevious(T_DOC... | [
"public function apply(AbstractNode $node)\n {\n /** @var \\PDepend\\Source\\AST\\ASTClass $node */\n if ($node->isAbstract()) {\n return;\n }\n\n if (empty($this->classRegex) || preg_match($this->classRegex, $node->getFullQualifiedName()) === 0) {\n return;\n ... | codesearchnet | {
"query": "Represent the Github post about PHP programming:",
"pos": "Represent the Github code about PHP programming:",
"neg": "Represent the Github code about programming:"
} |
Remove a parser from the render queue.
@param \Ems\Contracts\Core\TextParser $parser
@return self | [
"public function remove(TextParser $parser)\n {\n $parserHash = $this->objectHash($parser);\n\n $this->parsers = array_filter($this->parsers, function ($known) use ($parserHash) {\n return $this->objectHash($known) != $parserHash;\n });\n\n if (isset($this->parserIds[$parse... | [
"final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// GetZone returns the Zone containing the current availability zone and locality region that the program is running in.
// If the node is not running with availability zones, then it will fall back to fault domain. | [
"func (az *Cloud) GetZone(ctx context.Context) (cloudprovider.Zone, error) {\n\tif az.UseInstanceMetadata {\n\t\tmetadata, err := az.metadata.GetMetadata()\n\t\tif err != nil {\n\t\t\treturn cloudprovider.Zone{}, err\n\t\t}\n\n\t\tif metadata.Compute == nil {\n\t\t\treturn cloudprovider.Zone{}, fmt.Errorf(\"failure... | [
"func (p *provisioningIdentityMapper) UserFor(info authapi.UserIdentityInfo) (kuser.Info, error) {\n\t// Retrying up to three times lets us handle race conditions with up to two conflicting identity providers without returning an error\n\t// * A single race is possible on user creation for every conflicting identit... | codesearchnet | {
"query": "Represent the Github comment about Networking:",
"pos": "Represent the Github code about Networking:",
"neg": "Represent the Github code about Software development:"
} |
Decode sensor data.
Returns:
dict: Sensor values | [
"def decode_data(self, encoded):\n '''\n \n '''\n try:\n identifier = None\n data_format = 2\n if len(encoded) > 8:\n data_format = 4\n identifier = encoded[8:]\n encoded = encoded[:8]\n decoded = by... | [
"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 Data processing:",
"pos": "Represent the code about Data processing:",
"neg": "Represent the code:"
} |
<p>
A list of the configuration options and their values in this configuration set.
</p>
@return A list of the configuration options and their values in this configuration set. | [
"public java.util.List<ConfigurationOptionSetting> getOptionSettings() {\n if (optionSettings == null) {\n optionSettings = new com.amazonaws.internal.SdkInternalList<ConfigurationOptionSetting>();\n }\n return optionSettings;\n }"
] | [
"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 Github sentence about Documentation:",
"pos": "Represent the Github code about Documentation:",
"neg": "Represent the Github code about AWS Redshift:"
} |
// SetDeadline implements the net.PacketConn SetDeadline method. | [
"func (c *Conn) SetDeadline(t time.Time) error {\n\treturn c.p.SetDeadline(t)\n}"
] | [
"func (*protocol) NewEndpoint(stack *stack.Stack, netProto tcpip.NetworkProtocolNumber, waiterQueue *waiter.Queue) (tcpip.Endpoint, *tcpip.Error) {\n\treturn newEndpoint(stack, netProto, waiterQueue), nil\n}"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
// Reset cleans up the request queue | [
"func (s *BulkService) Reset() {\n\ts.requests = make([]BulkableRequest, 0)\n\ts.sizeInBytes = 0\n\ts.sizeInBytesCursor = 0\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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Registers a named object in the store. | [
"function(obj, type, name, nameIsUnique, oldName) {\n var nameMap, objList\n\n this._store[type] = nameMap = this._store[type] || {}\n nameMap[name] = objList = nameMap[name] || []\n\n // Adding new mapping\n if (objList.indexOf(obj) === -1) {\n if (nameIsUnique && objList.length > 0)\n t... | [
"@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 software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code:"
} |
Function creating an iterator of edges for the given type.
@param {Graph} graph - Target Graph instance.
@param {string} type - Type of edges to retrieve.
@return {Iterator} | [
"function createEdgeIterator(graph, type) {\n if (graph.size === 0)\n return Iterator.empty();\n\n let iterator;\n\n if (type === 'mixed') {\n iterator = graph._edges.values();\n\n return new Iterator(function next() {\n const step = iterator.next();\n\n if (step.done)\n return step;\n\... | [
"function NDDBIndex(idx, nddb) {\n // The name of the index.\n this.idx = idx;\n // Reference to the whole nddb database.\n this.nddb = nddb;\n // Map indexed-item to a position in the original database.\n this.resolve = {};\n // List of all keys in `resolve` object.... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// SetFIFOCompactionOptions sets the options for FIFO compaction style.
// Default: nil | [
"func (opts *Options) SetFIFOCompactionOptions(value *FIFOCompactionOptions) {\n\tC.rocksdb_options_set_fifo_compaction_options(opts.c, value.c)\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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Method to create the blank transaction nodes as a dict. If bic is True,
the BIC node will also be created. | [
"def _create_TX_node(self, bic=True):\n \n ED = dict()\n ED['DrctDbtTxInfNode'] = ET.Element(\"DrctDbtTxInf\")\n ED['PmtIdNode'] = ET.Element(\"PmtId\")\n ED['EndToEndIdNode'] = ET.Element(\"EndToEndId\")\n ED['InstdAmtNode'] = ET.Element(\"InstdAmt\")\n ED['DrctDbtT... | [
"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 Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic Object eGet(int featureID, boolean resolve, boolean coreType) {\n\t\tswitch (featureID) {\n\t\t\tcase BpsimPackage.NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT:\n\t\t\t\treturn getCurrencyUnit();\n\t\t\tcase BpsimPackage.NUMERIC_PARAMETER_TYPE__TIME_UNIT:\n\t\t\t\treturn getTimeUnit();\n\t\t\tcase Bps... | [
"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 Github text about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
@param GitUserInterface $user
@param FilePath $relativeFilePath
@param string $commitMessage
@throws \Exception | [
"public function removeFile(GitUserInterface $user, FilePath $relativeFilePath, $commitMessage)\n {\n $this->assertCommitMessageExists($commitMessage);\n $this->createLock($user, $relativeFilePath);\n $this->gitService->removeAndCommit($user, $relativeFilePath, $commitMessage);\n $thi... | [
"public function execute(Config $config, IO $io, Repository $repository, Config\\Action $action) : void\n {\n $options = $action->getOptions();\n $oldMsg = $repository->getCommitMsg();\n\n if (!$repository->isMerging()) {\n $repository->setCommitMsg(new CommitMessage($options->ge... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.