query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
获取已上传的文件列表 @param $action @return array
[ "protected function lists($action)\n {\n //查询实例\n $query = Attachment::find()->where(['user_id' => Yii::$app->user->id])->orderBy(['id' => SORT_DESC]);\n /* 判断类型 */\n switch ($action) {\n /* 列出文件 */\n case 'list-file':\n $query->andWhere(['ext' => ...
[ "public static String getTransferQueue(String name) {\n LOG.debug(\"对于需要保序的情况,只应该启动单个中转节点,目前启动多个节点原节点会被挤掉线,但是由于重连机制,会轮着挤掉线\");\n return IdManager.generateStaticQueueId(buildTransferName(name));\n }" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// LikelySchemaBlob returns quickly whether buf likely contains (or is // the prefix of) a schema blob.
[ "func LikelySchemaBlob(buf []byte) bool {\n\tif len(buf) == 0 || buf[0] != '{' {\n\t\treturn false\n\t}\n\treturn bytes.Contains(buf, bytesCamliVersion)\n}" ]
[ "def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ...
codesearchnet
{ "query": "Represent the comment about software development:", "pos": "Represent the code about software development:", "neg": "Represent the code about Software development:" }
Extract environment name using studyname and protocolname to guide :param str studyname: Name of the study (including Env) :param str protocolname: Name of the study
[ "def getEnvironmentFromNameAndProtocol(studyname, protocolname):\n \n # StudyName = \"TEST (1) (DEV)\"\n # ProtocolName = \"TEST (1)\"\n # Raw Env = \"(DEV)\"\n\n raw_env = studyname[len(protocolname) :].strip()\n\n if \"(\" in raw_env:\n l_brace_pos = raw_env.rfind(\"(\")...
[ "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 Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// GetBareMetalPlans returns a list of all available bare metal plans on Vultr account.
[ "func (c *Client) GetBareMetalPlans() ([]BareMetalPlan, error) {\n\tvar bareMetalPlanMap map[string]BareMetalPlan\n\tif err := c.get(`plans/list_baremetal`, &bareMetalPlanMap); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar b bareMetalPlans\n\tfor _, bareMetalPlan := range bareMetalPlanMap {\n\t\tb = append(b, bar...
[ "func (c *NetworkGetCommand) Info() *cmd.Info {\n\targs := \"<binding-name> [--ingress-address] [--bind-address] [--egress-subnets]\"\n\tdoc := `\nnetwork-get returns the network config for a given binding name. By default\nit returns the list of interfaces and associated addresses in the space for\nthe binding, as...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Prefix uses static::EVENT_PREFIX if defined else it uses static::class without the namespace @return string
[ "public function getEventPrefix() {\n static $prefix;\n if (!$prefix) {\n if (defined(static::class.'::EVENT_PREFIX'))\n $prefix = static::EVENT_PREFIX;\n else\n $prefix = strtolower(array_slice(explode('\\\\', static::class), -1)[0]);\n }\n return $prefix;\n }" ]
[ "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 Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Regular expressions:" }
Get column names and types from a table
[ "def get_table_column_names(self, exclude=None):\n \"\"\"\"\"\"\n query = 'SELECT * FROM \"{schema}\".\"{table}\" limit 0'.format(table=self.table_name, schema=self.schema)\n columns = get_column_names(self.cc, query).keys()\n\n if exclude and isinstance(exclude, list):\n colu...
[ "@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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Squared sum of total displacements for these atoms. Args: None Returns: (Float): The square of the summed total displacements for these atoms.
[ "def collective_dr_squared( self ):\n \n return sum( np.square( sum( [ atom.dr for atom in self.atoms ] ) ) )" ]
[ "def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
check if current tag can be converted to Markdown @param void @return bool
[ "protected function isMarkdownable()\n {\n if (!isset($this->isMarkdownable[$this->parser->tagName])) {\n // simply not markdownable\n\n return false;\n }\n if ($this->parser->isStartTag) {\n $return = true;\n if ($this->keepHTML) {\n ...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Do a POST request to the API
[ "def _api_post(path, data, server=None):\n '''\n \n '''\n server = _get_server(server)\n response = requests.post(\n url=_get_url(server['ssl'], server['url'], server['port'], path),\n auth=_get_auth(server['user'], server['password']),\n headers=_get_headers(),\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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Get URI for a route. @param string|array|Route|HasRoute $route A route. @return Message\Uri Uri.
[ "public function getUri($route, $full = false)\n {\n $route = $this->validate($route);\n $path = $this->getPathValidated($route);\n if (is_string($path)) {\n return new Message\\Uri($path);\n }\n if ($full) {\n $uri = $this->request->getUri()->withPath($th...
[ "function validateService($pluginInstance)\n {\n if (! is_object($pluginInstance) )\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof aGrantRequest)\n throw new exContainerInvalidServiceType('Invalid Plugi...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Set the model used by the right table. @param model table model
[ "public void setRightTableModel(TableModel model)\n {\n TableModel old = m_rightTable.getModel();\n m_rightTable.setModel(model);\n firePropertyChange(\"rightTableModel\", old, model);\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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Get a dynamic command @param commandName command name @return The dynamic command
[ "public ICommandBehavior getCommand(final String commandName) {\n return dynamicCommands.get(commandName.toLowerCase(Locale.ENGLISH)).getBehavior();\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 text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Returns TRUE if the data item exists. FALSE otherwise. @param string $key The key of the stored data item. @return bool TRUE if the data item exists. FALSE otherwise. @throws \Exception @throws \BearFramework\App\Data\DataLockedException
[ "public function exists(string $key): bool\n {\n $result = $this->execute([\n [\n 'command' => 'get',\n 'key' => $key,\n 'result' => ['key']\n ]\n ]);\n return isset($result[0]['key']);\n }" ]
[ "function validateService($pluginInstance)\n {\n if (!is_object($pluginInstance))\n throw new \\Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));\n\n if (!$pluginInstance instanceof iAuthenticator)\n throw new exContainerInvalidServiceType('Invalid Plugin...
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
// NewRsiWithoutStorage creates a Relative Strength Indicator (Rsi) without storage
[ "func NewRsiWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *RsiWithoutStorage, err error) {\n\n\t// an indicator without storage MUST have a value available action\n\tif valueAvailableAction == nil {\n\t\treturn nil, ErrValueAvailableActionIsNil\n\t}\n\n\t// the minimum ti...
[ "public void setLossVariables(String... lossVariableNames){\n this.lossVariables.clear();\n for(String s : lossVariableNames){\n addLossVariable(s);\n }\n //After changing loss function variables, we (probably) need to recreate gradient function - as gradient\n // funct...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Start starts the service, returning nil when successful. // If the service is already running, Start does not restart it. // // Start is part of the service.ServiceActions interface
[ "func (s Service) Start() error {\n\trunning, err := s.Running()\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\tif running {\n\t\treturn nil\n\t}\n\n\tcommands, err := s.StartCommands()\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\tfor _, command := range commands {\n\t\tcommandParts := strings...
[ "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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic Object eGet(int featureID, boolean resolve, boolean coreType) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.EPG__PAGE_NAME:\n\t\t\t\treturn getPageName();\n\t\t\tcase AfplibPackage.EPG__TRIPLETS:\n\t\t\t\treturn getTriplets();\n\t\t}\n\t\treturn super.eGet(featureID, resolve, coreType);...
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the comment about Text generation:", "pos": "Represent the code about Text generation:", "neg": "Represent the code:" }
Closes the current session as well as clearing the token cache.
[ "protected final void closeSessionAndClearTokenInformation() {\n if (sessionTracker != null) {\n Session currentSession = sessionTracker.getOpenSession();\n if (currentSession != null) {\n currentSession.closeAndClearTokenInformation();\n }\n }\n }" ]
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// AddWithExpire stores a key value pair in the cache. If the key was already present, // it is moved to the front. Additionally, the given expiration time is used (overriding the // default ttl).
[ "func (lru *TTLRUCache) AddWithExpire(key, val interface{}, expiration time.Time) {\n\tlru.lock.Lock()\n\tdefer lru.lock.Unlock()\n\n\tif etriple, ok := lru.mapping[key]; ok {\n\t\tetriple.val = val\n\t\tlru.order.MoveToFront(&etriple.orderelement)\n\t\tlru.timeorder.MoveToBack(&etriple.timeelement)\n\t\tetriple.ex...
[ "def _limit_call_handler(self):\n \n # acquire a lock on our threading.Lock() object\n with self.limit_lock:\n # if we have no configured limit, exit. the lock releases based on scope\n if self.limit_per_min <= 0:\n return\n\n now = time.time()\n...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Combines the state of another {@code IntSummaryStatistics} into this one. @param other another {@code IntSummaryStatistics} @throws NullPointerException if {@code other} is null
[ "public void combine(IntSummaryStatistics other) {\n count += other.count;\n sum += other.sum;\n min = Math.min(min, other.min);\n max = Math.max(max, other.max);\n }" ]
[ "public static Matrix copy(Matrix m) {\n\t\tif (m==null) throw new NullPointerException();\n\t\tMatrix copy=createMatrix(m.getRowCount(), m.getColumnCount());\n\t\tfor (int row=0; row<m.getRowCount(); row++) for (int col=0; col<m.getColumnCount(); col++)\n\t\t\tcopy.set(row, col, m.getQuick(row, col));\n\t\treturn ...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Write a simple value to the model.ini/[info] section. Here "simple" means a value that can be stringified with .toString(), and its stringified version does not span multiple lines.
[ "protected final void writekv(String key, Object value) throws IOException {\n String valStr = value == null ? \"null\" : value.toString();\n if (valStr.contains(\"\\n\"))\n throw new IOException(\"The `value` must not contain newline characters, got: \" + valStr);\n if (lkv.containsKey(key))\n t...
[ "private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Truncate deletes the values prior to mint and the series which the keep function // does not indicate to preserve.
[ "func (w *SegmentWAL) Truncate(mint int64, keep func(uint64) bool) error {\n\t// The last segment is always active.\n\tif len(w.files) < 2 {\n\t\treturn nil\n\t}\n\tvar candidates []*segmentFile\n\n\t// All files have to be traversed as there could be two segments for a block\n\t// with first block having times (10...
[ "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 Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
The public API for prompting the user before navigating away from a screen.
[ "function Prompt({ message, when = true }) {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Prompt> outside a <Router>\");\n\n if (!when || context.staticContext) return null;\n\n const method = context.history.block;\n\n return ...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Shows and persists fail symbol and text and exits. Parameters ---------- text : None, optional Text to be shown alongside fail symbol. Returns ------- self
[ "def fail(self, text=None):\n \n return self.stop_and_persist(symbol=LogSymbols.ERROR.value, text=text)" ]
[ "def get_value(self, context):\n \"\"\"\"\"\"\n if self.value:\n return expressions.eval_string(self.value, context)\n else:\n # Empty input raises cryptic EOF syntax err, this more human\n # friendly\n raise ValueError('!py string expression is empty...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Returns {@link UsernamePasswordToken} which holds a username and a password.
[ "private UsernamePasswordToken usernamePassword(ServiceRequestContext ctx, AggregatedHttpMessage req) {\n // check the Basic HTTP authentication first (https://tools.ietf.org/html/rfc7617)\n final BasicToken basicToken = AuthTokenExtractors.BASIC.apply(req.headers());\n if (basicToken != null) ...
[ "private Subject authenticateWithCertificateChain(SSLSession session) throws SSLPeerUnverifiedException, AuthenticationException, CredentialExpiredException, CredentialDestroyedException {\n Subject transportSubject = null;\n if (session != null) {\n Certificate[] certificateChain = session...
codesearchnet
{ "query": "Represent the description about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
Sets all members, types and executables in this module as public as long as it doesn't already have the 'private' modifier.
[ "def all_to_public(self):\n \n if \"private\" not in self.modifiers:\n def public_collection(attribute):\n for key in self.collection(attribute):\n if key not in self.publics:\n self.publics[key.lower()] = 1\n public_collec...
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Short description of method render @access public @author Joel Bout, <joel.bout@tudor.lu> @return string
[ "public function render()\n {\n $widgetName = 'Uploader_' . md5($this->name);\n \n $returnValue = $this->renderLabel();\n $returnValue .= \"<input type='hidden' name='{$this->name}' id='{$this->name}' value='' />\";\n $returnValue .= \"<div id='{$widgetName}_container' class='f...
[ "def helpAbout(self):\n \n\n # Text to be displayed\n about_text = translate('pyBarPlugin',\n \"\"\"<qt>\n <p>Data plotting plug-in for pyBAR.\n </qt>\"\"\",\n 'About')\n\n descr = dict(module_name='pyBarPl...
codesearchnet
{ "query": "Represent the Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Generates a square thumbnail
[ "def generateThumbnail(self):\n \"\"\"\"\"\"\n image = pilImage.open(ROOT / self.source.name)\n box, width, height = cropBox(self.width, self.height)\n\n # Resize\n image.thumbnail((width, height), pilImage.ANTIALIAS)\n # Crop from center\n box = cropBox(*image.size)...
[ "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 post:", "pos": "Represent the code:", "neg": "Represent the code:" }
// NormalizeIdentifier change invalid character in identifier // to `_`. // Edge cases: // - If started with invalid char, we prepend with `The_` // - don't replace `.` if it means a library
[ "func NormalizeIdentifier(s string) string {\n\tif s == \"\" {\n\t\treturn s\n\t}\n\n\tstr := regValidIdentifier.ReplaceAllString(s, underscore)\n\n\t// it needs to be started with letter\n\t// if not, prepend `The_`\n\tstartedWithLetter := func() bool {\n\t\tr := []rune(str)\n\t\treturn unicode.IsLetter(r[0])\n\t}...
[ "def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ...
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
@param VolumeInterface $volume @param FolderInterface $folder @return CalculatedSize
[ "public function calculate(VolumeInterface $volume, FolderInterface $folder = null)\n {\n if (null === $folder) {\n $folder = $volume->findRootFolder();\n }\n\n $size = 0;\n $numFiles = 0;\n\n foreach ($volume->findFilesByFolder($folder) as $file) {\n $siz...
[ "public function getAll(){\n $rest = $this->getService( self::API_STORAGE_PARTITION);\n $rest->GET();\n\n return $rest->getResultAsArray( models\\Storage\\DiskPartition::class);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// SetKey sets the Key field's value.
[ "func (s *GameProperty) SetKey(v string) *GameProperty {\n\ts.Key = &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 sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
@param string $instance @param string $node @return ConnectionInterface
[ "private static function getConnection(string $instance, string $node, $ts = 'query'): ConnectionInterface\n {\n $transactionConnection = self::getTransactionConnection($instance);\n if ($transactionConnection !== null) {\n return $transactionConnection;\n }\n\n $pool = DbH...
[ "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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Gets the name to reference the sorted field :return: the name to reference the sorted field :rtype: str
[ "def get_name(self, use_alias=True):\n \n if self.desc:\n direction = 'DESC'\n else:\n direction = 'ASC'\n\n if use_alias:\n return '{0} {1}'.format(self.field.get_identifier(), direction)\n return '{0} {1}'.format(self.field.get_select_sql(), dire...
[ "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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Generates the date-time classes into the given output directory.
[ "public Map<LocaleID, ClassName> generate(Path outputDir, DataReader reader)\n throws IOException {\n\n Map<LocaleID, ClassName> dateClasses = new TreeMap<>();\n List<DateTimeData> dateTimeDataList = new ArrayList<>();\n\n for (Map.Entry<LocaleID, DateTimeData> entry : reader.calendars().entrySet()) {...
[ "@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:" }
// toOuchValue serializes nosql.Value -> native json values.
[ "func toOuchValue(v nosql.Value) interface{} {\n\tswitch v := v.(type) {\n\tcase nil:\n\t\treturn nil\n\tcase nosql.Strings:\n\t\treturn []string(v)\n\tcase nosql.String:\n\t\treturn string(v)\n\tcase nosql.Int:\n\t\treturn int64(v)\n\tcase nosql.Float:\n\t\treturn float64(v)\n\tcase nosql.Bool:\n\t\treturn bool(v)...
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
@param string $attribute @param mixed $subject @param TokenInterface $token @return bool
[ "protected function voteOnAttribute($attribute, $subject, TokenInterface $token)\n {\n if ($this->isSuperAdmin($token)) {\n return true;\n }\n\n if (ContributionActionInterface::READ === $attribute) {\n return $this->voteForReadAction($subject, $token);\n }\n\n ...
[ "protected static function getField(\n ParticleInterface $particle,\n FieldsCargo $cargo,\n string $name,\n array $args = []\n )/*: mixed*/\n {\n $name = Utils::findFieldName($cargo, $name);\n return $particle->attributes()->$name; // test with null.\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about Software development:" }
Calls drawcircle and writelable for an list of stars. Provide a list of dictionnaries, where each dictionnary contains "name", "x", and "y".
[ "def drawstarslist(self, dictlist, r = 10, colour = None):\n \n \n self.checkforpilimage()\n colour = self.defaultcolour(colour)\n self.changecolourmode(colour)\n self.makedraw()\n \n \n for star in dictlist:\n self.drawcircle(star[\"x\"], st...
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
@return Serializer @throws \Zend\ServiceManager\Exception\ServiceNotFoundException @throws \Zend\ServiceManager\Exception\ServiceNotCreatedException @throws \Zend\ServiceManager\Exception\RuntimeException
[ "public function getSerializer()\n {\n if ($this->serializer) {\n return $this->serializer;\n }\n\n $serializerName = $this->getSerializerName();\n /** @var Serializer $serializer */\n $serializer = $this->getSerializerManager()->get($serializerName);\n $this-...
[ "public function onBootstrap(EventInterface $event)\n {\n /** @var Application $application */\n $application = $event->getApplication();\n $serviceManager = $application->getServiceManager();\n $eventManager = $application->getEventManager();\n $sharedEventManager...
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Fetches next result set. :return: Collection object.
[ "def next_page(self):\n \n for link in self.links:\n if link.rel.lower() == 'next':\n return self._load(link.href)\n raise PaginationError('No more entries.')" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SourceRangeFromHCL constructs a SourceRange from the corresponding range // type within the HCL package.
[ "func SourceRangeFromHCL(hclRange hcl.Range) SourceRange {\n\treturn SourceRange{\n\t\tFilename: hclRange.Filename,\n\t\tStart: SourcePos{\n\t\t\tLine: hclRange.Start.Line,\n\t\t\tColumn: hclRange.Start.Column,\n\t\t\tByte: hclRange.Start.Byte,\n\t\t},\n\t\tEnd: SourcePos{\n\t\t\tLine: hclRange.End.Line,\n\t\...
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Gets the pathClasses. A Map containing hints about what Class to be used for what path segment If local instance not set, try parent Criteria's instance. If this is the top-level Criteria, try the m_query's instance @return Returns a Map
[ "public Map getPathClasses()\r\n\t{\r\n\t\tif (m_pathClasses.isEmpty())\r\n\t\t{\r\n\t\t\tif (m_parentCriteria == null)\r\n\t\t\t{\r\n\t\t\t\tif (m_query == null)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn m_pathClasses;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn m_query.getPathClasses();\r\n\t\t\t\t}\r\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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Registers an object as a controller if it implements the IPluginController interface. @param object Object to register.
[ "public void tryRegisterController(Object object) {\n if (object instanceof IPluginController) {\n if (pluginControllers == null) {\n pluginControllers = new ArrayList<>();\n }\n\n pluginControllers.add((IPluginController) object);\n }\n }" ]
[ "protected Expression instantiate(Object oldInstance, Encoder out)\n {\n //\n // An implementation instance is actually constructed at decode time by calling\n // ControlBean.ensureControl on the parent bean. This will create a new impl\n // instance and run the impl initializer on i...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// CheckValidImport returns nil if the "new" snapshot can be imported as a // successor of the "existing" snapshot without forcing. // // If not, an error is returned describing why.
[ "func CheckValidImport(newFile, existingFile *statefile.File) error {\n\tif existingFile == nil || existingFile.State.Empty() {\n\t\t// It's always okay to overwrite an empty state, regardless of\n\t\t// its lineage/serial.\n\t\treturn nil\n\t}\n\tnew := SnapshotMeta{\n\t\tLineage: newFile.Lineage,\n\t\tSerial: ne...
[ "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 programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Get XML content. @access protected @author Aleh Hutnikau, <hutnikau@1pt.com> @param boolean $refresh load content again. @return string
[ "public function getContent($refresh = false)\n {\n if ($this->content === null || $refresh) {\n try{\n switch ($this->sourceType) {\n case self::SOURCE_FILE:\n //check file\n if(!file_exists($this->source)){\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 programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Import our customizations into the kernel.
[ "def import_spydercustomize():\n \"\"\"\"\"\"\n here = osp.dirname(__file__)\n parent = osp.dirname(here)\n customize_dir = osp.join(parent, 'customize')\n\n # Remove current directory from sys.path to prevent kernel\n # crashes when people name Python files or modules with\n # the same name as...
[ "@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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Get the instance as an array. @param boolean $includeMetaData @return array
[ "public function toArray($includeMetaData = false, $nestedInclude = true, $callback = null)\n\t{\n\t\t$data = $this->transformToArray($this->data, $nestedInclude, [], $callback);\n\t\t\n\t\tif( ! $includeMetaData )\n\t\t{\n\t\t\treturn $data;\n\t\t}\n\n\t\t$result = [];\n\t\t$result['data'] = $data;\n\t\t\n\t\tif( ...
[ "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:" }
Create a tar file containing all the source_files Args: source_files (List[str]): List of file paths that will be contained in the tar file Returns: (str): path to created tar file
[ "def create_tar_file(source_files, target=None):\n \n if target:\n filename = target\n else:\n _, filename = tempfile.mkstemp()\n\n with tarfile.open(filename, mode='w:gz') as t:\n for sf in source_files:\n # Add all files from the directory into the root of the directory...
[ "function (src, target) {\n /*\n * Copy a file from one path relative to the src, to another relative to the\n * target.\n * @param {String} from - the path to copy from, relative to the src.\n * @param {String} to - the path to copy to.\n * @return {Promise} - promise to copy\n */\n this.copy = funct...
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
// NewSfFbInviteChangeRoleType returns a new SfFbInviteChangeRoleType instance
[ "func NewSfFbInviteChangeRoleType(Description string) *SfFbInviteChangeRoleType {\n\ts := new(SfFbInviteChangeRoleType)\n\ts.Description = Description\n\treturn s\n}" ]
[ "Observable<ComapiResult<String>> doCreateFbOptInState(@NonNull final String token) {\n return wrapObservable(service.createFbOptInState(AuthManager.addAuthPrefix(token), apiSpaceId, new Object()).map(mapToComapiResult()), log, \"Creating fb opt in state.\");\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
/* Print procedure detail, such as statement text, frag id and json plan. @Param proc Catalog procedure
[ "public static String printUserProcedureDetail(Procedure proc) {\n PureJavaCrc32C crc = new PureJavaCrc32C();\n StringBuilder sb = new StringBuilder();\n sb.append(\"Procedure:\" + proc.getTypeName()).append(\"\\n\");\n for (Statement stmt : proc.getStatements()) {\n // comput...
[ "def show(self):\n \n bytecode._Print(\"MAP_LIST SIZE\", self.size)\n for i in self.map_item:\n if i.item != self:\n # FIXME this does not work for CodeItems!\n # as we do not have the method analysis here...\n i.show()" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Searches for any group that is either the user's primary or contains the user as a member.
[ "def user_groups(self, ldap_user, group_search):\n \n groups = []\n\n try:\n user_uid = ldap_user.attrs[\"uid\"][0]\n\n if \"gidNumber\" in ldap_user.attrs:\n user_gid = ldap_user.attrs[\"gidNumber\"][0]\n filterstr = \"(|(gidNumber={})(member...
[ "protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Data synchronization:" }
Return a array of data containing information about a record Used by Entity\Base->load() @param string|array $key @return array
[ "public function data( $key )\n {\n\n // string, key clause\n if( is_scalar( $key ) ) {\n\n $dataTypes = $this->dataTypesGet( DataType::PRIMARY_KEYS );\n try {\n $key = array_combine(\n array_keys( $dataTypes ),\n explode( B...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Retrieve a Proxy Ticket from the CAS server. @param string $target_service Url string of service to proxy @param string &$err_code error code @param string &$err_msg error message @return string Proxy Ticket
[ "public static function retrievePT($target_service, & $err_code, & $err_msg)\n {\n phpCAS::_validateProxyExists();\n\n try {\n return (self::$_PHPCAS_CLIENT->retrievePT($target_service, $err_code, $err_msg));\n } catch (Exception $e) {\n phpCAS :: error(get_class($e) . ...
[ "def get_value_from_session(key):\n \n def value_from_session_function(service, message):\n \"\"\"Actual implementation of get_value_from_session function.\n\n :param service: SelenolService object.\n :param message: SelenolMessage request.\n \"\"\"\n return _get_value(messa...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
some where conditions eg. 1=1 or 3>2 or 'a'='b'
[ "private boolean explanSpecialCondWithBothSidesAreLiterals(SQLBinaryOpExpr bExpr, Where where) throws SqlParseException {\n if ((bExpr.getLeft() instanceof SQLNumericLiteralExpr || bExpr.getLeft() instanceof SQLCharExpr) &&\n (bExpr.getRight() instanceof SQLNumericLiteralExpr || bExpr.getRight...
[ "def reminder_validator(input_str):\n \n match = re.match(REMINDER_REGEX, input_str)\n if match or input_str == '.':\n return input_str\n else:\n raise ValidationError('Expected format: <number><w|d|h|m> '\n '<popup|email|sms>. (Ctrl-C to exit)\\n')" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetJobId sets the JobId field's value.
[ "func (s *StopKeyPhrasesDetectionJobInput) SetJobId(v string) *StopKeyPhrasesDetectionJobInput {\n\ts.JobId = &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:" }
Called by a proxy queue conversation group to notify this factory of its closure. @param conversation @param group
[ "protected synchronized void groupCloseNotification(Conversation conversation, \n ProxyQueueConversationGroup group)\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, \"groupCloseNotification\", new Object[] {conversati...
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TC...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
unsetSticky @param {Sticky} sticky : a sticky instance. @param {string} position : position replacing with (default: 'relative').
[ "function unsetSticky (sticky, position) {\n const comp = sticky.component\n const element = sticky.element\n position = position ? position + '' : sticky.prePosition\n element.style.position = position\n element.style.marginTop = sticky.preMarginTop || ''\n element.style.top = sticky.preTop || ''\n element....
[ "def set_form form\n raise \"Form is nil in set_form\" if form.nil?\n @form = form\n @id = form.add_widget(self) if !form.nil? and form.respond_to? :add_widget\n # 2009-10-29 15:04 use form.window, unless buffer created\n # should not use form.window so explicitly everywhere.\n # added...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
/* (non-Javadoc) @see java.io.InputStream#read(byte[], int, int)
[ "public int read(byte[] b, int off, int len) throws IOException {\n int c = super.read(b, off, len);\n if( c == -1 && filenames.hasNext() ) {\n cueStream();\n return read(b,off,len);\n }\n return c;\n }" ]
[ "public static void _idx(final byte[] array, int startIndex, byte[] input) {\n\t\ttry {\n\n\t\t\tSystem.arraycopy(input, 0, array, startIndex, input.length);\n\t\t} catch (Exception ex) {\n\t\t\tthrow new KriptonRuntimeException(String.format(\"array size %d, startIndex %d, input length %d\", array.length, startInd...
codesearchnet
{ "query": "Represent the sentence about Java programming:", "pos": "Represent the code about Java programming:", "neg": "Represent the code about programming:" }
Takes a docset and merges the :comment and :code inside it, producing hash as a result.
[ "def merge(docset, filename=\"\", linenr=0)\n docs = docset[:comment]\n code = process_code(docset[:tagname], docset[:code])\n\n h = {\n :tagname => docset[:tagname],\n :name => docs[:name] || code[:name] || \"\",\n :autodetected => code[:autodetected] || {},\n :files => [...
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Load refresh token details by token @param string $refresh_token Refresh token @return array Refresh token details
[ "public function getRefreshToken($refresh_token)\n\t{\n\t\t// create refresh token\n\t\t$token = \\Components\\Developer\\Models\\Refreshtoken::oneByToken($refresh_token);\n\n\t\t// make sure we have a token\n\t\tif (!$token->get('id'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// make sure its a published token\n\...
[ "function attainAccessToken(iGrantTokenRequest $grant)\n {\n // client_id, secret_key can send as Authorization Header Or Post Request Body\n $grantParams = $grant->assertTokenParams();\n\n $response = $this->call( new Token($grantParams) );\n if ( $ex = $response->hasException() )\n ...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Same as all_dict_combinations but preserves order
[ "def iter_all_dict_combinations_ordered(varied_dict):\n \n tups_list = [[(key, val) for val in val_list]\n for (key, val_list) in six.iteritems(varied_dict)]\n dict_iter = (OrderedDict(tups) for tups in it.product(*tups_list))\n return dict_iter" ]
[ "def serialize_identity(self, identity):\n \n section, check, iterargs = identity\n values = map(\n # separators are without space, which is the default in JavaScript;\n # just in case we need to make these keys in JS.\n partial(json.dumps, separators=(',', ':'))\n # iterargs ar...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// NewPluginlist initializes panel with a singlestat panel.
[ "func NewPluginlist(title string) *Panel {\n\tif title == \"\" {\n\t\ttitle = \"Panel Title\"\n\t}\n\trender := \"flot\"\n\treturn &Panel{\n\t\tcommonPanel: commonPanel{\n\t\t\tOfType: PluginlistType,\n\t\t\tTitle: title,\n\t\t\tType: \"pluginlist\",\n\t\t\tRenderer: &render,\n\t\t\tIsNew: true},\n\t\tP...
[ "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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Encrypts a message. @see \phpseclib\Crypt\Base::encrypt() @access public @param string $plaintext @return string $cipertext
[ "function encrypt($plaintext)\n {\n // parent::en/decrypt() is able to do all the work for all modes and keylengths,\n // except for: self::MODE_3CBC (inner chaining CBC) with a key > 64bits\n\n // if the key is smaller then 8, do what we'd normally do\n if ($this->mode_3cbc && strlen...
[ "public static byte[] encipher(byte[] decrypted_bytes, String crypto_algorithm)\n throws InvalidPasswordCipherException, UnsupportedCryptoAlgorithmException {\n EncryptedInfo info = encipher_internal(decrypted_bytes, crypto_algorithm, (String) null); // TODO check null\n return info...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
@param CommandInterface $command @throw \LogicException @throw \GuzzleHttp\Exception\RequestException @return \GuzzleHttp\Message\ResponseInterface|void
[ "public function request(CommandInterface $command)\n {\n if ($command instanceof MultipartDocumentUpload) {\n return $command->execute($this->uploadClient);\n }\n\n return $command->execute($this->apiClient);\n }" ]
[ "public function updateApiMethodAnnotations()\n {\n $updater = new ClassAnnotationUpdater(\n $this->reflection,\n $this->getMethodAnnotations(),\n $this->getDefaultDocComment(),\n '/^\\* @method (\\\\\\\\Aws\\\\\\\\Result|\\\\\\\\GuzzleHttp\\\\\\\\Promise\\\\\\\...
codesearchnet
{ "query": "Represent the Github text about PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about NLP:" }
return the min UMI(s) need to account for cluster
[ "def _get_best_min_account(self, cluster, adj_list, counts):\n ''' '''\n if len(cluster) == 1:\n return list(cluster)\n\n sorted_nodes = sorted(cluster, key=lambda x: counts[x],\n reverse=True)\n\n for i in range(len(sorted_nodes) - 1):\n ...
[ "def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
// Serve accepts incoming HTTP connections on the listener l, invoking the service mux handler for each.
[ "func (service *Service) Serve(l net.Listener) error {\n\treturn service.Server.Serve(l)\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 description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Programming:" }
Set the allowed association types, checking to make sure each combination is valid. @access private @param array $allowed_types @return bool
[ "function setAllowedTypes($allowed_types)\n {\n foreach ($allowed_types as $pair) {\n list($assoc_type, $session_type) = $pair;\n if (!Auth_OpenID_checkSessionType($assoc_type, $session_type)) {\n return false;\n }\n }\n\n $this->allowed_types ...
[ "def has(*permissions, **kwargs):\n \n\n target = kwargs['target']\n\n kwargs['target'] = type_for(target)\n\n # TODO: Predicate evaluation?\n return target in filter_(*permissions, **kwargs)" ]
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Reads (and optionally parses) a single line.
[ "def readline(self):\r\n \"\"\"\"\"\"\r\n line = self.file.readline()\r\n if self.grammar and line:\r\n try:\r\n return self.grammar.parseString(line).asDict()\r\n except ParseException:\r\n return self.readline()\r\n else:\r\n ...
[ "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 Github post about Data processing:", "pos": "Represent the Github code about Data processing:", "neg": "Represent the Github code:" }
Formats and prints a pending version with the given style. @param Version $version The Version to print. @param string $style One of the STYLE_* constants.
[ "protected function printPendingVersion(Version $version, $style)\n {\n /** @var Version $version */\n $id = $version->getId();\n $reflectionClass = new \\ReflectionClass($version->getMigration());\n $absolutePath = $reflectionClass->getFileName();\n $fileName = $absolutePath ?...
[ "public function initializeArguments()\n {\n $this->registerArgument('value', 'string', 'The input value. If not given, the evaluated child nodes will be used', false, null);\n $this->registerArgument('mode', 'string', 'The case to apply, must be one of this\\' CASE_* constants. Defaults to upperca...
codesearchnet
{ "query": "Represent the description about Documentation:", "pos": "Represent the code about Documentation:", "neg": "Represent the code about Programming:" }
Configure and create an instance of the connector
[ "function Connector(settings) {\n this.mailgun = Mailgun({apiKey: settings.apikey, domain: settings.domain});\n}" ]
[ "func New(*SmartSampleConfig, log.Logger, dtsink) (*SmartSampler, error) {\n\treturn nil, errors.New(\"you are attempting to configure a regular SignalFx Gateway with the config of a Smart Gateway. This is an unsupported configuration\")\n}" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// SetStorageCapacity sets the StorageCapacity field's value.
[ "func (s *FileSystem) SetStorageCapacity(v int64) *FileSystem {\n\ts.StorageCapacity = &v\n\treturn s\n}" ]
[ "public static void reset(File directory, int processNumber) {\n try (DefaultProcessCommands processCommands = new DefaultProcessCommands(directory, processNumber, true)) {\n // nothing else to do than open file and reset the space of specified process\n }\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Remove the association for the given server URL and handle, returning whether the association existed at all. (str, str) -> bool
[ "def txn_removeAssociation(self, server_url, handle):\n \n self.db_remove_assoc(server_url, handle)\n return self.cur.rowcount > 0" ]
[ "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 Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about AWS S3:" }
// Errorf implements Reporter.Errorf.
[ "func (r *AssertReporter) Errorf(message string, args ...interface{}) {\n\tr.backend.Fail(fmt.Sprintf(message, args...))\n}" ]
[ "func init() {\n\t// take an output from a print function\n\toutput := pio.Wrap(logrus.Errorf)\n\t// register a new printer with name \"logrus\"\n\t// which will be able to read text and print as string.\n\tpio.Register(\"logrus\", output).Marshal(pio.Text)\n\n\t// p := pio.Register(\"logrus\", output).Marshal(pio....
codesearchnet
{ "query": "Represent the text about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about Software development:" }
Processes the specified rule input with each rule, and processes the result of all rules, all at once, with each result handler. @param ruleInput Rule input to be validated.
[ "@SuppressWarnings(\"unchecked\") // NOSONAR (Avoid Duplicate Literals)\n private void processAllRulesWithEachResultHandler(RI ruleInput) {\n // For each rule\n List<Object> combinedRulesOutput = new ArrayList<Object>(rules.size());\n for (Rule<RI, RO> rule : rules) {\n // Validat...
[ "@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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Pad and use mcrypt on the given value and input vector. @param string $value @param string $iv @return string
[ "protected function padAndMcrypt($value, $iv)\n {\n $value = $this->addPadding(serialize($value));\n\n return mcrypt_encrypt($this->cipher, $this->key, $value, MCRYPT_MODE_CBC, $iv);\n }" ]
[ "public static function hash_update($hasher, $data)\n {\n // use Buffer always\n $data = self::prepareInputBuffer($data);\n\n //XXX should use Hasher class to keep track of key size\n return hash_update($hasher, $data->getBinary());\n }" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Get the number of comments inserted since the given timestamp. @since 1.0 @access public
[ "public function GetCommentCountSince($DiscussionID, $DateAllViewed) {\n\t\t// Only for members\n\t\tif(!Gdn::Session()->IsValid()) return;\n\t\t\n\t\t// Validate DiscussionID\n\t\t$DiscussionID = (int) $DiscussionID;\n\t\tif (!$DiscussionID)\n\t\t\tthrow new Exception('A valid DiscussionID is required in GetCommen...
[ "def can_access_api(self):\n \n try:\n version_dict = self.get_version()\n except Exception, e:\n msg = 'An exception was raised when connecting to REST API: \"%s\"'\n raise APIException(msg % e)\n else:\n \"\"\"\n This is an example...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Documentation:" }
Common reading of a Date Field using Generic Getters & Setters @param string $fieldName Suffix for Getter & Setter (ie: Product => getProduct() & setProduct()) @param string $objectName Name of private object to read (Default : "object") @return self
[ "protected function getGenericDate($fieldName, $objectName = \"object\")\n {\n $date = $this->{$objectName}->{ \"get\".$fieldName}();\n $this->out[$fieldName] = $date ? $date->format(SPL_T_DATECAST) : \"\";\n\n return $this;\n }" ]
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Checks the status of the user's subscription to this thread. :returns: :class:`Subscription <Subscription>`
[ "def subscription(self):\n \n url = self._build_url('subscription', base_url=self._api)\n json = self._json(self._get(url), 200)\n return Subscription(json, self) if json else None" ]
[ "def syncItems(self):\n \n if 'sync-target' not in self.provides:\n raise BadRequest('Requested syncList for device which do not provides sync-target')\n\n return self._server.syncItems(client=self)" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Array to CSS. Converts an array of rule => value into proper CSS formatted rules. @param string[] $rules The CSS rules. @return string The CSS formatted string.
[ "private function array_to_css( array $rules )\n {\n $css = '';\n foreach( $rules as $rule => $value )\n {\n $css .= $rule.':'.$value.';';\n }\n return $css;\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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Full instantiation interface. @param database Database @param relation Relation @return Instance
[ "public Instance instantiate(Database database, Relation<V> relation) {\n DistanceQuery<V> dq = database.getDistanceQuery(relation, EuclideanDistanceFunction.STATIC);\n KNNQuery<V> knnq = database.getKNNQuery(dq, settings.k);\n\n WritableDataStore<PCAFilteredResult> storage = DataStoreUtil.makeStorage(rela...
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// DetectObjects loads Haar cascade to detect face objects in image
[ "func DetectObjects(haar string, img gocv.Mat) []image.Rectangle {\n\treturn loadCascadeClassifier(haar).DetectMultiScale(img)\n}" ]
[ "def read_description():\n \"\"\"\"\"\"\n try:\n with open(\"README.md\") as r:\n description = \"\\n\"\n description += r.read()\n with open(\"CHANGELOG.md\") as c:\n description += \"\\n\"\n description += c.read()\n return description\n ex...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Modify update query to set value of this field. @param DB_dsql $modify @return $this
[ "public function updateModifyQuery($modify)\n {\n if ($this->relation) {\n $modify = $this->relation->dsql;\n }\n\n $modify->set(\n $this->actual_field ?: $this->short_name,\n $this->getSQL()\n );\n\n return $this;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Return specfied GoSubDag initialization object.
[ "def _get_edgesobj(gosubdag, **kws):\n \"\"\"\"\"\"\n # Keyword args (kws):\n # 1. dst_srcs_list Used for edges pruned such that only GO terms\n # are retained which are between the sets of dst & srcs.\n # 2 traverse_parent & traverse_child\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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
logs message with status code 2 - critical
[ "@Override\n public void sendError(String message) {\n System.out.print(\"Critical: \" + message);\n System.exit(2);\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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Returns plain text from *source_text*, a base64 AES encrypted string as generated with openssl. $ echo '_source_text_' | openssl aes-256-cbc -a -k _passphrase_ -p salt=... key=... iv=... _full_encrypted_
[ "def decrypt(source_text, passphrase, debug_stmt=None):\n \n if debug_stmt is None:\n debug_stmt = \"decrypt\"\n full_encrypted = b64decode(source_text)\n salt = full_encrypted[8:IV_BLOCK_SIZE]\n encrypted_text = full_encrypted[IV_BLOCK_SIZE:]\n key, iv_ = _openssl_key_iv(passphrase, salt)\...
[ "def genkey(outcompressed=True,prefix='80'):\n '''\n \n '''\n\n key = prefix + genkeyhex()\n if outcompressed:\n key = key + '01'\n return b58e(key)" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Populate DB object items (post types, terms, authors). @access public
[ "public function populate_db_object_items() {\n\t\t$locators = array(\n\t\t\t'post',\n\t\t\t'term',\n\t\t\t'user',\n\t\t);\n\n\t\tforeach ( $locators as $locator_name ) {\n\t\t\t$items = $this->generate_locator_items( $locator_name );\n\t\t\t$this->get_trail()->add_item( $items );\n\t\t}\n\t}" ]
[ "def getSampleTypeTitles(self):\n \n sample_types = self.getSampleTypes()\n sample_type_titles = map(lambda obj: obj.Title(), sample_types)\n\n # N.B. This is used only for search purpose, because the catalog does\n # not add an entry to the Keywordindex for an empty list.\n ...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Gets an historical rate. @param HistoricalExchangeRateQuery $exchangeQuery @return ExchangeRate
[ "private function getHistoricalExchangeRate(HistoricalExchangeRateQuery $exchangeQuery): ExchangeRate\n {\n $date = $exchangeQuery->getDate();\n $currencyPair = $exchangeQuery->getCurrencyPair();\n $rate = (float) $this->historicalRates[$date->format('Y-m-d')][(string) $currencyPair];\n\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 post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// Eval evaluates the given AST tree and returns its output value, the type // of the output, and any error that occurred.
[ "func internalEval(root ast.Node, config *EvalConfig) (interface{}, ast.Type, error) {\n\t// Copy the scope so we can add our builtins\n\tif config == nil {\n\t\tconfig = new(EvalConfig)\n\t}\n\tscope := registerBuiltins(config.GlobalScope)\n\timplicitMap := map[ast.Type]map[ast.Type]string{\n\t\tast.TypeFloat: {\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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
begin 231634 Support posts with query parms in chunked body WAS.webcontainer
[ "@SuppressWarnings(\"rawtypes\")\n public static Hashtable parsePostData(ServletInputStream in, String encoding, boolean multireadPropertyEnabled) /* 157338 add throws */ throws IOException\n {\n int inputLen;\n byte[] postedBytes = null;\n String postedBody;\n if (com.ibm.ejs.ras....
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github instruction about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
<p> The new event configuration values. </p> @param eventConfigurations The new event configuration values. @return Returns a reference to this object so that method calls can be chained together.
[ "public UpdateEventConfigurationsRequest withEventConfigurations(java.util.Map<String, Configuration> eventConfigurations) {\n setEventConfigurations(eventConfigurations);\n return this;\n }" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// UnmarshalJSON - histogram will come in a base64 encoded serialized form
[ "func (h *Histogram) UnmarshalJSON(b []byte) error {\n\tvar s string\n\tif err := json.Unmarshal(b, &s); err != nil {\n\t\treturn err\n\t}\n\tdata, err := base64.StdEncoding.DecodeString(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\th, err = Deserialize(bytes.NewBuffer(data))\n\treturn err\n}" ]
[ "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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Validates a Cookie Token @param string $strCookieToken @param string $strSalt Token salt @return array|bool The username or FALSE
[ "public function validateCookieToken($strCookieToken, $strSalt=false) {\n\t\t$t = Cryptastic::decrypt($strCookieToken, ($strSalt ? $strSalt : $this->salt));\n\n\t\tif (isset($t['username']) && isset($t['expiration']) && $t['expiration'] > time())\n\t\t\treturn $t['username'];\n\n\t\treturn false;\n\t}" ]
[ "function newService()\n {\n ### Attain Login Continue If Has\n /** @var iHttpRequest $request */\n $request = \\IOC::GetIoC()->get('/HttpRequest');\n $tokenAuthIdentifier = new IdentifierHttpToken;\n $tokenAuthIdentifier\n ->setRequest($request)\n ->setT...
codesearchnet
{ "query": "Represent the Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Marshall the given parameter object.
[ "public void marshall(GroupInformation groupInformation, ProtocolMarshaller protocolMarshaller) {\n\n if (groupInformation == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(groupInformation....
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Remove all occurances of value from the array at field @param field The field to remove the value from @param value The value to remove. This may be another query. @return this object
[ "public static Builder pull(String field, Object value) {\n return new Builder().pull(field, value);\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 comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Parse a function call (like ``%foo{bar,baz}``) starting at ``pos``. Possibly appends a Call object to ``parts`` and update ``pos``. The character at ``pos`` must be ``%``.
[ "def parse_call(self):\n \n assert self.pos < len(self.string)\n assert self.string[self.pos] == FUNC_DELIM\n\n start_pos = self.pos\n self.pos += 1\n\n ident = self._parse_ident()\n if not ident:\n # No function name.\n self.parts.append(FUNC_D...
[ "def t_binaryValue(t):\n '\n # We must match [0-9], and then check the validity of the binary number.\n # If we match [0-1], the invalid binary number \"2b\" would match\n # 'decimalValue' 2 and 'IDENTIFIER 'b'.\n if re.search(r'[2-9]', t.value) is not None:\n msg = _format(\"Invalid binary nu...
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Regular expressions:" }
Executed on mouse move while dragging.<p> @param event the event
[ "protected void setNewHeight(Event event) {\r\n\r\n double newheight = m_oldheight + (event.getClientY() - m_clientY);\r\n if (m_defaultHeight != -1) {\r\n if (newheight < m_defaultHeight) {\r\n newheight = m_defaultHeight;\r\n }\r\n }\r\n ResizeEvent...
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Runs all @param notifier The notifier
[ "@Override\n\tpublic void run(RunNotifier notifier) {\n\t\tlog.debug(\"Run called on ParameterizedCucumber\");\n\t\tsuper.run(notifier);\n\t\tjUnitReporter.done();\n\t\tnew SummaryPrinter(System.out).print(runtime);\n\t\tjUnitReporter.close();\n\t\tlog.debug(\"Run finished on ParameterizedCucumber\");\n\t}" ]
[ "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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
// Usage retrieves the disk usage of the top-level snapshot.
[ "func (b *snapshotter) Usage(ctx context.Context, key string) (snapshots.Usage, error) {\n\treturn b.usage(ctx, key)\n}" ]
[ "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 description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Technology:" }
A helper method for `self.search` that returns a generator rather than a list.
[ "def _search_generator(self, item: Any) -> Generator[Any, None, None]:\n \"\"\"\"\"\"\n results = 0\n for x in self.enumerate(item):\n yield x\n results += 1\n if results == 0:\n raise SearchError(str(item))" ]
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
/* @function remove @description Remove a store data item from a local source @param {String} id [Store data item id] @param {Object} store [Store element] @return {Object} [Store data item]
[ "function remove(id, store) {\n var data = store.rootData.asObject();\n // Check id coincidence\n if (data[id.toString()]) {\n var deleted = JSON.stringify(data[id.toString()]);\n // Delete item\n delete data[id.toString()];\n // Update store data\n store.rootData =...
[ "function newLocalModel (call) {\n // get clone of call and reset original\n call = resetCall(call)\n // require immutable core\n assert.ok(GLOBAL.immutableCoreModel !== undefined, 'ImmutableAI configuration error: immutableCoreModel required')\n // get model - throws error if not found\n var mode...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Convert sample data to different bits per sample. @param int $bitsPerSample (Required) The new number of bits per sample; @throws WavFileException
[ "public function convertBitsPerSample($bitsPerSample) {\n if ($this->getBitsPerSample() == $bitsPerSample) {\n return $this;\n }\n\n $tempWav = new WavFile($this->getNumChannels(), $this->getSampleRate(), $bitsPerSample);\n $tempWav->filter(\n array(self::FILTER_MIX...
[ "public void init(Rec record, int iKeyDup, String strKeyName)\n {\n super.init(record, iKeyDup, strKeyName);\n m_iKeyActualLength = 0; // Actual Byte length\n m_iKeyByteLength = 0; // Key length (0-64 bytes) (including trailer bytes)\n }" ]
codesearchnet
{ "query": "Represent the summarization about Signal Processing:", "pos": "Represent the code about Signal Processing:", "neg": "Represent the code about Software Development:" }
Generate a unique key @param boolean unique force the key to be unique @return string
[ "public function generateKey ( $unique = false )\n\t{\n\t\t$key = md5(uniqid(rand(), true));\n\t\tif ($unique)\n\t\t{\n\t\t\tlist($usec,$sec) = explode(' ',microtime());\n\t\t\t$key .= dechex($usec).dechex($sec);\n\t\t}\n\t\treturn $key;\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 Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }