query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
See the class documentation.
[ "def defconfig_filename(self):\n \n if self.defconfig_list:\n for filename, cond in self.defconfig_list.defaults:\n if expr_value(cond):\n try:\n with self._open_config(filename.str_value) as f:\n return f.n...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Decora un valor, aplicando un estilo @param \PlanB\Beautifier\Style\Style $style @param string $value @return string
[ "public function decorate(Style $style, string $value): string\n {\n if (!$style->isExpand()) {\n return $value;\n }\n\n $lineWidth = $style->getLineWidth();\n $align = $style->getAlignValue();\n\n return str_pad($value, $lineWidth, ' ', $align);\n }" ]
[ "private function init(){\n //Load Archivos de Funciones\n $this->loadFunctionsFiles();\n //Instancio el sistema de Cache\n $this->cache= new Support\\Cache\\Cache();\n //EnolaContext->init(): Cargo las configuraciones de contexto faltante\n $this->context->init();\n ...
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Authorize and capture funds
[ "def authorize_and_capture\n \n resp = StdClass.new \n if self.financial_status == Invoice::FINANCIAL_STATUS_CAPTURED\n resp.error = \"Funds for this invoice have already been captured.\"\n else\n \n sc = self.site.store_config ...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
returns formatted date/time string for start date @param string $format format, see http://php.net/date @param \stubbles\date\TimeZone $timeZone target time zone of formatted string @return string @since 3.5.0
[ "public function formatStart(string $format, TimeZone $timeZone = null): string\n {\n return $this->start->format($format, $timeZone);\n }" ]
[ "public static function configureInput(InputDefinition $definition)\n {\n $definition->addOption(new InputOption(\n 'date-fmt',\n null,\n InputOption::VALUE_REQUIRED,\n 'The date format (as a PHP date format string)',\n // @todo refactor so this can b...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Bootstrap any application services. @return void
[ "public function boot()\n {\n $manager = new ThemeManager($this->app['files'], $this->app[Template::class], $this->app['cache.store']);\n\n $this->app->singleton('boomcms.template.manager', function () use ($manager) {\n return $manager;\n });\n\n $this->themes = $manager->...
[ "@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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
// Update an existing app. // // appIdentity is the unique identifier of the App. options is the struct of // optional parameters for this action.
[ "func (c *Client) AppUpdate(appIdentity string, options *AppUpdateOpts, message string) (*App, error) {\n\trh := RequestHeaders{CommitMessage: message}\n\tvar appRes App\n\treturn &appRes, c.PatchWithHeaders(&appRes, \"/apps/\"+appIdentity, options, rh.Headers())\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 about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// SetCustomKeyStoreName sets the CustomKeyStoreName field's value.
[ "func (s *CustomKeyStoresListEntry) SetCustomKeyStoreName(v string) *CustomKeyStoresListEntry {\n\ts.CustomKeyStoreName = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
@param Request $request @return Response
[ "public function cgetAction(Request $request)\n {\n $list = new CollectionRepresentation(\n $this->getManager()->findAll($this->getLocale($request)),\n self::$entityKey\n );\n\n $view = $this->view($list);\n\n return $this->handleView($view);\n }" ]
[ "public function init()\n {\n $this->response->disableLayout();\n $this->userStore = b8\\Store\\Factory::getStore('User');\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
List all config stores. A copy of CliCache, except for further check that the cache store name starts with 'config.'. @see \SimpleComplex\Cache\CliCache @return mixed Exits if no/falsy option 'get'.
[ "protected function cmdListStores() /*: void*/\n {\n /**\n * @see simplecomplex_cache_cli()\n */\n $container = Dependency::container();\n // Validate input. ---------------------------------------------\n $match = '';\n if (\n !empty($this->command->...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Replace text representing greek letters with greek letters.
[ "def replace_greek(self, name):\n \"\"\"\"\"\"\n name = name.replace('gamma-delta', 'gammadelta')\n name = name.replace('interleukin-1 beta', 'interleukin-1beta')\n greek_present = False\n for greek_txt, uni in self.greek2uni.items():\n if greek_txt in name:\n ...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Fix the json representation of an agent.
[ "def _fix_json_agents(ag_obj):\n \"\"\"\"\"\"\n if isinstance(ag_obj, str):\n logger.info(\"Fixing string agent: %s.\" % ag_obj)\n ret = {'name': ag_obj, 'db_refs': {'TEXT': ag_obj}}\n elif isinstance(ag_obj, list):\n # Recursive for complexes and similar.\n ret = [_fix_json_age...
[ "@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:" }
Get the includes. @param array $available @throws \Tobscure\JsonApi\Exception\InvalidParameterException @return array
[ "public function getInclude(array $available = [])\n {\n if ($include = $this->getInput('include')) {\n $relationships = explode(',', $include);\n\n $invalid = array_diff($relationships, $available);\n\n if (count($invalid)) {\n throw new InvalidParameterExc...
[ "public function applyFilters($filters, FilterFactory $filterFactory, ConditionAwareRepository $repository)\n {\n // @see Ipunkt\\LaravelJsonApi\\Services\\FilterApplier\\FilterApplier\n \\FilterApplier::applyFiltersToRepository($filters, $filterFactory, $repository);\n }" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
取得变量的存储文件名 @access private @param string $name 缓存变量名 @return string
[ "private function filename($name) {\n $name\t=\tmd5(C('DATA_CACHE_KEY').$name);\n if(C('DATA_CACHE_SUBDIR')) {\n // 使用子目录\n $dir ='';\n for($i=0;$i<C('DATA_PATH_LEVEL');$i++) {\n $dir\t.=\t$name{$i}.'/';\n }\n if(!is_dir($this->op...
[ "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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Gets a list of rows from the worksheet. @return array @throws Exception
[ "public function getRowsList()\n {\n //check whether workshett name is set or not\n if ($this->worksheetName == '')\n throw new Exception('Worksheet name not specified');\n $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() .\n '/worksheets/' . $this-...
[ "@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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Fetch all the data from this Data Source. If offset and / or limit are set, only those records will be returned. @return array The records @throws \Exception @throws InvalidArgumentException
[ "public function fetch()\n {\n static $currentLine = 0;\n $dataResult = array();\n\n if (isset($this->options['skipHeader']) && $this->options['skipHeader'] === true) {\n $skipLines = 1;\n } elseif (isset($this->options['skipHeader']) && \\is_numeric($this->options['skipHea...
[ "public static function all($params = null, $opts = null)\n {\n $msg = \"Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. \" .\n \"List those using \\$schedule->allRevisions('revision_id') instead.\";\n throw new Error\\InvalidRequest($msg, null);\n...
codesearchnet
{ "query": "Represent the post about Data retrieval:", "pos": "Represent the code about Data retrieval:", "neg": "Represent the code about PHP:" }
Get a decoder for the given charset.
[ "public static Decoder get(Charset charset) throws Exception {\n\t\tClass<? extends Decoder> cl = decoders.get(charset.name());\n\t\tif (cl == null) {\n\t\t\tCharsetDecoder decoder = charset.newDecoder();\n\t\t\tdecoder.onMalformedInput(CodingErrorAction.REPLACE);\n\t\t\tdecoder.onUnmappableCharacter(CodingErrorAct...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Print the message and then exit with the given exit code @param message The message to print @param exitCode The exit code
[ "public static void croak(final String message, final int exitCode) {\n System.err.println(message);\n System.exit(exitCode);\n }" ]
[ "def check_command(self, command):\n \n\n # Use `command` to see if command is callable, store exit code\n code = os.system(\"command -v {0} >/dev/null 2>&1 || {{ exit 1; }}\".format(command))\n\n # If exit code is not 0, report which command failed and return False, else return True\n ...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Detaches of the upload strategy with the specific priority. @param int $priority The priority @throws \RuntimeException If try to detach during invoking @return self
[ "public function detach($priority)\n {\n if ($this->started) {\n throw new RuntimeException('Unable during invoking.');\n }\n if (isset($this->queue[$priority])) {\n unset($this->queue[$priority]);\n $this->sortedQueue = null;\n }\n\n return $th...
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
plots lines and planes on a great circle with alpha 95 and mean deprecated (used in pmagplotlib)
[ "def plot_slnp(fignum, SiteRec, datablock, key):\n \n# make the stereonet\n plt.figure(num=fignum)\n plot_net(fignum)\n s = SiteRec['er_site_name']\n#\n# plot on the data\n#\n coord = SiteRec['site_tilt_correction']\n title = ''\n if coord == '-1':\n title = s + \": specimen coordinate...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
To be called when merging actions. Note: Practical for extended classes. @param array $a First action object to sort. @param array $b Second action object to sort. @return boolean Returns TRUE if $a has priority. Otherwise, FALSE for $b.
[ "protected function compareActions(array $a, array $b)\n {\n $a = isset($a['priority']) ? $a['priority'] : 0;\n $b = isset($b['priority']) ? $b['priority'] : 0;\n $c = isset($action['isSubmittable']) && $action['isSubmittable'];\n\n return ($c || ($a === 0) || ($a >= $b));\n }" ]
[ "public function containsValue($value): bool {\n\n /**\n * @var string $arrayIndex\n * @var SinglyLinkedList $list\n */\n foreach ($this->bucket as $arrayIndex => $list) {\n /* $list is the first element in the bucket. The bucket\n * can contain max $maxS...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Add networking aliases to a custom network @param config network config as configured in the pom.xml @return this configuration
[ "public ContainerNetworkingConfig aliases(NetworkConfig config) {\n JsonObject endPoints = new JsonObject();\n endPoints.add(\"Aliases\", JsonFactory.newJsonArray(config.getAliases()));\n\n JsonObject endpointConfigMap = new JsonObject();\n endpointConfigMap.add(config.getCustomNetwork()...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
Get the stream path @return string he URI/filename associated with this stream
[ "public function getPath()\n {\n if($this->getType() == 'memory') {\n $this->_path = parse_url($this->_path, PHP_URL_PATH);\n }\n\n if($this->getType() == 'temp')\n {\n if(!$this->getResource()) {\n $this->_path = $this->getTemporaryFile();\n ...
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// Converts byte slice of SETTINGS frame payload into http2.Setting slice.
[ "func ParseSettings(b []byte) []http2.Setting {\n\tvar r []http2.Setting\n\tfor i := 0; i < len(b)/6; i++ {\n\t\tr = append(r, http2.Setting{\n\t\t\tID: http2.SettingID(binary.BigEndian.Uint16(b[i*6:])),\n\t\t\tVal: binary.BigEndian.Uint32(b[i*6+2:]),\n\t\t})\n\t}\n\treturn r\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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Attaches a websocket server to the specified http server.
[ "function (server) {\n\n // Retrieve the configured handler.\n if (handler) {\n handler = require(require('path').resolve() + '/' + handler);\n } else {\n console.log('No handler defined for websocket server, not starting websocket.');\n return;\n }\n\n // Attach websoc...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Add phone element @param $name @param string $label @param array $attr @return \FrenchFrogs\Form\Element\Tel
[ "public function addTel($name, $label = '', $is_mandatory = true)\n {\n $e = new \\FrenchFrogs\\Form\\Element\\Tel($name, $label);\n $this->addElement($e);\n $e->addRule('laravel','laravel', ['regex:/^[+]{0,1}[0-9]{9,13}$/'],['regex' => 'Le champ doit être un numero valide . Il peut commence...
[ "protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
###### CHECKOUT ######
[ "function checkout (cb) {\n if (my.args.length !== 1) {\n return cb( erf( '\"checkout\" command requires single <bin> argument' ) )\n }\n var bin\n , found = false\n , chbin = my.args[0]\n\n for (bin in my.state.bins) {\n if (path.basename(bin) === path.basename(chbin)) {\n my.sta...
[ "protected function prepareResponseHeaders()\n {\n $this->getResponse(true)->headers->set('Content-Type', 'text/html');\n $this->getResponse()->setCharset('utf-8');\n\n\n // FIX FOR IE SESSION COOKIE\n // CAO IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\n //...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about PHP programming:" }
Checks if a value is empty.
[ "function isEmpty(value: mixed): boolean {\n if (Array.isArray(value)) {\n return value.length === 0;\n } else if (typeof value === 'object') {\n if (value) {\n invariant(\n !isIterable(value) || value.size === undefined,\n 'isEmpty() does not support iterable collections.',\n );\n ...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Remove Absolute (resample) xlabel = "Max fraction of features removed" ylabel = "1 - ROC AUC" transform = "one_minus" sort_order = 15
[ "def remove_absolute_resample__roc_auc(X, y, model_generator, method_name, num_fcounts=11):\n \n return __run_measure(measures.remove_resample, X, y, model_generator, method_name, 0, num_fcounts, sklearn.metrics.roc_auc_score)" ]
[ "def lgdistplot(self,dict_to_use,orientation):\n \"\"\"\"\"\"\n\n data = dict()\n for s_name in dict_to_use:\n try:\n data[s_name] = {int(d): int (dict_to_use[s_name][d]) for d in dict_to_use[s_name]}\n except KeyError:\n pass\n if len(...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Translate a text string based on our i18n files. @since 3.1
[ "public static String i18n(ResourceBundle messages, String key, Object... messageArguments) {\n MessageFormat formatter = new MessageFormat(\"\");\n formatter.applyPattern(messages.getString(key).replaceAll(\"'\", \"''\"));\n return formatter.format(messageArguments);\n }" ]
[ "public function Upgrade182to183()\n {\n $this->_batch->addTask('Db_CreateNewTables');\n $this->_batch->addTask('Db_AddPatches', 61);\n\n // Use AddTask task to execute after patches\n $this->_batch->addTask('AddTask', 'Echo', $this->_('Make sure to read the changelog as it contains i...
codesearchnet
{ "query": "Represent the Github description about Text translation:", "pos": "Represent the Github code about Text translation:", "neg": "Represent the Github code:" }
{@inheritdoc} @param string $context
[ "final public function resolveArguments(\n ContextFunction $reflection,\n array $parameters = [],\n string $context = null\n ): array {\n $arguments = [];\n foreach ($reflection->getParameters() as $parameter) {\n try {\n //Information we need to know ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization about writing:", "pos": "Represent the code about writing:", "neg": "Represent the code:" }
// NewLoggingMounter returns a MountUnmounter that logs mount events using the given logger func.
[ "func NewLoggingMounter(m Mounter, um Unmounter, logf func(string, ...interface{})) MountUnmounter {\n\treturn &loggingMounter{m, um, logf}\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:" }
The main entry point for the task
[ "public function main()\n {\n if (null === $this->getRepository()) {\n throw new BuildException('\"repository\" is required parameter');\n }\n\n $client = $this->getGitClient(false, $this->getRepository());\n $command = $client->getCommand('pull');\n $command\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:" }
// Add adds the selector string's matching nodes to those in the current // selection and returns a new Selection object. // The selector string is run in the context of the document of the current // Selection object.
[ "func (s *Selection) Add(selector string) *Selection {\n\treturn s.AddNodes(findWithMatcher([]*html.Node{s.document.rootNode}, compileMatcher(selector))...)\n}" ]
[ "function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
method to sanitize model parameters Parameters --------- None Returns ------- None
[ "def _validate_params(self):\n \n self.distribution = NormalDist(scale=self.scale)\n super(LinearGAM, self)._validate_params()" ]
[ "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 summarization about Software Engineering:", "pos": "Represent the code about Software Engineering:", "neg": "Represent the code about programming:" }
Commits the changes for all the items in the tree. :return <bool> | success
[ "def commit(self):\r\n \r\n remove_items = []\r\n commit_items = []\r\n \r\n # remove all the items\r\n commit_state = XOrbRecordItem.State.Modified | XOrbRecordItem.State.New\r\n remove_state = XOrbRecordItem.State.Removed\r\n for i in range(self.topLevelItem...
[ "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 programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// NewNetStore creates a new NetStore object using the given local store. newFetchFunc is a // constructor function that can create a fetch function for a specific chunk address.
[ "func NewNetStore(store SyncChunkStore, nnf NewNetFetcherFunc) (*NetStore, error) {\n\tfetchers, err := lru.New(defaultChunkRequestsCacheCapacity)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &NetStore{\n\t\tstore: store,\n\t\tfetchers: fetchers,\n\t\tNewNetFetcherFunc: nnf,\n\t\tclos...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github comment about AWS S3:", "pos": "Represent the Github code about AWS S3:", "neg": "Represent the Github code:" }
Use this API to create sslcertreq.
[ "public static base_response create(nitro_service client, sslcertreq resource) throws Exception {\n\t\tsslcertreq createresource = new sslcertreq();\n\t\tcreateresource.reqfile = resource.reqfile;\n\t\tcreateresource.keyfile = resource.keyfile;\n\t\tcreateresource.fipskeyname = resource.fipskeyname;\n\t\tcreatereso...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github sentence about htbridge.com:", "pos": "Represent the Github code about htbridge.com:", "neg": "Represent the Github code:" }
// SetPageToken sets the PageToken field's value.
[ "func (s *GetRelationalDatabaseSnapshotsInput) SetPageToken(v string) *GetRelationalDatabaseSnapshotsInput {\n\ts.PageToken = &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:" }
Parse the entity XML. @param Callable[] $callbacks Hooks for pre- and postprocessing of elements @param LocatorInterface $locator The XML description file locator @return Element
[ "public function parse($callbacks, LocatorInterface $locator)\n {\n $data = null;\n\n while ($this->read()) {\n if ($this->nodeType == \\XMLReader::ELEMENT) {\n $child = $this->parseElement($this->name, $callbacks, $locator);\n $data = $child;\n ...
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //...
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software Development:" }
Ending the install process. @param string $message End message
[ "public function end($message)\n {\n $this->info($message);\n\n if ($this->progressBar instanceof ProgressBar) {\n $this->progressBar->setMessage($message);\n $this->progressBar->finish();\n }\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 Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Applies the whitespace removal rules used in HTML. @param src source string @return a new string with additional whitespaces removed
[ "private String collapseWhitespaces(String src)\n {\n StringBuffer ret = new StringBuffer();\n boolean inws = false;\n for (int i = 0; i < src.length(); i++)\n {\n char ch = src.charAt(i);\n if (collapsews && isWhitespace(ch))\n {\n if (...
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// NewDockerCgroupNetController returns a handle to call functions on the cgroup net_cls controller
[ "func NewDockerCgroupNetController() Cgroupnetcls {\n\n\tcontroller := &netCls{\n\t\tmarkchan: make(chan uint64),\n\t\tReleaseAgentPath: \"\",\n\t\tTriremePath: \"\",\n\t}\n\n\treturn controller\n}" ]
[ "func (plugin *flexVolumePlugin) Init(host volume.VolumeHost) error {\n\tplugin.host = host\n\t// Hardwired 'success' as any errors from calling init() will be caught by NewFlexVolumePlugin()\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Synchronous call to NT procedure run(..) method. Wraps coreCall with statistics. @return True if done and null if there is an async task still running.
[ "protected boolean call(Object... paramListIn) {\n m_perCallStats = m_statsCollector.beginProcedure();\n\n // if we're keeping track, calculate parameter size\n if (m_perCallStats.samplingProcedure()) {\n ParameterSet params = ParameterSet.fromArrayNoCopy(paramListIn);\n m...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Formats an amount in html, adding classes given the status. @param float $amount @param int $status One of the Status_... constants. @return string An html string representing the amount and its status.
[ "private function getFormattedAmount($amount, $status)\n {\n $currency = '€';\n $sign = $amount < 0.0 ? '-' : '';\n /** @noinspection CallableParameterUseCaseInTypeContextInspection */\n $amount = abs($amount);\n $statusClass = $this->getStatusClass($status);\n $statusMe...
[ "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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// NewPostBookmark handles the request and creates a new bookmark for the post
[ "func NewPostBookmark() echo.HandlerFunc {\n\n\t// swagger:route POST /users/{id}/posts/{pid}/bookmarks users post vote NewUserPostBookmark\n\t//\n\t// Adds a new bookmark on the current post\n\t//\n\t//\tProduces:\n\t//\t- application/json\n\t//\n\t//\tSecurity:\n\t//\t\toauth: profile_messages:write\n\t//\n\t//\t...
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi...
codesearchnet
{ "query": "Represent the Github summarization about Web development:", "pos": "Represent the Github code about Web development:", "neg": "Represent the Github code about programming:" }
Request to start a shell on the given channel
[ "def check_channel_shell_request(self, channel):\n ''''''\n try:\n self.channels[channel].start()\n except KeyError:\n log.error('Requested to start a channel (%r) that was not previously set up.', channel)\n return False\n else:\n return True"...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// UseKV returns Option that sets KvPlugin dependency.
[ "func UseKV(kv keyval.KvProtoPlugin) Option {\n\treturn func(p *Plugin) {\n\t\tp.KvPlugin = kv\n\t}\n}" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Gets source parameter. @param request the request @param paramNames the param names @return the source parameter
[ "protected static String getSourceParameter(final HttpServletRequest request, final String... paramNames) {\n if (request != null) {\n val parameterMap = request.getParameterMap();\n return Stream.of(paramNames)\n .filter(p -> parameterMap.containsKey(p) || request.getAtt...
[ "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 description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
List the forwarding addresses for a certain api key (and on a specific blockchain)
[ "def list_forwarding_addresses(api_key, offset=None, coin_symbol='btc'):\n '''\n \n '''\n\n assert is_valid_coin_symbol(coin_symbol)\n assert api_key\n\n url = make_url(coin_symbol, 'payments')\n\n params = {'token': api_key}\n\n if offset:\n params['start'] = offset\n\n r = reques...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Technology:" }
Replies the preferred size of the roazd borders (in pixels). @param useSystemValue indicates if the <code>null</code> value must be replaced by the default system value: {@link #DEFAULT_BORDER_SIZE}. @return size of the road borders.
[ "@Pure\n\tpublic static Integer getPreferredRoadBorderSize(boolean useSystemValue) {\n\t\tfinal Preferences prefs = Preferences.userNodeForPackage(RoadNetworkLayerConstants.class);\n\t\tif (prefs != null) {\n\t\t\tfinal int size = prefs.getInt(\"ROAD_BORDER_SIZE\", -1); //$NON-NLS-1$\n\t\t\tif (size >= 0) {\n\t\t\t...
[ "public String getHeader()\n {\n if (this.header == null)\n {\n if (this.headerKeys == null)\n {\n this.headerKeys = new String[2];\n this.headerKeys[0] = getPropertyName() + \".header\";\n this.headerKeys[1] = getPropertyName();\n ...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
找到单个Channel,用于编辑Channel信息界面加载信息 @param channelId @param context @throws WebxException
[ "public void execute(@Param(\"clusterId\") Long clusterId, Context context, Navigator nav) throws Exception {\n AutoKeeperCluster autoKeeperCluster = autoKeeperClusterService.findAutoKeeperClusterById(clusterId);\n\n context.put(\"autoKeeperCluster\", autoKeeperCluster);\n }" ]
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
// SetPreSignedUrl sets the PreSignedUrl field's value.
[ "func (s *UserImportJobType) SetPreSignedUrl(v string) *UserImportJobType {\n\ts.PreSignedUrl = &v\n\treturn s\n}" ]
[ "@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
Our own version of wd's waitForElement. wd's version of waitFor* has the unfortunate habit of generating really unhelpful error messages. eslint-disable-next-line no-underscore-dangle
[ "function _waitForElement(browser, selector, asserter, timeout, pollFreq) {\n /* eslint no-use-before-define:0 */\n timeout = timeout || 2000;\n pollFreq = pollFreq || 50;\n\n const endTime = Date.now() + timeout;\n\n function attempt() {\n const element = browser.elementByCssSelectorOrNull(selector);\n ...
[ "function run(booleanOrString, anyDataType, functionOrObject, aNumber, anArray) {\n /*\n * if expectations aren't met, args checker will throw appropriate exceptions\n * notifying the user regarding the errors of the arguments.\n * */\n \targs.expect(arguments, ['boolean|string', '*',...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// serialize returns the data that should be written to disk for the // provided Conf, rendered in the systemd unit file format.
[ "func serialize(name string, conf common.Conf, renderer shell.Renderer) ([]byte, error) {\n\tif err := validate(name, conf, renderer); err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\n\tvar unitOptions []*unit.UnitOption\n\tunitOptions = append(unitOptions, serializeUnit(conf)...)\n\tunitOptions = append(uni...
[ "@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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetIndexDocument sets the IndexDocument field's value.
[ "func (s *GetBucketWebsiteOutput) SetIndexDocument(v *IndexDocument) *GetBucketWebsiteOutput {\n\ts.IndexDocument = 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:" }
// NewSchemaLoader creates a new NewSchemaLoader
[ "func NewSchemaLoader() *SchemaLoader {\n\n\tps := &SchemaLoader{\n\t\tpool: &schemaPool{\n\t\t\tschemaPoolDocuments: make(map[string]*schemaPoolDocument),\n\t\t},\n\t\tAutoDetect: true,\n\t\tValidate: false,\n\t\tDraft: Hybrid,\n\t}\n\tps.pool.autoDetect = &ps.AutoDetect\n\n\treturn ps\n}" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
// Handle executing the request and returning a response
[ "func (fn FindPetsByStatusHandlerFunc) Handle(params FindPetsByStatusParams, principal interface{}) middleware.Responder {\n\treturn fn(params, principal)\n}" ]
[ "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 Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// RemoveNamed adds SET column=column-? clauses to the query with a custom // parameter name.
[ "func (b *UpdateBuilder) RemoveNamed(column, name string) *UpdateBuilder {\n\treturn b.removeValue(column, param(name))\n}" ]
[ "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 post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
TODO: This method needs a leader session ID
[ "@Override\n\tpublic void declineCheckpoint(DeclineCheckpoint decline) {\n\t\tfinal CheckpointCoordinator checkpointCoordinator = executionGraph.getCheckpointCoordinator();\n\n\t\tif (checkpointCoordinator != null) {\n\t\t\tgetRpcService().execute(() -> {\n\t\t\t\ttry {\n\t\t\t\t\tcheckpointCoordinator.receiveDecli...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Set the target currencies. @param array|string $currencies @return self
[ "public function target($currencies)\n {\n if (!is_array($currencies)) {\n $currencies = [$currencies];\n }\n\n $this->targets = $currencies;\n\n return $this;\n }" ]
[ "func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Parses the layout ID annotation form the itemViewHolderClass
[ "public static Integer parseItemLayoutId(Class<? extends ItemViewHolder> itemViewHolderClass) {\n Integer itemLayoutId = ClassAnnotationParser.getLayoutId(itemViewHolderClass);\n if (itemLayoutId == null) {\n throw new LayoutIdMissingException();\n }\n return itemLayoutId;\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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Redacts the message with specified event_id for the given reason. See https://matrix.org/docs/spec/r0.0.1/client_server.html#id112
[ "def redact_message(self, event_id, reason=None):\n \n return self.client.api.redact_event(self.room_id, event_id, reason)" ]
[ "async def text(self, *, encoding: Optional[str]=None) -> str:\n \"\"\"\"\"\"\n data = await self.read(decode=True)\n # see https://www.w3.org/TR/html5/forms.html#multipart/form-data-encoding-algorithm # NOQA\n # and https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttpreques...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Match empty statement if: - Parent statement is an if - The then part of the parent if is an empty statement, and - The else part of the parent if does not exist
[ "@Override\n public Description matchEmptyStatement(EmptyStatementTree tree, VisitorState state) {\n boolean matches = false;\n Tree parent = state.getPath().getParentPath().getLeaf();\n if (parent.getKind() == IF) {\n IfTree parentAsIf = (IfTree) parent;\n matches =\n (parentAsIf.getTh...
[ "function skip1(previousExpr) {\n \n \n if( previousExpr == always ) {\n /* If there is no previous expression this consume command \n is at the start of the jsonPath.\n Since JSONPath specifies what we'd like to find but not \n necessarily everything leading down t...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
When used adapter with IMMUTABLE data, returns columns position modifications (old position -> new position) @return row position modification map. Includes only modified column numbers
[ "@SuppressWarnings(\"unchecked\")\n public Map<Integer, Integer> getLinkedAdapterColumnsModifications() {\n return mAdapter instanceof LinkedAdaptiveTableAdapterImpl ?\n ((LinkedAdaptiveTableAdapterImpl) mAdapter).getColumnsModifications() :\n Collections.<Integer, Integer>em...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Subscriber returns the subscriber.
[ "func (t *peerThunk) Subscriber() peer.Subscriber {\n\tt.lock.RLock()\n\ts := t.subscriber\n\tt.lock.RUnlock()\n\treturn s\n}" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github description about Messaging:", "pos": "Represent the Github code about Messaging:", "neg": "Represent the Github code about Programming:" }
// String returns the string representation
[ "func (mp MultiPoint) String() string {\n\tvar result string\n\tif bytes, err := json.Marshal(mp); err == nil {\n\t\tresult = string(bytes)\n\t} else {\n\t\tresult = err.Error()\n\t}\n\treturn result\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 sentence about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
----------------------- <state> maximum-prefix <limit> <threshold> <opt> <threshold> : optional <opt> : optional = [ restart <interval> | warning-only ]
[ "def max_prefix_get\n str = config_get('bgp_neighbor_af', 'max_prefix', @get_args)\n return nil if str.nil?\n\n regexp = Regexp.new('maximum-prefix (?<limit>\\d+)' \\\n ' *(?<threshold>\\d+)?' \\\n ' *(?<opt>restart|warning-only)?' \\\n ...
[ "def BIF_templates(self):\n \n network_template = Template('network $name {\\n}\\n')\n # property tag may or may not be present in model,and since no of properties\n # can be more than one , will replace them accoriding to format otherwise null\n variable_template = Template(\"\"\...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Creates a local temporary directory. The directory is removed when no longer needed. Failure to do so will be ignored. :return: Path to the temporary directory. :rtype: unicode
[ "def local_temp_dir():\n \n path = tempfile.mkdtemp()\n yield path\n shutil.rmtree(path, ignore_errors=True)" ]
[ "def _is_path(instance, attribute, s, exists=True):\n \"\"\n if not s:\n # allow False as a default\n return\n if exists:\n if os.path.exists(s):\n return\n else:\n raise OSError(\"path does not exist\")\n else:\n # how do we tell if it's a path i...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Get URL for an image in the media library @param string $path @param string $size (size keys that you've passed to add_image_size) @return string Relative URL
[ "public static function media($path, $size) {\n // Which image size was requested?\n global $_wp_additional_image_sizes;\n $image_size = $_wp_additional_image_sizes[$size];\n \n // Get the path info\n $pathinfo = pathinfo($path);\n $fname = $pathinfo['basename'];\n $fext = $pathinfo['extensi...
[ "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 summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
// SimpleFSListFavorites lists the favorite, new, // and ignored folders of the logged in user, // getting its data from the KBFS Favorites cache. If the cache is stale, // this will trigger a network request.
[ "func (k *SimpleFS) SimpleFSListFavorites(ctx context.Context) (\n\tkeybase1.FavoritesResult, error) {\n\treturn k.config.KBFSOps().GetFavoritesAll(ctx)\n}" ]
[ "function databaseInitialize() {\n var entries = db.getCollection(\"entries\");\n var messages = db.getCollection(\"messages\");\n\n // Since our LokiFsStructuredAdapter is partitioned, the default 'quickstart3.db'\n // file will actually contain only the loki database shell and each of the collections\n // wi...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Deactivates/unregisters all recipes of the current plugin, if this plugin gets deactivated.
[ "def __deactivate_recipes(self, plugin, *args, **kwargs):\n \n recipes = self.get()\n for recipe in recipes.keys():\n self.unregister(recipe)" ]
[ "def _post_deactivate_injection(self):\n \n # Lets be sure that active is really set to false.\n self.active = False\n self.app.signals.send(\"plugin_deactivate_post\", self)\n # After all receivers are handled. We start to clean up signals and receivers of this plugin\n # ...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// SetOfferingId sets the OfferingId field's value.
[ "func (s *DescribeOfferingOutput) SetOfferingId(v string) *DescribeOfferingOutput {\n\ts.OfferingId = &v\n\treturn s\n}" ]
[ "@NotNull\n @ApiModelProperty(required = true, value = \"Key-value pairs to add as custom property into alert. You can refer here for example values\")\n public Map<String, String> getDetails() {\n return details;\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// GetWebhookOfRepoByID returns webhook of repository by given ID.
[ "func GetWebhookOfRepoByID(repoID, id int64) (*Webhook, error) {\n\treturn getWebhook(&Webhook{\n\t\tID: id,\n\t\tRepoID: repoID,\n\t})\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 post:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Add severities to @output @since 0.1.5 @param data [Hash]
[ "def evaluate_severities(data)\n @output[:lint_warnings] = []\n @output[:lint_errors] = []\n @output[:lint_conventions] = []\n @output[:lint_refactors] = []\n @output[:lint_fatals] = []\n\n return if data.blank?\n\n data.each do |filename, error_list|\n erro...
[ "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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
@!visibility public Assign a hash of values to the matching instance variables. @param [Hash] attributes to assign. @return [self]
[ "def assign_attributes( attributes )\n attributes = resolve_attributes( attributes )\n\n self.class.attributes.each do |key, options|\n as = options[ :as ] # Alias support\n next unless attributes.key?( key ) || ( as && attributes.key?( as ) )\n value = attributes[ key ]\n ...
[ "def attributes_properties(**options)\n options_set = Set.new options.keys.map(&:to_s)\n\n unless options_set.subset? Set.new(@fields)\n fail \"You have to provide correct attribute names in\" +\n \"'attributes_properties' for '#{@model}'.\"\n end\n\n # TODO: Check for valid v...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// SetStatusCodes sets the StatusCodes field's value.
[ "func (s *EntityFilter) SetStatusCodes(v []*string) *EntityFilter {\n\ts.StatusCodes = 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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Returns an array of DQL references ready for filtering, handling nested entities through joins @param FilterInterface $filter @param DoctrineQueryHandlerInterface $queryHandler @return array
[ "public function getFullAttributeReferences(\n FilterInterface $filter,\n DoctrineQueryHandlerInterface $queryHandler\n ): array {\n $references = [];\n foreach ($filter->getAttributes() as $attributePath) {\n $references[] = $queryHandler->resolveAttributeAlias($attributeP...
[ "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 summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Saves CAPTCHA audio to the configured database @param string $data Audio data @return boolean true on success, false on failure
[ "protected function saveAudioToDatabase($data)\n {\n $success = false;\n $this->openDatabase();\n\n if ($this->use_database && $this->pdo_conn) {\n $id = $this->getCaptchaId(false);\n $ip = $_SERVER['REMOTE_ADDR'];\n $ns = $this->namespace;\n\n if ...
[ "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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// SetNames sets the Names field's value.
[ "func (s *DescribeFleetsInput) SetNames(v []*string) *DescribeFleetsInput {\n\ts.Names = v\n\treturn s\n}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Gets a duplicate of this <CODE>PdfTemplate</CODE>. All the members are copied by reference but the buffer stays different. @return a copy of this <CODE>PdfTemplate</CODE>
[ "public PdfContentByte getDuplicate() {\n PdfTemplate tpl = new PdfTemplate();\n tpl.writer = writer;\n tpl.pdf = pdf;\n tpl.thisReference = thisReference;\n tpl.pageResources = pageResources;\n tpl.bBox = new Rectangle(bBox);\n tpl.group = group;\n tpl.layer ...
[ "public void setValue(Object value) {\n\n if(LOGGER.isInfoEnabled() && !(value instanceof java.io.Serializable))\n LOGGER.info(\"Warning: setting a filter value tiat is not serializable. The Filter object is serializable and should contain only serializable state\");\n\n _value = value;\n ...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
:type lex_input_event: LexInputEvent :return: None
[ "def update_slots(self, event):\n \n if isinstance(event, LexInputEvent):\n event_slots = event.currentIntent.slots\n elif isinstance(event, basestring) or isinstance(event, unicode) or isinstance(event, str):\n event_slots = deepcopy(json.loads(event)['currentIntent']['sl...
[ "def t_ATOM(self, t):\n '\n t.type = PLLexer.reserved.get(t.value, 'ATOM') # Check for reserved words\n return t" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Regular expressions:" }
Add in the Content-Type header if necessary. @param array $headers The headers to update @param \Cake\Http\Response $response The CakePHP response to convert @return array The updated headers.
[ "protected static function setContentType($headers, $response)\n {\n if (isset($headers['Content-Type'])) {\n return $headers;\n }\n if (in_array($response->statusCode(), [204, 304])) {\n return $headers;\n }\n\n $whitelist = [\n 'application/ja...
[ "private function issueResponse(Request $request, \\Exception $exception = null)\n {\n $responder = null;\n if ($exception === null) {\n // No exception, just return a normal responder.\n $responder = ResponderFactory::getResponder($request);\n } else {\n // ...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Adds a language to the list of supported languages @Action @Logged @param string $language
[ "public function addSupportedLanguage($language, $name = \"defaultTranslationService\", $selfedit=\"false\") {\n\t\t$this->addTranslationLanguageFromService(($selfedit == \"true\"), $name, $language);\n\t\t\n\t\t// Once more to reaload languages list\n\t\t$this->supportedLanguages($name, $selfedit);\n\t}" ]
[ "public List<Audit> getAllNotifications(JPAEntity entity) {\n\t\treturn _auditService.findByEntityHostnameMessage(entity.getId(), null, \"Triggering event value:\");\n\t}" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Documentation:" }
委托代扣-扣款 @param pappayapply pappayapply @param key key @return PappayapplyResult
[ "public static PappayapplyResult payPappayapply(Pappayapply pappayapply,String key){\n\t\tMap<String,String> map = MapUtil.objectToMap( pappayapply);\n\t\tString sign = SignatureUtil.generateSign(map,pappayapply.getSign_type(),key);\n\t\tpappayapply.setSign(sign);\n\t\tString secapiPayRefundXML = XMLConverUtil.conv...
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// Open opens a websocket to the API's /logstream endpoint and returns // a stream of log records from that connection.
[ "func Open(conn base.StreamConnector, cfg params.LogStreamConfig, controllerUUID string) (*LogStream, error) {\n\twsStream, err := stream.Open(conn, \"/logstream\", &cfg)\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tls := &LogStream{\n\t\tstream: wsStream,\n\t\tcontrollerUUID: controllerUUI...
[ "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 description about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
// GetDisk return: disk provisionState, diskID, error
[ "func (c *ManagedDiskController) GetDisk(resourceGroup, diskName string) (string, string, error) {\n\tctx, cancel := getContextWithCancel()\n\tdefer cancel()\n\n\tresult, err := c.common.cloud.DisksClient.Get(ctx, resourceGroup, diskName)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tif result.DiskProper...
[ "func (e *environ) AdoptResources(ctx context.ProviderCallContext, controllerUUID string, fromVersion version.Number) error {\n\t// This provider doesn't track instance -> controller.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Writes flow results for a given flow.
[ "def WriteFlowResults(self, results, cursor=None):\n \"\"\"\"\"\"\n query = (\"INSERT INTO flow_results \"\n \"(client_id, flow_id, hunt_id, timestamp, payload, type, tag) \"\n \"VALUES \")\n templates = []\n\n args = []\n for r in results:\n templates.append(\"(%s, %s, %...
[ "@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 comment about writing:", "pos": "Represent the code about writing:", "neg": "Represent the code:" }
@param string $format @return mixed
[ "public function getDocs($format = 'array')\n {\n if ($format == 'json') {\n $filler = [];\n foreach ($this->docs as $doc) {\n $filler[] = $doc->toArray();\n }\n\n return json_encode($filler, true);\n }\n\n return $this->docs;\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 instruction about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about programming:" }
Create task and add to our collection of pending tasks.
[ "def create_task(self, target: Callable[..., Any], *args: Any)\\\n -> asyncio.tasks.Task:\n \"\"\"\"\"\"\n if asyncio.iscoroutine(target):\n task = self._loop.create_task(target)\n elif asyncio.iscoroutinefunction(target):\n task = self._loop.create_task(target(...
[ "public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A...
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Builds templating, currently only twig @param ContainerInterface $container
[ "protected function buildTemplating($container)\n\t{\n\t\t$container['templating.global'] = function () {\n\t\t\treturn new SupraGlobal();\n\t\t};\n\n\t\t$container['templating.templating'] = function () use ($container) {\n\t\t\t$templating = new TwigTemplating();\n\t\t\t$templating->addGlobal('supra', $container[...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
To image buffered image. @param component the component @return the buffered image
[ "public static BufferedImage toImage(@javax.annotation.Nonnull final Component component) {\n try {\n com.simiacryptus.util.Util.layout(component);\n @javax.annotation.Nonnull final BufferedImage img = new BufferedImage(component.getWidth(), component.getHeight(), BufferedImage.TYPE_INT_ARGB_PRE);\n ...
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
@param array $context @param string $name @param array $options @return string
[ "public function renderMenu($context, $name, array $options = [])\n {\n $options = $this->resolver->resolve($options);\n\n $edit = $this->request && $this->request->attributes->get('integrated_menu_edit');\n $menu = $this->provider->get($name);\n\n $html = '';\n\n if ($edit) {\...
[ "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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Workaround AD special cases with the unicodePwd attribute... @link https://support.microsoft.com/en-us/kb/263991 @param AddOperation $operation
[ "protected function unicodePwdHack(AddOperation $operation)\n {\n if (!$this->isUnicodePwdHackNeeded()) {\n return;\n }\n $attributes = $operation->getAttributes();\n\n foreach ($attributes as $attribute => $value) {\n if (strtolower($attribute) !== 'unicodepwd')...
[ "def Delete(self):\n\t\t\n\t\tr = clc.v2.API.Call('DELETE','antiAffinityPolicies/%s/%s' % (self.alias,self.id),{},session=self.session)" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Helper to return a collection of errors for the given job
[ "def collection_for_job(cls, job):\n \n return cls.collection(job_model_repr=job.get_model_repr(), identifier=getattr(job, '_cached_identifier', job.identifier.hget()))" ]
[ "@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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Takes any arguments like a model and crud, or just one of those, in any order, and return a model and crud.
[ "def extract_args(cls, *args):\n \n model = None\n crudbuilder = None\n\n for arg in args:\n if issubclass(arg, models.Model):\n model = arg\n else:\n crudbuilder = arg\n\n return [model, crudbuilder]" ]
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Aquire a file lock in a thread-safe manner that also reaps stale locks possibly left behind by processes that crashed hard.
[ "def lock(path, poll_interval=5, max_age=60):\n \n if max_age < 30:\n raise ValueError(\"`max_age` must be at least 30 seconds\")\n if poll_interval < 1:\n raise ValueError(\"`poll_interval` must be at least 1 second\")\n if poll_interval >= max_age:\n raise ValueError(\"`poll_inter...
[ "def process_request_thread(self, request, client_address):\n \"\"\"\"\"\"\n # Instantiate the request handler.\n handler = self.RequestHandlerClass(request, client_address, self)\n try:\n # Attempt to handle a request with the handler.\n handler.handle_request()\n self.request_complete_c...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// validate check if the caller has set the right fields.
[ "func (s HorizontalPodAutoscalerGeneratorV1) validate() error {\n\tif len(s.Name) == 0 {\n\t\treturn fmt.Errorf(\"name must be specified\")\n\t}\n\tif s.MaxReplicas < 1 {\n\t\treturn fmt.Errorf(\"'max' is a required parameter and must be at least 1\")\n\t}\n\tif s.MinReplicas > s.MaxReplicas {\n\t\treturn fmt.Error...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
capture A's value if B's value is null or undefined, otherwise use B's value
[ "function resolveBindingValue(oldValue, value) {\n if (value === undefined && oldValue === null) {\n return value;\n }\n return (value === null || value === undefined) ? oldValue : value;\n }" ]
[ "def reify_from_row(row)\n #the tap method allows preconfigured methods and values to\n #be associated with the instance during instantiation while also automatically returning\n #the object after its creation is concluded.\n self.new.tap do |card|\n self.attributes.keys.each.with_index d...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetLabelAttributeName sets the LabelAttributeName field's value.
[ "func (s *DescribeLabelingJobOutput) SetLabelAttributeName(v string) *DescribeLabelingJobOutput {\n\ts.LabelAttributeName = &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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// PopInt returns a value from the list, it panics if not enough values // were allocated
[ "func (p *PortList) PopInt() int {\n\ti, err := strconv.Atoi(p.Pop())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\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:" }