query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
// SetSearchEnabled sets the SearchEnabled field's value. | [
"func (s *DoubleArrayOptions) SetSearchEnabled(v bool) *DoubleArrayOptions {\n\ts.SearchEnabled = &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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Updates the base path for the folder information.<p>
@param basePath the new base path | [
"protected void updateBasePath(String basePath) {\n\n if (m_folderOrName != null) {\n if (m_folderOrName.isName()) {\n m_folderOrName = new CmsContentFolderDescriptor(basePath, m_folderOrName.getFolderName());\n }\n } else {\n m_folderOrName = new CmsCon... | [
"@RequestCache(keyMask = {false, true})\n @Override\n public List<String> getFolderNamesForLayoutNode(\n HttpServletRequest request, String layoutNodeId) {\n // layout node folders are never part of the mobile url\n return Collections.emptyList();\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Computer Science:"
} |
Returns a simple web page where certs can be downloaded. This is meant for mobile device setup.
@return
@throws Exception | [
"@RequestMapping(value = \"/cert\", method = {RequestMethod.GET, RequestMethod.HEAD})\n public String certPage() throws Exception {\n return \"cert\";\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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// SetTimestamp sets the Timestamp field's value. | [
"func (s *HistoryEvent) SetTimestamp(v time.Time) *HistoryEvent {\n\ts.Timestamp = &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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Gives support for Rails date_select, datetime_select, time_select helpers. | [
"def process_attributes(attributes = nil)\n return attributes if attributes.blank?\n multi_parameter_attributes = {}\n new_attributes = {}\n attributes.each_pair do |key, value|\n if key.match(DATE_KEY_REGEX)\n match = key.to_s.match(DATE_KEY_REGEX)\n found_key = match[1... | [
"def buy\n @page = Pwb::Page.find_by_slug \"buy\"\n @page_title = @current_agency.company_name\n # @content_to_show = []\n if @page.present?\n @page_title = @page.page_title + ' - ' + @current_agency.company_name\n # TODO: - allow addition of custom content\n # @page.ordered... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Saves the registry entry in DB, persist it if need.
@param \BackBee\Bundle\Registry $registry
@return \BackBee\Bundle\Registry | [
"public function save(\\BackBee\\Bundle\\Registry $registry)\n {\n if (false === $this->getEntityManager()->contains($registry)) {\n $this->getEntityManager()->persist($registry);\n }\n\n $this->getEntityManager()->flush($registry);\n\n return $registry;\n }"
] | [
"public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Split the function name on multiple lines. | [
"def wrap_function_name(self, name):\n \"\"\"\"\"\"\n\n if len(name) > 32:\n ratio = 2.0/3.0\n height = max(int(len(name)/(1.0 - ratio) + 0.5), 1)\n width = max(len(name)/height, 32)\n # TODO: break lines in symbols\n name = textwrap.fill(name, wi... | [
"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:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Private: Returns the minimum active logging level for the given context.
context - The context of the logging call.
Returns the minimum level that a message would be logged at for the given
context. | [
"def level_for_context(context)\n lvl = self.levels_cache[nil]\n root = []\n context.to_s.split('::').each do |part|\n root << part\n path = root.join '::'\n lvl = self.levels_cache[path] if self.levels_cache.key? path\n end\n lvl\n end"
] | [
"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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
There is a bug in ast.parse that cause it to throw a syntax error if
you have a header similar to...
# coding=utf-8,
we replace this line with something else to bypass the bug.
:param blob: file text contents
:return: adjusted blob | [
"def _remove_coding_header(cls, blob):\n \n # Remove the # coding=utf-8 to avoid AST erroneous parse errors\n # https://bugs.python.org/issue22221\n lines = blob.decode('utf-8').split('\\n')\n if lines and 'coding=utf-8' in lines[0]:\n lines[0] = '#remove coding'\n return '\\n'.join(lines).... | [
"def file_or_token(value):\n \n if isfile(value):\n with open(value) as fd:\n return fd.read().strip()\n\n if any(char in value for char in '/\\\\.'):\n # This chars will never be in a token value, but may be in a path\n # The error message will be handled by the parser\n ... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Lookup a config field and return its value, first checking the
route.config, then route.app.config. | [
"def get_config(self, key, default=None):\n ''' '''\n for conf in (self.config, self.app.conifg):\n if key in conf: return conf[key]\n return default"
] | [
"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:"
} |
// Lenient specifies whether format-based query failures (such as
// providing text to a numeric field) should be ignored. | [
"func (s *CountService) Lenient(lenient bool) *CountService {\n\ts.lenient = &lenient\n\treturn s\n}"
] | [
"def generate(options, command: nil)\n # First, enable `always_trace`, to show the stack trace\n always_trace!\n\n used_switches = []\n options.each do |option|\n next if option.description.to_s.empty? # \"private\" options\n next unless option.display_in_shell\n\n short_swi... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Gets a list of custom source files on the custom_sources directory
that resides in the templates/$generator_name directory with the .php
extension stripped out. | [
"public function GetCustomSources()\n {\n $sources = scandir($this->templates_path . \"custom_sources\");\n \n foreach($sources as $index=>$source)\n {\n // Skip non .php files\n if(strpos($source, \".php\") === false)\n {\n unset($sourc... | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Suspend repository which means that allow only read operations.
All writing threads will wait until resume operations invoked. | [
"protected void suspendRepository() throws RepositoryException\r\n {\r\n SecurityHelper.validateSecurityPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION);\r\n\r\n repository.setState(ManageableRepository.SUSPENDED);\r\n }"
] | [
"func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Plot the data of the tomodir in one overview plot. | [
"def create_anisophaplot(plotman, x, y, z, alpha, options):\n '''\n '''\n sizex, sizez = getfigsize(plotman)\n # create figure\n f, ax = plt.subplots(2, 3, figsize=(3 * sizex, 2 * sizez))\n if options.title is not None:\n plt.suptitle(options.title, fontsize=18)\n plt.subplots_adjust... | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Pass through to provider BookAdminSession.create_book | [
"def create_book(self, *args, **kwargs):\n \"\"\"\"\"\"\n # Implemented from kitosid template for -\n # osid.resource.BinAdminSession.create_bin\n return Book(\n self._provider_manager,\n self._get_provider_session('book_admin_session').create_book(*args, **kwargs),... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get the SQL for enabling or disabling foreign keys
@param string $enableDisable "enable" or "disable"
@return string | [
"protected function _foreignKeySQL($enableDisable)\n {\n $startQuote = $this->_startQuote;\n $endQuote = $this->_endQuote;\n if (!empty($this->_config['schema'])) {\n $schemaName = strtoupper($this->_config['schema']);\n $fromWhere = \"from sys.all_constraints\n ... | [
"@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Renders the actions for the selected rows.
@return string the rendering result | [
"public function renderActions()\n {\n $str = '';\n if(count($this->buttons)) {\n foreach($this->buttons as $button) {\n $str .= Html::a($button['text'], $button['url'], $button['options']);\n }\n }\n if($str)\n return \"<div class=\\\"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 sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Enumerate the imarks in the block. If any of them (after the first one) are at a stop point, returns the address
of the stop point. None is returned otherwise. | [
"def _first_stoppoint(self, irsb, extra_stop_points=None):\n \n if self._stop_points is None and extra_stop_points is None and self.project is None:\n return None\n\n first_imark = True\n for stmt in irsb.statements:\n if type(stmt) is pyvex.stmt.IMark: # pylint: d... | [
"def normalize_mapping_line(mapping_line, previous_source_column=0):\n \n\n if not mapping_line:\n return [], previous_source_column\n\n # Note that while the local record here is also done as a 4-tuple,\n # element 1 and 2 are never used since they are always provided by\n # the segments in t... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Computer Science:"
} |
// SetLoggingEnabled sets the LoggingEnabled field's value. | [
"func (s *LoggingStatus) SetLoggingEnabled(v bool) *LoggingStatus {\n\ts.LoggingEnabled = &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 sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Get a particular option, or the default if it's missing | [
"def get(self, option, default=None):\n ''''''\n val = self[option]\n return (val is None and default) or val"
] | [
"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 post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Throw an unauthorized exception based on gate results.
@param string $ability
@param mixed|array $arguments
@param string $message
@param \Exception $previousException
@return \Symfony\Component\HttpKernel\Exception\HttpException | [
"protected function createGateUnauthorizedException($ability, $arguments, $message = null, $previousException = null)\n {\n $message = $message ?: __d('nova', 'This action is unauthorized.');\n\n return new HttpException(403, $message, $previousException);\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 iAuthenticator)\n throw new exContainerInvalidServiceType('Invalid Plugin... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
store the values in +:config+, checking they are valid | [
"def store_config config\n required = Set.new([:name, :parameters, :output])\n missing = required - config.keys\n raise TargetLoadError.new(\"Required keys are missing from target definition: #{missing.to_a.join(\",\")}\") unless missing.empty?\n config.each_pair do |param, data|\n case p... | [
"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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
1 millisecond = 0.001 seconds
@param start between time
@param end finish time
@return duration in seconds | [
"public static double durationSeconds(LocalDateTime start, LocalDateTime end)\r\n {\r\n\t return Duration.between(start, end).getSeconds();\r\n }"
] | [
"def normalize(self, timestamp, steps=0):\n '''\n \n '''\n # So far, the only commonality with RelativeTime\n return self.from_bucket( self.to_bucket(timestamp, steps) )"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// JoinConversation joins an existing conversation | [
"func (api *Client) JoinConversation(channelID string) (*Channel, string, []string, error) {\n\treturn api.JoinConversationContext(context.Background(), channelID)\n}"
] | [
"private void registerPushServices() {\n RespokeClient activeInstance = null;\n\n // If there are already client instances running, check if any of them have already connected\n for (RespokeClient eachInstance : instances) {\n if (eachInstance.isConnected()) {\n // The... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Initialize indexing queue. | [
"def init_queue():\n \"\"\"\"\"\"\n def action(queue):\n queue.declare()\n click.secho('Indexing queue has been initialized.', fg='green')\n return queue\n return action"
] | [
"@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 instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Programming:"
} |
Create an instance of {@link JAXBElement }{@code <}{@link MassPointReliefType }{@code >}
@param value
Java instance representing xml element's value.
@return
the new instance of {@link JAXBElement }{@code <}{@link MassPointReliefType }{@code >} | [
"@XmlElementDecl(namespace = \"http://www.opengis.net/citygml/relief/2.0\", name = \"MassPointRelief\", substitutionHeadNamespace = \"http://www.opengis.net/citygml/relief/2.0\", substitutionHeadName = \"_ReliefComponent\")\n public JAXBElement<MassPointReliefType> createMassPointRelief(MassPointReliefType value... | [
"public ExtendedSwidProcessor setExtendedInformation(final JAXBElement<Object>... extendedInformationList) {\n ExtendedInformationComplexType eict = new ExtendedInformationComplexType();\n if (extendedInformationList.length > 0) {\n for (JAXBElement<Object> extendedInformation : extendedInf... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
@deprecated
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container DI container
@param string[] $ids Service IDs | [
"public function addConfigurations(ContainerBuilder $container, array $ids)\n {\n if (empty($ids) || !$container->hasDefinition(self::POOL_ID)) {\n return;\n }\n\n $poolDefinition = $container->getDefinition(self::POOL_ID);\n $poolReference = new Reference(self::POOL_ID);\n... | [
"private function registerStandaloneObjects(ContainerBuilder $container)\n {\n //====================================================================//\n // Load Service Definition\n $definition = $container->getDefinition('splash.connectors.standalone');\n //=========================... | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
create
@param array $options
@param TransportInterface|null $transport
@return HttpClient | [
"public static function create($options = [], TransportInterface $transport = null)\n {\n $transport = $transport ?: static::getTransport();\n $options = $options ?: static::getOptions();\n\n switch ($transport) {\n case 'mock':\n $mockOptions = isset($options['mo... | [
"function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Return a normalized path.
:param list path: elements of the metric path to record
:param str metric_type: The metric type
:rtype: str | [
"def _build_path(self, path, metric_type):\n \n path = self._get_prefixes(metric_type) + list(path)\n return '{}.{}'.format(self._namespace,\n '.'.join(str(p).replace('.', '-') for p in path))"
] | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the Github post about text processing:",
"pos": "Represent the Github code about text processing:",
"neg": "Represent the Github code:"
} |
Maximum level we can zoom out is such that the available range takes 400px. The 3 days per pixel upper bound on that scale is to prevent ugly rendering in extreme cases. | [
"function maxDurationMsPerTimelinePx(earliestTimestamp) {\n const durationMsLowerBound = minDurationMsPerTimelinePx();\n const durationMsUpperBound = moment.duration(3, 'days').asMilliseconds();\n const durationMs = availableTimelineDurationMs(earliestTimestamp) / 400.0;\n return clamp(durationMs, durationMsLow... | [
"def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// handleGetFragmentBlockData handles GET /internal/fragment/block/data requests. | [
"func (h *Handler) handleGetFragmentBlockData(w http.ResponseWriter, r *http.Request) {\n\tbuf, err := h.api.FragmentBlockData(r.Context(), r.Body)\n\tif err != nil {\n\t\tif _, ok := err.(pilosa.BadRequestError); ok {\n\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t} else if errors.Cause(err) == pilo... | [
"def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
########################################################################## | [
"static public function interpret_bool($interpretThis, array $trueFalseMapper=null) {\n\t\t$interpretThis = preg_replace('/ /', '', $interpretThis);\n\t\tif(is_array($trueFalseMapper)) {\n\t\t\tif(count($trueFalseMapper) == 2 && isset($trueFalseMapper[0]) && isset($trueFalseMapper[1])) {\n\t\t\t\t$realVals = $trueF... | [
"public function getStageName($stage)\n {\n switch ($stage) {\n case Runtime::PRE_DEPLOY:\n return 'Pre Deploy';\n\n case Runtime::ON_DEPLOY:\n return 'On Deploy';\n\n case Runtime::POST_DEPLOY:\n return 'Post Deploy';\n\n ... | codesearchnet | {
"query": "Represent the Github summarization about N/A:",
"pos": "Represent the Github code about N/A:",
"neg": "Represent the Github code about programming:"
} |
Describes a structure inside tile folder of ESA product .SAFE structure
:return: nested dictionaries representing .SAFE structure
:rtype: dict | [
"def get_safe_struct(self):\n \n safe = {}\n main_folder = self.get_main_folder()\n safe[main_folder] = {}\n\n safe[main_folder][AwsConstants.AUX_DATA] = {}\n\n safe[main_folder][AwsConstants.DATASTRIP] = {}\n datastrip_list = self.get_datastrip_list()\n for d... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
*********************************************************************************** | [
"@Override\n\tpublic void propagate(int evtmask) throws ContradictionException {\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tif (matrix[i][j].getLB() == 1) {\n\t\t\t\t\tg.enforceArc(i, j, this);\n\t\t\t\t} else if (matrix[i][j].getUB() == 0) {\n\t\t\t\t\tg.removeArc(i, j, this);... | [
"private void populateMilestone(Row row, Task task)\n {\n task.setMilestone(true);\n //PROJID\n task.setUniqueID(row.getInteger(\"MILESTONEID\"));\n task.setStart(row.getDate(\"GIVEN_DATE_TIME\"));\n task.setFinish(row.getDate(\"GIVEN_DATE_TIME\"));\n //PROGREST_PERIOD\n //SYMBO... | codesearchnet | {
"query": "Represent the comment about N/A:",
"pos": "Represent the code about N/A:",
"neg": "Represent the code about Data management:"
} |
/*
update our input with the new date time.. | [
"function (dp_inst) {\n\t\t\tdp_inst = this.inst || dp_inst;\n\t\t\tvar dtTmp = (dp_inst.currentYear > 0? \n\t\t\t\t\t\t\tnew Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) : \n\t\t\t\t\t\t\tnew Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),\n\t\t\t\tdt = $.datepicker.... | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Convert a time date item to (x, y) four point.
@param {Array} data date[0] is date
@param {boolean} [clamp=true] out of range
@return {Object} point | [
"function (data, clamp) {\n var point = this.dataToPoint(data, clamp);\n\n return {\n contentShape: {\n x: point[0] - (this._sw - this._lineWidth) / 2,\n y: point[1] - (this._sh - this._lineWidth) / 2,\n width: this._sw - this._lineWidth,\n ... | [
"def normalize(self, timestamp, steps=0):\n '''\n \n '''\n # So far, the only commonality with RelativeTime\n return self.from_bucket( self.to_bucket(timestamp, steps) )"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Front returns the head of the chain. If the chain is empty, then this
// returns a pointer to a nil node.
//
// NOTE: Part of the Chain interface. | [
"func (b *BoundedMemoryChain) Front() *Node {\n\tif b.tailPtr == -1 && b.headPtr == -1 {\n\t\treturn nil\n\t}\n\n\treturn &b.chain[b.headPtr]\n}"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the Github text about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about programming:"
} |
Support the subscript operator with an ObjectRange for a char array
@param array a char array
@param range an ObjectRange indicating the indices for the items to retrieve
@return list of the retrieved chars
@since 1.0 | [
"@SuppressWarnings(\"unchecked\")\n public static List<Character> getAt(char[] array, ObjectRange range) {\n return primitiveArrayGet(array, range);\n }"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Get the unique set of declared methods on the leaf class and all superclasses. Leaf
class methods are included first and while traversing the superclass hierarchy any methods found
with signatures matching a method already included are filtered out. | [
"public static Method[] getUniqueDeclaredMethods(Class<?> leafClass) throws IllegalArgumentException {\n final List<Method> methods = new ArrayList<Method>(32);\n doWithMethods(leafClass, new MethodCallback() {\n @Override\n public void doWith(Method method) {\n bo... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Function to normalize data to have mean 0 and unity standard deviation
(also called z-transform)
Parameters
----------
data : numpy.ndarray
Returns
-------
numpy.ndarray
z-transform of input array | [
"def normalize(data):\n \n data = data.astype(float)\n data -= data.mean()\n \n return data / data.std()"
] | [
"def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
main method called. calls the provider and gets the provider to
authenticate the user
@return type | [
"public function execute() {\n $this->container->set('securityContext', $this->securityContext);\n\n if (is_null($this->node) || !array_key_exists('authentication', $this->node)) {\n return;\n }\n if (array_key_exists('security', $this->node) && (!$this->node['security'] || $t... | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Return a function for retrieving one item
@param {Endpoint} endpoint
@param {String[]} [allowable]
@return {itemsGetOneRequest} | [
"function newGetOne(endpoint, allowable) {\n var get = newGet(endpoint, allowable);\n return function(id, params, callback) {\n var args = utils.allowOptionalParams(params, callback);\n if (typeof id === \"object\") {\n _.assign(args.params, id);\n } else {\n args.pa... | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Adds an in edge to this node.
@param DocumentGraphEdge $edge | [
"public function addInEdge(DocumentGraphEdge $edge): void\n {\n $this->inEdges[$edge->getSource()->className] = $edge;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the comment about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Returns True if the IPv4 address ia valid, otherwise returns False. | [
"def is_ipv4(ip: str) -> bool:\n \n try:\n socket.inet_aton(ip)\n except socket.error:\n return False\n return True"
] | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
:return: Hessian filled with the symbolic expressions for all the
second order partial derivatives. Partial derivatives are taken with
respect to the Parameter's, not the independent Variable's. | [
"def hessian(self):\n \n return [[[sympy.diff(partial_dv, param) for param in self.params]\n for partial_dv in comp] for comp in self.jacobian]"
] | [
"def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Return the list of keys on the path from root to the receiver. | [
"def path(self) -> Tuple[InstanceKey]:\n \"\"\"\"\"\"\n res = []\n inst: InstanceNode = self\n while inst.parinst:\n res.insert(0, inst._key)\n inst = inst.parinst\n return tuple(res)"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
remove a volume by its name
:param volume_name: str
:return None | [
"def remove_volume(self, volume_name):\n \n logger.info(\"removing volume '%s'\", volume_name)\n try:\n self.d.remove_volume(volume_name)\n except APIError as ex:\n if ex.response.status_code == requests.codes.CONFLICT:\n logger.debug(\"ignoring a con... | [
"def clone(self, id=None, src=None, backup=None, size=None):\n \n # Set basic Logging\n logging.basicConfig()\n # Get the lunr logger\n log = logger.get_logger()\n # Output Debug level info\n log.logger.setLevel(logging.DEBUG)\n # Load the local storage config... | codesearchnet | {
"query": "Represent the summarization about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Generate a list of items for the main menu.
@param Tree|null $tree
@return Menu[] | [
"public function genealogyMenu(?Tree $tree): array\n {\n if ($tree === null) {\n return [];\n }\n\n return app(ModuleService::class)->findByComponent(ModuleMenuInterface::class, $tree, Auth::user())\n ->map(static function (ModuleMenuInterface $menu) use ($tree): ?Menu ... | [
"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:"
} |
Create an instance of {@link JAXBElement }{@code <}{@link SemanticsType }{@code >}} | [
"@XmlElementDecl(namespace = \"http://www.w3.org/1998/Math/MathML\", name = \"semantics\")\n public JAXBElement<SemanticsType> createSemantics(SemanticsType value) {\n return new JAXBElement<SemanticsType>(_Semantics_QNAME, SemanticsType.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 Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// Insert will insert the provided keys into the btree. This is an
// O(m*log n) operation where m is the number of keys to be inserted
// and n is the number of items in the tree. | [
"func (tree *btree) Insert(keys ...Key) {\n\tfor _, key := range keys {\n\t\ttree.insert(key)\n\t}\n}"
] | [
"public long appendEntry(JournalEntry entry) {\n // TODO(gpang): handle bounding the queue if it becomes too large.\n\n /**\n * Protocol for appending entries\n *\n * This protocol is lock free, to reduce the overhead in critical sections. It uses\n * {@link AtomicLong} and {@link ConcurrentLi... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about text processing:"
} |
上传文件
@param filePath 上传的文件路径
@param key 上传文件保存的文件名
@param token 上传凭证
@param params 自定义参数,如 params.put("x:foo", "foo")
@param mime 指定文件mimetype
@param checkCrc 是否验证crc32 | [
"public Response put(String filePath, String key, String token, StringMap params,\n String mime, boolean checkCrc) throws QiniuException {\n return put(new File(filePath), key, token, params, mime, checkCrc);\n }"
] | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the text about Encryption:",
"pos": "Represent the code about Encryption:",
"neg": "Represent the code about programming:"
} |
// getFirstDDLJob gets the first DDL job form DDL queue. | [
"func (w *worker) getFirstDDLJob(t *meta.Meta) (*model.Job, error) {\n\tjob, err := t.GetDDLJobByIdx(0)\n\treturn job, errors.Trace(err)\n}"
] | [
"@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Module loader
@param name
@param moduleClass
@returns {Promise.<TResult>} | [
"function useModule(name, moduleClass) {\n if (arguments.length === 1) {\n moduleClass = name;\n name = null;\n }\n\n // create module\n var module = new moduleClass(),\n bootResponse = void 0;\n\n // Wrapper methods\n function boot() {\n var initialResponse = typeof mo... | [
"func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}"
] | codesearchnet | {
"query": "Represent the description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Drop
Drop a Collection
@param {String} connectionName
@param {String} collectionName
@param {Array} relations
@param {Function} callback | [
"function(connection, collection, relations, cb) {\n log.debug('drop:', collection);\n // Add in logic here to delete a collection (e.g. DROP TABLE logic)\n\n return connections[connection].drop(collection, relations, cb);\n }"
] | [
"function initCreate (args) {\n // method name is moduleNameCreate\n var methodName = `${this.name}Create`\n // method signature is moduleName.methodname\n var methodSignature = `${this.moduleName}.${methodName}`\n // capture model to pass to function\n var model = this\n // add create method t... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
// RPCObserver implements Observer. | [
"func (n *RequestObserver) RPCObserver() rpc.Observer {\n\treturn &rpcObserver{\n\t\tclock: n.clock,\n\t\tlogger: n.logger,\n\t\tpingLogger: n.pingLogger,\n\t\tid: n.state.id,\n\t\ttag: n.state.tag,\n\t}\n}"
] | [
"@SuppressWarnings(\"unchecked\")\n public <C extends CDACallback<SynchronizedSpace>> C fetch(C callback) {\n return (C) Callbacks.subscribeAsync(observe(), callback, client);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// MarshalBinary implements encoding.BinaryMarshaler interface | [
"func (po *Po) MarshalBinary() ([]byte, error) {\n\tobj := new(TranslatorEncoding)\n\tobj.Headers = po.Headers\n\tobj.Language = po.Language\n\tobj.PluralForms = po.PluralForms\n\tobj.Nplurals = po.nplurals\n\tobj.Plural = po.plural\n\tobj.Translations = po.translations\n\tobj.Contexts = po.contexts\n\n\tvar buff b... | [
"func (pl *Payload) Decode(data []byte) error {\n\t// Note that this method can't be named UnmarshalBinary, because the gob encoder would call\n\t// this method, resulting in infinite recursion.\n\treturn pl.ReadBinary(bytes.NewBuffer(data))\n}"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Trigger a search in lunr and transform the result
@param {String} query
@return {Array} results | [
"function search(query) {\n // Find the item in our index corresponding to the lunr one to have more info\n return lunrIndex.search(query).map(function(result) {\n return pagesIndex.filter(function(page) {\n return page.uri === result.ref;\n })[0];\n });\n}"
] | [
"function function_ (options) {\n options.hash.kind = 'function'\n var result = ddata._identifier(options)\n return result ? options.fn(result) : 'ERROR, Cannot find function.'\n}"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Writes a file to disk | [
"def _write_file(iface, data, folder, pattern):\n '''\n \n '''\n filename = os.path.join(folder, pattern.format(iface))\n if not os.path.exists(folder):\n msg = '{0} cannot be written. {1} does not exist'\n msg = msg.format(filename, folder)\n log.error(msg)\n raise Attrib... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github description about File management:",
"pos": "Represent the Github code about File management:",
"neg": "Represent the Github code about programming:"
} |
Adds a {@link CssLink} to the theme. The css precedence is declared within the {@link CssLink}.
@param link the link | [
"public void addLink(CssLink link) {\n\t\tif (!this.links.contains(link)) {\n\t\t\tthis.links.add(link);\n\t\t}\n\t\tCollections.sort(this.links);\n\t}"
] | [
"private void loadConfigurationFiles() {\n\n // Parse the first annotation found (manage overriding)\n final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);\n\n // Conf variable cannot be null because it was defined in this class\n // It's ... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Obtains appropriate model scale and shape latent variables
Parameters
----------
parm : np.array
Transformed latent variable vector
Returns
----------
None (changes model attributes) | [
"def _get_scale_and_shape(self,parm):\n \n\n if self.scale is True:\n if self.shape is True:\n model_shape = parm[-1] \n model_scale = parm[-2]\n else:\n model_shape = 0\n model_scale = parm[-1]\n else:\n ... | [
"def normalize(self, inplace=True):\n \n phi = self if inplace else self.copy()\n\n # The pdf of a Joint Gaussian distrinution is always\n # normalized. Hence, no changes.\n if not inplace:\n return phi"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Obtains form style from passed custom 'formStyle' option.
Style can also be detected by the the 'class' option when it is horizontal or inline.
Sets $this->formStyle property.
@param array $options
@return array | [
"protected function _detectFormStyle($options) {\n\t\t$this->formStyle = $this->_extractOption('formStyle', $options);\n\t\t$class = $this->_extractOption('class', $options);\n\n\t\tif (!$this->formStyle) {\n\t\t\tif (!$class) {\n\t\t\t\treturn $options;\n\t\t\t}\n\n\t\t\t$registeredStyles = $this->listFormStyles()... | [
"protected function configureFormer()\n {\n // Use Bootstrap 3\n Config::set('former.framework', 'TwitterBootstrap3');\n\n // Reduce the horizontal form's label width\n Config::set('former.TwitterBootstrap3.labelWidths', []);\n\n // Change Former's required field HTML\n ... | codesearchnet | {
"query": "Represent the summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Convert an SVG path string into a Path2D object
Parameters
-------------
paths: list of tuples
Containing (path string, (3,3) matrix)
Returns
-------------
drawing : dict
Kwargs for Path2D constructor | [
"def _svg_path_convert(paths):\n \n def complex_to_float(values):\n return np.array([[i.real, i.imag] for i in values])\n\n def load_line(svg_line):\n points = complex_to_float([svg_line.point(0.0),\n svg_line.point(1.0)])\n if starting:\n #... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
fee_paying_wallet is used only if there are no bytes on the asset wallet, it is a sort of fallback wallet for fees | [
"function readFundedAndSigningAddresses(\n\t\tasset, wallet, estimated_amount, spend_unconfirmed, fee_paying_wallet,\n\t\tarrSigningAddresses, arrSigningDeviceAddresses, handleFundedAndSigningAddresses)\n{\n\treadFundedAddresses(asset, wallet, estimated_amount, spend_unconfirmed, function(arrFundedAddresses){\n\t\t... | [
"def can_pull(self, initial, scheduled):\n \n if not initial and self.config.is_valid_schedule():\n # if the config has a valid schedule, return True if this is a scheduled run\n return scheduled\n return True"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software Development:"
} |
Returns symbol instances corresponding to aliased vars. | [
"def aliases(self):\n \n return [x for x in self[self.current_scope].values() if x.is_aliased]"
] | [
"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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Generating the current Datetime with a given format
Returns:
--------
string: The string of a date. | [
"def getCurrentStrDatetime():\n \n # Generating current time\n i = datetime.datetime.now()\n strTime = \"%s-%s-%s_%sh%sm\" % (i.year, i.month, i.day, i.hour, i.minute)\n return strTime"
] | [
"def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\""
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// Check returns nil if XSRF token is valid. | [
"func Check(c context.Context, tok string) error {\n\t_, err := xsrfToken.Validate(c, tok, state(c))\n\treturn err\n}"
] | [
"def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ... | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Returns webdriver command description.
@param WebDriver_Command $command
@return string | [
"public static function getCommandDescription(WebDriver_Command $command)\n {\n $commandDescriptionList = [\n \"Command: {$command->getCommandName()}\",\n \"Method: {$command->getMethod()}\",\n \"URL: {$command->getUrl()}\"\n ];\n $paramList = $command->getPa... | [
"@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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetServer sets the Server field's value. | [
"func (s *UpdateServerEngineAttributesOutput) SetServer(v *Server) *UpdateServerEngineAttributesOutput {\n\ts.Server = 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 summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Handle the DefineFontAlignZones tag. | [
"def _handle_tag_definefontalignzones(self):\n \"\"\"\"\"\"\n obj = _make_object(\"DefineFontAlignZones\")\n obj.FontId = unpack_ui16(self._src)\n bc = BitConsumer(self._src)\n obj.CSMTableHint = bc.u_get(2)\n obj.Reserved = bc.u_get(6)\n\n obj.ZoneTable = zone_recor... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Rounds a number to a nearest multiple.
@param {Number} n The number to round.
@param {Number} multiple The multiple to round to.
@return {Number} The result of the round operation. | [
"function( n, multiple ) {\n 'use strict';\n\n var remainder = 0;\n\n if ( multiple === 0 ) {\n return n;\n }\n\n remainder = Math.abs( n ) % multiple;\n\n if ( remainder === 0 ) {\n return n;\n }\n\n if ( n < 0 ) {\n return -(... | [
"def _RoundTowardZero(value, divider):\n \"\"\"\"\"\"\n # For some languanges, the sign of the remainder is implementation\n # dependent if any of the operands is negative. Here we enforce\n # \"rounded toward zero\" semantics. For example, for (-5) / 2 an\n # implementation may give -3 as the result with the ... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// kqueue creates a new kernel event queue and returns a descriptor. | [
"func kqueue() (kq int, err error) {\n\tkq, err = unix.Kqueue()\n\tif kq == -1 {\n\t\treturn kq, err\n\t}\n\treturn kq, nil\n}"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Marshall the given parameter object. | [
"public void marshall(DescribeAccountAuditConfigurationRequest describeAccountAuditConfigurationRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (describeAccountAuditConfigurationRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Return an associative array of the data.
@return array | [
"public function toArray()\n {\n $result = array();\n foreach ($this as $key => $row) {\n $result[$key] = $row->toArray();\n }\n return $result;\n }"
] | [
"final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Add regular file to package.
@param source
@param target
@return
@throws IOException | [
"@Override\r\n public FileBuilder addFile(Path source, String target) throws IOException\r\n {\r\n checkTarget(target);\r\n FileBuilder fb = new FileBuilder(target, source);\r\n fileBuilders.add(fb);\r\n return fb;\r\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:"
} |
// Match checks if the given message matches any of the filters | [
"func (m MsgFilters) Match(msg *Msg) bool {\n\t// check if there is a wildcard filter for the message's protocol\n\tif _, ok := m[MsgFilter{Proto: msg.Protocol, Code: -1}]; ok {\n\t\treturn true\n\t}\n\n\t// check if there is a filter for the message's protocol and code\n\tif _, ok := m[MsgFilter{Proto: msg.Protoco... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Return the definition location of the python name at `offset`
A `Location` object is returned if the definition location can be
determined, otherwise ``None`` is returned. | [
"def find_definition(project, code, offset, resource=None, maxfixes=1):\n \n fixer = fixsyntax.FixSyntax(project, code, resource, maxfixes)\n pyname = fixer.pyname_at(offset)\n if pyname is not None:\n module, lineno = pyname.get_definition_location()\n name = rope.base.worder.Worder(code)... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the text about software development:",
"pos": "Represent the code about software development:",
"neg": "Represent the code:"
} |
returns field name camelcased if it has underlines
eg: user_id => userId
@param string $fieldname
@return string | [
"private function toCamelCase($fieldname)\n {\n $words = str_replace('_', ' ', $fieldname);\n $words = ucwords($words);\n $pascalCased = str_replace(' ', '', $words);\n\n return lcfirst($pascalCased);\n }"
] | [
"def apply(self, search, field, value):\n \"\"\"\"\"\"\n # We assume that the field in question has a \"raw\" counterpart.\n return search.query('match', **{'{}.raw'.format(field): value})"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetDestinationS3BucketName sets the DestinationS3BucketName field's value. | [
"func (s *GenerateDataSetInput) SetDestinationS3BucketName(v string) *GenerateDataSetInput {\n\ts.DestinationS3BucketName = &v\n\treturn s\n}"
] | [
"@Override\n @VisibleForTesting\n protected void configureBuckets(GoogleCloudStorageFileSystem gcsFs) throws IOException {\n rootBucket = initUri.getAuthority();\n checkArgument(rootBucket != null, \"No bucket specified in GCS URI: %s\", initUri);\n // Validate root bucket name\n pathCodec.getPath(roo... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Programming:"
} |
This method allows to insert specified label to specified Huffman tree position.
CAUTION: Never use this, unless you 100% sure what are you doing.
@param index
@param label | [
"@Override\n public void addWordToIndex(int index, String label) {\n if (index >= 0) {\n T token = tokenFor(label);\n if (token != null) {\n idxMap.put(index, token);\n token.setIndex(index);\n }\n }\n }"
] | [
"def show(self):\n \n bytecode._Print(\"MAP_LIST SIZE\", self.size)\n for i in self.map_item:\n if i.item != self:\n # FIXME this does not work for CodeItems!\n # as we do not have the method analysis here...\n i.show()"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// SetName sets the Name field's value. | [
"func (s *RelationalDatabaseBundle) SetName(v string) *RelationalDatabaseBundle {\n\ts.Name = &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:"
} |
智能匹配模版接口发短信
@param apikey apikey
@param text 短信内容
@param mobile 接受的手机号
@return json格式字符串 | [
"public static Single<String> sendSms(String apikey, String text, String mobile) {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"apikey\", apikey);\n params.put(\"text\", text);\n params.put(\"mobile\", mobile);\n return post(URI_SEND_SMS, params);\n... | [
"public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城... | codesearchnet | {
"query": "Represent the instruction about text processing:",
"pos": "Represent the code about text processing:",
"neg": "Represent the code about programming:"
} |
Transform source code containing lazy-cache statements into a requirable file usable with webpack.
@param {String} `source` Source code.
@return {String} Transformed source code. | [
"function transform(str) {\n str = str.split(/^lazy\\(/gm).join('require(');\n var lines = str.split(/\\r\\n|\\n/);\n var len = lines.length;\n var re = regex();\n var idx = 0;\n\n var start = false;\n var isExported = false;\n var namespace;\n var res = '';\n\n while (idx < len) {\n var line = lines[i... | [
"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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// SetCommands sets the Commands field's value. | [
"func (s *ListCommandsOutput) SetCommands(v []*Command) *ListCommandsOutput {\n\ts.Commands = v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Get an array containing all the queries run on a
specified connection up to now.
Only works if the 'logging' config option is
set to true. Otherwise, returned array will be empty.
@param string $connection_name Which connection to use | [
"public static function get_query_log($connection_name = self::DEFAULT_CONNECTION)\n {\n if (isset(self::$_query_log[$connection_name])) {\n return self::$_query_log[$connection_name];\n }\n\n return [];\n }"
] | [
"def get_cursor(self, instance, db_key, db_name=None):\n '''\n \n '''\n conn_key = self._conn_key(instance, db_key, db_name)\n try:\n conn = self.connections[conn_key]['conn']\n except KeyError:\n # We catch KeyError to avoid leaking the auth info used... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
// Create creates a docker client based on the specified options. | [
"func Create(c Options) (client.APIClient, error) {\n\tif c.Host == \"\" {\n\t\tif os.Getenv(\"DOCKER_API_VERSION\") == \"\" {\n\t\t\tos.Setenv(\"DOCKER_API_VERSION\", DefaultAPIVersion)\n\t\t}\n\t\tclient, err := client.NewEnvClient()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn client, nil\n\t}\... | [
"def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how t... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Sets the `box` my property based on actual container size . | [
"function setBox(){\n if(my.container){\n my.box = {\n x: 0,\n y: 0,\n width: my.container.clientWidth,\n height: my.container.clientHeight\n };\n }\n }"
] | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Use this API to fetch dnsview resource of given name . | [
"public static dnsview get(nitro_service service, String viewname) throws Exception{\n\t\tdnsview obj = new dnsview();\n\t\tobj.set_viewname(viewname);\n\t\tdnsview response = (dnsview) obj.get_resource(service);\n\t\treturn response;\n\t}"
] | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Technology:"
} |
Initialize class fields. | [
"public void init(BaseField fldTargetTree)\n {\n m_recPackages = null;\n m_fldTargetTree = null;\n m_fldTargetTree = fldTargetTree;\n super.init(null);\n }"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the post about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Format nice datetime
@param mixed $value
@param array $options
boolean skip_user_timezone
@return string | [
"public static function niceDatetime($value, array $options = []) {\n\t\tif (!isset($value)) return '';\n\t\ttry {\n\t\t\t$server_timezone = self::$options['server_timezone_code'] ?? Application::get('php.date.timezone');\n\t\t\t$object = new DateTime($value, new DateTimeZone($server_timezone));\n\t\t\t// change ti... | [
"final protected function fc($k = null, $d = null) {return dfak(\n\t\t/** 2017-12-12 @todo Should we care of a custom `config_path` or not? https://mage2.pro/t/5148 */\n\t\tdf_config_field($this->getPath())->getData(), $k, $d\n\t);}"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Programming:"
} |
/*
(non-Javadoc)
@see javax.persistence.EntityManager#lock(java.lang.Object, javax.persistence.LockModeType) | [
"@Override\n public void lock(Object entity, LockModeType lockMode)\n {\n ivEm.lock(entity, lockMode);\n }"
] | [
"public void setTransactionRegistry(org.jboss.tm.usertx.UserTransactionRegistry v)\n {\n ((org.jboss.tm.usertx.UserTransactionProvider)utp).setTransactionRegistry(v);\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Finds a converter by type.
@param cls the type to lookup, not null
@return the converter, null if not found
@throws RuntimeException (or subclass) if source code is invalid | [
"@Override\n public StringConverter<?> findConverter(Class<?> cls) {\n if (cls == Character[].class) {\n return CharecterArrayStringConverter.INSTANCE;\n }\n return null;\n }"
] | [
"@SuppressWarnings(\"unused\")\n @Internal\n protected final void warnMissingProperty(Class type, String method, String property) {\n if (LOG.isWarnEnabled()) {\n LOG.warn(\"Configuration property [{}] could not be set as the underlying method [{}] does not exist on builder [{}]. This usuall... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Check if route is duplicated.
@param Route $route
@return bool | [
"private static function checkDuplicated(Route $route)\n {\n foreach (self::$register as $registeredRoute) {\n if ($registeredRoute->getName() == $route->getName()) {\n return true;\n }\n }\n\n return false;\n }"
] | [
"static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}"
] | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
getGithubId - anchors used at github.com
@private
If no repetition, or if the repetition is 0 then ignore. Otherwise append '-' and the number. | [
"function getGithubId (text) {\n text = basicGithubId(text)\n text = text.replace(emojiRegex(), '') // Strip emojis\n return text\n}"
] | [
"private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Take a SystemID string and try to turn it into a good absolute URI.
@param systemId A URI string, which may be absolute or relative.
@return The resolved absolute URI | [
"public static String getAbsoluteURI(String systemId)\n {\n String absoluteURI = systemId;\n if (isAbsoluteURI(systemId))\n {\n // Only process the systemId if it starts with \"file:\".\n if (systemId.startsWith(\"file:\"))\n {\n String str = systemId.substring(5);\n\n // Reso... | [
"def uri_from(url)\n # This will raise an InvalidURIError if the URL is very wrong. It will\n # still pass for strings like \"foo\", though.\n url = URI(url)\n\n # We need to check if the URL was either http://, https:// or ftp://,\n # because these are the only ones we can download from. o... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
defines actions for each request in yaml file. | [
"def define_actions\n unless @action_defined\n hash = YAML.load(File.read(@file_path))\n hash.each do |k, v|\n v.each do |key, value|\n @app.class.define_action!(value[\"request\"], value[\"response\"])\n end\n end\n @action_defined = true\n end\n ... | [
"def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Technology:"
} |
// PeerUserTLSDir returns the path to the TLS directory containing the
// certificates and keys for the specified user of the peer. | [
"func (n *Network) PeerUserTLSDir(p *Peer, user string) string {\n\treturn n.peerUserCryptoDir(p, user, \"tls\")\n}"
] | [
"func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as... | codesearchnet | {
"query": "Represent the Github text about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Add extra information about request handler and its params | [
"def document(info=None, input=None, output=None):\n \n def wrapper(func):\n if info is not None:\n setattr(func, \"_swg_info\", info)\n if input is not None:\n setattr(func, \"_swg_input\", input)\n if output is not None:\n setattr(func, \"_swg_output\", ... | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
// GetAWSIoTAnalyticsChannelWithName retrieves all AWSIoTAnalyticsChannel items from an AWS CloudFormation template
// whose logical ID matches the provided name. Returns an error if not found. | [
"func (t *Template) GetAWSIoTAnalyticsChannelWithName(name string) (*resources.AWSIoTAnalyticsChannel, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *resources.AWSIoTAnalyticsChannel:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resou... | [
"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 summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// Renew is used to renew the TTL on a single session | [
"func (s *Session) Renew(args *structs.SessionSpecificRequest,\n\treply *structs.IndexedSessions) error {\n\tif done, err := s.srv.forward(\"Session.Renew\", args, args, reply); done {\n\t\treturn err\n\t}\n\tdefer metrics.MeasureSince([]string{\"session\", \"renew\"}, time.Now())\n\n\t// Get the session, from loca... | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Create a normalized tree of UploadedFile instances from the Environment.
@param Environment $env The environment
@return array|null A normalized tree of UploadedFile instances or null if none are provided. | [
"public static function createFromEnvironment(\\Slim\\Environment $env) {\n if (isset($env['slim.files']) && is_array($env['slim.files'])) {\n return $env['slim.files'];\n } elseif (isset($_FILES)) {\n return static::parseUploadedFiles($_FILES);\n }\n\n return array... | [
"public function addFiles($files)\n {\n if ($files instanceof FileBag) {\n $this->fileBag = $files;\n return;\n }\n\n if (is_array($files)) {\n $this->fileBag = new FileBag($files);\n return;\n }\n throw new BadFileDataException('The ... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.