query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Meter contains a tag matching the name predicate. @param nameMatches Name matching predicate. @return This search.
[ "public Search name(@Nullable Predicate<String> nameMatches) {\n if (nameMatches != null)\n this.nameMatches = nameMatches;\n return this;\n }" ]
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
// reloadAllowNondistributableArtifacts updates the configuration with allow-nondistributable-artifacts options // and updates the passed attributes.
[ "func (daemon *Daemon) reloadAllowNondistributableArtifacts(conf *config.Config, attributes map[string]string) error {\n\t// Update corresponding configuration.\n\tif conf.IsValueSet(\"allow-nondistributable-artifacts\") {\n\t\tdaemon.configStore.AllowNondistributableArtifacts = conf.AllowNondistributableArtifacts\...
[ "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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Change the data in this field to base64. WARNING - This requires 64bit encoding found in javax.mail! @param field The field containing the binary data to encode. @return The string encoded using base64.
[ "public static String encodeFieldData(BaseField field)\n {\n if (field.getData() == null)\n return DBConstants.BLANK;\n ByteArrayOutputStream baOut = new ByteArrayOutputStream();\n DataOutputStream daOut = new DataOutputStream(baOut);\n try {\n field.write(daOut,...
[ "def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ...
codesearchnet
{ "query": "Represent the Github comment about Java programming:", "pos": "Represent the Github code about Java programming:", "neg": "Represent the Github code about programming:" }
Sets the text value. @param entity the entity @param member the member @param retVal the ret val @return the object
[ "private static Object setTextValue(Object entity, Field member, Object retVal)\n {\n if (member != null && member.getType().isEnum())\n {\n EnumAccessor accessor = new EnumAccessor();\n if (member != null)\n {\n retVal = accessor.fromString(member.ge...
[ "def set_note_attribute(data):\n \n na = False\n if data.get('link'):\n na = Types.NoteAttributes()\n # add the url\n na.sourceURL = data.get('link')\n # add the object to the note\n return na" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
The lookup table for error messages.
[ "public Object[][] getContents() {\n Object[][] contents = new Object[][] {\n { MsgKey.BAD_MSGKEY,\n \"A chave de mensagem ''{0}'' n\\u00e3o est\\u00e1 na classe de mensagem ''{1}''\" },\n\n { MsgKey.BAD_MSGFORMAT,\n \"O formato da mensagem ''{0}'' na c...
[ "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 comment about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code:" }
Exports a flow to another external interface @param *string $event @param bool $map @return Closure|array
[ "public function export(string $event, bool $map = false)\n {\n $handler = $this;\n\n $next = function (...$args) use ($handler, $event, $map) {\n $request = $handler->getRequest();\n $response = $handler->getResponse();\n\n $meta = $handler\n //do th...
[ "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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Builds the columns for the select queries. @return string
[ "private function buildSelectColumns()\n {\n $columns = array();\n\n foreach ($this->query['select'] as $column => $as) {\n // Normal column select\n if (is_numeric($column)) {\n $columns[] = $this->columnName($as);\n }\n // Alias\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 Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Add --with-X/--without-X options based on optional features
[ "def _set_global_opts_from_features(self):\n \"\"\"\"\"\"\n\n go = []\n no = self.negative_opt.copy()\n\n for name, feature in self.features.items():\n self._set_feature(name, None)\n feature.validate(self)\n\n if feature.optional:\n descr ...
[ "def check(path=None, env='default'):\n \n # TODO: add files=<list of files> to check only a subset...\n # also useful for 'quilt build' to exclude certain files?\n # (if not, then require dry_run=True if files!=None/all)\n build(\"dry_run/dry_run\", path=path, dry_run=True, env=env)" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Executes parent::render() and returns array with languages. @return array $this->aLanguages languages
[ "public function render()\n {\n parent::render();\n\n // Performance\n if (\\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getConfigParam('bl_perfLoadLanguages')) {\n $aLanguages = \\OxidEsales\\Eshop\\Core\\Registry::getLang()->getLanguageArray(null, true, true);\n r...
[ "public function render($renderer)\n {\n $renderer->setCurrentStyle('footnotenum');\n $renderer->Write($renderer->getCurrentStyleHeight(), $this->numText, $this->addlink); //source link numbers after name\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Checks if content can be shown @param string $sContentIdent ident of content to display @return bool
[ "protected function _canShowContent($sContentIdent)\n {\n return !($this->isEnabledPrivateSales() &&\n !$this->getUser() && !in_array($sContentIdent, $this->_aPsAllowedContents)\n );\n }" ]
[ "public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $...
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Pushes unique nodes that are in context to an array @private @param {Array} result The array to push to @param {Array} nodes The list of nodes to push @param {Object} context The "resolved" context object, @see resolveContext
[ "function pushNode(result, nodes) {\n\t'use strict';\n\n\tvar temp;\n\n\tif (result.length === 0) {\n\t\treturn nodes;\n\t}\n\tif (result.length < nodes.length) {\n\t\t// switch so the comparison is shortest\n\t\ttemp = result;\n\t\tresult = nodes;\n\t\tnodes = temp;\n\t}\n\tfor (var i = 0, l = nodes.length; i < l;...
[ "function transformer (selection) {\n const type = quantum.isSelection(selection) ? selection.type() : undefined\n const entityTransform = transformMap[type] || defaultTransform\n return entityTransform(selection, transformer, meta) // bootstrap to itself to make the transformer accessible to children\n ...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Load a View and convert to HTML @param string $view @param array $data @param array $mergeData @return $this
[ "public function loadView($view, $data = array(), $mergeData = array())\n {\n $this->view = View::make($view, $data, $mergeData);\n return parent::loadView($view, $data, $mergeData);\n }" ]
[ "final private function __setDataFromFilter()\n {\n if ($this->template === 'app') {\n // Merge all incoming data from app to allow Sage add_filter support\n $this->data = array_merge($this->data, $this->incomingData);\n }\n }" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// WriteTarGzip writes the given VFS as a tar.gz file to the given io.Writer.
[ "func WriteTarGzip(w io.Writer, fs VFS) error {\n\tgw, err := gzip.NewWriterLevel(w, gzip.BestCompression)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := WriteTar(gw, fs); err != nil {\n\t\treturn err\n\t}\n\treturn gw.Close()\n}" ]
[ "func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Handle pane for dashboard page. @return void
[ "public function compose($name = null, $options = array())\n {\n $menu = $this->widget->make('menu.brands.pane');\n $menu->add('module-item')\n ->link('#')\n ->title('Module item')\n ->icon('zmdi-settings');\n\n $menu->add('module-item-submenu')\n...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Closest gets the first element that matches the selector by testing the // element itself and traversing up through its ancestors in the DOM tree.
[ "func (s *Selection) Closest(selector string) *Selection {\n\tcs := compileMatcher(selector)\n\treturn s.ClosestMatcher(cs)\n}" ]
[ "function _matchesSelector (element, selector, boundElement) {\n // no selector means this event was bound directly to this element\n if (selector === '_root') {\n return boundElement;\n }\n\n // if we have moved up to the element you bound the event to\n // then we have come too far\n if (element === boun...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Returns the array type. Returns the specified class if it is not an array.
[ "public Class<?> getArrayType(Class<?> clazz) {\n\n if (clazz.isArray()) {\n return getArrayType(clazz.getComponentType());\n }\n\n return clazz;\n }" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(fieldName(sym),\n retrofit\n ? sym.erasure(types)\n : sym.externalType(types), types);\n // if we retrofit, then the NameAndType has been read in as is...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Registers jQuery and Foundation JavaScript. @param bool $useZepto whether to use zepto or not @param bool $minimized whether to register full minimized library or not @param int $position the position to register the core script
[ "public static function registerCoreScripts(\n $useZepto = false,\n $minimized = true,\n $position = \\CClientScript::POS_END\n ) {\n /** @var CClientScript $cs */\n $cs = \\Yii::app()->getClientScript();\n\n if ($useZepto) {\n $cs->registerScriptFile(static::...
[ "function() {\n if (options.servePacked) {\n ss.bundler.forEach(function(bundler) {\n bundler.useLatestsPackedId();\n });\n }\n ss.bundler.load();\n //TODO convert options.dirs to relative paths stripping the lead '/' if present\n\n // Cache instances of code formatte...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
--------------------------------------------------------------------------------
[ "public void init(String st, int minsize, int maxsize) {\n super.init(buildString(st.trim(), minsize), minsize, maxsize);\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 instruction about language and writing:", "pos": "Represent the code about language and writing:", "neg": "Represent the code about programming:" }
**********************************************************************************************************************************************************************
[ "public function afficheSelectSousQuartier($params = array())\n {\n $html=\"\";\n $t=new Template('modules/archi/templates/');\n $t->set_filenames((array('listeSousQuartiers'=>'listeSousQuartiers.tpl')));\n\n\n $a = new archiAuthentification();\n $u = new archiUtilisateur();\n\...
[ "public static function protect()\n\t{\n\t\t$eye = \\Cli::color(\"*\", 'green');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"PROTECT ALL HUMANS\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::color(\"\t\t\t ____[\\\\\", 'blue').$eye.\\Cli::color('---', 'blue').$eye.\\Cli:...
codesearchnet
{ "query": "Represent the Github text about N/A:", "pos": "Represent the Github code about N/A:", "neg": "Represent the Github code about Programming:" }
Privat24 settings
[ "protected function addgroup_privat24(){\n\t\t$this->registerGroup(BLang::_('ADMIN_CONFIG_PAYMENT_PRIVAT24'),'privat24',array(\n\t\t\tnew BConfigFieldInt(\n\t\t\t\t'PAYMENT_PRIVAT24_MERCHANT_ID',\n\t\t\t\tBLang::_('ADMIN_CONFIG_PAYMENT_PRIVAT24_MERCHANT_ID')),\n\t\t\tnew BConfigFieldString(\n\t\t\t\t'PAYMENT_PRIVAT...
[ "def postloop(self):\n \n cmd.Cmd.postloop(self) # Clean up command completion\n d1_cli.impl.util.print_info(\"Exiting...\")" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// SetDisassociateLifecycleConfig sets the DisassociateLifecycleConfig field's value.
[ "func (s *UpdateNotebookInstanceInput) SetDisassociateLifecycleConfig(v bool) *UpdateNotebookInstanceInput {\n\ts.DisassociateLifecycleConfig = &v\n\treturn s\n}" ]
[ "public final void setTemplateMode(final TemplateMode templateMode) {\n Validate.notNull(templateMode, \"Cannot set a null template mode value\");\n // We re-parse the specified template mode so that we make sure we get rid of deprecated values\n this.templateMode = TemplateMode.parse(templateM...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// flusher is a single goroutine that periodically asks all workers to // commit their outstanding bulk requests. It is only started if // FlushInterval is greater than 0.
[ "func (p *BulkProcessor) flusher(interval time.Duration) {\n\tticker := time.NewTicker(interval)\n\tdefer ticker.Stop()\n\n\tfor {\n\t\tselect {\n\t\tcase <-ticker.C: // Periodic flush\n\t\t\tp.Flush() // TODO swallow errors here?\n\n\t\tcase <-p.flusherStopC:\n\t\t\tp.flusherStopC <- struct{}{}\n\t\t\treturn\n\t\t...
[ "func (m *Manager) removeProxyServiceLocked(proxyID string) {\n\tstate, ok := m.proxies[proxyID]\n\tif !ok {\n\t\treturn\n\t}\n\n\t// Closing state will let the goroutine we started in Ensure finish since\n\t// watch chan is closed.\n\tstate.Close()\n\tdelete(m.proxies, proxyID)\n\n\t// We intentionally leave poten...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Builds an EventMetadata {@link Map} from the {@link #SlaEventSubmitter}. The method filters out metadata by applying {@link #NOT_NULL_OR_EMPTY_PREDICATE}
[ "private Map<String, String> buildEventMap() {\n\n Map<String, String> eventMetadataMap = Maps.newHashMap();\n eventMetadataMap.put(withoutPropertiesPrefix(SlaEventKeys.DATASET_URN_KEY), datasetUrn);\n eventMetadataMap.put(withoutPropertiesPrefix(SlaEventKeys.PARTITION_KEY), partition);\n eventMetadataM...
[ "public Map<String, MethodConstraint> getUserDataMap(int table) {\n if (tc.isDebugEnabled())\n Tr.debug(tc, \"Getting user data map of which attribute is either confidential or integral\");\n return getMethodSet(table, UD_CONFIDENTIAL_OR_INTEGRAL_NO_EX_CHECK);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Fetch node assignment count by version status, giving parent node id list. @param array $parentNodeIDList @param int $status @return int
[ "static function fetchChildCountByVersionStatus( $parentNodeIDList, $status = eZContentObjectVersion::STATUS_PENDING )\n {\n $db = eZDB::instance();\n $parentIDStatement = $db->generateSQLINStatement( $parentNodeIDList );\n $sql = \"SELECT COUNT( DISTINCT eznode_assignment.id ) AS cnt\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 Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// Set invokes the wrapped diode's Set with the given data and uses Broadcast // to wake up any readers.
[ "func (w *Waiter) Set(data GenericDataType) {\n\tw.Diode.Set(data)\n\tw.c.Broadcast()\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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
@param array $doc @return string
[ "private function generate(array $doc)\n {\n $this->xml->openMemory();\n $this->xml->setIndentString(str_repeat(' ', 4));\n $this->xml->setIndent(true);\n\n $this->xml->startDocument('1.0', 'UTF-8');\n\n foreach ($doc as $name => $element) {\n $this->buildElement($th...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Check if playlist exists in local directory.
[ "def write_playlist_file(self, localdir):\n \n path = \"{0}/playlists\".format(localdir)\n if not os.path.exists(path):\n os.makedirs(path)\n\n filepath = \"{0}/{1}\".format(path, self.gen_filename())\n playlist = open(filepath, \"w\")\n for track in self.get_tra...
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Display a value from the resource but provides no editable field.
[ "public function staticValue($key, $label=false, array $attr=[]){\n\t\t$field = $this->factory('static', $key, $label, $attr);\n\t\treturn $this->addField($field);\n\t}" ]
[ "@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:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Reads entire file into a string @param int $offset The offset where the reading starts on the original stream. @param int $maxlen Maximum length of data read
[ "final public function fileGetContents($offset = -1, $maxlen = null)\n\t{\n\t\t$this->fseek($offset + 1, SEEK_SET);\n\t\treturn $this->fread($maxlen);\n\t}" ]
[ "protected function detectChunkSizeBytes()\n {\n // Max and default chunk size of 100MB\n $chunkSizeBytes = 100 * 1024 * 1024;\n $memoryLimit = $this->getIniBytes('memory_limit');\n if ($memoryLimit > 0) {\n $availableMemory = $memoryLimit - $this->getMemoryUsedBytes();\n ...
codesearchnet
{ "query": "Represent the Github summarization about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
// SetSourceRegion sets the SourceRegion field's value.
[ "func (s *CreateDBInstanceReadReplicaInput) SetSourceRegion(v string) *CreateDBInstanceReadReplicaInput {\n\ts.SourceRegion = &v\n\treturn s\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 post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Deserialize the data @param array $json @return DocumentSerializationInterface
[ "public static function jsonDeserialize(array $json): DocumentSerializationInterface\n {\n $managerClass = $json['document_serialization']['manager_class'];\n $data = (array) $json['document_serialization']['data'];\n\n return new self($managerClass, $data);\n }" ]
[ "def DeserializeExclusiveData(self, reader):\n \n self.Type = TransactionType.StateTransaction\n\n self.Descriptors = reader.ReadSerializableArray('neo.Core.State.StateDescriptor.StateDescriptor')" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
for debugging, uses {@link DebugStyler#getStyleSetup() } to return classNames @param l @return
[ "public static String styleClasses(Collection<? extends BaseStyler> l) {\n if (l == null) {\n return \"argument is null\";\n }\n\n for (BaseStyler st : l) {\n if (st instanceof DebugStyler) {\n return ((DebugStyler) st).getStyleSetup().toString();\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:" }
// IsErrorWithCode returns true if the given error is an LDAP error with the given result code
[ "func IsErrorWithCode(err error, desiredResultCode uint8) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\n\tserverError, ok := err.(*Error)\n\tif !ok {\n\t\treturn false\n\t}\n\n\treturn serverError.ResultCode == desiredResultCode\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the instruction about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code:" }
Check the pillar for errors, refuse to run the state if there are errors in the pillar and return the pillar errors
[ "def _check_pillar(kwargs, pillar=None):\n '''\n \n '''\n if kwargs.get('force'):\n return True\n pillar_dict = pillar if pillar is not None else __pillar__\n if '_errors' in pillar_dict:\n return False\n return True" ]
[ "def finish_parse(self, last_lineno_seen):\n \"\"\"\"\"\"\n if self.state == self.STATES['step_in_progress']:\n # We've reached the end of the log without seeing the final \"step finish\"\n # marker, which would normally have triggered updating the step. As such we\n #...
codesearchnet
{ "query": "Represent the comment about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code about programming:" }
Returns a `list` of all the `ScaleIO_SDC` known to the cluster. Updates every time - no caching. :return: a `list` of all the `ScaleIO_SDC` known to the cluster. :rtype: list
[ "def sdc(self):\n \n self.connection._check_login()\n response = self.connection._do_get(\"{}/{}\".format(self.connection._api_url, \"types/Sdc/instances\")).json() \n all_sdc = []\n for sdc in response:\n all_sdc.append(\n SIO_SDC.from_dict(sdc)\n ...
[ "def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne...
codesearchnet
{ "query": "Represent the post about AWS Route 53:", "pos": "Represent the code about AWS Route 53:", "neg": "Represent the code about AWS S3:" }
Update the specified resource in storage. @param \Illuminate\Http\Request $request @param int $id @return \Illuminate\Http\Response
[ "public function update(Request $request, $id)\r\n {\r\n /** @noinspection PhpUndefinedMethodInspection */\r\n $request->validate([\r\n \"name\" => \"required|max:36\",\r\n \"description\" => \"required|max:128\",\r\n ]);\r\n $memberCategory = MemberCategory::fin...
[ "public function make()\n {\n if (is_lumen()) {\n return new \\Laravel\\Lumen\\Http\\ResponseFactory();\n }\n\n return app(\\Illuminate\\Contracts\\Routing\\ResponseFactory::class);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software Development:" }
Build the map of property => marshalling callable. @param array $data The data being marshalled. @param array $options List of options containing the 'associated' key. @throws \InvalidArgumentException When associations do not exist. @return array
[ "protected function _buildPropertyMap($data, $options)\n {\n $map = [];\n $schema = $this->_table->getSchema();\n\n // Is a concrete column?\n foreach (array_keys($data) as $prop) {\n $columnType = $schema->getColumnType($prop);\n if ($columnType) {\n ...
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
Determines whether the parameter string is null, empty or whitespace. @param arg The string to be checked. @return true if the string is null, empty or whitespace.
[ "public static boolean isNullOrWhiteSpace(String arg) {\n\n if (Strings.isNullOrEmpty(arg) || arg.trim().isEmpty()) {\n return true;\n }\n\n return false;\n }" ]
[ "function isValidJSONPointer(pointer) {\n if (!_.isString(pointer)) {\n // If it's not a string, it obviously is not valid.\n return false;\n }\n\n // If it is string and is an empty string, it's valid.\n if ('' === pointer) {\n return true;\n }\n\n // If it is non-empty string, it must match s...
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
// get a storage account by UUID
[ "func generateStorageAccountName(accountNamePrefix string) string {\n\tuniqueID := strings.Replace(string(uuid.NewUUID()), \"-\", \"\", -1)\n\taccountName := strings.ToLower(accountNamePrefix + uniqueID)\n\tif len(accountName) > storageAccountNameMaxLength {\n\t\treturn accountName[:storageAccountNameMaxLength-1]\n...
[ "def create(self, **kwargs):\n \n raise exceptions.MethodNotImplemented(method=self.create, url=self.url, details='GUID cannot be duplicated, to create a new GUID use the relationship resource')" ]
codesearchnet
{ "query": "Represent the Github summarization about Technology:", "pos": "Represent the Github code about Technology:", "neg": "Represent the Github code about Natural Language Processing:" }
Add a subject to a EmailAddress object @param string $subject The personalized subject of the email @throws TypeException
[ "public function setSubject($subject)\n {\n if (!is_string($subject)) {\n throw new TypeException('$subject must be of type string.');\n }\n if (!($subject instanceof Subject)) {\n $this->subject = new Subject($subject);\n } else {\n $this->subject = $...
[ "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 Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Create a Vendor from a Callable
[ "public static<T> Vendor<T> vendor(Callable<T> f) {\n\treturn j.vendor(f);\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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Remove an authorized key from the specified user's authorized key file, using a file as source CLI Example: .. code-block:: bash salt '*' ssh.rm_auth_key_from_file <user> salt://ssh_keys/<user>.id_rsa.pub
[ "def rm_auth_key_from_file(user,\n source,\n config='.ssh/authorized_keys',\n saltenv='base',\n fingerprint_hash_type=None):\n '''\n \n '''\n lfile = __salt__['cp.cache_file'](source, saltenv)\n if not...
[ "def copySshKeys(self, keyName):\n \n if keyName == 'core':\n return # No point.\n\n # Make sure that keys are there.\n self._waitForSSHKeys(keyName=keyName)\n\n # copy keys to core user so that the ssh calls will work\n # - normal mechanism failed unless public ...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Add a validationResultsModel as a child to this one. Attach listeners and if it already has messages, fire events. @param validationResultsModel
[ "public void add(ValidationResultsModel validationResultsModel) {\n\t\tif (children.add(validationResultsModel)) {\n\t\t\tvalidationResultsModel.addValidationListener(this);\n\t\t\tvalidationResultsModel.addPropertyChangeListener(HAS_ERRORS_PROPERTY, this);\n\t\t\tvalidationResultsModel.addPropertyChangeListener(HA...
[ "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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// Rate creates a new ugen at a specific rate. // If rate is an unsupported value this method will cause a runtime panic. // If the input signal is nil this method will panic.
[ "func (jpv JPverb) Rate(rate int8) Input {\n\tCheckRate(rate)\n\tif jpv.In == nil {\n\t\tpanic(\"JPverb requires an input signal\")\n\t}\n\t(&jpv).defaults()\n\n\tvar in1, in2 Input\n\n\tswitch x := jpv.In.(type) {\n\tcase Inputs:\n\t\tif len(x) == 0 {\n\t\t\tpanic(\"JPverb requires an input signal\")\n\t\t}\n\t\ti...
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Randomly shuffle a char array @param charArray array of char to shuffle.
[ "public static void shuffle(char[] charArray) {\n\t\tint swapPlace = -1;\n\n\t\tfor(int i = 0; i < charArray.length; i++) {\n\t\t\tswapPlace = (int) (Math.random() * (charArray.length - 1 ));\n\t\t\tXORSwap.swap(charArray, i, swapPlace);\n\t\t}\n\t}" ]
[ "def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
setupTracy. @method setupTracy @return static
[ "public function setupTracy($config = [])\n {\n $tracy = Tracy::instance($config);\n $databasePanel = $tracy->getPanel('database');\n $this->dispatcher->listen(QueryExecuted::class, function ($event) use ($databasePanel) {\n $sql = $event->sql;\n $bindings = $event->bin...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
InternalXtext.g:745:1: entryRuleParameterReference : ruleParameterReference EOF ;
[ "public final void entryRuleParameterReference() throws RecognitionException {\n try {\n // InternalXtext.g:746:1: ( ruleParameterReference EOF )\n // InternalXtext.g:747:1: ruleParameterReference EOF\n {\n before(grammarAccess.getParameterReferenceRule()); \n ...
[ "Rule LocalVariableDeclarationStatement() {\n return Sequence(ZeroOrMore(FirstOf(FINAL, Annotation())), Type(), VariableDeclarators(), SEMI);\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about language and writing:" }
Register a value proxy with the namespace, and add the help_text.
[ "def register_value_proxy(namespace, value_proxy, help_text):\n \"\"\"\"\"\"\n namespace.register_proxy(value_proxy)\n config.config_help.add(\n value_proxy.config_key, value_proxy.validator, value_proxy.default,\n namespace.get_name(), help_text)" ]
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
! moment.js locale configuration ! locale : german (de) ! author : lluchs : https://github.com/lluchs ! author: Menelion Elensúle: https://github.com/Oire
[ "function de__processRelativeTime(number, withoutSuffix, key, isFuture) {\n var format = {\n 'm': ['eine Minute', 'einer Minute'],\n 'h': ['eine Stunde', 'einer Stunde'],\n 'd': ['ein Tag', 'einem Tag'],\n 'dd': [number + ' Tage', number + ' Tagen'],\n '...
[ "protected function setupTheme(string $name)\n {\n $this->info('Set [style.css] file...');\n\n $theme = ucwords(str_replace(['-', '_'], ' ', $name));\n $textdomain = str_replace(['-', ' '], '_', strtolower($name));\n\n $content = <<<STYLES\n/*\nTheme Name: $theme\nTheme URI: https://f...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Updates the shared currency. If the currency is already set and the new currency is not the same, it throws an exception @param Money $money @return StockMovement @throws \Loevgaard\DandomainStock\Exception\CurrencyMismatchException
[ "protected function updateCurrency(Money $money): self\n {\n if ($this->currency && $money->getCurrency()->getCode() !== $this->currency) {\n throw new CurrencyMismatchException('The currency on this stock movement is not the same as the one your Money object');\n }\n\n $this->cur...
[ "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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Get the HTTP status message based on status code @return string
[ "public static function getDefaultStatusMessage($statusCode)\n\t{\n\t\t$statusCode = (int) $statusCode;\n\t\t\n\t\tif (isset(self::$_defaultStatusMessages[$statusCode]))\n\t\t{\n\t\t\treturn self::$_defaultStatusMessages[$statusCode];\n\t\t}\n\t\t\n\t\treturn \"Unknown Status\";\n\t}" ]
[ "@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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Free GL resources
[ "function freeGLResources(glResources) {\n const gl = glResources.gl;\n\n // Delete each program\n Object.keys(glResources.programs).forEach((programName) => {\n const program = glResources.programs[programName];\n const shaders = program.shaders;\n\n let count = shaders.length;\n\n // Delete shaders...
[ "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:" }
// SetMaxRecords sets the MaxRecords field's value.
[ "func (s *DescribeDBSnapshotsInput) SetMaxRecords(v int64) *DescribeDBSnapshotsInput {\n\ts.MaxRecords = &v\n\treturn s\n}" ]
[ "def from_bucket(cls, connection, bucket):\n \"\"\"\"\"\"\n if bucket is None:\n raise errors.NoContainerException\n\n # It appears that Amazon does not have a single-shot REST query to\n # determine the number of keys / overall byte size of a bucket.\n return cls(conne...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about AWS S3:" }
// NewShowcaseFileAddedDetails returns a new ShowcaseFileAddedDetails instance
[ "func NewShowcaseFileAddedDetails(EventUuid string) *ShowcaseFileAddedDetails {\n\ts := new(ShowcaseFileAddedDetails)\n\ts.EventUuid = EventUuid\n\treturn s\n}" ]
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the Github post about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code:" }
Assert that an alert box is displayed, and contains the given text. @param string $text @param boolean $accept @return
[ "public function seeInAlert($text, $accept = true)\n {\n try {\n $alert = $this->session->alert_text();\n } catch (\\WebDriver\\Exception\\NoAlertOpenError $e) {\n throw new PHPUnitException(\n \"Could not see '{$text}' because no alert box was shown.\"\n ...
[ "function run(booleanOrString, anyDataType, functionOrObject, aNumber, anArray) {\n /*\n * if expectations aren't met, args checker will throw appropriate exceptions\n * notifying the user regarding the errors of the arguments.\n * */\n \targs.expect(arguments, ['boolean|string', '*',...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Deletes the lock regardless of if it has a ttl set
[ "def delete!\n Scripts.call(\n :delete,\n redis_pool,\n keys: [exists_key, grabbed_key, available_key, version_key, UNIQUE_SET, unique_digest],\n )\n end" ]
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the description about Instructions or commands:", "pos": "Represent the code about Instructions or commands:", "neg": "Represent the code about Software development:" }
Return month name in given season @param int $season Season index in 1..4 range @param int $month Month index in 1..3 range @return string
[ "public function getSeasonMonthName($season = null, $month = null)\n {\n if ($season === null) {\n $season = $this->getSeason();\n }\n if ($month === null) {\n $month = $this->getMonth();\n }\n if ($month <= 0) {\n $month += count($this->monthNa...
[ "def resolve(self, year: int = YEAR_ANY) -> MDate:\n \n year = year or self.year\n if year:\n return self._resolve(year)\n raise ValueError('Unable resolve the date without a specified year.')" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Expand wildcarded paths
[ "def _expand_paths(path):\n \n dir_name = os.path.dirname(path)\n paths = []\n logger.debug(\"Attempting to expand %s\", path)\n if os.path.isdir(dir_name):\n files = os.listdir(dir_name)\n match = os.path.basename(path)\n for file_path in files:\n if re.match(match, f...
[ "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 Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// HasLink determines whether role: name1 inherits role: name2. // domain is a prefix to the roles.
[ "func (rm *RoleManager) HasLink(name1 string, name2 string, domain ...string) (bool, error) {\n\tif len(domain) == 1 {\n\t\tname1 = domain[0] + \"::\" + name1\n\t\tname2 = domain[0] + \"::\" + name2\n\t} else if len(domain) > 1 {\n\t\treturn false, errors.New(\"error: domain should be 1 parameter\")\n\t}\n\n\tif na...
[ "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 post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Injection point for logging aspect @param pjp where the inject takes pace @return the point reaches @throws Throwable if anything happens
[ "@Around(\"@annotation(org.treetank.aspects.logging.Logging)\")\n public Object advice(ProceedingJoinPoint pjp) throws Throwable {\n final Signature sig = pjp.getSignature();\n final Logger logger = FACTORY.getLogger(sig.getDeclaringTypeName());\n logger.debug(new StringBuilder(\"Entering \"...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// setScaleClipping directly sets the scaleClipping member of the receiving Waveform // struct.
[ "func (w *Waveform) setScaleClipping(scaleClipping bool) error {\n\tw.scaleClipping = scaleClipping\n\n\treturn nil\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 Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Check if the role hierarchy cache must be invalidated. @param UnitOfWork $uow The unit of work @param object $object The object @return false|string
[ "protected function invalidateCache(UnitOfWork $uow, $object)\n {\n if ($this->isCacheableObject($object)) {\n return $this->invalidateCacheableObject($uow, $object);\n }\n\n if ($object instanceof PersistentCollection && $this->isRequireAssociation($object->getMapping())) {\n ...
[ "public function validate() {\n if ($this->initializer) {\n Ensure::isFalse($this->initializer->getRepository() && $this->initializer->getValue(), 'It makes no sense to define initializer repository and value simultaneously for column [%s]', $this->name);\n }\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// NewStringField retruns a new Instance of StringField. // It validates its name and type against the database schema.
[ "func (db *DB) NewStringField(name string) (f StringField, err error) {\n\tkey, err := db.schemaFieldKey(name, \"string\")\n\tif err != nil {\n\t\treturn f, err\n\t}\n\treturn StringField{\n\t\tdb: db,\n\t\tkey: key,\n\t}, nil\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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
GetGroup. [Preview API] Get a group by its descriptor. :param str group_descriptor: The descriptor of the desired graph group. :rtype: :class:`<GraphGroup> <azure.devops.v5_0.graph.models.GraphGroup>`
[ "def get_group(self, group_descriptor):\n \n route_values = {}\n if group_descriptor is not None:\n route_values['groupDescriptor'] = self._serialize.url('group_descriptor', group_descriptor, 'str')\n response = self._send(http_method='GET',\n loca...
[ "async def get_config(self):\n \n app_facade = client.ApplicationFacade.from_connection(self.connection)\n\n log.debug(\n 'Getting config for %s', self.name)\n\n return (await app_facade.Get(self.name)).config" ]
codesearchnet
{ "query": "Represent the text about AWS Redshift:", "pos": "Represent the code about AWS Redshift:", "neg": "Represent the code about Software development:" }
Adding the URL as entity.
[ "def add_url(self, post_data):\n '''\n \n '''\n img_desc = post_data['desc']\n img_path = post_data['file1']\n cur_uid = tools.get_uudd(4)\n while MEntity.get_by_uid(cur_uid):\n cur_uid = tools.get_uudd(4)\n MEntity.create_entity(cur_uid, img_path, ...
[ "@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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Marshall the given parameter object.
[ "public void marshall(DeleteCollectionRequest deleteCollectionRequest, ProtocolMarshaller protocolMarshaller) {\n\n if (deleteCollectionRequest == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marsh...
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
convert a byte-ASCII encoded string into equivalent Unicode string in the UTF-8 notation.
[ "def convert_to_unicode( tscii_input ):\n \n output = list()\n prev = None\n prev2x = None\n # need a look ahead of 2 tokens atleast\n for char in tscii_input:\n ## print \"%2x\"%ord(char) # debugging\n if ord(char) < 128 :\n # base-ASCII copy to output\n output...
[ "def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Binds data to the template. @param array $data @return self
[ "public function bind (array $data) : TemplateInterface\n {\n $this->data = array_merge($this->data, $data);\n return $this;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Commit this context's offsets: - If the high-water mark has moved, commit up to and position the consumer at the high-water mark. - Otherwise, reset to the consumer to the initial offsets.
[ "def commit(self):\n \n if self.high_water_mark:\n self.logger.info(\"Committing offsets: %s\", self.high_water_mark)\n self.commit_partition_offsets(self.high_water_mark)\n self.update_consumer_offsets(self.high_water_mark)\n else:\n self.update_cons...
[ "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:", "pos": "Represent the code:", "neg": "Represent the code about File management:" }
Return incremented id or uuid
[ "function createId(coll) {\n if (_.isEmpty(coll)) {\n return 1\n } else {\n var id = _.max(coll, function(doc) {\n return doc.id\n }).id\n\n if (_.isFinite(id)) {\n // Increment integer id\n return ++id\n } else {\n // Generate string id\n return uuid()\n }\n }\n}" ]
[ "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 Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Create a new figure manager instance for the given figure.
[ "def new_figure_manager_given_figure(num, figure):\n \n frame = FigureFrameWxAgg(num, figure)\n figmgr = frame.get_figure_manager()\n if matplotlib.is_interactive():\n figmgr.frame.Show()\n return figmgr" ]
[ "def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
/* (non-Javadoc) @see com.ibm.ws.sib.processor.impl.interfaces.DestinationHandler#getBaseUuid()
[ "@Override\n public SIBUuid12 getBaseUuid()\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(tc, \"getBaseUuid\");\n\n SIBUuid12 uuid = _targetDestinationHandler.getDefinition().getUUID();\n\n if (TraceComponent.isAnyTracingEnabled() && tc.is...
[ "private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }" ]
codesearchnet
{ "query": "Represent the summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Fetch a topic @param string $guid @param array $options @return CollectionDocJson
[ "public function fetchTopic($guid, $options = [])\n {\n $options['guid'] = $guid;\n return $this->_request(self::FETCH_TOPIC, $options);\n }" ]
[ "public static function getPageAuthority($url = false)\n {\n $data = static::getCols('34359738368', $url);\n return (parent::noDataDefaultValue() == $data) ? $data :\n $data['upa'];\n }" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Separate mehtod for testing puroposes
[ "public static function generatePluginsManifest(array $packages, string $outputPath, string $vendorDir = null)\n {\n $plugins = [];\n\n foreach($packages as $package) {\n\n /* Skip packages that do not define plugin in extra */\n if(empty($package['extra']['jinitialize-plugin'...
[ "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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Save any file changes using the form model.
[ "private function fileEntitySave()\n {\n if (!$this->file) {\n return;\n }\n if ($this->file->isNew() || $this->file->getChanges()) {\n if ($this->contactClient->getId()) {\n $this->formModel->saveEntity($this->file, true);\n }\n }\n ...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Gets a map of module IDs that the given user has opted-in to. @author Leo Fajardo (@leorw) @since 2.1.0 @param number $fs_user_id @return array { @key number $plugin_id @value bool Always true. }
[ "private static function get_user_opted_in_module_ids_map( $fs_user_id ) {\r\n self::$_static_logger->entrance();\r\n\r\n if ( ! is_multisite() ) {\r\n $installs = array_merge(\r\n self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN ),\r\n self::...
[ "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 Github sentence about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Execute the function. The function must return a valid object. @param xctxt The current execution context. @return A valid XObject. @throws javax.xml.transform.TransformerException
[ "public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException\n {\n return new XNumber(Math.ceil(m_arg0.execute(xctxt).num()));\n }" ]
[ "public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {\n Except.throw_exception(\"Api_TacoFailed\",\n \"Taco protocol not supported\",\n \"TacoTangoDeviceDAODefaultImpl.command_inout()\");\n return null;\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about N/A:" }
Extracts the value from the given {@code OpenEngSBModelEntry} and maps that value to the given field type. @param field the field to map to @param entry the entry containing the value @return the transformed (possibly) value
[ "protected Object extractValue(IndexField<?> field, OpenEngSBModelEntry entry) {\n Object value = entry.getValue();\n\n if (value == null) {\n return null;\n }\n\n if (Introspector.isModel(value)) {\n return ((OpenEngSBModel) value).retrieveInternalModelId();\n ...
[ "@Override\n public ExpandableField<?> deserialize(JsonElement json, Type typeOfT,\n JsonDeserializationContext context) throws JsonParseException {\n if (json.isJsonNull()) {\n return null;\n }\n\n ExpandableField<?> expandableField;\n\n // Check if json is a String ID. If so, the field has ...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Returns a string ID suitable for use in the specified GA ReadAlignment object in this ReadGroupSet.
[ "def getReadAlignmentId(self, gaAlignment):\n \n compoundId = datamodel.ReadAlignmentCompoundId(\n self.getCompoundId(), gaAlignment.fragment_name)\n return str(compoundId)" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Look up an attribute's type by qualified (prefixed) name. @param qName The qualified name. @return The attribute's type, or null if there is no matching attribute. @see org.xml.sax.Attributes#getType(java.lang.String)
[ "public String getType (String qName)\n {\n int max = length * 5;\n for (int i = 0; i < max; i += 5) {\n if (data[i+2].equals(qName)) {\n return data[i+3];\n }\n }\n return null;\n }" ]
[ "@Override\n public void visitEnum(String targetMethodName,\n String enumerationTypeDescription,\n String enumerationLiteral) {\n\n if (tc.isDebugEnabled()) {\n Tr.debug(tc, MessageFormat.format(\"visitEnum [ {0} ] Name [ {1} ] Description [ {2}...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Main entry point. @return void
[ "public function main(): void\n {\n $args = getopt('t::');\n\n if (isset($args['t']) === false) {\n $this->showBasicExample();\n $this->showIncludedObjectsExample();\n $this->showSparseAndFieldSetsExample();\n $this->showTopLevelMetaAndLinksExample();\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// Match returns true if the DateString Regexp matches b
[ "func (d *DateString) Match(value string) bool {\n\treturn d.Regexp.Match([]byte(value))\n}" ]
[ "def visit_rule(self, node, rule):\n \"\"\"\"\"\"\n label, equals, expression = rule\n expression.name = label # Assign a name to the expr.\n return expression" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
If the broadcaster has not been set for MAX_SECONDS_TO_WAIT_FOR_BROADCASTER_TO_BE_SET seconds, then the programmer probably forgot to set it and we should throw exception.
[ "private TransactionBroadcaster getBroadcaster() {\n try {\n return broadcasterFuture.get(MAX_SECONDS_TO_WAIT_FOR_BROADCASTER_TO_BE_SET, TimeUnit.SECONDS);\n } catch (InterruptedException e) {\n throw new RuntimeException(e);\n } catch (ExecutionException e) {\n ...
[ "protected final void setState(int state) {\n\n String thisMethodName = \"setState\";\n\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {\n SibTr.entry(tc, thisMethodName, Integer.toString(state));\n }\n\n _state = state;\n // 212263 - State changes p...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// NOTE since this function uses `Load` and not `load2`, readSubteamID cannot // be passed through, this call will fail if a user is not a member of the // parent team (or child of the parent team) for which the validator validates
[ "func (t *Team) traverseUpUntil(ctx context.Context, validator func(t *Team) bool) (targetTeam *Team, err error) {\n\ttargetTeam = t\n\tfor {\n\t\tif validator(targetTeam) {\n\t\t\treturn targetTeam, nil\n\t\t}\n\t\tparentID := targetTeam.chain().GetParentID()\n\t\tif parentID == nil {\n\t\t\treturn nil, nil\n\t\t}...
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Save data by auto-expire key @param $key @param string $data @param int $expire
[ "protected function set($key, $data, $expire) {\n\t\t$this->mongoCollection->update(array(\n\t\t\t'key' => $key\n\t\t), array(\n\t\t\t'key' => $key,\n\t\t\t'data' => $data,\n\t\t\t'expireAt' => new \\MongoDate(time() + $expire)\n\t\t), array(\n\t\t\t'upsert' => true\n\t\t));\n\t}" ]
[ "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 summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Renders an object as formatted HTML @param {Object} obj @return {String} html @api public
[ "function htmlStringify(obj, fromRecur) {\n\n\tvar tag = (fromRecur) ? 'span' : 'div';\n\tvar nextLevel = (fromRecur || 0) + 1;\n\t\n\t// strings\n\tif (typeof obj == 'string') {\n\t\treturn '<' + tag + ' style=\"color: #0e4889; cursor: default;\">\"' + obj + '\"</' + tag + '>';\n\t}\n\t// booleans, null and undefi...
[ "function () {\n /**\n * Get a valid file path for a template file from a set of directories\n * @param {Object} opts Configurable options (see periodicjs.core.protocols for more details)\n * @param {string} [opts.extname] Periodic extension that may contain view file\n * @param {string} opts.viewna...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Gets the top hits aggregation. @param selectStatement the select statement @param size the size @param entityMetadata the entity metadata @return the top hits aggregation
[ "private TopHitsBuilder getTopHitsAggregation(SelectStatement selectStatement, Integer size,\n EntityMetadata entityMetadata)\n {\n TopHitsBuilder topHitsBuilder = AggregationBuilders.topHits(ESConstants.TOP_HITS);\n if (size != null)\n {\n topHitsBuilder.setSize(size);...
[ "@SuppressWarnings(\"unchecked\")\n @Override\n public final Collection<V> getAll(final PaginationData pagination) {\n final Query builtQuery; // Query created from the query data\n\n checkNotNull(pagination,\n \"Received a null pointer as the pagination data\");\n\n // Bui...
codesearchnet
{ "query": "Represent the Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software Development:" }
http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html A query that uses a query parser in order to parse its content. > query = ElasticQuery().query_string('this AND that OR thus', default_field='content')
[ "def query_string(cls,\n query,\n default_field=None,\n default_operator=None,\n analyzer=None,\n allow_leading_wildcard=None,\n lowercase_expanded_terms=None,\n enable_positio...
[ "def search(self):\n \n s = Search(doc_type=self.doc_types, using=es.client,\n index=es.index_name)\n # don't return any fields, just the metadata\n s = s.fields([])\n # Sort from parameters\n s = s.sort(*self.sorts)\n # Paginate from parameters\n ...
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
Return an expression where all subterms equal to a key expression are substituted by the corresponding value expression using a mapping of: {expr->expr to substitute.}
[ "def _subs(self, substitutions, default, simplify):\n \n # track the new list of unchanged args or replaced args through\n # a substitution\n new_arguments = []\n changed_something = False\n\n # shortcut for basic logic True or False\n if self is self.TRUE or self is...
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototyp...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Returns TRUE if it's probable that $name is a relation and FALSE if not. @param string $name Relation name @return bool
[ "protected function isRelation(string $name): bool\n\t{\n\t\treturn method_exists(self::class, $name) === false && method_exists($this, $name);\n\t}" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
The main function.
[ "def main():\n \"\"\"\"\"\"\n arguments = docopt.docopt(__doc__, version='Coil CMS v{0}'.format(\n coil.__version__))\n if arguments['write_users']:\n sys.exit(write_users(arguments))\n elif arguments['devserver']:\n sys.exit(devserver(arguments))\n elif arguments['unlock']:\n ...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Original uploaded data file the subject was created from. Returns ------- File-type object Reference to file on local disk
[ "def data_file(self):\n \n return os.path.join(self.upload_directory, self.properties[datastore.PROPERTY_FILENAME])" ]
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
APIProperty: handlerOptions {Object} Used to set non-default properties on the control's handler Constructor: OpenLayers.Control.DrawFeature Parameters: layer - {<OpenLayers.Layer.Vector>} handler - {<OpenLayers.Handler>} options - {Object}
[ "function(layer, handler, options) {\n OpenLayers.Control.prototype.initialize.apply(this, [options]);\n this.callbacks = OpenLayers.Util.extend(\n {\n done: this.drawFeature,\n modify: function(vertex, feature) {\n this.layer.events.triggerE...
[ "function(evt) {\n this.events.triggerEvent(\"beforegetfeatureinfo\", {xy: evt.xy});\n // Set the cursor to \"wait\" to tell the user we're working on their\n // click.\n OpenLayers.Element.addClass(this.map.viewPortDiv, \"olCursorWait\");\n this.request(evt.xy, {});\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Add the self-closing tag that matches current BBCode @return Tag
[ "protected function addBBCodeSelfClosingTag()\n\t{\n\t\t$tag = $this->parser->addSelfClosingTag($this->getTagName(), $this->startPos, $this->pos - $this->startPos);\n\t\t$tag->setAttributes($this->attributes);\n\n\t\treturn $tag;\n\t}" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Returns the number of documents in this index. @return the number of documents in this index. @throws IOException if an error occurs while reading from the index.
[ "int numDocs() throws IOException\n {\n if (indexNames.size() == 0)\n {\n return volatileIndex.getNumDocuments();\n }\n else\n {\n CachingMultiIndexReader reader = getIndexReader();\n try\n {\n return reader.numDocs();\n }\n final...
[ "function LoggerContext() {\n LifeCycle.call(this);\n\n /**\n * Context start time\n */\n this.startTime = new Date();\n\n /**\n * The list of trace levels that the logger context knows about\n */\n this.logLevel = new LogLevel();\n\n /**\n * Root logger, final ancestor of all ...
codesearchnet
{ "query": "Represent the Github summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Serve a file given its filename
[ "def serve(self, filename):\n ''''''\n if not self.exists(filename):\n abort(404)\n return self.backend.serve(filename)" ]
[ "def uri_from(url)\n # This will raise an InvalidURIError if the URL is very wrong. It will\n # still pass for strings like \"foo\", though.\n url = URI(url)\n\n # We need to check if the URL was either http://, https:// or ftp://,\n # because these are the only ones we can download from. o...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Sets options changing comparison behavior. For more details see {@link net.javacrumbs.jsonunit.core.Option} @see net.javacrumbs.jsonunit.core.Option
[ "public static void setOptions(Option firstOption, Option... rest) {\n configuration = configuration.withOptions(Options.empty().with(firstOption, rest));\n }" ]
[ "public static <M extends net.morimekta.providence.PMessage<M, F>, F extends net.morimekta.providence.descriptor.PField>\n Any wrapMessage(@javax.annotation.Nonnull M message) {\n return wrapMessage(message, new net.morimekta.providence.serializer.BinarySerializer());\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
-----------------------------------------------------------------------------
[ "async function (exchange, symbol) {\n\n try {\n\n await exchange.loadMarkets ()\n\n if (symbol in exchange.markets) {\n\n let ticker = await exchange.fetchTicker (symbol)\n\n log (exchange.id.green, symbol.green, 'ticker',\n ticker['datetime'],\n ...
[ "protected static function showVersion()\n {\n \\cli\\line();\n \\cli\\line(\\cli\\Colors::colorize('%y+----------------------------------------------------------------------+%N'));\n \\cli\\line(\\cli\\Colors::colorize('%y| Welcome to Doozr\\'s Demo project installer. ...
codesearchnet
{ "query": "Represent the Github summarization about language and writing:", "pos": "Represent the Github code about language and writing:", "neg": "Represent the Github code:" }
Converts the cluster into a grid data structure. If its not a grid then nothing happens
[ "protected void processCluster( List<SquareNode> cluster ) {\n\t\tinvalid = false;\n\t\t// handle a special case\n\t\tif( cluster.size() == 1 ) {\n\t\t\tSquareNode n = cluster.get(0);\n\t\t\tif( n.getNumberOfConnections() == 0 ) {\n\t\t\t\tSquareGrid grid = grids.grow();\n\t\t\t\tgrid.reset();\n\t\t\t\tgrid.columns...
[ "def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Returns the .info() output of a dataframe
[ "def get_info(df, verbose = None,max_cols = None, memory_usage = None, null_counts = None):\n \n assert type(df) is pd.DataFrame\n buffer = io.StringIO()\n df.info(verbose, buffer, max_cols, memory_usage, null_counts)\n return buffer.getvalue()" ]
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }