query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Determines whether a module exists with the given modpath.
[ "def find_module(modpath):\n \"\"\"\"\"\"\n module_path = modpath.replace('.', '/') + '.py'\n init_path = modpath.replace('.', '/') + '/__init__.py'\n for root_path in sys.path:\n path = os.path.join(root_path, module_path)\n if os.path.isfile(path):\n return path\n path = os.path.join(root_path, init_path)\n if os.path.isfile(path):\n return path" ]
[ "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 likely to be in terms of SQL path. Currently we still don't have support multiple function namespaces, nor\n // SQL path. As a result, session is not used here. We still add this to distinguish the two versions of resolveFunction\n // while the refactoring is on-going.\n return staticFunctionNamespace.resolveFunction(name, parameterTypes);\n }" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Download file(s) @param \gplcart\core\Controller $controller
[ "public function submit($controller)\n {\n set_time_limit(0);\n\n // Download method calls exit() so clean session here\n $this->session->delete('file_manager_selected');\n\n $destination = $this->file->getTempFile();\n $files = $controller->getSubmitted('files');\n\n /* @var $file \\SplFileInfo */\n $file = reset($files);\n\n $path = $file->getRealPath();\n $filename = $file->getBasename();\n\n if ($file->isFile()) {\n $result = $this->zip->file($path, $destination);\n } else if ($file->isDir()) {\n $result = $this->zip->directory($path, $destination, $filename);\n }\n\n if (!empty($result)) {\n $controller->download($destination, \"$filename.zip\");\n }\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get the parameters of bounding box of the UI element. Returns: :obj:`list` <:obj:`float`>: 4-list (top, right, bottom, left) coordinates related to the edge of screen in NormalizedCoordinate system
[ "def get_bounds(self):\n \n\n size = self.get_size()\n top_left = self.get_position([0, 0])\n\n # t, r, b, l\n bounds = [top_left[1], top_left[0] + size[0], top_left[1] + size[1], top_left[0]]\n return bounds" ]
[ "def setTopRight(self, loc):\n \n offset = self.getTopRight().getOffset(loc) # Calculate offset from current top right\n return self.setLocation(self.getTopLeft().offset(offset)) # Move top left corner by the same offset" ]
codesearchnet
{ "query": "Represent the Github summarization about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
FIXME: this and the --include-all doesn't seem to be very happy, redefine one one queries different types of pages
[ "private Predicate<HelpPage> query(final Predicate<HelpPage> predicate) {\n Predicate<HelpPage> query = predicate;\n\n if (includeAll == null || !includeAll) {\n if (includeAliases != null && !includeAliases) {\n query = query.and(TypePredicate.of(AliasHelpPage.class).negate());\n }\n if (includeMeta != null && !includeMeta) {\n query = query.and(TypePredicate.of(MetaHelpPage.class).negate());\n }\n if (includeCommands != null && !includeCommands) {\n query = query.and(TypePredicate.of(CommandHelpPage.class).negate());\n }\n if (includeGroups != null && !includeGroups) {\n query = query.and(TypePredicate.of(GroupHelpPage.class).negate());\n }\n }\n\n return query;\n }" ]
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll get false ambiguity.\n for t in sequence.unique(g.target_types()):\n __type_to_generators.setdefault(t, []).append(g)\n\n # Update the set of generators for toolset\n\n # TODO: should we check that generator with this id\n # is not already registered. For example, the fop.jam\n # module intentionally declared two generators with the\n # same id, so such check will break it.\n\n # Some generators have multiple periods in their name, so the\n # normal $(id:S=) won't generate the right toolset name.\n # e.g. if id = gcc.compile.c++, then\n # .generators-for-toolset.$(id:S=) will append to\n # .generators-for-toolset.gcc.compile, which is a separate\n # value from .generators-for-toolset.gcc. Correcting this\n # makes generator inheritance work properly.\n # See also inherit-generators in module toolset\n base = id.split ('.', 100) [0]\n\n __generators_for_toolset.setdefault(base, []).append(g)\n\n # After adding a new generator that can construct new target types, we need\n # to clear the related cached viable source target type information for\n # constructing a specific target type or using a specific generator. Cached\n # viable source target type lists affected by this are those containing any\n # of the target types constructed by the new generator or any of their base\n # target types.\n #\n # A more advanced alternative to clearing that cached viable source target\n # type information would be to expand it with additional source types or\n # even better - mark it as needing to be expanded on next use.\n #\n # For now we just clear all the cached viable source target type information\n # that does not simply state 'all types' and may implement a more detailed\n # algorithm later on if it becomes needed.\n\n invalidate_extendable_viable_source_target_type_cache()" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
As per {@link #scoreExamples(DataSet, boolean)} - the outputs (example scores) for all DataSets in the iterator are concatenated
[ "public INDArray scoreExamples(DataSetIterator iter, boolean addRegularizationTerms) {\n List<INDArray> out = new ArrayList<>();\n\n while (iter.hasNext()) {\n out.add(scoreExamples(iter.next(), addRegularizationTerms));\n }\n return Nd4j.toFlattened('f', out);\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 expected by the\n # objective function\n return objective.run(raw_output, output_files, threads)\n end" ]
codesearchnet
{ "query": "Represent the comment about Deep Learning:", "pos": "Represent the code about Deep Learning:", "neg": "Represent the code:" }
Gets local configuration. For explanation when it could die, see {@link #get()}
[ "@Restricted(NoExternalUse.class)\n public static @Nonnull JenkinsLocationConfiguration getOrDie(){\n JenkinsLocationConfiguration config = JenkinsLocationConfiguration.get();\n if (config == null) {\n throw new IllegalStateException(\"JenkinsLocationConfiguration instance is missing. Probably the Jenkins instance is not fully loaded at this time.\");\n }\n return config;\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,writeDirectory);\n \n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// New returns a generated name based on the provided id, and its matching label. // Names are title cased with spaces between words. // Labels are lowercased with hyphens between words // Deprecated: for resource names use `ForResource` instead
[ "func New(id manifold.ID) (string, string) {\n\tidBytes := id[2:]\n\n\toffset := 0\n\tadj, offset := fetchWord(idBytes, data.Adjectives, offset, aShare)\n\tcolor, offset := fetchWord(idBytes, data.Colors, offset, cShare)\n\tshape, _ := fetchWord(idBytes, data.Shapes, offset, sShare)\n\n\tname := strings.Title(adj + \" \" + color + \" \" + shape)\n\tlabel := strings.Replace(strings.ToLower(name), \" \", \"-\", -1)\n\treturn name, label\n}" ]
[ "func ValidatePodPresetName(name string, prefix bool) []string {\n\t// TODO: Validate that there's name for the suffix inserted by the pods.\n\t// Currently this is just \"-index\". In the future we may allow a user\n\t// specified list of suffixes and we need to validate the longest one.\n\treturn apimachineryvalidation.NameIsDNSSubdomain(name, prefix)\n}" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
{@inheritDoc} @param observer {@inheritDoc}
[ "@Override\n public void addDataObserver(Observer<DataProvider<M>, M> observer) {\n dataObserver.addObserver(observer);\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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Computes the cost of this point with centre centre
[ "public double costOfPointToCenter(Point centre){\n\t\tif(this.weight == 0.0){\n\t\t\treturn 0.0;\n\t\t}\n\n\t\t//stores the distance between p and centre\n\t\tdouble distance = 0.0;\n\n\t\t//loop counter\n\t\tfor(int l=0; l<this.dimension; l++){\n\t\t\t//Centroid coordinate of the point\n\t\t\tdouble centroidCoordinatePoint;\n\t\t\tif(this.weight != 0.0){\n\t\t\t\tcentroidCoordinatePoint = this.coordinates[l] / this.weight;\n\t\t\t} else {\n\t\t\t\tcentroidCoordinatePoint = this.coordinates[l];\n\t\t\t}\n\t\t\t//Centroid coordinate of the centre\n\t\t\tdouble centroidCoordinateCentre;\n\t\t\tif(centre.weight != 0.0){\n\t\t\t\tcentroidCoordinateCentre = centre.coordinates[l] / centre.weight;\n\t\t\t} else {\n\t\t\t\tcentroidCoordinateCentre = centre.coordinates[l];\n\t\t\t}\n\t\t\tdistance += (centroidCoordinatePoint-centroidCoordinateCentre) * \n\t\t\t\t\t(centroidCoordinatePoint-centroidCoordinateCentre) ;\n\t\t\t\t\t\n\t\t}\n\t\treturn distance * this.weight;\n\t}" ]
[ "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 evaluator polynomial, etc. but not the errors positions).\n # This is not necessary as anyway syndromes are defined such as there are only non-zero coefficients (the only 0 is the shift of the constant here) and subsequent computations will/must account for the shift by skipping the first iteration (eg, the often seen range(1, n-k+1)), but you can also avoid prepending the 0 coeff and adapt every subsequent computations to start from 0 instead of 1.\n return [0] + [gf_poly_eval(msg, gf_pow(generator, i+fcr)) for i in xrange(nsym)]" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about Natural Language Processing:" }
Sets whether trace logging should be enabled. Enabling trace logging automatically enables debug logging, too. @param trace Whether trace logging should be enabled or not.
[ "public static void setTrace(boolean trace) {\n FallbackLoggerConfiguration.trace.set(trace);\n if (trace) {\n debug.set(true);\n }\n }" ]
[ "function LoggerContext() {\n LifeCycle.call(this);\n\n /**\n * Context start time\n */\n this.startTime = new Date();\n\n /**\n * The list of trace levels that the logger context knows about\n */\n this.logLevel = new LogLevel();\n\n /**\n * Root logger, final ancestor of all loggers\n */\n this.rootLogger = new Logger('[root]', this);\n\n /**\n * List of loggers that have been created, indexed by name.\n */\n this.loggers = {};\n\n /**\n * List of appenders that have been registered through a call to\n * \"registerAppender\", indexed by name.\n */\n this.appenders = {};\n\n /**\n * List of filters that have been registered through a call to\n * \"registerFilter\", indexed by name.\n */\n this.filters = {};\n\n /**\n * List of layouts that have been registered through a call to\n * \"registerLayout\", indexed by name.\n */\n this.layouts = {};\n\n /**\n * List of appenders that have been instantiated.\n *\n * The list is constructed when the configuration is applied. It is used\n * to start/stop appenders when corresponding functions are called on this\n * context.\n */\n this.createdAppenders = [];\n\n /**\n * The context-wide filter.\n *\n * The filter is constructed when the configuration is applied. If the\n * configuration specifies more than one context-wide filter, a\n * CompositeFilter filter is created.\n */\n this.filter = null;\n\n /**\n * Flag set when the context is up and running\n */\n this.started = false;\n\n /**\n * Log events received by the context before it got a chance to start and\n * that need to be processed as soon as the context is operational\n *\n * The context keeps a maximum of 1000 events in memory. If more events are\n * received before the context becomes operational, the context starts to\n * drop events, replacing the first event with a warning that events had to\n * be droppes. That warning is sent to the root logger.\n */\n this.pendingEvents = [];\n\n /**\n * Maximum number of log events that can be stored in the pending list.\n *\n * TODO: adjust this setting based on configuration settings.\n */\n this.maxPendingEvents = 1000;\n\n /**\n * Number of log events that had to be discarded so far\n */\n this.discardedPendingEvents = 0;\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Force save the model even if validation fails. @param array $rules @param array $customMessages @param array $options @param Closure $beforeSave @param Closure $afterSave @return bool @see SmartModel::save()
[ "public function forceSave(array $rules = array(),\n array $customMessages = array(),\n array $options = array(),\n Closure $beforeSave = null,\n Closure $afterSave = null\n ) {\n return $this->internalSave($rules, $customMessages, $options, $beforeSave, $afterSave, true);\n }" ]
[ "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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
TODO: Support case-insensitive models
[ "public DataType resolveProperty(DataType sourceType, String identifier, boolean mustResolve) {\n DataType currentType = sourceType;\n while (currentType != null) {\n if (currentType instanceof ClassType) {\n ClassType classType = (ClassType)currentType;\n for (ClassTypeElement e : classType.getElements()) {\n if (e.getName().equals(identifier)) {\n if (e.isProhibited()) {\n throw new IllegalArgumentException(String.format(\"Element %s cannot be referenced because it is marked prohibited in type %s.\", e.getName(), ((ClassType) currentType).getName()));\n }\n\n return e.getType();\n }\n }\n }\n else if (currentType instanceof TupleType) {\n TupleType tupleType = (TupleType)currentType;\n for (TupleTypeElement e : tupleType.getElements()) {\n if (e.getName().equals(identifier)) {\n return e.getType();\n }\n }\n }\n else if (currentType instanceof IntervalType) {\n IntervalType intervalType = (IntervalType)currentType;\n switch (identifier) {\n case \"low\":\n case \"high\":\n return intervalType.getPointType();\n case \"lowClosed\":\n case \"highClosed\":\n return resolveTypeName(\"System\", \"Boolean\");\n default:\n // ERROR:\n throw new IllegalArgumentException(String.format(\"Invalid interval property name %s.\", identifier));\n }\n }\n else if (currentType instanceof ChoiceType) {\n ChoiceType choiceType = (ChoiceType)currentType;\n // TODO: Issue a warning if the property does not resolve against every type in the choice\n\n // Resolve the property against each type in the choice\n Set<DataType> resultTypes = new HashSet<>();\n for (DataType choice : choiceType.getTypes()) {\n DataType resultType = resolveProperty(choice, identifier, false);\n if (resultType != null) {\n resultTypes.add(resultType);\n }\n }\n\n // The result type is a choice of all the resolved types\n if (resultTypes.size() > 1) {\n return new ChoiceType(resultTypes);\n }\n\n if (resultTypes.size() == 1) {\n for (DataType resultType : resultTypes) {\n return resultType;\n }\n }\n }\n else if (currentType instanceof ListType && listTraversal) {\n // NOTE: FHIRPath path traversal support\n // Resolve property as a list of items of property of the element type\n ListType listType = (ListType)currentType;\n DataType resultType = resolveProperty(listType.getElementType(), identifier);\n return new ListType(resultType);\n\n }\n\n if (currentType.getBaseType() != null) {\n currentType = currentType.getBaseType();\n }\n else {\n break;\n }\n }\n\n if (mustResolve) {\n // ERROR:\n throw new IllegalArgumentException(String.format(\"Member %s not found for type %s.\", identifier, sourceType != null ? sourceType.toLabel() : null));\n }\n\n return null;\n }" ]
[ "def harvest(self, text):\n \"\"\"\"\"\"\n for match in self.harvest_regex.finditer(text):\n # TODO: optionally validate before yielding?\n # TODO: keep a list of harvested but not validated?\n yield match.group().replace('..', '.')" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Images should be a (N_images x pixels) matrix.
[ "def plot_images(images, ax, ims_per_row=5, padding=5, digit_dimensions=(28, 28),\n cmap=matplotlib.cm.binary, vmin=None, vmax=None):\n \"\"\"\"\"\"\n N_images = images.shape[0]\n N_rows = (N_images - 1) // ims_per_row + 1\n pad_value = np.min(images.ravel())\n concat_images = np.full(((digit_dimensions[0] + padding) * N_rows + padding,\n (digit_dimensions[1] + padding) * ims_per_row + padding), pad_value)\n for i in range(N_images):\n cur_image = np.reshape(images[i, :], digit_dimensions)\n row_ix = i // ims_per_row\n col_ix = i % ims_per_row\n row_start = padding + (padding + digit_dimensions[0]) * row_ix\n col_start = padding + (padding + digit_dimensions[1]) * col_ix\n concat_images[row_start: row_start + digit_dimensions[0],\n col_start: col_start + digit_dimensions[1]] = cur_image\n cax = ax.matshow(concat_images, cmap=cmap, vmin=vmin, vmax=vmax)\n plt.xticks(np.array([]))\n plt.yticks(np.array([]))\n return cax" ]
[ "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(whence=whence)" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Checks to see if all the provided matrices are the expected size for an SVD. If an error is encountered then an exception is thrown. This automatically handles compact and non-compact formats
[ "public static void checkSvdMatrixSize(DMatrixRMaj U, boolean tranU, DMatrixRMaj W, DMatrixRMaj V, boolean tranV ) {\n int numSingular = Math.min(W.numRows,W.numCols);\n boolean compact = W.numRows == W.numCols;\n\n if( compact ) {\n if( U != null ) {\n if( tranU && U.numRows != numSingular )\n throw new IllegalArgumentException(\"Unexpected size of matrix U\");\n else if( !tranU && U.numCols != numSingular )\n throw new IllegalArgumentException(\"Unexpected size of matrix U\");\n }\n\n if( V != null ) {\n if( tranV && V.numRows != numSingular )\n throw new IllegalArgumentException(\"Unexpected size of matrix V\");\n else if( !tranV && V.numCols != numSingular )\n throw new IllegalArgumentException(\"Unexpected size of matrix V\");\n }\n } else {\n if( U != null && U.numRows != U.numCols )\n throw new IllegalArgumentException(\"Unexpected size of matrix U\");\n if( V != null && V.numRows != V.numCols )\n throw new IllegalArgumentException(\"Unexpected size of matrix V\");\n if( U != null && U.numRows != W.numRows )\n throw new IllegalArgumentException(\"Unexpected size of W\");\n if( V != null && V.numRows != W.numCols )\n throw new IllegalArgumentException(\"Unexpected size of W\");\n }\n }" ]
[ "def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the same piece\n # of memory. Just checking to be sure.\n if (self.numbers != graph.numbers).any():\n raise TypeError(\"The atomic numbers in the graph do not match the \"\n \"atomic numbers in the molecule.\")" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
// Reset stores the new reader and resets its bytes.Buffer and proto.Buffer
[ "func (dec *ProtoDecoder) Reset(r io.Reader) {\n\tdec.pBuf.Reset()\n\tdec.bBuf.Reset()\n\tdec.r = r\n}" ]
[ "@Override\n public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {\n writeReqContext = x;\n muxCallback = c;\n\n // callback will need to know how to get back to this write queue.\n // This means one and only one H2WriteTree per H2InboundLink which has just one true TCP Channel facing write callback\n muxCallback.setH2WorkQ(this);\n\n tree = new Tree();\n\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// isAuditedAtProxy returns true if sessions are being recorded at the proxy // and this is a Teleport node.
[ "func (s *Server) isAuditedAtProxy() bool {\n\t// always be safe, better to double record than not record at all\n\tclusterConfig, err := s.GetAccessPoint().GetClusterConfig()\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tisRecordAtProxy := clusterConfig.GetSessionRecording() == services.RecordAtProxy\n\tisTeleportNode := s.Component() == teleport.ComponentNode\n\n\tif isRecordAtProxy && isTeleportNode {\n\t\treturn true\n\t}\n\treturn false\n}" ]
[ "func (r *controller) Update(ctx context.Context, t *api.Task) error {\n\t// TODO(stevvooe): While assignment of tasks is idempotent, we do allow\n\t// updates of metadata, such as labelling, as well as any other properties\n\t// that make sense.\n\treturn nil\n}" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Lazy load, create or adapt the table structure in the database.
[ "def _sync_table(self, columns):\n \"\"\"\"\"\"\n if self._table is None:\n # Load an existing table from the database.\n self._reflect_table()\n if self._table is None:\n # Create the table with an initial set of columns.\n if not self._auto_create:\n raise DatasetException(\"Table does not exist: %s\" % self.name)\n # Keep the lock scope small because this is run very often.\n with self.db.lock:\n self._threading_warn()\n self._table = SQLATable(self.name,\n self.db.metadata,\n schema=self.db.schema)\n if self._primary_id is not False:\n # This can go wrong on DBMS like MySQL and SQLite where\n # tables cannot have no columns.\n primary_id = self._primary_id or self.PRIMARY_DEFAULT\n primary_type = self._primary_type or Types.integer\n increment = primary_type in [Types.integer, Types.bigint]\n column = Column(primary_id, primary_type,\n primary_key=True,\n autoincrement=increment)\n self._table.append_column(column)\n for column in columns:\n if not column.name == self._primary_id:\n self._table.append_column(column)\n self._table.create(self.db.executable, checkfirst=True)\n elif len(columns):\n with self.db.lock:\n self._reflect_table()\n self._threading_warn()\n for column in columns:\n if not self.has_column(column.name):\n self.db.op.add_column(self.name, column, self.db.schema)\n self._reflect_table()" ]
[ "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 likely to be in terms of SQL path. Currently we still don't have support multiple function namespaces, nor\n // SQL path. As a result, session is not used here. We still add this to distinguish the two versions of resolveFunction\n // while the refactoring is on-going.\n return staticFunctionNamespace.resolveFunction(name, parameterTypes);\n }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// NewCiliumHealthAPI creates a new CiliumHealth instance
[ "func NewCiliumHealthAPI(spec *loads.Document) *CiliumHealthAPI {\n\treturn &CiliumHealthAPI{\n\t\thandlers: make(map[string]map[string]http.Handler),\n\t\tformats: strfmt.Default,\n\t\tdefaultConsumes: \"application/json\",\n\t\tdefaultProduces: \"application/json\",\n\t\tcustomConsumers: make(map[string]runtime.Consumer),\n\t\tcustomProducers: make(map[string]runtime.Producer),\n\t\tServerShutdown: func() {},\n\t\tspec: spec,\n\t\tServeError: errors.ServeError,\n\t\tBasicAuthenticator: security.BasicAuth,\n\t\tAPIKeyAuthenticator: security.APIKeyAuth,\n\t\tBearerAuthenticator: security.BearerAuth,\n\t\tJSONConsumer: runtime.JSONConsumer(),\n\t\tJSONProducer: runtime.JSONProducer(),\n\t\tGetHealthzHandler: GetHealthzHandlerFunc(func(params GetHealthzParams) middleware.Responder {\n\t\t\treturn middleware.NotImplemented(\"operation GetHealthz has not yet been implemented\")\n\t\t}),\n\t\tGetHelloHandler: GetHelloHandlerFunc(func(params GetHelloParams) middleware.Responder {\n\t\t\treturn middleware.NotImplemented(\"operation GetHello has not yet been implemented\")\n\t\t}),\n\t\tConnectivityGetStatusHandler: connectivity.GetStatusHandlerFunc(func(params connectivity.GetStatusParams) middleware.Responder {\n\t\t\treturn middleware.NotImplemented(\"operation ConnectivityGetStatus has not yet been implemented\")\n\t\t}),\n\t\tConnectivityPutStatusProbeHandler: connectivity.PutStatusProbeHandlerFunc(func(params connectivity.PutStatusProbeParams) middleware.Responder {\n\t\t\treturn middleware.NotImplemented(\"operation ConnectivityPutStatusProbe has not yet been implemented\")\n\t\t}),\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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Change password. @return boolean Whether the password changed.
[ "public function changePassword()\n {\n if ($this->validate()) {\n if (!($user = $this->getUser())) {\n return false;\n }\n if (!$user->applyForNewPassword()) {\n return false;\n }\n return $user->resetPassword($this->new_password, $user->getPasswordResetToken());\n }\n return false;\n }" ]
[ "public function reset(array $credentials, Closure $callback)\n {\n // If the responses from the validate method is not a user instance, we will\n // assume that it is a redirect and simply return it from this method and\n // the user is properly redirected having an error message on the post.\n $user = $this->validateReset($credentials);\n\n if (! $user instanceof CanResetPasswordContract) {\n return $user;\n }\n\n $password = $credentials['password'];\n\n // Once the reset has been validated, we'll call the given callback with the\n // new password. This gives the user an opportunity to store the password\n // in their persistent storage.\n $callback($user, $password);\n\n return static::PASSWORD_RESET;\n }" ]
codesearchnet
{ "query": "Represent the sentence about NLP:", "pos": "Represent the code about NLP:", "neg": "Represent the code about Programming:" }
// Errorf2 is part of the Logger interface
[ "func (tl *TeeLogger) Errorf2(err error, format string, v ...interface{}) {\n\ttl.ErrorDepth(1, fmt.Sprintf(format+\": %+v\", append(v, err)))\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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Parses class property @param string $fullClassName Name of the class @param string $propertyName Name of the property @return array Pair of [Property and PropertyProperty] nodes
[ "public static function parseClassProperty($fullClassName, $propertyName)\n {\n $class = self::parseClass($fullClassName);\n $classNodes = $class->stmts;\n\n foreach ($classNodes as $classLevelNode) {\n if ($classLevelNode instanceof Property) {\n foreach ($classLevelNode->props as $classProperty) {\n if ($classProperty->name->toString() == $propertyName) {\n return [$classLevelNode, $classProperty];\n }\n }\n }\n }\n\n throw new \\InvalidArgumentException(\"Property $propertyName was not found in the $fullClassName\");\n }" ]
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n // attributes array. This allows callers to get/set parameters when\n // working with new models\n $this->addHintedAttributes();\n }" ]
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software Development:" }
// NewStaticIterator constructs a random iterator from a list of nodes
[ "func NewStaticIterator(ctx Context, nodes []*structs.Node) *StaticIterator {\n\titer := &StaticIterator{\n\t\tctx: ctx,\n\t\tnodes: nodes,\n\t}\n\treturn iter\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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Creates the client object using the specified parameters. @return The build client @since 1.0.0
[ "public Client build() {\n validate();\n Client client = new Client(database, credentials, host, scheme);\n return client;\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 Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
// Trace adds a TRACE route > handler to the router.
[ "func Trace(path string, h interface{}, m ...interface{}) {\n\tDefault.Trace(path, h, m...)\n}" ]
[ "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 # CAREFUL : doesnt make sense if this node only run a one-time task...\n # TODO: futures and ThreadPoolExecutor (so we dont need to manage the pool ourselves)\n else:\n return False" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
{@inheritDoc} Try to authenticate a pre-authenticated user with Spring Security if the user has not yet been authenticated.
[ "@Override\n protected void doCommonFilter(PortletRequest request, PortletResponse response,\n javax.portlet.filter.FilterChain chain) throws IOException, PortletException {\n\n if (logger.isDebugEnabled()) {\n logger.debug(\"Checking secure context token: \" + SecurityContextHolder.getContext().getAuthentication());\n }\n\n if (requiresAuthentication((PortletRequest) request)) {\n doAuthenticate((PortletRequest) request, (PortletResponse) response);\n }\n\n PortletFilterUtils.doFilter(request, response, chain);\n }" ]
[ "private boolean isInternalUnprotectedMethod(EJBMethodMetaData methodMetaData) {\n EJBMethodInterface interfaceType = methodMetaData.getEJBMethodInterface();\n /***\n * For TIMED_OBJECT, the code references EJB 2.1 spec section 22.2.2 and matches a\n * method signature, which is necessary but not sufficient. As of EJB 3.0, the\n * TimedObject interface is not necessary and arbitrary methods can be designated\n * as timeout callback methods using the @Timeout annotation. Further, the EJB\n * 3.1 spec adds the ability to specify timeout methods without a Timer argument,\n * and it also adds new timeout callback methods via the @Schedule annotation. In\n * all of these cases, the MethodInterface will be TIMED_OBJECT.\n *\n * For LIFECYCLE_INTERCEPTOR, this type is used only for lifecycle interceptors of\n * EJB 3.1 singleton session beans. This type should have been added to the EJB 3.1\n * spec, but it was overlooked by the EG. However, EJB container needs to classify\n * methods in this way, so an internal type was added.\n *\n * For background on why returning true from internalUnprotected is correct for\n * LIFECYCLE_INTERCEPTOR, a singleton method invocation has two steps, and the\n * container invokes the security collaborator for each.\n *\n * 1. Obtain the bean instance if it does not already exist.\n * If the bean does not exist, the container calls the security collaborator\n * with LifecycleInterceptor to establish a RunAs security context. However,\n * authorization checks are not needed because the bean is performing\n * initialization, not business logic. Further, attempting to pass the\n * internal-only LifecycleInterceptor type to JACC causes an\n * IllegalArgumentException.\n *\n * If a singleton session bean is annotated @Startup, then the container\n * performs this step as part of application start rather than when a method\n * is first invoked on the bean. This is the scenario for this defect.\n *\n * 2. Invoke the business method.\n * The container calls the security collaborator \"as normal\" with Local,\n * Remote, or ServiceEndpoint to both authorize the caller security context\n * and to establish a RunAs security context as needed.\n *\n * Per EJB spec section 22.2.2:\n *\n * Since the ejbTimeout method is an internal method of the bean class,\n * it has no client security context. When getCallerPrincipal is called\n * from within the ejbTimeout method, it returns the container\n * representation of the unauthenticated identity.\n * Since the ejbTimeout method is an internal method of the bean class,\n * it has no client security context. The Bean Provider should use the\n * run-as deployment descriptor element to specify a security identity to\n * be used for the invocation of methods from within the ejbTimeout method.\n *\n * Because of the above spec requirements, we still need to establish the\n * runasSpecified identity when this method is called.\n **/\n if (EJBMethodInterface.LIFECYCLE_INTERCEPTOR.value() == (interfaceType.value()) ||\n EJBMethodInterface.TIMER.value() == (interfaceType.value())) {\n return true;\n //TODO: should this logic go into ejb container?\n }\n return false;\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// GetTrafficMonitoringConfig トラフィックコントロール 取得
[ "func (api *MobileGatewayAPI) GetTrafficMonitoringConfig(id int64) (*sacloud.TrafficMonitoringConfig, error) {\n\tvar (\n\t\tmethod = \"GET\"\n\t\turi = fmt.Sprintf(\"%s/%d/mobilegateway/traffic_monitoring\", api.getResourceURL(), id)\n\t)\n\n\tres := &trafficMonitoringBody{}\n\terr := api.baseAPI.request(method, uri, nil, res)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn res.TrafficMonitoring, nil\n}" ]
[ "function GroupProfile(_id, _owner) {\n this._id = _id;\n this._owner = _owner;\n this._parent = null; //!< 親 GroupProfile インスタンス\n this._children = []; //!< 子 GroupProfile インスタンス\n this._expanded = false; //!< 開閉情報\n this._status = \"unregistered\"; //!< _owner への登録状態 [ unregistered | registered ]\n this._mapLines = {}; //!< 自身が管轄する LineProfile を key とともに格納\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Hook that allows actions when data was saved When not rerouted, the form will be populated afterwards @param int $changed The number of changed rows (0 or 1 usually, but can be more)
[ "protected function afterSave($changed)\n {\n if ($changed) {\n $this->accesslog->logChange($this->request, null, $this->formData);\n\n // Reload the current user data\n $user = $this->currentUser;\n $currentOrg = $user->getCurrentOrganizationId();\n\n $this->loader->getUserLoader()->unsetCurrentUser();\n $user = $this->loader->getUser($user->getLoginName(), $user->getBaseOrganizationId())->setAsCurrentUser();\n $user->setCurrentOrganization($currentOrg);\n\n // In case locale has changed, set it in a cookie\n \\Gems_Cookies::setLocale($this->formData['gsf_iso_lang'], $this->basepath);\n\n $this->addMessage($this->_('Saved your setup data', $this->formData['gsf_iso_lang']));\n } else {\n $this->addMessage($this->_('No changes to save!'));\n }\n\n if ($this->cacheTags && ($this->cache instanceof \\Zend_Cache_Core)) {\n $this->cache->clean(\\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, (array) $this->cacheTags);\n }\n }" ]
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maximum_rows_actions'],\n $configGeneral['datatable_archiving_maximum_rows_subtable_actions']\n );\n\n // FIXME: This is a quick fix for #3482. The actual cause of the bug is that\n // the site search & performance metrics additions to\n // ArchivingHelper::updateActionsTableWithRowQuery expect every\n // row to have 'type' data, but not all of the SQL queries that are run w/o\n // ranking query join on the log_action table and thus do not select the\n // log_action.type column.\n //\n // NOTES: Archiving logic can be generalized as follows:\n // 0) Do SQL query over log_link_visit_action & join on log_action to select\n // some metrics (like visits, hits, etc.)\n // 1) For each row, cache the action row & metrics. (This is done by\n // updateActionsTableWithRowQuery for result set rows that have\n // name & type columns.)\n // 2) Do other SQL queries for metrics we can't put in the first query (like\n // entry visits, exit vists, etc.) w/o joining log_action.\n // 3) For each row, find the cached row by idaction & add the new metrics to\n // it. (This is done by updateActionsTableWithRowQuery for result set rows\n // that DO NOT have name & type columns.)\n //\n // The site search & performance metrics additions expect a 'type' all the time\n // which breaks the original pre-rankingquery logic. Ranking query requires a\n // join, so the bug is only seen when ranking query is disabled.\n if ($limit === 0) {\n $limit = 100000;\n }\n return $limit;\n\n }" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// InsertCIDR inserts an entry to 'cm' with key 'cidr'. Value is currently not // used.
[ "func (cm *CIDRMap) InsertCIDR(cidr net.IPNet) error {\n\tkey := cm.cidrKeyInit(cidr)\n\tentry := [LPM_MAP_VALUE_SIZE]byte{}\n\tif err := cm.checkPrefixlen(&key, \"update\"); err != nil {\n\t\treturn err\n\t}\n\tlog.WithField(logfields.Path, cm.path).Debugf(\"Inserting CIDR entry %s\", cidr.String())\n\treturn bpf.UpdateElement(cm.Fd, unsafe.Pointer(&key), unsafe.Pointer(&entry), 0)\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 # subtree thus we can not safely delete nodes for now\n #\n # \\@db.delete encoded\n end" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Returns true if there is a permission for the given id @access public @param integer $id @return boolean @throws \Zepi\Core\AccessControl\Exception Cannot check if there is a permission for the given id "{id}".
[ "public function hasPermissionForId($id)\n {\n try {\n $em = $this->entityManager->getDoctrineEntityManager();\n $permission = $em->getRepository('\\\\Zepi\\\\Core\\\\AccessControl\\\\Entity\\\\Permission')->find($id);\n \n if ($permission !== null) {\n return true;\n }\n \n return false;\n } catch (\\Exception $e) {\n throw new Exception('Cannot check if there is a permission for the given id \"' . $id . '\".', 0, $e);\n }\n }" ]
[ "protected function getUsersPassword()\n {\n\n try {\n // load the application context\n $application = RequestHandler::getApplicationContext();\n\n // load and return the user's password or throw an exception\n return new String($application->search(sprintf('%s/%s', $this->userPathPrefix, $this->getUsername())));\n\n } catch (\\Exception $e) {\n throw new LoginException('No matching username found in naming directory');\n }\n }" ]
codesearchnet
{ "query": "Represent the summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// EncodeJSON encodes a transaction into a JSON data dump.
[ "func (tx *Transaction) EncodeJSON() (string, error) {\n\tdata, err := json.Marshal(tx.tx)\n\treturn string(data), err\n}" ]
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// hasKeyPath - if the map 'key' exists append it to KeyPath.path and increment KeyPath.depth // This is really just a breadcrumber that saves all trails that hit the prescribed 'key'.
[ "func hasKeyPath(crumb string, iv interface{}, key string, basket *map[string]bool) {\n\tswitch iv.(type) {\n\tcase map[string]interface{}:\n\t\tvv := iv.(map[string]interface{})\n\t\tif _, ok := vv[key]; ok {\n\t\t\tif crumb == \"\" {\n\t\t\t\tcrumb = key\n\t\t\t} else {\n\t\t\t\tcrumb += \".\" + key\n\t\t\t}\n\t\t\t// *basket = append(*basket, crumb)\n\t\t\t(*basket)[crumb] = true\n\t\t}\n\t\t// walk on down the path, key could occur again at deeper node\n\t\tfor k, v := range vv {\n\t\t\t// create a new breadcrumb, add the one we're at to the crumb-trail\n\t\t\tvar nbc string\n\t\t\tif crumb == \"\" {\n\t\t\t\tnbc = k\n\t\t\t} else {\n\t\t\t\tnbc = crumb + \".\" + k\n\t\t\t}\n\t\t\thasKeyPath(nbc, v, key, basket)\n\t\t}\n\tcase []interface{}:\n\t\t// crumb-trail doesn't change, pass it on\n\t\tfor _, v := range iv.([]interface{}) {\n\t\t\thasKeyPath(crumb, v, key, basket)\n\t\t}\n\t}\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 converts multiple language tags into one\n // Otherwise, it assumes that a single name_ tag exists with JSON content, and it will replace\n // it with multiple tags \"name_en\", \"name_fr\", ... depending on the JSON language codes\n this.namePicker = options.namePicker;\n\n // Flag to make requested_name (local_name) form\n this.combineName = options.combineName;\n}" ]
codesearchnet
{ "query": "Represent the description about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
helpers. @param [type] $string [description] @param [type] $event [description] @return [type] [description]
[ "public function alert($string, $event)\n {\n $this->comment(str_repeat('*', strlen($string) + 12), $event);\n $this->comment('* ' . $string . ' *', $event);\n $this->comment(str_repeat('*', strlen($string) + 12), $event);\n }" ]
[ "function Message(instanceList, // @arg InstanceObject - address list. { id: instance, ... }\n methodName) { // @arg MethodNameString = \"inbox\" - instance[method]\n // @desc MessagePassing implementation.\n this._instanceList = instanceList;\n this._methodName = methodName || \"inbox\";\n\n//{@dev\n $valid($type(instanceList, \"Object\"), Message, \"instanceList\");\n $valid($type(methodName, \"String|omit\"), Message, \"methodName\");\n\n for (var id in instanceList) {\n $valid($type(instanceList[id][this._methodName], \"Function\"), Message, \"methodName\"); // instance has not method.\n }\n//}@dev\n}" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// SetSizeConstraints sets the SizeConstraints field's value.
[ "func (s *SizeConstraintSet) SetSizeConstraints(v []*SizeConstraint) *SizeConstraintSet {\n\ts.SizeConstraints = v\n\treturn s\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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Add metadata filters to metadata resolver. @param metadataProvider the metadata provider @param metadataFilterList the metadata filter list
[ "protected void addMetadataFiltersToMetadataResolver(final AbstractMetadataResolver metadataProvider, final MetadataFilter... metadataFilterList) {\n addMetadataFiltersToMetadataResolver(metadataProvider, Arrays.stream(metadataFilterList).collect(Collectors.toList()));\n }" ]
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototype link\n :return: Tuple of key/value tuples from the attributes; suitable for hashing\n '''\n computed_rels = [ rel(ctx) if callable(rel) else rel for rel in rels ]\n return computed_rels\n return _values" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Shows collections with ACL.
[ "def access_storage_list(**kwargs):\n \n ctx = Context(**kwargs)\n ctx.execute_action('access:storage:list', **{\n 'storage': ctx.repo.create_secure_service('storage'),\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 CAP\n}" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
escape quotes by doubling them when we need a string inside quotes @param o @return
[ "protected String escapeQuotes(Object o) {\n if (o != null) {\n return o.toString().replace(\"'\", \"''\");\n }\n return null;\n }" ]
[ "def label(self, string):\n \n if '*/' in string:\n raise ValueError(\"Bad label - cannot be embedded in SQL comment\")\n return self.extra(where=[\"/*QueryRewrite':label={}*/1\".format(string)])" ]
codesearchnet
{ "query": "Represent the Github post about text processing:", "pos": "Represent the Github code about text processing:", "neg": "Represent the Github code about Software development:" }
// ImageWxH returns a screenshot at the ts milliseconds, scaled to the specified width and height.
[ "func (g *Generator) ImageWxH(ts int64, width, height int) (image.Image, error) {\n\tframeNum := C.av_rescale(\n\t\tC.int64_t(ts),\n\t\tC.int64_t(g.streams[g.vStreamIndex].time_base.den),\n\t\tC.int64_t(g.streams[g.vStreamIndex].time_base.num),\n\t) / 1000\n\tif C.avformat_seek_file(\n\t\tg.avfContext,\n\t\tC.int(g.vStreamIndex),\n\t\t0,\n\t\tframeNum,\n\t\tframeNum,\n\t\tC.AVSEEK_FLAG_FRAME,\n\t) < 0 {\n\t\tif C.avformat_seek_file(\n\t\t\tg.avfContext,\n\t\t\tC.int(g.vStreamIndex),\n\t\t\t0,\n\t\t\tframeNum,\n\t\t\tframeNum,\n\t\t\tC.AVSEEK_FLAG_ANY,\n\t\t) < 0 {\n\t\t\treturn nil, errors.New(\"can't seek to timestamp\")\n\t\t}\n\t}\n\timg := image.NewRGBA(image.Rect(0, 0, width, height))\n\tframe := C.av_frame_alloc()\n\tdefer C.av_frame_free(&frame)\n\tC.avcodec_flush_buffers(g.avcContext)\n\tpkt := C.av_packet_alloc()\n\tfor C.av_read_frame(g.avfContext, pkt) == 0 {\n\t\tif int(pkt.stream_index) != g.vStreamIndex {\n\t\t\tC.av_packet_unref(pkt)\n\t\t\tcontinue\n\t\t}\n\t\tif C.avcodec_send_packet(g.avcContext, pkt) != 0 {\n\t\t\tC.av_packet_unref(pkt)\n\t\t\treturn nil, errors.New(\"avcodec_send_packet failed\")\n\t\t}\n\t\tdts := pkt.dts\n\t\tC.av_packet_unref(pkt)\n\t\tif ret := C.avcodec_receive_frame(g.avcContext, frame); ret != 0 {\n\t\t\tif ret != C.AVERROR_EAGAIN {\n\t\t\t\treturn nil, errors.New(\"avcodec_receive_frame failed\")\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif !g.Fast && dts < frameNum {\n\t\t\tcontinue\n\t\t}\n\t\tctx := C.sws_getContext(\n\t\t\tC.int(g.width),\n\t\t\tC.int(g.height),\n\t\t\tg.avcContext.pix_fmt,\n\t\t\tC.int(width),\n\t\t\tC.int(height),\n\t\t\tC.AV_PIX_FMT_RGBA,\n\t\t\tC.SWS_BICUBIC,\n\t\t\tnil,\n\t\t\tnil,\n\t\t\tnil,\n\t\t)\n\t\tif ctx == nil {\n\t\t\treturn nil, errors.New(\"can't allocate scaling context\")\n\t\t}\n\t\tsrcSlice := (**C.uint8_t)(&frame.data[0])\n\t\tsrcStride := (*C.int)(&frame.linesize[0])\n\t\thdr := (*reflect.SliceHeader)(unsafe.Pointer(&img.Pix))\n\t\tdst := (*C.uint8_t)(unsafe.Pointer(hdr.Data))\n\t\tdstStride := (*C.int)(unsafe.Pointer(&[1]int{img.Stride}))\n\t\tC.sws_scale_wrapper(\n\t\t\tctx,\n\t\t\tsrcSlice,\n\t\t\tsrcStride,\n\t\t\t0,\n\t\t\tg.avcContext.height,\n\t\t\tdst,\n\t\t\tdstStride,\n\t\t)\n\t\tC.sws_freeContext(ctx)\n\t\tbreak\n\t}\n\treturn img, nil\n}" ]
[ "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(int(opts['--zres']));\n if use == []:\n use = ['x','y','z'];\n res = map(lambda k: int(opts[k]),['--xres','--yres','--zres']);\n # A couple of things to note; written in this way, whatever\n # this list (and thus, what is read) becomes, it is ordered\n # alphabetically. This is important, as this determines what\n # each resulting row and column and breadth in the output\n # array corresponds to from the actual simulation.\n #\n # It is probably worth mentioning that the xz in simulation\n # axes will be [0,1] in numpy axes, that is, it will be left-handed.\n # Using xz leads to this anyway, but it's worth reminding the reader.\n # To permute in 2D, use the --permute flag.\n return use,res;" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Returns true if the property exists on the wrapped object. @param string $property The name of the property to search for. @return boolean True if the property exists.
[ "public function __isset($property)\n {\n if ($propertyReflector = $this->liberatorPropertyReflector($property)) {\n return null !== $propertyReflector->getValue($this->popsValue());\n }\n\n return parent::__isset($property);\n }" ]
[ "function Pointer ($ref, path, friendlyPath) {\n /**\n * The {@link $Ref} object that contains this {@link Pointer} object.\n * @type {$Ref}\n */\n this.$ref = $ref;\n\n /**\n * The file path or URL, containing the JSON pointer in the hash.\n * This path is relative to the path of the main JSON schema file.\n * @type {string}\n */\n this.path = path;\n\n /**\n * The original path or URL, used for error messages.\n * @type {string}\n */\n this.originalPath = friendlyPath || path;\n\n /**\n * The value of the JSON pointer.\n * Can be any JSON type, not just objects. Unknown file types are represented as Buffers (byte arrays).\n * @type {?*}\n */\n this.value = undefined;\n\n /**\n * Indicates whether the pointer references itself.\n * @type {boolean}\n */\n this.circular = false;\n\n /**\n * The number of indirect references that were traversed to resolve the value.\n * Resolving a single pointer may require resolving multiple $Refs.\n * @type {number}\n */\n this.indirections = 0;\n}" ]
codesearchnet
{ "query": "Represent the sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Programming:" }
Check if value/values are not empty This method uses func_get_args() so you can pass in as many variables/items as you want! @return boolean True if all value/values are not empty, false if one of the elements are empty
[ "public static function isNotEmpty() {\n $args = func_get_args();\n\n foreach ($args as $item) {\n\n if (is_array($item) && empty($item)) {\n return false;\n }\n else {\n $item = trim($item);\n if (empty($item) && $item !== \"0\") //0 as string is allowed, a field can be zero as string\n return false;\n }\n }\n\n return true;\n }" ]
[ "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 const value = object[path];\n\n // set the value on the result according to\n // the dot notation path (if the key is a dot\n // notation path)\n result = set(result, path, value);\n });\n\n // returned the result\n return result;\n }\n\n // if the object isn't an object or is empty return\n // an empty object this will keep the return immutable\n return {};\n}" ]
codesearchnet
{ "query": "Represent the description about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Adds a tablespace to the Postgres server. CLI Example: .. code-block:: bash salt '*' postgres.tablespace_create tablespacename '/path/datadir' .. versionadded:: 2015.8.0
[ "def tablespace_create(name, location, options=None, owner=None, user=None,\n host=None, port=None, maintenance_db=None, password=None,\n runas=None):\n '''\n \n '''\n owner_query = ''\n options_query = ''\n if owner:\n owner_query = 'OWNER \"{0}\"'.format(owner)\n # should come out looking like: 'OWNER postgres'\n if options:\n optionstext = ['{0} = {1}'.format(k, v) for k, v in six.iteritems(options)]\n options_query = 'WITH ( {0} )'.format(', '.join(optionstext))\n # should come out looking like: 'WITH ( opt1 = 1.0, opt2 = 4.0 )'\n query = 'CREATE TABLESPACE \"{0}\" {1} LOCATION \\'{2}\\' {3}'.format(name,\n owner_query,\n location,\n options_query)\n\n # Execute the command\n ret = _psql_prepare_and_run(['-c', query],\n user=user, host=host, port=port,\n maintenance_db=maintenance_db,\n password=password, runas=runas)\n return ret['retcode'] == 0" ]
[ "def _get_migrate_command():\n '''\n \n '''\n tunnel = __salt__['config.option']('virt.tunnel')\n if tunnel:\n salt.utils.versions.warn_until(\n 'Sodium',\n '\\'virt.tunnel\\' has been deprecated in favor of '\n '\\'virt:tunnel\\'. \\'virt.tunnel\\' will stop '\n 'being used in {version}.')\n else:\n tunnel = __salt__['config.get']('virt:tunnel')\n if tunnel:\n return ('virsh migrate --p2p --tunnelled --live --persistent '\n '--undefinesource ')\n return 'virsh migrate --live --persistent --undefinesource '" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get the blocks around the one given. Returns: a list of all of those blocks.
[ "def get_surrounding_blocks(self):\n \n\n next = self.next_blocks()\n prev = self.previous_blocks()\n\n surrounding_blocks = list(chain(prev, [self], next))\n return surrounding_blocks" ]
[ "def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the same piece\n # of memory. Just checking to be sure.\n if (self.numbers != graph.numbers).any():\n raise TypeError(\"The atomic numbers in the graph do not match the \"\n \"atomic numbers in the molecule.\")" ]
codesearchnet
{ "query": "Represent the Github comment about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code:" }
// Generate create a pid file for own process.
[ "func Generate(pidfile string, chDel <-chan struct{}) error {\n\tf, err := os.OpenFile(pidfile, os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\tfmt.Fprintln(f, os.Getpid())\n\tif chDel != nil {\n\t\tgo func() {\n\t\t\tselect {\n\t\t\tcase <-chDel:\n\t\t\t\tos.Remove(pidfile)\n\t\t\t}\n\t\t}()\n\t}\n\treturn nil\n}" ]
[ "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 # CAREFUL : doesnt make sense if this node only run a one-time task...\n # TODO: futures and ThreadPoolExecutor (so we dont need to manage the pool ourselves)\n else:\n return False" ]
codesearchnet
{ "query": "Represent the Github summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
移除事件监听 @param string $type 事件类型 @param string $plugin 监听器
[ "public function removeEventListener($type, $plugin) {\n\t\t$type = strtolower($type);\n\t\tif (isset($this->eventsListeners[$type]) && in_array($plugin, $this->eventsListeners[$type])) {\n\t\t\t$index = array_search($plugin, $this->eventsListeners[$type]);\n\t\t\tarray_splice($this->eventsListeners[$type], $index, 1);\n\t\t}\n\t}" ]
[ "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 $c = strtolower($info[1]);\n // 获取方法名称 转换成小写\n $a = strtolower($info[2]);\n\n }else{ // 当用户没有参数传递时设置默认参数\n\n // 模块名称 默认名称\n $m = 'home';\n // 默认控制器\n $c = 'entry';\n // 默认方法名称\n $a = 'index';\n }\n\n // 定义三个常量 将路由参照中的模块 控制器和方法定义成方法\n // 用于在view核心方法中能够访问到这些参数,凭借出模板的路径方便控制器载入模板\n\n // 模块常量\n define('MODULE',$m);\n // 控制器常量\n define('CONTROLLER',$c);\n // 方法名常量\n define('ACTION',$a);\n\n // 根据get参数的在自动执行对象类中的方法\n // 因为类名称首字母大写 为保持一致转换成大写\n $controller = ucfirst($c);\n\n // 拼接对应类的命名 ,实现不同参数调用不同的类,文件以及通过composer自动加载了\n // 路径如:\\app\\home\\controller\\Entry()\n // 其中上面路径中 app controller是固定不变的 ,\n // home:对应的模块\n // Entry: 方法名称\n // 拼接路径是需要将home 和Entry用变量替换\n $class = \"\\app\\\\{$m}\\controller\\\\{$controller}\";\n\n // 执行对应的方法 实现路由的分配\n // 通过echo 触发view 中Base类中的__toString 方法\n\n echo call_user_func_array([new $class,$a],[]);\n\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Decrement a raw value @param string $id Cache ID @param int $offset Step/value to reduce by @return mixed New value on success or FALSE on failure
[ "public function decrement($id, $offset = 1)\n\t{\n\t\t$success = FALSE;\n\t\t$value = wincache_ucache_dec($id, $offset, $success);\n\n\t\treturn ($success === TRUE) ? $value : FALSE;\n\t}" ]
[ "public function singlePcmlToParam(\\SimpleXmlElement $dataElement)\n {\n $tagName = $dataElement->getName();\n \n // get attributes of this element.\n $attrs = $dataElement->attributes();\n \n // both struct and data have name, count (optional), usage\n $name = (isset($attrs['name'])) ? (string) $attrs['name'] : '';\n $count = (isset($attrs['count'])) ? (string) $attrs['count'] : '';\n $usage = (isset($attrs['usage'])) ? (string) $attrs['usage'] : '';\n $structName = (isset($attrs['struct'])) ? (string) $attrs['struct'] : '';\n \n // fill this if we have a struct\n $subElements = array();\n \n // each item should have tag name <data>\n if ($tagName != 'data') {\n return false;\n }\n \n $type = (isset($attrs['type'])) ? (string) $attrs['type'] : '';\n\n // Get initial value, if specified by PCML.\n $dataValue = (isset($attrs['init'])) ? (string) $attrs['init'] : '';\n \n // if a struct then we need to recurse.\n if ($type == 'struct') {\n $theStruct = null; // init\n\n // look for matching struct definition encountered earlier.\n if ($this->_pcmlStructs) {\n\n // @todo verify type with is_array and count\n foreach ($this->_pcmlStructs as $possibleStruct) {\n $possStructAttrs = $possibleStruct->attributes();\n \n if ($possStructAttrs['name'] == $structName) {\n $theStruct = $possibleStruct;\n $structAttrs = $possStructAttrs;\n break;\n }\n }\n }\n\n // if struct was not found, generate error for log\n if (!$theStruct) {\n // $this->getConnection->logThis(\"PCML structure '$structName' not found.\");\n return null;\n }\n\n // count can also be defined at the structure level. If so, it will override count from data level)\n if (isset($structAttrs['count'])) {\n $count = (string) $structAttrs['count'];\n }\n\n // \"usage\" (in/out/inherit) can be defined here, at the structure level.\n $structUsage = (isset($structAttrs['usage'])) ? (string) $structAttrs['usage'] : '';\n\n // if we're not inheriting from our parent data element, but there is a struct usage, use the struct's usage (input, output, or inputoutput).\n if (!empty($structUsage) && ($structUsage != 'inherit')) {\n $usage = $structUsage;\n }\n\n $structSubDataElementsXmlObj = $theStruct->xpath('data');\n if ($structSubDataElementsXmlObj) {\n foreach ($structSubDataElementsXmlObj as $subDataElementXmlObj) {\n\n if ($subDataElementXmlObj->attributes()->usage == 'inherit') {\n // subdata is inheriting type from us. Give it to them.\n $subDataElementXmlObj->attributes()->usage = $usage;\n }\n\n // here's where the recursion comes in. Convert data and add to array for our struct.\n $subElements[] = $this->singlePcmlToParam($subDataElementXmlObj);\n }\n }\n }\n\n /* explanation of the terms \"length\" and \"precision\" in PCML:\n * http://publib.boulder.ibm.com/infocenter/iadthelp/v6r0/index.jsp?topic=/com.ibm.etools.iseries.webtools.doc/ref/rdtcattr.htm\n * \n * For \"int\" values, length is the number of bytes; precision represents the number of bits. (Can be ignored here)\n * For zoned and packed values, length is the maximum number of digits; precision represents the maximum decimal places.\n * \n */\n $length = (isset($attrs['length'])) ? (string) $attrs['length'] : '';\n $precision = (isset($attrs['precision'])) ? (string) $attrs['precision'] : '';\n\n $passBy = ''; // default of blank will become 'ref'/Reference in XMLSERVICE. Blank is fine here.\n if (isset($attrs['passby']) && ($attrs['passby'] == 'value')) {\n $passBy = 'val'; // rare. PCML calls it 'value'. XMLSERVICE calls it 'val'.\n }\n \n // find new toolkit equivalent of PCML data type\n if (isset($this->_pcmlTypeMap[$type])) {\n // a simple type mapping\n $newType = (string) $this->_pcmlTypeMap[$type];\n } elseif ($type == 'int') {\n // one of the integer types. Need to use length to determine which one.\n if ($length == '2') {\n $newType = '5i0'; // short ints have two bytes\n } elseif ($length == '4') {\n $newType = '10i0'; // normal ints have four bytes\n } else {\n $newType = ''; // no match\n } //(length == 2, et al.)\n } else {\n $newType = '';\n }\n \n $newInout = (isset($this->_pcmlInoutMap[$usage])) ? (string) $this->_pcmlInoutMap[$usage] : '';\n\n // @todo correct all this isArray business. \n // Can we manage without isArray? \n // well, it's already handled by toolkit....try and see, though.\n // poss. eliminate extra object levels, at least?\n \n if ($count > 1) {\n $isArray = true;\n } else {\n // no need for any dummy value.Could be 'init' from above, or leave the default.\n $isArray = false;\n }\n\n // @todo I think simply add 'counterLabel' and 'countedLabel'. \n // count\n $newCount = 0; // initialize\n // @todo deal with this. Really need a better way to find the counter data elements.\n // Allow a countref, too, in PCML??? Maybe! Count will be the dim (max) and countref is the actual name.\n // Some customers have done it wrong. Instead of specifying a field as count, gave max count.\n // \"count can be a number where number defines a fixed, never-changing number of elements in a sized array.\n // OR a data-name where data-name defines the name of a <data> element within the PCML document that will contain, at runtime, the number of elements in the array. The data-name specified can be a fully qualified name or a name that is relative to the current element. In either case, the name must reference a <data> element that is defined with type=\"int\". See Resolving Relative Names for more information about how relative names are resolved.\n // about finding the element: http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Frzahh%2Flengthprecisionrelative.htm\n // Names are resolved by seeing if the name can be resolved as a child or descendent of the tag containing the current tag. If the name cannot be resolved at this level, the search continues with the next highest containing tag. This resolution must eventually result in a match of a tag that is contained by either the <pcml> tag or the <rfml> tag, in which case the name is considered to be an absolute name, not a relative name.\"\"\n // Let's simply use $countersAndCounted. If necessary, pre-process PCML to create $countersAndCounted.\n if (is_numeric($count) && ($count > 0)) {\n $newCount = $count;\n }\n \n // $subElements are if this is a struct.\n if (count($subElements)) {\n $dataValue = $subElements;\n }\n\n $param = new ProgramParameter(sprintf($newType, $length, $precision), $newInout, '', $name, $dataValue, 'off', $newCount, $passBy, $isArray);\n\n if ($this->_countersAndCounted) {\n // some counters were configured\n // counter item reference was specified.\n if (isset($this->_countersAndCounted[$name])) {\n $param->setParamLabelCounter($name);\n }\n \n // counted item reference was specified as value in array.\n // look for value ($name). if found, counter is key.\n if ($counter = array_search($name, $this->_countersAndCounted)) {\n $param->setParamLabelCounted($counter);\n }\n }\n \n return $param;\n }" ]
codesearchnet
{ "query": "Represent the summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
Evaluate text passed by L{_partialParseDateStd()}
[ "def _evalDateStd(self, datetimeString, sourceTime):\n \n s = datetimeString.strip()\n sourceTime = self._evalDT(datetimeString, sourceTime)\n\n # Given string is in the format 07/21/2006\n return self.parseDate(s, sourceTime)" ]
[ "func ListGetOp(binName string, index int) *Operation {\n\treturn &Operation{opType: _CDT_READ, binName: binName, binValue: ListValue{_CDT_LIST_GET, IntegerValue(index)}, encoder: listGenericOpEncoder}\n}" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Returns an instance of Month for the given month value. @param int $value The month number, from 1 (January) to 12 (December). @return Month The Month instance. @throws DateTimeException
[ "public static function of(int $value) : Month\n {\n Field\\MonthOfYear::check($value);\n\n return Month::get($value);\n }" ]
[ "public static function check(int $dayOfYear, int $year = null) : void\n {\n if ($dayOfYear < 1 || $dayOfYear > 366) {\n throw DateTimeException::fieldNotInRange(self::NAME, $dayOfYear, 1, 366);\n }\n\n if ($dayOfYear === 366 && $year !== null && ! Year::isLeap($year)) {\n throw new DateTimeException(\"Invalid day-of-year 366 as $year is not a leap year\");\n }\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software Development:" }
Build the syntax tree for kubectl command line
[ "def build(self, root, schema):\n \n if schema.get(\"subcommands\") and schema[\"subcommands\"]:\n for subcmd, childSchema in schema[\"subcommands\"].items():\n child = CommandTree(node=subcmd)\n child = self.build(child, childSchema)\n root.children.append(child)\n # {args: {}, options: {}, help: \"\"}\n root.help = schema.get(\"help\")\n for name, desc in schema.get(\"options\").items():\n if root.node == \"kubectl\": # register global flags\n self.globalFlags.append(Option(name, desc[\"help\"]))\n root.localFlags.append(Option(name, desc[\"help\"]))\n for arg in schema.get(\"args\"):\n node = CommandTree(node=arg)\n root.children.append(node)\n return root" ]
[ "def star_sep_check(self, original, loc, tokens):\n \"\"\"\"\"\"\n return self.check_py(\"3\", \"keyword-only argument separator (add 'match' to front to produce universal code)\", original, loc, tokens)" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
convertSlice Convert a slice. @access protected @param array $values @param string $name @return array
[ "protected function convertSlice(array $values, $name)\n {\n $type = $this->projection->getFieldType($name);\n $converter = $this->hydration_plan->getConverterForField($name);\n\n return array_map(\n function ($val) use ($converter, $type) {\n return $converter->fromPg($val, $type, $this->session);\n },\n $values\n );\n }" ]
[ "public static function castDimensions(Image\\Dimensions $dimensions, array $a, Stub $stub, $isNested, $filter = 0)\n {\n $stub->class .= sprintf(' \"%s\"', (string) $dimensions);\n\n return $a;\n }" ]
codesearchnet
{ "query": "Represent the Github description about Text analysis:", "pos": "Represent the Github code about Text analysis:", "neg": "Represent the Github code about programming:" }
Checks a field signature. @param signature a string containing the signature that must be checked.
[ "public static void checkFieldSignature(final String signature) {\n int pos = checkFieldTypeSignature(signature, 0);\n if (pos != signature.length()) {\n throw new IllegalArgumentException(signature + \": error at index \"\n + pos);\n }\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 different than the class name\n this.type = \"\";\n // Used to provide access to the name of the class \n this.className = \"Rule\";\n // Indicates whether generated nodes should be added to the abstract syntax tree\n this._createAstNode = false;\n // A parser function, computed in a rule's constructor. If successful returns either the original or a new \n // ParseState object. If it fails it returns null.\n this.parser = null;\n // A lexer function, computed in a rule's constructor. The lexer may update the ParseState if successful.\n // If it fails it is required that the lexer restore the ParseState index to the previous state. \n // Lexers should only update the index. \n this.lexer = null;\n }" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Serialize model to filename.
[ "def save(self, filename):\n \n\n with open(filename, 'wb') as savefile:\n pickle.dump(self.__dict__,\n savefile,\n protocol=pickle.HIGHEST_PROTOCOL)" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Equal to calling parseInt(cs, 10). @param cs @return @throws java.lang.NumberFormatException if input cannot be parsed to proper int. @see java.lang.Integer#parseInt(java.lang.String) @see java.lang.Character#digit(int, int)
[ "public static final int parseInt(CharSequence cs)\r\n {\r\n if (CharSequences.startsWith(cs, \"0b\"))\r\n {\r\n return parseInt(cs, 2, 2, cs.length());\r\n }\r\n if (CharSequences.startsWith(cs, \"0x\"))\r\n {\r\n return parseInt(cs, 16, 2, cs.length());\r\n }\r\n return parseInt(cs, 10);\r\n }" ]
[ "private static long toArrayIndex(String id)\n {\n long index = toArrayIndex(ScriptRuntime.toNumber(id));\n // Assume that ScriptRuntime.toString(index) is the same\n // as java.lang.Long.toString(index) for long\n if (Long.toString(index).equals(id)) {\n return index;\n }\n return -1;\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SetCenter positions the space component according to its center instead of its // top-left point (this avoids doing the same math each time in your systems)
[ "func (sc *SpaceComponent) SetCenter(p engo.Point) {\n\txDelta := sc.Width / 2\n\tyDelta := sc.Height / 2\n\t// update position according to point being used as our center\n\tif sc.Rotation == 0 {\n\t\tsc.Position.X = p.X - xDelta\n\t\tsc.Position.Y = p.Y - yDelta\n\t\treturn\n\t}\n\tsin, cos := math.Sincos(sc.Rotation * math.Pi / 180)\n\txDelta = (sc.Width*cos - sc.Height*sin) / 2\n\tyDelta = (sc.Height*cos + sc.Width*sin) / 2\n\tsc.Position.X = p.X - xDelta\n\tsc.Position.Y = p.Y - yDelta\n}" ]
[ "function (element) {\n $.data(element, \"velocity\", {\n /* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */\n isSVG: Type.isSVG(element),\n /* Keep track of whether the element is currently being animated by Velocity.\n This is used to ensure that property values are not transferred between non-consecutive (stale) calls. */\n isAnimating: false,\n /* A reference to the element's live computedStyle object. Learn more here: https://developer.mozilla.org/en/docs/Web/API/window.getComputedStyle */\n computedStyle: null,\n /* Tween data is cached for each animation on the element so that data can be passed across calls --\n in particular, end values are used as subsequent start values in consecutive Velocity calls. */\n tweensContainer: null,\n /* The full root property values of each CSS hook being animated on this element are cached so that:\n 1) Concurrently-animating hooks sharing the same root can have their root values' merged into one while tweening.\n 2) Post-hook-injection root values can be transferred over to consecutively chained Velocity calls as starting root values. */\n rootPropertyValueCache: {},\n /* A cache for transform updates, which must be manually flushed via CSS.flushTransformCache(). */\n transformCache: {}\n });\n }" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Compares & pops top 2 operands out of the stack, and checks if the 1st operand <= 2nd operand (top of the stack). Pushes 0 if False, 1 if True. 8 bit unsigned version
[ "def _leu8(ins):\n \n output = _8bit_oper(ins.quad[2], ins.quad[3], reversed_=True)\n output.append('sub h') # Carry if H > A\n output.append('ccf') # Negates => Carry if H <= A\n output.append('sbc a, a')\n output.append('push af')\n\n return output" ]
[ "def determine_operands\n if( @left.is_a?(Parfait::Object) or @left.is_a?(Risc::Label) or\n (@left.is_a?(Symbol) and !Risc::RegisterValue.look_like_reg(@left)))\n left = @left\n left = left.address if left.is_a?(Risc::Label)\n # do pc relative addressing with the difference to the instuction\n # 8 is for the funny pipeline adjustment (ie pointing to fetch and not execute)\n right = Risc::Position.get(left) - 8\n right -= Risc::Position.get(self).at\n if( (right < 0) && ((opcode == :add) || (opcode == :sub)) )\n right *= -1 # this works as we never issue sub only add\n set_opcode :sub # so (as we can't change the sign permanently) we can change the opcode\n end # and the sign even for sub (beucase we created them)\n raise \"No negatives implemented #{self} #{right} \" if right < 0\n return :pc , right\n else\n return @left , @right\n end\n end" ]
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// SetQuantity sets the Quantity field's value.
[ "func (s *GeoRestriction) SetQuantity(v int64) *GeoRestriction {\n\ts.Quantity = &v\n\treturn s\n}" ]
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are different than the class name\n this.type = \"\";\n // Used to provide access to the name of the class \n this.className = \"Rule\";\n // Indicates whether generated nodes should be added to the abstract syntax tree\n this._createAstNode = false;\n // A parser function, computed in a rule's constructor. If successful returns either the original or a new \n // ParseState object. If it fails it returns null.\n this.parser = null;\n // A lexer function, computed in a rule's constructor. The lexer may update the ParseState if successful.\n // If it fails it is required that the lexer restore the ParseState index to the previous state. \n // Lexers should only update the index. \n this.lexer = null;\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Just run the checks for our modules
[ "def run_checks(collector):\n \"\"\"\"\"\"\n artifact = collector.configuration[\"dashmat\"].artifact\n chosen = artifact\n if chosen in (None, \"\", NotSpecified):\n chosen = None\n\n dashmat = collector.configuration[\"dashmat\"]\n modules = collector.configuration[\"__active_modules__\"]\n config_root = collector.configuration[\"config_root\"]\n module_options = collector.configuration[\"modules\"]\n\n datastore = JsonDataStore(os.path.join(config_root, \"data.json\"))\n if dashmat.redis_host:\n datastore = RedisDataStore(redis.Redis(dashmat.redis_host))\n\n scheduler = Scheduler(datastore)\n\n for name, module in modules.items():\n if chosen is None or name == chosen:\n server = module.make_server(module_options[name].server_options)\n scheduler.register(module, server, name)\n\n scheduler.twitch(force=True)" ]
[ "def platform\n # If you are declaring a new platform, you will need to tell\n # Train a bit about it.\n # If you were defining a cloud API, you should say you are a member\n # of the cloud family.\n\n # This plugin makes up a new platform. Train (or rather InSpec) only\n # know how to read files on Windows and Un*x (MacOS is a kind of Un*x),\n # so we'll say we're part of those families.\n Train::Platforms.name('local-rot13').in_family('unix')\n Train::Platforms.name('local-rot13').in_family('windows')\n\n # When you know you will only ever run on your dedicated platform\n # (for example, a plugin named train-aws would only run on the AWS\n # API, which we report as the 'aws' platform).\n # force_platform! lets you bypass platform detection.\n # The options to this are not currently documented completely.\n\n # Use release to report a version number. You might use the version\n # of the plugin, or a version of an important underlying SDK, or a\n # version of a remote API.\n force_platform!('local-rot13', release: TrainPlugins::LocalRot13::VERSION)\n end" ]
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Writes an unsigned value whose size is, in maximum, {@value Byte#SIZE}. @param size the number of lower bits to write; between {@code 1} and {@value Byte#SIZE}, both inclusive. @param value the value to write @throws IOException if an I/O error occurs.
[ "protected void unsigned8(final int size, int value) throws IOException {\n requireValidSizeUnsigned8(size);\n final int required = size - available;\n if (required > 0) {\n unsigned8(available, value >> required);\n unsigned8(required, value);\n return;\n }\n octet <<= size;\n octet |= (value & ((1 << size) - 1));\n available -= size;\n if (available == 0) {\n write(octet);\n count++;\n octet = 0x00;\n available = Byte.SIZE;\n }\n }" ]
[ "public static byte[] decode(byte[] bytes) {\n ByteArrayInputStream in = new ByteArrayInputStream(bytes);\n // calculate the length of the resulting output.\n // in general it will be at most 3/4 the size of the input\n // but the input length must be divisible by four.\n // If it isn't the next largest size that is divisible\n // by four is used.\n int mod;\n int length = bytes.length;\n if ((mod = length % 4) != 0) {\n length += 4 - mod;\n }\n length = length * 3 / 4;\n ByteArrayOutputStream out = new ByteArrayOutputStream(length);\n try {\n decode(in, out, false);\n } catch (IOException x) {\n // This can't happen.\n // The input and output streams were constructed\n // on memory structures that don't actually use IO.\n throw new RuntimeException(x);\n }\n return out.toByteArray();\n }" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Obtains the super type element for a given type element. @param element The type element @return The super type element or null if none exists
[ "TypeElement superClassFor(TypeElement element) {\n TypeMirror superclass = element.getSuperclass();\n if (superclass.getKind() == TypeKind.NONE) {\n return null;\n }\n DeclaredType kind = (DeclaredType) superclass;\n return (TypeElement) kind.asElement();\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 different than the class name\n this.type = \"\";\n // Used to provide access to the name of the class \n this.className = \"Rule\";\n // Indicates whether generated nodes should be added to the abstract syntax tree\n this._createAstNode = false;\n // A parser function, computed in a rule's constructor. If successful returns either the original or a new \n // ParseState object. If it fails it returns null.\n this.parser = null;\n // A lexer function, computed in a rule's constructor. The lexer may update the ParseState if successful.\n // If it fails it is required that the lexer restore the ParseState index to the previous state. \n // Lexers should only update the index. \n this.lexer = null;\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Execute a block of code within a given scope. If `locator` begins with `/` or `./`, then it's assumed to be an XPath selector; otherwise, it's assumed to be a CSS selector.
[ "def scope_within(locator)\n if locator\n # Use the selector_for method if it's defined. This may be provided\n # by features/support/selectors.rb, generated by cucumber-rails.\n if defined? selector_for\n kelp_within(*selector_for(locator)) { yield }\n # Otherwise, fall back on the Capybara locator syntax (CSS or XPath)\n else\n if locator =~ /\\.?\\//\n kelp_within(:xpath, locator) { yield }\n else\n kelp_within(:css, locator) { yield }\n end\n end\n else\n yield\n end\n end" ]
[ "function Scope(context, parent, meta) {\n\t// The object that will be looked on for values.\n\t// If the type of context is TemplateContext, there will be special rules for it.\n\tthis._context = context;\n\t// The next Scope object whose context should be looked on for values.\n\tthis._parent = parent;\n\t// If this is a special context, it can be labeled here.\n\t// Options are:\n\t// - `viewModel` - This is a viewModel. This is mostly used by can-component to make `scope.vm` work.\n\t// - `notContext` - This can't be looked within using `./` and `../`. It will be skipped.\n\t// This is for virtual contexts like those used by `%index`. This is very much like\n\t// `variable`. Most things should switch to `variable` in the future.\n\t// - `special` - This can't be looked within using `./` and `../`. It will be skipped.\n\t// This is for reading properties on the scope {{scope.index}}. It's different from variable\n\t// because it's never lookup up like {{key}}.\n\t// - `variable` - This is used to define a variable (as opposed to \"normal\" context). These\n\t// will also be skipped when using `./` and `../`.\n\tthis._meta = meta || {};\n\n\t// A cache that can be used to store computes used to look up within this scope.\n\t// For example if someone creates a compute to lookup `name`, another compute does not\n\t// need to be created.\n\tthis.__cache = {};\n}" ]
codesearchnet
{ "query": "Represent the instruction:", "pos": "Represent the code:", "neg": "Represent the code:" }
Segment all the pofiles for `locale`. Returns a set of filenames, all the segment files written.
[ "def segment_pofiles(configuration, locale):\n \n files_written = set()\n for filename, segments in configuration.segment.items():\n filename = configuration.get_messages_dir(locale) / filename\n files_written.update(segment_pofile(filename, segments))\n return files_written" ]
[ "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 expected by the\n # objective function\n return objective.run(raw_output, output_files, threads)\n end" ]
codesearchnet
{ "query": "Represent the Github instruction about computer science:", "pos": "Represent the Github code about computer science:", "neg": "Represent the Github code:" }
防止csrf跨站攻击 @param int $type 检测类型 0不检查,1、只检查post,2、post get都检查
[ "public static function checkCsrf($type = 1)\n {\n if ($type !== 0 && isset($_SERVER['HTTP_REFERER']) && !strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])) {\n if ($type == 1) {\n if (!empty($_POST)) {\n Response::sendHttpStatus(403);\n throw new \\UnexpectedValueException(Lang::get('_ILLEGAL_REQUEST_'));\n }\n } else {\n Response::sendHttpStatus(403);\n throw new \\UnexpectedValueException(Lang::get('_ILLEGAL_REQUEST_'));\n }\n }\n }" ]
[ "public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城市\tString\t用户注册时填写的城市, 如果没有数据的时候不会返回该数据,请做好容错\t可空\t杭州\n gender\t用户性别\tString\tM为男性,F为女性, 如果没有数据的时候不会返回该数据,请做好容错\t可空\tM\n user_type_value\t用户类型\tString\t(1/2),1代表公司账户;2代表个人账户\t不可空\t1\n is_licence_auth\t是否经过营业执照认证\tString\tT为通过营业执照认证,F为没有通过\t不可空\tT\n is_certified\t是否通过实名认证\tString\tT是通过;F是没有实名认证\t不可空\tF\n is_certify_grade_a\t是否A类认证\tString\tT表示是A类认证,F表示非A类认证,A类认证用户是指上传过身份证照片并且通过审核的支付宝用户\t不可空\tT\n is_student_certified\t是否是学生\tString\tT表示是学生,F表示不是学生\t不可空\tT\n is_bank_auth\t是否经过银行卡认证\tString\tT为经过银行卡认证,F为未经过银行卡认证\t不可空\tT\n is_mobile_auth\t是否经过手机认证\tString\tT为经过手机认证,F为未经过手机认证\t不可空\tT\n alipay_user_id\t当前用户的userId\tString\t支付宝用户的userId\t不可空\t2088411964574197\n user_id\t已废弃,请勿使用\tString\t已废弃,请勿使用\t不可空\t已废弃,请勿使用\n user_status\t用户状态(Q/T/B/W)\tString\tQ代表快速注册用户;T代表已认证用户;B代表被冻结账户;W代表已注册,未激活的账户\t不可空\tT\n is_id_auth\t是否身份证认证\tString\tT为是身份证认证,F为非身份证认证\t不可空\tT\n */\n $user = (new OAuth())->info($this->get('access_token'));\n if (!is_array($user) || $user['code'] != 10000) {\n return false;\n }\n $user['username'] = $user['nick_name'];\n $user['sex'] = $user['gender'];\n $this->set($user);\n return $user;\n }" ]
codesearchnet
{ "query": "Represent the Github instruction about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about programming:" }
[DEPRECATED] Compute the maximum number of record pairs possible.
[ "def max_pairs(shape):\n \"\"\"\"\"\"\n\n if not isinstance(shape, (tuple, list)):\n x = get_length(shape)\n n = int(x * (x - 1) / 2)\n\n elif (isinstance(shape, (tuple, list)) and len(shape) == 1):\n x = get_length(shape[0])\n n = int(x * (x - 1) / 2)\n\n else:\n n = numpy.prod([get_length(xi) for xi in shape])\n\n return n" ]
[ "public static function getRankingQueryLimit()\n {\n $configGeneral = Config::getInstance()->General;\n $configLimit = $configGeneral['archiving_ranking_query_row_limit'];\n $limit = $configLimit == 0 ? 0 : max(\n $configLimit,\n $configGeneral['datatable_archiving_maximum_rows_actions'],\n $configGeneral['datatable_archiving_maximum_rows_subtable_actions']\n );\n\n // FIXME: This is a quick fix for #3482. The actual cause of the bug is that\n // the site search & performance metrics additions to\n // ArchivingHelper::updateActionsTableWithRowQuery expect every\n // row to have 'type' data, but not all of the SQL queries that are run w/o\n // ranking query join on the log_action table and thus do not select the\n // log_action.type column.\n //\n // NOTES: Archiving logic can be generalized as follows:\n // 0) Do SQL query over log_link_visit_action & join on log_action to select\n // some metrics (like visits, hits, etc.)\n // 1) For each row, cache the action row & metrics. (This is done by\n // updateActionsTableWithRowQuery for result set rows that have\n // name & type columns.)\n // 2) Do other SQL queries for metrics we can't put in the first query (like\n // entry visits, exit vists, etc.) w/o joining log_action.\n // 3) For each row, find the cached row by idaction & add the new metrics to\n // it. (This is done by updateActionsTableWithRowQuery for result set rows\n // that DO NOT have name & type columns.)\n //\n // The site search & performance metrics additions expect a 'type' all the time\n // which breaks the original pre-rankingquery logic. Ranking query requires a\n // join, so the bug is only seen when ranking query is disabled.\n if ($limit === 0) {\n $limit = 100000;\n }\n return $limit;\n\n }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Retrieves the index of a link with a specified ID. <p>Link indexes are consecutive integers starting from 1. @param id link ID label. @return the link index. @throws EpanetException
[ "public int ENgetlinkindex( String id ) throws EpanetException {\n int[] index = new int[1];\n int error = epanet.ENgetlinkindex(id, index);\n checkError(error);\n return index[0];\n }" ]
[ "@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 Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Align given proteins with clustalw. recs are iterable of Biopython SeqIO objects
[ "def clustal_align_protein(recs, work_dir, outfmt=\"fasta\"):\n \n fasta_file = op.join(work_dir, \"prot-start.fasta\")\n align_file = op.join(work_dir, \"prot.aln\")\n SeqIO.write(recs, file(fasta_file, \"w\"), \"fasta\")\n\n clustal_cl = ClustalwCommandline(cmd=CLUSTALW_BIN(\"clustalw2\"),\n infile=fasta_file, outfile=align_file, outorder=\"INPUT\",\n type=\"PROTEIN\")\n stdout, stderr = clustal_cl()\n\n aln_file = file(clustal_cl.outfile)\n alignment = AlignIO.read(aln_file, \"clustal\")\n print(\"\\tDoing clustalw alignment: %s\" % clustal_cl, file=sys.stderr)\n if outfmt == \"fasta\":\n return alignment.format(\"fasta\")\n if outfmt == \"clustal\":\n return alignment" ]
[ "def path_from_structure(cls, ndivsm, structure):\n \"\"\"\"\"\"\n return cls._path(ndivsm, structure=structure, comment=\"K-path generated automatically from structure\")" ]
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
// NewRangeScanner initializes a new range scanner. It takes a `min` and a // `max` key for specifying the range paramaters.
[ "func (bk *Bucket) NewRangeScanner(min, max []byte) *RangeScanner {\n\treturn &RangeScanner{bk.db, bk.Name, min, max}\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 different than the class name\n this.type = \"\";\n // Used to provide access to the name of the class \n this.className = \"Rule\";\n // Indicates whether generated nodes should be added to the abstract syntax tree\n this._createAstNode = false;\n // A parser function, computed in a rule's constructor. If successful returns either the original or a new \n // ParseState object. If it fails it returns null.\n this.parser = null;\n // A lexer function, computed in a rule's constructor. The lexer may update the ParseState if successful.\n // If it fails it is required that the lexer restore the ParseState index to the previous state. \n // Lexers should only update the index. \n this.lexer = null;\n }" ]
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Dispatches a Route, executing its action. @param Route $route The route to be executed. @param Request $request The request information, if available. Used for mapping route variables. @return mixed Route target function return value, if any.
[ "public function dispatch(Route $route, Request $request = null)\n {\n $context = $this->context;\n\n if (empty($this->context) && !empty($request)) {\n // If we have no context, but do have a request, prepare a context to store path variables in.\n // Otherwise routing path variables would be lost for no good reason.\n $context = new Context();\n $context->registerInstance($request);\n }\n\n if (!empty($context)) {\n // If we have a context, ensure that the route is made available in it.\n $context->registerInstance($route);\n\n if (!empty($request)) {\n // If we have a request, map the path variables and pass them to the context as primitive types by name.\n // This will allow us to inject info from a route e.g. \"/view/$userId\" to a $userId variable.\n $pathVariables = VariableUrl::extractUrlVariables($request->getRequestUri(), $route->getPattern());\n\n foreach ($pathVariables as $name => $value) {\n $context->registerVariable($name, $value);\n }\n }\n }\n\n return $route->action($context);\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 different than the class name\n this.type = \"\";\n // Used to provide access to the name of the class \n this.className = \"Rule\";\n // Indicates whether generated nodes should be added to the abstract syntax tree\n this._createAstNode = false;\n // A parser function, computed in a rule's constructor. If successful returns either the original or a new \n // ParseState object. If it fails it returns null.\n this.parser = null;\n // A lexer function, computed in a rule's constructor. The lexer may update the ParseState if successful.\n // If it fails it is required that the lexer restore the ParseState index to the previous state. \n // Lexers should only update the index. \n this.lexer = null;\n }" ]
codesearchnet
{ "query": "Represent the Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// WithMaxConcurrentDownloads sets max concurrent download limit.
[ "func WithMaxConcurrentDownloads(max int) RemoteOpt {\n\treturn func(client *Client, c *RemoteContext) error {\n\t\tc.MaxConcurrentDownloads = max\n\t\treturn nil\n\t}\n}" ]
[ "def getLockByID(self, lockid):\n \n assert isinstance(lockid, (locks.MasterLock, locks.WorkerLock))\n if lockid not in self.locks:\n self.locks[lockid] = lockid.lockClass(lockid)\n # if the master.cfg file has changed maxCount= on the lock, the next\n # time a build is started, they'll get a new RealLock instance. Note\n # that this requires that MasterLock and WorkerLock (marker) instances\n # be hashable and that they should compare properly.\n return self.locks[lockid]" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Verifies the signature for the response. @throws InvalidResponseException if the signature doesn't match @return void
[ "public function verifySignature()\n {\n if ( isset($this->data['CreditCardTransactionResults']['ResponseCode']) && (\n '1' == $this->data['CreditCardTransactionResults']['ResponseCode'] ||\n '2' == $this->data['CreditCardTransactionResults']['ResponseCode']) )\n {\n $signature = $this->request->getMerchantPassword();\n $signature .= $this->request->getMerchantId();\n $signature .= $this->request->getAcquirerId();\n $signature .= $this->request->getTransactionId();\n\n $signature = base64_encode( sha1($signature, true) );\n\n if ( $signature !== $this->data['Signature'] ) {\n throw new InvalidResponseException('Signature verification failed');\n }\n }\n }" ]
[ "public static function createNotMerged(Envelope $envelope, \\Exception $e = null)\n {\n $message = 'The given DigiDoc envelope must be merged with Api (using Api::merge) before calling this method.';\n\n return new static($message, null, $e);\n }" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about API documentation:" }
Creates {@link KeyManager} instances based on the given parameters. @param keyStoreFile path to keyStore file @param pass password for keyStore @return an array of {@link KeyManager} instances @throws InitializationException
[ "public static KeyManager[] getKeyManagers(String keyStoreFile, String pass)\n\t\t\tthrows InitializationException {\n\t\treturn getKeyManagers(getFileAsInputStream(keyStoreFile), pass);\n\t}" ]
[ "private Subject authenticateWithCertificateChain(SSLSession session) throws SSLPeerUnverifiedException, AuthenticationException, CredentialExpiredException, CredentialDestroyedException {\n Subject transportSubject = null;\n if (session != null) {\n Certificate[] certificateChain = session.getPeerCertificates();\n transportSubject = authenticator.authenticate((X509Certificate[]) certificateChain);\n /* Here we need to get the WSCredential from the subject. We will use the subject manager for the same. */\n SubjectHelper subjectHelper = new SubjectHelper();\n WSCredential wsCredential = subjectHelper.getWSCredential(transportSubject);\n /*\n * First we tell the WSCredential that the identity token is in the form of a certificate chain. This is\n * done by setting the property \"wssecurity.identity_name\" to \"ClientCertificate\"\n */\n wsCredential.set(Constants.IDENTITY_NAME, Constants.ClientCertificate);\n /*\n * Now we need to put the certificate chain into the WScredential object. By doing this, we\n * make sure that, the authenticated certificates are indeed part of the credential. This credential\n * can be used further down the CSIv2 flow. The certificate is set as a name value pair, with the name\n * \"wssecurity.identity_value\"\n */\n wsCredential.set(Constants.IDENTITY_VALUE, certificateChain);\n }\n return transportSubject;\n }" ]
codesearchnet
{ "query": "Represent the Github text about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Query widget option. :param key: option name :type key: str :return: value of the option To get the list of options for this widget, call the method :meth:`~LinkLabel.keys`.
[ "def cget(self, key):\n \n if key is \"link\":\n return self._link\n elif key is \"hover_color\":\n return self._hover_color\n elif key is \"normal_color\":\n return self._normal_color\n elif key is \"clicked_color\":\n return self._clicked_color\n else:\n return ttk.Label.cget(self, key)" ]
[ "def add_reference(self, reftype: str, label: str, target):\n \n\n # The self.data[reftype] dict springs into being during the\n # register_references event handler at startup, which looks in the\n # kb registry for all registered reference names.\n self.data[reftype][label] = target" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// IsDir checks if the given path is a directory
[ "func (u *volumeUtil) IsDir(fullPath string) (bool, error) {\n\tdir, err := os.Open(fullPath)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer dir.Close()\n\n\tstat, err := dir.Stat()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn stat.IsDir(), nil\n}" ]
[ "async function getTrueFilePath(p) {\n let fsPathNormalized = p;\n // OSX: HFS+ stores filenames in NFD (decomposed normal form) Unicode format,\n // so we must ensure that the input path is in that format first.\n if (process.platform === 'darwin')\n fsPathNormalized = fsPathNormalized.normalize('NFD');\n\n // !! Windows: Curiously, the drive component mustn't be part of a glob,\n // !! otherwise glob.sync() will invariably match nothing.\n // !! Thus, we remove the drive component and instead pass it in as the 'cwd'\n // !! (working dir.) property below.\n const pathRoot = parse(fsPathNormalized).root;\n const noDrivePath = fsPathNormalized.slice(Math.max(pathRoot.length - 1, 0));\n\n // Perform case-insensitive globbing (on Windows, relative to the drive /\n // network share) and return the 1st match, if any.\n // Fortunately, glob() with nocase case-corrects the input even if it is\n // a *literal* path.\n const result = await glob(noDrivePath, { nocase: true, cwd: pathRoot });\n return result[0];\n}" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
:param acs: List of AttributeConverter instances :param attr: an Attribute instance :return: The local attribute name
[ "def to_local_name(acs, attr):\n \n for aconv in acs:\n lattr = aconv.from_format(attr)\n if lattr:\n return lattr\n\n return attr.friendly_name" ]
[ "def values(*rels):\n '''\n \n '''\n #Action function generator to multiplex a relationship at processing time\n def _values(ctx):\n '''\n Versa action function Utility to specify a list of relationships\n\n :param ctx: Versa context used in processing (e.g. includes the prototype link\n :return: Tuple of key/value tuples from the attributes; suitable for hashing\n '''\n computed_rels = [ rel(ctx) if callable(rel) else rel for rel in rels ]\n return computed_rels\n return _values" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
Remove all joins linked to a specific attachment. @return boolean
[ "public function removeAttachmentJoins()\n {\n $joinProto = $this->modelFactory()->get(Join::class);\n\n $loader = $this->collectionLoader();\n $loader\n ->setModel($joinProto)\n ->addFilter('object_type', $this->objType())\n ->addFilter('object_id', $this->id());\n\n $collection = $loader->load();\n\n foreach ($collection as $obj) {\n $obj->delete();\n }\n\n return true;\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 post about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// Filter based on extender implemented predicate functions. The filtered list is // expected to be a subset of the supplied list. failedNodesMap optionally contains // the list of failed nodes and failure reasons.
[ "func (h *HTTPExtender) Filter(\n\tpod *v1.Pod,\n\tnodes []*v1.Node, nodeNameToInfo map[string]*schedulernodeinfo.NodeInfo,\n) ([]*v1.Node, schedulerapi.FailedNodesMap, error) {\n\tvar (\n\t\tresult schedulerapi.ExtenderFilterResult\n\t\tnodeList *v1.NodeList\n\t\tnodeNames *[]string\n\t\tnodeResult []*v1.Node\n\t\targs *schedulerapi.ExtenderArgs\n\t)\n\n\tif h.filterVerb == \"\" {\n\t\treturn nodes, schedulerapi.FailedNodesMap{}, nil\n\t}\n\n\tif h.nodeCacheCapable {\n\t\tnodeNameSlice := make([]string, 0, len(nodes))\n\t\tfor _, node := range nodes {\n\t\t\tnodeNameSlice = append(nodeNameSlice, node.Name)\n\t\t}\n\t\tnodeNames = &nodeNameSlice\n\t} else {\n\t\tnodeList = &v1.NodeList{}\n\t\tfor _, node := range nodes {\n\t\t\tnodeList.Items = append(nodeList.Items, *node)\n\t\t}\n\t}\n\n\targs = &schedulerapi.ExtenderArgs{\n\t\tPod: pod,\n\t\tNodes: nodeList,\n\t\tNodeNames: nodeNames,\n\t}\n\n\tif err := h.send(h.filterVerb, args, &result); err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif result.Error != \"\" {\n\t\treturn nil, nil, fmt.Errorf(result.Error)\n\t}\n\n\tif h.nodeCacheCapable && result.NodeNames != nil {\n\t\tnodeResult = make([]*v1.Node, 0, len(*result.NodeNames))\n\t\tfor i := range *result.NodeNames {\n\t\t\tnodeResult = append(nodeResult, nodeNameToInfo[(*result.NodeNames)[i]].Node())\n\t\t}\n\t} else if result.Nodes != nil {\n\t\tnodeResult = make([]*v1.Node, 0, len(result.Nodes.Items))\n\t\tfor i := range result.Nodes.Items {\n\t\t\tnodeResult = append(nodeResult, &result.Nodes.Items[i])\n\t\t}\n\t}\n\n\treturn nodeResult, result.FailedNodes, nil\n}" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is likely to be in terms of SQL path. Currently we still don't have support multiple function namespaces, nor\n // SQL path. As a result, session is not used here. We still add this to distinguish the two versions of resolveFunction\n // while the refactoring is on-going.\n return staticFunctionNamespace.resolveFunction(name, parameterTypes);\n }" ]
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software development:" }
Adds an annotated Class to xmlJmapper structure. @param aClass Class to convert to XmlClass @return this instance of XML
[ "private XML addClass(Class<?> aClass){\r\n\t\txmlJmapper.classes.add(Converter.toXmlClass(aClass));\r\n\t\treturn this;\r\n\t}" ]
[ "public static OriginIdElement addOriginId(Message message) {\n OriginIdElement originId = new OriginIdElement();\n message.addExtension(originId);\n // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.\n // message.setStanzaId(originId.getId());\n return originId;\n }" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Merge two PDFs one after the other. @param $firstPDFPath @param $secondPDFPath @param null $outputDestination
[ "public function joinTwoPDFs($firstPDFPath, $secondPDFPath, $outputDestination = null)\n {\n $firstPDF = new \\PDFDoc($firstPDFPath);\n $firstPDF->InitSecurityHandler();\n\n $secondPDF = new \\PDFDoc($secondPDFPath);\n $firstPDF->InsertPages(1, $secondPDF, 1, $secondPDF->GetPageCount(), \\PDFDoc::e_none);\n $secondPDF->Close();\n\n if (!empty($outputDestination)) {\n $firstPDF->Save($outputDestination, \\SDFDoc::e_remove_unused);\n } else {\n $firstPDF->Save($firstPDFPath, \\SDFDoc::e_remove_unused);\n }\n\n }" ]
[ "def changeTo(self, path):\n '''\n '''\n dictionary = DictSingle(Pair('PATH', StringSingle(path)))\n self.value = [dictionary]" ]
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
A trivial int-to-hex converter
[ "public static void main(String[] args) {\n System.err.println(toString(new int[] { Integer.parseInt(args[0]) }));\n }" ]
[ "def genKw(w,msk,z):\n \n # Hash inputs into a string of bytes\n b = hmac(msk, z + w, tag=\"TAG_PYTHIA_KW\")\n\n # Convert the string into a long value (no larger than the order of Gt),\n # then return a BigInt value.\n return BigInt(longFromString(b) % long(orderGt()))" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
create name before creating a new role instance. @param array $data @return EloquentRole
[ "public function create(array $data)\n {\n if (! array_key_exists('name', $data)) {\n $data['name'] = Str::slug($data['display_name']);\n }\n\n return parent::create($data);\n }" ]
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about programming:" }
Get primary key @param bool $require @return mixed @throws NoPkException
[ "public function getPK($require = true)\n {\n foreach ($this->fields as $field) {\n if ($field->pk()) {\n return $field;\n }\n }\n\n if ($require) {\n throw new NoPKException();\n }\n }" ]
[ "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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
裁剪图片,如果不传入$startX, $startY, 则默认从图片正中间开始裁剪 @param int $width 裁剪高度 @param int $height 裁剪宽度 @param int $startX 裁剪起始位置横坐标 @param int $startY 裁剪起始位置纵坐标 @return $this
[ "public function crop($width, $height, $startX=null, $startY=null)\n {\n $sizeSrc = $this->getImageSize($this->imgSrc);\n if ( $startX === null ) {\n $startX = ($sizeSrc[0] - $width)/2;\n }\n if ( $startY === null ) {\n $startY = ($sizeSrc[1] - $height)/2;\n }\n $this->imgDst = imagecrop($this->imgDst,\n ['x' => $startX, 'y' => $startY, 'width' => $width, 'height' => $height]);\n return $this;\n }" ]
[ "public function info() {\n /**\n * avatar\t用户头像\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\thttps://tfsimg.alipay.com/images/partner/T1k0xiXXRnXXXXXXXX\n nick_name\t用户昵称\tString\t如果没有数据的时候不会返回该数据,请做好容错\t可空\t张三\n province\t省份\tString\t用户注册时填写的省份 如果没有数据的时候不会返回该数据,请做好容错\t可空\t浙江省\n city\t城市\tString\t用户注册时填写的城市, 如果没有数据的时候不会返回该数据,请做好容错\t可空\t杭州\n gender\t用户性别\tString\tM为男性,F为女性, 如果没有数据的时候不会返回该数据,请做好容错\t可空\tM\n user_type_value\t用户类型\tString\t(1/2),1代表公司账户;2代表个人账户\t不可空\t1\n is_licence_auth\t是否经过营业执照认证\tString\tT为通过营业执照认证,F为没有通过\t不可空\tT\n is_certified\t是否通过实名认证\tString\tT是通过;F是没有实名认证\t不可空\tF\n is_certify_grade_a\t是否A类认证\tString\tT表示是A类认证,F表示非A类认证,A类认证用户是指上传过身份证照片并且通过审核的支付宝用户\t不可空\tT\n is_student_certified\t是否是学生\tString\tT表示是学生,F表示不是学生\t不可空\tT\n is_bank_auth\t是否经过银行卡认证\tString\tT为经过银行卡认证,F为未经过银行卡认证\t不可空\tT\n is_mobile_auth\t是否经过手机认证\tString\tT为经过手机认证,F为未经过手机认证\t不可空\tT\n alipay_user_id\t当前用户的userId\tString\t支付宝用户的userId\t不可空\t2088411964574197\n user_id\t已废弃,请勿使用\tString\t已废弃,请勿使用\t不可空\t已废弃,请勿使用\n user_status\t用户状态(Q/T/B/W)\tString\tQ代表快速注册用户;T代表已认证用户;B代表被冻结账户;W代表已注册,未激活的账户\t不可空\tT\n is_id_auth\t是否身份证认证\tString\tT为是身份证认证,F为非身份证认证\t不可空\tT\n */\n $user = (new OAuth())->info($this->get('access_token'));\n if (!is_array($user) || $user['code'] != 10000) {\n return false;\n }\n $user['username'] = $user['nick_name'];\n $user['sex'] = $user['gender'];\n $this->set($user);\n return $user;\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Generates the button dropdown. @return string the rendering result.
[ "protected function renderButton($dropdown) {\n $dropdownId = $dropdown->getId();\n \n $label = $this->label;\n if ($this->encodeLabel) {\n $label = Html::encode($label);\n }\n if ($this->split) {\n $this->tagName = 'a';\n Html::addCssClass($this->options, 'button');\n Html::addCssClass($this->options, 'split');\n $options = $this->options;\n $label .= Html::tag('span', '', ['data-dropdown' => $dropdownId]);\n } else {\n Html::addCssClass($this->options, 'dropdown');\n $options = $this->options;\n \n $options['data-dropdown'] = $dropdownId;\n }\n\n return Button::widget([\n 'tagName' => $this->tagName,\n 'label' => $label,\n 'options' => $options,\n 'url' => $this->url,\n 'encodeLabel' => false,\n ]) . \"<br />\\n\";\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 converts multiple language tags into one\n // Otherwise, it assumes that a single name_ tag exists with JSON content, and it will replace\n // it with multiple tags \"name_en\", \"name_fr\", ... depending on the JSON language codes\n this.namePicker = options.namePicker;\n\n // Flag to make requested_name (local_name) form\n this.combineName = options.combineName;\n}" ]
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
// IsStrictSuperSet returns true if this is a strict superset of the other set
[ "func (b *BitSet) IsStrictSuperSet(other *BitSet) bool {\n\treturn b.Count() > other.Count() && b.IsSuperSet(other)\n}" ]
[ "function(){\n return {\n classes: [], \n colonSelectors: [],\n data: [],\n group: null,\n ids: [],\n meta: [],\n\n // fake selectors\n collection: null, // a collection to match against\n filter: null, // filter function\n\n // these are defined in the upward direction rather than down (e.g. child)\n // because we need to go up in Selector.filter()\n parent: null, // parent query obj\n ancestor: null, // ancestor query obj\n subject: null, // defines subject in compound query (subject query obj; points to self if subject)\n\n // use these only when subject has been defined\n child: null,\n descendant: null\n };\n }" ]
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Raises an exception if the given app setting is not defined.
[ "def require_setting(self, name: str, feature: str = \"this feature\") -> None:\n \"\"\"\"\"\"\n if not self.application.settings.get(name):\n raise Exception(\n \"You must define the '%s' setting in your \"\n \"application to use %s\" % (name, feature)\n )" ]
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is likely to be in terms of SQL path. Currently we still don't have support multiple function namespaces, nor\n // SQL path. As a result, session is not used here. We still add this to distinguish the two versions of resolveFunction\n // while the refactoring is on-going.\n return staticFunctionNamespace.resolveFunction(name, parameterTypes);\n }" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about Software development:" }
Retry this factory's connection. It is assumed that a previous connection was attempted and failed- either before or after a successful connection.
[ "def retry(self):\n \n\n if self.connector is None:\n raise ValueError(\"No connector to retry\")\n if self.service is None:\n return\n self.connector.connect()" ]
[ "def connect(self, host, port):\n '''\n \n '''\n # Clear the connect state immediately since we're no longer connected\n # at this point.\n self._connected = False\n\n # Only after the socket has connected do we clear this state; closed\n # must be False so that writes can be buffered in writePacket(). The\n # closed state might have been set to True due to a socket error or a\n # redirect.\n self._host = \"%s:%d\" % (host, port)\n self._closed = False\n self._close_info = {\n 'reply_code': 0,\n 'reply_text': 'failed to connect to %s' % (self._host),\n 'class_id': 0,\n 'method_id': 0\n }\n\n self._transport.connect((host, port))\n self._transport.write(PROTOCOL_HEADER)\n\n self._last_octet_time = time.time()\n\n if self._synchronous_connect:\n # Have to queue this callback just after connect, it can't go\n # into the constructor because the channel needs to be\n # \"always there\" for frame processing, but the synchronous\n # callback can't be added until after the protocol header has\n # been written. This SHOULD be registered before the protocol\n # header is written, in the case where the header bytes are\n # written, but this thread/greenlet/context does not return until\n # after another thread/greenlet/context has read and processed the\n # recv_start frame. Without more re-write to add_sync_cb though,\n # it will block on reading responses that will never arrive\n # because the protocol header isn't written yet. TBD if needs\n # refactoring. Could encapsulate entirely here, wherein\n # read_frames exits if protocol header not yet written. Like other\n # synchronous behaviors, adding this callback will result in a\n # blocking frame read and process loop until _recv_start and any\n # subsequent synchronous callbacks have been processed. In the\n # event that this is /not/ a synchronous transport, but the\n # caller wants the connect to be synchronous so as to ensure that\n # the connection is ready, then do a read frame loop here.\n self._channels[0].add_synchronous_cb(self._channels[0]._recv_start)\n while not self._connected:\n self.read_frames()" ]
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Find data with specified criteria @param array $criteria @return Norm\Cursor
[ "public function find($criteria = array())\n {\n if (!is_array($criteria)) {\n $criteria = array(\n '$id' => $criteria,\n );\n }\n\n // wrap criteria as NObject instance to make sure it can be override by hooks\n $criteria = new NObject($criteria);\n\n $this->applyHook('searching', $criteria);\n $cursor = $this->connection->query($this, $criteria->toArray());\n $this->applyHook('searched', $cursor);\n\n return $cursor;\n }" ]
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Set gender. @param \Innova\LexiconBundle\Entity\Gender $gender @return Inflection
[ "public function setGender(\\Innova\\LexiconBundle\\Entity\\Gender $gender = null)\n {\n $this->gender = $gender;\n\n return $this;\n }" ]
[ "public function initServices() {\n $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService());\n \n // wir mappen den users controller auf den in Psc\n $entityService->setControllerClass('User', 'Psc\\CMS\\Controller\\UserEntityController');\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// SetValue sets the Value field's value.
[ "func (s *HistoricalMetricData) SetValue(v float64) *HistoricalMetricData {\n\ts.Value = &v\n\treturn s\n}" ]
[ "@SuppressWarnings(\"unchecked\")\n public <T> Param<T> get(int index) {\n // TODO: Provide a more type safe API. E.g. make index a pojo typed on T which is aligned with the Param<T>\n return (Param<T>) params[index];\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
// SetCodeBuildServiceRole sets the CodeBuildServiceRole field's value.
[ "func (s *BuildConfiguration) SetCodeBuildServiceRole(v string) *BuildConfiguration {\n\ts.CodeBuildServiceRole = &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 JEEMetadataContextProviderImpl.deserializeThreadContext\n // in order to re-establish the thread context based on the metadata identifier if not defaulted.\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Adds the panel's CSS and JavaScript to the &lt;head&gt;.
[ "public function head()\n {\n global $event, $theme;\n\n if ($event != 'rah_backup') {\n return;\n }\n\n gTxtScript(array(\n 'rah_backup_confirm_backup',\n ));\n\n $msg = array(\n 'backup' => escape_js($theme->announce_async(gTxt('rah_backup_taking'))),\n 'error' => escape_js($theme->announce_async(gTxt('rah_backup_task_error'))),\n );\n\n $js = <<<EOF\n $(function ()\n {\n $('.rah_backup_take').on('click', function (e)\n {\n e.preventDefault();\n var obj = $(this), href, spinner;\n\n if (obj.hasClass('disabled') || !verify(textpattern.gTxt('rah_backup_confirm_backup'))) {\n return false;\n }\n\n $.globalEval('{$msg['backup']}');\n\n spinner = $('<span> <span class=\"spinner\"></span> </span>');\n href = obj.attr('href');\n obj.addClass('disabled').attr('href', '#').after(spinner);\n\n $.ajax('index.php', {\n data: href.substr(1) + '&app_mode=async',\n dataType: 'script',\n timeout: 1800000\n }).fail(function ()\n {\n $.globalEval('{$msg['error']}');\n }).always(function ()\n {\n obj.removeClass('disabled').attr('href', href);\n spinner.remove();\n });\n });\n });\nEOF;\n\n echo script_js($js);\n }" ]
[ "public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $objPage->cssClass . ' {{cache_mobiledetectioncss}}';\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Return the JSON string of the response cache. Leverage the Gson nature of the domain wireline classes @return the JSON string
[ "public String asJSON() {\n Gson gson = new Gson();\n\n clearExpired();\n\n Cache jsonCache = new Cache();\n for (ExpiringService svc : cache.values()) {\n jsonCache.cache.add(svc.getService());\n }\n\n String json = gson.toJson(jsonCache);\n\n return json;\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 post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Get the series' symbol in the legend. This method should be overridable to create custom symbols through Highcharts.seriesTypes[type].prototype.drawLegendSymbols. @param {Object} legend The legend object
[ "function (legend) {\n\n var options = this.options,\n markerOptions = options.marker,\n radius,\n legendOptions = legend.options,\n legendSymbol,\n symbolWidth = legend.symbolWidth,\n renderer = this.chart.renderer,\n legendItemGroup = this.legendGroup,\n verticalCenter = legend.baseline - mathRound(renderer.fontMetrics(legendOptions.itemStyle.fontSize, this.legendItem).b * 0.3),\n attr;\n\n // Draw the line\n if (options.lineWidth) {\n attr = {\n 'stroke-width': options.lineWidth\n };\n if (options.dashStyle) {\n attr.dashstyle = options.dashStyle;\n }\n this.legendLine = renderer.path([\n M,\n 0,\n verticalCenter,\n L,\n symbolWidth,\n verticalCenter\n ])\n .attr(attr)\n .add(legendItemGroup);\n }\n\n // Draw the marker\n if (markerOptions && markerOptions.enabled !== false) {\n radius = markerOptions.radius;\n this.legendSymbol = legendSymbol = renderer.symbol(\n this.symbol,\n (symbolWidth / 2) - radius,\n verticalCenter - radius,\n 2 * radius,\n 2 * radius\n )\n .add(legendItemGroup);\n legendSymbol.isMarker = true;\n }\n }" ]
[ "function getDatasetModel(seriesModel) {\n var option = seriesModel.option;\n // Caution: consider the scenario:\n // A dataset is declared and a series is not expected to use the dataset,\n // and at the beginning `setOption({series: { noData })` (just prepare other\n // option but no data), then `setOption({series: {data: [...]}); In this case,\n // the user should set an empty array to avoid that dataset is used by default.\n var thisData = option.data;\n if (!thisData) {\n return seriesModel.ecModel.getComponent('dataset', option.datasetIndex || 0);\n }\n}" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
<p> User-supplied properties in key-value form. </p> @param parameters User-supplied properties in key-value form. @return Returns a reference to this object so that method calls can be chained together.
[ "public StorageDescriptor withParameters(java.util.Map<String, String> parameters) {\n setParameters(parameters);\n return this;\n }" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n * (Optional)Callback function to receive the result of the _delete operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~_deleteCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UsersResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Removes users account privileges.\n * This closes one or more user records in the account. Users are never deleted from an account, but closing a user prevents them from using account functions.\n\nThe response returns whether the API execution was successful (200 - OK) or if it failed. The response contains a user structure similar to the request and includes the user changes. If an error occurred during the DELETE operation for any of the users, the response for that user contains an `errorDetails` node with `errorCode` and `message` properties.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback._delete \n * @param {module:model/UserInfoList} optsOrCallback.userInfoList \n * @param {module:api/UsersApi~_deleteCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UsersResponse}\n */\n this._delete = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userInfoList'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling _delete\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n 'delete': optsOrCallback['_delete']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UsersResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the create operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~createCallback\n * @param {String} error Error message, if any.\n * @param {module:model/NewUsersSummary} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Adds news user to the specified account.\n * Adds new users to your account. Set the `userSettings` property in the request to specify the actions the users can perform on the account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/NewUsersDefinition} optsOrCallback.newUsersDefinition \n * @param {module:api/UsersApi~createCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/NewUsersSummary}\n */\n this.create = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['newUsersDefinition'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling create\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = NewUsersSummary;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users', 'POST',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the createSignatures operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~createSignaturesCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignaturesInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Adds user Signature and initials images to a Signature.\n * Adds a user signature image and/or user initials image to the specified user. \n\nThe userId property specified in the endpoint must match the authenticated user's userId and the user must be a member of the account.\n\nThe rules and processes associated with this are:\n\n* If Content-Type is set to application/json, then the default behavior for creating a default signature image, based on the name and a DocuSign font, is used.\n* If Content-Type is set to multipart/form-data, then the request must contain a first part with the user signature information, followed by parts that contain the images.\n\nFor each Image part, the Content-Disposition header has a \"filename\" value that is used to map to the `signatureName` and/or `signatureInitials` properties in the JSON to the image. \n\nFor example: \n`Content-Disposition: file; filename=\"Ron Test20121127083900\"`\n\nIf no matching image (by filename value) is found, then the image is not set. One, both, or neither of the signature and initials images can be set with this call.\n\nThe Content-Transfer-Encoding: base64 header, set in the header for the part containing the image, can be set to indicate that the images are formatted as base64 instead of as binary.\n\nIf successful, 200-OK is returned, and a JSON structure containing the signature information is provided, note that the signatureId can change with each API POST, PUT, or DELETE since the changes to the signature structure cause the current signature to be closed, and a new signature record to be created.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserSignaturesInformation} optsOrCallback.userSignaturesInformation \n * @param {module:api/UsersApi~createSignaturesCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignaturesInformation}\n */\n this.createSignatures = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userSignaturesInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling createSignatures\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling createSignatures\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignaturesInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures', 'POST',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteContactWithId operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteContactWithIdCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactUpdateResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Replaces a particular contact associated with an account for the DocuSign service.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} contactId The unique identifier of a person in the contacts address book.\n * @param {module:api/UsersApi~deleteContactWithIdCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactUpdateResponse}\n */\n this.deleteContactWithId = function(accountId, contactId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteContactWithId\");\n }\n\n // verify the required parameter 'contactId' is set\n if (contactId == undefined || contactId == null) {\n throw new Error(\"Missing the required parameter 'contactId' when calling deleteContactWithId\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'contactId': contactId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactUpdateResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts/{contactId}', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteContacts operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteContactsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactUpdateResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Delete contacts associated with an account for the DocuSign service.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/ContactModRequest} optsOrCallback.contactModRequest \n * @param {module:api/UsersApi~deleteContactsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactUpdateResponse}\n */\n this.deleteContacts = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['contactModRequest'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteContacts\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactUpdateResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteCustomSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteCustomSettingsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/CustomSettingsInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Deletes custom user settings for a specified user.\n * Deletes the specified custom user settings for a single user.\n\n###Deleting Grouped Custom User Settings###\n\nIf the custom user settings you want to delete are grouped, you must include the following information in the header, after Content-Type, in the request:\n\n`X-DocuSign-User-Settings-Key:group_name`\n\nWhere the `group_name` is your designated name for the group of customer user settings.\n\nIf the extra header information is not included, only the custom user settings that were added without a group are deleted.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/CustomSettingsInformation} optsOrCallback.customSettingsInformation \n * @param {module:api/UsersApi~deleteCustomSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/CustomSettingsInformation}\n */\n this.deleteCustomSettings = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['customSettingsInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteCustomSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling deleteCustomSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = CustomSettingsInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/custom_settings', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteProfileImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteProfileImageCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Deletes the user profile image for the specified user.\n * Deletes the user profile image from the specified user's profile.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~deleteProfileImageCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.deleteProfileImage = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteProfileImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling deleteProfileImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile/image', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteSignature operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteSignatureCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Removes removes signature information for the specified user.\n * Removes the signature information for the user.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {module:api/UsersApi~deleteSignatureCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.deleteSignature = function(accountId, userId, signatureId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteSignature\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling deleteSignature\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling deleteSignature\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the deleteSignatureImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~deleteSignatureImageCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignature} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Deletes the user initials image or the user signature image for the specified user.\n * Deletes the specified initials image or signature image for the specified user.\n\nThe function deletes one or the other of the image types, to delete both the initials image and signature image you must call the endpoint twice.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {String} imageType One of **signature_image** or **initials_image**.\n * @param {module:api/UsersApi~deleteSignatureImageCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignature}\n */\n this.deleteSignatureImage = function(accountId, userId, signatureId, imageType, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling deleteSignatureImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling deleteSignatureImage\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling deleteSignatureImage\");\n }\n\n // verify the required parameter 'imageType' is set\n if (imageType == undefined || imageType == null) {\n throw new Error(\"Missing the required parameter 'imageType' when calling deleteSignatureImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId,\n 'imageType': imageType\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignature;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}/{imageType}', 'DELETE',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getContactById operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getContactByIdCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactGetResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Gets a particular contact associated with the user&#39;s account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} contactId The unique identifier of a person in the contacts address book.\n * @param {module:api/UsersApi~getContactByIdCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactGetResponse}\n */\n this.getContactById = function(accountId, contactId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getContactById\");\n }\n\n // verify the required parameter 'contactId' is set\n if (contactId == undefined || contactId == null) {\n throw new Error(\"Missing the required parameter 'contactId' when calling getContactById\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'contactId': contactId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactGetResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts/{contactId}', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getInformation operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getInformationCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Gets the user information for a specified user.\n * Retrieves the user information for the specified user. \n\nTo return additional user information that details the last login date, login status, and the user's password expiration date, set the optional `additional_info` query string parameter to **true**.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.additionalInfo When set to **true**, the full list of user information is returned for each user in the account.\n * @param {String} optsOrCallback.email \n * @param {module:api/UsersApi~getInformationCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserInformation}\n */\n this.getInformation = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getInformation\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getInformation\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n 'additional_info': optsOrCallback['additionalInfo'],\n 'email': optsOrCallback['email']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getProfile operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getProfileCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserProfile} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the user profile for a specified user.\n * Retrieves the user profile information, the privacy settings and personal information (address, phone number, etc.) for the specified user.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~getProfileCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserProfile}\n */\n this.getProfile = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getProfile\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getProfile\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserProfile;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getProfileImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getProfileImageCallback\n * @param {String} error Error message, if any.\n * @param {Object} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the user profile image for the specified user.\n * Retrieves the user profile picture for the specified user. The image is returned in the same format as uploaded.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account.\n\nIf successful, the response returns a 200 - OK and the user profile image.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.encoding \n * @param {module:api/UsersApi~getProfileImageCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link Object}\n */\n this.getProfileImage = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getProfileImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getProfileImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n 'encoding': optsOrCallback['encoding']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['image/gif'];\n var returnType = Object;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile/image', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getSettingsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSettingsInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Gets the user account settings for a specified user.\n * Retrieves a list of the account settings and email notification information for the specified user.\n\nThe response returns the account setting name/value information and the email notification settings for the specified user. For more information about the different user settings, see the [ML:userSettings list].\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~getSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSettingsInformation}\n */\n this.getSettings = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSettingsInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/settings', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getSignature operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getSignatureCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignature} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Gets the user signature information for the specified user.\n * Retrieves the structure of a single signature with a known signature name.\n\nThe userId specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {module:api/UsersApi~getSignatureCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignature}\n */\n this.getSignature = function(accountId, userId, signatureId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getSignature\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getSignature\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling getSignature\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignature;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the getSignatureImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~getSignatureImageCallback\n * @param {String} error Error message, if any.\n * @param {Object} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the user initials image or the user signature image for the specified user.\n * Retrieves the specified initials image or signature image for the specified user. The image is returned in the same format as uploaded. In the request you can specify if the chrome (the added line and identifier around the initial image) is returned with the image.\n\nThe userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n\n###### Note: Older envelopes might only have chromed images. If getting the non-chromed image fails, try getting the chromed image.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {String} imageType One of **signature_image** or **initials_image**.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.includeChrome \n * @param {module:api/UsersApi~getSignatureImageCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link Object}\n */\n this.getSignatureImage = function(accountId, userId, signatureId, imageType, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling getSignatureImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling getSignatureImage\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling getSignatureImage\");\n }\n\n // verify the required parameter 'imageType' is set\n if (imageType == undefined || imageType == null) {\n throw new Error(\"Missing the required parameter 'imageType' when calling getSignatureImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId,\n 'imageType': imageType\n };\n var queryParams = {\n 'include_chrome': optsOrCallback['includeChrome']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['image/gif'];\n var returnType = Object;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}/{imageType}', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the list operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~listCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserInformationList} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the list of users for the specified account.\n * Retrieves the list of users for the specified account.\n\nThe response returns the list of users for the account along with the information about the result set. If the `additional_info` query was added to the endpoint and set to **true**, the full user information is returned for each user\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.additionalInfo When set to **true**, the full list of user information is returned for each user in the account.\n * @param {String} optsOrCallback.count Number of records to return. The number must be greater than 0 and less than or equal to 100. \n * @param {String} optsOrCallback.email \n * @param {String} optsOrCallback.emailSubstring Filters the returned user records by the email address or a sub-string of email address.\n * @param {String} optsOrCallback.groupId Filters user records returned by one or more group Id&#39;s.\n * @param {String} optsOrCallback.loginStatus \n * @param {String} optsOrCallback.notGroupId \n * @param {String} optsOrCallback.startPosition Starting value for the list. \n * @param {String} optsOrCallback.status \n * @param {String} optsOrCallback.userNameSubstring Filters the user records returned by the user name or a sub-string of user name.\n * @param {module:api/UsersApi~listCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserInformationList}\n */\n this.list = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling list\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n 'additional_info': optsOrCallback['additionalInfo'],\n 'count': optsOrCallback['count'],\n 'email': optsOrCallback['email'],\n 'email_substring': optsOrCallback['emailSubstring'],\n 'group_id': optsOrCallback['groupId'],\n 'login_status': optsOrCallback['loginStatus'],\n 'not_group_id': optsOrCallback['notGroupId'],\n 'start_position': optsOrCallback['startPosition'],\n 'status': optsOrCallback['status'],\n 'user_name_substring': optsOrCallback['userNameSubstring']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserInformationList;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the listCustomSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~listCustomSettingsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/CustomSettingsInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves the custom user settings for a specified user.\n * Retrieves a list of custom user settings for a single user.\n\nCustom settings provide a flexible way to store and retrieve custom user information that can be used in your own system.\n\n###### Note: Custom user settings are not the same as user account settings.\n\n###Getting Grouped Custom User Settings###\n\nIf the custom user settings you want to retrieve are grouped, you must include the following information in the header, after Content-Type, in the request:\n\n`X-DocuSign-User-Settings-Key:group_name`\n\nWhere the `group_name` is your designated name for the group of customer user settings.\n\nIf the extra header information is not included, only the custom user settings that were added without a group are retrieved.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~listCustomSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/CustomSettingsInformation}\n */\n this.listCustomSettings = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling listCustomSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling listCustomSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = CustomSettingsInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/custom_settings', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the listSignatures operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~listSignaturesCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignaturesInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Retrieves a list of user signature definitions for a specified user.\n * Retrieves the signature definitions for the specified user.\n\nThe userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.stampType \n * @param {module:api/UsersApi~listSignaturesCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignaturesInformation}\n */\n this.listSignatures = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling listSignatures\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling listSignatures\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n 'stamp_type': optsOrCallback['stampType']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignaturesInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures', 'GET',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the postContacts operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~postContactsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactUpdateResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Imports multiple new contacts into the contacts collection from CSV, JSON, or XML (based on content type).\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/ContactModRequest} optsOrCallback.contactModRequest \n * @param {module:api/UsersApi~postContactsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactUpdateResponse}\n */\n this.postContacts = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['contactModRequest'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling postContacts\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactUpdateResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts', 'POST',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the putContacts operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~putContactsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/ContactUpdateResponse} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Replaces contacts associated with an account for the DocuSign service.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/ContactModRequest} optsOrCallback.contactModRequest \n * @param {module:api/UsersApi~putContactsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/ContactUpdateResponse}\n */\n this.putContacts = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['contactModRequest'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling putContacts\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = ContactUpdateResponse;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/contacts', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateCustomSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateCustomSettingsCallback\n * @param {String} error Error message, if any.\n * @param {module:model/CustomSettingsInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Adds or updates custom user settings for the specified user.\n * Adds or updates custom user settings for the specified user.\n\n###### Note: Custom user settings are not the same as user account settings.\n\nCustom settings provide a flexible way to store and retrieve custom user information that you can use in your own system.\n\n**Important**: There is a limit on the size for all the custom user settings for a single user. The limit is 4,000 characters, which includes the XML and JSON structure for the settings.\n\n### Grouping Custom User Settings ###\n\nYou can group custom user settings when adding them. Grouping allows you to retrieve settings that are in a specific group, instead of retrieving all the user custom settings.\n\nTo group custom user settings, add the following information in the header, after Content-Type:\n\n`X-DocuSign-User-Settings-Key:group_name`\n\nWhere the `group_name` is your designated name for the group of customer user settings. Grouping is shown in the Example Request Body below.\n\nWhen getting or deleting grouped custom user settings, you must include the extra header information.\n\nGrouping custom user settings is not required and if the extra header information is not included, the custom user settings are added normally and can be retrieved or deleted without including the additional header.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/CustomSettingsInformation} optsOrCallback.customSettingsInformation \n * @param {module:api/UsersApi~updateCustomSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/CustomSettingsInformation}\n */\n this.updateCustomSettings = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['customSettingsInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateCustomSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateCustomSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = CustomSettingsInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/custom_settings', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateProfile operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateProfileCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user profile information for the specified user.\n * Updates the user's detail information, profile information, privacy settings, and personal information in the user ID card.\n\nYou can also change a user's name by changing the information in the `userDetails` property. When changing a user's name, you can either change the information in the `userName` property OR change the information in `firstName`, `middleName`, `lastName, suffixName`, and `title` properties. Changes to `firstName`, `middleName`, `lastName`, `suffixName`, and `title` properties take precedence over changes to the `userName` property.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserProfile} optsOrCallback.userProfile \n * @param {module:api/UsersApi~updateProfileCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.updateProfile = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userProfile'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateProfile\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateProfile\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateProfileImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateProfileImageCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user profile image for a specified user.\n * Updates the user profile image by uploading an image to the user profile.\n\nThe supported image formats are: gif, png, jpeg, and bmp. The file must be less than 200K. For best viewing results, DocuSign recommends that the image is no more than 79 pixels wide and high.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {module:api/UsersApi~updateProfileImageCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.updateProfileImage = function(accountId, userId, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateProfileImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateProfileImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = ['image/gif'];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/profile/image', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateSettings operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateSettingsCallback\n * @param {String} error Error message, if any.\n * @param data This operation does not return a value.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user account settings for a specified user.\n * Updates the account settings list and email notification types for the specified user.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserSettingsInformation} optsOrCallback.userSettingsInformation \n * @param {module:api/UsersApi~updateSettingsCallback} callback The callback function, accepting three arguments: error, data, response\n */\n this.updateSettings = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userSettingsInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateSettings\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateSettings\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = null;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/settings', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateSignature operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateSignatureCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignature} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user signature for a specified user.\n * Creates, or updates, the signature font and initials for the specified user. When creating a signature, you use this resource to create the signature name and then add the signature and initials images into the signature.\n\n###### Note: This will also create a default signature for the user when one does not exist.\n\nThe userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {String} optsOrCallback.closeExistingSignature When set to **true**, closes the current signature.\n * @param {module:model/UserSignatureDefinition} optsOrCallback.userSignatureDefinition \n * @param {module:api/UsersApi~updateSignatureCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignature}\n */\n this.updateSignature = function(accountId, userId, signatureId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userSignatureDefinition'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateSignature\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateSignature\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling updateSignature\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId\n };\n var queryParams = {\n 'close_existing_signature': optsOrCallback['closeExistingSignature']\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignature;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateSignatureImage operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateSignatureImageCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignature} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the user signature image or user initials image for the specified user.\n * Updates the user signature image or user initials image for the specified user. The supported image formats for this file are: gif, png, jpeg, and bmp. The file must be less than 200K.\n\nThe userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {String} signatureId The ID of the signature being accessed.\n * @param {String} imageType One of **signature_image** or **initials_image**.\n * @param {module:api/UsersApi~updateSignatureImageCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignature}\n */\n this.updateSignatureImage = function(accountId, userId, signatureId, imageType, callback) {\n var postBody = null;\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateSignatureImage\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateSignatureImage\");\n }\n\n // verify the required parameter 'signatureId' is set\n if (signatureId == undefined || signatureId == null) {\n throw new Error(\"Missing the required parameter 'signatureId' when calling updateSignatureImage\");\n }\n\n // verify the required parameter 'imageType' is set\n if (imageType == undefined || imageType == null) {\n throw new Error(\"Missing the required parameter 'imageType' when calling updateSignatureImage\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId,\n 'signatureId': signatureId,\n 'imageType': imageType\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = ['image/gif'];\n var accepts = ['application/json'];\n var returnType = UserSignature;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures/{signatureId}/{imageType}', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateSignatures operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateSignaturesCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserSignaturesInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Adds/updates a user signature.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserSignaturesInformation} optsOrCallback.userSignaturesInformation \n * @param {module:api/UsersApi~updateSignaturesCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserSignaturesInformation}\n */\n this.updateSignatures = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userSignaturesInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateSignatures\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateSignatures\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserSignaturesInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}/signatures', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateUser operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateUserCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserInformation} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Updates the specified user information.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserInformation} optsOrCallback.userInformation \n * @param {module:api/UsersApi~updateUserCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserInformation}\n */\n this.updateUser = function(accountId, userId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userInformation'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateUser\");\n }\n\n // verify the required parameter 'userId' is set\n if (userId == undefined || userId == null) {\n throw new Error(\"Missing the required parameter 'userId' when calling updateUser\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId,\n 'userId': userId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserInformation;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users/{userId}', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n\n /**\n * (Optional)Callback function to receive the result of the updateUsers operation. If none specified a Promise will be returned.\n * @callback module:api/UsersApi~updateUsersCallback\n * @param {String} error Error message, if any.\n * @param {module:model/UserInformationList} data The data returned by the service call.\n * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.\n */\n\n /**\n * Change one or more user in the specified account.\n * @param {String} accountId The external account number (int) or account ID Guid.\n * @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.\n * @param {module:model/UserInformationList} optsOrCallback.userInformationList \n * @param {module:api/UsersApi~updateUsersCallback} callback The callback function, accepting three arguments: error, data, response\n * data is of type: {@link module:model/UserInformationList}\n */\n this.updateUsers = function(accountId, optsOrCallback, callback) {\n optsOrCallback = optsOrCallback || {};\n\n if (typeof optsOrCallback === 'function') {\n callback = optsOrCallback;\n optsOrCallback = {};\n }\n\n var postBody = optsOrCallback['userInformationList'];\n\n // verify the required parameter 'accountId' is set\n if (accountId == undefined || accountId == null) {\n throw new Error(\"Missing the required parameter 'accountId' when calling updateUsers\");\n }\n\n if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){\n if (typeof optsOrCallback !== 'undefined') {\n optsOrCallback = callback;\n }\n callback = arguments[arguments.length-1];\n }\n\n var pathParams = {\n 'accountId': accountId\n };\n var queryParams = {\n };\n var headerParams = {\n };\n var formParams = {\n };\n\n var authNames = [];\n var contentTypes = [];\n var accepts = ['application/json'];\n var returnType = UserInformationList;\n\n return this.apiClient.callApi(\n '/v2/accounts/{accountId}/users', 'PUT',\n pathParams, queryParams, headerParams, formParams, postBody,\n authNames, contentTypes, accepts, returnType, callback\n );\n };\n }" ]
codesearchnet
{ "query": "Represent the comment about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about Software development:" }
Determines whether or not a command definition has options. @param array $commandDef The command definition as returned from {@link Cli::getSchema()}. @return bool Returns true if the command def has options or false otherwise.
[ "protected function hasOptionsDef($commandDef) {\n return count($commandDef) > 1 || (count($commandDef) > 0 && !isset($commandDef[Cli::META]));\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. If not set, the current package key will be used', false, null);\n $this->registerArgument('resource', PersistentResource::class, 'If specified, this resource object is used instead of the path and package information', false, null);\n $this->registerArgument('localize', 'bool', 'Whether resource localization should be attempted or not.', false, true);\n }" ]
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
/* Compile a link.
[ "function link(node, href) {\n var self = this\n var value = 'children' in node ? self.all(node).join('') : node.alt\n var url = escape(typeof href === 'string' ? href : node.url || '')\n var head\n\n if (url && url.slice(0, mailto.length) === mailto) {\n url = url.slice(mailto.length)\n }\n\n head = url.charAt(0) === '#' && self.headings[url.slice(1)]\n\n if (head) {\n url = '(' + escape(toString(head)) + ')'\n } else {\n if (value && escape(url) === value) {\n value = ''\n }\n\n if (url) {\n url = '\\\\(la' + escape(url) + '\\\\(ra'\n }\n }\n\n if (value) {\n value = bold.call(self, value)\n\n if (url) {\n value += ' '\n }\n }\n\n return value + (url ? italic.call(self, url) : '')\n}" ]
[ "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:" }
// Reverse reverses the given byte slice.
[ "func Reverse(a []byte) []byte {\n\tfor left, right := 0, len(a)-1; left < right; left, right = left+1, right-1 {\n\t\ta[left], a[right] = a[right], a[left]\n\t}\n\n\treturn a\n}" ]
[ "public String filePath(int index, String savePath) {\n // not calling the corresponding swig function because internally,\n // the use of the function GetStringUTFChars does not consider the case of\n // a copy not made\n return savePath + File.separator + fs.file_path(index);\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
{@inheritDoc} check if given string is a not empty after strip. @see javax.validation.ConstraintValidator#isValid(java.lang.Object, javax.validation.ConstraintValidatorContext)
[ "@Override\n public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {\n final String valueAsString = StringUtils.strip(Objects.toString(pvalue, null), stripcharacters);\n\n return StringUtils.isNotEmpty(valueAsString);\n }" ]
[ "@Deprecated\n protected static ValidationBuilder convertWith(org.javalite.activejdbc.validation.Converter converter) {\n return ModelDelegate.convertWith(modelClass(), converter);\n }" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software development:" }
Load a system from the remote location specified by *url*. **Example** :: load_remote_system('https://raw.github.com/chemlab/chemlab-testdata/master/naclwater.gro')
[ "def load_remote_system(url, format=None):\n '''\n '''\n filename, headers = urlretrieve(url)\n return load_system(filename, format=format)" ]
[ "def activate_script(self):\n \"\"\"\"\"\"\n\n # must be rethought\n # ./scripts\n # deploydir/./scripts\n self._add_scope(\"script\")\n self.scripts = {}\n self.script_files = [\n \"./scripts/script_*.txt\", \"~/.cloudmesh/scripts/script_*.txt\"]\n self._load_scripts(self.script_files)" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Checks if the file is a MKA. @return boolean|null
[ "protected function leadMKA()\r\n\t{\r\n\t\t$lead = $this->ffprobeFormat(\"matroska\", \"webm\");\r\n\r\n\t\tif ($lead === true)\r\n\t\t{\r\n\t\t\tif ($this->ffprobeHasAudio() !== false)\r\n\t\t\t{\r\n\t\t\t\treturn $this->closeCase(\"mka\", \"audio/x-matroska\", $this->metadata);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}" ]
[ "public File getExistingDirectory(final String param) {\n return get(param, new StringToFile(),\n new And<>(new FileExists(), new IsDirectory()),\n \"existing directory\");\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Main init method
[ "public function init()\n {\n $host =getenv('PDO_HOST');\n if($host) {\n $this->setHost(trim($host));\n }\n\n $database = getenv('PDO_DATABASE');\n if($database) {\n $this->setDatabase(trim($database));\n }\n $user = getenv('PDO_USER');\n if($user) {\n $this->setUser($user);\n }\n\n $password = getenv('PDO_PASSWORD');\n if($password) {\n $this->setPassword($password);\n }\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 Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Populate with thanks
[ "private void populateStep4() {\n this.insertRoadmapItem(3, true, I18nLabelsLoader.REPORT_STEP_THANKS, 4);\n\n int y = 6;\n\n // thanks\n this.insertFixedTextBold(this, DEFAULT_PosX, y, DEFAULT_WIDTH_LARGE, STEP_THANKS, I18nLabelsLoader.REPORT_STEP_THANKS);\n y += 12; // plus one line\n\n // thanks msg\n this.insertMultilineFixedText(this, DEFAULT_PosX, y, DEFAULT_WIDTH_LARGE, 8*5, STEP_THANKS, I18nLabelsLoader.ADDON_THANKS_MESSAGE);\n y += 8*5 + 12; // plus 15 lines\n\n // status\n this.insertFixedText(this, DEFAULT_PosX, y, DEFAULT_WIDTH_LARGE, STEP_THANKS, I18nLabelsLoader.ADDON_THANKS_STATUS);\n this.thanksStatusLabel = this.insertHiddenFixedStatusText(this, DEFAULT_PosX + 40, y, DEFAULT_WIDTH_LARGE, STEP_THANKS, I18nLabelsLoader.ADDON_THANKS_STATUS, false);\n y += 12;\n \n // link\n this.thanksReportLink = this.insertFixedHyperlink(this, DEFAULT_PosX, y, DEFAULT_WIDTH_LARGE, STEP_THANKS, I18nLabelsLoader.ADDON_THANKS_LINK, Resources.getProperty(\"COMMUNITY_ROOT\") + \"/reports\");\n\n this.thanksProgressBar = this.insertProgressBar(DEFAULT_PosX, DEFAULT_DIALOG_HEIGHT - 26 - 8, DEFAULT_WIDTH_LARGE, STEP_THANKS, 100);\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 CAP\n}" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Get the listener options for the command. @return \Illuminate\Queue\ListenerOptions
[ "protected function gatherOptions()\n {\n return new ListenerOptions(\n $this->option('env'), $this->option('delay'),\n $this->option('memory'), $this->option('timeout'),\n $this->option('sleep'), $this->option('tries'),\n $this->option('force')\n );\n }" ]
[ "public function register()\n {\n $this->registerFileConfig();\n $this->registerDatabaseConfig();\n\n // Bind the concrete types\n $this->app->bind('Concrete\\Core\\Config\\Repository\\Repository', 'config');\n $this->app->bind('Illuminate\\Config\\Repository', 'Concrete\\Core\\Config\\Repository\\Repository');\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }