query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
// QueryRow executes a query that is expected to return at most one row.
// QueryRow always return a non-nil value. Errors are deferred until
// Row's Scan method is called. | [
"func (tx *Tx) QueryRow(query string, args ...interface{}) *Row {\n\trows, err := tx.Query(query, args...)\n\treturn &Row{rows: rows, err: err}\n}"
] | [
"function RowStatementPostExec(\n statementOptions, context, services, connectionConfig)\n{\n // call super\n BaseStatement.apply(this, arguments);\n\n // add the result request headers to the context\n context.resultRequestHeaders = buildResultRequestHeadersRow();\n\n /**\n * Called when the statement re... | codesearchnet | {
"query": "Represent the instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
// SetUserPoolConfig sets the UserPoolConfig field's value. | [
"func (s *GraphqlApi) SetUserPoolConfig(v *UserPoolConfig) *GraphqlApi {\n\ts.UserPoolConfig = v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Assert if the current URL is identical to the target URL.
With this function also redirects can be tested.
@param {MozmillController} controller
MozMillController of the window to operate on
@param {string} targetURL
URL to check | [
"function assertLoadedUrlEqual(controller, targetUrl) {\n var locationBar = new elementslib.ID(controller.window.document, \"urlbar\");\n var currentURL = locationBar.getNode().value;\n\n // Load the target URL\n controller.open(targetUrl);\n controller.waitForPageLoad();\n\n // Check the same web page has be... | [
"function(element, options) {\n\n var $el = $(element);\n // React on every server/socket.io message.\n // If the element is defined with a data-react-on-event attribute\n // we take that as an eventType the user wants to be warned on this\n // element and we forward the event via jQuery events on $(... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Like a groupby but expect the key_fn to return multiple keys for
each element. | [
"def multi_groupby(self, key_fn):\n \n result_dict = defaultdict(list)\n\n for x in self:\n for key in key_fn(x):\n result_dict[key].append(x)\n\n # convert result lists into same Collection type as this one\n return {\n k: self.clone_with_new_... | [
"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 instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
connect fail 解决结果回调, 由 HMSAgentActivity 在 onActivityResult 中调用
@param result 解决结果 | [
"void onResolveErrorRst(int result) {\r\n HMSAgentLog.d(\"result=\"+result);\r\n isResolving = false;\r\n resolveActivity = null;\r\n hasOverActivity = false;\r\n\r\n if(result == ConnectionResult.SUCCESS) {\r\n HuaweiApiClient client = getApiClient();\r\n i... | [
"function redirectToIndex() {\n var baseURL = window.DEBUG\n ? 'index-debug.html'\n : 'index.html';\n location.href = baseURL + location.hash;\n // 在`Promise`中,抛出异常会使其进入失败状态,\n // 一般来说跳转了就不会有下面的代码执行,这里就是防止进入成功状态\n throw new Error('... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// parse runs the left recursive descending algorithm
// on input string. It returns a list of map[key]value. | [
"func (p *Parser) parse() (map[string]string, error) {\n\tp.scan() // init scannedItems\n\n\tlabelsMap := map[string]string{}\n\tfor {\n\t\ttok, lit := p.lookahead()\n\t\tswitch tok {\n\t\tcase IdentifierToken:\n\t\t\tkey, value, err := p.parseLabel()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"unable ... | [
"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 about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Run the migrations.
@return void | [
"public function up()\r\n {\r\n Schema::create($this->table_name, function ($table) {\r\n $table->increments('id')->unsigned();\r\n $table->string('name');\r\n $table->string('code', 10)->index();\r\n $table->string('symbol', 25);\r\n $table->string('... | [
"private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope... | codesearchnet | {
"query": "Represent the post about Database management:",
"pos": "Represent the code about Database management:",
"neg": "Represent the code about programming:"
} |
// Format renders a single log entry | [
"func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) {\n\tdata := make(Fields, len(entry.Data)+4)\n\tfor k, v := range entry.Data {\n\t\tswitch v := v.(type) {\n\t\tcase error:\n\t\t\t// Otherwise errors are ignored by `encoding/json`\n\t\t\t// https://github.com/sirupsen/logrus/issues/137\n\t\t\tdata[k] =... | [
"@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:"
} |
resolve the slots one by one to slot_to_reg instructions using the
type information inferred from their names / type hierachy | [
"def sym_to_risc(compiler , source)\n slots = @slots.dup\n raise \"Not Message #{object}\" unless @known_object == :message\n left = Risc.message_reg\n left = left.resolve_and_add( slots.shift , compiler)\n reg = compiler.current.register\n while( !slots.empty? )\n left = left.r... | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code about Natural Language Processing:"
} |
Returns the special tshark parameters to be used according to the configuration of this class. | [
"def get_parameters(self, packet_count=None):\n \n params = super(LiveRingCapture, self).get_parameters(packet_count=packet_count)\n params += ['-b', 'filesize:' + str(self.ring_file_size), '-b', 'files:' + str(self.num_ring_files), '-w', self.ring_file_name, '-P']\n return params"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
Synchronizes the node.html, and the node's content
@property setHtml
@param o {object} An html string or object containing an html property | [
"function(o) {\n\n this.html = (typeof o === \"string\") ? o : o.html;\n\n var el = this.getContentEl();\n if (el) {\n el.innerHTML = this.html;\n }\n\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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
TODO: Docstring for spark.
Parameters
----------
points : array-like
shapes : array-like
fill : array-like, optional
Returns
-------
Chart | [
"def spark_shape(points, shapes, fill=None, color='blue', width=5, yindex=0, heights=None):\n \n assert len(points) == len(shapes) + 1\n data = [{'marker': {'color': 'white'}, 'x': [points[0], points[-1]], 'y': [yindex, yindex]}]\n\n if fill is None:\n fill = [False] * len(shapes)\n\n if heigh... | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
Enables / disables the usage of a transparent color for filling sections
@param TRANSPARENT_SECTIONS_ENABLED | [
"public void setTransparentSectionsEnabled(final boolean TRANSPARENT_SECTIONS_ENABLED) {\n transparentSectionsEnabled = TRANSPARENT_SECTIONS_ENABLED;\n init(getInnerBounds().width, getInnerBounds().height);\n repaint(getInnerBounds());\n }"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Throw an exception if <i>$value</i> is not an int or null.
@param mixed $value
@throws MWrongTypeException | [
"public static function mustBeNullableInt($value)\n {\n if (is_int($value) === false && $value != null) {\n throw new MWrongTypeException('\\$value', 'int|null', gettype($value));\n }\n }"
] | [
"final private function checkScalarValue(string $scalar):bool\n {\n if ($this->strlikeInArray($scalar, $this->scalar) !== false) {\n return (true);\n } else {\n throw new Server500(new \\ArrayObject(array(\"explain\" => \"Unknow type $scalar in Mercure\",\n \"so... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
from interface LogChute | [
"public void init (RuntimeServices rsvc)\n {\n // if we weren't constructed with a servlet context, try to obtain\n // one via the application context\n if (_sctx == null) {\n // first look for the servlet context directly\n _sctx = (ServletContext)rsvc.getApplicationAt... | [
"def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)"
] | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get values profile.
@param mixed $values | [
"public function profile($values)\n {\n $profile = [];\n\n foreach (array_keys($values) as $field) {\n $profile[$field] = '';\n }\n\n return $profile;\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Return :data:`True` if the (possibly extensionless) file at `path`
resembles a Python script. For now we simply verify the file contains
ASCII text. | [
"def _looks_like_script(self, path):\n \n fp = open(path, 'rb')\n try:\n sample = fp.read(512).decode('latin-1')\n return not set(sample).difference(string.printable)\n finally:\n fp.close()"
] | [
"def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
获取外层高度
@param {HTMLElement} el dom节点
@param {Number} defaultValue 默认值
@return {Number} 高度 | [
"function getOuterHeight(el, defaultValue) {\n var height = this.getHeight(el, defaultValue);\n var bTop = parseFloat(this.getStyle(el, 'borderTopWidth')) || 0;\n var pTop = parseFloat(this.getStyle(el, 'paddingTop')) || 0;\n var pBottom = parseFloat(this.getStyle(el, 'paddingBottom')) || 0;\n var bB... | [
"static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }"
] | codesearchnet | {
"query": "Represent the Github post about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about Software development:"
} |
Gets the areas of the table which can be scrolled horizontally.
@param {sap.ui.table.Table} oTable Instance of the table.
@returns {HTMLElement[]} Returns only elements which exist in the DOM.
@private | [
"function(oTable) {\n\t\t\tvar oDomRef = oTable.getDomRef();\n\t\t\tvar aScrollableColumnAreas;\n\n\t\t\tif (oDomRef) {\n\t\t\t\taScrollableColumnAreas = Array.prototype.slice.call(oTable.getDomRef().querySelectorAll(\".sapUiTableCtrlScr\"));\n\t\t\t}\n\n\t\t\tvar aScrollAreas = [\n\t\t\t\toTable._getScrollExtensio... | [
"function(DataType) {\n\n\t\"use strict\";\n\n\t// delegate further initialization of this library to the Core\n\tsap.ui.getCore().initLibrary({\n\t\tname : \"sap.f\",\n\t\tversion: \"${version}\",\n\t\tdependencies : [\"sap.ui.core\", \"sap.m\", \"sap.ui.layout\"],\n\t\tdesigntime: \"sap/f/designtime/library.desig... | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
@param NotifiableInterface $notifiable
@return int
@throws \RuntimeException
@throws \InvalidArgumentException
@throws \Doctrine\ORM\NonUniqueResultException
@throws \Doctrine\ORM\NoResultException | [
"public function getNotificationCount(NotifiableInterface $notifiable)\n {\n return $this->notifiableNotificationRepository->getNotificationCount(\n $this->generateIdentifier($notifiable),\n ClassUtils::getRealClass(get_class($notifiable))\n );\n }"
] | [
"public function register()\n {\n $this->registerConfigurationMapper();\n $this->registerCacheManager();\n $this->registerEntityManager();\n $this->registerClassMetadataFactory();\n $this->registerValidationVerifier();\n\n $this->commands([\n 'Mitch\\LaravelDo... | codesearchnet | {
"query": "Represent the summarization about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
Run wireshark on a list of packets | [
"def wireshark(pktlist, *args):\n \"\"\"\"\"\"\n fname = get_temp_file()\n wrpcap(fname, pktlist)\n subprocess.Popen([conf.prog.wireshark, \"-r\", fname] + list(args))"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Find a directory in parent tree with a specific filename
:param directory: directory name to find
:param filename: filename to find
:returns: absolute directory path | [
"def _find_parent_directory(directory, filename):\n \n parent_directory = directory\n absolute_directory = '.'\n while absolute_directory != os.path.abspath(parent_directory):\n absolute_directory = os.path.abspath(parent_directory)\n if os.path.isfile(os.path.join(... | [
"def is_multifile_object_without_children(self, location: str) -> bool:\n \n # (1) Find the base directory and base name\n if isdir(location): # special case: parent location is the root folder where all the files are.\n return len(self.find_multifile_object_children(location)) == 0... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Calculate P'di (the uncorrected decay heat power) from ANS-5.1-1979 Eq.6
need f_ts2t0, Pi(thePi), Qi(theQ) from class DataForANS_5_1_1979.
calc_sum_thermal_fission(f_ts2t0, read_data)
return P'd | [
"def calc_sum_thermal_fission(f_ts2t0, read_data)\n prd = ThermalData::HashWithThermalFission.new\n pd = 0\n prd.thermal_fission.each do |key, value|\n value = value + read_data.thePi[key] * f_ts2t0[key] / read_data.theQ[key]\n pd += value\n end\n pd\n end"
] | [
"def ystep(self):\n \n \"\"\"\n\n self.Y = self.Pcn(self.AX + self.U)"
] | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
also used by DoublesSketch, DoublesUnionImpl and HeapDoublesSketchTest | [
"static void downSamplingMergeInto(final DoublesSketch src, final UpdateDoublesSketch tgt) {\n final int srcK = src.getK();\n final int tgtK = tgt.getK();\n final long tgtN = tgt.getN();\n\n if ((srcK % tgtK) != 0) {\n throw new SketchesArgumentException(\n \"source.getK() must equal targe... | [
"protected List<List<Row<I>>> incorporateCounterExample(DefaultQuery<I, D> ce) {\n return ObservationTableCEXHandlers.handleClassicLStar(ce, table, oracle);\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Convert a mopidy track to a mopidy ref. | [
"def track_to_ref(track, with_track_no=False):\n \"\"\"\"\"\"\n if with_track_no and track.track_no > 0:\n name = '%d - ' % track.track_no\n else:\n name = ''\n for artist in track.artists:\n if len(name) > 0:\n name += ', '\n name += artist.name\n if (len(name)... | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Handling the output tyoe.
@param pType [String] Type of object
@return Return an object of output. | [
"def get_output(pType)\n pType.downcase!\n\n return XMLOutputFormat.new if pType == 'xml'\n raise Error::ParserError if pType == 'yml'\n end"
] | [
"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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
-------------------------------------------------------------------------------------------- | [
"private DescriptorProperties getValidatedProperties(Map<String, String> properties) {\n\t\tfinal DescriptorProperties descriptorProperties = new DescriptorProperties(true);\n\t\tdescriptorProperties.putProperties(properties);\n\n\t\t// allow Kafka timestamps to be used, watermarks can not be received from source\n... | [
"public static function run($speech = null)\n\t{\n\t\tif ( ! isset($speech))\n\t\t{\n\t\t\t$speech = 'KILL ALL HUMANS!';\n\t\t}\n\n\t\t$eye = \\Cli::color(\"*\", 'red');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"{$speech}\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::col... | codesearchnet | {
"query": "Represent the comment about language and writing:",
"pos": "Represent the code about language and writing:",
"neg": "Represent the code about programming:"
} |
Write a row to the file.
@param array $row The row to write.
@return int The length of the line written.
@throws \RuntimeException On error. | [
"public function write(array $row)\n {\n\n // Open the file if it's not already open.\n if ($this->csv === null) {\n $csv = fopen($this->getConfig('file'), 'w');\n if (is_resource($csv) === false) {\n throw new \\RuntimeException('Unable to open output file.');\... | [
"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 text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Run the pruned and frozen inference graph. | [
"def apply_compact(graph_path):\n \n with tf.Session(config=tf.ConfigProto(allow_soft_placement=True)) as sess:\n # Note, we just load the graph and do *not* need to initialize anything.\n with tf.gfile.GFile(graph_path, \"rb\") as f:\n graph_def = tf.GraphDef()\n graph_def... | [
"def determine_target_roots(self, goal_name):\n \n if not self.context.target_roots:\n print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.stderr)\n\n # For the v2 path, e.g. `./pants list` is a functional no-op. This matches the v2 mode behavior\n # of e.g. `./pants ... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Find a global ordering for layers in a HoloMap of CompositeOverlay
types. | [
"def layer_sort(hmap):\n \n orderings = {}\n for o in hmap:\n okeys = [get_overlay_spec(o, k, v) for k, v in o.data.items()]\n if len(okeys) == 1 and not okeys[0] in orderings:\n orderings[okeys[0]] = []\n else:\n orderings.update({k: [] if k == v else [v] for k, v in zip(okeys[... | [
"AtomSymbol alignTo(SymbolAlignment alignment) {\n return new AtomSymbol(element, adjuncts, annotationAdjuncts, alignment, hull);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Parse manifest and create the manifest array
@return array | [
"public function load()\n {\n $this->manifest = new ArrayObject(array(\n 'name' => $this->getModuleName(),\n 'version' => $this->getModuleVersion(),\n 'application_config' => array(),\n 'autoloader_config' => array(),\n 'console' => array(\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 about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Clone creates an exact copy of a Collector without callbacks.
// HTTP backend, robots.txt cache and cookie jar are shared
// between collectors. | [
"func (c *Collector) Clone() *Collector {\n\treturn &Collector{\n\t\tAllowedDomains: c.AllowedDomains,\n\t\tAllowURLRevisit: c.AllowURLRevisit,\n\t\tCacheDir: c.CacheDir,\n\t\tDetectCharset: c.DetectCharset,\n\t\tDisallowedDomains: c.DisallowedDomains,\n\t\tID: ... | [
"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 about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code about Software development:"
} |
Asserts that a value is greater than or equal to another value.
@param mixed $expected
@param string $message
@return $this | [
"public function assertGreaterThanOrEqual($expected, $message = '')\n {\n Assert::assertGreaterThanOrEqual($expected, $this->getData(), $message);\n\n return $this;\n }"
] | [
"static public function throwTypingError($value)\n {\n $givenValue = (gettype($value) == 'object') ? get_class($value) : gettype($value);\n $acceptedTypes = array('boolean', 'integer', 'float', 'double', 'string', 'Duration', 'Pair', 'DirectedPair', 'Point');\n $acceptedTypes = implode(\", \... | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software Development:"
} |
Write start of checking info as DOT comment. | [
"def start_output (self):\n \"\"\"\"\"\"\n super(DOTLogger, self).start_output()\n if self.has_part(\"intro\"):\n self.write_intro()\n self.writeln()\n self.writeln(u\"digraph G {\")\n self.writeln(u\" graph [\")\n self.writeln(u\" charset=\\\"%s\\... | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns SQL string to add a column to an existing table.
@param entityType entity meta data
@param attr attribute
@param columnMode column mode
@return SQL string | [
"static String getSqlAddColumn(EntityType entityType, Attribute attr, ColumnMode columnMode) {\n StringBuilder sql = new StringBuilder(\"ALTER TABLE \");\n\n String columnSql = getSqlColumn(entityType, attr, columnMode);\n sql.append(getTableName(entityType)).append(\" ADD \").append(columnSql);\n\n Lis... | [
"@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ... | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Skip forward in the open file pointer
This is basically a wrapper around seek() (and a workaround for bzip2)
@param int $bytes seek to this position | [
"protected function skipbytes($bytes)\n {\n if ($this->comptype === Archive::COMPRESS_GZIP) {\n @gzseek($this->fh, $bytes, SEEK_CUR);\n } elseif ($this->comptype === Archive::COMPRESS_BZIP) {\n // there is no seek in bzip2, we simply read on\n // bzread allows to re... | [
"def read_plain_boolean(file_obj, count):\n \"\"\"\"\"\"\n # for bit packed, the count is stored shifted up. But we want to pass in a count,\n # so we shift up.\n # bit width is 1 for a single-bit boolean.\n return read_bitpacked(file_obj, count << 1, 1, logger.isEnabledFor(logging.DEBUG))"
] | codesearchnet | {
"query": "Represent the comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// SetDocumentId sets the DocumentId field's value. | [
"func (s *CreateCommentInput) SetDocumentId(v string) *CreateCommentInput {\n\ts.DocumentId = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// SetCreationTime sets the CreationTime field's value. | [
"func (s *NotebookInstanceSummary) SetCreationTime(v time.Time) *NotebookInstanceSummary {\n\ts.CreationTime = &v\n\treturn s\n}"
] | [
"def _GetStat(self):\n \n stat_object = super(VShadowFileEntry, self)._GetStat()\n\n if self._vshadow_store is not None:\n # File data stat information.\n stat_object.size = self._vshadow_store.volume_size\n\n # Ownership and permissions stat information.\n\n # File entry type stat informat... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Evaluate the response from the {@value TwitterConstants#TWITTER_ENDPOINT_VERIFY_CREDENTIALS} endpoint. This checks the
status code of the response and ensures that an email value is contained in the response.
@param responseBody
@return | [
"public Map<String, Object> evaluateVerifyCredentialsResponse(String responseBody) {\n String endpoint = TwitterConstants.TWITTER_ENDPOINT_VERIFY_CREDENTIALS;\n\n Map<String, Object> responseValues = null;\n try {\n responseValues = populateJsonResponse(responseBody);\n } catc... | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the Github sentence about NLP:",
"pos": "Represent the Github code about NLP:",
"neg": "Represent the Github code about Software development:"
} |
Gets the configuration describing the queryable state as deactivated. | [
"public static QueryableStateConfiguration disabled() {\n\t\tfinal Iterator<Integer> proxyPorts = NetUtils.getPortRangeFromString(QueryableStateOptions.PROXY_PORT_RANGE.defaultValue());\n\t\tfinal Iterator<Integer> serverPorts = NetUtils.getPortRangeFromString(QueryableStateOptions.SERVER_PORT_RANGE.defaultValue())... | [
"@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 Technology:",
"pos": "Represent the Github code about Technology:",
"neg": "Represent the Github code:"
} |
Marshall the given parameter object. | [
"public void marshall(StreamFile streamFile, ProtocolMarshaller protocolMarshaller) {\n\n if (streamFile == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(streamFile.getFileId(), FILEID_BIND... | [
"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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
return a F ordered version of A, assuming A is symmetric | [
"def force_F_ordered_symmetric(A):\n \n if A.flags['F_CONTIGUOUS']:\n return A\n if A.flags['C_CONTIGUOUS']:\n return A.T\n else:\n return np.asfortranarray(A)"
] | [
"def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Natural Language Processing:"
} |
User browserify to create a "packed" file.
@param {string} input - input file
@param {string} nc - node compiler dir
@param {array} options - nexe options
@param {function} complete - next function to call (async) | [
"function bundle(input, nc, options, complete) {\n const bundlePath = path.join(nc, 'lib', 'nexe.js');\n const mapfile = options.output + '.map';\n let ws = fs.createWriteStream(bundlePath);\n\n const igv = '__filename,__dirname,_process';\n let insertGlobalVars = { isNexe: true },\n wantedGlobalVars = igv.... | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// DownloadInWriter is a cancellable function that downloads a src into a writer using a specific *http.Client | [
"func DownloadInWriter(ctx context.Context, c *http.Client, src string, dst io.Writer) (err error) {\n\t// Send request\n\tvar resp *http.Response\n\tif resp, err = c.Get(src); err != nil {\n\t\treturn errors.Wrapf(err, \"astihttp: getting %s failed\", src)\n\t}\n\tdefer resp.Body.Close()\n\n\t// Validate status co... | [
"@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC... | codesearchnet | {
"query": "Represent the Github comment about writing:",
"pos": "Represent the Github code about writing:",
"neg": "Represent the Github code:"
} |
// NewParser initializes the resources for a parser.
//
// Make sure to Close the parser when you're done with it. | [
"func NewParser(m *Mrb) *Parser {\n\tp := C.mrb_parser_new(m.state)\n\n\t// Set capture_errors to true so we don't go just printing things\n\t// out to stdout.\n\tC._go_mrb_parser_set_capture_errors(p, 1)\n\n\treturn &Parser{\n\t\tmrb: m,\n\t\tparser: p,\n\t}\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 summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Delete the file from the Livedocx service
@return Image
@throws DeleteException | [
"public function delete()\n {\n try {\n $this->getSoapClient()->DeleteImage([\n 'filename' => basename($this->getName(true)) ,\n ]);\n\n return $this;\n } catch ( SoapException $e ) {\n throw new DeleteException('Error while deleting the im... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Create a globally unique identifier for naming instances
@return New globally unique identifier | [
"public static String makeGUID() {\n String uuid = \"\";\n String chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n int rnd = 0;\n int r;\n\n for (int i = 0; i < GUID_STRING_LENGTH; i += 1) {\n if (i == 8 || i == 13 || i == 18 || i == 23) {\... | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
{@inheritDoc}
@see \Zend\Mvc\Controller\AbstractController::setEventManager() | [
"public function setEventManager(EventManagerInterface $events) {\n\t parent::setEventManager($events);\n\t\t$controller = $this;\n\t\t$events->attach('dispatch', function ($e) use ($controller) {\n\t\t\t$controller->layout('layout/cathedral/builder');\n\t\t}, 100);\n\t}"
] | [
"public function afterRegistry()\n {\n parent::afterRegistry();\n\n $this->addColumn($this->util->getTokenData()->getStatusExpression(), 'status');\n\n if (! $this->request instanceof \\Zend_Controller_Request_Abstract) {\n $this->request = \\Zend_Controller_Front::getInstance()->... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
Overridden to use this->class instead of base class | [
"public function stageChildren($showAll = false) {\n\t\t$baseClass = $this->class;\n\t\t$staged = $baseClass::get()\n\t\t\t->filter('ParentID', (int)$this->owner->ID)\n\t\t\t->exclude('ID', (int)$this->owner->ID);\n\n\t\t$this->owner->extend(\"augmentStageChildren\", $staged, $showAll);\n\t\treturn $staged;\n\t}"
] | [
"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 sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// SetLimit sets the Limit field's value. | [
"func (s *ListAliasesInput) SetLimit(v int64) *ListAliasesInput {\n\ts.Limit = &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 sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// Enable takes either a '*' or a comma-separated list of URLs that can make
// cross-origin requests to Vault. | [
"func (c *CORSConfig) Enable(ctx context.Context, urls []string, headers []string) error {\n\tif len(urls) == 0 {\n\t\treturn errors.New(\"at least one origin or the wildcard must be provided\")\n\t}\n\n\tif strutil.StrListContains(urls, \"*\") && len(urls) > 1 {\n\t\treturn errors.New(\"to allow all origins the '*... | [
"function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m... | codesearchnet | {
"query": "Represent the description about Access control:",
"pos": "Represent the code about Access control:",
"neg": "Represent the code:"
} |
Progressbar for xgboost using tqdm library.
Examples
--------
>>> model = xgb.train(params, X_train, 1000, callbacks=[xgb_progress(1000), ]) | [
"def xgb_progressbar(rounds=1000):\n \n pbar = tqdm(total=rounds)\n\n def callback(_, ):\n pbar.update(1)\n\n return callback"
] | [
"def cric__gbm():\n \n import xgboost\n\n # max_depth and subsample match the params used for the full cric data in the paper\n # learning_rate was set a bit higher to allow for faster runtimes\n # n_estimators was chosen based on a train/test split of the data\n model = xgboost.XGBClassifier(max_... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// getIPTablesRestoreVersionString runs "iptables-restore --version" to get the version string
// in the form "X.X.X" | [
"func getIPTablesRestoreVersionString(exec utilexec.Interface, protocol Protocol) (string, error) {\n\t// this doesn't access mutable state so we don't need to use the interface / runner\n\n\t// iptables-restore hasn't always had --version, and worse complains\n\t// about unrecognized commands but doesn't exit when... | [
"protected function showHelp($msg = '', $code = 0)\n {\n $usage = Cli::color('USAGE:', 'brown');\n $commands = Cli::color('COMMANDS:', 'brown');\n $sOptions = Cli::color('SPECIAL OPTIONS:', 'brown');\n $pOptions = Cli::color('PUBLIC OPTIONS:', 'brown');\n $version = Cli::color(... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about PHP programming:"
} |
Gets an object from context - by name.
@param name name of object
@return object or null if not found. | [
"protected TemplateModel get(Object name) {\n try {\n return FreeMarkerTL.getEnvironment().getVariable(name.toString());\n } catch (Exception e) {\n throw new ViewException(e);\n }\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 sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Maximize
4 x1 + 2 x2 + 3 x3 + x4
Subject To
x1 + x2 <= 1
End | [
"def format_lp(nodes, constraints_x, qa, constraints_y, qb):\n \n lp_handle = cStringIO.StringIO()\n\n lp_handle.write(\"Maximize\\n \")\n records = 0\n for i, score in nodes:\n lp_handle.write(\"+ %d x%d \" % (score, i))\n # SCIP does not like really long string per row\n record... | [
"def calcOffset(self, x, y):\n \"\"\"\"\"\"\n # Datalayout\n # X = longitude\n # Y = latitude\n # Sample for size 1201x1201\n # ( 0/1200) ( 1/1200) ... (1199/1200) (1200/1200)\n # ( 0/1199) ( 1/1199) ... (1199/1199) (1200/1199)\n ... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Returns the items for the specified type.
@param string item type (e.g. 'PostStatus').
@return array item names indexed by item code. The items are order by their position values.
An empty array is returned if the item type does not exist. | [
"public static function items($type)\n\t{\n\t\tif(!isset(self::$_items[$type]))\n\t\t\tself::loadItems($type);\n\t\treturn self::$_items[$type];\n\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 post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Parses an item id
@param id
the identifier of the entity, such as "Q42"
@param siteIri
the siteIRI that this value refers to
@throws IllegalArgumentException
if the id is invalid | [
"static EntityIdValue fromId(String id, String siteIri) {\n\t\tswitch (guessEntityTypeFromId(id)) {\n\t\t\tcase EntityIdValueImpl.JSON_ENTITY_TYPE_ITEM:\n\t\t\t\treturn new ItemIdValueImpl(id, siteIri);\n\t\t\tcase EntityIdValueImpl.JSON_ENTITY_TYPE_PROPERTY:\n\t\t\t\treturn new PropertyIdValueImpl(id, siteIri);\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 post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// parseQueryMeta is used to help parse query meta-data
//
// TODO(rb): bug? the error from this function is never handled | [
"func parseQueryMeta(resp *http.Response, q *QueryMeta) error {\n\theader := resp.Header\n\n\t// Parse the X-Consul-Index (if it's set - hash based blocking queries don't\n\t// set this)\n\tif indexStr := header.Get(\"X-Consul-Index\"); indexStr != \"\" {\n\t\tindex, err := strconv.ParseUint(indexStr, 10, 64)\n\t\t... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github post about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
// SetReservedDBInstancesOfferingId sets the ReservedDBInstancesOfferingId field's value. | [
"func (s *ReservedDBInstance) SetReservedDBInstancesOfferingId(v string) *ReservedDBInstance {\n\ts.ReservedDBInstancesOfferingId = &v\n\treturn s\n}"
] | [
"func rdsCustomizations(a *API) {\n\tinputs := []string{\n\t\t\"CopyDBSnapshotInput\",\n\t\t\"CreateDBInstanceReadReplicaInput\",\n\t\t\"CopyDBClusterSnapshotInput\",\n\t\t\"CreateDBClusterInput\",\n\t}\n\tfor _, input := range inputs {\n\t\tif ref, ok := a.Shapes[input]; ok {\n\t\t\tref.MemberRefs[\"SourceRegion\"... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// SetEvent sets the Event field's value. | [
"func (s *UnsubscribeFromEventInput) SetEvent(v string) *UnsubscribeFromEventInput {\n\ts.Event = &v\n\treturn s\n}"
] | [
"private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo... | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodManifestConfig. | [
"func (in *PodManifestConfig) DeepCopy() *PodManifestConfig {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(PodManifestConfig)\n\tin.DeepCopyInto(out)\n\treturn out\n}"
] | [
"func (resource *Bundle) MarshalJSON() ([]byte, error) {\n\tresource.ResourceType = \"Bundle\"\n\t// Dereferencing the pointer to avoid infinite recursion.\n\t// Passing in plain old x (a pointer to Bundle), would cause this same\n\t// MarshallJSON function to be called again\n\treturn json.Marshal(*resource)\n}"
] | codesearchnet | {
"query": "Represent the comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
Set the visibility of the menu item and any sub items in accordance
with the specified user role.
@param \Zend_Acl $acl
@param string $userRole
@return \Gems_Menu_MenuAbstract (continuation pattern) | [
"protected function applyAcl(\\MUtil_Acl $acl, $userRole)\n {\n foreach ($this->_subItems as $item) {\n\n $allowed = $item->get('allowed', true);\n\n if ($allowed && ($privilege = $item->get('privilege'))) {\n $allowed = $acl->isAllowed($userRole, null, $privilege);\n ... | [
"public function removeAccessLevel($key)\n {\n if (!isset($this->accessLevels[$key])) {\n return false;\n }\n \n // Remove the access level\n unset($this->accessLevels[$key]);\n \n // Save the access levels\n $this->saveAccessLevels();\n \... | codesearchnet | {
"query": "Represent the comment about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software Development:"
} |
// You should always use this function to get a new AddBaremetalRctParams instance,
// as then you are sure you have configured all required params | [
"func (s *BaremetalService) NewAddBaremetalRctParams(baremetalrcturl string) *AddBaremetalRctParams {\n\tp := &AddBaremetalRctParams{}\n\tp.p = make(map[string]interface{})\n\tp.p[\"baremetalrcturl\"] = baremetalrcturl\n\treturn p\n}"
] | [
"function (err, collection) {\n if (err) {\n return callback(err);\n }\n\n // ensure that the collection option is present before starting a run\n if (!_.isObject(collection)) {\n return callback(new Error(COLLECTION_L... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
Identifies the separator of data in a filepath.
It reads the first line of the file and counts supported separators.
Currently supported separators: ['|', ';', ',','\t',':'] | [
"def identify_sep(filepath):\n \n ext = os.path.splitext(filepath)[1].lower()\n allowed_exts = ['.csv', '.txt', '.tsv']\n assert ext in ['.csv', '.txt'], \"Unexpected file extension {}. \\\n Supported extensions {}\\n filename: {}\".format(\n ... | [
"function showHelp() {\n var hlp = [\n '',\n ' Usage: \\x1B[1mjspp\\x1B[0m [options] [file...]',\n '',\n ' Tiny C-style source file preprocessor for JavaScript, with duplicate',\n ' empty lines and comments remover.',\n '',\n ' If no file name are given, jspp reads from the standard ... | codesearchnet | {
"query": "Represent the summarization about File management:",
"pos": "Represent the code about File management:",
"neg": "Represent the code:"
} |
Reads an array from the stream.
@warning: There is a very specific problem with AMF3 where the first
three bytes of an encoded empty C{dict} will mirror that of an encoded
C{{'': 1, '2': 2}} | [
"def readArray(self):\n \n size = self.readInteger(False)\n\n if size & REFERENCE_BIT == 0:\n return self.context.getObject(size >> 1)\n\n size >>= 1\n\n key = self.readBytes()\n\n if key == '':\n # integer indexes only -> python list\n resu... | [
"def _ordered_struct_start_handler(handler, ctx):\n \n _, self = yield\n self_handler = _create_delegate_handler(self)\n (length, _), _ = yield ctx.immediate_transition(\n _var_uint_field_handler(self_handler, ctx)\n )\n if length < 2:\n # A valid field name/value pair is at least tw... | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
If the cell is a date, format it to MM/DD/YYYY, stripping time. | [
"def format_date(a_cell)\n isdate = true if(nil != (dt = a_cell.match(@date_RE)))\n isdate = true if(isdate || (nil != (dt = a_cell.match(@date_with_dashes_RE))) )\n isdate = true if(isdate || (nil != (dt = a_cell.match(@date_with_time_RE))) )\n if isdate\n begin\n mod_dt = DateTime.parse(a_... | [
"def parse_date(string, force_datetime=False):\n \n matches = DATE.match(string)\n if not matches:\n return None\n\n values = dict([\n (\n k,\n v if v[0] in '+-' else int(v)\n ) for k,v in matches.groupdict().items() if v and int(v)\n ])\n\n if 'timestamp... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get top and left padding for same mode only for 3d convolutions
@param outSize
@param inSize
@param kernel
@param strides
@return | [
"public static int[] get3DSameModeTopLeftPadding(int[] outSize, int[] inSize, int[] kernel, int[] strides,\n int[] dilation) {\n int[] eKernel = effectiveKernelSize(kernel, dilation);\n int[] outPad = new int[3];\n outPad[0] = ((outSize[0] - 1)... | [
"def BL(self, params):\n \n label = self.get_one_parameter(self.ONE_PARAMETER, params)\n\n self.check_arguments(label_exists=(label,))\n # TODO check if label is within +- 16 MB\n\n # BL label\n def BL_func():\n self.register['LR'] = self.register['PC'] # No nee... | codesearchnet | {
"query": "Represent the comment about Image processing:",
"pos": "Represent the code about Image processing:",
"neg": "Represent the code:"
} |
Delete a domain mail forward. | [
"def delete(gandi, address, force):\n \"\"\"\"\"\"\n source, domain = address\n\n if not force:\n proceed = click.confirm('Are you sure to delete the domain '\n 'mail forward %s@%s ?' % (source, domain))\n\n if not proceed:\n return\n\n result = ga... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Perform the addition of the two top values on the data stack in the given
DMLContext. This method will handle long, double, and string values.
Exceptions are thrown if the types of the arguments do not match or they
are another type. | [
"@Override\n\tpublic Element execute(Context context) {\n\n\t\ttry {\n\t\t\tElement[] args = calculateArgs(context);\n\t\t\tProperty a = (Property) args[0];\n\t\t\tProperty b = (Property) args[1];\n\t\t\treturn execute(sourceRange, a, b);\n\t\t} catch (ClassCastException cce) {\n\t\t\tthrow new EvaluationException(... | [
"private static String identifyBadCast(Type lhs, Type rhs, Types types) {\n if (!lhs.isPrimitive()) {\n return null;\n }\n if (types.isConvertible(rhs, lhs)) {\n // Exemption if the rhs is convertible to the lhs.\n // This allows, e.g.: <byte> &= <byte> since the narrowing conversion can nev... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
************* RAW HTML **************** | [
"public Rule InlineHtml() {\n return NodeSequence(\n FirstOf(HtmlComment(), HtmlTag()),\n push(new InlineHtmlNode(ext(SUPPRESS_INLINE_HTML) ? \"\" : match()))\n );\n }"
] | [
"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 description:",
"pos": "Represent the code:",
"neg": "Represent the code about PHP programming:"
} |
Block for random integer between [X] and [Y].
@this Blockly.Block | [
"function() {\n this.jsonInit({\n \"message0\": Blockly.Msg.MATH_RANDOM_INT_TITLE,\n \"args0\": [\n {\n \"type\": \"input_value\",\n \"name\": \"FROM\",\n \"check\": \"Number\"\n },\n {\n \"type\": \"input_value\",\n \"name\": \"TO\",\n ... | [
"func (s *StringCodeGenerator) Init() {\n\ts.Position = vm.Position{State: vm.NewState()}\n\ts.Lines = []string{\"(Exported by gocnc)\", \"G21G90\\n\"}\n}"
] | codesearchnet | {
"query": "Represent the Github instruction:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Gets the value(s) for <b>alias</b> ().
creating it if it does
not exist. Will not return <code>null</code>.
<p>
<b>Definition:</b>
Identifies additional names by which this element might also be known
</p> | [
"public java.util.List<StringDt> getAlias() { \n\t\tif (myAlias == null) {\n\t\t\tmyAlias = new java.util.ArrayList<StringDt>();\n\t\t}\n\t\treturn myAlias;\n\t}"
] | [
"public static IGroupMember getGroupMember(String key, Class<?> type) throws GroupsException {\n /*\n * WARNING: The 'type' parameter is not the leafType; you're obligated\n * to say whether you want a group or a non-group (i.e. some type of\n * entity). In fact, the underlying imp... | codesearchnet | {
"query": "Represent the Github text about Data management:",
"pos": "Represent the Github code about Data management:",
"neg": "Represent the Github code about Software development:"
} |
// DeleteMachineSnapshot deletes the specified snapshot.
// See API docs: http://apidocs.joyent.com/cloudapi/#DeleteMachineSnapshot | [
"func (c *Client) DeleteMachineSnapshot(machineID, snapshotName string) error {\n\treq := request{\n\t\tmethod: client.DELETE,\n\t\turl: makeURL(apiMachines, machineID, apiSnapshots, snapshotName),\n\t\texpectedStatus: http.StatusNoContent,\n\t}\n\tif _, err := c.sendRequest(req); err != nil {\n\... | [
"def limits(args):\n \n # https://aws.amazon.com/about-aws/whats-new/2014/06/19/amazon-ec2-service-limits-report-now-available/\n # Console-only APIs: getInstanceLimits, getAccountLimits, getAutoscalingLimits, getHostLimits\n # http://boto3.readthedocs.io/en/latest/reference/services/dynamodb.html#Dynam... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SyncStrategyHook. | [
"func (in *SyncStrategyHook) DeepCopy() *SyncStrategyHook {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(SyncStrategyHook)\n\tin.DeepCopyInto(out)\n\treturn out\n}"
] | [
"func (cip *cachedSelectorPolicy) Consume(owner policy.PolicyOwner, cache cache.IdentityCache) *policy.EndpointPolicy {\n\t// TODO: This currently computes the EndpointPolicy from SelectorPolicy\n\t// on-demand, however in future the cip is intended to cache the\n\t// EndpointPolicy for this Identity and emit datap... | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
通过传入zealot xml文件对应的命名空间和zealot节点的ID来生成和获取sqlInfo信息(无参的SQL).
@param nameSpace xml命名空间
@param zealotId xml中的zealotId
@return 返回SqlInfo对象 | [
"public static SqlInfo getSqlInfo(String nameSpace, String zealotId) {\n return getSqlInfo(nameSpace, zealotId, null);\n }"
] | [
"public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Provides access to a root cause Exception that might have occurred in a complex include scenario.<p>
@param req the current request
@return the root cause exception or null if no root cause exception is available
@see #getThrowable() | [
"public static Throwable getThrowable(ServletRequest req) {\n\n CmsFlexController controller = (CmsFlexController)req.getAttribute(ATTRIBUTE_NAME);\n if (controller != null) {\n return controller.getThrowable();\n } else {\n return null;\n }\n }"
] | [
"public OptionalThing<Redirectable> getMappedRedirectable() { // exists after application exception handling\n final Class<?> exType = getClass();\n return OptionalThing.ofNullable(mappedRedirectable, () -> {\n throw new IllegalStateException(\"Not found the mapped redirectable in exception... | codesearchnet | {
"query": "Represent the text about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Language and Writing:"
} |
// Validate inspects the fields of the type to determine if they are valid. | [
"func (s *CreateComputerInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateComputerInput\"}\n\tif s.ComputerName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ComputerName\"))\n\t}\n\tif s.ComputerName != nil && len(*s.ComputerName) < 1 {\n\t\tinvalidParams.Add(r... | [
"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 text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Returns the local time or <tt>null</tt> if the time hasn't been set.
@return the local time. | [
"public Date getTime() {\n if (utc == null) {\n return null;\n }\n Date date = null;\n try {\n date = XmppDateTime.parseDate(utc);\n }\n catch (Exception e) {\n LOGGER.log(Level.SEVERE, \"Error getting local time\", e);\n }\n r... | [
"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 sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
Controller Service API to create scope.
@param scope Name of scope to be created.
@return Status of create scope. | [
"public CompletableFuture<CreateScopeStatus> createScope(final String scope) {\n Exceptions.checkNotNullOrEmpty(scope, \"scope\");\n try {\n NameUtils.validateScopeName(scope);\n } catch (IllegalArgumentException | NullPointerException e) {\n log.warn(\"Create scope failed... | [
"@Help(\n help =\n \"Resumes a NSR that failed while executing a script in a VNFR. The id in the URL specifies the Network Service Record that will be resumed.\"\n )\n public void resume(final String idNsr) throws SDKException {\n String url = idNsr + \"/resume\";\n requestPost(url);\n }"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the recommended extension for a given format | [
"def get_format_extension(fmt):\n '''\n \n '''\n\n if fmt is None:\n return 'dict'\n\n fmt = fmt.lower()\n if fmt not in _converter_map:\n raise RuntimeError('Unknown basis set format \"{}\"'.format(fmt))\n\n return _converter_map[fmt]['extension']"
] | [
"def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated... | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
Return GlyphData holding data from a list of XML file paths. | [
"def from_files(cls, *glyphdata_files):\n \"\"\"\"\"\"\n name_mapping = {}\n alt_name_mapping = {}\n production_name_mapping = {}\n\n for glyphdata_file in glyphdata_files:\n glyph_data = xml.etree.ElementTree.parse(glyphdata_file).getroot()\n for glyph in gl... | [
"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 comment about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
// NewSubExpression instanciates a new subexpression node. | [
"func NewSubExpression(pos int, line int) *SubExpression {\n\treturn &SubExpression{\n\t\tNodeType: NodeSubExpression,\n\t\tLoc: Loc{pos, line},\n\t}\n}"
] | [
"public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Recursively iterate through values in nested lists. | [
"def empty_tree(input_list):\n \"\"\"\"\"\"\n for item in input_list:\n if not isinstance(item, list) or not empty_tree(item):\n return False\n return True"
] | [
"@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:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
overwrite the unregisterAdapterDataObserver to correctly forward all events to the FastAdapter
@param observer | [
"@Override\n public void unregisterAdapterDataObserver(RecyclerView.AdapterDataObserver observer) {\n super.unregisterAdapterDataObserver(observer);\n if (mFastAdapter != null) {\n mFastAdapter.unregisterAdapterDataObserver(observer);\n }\n }"
] | [
"public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
检查传递的字符串是否与给定的通配符模式匹配.
@param string $pattern 通配符.
@param string $string 字符串.
@param array $options 用于匹配的选项.
@param bool $caseSensitive 是否区分大小写,默认为'true'.
@param bool $escape 反斜杠是否转义,默认为'true'.
@param bool $filePath 斜线是否匹配,默认为'false'.
@return bool | [
"public static function matchWildcard(\r\n string $pattern,\r\n string $string,\r\n array $options = []\r\n ): bool {\r\n if ($pattern === '*' && empty($options['filePath'])) {\r\n return true;\r\n }\r\n\r\n $replacements = [\r\n '\\\\\\\\\\\\\\\\' ... | [
"protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------... | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about text processing:"
} |
Any value literal may be a valid representation of a Scalar, depending on
that scalar type. | [
"function isValidScalar(context: ValidationContext, node: ValueNode): void {\n // Report any error at the full type expected by the location.\n const locationType = context.getInputType();\n if (!locationType) {\n return;\n }\n\n const type = getNamedType(locationType);\n\n if (!isScalarType(type)) {\n ... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the description about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about programming:"
} |
asserts a http method
@param string $method
@return $this | [
"private function assertHttpMethod($method) {\n if (!$this->assertString($method)) return false;\n $validHttpMethods = array(\n 'GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT', 'PATCH', 'LINK', 'UNLINK'\n );\n if (!in_array($method, $validHttpMethods)) re... | [
"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 summarization about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
// MarshalJSON method of BoxComponent | [
"func (c *BoxComponent) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(&struct {\n\t\tType FlexComponentType `json:\"type\"`\n\t\tLayout FlexBoxLayoutType `json:\"layout\"`\n\t\tContents []FlexComponent `json:\"contents\"`\n\t\tFlex *int `json:\"flex,omit... | [
"public Descriptor replaceAllCalls(PSequence<Call<?, ?>> calls) {\n return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);\n }"
] | codesearchnet | {
"query": "Represent the sentence about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
Gets options and values for everything passed in to the command line including unamed options.
@return An <code>Map.Entry</code> of options and values for everything passed in to the command line including
unamed options. | [
"public Set<Map.Entry<String, String>> getSetEntries() {\n Set<Map.Entry<String, String>> entries = optionSet.stream()\n .filter(this::isSet)\n .map(no -> Tuple2.of(no.getName(),\n ... | [
"def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types... | codesearchnet | {
"query": "Represent the post about Computer Science:",
"pos": "Represent the code about Computer Science:",
"neg": "Represent the code:"
} |
Re-render the titles of the todo item. | [
"function () {\n\t\t\t// Backbone LocalStorage is adding `id` attribute instantly after creating a model.\n\t\t\t// This causes our TodoView to render twice. Once after creating a model and once on `id` change.\n\t\t\t// We want to filter out the second redundant render, which is caused by this `id` change.\n\t\t\t... | [
"def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Register the package requirements.
@see ChunkUploadServiceProvider::registerConfig() | [
"public function register()\n {\n // Register the commands\n $this->commands([\n ClearChunksCommand::class,\n ]);\n\n // Register the config\n $this->registerConfig();\n\n // Register the config via abstract instance\n $this->app->singleton(AbstractConf... | [
"@Override\n public void performFileBasedAction(Collection<File> files) {\n Tr.audit(tc, \"LTPA_KEYS_TO_LOAD\", keyImportFile);\n submitTaskToCreateLTPAKeys();\n }"
] | codesearchnet | {
"query": "Represent the description about Logistics:",
"pos": "Represent the code about Logistics:",
"neg": "Represent the code about Software Development:"
} |
cfitsio reads as characters 'T' and 'F' -- convert to real boolean
If input is a fits bool, convert to numpy boolean | [
"def _convert_bool_array(self, array):\n \n\n output = (array.view(numpy.int8) == ord('T')).astype(numpy.bool)\n return output"
] | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
@param string $key
@param string $language
@return string | [
"public function getLabel($key, $language)\n {\n if (!is_array($this->labels) || !array_key_exists($key, $this->labels)) {\n return 'n/a';\n }\n\n if (!is_array($this->labels[$key]) || !array_key_exists($language, $this->labels[$key])) {\n return 'n/a';\n }\n\n ... | [
"static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}"
] | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
If a widget was converted and the Form data was submitted through an Ajax request,
then these data fields must be converted to suit the Django Form validation | [
"def rectify_ajax_form_data(self, data):\n \n for name, field in self.base_fields.items():\n try:\n data[name] = field.convert_ajax_data(data.get(name, {}))\n except AttributeError:\n pass\n return data"
] | [
"def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Language and programming:"
} |
@param string|null $view
@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | [
"public function render($view = null)\n {\n if ($this->hasChild() && ! $this->hasClassProperty($class = config('navigation.class.has_child', 'treeview'))) {\n $this->setHtmlAttribute('class', $class);\n }\n\n $data = $this->toArray();\n\n if (! is_null($view)) {\n ... | [
"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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Schedules expiration of new users from policy and existing ones
@param [Array<LoginUsers>] Array of updated users
== Returns:
@return [TrueClass] always returns true | [
"def manage_existing_users(new_policy_users)\n now = Time.now\n\n previous = {}\n if InstanceState.login_policy\n InstanceState.login_policy.users.each do |user|\n previous[user.uuid] = user\n end\n end\n\n current = {}\n new_policy_users.each do |user|\n ... | [
"def delete(self, instance):\n \n \n #TODO: Really drop the database based on a policy set in `instance.parameters`.\n #\n # We need :\n # - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop => default to retain)\n # - t... | codesearchnet | {
"query": "Represent the text about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about AWS Auto Scaling:"
} |
/* (non-Javadoc)
@see com.abubusoft.kripton.processor.core.ModelElementVisitor#visit(com.abubusoft.kripton.processor.core.ModelProperty) | [
"@Override\n\tpublic void visit(SQLProperty property) throws Exception {\n\t\t// add property index\n\t\tclassBuilder.addField(FieldSpec.builder(Integer.TYPE, \"index\"+(counter++), Modifier.PROTECTED).addJavadoc(\"Index for column $S\\n\", property.getName()).build());\n\n\t}"
] | [
"private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }"
] | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get the extension information.
@param boolean $reload Force reloading?
@return \stdClass | [
"public function getExtension($reload = false)\n\t{\n\t\tif ($reload || null === $this->extension)\n\t\t{\n\t\t\t$this->extension = $this->loadExtension();\n\t\t}\n\n\t\treturn clone $this->extension;\n\t}"
] | [
"private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope... | codesearchnet | {
"query": "Represent the Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Test if two graphics devices should be considered the same device | [
"def _graphics_equal(gfx1, gfx2):\n '''\n \n '''\n def _filter_graphics(gfx):\n '''\n When the domain is running, the graphics element may contain additional properties\n with the default values. This function will strip down the default values.\n '''\n gfx_copy = copy... | [
"function createGraph(options) {\n // Graph structure is maintained as dictionary of nodes\n // and array of links. Each node has 'links' property which\n // hold all links related to that node. And general links\n // array is used to speed up all links enumeration. This is inefficient\n // in terms of memory,... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Returns the name of the given type, including any enclosing types but not the package. | [
"static String classNameOf(TypeElement type) {\n String name = type.getQualifiedName().toString();\n String pkgName = packageNameOf(type);\n return pkgName.isEmpty() ? name : name.substring(pkgName.length() + 1);\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 post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Software development:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.