query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Bootstrap the application services.
[ "public function boot()\n {\n if ( ! $this->app->routesAreCached()) {\n require __DIR__ . '/routes.php';\n }\n\n $this->publishes([\n __DIR__ . '/../config/config.php' => config_path('laravelimage.php'),\n ]);\n\n $this->registerBladeExtensions();\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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Retrieve related objects. @param key {string} The relation key to fetch models for. @param options {object} Options for 'Backbone.Model.fetch' and 'Backbone.sync'. @return {xhr} An array or request objects
[ "function( key, options ) {\n\t\t\toptions || ( options = {} );\n\t\t\tvar rel = this.getRelation( key ),\n\t\t\t\tkeyContents = rel && rel.keyContents,\n\t\t\t\ttoFetch = keyContents && _.select( _.isArray( keyContents ) ? keyContents : [ keyContents ], function( item ) {\n\t\t\t\t\t\tvar id = _.isString( item ) |...
[ "function loadUncached () {\n // debug\n debug('view:id:collection:loadUncached', this.idCacheKey)\n // create new select for only uncached ids without view applied\n var select = sql.select(this.query.model, {\n all: true,\n where: {id: this.ids},\n })\n // replace original select i...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Computer Science:" }
Parse, extract and load assets from the stylesheet content @param string $css the stylesheet content
[ "private function loadStyleSheetAsset($css){\n\n $imageRe = \"/url\\\\s*\\\\(['|\\\"]?([^)]*\\.(png|jpg|jpeg|gif|svg))['|\\\"]?\\\\)/mi\";\n $importRe = \"/@import\\\\s*(url\\\\s*\\\\()?['\\\"]?([^;]*)['\\\"]/mi\";\n $fontFaceRe = \"/@font-face\\\\s*\\\\{(.*)?\\\\}/mi\";\n $fontRe = \"/u...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Function executed when running the script with the -install switch
[ "def install():\r\n \"\"\"\"\"\"\r\n # Create Spyder start menu folder\r\n # Don't use CSIDL_COMMON_PROGRAMS because it requres admin rights\r\n # This is consistent with use of CSIDL_DESKTOPDIRECTORY below\r\n # CSIDL_COMMON_PROGRAMS =\r\n # C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Progra...
[ "@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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Get the min and max values for a response body group @param string $group The name of the group @throws InvalidArgumentException @return array An array with two keys, min and max, which represents the min and max values for $group
[ "protected function getResponseCodeGroupRange($group) {\n switch ($group) {\n case 'informational':\n $min = 100;\n $max = 199;\n break;\n case 'success':\n $min = 200;\n $max = 299;\n break;\n ...
[ "protected function processRequest(Builder $query, $results)\n {\n // Here we validate the results being returned to be associative.\n // When they are not we wrap them in an array making it easier for\n // elicit to them parse as a model.\n if (array_keys($results) !== range(0, count...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Check if a piece of text is in the list of countries
[ "def is_country(self, text):\n \"\"\"\"\"\"\n ct_list = self._just_cts.keys()\n if text in ct_list:\n return True\n else:\n return False" ]
[ "def file_or_token(value):\n \n if isfile(value):\n with open(value) as fd:\n return fd.read().strip()\n\n if any(char in value for char in '/\\\\.'):\n # This chars will never be in a token value, but may be in a path\n # The error message will be handled by the parser\n ...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Handle the drag end. Apply the correct positioning to the draggable element
[ "function () {\n var element = this.getElement();\n // This is to handle if there is a scroll\n element.onselectstart = Aria.returnTrue;\n if (this.overlay) {\n // remove overlay here\n this.overlay.$dispose();\n ...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Field is the field to be used for random number generation. // This parameter is compulsory when a Seed is set and ignored // otherwise. Note that documents that have the same value for a // field will get the same score.
[ "func (fn *RandomFunction) Field(field string) *RandomFunction {\n\tfn.field = field\n\treturn fn\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 sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Expects an exception with an authorization_paramaters field in its raw_json
[ "def session_hook(exception):\n \n safeprint(\n \"The resource you are trying to access requires you to \"\n \"re-authenticate with specific identities.\"\n )\n\n params = exception.raw_json[\"authorization_parameters\"]\n message = params.get(\"session_message\")\n if message:\n ...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Adds a value to a writer if value is not <code>null</code>. @param writer writer to add object to. @param field field name to set. @param value field value. @throws JSONException if io error occurs.
[ "public static void addIfNotNull(JSONWriter writer, String field,\n\t\t\tBoolean value) throws JSONException {\n\t\tif (value == null)\n\t\t\treturn;\n\t\twriter.key(field);\n\t\twriter.value(value);\n\t}" ]
[ "protected final void mapUpdate(Map map, Object key, Object value) {\n Object o = map.get(key);\n /*\n If a value exists in map.get(key), convert the \"value\" parameter into\n the type of map.get(key). It's a best guess as to what the type of the\n Map _should_ be without ...
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Read a duration. @param units duration units @param duration duration value @return Duration instance
[ "private Duration getDuration(TimeUnit units, Double duration)\n {\n Duration result = null;\n if (duration != null)\n {\n double durationValue = duration.doubleValue() * 100.0;\n\n switch (units)\n {\n case MINUTES:\n {\n durationValue *=...
[ "def normalize(self, timestamp, steps=0):\n '''\n \n '''\n # So far, the only commonality with RelativeTime\n return self.from_bucket( self.to_bucket(timestamp, steps) )" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Initializes the found DFU device so that we can program it.
[ "def init():\n \"\"\"\"\"\"\n global __dev, __cfg_descr\n devices = get_dfu_devices(idVendor=__VID, idProduct=__PID)\n if not devices:\n raise ValueError('No DFU device found')\n if len(devices) > 1:\n raise ValueError(\"Multiple DFU devices found\")\n __dev = devices[0]\n __dev.s...
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Executes the command @param InputInterface $input Command input @param OutputInterface $output Command output
[ "protected function execute( InputInterface $input, OutputInterface $output ) {\n\t\tLog::instance()->setOutput( $output );\n\n\t\t$repository = RepositoryManager::instance()->setup( $input->getArgument( 'repository' ) );\n\n\t\tif ( ! $repository ) {\n\t\t\tLog::instance()->write( 'Repository not configured. Befor...
[ "protected function executeCliAction(Config\\Action $action) : void\n {\n // since the cli has no straight way to communicate back to php\n // cli hooks have to handle sync stuff by them self\n // so no 'beforeAction' or 'afterAction' is called here\n $runner = new Action\\Cli();\n ...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
Generate the final CSS string
[ "def create_css(self, rules):\n \n style = rules[0].legacy_compiler_options.get(\n 'style', self.compiler.output_style)\n debug_info = self.compiler.generate_source_map\n\n if style == 'legacy':\n sc, sp, tb, nst, srnl, nl, rnl, lnl, dbg = True, ' ', ' ', False, ''...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Stores the members of the set resulting from the intersection of all the given sets.
[ "function sinterstore(destination /* key-1, key-N, req*/) {\n var args = slice.call(arguments, 1)\n , req = typeof args[args.length - 1] === 'object'\n ? args[args.length - 1] : null;\n var list = this.sinter.apply(this, args);\n if(list.length) {\n this.setKey(\n destination, new Set(list), unde...
[ "@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Adds a header entry value to the header. For example use this to set the source RPM package name on your RPM @param tag the header tag to set @param value the value to set the header entry with
[ "public void addHeaderEntry( final Tag tag, final String value) {\n\t format.getHeader().createEntry(tag, value);\n\t}" ]
[ "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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
to join the data that does not fit into memory. @param masterLabels label of master data @param masterColumns master column's @param dataColumns data column's @param masterPath master data HDFS path @return this @throws DataFormatException
[ "public SimpleJob setBigJoin(String[] masterLabels, String[] masterColumns,\n String[] dataColumns, String masterPath) throws DataFormatException {\n String separator = conf.get(SEPARATOR);\n return setBigJoin(masterLabels, masterColumns, dataColumns, masterPath, separat...
[ "def _get_result_paths(self, data):\n \n\n # Swarm OTU map (mandatory output)\n return {'OtuMap': ResultPath(Path=self.Parameters['-o'].Value,\n IsWritten=True)}" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Gets information from the #WINDOWS file. Checks the #WINDOWS file to see if it has any info that was not found in #SYSTEM (topics, index or default page.
[ "def GetWindowsInfo(self):\n '''\n '''\n result, ui = chmlib.chm_resolve_object(self.file, '/#WINDOWS')\n if (result != chmlib.CHM_RESOLVE_SUCCESS):\n return -1\n\n size, text = chmlib.chm_retrieve_object(self.file, ui, 0l, 8)\n if (size < 8):\n return...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Technology:" }
Search and load every installed plugin through entry points.
[ "def load_installed_plugins():\n \"\"\"\"\"\"\n providers = {}\n checkers = {}\n for entry_point in pkg_resources.iter_entry_points(group='archan'):\n obj = entry_point.load()\n if issubclass(obj, Provider):\n providers[entry_point.name] = obj\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Parse the request command input. Input: Request Handle Output: Request Handle updated with parsed input. Return code - 0: ok, non-zero: error
[ "def parseCmdline(rh):\n \n\n rh.printSysLog(\"Enter powerVM.parseCmdline\")\n\n if rh.totalParms >= 2:\n rh.userid = rh.request[1].upper()\n else:\n # Userid is missing.\n msg = msgs.msg['0010'][1] % modId\n rh.printLn(\"ES\", msg)\n rh.updateResults(msgs.msg['0010'][...
[ "def delete_state(node)\n # => Find the Node\n existing = find_state(node)\n return 'Node not present in state' unless existing\n # => Delete the Node from State\n state.delete(existing)\n # => Write Out the Updated State\n write_state\n # => Return the Deleted Node\n ex...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software Development:" }
Set or retrieve an attribute ``name`` from thread ``ct``. If ``ct`` is not given used the current thread. If ``value`` is None, it will get the value otherwise it will set the value.
[ "def thread_data(name, value=NOTHING, ct=None):\n '''\n '''\n ct = ct or current_thread()\n if is_mainthread(ct):\n loc = process_data()\n elif not hasattr(ct, '_pulsar_local'):\n ct._pulsar_local = loc = {}\n else:\n loc = ct._pulsar_local\n if value is not NOTHING:\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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetNextToken sets the NextToken field's value.
[ "func (s *ListRobotApplicationsInput) SetNextToken(v string) *ListRobotApplicationsInput {\n\ts.NextToken = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
-- delete ------------------------
[ "@Override\n public boolean delete(Object bean) throws OptimisticLockException {\n methodCalls.add(MethodCall.of(\"bean\").with(\"bean\", bean));\n capturedBeans.addDeleted(bean);\n if (persistDeletes) {\n return delete.delete(bean, null);\n }\n return true;\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:" }
// Next returns true if there are any values remaining in the iterator.
[ "func (k *tsmBatchKeyIterator) Next() bool {\nRETRY:\n\t// Any merged blocks pending?\n\tif len(k.merged) > 0 {\n\t\tk.merged = k.merged[1:]\n\t\tif len(k.merged) > 0 {\n\t\t\treturn true\n\t\t}\n\t}\n\n\t// Any merged values pending?\n\tif k.hasMergedValues() {\n\t\tk.merge()\n\t\tif len(k.merged) > 0 || k.hasMerg...
[ "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 description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about File management:" }
Determines if a file is dirty @private @param {!File} file - file to test @return {boolean} true if the file is dirty, false otherwise
[ "function _isOpenAndDirty(file) {\n // working set item might never have been opened; if so, then it's definitely not dirty\n var docIfOpen = DocumentManager.getOpenDocumentForPath(file.fullPath);\n return (docIfOpen && docIfOpen.isDirty);\n }" ]
[ "function Value(payload) {\n\n var path = payload.path;\n\n /**\n @property {string} key The string representation of the Key (read-only).\n @memberof Value\n @instance\n @name key\n */\n this.key = path.join(\".\");\n\n /**\n @property {boolean} exists A boolean value that indic...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Get this object properties REST: GET /hosting/web/{serviceName}/envVar/{key} @param serviceName [required] The internal name of your hosting @param key [required] Name of the variable
[ "public OvhEnvVar serviceName_envVar_key_GET(String serviceName, String key) throws IOException {\n\t\tString qPath = \"/hosting/web/{serviceName}/envVar/{key}\";\n\t\tStringBuilder sb = path(qPath, serviceName, key);\n\t\tString resp = exec(qPath, \"GET\", sb.toString(), null);\n\t\treturn convertTo(resp, OvhEnvVa...
[ "@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 instruction about Object properties:", "pos": "Represent the code about Object properties:", "neg": "Represent the code about Programming:" }
Send the given notification immediately. @param \Illuminate\Support\Collection|array|mixed $notifiables @param mixed $notification @param array|null $channels @return void
[ "public function sendNow($notifiables, $notification, array $channels = null)\n {\n $notifiables = $this->formatNotifiables($notifiables);\n\n $original = clone $notification;\n\n foreach ($notifiables as $notifiable) {\n if (empty($viaChannels = $channels ?: $notification->via($n...
[ "abstract public function __construct(Request $request, Translator $translator, View $view, GridContract $grid);\n\n /**\n * Extend decoration.\n *\n * @param callable $callback\n *\n * @return $this\n */\n public function extend(callable $callback = null)\n {\n // Run the ...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// NewPrefixV0 returns a CIDv0 prefix with the specified multihash type. // DEPRECATED: Use V0Builder
[ "func NewPrefixV0(mhType uint64) Prefix {\n\treturn Prefix{\n\t\tMhType: mhType,\n\t\tMhLength: mh.DefaultLengths[mhType],\n\t\tVersion: 0,\n\t\tCodec: DagProtobuf,\n\t}\n}" ]
[ "func (s *SharedStore) keyPath(key NamedKey) string {\n\t// WARNING - STABLE API: The composition of the absolute key path\n\t// cannot be changed without breaking up and downgrades.\n\treturn path.Join(s.conf.Prefix, key.GetKeyName())\n}" ]
codesearchnet
{ "query": "Represent the Github post about Text processing:", "pos": "Represent the Github code about Text processing:", "neg": "Represent the Github code:" }
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
[ "@Override\n public Request<DescribeSecurityGroupsRequest> getDryRunRequest() {\n Request<DescribeSecurityGroupsRequest> request = new DescribeSecurityGroupsRequestMarshaller().marshall(this);\n request.addParameter(\"DryRun\", Boolean.toString(true));\n return request;\n }" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the post about PHP programming:", "pos": "Represent the code about PHP programming:", "neg": "Represent the code about Software development:" }
This will fail if there are duplicate beans in the Spring context. Beans that are configured in the bootstrap context will not be considered duplicate beans.
[ "public void assertUniqueBeans(Set<String> ignoredDuplicateBeanNames) {\n\t\tfor (BeanohBeanFactoryMethodInterceptor callback : callbacks) {\n\t\t\tMap<String, List<BeanDefinition>> beanDefinitionMap = callback\n\t\t\t\t\t.getBeanDefinitionMap();\n\t\t\tfor (String key : beanDefinitionMap.keySet()) {\n\t\t\t\tif (!...
[ "private Class<?> resolveClassWithCL(String name) throws ClassNotFoundException {\n SecurityManager security = System.getSecurityManager();\n if (security != null) {\n return Class.forName(name, false, getClassLoader(thisClass));\n }\n\n // The platform classloader is null if ...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
测试是否以数字开头,负数也是数字,但是不支持科学表达式模型 @return if matches a digit character
[ "public boolean matchesDigit() {\n return !isEmpty() && (Character.isDigit(queue.charAt(pos))\n || queue.charAt(pos) == '-' && remainingLength() >= 2 && Character.isDigit(queue.charAt(pos + 1)));\n }" ]
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about text processing:" }
// Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled.
[ "func (c *ServerGetBotConfigCall) Context(ctx context.Context) *ServerGetBotConfigCall {\n\tc.ctx_ = ctx\n\treturn c\n}" ]
[ "@Override\n public void handlerAdded(ChannelHandlerContext ctx) throws Exception {\n if (ctx.channel().isRegistered()) {\n // This should always be true with our current DefaultChannelPipeline implementation.\n // The good thing about calling initChannel(...) in handlerAdded(...) is...
codesearchnet
{ "query": "Represent the description about Go programming language:", "pos": "Represent the code about Go programming language:", "neg": "Represent the code about programming:" }
Checks the selector value. @param $value @return bool
[ "public function checkValue(&$value)\n {\n if (is_string($value)) {\n $value = Placeholder::replaceStringsAndComments($value);\n $value = Placeholder::removeCommentPlaceholders($value, true);\n $value = preg_replace('/[ ]+/', ' ', $value);\n $value = Placeholder...
[ "def _type_bool(label,default=False):\n \"\"\"\"\"\"\n return label, abstractSearch.nothing, abstractRender.boolen, default" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Cleans the text from mentions, by providing a context message. @param \CharlotteDunois\Yasmin\Models\Message $message @param string $text @return string
[ "static function cleanContent(\\CharlotteDunois\\Yasmin\\Models\\Message $message, string $text) {\n /** @var \\CharlotteDunois\\Yasmin\\Interfaces\\ChannelInterface $channel */\n foreach($message->mentions->channels as $channel) {\n $text = \\str_replace('<#'.$channel->getId().'>', '#'.$c...
[ "public static function bindToObject(TelegramResponse $data, LoggerInterface $logger): TelegramTypes\n {\n return new File($data->getResult(), $logger);\n }" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Iterates over (valid) attributes of a class. Args: cls (object): the class to iterate over Yields: (str, obj) tuples: the class-level attributes.
[ "def iterclass(cls):\n \n for field in dir(cls):\n if hasattr(cls, field):\n value = getattr(cls, field)\n yield field, value" ]
[ "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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Convert datetime.datetime to timestamp :param obj: value to (possibly) convert
[ "def json_encode_default(obj):\n '''\n \n '''\n if isinstance(obj, (datetime, date)):\n result = dt2ts(obj)\n else:\n result = json_encoder.default(obj)\n return to_encoding(result)" ]
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Attempt to immediately acquire a shared read lock. @param locker object which might be write or upgrade lock owner @return true if acquired
[ "public final boolean tryLockForRead(L locker) {\r\n int state = mState;\r\n if (state >= 0) { // no write lock is held\r\n if (isReadWriteFirst() || isReadLockHeld(locker)) {\r\n do {\r\n if (incrementReadLocks(state)) {\r\n adjustRe...
[ "boolean setReplica( H2ONode h2o ) {\n assert _key.home(); // Only the HOME node for a key tracks replicas\n assert h2o != H2O.SELF; // Do not track self as a replica\n if( !read_lock() ) return false; // Write-locked; no new replications. Read fails to read *this* value\n // Narrow non-race here. ...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Get a specific attribute for this tag. @param string @attribute @return string|null
[ "public function getAttribute($attribute)\n {\n return !empty($this->attributes[$attribute]) ? $this->attributes[$attribute] : null;\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 text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Initialize JSON structure. @return Path @deprecated
[ "public function initializeStructure()\n {\n $structure = [\n 'id' => $this->getId(),\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n 'manualProgressionAllowed' => $this->manualProgressionAllowed,\n 'steps' => [],\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github sentence about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code:" }
Emits the record clicked signal for the given item, provided the signals are not currently blocked. :param item | <QTreeWidgetItem>
[ "def emitRecordMiddleClicked(self, item):\r\n \r\n # emit that the record has been double clicked\r\n if isinstance(item, XOrbRecordItem) and not self.signalsBlocked():\r\n self.recordMiddleClicked.emit(item.record())" ]
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// ReturnSubs returns substitutions to the pool. USE WITH CAUTION.
[ "func ReturnSubs(sub Subs) {\n\tswitch s := sub.(type) {\n\tcase mSubs:\n\t\tfor k := range s {\n\t\t\tdelete(s, k)\n\t\t}\n\t\tmSubPool.Put(sub)\n\tcase *sSubs:\n\t\tsize := cap(s.s) - 2\n\t\tif size > 0 && size < poolSize+1 {\n\t\t\t// reset to empty\n\t\t\tfor i := range s.s {\n\t\t\t\ts.s[i] = Substitution{}\n\...
[ "def scopes(cls):\n \n # Why do we need this? This should either\n # * Be bubbled to the places where it is used (AcidXBlock).\n # * Be automatic. Look for all members of a type.\n return [cls.USAGE, cls.DEFINITION, cls.TYPE, cls.ALL]" ]
codesearchnet
{ "query": "Represent the summarization about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
Converts the RP Record to a String
[ "String\nrrToString() {\n\tStringBuffer sb = new StringBuffer();\n\tsb.append(mailbox);\n\tsb.append(\" \");\n\tsb.append(textDomain);\n\treturn sb.toString();\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 Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "func (in *TopologySpec) DeepCopyInto(out *TopologySpec) {\n\t*out = *in\n\tif in.Bastion != nil {\n\t\tin, out := &in.Bastion, &out.Bastion\n\t\t*out = new(BastionSpec)\n\t\t(*in).DeepCopyInto(*out)\n\t}\n\tif in.DNS != nil {\n\t\tin, out := &in.DNS, &out.DNS\n\t\t*out = new(DNSSpec)\n\t\t**out = **in\n\t}\n\tretu...
[ "func ExternalCAsEqualStable(a, b []*api.ExternalCA) bool {\n\t// because DeepEqual will treat an empty list and a nil list differently, we want to manually check this first\n\tif len(a) == 0 && len(b) == 0 {\n\t\treturn true\n\t}\n\t// The assumption is that each individual api.ExternalCA within both lists are cre...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Returns the shipment state label. @param string|ShipmentInterface $stateOrShipment @return string
[ "public function getShipmentStateLabel($stateOrShipment)\n {\n $state = $stateOrShipment instanceof ShipmentInterface ? $stateOrShipment->getState() : $stateOrShipment;\n\n return $this->translator->trans(ShipmentStates::getLabel($state));\n }" ]
[ "public function execute($request)\n {\n RequestNotSupportedException::assertSupports($this, $request);\n $this->logger->info(\"Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid\");\n throw new HttpResponse('OK');\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Transaction Management:", "pos": "Represent the Github code about Transaction Management:", "neg": "Represent the Github code about Software development:" }
print header row allows user to override
[ "def print_header_row r, c, len, value, color, attr\n #acolor = $promptcolor\n @graphic.printstring r, c+@left_margin, \"%-*s\" % [len-@left_margin ,value], color, attr\n end" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Ensure that datetime fields are correctly formatted. @param string $type @param string $value @return string|FragmentInterface|\DateTime @throws DefaultValueException
[ "protected function formatDatetime(string $type, $value)\n {\n if ($value === 'current_timestamp()') {\n $value = self::DATETIME_NOW;\n }\n\n return parent::formatDatetime($type, $value);\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 sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// SetTrainingStartTime sets the TrainingStartTime field's value.
[ "func (s *TrainingJob) SetTrainingStartTime(v time.Time) *TrainingJob {\n\ts.TrainingStartTime = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Maps this exception to a response object. @return Response this exception maps to.
[ "public static Response toResponse(Response.Status status, String wwwAuthHeader) {\n Response.ResponseBuilder rb = Response.status(status);\n if (wwwAuthHeader != null) {\n rb.header(\"WWW-Authenticate\", wwwAuthHeader);\n }\n return rb.build();\n }" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Calls the post init hubs :param dict parser_result: Dictionary with the parsed arguments
[ "def post_setup_plugins(parser_result):\n \n if not isinstance(parser_result, dict):\n parser_result = vars(parser_result)\n plugins.run_post_inits(parser_result)" ]
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// Convert_kops_LyftVPCNetworkingSpec_To_v1alpha1_LyftVPCNetworkingSpec is an autogenerated conversion function.
[ "func Convert_kops_LyftVPCNetworkingSpec_To_v1alpha1_LyftVPCNetworkingSpec(in *kops.LyftVPCNetworkingSpec, out *LyftVPCNetworkingSpec, s conversion.Scope) error {\n\treturn autoConvert_kops_LyftVPCNetworkingSpec_To_v1alpha1_LyftVPCNetworkingSpec(in, out, s)\n}" ]
[ "func GetIdentitySchema() string {\n\treturn fmt.Sprintf(services.V2SchemaTemplate, services.MetadataSchema, IdentitySpecV2Schema, services.DefaultDefinitions)\n}" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Application booted, let's dispatch the routes. @return callable
[ "protected function dispatchToRouter() : Closure\n {\n return function ($request) {\n return $this->router->setContainer($this->container)->dispatch($request);\n };\n }" ]
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
// SetOutputArtifactDetails sets the OutputArtifactDetails field's value.
[ "func (s *ActionType) SetOutputArtifactDetails(v *ArtifactDetails) *ActionType {\n\ts.OutputArtifactDetails = 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:" }
Calls a JavaScript method on the object. @param method The name of the method. @param returnType The return type. @param args Method arguments. @param <T> Java type for the return value. @return A return value.
[ "@Nullable\n protected final <T> T jsiiCall(final String method, final Class<T> returnType, @Nullable final Object... args) {\n return JsiiObjectMapper.treeToValue(JsiiObject.engine.getClient()\n .callMethod(this.objRef,\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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Relay chat messages to and from clients.
[ "def chat(ws):\n \n lag_tolerance_secs = float(request.args.get(\"tolerance\", 0.1))\n client = Client(ws, lag_tolerance_secs=lag_tolerance_secs)\n client.subscribe(request.args.get(\"channel\"))\n gevent.spawn(client.heartbeat)\n client.publish()" ]
[ "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:" }
call api, handle error, return response @param Message $req @param String $method @param String $uri @param function $handler function($response, $bizerror, $common) create response oject or throw biz error exception @return Message $result
[ "public function callApi(Message $req, $method, $uri, $handler)\n {\n // check handler, php before 5.4 doesn't support Type Hinting of callable\n if (!is_callable($handler)) {\n throw new GeneralException(\"Can not find response handler.\");\n }\n\n $data = [\n '...
[ "function (err, node, next) {\n var func = node.action + 'Action';\n var obj = eval(func + '(node.params)');\n logger.log('debug', 'M|actionQueue::execute|obj=%j', +obj, meta);\n return null;\n }" ]
codesearchnet
{ "query": "Represent the description about PHP:", "pos": "Represent the code about PHP:", "neg": "Represent the code:" }
Execute an Http GET request. @param $path @param array $parameters @return mixed
[ "protected function get($path, array $parameters = array())\n {\n if (count($parameters) > 0) {\n $path .= '?' . http_build_query($parameters);\n }\n\n $response = $this->client->getHttpClient()->get($path);\n\n return $this->parseResponse($response);\n }" ]
[ "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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Deletes the expired contexts. @return int[] The number of deleted contexts.
[ "public function process_approved_deletions() : array {\n $this->trace->output('Checking requirements');\n if (!$this->check_requirements()) {\n $this->trace->output('Requirements not met. Cannot process expired retentions.', 1);\n return [0, 0];\n }\n\n $this->trac...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the post about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
Sets id @param string $id id @return $this
[ "public function setId($id)\n {\n\n if (!is_null($id) && (!preg_match(\"/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/\", $id))) {\n throw new \\InvalidArgumentException(\"invalid value for $id when calling StackService., must conform to the pattern /^[0-9a-f]{8}-[0-9a-f]{4}-[...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Set the Trigger's {@link JobDataMap}, adding any values to it that were already set on this TriggerBuilder using any of the other 'usingJobData' methods. @return the updated TriggerBuilder @see ITrigger#getJobDataMap()
[ "@Nonnull\n public TriggerBuilder <T> usingJobData (final JobDataMap newJobDataMap)\n {\n // add any existing data to this new map\n newJobDataMap.putAll (m_aJobDataMap);\n m_aJobDataMap = newJobDataMap; // set new map as the map to use\n return this;\n }" ]
[ "public ResultHandlerContext<DPO, RI, RO, RHI> handleWith(ResultHandler<RHI> resultHandler) {\n if (resultHandler != null) {\n addedResultHandlers.add(resultHandler);\n builtValidator.addResultHandler(resultHandler);\n }\n\n // Stay in the same context and re-use the same ...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// SetFlow sets the Flow field's value.
[ "func (s *CreateFlowOutput) SetFlow(v *Flow) *CreateFlowOutput {\n\ts.Flow = v\n\treturn s\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
<pre> Performs generic data validation for the operation to be performed </pre>
[ "protected void validate(String operationType) throws Exception\r\n\t{\r\n\t\tsuper.validate(operationType);\r\n\r\n\t\tMPSString id_validator = new MPSString();\r\n\t\tid_validator.setConstraintIsReq(MPSConstants.DELETE_CONSTRAINT, true);\r\n\t\tid_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true)...
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
return quality score format - might return several if ambiguous.
[ "def guessFormat(self):\n ''''''\n\n c = [ord(x) for x in self.quals]\n mi, ma = min(c), max(c)\n r = []\n for entry_format, v in iteritems(RANGES):\n m1, m2 = v\n if mi >= m1 and ma < m2:\n r.append(entry_format)\n return r" ]
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the comment about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
Bail to send new saved data back to our modal handler. @param int $item_id Item ID. @param string $item_title Item title. @param object $field_args Field arguments.
[ "public function admin_modal_bail( $item_id, $item_title, $field_args ) {\n\n\t\t$model_data = $this->build_dfv_field_item_data_recurse_item( $item_id, $item_title, $field_args );\n\t\t?>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\twindow.parent.jQuery( window.parent ).trigger(\n\t\t\t\t\t'dfv:modal:update',\...
[ "public function getStoreValue($data = null)\n {\n\n // If Overrite Value\n if (isset($this->value) && $this->overwriteValue) {\n return $this->value;\n }\n\n // If user have user input value\n if ($data != null && isset($data[$this->getName()])) {\n\n // ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Is the given line a diff header line. diff --git a/some/file b/some/file @param string $line @return bool
[ "private function isHeaderLine(string $line): bool\n {\n $matches = [];\n if (preg_match('#^diff --git [a|b|c|i|w|o]/(.*) [a|b|c|i|w|o]/(.*)#', $line, $matches)) {\n $this->appendCollectedFileAndChanges();\n $this->currentOperation = File::OP_MODIFIED;\n $this->curr...
[ "def make_sample():\n \n if md_sample:\n # user has set another:\n return md_sample\n _md = []\n for hl in range(1, 7): _md.append('#' * hl + ' ' + 'Header %s' % hl)\n this = open(__file__).read().split('\"\"\"', 3)[2].splitlines()[:10]\n _md.append('```python\\n\"\"\" Test \"\"\"\\n...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetTimeoutSeconds sets the TimeoutSeconds field's value.
[ "func (s *SendCommandInput) SetTimeoutSeconds(v int64) *SendCommandInput {\n\ts.TimeoutSeconds = &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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Returns a route definition by the name of the route. @param string $name The name of the route @return RouteDefinition The route definition with the given name
[ "public function getRouteDefinitionByName(string $name): RouteDefinition\n {\n if (!isset($this->routesByName[$name])) {\n throw new \\InvalidArgumentException(\"Invalid route name '$name'\");\n }\n\n return $this->getRouteDefinition($this->routesByName[$name]);\n }" ]
[ "public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key....
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
// NewRegexpWithLimit creates a new Regular Expression automaton with // the specified expression. The size of the compiled finite state // automaton exceeds the user specified size, ErrCompiledTooBig will be // returned.
[ "func NewWithLimit(expr string, size uint) (*Regexp, error) {\n\tparsed, err := syntax.Parse(expr, syntax.Perl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewParsedWithLimit(expr, parsed, size)\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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns the GA4GH protocol representation of this read group's ReadStats.
[ "def getStats(self):\n \n stats = protocol.ReadStats()\n stats.aligned_read_count = self.getNumAlignedReads()\n stats.unaligned_read_count = self.getNumUnalignedReads()\n # TODO base_count requires iterating through all reads\n return stats" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// PubSubHandler is a webhook that stores the builds coming in from pubsub.
[ "func PubSubHandler(ctx *router.Context) {\n\tstatusCode := pubSubHandlerImpl(ctx.Context, ctx.Request)\n\tctx.Writer.WriteHeader(statusCode)\n}" ]
[ "func NewHTTPCommand(stdin io.Reader, stdout, stderr io.Writer) *cobra.Command {\n\tcom, err := cobrafy.Command(http.NewMain())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tcom.Use = `http`\n\tcom.Short = `listens for and indexes arbitrary JSON data in Pilosa`\n\tcom.Long = `\npdk http listens for and indexes arbitra...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Returns the WKB representation of this geometry. @noproxy @return string
[ "public function asBinary() : string\n {\n static $wkbWriter;\n\n if ($wkbWriter === null) {\n $wkbWriter = new WKBWriter();\n }\n\n return $wkbWriter->write($this);\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Returns all the values joined together. :return <int>
[ "def all(self):\n \n out = 0\n for key, value in self.items():\n out |= value\n return out" ]
[ "def t_ATOM(self, t):\n '\n t.type = PLLexer.reserved.get(t.value, 'ATOM') # Check for reserved words\n return t" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Regular expressions:" }
// ReadLine awaits a single line from the client.
[ "func (c *Conn) ReadLine() (text string, ok bool) {\n\tok = c.RwcScanner.Scan()\n\treturn c.RwcScanner.Text(), ok\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 instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about File management:" }
Given a value of type <code>A</code>, produced an instance of this tuple with each slot set to that value. @param a the value to fill the tuple with @param <A> the value type @return the filled tuple @see Tuple2#fill
[ "public static <A> Tuple7<A, A, A, A, A, A, A> fill(A a) {\n return tuple(a, a, a, a, a, a, a);\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 comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
@param string $id @param array $data @param array $headers @throws Exception @return array|string
[ "public function reactivate(string $id, array $data, array $headers = [])\n {\n $url = $this->url('subscriptions/%s/reactivate', $id);\n\n return $this->post($url, $data, $headers);\n }" ]
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Link given $zone with the zone given in $zoneData.
[ "private function linkZone(Zone $zone, array $zoneData): void\n {\n $linkedZoneLayout = $this->layoutService->loadLayout($zoneData['layout_id']);\n $linkedZone = $linkedZoneLayout->getZone($zoneData['identifier']);\n $this->layoutService->linkZone($zone, $linkedZone);\n }" ]
[ "function completeQuery(err) {\n if (err) return cb(err);\n db.eval(zahd, 2, 'expiring_domains', 'querying_domains',\n expiration, domain, next);\n }" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Creates a Diffie-Hellman key pair. @return dh keypair
[ "protected KeyPair generateKeyPair() {\r\n KeyPair keyPair = null;\r\n DHParameterSpec keySpec = new DHParameterSpec(DH_MODULUS, DH_BASE);\r\n try {\r\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"DH\");\r\n keyGen.initialize(keySpec);\r\n keyPair =...
[ "def get_hash(self):\n \n if not self.executed:\n raise pyhsm.exception.YHSM_Error(\"HMAC-SHA1 hash not available, before execute().\")\n return self.result.hash_result" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Create a package finder appropriate to this install command. This method is meant to be overridden by subclasses, not called directly.
[ "def _build_package_finder(self, options, index_urls):\n \n return PackageFinder(find_links=options.find_links,\n index_urls=index_urls,\n use_mirrors=options.use_mirrors,\n mirrors=options.mirrors)" ]
[ "def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Generates the data that powers the index page
[ "protected function generateIndex() {\n\n\t\t/**\n\t\t\t* Handle missing index.html. Solves https://github.com/drupal-pattern-lab/patternlab-php-core/issues/14\n\t\t\t* Could also be used to re-add missing styleguidekit assets with a few edits?\n\t\t\t*\n\t\t\t* 1. @TODO: Figure out a better way to future-proof ...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Parses a complex fault geometry node returning both the attributes and parameters in a dictionary
[ "def parse_complex_fault_geometry(node):\n \n assert \"complexFaultGeometry\" in node.tag\n # Get general attributes\n geometry = {\"intermediateEdges\": []}\n for subnode in node:\n crds = subnode.nodes[0].nodes[0].text\n if \"faultTopEdge\" in subnode.tag:\n geometry[\"faul...
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Compute distance matrix from contact data by applying a negative power law (alpha) to its nonzero pixels, then interpolating on the zeroes using a shortest-path algorithm.
[ "def to_distance(matrix, alpha=1):\n \n matrix = np.array(matrix)\n try:\n import scipy.sparse\n except ImportError as e:\n print(\"Scipy not found.\")\n print(str(e))\n raise\n\n if callable(alpha):\n distance_function = alpha\n else:\n try:\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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
The wrapper for creating shell instances. @param string $className Shell class name. @param \Cake\Console\ConsoleIo $io The IO wrapper for the created shell class. @return \Cake\Console\Shell|\Cake\Console\Command
[ "protected function createShell($className, ConsoleIo $io)\n {\n $shell = $this->factory->create($className);\n if ($shell instanceof Shell) {\n $shell->setIo($io);\n }\n\n return $shell;\n }" ]
[ "public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\...
codesearchnet
{ "query": "Represent the description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
count ``` $db->count(); ``` @param string $table @param array|string $wheres @return int @throws \RuntimeException
[ "public function count(string $table, $wheres)\n {\n list($where, $bindings) = $this->handleWheres($wheres);\n $sql = \"SELECT COUNT(*) AS total FROM {$table} WHERE {$where}\";\n\n $result = $this->fetchObject($sql, $bindings);\n\n return $result ? (int)$result->total : 0;\n }" ]
[ "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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Return the extra classes as concatenated strings @return String $classes
[ "protected function getTableExtraClassesString()\n {\n $classes_html = '';\n\n if( ! empty($this->table_extra_classes) )\n {\n foreach($this->table_extra_classes as $class)\n {\n $classes_html.= \"{$class} \";\n }\n }\n\n return $classes_html;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
// ContentTypeHandler wraps and returns a http.Handler, validating the request // content type is compatible with the contentTypes list. It writes a HTTP 415 // error if that fails. // // Only PUT, POST, and PATCH requests are considered.
[ "func ContentTypeHandler(h http.Handler, contentTypes ...string) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tif !(r.Method == \"PUT\" || r.Method == \"POST\" || r.Method == \"PATCH\") {\n\t\t\th.ServeHTTP(w, r)\n\t\t\treturn\n\t\t}\n\n\t\tfor _, ct := range contentT...
[ "function mkcol($path) {\n $this->_path = $this->translate_uri($path);\n $this->header_unset();\n $this->create_basic_request('MKCOL');\n $this->send_request();\n $this->get_respond();\n $response = $this->process_respond();\n // validate the response ...\n //...
codesearchnet
{ "query": "Represent the Github post about Web development:", "pos": "Represent the Github code about Web development:", "neg": "Represent the Github code about Software development:" }
Notify all listeners that a property has changed. @param property the property whose value has changed
[ "private void firePropertyChanged(T property)\r\n {\r\n PropertyEvent<T> event = null;\r\n\r\n for (PropertyListener<T> l : listeners)\r\n {\r\n if (event == null)\r\n {\r\n event = new PropertyEvent<T>(this, property);\r\n }\r\n\r\n ...
[ "function DependentArraysObserver(callbacks, cp, instanceMeta, context, propertyName, sugarMeta) {\n // user specified callbacks for `addedItem` and `removedItem`\n this.callbacks = callbacks;\n\n // the computed property: remember these are shared across instances\n this.cp = cp;\n\n // th...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
/ perform extra validation before submission
[ "function validation($data, $files) {\n global $COURSE;\n\n $errors = parent::validation($data, $files);\n\n if (array_key_exists('idnumber', $data)) {\n if ($data['id']) {\n $grade_item = new grade_item(array('id'=>$data['id'], 'courseid'=>$data['courseid']));\n ...
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maxi...
codesearchnet
{ "query": "Represent the post about User interface:", "pos": "Represent the code about User interface:", "neg": "Represent the code about programming:" }
Additionally encodes headers. :return:
[ "def as_dict(self):\n \n data = super(BaseEmail, self).as_dict()\n data[\"Headers\"] = [{\"Name\": name, \"Value\": value} for name, value in data[\"Headers\"].items()]\n for field in (\"To\", \"Cc\", \"Bcc\"):\n if field in data:\n data[field] = list_to_csv(dat...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Splits a line at the first occurrence of : @param {string} line @return {Array.<string>} @private
[ "function splitLine(line) {\n\tvar idx = String(line).indexOf(':');\n\n\tif (!line || idx < 0) {\n\t\treturn null;\n\t}\n\n\treturn [line.slice(0, idx), line.slice(idx + 1)];\n}" ]
[ "function DocBlockParser(conf) {\n conf = conf || {};\n this.docBlockPattern = conf.docBlockPattern || '\\\\\\/\\\\\\*\\\\\\*[^]*?\\\\\\*\\\\\\/';\n this.docBlockStrip = '(^\\\\\\s*\\\\\\/\\\\\\*\\\\\\*)|(\\\\\\*\\\\\\/\\\\\\s*$)';\n\n this.docLineStrip = '^\\\\\\s*\\\\\\* ?';\n\n /**\n * Skip markdown parsi...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Computer Science:" }
Helper to cast string to datetime using :member:`parse_format`. :param value: String representing a datetime :type value: str :return: datetime
[ "def get_parsed_value(self, value):\n \n\n def get_parser(parser_desc):\n try:\n return parser_desc['parser']\n except TypeError:\n try:\n return get_parser(self.date_parsers[parser_desc])\n except KeyError:\n ...
[ "def _parse_filter_word(self, word):\n \n if isinstance(word, str):\n word = \"'{}'\".format(word)\n elif isinstance(word, dt.date):\n if isinstance(word, dt.datetime):\n if word.tzinfo is None:\n # if it's a naive datetime, localize the d...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
<code>.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig crypto_replace_ffx_fpe_config = 4; </code>
[ "public com.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfigOrBuilder\n getCryptoReplaceFfxFpeConfigOrBuilder() {\n if (transformationCase_ == 4) {\n return (com.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig) transformation_;\n }\n return com.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.getDe...
[ "def update(self, ignore_warnings=None):\n \n update_mask_pb = field_mask_pb2.FieldMask()\n\n if self.description is not None:\n update_mask_pb.paths.append(\"description\")\n\n if self.routing_policy_type == RoutingPolicyType.ANY:\n update_mask_pb.paths.append(\"mu...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
List all file `filename` breakpoints
[ "def get_file_breaks(self, filename):\n \"\"\"\"\"\"\n return [\n breakpoint for breakpoint in self.breakpoints\n if breakpoint.on_file(filename)\n ]" ]
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the instruction about File management:", "pos": "Represent the code about File management:", "neg": "Represent the code:" }
Add an edge for every attribute the given artifact provides. This method adds a directed edge from the artifact node to every attribute this artifact provides. Args: rdf_artifact: The artifact object.
[ "def _AddProvidesEdges(self, rdf_artifact):\n \n for attribute in rdf_artifact.provides:\n self._AddEdge(rdf_artifact.name, attribute)" ]
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// AllCols indicates that all columns should be use
[ "func (engine *Engine) AllCols() *Session {\n\tsession := engine.NewSession()\n\tsession.isAutoClose = true\n\treturn session.AllCols()\n}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Converts the given Metric into datapoints that can be sent to SignalFx. @param metric The {@link Metric} containing the timeseries of each combination of label values. @return A list of datapoints for the corresponding metric timeseries of this metric.
[ "static List<DataPoint> adapt(Metric metric) {\n MetricDescriptor metricDescriptor = metric.getMetricDescriptor();\n MetricType metricType = getType(metricDescriptor.getType());\n if (metricType == null) {\n return Collections.emptyList();\n }\n\n DataPoint.Builder shared = DataPoint.newBuilder(...
[ "@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
Returns a contentset options according to the layout zone. @param \StdClass $zone @return array
[ "private function getZoneOptions(\\stdClass $zone)\n {\n $options = array(\n 'parameters' => array(\n 'class' => array(\n 'type' => 'scalar',\n 'options' => array('default' => 'row'),\n ),\n ),\n );\n\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Returns a list of pairs (leaf_name, distance)
[ "def _parse_leaves(self, leaves) -> List[Tuple[str, int]]:\n \"\"\"\"\"\"\n return [(self._leaf_name(leaf), 0) for leaf in leaves]" ]
[ "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 comment about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code:" }
------------------------------------------------------------------------------
[ "function onRequestGetAgents(session, channel, message) {\n var agents = session.getAgents()\n var infos = agents.map(function(agent){\n return agent.info\n })\n\n channel.sendMessage({\n type: \"response\",\n name: message.name,\n from: message.to,\n id: message.id,\n body: infos\n }...
[ "public static function run($speech = null)\n\t{\n\t\tif ( ! isset($speech))\n\t\t{\n\t\t\t$speech = 'KILL ALL HUMANS!';\n\t\t}\n\n\t\t$eye = \\Cli::color(\"*\", 'red');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"{$speech}\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::col...
codesearchnet
{ "query": "Represent the Github summarization about language and writing:", "pos": "Represent the Github code about language and writing:", "neg": "Represent the Github code about programming:" }
Does our comparison need a container? EG: "[* TO *]"? If so, return the opening container brace. @param string $comparison @return string @throws InvalidArgumentException
[ "protected function getOpenComparisonContainer($comparison)\n {\n switch ($comparison) {\n case SearchCriterion::GREATER_EQUAL:\n case SearchCriterion::LESS_EQUAL:\n case SearchCriterion::ISNULL:\n case SearchCriterion::ISNOTNULL:\n return '[';\n ...
[ "def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Generates an unique auth code. Implementing classes may want to override this function to implement other auth code generation schemes. @return An unique auth code. @ingroup oauth2_section_4
[ "protected function generateAuthorizationCode()\n {\n $tokenLen = 40;\n if (function_exists('random_bytes')) {\n $randomData = random_bytes(100);\n } elseif (function_exists('openssl_random_pseudo_bytes')) {\n $randomData = openssl_random_pseudo_bytes(100);\n } e...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Recovers a RingSet corresponding to a AtomContainer that has been stored by storeRingSystem(). @param mol The IAtomContainer for which to recover the IRingSet.
[ "private IRingSet recoverRingSystem(IAtomContainer mol) {\n IRingSet ringSet = mol.getBuilder().newInstance(IRingSet.class);\n for (Integer[] bondNumbers : listOfRings) {\n IRing ring = mol.getBuilder().newInstance(IRing.class, bondNumbers.length);\n for (int bondNumber : bondNum...
[ "@Override\n public void addProduct(IAtomContainer product, Double coefficient) {\n products.addAtomContainer(product, coefficient);\n /*\n * notifyChanged() is called by addReactant(Molecule reactant, double\n * coefficient)\n */\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }