query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Evaluate in silico growth rates.
[ "def evaluate(self, model, threshold=0.1):\n \"\"\"\"\"\"\n with model:\n if self.medium is not None:\n self.medium.apply(model)\n if self.objective is not None:\n model.objective = self.objective\n model.add_cons_vars(self.constraints)\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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Natural Language Processing:" }
Gets the set of changed bytes between `self` and `other`. :type other: SimPagedMemory :returns: A set of differing bytes.
[ "def __changed_bytes(self, other):\n \n if self._page_size != other._page_size:\n raise SimMemoryError(\"SimPagedMemory page sizes differ. This is asking for disaster.\")\n\n our_pages = set(self._pages.keys())\n their_pages = set(other._pages.keys())\n their_additions ...
[ "def intersection(self, other):\n \n #NOTE: This is a work around \n # Python 3 return as the result of set.intersection a new set instance.\n # Python 2 however returns as a the result a ClusterShell.RangeSet.RangeSet instance.\n # ORIGINAL CODE: return self._wrap_set_op(set.inte...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Set keep-alive connection mode. :param bool val: new state.
[ "def keep_alive(self, val: bool) -> None:\n \n self._keepalive = val\n if self._keepalive_handle:\n self._keepalive_handle.cancel()\n self._keepalive_handle = None" ]
[ "def _enter(self):\n \"\"\"\"\"\"\n command = self.command\n logger.log(5, \"Snippet keystroke `Enter`.\")\n # NOTE: we need to set back the actions (mode_off) before running\n # the command.\n self.mode_off()\n self.run(command)" ]
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Parse a new-expression, or if next token isn't {@link Token#NEW}, a primary expression. @param allowCallSyntax passed down to {@link #memberExprTail}
[ "private AstNode memberExpr(boolean allowCallSyntax)\n throws IOException\n {\n int tt = peekToken(), lineno = ts.lineno;\n AstNode pn;\n\n if (tt != Token.NEW) {\n pn = primaryExpr();\n } else {\n consumeToken();\n int pos = ts.tokenBeg;\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 comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// Set set value by name
[ "func (scope *Scope) Set(name string, value interface{}) *Scope {\n\tscope.db.InstantSet(name, value)\n\treturn scope\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 description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
remove directory recursivly (all items within)
[ "async function rmrf(dir){\n // get absolute path\n const absPath = _path.resolve(dir);\n\n let stats = null;\n // stats command executable ? dir/file exists\n try{\n stats = await _fs.stat(absPath);\n\n }catch(e){\n throw new Error('Requested directory <' + absPath + '> does not ex...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
// formatSourceCode formats source files
[ "func FormatSourceCode(filename string) {\n\tcmd := exec.Command(\"gofmt\", \"-w\", filename)\n\tif err := cmd.Run(); err != nil {\n\t\tbeeLogger.Log.Warnf(\"Error while running gofmt: %s\", err)\n\t}\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Handles the "bind --disable" command. @param Args $args The console arguments @return int The status code
[ "public function handleDisable(Args $args)\n {\n $bindingToDisable = $this->getBindingByUuidPrefix($args->getArgument('uuid'));\n\n if ($bindingToDisable->getContainingModule() instanceof RootModule) {\n throw new RuntimeException(sprintf(\n 'Cannot disable bindings in the...
[ "def _enter(self):\n \"\"\"\"\"\"\n command = self.command\n logger.log(5, \"Snippet keystroke `Enter`.\")\n # NOTE: we need to set back the actions (mode_off) before running\n # the command.\n self.mode_off()\n self.run(command)" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// DecorateService annotates the service with the Kinesis hook
[ "func (lad *LogAggregatorDecorator) DecorateService(context map[string]interface{},\n\tserviceName string,\n\ttemplate *gocf.Template,\n\tS3Bucket string,\n\tS3Key string,\n\tbuildID string,\n\tawsSession *session.Session,\n\tnoop bool,\n\tlogger *logrus.Logger) error {\n\n\t// Create the Kinesis Stream\n\ttemplate...
[ "@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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Get the intrinsic values of a given QTI $variable. @param Variable $variable @return array
[ "public static function getVariableValues(Variable $variable) {\n\n $returnValue = array();\n\n $baseType = $variable->getBaseType();\n $cardinalityType = $variable->getCardinality();\n $value = $variable->getValue();\n \n // This only works if the variable has a value ;)\n...
[ "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:" }
Creates a configuration with an annotation metadata driver. @param array $paths @param boolean $isDevMode @param string $proxyDir @param Cache $cache @param bool $useSimpleAnnotationReader @return Configuration
[ "public static function createAnnotationMetadataConfiguration(array $paths, $isDevMode = false, $proxyDir = null, Cache $cache = null, $useSimpleAnnotationReader = true)\n {\n $config = self::createConfiguration($isDevMode, $proxyDir, $cache);\n $config->setMetadataDriverImpl($config->newDefaultAnn...
[ "private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Return a json string that can also be used as a key. The JSON is explicitly unambiguous in the item order entries (dictionaries are not ordered usually) Otherwise it is valid JSON
[ "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...
[ "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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// isUnbound returns true if the device is not bound to any driver or if it's // bound to a stub driver like pci-stub or vfio-pci. // The input device is expected to be a string like 0000:03:00.1 (Domain:Bus:Slot.Function)
[ "func isUnbound(device string) bool {\n\tmodulePath, err := filepath.EvalSymlinks(filepath.Join(sysFsPCIDevicesPath, device, \"driver\", \"module\"))\n\tif os.IsNotExist(err) {\n\t\tlog.Infof(\"%v is not bound to any driver\", device)\n\t\treturn true\n\t}\n\tmodule := filepath.Base(modulePath)\n\tif module == \"pc...
[ "def is_micropython_usb_device(port):\n \n if type(port).__name__ == 'Device':\n # Assume its a pyudev.device.Device\n if ('ID_BUS' not in port or port['ID_BUS'] != 'usb' or\n 'SUBSYSTEM' not in port or port['SUBSYSTEM'] != 'tty'):\n return False\n usb_id = 'usb vid:...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Generate a normalized Gaussian profile from its FWHM
[ "def generate_gaussian_profile(seeing_fwhm):\n \"\"\"\"\"\"\n FWHM_G = 2 * math.sqrt(2 * math.log(2))\n sigma = seeing_fwhm / FWHM_G\n amplitude = 1.0 / (2 * math.pi * sigma * sigma)\n seeing_model = Gaussian2D(amplitude=amplitude,\n x_mean=0.0,\n ...
[ "def gaussian_window(t, params):\n \n window = suspect.basis.gaussian(t, 0, 0, params[\"line_broadening\"])\n\n # the above gaussian function returns an area 1 fid, for a windowing\n # function we need to be area preserving (first point must be 1)\n return window / window[0]" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Obtain (uri, name) from a qualified name
[ "def resolve_namespace(self, qname):\n \n if ':' in qname:\n prefix, name = qname.split(':', 1)\n uri = self._ns[prefix]\n else:\n name = qname\n if None in self._ns:\n uri = self._ns[None]\n else:\n uri = None...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Needed for header widgets to prevent expand/collapse on their clicks.
[ "public void discardHeaderClick(ClickEvent event) {\n if (event == null) return;\n\n // Example: we use radioset on collapsible header, so stopPropagation() is needed\n // to suppress collapsible open/close behavior.\n // But preventDefault() is not needed, otherwise radios won't switch....
[ "function showDropdown(position) {\n // If the dropdown is already visible, just return (so the root click handler on html\n // will close it).\n if ($dropdown) {\n return;\n }\n\n Menus.closeAll();\n\n $dropdown = $(renderList())\n .css({\n ...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Loosely check if the record can be sorted by a property @param string $property @return boolean
[ "public function canSortBy($property)\n {\n $canSort = false;\n $singleton = $this->dataRecord->getDataSingleton();\n\n if ($singleton) {\n $properties = explode('.', $property);\n\n $relationClass = $singleton->getRelationClass($properties[0]);\n if ($relati...
[ "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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Store fields. This method is used to save any additional input into the current task object if the task class matches @param array $submittedData Array containing the data submitted by the user @param object $task Reference to the current task object
[ "protected function saveFields( array $submittedData, $task )\n\t{\n\t\t$task->{$this->fieldSite} = $submittedData[$this->fieldSite];\n\t\t$task->{$this->fieldController} = $submittedData[$this->fieldController];\n\t\t$task->{$this->fieldTSconfig} = $submittedData[$this->fieldTSconfig];\n\t}" ]
[ "def _reflex_rule_process(self, wf_action):\n \n # Check out if the analysis has any reflex rule bound to it.\n # First we have get the analysis' method because the Reflex Rule\n # objects are related to a method.\n a_method = self.getMethod()\n if not a_method:\n ...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
@param \eZ\Publish\API\Repository\Values\User\User $user @param \Symfony\Component\HttpFoundation\Request $request @return \eZ\Publish\Core\REST\Server\Values\Version
[ "private function mapUserToVersion(User $user, Request $request)\n {\n $content = $this->repository->getContentService()->loadContent($user->id);\n $request->headers->set('Url', $request->getPathInfo());\n\n return new Version(\n $content,\n $this->repository->getConten...
[ "public function boot(\\Neos\\Flow\\Core\\Bootstrap $bootstrap)\n {\n $bootstrap->registerRequestHandler(new \\Neos\\Setup\\Core\\RequestHandler($bootstrap));\n }" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
需要执行的方法 @param call @param content @return
[ "public <T> Future<T> executeMethod(Callable<T> call,Content content){\r\n\t\tLogProcessContext logProcessContext = getLogProcessContext();\r\n\t\treturn logProcessContext.getExecuteManager().cacheCall(call, content);\r\n\t}" ]
[ "public void addSharedFunctionByString(String content) {\r\n\t\t// content 中的内容被解析后会存放在 Env 之中,而 StringSource 所对应的\r\n\t\t// Template 对象 isModified() 始终返回 false,所以没有必要对其缓存\r\n\t\tStringSource stringSource = new StringSource(content, false);\r\n\t\tdoAddSharedFunction(stringSource, null);\r\n\t}" ]
codesearchnet
{ "query": "Represent the instruction about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code:" }
Check if arguments are list type.
[ "def list_check(*args, func=None):\n \"\"\"\"\"\"\n func = func or inspect.stack()[2][3]\n for var in args:\n if not isinstance(var, (list, collections.UserList, collections.abc.MutableSequence)):\n name = type(var).__name__\n raise ListError(\n f'Function {func}...
[ "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 text:", "pos": "Represent the code:", "neg": "Represent the code:" }
get a list of messages with number and size @param int $id number of message @return int|array size of given message of list with all messages as array(num => size) @throws Zend_Mail_Protocol_Exception
[ "public function getSize($id = 0)\n {\n $id = $id ? $id : null;\n return $this->_protocol->getList($id);\n }" ]
[ "public function reduceFilePath($varValue, \\DataContainer $dc)\n {\n $doc = $dc->activeRecord;\n\n $path = \\FilesModel::findByUuid($varValue)->path;\n\n $arrFileNameParts = \\Document::splitFileName(substr($path, strlen(\\DmsConfig::getBaseDirectory(true))));\n\n // TODO (#33): reset the new fileType...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Produce dictionary of sequences from sequence of sequences, optionally with a header "row". >>> dos_from_table([['hello', 'world'], [1, 2], [3,4]]) == {'hello': [1, 3], 'world': [2, 4]} True
[ "def dos_from_table(table, header=None):\n \n start_row = 0\n if not table:\n return table\n if not header:\n header = table[0]\n start_row = 1\n header_list = header\n if header and isinstance(header, basestring):\n header_list = header.split('\\t')\n if len(hea...
[ "def loadNumpyAnnotations(self, data):\n \n print('Converting ndarray to lists...')\n assert(type(data) == np.ndarray)\n print(data.shape)\n assert(data.shape[1] == 7)\n N = data.shape[0]\n ann = []\n for i in range(N):\n if i % 1000000 == 0:\n ...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Execute a SQL statement and skip potential result set processing. This method should be used for SQL statements not returning rows. @param string $sql - SQL statement @return $this @throws DatabaseException on errors
[ "public function execute($sql) {\n //\n // TODO: check mysql_unbuffered_query() with mysql_free_result() for larger result sets\n // @see https://www.percona.com/blog/2006/06/26/handling-of-big-parts-of-data/\n // @see https://dev.mysql.com/doc/refman/5.7/en/mysql-use-resul...
[ "@Override\n\tpublic void showHelp(final Terminal terminal) {\n\t\tterminal.writer().println(\"\\t\" + this.toString() + \": generate sql to access the table.\");\n\t\tterminal.writer().println(\n\t\t\t\t\"\\t\\tex) generate [select/insert/update/delete] [table name]<Enter> : Show sql to access tables according to ...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// Capture interface used by participle
[ "func (qi *QuotedIdentifier) Capture(values []string) error {\n\t// Remove enclosing quotes\n\tn := len(values[0])\n\tr := values[0][1 : n-1]\n\n\t// Translate doubled quotes\n\t*qi = QuotedIdentifier(strings.Replace(r, `\"\"`, `\"`, -1))\n\treturn nil\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// Get implements groupcache.Getter.
[ "func (gt *Getter) Get(ctx groupcache.Context, key string, dest groupcache.Sink) error {\n\tmyctx, ok := ctx.(*Context)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid context type: %T\", ctx)\n\t}\n\tif myctx == nil {\n\t\treturn fmt.Errorf(\"context is nil\")\n\t}\n\tif myctx.Params == nil {\n\t\treturn fmt.Errorf(\...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction about software development:", "pos": "Represent the code about software development:", "neg": "Represent the code:" }
Remove a previously registered monitor. See :meth:`AbstractDeviceAdapter.adjust_monitor`.
[ "def remove_monitor(self, handle):\n \n\n action = (handle, \"delete\", None, None)\n if self._currently_notifying:\n self._deferred_adjustments.append(action)\n else:\n self._adjust_monitor_internal(*action)" ]
[ "def addLocalCacheService(self):\n \"\"\n _cache = self.getCacheService()\n _cache.setName('cache_proxy')\n _cache.setServiceParent(self.hendrix)" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
@param string $step @param array $params @throws \Http\Client\Exception @return array
[ "public function stop(string $step, array $params = [])\n {\n $path = $this->buildStepsPath($step, 'stopPipeline');\n\n return $this->post($path, $params);\n }" ]
[ "public function run()\n {\n $this->loadMiddleware();\n\n //~ Default response\n $response = new HttpMessage\\Response();\n //$response->getBody()->write('-- static --');\n\n //~ Get response\n $stack = new HttpMiddleware\\Stack($response, $this->middleware);\n ...
codesearchnet
{ "query": "Represent the sentence about PHP:", "pos": "Represent the code about PHP:", "neg": "Represent the code:" }
Update the display of button after querying data from interface
[ "def _update(self):\n \"\"\"\"\"\"\n self.clear()\n self._set_boutons_communs()\n if self.interface:\n self.addSeparator()\n l_actions = self.interface.get_actions_toolbar()\n self._set_boutons_interface(l_actions)" ]
[ "@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 text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Decorator for API requests. Handles auth and adds the username as the first argument.
[ "def api(require_login=True, schema=None, enabled=True,\n require_admin=False, require_anonymous=False):\n \n if require_admin:\n require_login = True\n\n if schema is not None:\n Draft4Validator.check_schema(schema)\n validator = Draft4Validator(schema)\n else:\n vali...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// Regex represents the nodes that are matching provided regexp pattern. // It will only include Raw and String values.
[ "func (p *Path) Regex(pattern *regexp.Regexp) *Path {\n\treturn p.Filters(shape.Regexp{Re: pattern, Refs: false})\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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
获取随机字符串 @param int $length @return string
[ "public static function genRandomChar($length = 8)\n {\n // 密码字符集,可任意添加你需要的字符\n //$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n $chars = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789';\n $char = '';\n for ($i = 0; $i < $length; $i++) ...
[ "static function position($name, $value=null, $settings=[])\n {\n if (!isset($settings['description'])) {\n $settings['description'] = '位置可设为:1到9的数字表示九宫格的位置, 或100|30, 或 center|center, 或100|left';\n }\n \n return static::input('text', $name, $value, $settings);\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
{@inheritDoc}. @deprecated see {@link #willReceive(UUID, Event)}
[ "@Deprecated\n\t@Override\n\tpublic void receive(UUID receiverID, Event event) {\n\t\twillReceive(receiverID, event);\n\t}" ]
[ "@SuppressWarnings(\"unchecked\")\n public <C extends CDACallback<SynchronizedSpace>> C fetch(C callback) {\n return (C) Callbacks.subscribeAsync(observe(), callback, client);\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about writing:", "pos": "Represent the Github code about writing:", "neg": "Represent the Github code about programming:" }
Check the information of a credit card (Token) data identifier. Args: credit_card_id: Credit Card Token you want to consult. Returns:
[ "def get_credit_card(self, credit_card_id):\n \n return self.client._get(self.url + 'creditCards/{}'.format(credit_card_id), headers=self.get_headers())" ]
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// MinTimeSignature sets the minimum time signature // The time signature (meter) is a notational convention to // specify how many beats are in each bar (or measure).
[ "func (ta *TrackAttributes) MinTimeSignature(timeSignature int) *TrackAttributes {\n\tta.intAttributes[\"min_time_signature\"] = timeSignature\n\treturn ta\n}" ]
[ "def _calculate_index_of_coincidence(frequency_map, length):\n \n if length <= 1:\n return 0\n # We cannot error here as length can legitimiately be 1.\n # Imagine a ciphertext of length 3 and a key of length 2.\n # Spliting this text up and calculating the index of coincidence res...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Determinate satisfies ProgressDisplay interface.
[ "func (p ProgressDisplayFunc) Determinate() [101]string {\n\tvar set [101]string\n\tfor i := range set {\n\t\tset[i] = p(i)\n\t}\n\treturn set\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 comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
If a formatted phone number is an international one then it strips the `+${country_phone_code}` prefix from the formatted number.
[ "function strip_country_phone_code(formatted_number, metadata)\n{\n\tif (!formatted_number || formatted_number[0] !== '+' || formatted_number === '+')\n\t{\n\t\treturn formatted_number\n\t}\n\n\tfor (const country_phone_code of Object.keys(metadata.country_phone_code_to_countries))\n\t{\n\t\tif (formatted_number.in...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// String is used for test output
[ "func (r report) String() string {\n\tresult := &bytes.Buffer{}\n\tfmt.Fprintf(result, \"{\")\n\tfor k := range r {\n\t\tvar status string\n\t\tswitch k {\n\t\tcase statusPending:\n\t\t\tstatus = \"pending\"\n\t\tcase statusDownloading:\n\t\t\tstatus = \"downloading\"\n\t\tcase statusExtracting:\n\t\t\tstatus = \"e...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// NewReporter returns a new log reporter.
[ "func NewReporter(l *log.Logger) reporter.Reporter {\n\tif l == nil {\n\t\t// use standard type of log setup\n\t\tl = log.New(os.Stderr, \"\", log.LstdFlags)\n\t}\n\treturn &logReporter{\n\t\tlogger: l,\n\t}\n}" ]
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Export the data. @param renderer_base $output @return stdClass
[ "public function export_for_template(renderer_base $output) {\n global $CFG, $DB, $PAGE;\n\n $context = context_course::instance($this->courseid);\n\n $data = new stdClass();\n $data->userid = $this->userid;\n $data->competencyid = $this->competencyid;\n $data->courseid = $...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
@param string $oldText @param string $newText @param string $data @param int $lifeTime @return bool
[ "public function save($oldText, $newText, $data, $lifeTime = 0)\n {\n return $this->cacheProvider->save($this->getHashKey($oldText, $newText), $data, $lifeTime);\n }" ]
[ "protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Check that the content and structure of different fields are consistent with one another.
[ "def check_field_cohesion(self, present_label_fields):\n \n # Ensure all written annotation fields have the same length\n nannots = len(self.sample)\n\n for field in ['sample', 'num', 'subtype', 'chan', 'aux_note']+present_label_fields:\n if getattr(self, field) is not None:\n...
[ "def get_render_language(contentitem):\n \n plugin = contentitem.plugin\n\n if plugin.render_ignore_item_language \\\n or (plugin.cache_output and plugin.cache_output_per_language):\n # Render the template in the current language.\n # The cache also stores the output under the current lang...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Language and programming:" }
Convenience method to reuse the super constructor. @param components @return a non-null collection
[ "static Collection<AbstractType> asList( Collection<Component> components ) {\n\n\t\tCollection<AbstractType> result = new ArrayList<AbstractType> ();\n\t\tresult.addAll( components );\n\n\t\treturn result;\n\t}" ]
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Definition constructor @param {Object} meta meta infos like: { name: 'name' } @constructor
[ "function Definition (meta) {\n if (!this.name && meta && meta.name) {\n this.name = meta.name;\n }\n\n this.options = {};\n\n this.definitions = {\n command: {\n id: 'id'\n//// name: 'name', // optional\n//// aggregateId: 'aggregate.id', // optional\n//// context:...
[ "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 Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Re-attempt to split and execute the failed commands
[ "def _execute_commands_from_dir(self, directory):\n \"\"\"\"\"\"\n # Get file paths and contents\n commands = get_commands_from_dir(directory)\n\n # Execute failed commands again\n print('\\tAttempting to execute {0} failed commands'.format(len(commands)))\n return self.exe...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Evaluates a file containing a Python params dictionary.
[ "def eval_py(self, _globals, _locals):\n \n try:\n params = eval(self.script, _globals, _locals)\n except NameError as e:\n raise Exception(\n 'Failed to evaluate parameters: {}'\n .format(str(e))\n )\n except ResolutionError...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Run a shell command given the command's parsed command line
[ "def runCommandSplits(splits, silent=False, shell=False):\n \n try:\n if silent:\n with open(os.devnull, 'w') as devnull:\n subprocess.check_call(\n splits, stdout=devnull, stderr=devnull, shell=shell)\n else:\n subprocess.check_call(splits...
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *JobReport) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"JobReport\"}\n\tif s.Bucket != nil && len(*s.Bucket) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Bucket\", 1))\n\t}\n\tif s.Enabled == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Enabled\"))\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:" }
// Returns the description of a field. // // Parameters: // // ◾ fieldName - Name of the field. //
[ "func (obj *Doc) GetFieldDescription(ctx context.Context, fieldName string) (*FieldDescription, error) {\n\tresult := &struct {\n\t\tReturn *FieldDescription\t`json:\"qReturn\"`\n\t} {}\n\terr := obj.rpc(ctx, \"GetFieldDescription\", result, fieldName)\n\treturn result.Return, err \n}" ]
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Parses Style#add_style options for number formatting. noop if neither :format_code or :num_format options are set. @option options [Hash] A hash describing the :format_code and/or :num_fmt integer for the style. @return [NumFmt|Integer]
[ "def parse_num_fmt_options(options={})\n return if (options.keys & [:format_code, :num_fmt]).empty?\n\n #When the user provides format_code - we always need to create a new numFmt object\n #When the type is :dxf we always need to create a new numFmt object\n if options[:format_code] || options[:...
[ "def uncomment(key, value, tree)\n # Try to find if it is commented out, so we can replace line\n matcher = Matcher.new(\n collection: \"#comment\",\n # FIXME: this assumes a specific \"=\" syntax, bypassing the lens\n # FIXME: this will match also \"# If you set FOO=bar then...\"\...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Computer Science:" }
// Union returns the smallest cap which encloses this cap and other.
[ "func (c Cap) Union(other Cap) Cap {\n\t// If the other cap is larger, swap c and other for the rest of the computations.\n\tif c.radius < other.radius {\n\t\tc, other = other, c\n\t}\n\n\tif c.IsFull() || other.IsEmpty() {\n\t\treturn c\n\t}\n\n\t// TODO: This calculation would be more efficient using s1.ChordAngl...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetPolicyNames sets the PolicyNames field's value.
[ "func (s *DescribePoliciesInput) SetPolicyNames(v []*string) *DescribePoliciesInput {\n\ts.PolicyNames = v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
@command doctor:check @hidden
[ "public function doctorCheck() {\n $status = $this->getInspector()->getStatus();\n $this->printArrayAsTable($status);\n\n $checks = [\n AcsfCheck::class,\n BehatCheck::class,\n ComposerCheck::class,\n ConfigCheck::class,\n DbCheck::class,\n DevDesktopCheck::class,\n Drupa...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// existsDebit checks for the existance of a debit. If found, the debit and // previous credit keys are returned. If the debit does not exist, both keys // are nil.
[ "func existsDebit(ns walletdb.ReadBucket, txHash *chainhash.Hash, index uint32, block *Block) (k, credKey []byte, err error) {\n\tk = keyDebit(txHash, index, block)\n\tv := ns.NestedReadBucket(bucketDebits).Get(k)\n\tif v == nil {\n\t\treturn nil, nil, nil\n\t}\n\tif len(v) < 80 {\n\t\tstr := fmt.Sprintf(\"%s: shor...
[ "function inflate(object) {\n // check if the object is an object and isn't empty\n if (is(object) && !empty(object)) {\n // create a new object for the result\n let result = {};\n\n // for each key in the object\n Object.keys(object).forEach((path) => {\n // get value from the object\n cons...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Pulls out the options hash from $array if any. @internal DO NOT remove the reference on $array. @param array &$array An array @return array A valid options array
[ "public static function extractAndValidateOptions(array &$array)\n\t{\n\t\t$options = array();\n\n\t\tif ($array)\n\t\t{\n\t\t\t$last = &$array[count($array)-1];\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (self::isOptionsHash($last))\n\t\t\t\t{\n\t\t\t\t\tarray_pop($array);\n\t\t\t\t\t$options = $last;\n\t\t\t\t}\n\t\t\t}\n...
[ "def uncomment(key, value, tree)\n # Try to find if it is commented out, so we can replace line\n matcher = Matcher.new(\n collection: \"#comment\",\n # FIXME: this assumes a specific \"=\" syntax, bypassing the lens\n # FIXME: this will match also \"# If you set FOO=bar then...\"\...
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Computer Science:" }
Parse the status arguments. @param string $status @param array $args @return array
[ "protected function parseStatusArguments(string $status, array $args): array\n {\n $name = ucfirst($status);\n\n return wp_parse_args($args, [\n 'label' => $name,\n 'public' => true,\n 'exclude_from_search' => false,\n 'show_in_admin_all_list' => true,\n ...
[ "def setConfiguration(self, configuration):\n \n \"\"\"\n if isinstance(configuration, Configuration):\n configuration = configuration.value\n\n self.dev.set_configuration(configuration)" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Delete a single VM
[ "def destroy(name, conn=None, call=None):\n '''\n \n '''\n if call == 'function':\n raise SaltCloudSystemExit(\n 'The destroy action must be called with -d, --destroy, '\n '-a or --action.'\n )\n\n __utils__['cloud.fire_event'](\n 'event',\n 'destroyi...
[ "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:" }
Update entity before flush to prevent a possible after flush @param PreFlushEventArgs $args
[ "public function preFlush(PreFlushEventArgs $args)\n {\n $uow = $args->getEntityManager()->getUnitOfWork();\n $result = $uow->getIdentityMap();\n if(isset($result[$this->targetClass])) {\n foreach ($result[$this->targetClass] as $entity) {\n $this->updateEntity($ent...
[ "public void doAddNew() throws DBException\n {\n if (this.lockOnDBTrxType(null, DBConstants.ADD_TYPE, false)) // ADD_TYPE = Add new; Should I do the unlock in my code?\n this.unlockIfLocked(this.getRecord(), null); // Release any locks\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
This method is only called from code synched on the <code>freeLockObject</code>, so we do not have to worry about synchronizing access to <code>waiterCount</code>.
[ "private void queueRequest(ManagedConnectionFactory managedConnectionFactory, long waitTimeout) throws ResourceAllocationException, ConnectionWaitTimeoutException {\n\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {\n Tr.entry(this, tc, \"queueRequest\", waitTimeout);\n ...
[ "public static void recordInstance(Object obj) {\n\t\t// obj will be a ClassPropertyFetcher instance\n\t\tSystem.err.println(\"new instance queued \" + System.identityHashCode(obj));\n\t\t// TODO urgent - race condition here, can create Co-modification problem if adding whilst another thread is processing\n\t\tclas...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// UpgradePrep stops and uninstalls all components except router and publisher
[ "func UpgradePrep(stateless bool, b backend.Backend) error {\n\tvar wg sync.WaitGroup\n\n\tb.Stop([]string{\"database\", \"registry@*\", \"controller\", \"builder\", \"logger\", \"logspout\"}, &wg, Stdout, Stderr)\n\twg.Wait()\n\tb.Destroy([]string{\"database\", \"registry@*\", \"controller\", \"builder\", \"logger...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// SetRequesterFeedback sets the RequesterFeedback field's value.
[ "func (s *Assignment) SetRequesterFeedback(v string) *Assignment {\n\ts.RequesterFeedback = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
@param array $item @param string $idField @return int last insert id @throws \WebComplete\microDb\Exception
[ "public function insert(array $item, string $idField = 'id'): int\n {\n $collectionData = $this->storage->load(true);\n if (!isset($collectionData['items'])) {\n $collectionData['items'] = [];\n }\n if (!isset($collectionData['inc'])) {\n $collectionData['inc'] =...
[ "public function getTokenStatusDescriptionForBridge(\\MUtil_Model_Bridge_TableBridgeAbstract $bridge, $addDescription = false)\n {\n return \\MUtil_Lazy::method($this, 'getStatusDescription', $bridge->getLazy('token_status'));\n }" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Return the hosts file path based on the supplied or detected platform. :param platform: a string used to identify the platform :return: detected filesystem path of the hosts file
[ "def determine_hosts_path(platform=None):\n \n if not platform:\n platform = sys.platform\n if platform.startswith('win'):\n result = r\"c:\\windows\\system32\\drivers\\etc\\hosts\"\n return result\n else:\n return '/etc/hosts'" ]
[ "def resolveEntryPoint(entryPoint):\n \n if inVirtualEnv():\n path = os.path.join(os.path.dirname(sys.executable), entryPoint)\n # Inside a virtualenv we try to use absolute paths to the entrypoints.\n if os.path.isfile(path):\n # If the entrypoint is present, Toil must have be...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Gets number of child bookmarks in a specfied parent bookmark. @param integer $parent @return integer @throws Exception
[ "public function getChildBookmarksCount($parent)\n {\n\n $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/bookmarks/' . $parent . '/bookmarks';\n $signedURI = Utils::sign($strURI);\n $responseStream = Utils::processCommand($signedURI, 'GET', '', '');\n $json = j...
[ "protected function processDetails(Buffer &$buffer, Result &$result)\n {\n parent::processDetails($buffer, $result);\n\n // Add in map\n $result->add('mapname', 'Panau');\n $result->add('dedicated', 'true');\n }" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
// SetUlimits sets the Ulimits field's value.
[ "func (s *ContainerDefinition) SetUlimits(v []*Ulimit) *ContainerDefinition {\n\ts.Ulimits = 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 instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
TODO: refactor this
[ "def respond_to? method, include_private=false\n attribute = self.meta_attributes.select { |x| method.match /^#{x}(_id)?=?$/ }.pop\n if attribute\n self.class.find_object_from(attribute) ? true : !method.match(/^#{attribute}=?$/).nil?\n else\n super\n end\n end" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Close closes the Manager and all active sessions. All rpcc.Conn // created by Dial will be closed.
[ "func (m *Manager) Close() error {\n\tm.cancel()\n\tif m.done != nil {\n\t\treturn errors.Wrapf(<-m.done, \"session.Manager: close failed\")\n\t}\n\treturn nil\n}" ]
[ "public H2StreamProcessor startNewInboundSession(Integer streamID) {\n H2StreamProcessor h2s = null;\n h2s = muxLink.createNewInboundLink(streamID);\n return h2s;\n // call the stream processor with the data it needs to then call \"ready\" are the underlying HttpInboundLink\n // (...
codesearchnet
{ "query": "Represent the post about Computer Networking:", "pos": "Represent the code about Computer Networking:", "neg": "Represent the code:" }
Returns the meta keys associated with the property @returns {*}
[ "function () {\n return arguments.length ? _.pick(this._, Array.prototype.slice.apply(arguments)) : _.cloneDeep(this._);\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:" }
Calculates hexadecimal value of current color instance @param string $prefix @return string
[ "public function getHex($prefix = '')\n {\n return sprintf('%s%02x%02x%02x', $prefix, $this->r, $this->g, $this->b);\n }" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// SetOutputValue sets the OutputValue field's value.
[ "func (s *Output) SetOutputValue(v string) *Output {\n\ts.OutputValue = &v\n\treturn s\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Add a new template function. @param string $name @param callback $callback @return ViewHelpers
[ "public function add(string $name, callable $callback): self\n {\n if ($this->exists($name)) {\n throw new LogicException(\n 'The helper function name \"' . $name . '\" is already registered.'\n );\n }\n\n $this->helpers[$name] = $callback;\n\n ret...
[ "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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
@param string $field @param string $from @param string $to @return ExprBuilder
[ "public function between($field, $from, $to)\n {\n $this->enqueue(new BetweenExpr($field, $from, $to));\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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
--------------------------------------------------------------------------- pc.copyBufferData() Bufferに描画したデータを盤面へコピーする ---------------------------------------------------------------------------
[ "function(g,g2,x1,y1,x2,y2){\n\t\t// source側はtaranslateのぶん足されていないので、加算しておきます\n\t\tvar sx1 = this.x0+x1*this.bw-1, sy1 = this.y0+y1*this.bh-1,\n\t\t\tsx2 = this.x0+x2*this.bw+2, sy2 = this.y0+y2*this.bh+2;\n\t\tif(sx1<0){ sx1=0;} if(sx2>g2.child.width) { sx2=g2.child.width;}\n\t\tif(sy1<0){ sy1=0;} if(sy2>g2.child.h...
[ "func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// NOTE ucon内部のルーティングは一元的にこの関数から行う\n\t// Handlerを細分化しhttp.ServeMuxに登録すると、OPTIONSのhandleがうまくできなくなる\n\t// このため、Handlerはucon全体で1つとし、OPTIONSも通常のMethodと同じようにHandlerを設定し利用する\n\t// OPTIONSを適切にhandleするため、全てのHandlerに特殊なHookを入れるよりマシである\n\n\tm.router.S...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Get attribute(s) information. Args: attributes: Dict representing user attributes and values which need to be recorded. Returns: List consisting of valid attributes for the user. Empty otherwise.
[ "def _get_attributes(self, attributes):\n \n\n params = []\n\n if isinstance(attributes, dict):\n for attribute_key in attributes.keys():\n attribute_value = attributes.get(attribute_key)\n # Omit attribute values that are not supported by the log endpoint.\n if validator.is_attri...
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
%prog consensus fastafile bamfile Convert bam alignments to consensus FASTQ/FASTA.
[ "def consensus(args):\n \n p = OptionParser(consensus.__doc__)\n p.add_option(\"--fasta\", default=False, action=\"store_true\",\n help=\"Generate consensus FASTA sequences [default: %default]\")\n p.add_option(\"--mask\", default=0, type=\"int\",\n help=\"Mask bases with quality l...
[ "def runner(self):\n \n logging.info('Starting {} analysis pipeline'.format(self.analysistype))\n if not self.pipeline:\n # If the metadata has been passed from the method script, self.pipeline must still be false in order to\n # get Sippr() to function correctly, but the ...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Display this screen in html input format. @return true if default params were found for this form. @param out The http output stream. @exception DBException File exception.
[ "public boolean printData(PrintWriter out, int iPrintOptions)\n {\n boolean bFieldsFound = false;\n int iNumCols = this.getSFieldCount();\n for (int iIndex = 0; iIndex < iNumCols; iIndex++)\n {\n ScreenField sField = this.getSField(iIndex);\n boolean bPrintContro...
[ "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 comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// SetS3BucketName sets the S3BucketName field's value.
[ "func (s *UpdateTrailOutput) SetS3BucketName(v string) *UpdateTrailOutput {\n\ts.S3BucketName = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);\n\n // Note that further processing is required in JEEMetadataContextProviderImp...
codesearchnet
{ "query": "Represent the post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
@param Request $request @return ResultResponse @Route("/savesets", name="mediamanager_file_meta_sets_save")
[ "public function savesetsAction(Request $request)\n {\n $fileId = $request->get('file_id');\n $joinedIds = $request->get('ids');\n if ($joinedIds) {\n $ids = explode(',', $joinedIds);\n } else {\n $ids = [];\n }\n\n $volumeManager = $this->get('phle...
[ "public function make(ICategory $category)\r\n {\r\n //$category->setResponse($this->response->view('admin.categorys.view', compact('category')));\r\n $category->setResponse($this->response->view(\\OogleeBConfig::get('config.category_view.view'), compact('category')));\r\n }" ]
codesearchnet
{ "query": "Represent the summarization about Metadata management:", "pos": "Represent the code about Metadata management:", "neg": "Represent the code about Computer Science:" }
:returns: list of dict representing shares informations
[ "def get_share_info(self, grantee_type=None, grantee_id=None,\n grantee_name=None, owner=None, owner_type='name'):\n \n params = {}\n if grantee_type:\n if 'grantee' not in params.keys():\n params['grantee'] = {}\n params['grantee'].upd...
[ "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 text about AWS Route 53:", "pos": "Represent the Github code about AWS Route 53:", "neg": "Represent the Github code:" }
Process the values in the ini array. This method turns string values that hold array definitions (comma separated values enclosed by curly brackets) into array values. @param $value A reference to the value
[ "protected function processValue(&$value) {\r\n if (!is_array($value)) {\r\n // decode encoded (%##) values\r\n if (preg_match (\"/%/\", $value)) {\r\n $value = urldecode($value);\r\n }\r\n // make arrays\r\n if(preg_match(\"/^{.*}$/\", $value)) {\r\n $arrayValues = StringU...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// DiskIsAttached implements Volumes.DiskIsAttached
[ "func (c *Cloud) DiskIsAttached(diskName KubernetesVolumeID, nodeName types.NodeName) (bool, error) {\n\t_, instance, err := c.getFullInstance(nodeName)\n\tif err != nil {\n\t\tif err == cloudprovider.ErrInstanceNotFound {\n\t\t\t// If instance no longer exists, safe to assume volume is not attached.\n\t\t\tglog.Wa...
[ "func (st *State) WatchFilesystemAttachments(scope names.Tag) (watcher.MachineStorageIdsWatcher, error) {\n\treturn st.watchAttachments(\"WatchFilesystemAttachments\", scope, apiwatcher.NewFilesystemAttachmentsWatcher)\n}" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Update the specified resource in storage. PUT /compte/{id} @param int $id @return Response
[ "public function update($id,Request $request)\n {\n $email = $this->emails->update( $request->all() );\n\n alert()->success('Email mis à jour');\n\n return redirect('build/liste/'.$email->list_id);\n }" ]
[ "public function handle(PublishThePost $event) {\n $this->sendEmailsFromList->sendEmails($event->data['id']['listID'], $event->data['id']);\n \\Log::info('Lasallecms\\Lasallecmsapi\\Listeners\\TriggerLaSalleCRMList listener completed');\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Fills the holes information into OPhysicalPosition object given as parameter. @return true, if it's a valid hole, otherwise false @throws IOException
[ "public synchronized ODataHoleInfo getHole(final int iPosition) {\r\n final ODataHoleInfo hole = availableHolesList.get(iPosition);\r\n if (hole.dataOffset == -1)\r\n return null;\r\n return hole;\r\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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// hasCPUFreq returns if the system has cpufreq information:
[ "func (prof *Profiler) hasCPUFreq() bool {\n\t_, err := os.Stat(filepath.Join(prof.cpuPath, CPUFreq))\n\tif err == nil {\n\t\treturn true\n\t}\n\treturn false\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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Retrieves the list of individual objects that have been updated (added or changed) within the given timespan for the specified object.
[ "def getUpdated(self, sObjectType, startDate, endDate):\n '''\n \n '''\n self._setHeaders('getUpdated')\n return self._sforce.service.getUpdated(sObjectType, startDate, endDate)" ]
[ "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:" }
matchRequest @param Request $request @return MatchContext
[ "public function matchRequest(Request $request, RouteCollectionInterface $routes)\n {\n $path = $request->getPath();\n $filtered = $this->filterByMethodAndScheme($routes, $request);\n\n if ($filtered instanceof CachedCollectionInterface && 0 !== count($r = $route->findByStaticPath($path)))...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Sends a {@link Packet} to player to update the picked {@link ItemStack}. @param itemStack the item stack @param player the player @param windowId the window id
[ "public static void updatePickedItemStack(ItemStack itemStack, EntityPlayerMP player, int windowId)\n\t{\n\t\tPacket packet = new Packet(PICKEDITEM, windowId);\n\t\tpacket.draggedItemStack(itemStack);\n\t\tMalisisCore.network.sendTo(packet, player);\n\t}" ]
[ "function setSlotKey(slot, key) {\n slot.key = key;\n\n // Add the slot to the keyMap, so it is possible to quickly find the slot given its key\n keyMap[slot.key] = slot;\n }" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
集合分组统计,返回各组中对象的数量统计 @param {Array} obj 对象 @param {Function} iterate 回调/对象属性 @param {Object} context 上下文 @return {Object}
[ "function countBy (obj, iterate, context) {\n var result = groupBy(obj, iterate, context || this)\n objectEach(result, function (item, key) {\n result[key] = item.length\n })\n return result\n}" ]
[ "function hot(backendTplServer) {\n backendTplServer.app.get('/news/hot', function(request, response) {\n var data = Mock.mock({\n 'news|0-10': [news]\n });\n\n // 如果对象中有方法的定义, 最好不要放在 Mock.mock 中, 因为他会将方法定义变成直接的属性值(方法的返回值)\n data.__helper = __helper;\n\n response.ren...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Gets an option or its default value if it is not set. @param Container $app @param string $name @return mixed
[ "protected function getOption(Container $app, $name)\n {\n if (isset($app['silex_user.options'][$name])) {\n return $app['silex_user.options'][$name];\n } else {\n return self::$defaultOptions[$name];\n }\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 comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Fetch user profile information.
[ "def get_profile_data(self, raw_token):\n \"\"\"\"\"\"\n token_data = json.loads(raw_token)\n # This header is the 'magic' that makes this empty GET request work.\n headers = {'Authorization': 'OAuth %s' % token_data['access_token']}\n\n try:\n response = self.request('...
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Create a direction and parity map for use in adjacent hash calculations. @return map
[ "private static Map<Direction, Map<Parity, String>> createDirectionParityMap() {\n Map<Direction, Map<Parity, String>> m = newHashMap();\n m.put(Direction.BOTTOM, GeoHash.<Parity, String> newHashMap());\n m.put(Direction.TOP, GeoHash.<Parity, String> newHashMap());\n m.put(Direction.LEFT...
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
private function
[ "function getCacheCtor(cache){\n if (!cache){\n return;\n }\n\n if (typeof cache === 'function'){\n return cache;\n }\n\n function runtimeLoad(moduleRef){\n return require(moduleRef);\n }\n\n var cacheCtors = {\n disabled: runtimeLoad('./DisabledCache'),\n memory: runtimeLoad('./MemoryStore'),...
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetTargetARN sets the TargetARN field's value.
[ "func (s *CreateCachediSCSIVolumeOutput) SetTargetARN(v string) *CreateCachediSCSIVolumeOutput {\n\ts.TargetARN = &v\n\treturn s\n}" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Software development:" }
print error text
[ "function printError(error) {\n process.stderr.write(red);\n console.error(error.trace);\n process.stderr.write(yellow);\n console.error('an error occurred, please file an issue');\n process.stderr.write(reset);\n process.exit(1);\n }" ]
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Refreshes the current session manually using password. @param username the username @param password the password @param characterSelector the character selector @throws AuthenticationException If an exception occurs during the authentication
[ "public synchronized void refreshWithPassword(String username, String password, CharacterSelector characterSelector) throws AuthenticationException {\n\t\trefreshWithPassword(createPasswordProvider(username, password, characterSelector));\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 post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Finds a document in the collection and performs the given update. @param filter the query filter @param update the update document @param options A RemoteFindOneAndModifyOptions struct @return the resulting document
[ "public DocumentT findOneAndUpdate(final Bson filter,\n final Bson update,\n final RemoteFindOneAndModifyOptions options) {\n return proxy.findOneAndUpdate(filter, update, options);\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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Returns the elements's attributes as a string @return string
[ "public function getAttributes()\n {\n $result = [];\n foreach ($this->element->getAttributes() as $attribute => $value) {\n if (null === $value) {\n $result[] = $attribute;\n continue;\n }\n\n $result[] = \"{$attribute}=\\\"{$value}\\\...
[ "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 about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Playback command request.
[ "def command(cmd):\n \"\"\"\"\"\"\n message = create(protobuf.SEND_COMMAND_MESSAGE)\n send_command = message.inner()\n send_command.command = cmd\n return message" ]
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
@param string $word Word @return array
[ "private function getCases($word)\n {\n $cases = array_fill_keys([\n 'accusative',\n 'genitive',\n 'multiple',\n ], $word);\n\n if (!preg_match('/[а-яА-Я]+/', $word) || StringsUtil::isUppercase($word)) {\n return $cases;\n }\n\n $xml ...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Set/get actor's transparency.
[ "def alpha(self, a=None):\n \"\"\"\"\"\"\n if a is not None:\n self.GetProperty().SetOpacity(a)\n return self\n else:\n return self.GetProperty().GetOpacity()" ]
[ "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:" }