query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Get the security identities for all organizations of user. @param UserInterface $user The user @param null|RoleHierarchyInterface $roleHierarchy The role hierarchy @return SecurityIdentityInterface[]
[ "protected static function getSecurityIdentityForAllOrganizations(UserInterface $user, $roleHierarchy = null)\n {\n $sids = [];\n\n if ($user instanceof UserOrganizationUsersInterface) {\n foreach ($user->getUserOrganizations() as $userOrg) {\n $sids[] = self::fromAccount(...
[ "function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Get collection record or meta data @param string $index @return mixed
[ "function offsetGet($index)\n {\n if (isset($this->{$index})) {\n return $this->{$index};\n } else {\n $records = $this->records();\n if ($index === \"results\") {\n return $records;\n }\n if ($record =& $records[$index]) {\n ...
[ "def search_prod_type_tags(self, ins, type, tags, pipeline):\n ''''''\n return StoredProduct(id=100, content='null.fits', tags={})" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Return the root of the directory corresponding to the desired environment, or None if the environment was not found.
[ "def _env_root(repo, saltenv):\n '''\n \n '''\n # If 'base' is desired, look for the trunk\n if saltenv == 'base':\n trunk = os.path.join(repo['repo'], repo['trunk'])\n if os.path.isdir(trunk):\n return trunk\n else:\n return None\n\n # Check branches\n ...
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// Show a navigable tree view of the current directory.
[ "func main() {\n\trootDir := \".\"\n\troot := tview.NewTreeNode(rootDir).\n\t\tSetColor(tcell.ColorRed)\n\ttree := tview.NewTreeView().\n\t\tSetRoot(root).\n\t\tSetCurrentNode(root)\n\n\t// A helper function which adds the files and directories of the given path\n\t// to the given target node.\n\tadd := func(target...
[ "def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt...
codesearchnet
{ "query": "Represent the Github text about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code:" }
Returns the number of free bytes remaining in the file associated with this LogFileHandle instance. @return long The number of free bytes remaining.
[ "public int freeBytes()\n {\n if (tc.isEntryEnabled())\n Tr.entry(tc, \"freeBytes\", this);\n\n int freeBytes = 0;\n\n try\n {\n int currentCursorPosition = _fileBuffer.position();\n int fileLength = _fileBuffer.capacity();\n\n freeBytes = f...
[ "function MODERN( buffer, start, end ) {\n\n if( !(this instanceof MODERN) )\n return new MODERN( buffer, start, end )\n\n // In order to ensure the integrity of the MBR boot loader code,\n // it is important that the bytes at +0DAh to +0DFh are never changed,\n // unless either all six bytes represent a val...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// BulkUnlinkRichMenu method
[ "func (client *Client) BulkUnlinkRichMenu(userIDs ...string) *BulkUnlinkRichMenuCall {\n\treturn &BulkUnlinkRichMenuCall{\n\t\tc: client,\n\t\tuserIDs: userIDs,\n\t}\n}" ]
[ "@Override\n public void performFileBasedAction(Collection<File> files) {\n Tr.audit(tc, \"LTPA_KEYS_TO_LOAD\", keyImportFile);\n submitTaskToCreateLTPAKeys();\n }" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software Development:" }
Fired after every event, decide if we want to stop waiting
[ "function ontick(next) {\n // No point in waiting that long\n if (next >= timeoutOn) {\n timeout();\n return;\n }\n\n const activeWindow = eventLoop.active;\n if (completionFunction && activeWindow.document.documentElement)\n try {\n const waitFor = Math.max(...
[ "function showIntro() {\n write(\"Welcome to the Recognizer's Sample console application!\");\n write(\"To try the recognizers enter a phrase and let us show you the different outputs for each recognizer or just type 'exit' to leave the application.\");\n write();\n write(\"Here are some examples you co...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Factory function for binary operator handlers.
[ "def _binop_handler(nodetype):\n \n def _handler(toplevel, stack_builders):\n right = make_expr(stack_builders)\n left = make_expr(stack_builders)\n return ast.BinOp(left=left, op=nodetype(), right=right)\n return _handler" ]
[ "@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 software development:", "pos": "Represent the code about software development:", "neg": "Represent the code:" }
Sets the hdc disk interface for this QEMU VM. :param hdc_disk_interface: QEMU hdc disk interface
[ "def hdc_disk_interface(self, hdc_disk_interface):\n \n\n self._hdc_disk_interface = hdc_disk_interface\n log.info('QEMU VM \"{name}\" [{id}] has set the QEMU hdc disk interface to {interface}'.format(name=self._name,\n ...
[ "def detachKernelDriver(self, interface):\n \n \"\"\"\n if isinstance(interface, Interface):\n interface = interface.interfaceNumber\n\n self.dev.detach_kernel_driver(interface)" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Find a matching task for +task_name+.
[ "def [](task_name, scopes=nil)\n task_name = task_name.to_s\n self.lookup(task_name, scopes) or\n enhance_with_matching_rule(task_name) or\n synthesize_file_task(task_name) or\n fail \"Don't know how to build task '#{task_name}'\"\n end" ]
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
// ToError receives an error and mutates it into an Error based on the concrete // type of the Error.
[ "func ToError(err error) HTTPError {\n\tswitch e := err.(type) {\n\tcase *Error:\n\t\treturn e\n\tcase HTTPError:\n\t\tif et, ok := errors.TypeForStatusCode(e.StatusCode()); ok {\n\t\t\treturn NewError(et, e.Error())\n\t\t}\n\t}\n\n\treturn NewError(errors.InternalServerError, \"Internal Server Error\")\n}" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Check that the element's allowed parents are limited to the specified element types.
[ "void assertParent(Collection<Class<? extends Element>> permittedParents) throws InvalidInputException {\n if (!permittedParents.contains(this.getParent().getClass())) {\n throw new InvalidInputException(\"Element \\\"\" + this.getMessageMLTag() + \"\\\" is not allowed as a child of \\\"\"\n + this...
[ "function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n ...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// formatBits computes the string representation of u in the given base. // If neg is set, u is treated as negative int64 value. // Extracted from std package strconv
[ "func formatBits(dst io.Writer, u uint64, neg bool) (int, error) {\n\n\tvar a = pool_integerBuffer.Get().(*byteSliceBuffer)\n\n\ti := integerBufferSize\n\n\tif neg {\n\t\tu = -u\n\t}\n\n\t// common case: use constants for / because\n\t// the compiler can optimize it into a multiply+shift\n\n\tif ^uintptr(0)>>32 == ...
[ "func estimateUnknownSize(unk *runtime.Unknown, byteSize uint64) uint64 {\n\tsize := uint64(unk.Size())\n\t// protobuf uses 1 byte for the tag, a varint for the length of the array (at most 8 bytes - uint64 - here),\n\t// and the size of the array.\n\tsize += 1 + 8 + byteSize\n\treturn size\n}" ]
codesearchnet
{ "query": "Represent the Github text about 32-bit integers:", "pos": "Represent the Github code about 32-bit integers:", "neg": "Represent the Github code about programming:" }
start of the path.
[ "private static String getPath(String uri) {\n int offset = 0;\n if (uri.startsWith(\"http://\")) {\n offset = \"http://\".length();\n } else if (uri.startsWith(\"https://\")) {\n offset = \"https://\".length();\n }\n\n if (offset == 0) {\n return ...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Builds the 17x17 resnet block.
[ "def block17(net, scale=1.0, activation_fn=tf.nn.relu, scope=None, reuse=None):\n \"\"\"\"\"\"\n with tf.variable_scope(scope, 'Block17', [net], reuse=reuse):\n with tf.variable_scope('Branch_0'):\n tower_conv = slim.conv2d(net, 192, 1, scope='Conv2d_1x1')\n with tf.variable_scope('Branch_1'):\n t...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
-- HTTP REQUESTS ------------------------------------------------------------
[ "function makeRequest(title, cacheHitExpected, next) {\n var start = Date.now();\n\n request({\n url: 'http://localhost:1337/',\n encoding: null\n }, function(err, data, body) {\n var time = Date.now() - start;\n\n var receivedImage = new Buffer(body, 'binary');\n\n console.log(title);\n consol...
[ "protected function ping(InputInterface $input, OutputInterface $output)\n {\n $input;\n //====================================================================//\n // Perform Ping Test\n $result = Splash::Selftest();\n //=========================================================...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Addresses is defined on the instances.Instance interface.
[ "func (o *oracleInstance) Addresses(ctx context.ProviderCallContext) ([]network.Address, error) {\n\taddresses := []network.Address{}\n\n\tips, err := o.publicAddressesAssociations()\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\n\tif len(o.machine.Attributes.Network) > 0 {\n\t\tfor name, val := rang...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github sentence about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
Converts parsed formula into DIMACS format. @param formula parsed formula @return formula in DIMACS format
[ "protected static String DIMACSfromList(ArrayList<ArrayList<String>> formula) {\r\n StringBuilder dimacs = new StringBuilder(\"\");\r\n for (List<String> conjClause : formula) {\r\n for (String disjClause : conjClause) {\r\n dimacs.append(disjClause).append(\" \");\r\n ...
[ "def usufyToCsvExport(d, fPath):\n \n\n from pyexcel_io import get_data\n try:\n oldData = {\"OSRFramework\": get_data(fPath) }\n except:\n # No information has been recovered\n oldData = {\"OSRFramework\":[]}\n\n # Generating the new tabular data.\n tabularData = _generateTab...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Backup provides a mock function with given fields: _a0, _a1
[ "func (_m *API) Backup(_a0 string, _a1 []string, _a2 bool) (string, error) {\n\tret := _m.Called(_a0, _a1, _a2)\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func(string, []string, bool) string); ok {\n\t\tr0 = rf(_a0, _a1, _a2)\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.G...
[ "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 text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
// handleListenSegment is called when a listening endpoint receives a segment // and needs to handle it.
[ "func (e *endpoint) handleListenSegment(ctx *listenContext, s *segment) {\n\tswitch s.flags {\n\tcase header.TCPFlagSyn:\n\t\topts := parseSynSegmentOptions(s)\n\t\tif incSynRcvdCount() {\n\t\t\ts.incRef()\n\t\t\tgo e.handleSynSegment(ctx, s, &opts)\n\t\t} else {\n\t\t\tcookie := ctx.createCookie(s.id, s.sequenceNu...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about File management:" }
Executes a SELECT query and returns an array where the first column is used as keys and the second as values. @param string $query SQL query @param array $params Query parameters @return array
[ "public function pairs(string $query, array $params = []): array\n\t{\n\t\treturn $this->all($query, $params, PDO::FETCH_KEY_PAIR);\n\t}" ]
[ "public function compileUpdateLabels(Builder $query, $labels, $operation = 'add' )\n {\n if(trim(strtolower($operation)) == 'add')\n {\n $updateType = 'SET';\n } else\n {\n $updateType = 'REMOVE';\n }\n // Each one of the columns in the update state...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Read full duration and update maximum. Parameters ---------- reset: bool If True, current window start time is reset to 0.
[ "def update(self, reset=True):\n \n if self.parent.info.dataset is not None:\n # read from the dataset, if available\n header = self.parent.info.dataset.header\n maximum = header['n_samples'] / header['s_freq'] # in s\n self.minimum = 0\n self.ma...
[ "def _get_recording(self, index):\n \"\"\"\"\"\"\n assert index >= 0\n recs = np.nonzero((index - self.offsets[:-1]) >= 0)[0]\n if len(recs) == 0: # pragma: no cover\n # If the index is greater than the total size,\n # return the last recording.\n return...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Returns index names and their aliases. This only returns indices which actually have an alias.
[ "@NotNull\n public Map<String, Set<String>> getIndexNamesAndAliases(String indexPattern) {\n // only request indices matching the name or pattern in `indexPattern` and only get the alias names for each index,\n // not the settings or mappings\n final GetAliases request = new GetAliases.Build...
[ "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 Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
/* (non-Javadoc) @see javax.servlet.sip.SipApplicationSessionActivationListener#sessionWillPassivate(javax.servlet.sip.SipApplicationSessionEvent)
[ "public void sessionWillPassivate(SipApplicationSessionEvent event) {\n\t\tlogger.info(\"Following sip application session just passivated \" + event.getApplicationSession().getId() + \" cause \" + ((SipApplicationSessionActivationEvent)event).getCause());\n\n\t}" ]
[ "@Override\n public void removeSSOCookieFromResponse(HttpServletResponse resp) {\n if (resp instanceof com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) {\n ((com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) resp).removeCookie(getSSOCookiename());\n removeJwtSSOCookies((com....
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
TODO: Is there a better place for this ssl setup work and constant defns
[ "private void setupSSL(ReadDeploymentResults readDepl) {\n SslType sslType = readDepl.deployment.getSsl();\n m_config.m_sslEnable = m_config.m_sslEnable || (sslType != null && sslType.isEnabled());\n if (m_config.m_sslEnable) {\n try {\n hostLog.info(\"SSL enabled for ...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
@param array $array @param string $key @return array
[ "public function arrayKey(array $array, $key = 'key'): array\n {\n $out = [];\n\n foreach ($array as $id => $item) {\n if (isset($item[$key])) {\n $out[$item[$key]] = $item;\n } else {\n $out[$id] = $item;\n }\n }\n\n re...
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
format_string should be ``app_label model counts`` renders 'tagging_ext/tag_autocomplete_js.html
[ "def tag_autocomplete_js(format_string=None):\n \"\"\"\"\"\"\n if format_string:\n context_list = format_string.split(' ')\n context = {\n 'app_label':context_list[0],'model':context_list[1], 'counts':context_list[2]\n }\n else:\n context = {}\n return render_to_st...
[ "def single(self):\n \n return 'display: none;' not in self._looking_for_xpb.li(id='ajax_single').\\\n one_(self._profile.profile_tree).attrib['style']" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Set the right child of this node. @param newChild is the new left child @return <code>true</code> on success, otherwise <code>false</code>
[ "public boolean setRightChild(N newChild) {\n\t\tfinal N oldChild = this.right;\n\t\tif (oldChild == newChild) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (oldChild != null) {\n\t\t\toldChild.setParentNodeReference(null, true);\n\t\t\t--this.notNullChildCount;\n\t\t\tfirePropertyChildRemoved(1, oldChild);\n\t\t}\n\n\t\...
[ "public void call(String method, Object[] args)\n throws IOException\n {\n startCall(method);\n\n if (args != null) {\n for (int i = 0; i < args.length; i++)\n writeObject(args[i]);\n }\n\n completeCall();\n }\n\n /**\n * Starts the method ca...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about writing:" }
// NewDNSProviderConfig return a DNSProvider instance configured for AuroraDNS.
[ "func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {\n\tif config == nil {\n\t\treturn nil, errors.New(\"aurora: the configuration of the DNS provider is nil\")\n\t}\n\n\tif config.UserID == \"\" || config.Key == \"\" {\n\t\treturn nil, errors.New(\"aurora: some credentials information are missing\")\...
[ "@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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Marshall the given parameter object.
[ "public void marshall(ListRoutingProfilesRequest listRoutingProfilesRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (listRoutingProfilesRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshal...
[ "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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Marshall the given parameter object.
[ "public void marshall(ProjectBadge projectBadge, ProtocolMarshaller protocolMarshaller) {\n\n if (projectBadge == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(projectBadge.getBadgeEnabled(...
[ "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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Get the current message count. @return int
[ "public function getCurrentMessageCount()\n {\n // Save the current queue flags and setup the queue in passive mode\n $flags = $this->queue->getFlags();\n $this->queue->setFlags($flags | AMQP_PASSIVE);\n\n // Declare the queue again as passive to get the count of messages\n $me...
[ "def getKeySequenceCounter(self):\n \"\"\"\"\"\"\n print '%s call getKeySequenceCounter' % self.port\n keySequence = ''\n keySequence = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:KeyIndex')[0]\n return keySequence" ]
codesearchnet
{ "query": "Represent the instruction about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code:" }
Gets the bit at the given index. @param index The index of the bit to get. @return Indicates whether the bit is set.
[ "public boolean get(long index) {\n if (!(index < size))\n throw new IndexOutOfBoundsException();\n return (bytes.readLong(offset(index)) & (1l << (position(index)))) != 0;\n }" ]
[ "public function containsValue($value): bool {\n\n /**\n * @var string $arrayIndex\n * @var SinglyLinkedList $list\n */\n foreach ($this->bucket as $arrayIndex => $list) {\n /* $list is the first element in the bucket. The bucket\n * can contain max $maxS...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Is the node pointed to by @ref path a name server (specialisation of directory nodes)?
[ "def is_nameserver(self, path):\n '''\n\n '''\n node = self.get_node(path)\n if not node:\n return False\n return node.is_nameserver" ]
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Append notification from the tree node.
[ "function _pushNotifications(meta, obj, fns) {\r\n for (var id in meta[nfs]) {\r\n fns.push(function (i) {\r\n return function () {\r\n meta[nfs][i](obj);\r\n }\r\n } (id));\r\n }\r\n }" ]
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
returns new list with elements from input that satisfies given filter condition
[ "public static <T> List<T> positiveFilter(List<T> input, Predicate<T> filter) {\n argumentsAreNotNull(input, filter);\n return input.stream().filter(filter).collect(Collectors.toList());\n }" ]
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
Returns value from jsopenParams @return boolean $evalValue is set @author Benjamin Butschell bb@webprofil.at>
[ "public function render()\n {\n $fieldKey = $this->arguments['fieldKey'];\n $elementKey = $this->arguments['elementKey'];\n $property = $this->arguments['property'];\n $field = $this->arguments['field'];\n\n $this->generalUtility = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::m...
[ "def helpAbout(self):\n \n\n # Text to be displayed\n about_text = translate('pyBarPlugin',\n \"\"\"<qt>\n <p>Data plotting plug-in for pyBAR.\n </qt>\"\"\",\n 'About')\n\n descr = dict(module_name='pyBarPl...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
From JMS to semileptonic Fierz basis for Class V. `ddll` should be of the form 'sbl_enu_tau', 'dbl_munu_e' etc.
[ "def JMS_to_Fierz_lep(C, ddll):\n \"\"\"\"\"\"\n if ddll[:2] == 'uc':\n s = uflav[ddll[0]]\n b = uflav[ddll[1]]\n q = 'u'\n else:\n s = dflav[ddll[0]]\n b = dflav[ddll[1]]\n q = 'd'\n l = lflav[ddll[4:ddll.find('n')]]\n lp = lflav[ddll[ddll.find('_',5)+1:len(...
[ "def obfn_g1var(self):\n \n \"\"\"\n\n # Use of self.block_sep1(self.AXnr) instead of self.cnst_A1(self.X)\n # reduces number of calls to self.cnst_A0\n return self.var_y1() if self.opt['gEvalY'] else \\\n self.block_sep1(self.AXnr)" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns whether or not the table has a column. @param Column|string $column The Column object or its name @param boolean $caseInsensitive Whether the check is case insensitive. @return boolean
[ "public function hasColumn($column, $caseInsensitive = false)\n {\n if ($column instanceof Column) {\n $column = $column->getName();\n }\n\n if ($caseInsensitive) {\n return isset($this->columnsByLowercaseName[strtolower($column)]);\n }\n\n return isset($t...
[ "public static function getDatabaseConfig($dbConfig = null)\n {\n $config = Config::getInstance();\n\n if (is_null($dbConfig)) {\n $dbConfig = $config->database;\n }\n\n /**\n * Triggered before a database connection is established.\n *\n * This even...
codesearchnet
{ "query": "Represent the sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Programming:" }
Define variables within the namespace. This is similar to :meth:`.Problem.define` except that names must be given as an iterable. This method accepts the same keyword arguments as :meth:`.Problem.define`.
[ "def define(self, names, **kwargs):\n \n define_kwargs = dict(self._define_kwargs)\n define_kwargs.update(kwargs)\n self._problem.define(\n *((self, name) for name in names), **define_kwargs)" ]
[ "def params(self_, parameter_name=None):\n \n if self_.self is not None and self_.self._instance__params:\n self_.warning('The Parameterized instance has instance '\n 'parameters created using new-style param '\n 'APIs, which are incompatibl...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
fonction affichant le formulaire permettant aux admins d'ajouter de nouvelles adresses (rue, sousQuartier, Quartier, ....)
[ "public function afficheFormulaireNouvelleAdresse($criteres = array())\n {\n $html=\"\";\n\n // verification des droits\n $a = new archiAuthentification();\n $u = new archiUtilisateur();\n\n if ($u->isAuthorized('admin_rues', $a->getIdUtilisateur()) && $u->isAuthorized('admin_q...
[ "public function enregistreAdressesLieesAEvenement()\n {\n if (isset($this->variablesGet['idEvenement']) && $this->variablesGet['idEvenement']!='') {\n // d'abord il faut supprimer les ancienne liaisons de positions d'evenements auquel n'appartiennent pas les evenements , ceux ci seront ensuite rem...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about N/A:" }
// SetSourceEndBehavior sets the SourceEndBehavior field's value.
[ "func (s *InputSettings) SetSourceEndBehavior(v string) *InputSettings {\n\ts.SourceEndBehavior = &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 summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// SetFileShareARN sets the FileShareARN field's value.
[ "func (s *DeleteFileShareInput) SetFileShareARN(v string) *DeleteFileShareInput {\n\ts.FileShareARN = &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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Stringify the codes @param mixed $codes @return string
[ "protected function codeStr($codes)\n {\n // If we get something that is already a code string, just pass it back\n if (!is_array($codes) && strpos($codes, ';')) {\n return $codes;\n }\n\n $codes = Helper::toArray($codes);\n\n // Sort for the sake of consistency and ...
[ "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 Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Creates the sequence table if it doesn't exist @chainable
[ "public function initialize()\n {\n $this->_connection->table(self::TABLE)\n ->createIfNotExists(array(\n 'name' => new \\Pheasant\\Types\\StringType(255, 'notnull primary'),\n 'id' => new \\Pheasant\\Types\\IntegerType(null, 'notnull unsigned'),\n )...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Save this image to another DockerImage :param image: DockerImage :return:
[ "def save_to(self, image):\n \n if not isinstance(image, self.__class__):\n raise ConuException(\"Invalid target image type\", type(image))\n self.copy(image.name, image.tag,\n target_transport=image.transport, target_path=image.path,\n logs=False)" ...
[ "def _parse_singlefile(self, desired_type: Type[T], file_path: str, encoding: str, logger: Logger,\n options: Dict[str, Dict[str, Any]]) -> T:\n \n raise Exception('Not implemented since this is a MultiFileParser')" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Args: * None Returns: String - Returns the full postpath & semantic components *NOTE* may not contain the server & port numbers. That depends on what was provided to the parser.
[ "def return_current_uri_subpage(self):\n \n uri = post_slash(\"%s%s/%s/%s\" % (post_slash(self.current_dir()),\n self.slots['page'], self.slots['item'],\n self.slots['subpage']))\n return uri" ]
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Processes log message from a given hunt-induced flow.
[ "def ProcessHuntFlowLog(flow_obj, log_msg):\n \"\"\"\"\"\"\n\n if not hunt.IsLegacyHunt(flow_obj.parent_hunt_id):\n return\n\n hunt_urn = rdfvalue.RDFURN(\"hunts\").Add(flow_obj.parent_hunt_id)\n flow_urn = hunt_urn.Add(flow_obj.flow_id)\n log_entry = rdf_flows.FlowLog(\n client_id=flow_obj.client_id,\...
[ "@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 Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Creates an instance of fabric.Image out of an object @method cloneAsImage @param callback {Function} callback, invoked with an instance as a first argument @return {fabric.Object} thisArg @chainable
[ "function(callback) {\n if (fabric.Image) {\n var i = new Image();\n\n /** @ignore */\n i.onload = function() {\n if (callback) {\n callback(new fabric.Image(i), orig);\n }\n i = i.onload = null;\n };\n\n var orig = {\n angle: th...
[ "function initCreate (args) {\n // method name is moduleNameCreate\n var methodName = `${this.name}Create`\n // method signature is moduleName.methodname\n var methodSignature = `${this.moduleName}.${methodName}`\n // capture model to pass to function\n var model = this\n // add create method t...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Returns all the data from the selected column @param String $filter @param array $columns @return Array
[ "public function getDataForExport($filter, $columns = array())\n\t{\n $select = $this->tableGateway->getSql()->select();\n $select->columns(array('*'));\n \n $w = new Where();\n $filters = array();\n $likes = array();\n \n foreach($columns as $columnKeys) \n ...
[ "public List<Symbol> getSymbolList(final String param) {\n return get(param, new StringToSymbolList(\",\"),\n new AlwaysValid<List<Symbol>>(),\n \"comma-separated list of strings\");\n }" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Documentation:" }
Signal for sending emails after community inclusion request.
[ "def send_community_request_email(increq):\n \"\"\"\"\"\"\n from flask_mail import Message\n from invenio_mail.tasks import send_email\n\n msg_body = format_request_email_body(increq)\n msg_title = format_request_email_title(increq)\n\n sender = current_app.config['COMMUNITIES_REQUEST_EMAIL_SENDER...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Read clusters from file and save to model file.
[ "def load(ctx, input, output):\n \"\"\"\"\"\"\n log.debug('chemdataextractor.cluster.load')\n import pickle\n click.echo('Reading %s' % input.name)\n clusters = {}\n for line in input.readlines():\n cluster, word, freq = line.split()\n clusters[word] = cluster\n pickle.dump(cluste...
[ "@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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Create a new {@link DocumentBuilderFactory} for the specified schema, with the following settings: coalescing, comment ignoring and namespace aware. @param aSchema The schema to use. May not be <code>null</code>. @return Never <code>null</code>.
[ "@Nonnull\n public static DocumentBuilderFactory createDocumentBuilderFactory (@Nonnull final Schema aSchema)\n {\n ValueEnforcer.notNull (aSchema, \"Schema\");\n\n final DocumentBuilderFactory aDocumentBuilderFactory = createDefaultDocumentBuilderFactory ();\n aDocumentBuilderFactory.setSchema (aSchema)...
[ "protected void createGenModelAnnotations()\n\t{\n\t\tString source = \"http://www.eclipse.org/emf/2002/GenModel\";\t\n\t\taddAnnotation\n\t\t (jvmIdentifiableElementEClass.getEOperations().get(0), \n\t\t source, \n\t\t new String[] \n\t\t {\n\t\t\t \"documentation\", \"<p>The identifier of a JvmIdentifiable...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Text generation:" }
Builds the File path mapping and add it to the file mappings of the bundle @param bundle the bundle @param path the resource path @param rsHandler the resource reader handler @return the file path mapping
[ "public static FilePathMapping buildFilePathMapping(JoinableResourceBundle bundle, String path,\n\t\t\tResourceReaderHandler rsHandler) {\n\n\t\tFilePathMapping fPathMapping = null;\n\t\tString filePath = rsHandler.getFilePath(path);\n\t\tif(filePath != null){\n\t\t\t\n\t\t\tFile f = new File(filePath);\n\t\t\tif(f...
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// IsNewlyBlocked mocks base method
[ "func (m *MockStreamFlowController) IsNewlyBlocked() (bool, protocol.ByteCount) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"IsNewlyBlocked\")\n\tret0, _ := ret[0].(bool)\n\tret1, _ := ret[1].(protocol.ByteCount)\n\treturn ret0, ret1\n}" ]
[ "public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
This method finds the union of set A and set B @param setA set A @param setB set B @param <T> type @return a new set containing the union
[ "public static <T> Set<T> union(Set<T> setA, Set<T> setB) {\n Set<T> union = new HashSet<T>(setA);\n union.addAll(setB);\n return union;\n }" ]
[ "@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
https://developer.zendesk.com/rest_api/docs/help_center/subscriptions#show-article-subscription
[ "def help_center_article_subscription_show(self, article_id, id, locale=None, **kwargs):\n \"\"\n api_path = \"/api/v2/help_center/articles/{article_id}/subscriptions/{id}.json\"\n api_path = api_path.format(article_id=article_id, id=id)\n if locale:\n api_opt_path = \"/api/v2...
[ "def authorize_proxy_routes\n deny_access unless (authenticate || authenticate_client)\n\n route, params = Engine.routes.router.recognize(request) do |rte, parameters|\n break rte, parameters if rte.name\n end\n\n # route names are defined in routes.rb (:as => :name)\n case route.nam...
codesearchnet
{ "query": "Represent the post about developer.zendesk.com:", "pos": "Represent the code about developer.zendesk.com:", "neg": "Represent the code:" }
Triggered when shortcut keys for adding a new state are pressed, or Menu Bar "Edit, Add State" is clicked. Adds a new state only if the the state machine tree is in focus.
[ "def _add_new_state(self, *event, **kwargs):\n \n if react_to_event(self.view, self.view['state_machine_tree_view'], event):\n state_type = StateType.EXECUTION if 'state_type' not in kwargs else kwargs['state_type']\n gui_helper_state_machine.add_new_state(self._selected_sm_model...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Link for ConstantBool
[ "func (c ConstantBool) Link(scope Scope, t TypeSpec) (ConstantValue, error) {\n\tif _, ok := RootTypeSpec(t).(*BoolSpec); !ok {\n\t\treturn nil, constantValueCastError{Value: c, Type: t}\n\t}\n\treturn c, 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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about File management:" }
Fetches template with previous set data. @param Request $request @param string $template The template to render @return string @throws Exception
[ "public function fetchTemplate(Request $request, $template)\n {\n if (!$this->view instanceof Twig) {\n throw new Exception(\"Twig provider not registered.\");\n }\n\n foreach ($this->settings['view']['global'] as $key => $map) {\n $key = is_numeric($key) ? $map : $key;...
[ "public function insert(): self\n {\n /** @var self $data */\n $data = $this;\n\n if(!$this->validate(\"post\", $missing))\n {\n throw new \\Exception(\"[MVQN\\REST\\Endpoints\\Endpoint] Annotations for the '\".get_class($this).\"' class require valid values be set \".\n ...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Get geolocation data for a given IP address If field is specified, get specific field as text Else get complete location data as JSON
[ "def location(ip=None, key=None, field=None):\n ''' \n '''\n\n if field and (field not in field_list):\n return 'Invalid field'\n\n if field:\n if ip:\n url = 'https://ipapi.co/{}/{}/'.format(ip, field)\n else:\n url = 'https://ipapi.co/{}/'.format(field)\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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Get the class part of a fully namespaced class name @param $namespaceClass @return string
[ "public static function getClassName($namespaceClass)\n {\n $lastSlashPosition = mb_strrpos($namespaceClass, '\\\\');\n \n if ($lastSlashPosition !== false) {\n return mb_substr($namespaceClass, $lastSlashPosition + 1);\n }\n \n return $namespaceClass;\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 Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
// Find looks up a field value by its alias. This is most useful in pattern // subscriptions where might use Find to look up a parameterized property. // If the alias does not exist, an empty struct will be returned.
[ "func (e Event) Find(alias string) Field {\n\tfor _, field := range e.fields {\n\t\tif field.alias == alias {\n\t\t\treturn field\n\t\t}\n\t}\n\n\treturn Field{valid: false}\n}" ]
[ "function Scope(context, parent, meta) {\n\t// The object that will be looked on for values.\n\t// If the type of context is TemplateContext, there will be special rules for it.\n\tthis._context = context;\n\t// The next Scope object whose context should be looked on for values.\n\tthis._parent = parent;\n\t// If t...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Checks if a unit is patrolling.
[ "def is_patrolling(self) -> bool:\n \n return self.orders and self.orders[0].ability.id is AbilityId.PATROL" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get the [dealer_shedules_versions] column value. @return array
[ "public function getDealerShedulesVersions()\n {\n if (null === $this->dealer_shedules_versions_unserialized) {\n $this->dealer_shedules_versions_unserialized = array();\n }\n if (!$this->dealer_shedules_versions_unserialized && null !== $this->dealer_shedules_versions) {\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 summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// SetIntegrationUri sets the IntegrationUri field's value.
[ "func (s *GetIntegrationOutput) SetIntegrationUri(v string) *GetIntegrationOutput {\n\ts.IntegrationUri = &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 description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Get table status percentage @return float
[ "public function getStatus()\n {\n $tables = count($this->getTables());\n $unhealth = count($this->getUnhealthyTable());\n\n if ($tables) {\n $healthy = $tables - $unhealth;\n\n return ($healthy / $tables) * 100;\n }\n\n return 100;\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 text about software development:", "pos": "Represent the code about software development:", "neg": "Represent the code:" }
@param array $defaultValuesMap Default values map to filter @param object $entity Entity @param string $entityClass Entity class @throws \Darvin\Utils\DefaultValue\DefaultValueException
[ "private function filterDefaultValuesMap(array &$defaultValuesMap, $entity, $entityClass)\n {\n foreach ($defaultValuesMap as $targetProperty => $sourcePropertyPath) {\n if (!$this->propertyAccessor->isReadable($entity, $targetProperty)) {\n throw $this->createPropertyNotReadable...
[ "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 Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
// Returns true if ips contains IPv4 addresses.
[ "func includesIPv4(ips []net.IP) bool {\n\tfor _, ip := range ips {\n\t\tif ip.To4() != nil {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\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 instruction about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
Return the be current working directory
[ "def cwd():\n \"\"\"\"\"\"\n cwd = os.environ.get(\"BE_CWD\")\n if cwd and not os.path.isdir(cwd):\n sys.stderr.write(\"ERROR: %s is not a directory\" % cwd)\n sys.exit(lib.USER_ERROR)\n return cwd or os.getcwd().replace(\"\\\\\", \"/\")" ]
[ "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 programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
*** *** eslint-disable-next-line no-unused-vars ***
[ "function hotCreateModule(moduleId) {\n/******/ \t\tvar hot = {\n/******/ \t\t\t// private stuff\n/******/ \t\t\t_acceptedDependencies: {},\n/******/ \t\t\t_declinedDependencies: {},\n/******/ \t\t\t_selfAccepted: false,\n/******/ \t\t\t_selfDeclined: false,\n/******/ \t\t\t_disposeHandlers: [],\n/******/ \t\t\t_ma...
[ "def process_docstring(app, what, name, obj, options, lines):\n \"\"\"\"\"\"\n # pylint: disable=unused-argument\n # pylint: disable=too-many-arguments\n lines.extend(_format_contracts(what=what, obj=obj))" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// MarshalJSON assemble gss.Feed struct
[ "func (f Feed) MarshalJSON() ([]byte, error) {\n\tvar categories []Category\n\tif len(f.Channel.Categories) > 0 {\n\t\tcategories = f.Channel.Categories\n\t}\n\n\tvar date string\n\tif f.Channel.PubDate != \"\" {\n\t\tdate = f.Channel.PubDate\n\t} else if f.Channel.Modules.DublinCore.Date != \"\" {\n\t\tdate = f.Ch...
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Deletes a directory and optionally removes the parent directory if it becomes empty. @param path @param cleanParent @return @throws IOException
[ "protected boolean deleteDirectory(Path path, boolean cleanParent) throws IOException {\n boolean pathExists = deleteIfExistsRecursively(path);\n if(pathExists && cleanParent) {\n cleanEmptyParentDirectory(path.getParent());\n return true;\n }\n return false;\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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about File management:" }
<code>optional .alluxio.grpc.job.GetJobStatusPOptions options = 2;</code>
[ "public alluxio.grpc.GetJobStatusPOptions getOptions() {\n return options_ == null ? alluxio.grpc.GetJobStatusPOptions.getDefaultInstance() : options_;\n }" ]
[ "@java.lang.Deprecated\n public java.util.Map<java.lang.String, alluxio.grpc.InconsistentPropertyValues> getValues() {\n return getValuesMap();\n }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
If the file received is an object or array, check if the 'title' field is set @return string
[ "protected function parseTitle() {\n if (is_object($this->file)) {\n if (isset($this->file->title)) {\n return $this->file->title;\n }\n }\n\n if (is_array($this->file)) {\n if (isset($this->file['title'])) {\n return $this->file['title'];\n }\n }\n\n return '';\n }...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// NewApplicationOffersAPI returns an application offers api for the root api endpoint // that the command returns.
[ "func (c *offerCommand) NewApplicationOffersAPI() (*applicationoffers.Client, error) {\n\troot, err := c.NewAPIRoot()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn applicationoffers.NewClient(root), nil\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github instruction about Juju model:", "pos": "Represent the Github code about Juju model:", "neg": "Represent the Github code about programming:" }
Generate a new pubkey for a new/existing GPG identity.
[ "def export_public_key(device_type, args):\n \"\"\"\"\"\"\n log.warning('NOTE: in order to re-generate the exact same GPG key later, '\n 'run this command with \"--time=%d\" commandline flag (to set '\n 'the timestamp of the GPG key manually).', args.time)\n c = client.Client(...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
@param array $list @param array $default @return array
[ "public function getListOptions(array $list = [], $default = [])\n {\n $options = [];\n foreach ($list as $key => $value) {\n $options[] = [\n 'value' => $key,\n 'display-name' => $value,\n ];\n if (is_array($default) && in_array...
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Collects the attributes from PYQUIL_PROGRAM_PROPERTIES on the Program object program into a dictionary. :param program: Program to collect attributes from. :return: Dictionary of attributes, keyed on the string attribute name.
[ "def _extract_attribute_dictionary_from_program(program: Program) -> Dict[str, Any]:\n \n attrs = {}\n for prop in PYQUIL_PROGRAM_PROPERTIES:\n attrs[prop] = getattr(program, prop)\n return attrs" ]
[ "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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Конвертирует данные, полученные из QR-кода, в массив данных для запроса к API. @param string $qrCodeString Данные QR-кода @return array Массив данных для запроса к API
[ "public static function fromQRCode($qrCodeString)\n {\n $paramsMap = [\n 't' => 'date',\n 's' => 'sum',\n 'fn' => 'fiscalNumber',\n 'i' => 'fiscalDocument',\n 'fp' => 'fiscalSign',\n 'n' => 'operation',\n ];\n\n $normalize...
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Inject useAsQuery function if no query and no id found. @param {Function} fn The function to be injected. @returns {ViewBuilder} to be able to chain...
[ "function (fn) {\n if (!fn || !_.isFunction(fn)) {\n var err = new Error('Please pass a valid function!');\n debug(err);\n throw err;\n }\n\n if (fn.length === 2) {\n this.getQueryForThisViewBuilder = fn;\n return this;\n }\n\n this.getQueryForThisViewBuilder = function (evt,...
[ "function initCreate (args) {\n // method name is moduleNameCreate\n var methodName = `${this.name}Create`\n // method signature is moduleName.methodname\n var methodSignature = `${this.moduleName}.${methodName}`\n // capture model to pass to function\n var model = this\n // add create method t...
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:" }
Parse the project ID and possibly other details from a provided URL. @param string $url A web UI, API, or public URL of the project. @return array
[ "private function parseProjectId($url)\n {\n $result = [];\n\n // If it's a plain alphanumeric string, then it's an ID already.\n if (!preg_match('/\\W/', $url)) {\n $result['projectId'] = $url;\n\n return $result;\n }\n\n $urlParts = parse_url($url);\n ...
[ "@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }" ]
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
// Init function initialize the data needed by auth.
[ "func Init(s store.Store, ctx context.Context, ip string, act bool) error {\n\tactive = act // set active, auth always return success when unactive\n\tlocalIP = ip\n\tauthTable = make(map[string]containerInfo)\n\tdependsInvertTable = make(map[string]string)\n\tpodgroupInvertTable = make(map[string]string)\n\tvar er...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Render badge by given template. @param string $template string to render @return string
[ "public function renderBadge($template)\n {\n $tpl = $this->getTwig()->createTemplate($template);\n\n return $tpl->render(['app' => Yii::$app]);\n }" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// isValidResultType returns whether the passed reflect kind is one of the // acceptable types for results.
[ "func isValidResultType(kind reflect.Kind) bool {\n\tif isNumeric(kind) {\n\t\treturn true\n\t}\n\n\tswitch kind {\n\tcase reflect.String, reflect.Struct, reflect.Array, reflect.Slice,\n\t\treflect.Bool, reflect.Map:\n\n\t\treturn true\n\t}\n\n\treturn false\n}" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Save config @param string $setting @param mixed $value
[ "public function set($setting, $value = null) {\n $this->store->set($setting, $value);\n $this->dirty = true;\n }" ]
[ "static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}" ]
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Return list of reactions that are constrained to zero flux.
[ "def find_zero_constrained_reactions(model):\n \"\"\"\"\"\"\n return [rxn for rxn in model.reactions if\n rxn.lower_bound == 0 and\n rxn.upper_bound == 0]" ]
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Method to add a menu item as child @param MenuItem $menu_item @return MenuItem Reference to the added menu item.
[ "public function &addItem(MenuItem $menu_item)\n {\n $this->items[$menu_item->getName()] = $menu_item;\n\n return $this->items[$menu_item->getName()];\n }" ]
[ "def getItem(self, index, altItem=None):\n \n if index.isValid():\n item = index.internalPointer()\n if item:\n return item\n\n #return altItem if altItem is not None else self.invisibleRootItem # TODO: remove\n return altItem" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Reads one half-wave and returns frequency @return @throws IOException
[ "public float getHalfWave() throws IOException\r\n {\r\n while (true)\r\n {\r\n int sample = getSample();\r\n if (frequencyCounter.update(sample))\r\n {\r\n return frequencyCounter.getFrequency();\r\n }\r\n }\r\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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// Destroy deallocates the WriteOptions object.
[ "func (opts *WriteOptions) Destroy() {\n\tC.rocksdb_writeoptions_destroy(opts.c)\n\topts.c = nil\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:" }
Convert an HTML string to entities. @param string $value @return string
[ "public function entities($value)\n {\n if (is_array($value)) {\n $newValue = array();\n foreach ($value as $key => $val) {\n $newValue[$key] = htmlentities($val, ENT_QUOTES, 'UTF-8', false);\n }\n\n return $newValue;\n }\n\n return ...
[ "public function XML_val($field, $arguments = [], $cache = false)\n {\n $result = $this->obj($field, $arguments, $cache);\n // Might contain additional formatting over ->XML(). E.g. parse shortcodes, nl2br()\n return $result->forTemplate();\n }" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Get IP geolocation. Args: ip (str): IP address to use if no data provided. hit_api (bool): whether to hit api if info not found. Returns: str: latitude and longitude, comma-separated.
[ "def ip_geoloc(ip, hit_api=True):\n \n from ..logs.models import IPInfoCheck\n try:\n obj = IPInfoCheck.objects.get(ip_address=ip).ip_info\n except IPInfoCheck.DoesNotExist:\n if hit_api:\n try:\n obj = IPInfoCheck.check_ip(ip)\n except RateExceededErro...
[ "def lookup_from_headers(cls, headers):\n \n\n # A single address, set by this server, returned as an Array\n remote_addr = cls.ips_from(headers.get(\"REMOTE_ADDR\"))\n\n # Could be a CSV list and/or repeated headers that were concatenated.\n forwarded_ips = cls.ips_from(headers.g...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
// SetTaskId sets the TaskId field's value.
[ "func (s *DescribeAuditTaskInput) SetTaskId(v string) *DescribeAuditTaskInput {\n\ts.TaskId = &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:" }
@param Campaign $campaign @return $this
[ "public function setCampaign(Campaign $campaign = null)\n {\n if ($campaign) {\n $this->campaign = $campaign;\n $this->campaignId = $campaign->getId();\n }\n\n return $this;\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
get what dates we can for pins from the board RSS feeds
[ "function(seriesCallback) {\n if(!obtainDates) {\n seriesCallback();\n return;\n }\n\n var pinDateMaps = [];\n async.eachLimit(boards, 5, function(board, eachCallback) {\n getDatesForBoardPinsFromRss...
[ "def requests(self):\n ''''''\n path = pathjoin(self.path, self.name, Request.path)\n response = self.service.send(SRequest('GET', path))\n # a bin behaves as a push-down store --- better to return the requests\n # in order of appearance\n return list(reversed(Request.from_...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
@param string $data @throws \Exception
[ "protected function write($data)\n {\n if ($this->debug) {\n Helper::debugMsg(\n '< [hex]:' . PHP_EOL . Helper::hexdump(\n $data, false, true, true\n )\n );\n }\n\n $len = strlen($data);\n while (true) {\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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Input must be 64-char hex string
[ "def privtopub(priv,outcompressed=True):\n '''\n \n '''\n\n x, y = ecmultiply(Gx,Gy,int(priv,16))\n x = dechex(x,32)\n y = dechex(y,32)\n o = '04' + x + y\n if outcompressed:\n return compress(o)\n else:\n return o" ]
[ "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 about 32-bit integers:", "pos": "Represent the Github code about 32-bit integers:", "neg": "Represent the Github code:" }
// CheckSimpleCommand executes a simple echo command to ensure docker can // create and run a container.
[ "func CheckSimpleCommand() (err error) {\n\tcli, err := newClient()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"creating client: %v\", err)\n\t}\n\techoStr := \"hello\"\n\tconfig := &docker.ContainerConfig{\n\t\tImage: \"ubuntu:14.04\",\n\t\tCmd: []string{\"echo\", \"-n\", echoStr},\n\t}\n\tcid, err := cli.Create...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.
[ "func (c *CheckSuite) GetNodeID() string {\n\tif c == nil || c.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Adds the "response" helper to the view object @param \Aimeos\MW\View\Iface $view View object @return \Aimeos\MW\View\Iface Modified view object
[ "protected function addResponse( \\Aimeos\\MW\\View\\Iface $view )\n\t{\n\t\t$helper = new \\Aimeos\\MW\\View\\Helper\\Response\\Symfony2( $view );\n\t\t$view->addHelper( 'response', $helper );\n\n\t\treturn $view;\n\t}" ]
[ "protected function addCache( \\Aimeos\\MShop\\Context\\Item\\Iface $context )\n\t{\n\t\t$cache = new \\Aimeos\\MAdmin\\Cache\\Proxy\\Standard( $context );\n\n\t\treturn $context->setCache( $cache );\n\t}" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Aimeos:" }