query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Retrieves all languages availables with Google Translate API If a target language is specified, returns languages name translated in target language. @param string $target A target language to translate languages names @return string
[ "public function get($target = null)\n {\n $options = ['key' => $this->apiKey];\n\n if (null !== $target) {\n $this->url = sprintf('%s&target={target}', $this->url);\n\n $options['target'] = $target;\n }\n\n return $this->process($options);\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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Short description of method evaluateRecursiveOperation @access public @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> @param Literal first @param Literal second @param Resource operator @return mixed
[ "public function evaluateRecursiveOperation( core_kernel_classes_Literal $first, core_kernel_classes_Literal $second, core_kernel_classes_Resource $operator)\r\n {\r\n \r\n \r\n switch ($operator->getUri()) {\r\n \tcase RulesRdf::INSTANCE_OPERATOR_ADD: {\r\n \t\t$returnValue ...
[ "def add(doc, pointer, value):\n \n return Target(doc).add(pointer, value).document" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// AuthorizeToken authorizes a given token to access a given URL.
[ "func (s *service) AuthorizeToken(ctx context.Context, hostname, path, token string) (*sessions.Session, error) {\n\tresourceCh, resourceErrCh := make(chan *resources.Resource, 1), make(chan error, 1)\n\tsessionCh, sessionErrCh := make(chan *sessions.Session, 1), make(chan error, 1)\n\tgo func() {\n\t\tsession, err...
[ "func valid(authorization []string) bool {\n\tif len(authorization) < 1 {\n\t\treturn false\n\t}\n\ttoken := strings.TrimPrefix(authorization[0], \"Bearer \")\n\t// Perform the token validation here. For the sake of this example, the code\n\t// here forgoes any of the usual OAuth2 token validation and instead check...
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Returns the MurmurHash3_x86_32 hash of the UTF-8 bytes of the String without actually encoding the string to a temporary buffer. This is more than 2x faster than hashing the result of String.getBytes().
[ "public static int murmurhash3_x86_32(CharSequence data, int offset, int len, int seed) {\n\n final int c1 = 0xcc9e2d51;\n final int c2 = 0x1b873593;\n\n int h1 = seed;\n\n int pos = offset;\n int end = offset + len;\n int k1 = 0;\n int k2 = 0;\n int shift = 0;\n int bits = 0;\n int nB...
[ "def _init_io_container(self, init_value):\n \n if isinstance(init_value, CLOB_STRING_IO_CLASSES):\n # already a valid StringIO instance, just use it as it is\n v = init_value\n else:\n # works for strings and unicodes. However unicodes must only contain valid a...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Only valid if this is a reference. Also works for attributes, this was a crappy name
[ "def referenced_element\n ref = @xml.attributes['ref'].value\n @referenced_element ||= if ref =~ /:/\n prefix, element = ref.split(':')\n schema.find_element(element) || schema.find_attribute(\"@#{element}\") if schema = Schema.find(prefix)\n else\n self.schema.find_element(ref) ...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Emit a ray to beginb uilding the scene. @param {Number} sin Sine of the cast angle. @param {Number} cos Cosine of the cast angle. @param {Number} range Max length of the ray. @param {Object} origin x, y, height and sitance
[ "function(sin, cos, range, origin) {\n var stepX = this.step(sin, cos, origin.x, origin.y, false);\n var stepY = this.step(cos, sin, origin.y, origin.x, true);\n \n var inspectX = [sin, cos, stepX, 1, 0, origin.dist, stepX.y];\n var inspectY = [sin, cos, stepY, 0, 1, origin.dist, stepY.x];\n var n...
[ "function Animation(path) {\n // each prefab is a tetrahedron\n var prefabGeometry = new THREE.TetrahedronBufferGeometry(2.0);\n var prefabCount = 100000;\n\n // create the buffer geometry with all the prefabs\n var geometry = new BAS.PrefabBufferGeometry(prefabGeometry, prefabCount);\n\n // ANIMATION\n\n //...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Create an instance of {@link Bytes} that is created and stored in memory. @param creator the creator of byte data @param expectedSize the expected size of the created byte data, used to allocate memory for the data @return instance of bytes
[ "static Bytes createViaDataOutput(@NonNull IOConsumer<ExtendedDataOutput> creator, int expectedSize)\n\t\tthrows IOException\n\t{\n\t\tObjects.requireNonNull(creator);\n\t\tif(expectedSize <= 0) throw new IllegalArgumentException(\"expectedSize should be larger than 0\");\n\n\t\tByteArrayOutputStream out = new Byte...
[ "void offerData(byte[] chunk) {\n if (chunk == null || chunk.length == 0) {\n throw new IllegalArgumentException(\"chunk must have at least one byte of data\");\n }\n\n if (closed) {\n return;\n }\n\n // Since this is an unbounded queue, offer() always succeeds. In addition, we don't make a...
codesearchnet
{ "query": "Represent the Github summarization about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Used for nested lists. Removes list markers and up to 4 leading spaces. @param configuration txtmark configuration
[ "public void removeListIndent(final Configuration configuration)\n {\n Line line = this.lines;\n while (line != null)\n {\n if (!line.isEmpty)\n {\n switch (line.getLineType(configuration))\n {\n case ULIST:\n ...
[ "def check_arrange_act_spacing(self) -> typing.Generator[AAAError, None, None]:\n \n yield from self.check_block_spacing(\n LineType.arrange,\n LineType.act,\n 'AAA03 expected 1 blank line before Act block, found {}',\n )" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// NewTerrainRequest returns a new TerrainRequest
[ "func NewTerrainRequest(MASK uint64, LAT int32, LON int32, GRID_SPACING uint16) *TerrainRequest {\n\tm := TerrainRequest{}\n\tm.MASK = MASK\n\tm.LAT = LAT\n\tm.LON = LON\n\tm.GRID_SPACING = GRID_SPACING\n\treturn &m\n}" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
// ImportScript creates a new scriptAddress with a user-provided script // and adds it to the key store.
[ "func (s *Store) ImportScript(script []byte, bs *BlockStamp) (btcutil.Address, error) {\n\ts.mtx.Lock()\n\tdefer s.mtx.Unlock()\n\n\tif s.flags.watchingOnly {\n\t\treturn nil, ErrWatchingOnly\n\t}\n\n\tif _, ok := s.addrMap[addressKey(btcutil.Hash160(script))]; ok {\n\t\treturn nil, ErrDuplicate\n\t}\n\n\t// Create...
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
This method saves paragraph vectors to the given file. @param vectors @param path
[ "@Deprecated\n public static void writeWordVectors(@NonNull ParagraphVectors vectors, @NonNull File path) {\n try (FileOutputStream fos = new FileOutputStream(path)) {\n writeWordVectors(vectors, fos);\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n ...
[ "def _get_result_paths(self, data):\n \n\n # Swarm OTU map (mandatory output)\n return {'OtuMap': ResultPath(Path=self.Parameters['-o'].Value,\n IsWritten=True)}" ]
codesearchnet
{ "query": "Represent the instruction about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
@param string $label @return Menu_jUI
[ "public function addSubMenu($label)\n {\n // we use MenuSeparator tag here just to put View_Popover outside of UL list.\n // Otherwise it breaks correct HTML and CSS.\n /** @type View_Popover $f */\n $f = $this->add('View_Popover');\n $this->addMenuItem($f->showJS('#'.$this->na...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code:" }
Constructor and Initialisation ------------------------------
[ "public function init() {\n\n\t\tparent::init();\n\n\t\t// Default Layout\n\t\t$this->layout = Yii::$app->core->defaultLayout;\n\n\t\t// Default Permission\n\t\t$this->crudPermission = CoreGlobal::PERM_USER;\n\t}" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github comment about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Removes an object. The remote end of the ObjectSpace's connections will no longer be able to access it.
[ "public void remove (int objectID) {\n\t\tObject object = idToObject.remove(objectID);\n\t\tif (object != null) objectToID.remove(object, 0);\n\t\tif (TRACE) trace(\"kryonet\", \"Object \" + objectID + \" removed from ObjectSpace: \" + object);\n\t}" ]
[ "@Override\n public void destroy() // PK20881\n {\n if (tc.isEntryEnabled())\n Tr.entry(tc, \"destroy\");\n\n // Dummy transactionWrappers may not be in any table and so\n // will not have a resourceCallback registered to remove them.\n if (_resourceCallback != null)\n ...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Database management:" }
// Configure sets up the provider using the given configuration.
[ "func (c *ConsulProvider) Configure(clusterID string, isRoot bool, rawConfig map[string]interface{}) error {\n\t// Parse the raw config and update our ID.\n\tconfig, err := ParseConsulCAConfig(rawConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\tc.config = config\n\thash := sha256.Sum256([]byte(fmt.Sprintf(\"%s,%s...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Добавление миграции в лог БД после выполнения @param MigrationInterface $migration
[ "public function completeUp(MigrationInterface $migration)\n {\n $query = (new InsertQueryBuilder())->into(static::tableName())->set([\n 'id' => $migration->getTime(),\n 'comment' => $migration->comment(),\n ]);\n\n $parsed = $query->parse($this->connection->getDialect(...
[ "private function processA(array $result) {\n\t\ttry {\n\t\t\t$result = $this->processI($result);\n\t\t}\n\t\t/**\n\t\t * 2016-08-02\n\t\t * Исключительная ситуация может быть не только типа @see \\Df\\Core\\Exception,\n\t\t * но и типа @see \\Exception,\n\t\t * потому что чтение некорректных данных может приводить...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
/* Creates a view of a file (.brackets.json) @param {!File} file - the file to create a view for @param {!Pane} pane - the pane where to create the view @private
[ "function _createConfigViewOf(file, pane) {\n var result = new $.Deferred(),\n view = pane.findViewOfFile(file.fullPath);\n\n if (view) {\n // existing view, then just show it\n pane.showView(view);\n result.resolve(view.getFile());\n } else {\n ...
[ "function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// String renders node as a string using fmt. Acquires a read lock to ensure the // reflective dump of dependents doesn't race with any concurrent writes.
[ "func (n *node) String() string {\n\tn.dependentsLock.RLock()\n\tdefer n.dependentsLock.RUnlock()\n\treturn fmt.Sprintf(\"%#v\", n)\n}" ]
[ "func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Computer Science:" }
// GetMetricTypes returns metric types for testing
[ "func (f *Mock) GetMetricTypes(cfg plugin.ConfigType) ([]plugin.MetricType, error) {\n\tmts := []plugin.MetricType{}\n\tif _, ok := cfg.Table()[\"test-fail\"]; ok {\n\t\treturn mts, fmt.Errorf(\"testing\")\n\t}\n\tif d, ok := cfg.Table()[\"test-sleep-duration\"]; ok {\n\t\tduration, err := time.ParseDuration(d.(cty...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the comment about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
Mutates expression such that, if it contains a NameExpr for any of the <code>names</code>, it is replaced with a FieldAccessExpr having <code>newScope</code> as the scope.
[ "public static void rescopeNamesToNewScope(Expression newScope, List<String> names, Expression e) {\n\n if (e instanceof NodeWithArguments) {\n NodeWithArguments<?> arguments = (NodeWithArguments) e;\n for (Expression argument : arguments.getArguments()) {\n rescopeNamesT...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
{@inheritDoc} @param string $name Module name
[ "public function main(string $name = '') : void\n {\n parent::main();\n\n $name = $this->_camelize($name);\n\n $this->validate($name, (string)Configure::read('CsvMigrations.modules.path'));\n\n $this->bakeModuleConfig($name);\n $this->bakeDatabaseConfig($name);\n $this->...
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// convert from into normalized *Config checking for errors // before merging generated(normalized) config with current config
[ "func normalize(opts *options, from interface{}) (*Config, Error) {\n\tvFrom := chaseValue(reflect.ValueOf(from))\n\n\tswitch vFrom.Type() {\n\tcase tConfig:\n\t\treturn vFrom.Addr().Interface().(*Config), nil\n\tcase tConfigMap:\n\t\treturn normalizeMap(opts, vFrom)\n\tdefault:\n\t\t// try to convert vFrom into Co...
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Checks if VM is running. @param hostIpPort @param id @return @throws TargetException
[ "public static boolean isVMRunning(String hostIpPort, String id)\n\tthrows TargetException {\n\t\tboolean result = false;\n\t\tString ip = OcciVMUtils.getVMIP(hostIpPort, id);\n\t\ttry {\n\t\t\tInetAddress inet = InetAddress.getByName(ip);\n\t\t\tresult = inet.isReachable(5000);\n\n\t\t} catch (Exception e) {\n\t\t...
[ "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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about N/A:" }
To get configuration @param string $location @return mixed
[ "public function config($location)\r\n {\r\n $keys = explode('.', $location);\r\n\r\n $filename = 'get' . strtoupper(array_shift($keys));\r\n\r\n $location = implode('.', $keys);\r\n\r\n if(empty($location)) {\r\n return $this->config->{$filename}();\r\n }\r\n\r\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 text about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about programming:" }
Submit reassignment plan for execution.
[ "def execute_plan(self, plan, allow_rf_change=False):\n \"\"\"\"\"\"\n reassignment_path = '{admin}/{reassignment_node}'\\\n .format(admin=ADMIN_PATH, reassignment_node=REASSIGNMENT_NODE)\n plan_json = dump_json(plan)\n base_plan = self.get_cluster_plan()\n if not valid...
[ "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:" }
Gets the viewabilityProvider value for this Company. @return viewabilityProvider * Info required for when Company Type is VIEWABILITY_PROVIDER.
[ "public com.google.api.ads.admanager.axis.v201808.ViewabilityProvider getViewabilityProvider() {\n return viewabilityProvider;\n }" ]
[ "@Override\n public Root delete(Root root) throws WIMException {\n //Please DONOT UPDATE or CHANGE this wrapper.\n //If a need arises, please updated the searchImpl method call.\n\n final String METHODNAME = \"delete\";\n return genericProfileManagerMethod(METHODNAME, ProfileManager.D...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Sets action_category @param string $action_category action_category @return $this
[ "public function setActionCategory($action_category)\n {\n $allowedValues = $this->getActionCategoryAllowableValues();\n if (!in_array($action_category, $allowedValues, true)) {\n throw new \\InvalidArgumentException(\n sprintf(\n \"Invalid value for 'ac...
[ "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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Gets the metadata for the published date. return: (osid.Metadata) - metadata for the published date *compliance: mandatory -- This method must be implemented.*
[ "def get_published_date_metadata(self):\n \n # Implemented from template for osid.resource.ResourceForm.get_group_metadata_template\n metadata = dict(self._mdata['published_date'])\n metadata.update({'existing_date_time_values': self._my_map['publishedDate']})\n return Metadata(**...
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Return all values for the specified channel of the type corresponding to the function `f`, where `f` is either `self.series_resistance` or `self.series_capacitance`.
[ "def read_all_series_channel_values(self, f, channel):\n '''\n \n '''\n values = []\n channel_max_param_count = [3, 5]\n for i in range(channel_max_param_count[channel]):\n try:\n values.append(f(channel, i))\n except RuntimeError:\n ...
[ "def numericshape(self):\n \"\"\"\"\"\"\n try:\n numericshape = [self.subseqs.seqs.model.numconsts.nmb_stages]\n except AttributeError:\n objecttools.augment_excmessage(\n 'The `numericshape` of a sequence like `%s` depends on the '\n 'configu...
codesearchnet
{ "query": "Represent the comment about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
Normalize readonly and force options objects. @param value Raw options. @return Normalized options. @static @private
[ "function normalizeCacheRemote(value: Object|boolean): Object {\n if (value === true || !value) {\n return { cache: !!value, remote: !!value };\n }\n\n return value;\n}" ]
[ "function(key, options={}){\n if(this.returnType === 'value'){ return console.error('Called get on the `'+ this.name +'` computed property which returns a primitive value.'); }\n return this.value().get(key, options);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// DefaultSigAlgo returns an appropriate X.509 signature algorithm given // the CA's private key.
[ "func DefaultSigAlgo(priv crypto.Signer) x509.SignatureAlgorithm {\n\tpub := priv.Public()\n\tswitch pub := pub.(type) {\n\tcase *rsa.PublicKey:\n\t\tkeySize := pub.N.BitLen()\n\t\tswitch {\n\t\tcase keySize >= 4096:\n\t\t\treturn x509.SHA512WithRSA\n\t\tcase keySize >= 3072:\n\t\t\treturn x509.SHA384WithRSA\n\t\tc...
[ "func (msp *bccspmsp) deserializeIdentityInternal(serializedIdentity []byte) (Identity, error) {\n\t// This MSP will always deserialize certs this way\n\tbl, _ := pem.Decode(serializedIdentity)\n\tif bl == nil {\n\t\treturn nil, errors.New(\"could not decode the PEM structure\")\n\t}\n\tcert, err := x509.ParseCerti...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// WithDockerfile creates / returns a CmdOperator to set the Dockerfile for a build operation
[ "func WithDockerfile(dockerfile string) func(*icmd.Cmd) func() {\n\treturn func(cmd *icmd.Cmd) func() {\n\t\tcmd.Command = append(cmd.Command, \"-\")\n\t\tcmd.Stdin = strings.NewReader(dockerfile)\n\t\treturn nil\n\t}\n}" ]
[ "func NewTarTimeoutError() error {\n\treturn Error{\n\t\tMessage: fmt.Sprintf(\"timeout waiting for tar stream\"),\n\t\tDetails: nil,\n\t\tErrorCode: TarTimeoutError,\n\t\tSuggestion: \"check the Source-To-Image scripts if it accepts tar stream for assemble and sends for save-artifacts\",\n\t}\n}" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Collect all the certs/profiles
[ "def prepare_list\n UI.message(\"Fetching certificates and profiles...\")\n cert_type = Match.cert_type_sym(type)\n\n prov_types = []\n prov_types = [:development] if cert_type == :development\n prov_types = [:appstore, :adhoc] if cert_type == :distribution\n prov_types = [:enterprise]...
[ "def document_agents(p):\n \n p.comment('agent.py', 'base agent class')\n p.comment('run_agents.py', 'Top level function to run the agents')\n \n p.comment('agent_image_metadata.py', 'agent to collect file picture metadata')\n p.comment('agent_learn_aixi.py', '')\n p.comment('dummy_learn_1.py',...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Fetches the data from the persistent data storage. @return array list of data items
[ "protected function fetchData()\n\t{\n\t\t$criteria=clone $this->getCriteria();\n\n\t\tif(($pagination=$this->getPagination())!==false)\n\t\t{\n\t\t\t$pagination->setItemCount($this->getTotalItemCount());\n\t\t\t$pagination->applyLimit($criteria);\n\t\t}\n\n\t\t$baseCriteria=$this->model->getDbCriteria(false);\n\n\...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
{@inheritDoc} @param ServerRequestInterface $request @param RequestHandlerInterface $handler @return ResponseInterface
[ "public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n {\n if($this->detector->isMobile()){\n $request->withAttribute('client-isMobile', TRUE);\n }\n if($this->detector->isTablet()){\n $request->withAttribute('client-...
[ "public function run()\n {\n $this->loadMiddleware();\n\n //~ Default response\n $response = new HttpMessage\\Response();\n //$response->getBody()->write('-- static --');\n\n //~ Get response\n $stack = new HttpMiddleware\\Stack($response, $this->middleware);\n ...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Refactor a list of files and directories.
[ "def refactor(self, items, write=False, doctests_only=False):\n \"\"\"\"\"\"\n\n for dir_or_file in items:\n if os.path.isdir(dir_or_file):\n self.refactor_dir(dir_or_file, write, doctests_only)\n else:\n self.refactor_file(dir_or_file, write, doctes...
[ "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 sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
join语句,可多次调用产生多个join,格式为['表名:连接方式(可选)'=>'连接条件']如['table:left outter'=>'table.id=id'] @param array|string $condition 条件单元或者表名 @param string $expression 连接条件表达式 @return objetc $this
[ "public function join($condition, string $expression = null): object\n {\n if (!is_array($condition)) {\n $condition = [$condition => $expression];\n }\n $this->container[$this->id]['s']['join'] = array_merge($this->container[$this->id]['s']['join'], $condition);\n return $...
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Assert own property _name_ exists. @param {String} name @param {String} description @api public
[ "function(name, desc){\r\n this.assert(\r\n this.obj.hasOwnProperty(name)\r\n , function(){ return 'expected ' + this.inspect + ' to have own property ' + i(name) + (desc ? \" | \" + desc : \"\") }\r\n , function(){ return 'expected ' + this.inspect + ' to not have own proper...
[ "function Message(instanceList, // @arg InstanceObject - address list. { id: instance, ... }\n methodName) { // @arg MethodNameString = \"inbox\" - instance[method]\n // @desc MessagePassing implementation.\n this._instanceList = instanceList;\n this._methodName ...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Parse length-encoded string @return integer Result
[ "public function parseEncodedString()\n {\n $l = $this->parseEncodedBinary();\n if (($l === null) || ($l === false)) {\n return $l;\n }\n return $this->read($l);\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 instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
/* action [data] [options]
[ "function() {\n //copy to make real Array\n var args = Array.prototype.slice.call( arguments );\n var action = args.shift();\n args = deduceArgs(args);\n var txn = args[1].txn, data = args[0], callback = args[1].callback,\n comment = args[1].comment, override = arg...
[ "def anim(host, seq, anim, d):\n \n at(host, 'ANIM', seq, [anim, d])" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns the variables passed to the template URLs and paths (namely `base_dir`, `base_url`, `theme_dir` and `theme_url`) don't add a trailing slash for historic reasons. @return array template variables
[ "protected function getTwigVariables()\n {\n return array(\n 'config' => $this->getConfig(),\n 'base_dir' => rtrim($this->getRootDir(), '/'),\n 'base_url' => rtrim($this->getBaseUrl(), '/'),\n 'theme_dir' => $this->getThemesDir() . $this->getConfig('theme'),\n ...
[ "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 instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Kill this session
[ "public function kill()\n {\n $this->vars = null;\n $this->ip = rcube_utils::remote_addr(); // update IP (might have changed)\n $this->destroy(session_id());\n rcube_utils::setcookie($this->cookiename, '-del-', time() - 60);\n }" ]
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
* archive tp file done tasks* **Key Arguments:** - ``taskpaperPath`` -- path to a taskpaper file **Return:** - None
[ "def _archive_tp_file_done_tasks(\n self,\n taskpaperPath):\n \n self.log.info('starting the ``_archive_tp_file_done_tasks`` method')\n self.log.info(\"archiving taskpaper file %(taskpaperPath)s\" % locals())\n taskLog = {}\n mdArchiveFile = taskpaperPath.rep...
[ "def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe...
codesearchnet
{ "query": "Represent the Github description about computer science:", "pos": "Represent the Github code about computer science:", "neg": "Represent the Github code about programming:" }
// Close implements the Store interface.
[ "func (s *winStore) Close() {\n\tC.CertCloseStore(s.store, 0)\n\ts.store = 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 summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Return false if suffixes are mutually exclusive
[ "def _compare_suffix(self, other):\n \"\"\"\"\"\"\n\n # If suffix is omitted, assume a match\n if not self.suffix or not other.suffix:\n return True\n\n # Check if more than one unique suffix\n suffix_set = set(self.suffix_list + other.suffix_list)\n unique_suffi...
[ "private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Takes a string and append blanks until the pad value is reached. @param String text @param Number pad Pad value (optional; default: 80) @return String
[ "function fillBlanks(text, pad) {\n \"use strict\";\n pad = pad || 80;\n if (text.length < pad) {\n text += new Array(pad - text.length + 1).join(' ');\n }\n return text;\n}" ]
[ "function renderLine(n, line) {\n // Convert tabs to spaces, so errors in code lines with tabs as indention symbol\n // could be correctly rendered, plus it will provide less verbose output\n line = line.replace(/\\t/g, ' ');\n\n // \"n + 1\" to print lines in human way (counted from 1)\n var lineNum...
codesearchnet
{ "query": "Represent the Github post about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about programming:" }
// stateDot0 is the state after reading the integer, decimal point, and subsequent // digits of a number, such as after reading `3.14`.
[ "func stateDot0(s *scanner, c byte) int {\n\tif '0' <= c && c <= '9' {\n\t\treturn scanContinue\n\t}\n\tif c == 'e' || c == 'E' {\n\t\ts.step = stateE\n\t\treturn scanContinue\n\t}\n\treturn stateEndValue(s, c)\n}" ]
[ "def formatDecimalMark(value, decimalmark='.'):\n \n # We have to consider the possibility of working with decimals such as\n # X.000 where those decimals are important because of the precission\n # and significant digits matters\n # Using 'float' the system delete the extre desimals with 0 as a valu...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Verifies JWT user. @param Payload $payload @return bool @throws TokenInvalidException
[ "public static function verifyUser($payload)\n {\n $userId = $payload->get('user_id');\n $userKey = $payload->get('sub');\n $userInfo = ($userId) ? User::getCachedInfo($userId) : null;\n\n if (!empty($userInfo) && $userKey === md5($userInfo['email'])) {\n return true;\n ...
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Actually performe add with carry. Useful, as SBC is also a modified add-with-carry.
[ "function doADC( value ) {\n\t\tvar t = A + value + flagC;\n\t\t\t\n\t\tflagV = !!((A ^ t) & (value ^ t) & 0x80) && 1;\n\t\tflagN = !!( t & 0x80 );\n\t\tflagC = ( t > 255 );\n\t\tflagZ = !( t & 0xff );\n\n\t\twriteA( t & 0xff );\n\t}" ]
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
@param FileInterface $file @param string $userId @return FileInterface
[ "public function showFile(FileInterface $file, $userId)\n {\n $event = new FileEvent($file);\n if ($this->eventDispatcher->dispatch(VolumeEvents::BEFORE_SHOW_FILE, $event)->isPropagationStopped()) {\n throw new IOException(\"Show file {$file->getName()} cancelled.\");\n }\n\n ...
[ "public static function bindToObject(TelegramResponse $data, LoggerInterface $logger): TelegramTypes\n {\n return new File($data->getResult(), $logger);\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Adds a home to make it externally accessible. @param bmd the bean
[ "protected void addHome(BeanMetaData bmd) throws ContainerException {\n try {\n EJSContainer.homeOfHomes.addHome(bmd); //d200714 d429866.2 F743-26072\n } catch (Throwable ex) {\n ContainerException ex2 = new ContainerException(ex);\n Tr.error(tc, \"CAUGHT_EXCEPTION_THR...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
UpTime time the system is running @return void
[ "private function _uptime()\n {\n $result = 0;\n date_default_timezone_set('UTC');\n $buffer = $this->_get_Win32_OperatingSystem();\n if ($buffer && ($buffer[0]['LastBootUpTime'] !== null)) {\n $local = $buffer[0]['LocalDateTime'];\n $boot = $buffer[0]['LastBootU...
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// GetActiveLockReason returns the ActiveLockReason field if it's non-nil, zero value otherwise.
[ "func (i *Issue) GetActiveLockReason() string {\n\tif i == nil || i.ActiveLockReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.ActiveLockReason\n}" ]
[ "func (f *RecordFlags) AddFlags(cmd *cobra.Command) {\n\tif f == nil {\n\t\treturn\n\t}\n\n\tif f.Record != nil {\n\t\tcmd.Flags().BoolVar(f.Record, \"record\", *f.Record, \"Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If ...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// Set implements Cache.
[ "func (a *Async) Set(key string, image *imageserver.Image, params imageserver.Params) error {\n\tgo func() {\n\t\t_ = a.Cache.Set(key, image, params)\n\t}()\n\treturn nil\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 sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about File management:" }
Grab the ~/.polyglot/.env file for variables If you are running Polyglot v2 on this same machine then it should already exist. If not create it.
[ "def init_interface():\n sys.stdout = LoggerWriter(LOGGER.debug)\n sys.stderr = LoggerWriter(LOGGER.error)\n\n \n warnings.simplefilter('error', UserWarning)\n try:\n load_dotenv(join(expanduser(\"~\") + '/.polyglot/.env'))\n except (UserWarning) as err:\n LOGGER.warning('File does n...
[ "def create_readme\n builder.remove_file \"README.rdoc\"\n builder.create_file \"README.md\" do\n <<-END.strip_heredoc\n# #{app_name}\n\n## Setup\n\n### Requirements\n\n1. [ruby](https://www.ruby-lang.org/en/)\n2. [postgres](http://www.postgresql.org/download/) (can be installed via homebrew)\n\n\n...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Convert to pauli operators of universal gate model. Requires blueqat.
[ "def pauli(qubo):\n\t\n\tfrom blueqat.pauli import qubo_bit\n\th = 0.0\n\tassert all(len(q) == len(qubo) for q in qubo)\n\tfor i in range(len(qubo)):\n\t\th += qubo_bit(i) * qubo[i][i]\n\t\tfor j in range(i + 1, len(qubo)):\n\t\t\th += qubo_bit(i)*qubo_bit(j) * (qubo[i][j] + qubo[j][i])\n\treturn h" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Perform an operation on Todoist using the API sync end-point.
[ "def _perform_command(user, command_type, command_args):\n \"\"\"\"\"\"\n command_uuid = _gen_uuid()\n command = {\n 'type': command_type,\n 'args': command_args,\n 'uuid': command_uuid,\n 'temp_id': _gen_uuid()\n }\n commands = json.dumps([command])\n response = API.sy...
[ "@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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Get image sizes @return array
[ "protected function getImageSizes()\n {\n if (is_callable($this->_imageSizes)) {\n return call_user_func($this->_imageSizes, $this->owner);\n } else {\n return $this->_imageSizes;\n }\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Checking in with the central server informs it of the location and configuration of this Node. If it can't check-in, there's no point in starting.
[ "def check_in(critical=false)\n @central[\"/node/#{@id}\"].put(\n :busy => @overloaded,\n :tag => @tag,\n :max_workers => CloudCrowd.config[:max_workers],\n :enabled_actions => @enabled_actions.join(',')\n )\n rescue RestClient::Exception, Errn...
[ "private static void startNetworkServices() {\n // We've rebooted the JVM recently. Tell other Nodes they can ignore task\n // prior tasks by us. Do this before we receive any packets\n UDPRebooted.T.reboot.broadcast();\n\n // Start the MultiReceiverThread, to listen for multi-cast requests from\n //...
codesearchnet
{ "query": "Represent the Github comment about Networking:", "pos": "Represent the Github code about Networking:", "neg": "Represent the Github code:" }
Add *value* to the left side of the collection.
[ "def appendleft(self, value):\n \"\"\"\"\"\"\n def appendleft_trans(pipe):\n self._appendleft_helper(value, pipe)\n\n self._transaction(appendleft_trans)" ]
[ "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 summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Encode a string as buffer
[ "function encodeStringBuffer( encoder, str, utf8 ) {\n\n\t// If we do not have an explicit utf8 or not decision, pick one now\n\tif (utf8 === undefined) {\n\t\tutf8 = false; // Assume false\n\t\tfor (var i=0, strLen=str.length; i<strLen; ++i) {\n\t\t\tif (str.charCodeAt(i) > 255) {\n\t\t\t\tutf8 = true; break;\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 about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// WithReturnBody sets Riak to return the value within its response after completing the write // operation
[ "func (builder *UpdateMapCommandBuilder) WithReturnBody(returnBody bool) *UpdateMapCommandBuilder {\n\tbuilder.protobuf.ReturnBody = &returnBody\n\treturn builder\n}" ]
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *GitConfig) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"GitConfig\"}\n\tif s.Branch != nil && len(*s.Branch) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Branch\", 1))\n\t}\n\tif s.RepositoryUrl == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Reposit...
[ "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:" }
Opens the topic-keyword map resource file and returns the corresponding python dictionary. - Input: - file_path: The path pointing to the topic-keyword map resource file. - Output: - topic_set: A topic to keyword python dictionary.
[ "def get_topic_keyword_dictionary():\n \n topic_keyword_dictionary = dict()\n file_row_gen = get_file_row_generator(get_package_path() + \"/twitter/res/topics/topic_keyword_mapping\" + \".txt\",\n \",\",\n \"utf-8\")\n for...
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Creates a TimestampedValue from given {@link StreamRecord}. @param streamRecord The StreamRecord object from which TimestampedValue is to be created.
[ "public static <T> TimestampedValue<T> from(StreamRecord<T> streamRecord) {\n\t\tif (streamRecord.hasTimestamp()) {\n\t\t\treturn new TimestampedValue<>(streamRecord.getValue(), streamRecord.getTimestamp());\n\t\t} else {\n\t\t\treturn new TimestampedValue<>(streamRecord.getValue());\n\t\t}\n\t}" ]
[ "@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the...
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
// Remove removes a transaction from the lookup.
[ "func (t *txLookup) Remove(hash common.Hash) {\n\tt.lock.Lock()\n\tdefer t.lock.Unlock()\n\n\tdelete(t.all, hash)\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Returns a new interval shifted backward in time by the given duration. @param duration a time duration @return the new shifted interval
[ "public TimeInterval minus(TimeDuration duration) {\n return between(start.minus(duration), end.minus(duration));\n }" ]
[ "@PrefMetadata(type = CmsTimeWarpPreference.class)\n public String getTimeWarp() {\n\n long warp = m_settings.getTimeWarp();\n return warp < 0 ? \"\" : \"\" + warp; // if timewarp < 0 (i.e. time warp is not set), use the empty string because we don't want the date selector widget to interpret the n...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Perform lookup @return array Raw response as array separated by "\n"
[ "public function getRawData($query)\n {\n\n $this->query['query'] = $query;\n\n // clear error description\n if (isset($this->query['errstr'])) {\n unset($this->query['errstr']);\n }\n\n if (!isset($this->query['server'])) {\n $this->query['status'] = 'err...
[ "def fix_config(self, options):\n \n options = super(Trigger, self).fix_config(options)\n\n opt = \"condition\"\n if opt not in options:\n options[opt] = \"True\"\n if opt not in self.help:\n self.help[opt] = \"The (optional) condition for teeing off the toke...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Generation for the long type. @param string $id 身份证号 @return array
[ "private function _generateLongType($id)\n {\n preg_match('/((.{6})(.{8})(.{3}))(.)/', $id, $matches);\n\n return [\n 'body' => $matches[1],\n 'addressCode' => $matches[2],\n 'birthdayCode' => $matches[3],\n 'order' => $matches[4],\n ...
[ "public static SqlInfo getSqlInfoSimply(String nsAtZealotId, Object paramObj) {\n String[] arr = nsAtZealotId.split(ZealotConst.SP_AT);\n if (arr.length != LEN) {\n throw new ValidFailException(\"nsAtZealotId参数的值必须是xml文件中的 nameSpace + '@@' + zealotId 节点的值,\"\n + \"如:'stu...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
Maybe compress CSS code. @since 140417 Initial release. @param string $css Raw CSS code. @return string CSS code (possibly compressed).
[ "protected function maybeCompressCssCode($css)\n {\n if (($benchmark = !empty($this->options['benchmark']) && $this->options['benchmark'] === 'details')) {\n $time = microtime(true);\n }\n $css = (string) $css; // Force string value.\n\n if (isset($this->options['compress_c...
[ "public function onStyleLoaderTag($tag, $handle): string\n {\n $tag = (string) $tag;\n $handle = (string) $handle;\n\n if (!($style = $this->didEnqueueStyle($handle))) {\n return $tag; // We did not enqueue this style.\n }\n if ($style['sri'] !== '' && !preg_match...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Get class constants
[ "private function getClassConstants()\n {\n $pgClass = $this->entity->pgClass;\n\n $this->class->classComponents[] = new ClassConstant(\n 'TABLE',\n new Sformatf( \"const TABLE = '%s';\", $pgClass->getFullyQualifiedName() )\n );\n $this->class->classComponents[] ...
[ "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:" }
Updates an item.
[ "public function updateItem(Item $item): void\n {\n $query = $this->connection->createQueryBuilder();\n\n $query\n ->update('ngbm_collection_item')\n ->set('collection_id', ':collection_id')\n ->set('position', ':position')\n ->set('value', ':value')\n ...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
GET /users/:id/contact_lists/ Returns a list of :format:`contact_list` that the user owns as the key ``contact_lists``.
[ "def get_user_contact_lists(self, id, **data):\n \n \n return self.get(\"/users/{0}/contact_lists/\".format(id), data=data)" ]
[ "function Api(config) {\n // config\n this._config = config || {};\n this._config.transforms = _.merge(this._config.transforms || {},{\n defaults: {\n serialize: JSON.stringify,\n deserialize: JSON.parse\n }\n });\n\n this._config.headers = this._config.headers || {};\n\n // stack of [('one' |...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Smaze uzivatele @param int $id @secured @throws AbortException
[ "public function handleDelete(int $id): void\n\t{\n\t\tif ($this->isAjax()) {\n\t\t\t$user = $this->orm->users->getById($id);\n\t\t\t$this->orm->users->removeAndFlush($user);\n\t\t\t$this['userList']->reload();\n\t\t} else {\n\t\t\t$this->terminate();\n\t\t}\n\t}" ]
[ "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 post about API documentation:", "pos": "Represent the code about API documentation:", "neg": "Represent the code about programming:" }
Lookup the response from the request. @param request The request @return The {@link NettyMutableHttpResponse}
[ "@Internal\n public static Optional<NettyMutableHttpResponse> get(NettyHttpRequest<?> request) {\n NettyMutableHttpResponse nettyHttpResponse = request.attr(KEY).get();\n return Optional.ofNullable(nettyHttpResponse);\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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Manual install main script.
[ "def install():\n \n # check installed package\n print(\"Compare to '%s' ...\" % DST)\n need_install_flag = check_need_install()\n if not need_install_flag:\n print(\" package is up-to-date, no need to install.\")\n return\n print(\"Difference been found, start installing ...\")\n...
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Set the name of the schema containing the Primavera tables. @param schema schema name.
[ "public void setSchema(String schema)\n {\n if (schema == null)\n {\n schema = \"\";\n }\n else\n {\n if (!schema.isEmpty() && !schema.endsWith(\".\"))\n {\n schema = schema + '.';\n }\n }\n m_schema = schema;\n }" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the post 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 DeploymentConfigStatus.
[ "func (in *DeploymentConfigStatus) DeepCopy() *DeploymentConfigStatus {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DeploymentConfigStatus)\n\tin.DeepCopyInto(out)\n\treturn out\n}" ]
[ "func (r Registration) Unmarshal(fileContent []byte) (runtime.Object, error) {\n\t// Do a deepcopy of the empty value so we don't mutate it, which could lead to strange errors\n\tobj := r.EmptyValue.DeepCopyObject()\n\n\t// Decode the file content into obj which is a pointer to an empty struct of the internal Compo...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
convert headers in human readable format :param headers: :return:
[ "def parse_request_headers(headers):\n \n request_header_keys = set(headers.keys(lower=True))\n request_meta_keys = set(XHEADERS_TO_ARGS_DICT.keys())\n data_header_keys = request_header_keys.intersection(request_meta_keys)\n return dict(([XHEADERS_TO_ARGS_DICT[key],\n headers.get(key...
[ "def get_hdrs(self, **kws):\n \"\"\"\"\"\"\n hdrs = get_hdrs(self.prt_flds, **kws)\n # Values in a \"format_txt\" \"column\" are used for formatting, not printing\n return [h for h in hdrs if h != \"format_txt\"]" ]
codesearchnet
{ "query": "Represent the instruction about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about User interface customization:" }
// InitRenderer 初始化渲染接口(用于单独对app指定renderer,如不指定,默认会使用Server中Renderer)
[ "func (a *Module) InitRenderer(conf *render.Config, funcMap map[string]interface{}) *Module {\n\ta.Renderer, a.Resource = a.Application.NewRenderer(conf, a, funcMap)\n\tif a.Handler != nil {\n\t\ta.Handler.SetRenderer(a.Renderer)\n\t\t//为了支持域名绑定和解除绑定,此处使用路由Hander的方式服务静态资源文件\n\t\ta.Resource.Wrapper(a.Handler)\n\t} e...
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Retourne le contenu généré pour les breadcrumbs. @param string $title @return array
[ "protected function getBreadcrumbsContent($title)\n {\n if (!$stub = $this->getBreadcrumbsStub()) {\n return '';\n }\n\n return strtr($stub, array_merge($this->getCommonReplacements(), [\n '{{title}}' => ucfirst($title),\n ]));\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github comment about translation:", "pos": "Represent the Github code about translation:", "neg": "Represent the Github code about programming:" }
Return a list of syllables that contain a dipthong :param syllables: :return:
[ "def flag_dipthongs(self, syllables: List[str]) -> List[int]:\n \n long_positions = []\n for idx, syl in enumerate(syllables):\n for dipthong in self.constants.DIPTHONGS:\n if dipthong in syllables[idx]:\n if not string_utils.starts_with_qu(syllables...
[ "def append_stem(to_transform, word):\n \n if is_sequence(to_transform):\n return [append_stem(f, word) for f in to_transform]\n elif is_string(to_transform):\n (base, ext) = splitext_plus(to_transform)\n return \"\".join([base, word, ext])\n else:\n raise ValueError(\"append...
codesearchnet
{ "query": "Represent the description about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about Natural Language Processing:" }
{@inheritdoc} @throws ComponentNotFound If an unsupported element type is given.
[ "public function create($model, string $column): Component\n {\n if (!isset($this->gridElementTypes[$model->type])) {\n throw ComponentNotFound::forModel($model);\n }\n\n $className = $this->gridElementTypes[$model->type];\n\n return new $className(\n $model,\n ...
[ "@SuppressWarnings(\"unused\")\n @Internal\n protected final void warnMissingProperty(Class type, String method, String property) {\n if (LOG.isWarnEnabled()) {\n LOG.warn(\"Configuration property [{}] could not be set as the underlying method [{}] does not exist on builder [{}]. This usuall...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "func (in *CSINodeDriver) DeepCopyInto(out *CSINodeDriver) {\n\t*out = *in\n\tif in.TopologyKeys != nil {\n\t\tin, out := &in.TopologyKeys, &out.TopologyKeys\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}" ]
[ "func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Generate an unused label.
[ "def _unused_label(self, label):\n \"\"\"\"\"\"\n original = label\n existing = self.labels\n i = 2\n while label in existing:\n label = '{}_{}'.format(original, i)\n i += 1\n return label" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
register a new route on a method (str, obj) -> obj
[ "function on (route, methods) {\n assert.equal(typeof route, 'string')\n methods = methods || {}\n\n // mount subrouter\n if (methods[sym]) return router.on(route, methods)\n\n assert.equal(typeof methods, 'object')\n\n // mount http methods\n router.on(route, function (args) {\n demuxSsa(...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Groups a list of scheduled documents by their class.
[ "private function getClassesForCommitAction(array $documents, bool $includeEmbedded = false) : array\n {\n if (empty($documents)) {\n return [];\n }\n $divided = [];\n $embeds = [];\n foreach ($documents as $oid => $d) {\n $className = get_class($d);\n ...
[ "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 Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Create an instance using the launcher.
[ "def create(self, ami, count, config=None):\n \"\"\"\"\"\"\n return self.Launcher(config=config).launch(ami, count)" ]
[ "@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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Makes actions state. @param ActionContext $actionContext Action context and descriptor. @return void
[ "private static function makeActionState($actionContext) {\n $arguments = array();\n $modelState = new ModelState();\n $modelState->annotations = $actionContext->getModelState()->annotations;\n $hasModel = false;\n $request = $actionContext->getHttpContext()->getRequest();\n\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 Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// CompareTablets will compare the tablets in the destination topo.
[ "func CompareTablets(ctx context.Context, fromTS, toTS *topo.Server) error {\n\tcells, err := fromTS.GetKnownCells(ctx)\n\tif err != nil {\n\t\treturn vterrors.Wrapf(err, \"fromTS.GetKnownCells\")\n\t}\n\n\tfor _, cell := range cells {\n\t\ttabletAliases, err := fromTS.GetTabletsByCell(ctx, cell)\n\t\tif err != nil...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
/////////////////////////////////////////////////// @module ContextParserHandlebars /////////////////////////////////////////////////// @module ContextParserHandlebars
[ "function ContextParserHandlebars(config) {\n\n config || (config = {});\n config.shbsPartialsCache || (config.shbsPartialsCache = {});\n\n /* reset the internal */\n this.reset(config.processingFile);\n\n /* the configuration of ContextParserHandlebars */\n this._config = {};\n\n /* the flag i...
[ "function (p) {\n/*Line 57 - 'AtomPostButton.js' */ AtomBinder.setValue(caller, \"postResult\", p.value());\n/*Line 58 - 'AtomPostButton.js' */ caller.invokeAction(caller._next);\n/*Line 59 - 'AtomPostButton.js' */ }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Multiply values in block
[ "def mul_block(self, index, val):\n \"\"\"\"\"\"\n self._prepare_cache_slice(index)\n self.msinds[self.cache_slice] *= val" ]
[ "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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Run is part of the environs.UpgradeStep interface.
[ "func (step diskLabelsUpgradeStep) Run(ctx context.ProviderCallContext) error {\n\tenv := step.env\n\tdisks, err := env.gce.Disks()\n\tif err != nil {\n\t\treturn google.HandleCredentialError(errors.Trace(err), ctx)\n\t}\n\tfor _, disk := range disks {\n\t\tif !isValidVolume(disk.Name) {\n\t\t\tcontinue\n\t\t}\n\t\...
[ "@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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
This method has been made "static"ally available so that non-JAXB code does not have to (unnecesarily) instantiate an instance fo this class. @param key A {@link CorrelationKey} @return A {@link String} equivalent of the key
[ "public static String marshalCorrelationKey( CorrelationKey key ) {\n if( key == null ) {\n return \"\";\n }\n StringBuffer result = new StringBuffer();\n if( ! key.getProperties().isEmpty() ) {\n Iterator<CorrelationProperty<?>> iter = key.getProperties().iterator(...
[ "protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Returns an element list (`<li>`). If `$element` is an array, the same `$options` will be applied to all elements @param string|array $element Element or elements @param array $options HTML attributes of the list tag @return string @uses tag()
[ "public function li($element, array $options = [])\n {\n if (!is_array($element)) {\n return self::tag('li', $element, $options);\n }\n\n $element = array_map(function ($element) use ($options) {\n return self::tag('li', $element, $options);\n }, $element);\n\n ...
[ "public function initializeArguments()\n {\n $this->registerTagAttribute('enctype', 'string', 'MIME type with which the form is submitted');\n $this->registerTagAttribute('method', 'string', 'Transfer type (GET or POST or dialog)');\n $this->registerTagAttribute('name', 'string', 'Name of fo...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
[ "func (c *FakeAPIServices) UpdateStatus(aPIService *v1beta1.APIService) (*v1beta1.APIService, error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewRootUpdateSubresourceAction(apiservicesResource, \"status\", aPIService), &v1beta1.APIService{})\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1beta1....
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Fetches an array of scheduled cron events. @return array|WP_Error An array of event objects, or a WP_Error object if there are no events scheduled.
[ "protected static function get_cron_events() {\n\n\t\t$crons = _get_cron_array();\n\t\t$events = array();\n\n\t\tif ( empty( $crons ) ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'no_events',\n\t\t\t\t'You currently have no scheduled cron events.'\n\t\t\t);\n\t\t}\n\n\t\tforeach ( $crons as $time => $hooks ) {\n\t\t\t...
[ "public function item()\n {\n if (!empty($this->response['data'])) {\n return new Fluent($this->resource, $this->response['data']);\n }\n\n // On a valid response that does not have a data field, we can assume that\n // the request is an update/delete type of request that d...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
订阅接口级配置 @param config provider/consumer config @param listener config listener
[ "protected void subscribeConfig(final AbstractInterfaceConfig config, ConfigListener listener) {\n try {\n if (configObserver == null) { // 初始化\n configObserver = new ZookeeperConfigObserver();\n }\n configObserver.addConfigListener(config, listener);\n ...
[ "public static IPool getPool(String host, Integer port, String database, String... userPwd) {\n //暂未启用\n throw new RuntimeException(\"未找到指定的数据库连接池\");\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// UPDATE table_name SET column_name = value [, column_name = value ...] [WHERE condition]
[ "func (q *Insert) toUpdateString(where *Where) string {\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(\"UPDATE \")\n\tbuffer.WriteString(q.table)\n\tbuffer.WriteString(\"\\n\")\n\tbuffer.WriteString(\"SET \")\n\t\n\tif len(q.column) > 0 && len(q.column) == len(q.data) {\n\t\tfor i:=0; i < len(q.column);i++ {\n\t...
[ "@Override\n protected AstNode parseAlterTableStatement( DdlTokenStream tokens,\n AstNode parentNode ) throws ParsingException {\n assert tokens != null;\n assert parentNode != null;\n // TODO:\n //\n /*\n * \n\n ALT...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Process a snapshot job @param array $query @param bool|String $report_email @param bool|String $postback_url @return array
[ "public function processSnapshotJob(array $query, $report_email = false, $postback_url = false, array $options = [ ]) {\n $data = [ 'query' => $query ];\n return $this->processJob('snaphot', $data, $report_email, $postback_url, [ ], $options);\n }" ]
[ "function event_status($params, $post_data) {\n\t\t// version 2 only.\n\t\t$request_url = \"{$this->url_base}/track/event\";\n\t\t$response = $this->curl($request_url, $post_data, \"POST\", \"tracking_event_status\");\n\t\treturn $response;\n\t}" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }