query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
If the expected type is a subtype of {@link Map}, the resolved super type is returned. This allows to query for the type arguments that are available on the expectation.
[ "protected LightweightTypeReference getMapExpectation(LightweightTypeReference expectation) {\n\t\tif (expectation != null && expectation.isResolved()) {\n\t\t\tLightweightTypeReference result = expectation.getSuperType(Map.class);\n\t\t\tif (result != null && result.getTypeArguments().size() == 2) {\n\t\t\t\tretur...
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Авторизация в сервисе B2BFamily @return array
[ "public function login()\n {\n $response = $this->request(self::METHOD_POST, '/user/login', [\n 'appkey' => $this->parameters->getAuth('appkey'),\n 'email' => $this->parameters->getAuth('email'),\n 'password' => $this->parameters->getAuth('password'),\n 'hash' =...
[ "final function handle() {\n\t\ttry {\n\t\t\tif ($this->m()->s()->log()) {\n\t\t\t\t$this->log();\n\t\t\t}\n\t\t\t$this->_e->validate();\n\t\t\tif ($c = $this->strategyC()) { /** @var string|null $c */\n\t\t\t\tStrategy::handle($c, $this);\n\t\t\t}\n\t\t}\n\t\t/** 2017-09-15 @uses NotForUs is thrown from @see \\Df\...
codesearchnet
{ "query": "Represent the Github sentence about software development:", "pos": "Represent the Github code about software development:", "neg": "Represent the Github code:" }
Copy the ClassicalWork and DancePiece data to use the new through models.
[ "def forwards(apps, schema_editor):\n \n Event = apps.get_model('spectator_events', 'Event')\n ClassicalWorkSelection = apps.get_model(\n 'spectator_events', 'ClassicalWorkSelection')\n DancePieceSelection = apps.get_model(\n 'spectator_event...
[ "def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// GetAffiliation returns information about the requested affiliation
[ "func (c *CAClientImpl) GetAffiliation(affiliation, caname string) (*api.AffiliationResponse, error) {\n\tif c.adapter == nil {\n\t\treturn nil, fmt.Errorf(\"no CAs configured for organization: %s\", c.orgName)\n\t}\n\n\t// Checke required parameters (affiliation)\n\tif affiliation == \"\" {\n\t\treturn nil, errors...
[ "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 text about Agent Identity Management:", "pos": "Represent the Github code about Agent Identity Management:", "neg": "Represent the Github code about Software development:" }
// ErrorString writes a response with specified status, code, and message set to // the the err's string representation.
[ "func ErrorString(w http.ResponseWriter, status int, code string, err error) {\n\tError(w, status, types.NewErrorV1(code, err.Error()))\n}" ]
[ "func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Computer Science:" }
Create an instance of {@link JAXBElement }{@code <}{@link Item }{@code >}}
[ "@XmlElementDecl(namespace = \"http://schema.intuit.com/finance/v3\", name = \"Item\", substitutionHeadNamespace = \"http://schema.intuit.com/finance/v3\", substitutionHeadName = \"IntuitObject\")\n public JAXBElement<Item> createItem(Item value) {\n return new JAXBElement<Item>(_Item_QNAME, Item.class, n...
[ "@SuppressWarnings(\"unchecked\")\n public Map<String, Field> getValueAsMap() {\n return (Map<String, Field>) type.convert(getValue(), Type.MAP);\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:" }
<!-- 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 AfplibPackage.GRLINE__XPOS:\n\t\t\t\treturn getXPOS();\n\t\t\tcase AfplibPackage.GRLINE__YPOS:\n\t\t\t\treturn getYPOS();\n\t\t\tcase AfplibPackage.GRLINE__RG:\n\t\t\t\treturn getRg();\n\t\t}\n...
[ "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 instruction about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
hide all open panels
[ "function _hidePanelsIfRequired() {\n var panelIDs = WorkspaceManager.getAllPanelIDs();\n _previouslyOpenPanelIDs = [];\n panelIDs.forEach(function (panelID) {\n var panel = WorkspaceManager.getPanelForID(panelID);\n if (panel && panel.isVisible()) {\n panel...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// StopMongoUntilVersion returns the current minimum version that // is required for this machine to have mongo running.
[ "func (m *Machine) StopMongoUntilVersion() (mongo.Version, error) {\n\treturn mongo.NewVersion(m.doc.StopMongoUntilVersion)\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 description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Expire a specific object from cache.
[ "def ExpireObject(self, key):\n \"\"\"\"\"\"\n node = self._hash.pop(key, None)\n if node:\n self._age.Unlink(node)\n self.KillObject(node.data)\n\n return node.data" ]
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// SetOutputArn sets the OutputArn field's value.
[ "func (s *Output) SetOutputArn(v string) *Output {\n\ts.OutputArn = &v\n\treturn s\n}" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Removes empty rank prefixes Parameters ---------- tax_list : list A list of taxonomic ranks. Returns ------- A list of taxonomic ranks with empty prefixes removed.
[ "def remove_empty_ranks(self, tax_list):\n '''\n \n '''\n new_tax_list = []\n for rank in tax_list:\n if rank not in self.meaningless_taxonomic_names:\n new_tax_list.append(rank)\n return new_tax_list" ]
[ "def reports(self):\n \n logging.info('Creating CLARK report for {} files'.format(self.extension))\n # Create a workbook to store the report. Using xlsxwriter rather than a simple csv format, as I want to be\n # able to have appropriately sized, multi-line cells\n workbook = xlsxw...
codesearchnet
{ "query": "Represent the text about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
<p> Creates the {@link LensDistortionNarrowFOV lens distortion} for the specified camera parameters. </p>
[ "public static LensDistortionNarrowFOV narrow(CameraModel param) {\n\t\tif( param instanceof CameraPinholeBrown) {\n\t\t\tCameraPinholeBrown c = (CameraPinholeBrown)param;\n\n\t\t\tif (c.isDistorted())\n\t\t\t\treturn new LensDistortionBrown(c);\n\t\t\telse\n\t\t\t\treturn new LensDistortionPinhole(c);\n\t\t} else ...
[ "@Override\n\tprotected void processImage(ImageBase image) {\n\t\t// The data type of 'image' was specified in onCreate() function\n\t\t// The line below will compute the gradient and store it in two images. One for the\n\t\t// gradient along the x-axis and the other along the y-axis\n\t\tgradient.process((GrayU8)i...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get adapter class name @param string $adapterName @return string @throws \Exception
[ "private static function getAdapterClassName($adapterName)\n {\n $className = 'Piwik\\Db\\Adapter\\\\' . str_replace(' ', '\\\\', ucwords(str_replace(array('_', '\\\\'), ' ', strtolower($adapterName))));\n if (!class_exists($className)) {\n throw new \\Exception(sprintf(\"Adapter '%s' is...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
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:" }
// getLayerDetails is a utility for getting a file name, size and indication of // sandbox for a VHD(x) in a folder. A read-only layer will be layer.vhd. A // read-write layer will be sandbox.vhdx.
[ "func getLayerDetails(folder string) (*layerDetails, error) {\n\tvar fileInfo os.FileInfo\n\tld := &layerDetails{\n\t\tisSandbox: false,\n\t\tfilename: filepath.Join(folder, layerFilename),\n\t}\n\n\tfileInfo, err := os.Stat(ld.filename)\n\tif err != nil {\n\t\tld.filename = filepath.Join(folder, sandboxFilename)\...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the Github text about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code:" }
@override @throws UnexpectedValueException If the object is not supported.
[ "public function attach($object, $data = null)\n {\n if (!$this->isSupported($object)) {\n throw new UnexpectedValueException(\n sprintf(\n 'The object, %s, is not supported.',\n get_class($object)\n )\n );\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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
@param \ArrayIterator $iterator @return RData\RDataInterface @throws ParseException
[ "private function extractRdata(\\ArrayIterator $iterator): Rdata\\RdataInterface\n {\n $type = strtoupper($iterator->current());\n $iterator->next();\n\n if (array_key_exists($type, $this->rdataHandlers)) {\n try {\n return call_user_func($this->rdataHandlers[$type]...
[ "public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Builds a no-arg method descriptor that is exposed for scripting everywhere.
[ "public static MethodDescriptor buildScriptableMethodDescriptorNoArgs( Class actionClass, String methodName )\n {\n MethodDescriptor md = _buildMethodDescriptor( actionClass, methodName, EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, EMPTY_CLASS_ARRAY );\n makeScriptable( md );\n return md;\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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// SetStep sets the Step field's value.
[ "func (s *DescribeStepOutput) SetStep(v *Step) *DescribeStepOutput {\n\ts.Step = v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
获取 @CacheName 注解配置的 cacheName,注解可配置在方法和类之上
[ "protected String getCacheName(Invocation inv) {\r\n\t\tCacheName cacheName = inv.getMethod().getAnnotation(CacheName.class);\r\n\t\tif (cacheName != null) {\r\n\t\t\treturn cacheName.value();\r\n\t\t}\r\n\t\t\r\n\t\tcacheName = inv.getController().getClass().getAnnotation(CacheName.class);\r\n\t\tif (cacheName == ...
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
See RedeliveryTask
[ "protected void redeliverMessage( AbstractMessage msg , MessageStore store , int handle )\n {\n \ttry\n \t{\n\t \tsynchronized (storeLock)\n\t {\n\t\t \t// Unlock message in store\n\t\t \t\tstore.unlock(handle);\n\t\t \t\tif (traceEnabled)\n\t\t \tlog.trace(\"(Deferred) UNLOCKED \"+...
[ "public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
/* -------------------------------------------------------------------------------
[ "private void parseDelimiter(ByteBuffer buffer) {\n while (__delimiterStates.contains(_state) && hasNextByte(buffer)) {\n HttpTokens.Token t = next(buffer);\n if (t == null)\n return;\n\n if (t.getType() == HttpTokens.Type.LF) {\n setState(State....
[ "function HttpError(message, code, description, response, captureStackTrace) {\n Error.call(this)\n\n // capture stack trace unless passed false\n if (captureStackTrace !== false) {\n Error.captureStackTrace(this, arguments.callee)\n }\n\n /*******************************************************************...
codesearchnet
{ "query": "Represent the summarization about N/A:", "pos": "Represent the code about N/A:", "neg": "Represent the code about Software development:" }
Execute the process and associate with this object. @param string $cmd Command to be executed @param array|string $args Arguments (strings) @return self
[ "public function exec($cmd, $args = array())\n {\n // Arguments must be safe\n if (!is_array($args)) {\n $args = array($args);\n }\n foreach ($args as $val) {\n if (!is_string($val)) {\n throw new BaseException('You must specify arguments as string...
[ "public function help()\n {\n $style = new Eurekon\\Style(' *** RUN - HELP ***');\n Eurekon\\Out::std($style->color('fg', Eurekon\\Style::COLOR_GREEN)->get());\n Eurekon\\Out::std('');\n\n $help = new Eurekon\\Help('...', true);\n $help->addArgument('', 'directory', 'Config dir...
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about NLP:" }
// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'prg'
[ "func (prg *prg) CardinalPluralRule(num float64, v uint64) locales.PluralRule {\n\n\tn := math.Abs(num)\n\tf := locales.F(n, v)\n\tnMod10 := math.Mod(n, 10)\n\tnMod100 := math.Mod(n, 100)\n\tfMod100 := f % 100\n\tfMod10 := f % 10\n\n\tif (nMod10 == 0) || (nMod100 >= 11 && nMod100 <= 19) || (v == 2 && fMod100 >= 11 ...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Retrieve the data from the pocket API @param array $options options to filter the data @param boolean $isArray if decode JSON to array @return array
[ "public function retrieve($options = array(), $isArray = false)\n {\n $params = array(\n 'consumer_key' => $this->consumer_key,\n 'access_token' => $this->access_token\n );\n\n // combine the creds with any options sent\n $params = array_merge($params, $options...
[ "public static function _fetch_handler( &$query )\n\t{\n\t\t// because the model is an object we force the fetch\n\t\t// arguments to obj so that we can still make use of\n\t\t// the group by and forward key functions\n\t\t$query->fetch_arguments = array( 'obj' );\n\n\t\t// Run the query and assign the reults\n\t\t...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Extends the specified object with another object. @method extend @static @param {Object} target Object to extend. @param {Object} [obj]* Multiple objects to extend with. @return {Object} Same as target, the extended object.
[ "function(target) {\n\t\tvar undef;\n\n\t\teach(arguments, function(arg, i) {\n\t\t\tif (i > 0) {\n\t\t\t\teach(arg, function(value, key) {\n\t\t\t\t\tif (value !== undef) {\n\t\t\t\t\t\tif (typeOf(target[key]) === typeOf(value) && !!~inArray(typeOf(value), ['array', 'object'])) {\n\t\t\t\t\t\t\textend(target[key],...
[ "function superPropertiesClass(constructor) {\n const superCtor = Object.getPrototypeOf(constructor);\n\n // Note, the `PropertiesMixin` class below only refers to the class\n // generated by this call to the mixin; the instanceof test only works\n // because the mixin is deduped and guaranteed only to appl...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
/* (non-Javadoc) @see javax.slee.resource.ResourceAdaptor#raConfigure(javax.slee.resource.ConfigProperties)
[ "public void raConfigure(ConfigProperties properties) {\n\t\t\n\t\tif (tracer.isFineEnabled()) {\n\t\t\ttracer.fine(\"Configuring RA.\");\n\t\t}\n\t\t\n\t\tthis.port = (Integer) properties.getProperty(SIP_PORT_BIND).getValue();\n\t\tthis.stackAddress = (String) properties.getProperty(SIP_BIND_ADDRESS).getValue();\n...
[ "@Override\n\t@Deprecated\n\tpublic DataSource dataSourceByName(String dbName) {\n\t\treturn new com.danidemi.jlubricant.embeddable.BasicDataSource(\n\t\t\t\tdbByName(dbName));\n\t}" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software Development:" }
Generate a key for the property to use during export @param string $uri @return string
[ "protected function generateId($uri)\n {\n $property = new \\core_kernel_classes_Property($uri);\n $label = strtolower(trim($property->getLabel()));\n $label = preg_replace(array('/\\s/', '[^a-z\\-]'), array('-', ''), $label);\n return empty($label) ? 'key' : $label;\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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Return all the security group names configured in this action.
[ "def get_action_group_names(self):\n \"\"\"\"\"\"\n return self.get_group_names(\n list(itertools.chain(\n *[self._get_array('add'),\n self._get_array('remove'),\n self._get_array('isolation-group')])))" ]
[ "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 sentence about permissions:", "pos": "Represent the code about permissions:", "neg": "Represent the code about Software development:" }
Create a class based binding using the IoC container. @param string $binding @return \Closure
[ "public function createClassBinding($binding)\n {\n return function ($value, $route) use ($binding)\n {\n // If the binding has an @ sign, we will assume it's being used to delimit\n // the class name from the bind method name. This allows for bindings\n // to run m...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// NewFilteredBlockEvent creates a new FilteredBlockEvent
[ "func NewFilteredBlockEvent(fblock *pb.FilteredBlock, sourceURL string) *fab.FilteredBlockEvent {\n\treturn &fab.FilteredBlockEvent{\n\t\tFilteredBlock: fblock,\n\t\tSourceURL: sourceURL,\n\t}\n}" ]
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Contains the path to the input file (or directory) to be processed
[ "public WindupConfiguration addInputPath(Path inputPath)\n {\n Set<Path> inputPaths = getOptionValue(InputPathOption.NAME);\n if (inputPaths == null)\n {\n inputPaths = new LinkedHashSet<>();\n setOptionValue(InputPathOption.NAME, inputPaths);\n }\n inputP...
[ "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 Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Return the Namespace URI (if any) as a String for the current tag
[ "def namespace(self):\n \n if self.m_name == -1 or (self.m_event != const.START_TAG and self.m_event != const.END_TAG):\n return u''\n\n # No Namespace\n if self.m_namespaceUri == 0xFFFFFFFF:\n return u''\n\n return self.sb[self.m_namespaceUri]" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
// Respond to the request with Rread message
[ "func (req *SrvReq) RespondRread(data []byte) {\n\terr := PackRread(req.Rc, data)\n\tif err != nil {\n\t\treq.RespondError(err)\n\t} else {\n\t\treq.Respond()\n\t}\n}" ]
[ "public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Removes an event listener from the specified events. @param string|string[] $events @param string|int|object $listener @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
[ "public function removeEventListener($events, $listener): void\n\t{\n\t\tif (!is_object($listener)) {\n\t\t\t$hash = 'service@' . $listener;\n\t\t} else {\n\t\t\t// Picks the hash code related to that listener\n\t\t\t$hash = spl_object_hash($listener);\n\t\t}\n\t\tforeach ((array) $events as $event) {\n\t\t\t// Che...
[ "protected function assertChainableReturnType(File $phpCsFile, int $stackPointer, array $parts, array $returnTypes): void\n {\n if ($returnTypes && $parts === ['$this'] && $returnTypes !== ['$this']) {\n $phpCsFile->addError('Chainable method (@return $this) cannot have multiple return types in...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about PHP programming:" }
@param string $key @return Payment
[ "public function removeCustomParam($key)\n {\n if (array_key_exists($key, $this->customParams)) {\n unset($this->customParams[$key]);\n }\n\n return $this;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// Deserialize back to map[interface{}]interface{}
[ "func (s GobSerializer) Deserialize(d []byte, ss *sessions.Session) error {\n\tdec := gob.NewDecoder(bytes.NewBuffer(d))\n\treturn dec.Decode(&ss.Values)\n}" ]
[ "func (m *NamedMethod) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m.Name != \"\" {\n\t\tinfo = append(info, yaml.MapItem{Key: \"name\", Value: m.Name})\n\t}\n\t// &{Name:value Type:Method StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value}\n\treturn info\n}"...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Combine HSPs into a single BlastLine.
[ "def combine_HSPs(a):\n \n m = a[0]\n if len(a) == 1:\n return m\n\n for b in a[1:]:\n assert m.query == b.query\n assert m.subject == b.subject\n m.hitlen += b.hitlen\n m.nmismatch += b.nmismatch\n m.ngaps += b.ngaps\n m.qstart = min(m.qstart, b.qstart)\...
[ "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:" }
Filter power mock constructor. @param declaredConstructors the declared constructors @return the constructor[]
[ "static Constructor<?>[] filterPowerMockConstructor(Constructor<?>[] declaredConstructors) {\n Set<Constructor<?>> constructors = new HashSet<Constructor<?>>();\n for (Constructor<?> constructor : declaredConstructors) {\n final Class<?>[] parameterTypes = constructor.getParameterTypes();\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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
/* Find an AttachmentResource in a given set which either has the desired Locale or failing that, the same language as the desired locale.
[ "public static AttachmentSummary matchByLocale(Collection<? extends AttachmentSummary> attachments,\n AttachmentType desiredType, Locale desiredLocale) {\n Collection<AttachmentSummary> possibleMatches = new ArrayList<AttachmentSummary>();\n for (Attach...
[ "public static String getDefaultMediaType(ResultType expectedType) {\n ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;\n \n // If the expected type is unknown, we should let the server decide, otherwise we could\n // wind up requesting a response type that d...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Selects and loads order payment history. @param string $paymentId Order id.
[ "public function load($paymentId)\n {\n $this->setPaymentId($paymentId);\n\n $comments = array();\n $commentsData = $this->getDbGateway()->getList($this->getPaymentId());\n if (is_array($commentsData) && count($commentsData)) {\n $comments = array();\n foreach ($...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
{@inheritdoc} @return URLImmutable
[ "public function addParameter($name, $parameter)\n {\n if ($this->isLocked()) {\n return $this->getObj()->addParameter($name, $parameter)->setLocked();\n } else {\n return parent::addParameter($name, $parameter);\n }\n }" ]
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the Github description about writing:", "pos": "Represent the Github code about writing:", "neg": "Represent the Github code:" }
Check if the given class has the correct form. <ul> <li>must have exactly one public constructor.</li> <li>must at least have one parameter.</li> <li>all the parameters must be annotated with @Column annotation.</li> </ul> @param clazz @return
[ "public static boolean hasConstructorInTheCorrectForm(Class<?> clazz) {\n\t\t\n\t\tif (clazz.getConstructors().length != 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tConstructor<?> con = clazz.getConstructors()[0];\n\n\t\tif (con.getParameterTypes().length == 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tAnnotation[][] parame...
[ "protected void createGenModelAnnotations()\n\t{\n\t\tString source = \"http://www.eclipse.org/emf/2002/GenModel\";\t\n\t\taddAnnotation\n\t\t (jvmIdentifiableElementEClass.getEOperations().get(0), \n\t\t source, \n\t\t new String[] \n\t\t {\n\t\t\t \"documentation\", \"<p>The identifier of a JvmIdentifiable...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Text generation:" }
// Newproxy create a new proxy object. It starts listening on the prxy port asynchronously.
[ "func newProxy(name, tenantEndpointID string, tcpMuxPort uint16, useTLS bool, listener net.Listener, allowDirectConn bool) (p *proxy, err error) {\n\tif len(name) == 0 {\n\t\treturn nil, fmt.Errorf(\"prxy: name can not be empty\")\n\t}\n\tp = &proxy{\n\t\tname: name,\n\t\ttenantEndpointID: tenantEndpoin...
[ "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 instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Whether the given point is contained within this cell @param point the point to check @return true if the point is contained, false otherwise
[ "public boolean containsPoint(INDArray point) {\n double first = point.getDouble(0), second = point.getDouble(1);\n return x - hw <= first && x + hw >= first && y - hh <= second && y + hh >= second;\n }" ]
[ "def collides(self, other):\n \"\"\"\"\"\"\n\n angle = self.angle\n width = self.width\n height = self.height\n\n if angle == 0:\n return other.collides(Rect(-0.5 * width,\n -0.5 * height, width, height))\n\n # Phase 1\n ...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Adds {@code element} to the list to be returned from {@link Datatype#getValueTypeAnnotations()}. @return this {@code Builder} object @throws NullPointerException if {@code element} is null
[ "public Datatype.Builder addValueTypeAnnotations(Excerpt element) {\n if (valueTypeAnnotations instanceof ImmutableList) {\n valueTypeAnnotations = new ArrayList<>(valueTypeAnnotations);\n }\n valueTypeAnnotations.add(Objects.requireNonNull(element));\n return (Datatype.Builder) this;\n }" ]
[ "private String getParameterName(AnnotatedParameter<?> parameter) {\n Parameter[] parameters = ((Method) parameter.getDeclaringCallable().getJavaMember()).getParameters();\n Parameter param = parameters[parameter.getPosition()];\n if (param.isNamePresent()) {\n return param.getName()...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Checks if each path is writeable @param array $paths Paths to check @return array Array with paths as keys and boolean as value
[ "protected function _isWriteable($paths)\n {\n foreach ((array)$paths as $path) {\n $result[$path] = is_writable_resursive($path);\n }\n\n return $result;\n }" ]
[ "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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// addOptions adds the parameters in opt as URL query parameters to s. opt // must be a struct whose fields may contain "url" tags.
[ "func addOptions(s string, opt interface{}) (string, error) {\n\tv := reflect.ValueOf(opt)\n\tif v.Kind() == reflect.Ptr && v.IsNil() {\n\t\treturn s, nil\n\t}\n\n\tu, err := url.Parse(s)\n\tif err != nil {\n\t\treturn s, err\n\t}\n\n\tqs, err := query.Values(opt)\n\tif err != nil {\n\t\treturn s, err\n\t}\n\n\tu.R...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Get data associated with provided key.
[ "def get(self, key):\n \n return self._object_class(json.loads(self._db[key]))" ]
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Updates the default card @param string $cardId The cardId to update to the default card @return $this
[ "public function updateDefaultCard($cardId)\n {\n // first lets update the default source for the stripe customer\n $customer = $this->asStripeCustomer();\n $customer->default_source = $cardId;\n $result = $customer->save();\n\n // now lets update the users default card\n ...
[ "@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Removes a reference to the subscription. @return The operation represented by the removal of the reference.
[ "int removeRef()\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(tc, \"removeRef\");\n\n int ret = NOP;\n\n // If this is the last reference, then the operation is unsubscribe.\n\n if (--_refCount == 0)\n ret = UNSUBSCRIBE;\n\n checkRefCount();\n\n i...
[ "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 description about Messaging:", "pos": "Represent the code about Messaging:", "neg": "Represent the code about Software development:" }
Partition a list into equally sized pieces, including last smaller parts http://stackoverflow.com/questions/5129102/python-equivalent-to-clojures-partition-all
[ "def partition_all(n, iterable):\n \n it = iter(iterable)\n while True:\n chunk = list(itertools.islice(it, n))\n if not chunk:\n break\n yield chunk" ]
[ "def get_mode(self):\n \n # http://stackoverflow.com/questions/10797819/finding-the-mode-of-a-list-in-python\n return max(set(self._entry_scores), key=self._entry_scores.count)" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Mathematics:" }
Free the specified slot.
[ "public void freeSlot(WorkerSlot slot) {\n // remove the slot from the existing assignments\n for (SchedulerAssignmentImpl assignment : this.assignments.values()) {\n if (assignment.isSlotOccupied(slot)) {\n assignment.unassignBySlot(slot);\n }\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 summarization about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
处理多态一对多更新 @param \Imi\Model\Model $model @param string $propertyName @param \Imi\Model\Annotation\Relation\PolymorphicOneToMany $annotation @return void
[ "public static function parseByPolymorphicOneToMany($model, $propertyName, $annotation)\n {\n $className = BeanFactory::getObjectClass($model);\n\n $struct = new PolymorphicOneToMany($className, $propertyName, $annotation);\n $leftField = $struct->getLeftField();\n $rightField = $stru...
[ "protected function byId($id)\n {\n //在QueryRelate 中的 __call中也没有找到first,需要用getQuery(),它指向的是Query\\Builder\n $model = $this->queryRelate->where($this->repository->getModel()->getKeyName(), $id)->getQuery()->first();\n\n $this->resetQueryRelate();\n\n return $model;\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Send this message to the server and return the reply. @return The message.
[ "public Object sendMessageAndGetReply() throws RemoteException\n {\n URL url = null;\n try {\n url = this.getProxyURL();\n } catch (MalformedURLException ex) {\n ex.printStackTrace();\n return null;\n }\n ServletMessage servlet = new ServletMess...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the comment about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code:" }
// HasCorrectColors verifies that the format of each color is correct
[ "func HasCorrectColors(c *chronograf.DashboardCell) error {\n\tfor _, color := range c.CellColors {\n\t\tif !oneOf(color.Type, \"max\", \"min\", \"threshold\", \"text\", \"background\", \"scale\") {\n\t\t\treturn chronograf.ErrInvalidColorType\n\t\t}\n\t\tif len(color.Hex) != 7 {\n\t\t\treturn chronograf.ErrInvalid...
[ "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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Check if specified collection item exists. @param mixed $key The item key. @param string $regex @param array &$matches [optional] @return bool
[ "public function matches($key, $regex, &$matches = [])\n {\n if (!$this->has($key, self::HAS_ISSET)) {\n return false;\n }\n\n return (bool) preg_match($regex, $this->get($key), $matches);\n }" ]
[ "public static function forIndex(string $index, string $value, ?\\Throwable $previous = null): self\n {\n return new self(\"The node could not be found by ({$index}:{$value}).\", $previous);\n }" ]
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about text processing:" }
Receives Data from Google Code Post-Commit Hook and returns JSON string. @access public @return string @throws RuntimeException if raw POST data is empty @throws RuntimeException if Key is invalid
[ "public function receiveData( Net_HTTP_Request_Receiver $request)\r\n\t{\r\n\t\t$data\t= $request->getRawPostData();\r\n\t\tif( !$data )\r\n\t\t\tthrow new RuntimeException( 'No raw POST data received' );\r\n\t\t$digest\t= hash_hmac( \"md5\", $data, $this->authKey );\r\n\t\t$header\t= array_pop( $request->getHeader...
[ "public void setLog(String log) throws ApplicationException {\n\tif (StringUtil.isEmpty(log, true)) return;\n\tthis.log = log.trim();\n\t// throw new ApplicationException(\"invalid value for attribute log [\"+log+\"]\",\"valid values are\n\t// [application, scheduler,console]\");\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Encryption:", "pos": "Represent the Github code about Encryption:", "neg": "Represent the Github code about Software development:" }
Check if this object configuration is correct :: * Check our own specific properties * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False :rtype: bool
[ "def is_correct(self):\n # pylint: disable=too-many-branches\n \n state = True\n\n if hasattr(self, 'trigger') and getattr(self, 'trigger', None):\n self.add_warning(\"[%s::%s] 'trigger' property is not allowed\"\n % (self.my_type, self.get_name()))...
[ "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 sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
One of ways of creating builder. This is possibly the least verbose way where compiler should be able to guess the generic parameters.
[ "@Nonnull\n\tpublic static <T> LObjFltConsumer<T> objFltConsumerFrom(Consumer<LObjFltConsumerBuilder<T>> buildingFunction) {\n\t\tLObjFltConsumerBuilder builder = new LObjFltConsumerBuilder();\n\t\tbuildingFunction.accept(builder);\n\t\treturn builder.build();\n\t}" ]
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Remove obsolete remotes with review prefix.
[ "def clean_remotes\n protected_remotes = remotes_for_branches\n remotes.each do |remote|\n # Only remove review remotes that aren't referenced by current branches.\n if remote.index('review_') == 0 && !protected_remotes.include?(remote)\n git_call \"remote remove #{remote}\"\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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
清空服务列表 @return 带回收的服务列表
[ "protected Map<ProviderInfo, ClientTransport> clearProviders() {\n providerLock.lock();\n try {\n // 当前存活+重试的\n HashMap<ProviderInfo, ClientTransport> all = new HashMap<ProviderInfo, ClientTransport>(aliveConnections);\n all.putAll(subHealthConnections);\n a...
[ "protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
设置最后修改日期. @param int $last_modify
[ "public static function lastModified($last_modify) {\n $time = time();\n $date = gmdate('D, d M Y H:i:s', $time) . ' GMT';\n $ldate = gmdate('D, d M Y H:i:s', $last_modify) . ' GMT';\n $headers = [\n 'Date' => $date,\n 'Last-Modified' => $ldate\n ...
[ "def log(self, message):\n \n theLog = '[日志名:%s] [时间:%s] \\n[内容:\\n%s]\\n\\n' % (\n self.startName, timestamp_to_time(get_current_timestamp()), message)\n if not self.fileName:\n print(theLog)\n else:\n # 由于这里有很多的线程都要经过这道线程锁的控制,所以不会出现问题\n ...
codesearchnet
{ "query": "Represent the post about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about PHP programming:" }
CMS Fields @return FieldList
[ "public function getCMSFields()\n {\n $fields = parent::getCMSFields();\n $fields->addFieldsToTab(\n 'Root.Main',\n array(\n DaysOfWeekField::create(\n 'DayOfWeek',\n _t('SchemaOpeningHours.DAYOFWEEK', 'Days of the week')\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// corColInAccess checks whether there's correlated column in access conditions.
[ "func (b *executorBuilder) corColInAccess(p plannercore.PhysicalPlan) bool {\n\tvar access []expression.Expression\n\tswitch x := p.(type) {\n\tcase *plannercore.PhysicalTableScan:\n\t\taccess = x.AccessCondition\n\tcase *plannercore.PhysicalIndexScan:\n\t\taccess = x.AccessCondition\n\t}\n\tfor _, cond := range ac...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Returns the size of the given (remote) filename.
[ "def size(filename)\n voidcmd(\"TYPE I\")\n resp = sendcmd(\"SIZE \" + filename)\n if resp[0, 3] != \"213\" \n\traise FTPReplyError, resp\n end\n return resp[3..-1].strip.to_i\n end" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
draw bottom/right half @param canvas
[ "private void drawNextHalf(Canvas canvas) {\n\t\tcanvas.save();\n\t\tcanvas.clipRect(isFlippingVertically() ? mBottomRect : mRightRect);\n\t\t\n\t\tfinal float degreesFlipped = getDegreesFlipped();\n\t\tfinal Page p = degreesFlipped > 90 ? mCurrentPage : mNextPage;\n\n\t\t// if the view does not exist, skip drawing...
[ "def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
******************** Initialization ************************************
[ "private void initGraphics() {\n // Set initial size\n if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 ||\n Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) {\n if (gauge.getPrefWidth(...
[ "protected function welcomeMessage ()\n {\n $this->comment ('');\n $this->comment ('**************************************************');\n $this->comment (' Welcome to HoneyComb CMS initial configuration!!!');\n $this->comment ('**************************************************');\n...
codesearchnet
{ "query": "Represent the Github instruction about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Writes gadgets to stdout. @param [Array<OneGadget::Gadget::Gadget>] gadgets @param [Boolean] raw In raw mode, only the offset of gadgets are printed. @return [true]
[ "def display_gadgets(gadgets, raw)\n if raw\n show(gadgets.map(&:offset).join(' '))\n else\n show(gadgets.map(&:inspect).join(\"\\n\"))\n end\n end" ]
[ "def append_line(self, new_line):\n \"\"\"\"\"\"\n # TODO: The user still has to write the raw line, this is error prone.\n self._write(('PGM', [Integer, String]), self.idx, new_line)" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
@param FormInterface $form @param array $schema @return array
[ "protected function addLabel(FormInterface $form, array $schema)\n {\n $translationDomain = $form->getConfig()->getOption('translation_domain');\n if ($label = $form->getConfig()->getOption('label')) {\n $schema['title'] = $this->translator->trans($label, [], $translationDomain);\n ...
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Lights Extension Specification: PENDING
[ "function GLTFLightsExtension( json ) {\n\n\t\tthis.name = EXTENSIONS.KHR_LIGHTS;\n\n\t\tthis.lights = {};\n\n\t\tvar extension = ( json.extensions && json.extensions[ EXTENSIONS.KHR_LIGHTS ] ) || {};\n\t\tvar lights = extension.lights || {};\n\n\t\tfor ( var lightId in lights ) {\n\n\t\t\tvar light = lights[ light...
[ "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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// executeSchemaCommands executes some SQL commands, using the mysql // command line tool. It uses the dba connection parameters, with credentials.
[ "func (mysqld *Mysqld) executeSchemaCommands(sql string) error {\n\tparams, err := dbconfigs.WithCredentials(mysqld.dbcfgs.Dba())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn mysqld.executeMysqlScript(params, strings.NewReader(sql))\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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// DeepCopy makes a deep copy of the ConnInfo.
[ "func (ci *ConnInfo) DeepCopy() *ConnInfo {\n\tci2 := &ConnInfo{\n\t\toidToDataType: make(map[OID]*DataType, len(ci.oidToDataType)),\n\t\tnameToDataType: make(map[string]*DataType, len(ci.nameToDataType)),\n\t\treflectTypeToDataType: make(map[reflect.Type]*DataType, len(ci.reflectTypeToDataType)),\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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Enable a payment method for this profile. @param string $methodId @param array $data @return Method @throws ApiException
[ "public function enableMethod($methodId, array $data = [])\n {\n return $this->client->profileMethods->createFor($this, $methodId, $data);\n }" ]
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
This method set the system property if the property is null or property value is not the same with the new value @param propName @param propValue @return
[ "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n public static String setPropertyAsNeeded(final String propName, final String propValue) {\n\n String previousPropValue = (String) java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {\n @Override\n pub...
[ "public boolean isSet(PropertyKey key) {\n if (isSetByUser(key)) {\n return true;\n }\n // In case key is not the reference to the original key\n return PropertyKey.fromString(key.toString()).getDefaultValue() != null;\n }" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
Create the parent directories of the given file, if needed.
[ "public static void ensureParentDirectoryExists(File f) throws IOException {\n final File parent = f.getParentFile();\n if (parent != null) {\n java.nio.file.Files.createDirectories(parent.toPath());\n }\n }" ]
[ "def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Function: reset Reset the connection. This function should be called after a connection is disconnected before that connection is reused.
[ "function ()\r\n {\r\n this._proto._reset();\r\n\r\n // SASL\r\n this.do_session = false;\r\n this.do_bind = false;\r\n\r\n // handler lists\r\n this.timedHandlers = [];\r\n this.handlers = [];\r\n this.removeTimeds = [];\r\n this.removeHandlers = []...
[ "def connect(self, host, port):\n '''\n \n '''\n # Clear the connect state immediately since we're no longer connected\n # at this point.\n self._connected = False\n\n # Only after the socket has connected do we clear this state; closed\n # must be False so th...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Auto Generated Code
[ "def show_vcs_output_vcs_nodes_vcs_node_info_node_vcs_id(self, **kwargs):\n \n config = ET.Element(\"config\")\n show_vcs = ET.Element(\"show_vcs\")\n config = show_vcs\n output = ET.SubElement(show_vcs, \"output\")\n vcs_nodes = ET.SubElement(output, \"vcs-nodes\")\n ...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the instruction about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code about File management:" }
// connectNext pops a datanode from the list based on previous failures, and // connects to it.
[ "func (br *BlockReader) connectNext() error {\n\taddress := br.datanodes.next()\n\n\tif br.DialFunc == nil {\n\t\tbr.DialFunc = (&net.Dialer{}).DialContext\n\t}\n\n\tconn, err := br.DialFunc(context.Background(), \"tcp\", address)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = br.writeBlockReadRequest(conn)\n\t...
[ "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 text about Networking:", "pos": "Represent the Github code about Networking:", "neg": "Represent the Github code about programming:" }
A shortcut property for settings of a stage.
[ "def stage_config(self):\n \n\n def get_stage_setting(stage, extended_stages=None):\n if extended_stages is None:\n extended_stages = []\n\n if stage in extended_stages:\n raise RuntimeError(stage + \" has already been extended to these settings. \"\...
[ "@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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Sort array data @param callable $callback @return Stack
[ "public function sort(callable $callback = null) : Stack\n {\n $values = $this->_sort($callback);\n $this->setValues($values);\n return $this;\n }" ]
[ "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:" }
// SetFilterBy 指定キーでのフィルター
[ "func (api *VPCRouterAPI) SetFilterBy(key string, value interface{}) {\n\tapi.filterBy(key, value, false)\n}" ]
[ "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 post about Technology:", "pos": "Represent the code about Technology:", "neg": "Represent the code about Software development:" }
// generateUnimplementedServer creates the unimplemented server struct
[ "func (g *grpc) generateUnimplementedServer(servName string, service *pb.ServiceDescriptorProto) {\n\tserverType := servName + \"Server\"\n\tg.P(\"// Unimplemented\", serverType, \" can be embedded to have forward compatible implementations.\")\n\tg.P(\"type Unimplemented\", serverType, \" struct {\")\n\tg.P(\"}\")...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Calculate multi-precision [left - right * multiplier] with given left offset and length. Return true when overflow occurred
[ "private static boolean multiplyAndSubtractUnsignedMultiPrecision(int[] left, int leftOffset, int[] right, int length, int multiplier)\n {\n long unsignedMultiplier = multiplier & LONG_MASK;\n int leftIndex = leftOffset - length;\n long multiplyAccumulator = 0;\n long subtractAccumula...
[ "def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
Created an service that only generates keys for the local address.
[ "public static <K, V> KeyAffinityService<K> newLocalKeyAffinityService(Cache<K, V> cache, KeyGenerator<K> keyGenerator, Executor ex, int keyBufferSize, boolean start) {\n Address localAddress = cache.getAdvancedCache().getRpcManager().getTransport().getAddress();\n Collection<Address> forAddresses = Colle...
[ "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:" }
Register a user to a managed lab. @param userName The name of the user. @throws IllegalArgumentException thrown if parameters fail the validation @return the {@link ServiceResponse} object if successful.
[ "public Observable<ServiceResponse<Void>> registerWithServiceResponseAsync(String userName) {\n if (userName == null) {\n throw new IllegalArgumentException(\"Parameter userName is required and cannot be null.\");\n }\n if (this.client.apiVersion() == null) {\n throw new I...
[ "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 text about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about Software development:" }
// syncBoundClaim is the main controller method to decide what to do with a // bound claim.
[ "func (ctrl *PersistentVolumeController) syncBoundClaim(claim *v1.PersistentVolumeClaim) error {\n\t// HasAnnotation(pvc, annBindCompleted)\n\t// This PVC has previously been bound\n\t// OBSERVATION: pvc is not \"Pending\"\n\t// [Unit test set 3]\n\tif claim.Spec.VolumeName == \"\" {\n\t\t// Claim was bound before ...
[ "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:" }
Draw 2 peaks at x
[ "def draw_peaks(self, x, peaks, line_color):\n \"\"\"\"\"\"\n\n y1 = self.image_height * 0.5 - peaks[0] * (self.image_height - 4) * 0.5\n y2 = self.image_height * 0.5 - peaks[1] * (self.image_height - 4) * 0.5\n\n if self.previous_y:\n self.draw.line(\n [self.pr...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Return a string with the names of input_xy catalog names
[ "def get_xy_catnames(self):\n \n catstr = self.name+' '\n if 'input_xy' in self.catalog_names:\n for xycat in self.catalog_names['input_xy']:\n catstr += ' '+xycat\n return catstr + '\\n'" ]
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// AddFilter add the filter to this FilterManager
[ "func (fm *filterManager) AddFilter(filter ...Filter) {\n\tfm.fmLocker.Lock()\n\tfm.addFilter(filter...)\n\tfm.fmLocker.Unlock()\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 text about Technology:", "pos": "Represent the Github code about Technology:", "neg": "Represent the Github code about programming:" }
Binds the uploaded file to its owner on creation. @param object $object @param array $ids
[ "protected function handleFiles($object)\n {\n $request = $this->getRequest();\n\n $rc = new \\ReflectionClass($object);\n $className = $rc->getShortName();\n\n $repo = $this->manager->getRepository('LibrinfoMediaBundle:File');\n\n if ($remove = $request->get('remove_files')) {...
[ "public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
This method retrieves the string at the specified offset. @param offset Offset into var data @return String value
[ "public String getUnicodeString(int offset)\n {\n String result = null;\n byte[] data = getByteArray(offset);\n if (data != null)\n {\n result = MPPUtility.getUnicodeString(data, 0);\n }\n\n return (result);\n }" ]
[ "public void init(Rec record, int iKeyDup, String strKeyName)\n {\n super.init(record, iKeyDup, strKeyName);\n m_iKeyActualLength = 0; // Actual Byte length\n m_iKeyByteLength = 0; // Key length (0-64 bytes) (including trailer bytes)\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
// ProgressLabel gives extra info about which task is currently being executed
[ "func (c *Consumer) ProgressLabel(label string) {\n\tif c != nil && c.OnProgressLabel != nil {\n\t\tc.OnProgressLabel(label)\n\t}\n}" ]
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about File management:" }
Terminate the request and send the response to the browser. @param \Symfony\Component\HttpFoundation\Request $request @param \Symfony\Component\HttpFoundation\Response $response @return void
[ "public function terminate(SymfonyRequest $request, SymfonyResponse $response)\n\t{\n\t\t$this->callFinishCallbacks($request, $response);\n\n\t\t$this->shutdown();\n\t}" ]
[ "private static function getHttpErrorResponder(\\Throwable $throwable, HttpRequest $request = null)\n {\n // If an error request has been made, oblige.\n $responder = new \\Eix\\Core\\Responders\\Http\\Error($request);\n $responder->setThrowable($throwable);\n\n return $responder;\n ...
codesearchnet
{ "query": "Represent the Github sentence about Symfony:", "pos": "Represent the Github code about Symfony:", "neg": "Represent the Github code about PHP:" }
Partitioned tables
[ "@Override\n public boolean shouldCreateWorkunit(Partition sourcePartition, LongWatermark lowWatermark) {\n // If a whitelist is provided only create workunits for those partitions\n if (!this.partitionsWhitelist.isEmpty()) {\n return this.partitionsWhitelist.contains(sourcePartition.getCompleteName());...
[ "@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:" }
Get a Closure that represents a slice of the application onion. @return \Closure
[ "protected function carry()\n {\n return function ($stack, $pipe) {\n return function ($passable) use ($stack, $pipe) {\n $method = $this->method;\n if (is_callable($pipe)) {\n // If the pipe is an instance of a Closure, we will just call it dire...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// SetComplianceLevel sets the ComplianceLevel field's value.
[ "func (s *PatchRule) SetComplianceLevel(v string) *PatchRule {\n\ts.ComplianceLevel = &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:" }
Read in the manifest json file which acts as a manifest for assets. This allows us to get the asset path as well as hashed names. :param app: Flask application :return: None
[ "def _set_asset_paths(self, app):\n \n webpack_stats = app.config['WEBPACK_MANIFEST_PATH']\n\n try:\n with app.open_resource(webpack_stats, 'r') as stats_json:\n stats = json.load(stats_json)\n\n if app.config['WEBPACK_ASSETS_URL']:\n ...
[ "def spec(self):\n \"\"\"\"\"\"\n from ambry_sources.sources import SourceSpec\n\n d = self.dict\n d['url'] = self.url\n\n # Will get the URL twice; once as ref and once as URL, but the ref is ignored\n\n return SourceSpec(**d)" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Read from a framedDeecoderStream. The frame is the "BEGIN FOO." block // at the beginning, and the "END FOO." block at the end.
[ "func (s *framedDecoderStream) Read(p []byte) (n int, err error) {\n\n\tif s.state == fdsHeader {\n\t\terr = s.loadHeader()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tif s.state == fdsBody {\n\t\tn, err = s.r.Read(p)\n\t\tif err == ErrPunctuated {\n\t\t\terr = nil\n\t\t\ts.state = fdsFooter\n\t\t}\n...
[ "def _ordered_struct_start_handler(handler, ctx):\n \n _, self = yield\n self_handler = _create_delegate_handler(self)\n (length, _), _ = yield ctx.immediate_transition(\n _var_uint_field_handler(self_handler, ctx)\n )\n if length < 2:\n # A valid field name/value pair is at least tw...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// SetProvisionedThroughputInMibps sets the ProvisionedThroughputInMibps field's value.
[ "func (s *UpdateFileSystemOutput) SetProvisionedThroughputInMibps(v float64) *UpdateFileSystemOutput {\n\ts.ProvisionedThroughputInMibps = &v\n\treturn s\n}" ]
[ "public CreateTableRequest getTableSchema() {\n return new CreateTableRequest()\n .withTableName(tableName)\n .withProvisionedThroughput(new ProvisionedThroughput(client.readCapacity(tableName),\n client.writeCapacity(tableName)));\n }" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }