query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
All client calls to update this instance with Onshape.
[ "def update(self):\n \"\"\"\"\"\"\n self.json = c.get_document(self.uri.did).json()\n self.e_list = c.element_list(self.uri.as_dict()).json()" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Search datasets within uData portal.
[ "def search_datasets(\n self,\n license=None,\n format=None,\n query=None,\n featured=None,\n owner=None,\n organization=None,\n badge=None,\n reuses=None,\n page_size=20,\n x_fields=None,\n ):\n \"\"\"\"\"\"\n # handling ...
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Returns a translated list of month names @param bool $leadingZero Whether to generate month keys with leading zero. @return array
[ "protected function _getMonthNames($leadingZero = false)\n {\n $months = [\n '01' => __d('cake', 'January'),\n '02' => __d('cake', 'February'),\n '03' => __d('cake', 'March'),\n '04' => __d('cake', 'April'),\n '05' => __d('cake', 'May'),\n ...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Set the (unfiltered) model for the tree @param model The model for the tree
[ "public void setInputModel(TreeModel model)\r\n {\r\n Enumeration<TreePath> expandedDescendants = \r\n this.tree.getExpandedDescendants(new TreePath(treeModel.getRoot()));\r\n \r\n this.treeModel = new FilteredTreeModel(model);\r\n this.tree.setModel(treeModel);\r\n ...
[ "def surface(self, canvas, X, Y, Z, color=None, label=None, **kwargs):\n \n raise NotImplementedError(\"Implement all plot functions in AbstractPlottingLibrary in order to use your own plotting library\")" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Register a binding with the registry @param string $alias The alias used for registering the binding @param \Closure|object|string|null $binding The binding requested to register @param boolean $shared The type of the binding: shared (singleton) or not
[ "public function register($alias, $binding, $shared = false)\n {\n $this->registry[$alias] = new Resolver(new Builder($binding), $shared);\n }" ]
[ "public function initializeArguments()\n {\n $this->registerArgument('path', 'string', 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI', false, null);\n $this->registerArgument('package', 'string', 'Target package key....
codesearchnet
{ "query": "Represent the Github text about Data management:", "pos": "Represent the Github code about Data management:", "neg": "Represent the Github code about programming:" }
Write an instance. @param instance the instance to write @param f the output file. If it ends with '.gz' it will be gzipped @throws IllegalArgumentException if an error occurred while writing the json
[ "public static void write(Instance instance, File f) {\n try (OutputStreamWriter out = makeOut(f)) {\n write(instance, out);\n } catch (IOException e) {\n throw new IllegalArgumentException(e);\n }\n }" ]
[ "def file_or_token(value):\n \n if isfile(value):\n with open(value) as fd:\n return fd.read().strip()\n\n if any(char in value for char in '/\\\\.'):\n # This chars will never be in a token value, but may be in a path\n # The error message will be handled by the parser\n ...
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Creates a new Author model. If creation is successful, the browser will be redirected to the 'index' page. @return mixed
[ "public function actionCreate()\n {\n\n if (\\Yii::$app->user->can('create')) {\n $model = new Author();\n\n if ($model->load(\\Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->re...
[ "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 e-commerce:", "pos": "Represent the code about e-commerce:", "neg": "Represent the code about Software development:" }
(HTML) formatted item for display in the dropdown
[ "def format_match(self, obj):\n \n result = [escape(obj.name)]\n\n if obj.description:\n result.append(escape(obj.description))\n\n return \" \".join(result)" ]
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Sets the given field to the given value. This is an alternative to invoking a set method. @param fieldName Name of the field to set @param mojo Mojo @param value New value for the field @throws Exception If setting the field using reflection goes wrong
[ "protected static void setField(String fieldName, Object mojo, Object value) throws Exception {\n Field field = null;\n try {\n field = mojo.getClass().getDeclaredField(fieldName);\n } catch (NoSuchFieldException ex) {\n // Ignore exception and try superclass.\n ...
[ "protected static RuntimeException unsettable(String view, String attribute, boolean create) {\n // This matches the behavior of the real file system implementations: if the attempt to set the\n // attribute is being made during file creation, throw UOE even though the attribute is one\n // that cannot be ...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Computer Science:" }
parseExtensions. @param string $data @param array $result @param string $text @return void
[ "protected static function parseExtensions(&$data, &$result, $text)\n {\n // Extensions\n $data = self::parseCommon($data, $extensionData);\n $result[] = [\n \"$text (\" . self::$len . ')',\n [self::parseASN((string) $extensionData, true)], ];\n }" ]
[ "final static function f($m, array $stages = []) {return dfcf(function(M $m, array $stages) {\n\t\t/** @var string $c */$c = df_con_hier($m, __CLASS__); return new $c($m, $stages ?: ['', '']);\n\t}, [dfpm($m), $stages]);}" ]
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Assigns the execution vertex with an {@link AllocatedResource}. @param allocatedResource the resources which are supposed to be allocated to this vertex
[ "public void setAllocatedResource(final AllocatedResource allocatedResource) {\n\n\t\tif (allocatedResource == null) {\n\t\t\tthrow new IllegalArgumentException(\"Argument allocatedResource must not be null\");\n\t\t}\n\n\t\tfinal AllocatedResource previousResource = this.allocatedResource.getAndSet(allocatedResour...
[ "@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
// KillUnit takes the unit name and a UNIX signal number to send. All of the unit's // processes are killed.
[ "func (c *Conn) KillUnit(name string, signal int32) {\n\tc.sysobj.Call(\"org.freedesktop.systemd1.Manager.KillUnit\", 0, name, \"all\", signal).Store()\n}" ]
[ "function startDeamon () {\n // ps aux | grep yourscript\n // kill -s SIGINT [process_id]\n process.stdin.resume()\n process.on('SIGINT', function (err) {\n // An easy way to send the SIGINT signal is with Control-C in most terminal programs.\n // Note:\n // SIGUSR1 is reserved by node.js to start th...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// Return the current hash as a 64 bit unsigned type.
[ "func (d *State364) Sum64() uint64 {\n\td.pc, d.pb = Jenkins364(d.tail, len(d.tail), d.pc, d.pb)\n\td.hash = uint64(d.pb)<<32 | uint64(d.pc)\n\treturn d.hash\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 Github post about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Software development:" }
Initialisation d'événements sur la touche Escape pour fermer les dialogues.
[ "public static void initEscapeClosesDialogs() {\r\n\t\tfinal AWTEventListener awtEventListener = new AWTEventListener() {\r\n\t\t\t/** {@inheritDoc} */\r\n\t\t\t@Override\r\n\t\t\tpublic void eventDispatched(final AWTEvent event) {\r\n\t\t\t\tif (event instanceof KeyEvent\r\n\t\t\t\t\t\t&& ((KeyEvent) event).getKey...
[ "public static void showException(Throwable throwable) {\r\n\t\tthrowable.printStackTrace(getSystemErrorStream());\r\n\t\tJOptionPane.showMessageDialog(null, throwable.toString(),\r\n\t\t\t\tUIManager.getString(\"OptionPane.messageDialogTitle\"), JOptionPane.ERROR_MESSAGE);\r\n\t\t// on pourrait affichage une boîte...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// ParamStr returns string representation of parameter at given position.
[ "func (options *Options) ParamStr(pos int) string {\n\treturn Str(options.Param(pos))\n}" ]
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the instruction about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
Sorts the given groups of items by priority and returns flatten array of sorted items. The higher the priority, the earlier item is added to the result array. @param array $items [priority => [item, ...], ...] @return array [item, ...]
[ "private function sortByPriorityAndFlatten(array $items)\n {\n if (!empty($items)) {\n \\krsort($items);\n $items = \\array_merge(...$items);\n }\n\n return $items;\n }" ]
[ "function(c, i, array) {\n if (c === undefined || c === null) return;\n // c is the component, type is dimension|attribute,\n // level is dataset|series|observation, i is index,\n // array is the component array\n failed += !iterator.call(context, c, type, level, i, array);\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// PackString packs a string
[ "func PackString(cmd BufferEx, val string) (int, error) {\n\treturn packString(cmd, val)\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 summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Cancel all notifications.
[ "public void cancelAll() {\n if (DBG) Log.v(TAG, \"prepare to cancel all\");\n cancelSchedule(ARRIVE);\n schedule(CANCEL_ALL, 0, 0, null, 0);\n }" ]
[ "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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Merge extra config into a RootPackageInterface @param RootPackageInterface $root @param PluginState $state
[ "public function mergeExtra(RootPackageInterface $root, PluginState $state)\n {\n $extra = $this->package->getExtra();\n unset($extra['merge-plugin']);\n if (!$state->shouldMergeExtra() || empty($extra)) {\n return;\n }\n\n $rootExtra = $root->getExtra();\n $u...
[ "function resolve(){\n\t\tLRState::clear_index();\n\t\tLRStation::clear_index();\n\t\t// create Root Set\n\t\t// we SHOULD have a single etransition to an intial state\n\t\treturn LRStateSet::init( $this->etransitions[0], $this->Grammar );\n\t}" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Computer Science:" }
// Like DoString but panics on error
[ "func (L *State) MustDoString(str string) {\n\tif err := L.DoString(str); err != nil {\n\t\tpanic(err)\n\t}\n}" ]
[ "def generate(options, command: nil)\n # First, enable `always_trace`, to show the stack trace\n always_trace!\n\n used_switches = []\n options.each do |option|\n next if option.description.to_s.empty? # \"private\" options\n next unless option.display_in_shell\n\n short_swi...
codesearchnet
{ "query": "Represent the summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// DefaultDataDir is the default data directory to use for the databases and other // persistence requirements.
[ "func DefaultDataDir() string {\n\t// Try to place the data folder in the user's home dir\n\thome := homeDir()\n\tif home != \"\" {\n\t\tswitch runtime.GOOS {\n\t\tcase \"darwin\":\n\t\t\treturn filepath.Join(home, \"Library\", \"Ethereum\")\n\t\tcase \"windows\":\n\t\t\t// We used to put everything in %HOME%\\AppD...
[ "def ready(self):\n \"\"\"\"\"\"\n # Initialize the type extension composer.\n from . composer import composer\n composer.discover_extensions()\n\n is_migrating = sys.argv[1:2] == ['migrate']\n if is_migrating:\n # Do not register signals and ES indices when:\n ...
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// SetWriteCapacityUnits sets the WriteCapacityUnits field's value.
[ "func (s *ProvisionedThroughputDescription) SetWriteCapacityUnits(v int64) *ProvisionedThroughputDescription {\n\ts.WriteCapacityUnits = &v\n\treturn s\n}" ]
[ "func (a *AccumulatedCopySizeError) Error() string {\n\treturn fmt.Sprintf(\"Unable to complete the copy, the accumulated size increase of copy is %d, exceeding the limit %d\", a.accumulated, a.limit)\n}" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Computer Science:" }
Uppercase or lowercase the next character.
[ "def single_case(self, i, case):\n \"\"\"\"\"\"\n\n # Pop a previous case if we have consecutive ones.\n if self.single_stack:\n self.single_stack.pop()\n self.single_stack.append(case)\n try:\n t = next(i)\n if self.use_format and t in _CURLY_BRAC...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Import accounts from a flatfile. @param sender The command sender so we can send back messages. @return True if the convert is done. Else false.
[ "private boolean importFlatFile(String sender) {\n boolean result = false;\n\n try {\n List<String> file = new ArrayList<>();\n String str;\n while ((str = flatFileReader.readLine()) != null) {\n file.add(str);\n }\n flatFileReader....
[ "public function item()\n {\n if (!empty($this->response['data'])) {\n return new Fluent($this->resource, $this->response['data']);\n }\n\n // On a valid response that does not have a data field, we can assume that\n // the request is an update/delete type of request that d...
codesearchnet
{ "query": "Represent the text about Technical writing:", "pos": "Represent the code about Technical writing:", "neg": "Represent the code about Software development:" }
Short description of method createProperty @access public @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> @param string label @param string comment @param boolean isLgDependent @return core_kernel_classes_Property
[ "public function createProperty($label = '', $comment = '', $isLgDependent = false)\r\n {\r\n return $this->getImplementation()->createProperty($this, $label, $comment, $isLgDependent);\r\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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Reset the internal state of the triangulator
[ "public void reset() {\r\n\t\twhile (holes != null) {\r\n\t\t\tholes = freePointBag(holes);\r\n\t\t}\r\n\r\n\t\tcontour.clear();\r\n\t\tholes = null;\r\n\t}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Auto Generated Code
[ "def banner_incoming(self, **kwargs):\n \n config = ET.Element(\"config\")\n banner = ET.SubElement(config, \"banner\", xmlns=\"urn:brocade.com:mgmt:brocade-aaa\")\n incoming = ET.SubElement(banner, \"incoming\")\n incoming.text = kwargs.pop('incoming')\n\n callback = kwarg...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about File management:" }
Generator for getting the line numbers of a code object. Args: code_object: the code object. Yields: The next line number in the code object.
[ "def _GetLineNumbers(code_object):\n \n # Get the line number deltas, which are the odd number entries, from the\n # lnotab. See\n # https://svn.python.org/projects/python/branches/pep-0384/Objects/lnotab_notes.txt\n # In Python 3, this is just a byte array. In Python 2 it is a string so the\n # numerical val...
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Parse a string to a value of the given class. @param v The string to parse. @param cls The class to parse it to. @return The parsed value may be null.
[ "@SuppressWarnings(\"unchecked\")\n private <T> T parseString(String v, Class<T> cls) {\n Object value;\n if (v == null || v.length() == 0) {\n value = null;\n } else if (cls == String.class) {\n value = v;\n } else if (cls == Boolean.class || cls == boolean.clas...
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Set the QuotedPrintable dot escaper preference. @param bool $dotEscape @return $this
[ "public function setQPDotEscape($dotEscape)\n {\n $dotEscape = !empty($dotEscape);\n Swift_DependencyContainer::getInstance()\n ->register('mime.qpcontentencoder')\n ->asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoder')\n ->withDependencies(['mime.charstre...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns a string version of these replication options which are suitable for use in a CREATE KEYSPACE statement.
[ "def export_for_schema(self):\n \n if self.options_map:\n return dict((str(key), str(value)) for key, value in self.options_map.items())\n return \"{'class': '%s'}\" % (self.name, )" ]
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Decode a list of headers. Takes a list of bytestrings, returns a list of unicode strings. The character set for each bytestring is individually decoded.
[ "def decode_headers(header_list):\n\t'''\n\t\n\t'''\n\n\tdecoded_headers = []\n\tfor header in header_list:\n\t\tif cchardet:\n\t\t\tinferred = cchardet.detect(header)\n\t\t\tif inferred and inferred['confidence'] > 0.8:\n\t\t\t\t# print(\"Parsing headers!\", header)\n\t\t\t\tdecoded_headers.append(header.decode(in...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// V1EnvVarsToMap constructs a map of environment name to value from a slice // of env vars.
[ "func V1EnvVarsToMap(envs []v1.EnvVar) map[string]string {\n\tresult := map[string]string{}\n\tfor _, env := range envs {\n\t\tresult[env.Name] = env.Value\n\t}\n\n\treturn result\n}" ]
[ "def _env(self, line):\n '''\n \n '''\n line = self._setup('ENV', line)\n\n # Extract environment (list) from the line\n environ = parse_env(line)\n\n # Add to global environment, run during install\n self.install += environ\n\n # Also define for global envi...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Log. @param array $log The log value.
[ "public function log(array $log)\n {\n if ($this->loggerCallable) {\n call_user_func($this->loggerCallable, array_merge($this->logDefault, $log));\n }\n }" ]
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
/* @see com.ibm.wsspi.channelfw.InterChannelCallback#error(com.ibm.wsspi.channelfw .VirtualConnection, java.lang.Throwable)
[ "public void error(VirtualConnection vc, Throwable t) {\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {\n Tr.debug(tc, \"error() called: \" + vc);\n }\n // can't do anything with a null VC\n if (null == vc) {\n return;\n }\n Object...
[ "@Override\n public void removeSSOCookieFromResponse(HttpServletResponse resp) {\n if (resp instanceof com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) {\n ((com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) resp).removeCookie(getSSOCookiename());\n removeJwtSSOCookies((com....
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Returns $string with $numberOfChars characters removed from its end @param string $string @param int $numberOfChars @return string
[ "public static function removeCharsFromEnd($string, $numberOfChars)\n {\n $length = strlen($string);\n if ($numberOfChars >= $length) {\n return $string;\n }\n return substr($string, 0, $length - $numberOfChars);\n }" ]
[ "public static function stringCute($string, $start = 0, $end = null): string\n {\n if (!\\is_string($string)) {\n return '';\n }\n\n // $length = Helper::strlen($string);\n return self::subStr($string, $start, $end);\n }" ]
codesearchnet
{ "query": "Represent the Github text about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Programming:" }
<code>.google.privacy.dlp.v2.KmsWrappedCryptoKey kms_wrapped = 3;</code>
[ "public com.google.privacy.dlp.v2.KmsWrappedCryptoKeyOrBuilder getKmsWrappedOrBuilder() {\n if (sourceCase_ == 3) {\n return (com.google.privacy.dlp.v2.KmsWrappedCryptoKey) source_;\n }\n return com.google.privacy.dlp.v2.KmsWrappedCryptoKey.getDefaultInstance();\n }" ]
[ "@java.lang.Deprecated\n public java.util.Map<java.lang.String, com.google.cloud.oslogin.common.OsLoginProto.SshPublicKey>\n getSshPublicKeys() {\n return getSshPublicKeysMap();\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Render the pagination view, and return the view @return View the configured view object
[ "public function render()\n\t{\n\t\t// make sure we have a correct url\n\t\t$this->paginationUrl();\n\n\t\t// and a current page number\n\t\t$this->calculateNumbers();\n\n\t\t$urls = array();\n\n\t\t// generate the URL's for the pagination block\n\t\tif ($this->config['totalPages'] > 1)\n\t\t{\n\t\t\t// calculate s...
[ "@Route(method= HttpMethod.GET, uri=\"/{id}\")\n public Result get(@Parameter(\"id\") String id) {\n // The value of id is computed from the {id} url fragment.\n return ok(id);\n }" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Validate issuer format and value. @param issuer the issuer @param context the context
[ "protected final void validateIssuer(final Issuer issuer, final SAML2MessageContext context) {\n if (issuer.getFormat() != null && !issuer.getFormat().equals(NameIDType.ENTITY)) {\n throw new SAMLIssuerException(\"Issuer type is not entity but \" + issuer.getFormat());\n }\n\n final ...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// SetLevel sets the zap logger's level.
[ "func SetLevel(level string) error {\n\tl := zap.NewAtomicLevel()\n\tif err := l.UnmarshalText([]byte(level)); err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\tzaplog.SetLevel(l.Level())\n\treturn nil\n}" ]
[ "func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Computer Science:" }
Prepare form layout.
[ "protected function _layoutForm()\n {\n if (!$this->expiresOn) {\n $expiresOn = new AnDate();\n\n $expiresOn->addMonths(1);\n\n $this->set(array(\n 'expiresOn' => $expiresOn,\n ));\n }\n }" ]
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github sentence about Writing:", "pos": "Represent the Github code about Writing:", "neg": "Represent the Github code:" }
Validate non-optional parameters and return new instance.
[ "public function build(): DispatchMouseEventRequest\n\t{\n\t\t$instance = new DispatchMouseEventRequest();\n\t\tif ($this->type === null) {\n\t\t\tthrow new BuilderException('Property [type] is required.');\n\t\t}\n\t\t$instance->type = $this->type;\n\t\tif ($this->x === null) {\n\t\t\tthrow new BuilderException('P...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// SetDescription sets the Description field's value.
[ "func (s *CacheSecurityGroup) SetDescription(v string) *CacheSecurityGroup {\n\ts.Description = &v\n\treturn s\n}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Accesses a resource by structure id.<p> @param structureId the structure id of the resource @return the resource with the given structure id @throws CmsException if the resource couldn't be read
[ "protected CmsResource getResource(CmsUUID structureId) throws CmsException {\n\n if (m_cachedResources.containsKey(structureId)) {\n return m_cachedResources.get(structureId);\n }\n return m_cms.readResource(structureId);\n }" ]
[ "public RepositoryFile getRepositoryFile() throws ResourceException {\n if (_fileRef == null || _fileRef.get() == null) {\n throw new ResourceException(this, \"RepositoryFile '\" + _qualifiedPath\n + \"' is not available since it was not serializable. The RepositoryFileResource ...
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Runs through all the callable functions provided, if all are met call the given callable @author Tim Perry
[ "public function run()\n {\n if (!isset($this->conditions)\n || !isset($this->callable)\n ) {\n\n $message = \"You have called the run function but have not provided both a array of conditions\";\n $message .= \" and a callable function, which will be called if all ...
[ "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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Вызов метода API
[ "def _call(self, method, **kwargs):\n \n kwargs.update(dict(\n partnerid=self.partner_id,\n partnerkey=self.partner_key,\n method=method,\n ))\n\n url = options.ENDPOINT_URL + '?' + parse.urlencode(kwargs)\n try:\n raw_json = request.url...
[ "private function processA(array $result) {\n\t\ttry {\n\t\t\t$result = $this->processI($result);\n\t\t}\n\t\t/**\n\t\t * 2016-08-02\n\t\t * Исключительная ситуация может быть не только типа @see \\Df\\Core\\Exception,\n\t\t * но и типа @see \\Exception,\n\t\t * потому что чтение некорректных данных может приводить...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
/* 锟斤拷荼锟斤拷锟斤拷id锟斤拷锟斤拷锟阶硷拷锟斤拷bean
[ "public int insertMetaBeanById(String tableName, MicroMetaBean microMetaBean) {\r\n\t\t//JdbcTemplate jdbcTemplate = (JdbcTemplate) MicroDbHolder.getDbSource(dbName);\r\n\t\tJdbcTemplate jdbcTemplate =getMicroJdbcTemplate();\r\n\t\tfinal MicroMetaBean insertBean=microMetaBean;\r\n\t\tString timeName=getTimeName();\...
[ "static public function randString($len=6,$type='',$addChars='') {\n $str ='';\n switch($type) {\n case 0:\n $chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.$addChars;\n break;\n case 1:\n $chars= str_repeat('0123456789',...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
@param string $input @return string
[ "protected function cleanString($input)\n\t{\n\t\treturn htmlentities(\n\t\t\t$input,\n\t\t\t$this->parent->getConfig('htmlentities_flags', ENT_QUOTES),\n\t\t\t$this->parent->getConfig('htmlentities_encoding', 'UTF-8'),\n\t\t\t$this->parent->getConfig('htmlentities_double_encode', false)\n\t\t);\n\t}" ]
[ "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 instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// Query can be used in: APIKeySecurity, JWTSecurity // // Query defines that an APIKeySecurity or JWTSecurity implementation must check in the query // parameter named "parameterName" to get the api key.
[ "func Query(parameterName string) {\n\tif current, ok := dslengine.CurrentDefinition().(*design.SecuritySchemeDefinition); ok {\n\t\tif current.Kind == design.APIKeySecurityKind || current.Kind == design.JWTSecurityKind {\n\t\t\tif current.In != \"\" {\n\t\t\t\tdslengine.ReportError(\"'In' previously defined throug...
[ "public Javalin addHandler(@NotNull HandlerType httpMethod, @NotNull String path, @NotNull Handler handler) {\n return addHandler(httpMethod, path, handler, new HashSet<>()); // no roles set for this route (open to everyone with default access manager)\n }" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Tell the asset manager to pack and minimise all assets
[ "function(opts) {\n if (opts && typeof opts !== 'object') {\n throw new Error('Options passed to ss.client.packAssets() must be an object');\n }\n options.packedAssets = opts || true;\n options.servePacked = opts || true;\n options.liveReload = false;\n\n // As it's safe to assu...
[ "def limitations():\n \n limitation_list = list()\n limitation_list.append(tr('InaSAFE is not a hazard modelling tool.'))\n limitation_list.append(\n tr('InaSAFE is a Free and Open Source Software (FOSS) project, '\n 'published under the GPL V3 license. As such you may freely '\n ...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Convert an iterable of samples where each sample is a dict to a numpy 2d array. Also determines the labels is they are None.
[ "def _samples_dicts_to_array(samples_dicts, labels):\n \n itersamples = iter(samples_dicts)\n\n first_sample = next(itersamples)\n\n if labels is None:\n labels = list(first_sample)\n\n num_variables = len(labels)\n\n def _iter_samples():\n yield np.fromiter((first_sample[v] for v in...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns a string representation of this object. @return string
[ "function() {\n var name_parts = [],\n proto_ref = this.reflector.getProto()[this.name],\n name = '',\n body = '';\n\n if (this.meta.is_abstract) { name_parts.push('abstract'); }\n if (this.meta.is_final) { name_parts.push('final'); }\n\n nam...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Accesses the protected resource and logs in successfully, ensuring that a JWT SSO cookie is included in the result.
[ "public Cookie logInAndObtainJwtCookie(String testName, String protectedUrl, String username, String password) throws Exception {\n return logInAndObtainJwtCookie(testName, new WebClient(), protectedUrl, username, password);\n }" ]
[ "func (p *provisioningIdentityMapper) UserFor(info authapi.UserIdentityInfo) (kuser.Info, error) {\n\t// Retrying up to three times lets us handle race conditions with up to two conflicting identity providers without returning an error\n\t// * A single race is possible on user creation for every conflicting identit...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Retrieves one row by primary key, returning an empty row if not found @param mixed $id The primary key field value to use to retrieve one row @return \Hubzero\Database\Relational|static @since 2.0.0
[ "public static function oneOrNew($id)\n\t{\n\t\t$row = self::one($id);\n\n\t\t// See if we have a valid row\n\t\tif ($row === false)\n\t\t{\n\t\t\t$row = self::blank();\n\t\t}\n\n\t\treturn $row;\n\t}" ]
[ "public static function insert(array $data)\n {\n $self = static::getInstance();\n\n $data = static::filterColumns($data);\n\n if (!\\count($data)) {\n throw new DbException(\n \"Invalid field names of table `{$self->name}`. Please check use of `insert()` method\"\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:" }
Protect against IFRAME Clickjacking
[ "public static function addXFrame()\n {\n global $objPage;\n\n $arrSkipPages = deserialize(\\Config::get('headerXFrameSkipPages'), true);\n\n if (in_array($objPage->id, $arrSkipPages))\n {\n return;\n }\n\n header(\"X-Frame-Options: SAMEORIGIN\");\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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// DeleteJob creates a Jenkins job with the given name for the given XML job config.
[ "func (client Client) DeleteJob(jobName string) error {\n\tretry := retry.New(3, retry.DefaultBackoffFunc)\n\twork := func() error {\n\t\treq, err := http.NewRequest(\"POST\", fmt.Sprintf(\"%s/job/%s/doDelete\", client.baseURL.String(), jobName), bytes.NewBuffer([]byte(\"\")))\n\t\tif err != nil {\n\t\t\treturn err...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Determine the {@link SQLDialect} to use based on this configuration and the primary {@link DataSource}. @param dataSource the data source @return the {@code SQLDialect} to use for that {@link DataSource}
[ "public SQLDialect determineSqlDialect(DataSource dataSource) {\n\t\tif (this.sqlDialect != null) {\n\t\t\treturn this.sqlDialect;\n\t\t}\n\t\treturn SqlDialectLookup.getDialect(dataSource);\n\t}" ]
[ "private EntityMetadata getMetadata(Class<?> clazz)\n {\n EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, clazz);\n if (metadata == null)\n {\n log.error(\"Entity metadata not found for {}, possible reasons may be: \"\n + \"1)...
codesearchnet
{ "query": "Represent the sentence about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about Metadata management:" }
Convert an HTTP Range header to a Range object @param source the source @return range object
[ "public static Range convert(final String source) {\n\n final Matcher matcher = rangePattern.matcher(source);\n\n if (!matcher.matches()) {\n return new Range();\n }\n\n final String from = matcher.group(1);\n final String to = matcher.group(2);\n\n final long st...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Returns a geometric object that represents the Point set difference of this geometric object with anotherGeometry. @param geometry other geometry @return difference between this and the other geometry
[ "public JTSGeometryExpression<Geometry> difference(Expression<? extends Geometry> geometry) {\n return JTSGeometryExpressions.geometryOperation(SpatialOps.DIFFERENCE, mixin, geometry);\n }" ]
[ "function (type) {\n /**\n * Type of this object.\n * @type {WKTType}\n */\n this.type = type;\n\n /**\n * It is possible for the WKT object to be displayed not in 2D but in 3D.\n * @type {Boolean}\n * @private\n */\n this._is3d = f...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
fetches the shipping costs from the active shipping group.
[ "protected function RecalculateShipping()\n {\n $this->dCostShipping = 0;\n\n // validate shipping group - reset if not valid\n if (null !== $this->GetActiveShippingGroup()) {\n if (false === $this->SetActiveShippingGroup($this->GetActiveShippingGroup())) {\n $this-...
[ "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 instruction:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
template method for MERGE serialization @param metadata @param entity @param keys @param columns @param values @param subQuery @param context
[ "public void serializeMerge(QueryMetadata metadata, RelationalPath<?> entity,\n List<Path<?>> keys, List<Path<?>> columns, List<Expression<?>> values,\n SubQueryExpression<?> subQuery, SQLSerializer context) {\n context.serializeForMerge(metadata, entity, keys, columns, values, subQuery...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Removes all children from this node and isolates the children from each other.
[ "public final void detachChildren() {\n for (Node child = first; child != null;) {\n Node nextChild = child.next;\n child.parent = null;\n child.next = null;\n child.previous = null;\n child = nextChild;\n }\n first = null;\n }" ]
[ "function WidgetDef(config, endFunc, out) {\n this.type = config.type; // The widget module type name that is passed to the factory\n this.id = config.id; // The unique ID of the widget\n this.config = config.config; // Widget config object (may be null)\n this.state = config.state; // Widget state obje...
codesearchnet
{ "query": "Represent the summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Retrieve image urls from an incoming message. @return array A download for the image file.
[ "public function getImagesUrls()\n {\n return Collection::make($this->event->get('attachments'))->where('contentType', 'image')->map(function ($item) {\n return new Image($item['contentUrl'], $item);\n })->toArray();\n }" ]
[ "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 Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Sets the framebuffer resize callback for the specified window. Wrapper for: GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun);
[ "def set_framebuffer_size_callback(window, cbfun):\n \n window_addr = ctypes.cast(ctypes.pointer(window),\n ctypes.POINTER(ctypes.c_long)).contents.value\n if window_addr in _framebuffer_size_callback_repository:\n previous_callback = _framebuffer_size_callback_repositor...
[ "func (w *Window) SetCursorEnterCallback(cbfun func(w *Window, entered bool)) {\n\tif cbfun == nil {\n\t\tC.glfwSetCursorEnterCallback(w.data, nil)\n\t} else {\n\t\tw.fCursorEnterHolder = cbfun\n\t\tC.glfwSetCursorEnterCallbackCB(w.data)\n\t}\n}" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// UnmarshalJSON is a custom json decode for resources
[ "func (rscs Resources) UnmarshalJSON(b []byte) error {\n\tvar resources map[string]json.RawMessage\n\terr := json.Unmarshal(b, &resources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor key, value := range resources {\n\t\trsc := resource.Resource{}\n\t\terr := json.Unmarshal(value, &rsc)\n\t\tif err != nil {\n\t\t...
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
default tenon action link
[ "def action_link(title, link, icon, options = {})\n icon_tag = content_tag(:i, '', class: \"fa fa-#{icon} fa-fw\")\n default_options = { title: title, data: { tooltip: title } }\n link_to icon_tag, link, default_options.deep_merge(options)\n end" ]
[ "def _init_objcolor(self, node_opts, **kwu):\n \"\"\"\"\"\"\n objgoea = node_opts.kws['dict'].get('objgoea', None)\n # kwu: go2color go2bordercolor dflt_bordercolor key2col\n return Go2Color(self.gosubdag, objgoea, **kwu)" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// NewIndicesGetSettingsService creates a new IndicesGetSettingsService.
[ "func NewIndicesGetSettingsService(client *Client) *IndicesGetSettingsService {\n\treturn &IndicesGetSettingsService{\n\t\tclient: client,\n\t\tindex: make([]string, 0),\n\t\tname: make([]string, 0),\n\t}\n}" ]
[ "@Override\n\tpublic void validateSetup(Server server, Query query) throws ValidationException {\n\t\tlogger.info(\"Starting Stackdriver writer connected to '{}', proxy {} ...\", gatewayUrl, proxy);\n\t}" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Poll the streaming system @param delta The amount of time passed since last poll (in milliseconds)
[ "public void poll(int delta) {\r\n\t\tif (!soundWorks) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (paused) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (music) {\r\n\t\t\tif (mod != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tmod.poll();\r\n\t\t\t\t} catch (OpenALException e) {\r\n\t\t\t\t\tLog.error(\"Error with OpenGL MOD Play...
[ "def check_for_system_time_change(self): # pragma: no cover, hardly testable with unit tests...\n \n now = time.time()\n difference = now - self.t_each_loop\n\n # Now set the new value for the tick loop\n self.t_each_loop = now\n\n # If we have more than 15 min time change...
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Returns the values from a single column of the input array, identified by the key. @param array $values Array to pluck from. @param string $key Array key. @return array
[ "public static function pluck(array $values, $key)\n {\n return array_map(\n function($val) use ($key) {\n return is_object($val) ? $val->{$key} : $val[$key];\n },\n $values\n );\n }" ]
[ "private function normalize($selection)\n {\n if (isset($selection['query'])) {\n return ['query' => $selection['query']];\n }\n\n if (is_string($selection) || (is_array($selection) && isset($selection[0]))) {\n return ['id' => $selection];\n }\n\n $select...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about PHP:" }
Raise the after queue job event. @param string $connection @param \Nova\Queue\Job $job @return void
[ "protected function raiseAfterJobEvent($connection, Job $job)\n {\n if (isset($this->events)) {\n $this->events->dispatch('nova.queue.processed', array($connection, $job));\n }\n }" ]
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
--------------------------------------------
[ "@Override\n public void dissect(final Parsable<?> parsable, final String inputname) throws DissectionFailure {\n final ParsedField field = parsable.getParsableField(HTTP_FIRSTLINE, inputname);\n\n final String fieldValue = field.getValue().getString();\n if (fieldValue == null || fieldValue...
[ "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 sentence about language and writing:", "pos": "Represent the Github code about language and writing:", "neg": "Represent the Github code:" }
Start the engine.
[ "private function init()\n {\n foreach ($this->configs as $webmaster => $content) {\n $this->add($webmaster, $content);\n }\n }" ]
[ "public function postCommit(\n InputInterface $input,\n OutputInterface $output,\n ParameterBagInterface $configuration\n ): void {\n // Yes we can send a notification to slack fx?\n // Then we would just add some configuration with slack channel, username etc etc\n // A...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// SetNextMarker sets the NextMarker field's value.
[ "func (s *ListLayersOutput) SetNextMarker(v string) *ListLayersOutput {\n\ts.NextMarker = &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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Update dict with None values filtered out.
[ "def dict_filter_update(base, updates):\n # type: (dict, dict) -> None\n \n base.update((k, v) for k, v in updates.items() if v is not None)" ]
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// RemoveByName remove pkg from PackageList by import path
[ "func (t *PackageList) RemoveByName(name string) {\n\tt.ensureInit()\n\tif pkg := t.LookupByName(name); pkg != nil {\n\t\tdelete(t.pkgpool, pkg)\n\t\tdelete(t.dirpool, pkg.Dir)\n\t\tdelete(t.namepool, getPackageName(pkg))\n\t}\n}" ]
[ "def execPath(self):\n \"\"\"\"\"\"\n vers = self.version.label if self.version else None # executables in Versions folder are stored by baseVersion (modified by game data patches)\n return self.installedApp.exec_path(vers)" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Store the object on S3 @throws BuildException @return void
[ "public function execute()\n {\n if (!$this->isBucketAvailable()) {\n if (!$this->getCreateBuckets()) {\n throw new BuildException('Bucket doesn\\'t exist and createBuckets not specified');\n }\n\n if (!$this->createBucket()) {\n throw new Bui...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about File management:" }
Logs the provided data. @param level The log level @param message The message parts (may be null) @param throwable The error (may be null)
[ "@Override\n protected void logImpl(LogLevel level,Object[] message,Throwable throwable)\n {\n //format log message\n String text=this.formatLogMessage(level,message,throwable);\n \n //print text to system out\n System.out.println(text);\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 text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
/* (non-Javadoc) @see org.talend.esb.sam.server.persistence.criterias.Criteria#parseValue(java.lang.String)
[ "@Override\n public Criteria[] parseValue(String attribute) {\n long attributeValue = Long.parseLong(attribute);\n if (name.endsWith(\"_on\")) {\n // We have timestamp_on case\n DateCriteria after = new DateCriteria(name + \"_after\", columnName);\n after.value = ne...
[ "private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Replace the last element of an address with a static path element. @param element the path element @return the operation address transformer
[ "public static AliasOperationTransformer replaceLastElement(final PathElement element) {\n return create(new AddressTransformer() {\n @Override\n public PathAddress transformAddress(final PathAddress original) {\n final PathAddress address = original.subAddress(0, origina...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Adds the possessive s after a string. value = 'Hans' becomes Hans' and value = 'Susi' becomes Susi's
[ "def append_s(value):\n \n if value.endswith('s'):\n return u\"{0}'\".format(value)\n else:\n return u\"{0}'s\".format(value)" ]
[ "def naturalize_thing(self, string):\n \n\n # Things we want to move to the back of the string:\n articles = [\n 'a', 'an', 'the',\n 'un', 'une', 'le', 'la', 'les', \"l'\", \"l’\",\n 'ein', 'eine', 'der', 'die', 'das',\n ...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// IsReturnable checks che
[ "func (o *order) IsReturnable(amount int64) error {\n\tif o.Status != orderpb.Order_Paid && o.Status != orderpb.Order_Fulfilled && o.Status != orderpb.Order_Canceled {\n\t\treturn status.Error(codes.Internal, \"Order is not paid or fulfilled.\")\n\t}\n\t// if refund amount is bigger than the order amount return err...
[ "@Override\n public List findByRange(byte[] muinVal, byte[] maxVal, EntityMetadata m, boolean isWrapReq, List<String> relations,\n List<String> columns, List<IndexExpression> conditions, int maxResults) throws Exception {\n throw new UnsupportedOperationException(\"Support available only for thrift...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Generate user administration and profile @param Filesystem $files @return void
[ "private function generateUserStuff(Filesystem $files)\n {\n // TODO this is probably redundant?\n // Migrate\n $this->call('migrate');\n\n // Generate User CRUD (with new model)\n $this->call('admin:generate:admin-user', [\n '--force' => true,\n ]);\n\n ...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
TODO:Method not working properly
[ "private function fileContains($filePath, $text) {\n\t\t$fileData = file_get_contents($filePath);\n\t\tif (strpos($fileData, $text) === false ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Create a unique command name @param MethodMeta $methodMeta @param ClassMeta $classMeta @return string
[ "protected function getCommandName($methodMeta, $classMeta)\n {\n $nameSpaceParts = explode('\\\\', $classMeta->getNamespace());\n $vendor = $nameSpaceParts[0];\n $package = $nameSpaceParts[1];\n\n return strtolower($vendor . ':' . $package . ':' . str_replace(self::COMMAND_SUFFIX, ''...
[ "private function prepareGetStorageName()\n {\n $fragment = new CNabuPHPMethodBuilder(\n $this, 'getStorageName', CNabuPHPMethodBuilder::METHOD_PUBLIC, true\n );\n $fragment->addComment('Get the table name represented by this class');\n $fragment->addComment('@return string...
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
// Decode accepts a packed byte array and populates the fields of the TerrainReport
[ "func (m *TerrainReport) Decode(buf []byte) {\n\tdata := bytes.NewBuffer(buf)\n\tbinary.Read(data, binary.LittleEndian, &m.LAT)\n\tbinary.Read(data, binary.LittleEndian, &m.LON)\n\tbinary.Read(data, binary.LittleEndian, &m.TERRAIN_HEIGHT)\n\tbinary.Read(data, binary.LittleEndian, &m.CURRENT_HEIGHT)\n\tbinary.Read(d...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Parse documents from a .txt file assuming 1 document per line, yielding lists of filtered tokens
[ "def get_texts(self):\n \n with self.getstream() as text_stream:\n for i, line in enumerate(text_stream):\n line = SMSCorpus.case_normalizer(line)\n if self.mask is not None and not self.mask[i]:\n continue\n ngrams = []\n ...
[ "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 sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
/* Use $final to tag a thing as non-overrideable (comes from Java) ========================================================================
[ "function () {\n\n /* Tagging arbitrary member as $final\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */\n\n $assertThrows (function () {\n\n var A = $prototype ({\n constructor: $final (function () {}) })\n\n var B = $extends ...
[ "def scopes(cls):\n \n # Why do we need this? This should either\n # * Be bubbled to the places where it is used (AcidXBlock).\n # * Be automatic. Look for all members of a type.\n return [cls.USAGE, cls.DEFINITION, cls.TYPE, cls.ALL]" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Check if visitor is applicable to current criterion. @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion @return bool
[ "public function canVisit(Criterion $criterion)\n {\n return\n $criterion instanceof Criterion\\Subtree &&\n (\n ($criterion->operator ?: Operator::IN) === Operator::IN ||\n $criterion->operator === Operator::EQ\n );\n }" ]
[ "public function deleteStoredObjectAttribute( $contentObjectAttribute, $version = null )\n {\n $contentObjectAttributeID = $contentObjectAttribute->attribute( 'id' );\n eZTagsAttributeLinkObject::removeByAttribute( $contentObjectAttributeID, $version );\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Technology:" }
Returns the integer whose value is the reverse of the lowest 'bits' bits of the integer 'x'.
[ "function reverseBits(x, bits) {\n var y = 0;\n\n for (var i = 0; i < bits; i++) {\n y = (y << 1) | (x & 1);\n x >>>= 1;\n }\n\n return y;\n }" ]
[ "def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Natural Language Processing:" }
@param $data @param null $form @return DataValidator
[ "static function getDataValidator($data, $form = null) {\r\n $v = static::getVendor();\r\n if ($v) {\r\n $v .= '::';\r\n }\r\n $filters = (array)\\Config::get($v . 'models/' . static::getEntity() . '/filters');\r\n $rules = (array)\\Config::get($v . 'models/' . static...
[ "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 PHP:", "pos": "Represent the Github code about PHP:", "neg": "Represent the Github code about programming:" }
Writes data to the MPD socket @param string $data The data to be written @return bool
[ "private function write( $data ) {\n\n\t\tif( !$this->connection->established ) {\n\n\t\t\tLog::info('LxMPD connection is NOT established', array($data));\n\n $this->connection->establish();\n }\n\n\t\tif( !fputs( $this->connection->socket, \"$data\\n\" ) ) {\n\n\t\t\tLog::info...
[ "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 PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code:" }
// remoteFetchInstance fetches the package file into 'output' and verifies its // hash along the way. Assumes 'pin' is already validated.
[ "func (client *clientImpl) remoteFetchInstance(ctx context.Context, pin common.Pin, output io.WriteSeeker) (err error) {\n\tstartTS := clock.Now(ctx)\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tlogging.Errorf(ctx, \"cipd: failed to fetch %s - %s\", pin, err)\n\t\t} else {\n\t\t\tlogging.Infof(ctx, \"cipd: success...
[ "function(request, modules_root, options){\n var [path, analysis] = normalize_path(request, modules_root, options.relative_path_root);\n var cache_path = path; // define cachepath as path to file with content. For modules, defines path to package.json\n if(analysis.is_a_module) cache_path = \"m...
codesearchnet
{ "query": "Represent the Github description about Data processing:", "pos": "Represent the Github code about Data processing:", "neg": "Represent the Github code:" }
Store user role in cookie, so it can be used with Javascript @return void
[ "protected function _storeRoleInCookie() {\n $userRecord = Garp_Auth::getInstance()->getUserData();\n if (!empty($userRecord['role'])) {\n $cookie = new Garp_Store_Cookie('Garp_Auth');\n $cookie->userData = array('role' => $userRecord['role']);\n }\n }" ]
[ "function(list){\n localStorage.setItem(localStorageKey, JSON.stringify(list));\n // if we used a real database, we would likely do the below in a callback\n this.list = list;\n this.trigger(list); // sends the updated list to all listening components (TodoApp)\n }...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
// UpsertNodes bulk inserts nodes.
[ "func (c *Client) UpsertNodes(namespace string, servers []services.Server) error {\n\tif namespace == \"\" {\n\t\treturn trace.BadParameter(\"missing node namespace\")\n\t}\n\n\tbytes, err := services.GetServerMarshaler().MarshalServers(servers)\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\targs := &upsert...
[ "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:" }
属性值验证 @param array $columnAry 属性字段验证规则 @param mixed $propertyValue 数组字段值 @throws MysqlException
[ "private static function validate(array $columnAry, $propertyValue)\n {\n // 验证信息\n $column = $columnAry['column'];\n $length = $columnAry['length'] ?? -1;\n $validates = $columnAry['validates'] ?? [];\n $type = $columnAry['type'] ?? Types::STRING;\n $required...
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Implementation of the OnItemPickerEventListener interface
[ "@Override\n public void onSelectionChanged(FloatingLabelItemPicker<String> source, Collection<String> selectedItems) {\n Toast.makeText(getActivity(), source.getItemPrinter().printCollection(selectedItems), Toast.LENGTH_SHORT).show();\n }" ]
[ "def openCurrentItem(self):\n \n logger.debug(\"openCurrentItem\")\n _currentItem, currentIndex = self.getCurrentItem()\n if not currentIndex.isValid():\n return\n\n # Expanding the node will call indirectly call RepoTreeModel.fetchMore which will call\n # BaseRt...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Apply policy constraints handling for the preparation step. @param ValidatorState $state @param Certificate $cert @return ValidatorState
[ "private function _preparePolicyConstraints(ValidatorState $state,\n Certificate $cert): ValidatorState\n {\n $extensions = $cert->tbsCertificate()->extensions();\n if (!$extensions->hasPolicyConstraints()) {\n return $state;\n }\n $ext = $extensions->policyConstrain...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
This method is only called, when this pagerAdapter is initialized.
[ "@Override\n public final Object instantiateItem(final ViewGroup container, final int position) {\n if (Constants.DEBUG) {\n Log.i(\"InfiniteViewPager\", String.format(\"instantiating position %s\", position));\n }\n final PageModel<T> model = createPageModel(position);\n m...
[ "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 description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Various metadata about what preceded a word can (only) be drawn from the previous word.
[ "def populate_previous_punctuation(previous_word, current_word)\n if !previous_word || previous_word.ends_sentence?\n current_word.begins_sentence = true\n else\n current_word.punctuation_before = previous_word.punctuation_after\n end\n end" ]
[ "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 description about Natural Language Processing:", "pos": "Represent the code about Natural Language Processing:", "neg": "Represent the code:" }
Retrieves the person with the given id. Throwing an IllegalArgumentException if there is no such person. @param id the given id @return the person with the given id
[ "protected Person getPersonById(String id) {\n\t\tPerson person = null;\n\t\ttry {\n\t\t\tLong personId = Long.valueOf(id);\n\t\t\tif (logger.isDebugEnabled()) {\n\t\t\t\tlogger.debug(\"Retrieving Person with id=[{}]\", personId);\n\t\t\t}\n\t\t\tperson = entityManager.find(Person.class, personId);\n\t\t} catch (Nu...
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }