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 ...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the Github 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 /*...
[ "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...
[ "def register (g):\n \n assert isinstance(g, Generator)\n id = g.id()\n\n __generators [id] = g\n\n # A generator can produce several targets of the\n # same type. We want unique occurence of that generator\n # in .generators.$(t) in that case, otherwise, it will\n # be tried twice and we'll...
codesearchnet
{ "query": "Represent the Github 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 ...
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. Pr...
[ "@Override\n public void generatePluginConfig(String serverName, File writeDirectory) {\n // Pass true to utilityRequest since this method will be called from the pluginUtility\n // or by the GeneratePluginConfigListener not by a call to the mbean.\n generatePluginConfig(null,serverName,true...
codesearchnet
{ "query": "Represent the Github 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 +...
[ "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 apimachineryval...
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 centroidCoord...
[ "def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato...
codesearchnet
{ "query": "Represent the 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 ...
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 ...
[ "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(...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
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....
[ "def _check_graph(self, graph):\n \"\"\"\"\"\"\n if graph.num_vertices != self.size:\n raise TypeError(\"The number of vertices in the graph does not \"\n \"match the length of the atomic numbers array.\")\n # In practice these are typically the same arrays using the s...
codesearchnet
{ "query": "Represent the 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 TC...
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\tisTelepor...
[ "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:\...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the 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\tcustomConsu...
[ "@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...
[ "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 pos...
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 ($cla...
[ "public function hintJsonStructure($column, $structure)\n {\n if (json_decode($structure) === null) {\n throw new InvalidJsonException();\n }\n\n $this->hintedJsonAttributes[$column] = $structure;\n\n // Run the call to add hinted attributes to the internal json\n //...
codesearchnet
{ "query": "Represent the 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 # CAR...
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....
[ "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 necess...
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...
[ "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._st...
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 ...
[ "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_maxi...
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....
[ "def delete_node_storage(node)\n return if node == BLANK_NODE\n raise ArgumentError, \"node must be Array or BLANK_NODE\" unless node.instance_of?(Array)\n\n encoded = encode_node node\n return if encoded.size < 32\n\n # FIXME: in current trie implementation two nodes can share identical\n ...
codesearchnet
{ "query": "Represent the 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 ...
[ "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...
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\...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the 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 ...
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 prototyp...
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...
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...
[ "def handle_dims(opts):\n '''\n \n '''\n use,res = [],[];\n if opts['--X']:\n use.append('x');\n res.append(int(opts['--xres']));\n if opts['--Y']:\n use.append('y');\n res.append(int(opts['--yres']));\n if opts['--Z']:\n use.append('z');\n res.append(i...
codesearchnet
{ "query": "Represent the text about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
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 ...
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 !== ...
[ "function inflate(object) {\n // check if the object is an object and isn't empty\n if (is(object) && !empty(object)) {\n // create a new object for the result\n let result = {};\n\n // for each key in the object\n Object.keys(object).forEach((path) => {\n // get value from the object\n cons...
codesearchnet
{ "query": "Represent the description about 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}\"'...
[ "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 '...
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 s...
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.R...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github 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,...
[ "private static function appRun(){\n // echo \"runing\";\n // 当有get参数传递时 获取get参数\n if(isset($_GET['s'])){\n // 更加\"/\"将get参数分割成数组\n $info = explode('/',$_GET['s']);\n\n // 获取模块名称 转换成小写\n $m = strtolower($info[0]);\n // 获取控制器名称 转换成小写\n ...
codesearchnet
{ "query": "Represent the Github 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($a...
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 ...
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.chil...
[ "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->fro...
[ "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 diff...
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());\...
[ "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 ...
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.Rota...
[ "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 i...
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 i...
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 diff...
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__\"]...
[ "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 t...
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 ...
[ "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 larg...
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 diff...
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 ba...
[ "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 t...
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 ...
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 ...
[ "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城...
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 = ...
[ "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_maxi...
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 ...
[ "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 diff...
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 v...
[ "function Rule(rules) {\n this.rules = rules;\n // Identifies individual rule\n this.name = \"\";\n // Identifies the grammar that this rule belongs to \n this.grammarName = \"\";\n // Identifies types of rules. Rules can have \"types\" that are diff...
codesearchnet
{ "query": "Represent the Github 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...
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 ...
[ "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...
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._clic...
[ "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] = tar...
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...
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 prototyp...
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->i...
[ "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.No...
[ "public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)\n {\n // TODO Actually use session\n // Session will be used to provide information about the order of function namespaces to through resolving the function.\n // This is l...
codesearchnet
{ "query": "Represent the 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.g...
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(...
[ "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 ...
[ "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城...
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::ad...
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github 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 ...
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 l...
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 th...
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);...
[ "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 JEEMetadataContextProviderImp...
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_bac...
[ "public function insertInsertTagMD( $objPage, $objLayout, $objPageRegular)\n {\n // set vary header for browsers to avoid caching in Proxies for different browsers\n header('Vary: User-Agent', false);\n \n // add mobiledetectioncss class to page css class\n $objPage->cssClass = $...
codesearchnet
{ "query": "Represent the 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 ...
[ "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 `s...
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 ...
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....
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....
[ "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 ...
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...
[ "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 ...
[ "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 ...
[ "function writeTimeBound(type, prmname, boundType, outputType) {\n return utils.parts(type, {\n B : prmname,\n // TODO: is this correct?\n C : boundType+'_'+(type === 'QU' ? 'UBT' : 'LBT')+'(KAF)',\n E : '1MON'\n }, outputType);\n //A=HEXT2014 B=SR-CMN_SR-CMN C=STOR_UBT(KAF) E=1MON F=CAMANCHE R FLOOD...
codesearchnet
{ "query": "Represent the Github 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\...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }