query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
{{{ public function display() | [
"public function display()\n {\n $options = $this->getOptions();\n\n if (!$this->visible || $options === null) {\n return;\n }\n\n SwatWidget::display();\n\n // add a hidden field so we can check if this list was submitted on\n // the process step\n $th... | [
"@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 Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
respond with proxied result (fires at the end of all middleware execution) | [
"function respond (next) {\n return function sendResult (error, proxyObj) {\n if (error) { return next(error); }\n\n // TESTING HELPER ONLY\n if (proxyObj.options.shortCircuit) {\n return proxyObj.res.send({\n result: 'proxy-express set to short circuit. If this is not expected, please check y... | [
"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 about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Write an element with the given name, content and attributes. If
there is no content and no block is given, a self-closing element is
created. Provide an empty string as content to create an empty,
non-self-closing element. | [
"def element!(name, content = nil, attributes = nil)\n build! do\n if content or block_given?\n @_crafted << \"<#{name}#{Tools.format_attributes(attributes)}>\"\n if block_given?\n value = yield\n content = value if !@_appended or value.kind_of? String\n ... | [
"function pushTextNode(list, html, level, start, ignoreWhitespace) {\n // calculate correct end of the content slice in case there's\n // no tag after the text node.\n var end = html.indexOf('<', start);\n var content = html.slice(start, end === -1 ? undefined : end); // if a node is nothing but whitesp... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Returns a partial of get_json_val that only needs a source argument. | [
"def json_val(path, *, ignore_bad_path=False):\n \"\"\"\"\"\"\n return lambda source: get_json_val(source, path, ignore_bad_path=ignore_bad_path)"
] | [
"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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Rolls dice in dice notation with advanced syntax used according to tinyurl.com/pydice
:param roll: Roll in dice notation
:return: Result of roll, and an explanation string | [
"def roll_dice(roll, *, functions=True, floats=True):\n \n roll = ''.join(roll.split())\n roll = regex.sub(r'(?<=d)%', '100', roll, regex.IGNORECASE)\n roll = roll.replace('^', '**')\n roll = zero_width_split(r'((?<=[\\(\\),%^\\/+*-])(?=.))|((?<=.)(?=[\\(\\),%^\\/+*-]))', roll) # Split the string on... | [
"def fix_config(self, options):\n \n options = super(Trigger, self).fix_config(options)\n\n opt = \"condition\"\n if opt not in options:\n options[opt] = \"True\"\n if opt not in self.help:\n self.help[opt] = \"The (optional) condition for teeing off the toke... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Write a cached version of the file
@param string $content view content to write to a cache file.
@param int|string $duration Duration to set for cache file.
@return bool Success of caching view. | [
"protected function _writeFile($content, $duration) {\n\t\t//$cacheTime = date('Y-m-d H:i:s', $timestamp);\n\t\t$now = time();\n\t\tif (!$duration) {\n\t\t\t$cacheTime = 0;\n\t\t} elseif (is_numeric($duration)) {\n\t\t\t$cacheTime = $now + $duration;\n\t\t} else {\n\t\t\t$cacheTime = strtotime($duration, $now);\n\t... | [
"static function removeExpiryCacheFromDisk( $expiryCachePath )\n {\n $fileHandler = eZClusterFileHandler::instance();\n if ( $fileHandler instanceof eZFSFileHandler )\n {\n // We will only delete files if the FS file handler is used,\n // if the DB file handler is in us... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Configures.
@param array $configuration The configuration for commands
@author Benjamin Carl <opensource@clickalicious.de>
@return $this Instance for chaining. | [
"protected function configure(array $configuration)\n {\n // Force colors\n \\cli\\Colors::enable();\n\n foreach ($configuration as $key => $values) {\n if ($values['type'] === 'short') {\n $this->getFlags()->{$values['type']}($key, $values['info']);\n } ... | [
"public function createContainer()\n {\n # Create the container\n $container = new Container;\n\n # If we have auto-wire option on ...\n if (($this->options['autowire'] ?? false)) {\n # Add reflection delegate, so auto-wiring is possible\n $container->delegate( new ReflectionContainer );\n ... | codesearchnet | {
"query": "Represent the description about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
........................................................................ | [
"function get_spanned_cells($frame) {\n $key = $frame->get_id();\n\n if ( !isset($this->_frames[$key]) ) {\n throw new DOMPDF_Exception(\"Frame not found in cellmap\");\n }\n\n return $this->_frames[$key];\n\n }"
] | [
"def annoy():\n\t\"\"\n\tdef a1():\n\t\tyield 'OOOOOOOHHH, WHAT DO YOU DO WITH A DRUNKEN SAILOR'\n\t\tyield 'WHAT DO YOU DO WITH A DRUNKEN SAILOR'\n\t\tyield \"WHAT DO YOU DO WITH A DRUNKEN SAILOR, EARLY IN THE MORNIN'?\"\n\n\tdef a2():\n\t\tyield \"I'M HENRY THE EIGHTH I AM\"\n\t\tyield \"HENRY THE EIGHTH I AM I A... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Sends a debug info to the handler
@param string $query
@param float $duration
@param mixed $info | [
"protected function debugLog($query, $duration, $info)\n {\n if ($this->debugCallback) {\n call_user_func($this->debugCallback, $query, $duration, $info);\n }\n }"
] | [
"public function onSniff(GenericEvent $event)\n {\n $context = $event->getArguments();\n\n $this->logger->debug('Visiting SNIFF, process {method} {sniff}', $context);\n }"
] | codesearchnet | {
"query": "Represent the instruction about PHP programming:",
"pos": "Represent the code about PHP programming:",
"neg": "Represent the code about programming:"
} |
// SetOperatingSystemVersion sets the OperatingSystemVersion field's value. | [
"func (s *PlatformSummary) SetOperatingSystemVersion(v string) *PlatformSummary {\n\ts.OperatingSystemVersion = &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 Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Update the cluster with id/label `cluster_id_label` using information provided in
`cluster_info`. | [
"def update(cls, cluster_id_label, cluster_info):\n \n conn = Qubole.agent(version=\"v2\")\n return conn.put(cls.element_path(cluster_id_label), data=cluster_info)"
] | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Meta parser that will try all known parser and it will bring the first found id
:param list[Callable] parsers: A list of callable parsers to try to extract request_id
:return: The request id if it is found or None
:rtype: str|None | [
"def auto_parser(parsers=(x_request_id, x_correlation_id, amazon_elb_trace_id)):\n \n\n for parser in parsers:\n request_id = parser()\n if request_id is not None:\n return request_id\n\n return None"
] | [
"def coerce_one(schema=str):\n \n def validate(val):\n \"\"\"Unpack a single item from the inputs sequence and run validation.\n\n NOTE(larsbutler): This code is highly opinionated for bottle, since\n bottle query params are wrapped in a list, even if there is just a\n single value... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
MqttClient的主要配置来至于MqttConnectOptions | [
"@IocBean(name = \"mqttConnectOptions\")\n public MqttConnectOptions createMqttConnectOptions() {\n MqttConnectOptions options = new MqttConnectOptions();\n options.setAutomaticReconnect(conf.getBoolean(PROP_OPTIONS_AUTOMATIC_RECONNECT, true));\n options.setKeepAliveInterval(conf.getInt(PROP... | [
"public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get the `base64` encoded image content
@param bool $to_href Set to `true` to get a full result to use in `img` tag
@return string | [
"public function getBase64Content($to_href = false)\n {\n if ($this->exists() && $this->isImage()) {\n $image_infos = $this->getImageInfos();\n $base64 = '';\n if ($to_href) {\n $type = pathinfo($this->getRealPath(), PATHINFO_EXTENSION);\n $ba... | [
"protected function getSnippetArrayFor($template, array $vars, $emailLocale)\n {\n // add a code snippet to reference the random image you added in the getParamArrayFor() method.\n // in the mean time it has been base64-encoded and attached as mime-part to your email.\n $vars['sampleSnippetW... | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Parse the string representation of an exception to a {@link ExceptionInfo} instance. | [
"static ExceptionInfo processStackTrace(StackTrace exception) {\n if (exception == null) {\n return null;\n }\n // Escape any special HTML characters in the exception that would otherwise break the HTML\n // rendering (e.g. the angle brackets around the default toString() for enums).\n String me... | [
"@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 text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Helper: turn: : {'string1': ['foo'], 'string2': ['foo', 'bar', 'foo'],} Into: : "string1 (foo)<br />string2 (foo, bar)" | [
"function sfuse(hash){\n\tvar retval = '';\n\n\tvar cache = [];\n\tus.each(hash, function(loc_list, str){\n\t var locs = dedupe(loc_list);\n\t cache.push( str + ' <small>[' + locs.join(', ') + ']</small>');\n\t});\n\tif( cache.length > 0 ){\n\t retval = cache.join('<br />');\t \n\t}\n\t\n\treturn retval... | [
"def from_template(cls, template):\n \n regex = r'#{\\s*%s\\s*}' % cls.ALLOWED_KEY\n keys = re.findall(regex, template)\n if len(keys) == 0:\n raise cls.Bad(\"Bad keys template: %s. Should be: \\\"%s\\\"\" % (\n template, \"a = #{key1}, b = #{key2.key3} ...\"))\... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Load a set of facts into the CLIPS data base.
The C equivalent of the CLIPS load-facts command.
Facts can be loaded from a string or from a text file. | [
"def load_facts(self, facts):\n \n facts = facts.encode()\n\n if os.path.exists(facts):\n ret = lib.EnvLoadFacts(self._env, facts)\n if ret == -1:\n raise CLIPSError(self._env)\n else:\n ret = lib.EnvLoadFactsFromString(self._env, facts, -1... | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Marshall the given parameter object. | [
"public void marshall(CreateOTAUpdateRequest createOTAUpdateRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (createOTAUpdateRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Draw a vertical gradient | [
"def vertical_gradient(self, x0, y0, x1, y1, start, end):\n \"\"\"\"\"\"\n x0, y0, x1, y1 = self.rect_helper(x0, y0, x1, y1)\n grad = gradient_list(start, end, y1 - y0)\n for x in range(x0, x1 + 1):\n for y in range(y0, y1 + 1):\n self.point(x, y, grad[y - y0])"... | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Un-registers the bean from the JMX server. | [
"public void stop() {\n MBeanServer server = ManagementFactory.getPlatformMBeanServer();\n ObjectName beanName = null;\n try {\n beanName = getObjectName();\n server.unregisterMBean(beanName);\n } catch (InstanceNotFoundException e) {\n LOGGER.debug(\"JMX... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the text about Technical Support:",
"pos": "Represent the code about Technical Support:",
"neg": "Represent the code about programming:"
} |
// makeParamSet takes a tuple of func params/results and returns ParamSet
// with types conversions applied and params names renamed according to prefix, i.e.
// if prefix is "p" then first param name will be p0. If prefix is "" no renaming
// is done. | [
"func (g *Generator) makeParamSet(prefix string, params *types.Tuple) ParamSet {\n\tps := make(ParamSet, params.Len())\n\n\tnumericParamCounter := 0\n\n\tfor i := 0; i < params.Len(); i++ {\n\t\tparam := params.At(i)\n\t\tname := param.Name()\n\n\t\ttypeName := g.typeOf(param.Type())\n\t\tparamPrefix, ok := g.types... | [
"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 programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Sets color
@param string $color Hexadecimal string representing label color, in RGB format
@return $this | [
"public function setColor($color)\n {\n $allowed_values = array('#ffffff', '#ffff01', '#ff6600', '#fe0000', '#9a0000', '#660066', '#0000fe', '#0099ff', '#01ffff', '#00ff33', '#349800', '#006634', '#666666', '#999999', '#e6e6e6', '#ffffcd', '#99ffff', '#ccff9a');\n if (!is_null($color) && (!in_array... | [
"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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
@param mixed $resource
@return bool | [
"protected static function isCertificateResource($resource): bool {\n if(!is_resource($resource)) {\n return FALSE;\n }\n if(get_resource_type($resource) != 'OpenSSL X.509') {\n return FALSE;\n }\n return TRUE;\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 Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Fill
@return void | [
"public function Fill()\r\n\t{\r\n\t\tif ( $this->src->getIsFinished() ) return;\r\n\r\n\t\tforeach ( $this->src as $fact )\r\n\t\t{\r\n\t\t\t$this->buffer[] = $fact;\r\n\t\t}\r\n\t\t// while ( $this->src->MoveNext() )\r\n\t\t// {\r\n\t\t// \t$this->buffer[] = $this->src->getCurrent();\r\n\t\t// }\r\n\r\n\t\t$this-... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Helper to compile protobuf files | [
"def _compile_proto(full_path, dest):\r\n ''\r\n proto_path = os.path.dirname(full_path)\r\n protoc_args = [find_protoc(),\r\n '--python_out={}'.format(dest),\r\n '--proto_path={}'.format(proto_path),\r\n full_path]\r\n proc = subprocess.Popen(protoc... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// IsBlock for unsupported platform returns error. | [
"func (u *volumeUtil) IsBlock(fullPath string) (bool, error) {\n\treturn false, fmt.Errorf(\"IsBlock is unsupported in this build\")\n}"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
in_array must be [[url_of_page, words_in_string_with_space],[next, same_element]] | [
"def find_not_uniq_words(in_array)\n all_words = []\n counter = {}\n result = []\n in_array.compact.each do |url_desc_cont|\n next unless url_desc_cont[1][0]\n url_desc_cont[1][0].scan(/\\w+/).each do |word|\n all_words << word\n end\n end\n all_words.each... | [
"def je(self):\n \n \"\"\"\n text = self._process()\n return self.make_string(text,join_str='',return_if_none='')"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software Engineering:"
} |
Return what changed
@param boolean $attrs if true, return old and current values
@return changes | [
"public function changed($attrs=false) \n {\n $changes = array();\n $cls = get_called_class();\n\n foreach (self::$_columns[$cls] as $column) {\n // if is the primary key or one of the automatic columns, skip\n if ($cls::getPK() == $column || in_array(strtolower($co... | [
"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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
Push CSS to the document
@param string $stylesheet Stylesheet or styles to add
@param string $extension Extension name, e.g.: com_example, mod_example, plg_example_test
@param array $attributes Attributes
@return object | [
"public function css($stylesheet = '', $extension = null, $attributes = array())\n\t{\n\t\t$extension = $extension ?: $this->detectExtensionName();\n\n\t\t$attr = array_merge(array(\n\t\t\t'type' => 'text/css',\n\t\t\t'media' => null,\n\t\t\t'attribs' => array()\n\t\t), $attributes);\n\n\t\t$asset = new Styles... | [
"public function initializeArguments()\n {\n parent::initializeArguments();\n $this->registerUniversalTagAttributes();\n $this->registerTagAttribute('name', 'string', 'Specifies the name of an anchor');\n $this->registerTagAttribute('rel', 'string', 'Specifies the relationship between... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Computer Science:"
} |
// Close handles OpClose requests | [
"func (s *Server) Close(p *Packet) (interface{}, error) {\n\treq := new(RequestClose)\n\terr := UnmarshalBinary(p.Payload, req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsession, err := s.getSession(p)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsession.mu.Lock()\n\tfile, ok := session.files[req.Handl... | [
"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 text about Web development:",
"pos": "Represent the code about Web development:",
"neg": "Represent the code:"
} |
Creates a signature for the given request
@param string $url string name of url suffix
@param array $params array get parameters to send to API
@return string | [
"private function createSignature($url, $params) {\n $url = $url . '?' . http_build_query($params);\n\n return 'giantbomb-'.substr(sha1($url), 0, 7);\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 Github sentence about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Compile solidity contracts into ABI and BIN. This requires solc somewhere in the $PATH
and also the :ref:`ethereum.tools` python library. The return value is a dict that
should be written into contracts.json. | [
"def _compile_all_contracts(self) -> Dict:\n \n ret = {}\n old_working_dir = Path.cwd()\n chdir(_BASE)\n\n def relativise(path):\n return path.relative_to(_BASE)\n import_dir_map = [\n '%s=%s' % (k, relativise(v))\n for k, v in self.contract... | [
"def register_options(cls, register):\n \"\"\"\"\"\"\n super(BundleMixin, cls).register_options(register)\n register('--archive', choices=list(archive.TYPE_NAMES),\n fingerprint=True,\n help='Create an archive of this type from the bundle. '\n 'This option is also d... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
AddMasterListeners Method. | [
"public void addMasterListeners()\n {\n super.addMasterListeners();\n this.getField(UserInfo.USER_NAME).addListener(new CheckNonNumericListener(null));\n this.addListener(new ReadOnlyRecordHandler(this.getField(UserInfo.READ_ONLY_RECORD), true));\n this.addListener(new FileListener(nu... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about File management:"
} |
// Init creates a driver with the given home and the set of options. | [
"func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error) {\n\tdeviceSet, err := NewDeviceSet(home, true, options, uidMaps, gidMaps)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := mount.MakePrivate(home); err != nil {\n\t\treturn nil, err\n\t}\n\n\td := &Dr... | [
"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 summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
/*eslint max-statements: [2, 40] | [
"function TChannelOutResponse(id, options) {\n options = options || {};\n var self = this;\n EventEmitter.call(self);\n self.errorEvent = self.defineEvent('error');\n self.spanEvent = self.defineEvent('span');\n self.finishEvent = self.defineEvent('finish');\n\n self.channel = options.channel;\... | [
"function convertRules (config) {\n const result = {}\n\n const eslintRules = new CLIEngine({\n useEslintrc: false,\n baseConfig: {\n extends: [require.resolve(`@vue/eslint-config-${config}`)]\n }\n }).getConfigForFile().rules\n\n const getRuleOptions = (ruleName, defaultOptions = []) => {\n co... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Construct a tokenizer. This creates both `tokenizeInline` and `tokenizeBlock`. | [
"function factory(type) {\n return tokenize\n\n // Tokenizer for a bound `type`.\n function tokenize(value, location) {\n var self = this\n var offset = self.offset\n var tokens = []\n var methods = self[type + 'Methods']\n var tokenizers = self[type + 'Tokenizers']\n var line = location.line\n... | [
"func (p *parser) addConcatenate() {\n\t// The first (| inside a Testgroup group goes directly to the group\n\tp.concatenation.addChild(p.unit)\n\tp.unit = nil\n}"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// SetMaxWorkers lets you change the total number of workers that can run concurrently. NOTE: If
// all workers are currently running, this setting is not guaranteed to take effect until one of them
// completes and Throttle() is called again | [
"func (t *Throttler) SetMaxWorkers(maxWorkers int) {\n\tif maxWorkers < 1 {\n\t\tpanic(\"maxWorkers has to be at least 1\")\n\t}\n\tatomic.StoreInt32(&t.maxWorkers, int32(maxWorkers))\n}"
] | [
"function errorAndExit(msg, logMe) {\n // @todo Only trigger if `verbosity > 1`\n if (logMe) {\n // Adding some empty lines before error message for readability\n console.log();\n console.log();\n console.log(logMe);\n }\n error(`Error: ${msg}`);\n\n // There's a few ways to handle exiting\n\n // ... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// IndexExists tests if an index exists for the passed in field name | [
"func (s *Store) IndexExists(tx *bolt.Tx, typeName, indexName string) bool {\n\treturn (tx.Bucket(indexBucketName(typeName, indexName)) != nil)\n}"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Retrieve a configuration option via a provided key.
@param string $key Unique configuration option key
@param mixed $default Default value to return if option does not exist
@return mixed Stored config item or $default value | [
"public function get($key, $default = null)\n {\n $config = $this->config;\n\n foreach (explode('.', $key) as $k) {\n if (! isset($config[$k])) {\n return $default;\n }\n $config = $config[$k];\n }\n\n return $config;\n }"
] | [
"public function get($key, $default = null)\n {\n $this->hydrate();\n\n // Create an Element instance using the data for the key\n if ($this->has($key)) {\n return new $this->model(array_merge($this->items[$key], ['key' => $key]));\n }\n\n // If the key doesn't exist... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
// DeleteCookieWithParams - Deletes browser cookie with given name, domain and path. | [
"func (c *Page) DeleteCookieWithParams(v *PageDeleteCookieParams) (*gcdmessage.ChromeResponse, error) {\n\treturn gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: \"Page.deleteCookie\", Params: v})\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 description about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Configures the compression options that should be used by the channel.
@param builder The channel builder to configure.
@param name The name of the client to configure. | [
"protected void configureCompression(final T builder, final String name) {\n final GrpcChannelProperties properties = getPropertiesFor(name);\n if (properties.isFullStreamDecompression()) {\n builder.enableFullStreamDecompression();\n }\n }"
] | [
"@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Programming:"
} |
Set page title automatically based on the current menu item
@param array $config Menu Config
@return void | [
"public function setPageTitle(array $config): void\n {\n foreach ($config as $item) {\n if (isset($item['active']) && $item['active']) {\n $this->_View->assign('title', $item['title']);\n break;\n }\n }\n }"
] | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// StringArrayEncodeAll encodes src into b, returning b and any error encountered.
// The returned slice may be of a different length and capactity to b.
//
// Currently only the string compression scheme used snappy. | [
"func StringArrayEncodeAll(src []string, b []byte) ([]byte, error) {\n\tsrcSz := 2 + len(src)*binary.MaxVarintLen32 // strings should't be longer than 64kb\n\tfor i := range src {\n\t\tsrcSz += len(src[i])\n\t}\n\n\t// determine the maximum possible length needed for the buffer, which\n\t// includes the compressed ... | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Create a new compiler instance by name or return the previous
instance with the same name.
@param string $compiler name
@return NodeCompilerInterface | [
"private function getNamedCompiler($compiler)\n {\n if (!isset($this->namedCompilers[$compiler])) {\n $this->namedCompilers[$compiler] = new $compiler($this);\n }\n\n return $this->namedCompilers[$compiler];\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 summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Writes efficiently part of the content to output stream.
@param os OutputStream to write to
@param start_offset Offset of data fragment to be written
@param length Length of data fragment to be written
@throws IOException | [
"public void writeTo(java.io.OutputStream os, int start_offset, int length) throws IOException {\n int towrite = min(length, _write_pos-start_offset);\n int writeoff = start_offset;\n if (towrite > 0) {\n while (towrite >= _window_size) {\n moveWindow(writeoff);\n ... | [
"def messages(self):\n ''''''\n\n # The file contains the fixed-size file header followed by\n # fixed-size message structures, followed by minimal message\n # information (subject, from, to). Start after the file\n # header and then simply return the message structures in\n ... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Formats the data for transmission echo $sql; | [
"private function getQueryString()\n {\n foreach ($_SERVER as $key => $value) {\n if (!in_array($key, $this->ignore)) {\n if ($key == 'REMOTE_ADDR') {\n $this->comment[$key] = $this->comment['user_ip'];\n } else {\n $this->comm... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Converts a given {@code Pattern} into a PERL style regular expression.
@param pattern
regular expression pattern
@return PERL style regular expression as string | [
"public static String convertPatternToPerlRegex(@Nonnull final Pattern pattern) {\n\t\tCheck.notNull(pattern, \"pattern\");\n\t\tfinal String modifiers = Flag.convertToModifiers(Flag.parse(pattern.flags()));\n\t\treturn String.format(PATTERN_TO_REGEX_TEMPLATE, pattern.pattern(), modifiers);\n\t}"
] | [
"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 description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Generates a string representation for this UUID.
@api private | [
"def generate_s\n result = sprintf(\"%8.8x-%4.4x-%4.4x-%2.2x%2.2x-\", @time_low, @time_mid,\n @time_hi_and_version, @clock_seq_hi_and_reserved, @clock_seq_low);\n 6.times do |i|\n result << sprintf(\"%2.2x\", @nodes[i])\n end\n return result.downcase\n end"
] | [
"public static OriginIdElement addOriginId(Message message) {\n OriginIdElement originId = new OriginIdElement();\n message.addExtension(originId);\n // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.\n // message.setStanzaId(originId.g... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Authorizes a user by OAuth2 to get access token | [
"def auth_oauth2(self) -> dict:\n \n oauth_data = {\n 'client_id': self._app_id,\n 'display': 'mobile',\n 'response_type': 'token',\n 'scope': '+66560',\n 'v': self.API_VERSION\n }\n response = self.post(self.OAUTH_URL, oauth_data)\n... | [
"func (p *provisioningIdentityMapper) UserFor(info authapi.UserIdentityInfo) (kuser.Info, error) {\n\t// Retrying up to three times lets us handle race conditions with up to two conflicting identity providers without returning an error\n\t// * A single race is possible on user creation for every conflicting identit... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// ToIPCommand converts the route into a full "ip route ..." command | [
"func (r *Route) ToIPCommand(dev string) []string {\n\tres := []string{\"ip\"}\n\tif r.Prefix.IP.To4() == nil {\n\t\tres = append(res, \"-6\")\n\t}\n\tres = append(res, \"route\", \"add\", r.Prefix.String())\n\tif r.Nexthop != nil {\n\t\tres = append(res, \"via\", r.Nexthop.String())\n\t}\n\tif r.MTU != 0 {\n\t\tre... | [
"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:"
} |
// WithRequiredScopes builds a context containing the given required scopes. | [
"func WithRequiredScopes(ctx context.Context, scopes []string) context.Context {\n\treturn context.WithValue(ctx, securityScopesKey, scopes)\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the post about Go programming language:",
"pos": "Represent the code about Go programming language:",
"neg": "Represent the code:"
} |
// Delete deletes item at `key` from cache | [
"func (c *InMemoryCache) Delete(_ context.Context, key Key) bool {\n\tif _, found := c.items.Load(key.String()); found {\n\t\tc.items.Delete(key.String())\n\t\treturn true\n\t}\n\treturn false\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 post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about programming:"
} |
Returns 501 Not Implemented HTTP Response
@param string $msg
@param int $errorCode
@param array $headers
@return json | [
"public function notImplemented($msg = '', $errorCode = null, $headers = [])\n {\n return $this->getErrorResponse($msg, $errorCode, self::HTTP_NOT_IMPLEMENTED, $headers);\n }"
] | [
"private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about PHP:",
"pos": "Represent the Github code about PHP:",
"neg": "Represent the Github code about Programming:"
} |
基于HS256算法验证
@throws InvalidTokenException 如果签名的格式不正确 | [
"private static boolean verifySignature(String content, String secret, String signature) throws InvalidTokenException{\n try {\n SecretKey secretKey = new SecretKeySpec(secret.getBytes(), ALG_HMACSHA256);\n Mac mac = Mac.getInstance(ALG_HMACSHA256);\n mac.init(secretKey);\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 description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Delete a chunk of text from a file.
See insert_text. | [
"def delete_text(self,\n\t text,\n\t fname,\n\t pattern=None,\n\t expect=None,\n\t shutit_pexpect_child=None,\n\t note=None,\n\t before=False,\n\t force=False,\n\t line_oriented=Tru... | [
"def append_line(self, new_line):\n \"\"\"\"\"\"\n # TODO: The user still has to write the raw line, this is error prone.\n self._write(('PGM', [Integer, String]), self.idx, new_line)"
] | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Get Coordinate Map by key or all from the actived sheet
@param string|int $key Key set by addRow()
@return string|array Coordinate string | Key-Coordinate array | [
"public static function getCoordinateMap($key=NULL)\n {\n if ($key) {\n return isset(self::$_keyCoordinateMap[$key]) ? self::$_keyCoordinateMap[$key] : NULL;\n } else {\n return self::$_keyCoordinateMap;\n }\n }"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Write the job to the corresponding plist. | [
"def write(self):\n ''''''\n with open(self.me, 'w') as f:\n f.write(self.printMe(self.tag, self.value))"
] | [
"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 description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Add notifications option to serialized resource node when requested through API.
@DI\Observe("serialize_resource_node") | [
"public function onSerialize(DecorateResourceNodeEvent $event)\n {\n $options = $event->getOptions();\n\n if (!in_array(Options::SKIP_RESOURCE_NOTIFICATION, $options)) {\n $node = $event->getResourceNode();\n $user = $this->tokenStorage->getToken()->getUser();\n $fo... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Updates the session info object with the information from
the given request context.<p>
@param context the request context to update the session with | [
"protected void update(CmsRequestContext context) {\n\n m_timeUpdated = System.currentTimeMillis();\n m_siteRoot = context.getSiteRoot();\n setProject(context.getCurrentProject().getUuid());\n m_ouFqn = context.getOuFqn();\n }"
] | [
"function Request(conn, cmd, args) {\n\n // current connection\n this.conn = conn;\n\n // command name\n this.cmd = cmd;\n\n // command arguments may be modified\n // during validation\n this.args = args;\n\n // raw command arguments, injected by the server\n this.raw = null;\n\n // server will inject thi... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Returns the local work directory. | [
"public static PathImpl getLocalWorkDir(ClassLoader loader)\n {\n PathImpl path = _localWorkDir.get(loader);\n\n if (path != null)\n return path;\n \n path = getTmpWorkDir();\n\n _localWorkDir.setGlobal(path);\n \n try {\n path.mkdirs();\n } catch (java.io.IOException e) {\n }\... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the instruction about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Clear pool for a tree reference.
@param treeReference | [
"public void clear(String treeReference){\n\t\tPool<BehaviorTree> treePool = pools.get(treeReference);\n\t\tif(treePool != null){\n\t\t\ttreePool.clear();\n\t\t}\n\t}"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"@Override\n\tpublic boolean eIsSet(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.ENG__PGRP_NAME:\n\t\t\t\treturn PGRP_NAME_EDEFAULT == null ? pGrpName != null : !PGRP_NAME_EDEFAULT.equals(pGrpName);\n\t\t\tcase AfplibPackage.ENG__TRIPLETS:\n\t\t\t\treturn triplets != null && !triplets.isEmpt... | [
"protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license... | codesearchnet | {
"query": "Represent the Github sentence about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
Mark the module as updated.
We check if the actual content has changed and if so we trigger an
update in py3status. | [
"def set_updated(self):\n \n # get latest output\n output = []\n for method in self.methods.values():\n data = method[\"last_output\"]\n if isinstance(data, list):\n if self.testing and data:\n data[0][\"cached_until\"] = method.get... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Gets a map of unsafe result elements, ie. elements that cannot be saved
because serialization fails.
@return | [
"public Map<ComponentJob, AnalyzerResult> getUnsafeResultElements() {\n if (_unsafeResultElements == null) {\n _unsafeResultElements = new LinkedHashMap<>();\n final Map<ComponentJob, AnalyzerResult> resultMap = _analysisResult.getResultMap();\n for (final Entry<ComponentJob,... | [
"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 instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Perform a re-login if not signed in or raise an exception | [
"def check_auth(self):\n \"\"\"\"\"\"\n if not self.logged_in:\n if self.relogin_interval and self.last_login and (time() - self.last_login) > self.relogin_interval:\n self.log(WARNING, 'Zabbix API not logged in. Performing Zabbix API relogin after %d seconds',\n ... | [
"def process_source(source)\n if source == \"00\"\n logger.warn(\"Connection has been aborted by the service provider because of an error by the service user (client side).\")\n elsif source == \"02\"\n logger.warn(\"Connection has been aborted by the service provider because of an error by ... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Create a node that implements given replacement strategy
@param DOMDocument $dom
@param array $replacement
@return DOMNode | [
"protected static function createReplacementNode(DOMDocument $dom, array $replacement)\n\t{\n\t\tif ($replacement[0] === 'expression')\n\t\t{\n\t\t\t$newNode = $dom->createElementNS(self::XMLNS_XSL, 'xsl:value-of');\n\t\t\t$newNode->setAttribute('select', $replacement[1]);\n\t\t}\n\t\telseif ($replacement[0] === 'p... | [
"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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Count records according to given criteria
@param Array $options Options
@return Int | [
"public function count(array $options = null) {\n if ($this->_model instanceof Garp_Model_Db) {\n unset($options['sort']);\n $options['fields'] = 'COUNT(*)';\n try {\n $result = $this->fetch($options);\n return !empty($result[0]['COUNT(*)']) ? $r... | [
"def _get_result_paths(self, data):\n \n\n # Swarm OTU map (mandatory output)\n return {'OtuMap': ResultPath(Path=self.Parameters['-o'].Value,\n IsWritten=True)}"
] | codesearchnet | {
"query": "Represent the Github post about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about programming:"
} |
Returns a reference to the registry for global or local actions.
@param global If true, return the global registry; if false, the local registry.
@return An action registry. | [
"private static ActionRegistry getRegistry(boolean global) {\n if (global) {\n return instance;\n }\n \n Page page = ExecutionContext.getPage();\n ActionRegistry registry = (ActionRegistry) page.getAttribute(ATTR_LOCAL_REGISTRY);\n \n if (registry == null)... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the instruction about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code:"
} |
Transform camel or pascal case to underscore separated string | [
"def to_underscore(s):\n \n return re.sub(\n r'(?!^)([A-Z]+)',\n lambda m: \"_{0}\".format(m.group(1).lower()),\n re.sub(r'(?!^)([A-Z]{1}[a-z]{1})', lambda m: \"_{0}\".format(m.group(1).lower()), s)\n ).lower()"
] | [
"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 post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Collector for getting count of consistancy points | [
"def consistency_point(self):\n \n\n cp_delta = {}\n xml_path = 'instances/instance-data/counters'\n netapp_api = NaElement('perf-object-get-instances')\n netapp_api.child_add_string('objectname', 'wafl')\n instance = NaElement('instances')\n instance.child_add_strin... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the summarization about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
https://developer.zendesk.com/rest_api/docs/voice-api/greetings#create-greetings | [
"def channels_voice_greeting_create(self, data, **kwargs):\n \"\"\n api_path = \"/api/v2/channels/voice/greetings.json\"\n return self.call(api_path, method=\"POST\", data=data, **kwargs)"
] | [
"def channels_voice_greeting_recording(self, id, **kwargs):\n \"\"\n api_path = \"/api/v2/channels/voice/greetings/{id}/recording.mp3\"\n api_path = api_path.format(id=id)\n return self.call(api_path, **kwargs)"
] | codesearchnet | {
"query": "Represent the post about developer.zendesk.com:",
"pos": "Represent the code about developer.zendesk.com:",
"neg": "Represent the code about developer.zendesk.com:"
} |
This method is stops the timer
@param callback A function that is called once the timer is destroyed
@return void | [
"function(callback) {\n\t\t\tthis.factory.running = false;\n\t\t\tthis._clearInterval(callback);\n\t\t\tthis.callback(this.callbacks.stop);\n\t\t\tthis.callback(callback);\n\t\t}"
] | [
"function (message) {\n receiveQueue.push(message);\n //reason I need this setTmeout is to return this function as fast as\n //possible to release the native side thread.\n setTimeout(function () {\n var message = receiveQueue.pop();\n callFunc(WebViewBridge.onMessage, message);\n ... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Apply applies the settings from the passed opts to the QueryOptions | [
"func (o *QueryOptions) Apply(opts []QueryOpt) {\n\tfor _, opt := range opts {\n\t\topt.f(o)\n\t}\n}"
] | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
From a stream of data points @ 50hz, buffer the points and release @ 50hz. | [
"function realtimeSimulationPipe(stream) {\n const parser = csv.parse({delimeter: \",\", columns: true});\n const nodeStream = RxNode\n .fromStream(stream.pipe(parser))\n\n return Observable.zip(nodeStream,\n Observable.interval(FIFTY_HZ),\n (data, interval) => data... | [
"protected void throttleUpdated ()\n {\n int messagesPerSec;\n synchronized(_pendingThrottles) {\n if (_pendingThrottles.size() == 0) {\n log.warning(\"Received throttleUpdated but have no pending throttles\",\n \"client\", this);\n ... | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the html code to build the lock dialog.<p>
@return html code
@throws CmsException if something goes wrong | [
"public String buildLockDialog() throws CmsException {\n\n CmsLockFilter nonBlockingFilter = CmsLockFilter.FILTER_ALL;\n nonBlockingFilter = nonBlockingFilter.filterLockableByUser(getCms().getRequestContext().getCurrentUser());\n nonBlockingFilter = nonBlockingFilter.filterSharedExclusive();\n ... | [
"public ScreenComponent startEditor(Field fldProperties, boolean bAllowAppending, Map<String,Object> mapKeyDescriptions)\n {\n return null; // TODO add thin impl\n }"
] | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Update internal skill_data_structure from disk. | [
"def sync_skills_data(self):\n \n self.skills_data = self.load_skills_data()\n if 'upgraded' in self.skills_data:\n self.skills_data.pop('upgraded')\n else:\n self.skills_data_hash = skills_data_hash(self.skills_data)"
] | [
"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 summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
MakeScreen Method. | [
"public ScreenParent makeScreen(ScreenLoc itsLocation, ComponentParent parentScreen, int iDocMode, Map<String,Object> properties)\n {\n ScreenParent screen = null;\n if ((iDocMode & ScreenConstants.MAINT_MODE) == ScreenConstants.MAINT_MODE)\n { // This is a little weird... can't directly c... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *DescribeCopyProductStatusInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DescribeCopyProductStatusInput\"}\n\tif s.CopyProductToken == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"CopyProductToken\"))\n\t}\n\tif s.CopyProductToken != nil && len(*s.CopyProduc... | [
"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 programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Combines the context data, and the local static or dynamic context data, and reformats the message
@param context input data
@param message message string
@return reformatted message string | [
"public String reformat(final Map<String, String> context, final String message) {\n final HashMap<String, String> tokens = new HashMap<String, String>();\n if (null != context) {\n tokens.putAll(context);\n }\n if (null != generator) {\n tokens.putAll(generator.get... | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Handle an incoming request.
@param \Illuminate\Http\Request $request
@param \Closure $next
@return mixed | [
"public function handle($request, Closure $next)\n {\n if ($this->auth->guest()) {\n if ($request->ajax()) {\n return response('Unauthorized.', 401);\n } else {\n return redirect()->guest('admin/login');\n }\n }\n\n if ($this->au... | [
"abstract public function __construct(Request $request, Translator $translator, View $view, GridContract $grid);\n\n /**\n * Extend decoration.\n *\n * @param callable $callback\n *\n * @return $this\n */\n public function extend(callable $callback = null)\n {\n // Run the ... | codesearchnet | {
"query": "Represent the summarization about Laravel:",
"pos": "Represent the code about Laravel:",
"neg": "Represent the code:"
} |
Add the proxies for content and view to view-documents.
@param PostConvertToDocumentEvent $event | [
"public function onPostConvertToDocument(PostConvertToDocumentEvent $event)\n {\n $document = $event->getDocument();\n if (!$document instanceof ArticleViewDocumentInterface) {\n return;\n }\n\n $document->setTargetWebspace($this->getTargetWebspace($document));\n }"
] | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Establishes a connection to the database server
@param string $dsn A Driver-specific PDO-DSN
@param array $config configuration to be used for creating connection
@return bool true on success | [
"protected function _connect($dsn, array $config)\n {\n $connection = new Oci8(\n $dsn,\n $config['username'],\n $config['password'],\n $config['flags']\n );\n $this->connection($connection);\n return true;\n }"
] | [
"public static function insert(array $data)\n {\n $self = static::getInstance();\n\n $data = static::filterColumns($data);\n\n if (!\\count($data)) {\n throw new DbException(\n \"Invalid field names of table `{$self->name}`. Please check use of `insert()` method\"\n... | codesearchnet | {
"query": "Represent the Github sentence about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Programming:"
} |
Performs deep clone of given model. | [
"protected M deepClone(Key<M> result) {\n M newModel = IcedUtils.deepCopy(self());\n newModel._key = result;\n // Do not clone model metrics\n newModel._output.clearModelMetrics();\n newModel._output._training_metrics = null;\n newModel._output._validation_metrics = null;\n // Clone trees\n ... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
update activity goals
@param period period for the goal ('weekly' or 'daily')
@param params the POST params for the request. Refer to Fitbit documentation for accepted format | [
"def update_activity_goals(period, params)\n unless period && %w(daily weekly).include?(period)\n raise FitgemOauth2::InvalidArgumentError, \"Goal period should either be 'daily' or 'weekly'\"\n end\n post_call(\"user/#{user_id}/activities/goals/#{period}.json\", params)\n end"
] | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Creates DBF file.
@return bool | [
"private function _createDBFFile()\n {\n if (! self::supportsDbase() || ! is_array($this->DBFHeader) || count($this->DBFHeader) == 0) {\n $this->DBFFile = null;\n\n return true;\n }\n $dbf_name = $this->_getFilename('.dbf');\n\n /* Unlink existing file */\n ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Handles removing sections based on submitted form.
@param \Symfony\Component\HttpFoundation\Request $request
@return \Symfony\Component\HttpFoundation\Response | [
"public function bulkDeleteAction(Request $request): Response\n {\n $this->denyAccessUnlessGranted(new Attribute('section', 'edit'));\n $form = $this->formFactory->deleteSections(\n new SectionsDeleteData()\n );\n $form->handleRequest($request);\n\n if ($form->isSubm... | [
"public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\... | codesearchnet | {
"query": "Represent the text about Symfony:",
"pos": "Represent the code about Symfony:",
"neg": "Represent the code:"
} |
Creates a submit button at $index position
@param int $index
@param string $cssStyle
@param string $url
@param string $responseElement
@param array $attributes associative array (<b>ajax</b> key is for ajax post)
@return DataTable | [
"public function fieldAsSubmit($index,$cssStyle=NULL,$url=NULL,$responseElement=NULL,$attributes=NULL){\n\t\treturn $this->_fieldAs(function($id,$name,$value,$caption) use ($url,$responseElement,$cssStyle,$attributes){\n\t\t\t$button=new HtmlButton($id,$value,$cssStyle);\n\t\t\t$button->postOnClick($url,\"$(event.t... | [
"public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Writes cache.
@param string $content The content to write in the cache
@param ResourceInterface[] $metadata An array of metadata
@throws \RuntimeException When cache file can't be written | [
"public function write($content, array $metadata = null)\n {\n $mode = 0666;\n $umask = umask();\n $filesystem = new Filesystem();\n $filesystem->dumpFile($this->file, $content);\n try {\n $filesystem->chmod($this->file, $mode, $umask);\n } catch (IOException ... | [
"public function getSection($key)\n {\n if (false === $this->hasSection($key)) {\n throw new ConfigException(sprintf('\"%s\" is not a section', $key));\n }\n\n // do not return the parent object if we were subclassed, but an actual\n // \"Config\" object to avoid copying in... | codesearchnet | {
"query": "Represent the Github description about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// ToJSON convert json response body to struct or map | [
"func (r *Resp) ToJSON(v interface{}) error {\n\tdata, err := r.ToBytes()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn json.Unmarshal(data, v)\n}"
] | [
"def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Links the current user Identity to another
@param current The Identity of the current user
@param to The Identity that needs to be linked to the current user | [
"@Override\n public Future<U> link(U current, BasicProfile to) {\n return toScala(doLink(current, to));\n }"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
{@inheritDoc}
@see java.sql.ResultSet#updateFloat(java.lang.String, float) | [
"@Override\n\tpublic void updateFloat(final String columnLabel, final float x) throws SQLException {\n\t\twrapped.updateFloat(columnLabel, x);\n\t}"
] | [
"public java.sql.Date getDate(Map<String, Object> data, String name) {\n return get(data, name, java.sql.Date.class);\n }"
] | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
获取当前选中的自闭合的节点
@method getClosedNode
@return { Node | NULL } 如果当前选中的是自闭合节点, 则返回该节点, 否则返回NULL | [
"function () {\n var node;\n if (!this.collapsed) {\n var range = this.cloneRange().adjustmentBoundary().shrinkBoundary();\n if (selectOneNode(range)) {\n var child = range.startContainer.childNodes[range.startOffset];\n if (c... | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about text processing:"
} |
Save annotation
@param int $idNote
@param string $note
@param string $starred
@param array $optional
@return bool|object
@throws InvalidRequestException | [
"public function saveAnnotation($idNote, $note = '', $starred = '', array $optional = [])\n {\n return $this->_request('Annotations.save', [\n 'idNote' => $idNote,\n 'note' => $note,\n 'starred' => $starred,\n ], $optional);\n }"
] | [
"protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }"
] | codesearchnet | {
"query": "Represent the instruction about PHP:",
"pos": "Represent the code about PHP:",
"neg": "Represent the code about Software development:"
} |
Convert given Query into a SolrQuery executable via {@link org.apache.solr.client.solrj.SolrClient}
@param query the source query to turn into a {@link SolrQuery}.
@param domainType can be {@literal null}.
@return | [
"@Override\n\tpublic final SolrQuery doConstructSolrQuery(SolrDataQuery query, @Nullable Class<?> domainType) {\n\n\t\tAssert.notNull(query, \"Cannot construct solrQuery from null value.\");\n\t\tAssert.notNull(query.getCriteria(), \"Query has to have a criteria.\");\n\n\t\tSolrQuery solrQuery = new SolrQuery();\n\... | [
"@Deprecated\n public static <T extends RepositoryBrowser>\n T createInstance(Class<T> type, StaplerRequest req, String fieldName) throws FormException {\n List<Descriptor<RepositoryBrowser<?>>> list = filter(type);\n String value = req.getParameter(fieldName);\n if(value==null || value.e... | codesearchnet | {
"query": "Represent the text about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software development:"
} |
Register the service provider.
@return void | [
"public function register()\n\t{\n\t\t$params = array(\n\t\t\t'database' => DB_NAME,\n\t\t\t'username' => DB_USER,\n\t\t\t'password' => DB_PASSWORD,\n\t\t\t'prefix' => $GLOBALS['table_prefix']\n\t\t);\n\n\t\tif(class_exists('Corcel\\Database'))\n\t\t{\n\t\t\tDatabase::connect($params);\n\t\t}\n\n\t}"
] | [
"@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 Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
See the date is not a given day in the month.
@param string $date
@param int $day | [
"public function dontSeeDayInMonth($date, $day) {\n \\PHPUnit_Framework_Assert::assertNotEquals($day, $this->_ParseDate($date)->day);\n }"
] | [
"def _evalDateStd(self, datetimeString, sourceTime):\n \n s = datetimeString.strip()\n sourceTime = self._evalDT(datetimeString, sourceTime)\n\n # Given string is in the format 07/21/2006\n return self.parseDate(s, sourceTime)"
] | codesearchnet | {
"query": "Represent the Github description about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
Loads data using util_io, but smartly constructs a filename | [
"def load_cache(dpath, fname, cfgstr, ext='.cPkl', verbose=None, enabled=True):\n \n if verbose is None:\n verbose = VERBOSE_CACHE\n if not USE_CACHE or not enabled:\n if verbose > 1:\n print('[util_cache] ... cache disabled: dpath=%s cfgstr=%r' %\n (basename(dpa... | [
"def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Join type, one of `miter`, `round`, `bevel`. | [
"def line_join_type(self):\n \"\"\"\"\"\"\n key = self._data.get(b'strokeStyleLineJoinType').enum\n return self.STROKE_STYLE_LINE_JOIN_TYPES.get(key, str(key))"
] | [
"func dotLegend(rpt *Report, g graph, origCount, droppedNodes, droppedEdges int) string {\n\tlabel := legendLabels(rpt)\n\tlabel = append(label, legendDetailLabels(rpt, g, origCount, droppedNodes, droppedEdges)...)\n\treturn fmt.Sprintf(`subgraph cluster_L { L [shape=box fontsize=32 label=\"%s\\l\"] }`, strings.Joi... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get the current time of the OVH servers, since UNIX epoch
REST: GET /auth/time | [
"public Long time_GET() throws IOException {\n\t\tString qPath = \"/auth/time\";\n\t\tStringBuilder sb = path(qPath);\n\t\tString resp = execN(qPath, \"GET\", sb.toString(), null);\n\t\treturn convertTo(resp, Long.class);\n\t}"
] | [
"def remove_all_servers(self):\n \n # 'no ntp' removes all server entries.\n # For command_builder, disable command 'ntp' gives the desired command\n cmd = self.command_builder('ntp', disable=True)\n return self.configure(cmd)"
] | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Networking:"
} |
Computes the 24 byte ANSI password hash given the 8 byte server challenge.
@param tc
@param chlng
@return the hash for the given challenge
@throws GeneralSecurityException | [
"public byte[] getAnsiHash ( CIFSContext tc, byte[] chlng ) throws GeneralSecurityException {\n switch ( tc.getConfig().getLanManCompatibility() ) {\n case 0:\n case 1:\n return NtlmUtil.getPreNTLMResponse(tc, this.password, chlng);\n case 2:\n return NtlmUtil.getNT... | [
"def get_hash(self):\n \n if not self.executed:\n raise pyhsm.exception.YHSM_Error(\"HMAC-SHA1 hash not available, before execute().\")\n return self.result.hash_result"
] | codesearchnet | {
"query": "Represent the Github comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.