query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
// SetCreatorRequestId sets the CreatorRequestId field's value.
[ "func (s *VaultListMember) SetCreatorRequestId(v string) *VaultListMember {\n\ts.CreatorRequestId = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Removes special controls characters and normalizes line endings and spaces. @param string $s UTF-8 encoding @return string
[ "public static function normalize(string $s): string\n {\n if (\\class_exists('\\Normalizer', false)) {\n // convert to compressed normal form (NFC)\n $s = \\Normalizer::normalize($s, \\Normalizer::FORM_C);\n }\n\n $s = static::normalizeNewLines($s);\n\n // remov...
[ "def append_line(self, new_line):\n \"\"\"\"\"\"\n # TODO: The user still has to write the raw line, this is error prone.\n self._write(('PGM', [Integer, String]), self.idx, new_line)" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// NewClient returns a fully configured and pre-authenticated client // (pre-authenticated with server CAs and signed session key)
[ "func (i *TeleInstance) NewClient(cfg ClientConfig) (*client.TeleportClient, error) {\n\ttc, err := i.NewUnauthenticatedClient(cfg)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\n\t// configures the client authenticate using the keys from 'secrets':\n\tuser, ok := i.Secrets.Users[cfg.Login]\n\tif !ok {...
[ "func (r *MintOAuthTokenGrantRPC) validateRequest(c context.Context, req *minter.MintOAuthTokenGrantRequest, caller identity.Identity) (*Rule, error) {\n\t// Dump the whole request and relevant auth state to the debug log.\n\tr.logRequest(c, req, caller)\n\n\t// Reject obviously bad requests.\n\tif err := r.checkRe...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Access control:" }
Gets the type transformations.
[ "public ImmutableMap<String, Node> getTypeTransformations() {\n if (info == null || info.typeTransformations == null) {\n return ImmutableMap.<String, Node>of();\n }\n return ImmutableMap.copyOf(info.typeTransformations);\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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
编码为Base64<br> 如果isMultiLine为<code>true</code>,则每76个字符一个换行符,否则在一行显示 @param arr 被编码的数组 @param isMultiLine 在76个char之后是CRLF还是EOF @param isUrlSafe 是否使用URL安全字符,一般为<code>false</code> @return 编码后的bytes
[ "public static byte[] encode(byte[] arr, boolean isMultiLine, boolean isUrlSafe) {\r\n\t\tif (null == arr) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tint len = arr.length;\r\n\t\tif (len == 0) {\r\n\t\t\treturn new byte[0];\r\n\t\t}\r\n\r\n\t\tint evenlen = (len / 3) * 3;\r\n\t\tint cnt = ((len - 1) / 3 + 1) << 2;...
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about text processing:" }
Generates rows (each a sequence of values) from a single array of values.
[ "def array_scanlines(self, pixels):\n \n\n # Values per row\n vpr = self.width * self.planes\n stop = 0\n for y in range(self.height):\n start = stop\n stop = start + vpr\n yield pixels[start:stop]" ]
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Natural Language Processing:" }
Marshall the given parameter object.
[ "public void marshall(DeleteDirectoryConfigRequest deleteDirectoryConfigRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (deleteDirectoryConfigRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolM...
[ "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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
<p> The attributes. </p> @param attributes The attributes.
[ "public void setAttributes(java.util.Collection<TargetGroupAttribute> attributes) {\n if (attributes == null) {\n this.attributes = null;\n return;\n }\n\n this.attributes = new java.util.ArrayList<TargetGroupAttribute>(attributes);\n }" ]
[ "func (m *Strings) ToRawInfo() interface{} {\n\tinfo := yaml.MapSlice{}\n\tif m == nil {\n\t\treturn info\n\t}\n\t// &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}\n\treturn info\n}" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Function that loads endpoints from the configuration file @param {{?}[]} endpoints The array of endpoints @param {{?}} options The map of options @param {bool} auth If we should be loading endpoints that require authentication
[ "function loadEndpoints(endpoints, options, auth) {\n\tif (Array.isArray(endpoints)) {\n\t\tendpoints.forEach(function(endpoint) {\n\t\t\tif (auth !== Boolean(endpoint.authenticated)) {\n\t\t\t\t//after endpoints refactored, remove this check\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst conditional = endpoint.hasOwnPrope...
[ "def webhook_handler(request):\n \n body = request.stream.read().decode('utf8')\n print('webhook handler saw:', body)\n api.notify_webhook_received(payload=body)\n\n # nb. protected references are not part of the API.\n # this is just to demonstrate that the asyncid is stored\n print('key store...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Refuse an incoming a transfer request
[ "def refuse_transfer(transfer, comment=None):\n ''''''\n TransferResponsePermission(transfer).test()\n\n transfer.responded = datetime.now()\n transfer.responder = current_user._get_current_object()\n transfer.status = 'refused'\n transfer.response_comment = comment\n transfer.save()\n\n ret...
[ "func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
model must be loaded after the connection is established
[ "def require_models\n model_dir = File.join(File.dirname(__FILE__), %w{ model })\n unless Dir.exist? model_dir\n raise \"model directory '#{model_dir}' not exists\"\n end\n Dir[File.join(model_dir, '*.rb')].each do |f|\n # puts f\n require f\n end\n end" ]
[ "def get_app(self):\n \n # First see to connection stack\n ctx = connection_stack.top\n if ctx is not None:\n return ctx.app\n\n # Next return app from instance cache\n if self.app is not None:\n return self.app\n\n # Something went wrong, in mo...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Update the offsets
[ "def _update_offsets(start_x, spacing, terminations, offsets, length):\n '''\n '''\n return (start_x + spacing[0] * terminations / 2.,\n offsets[1] + spacing[1] * 2. + length)" ]
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Cache the available locales we have so we don't read the same directory for each request
[ "function updateLocalesCache() {\n cached_available_locales = [];\n\n fs.readdir(global.config.public_http + '/assets/locales', function (err, files) {\n if (err) {\n if (err.code === 'ENOENT') {\n winston.error('No locale files could be found at ' + err.path);\n } ...
[ "def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Language and programming:" }
Restores the states of all the instances from the current target handlers.
[ "void restoreAllInstances() {\n\n\t\t// instancesMngr() instead of this.instancesMngr (for unit tests).\n\t\tthis.logger.fine( \"Restoring all the instance states from the current target handlers.\" );\n\t\tfor( ManagedApplication ma : this.applicationMngr.getManagedApplications()) {\n\n\t\t\t// Build a new snapsho...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Install any publicly accessible, standard Drupal distribution. @param string $site @param string $env @param string $projectName @param string $version @return \Acquia\Cloud\Api\Response\Task @throws \Guzzle\Http\Exception\ClientErrorResponseException
[ "public function installDistroByProject($site, $env, $projectName, $version)\n {\n $source = 'http://ftp.drupal.org/files/projects/' . $projectName . '-' . $version . '-core.tar.gz';\n return $this->installDistro($site, $env, self::INSTALL_PROJECT, $source);\n }" ]
[ "public function handle(EventInterface $event)\n {\n\n try {\n // load the application server instance\n /** @var \\AppserverIo\\Psr\\ApplicationServer\\ApplicationServerInterface $applicationServer */\n $applicationServer = $this->getApplicationServer();\n\n //...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Initializes PyMOL
[ "def initialize_pymol(options):\n \"\"\"\"\"\"\n import pymol\n # Pass standard arguments of function to prevent PyMOL from printing out PDB headers (workaround)\n pymol.finish_launching(args=['pymol', options, '-K'])\n pymol.cmd.reinitialize()" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.
[ "func (d *Deployment) GetNodeID() string {\n\tif d == nil || d.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.NodeID\n}" ]
[ "def _wrap_field(field):\n \"\"\"\"\"\"\n class WrappedField(field):\n def output(self, key, obj):\n value = _fields.get_value(key if self.attribute is None else self.attribute, obj)\n\n # For all fields, when its value was null (None), return null directly,\n # instea...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Reads the latest client startup record for a single client.
[ "def ReadClientStartupInfo(self, client_id, cursor=None):\n \"\"\"\"\"\"\n query = (\n \"SELECT startup_info, UNIX_TIMESTAMP(timestamp) \"\n \"FROM clients, client_startup_history \"\n \"WHERE clients.last_startup_timestamp=client_startup_history.timestamp \"\n \"AND clients.client...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Returns template configuration @param integer $template @return \stdClass @throws \ActualReports\PDFGeneratorAPI\Exception
[ "public function get($template)\n {\n $response = $this->request(self::REQUEST_GET, 'templates/'.$template);\n return $response->response;\n }" ]
[ "final public static function sinfo(array $params):string\n {\n return (\\iumioFramework\\Core\\Base\\Server\\GlobalServer::getServerInfo($params['name']));\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// NewPrefixDB lets you namespace multiple DBs within a single DB.
[ "func NewPrefixDB(db DB, prefix []byte) *prefixDB {\n\treturn &prefixDB{\n\t\tprefix: prefix,\n\t\tdb: db,\n\t}\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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Calculates anchor points evenly spaced across the world, given user-specified parameters. Note: May not be exactly even if world size is not divisible by patches+1. Note: Eveness is based on bounded world, not toroidal.
[ "def calcEvenAnchors(args):\n \n anchors = []\n dist = int((args.worldSize)/(args.patchesPerSide+1))\n for i in range(dist, args.worldSize, dist):\n for j in range(dist, args.worldSize, dist):\n anchors.append((i, j))\n return anchors" ]
[ "def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Is called to close the popup and show the new values.<p>
[ "protected void closePopup() {\n\n List<String> result;\n\n if (m_previewHandlerRegistration != null) {\n m_previewHandlerRegistration.removeHandler();\n m_previewHandlerRegistration = null;\n }\n if (m_isSingleValue) {\n result = m_cmsCategoryTree.getSel...
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns the EmptyVal instance for the given type
[ "def placeholder(type_):\n \"\"\"\"\"\"\n typetuple = type_ if isinstance(type_, tuple) else (type_,)\n if any in typetuple:\n typetuple = any\n if typetuple not in EMPTY_VALS:\n EMPTY_VALS[typetuple] = EmptyVal(typetuple)\n return EMPTY_VALS[typetuple]" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Gets the metadata for the provider chain. return: (osid.Metadata) - metadata for the provider chain *compliance: mandatory -- This method must be implemented.*
[ "def get_provider_links_metadata(self):\n \n # Implemented from template for osid.learning.ActivityForm.get_assets_metadata_template\n metadata = dict(self._mdata['provider_links'])\n metadata.update({'existing_provider_links_values': self._my_map['providerLinkIds']})\n return Met...
[ "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 description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Deletes the property definition by cascading the properties on resources.<p> @throws JspException if problems including sub-elements occur
[ "public void actionDeleteCascade() throws JspException {\n\n // save initialized instance of this class in request attribute for included sub-elements\n getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);\n try {\n // list of all resources containing this propertydefin...
[ "public void removeLinks(ServiceReference<D> declarationSRef) {\n D declaration = getDeclaration(declarationSRef);\n for (ServiceReference serviceReference : declaration.getStatus().getServiceReferencesBounded()) {\n // FIXME : In case of multiples Linker, we will remove the link of all the...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Convert_v1beta1_VolumeAttachmentList_To_storage_VolumeAttachmentList is an autogenerated conversion function.
[ "func Convert_v1beta1_VolumeAttachmentList_To_storage_VolumeAttachmentList(in *v1beta1.VolumeAttachmentList, out *storage.VolumeAttachmentList, s conversion.Scope) error {\n\treturn autoConvert_v1beta1_VolumeAttachmentList_To_storage_VolumeAttachmentList(in, out, s)\n}" ]
[ "func Convert_build_CommonSpec_To_v1_CommonSpec(in *build.CommonSpec, out *v1.CommonSpec, s conversion.Scope) error {\n\treturn autoConvert_build_CommonSpec_To_v1_CommonSpec(in, out, s)\n}" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Create the X axis. @param string $boundaries_csv @return array
[ "private function axisNumbers(string $boundaries_csv): array\n {\n $boundaries = explode(',', $boundaries_csv);\n\n $boundaries = array_map(static function (string $x): int {\n return (int) $x;\n }, $boundaries);\n\n $axis = [];\n foreach ($boundaries as $n => $bound...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// The Hijacker interface is implemented by ResponseWriters that allow an // HTTP handler to take over the connection.
[ "func (w *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {\n\treturn w.writer.(http.Hijacker).Hijack()\n}" ]
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the Github text about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Software development:" }
convert an fps value to an [x,y] array
[ "function fpsToPoint(index, fps_val, min, delta) {\n return [\n canvas_w - index,\n canvas_h - canvas_h * (fps_val - min) / delta\n ];\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Returns a UTMDetail object which consists of UTM parameters like source, medium & campaign @return The {@link UTMDetail} object
[ "@SuppressWarnings({\"unused\", \"WeakerAccess\"})\n public UTMDetail getUTMDetails() {\n UTMDetail ud = new UTMDetail();\n ud.setSource(source);\n ud.setMedium(medium);\n ud.setCampaign(campaign);\n return ud;\n }" ]
[ "def run(configObj=None, input_dict={}, loadOnly=False):\n \n # If called from interactive user-interface, configObj will not be\n # defined yet, so get defaults using EPAR/TEAL.\n #\n # Also insure that the input_dict (user-specified values) are folded in\n # with a fully populated configObj inst...
codesearchnet
{ "query": "Represent the description about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
@param string $placement @return MoveStrategyInterface @throws InvalidArgumentException
[ "protected function getMoveStrategy(string $placement): MoveStrategyInterface\n {\n $adapter = $this->getManipulator();\n\n switch ($placement) {\n case self::PLACEMENT_BOTTOM:\n return new MoveStrategy\\Bottom($adapter);\n case self::PLACEMENT_TOP:\n ...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Extract a subset of a geometry matching a desired atom. .. todo:: Complete g_subset docstring
[ "def g_subset(g, atwts, atwt,\n digits=_DEF.SYMM_ATWT_ROUND_DIGITS):\n \n\n # Imports\n import numpy as np\n\n # Ensure g and atwts are n-D vectors\n g = make_nd_vec(g, nd=None, t=np.float64, norm=False)\n atwts = make_nd_vec(atwts, nd=None, t=np.float64, norm=False)\n\n # Ensure dim...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Upload a file to the storage account. @param jobFolder the path to the destination folder within storage container. @param file the source file. @return the SAS URI to the uploaded file. @throws IOException
[ "public URI uploadFile(final String jobFolder, final File file) throws IOException {\n\n LOG.log(Level.INFO, \"Uploading [{0}] to [{1}]\", new Object[]{file, jobFolder});\n\n try {\n final CloudBlobClient cloudBlobClient = this.cloudBlobClientProvider.getCloudBlobClient();\n final CloudBlobContainer...
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Used to void a given previously-authorized transaction.
[ "function _doVoid($oID, $note = '') {\n global $db, $messageStack;\n\n $new_order_status = (int)MODULE_PAYMENT_AUTHORIZENET_AIM_REFUNDED_ORDER_STATUS_ID;\n if ($new_order_status == 0) $new_order_status = 1;\n $voidNote = strip_tags(zen_db_input($_POST['voidnote'] . $note));\n $voidAuthID = trim(strip...
[ "@Override\n protected CreditCardAuthorizationResult run() {\n // Simulate transitive dependency from CreditCardCommand to GetUserAccountCommand.\n // UserAccount could be injected into this command as an argument (and that would be more accurate)\n // but often in large codebase that ends u...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Converts a symbol to a class name, taken from rails
[ "def camelize(term)\n string = term.to_s\n string = string.sub(/^[a-z\\d]*/) { $&.capitalize }\n string.gsub(/(?:_|(\\/))([a-z\\d]*)/i) { $2.capitalize }.gsub('/', '::')\n end" ]
[ "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:" }
(Coord, Object, imgCols) -> Array
[ "function _getColorByXY(coord, imgSize, imgCols) {\n var colPos = _getColorPositionByXY(coord, imgSize);\n return [imgCols[colPos], imgCols[colPos+1], imgCols[colPos+2], imgCols[colPos+3]];\n}" ]
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Taint is used to mark a path as tainted. This means only RollbackOperation // RevokeOperation requests are allowed to proceed
[ "func (r *Router) Taint(ctx context.Context, path string) error {\n\tns, err := namespace.FromContext(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpath = ns.Path + path\n\n\tr.l.Lock()\n\tdefer r.l.Unlock()\n\t_, raw, ok := r.root.LongestPrefix(path)\n\tif ok {\n\t\traw.(*routeEntry).tainted = true\n\t}\n\tretur...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
@param string $storageName @param array|string $key @return string
[ "private function flattenKey($storageName, $key)\n {\n $finalKey = $storageName . '-';\n\n if (is_string($key)) {\n return $finalKey . $key;\n }\n\n if (! is_array($key)) {\n throw new \\InvalidArgumentException('The key should be a string or a flat array.');\n ...
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Return a link to edit a page, deep linking into the document set given @param int $pageId @param int $documentSetId @return string
[ "protected function getPageEditLink($pageId, $documentSetId)\n {\n return Controller::join_links(\n CMSPageEditController::singleton()->getEditForm($pageId)->FormAction(),\n 'field/DocumentSets/item',\n (int) $documentSetId\n );\n }" ]
[ "def set_note_attribute(data):\n \n na = False\n if data.get('link'):\n na = Types.NoteAttributes()\n # add the url\n na.sourceURL = data.get('link')\n # add the object to the note\n return na" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// MarshalBinary interface implementation
[ "func (m *Swaggeroauth2TokenParameters) MarshalBinary() ([]byte, error) {\n\tif m == nil {\n\t\treturn nil, nil\n\t}\n\treturn swag.WriteJSON(m)\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:" }
Find a structure by root paragraph id @param int|array $primaryKeys @return Structure
[ "public function find( $primaryKeys )\n {\n if ( is_array( $primaryKeys ) )\n {\n $primaryKeys = reset( $primaryKeys );\n }\n\n $rootId = ( (int) $primaryKeys ) ?: null;\n\n return $this->createStructure( array(\n 'rootId' => $rootId,\n 'extr...
[ "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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// Parse parses the input bytes to an array of metrics
[ "func (p *parser) Parse(buf []byte) ([]telegraf.Metric, error) {\n\n\tmetrics := make([]telegraf.Metric, 0)\n\n\tmetricTime, err := p.parseTime(buf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdwr, err := p.unmarshalMetrics(buf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmetrics = p.readDWMetrics(\"count...
[ "@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 Data processing:", "pos": "Represent the code about Data processing:", "neg": "Represent the code:" }
Get a specific survey Response Statistics. Survey ID must be set inside the api request object. @return [QuestionproRails::SurveyResponseCount] Survey Response Statistics.
[ "def get_survey_response_count\n url = ApiRequest.base_path(\"questionpro.survey.responseCount\")\n result = self.class.get(url, body: self.options)\n \n self.full_response = result\n self.status = result['status']\n\n response_count = SurveyResponseCount.new(result['response'])\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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Stashes the split between training and testing sets so that it can be used later for automatic scoring of the models in the log.
[ "def stash_split(fqdn, result, *argl, **argd):\n \n global _splits\n if fqdn == \"sklearn.cross_validation.train_test_split\":\n key = id(result[1])\n _splits[key] = result\n\n #We don't actually want to return anything for the analysis; we are using it\n #as a hook to save pointers to ...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Rate creates a new ugen at a specific rate. // If rate is an unsupported value this method will cause a runtime panic.
[ "func (ifft IFFT) Rate(rate int8) Input {\n\tCheckRate(rate)\n\t(&ifft).defaults()\n\treturn NewInput(\"IFFT\", rate, 0, 1, ifft.Buffer, ifft.WinType, ifft.WinSize)\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github instruction about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
Write an entry in the security log. @param $message @param $category
[ "public static function handle($message, $category = null)\n {\n\n SecurityLog::create([\n 'message' => $message,\n 'category' => $category,\n 'user_id' => auth()->user() ?\n auth()->user()->id : null,\n ]);\n\n }" ]
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
GET the provided endpoint
[ "def get(self, path, *args, **kwargs):\n ''''''\n target = self._host.relative(path).utf8\n if not isinstance(target, basestring):\n # on older versions of the `url` library, .utf8 is a method, not a property\n target = target()\n params = kwargs.get('params', {})\n...
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
runs a forge command on a dummy forge @param string $cmd @param array $params @return string
[ "public static function make( $cmd, $params )\n\t{\n\t\tif ( !is_array( $params ) )\n\t\t{\n\t\t\t$params = array( $params );\n\t\t}\n\t\t\n\t\t$forge = new static;\n\t\t\n\t\tif ( !method_exists( $forge, $cmd ) )\n\t\t{\n\t\t\tthrow new CCException( \"CCForge_Php - Command could not be found.\" );\n\t\t}\n\t\t\n\t...
[ "def load_tasks(self, cmd, params, args):\n \"\"\"\"\"\"\n return generate_tasks('taskname that shows up in log', self._gen_tasks()), self.DOIT_CONFIG" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Format a section node containg a summary of a Task class's key APIs.
[ "def _format_summary_node(self, task_class):\n \n modulename = task_class.__module__\n classname = task_class.__name__\n nodes = []\n\n nodes.append(\n self._format_class_nodes(task_class))\n\n nodes.append(\n self._format_config_nodes(modulename, clas...
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Checks path that will be the request. @return string
[ "private function getPath($resourceId = null)\n {\n if (!is_null($resourceId)) {\n $endpoint = ($this->isOrder($resourceId) ? Orders::PATH : Payment::PATH);\n\n return sprintf('/%s/%s/%s/%s', MoipResource::VERSION, $endpoint, $resourceId, self::PATH);\n }\n\n if ($this-...
[ "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 summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about File management:" }
Sets the additional style to mark expired entries or those that have the hide in navigation property set.<p> @param entry the sitemap entry @param itemWidget the item widget
[ "private static void setAdditionalStyles(CmsClientSitemapEntry entry, CmsListItemWidget itemWidget) {\n\n if (!entry.isResleasedAndNotExpired()\n || ((CmsSitemapView.getInstance().getEditorMode() == EditorMode.navigation)\n && !entry.isDefaultFileReleased())) {\n itemWidg...
[ "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 post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
/* internal methods
[ "@SuppressWarnings(\"unchecked\")\n protected CaseFileInstance internalGetCaseFileInstance(String caseId, String deploymentId) {\n logger.debug(\"Retrieving case file from working memory for case \" + caseId);\n Collection<CaseFileInstance> caseFiles = (Collection<CaseFileInstance>) processService....
[ "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:" }
Register the Blade engine implementation. @param \Illuminate\View\Engines\EngineResolver $resolver @return void
[ "public function registerBladeEngine($resolver)\n {\n $app = $this->app;\n\n // The Compiler engine requires an instance of the CompilerInterface, which in\n // this case will be the Blade compiler, so we'll first create the compiler\n // instance to pass into the engine so it can com...
[ "public function boot()\n {\n $manager = new Manager;\n\n // If you have to customize the manager instance, like setting a custom serializer,\n // I strongly suggest you to create your own service provider and add you manager configuration action here\n // Here some example if you wan...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Generating validator files @param stdClass $data @return array
[ "public function generate (stdClass $data)\n {\n $files = [];\n\n $this->createFileFromTemplate ([\n \"destination\" => $data->formValidationDestination,\n \"templateDestination\" => __DIR__ . '/../templates/service/validator.hctpl',\n \"content\" ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Tokenize sentences by reading trained tokenizer and invoking ``PunktSentenceTokenizer()``. :type untokenized_string: str :param untokenized_string: A string containing one of more sentences. :rtype : list of strings
[ "def tokenize_sentences(self, untokenized_string: str):\n \n # load tokenizer\n assert isinstance(untokenized_string, str), \\\n 'Incoming argument must be a string.'\n\n if self.language == 'latin':\n self.models_path = self._get_models_path(self.language)\n ...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
// Deletes a host.
[ "func (c *Client) DeleteHost(p *DeleteHostParameter) (*Result, error) {\n\tobj, err := c.Request(\"deleteHost\", convertParamToMap(p))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*Result), err\n}" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
Check a hash with the password given using PBKDF2 mode. @param string $password @param string $hash @return bool
[ "private function checkModePbkdf2($password, $hash)\n {\n $this->cwsDebug->titleH2('Check password hash in PBKDF2 mode');\n $this->cwsDebug->labelValue('Password', $password);\n $this->cwsDebug->dump('Hash', $hash);\n\n $params = explode(self::PBKDF2_SEPARATOR, $hash);\n if (co...
[ "public static function shortHash($msg, $key)\n {\n # Test the message and key for string validity.\n Helpers::isString($msg, 'Hash', 'shortHash');\n Helpers::isString($key, 'Hash', 'shortHash');\n\n return \\Sodium\\crypto_shorthash($msg, $key);\n }" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about PHP programming:" }
获取素材总数 @return bool|mixed @throws \yii\web\HttpException
[ "public function getMaterialCount()\n {\n $result = $this->httpGet(self::WECHAT_MATERIAL_COUNT_GET_PREFIX, [\n 'access_token' => $this->getAccessToken()\n ]);\n return !array_key_exists('errorcode', $result) ? $result : false;\n }" ]
[ "public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Save variables. @param Request $request @return ResultResponse @Route("/save", name="mediatemplates_form_save")
[ "public function saveAction(Request $request)\n {\n $repository = $this->get('phlexible_media_template.template_manager');\n\n $templateKey = $request->get('template_key');\n $params = $request->request->all();\n\n unset($params['template_key'],\n $params['module'],\n $p...
[ "def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)" ]
codesearchnet
{ "query": "Represent the Github description about Symfony:", "pos": "Represent the Github code about Symfony:", "neg": "Represent the Github code:" }
used by subclass DistributedNioMap
[ "final protected void common_put(\n Object key,\n Object value,\n Object userMetaData,\n int priority,\n int timeToLive,\n ...
[ "def create(self):\n \n self.queue = self.scheduler.queue.addSubQueue(self.priority, LockEvent.createMatcher(self.context, self.key),\n maxdefault = self.size, defaultQueueClass = CBQueue.AutoClassQueue.initHelper('locker', subqueuelimit = 1))" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Insert new data for $this->table @param array $data Data to store @param bool $return_obj Wanna see whole stored data? or just id @return mixed
[ "public function add(array $data, $return_obj = false)\n {\n if (false === $this->has_table()) return false;\n\n if (empty($data)) {\n $this->set_error('No data to insert');\n return false;\n }\n\n if ($timestamp = $this->timestamp('creation')) {\n $da...
[ "public function getPropertyValue($propertyName, $objectId = null)\n {\n\n //You can return this protected properties as objects too.\n if (in_array($propertyName, array(\"objectId\", \"objectType\", \"objectURI\")) && isset($this->$propertyName)) {\n return $this->$propertyName;\n ...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
/* ------------------------------------------------------------
[ "public synchronized void removeContextAttribute(String name)\n {\n Object old= super.getContextAttribute(name);\n super.removeContextAttribute(name);\n\n if (old != null && _contextAttributeListeners != null)\n {\n ServletContextAttributeEvent event= new ServletContextAttr...
[ "public function description()\n {\n //====================================================================//\n // Stack Trace\n Splash::log()->trace();\n\n //====================================================================//\n // Build & Return Widget Description Array\n ...
codesearchnet
{ "query": "Represent the Github instruction about N/A:", "pos": "Represent the Github code about N/A:", "neg": "Represent the Github code about Software Development:" }
Retrieve a deploy preview URL from an array of statuses. By default, a matching status is inferred via `isPreviewContext`.
[ "function getPreviewStatus(statuses, config) {\n const previewContext = config.getIn(['backend', 'preview_context']);\n return statuses.find(({ context }) => {\n return isPreviewContext(context, previewContext);\n });\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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
random_string function Does what it says on the tin. @param $length @return string
[ "public static function random_string($length) {\n $key = '';\n $keys = array_merge(range(0, 9), range('a', 'z'));\n\n for ($i = 0; $i < $length; $i++) {\n $key .= $keys[array_rand($keys)];\n }\n\n return $key;\n }" ]
[ "def append_line(self, new_line):\n \"\"\"\"\"\"\n # TODO: The user still has to write the raw line, this is error prone.\n self._write(('PGM', [Integer, String]), self.idx, new_line)" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// CreateOptionIpam function returns an option setter for the ipam configuration for this endpoint
[ "func CreateOptionIpam(ipV4, ipV6 net.IP, llIPs []net.IP, ipamOptions map[string]string) EndpointOption {\n\treturn func(ep *endpoint) {\n\t\tep.prefAddress = ipV4\n\t\tep.prefAddressV6 = ipV6\n\t\tif len(llIPs) != 0 {\n\t\t\tfor _, ip := range llIPs {\n\t\t\t\tnw := &net.IPNet{IP: ip, Mask: linkLocalMask}\n\t\t\t\...
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Technology:" }
// SetClusterArn sets the ClusterArn field's value.
[ "func (s *DescribeClusterInput) SetClusterArn(v string) *DescribeClusterInput {\n\ts.ClusterArn = &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 Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Call this method to offload auxiliary dependency tables to the disk and update property file.
[ "@Override\n public int writeAuxiliaryDepTables() {\n int returnCode = htod.writeAuxiliaryDepTables();\n if (returnCode == HTODDynacache.DISK_EXCEPTION) {\n stopOnError(this.htod.diskCacheException);\n } else {\n updatePropertyFile();\n }\n return returnCo...
[ "@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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Validate checks the field values on Router with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "func (m *Router) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\t{\n\t\ttmp := m.GetDynamicStats()\n\n\t\tif v, ok := interface{}(tmp).(interface{ Validate() error }); ok {\n\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\treturn RouterValidationError{\n\t\t\t\t\tfield: \"DynamicStats\",\n\t\t\...
[ "function DefaultChangeRequestInterceptor(saveContext, saveBundle) {\n /**\n Prepare and return the save data for an entity change-set.\n\n The adapter calls this method for each entity in the change-set,\n after it has prepared a \"change request\" for that object.\n\n The method can do anything...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Deprecated in 1.2. Use hitcount.views.HitCountJSONView instead.
[ "def update_hit_count_ajax(request, *args, **kwargs):\n \n warnings.warn(\n \"hitcount.views.update_hit_count_ajax is deprecated. \"\n \"Use hitcount.views.HitCountJSONView instead.\",\n RemovedInHitCount13Warning\n )\n view = HitCountJSONView.as_view()\n return view(request, *ar...
[ "def includeme(config):\n \n root = config.get_root_resource()\n root.add('nef_polymorphic', '{collections:.+,.+}',\n view=PolymorphicESView,\n factory=PolymorphicACL)" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Delivery functions
[ "def send_item_using_eventmachine(item, uri)\n body = item.dump\n return unless body\n\n headers = { 'X-Rollbar-Access-Token' => item['access_token'] }\n options = http_proxy_for_em(uri)\n req = EventMachine::HttpRequest.new(uri.to_s, options).post(:body => body, :head => headers)\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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetSecurityProfileName sets the SecurityProfileName field's value.
[ "func (s *ListActiveViolationsInput) SetSecurityProfileName(v string) *ListActiveViolationsInput {\n\ts.SecurityProfileName = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
获取缓存的值,access_token, jsapi_ticket @param string $key 键 @param Closure $call 如果缓存获取不到备用 @return mixed 值
[ "public function getCachedValue($key, $call = null)\n {\n // 从自己配置中取出未过期数据\n if ($this->getConfig($key) and $this->getConfig(\"{$key}_expiresed_at\") > time()) {\n return $this->getConfig($key);\n }\n\n // 自己的配置中没有就从缓存文件中取\n $prefix = $this->getConfig('file_prefix');...
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Converts a java date pattern to a jquery date pattern @param pattern Pattern to be converted @return converted pattern
[ "public static final String convertPattern(String pattern) {\n if (pattern == null) {\n return null;\n }\n else {\n String convertedPattern = pattern;\n for (PatternConverter converter : PATTERN_CONVERTERS) {\n convertedPattern = converter.convert...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// WriteTo writes record to file and returns bytes written or error
[ "func (r Record) WriteTo(w io.Writer) (int64, error) {\n\tn, err := fmt.Fprintf(w, \"%s\\t%s\\n\", r.IP, r.Hosts)\n\treturn int64(n), err\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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about File management:" }
Process relational attributes. @param rlHolders relation holders @param row kv row object @param schemaTable the schema table
[ "private void onRelationalAttributes(List<RelationHolder> rlHolders, Row row, Table schemaTable)\n {\n // Iterate over relations\n if (rlHolders != null && !rlHolders.isEmpty())\n {\n for (RelationHolder rh : rlHolders)\n {\n String relationName = rh.getR...
[ "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:" }
This private field in the superclass needs to be reset so that we can continue reporting leaks even if they're duplicates. This is ugly but ideally should not be called frequently (or at all).
[ "private void resetReportedLeaks() {\n try {\n Field reportedLeaks = ResourceLeakDetector.class.getDeclaredField(\"reportedLeaks\");\n reportedLeaks.setAccessible(true);\n Object f = reportedLeaks.get(this);\n if (f instanceof Map) {\n ((Map) f).clea...
[ "func (rl *resignLeadership) Execute(state State) (*State, error) {\n\t// TODO(fwereade): this hits a lot of interestingly intersecting problems.\n\t//\n\t// 1) we can't yet create a sufficiently dumbed-down hook context for a\n\t// leader-deposed hook to run as specced. (This is the proximate issue,\n\t// an...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Me lista todas las categorias que existen en la Queries si se le pasa como parametro un "*" me trae todas @param string $filtro @return array $categorias find(all)
[ "function listarCategorias($filtro = '*'){\n\n\t\t$conditions[] = array('categoria <>'=>\"\");\n\n\t\tif($filtro != '*'){\n\t\t\t$conditions[] = array(\"categoria LIKE\" => \"%\".$filtro.\"%\");\n\t\t}\n\t\t$this->recursive = -1;\n\n\t\t$categorias = $this->find('all', array(\n\t\t\t\t\t'group' => 'categoria',\n\t...
[ "private function init(){\n //Load Archivos de Funciones\n $this->loadFunctionsFiles();\n //Instancio el sistema de Cache\n $this->cache= new Support\\Cache\\Cache();\n //EnolaContext->init(): Cargo las configuraciones de contexto faltante\n $this->context->init();\n ...
codesearchnet
{ "query": "Represent the text about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Loads the configured providers.
[ "private function _loadProviders($fromRecord = false)\n {\n if($this->_providersLoaded)\n {\n return;\n }\n\n $providerSources = $this->_getProviders();\n\n foreach($providerSources as $providerSource)\n {\n // handle\n $handle = $provide...
[ "@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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Helper: formats string with any combination of bytestrings/unicode strings without raising exceptions
[ "def safe_format(format_string, *args, **kwargs):\n \n try:\n if not args and not kwargs:\n return format_string\n else:\n return format_string.format(*args, **kwargs)\n\n # catch encoding errors and transform everything into utf-8 string\n # before logging:\n exce...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// Set implements the flag.Value interface.
[ "func (f stringPairsFlag) Set(s string) error {\n\tparts := strings.Split(s, \":\")\n\tif len(parts) == 1 {\n\t\treturn fmt.Errorf(\"no colon\")\n\t}\n\tstrpair.Map(f).Add(parts[0], parts[1])\n\treturn nil\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 text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
this can be faster but it's pretty unusual to be called.
[ "public final static int typeNameKeyWordFromMask(int possible_names, int length) {\n int kw = KEYWORD_unrecognized;\n if (possible_names != IonTokenConstsX.KW_ALL_BITS) {\n for (int ii=0; ii<typeNameBits.length; ii++) {\n int tb = typeNameBits[ii];\n if (tb == ...
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
-----------------------------------------------------------------------
[ "private void generateSeparator() {\n if (insertRegion.size() > 0 && insertRegion.get(insertRegion.size() - 1).equals(LINE_SEPARATOR)) {\n return;\n }\n addLine(0, LINE_SEPARATOR);\n }" ]
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github instruction about language and writing:", "pos": "Represent the Github code about language and writing:", "neg": "Represent the Github code:" }
Gets a timetable for a specific line. @param lineId The id of the line you want to get a timetable for. @param options Options to limit the results by. Default: LineTimetableQueryOptions.defaultQueryOptions() @return The line timetable.
[ "public TransportApiResult<List<LineTimetable>> getLineTimetable(String lineId, LineTimetableQueryOptions options)\r\n {\r\n \tif (Extensions.isNullOrWhiteSpace(lineId))\r\n \t{\r\n \t\tthrow new IllegalArgumentException(\"LineId is required.\");\r\n \t}\r\n \t\r\n \tif (options == null)\r\n ...
[ "function initialize () {\n return pullTaskRunner.run(function() {\n return store.defineTable({\n name: pulltimeTableName,\n columnDefinitions: {\n id: 'string', // column for storing queryId\n tableName: 'string', // column for s...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Complete fills in any fields not set that are required to have valid data. It's mutating the receiver.
[ "func (c *Config) Complete(informers informers.SharedInformerFactory) completedConfig {\n\tc.GenericConfig.Version = &version.Info{\n\t\tMajor: \"1\",\n\t\tMinor: \"0\",\n\t}\n\treturn completedConfig{c.GenericConfig.Complete(informers)}\n}" ]
[ "function customizer(destination, source) {\n // If we're not working with a plain object, copy the value as is\n // If source is an array, for instance, it will replace destination\n if (!isPlain(source)) {\n return source;\n }\n\n // If the new value is a plain object but the first object value is not\n ...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Append relation column filter to query builder. @param array $column @param string $value @return $this
[ "public function filterByRelation($column, $value = null)\n {\n $relations = explode('.', $column);\n $column = $this->getColumn($column = array_pop($relations), $relations);\n\n $relations = array_map(function ($relation) {\n return camel_case($relation);\n }, $relation...
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
application : str charm_url : str Returns -> None
[ "async def SetCharmProfile(self, application, charm_url):\n '''\n \n '''\n # map input types to rpc msg\n _params = dict()\n msg = dict(type='Application',\n request='SetCharmProfile',\n version=8,\n params=_params)\n ...
[ "def app_to_object(self):\n \"\"\"\"\"\"\n if self.tagClass != Tag.applicationTagClass:\n raise ValueError(\"application tag required\")\n\n # get the class to build\n klass = self._app_tag_class[self.tagNumber]\n if not klass:\n return None\n\n # buil...
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Replaces "0.0" with "1.0" or "1.0" with "0.0" @return Node\Scalar\DNumber
[ "public function mutate(Node $node)\n {\n if ($node->value === 0.0) {\n return new Node\\Scalar\\DNumber(1.0);\n }\n\n return new Node\\Scalar\\DNumber(0.0);\n }" ]
[ "function BinaryPacker_pack(source, // @arg Any - source data\n formatID) { // @arg Integer - 0x0001 - 0xffff\n // @ret Uint8Array|null\n//{@dev\n $valid(_isValidFormatID(formatID), BinaryPacker_pack, \"formatID\");\n//}@dev\n var moduleID = ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Java programming:" }
/* Manually capture an exception and send it over to Opbeat.com @param {error} ex An exception to be logged @param {object} options A specific set of options for this error [optional] @return {Opbeat}
[ "function(ex, options) {\n // If not an Error is passed through, recall as a message instead\n if (!(ex instanceof Error)) return Opbeat.captureMessage(ex, options);\n\n // Store the raw exception object for potential debugging and introspection\n lastCapturedException = ex;\n\n /...
[ "function track(event){\n try {\n // TODO look up for event.data.transformer before setting data\n tracker.set(event);\n } catch(e) {\n /** @cut */ basis.dev.error(namespace + '.track(): Error during tracking event processing', event, e);\n }\n}" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Callback invoked by cdbg_native when breakpoint hits. Args: event: breakpoint event (see kIntegerConstants in native_module.cc). frame: Python stack frame of breakpoint hit or None for other events.
[ "def _BreakpointEvent(self, event, frame):\n \n error_status = None\n\n if event != native.BREAKPOINT_EVENT_HIT:\n error_status = _BREAKPOINT_EVENT_STATUS[event]\n elif self.definition.get('action') == 'LOG':\n error_status = self._collector.Log(frame)\n if not error_status:\n retu...
[ "def getFilenameSet(self):\n \n result = set(self._mergeFileTiming())\n # Ignore profiling code. __file__ does not always provide consistent\n # results with f_code.co_filename (ex: easy_install with zipped egg),\n # so inspect current frame instead.\n # Get current file fr...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// ToEtcdConfig returns a config struct for github.com/signalfx/embetcd/embetcd
[ "func (p *GatewayConfig) ToEtcdConfig() *embetcd.Config {\n\t// etcd/embed config struct\n\tetcdCfg := embed.NewConfig()\n\n\t// general configurations\n\tif p.ServerName != nil {\n\t\tetcdCfg.Name = *p.ServerName\n\t}\n\tif p.ClusterDataDir != nil {\n\t\tetcdCfg.Dir = path.Join(*p.ClusterDataDir, \"etcd\")\n\t}\n\...
[ "func Version(url string, kvdbOptions map[string]string) (string, error) {\n\t// Currently we support only v1\n\treturn kvdb.ConsulVersion1, nil\n}" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about consul address:" }
/* [MS-OLEPS] 2.9 BLOB
[ "function parse_BLOB(blob) {\n\tvar size = blob.read_shift(4);\n\tvar bytes = blob.slice(blob.l,blob.l+size);\n\tblob.l += size;\n\tif((size & 3) > 0) blob.l += (4 - (size & 3)) & 3;\n\treturn bytes;\n}" ]
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Given some html we will attempt to extract the id of the remote db. @param string $html @return null|string
[ "private function extractServerId($html)\n {\n $server_id = null;\n\n\t\t$regex =\n '#<option value=\"(\\d+)\".*?>'\n .preg_quote($this->remoteDbHost, '#').\n '.*?</option>#'\n ;\n\n\t\tif (preg_match($regex, $html, $matches) === 1)\n\t\t{\n\t\t\t$server_id = $m...
[ "public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
/* func Min(v1, v2 Vect) Vect { return INLI_Min(v1, v2) } func Max(v1, v2 Vect) Vect { return INLI_Max(v1, v2) } */
[ "func Min(v1, v2 Vect) (out Vect) {\n\tif v1.X < v2.X {\n\t\tout.X = v1.X\n\t} else {\n\t\tout.X = v2.X\n\t}\n\n\tif v1.Y < v2.Y {\n\t\tout.Y = v1.Y\n\t} else {\n\t\tout.Y = v2.Y\n\t}\n\treturn\n}" ]
[ "func (b *Bounding) Contains(c Comparable) bool {\n\tif b == nil {\n\t\treturn true\n\t}\n\tfor d := Dim(0); d < Dim(c.Dims()); d++ {\n\t\tif c.Compare(b[0], d) < 0 || c.Compare(b[1], d) > 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// RenderVSphere executes the actual VM clone creation for vSphere cloud.
[ "func (_ *VirtualMachine) RenderVSphere(t *vsphere.VSphereAPITarget, a, e, changes *VirtualMachine) error {\n\tglog.V(4).Infof(\"VirtualMachine.RenderVSphere invoked with a(%+v) e(%+v) and changes(%+v)\", a, e, changes)\n\t_, err := t.Cloud.CreateLinkClonedVm(changes.Name, changes.VMTemplateName)\n\tif err != nil {...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Remove a specific file reference for $fieldId and $versionId. @param int $fieldId @param int $versionNo
[ "public function removeFileReference($fieldId, $versionNo)\n {\n $deleteQuery = $this->connection->createQueryBuilder();\n $deleteQuery\n ->delete($this->connection->quoteIdentifier($this->getStorageTable()))\n ->where(\n $deleteQuery->expr()->andX(\n ...
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Return parsed command-line arguments.
[ "def parse_args():\n \"\"\"\"\"\"\n threshold_choices = docutils.frontend.OptionParser.threshold_choices\n\n parser = argparse.ArgumentParser(\n description=__doc__ + (' Sphinx is enabled.'\n if SPHINX_INSTALLED else ''),\n prog='rstcheck')\n\n parser.add_argu...
[ "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 about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Calculate the vertical move motion direction. @param delta moved delta. @param threshold threshold to detect the motion. @return the motion direction for the vertical axis.
[ "public static MotionDirection getVerticalMotionDirection(float delta, float threshold) {\n if (threshold < 0) {\n throw new IllegalArgumentException(\"threshold should be positive or zero.\");\n }\n return delta < -threshold ? MotionDirection.DOWN : delta > threshold ? MotionDirecti...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get the password that was typed in.
[ "public String getPassword()\n {\n \tif ((password != null) && (password.length() > 0))\n \t\treturn password;\t// External override\n char[] rgchPassword = passwordField.getPassword();\n return new String(rgchPassword);\n }" ]
[ "public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Clear stored offset information for all partitions except those specified in `excluded`. offset_manager.clear_offsets_excluding("my-topic" => [1, 2, 3]) @return [nil]
[ "def clear_offsets_excluding(excluded)\n # Clear all offsets that aren't in `excluded`.\n @processed_offsets.each do |topic, partitions|\n partitions.keep_if do |partition, _|\n excluded.fetch(topic, []).include?(partition)\n end\n end\n\n # Clear the cached commits from t...
[ "def key_exists?\n old_message = !@store.msetnx(msg_id, :status =>\"incomplete\", :expires => @expires_at, :timeout => now + timeout)\n if old_message\n logger.debug \"Beetle: received duplicate message: #{msg_id} on queue: #{@queue}\"\n end\n old_message\n end" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Messaging:" }
// FetchImageRepos finds all the known image metadata for // containers in the controllers given.
[ "func FetchImageRepos(reg registry.Registry, cs containers, logger log.Logger) (ImageRepos, error) {\n\timageRepos := imageReposMap{}\n\tfor i := 0; i < cs.Len(); i++ {\n\t\tfor _, container := range cs.Containers(i) {\n\t\t\timageRepos[container.Image.CanonicalName()] = image.RepositoryMetadata{}\n\t\t}\n\t}\n\tfo...
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the Github summarization about storage:", "pos": "Represent the Github code about storage:", "neg": "Represent the Github code about Technology:" }