query stringlengths 16 255 | pos list | neg list | task stringclasses 1
value | instruction dict |
|---|---|---|---|---|
Returns description of method parameters
@return external_function_parameters
@since Moodle 3.7 | [
"public static function get_async_backup_progress_parameters() {\n return new external_function_parameters(\n array(\n 'backupids' => new external_multiple_structure(\n new external_value(PARAM_ALPHANUM, 'Backup id to get progress for', VALUE_REQUIRED, null, N... | [
"public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about N/A:"
} |
Call each module
module_gen should be a iterator | [
"def call_multiple_modules(module_gen):\n \n for args_seq in module_gen:\n module_name_or_path = args_seq[0]\n with replace_sys_args(args_seq):\n if re.match(VALID_PACKAGE_RE, module_name_or_path):\n runpy.run_module(module_name_or_path,\n ... | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Checks if a given value is of a specific type
:param value: the value to check
:param data_type: the type to be checked upon
:return: | [
"def check_value_and_type(value, data_type):\n \n if value is not None and data_type is not type(None):\n # if not isinstance(value, data_type):\n if not type_inherits_of_type(data_type, type(value)):\n raise TypeError(\n \"Value: '{0}' is not of... | [
"def _infer_embedded_object(value):\n \n\n if value is None:\n # The default behavior is to assume that a value of None is not\n # an embedded object. If the user wants that, they must specify\n # the embedded_object parameter.\n return False\n\n if isinstance(value, list):\n ... | codesearchnet | {
"query": "Represent the instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
// Decompress decompresses coordinate x and ylsb (y's least significant bit) into a Point P on EllipticCurve ec. | [
"func (ec *EllipticCurve) Decompress(x *big.Int, ylsb uint) (P Point, err error) {\n\t/* y**2 = x**3 + a*x + b % p */\n\trhs := addMod(\n\t\taddMod(\n\t\t\texpMod(x, big.NewInt(3), ec.P),\n\t\t\tmulMod(ec.A, x, ec.P),\n\t\t\tec.P),\n\t\tec.B, ec.P)\n\n\t/* y = sqrt(rhs) % p */\n\ty := sqrtMod(rhs, ec.P)\n\n\t/* Us... | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the Github text about mathematics:",
"pos": "Represent the Github code about mathematics:",
"neg": "Represent the Github code:"
} |
Set associations for "self relation" type Modules.
@param string $module Module name
@param mixed[] $fields CSV Fields
@return void | [
"private function setByTypeSelfRelationField(string $module, array $fields) : void\n {\n $first = $fields[0];\n $second = $fields[1];\n\n $this->setAssociation(\n 'belongsToMany',\n static::generateAssociationName($module, $first->getName()),\n [\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 text about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Update volume | [
"func (v *volumeClient) Set(volumeID string, locator *api.VolumeLocator,\n\tspec *api.VolumeSpec) error {\n\treturn v.doVolumeSet(\n\t\tvolumeID,\n\t\t&api.VolumeSetRequest{\n\t\t\tLocator: locator,\n\t\t\tSpec: spec,\n\t\t},\n\t)\n}"
] | [
"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 Github instruction about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// DecodeObject is the same as Decode but it returns map[string]interface{}.
// You should use it to parse JSON objects. | [
"func DecodeObject(data []byte) (map[string]interface{}, error) {\n\td := NewDecoder(data)\n\tif c := d.skipSpaces(); c != '{' {\n\t\treturn nil, d.error(c, \"looking for beginning of object\")\n\t}\n\tval, err := d.object()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif c := d.skipSpaces(); d.pos < d.end {\n\t... | [
"@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }"
] | codesearchnet | {
"query": "Represent the Github description about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software development:"
} |
pc: Control any PLC device. | [
"def pc_encode(index, function_code, extended_code, time):\n \"\"\"\"\"\"\n return MessageEncode('11pc{hc}{fc:02d}{ec:02d}{time:04d}00'.\n format(hc=index_to_housecode(index),\n fc=function_code, ec=extended_code,\n time=tim... | [
"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 comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Add a dependence of a statement to a function. The statement's
dependence string is altered with this function.
@param function The function to add as dependee.
@param catalogStmt The statement to add as depender. | [
"private static void addStatementDependence(Function function, Statement catalogStmt) {\n String fnDeps = catalogStmt.getFunctiondependees();\n Set<String> fnSet = new TreeSet<>();\n for (String fnName : fnDeps.split(\",\")) {\n if (! fnName.isEmpty()) {\n fnSet.add(fn... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// Get a list of pods that have data directories. | [
"func (kl *Kubelet) listPodsFromDisk() ([]types.UID, error) {\n\tpodInfos, err := ioutil.ReadDir(kl.getPodsDir())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpods := []types.UID{}\n\tfor i := range podInfos {\n\t\tif podInfos[i].IsDir() {\n\t\t\tpods = append(pods, types.UID(podInfos[i].Name()))\n\t\t}\n\t}\n\t... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Returns a new string based on <code>source</code> with all instances of <code>before</code>
replaced with <code>after</code>.
@deprecated java.lang.String.replace() was added in 1.5 | [
"@Deprecated @ReplacedBy(value=\"java.lang.String.replace()\", reason=\"since 1.5\")\n public static String replace (String source, String before, String after)\n {\n int pos = source.indexOf(before);\n if (pos == -1) {\n return source;\n }\n\n StringBuilder sb = new Str... | [
"function DocBlockParser(conf) {\n conf = conf || {};\n this.docBlockPattern = conf.docBlockPattern || '\\\\\\/\\\\\\*\\\\\\*[^]*?\\\\\\*\\\\\\/';\n this.docBlockStrip = '(^\\\\\\s*\\\\\\/\\\\\\*\\\\\\*)|(\\\\\\*\\\\\\/\\\\\\s*$)';\n\n this.docLineStrip = '^\\\\\\s*\\\\\\* ?';\n\n /**\n * Skip markdown parsi... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Computer Science:"
} |
=== Params
* limit_page - Integer
* request_num - Integer
* options - Hash
=== Options
* from - Time or String
* to - Time or String
fetch reports `:from` newer `:to` older | [
"def fetch(filter_type, request_num, options = {})\n limit_page = options[:limit_page] || MAX_PAGES_DEFAULT\n filter = Filter.new(filter_type, min_time: options[:to])\n page = Page.new(session, filter, options[:from], options[:to])\n\n # NOTE: filter は report に渡したほうがシンプルじゃない?\n limit_page.t... | [
"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:"
} |
You can use ``@broker.observer()`` as a decorator to your callback
instead of :func:`Broker.add_observer`. | [
"def observer(self, component_type=ComponentType):\n \n def inner(func):\n self.add_observer(func, component_type)\n return func\n return inner"
] | [
"def use(self, middleware):\n \n\n logger.debug('use')\n logger.debug(middleware)\n\n self.middlewares.append(middleware)\n\n di.injector.register(instance=middleware)\n di.bind(middleware, auto=True)\n\n # TODO: should use DI somehow\n if check_spec(['send_te... | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about Software development:"
} |
// Path returns the path component of the URL. | [
"func (u *OfferURL) Path() string {\n\tvar parts []string\n\tif u.User != \"\" {\n\t\tparts = append(parts, u.User)\n\t}\n\tif u.ModelName != \"\" {\n\t\tparts = append(parts, u.ModelName)\n\t}\n\tpath := strings.Join(parts, \"/\")\n\tpath = fmt.Sprintf(\"%s.%s\", path, u.ApplicationName)\n\tif u.Source == \"\" {\n... | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }"
] | codesearchnet | {
"query": "Represent the Github description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// Distance returns the angle between two points. | [
"func (p Point) Distance(b Point) s1.Angle {\n\treturn p.Vector.Angle(b.Vector)\n}"
] | [
"def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]"
] | codesearchnet | {
"query": "Represent the Github sentence about mathematics:",
"pos": "Represent the Github code about mathematics:",
"neg": "Represent the Github code about Software development:"
} |
Function setListPackage
@author: 713uk13m <dev@nguyenanhung.com>
@time : 9/30/18 19:35
@param null $listPackage
@return mixed|void | [
"public function setListPackage($listPackage = NULL)\n {\n $this->listPackage = $listPackage;\n $this->debug->debug(__FUNCTION__, 'setListPackage: ' . json_encode($this->listPackage));\n\n }"
] | [
"public function pushGit()\n {\n if (!isset($this->config['git_address'])) {\n Log::info('Git地址没有配置,请在Config.php文件参照如下方式配置:' );\n Log::info('$config[\\'git_address\\']=\\'git@github.com:seeruo/seeruo.github.io.git\\';','error');\n }\n $Git = new GitService($this->config... | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Programming:"
} |
@param ReadBlockInterface $block
@return null|DisplayBlockInterface | [
"protected function getStrategy(ReadBlockInterface $block)\n {\n if (isset($this->cachedStrategies[$block->getId()])) {\n return $this->cachedStrategies[$block->getId()];\n }\n\n foreach ($this->strategies as $strategy) {\n if ($strategy->support($block)) {\n ... | [
"@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }"
] | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Run the inner task.
@param wave the wave that have triggered this command
@throws CommandException if an error occurred | [
"final void innerRun(final Wave wave) throws CommandException {\n beforePerform(wave);\n perform(wave);\n afterPerform(wave);\n }"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github text about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
/*
Tracks changes to dependent arrays, as well as to properties of items in
dependent arrays.
@class DependentArraysObserver | [
"function DependentArraysObserver(callbacks, cp, instanceMeta, context, propertyName, sugarMeta) {\n // user specified callbacks for `addedItem` and `removedItem`\n this.callbacks = callbacks;\n\n // the computed property: remember these are shared across instances\n this.cp = cp;\n\n // th... | [
"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 Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// signURL generates a signed GS URL using the signer. | [
"func signURL(c context.Context, gsPath string, signer *signer, expiry time.Duration) (string, error) {\n\t// See https://cloud.google.com/storage/docs/access-control/signed-urls.\n\t//\n\t// Basically, we sign a specially crafted multi-line string that encodes\n\t// expected parameters of the request. During the a... | [
"@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 description about AWS S3:",
"pos": "Represent the code about AWS S3:",
"neg": "Represent the code about programming:"
} |
// CharmURL returns the charm URL for all given units or applications. | [
"func (u *UniterAPI) CharmURL(args params.Entities) (params.StringBoolResults, error) {\n\tresult := params.StringBoolResults{\n\t\tResults: make([]params.StringBoolResult, len(args.Entities)),\n\t}\n\taccessUnitOrApplication := common.AuthAny(u.accessUnit, u.accessApplication)\n\tcanAccess, err := accessUnitOrAppl... | [
"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 comment about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Validates response body
@param [Object] response
@raise [Exceptions::Validation] When there is a missing required header.. | [
"def validate_body!(response)\n return unless media_type\n return if media_type.kind_of? SimpleMediaType\n\n errors = self.media_type.validate(self.media_type.load(response.body))\n if errors.any?\n message = \"Invalid response body for #{media_type.identifier}.\" +\n \"Errors: #... | [
"def check_input(self, token):\n \n if not isinstance(token.payload, ModelContainer):\n raise Exception(self.full_name + \": Input token is not a ModelContainer!\")"
] | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about programming:"
} |
Starts a DROP MATERIALIZED VIEW query for the given view name for the given keyspace name. | [
"@NonNull\n public static Drop dropMaterializedView(\n @Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier viewName) {\n return new DefaultDrop(keyspace, viewName, \"MATERIALIZED VIEW\");\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:"
} |
Should be called explicitely in Controller::beforeRender()
@param Event $event beforeRender event
@return void | [
"public function beforeRender(Event $event): void\n {\n $this->setJson('isAjax', $this->_controller->request->is('ajax'));\n $this->setJson('isMobile', $this->_controller->request->is('mobile'));\n $this->setBoth('isDialog', $this->_controller->request->is('dialog'));\n $this->setBoth... | [
"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 comment about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about Programming:"
} |
Removes the chunk layer (if exists) of the object (in memory) | [
"def remove_chunk_layer(self):\n \n if self.chunk_layer is not None:\n this_node = self.chunk_layer.get_node()\n self.root.remove(this_node)\n self.chunk_layer = None\n\n if self.header is not None:\n self.header.remove_lp('chunks')"
] | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// SkipUnless will Skip the test unless the LABELS environment variable includes any of the provided labels.
//
// LABELS=integration,nightly go test -v
// | [
"func SkipUnless(t skippeable, labels ...string) {\n\tenv := strings.Split(os.Getenv(\"LABELS\"), \",\")\n\tfor _, each := range labels {\n\t\tfor _, other := range env {\n\t\t\tif each == other {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tt.Skipf(\"skipped because provided LABELS=%v does not include any of %v\", env,... | [
"func (r *printRun) RegisterIDFlag() {\n\tr.Flags.BoolVar(&r.id, \"id\", false, doc(`\n\t\tPrint only build ids.\n\n\t\tIntended for piping the output into another bb subcommand:\n\t\t\tbb ls -cl myCL -id | bb cancel\n\t`))\n}"
] | codesearchnet | {
"query": "Represent the instruction about IT infrastructure management:",
"pos": "Represent the code about IT infrastructure management:",
"neg": "Represent the code about Software Development:"
} |
//
// Streaming Endpoints
//
//The server will forward all received messages to Ginkgo reporters registered with `RegisterReporters` | [
"func (server *Server) readAll(request *http.Request) []byte {\n\tdefer request.Body.Close()\n\tbody, _ := ioutil.ReadAll(request.Body)\n\treturn body\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 Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
分岐情報追加
@param start 開始位置(文字index)
@param end 終了位置(文字index)
@param state カバレッジ状態 | [
"public void appendBranchState(int start, int end, BranchCoverageState state) {\n\t\tthis.passed.put(new Range(start, end), state);\n\t}"
] | [
"public static double calculateLofWithUpdate(int kn, int max, LofPoint addedPoint,\n LofDataSet dataSet)\n {\n // データ数が最大に達している場合には古い方からデータの削除を行う\n String deleteId = addPointToDataSet(max, addedPoint, dataSet);\n\n // K距離、K距離近傍、局所到達可能密度の更新を行う対象点の一覧を取得する。\n Set<String> updat... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Returns the height of the surface when projected at the given angle.
Args:
surface (surface): the surface to project
angle (float): the angle at which to project the surface
Returns:
surface: A projected surface. | [
"def project_surface(surface, angle=DEFAULT_ANGLE):\n \n z_coef = np.sin(np.radians(angle))\n y_coef = np.cos(np.radians(angle))\n\n surface_height, surface_width = surface.shape\n slope = np.tile(np.linspace(0., 1., surface_height), [surface_width, 1]).T\n\n return slope * y_coef + surface * z_co... | [
"def dihedral(array_of_xyzs):\n \n p1 = array_of_xyzs[0]\n p2 = array_of_xyzs[1]\n p3 = array_of_xyzs[2]\n p4 = array_of_xyzs[3]\n\n vector1 = -1.0 * (p2 - p1)\n vector2 = p3 - p2\n vector3 = p4 - p3\n\n # Normalize vector so as not to influence magnitude of vector\n # rejections\n ... | codesearchnet | {
"query": "Represent the instruction about mathematics:",
"pos": "Represent the code about mathematics:",
"neg": "Represent the code:"
} |
Draw and return an arc
@param {Number} x X position
@param {Number} y Y position
@param {Number} r Radius
@param {Number} innerR Inner radius like used in donut charts
@param {Number} start Starting angle
@param {Number} end Ending angle | [
"function (x, y, r, innerR, start, end) {\r\n\t\t// arcs are defined as symbols for the ability to set\r\n\t\t// attributes in attr and animate\r\n\r\n\t\tif (isObject(x)) {\r\n\t\t\ty = x.y;\r\n\t\t\tr = x.r;\r\n\t\t\tinnerR = x.innerR;\r\n\t\t\tstart = x.start;\r\n\t\t\tend = x.end;\r\n\t\t\tx = x.x;\r\n\t\t}\r\n... | [
"function (inData, outData, width, height, options) {\n /* options:\n * - dx: horizontal offset (in pixels) of the effect.\n * - dy: vertical offset (in pixels) of the effect.\n * - radius: the radius of the effect in pixels.\n * - zoom: the amount of bulge (0.0-1.0).\n ... | codesearchnet | {
"query": "Represent the description about mathematics:",
"pos": "Represent the code about mathematics:",
"neg": "Represent the code:"
} |
// SetRoleARN sets the RoleARN field's value. | [
"func (s *ClusterMetadata) SetRoleARN(v string) *ClusterMetadata {\n\ts.RoleARN = &v\n\treturn s\n}"
] | [
"function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ... | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code about Software development:"
} |
/*!
Converts an array with Unicode values into an UTF8 string and returns it. | [
"static function convertUnicodeToString( $unicodeValues )\n {\n if ( !is_array( $unicodeValues ) )\n return false;\n $text = '';\n foreach ( $unicodeValues as $unicodeValue )\n {\n $utf8Char = eZUTF8Codec::toUTF8( $unicodeValue );\n $text .= $utf8Char;... | [
"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 text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
the state of execution | [
"protected function pushEnv($block = null)\n {\n $e = new stdclass();\n $e->parent = $this->env;\n $e->store = array();\n $e->block = $block;\n\n $this->env = $e;\n\n return $e;\n }"
] | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Funding gets added to noaa_data_sorted with LiPD keys. Change those keys to NOAA
:return none: | [
"def __reorganize_funding(self):\n \n _map = {\"agency\": \"Funding_Agency_Name\", \"grant\": \"Grant\"}\n try:\n _l = []\n for item in self.noaa_data_sorted[\"Funding_Agency\"]:\n _tmp = {}\n for lpd_name, noaa_name in _map.items():\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Loads the app categories.<p>
@return the app categories | [
"private Map<String, I_CmsAppCategory> loadCategories() {\n\n Map<String, I_CmsAppCategory> appCategories = new HashMap<String, I_CmsAppCategory>();\n CmsAppCategory main = new CmsAppCategory(MAIN_CATEGORY_ID, null, 0, 0);\n appCategories.put(main.getId(), main);\n CmsAppCategory admin =... | [
"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 instruction about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code:"
} |
Connection::prepareSqlStatement
Platform preparing a Sql statement.
@param string $sqlStatement Sql Statement to be prepared.
@param array $options Preparing Sql statement options.
@return string | [
"protected function platformPrepareSqlStatement($sqlStatement, array $options = [])\r\n {\r\n // Sqlite3::changes() returns 0 for \"DELETE FROM TABLE\" queries. This hack\r\n // modifies the query so that it a proper number of affected rows is returned.\r\n if ($this->isDeleteHack === true &... | [
"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 Github sentence about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Software Development:"
} |
Retrieves the details of an existing subscription schedule. You only need to supply the unique
subscription schedule identifier that was returned upon subscription schedule creation. | [
"public static SubscriptionSchedule retrieve(String schedule) throws StripeException {\n return retrieve(schedule, (Map<String, Object>) null, (RequestOptions) null);\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 Github summarization about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about Software development:"
} |
// NewGui returns a new Gui object with a given output mode. | [
"func NewGui(mode OutputMode) (*Gui, error) {\n\tif err := termbox.Init(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tg := &Gui{}\n\n\tg.outputMode = mode\n\ttermbox.SetOutputMode(termbox.OutputMode(mode))\n\n\tg.tbEvents = make(chan termbox.Event, 20)\n\tg.userEvents = make(chan userEvent, 20)\n\n\tg.maxX, g.maxY... | [
"def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")"
] | codesearchnet | {
"query": "Represent the post about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Chooses a new prime table capacity optimized for shrinking that (approximately) satisfies the invariant
<tt>c * minLoadFactor <= size <= c * maxLoadFactor</tt>
and has at least one FREE slot for the given size. | [
"protected int chooseShrinkCapacity(int size, double minLoad, double maxLoad) {\r\n return nextPrime(Math.max(size+1, (int) ((4*size / (minLoad+3*maxLoad)))));\r\n }"
] | [
"private final void quickSelectAndRebuild() {\n final int arrLongs = 1 << lgArrLongs_;\n\n final int pivot = (1 << lgNomLongs_) + 1; // pivot for QS\n\n thetaLong_ = selectExcludingZeros(cache_, curCount_, pivot); //messes up the cache_\n\n // now we rebuild to clean up dirty data, update count, reconfi... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Adds a new Site Map root node of type URL.
@param int $order Order for the node.
@param CNabuRole $nb_role Default role for this Site Map. If null, uses the default Role of the Site.
@return CNabuBuiltInSiteMap Returns the created instance | [
"public function addRootSiteMapForURL($order, CNabuRole $nb_role = null)\n {\n if ($nb_role === null) {\n $nb_role = $this->nb_engine->getHTTPServer()->getSite()->getDefaultRole();\n }\n\n $nb_site_map = new CNabuBuiltInSiteMap();\n $nb_site_map->setOrder($order);\n\n ... | [
"public function canEdit($member = null)\n {\n $parent = $this->Parent();\n if ($parent && $parent->exists()) {\n return $parent->canEdit($member) && !$this->isReadonly();\n } elseif (!$this->exists() && Controller::has_curr()) {\n // This is for GridFieldOrderableRows ... | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software Development:"
} |
Auto Generated Code | [
"def show_system_monitor_output_switch_status_port_status_port_state(self, **kwargs):\n \n config = ET.Element(\"config\")\n show_system_monitor = ET.Element(\"show_system_monitor\")\n config = show_system_monitor\n output = ET.SubElement(show_system_monitor, \"output\")\n ... | [
"public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }"
] | codesearchnet | {
"query": "Represent the Github instruction about Natural Language Processing:",
"pos": "Represent the Github code about Natural Language Processing:",
"neg": "Represent the Github code about File management:"
} |
Get all methods of a given kind using a given {@link MethodListBuilder}. | [
"private static <T, R> R getMethods(EnhancedAnnotatedType<T> type, MethodListBuilder<T, R> builder) {\n Collection<EnhancedAnnotatedMethod<?, ? super T>> methods = filterMethods(builder.getAllMethods(type));\n for (Class<? super T> clazz = type.getJavaClass(); clazz != null && clazz != Object.class; c... | [
"@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }"
] | codesearchnet | {
"query": "Represent the instruction about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
Output lines inside a block
@param \Leafo\ScssPhp\Formatter\OutputBlock $block | [
"protected function blockLines(OutputBlock $block)\n {\n $inner = $this->indentStr();\n\n $glue = $this->break . $inner;\n\n $this->write($inner . implode($glue, $block->lines));\n\n if (! empty($block->children)) {\n $this->write($this->break);\n }\n }"
] | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Sets the asset prefix path
@param string $prefix A prefix containing assets | [
"public function setPrefix($prefix = null)\n {\n $prefix = trim($prefix, '/');\n\n $this->prefix = ($prefix) ? trim($prefix, '/') . '/' : '';\n }"
] | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Run the database seeds. | [
"public function run()\n {\n $users = [\n [\n 'name' => 'admin',\n 'email' => 'admin@admin.com',\n 'password' => 'vercingetorige',\n 'role' => 'admin',\n 'enabled' => 1,\n ],\n ];\n\n ... | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the sentence about Database Management:",
"pos": "Represent the code about Database Management:",
"neg": "Represent the code about programming:"
} |
Returns an Uri instance with the given value.
@param string $variable Name of the variable to change
@param mixed $value New value for the variable
@return static A new or the same instance depending on if the value changed | [
"private function with($variable, $value)\n {\n if ($value === $this->$variable) {\n return $this;\n }\n\n $uri = clone $this;\n $uri->$variable = $value;\n\n return $uri;\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 instruction about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
@param HeaderInterface|string $header
@return Response | [
"public function header($header)\n {\n if ($header instanceof HeaderInterface) {\n $header = $header->toString();\n }\n\n if (empty($header)) {\n return $this;\n }\n\n header((string) $header);\n\n return $this;\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 text about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
Direct delete instruction. Registry will be stored
@see lib/ezc/Cache/src/storage/ezcCacheStorageMemory::delete() | [
"public function delete( $id = null, $attributes = array(), $search = false )\n {\n $this->forceStoreRegistry = true;\n parent::delete( $id, $attributes, $search );\n }"
] | [
"def addLocalCacheService(self):\n \"\"\n _cache = self.getCacheService()\n _cache.setName('cache_proxy')\n _cache.setServiceParent(self.hendrix)"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Creates the default factory implementation.
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"public static ColorFactory init() {\n\t\ttry {\n\t\t\tColorFactory theColorFactory = (ColorFactory)EPackage.Registry.INSTANCE.getEFactory(\"http://www.omg.org/spec/BPMN/non-normative/color\"); \n\t\t\tif (theColorFactory != null) {\n\t\t\t\treturn theColorFactory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception) {... | [
"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 post about Text generation:",
"pos": "Represent the Github code about Text generation:",
"neg": "Represent the Github code:"
} |
// NewFile creates a new Logger that writes all logs to the file
// specified by path. If overwrite is specified, the log file will be
// truncated before writing. Otherwise, the log file will be appended
// to. | [
"func NewFile(path string, overwrite bool) (*File, error) {\n\tfl := new(File)\n\n\tvar err error\n\n\tif overwrite {\n\t\tfl.fo, err = os.Create(path)\n\t} else {\n\t\tfl.fo, err = os.OpenFile(path, os.O_WRONLY|os.O_APPEND, 0644)\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfl.LogWriter = NewLogWriter(... | [
"function LoggerContext() {\n LifeCycle.call(this);\n\n /**\n * Context start time\n */\n this.startTime = new Date();\n\n /**\n * The list of trace levels that the logger context knows about\n */\n this.logLevel = new LogLevel();\n\n /**\n * Root logger, final ancestor of all ... | codesearchnet | {
"query": "Represent the Github instruction about software development:",
"pos": "Represent the Github code about software development:",
"neg": "Represent the Github code:"
} |
// ListPrivateKeyIDs does nothing | [
"func (m *Mocker) ListPrivateKeyIDs(context.Context) ([]string, error) {\n\treturn staticPrivateKeyList.Recipients(), nil\n}"
] | [
"@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true... | codesearchnet | {
"query": "Represent the Github description:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
Return the instance fields of itemtype identified by id.
@param string $itemType
@param integer $id
@param array $queryString
@return array | [
"public function getItem($itemType, $id, array $queryString = []) {\n $options = [];\n if ($queryString) {\n $options['query'] = $queryString;\n }\n $response = $this->client->request('get', $itemType . '/' . $id, $options);\n return [\n 'statusCode' => $response->getStatusC... | [
"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 description about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
This function saves the Chassis MAC, if different from stored. | [
"def remote_chassis_id_mac_uneq_store(self, remote_chassis_id_mac):\n \n if remote_chassis_id_mac != self.remote_chassis_id_mac:\n self.remote_chassis_id_mac = remote_chassis_id_mac\n return True\n return False"
] | [
"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 instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Get params from type.
@param string $type
@param string $name default: '*'
@return array type, namespace, class, name | [
"protected static function _params($type, $name = \"*\") {\n\t\tif (!$name) {\n\t\t\t$name = '*';\n\t\t}\n\t\t$library = $namespace = $class = '*';\n\n\t\tif (strpos($type, '.') !== false) {\n\t\t\t$parts = explode('.', $type);\n\t\t\t$type = array_shift($parts);\n\n\t\t\tswitch (count($parts)) {\n\t\t\t\tcase 1:\n... | [
"public function XML_val($field, $arguments = [], $cache = false)\n {\n $result = $this->obj($field, $arguments, $cache);\n // Might contain additional formatting over ->XML(). E.g. parse shortcodes, nl2br()\n return $result->forTemplate();\n }"
] | codesearchnet | {
"query": "Represent the post about Software Development:",
"pos": "Represent the code about Software Development:",
"neg": "Represent the code about Programming:"
} |
To learn steps in the recipe, in the good order | [
"public function followStepsRecipe(): callable\n {\n return function (array $steps, array $onError): ChefInterface {\n /**\n * @var Chef $this\n */\n $this->steps = \\array_values($steps);\n $this->stepsNames = \\array_flip(\\array_keys($steps));\n ... | [
"def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex... | codesearchnet | {
"query": "Represent the instruction:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
ATTENTION : Il faut faire un echo pour l'affichage ! | [
"public static function showGlyph($glyphName, $type = 'fas', $color = '', $params = '') {\n\n\t\t// Récupération du type par défaut\n\t\tif ($type == null) {\t$type = 'fas';\t}\n\n\t\t// Préparation de la variable à retourner\n\t\t$glyphMessage = \"\";\n\n\t\tif (empty($color)) {\n\t\t\tif (!empty($params)) {\n\t\t... | [
"void writeToFile() throws IOException {\r\n\t\t// on clone le counter avant de le sérialiser pour ne pas avoir de problèmes de concurrences d'accès\r\n\t\tfinal Counter counter = this.clone();\r\n\t\t// on n'écrit pas rootCurrentContextsByThreadId en fichier\r\n\t\t// puisque ces données ne seront plus vraies dans... | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Edit a form.
@param Request $request
@param int $id
@return RedirectResponse|Response | [
"public function editAction(Request $request, $id)\n {\n $formManager = $this->get('opifer.form.form_manager');\n $em = $this->get('doctrine.orm.entity_manager');\n\n $form = $formManager->getRepository()->find($id);\n\n if (!$form) {\n return $this->createNotFoundException... | [
"public function onDelete()\n {\n $this->validateRequestTheme();\n\n $type = Request::input('templateType');\n\n $this->loadTemplate($type, trim(Request::input('templatePath')))->delete();\n\n /*\n * Extensibility - documented above\n */\n $this->fireSystemEvent... | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about Programming:"
} |
// Returns a slice of the same length (big endian)
// except incremented by one.
// Appends 0x00 if bz is all 0xFF.
// CONTRACT: len(bz) > 0 | [
"func cpIncr(bz []byte) (ret []byte) {\n\tret = cp(bz)\n\tfor i := len(bz) - 1; i >= 0; i-- {\n\t\tif ret[i] < byte(0xFF) {\n\t\t\tret[i]++\n\t\t\treturn\n\t\t}\n\t\tret[i] = byte(0x00)\n\t\tif i == 0 {\n\t\t\treturn append(ret, 0x00)\n\t\t}\n\t}\n\treturn []byte{0x00}\n}"
] | [
"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 Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Get all languages.
@param bool $hydrate
@return array | [
"public static function languages($hydrate = false)\n {\n if (! isset(static::$languages)) {\n static::$languages = json_decode(static::getFile(__DIR__.'/../resources/languages.json'), true);\n }\n\n return $hydrate ? array_map(function ($language) {\n return new Langua... | [
"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:"
} |
// Signal uses the osc to generate a discreet signal | [
"func (o *Osc) Signal(length int) []float64 {\n\toutput := make([]float64, length)\n\tfor i := 0; i < length; i++ {\n\t\toutput[i] = o.Sample()\n\t}\n\treturn output\n}"
] | [
"def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
meta model subscriber on resource registration.
We watch for PHD event that provides affected entities and register
the health-event filter to the resources. | [
"def register_resources(klass, registry, resource_class):\n \n services = {'acm-certificate', 'directconnect', 'dms-instance', 'directory', 'ec2',\n 'dynamodb-table', 'cache-cluster', 'efs', 'app-elb', 'elb', 'emr', 'rds',\n 'storage-gateway'}\n if resource... | [
"def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR... | codesearchnet | {
"query": "Represent the post:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
// isLoggedIn determines if the user is currently logged in. | [
"func isLoggedIn(w http.ResponseWriter, r *http.Request) bool {\n\tlog.Debug(\"validating logged in\")\n\n\tw.Header().Set(\"WWW-Authenticate\", bearerAuthKey+\" realm=Restricted\")\n\tauth := r.Header.Get(\"Authorization\")\n\tl := len(bearerAuthKey)\n\n\t// Ensure client sent the token\n\tif len(auth) <= l+1 || a... | [
"function trackController (incoming, controller) {\n return incoming\n .withLatestFrom(controller)\n .flatMap(x => {\n\n const incomingEvent = x[0];\n const currentController = x[1];\n\n /**\n * Controller has not been set, therefore we allow this ev... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Is this filename any type of file?
@param string $filename
@return boolean | [
"public function isFile($filename)\n {\n $absolutePath = $this->parser->absoluteFilePath($filename);\n\n return file_exists($absolutePath) && is_file($absolutePath) ? $absolutePath : null;\n }"
] | [
"function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }"
] | codesearchnet | {
"query": "Represent the summarization about programming:",
"pos": "Represent the code about programming:",
"neg": "Represent the code:"
} |
// ConnectBucket is the default function used by BucketDataSource
// to connect to a Couchbase cluster to retrieve Bucket information.
// It is exposed for testability and to allow applications to
// override or wrap via BucketDataSourceOptions. | [
"func ConnectBucket(serverURL, poolName, bucketName string,\n\tauth couchbase.AuthHandler) (Bucket, error) {\n\tvar bucket *couchbase.Bucket\n\tvar err error\n\n\tif auth != nil {\n\t\tbucket, err = couchbase.ConnectWithAuthAndGetBucket(serverURL, poolName, bucketName, auth)\n\t} else {\n\t\tbucket, err = couchbase... | [
"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 about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Software development:"
} |
/*
Like 'readFullyTo', but only reads the header-part.
Starts from the beginning each time it is called. | [
"public void readHeaderTo(OutputStream os) throws IOException {\n position = 0;\n byte[] buf = new byte[(int)responseBodyStart];\n int c = read(buf,0,buf.length);\n if(c != -1) {\n os.write(buf,0,c);\n }\n }"
] | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about File management:"
} |
Marshall the given parameter object. | [
"public void marshall(ListSkillsStoreSkillsByCategoryRequest listSkillsStoreSkillsByCategoryRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (listSkillsStoreSkillsByCategoryRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n ... | [
"def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p"
] | codesearchnet | {
"query": "Represent the Github text about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
Contains information about every bucket in the DHT routing
table.
@return the routing table | [
"public ArrayList<DhtRoutingBucket> routingTable() {\n dht_routing_bucket_vector v = alert.getRouting_table();\n int size = (int) v.size();\n ArrayList<DhtRoutingBucket> l = new ArrayList<>(size);\n\n for (int i = 0; i < size; i++) {\n l.add(new DhtRoutingBucket(v.get(i)));\n ... | [
"public void setStaticRoute(NodesMap nm, Map<Link, Boolean> links) {\n routes.put(nm, links); // Only one route between two nodes (replace the old route)\n }"
] | codesearchnet | {
"query": "Represent the Github comment about AWS Route 53:",
"pos": "Represent the Github code about AWS Route 53:",
"neg": "Represent the Github code:"
} |
// get gets a sorted (by image size) image list from image cache.
// There is a potentical data race in this function. See PR #60448
// Because there is deepcopy function available currently, move sort
// function inside this function | [
"func (i *imageCache) get() []container.Image {\n\ti.Lock()\n\tdefer i.Unlock()\n\tsort.Sort(sliceutils.ByImageSize(i.images))\n\treturn i.images\n}"
] | [
"public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l... | codesearchnet | {
"query": "Represent the Github sentence about Computer Science:",
"pos": "Represent the Github code about Computer Science:",
"neg": "Represent the Github code about Software development:"
} |
Tries to lock and run cron jobs.
Args:
token: security token
force: If True, force a run
names: List of job names to run. If unset, run them all | [
"def RunOnce(self, token=None, force=False, names=None):\n \n names = names or self.ListJobs(token=token)\n urns = [self.CRON_JOBS_PATH.Add(name) for name in names]\n\n for cron_job_urn in urns:\n try:\n with aff4.FACTORY.OpenWithLock(\n cron_job_urn, blocking=False, token=token,\... | [
"def time_to_run(self, class_, time_):\n \n app_name = class_.app_name\n try:\n info = self.job_state_database[app_name]\n except KeyError:\n if time_:\n h, m = [int(x) for x in time_.split(':')]\n # only run if this hour and minute is ... | codesearchnet | {
"query": "Represent the comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
// Zip extracts a .zip archived stream of data in the specified location.
// It accepts a rename function to handle the names of the files (see the example). | [
"func (e *Extractor) Zip(ctx context.Context, body io.Reader, location string, rename Renamer) error {\n\t// read the whole body into a buffer. Not sure this is the best way to do it\n\tbuffer := bytes.NewBuffer([]byte{})\n\tcopyCancel(ctx, buffer, body)\n\n\tarchive, err := zip.NewReader(bytes.NewReader(buffer.Byt... | [
"function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ... | codesearchnet | {
"query": "Represent the sentence about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about File management:"
} |
Links OMIA groups to OMIM equivalents.
:param row:
:return: | [
"def _process_omia_omim_map(self, row):\n \n # omia_id, omim_id, added_by\n model = Model(self.graph)\n omia_id = 'OMIA:' + row['omia_id']\n omim_id = 'OMIM:' + row['omim_id']\n\n # also store this for use when we say that a given animal is\n # a model of a disease\n... | [
"def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Create HMAC Signature from secret for value. | [
"def create_signature(secret, value, digestmod='sha256', encoding='utf-8'):\n \n if isinstance(secret, str):\n secret = secret.encode(encoding)\n\n if isinstance(value, str):\n value = value.encode(encoding)\n\n if isinstance(digestmod, str):\n digestmod = getattr(hashlib, digestmod... | [
"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 text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
treats null values as empty sets
@param id a {@link QuotedID}
@param re1 a {@link RAExpressionAttributes}
@param re2 a {@link RAExpressionAttributes}
@return the union of occurrences of id in e1 and e2 | [
"private static ImmutableSet<RelationID> attributeOccurrencesUnion(QuotedID id,\n RAExpressionAttributes re1,\n RAExpressionAttributes re2) {\n\n ImmutableSet<RelationID> ... | [
"def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp... | codesearchnet | {
"query": "Represent the Github comment about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
<p>filterBeanFields.</p>
@param src a {@link java.util.Collection} object.
@param pathProperties a {@link ameba.message.internal.BeanPathProperties} object.
@param <T> a T object.
@return a {@link java.util.Collection} object. | [
"@SuppressWarnings(\"unchecked\")\n public static <T> Collection<BeanMap<T>> filterBeanFields(Collection<T> src, BeanPathProperties pathProperties) {\n return (Collection<BeanMap<T>>) FilteringBeanMap.from(src, pathProperties);\n }"
] | [
"@Override\n\t@SuppressWarnings(\"unchecked\")\n\tprotected T convert(JsonNode data) {\n\t\t// The (T) cast prevents the commandline javac from choking \"no unique maximal instance\"\n\t\treturn (T)this.mapper.convertValue(data, this.resultType);\n\t}"
] | codesearchnet | {
"query": "Represent the post about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code:"
} |
We accept sloppy urls and attempt to clean them up | [
"def parse_url(url)\n s = url\n\n # remove entities\n s = HTML_ENTITIES.decode(s)\n\n # fix a couple of common encoding bugs\n s = s.gsub(' ', '%20')\n s = s.gsub(\"'\", '%27')\n\n # append query manually (instead of letting HTTParty handle it) so we can\n # include it in cac... | [
"public static function get_contexts_for_userid(int $userid) : \\core_privacy\\local\\request\\contextlist {\n // We cannot associate files with a particular user as it would require to know all the details about\n // the source file, which only the component owning it knows about. And, the 'usermodif... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Any provider that may be used for TagsComponent can be added here. | [
"@DefaultVisibilityForTesting\n static TagsComponent loadTagsComponent(@Nullable ClassLoader classLoader) {\n try {\n // Call Class.forName with literal string name of the class to help shading tools.\n return Provider.createInstance(\n Class.forName(\n \"io.opencensus.impl.tags.... | [
"public static function get_contexts_for_userid(int $userid) : \\core_privacy\\local\\request\\contextlist {\n // We cannot associate files with a particular user as it would require to know all the details about\n // the source file, which only the component owning it knows about. And, the 'usermodif... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
Creates new Environment.
@param name Environment name.
@param project Parent Project.
@param attributes Additional attributes that should be set for Environment.
@return Newly created Environment. | [
"public Environment environment(String name, Project project, Map<String, Object> attributes) {\n Environment environment = new Environment(instance);\n\n environment.setName(name);\n environment.setProject(project);\n addAttributes(environment, attributes);\n environment.save();\... | [
"function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff... | codesearchnet | {
"query": "Represent the Github comment about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code:"
} |
// GetGenericCredential fetches the generic credential with the given name from Windows credential manager.
// It returns nil and an error if the credential could not be found or an error occurred. | [
"func GetGenericCredential(targetName string) (*GenericCredential, error) {\n\tcred, err := sysCredRead(targetName, sysCRED_TYPE_GENERIC)\n\tif cred != nil {\n\t\treturn &GenericCredential{*cred}, err\n\t}\n\treturn nil, err\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 summarization about Software Development:",
"pos": "Represent the Github code about Software Development:",
"neg": "Represent the Github code about Software development:"
} |
Get the {@link android.os.UserManager} service for this context.
@param context the context.
@return the {@link android.os.UserManager} | [
"@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)\n public static UserManager getUserManager(Context context) {\n return (UserManager) context.getSystemService(Context.USER_SERVICE);\n }"
] | [
"public static MortarScope getScope(Context context) {\n //noinspection ResourceType\n Object scope = context.getSystemService(MORTAR_SERVICE);\n if (scope == null) {\n // Essentially a workaround for the lifecycle interval where an Activity's\n // base context is not yet set to the Application, ... | codesearchnet | {
"query": "Represent the Github comment:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
// fetchUint64 retrieves an integer associated with a particular key. | [
"func (db *DB) fetchUint64(key []byte) uint64 {\n\tblob, err := db.lvl.Get(key, nil)\n\tif err != nil {\n\t\treturn 0\n\t}\n\tval, _ := binary.Uvarint(blob)\n\treturn val\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:"
} |
Returns the property to fetch along with its type (when specified)
@param Column | string $column
@return string | [
"protected function parseColumn($column) {\n\t\tif ($column instanceof Column) {\n\t\t\t$type = $column->getType();\n\t\t\treturn empty($type) ? $column->getName() : $column->getName() . ':' . $type;\n\t\t}\n\t\t\n\t\treturn $column;\n\t}"
] | [
"public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }"
] | codesearchnet | {
"query": "Represent the sentence about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about Documentation:"
} |
Build the form.
@param FormBuilderInterface $builder
@param array $options | [
"public function buildForm(FormBuilderInterface $builder, array $options)\n {\n if (!$options['data'] || null === $options['data']->getId()) {\n $options['provider']->buildCreateForm($builder, $options);\n } else {\n $options['provider']->buildEditForm($builder, $options);\n ... | [
"public function createService(ServiceLocatorInterface $serviceLocator)\n {\n $services = $serviceLocator->getServiceLocator();\n /* @var $options ModuleOptionsInterface */\n $options = $services->get(ModuleOptions::class);\n $element = new Money('money');\n return $element;\n ... | codesearchnet | {
"query": "Represent the post about Software development:",
"pos": "Represent the code about Software development:",
"neg": "Represent the code about writing:"
} |
Given a Java String, this value needs to be converted into a JavaScript compliant String.
See JavaScript: The Definitive Guide for how to do this | [
"private String convertToEcmaScriptString(String string) {\n int len = string.length();\n InternalStringBuilder buf = new InternalStringBuilder(len);\n for(int i = 0; i < len; i++) {\n char c = string.charAt(i);\n // skip the \\\\ and consume the next character either appe... | [
"public static String pathEncode(String path, Charset charset) {\n return encodeReserved(path, FragmentType.PATH_SEGMENT, charset);\n\n /*\n * path encoding is not equivalent to query encoding, there are few differences, namely dealing\n * with spaces, !, ', (, ), and ~ characters. we will need to man... | codesearchnet | {
"query": "Represent the sentence:",
"pos": "Represent the code:",
"neg": "Represent the code about Programming:"
} |
Returns current Key.
@access public
@return mixed|NULL | [
"public function key()\r\n\t{\r\n\t\t$keys\t= array_keys( $this->pairs );\r\n\t\treturn $this->position < $this->count() ? $keys[$this->position] : NULL;\r\n\t}"
] | [
"final static function f($op) {return dfcf(function(OP $op) {\n\t\t$c = df_con_hier($m = df_ar(dfpm($op), M::class), __CLASS__); /** @var string $c */ /** @var M $m */\n\t\treturn new $c($m);\n\t}, [dfp($op)]);}"
] | codesearchnet | {
"query": "Represent the Github post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code about programming:"
} |
Retrieves a type definition.
@param string $repositoryId
@param string $typeId
@return TypeDefinitionInterface|null
@throws CmisInvalidArgumentException if repository id or type id is <code>null</code> | [
"protected function getTypeDefinitionInternal($repositoryId, $typeId)\n {\n if (empty($repositoryId)) {\n throw new CmisInvalidArgumentException('Repository id must not be empty!');\n }\n\n if (empty($typeId)) {\n throw new CmisInvalidArgumentException('Type id must not... | [
"public function setId($id = '')\n {\n if (is_string($id) && (empty($id) === true || Format::isIdentifier($id, false) === true)) {\n $this->id = $id;\n } else {\n $msg = \"The 'id' argument of a body element must be a valid identifier or an empty string\";\n throw 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:"
} |
get required fields for this object
@param string $variationName a variation that can alter which fields are required
@return string[] | [
"public function getRequiredFields($variationName = null)\n {\n if (is_null($variationName)) {\n return $this->schema->required;\n }\n\n /* compose required fields based on variation */\n $requiredFields = $this->getRequiredFields();\n foreach ($this->schema->propert... | [
"function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co... | codesearchnet | {
"query": "Represent the Github instruction about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code about programming:"
} |
Get the first toplevel widget in a Gtk.Builder hierarchy.
This is mostly used for guessing purposes, and an explicit naming is
always going to be a better situation. | [
"def get_first_builder_window(builder):\n \n for obj in builder.get_objects():\n if isinstance(obj, Gtk.Window):\n # first window\n return obj"
] | [
"def _restore_clipboard_selection(self, backup: str):\n \"\"\"\"\"\"\n # Pasting takes some time, so wait a bit before restoring the content. Otherwise the restore is done before\n # the pasting happens, causing the backup to be pasted instead of the desired clipboard content.\n\n # Prog... | codesearchnet | {
"query": "Represent the text:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
Algolia does not allows to negate a group
@see https://www.algolia.com/doc/api-client/php/parameters#filters
@throws \InvalidArgumentException | [
"private function validate(Specification $spec)\n {\n if ($spec instanceof Not || $spec instanceof AndX || $spec instanceof OrX) {\n throw new \\InvalidArgumentException('Algolia does not allows to negate a group');\n }\n }"
] | [
"public static function Connection () {\n\t\t\\ickx\\fw2\\router\\Router::Connect('/{:controller}/{:action}/{:args}');\n\t\t\\ickx\\fw2\\router\\Router::Connect('/{:args}');\n\t}"
] | codesearchnet | {
"query": "Represent the Github post:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Override config-set to allow better value setting.
@param $collection
@param $key
@param $value
@return bool | [
"public function configSet($collection, $key, $value) {\n $value = base64_encode(Yaml::dump($value));\n\n if ($index = array_search('--format=json', $this->options)) {\n unset($this->options[$index]);\n }\n $this->options[] = '--format=yaml';\n $this->options[] = '-y';\n\n $pipe = \"echo '$va... | [
"protected function create_relatedObject($key, $relation_type)\n {\n $c = $this->addChild($this->working_node, 'relatedObject');\n $this->addChild($c, 'key', $key);\n $c = $this->addChild($c, 'relation');\n // Mimick ANDS with enpty value to get both tags for relation. Only for better... | codesearchnet | {
"query": "Represent the Github sentence about Software development:",
"pos": "Represent the Github code about Software development:",
"neg": "Represent the Github code:"
} |
Loads this ArrayFile into a memory-based int array.
@throws IOException | [
"public void load(MemoryIntArray intArray) throws IOException {\n if (!_file.exists() || _file.length() == 0) {\n return;\n }\n \n Chronos c = new Chronos();\n DataReader r = IOFactory.createDataReader(_file, _type);\n \n try {\n r.open();\n r.position(DATA_START_POSITION);\n ... | [
"public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }"
] | codesearchnet | {
"query": "Represent the Github sentence:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code about programming:"
} |
It converts number represented in words to numeral.
Example:
"صد و بیست و یک".to_number #=> 121 | [
"def to_number\n return @number_in_words unless @number_in_words.is_a?(String)\n\n numbers_array = make_integer_array(@number_in_words)\n\n memory = 0\n answer = 0\n reset = true\n numbers_array.each do |number|\n if reset || !(divisible_by_thousand? number)\n reset = f... | [
"def send_url(amount, redirect_url, url, api):\n '''\n \n '''\n values = {'api': api, 'amount': amount, 'redirect': redirect_url}\n send_request = requests.post(SEND_URL_FINAL, data=values)\n id_get = send_request.text\n print(id_get)\n if int(id_get) > 0:\n print(\".معتبر است id_get\... | codesearchnet | {
"query": "Represent the summarization:",
"pos": "Represent the code:",
"neg": "Represent the code about programming:"
} |
$ANTLR start synpred39_InternalPureXbase | [
"public final void synpred39_InternalPureXbase_fragment() throws RecognitionException { \n // InternalPureXbase.g:4873:6: ( ( () ( ( ( ruleJvmFormalParameter ) ) ( ',' ( ( ruleJvmFormalParameter ) ) )* )? ( ( '|' ) ) ) )\n // InternalPureXbase.g:4873:7: ( () ( ( ( ruleJvmFormalParameter ) ) ( ',' ( ... | [
"def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_"
] | codesearchnet | {
"query": "Represent the Github summarization:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
Update the component type information with
the type of the new array element.
@param newElement is the element for which the known top type in this array must be eventually updated. | [
"@SuppressWarnings(\"unchecked\")\n\tprotected final void updateComponentType(E newElement) {\n\t\tfinal Class<? extends E> lclazz = (Class<? extends E>) newElement.getClass();\n\t\tthis.clazz = (Class<? extends E>) ReflectionUtil.getCommonType(this.clazz, lclazz);\n\t}"
] | [
"NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is... | codesearchnet | {
"query": "Represent the text about Programming:",
"pos": "Represent the code about Programming:",
"neg": "Represent the code about programming:"
} |
expr : variable INC
| variable DEC | [
"def p_expr_post_incdec(p):\n ''''''\n p[0] = ast.PostIncDecOp(p[2], p[1], lineno=p.lineno(2))"
] | [
"function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD... | codesearchnet | {
"query": "Represent the Github text:",
"pos": "Represent the Github code:",
"neg": "Represent the Github code:"
} |
// Validate is used to sanity check a token | [
"func (a *ACLToken) Validate() error {\n\tvar mErr multierror.Error\n\tif len(a.Name) > maxTokenNameLength {\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"token name too long\"))\n\t}\n\tswitch a.Type {\n\tcase ACLClientToken:\n\t\tif len(a.Policies) == 0 {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(... | [
"@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 post about programming:",
"pos": "Represent the Github code about programming:",
"neg": "Represent the Github code:"
} |
// GetAllAWSElasticLoadBalancingV2LoadBalancerResources retrieves all AWSElasticLoadBalancingV2LoadBalancer items from an AWS CloudFormation template | [
"func (t *Template) GetAllAWSElasticLoadBalancingV2LoadBalancerResources() map[string]*resources.AWSElasticLoadBalancingV2LoadBalancer {\n\tresults := map[string]*resources.AWSElasticLoadBalancingV2LoadBalancer{}\n\tfor name, untyped := range t.Resources {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *resourc... | [
"func NewResourceByType(typeName string) ResourceProperties {\n\tswitch typeName {\n\tcase \"AWS::ApiGateway::Account\":\n\t\treturn &APIGatewayAccount{}\n\tcase \"AWS::ApiGateway::ApiKey\":\n\t\treturn &APIGatewayAPIKey{}\n\tcase \"AWS::ApiGateway::Authorizer\":\n\t\treturn &APIGatewayAuthorizer{}\n\tcase \"AWS::A... | codesearchnet | {
"query": "Represent the description:",
"pos": "Represent the code:",
"neg": "Represent the code about Software development:"
} |
设置数据库连接必备参数
@param array $dbconfig 数据库连接配置信息
@return object | [
"public function setDbConn($dbconfig = [])\n {\n if (empty($dbconfig)) {\n $this->dbconfig = config('database');\n //$this->dbconfig = Config::get('database');\n } else {\n $this->dbconfig = $dbconfig;\n }\n return $this;\n }"
] | [
"public static IPool getPool(String host, Integer port, String database, String... userPwd) {\n //暂未启用\n throw new RuntimeException(\"未找到指定的数据库连接池\");\n }"
] | codesearchnet | {
"query": "Represent the Github summarization about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code about programming:"
} |
// ParsePacket parses a DHCP4 packet from q. | [
"func ParsePacket(q []byte) (*Packet, error) {\n\tvar pkt Packet\n\tif err := (&pkt).UnmarshalBinary(q); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &pkt, nil\n}"
] | [
"@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC... | codesearchnet | {
"query": "Represent the text about Data processing:",
"pos": "Represent the code about Data processing:",
"neg": "Represent the code:"
} |
Check whether flyweight object with specified key has already been created.
Returns:
bool: True if already created, False if not | [
"def has_key(cls, *args):\n \n key = args if len(args) > 1 else args[0]\n return key in cls._instances"
] | [
"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 comment:",
"pos": "Represent the code:",
"neg": "Represent the code:"
} |
*
Add an ip for Sender object | [
"public function getIP()\n {\n if (function_exists('apache_request_headers')) {\n $headers = apache_request_headers();\n } else {\n $headers = $_SERVER;\n }\n \n if (array_key_exists('X-Forwarded-For', $headers)\n && filter_var($headers['X-Forwarded-Fo... | [
"def getDeviceRole(self):\n \"\"\"\"\"\"\n print '%s call getDeviceRole' % self.port\n return self.__stripValue(self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:NodeType')[0])"
] | codesearchnet | {
"query": "Represent the Github comment about Programming:",
"pos": "Represent the Github code about Programming:",
"neg": "Represent the Github code:"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.