query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
@SuppressWarnings(PHPMD.BooleanArgumentFlag) @param LoaderComponents $loaderComponentsPool @param PluginConfig $pluginConfig @param bool $devMode @return Patch\DefinitionList\Loader
[ "public function create(LoaderComponents $loaderComponentsPool, PluginConfig $pluginConfig, $devMode = false)\n {\n $composer = $this->composer;\n\n $installationManager = $composer->getInstallationManager();\n\n $rootPackage = $composer->getPackage();\n\n $composerConfig = clone $com...
[ "public function createService(ServiceLocatorInterface $serviceLocator)\n {\n /** @var $processingConfig ProcessingConfig */\n $processingConfig = $serviceLocator->get('processing_config');\n\n return ProcessingNode::initializeAs(NodeName::fromString($processingConfig->getNodeName()));\n ...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software Development:" }
Checks if given $password contains at least one numeric character (if rule is applicable). @param string $password @return bool
[ "private function containsAtLeastOneNumericCharacter(string $password): bool\n {\n if ($this->constraints['requireAtLeastOneNumericCharacter']) {\n return (bool)preg_match(self::AT_LEAST_ONE_NUMERIC_CHARACTER_REGEX, $password);\n }\n\n return true;\n }" ]
[ "public static function optionalIsNotSuffix(Input $definition): self\n {\n $pointer = self::createPointerString($definition->getInput(), $definition->getIndex());\n\n return new self(\"Optional sequence cannot be followed by anything else:\\n$pointer\");\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Programming:" }
Given a Collection of Purchasables, return a collection of related purchasables. @param PurchasableInterface[] $purchasables Purchasable @param int $limit Limit of elements retrieved @return array Related products
[ "public function getRelatedPurchasablesFromArray(array $purchasables, $limit)\n {\n $categories = [];\n\n /**\n * @var PurchasableInterface $product\n */\n foreach ($purchasables as $purchasable) {\n $category = $purchasable->getPrincipalCategory();\n if...
[ "abstract public function __construct(DataAccessInterface $dataSource);\n \n /**\n * Returns an array with all entities for the given data request.\n * \n * @param \\Zepi\\DataSource\\Core\\DataRequest $dataRequest\n * @return false|array\n */\n public function find(DataRequest $dataReq...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// forwardedTLSInfoFromContext obtains forwarded TLS CN/OU from the grpc.MD // object in ctx.
[ "func forwardedTLSInfoFromContext(ctx context.Context) (remoteAddr string, cn string, org string, ous []string) {\n\tmd, _ := metadata.FromIncomingContext(ctx)\n\tif len(md[remoteAddrKey]) != 0 {\n\t\tremoteAddr = md[remoteAddrKey][0]\n\t}\n\tif len(md[certCNKey]) != 0 {\n\t\tcn = md[certCNKey][0]\n\t}\n\tif len(md...
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the summarization about Go programming language:", "pos": "Represent the code about Go programming language:", "neg": "Represent the code about programming:" }
// UnmarshalYAML is a custom unmarshaler that wraps strings in arrays
[ "func (a *FlagArray) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar flags []string\n\tif err := unmarshal(&flags); err != nil {\n\t\tvar flagstr string\n\t\tif err := unmarshal(&flagstr); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t*a = strings.Fields(flagstr)\n\t} else {\n\t\t*a = flags\n\t}\n\tret...
[ "func (re RawExtension) MarshalJSON() ([]byte, error) {\n\tif re.Raw == nil {\n\t\t// TODO: this is to support legacy behavior of JSONPrinter and YAMLPrinter, which\n\t\t// expect to call json.Marshal on arbitrary versioned objects (even those not in\n\t\t// the scheme). pkg/kubectl/resource#AsVersionedObjects and ...
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
// stateBeginValue is the state at the beginning of the input.
[ "func stateBeginValue(s *Scanner, c int) int {\n\tif c <= ' ' && isSpace(rune(c)) {\n\t\treturn ScanSkipSpace\n\t}\n\tswitch c {\n\tcase '{':\n\t\ts.Step = stateBeginStringOrEmpty\n\t\ts.pushParseState(parseObjectKey)\n\t\treturn ScanBeginObject\n\tcase '[':\n\t\ts.Step = stateBeginValueOrEmpty\n\t\ts.pushParseStat...
[ "@Override\n public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)\n {\n // since we return a constant, no need to read from the event\n }" ]
codesearchnet
{ "query": "Represent the Github sentence about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code:" }
Saves an ONNX model to a ProtoBuf object. :param model: ONNX model :param file_path: ONNX file (full file name) Example: :: from onnxmltools.utils import save_model save_model(onnx_model, 'c:/test_model.onnx')
[ "def save_model(model, file_path):\n \n if model is None or not isinstance(model, onnx_proto.ModelProto):\n raise ValueError(\"Model is not a valid ONNX model.\")\n directory = os.path.dirname(os.path.abspath(file_path))\n if not path.exists(directory):\n raise FileNotFoundError(\"Director...
[ "def load_precise_model(model_name: str) -> Any:\n \"\"\"\"\"\"\n if not model_name.endswith('.net'):\n print('Warning: Unknown model type, ', model_name)\n\n inject_params(model_name)\n return load_keras().models.load_model(model_name)" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
// UnmarshalJSON handles deserialization of a SourceTransaction. This custom // unmarshaling is needed to extract the type specific data (accessible under // `TypeData`) but stored in JSON under a hash named after the `type` of the // source transaction.
[ "func (t *SourceTransaction) UnmarshalJSON(data []byte) error {\n\ttype sourceTransaction SourceTransaction\n\tvar v sourceTransaction\n\terr := json.Unmarshal(data, &v)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*t = SourceTransaction(v)\n\n\tvar raw map[string]interface{}\n\terr = json.Unmarshal(data, &raw)\n\tif...
[ "func (re RawExtension) MarshalJSON() ([]byte, error) {\n\tif re.Raw == nil {\n\t\t// TODO: this is to support legacy behavior of JSONPrinter and YAMLPrinter, which\n\t\t// expect to call json.Marshal on arbitrary versioned objects (even those not in\n\t\t// the scheme). pkg/kubectl/resource#AsVersionedObjects and ...
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Prepends the addition of required imports of the employed annotations. Since the 'typeComment' is a {@link JavaFileAccess.JavaTypeAwareStringConcatenation} any optionally required imports are already processed and tracked in {@link #imports}.
[ "@Override\n public CharSequence getContent() {\n CharSequence _xblockexpression = null;\n {\n final Consumer<IClassAnnotation> _function = (IClassAnnotation it) -> {\n this.importType(it.getAnnotationImport());\n };\n this.getClassAnnotations().forEach(_function);\n _xblockexpress...
[ "static Optional<AnnotatedValueResolver> ofBeanField(Field field, Set<String> pathParams,\n List<RequestObjectResolver> objectResolvers) {\n // 'Field' is only used for converting a bean.\n // So we always need to pass 'implicitRequestObjectAnnota...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Healthcare IT:" }
"Subject" is the to-be-copied node; the "sibling" node is the node after which the "Subject" should be copied. @return boolean
[ "public function canApply()\n {\n $nodeType = $this->getSubject()->getNodeType();\n\n return $this->getSiblingNode()->getParent()->isNodeTypeAllowedAsChildNode($nodeType);\n }" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the Github comment about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about programming:" }
@param string $type @param string $subtype @return PDFObject[]
[ "public function getObjectsByType($type, $subtype = null)\n {\n $objects = array();\n\n foreach ($this->objects as $id => $object) {\n if ($object->getHeader()->get('Type') == $type &&\n (is_null($subtype) || $object->getHeader()->get('Subtype') == $subtype)\n )...
[ "static function init() {return dfcf(function() {\n\t\t$appId = S::s()->appId(); /** @var string|null $appId */\n\t\treturn !$appId ? '' : df_block_output(__CLASS__, 'init', ['appId' => $appId]);\n\t});}" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
// Error should be called by the user to print out the stringified version of the error
[ "func (e ErrInvalidZebedeeResponse) Error() string {\n\treturn fmt.Sprintf(\"invalid response from zebedee - should be 2.x.x or 3.x.x, got: %d, path: %s\",\n\t\te.actualCode,\n\t\te.uri,\n\t)\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 text about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about programming:" }
Reads the content of a file. @param string $filePath The path to the file. @param boolean $showError Do we need to display na error message? @return string The content of the file, if readable.
[ "public function getFileContents($filePath, $showError = true)\n {\n $filePath = realpath($filePath);\n\n if ($this->fileIsReadable($filePath) === false) {\n if ($showError === true) {\n // This file was not readable! We need to tell the user!\n $this->pool-...
[ "function Check($value)\n {\n $success = true;\n $strings = System\\Str::SplitLines($value);\n foreach ($strings as $string)\n {\n $success = parent::Check($string);\n if (!$success)\n break;\n }\n \n //The value is temporarily...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
// Validate inspects the fields of the type to determine if they are valid.
[ "func (s *SendBonusInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"SendBonusInput\"}\n\tif s.AssignmentId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"AssignmentId\"))\n\t}\n\tif s.AssignmentId != nil && len(*s.AssignmentId) < 1 {\n\t\tinvalidParams.Add(request.New...
[ "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 programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// NewEncoder returns an Encoder which writes JSON stream into "w".
[ "func (j *JSONBuiltin) NewEncoder(w io.Writer) Encoder {\n\treturn json.NewEncoder(w)\n}" ]
[ "func (jsonFramer) NewFrameReader(r io.ReadCloser) io.ReadCloser {\n\t// we need to extract the JSON chunks of data to pass to Decode()\n\treturn framer.NewJSONFramedReader(r)\n}" ]
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// SetInstanceId sets the InstanceId field's value.
[ "func (s *DeleteAssociationInput) SetInstanceId(v string) *DeleteAssociationInput {\n\ts.InstanceId = &v\n\treturn s\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// IsWSClosedErr checks if the passed error indicates a closed websocket // connection.
[ "func IsWSClosedErr(err error) (closedErr bool) {\n\t// Must use strings.Contains to catch errors like \"write tcp\n\t// 127.0.0.1:7777->127.0.0.1:39196: use of closed network connection\".\n\treturn err != nil && strings.Contains(err.Error(), ErrWsClosed)\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 description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Attempts to cast <code>object</code> to class <code>cls</code>. Returns <code>null</code> if cast is impossible.
[ "@SuppressWarnings(\"unchecked\")\n\tpublic static @Nullable <T> T as(Object object, Class<T> cls) {\n\t\treturn cls.isInstance(object) ? (T) object : null;\n\t}" ]
[ "public void call(String method, Object[] args)\n throws IOException\n {\n startCall(method);\n\n if (args != null) {\n for (int i = 0; i < args.length; i++)\n writeObject(args[i]);\n }\n\n completeCall();\n }\n\n /**\n * Starts the method ca...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about writing:" }
wrapper for json encode, which does not work with non utf8 characters @param mixed $data data to encode @return string
[ "public function jsonEncode($data)\n {\n if (is_array($data)) {\n $ret = \"\";\n $blWasOne = false;\n $blNumerical = true;\n reset($data);\n while ($blNumerical && $key = key($data)) {\n $blNumerical = !is_string($key);\n }\n...
[ "def processRequest(cls, ps, **kw):\n \n resource = kw['resource']\n method = resource.getOperation(ps, None) # This getOperation method is valid for ServiceSOAPBinding subclass\n rsp = method(ps, **kw)[1] # return (request, response) but we only need response\n return rsp" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Computer Science:" }
Returns the named event. Removes it from the internal queue.
[ "def getEvent(self, name):\n \n to_return = None\n for event in self._observer.caught_events:\n if event[\"name\"] == name:\n to_return = event\n break\n if to_return:\n self._observer.caught_events.remove(to_return)\n self._...
[ "function DependentArraysObserver(callbacks, cp, instanceMeta, context, propertyName, sugarMeta) {\n // user specified callbacks for `addedItem` and `removedItem`\n this.callbacks = callbacks;\n\n // the computed property: remember these are shared across instances\n this.cp = cp;\n\n // th...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Задаёт описание сайта @param string $description новое описание @throws Eresus_Exception_InvalidArgumentType @since 3.01
[ "public function setDescription($description)\n {\n if (!is_string($description))\n {\n throw Eresus_Exception_InvalidArgumentType::factory(__METHOD__, 1, 'string', $description);\n }\n $this->description = $description;\n }" ]
[ "final protected function v($name = null) {return dfak($this, function() {\n\t\t$result = dfa($this->_data, 'value', []);\n\t\t/**\n\t\t * 2016-06-29\n\t\t * Что интересно, при смене области действия настроек с глобальной на другую (сайт или магазин)\n\t\t * поле «value» может почему-то содержать не массив,\n\t\t *...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Interpolate the sql query with the parameters. Do not try to execute this query directly as it can lead to SQL Injection. @todo Quote with pdo.
[ "public function getRawSql()\n {\n $search = array();\n $replace = array();\n $params = $this->getParams();\n ksort($params, SORT_STRING);\n foreach ($params as $key => $value) {\n if (is_int($key)) {\n $key = '?';\n }\n $search[]...
[ "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 instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Return a metric unit string for human consumption, that is inferred from the metric name. If a unit cannot be inferred, `None` is returned.
[ "def _metric_unit_from_name(metric_name):\n \n for item in _PATTERN_UNIT_LIST:\n pattern, unit = item\n if pattern.match(metric_name):\n return unit\n return None" ]
[ "def _split_standard_name(self, standard_name):\n '''\n \n '''\n\n if isinstance(standard_name, basestring) and ' ' in standard_name:\n return standard_name.split(' ', 1)\n # if this isn't a string, then it doesn't make sense to split\n # -- treat value as standa...
codesearchnet
{ "query": "Represent the summarization about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about Software Engineering:" }
Convert a PSR7 Response into a CakePHP one. @param \Psr\Http\Message\ResponseInterface $response The response to convert. @return \Cake\Http\Response The equivalent CakePHP response
[ "public static function toCake(PsrResponse $response)\n {\n $body = static::getBody($response);\n $data = [\n 'status' => $response->getStatusCode(),\n 'body' => $body['body'],\n ];\n $cake = new CakeResponse($data);\n if ($body['file']) {\n $ca...
[ "public function revokeAction()\n {\n // Can't do anything if not HTTP request...\n if (!$this->request instanceof HttpRequest) {\n return null;\n }\n\n // Currently, ZF2 Http Request object is not PSR-7 compliant, therefore we need to create a new one from\n // glob...
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Decorator that restricts access only for authorized users with correct permissions. If user is not authorized - raises HTTPUnauthorized, if user is authorized and does not have permission - raises HTTPForbidden.
[ "def has_permission(\n permission,\n context=None,\n):\n \n def wrapper(fn):\n @wraps(fn)\n async def wrapped(*args, **kwargs):\n request = args[-1]\n if not isinstance(request, web.BaseRequest):\n msg = (\"Incorrect decorator usage. \"\n ...
[ "def get_entity(ent_type, **kwargs):\n '''\n \n '''\n try:\n func = 'keystoneng.{}_get'.format(ent_type)\n ent = __salt__[func](**kwargs)\n except OpenStackCloudException as e:\n # NOTE(SamYaple): If this error was something other than Forbidden we\n # reraise the issue si...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Parse a JSON data structure from content from an inputStream @param inputStream stream over a JSON content @return a data structure of lists and maps @since 2.3
[ "public Object parse(InputStream inputStream) {\n if (inputStream == null) {\n throw new IllegalArgumentException(\"inputStream must not be null\");\n }\n\n Object content;\n JsonParser parser = createParser();\n content = parser.parse(inputStream);\n return cont...
[ "@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 summarization:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// Resource-level
[ "func (r *Service) Reload() (*Service, error) {\n\treturn r.collection.Get(r.Metadata.Name)\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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Programming:" }
/* @see com.ibm.wsspi.channelfw.base.OutboundProtocolLink#ready(com.ibm.wsspi.channelfw .VirtualConnection)
[ "public void ready(VirtualConnection inVC) {\n if (!this.reconnecting) {\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {\n Tr.debug(tc, \"Outbound ready for \" + this + \" \" + inVC);\n }\n super.ready(inVC);\n } else {\n ...
[ "@SuppressWarnings(\"unchecked\")\n public static StackFinder getInstance() {\n if (finder == null) {\n AccessController.doPrivileged(new PrivilegedAction() {\n public Object run() {\n finder = new StackFinder();\n return null;\n ...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SafeAdd returns the result and whether overflow occurred.
[ "func SafeAdd(x, y uint64) (uint64, bool) {\n\treturn x + y, y > MaxUint64-x\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 instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Static asset management in python. Called with no arguments grablib will download, then build. You can also choose to only download or build. See `grablib -h` and https://github.com/samuelcolvin/grablib for more help.
[ "def cli(action, config_file, debug, verbose):\n \n if verbose is True:\n log_level = 'DEBUG'\n elif verbose is False:\n log_level = 'WARNING'\n else:\n assert verbose is None\n log_level = 'INFO'\n\n setup_logging(log_level)\n try:\n grab = Grab(config_file, deb...
[ "def prepare(self):\n ''''''\n self.__make_scubadir()\n\n if self.is_remote_docker:\n '''\n Docker is running remotely (e.g. boot2docker on OSX).\n We don't need to do any user setup whatsoever.\n\n TODO: For now, remote instances won't have any .scub...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Get the list of library adapters that are present in the configuration. @return array
[ "protected function getLibrariesInUse()\n {\n $aNames = $this->getOption('dialogs.libraries', array());\n if(!is_array($aNames))\n {\n $aNames = array();\n }\n $libraries = array();\n foreach($aNames as $sName)\n {\n if(($library = $this->get...
[ "@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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Opens the location picker popup.<p>
[ "void openPopup() {\n\n try {\n if (m_popup == null) {\n m_popup = new CmsPopup(Messages.get().key(Messages.GUI_LOCATION_DIALOG_TITLE_0), hasMap() ? 1020 : 420);\n m_popupContent = new CmsLocationPopupContent(\n this,\n new CmsLoc...
[ "function() {\n \n // make sure the modal viewer and other options are off just in case\n modalViewer.close();\n\n // note it's turned on in the viewer\n DataSaver.updateValue('modalActive', 'true');\n modalViewer.active = true;\n\n // add an active class to the button that matches this templat...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "public EEnum getFNDFtWdClass() {\n\t\tif (fndFtWdClassEEnum == null) {\n\t\t\tfndFtWdClassEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(35);\n\t\t}\n\t\treturn fndFtWdClassEEnum;\n\t}" ]
[ "protected function _init($definition=null)\n {\n\n if (!is_null($definition)) {\n $this->_packageXml = simplexml_load_string($definition);\n } else {\n $packageXmlStub = <<<END\n<?xml version=\"1.0\"?>\n<package>\n <name />\n <version />\n <stability />\n <license...
codesearchnet
{ "query": "Represent the Github comment about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
import a scraper from the scraper registry
[ "def get_scraper(mod_path, scraper_type):\n \n\n # act of importing puts it into the registry\n try:\n module = importlib.import_module(mod_path)\n except ImportError as e:\n raise ScrapeError(\"could not import %s\" % mod_path, e)\n\n # now find the class within the module\n Scraper...
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Handle the global commands. @param EnvironmentInterface $environment The environment. @return void
[ "private function handleGlobalCommands(EnvironmentInterface $environment)\n {\n $dataDefinition = $environment->getDataDefinition();\n $backendView = $dataDefinition->getDefinition(Contao2BackendViewDefinitionInterface::NAME);\n\n $backButton = null;\n if ($backendView->getGlobalCo...
[ "@Help(help = \"Create the object of type {#}\")\n public T create(final T object) throws SDKException {\n return (T) requestPost(object);\n }" ]
codesearchnet
{ "query": "Represent the Github description about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
// Usagef prints the Printf formatted message to stderr, prints usage help and // exits the program // Note: os.Exit(1) is not recoverable
[ "func Usagef(cmd *cobra.Command, msg string, args ...interface{}) {\n\ttxt := fmt.Sprintf(msg, args...)\n\tfmt.Fprintf(os.Stderr, \"Error: %s\\n\\n\", txt)\n\tcmd.Help()\n\tos.Exit(1)\n}" ]
[ "func (logger *Logger) Log(level Level, v ...interface{}) {\n\t// Don't delete this calling. The calling is used to keep the same\n\t// calldepth for all the logging functions. The calldepth is used to\n\t// get runtime information such as line number, function name, etc.\n\tlogger.log(level, v...)\n}" ]
codesearchnet
{ "query": "Represent the comment about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Computer Science:" }
Returns a list of coastal edge coordinate. An edge is coastal if it is on the grid's border. :return: list(int)
[ "def coastal_edges(tile_id):\n \n edges = list()\n tile_coord = tile_id_to_coord(tile_id)\n for edge_coord in edges_touching_tile(tile_id):\n dirn = tile_edge_offset_to_direction(edge_coord - tile_coord)\n if tile_id_in_direction(tile_id, dirn) is None:\n edges.append(edge_coord...
[ "def point(self):\n \n if not self.geometry:\n raise ValueError('geometry attribute must be set before trying to get point property')\n if self.geometry.geom_type == 'Point':\n return self.geometry\n else:\n try:\n # point_on_surface guaran...
codesearchnet
{ "query": "Represent the Github summarization about Computer Science:", "pos": "Represent the Github code about Computer Science:", "neg": "Represent the Github code about Software development:" }
Parse aggregations providers from request node configuration. @param \DOMXPath $xpath XPath access to the document parsed. @param \DOMNode $rootNode Request node to be parsed. @return array
[ "private function parseAggregationsProviders(\\DOMXPath $xpath, \\DOMNode $rootNode)\n {\n $providers = [];\n\n foreach ($xpath->query(self::AGGREGATIONS_PROVIDERS_PATH, $rootNode) as $providerNode) {\n $providers[$providerNode->getAttribute('name')] = $providerNode->nodeValue;\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 //...
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:" }
Merge default config and config from application `config` folder.
[ "protected function mergeConfigs()\n {\n $repo = $this->getConfigRepository();\n $config = $repo->get(static::CONFIG_FILE_NAME_WO_EXT, []);\n $base = $this->getBaseConfig();\n $result = $config + $base;\n $repo->set(static::CONFIG_FILE_NAME_WO_EXT, $result);\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 description:", "pos": "Represent the code:", "neg": "Represent the code:" }
Check if user has any of the roles requested :param roles: tuple of roles string :return: bool
[ "def has_any_roles(self, *roles):\n \n roles = map(utils.slugify, list(roles))\n\n return True \\\n if AuthUserRole.query() \\\n .join(AuthUser) \\\n .filter(AuthUserRole.name.in_(roles)) \\\n .filter(AuthUser.id == self.id) \\\n .count() \...
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the post about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Use `git rev-parse HEAD <REPO>` to get current SHA.
[ "def get_sha(path=None, log=None, short=False, timeout=None):\n \n # git_command = \"git rev-parse HEAD {}\".format(repo_name).split()\n # git_command = \"git rev-parse HEAD\".split()\n git_command = [\"git\", \"rev-parse\"]\n if short:\n git_command.append(\"--short\")\n git_command.append...
[ "function (next) {\n console.log(chalk.yellow.bold('Publishing wiki...'));\n\n // create a location to clone repository\n // @todo - maybe do this outside in an os-level temp folder to avoid recursive .git\n mkdir('-p', WIKI_GIT_PATH);\n rm('-rf', WIKI_GIT_PATH...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code:" }
reset the obscov attribute to None Parameters ---------- arg : str or pyemu.Matrix the value to assign to the obscov attribute. If None, the private __obscov attribute is cleared but not reset
[ "def reset_obscov(self,arg=None):\n \n self.logger.statement(\"resetting obscov\")\n self.__obscov = None\n if arg is not None:\n self.obscov_arg = arg" ]
[ "def set_prop(self, prop, value, ef=None):\n \n if ef:\n # prop should be restricted to n_decoys, an int, the no. of decoys corresponding to a given FPF.\n # value is restricted to the corresponding enrichment factor and should be a float\n self.ef[prop] = value\n ...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
@param string $attributeName @return Attribute
[ "public function getAttribute($attributeName)\n {\n // init\n $result = null;\n\n // action\n foreach ($this->attributes as $attribute) {\n if ($attribute->Name == $attributeName) {\n $result = $attribute;\n break;\n }\n }\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 summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Adds the XML digester rules for organizational units.<p> @param digester the digester to add the rules to @param xpath the base xpath for the rules
[ "protected void addAccountsOrgunitRules(Digester digester, String xpath) {\n\n digester.addCallMethod(xpath + N_NAME, \"setOrgUnitName\", 0);\n digester.addCallMethod(xpath + N_DESCRIPTION, \"setOrgUnitDescription\", 0);\n digester.addCallMethod(xpath + N_FLAGS, \"setOrgUnitFlags\", 0);\n ...
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github sentence about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Create a temporary directory for the run.
[ "def _create_temp_dir(self):\n \"\"\"\"\"\"\n if self._user is None:\n base_dir = tempfile.mkdtemp(prefix=\"BenchExec_run_\")\n else:\n create_temp_dir = self._build_cmdline([\n 'python', '-c',\n 'import tempfile;'\n 'print(temp...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Encoded tags are of the form: <version_id><encoded_tags>
[ "static byte[] serializeBinary(TagContext tags) throws TagContextSerializationException {\n // Use a ByteArrayDataOutput to avoid needing to handle IOExceptions.\n final ByteArrayDataOutput byteArrayDataOutput = ByteStreams.newDataOutput();\n byteArrayDataOutput.write(VERSION_ID);\n int totalChars = 0; ...
[ "def _init_prtfmt(self, key=\"fmta\"):\n \"\"\"\"\"\"\n prtfmt = self.gosubdag.prt_attr[key]\n return prtfmt.replace(\"{NS}\", \"{NS} {hdr1usr01:2} {num_usrgos:>4} uGOs\")" ]
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
将集合中的数据全排列 @param list 集合数据 @param <T> 数据类型 @return 全排列结果,例如传入[1,2],返回[[1,2], [2,1]]
[ "public static <T> List<List<T>> permutations(List<T> list) {\n if (list == null || list.isEmpty()) {\n return Collections.emptyList();\n }\n long size = MathUtil.factorial(list.size());\n if (size > Integer.MAX_VALUE) {\n throw new OutOfMemoryError(\"全排列结果集大小为[\" +...
[ "protected static void fixResultByRule(List<Vertex> linkedArray)\n {\n\n //--------------------------------------------------------------------\n //Merge all seperate continue num into one number\n mergeContinueNumIntoOne(linkedArray);\n\n //-------------------------------------------...
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about text processing:" }
Execute solr autocomplete
[ "def autocomplete(self):\n \n self.facet = False\n params = self.solr_params()\n logging.info(\"PARAMS=\" + str(params))\n results = self.solr.search(**params)\n logging.info(\"Docs found: {}\".format(results.hits))\n return self._process_autocomplete_results(results...
[ "def build(self):\n \"\"\"\"\"\"\n from ambry.orm.config import BuildConfigGroupAccessor\n\n # It is a lightweight object, so no need to cache\n return BuildConfigGroupAccessor(self.dataset, 'buildstate', self._session)" ]
codesearchnet
{ "query": "Represent the comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
{{{ protected function getInputTag()
[ "protected function getInputTag()\n {\n $tag = parent::getInputTag();\n\n if ($this->name !== null) {\n $tag->name = $this->name;\n }\n\n return $tag;\n }" ]
[ "protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Internal method to create the size @param ImageReferencedElement $entity @param EntityManager $em
[ "protected function createImageSize(ImageReferencedElement $entity, EntityManager $em)\n\t{\n\t\t$imageId = $entity->getImageId();\n\n\t\t$fileStorage = $this->container['cms.file_storage'];\n\t\t/* @var $fileStorage \\Supra\\Package\\Cms\\FileStorage\\FileStorage */\n\n\t\t$image = $fileStorage->findImage($imageId...
[ "public File getExistingFile(final String param) {\n return get(param, getFileConverter(),\n new And<>(new FileExists(), new IsFile()),\n \"existing file\");\n }" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about File management:" }
Return the definition of the properties of this model. @return array
[ "protected static function define_properties() {\n return array(\n 'name' => array(\n 'type' => PARAM_TEXT\n ),\n 'image' => array(\n 'type' => PARAM_URL,\n 'null' => NULL_ALLOWED,\n 'default' => null\n ),...
[ "def property_(getter: Map[Domain, Range]) -> property:\n \n return property(map_(WeakKeyDictionary())(getter))" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Sets an array of filters as where conditions @param array $params Search parameters @return bool|array Array of results, or false
[ "public function search($filters = [])\n {\n // Set resolved\n $resolved = [];\n\n // Check the filters\n if (!isset($filters) || !is_array($filters)) {\n throw new \\InvalidArgumentException('Undefined search filters', 400);\n }\n\n // Set limit, offset and o...
[ "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 instruction about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software Development:" }
/* (non-Javadoc) @see javax.sip.SipListener#processTimeout(javax.sip.TimeoutEvent)
[ "public void processTimeout(TimeoutEvent timeoutEvent) {\n\t\t\t\t\n\t\tfinal SIPTransaction t;\n\t\tif (timeoutEvent.isServerTransaction()) {\n\t\t\tt = (SIPTransaction) timeoutEvent.getServerTransaction();\n\t\t}\n\t\telse {\n\t\t\tt = (SIPTransaction) timeoutEvent.getClientTransaction();\n\t\t}\n\t\t\n\t\tif (tr...
[ "public void initMediaConnection(SipServletRequest request) throws IOException {\n\t\tlog.info(\"initiating media connection\");\n\t\tsipServletResponse = request.createResponse(SipServletResponse.SC_OK);\n\t\tfireEvent(\n\t\t\t\tnull, \n\t\t\t\t(byte[])request.getContent(), \n\t\t\t\t\"org.mobicents.slee.service.i...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Returns set token. Generates a token when not set. @return string
[ "public function getToken(): string\n {\n if (empty($this->token)) {\n $this->setSize($this->token_size);\n $this->token = $this->generateRandomToken();\n }\n\n return $this->token;\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 description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
stype = always SCOOP port = comma separated ports sname = broker unique name location = routable location (ip or dns)
[ "def Advertise(port, stype=\"SCOOP\", sname=\"Broker\", advertisername=\"Broker\",\n location=\"\"):\n \n scoop.logger.info(\"Launching advertiser...\")\n service = minusconf.Service(stype, port, sname, location)\n advertiser = minusconf.ThreadAdvertiser([service], advertisername)\n adve...
[ "def list_nodes(self):\n \"\"\"\"\"\"\n self.add_environment_file(user='stack', filename='stackrc')\n ret, _ = self.run(\"ironic node-list --fields uuid|awk '/-.*-/ {print $2}'\", user='stack')\n # NOTE(Gonéri): the good new is, the order of the nodes is preserved and follow the one from...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Technology:" }
add the values to the bundle for saveInstanceState @param savedInstanceState @return
[ "public Bundle saveInstanceState(Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n savedInstanceState.putInt(BUNDLE_SELECTION_HEADER, mAccountHeaderBuilder.getCurrentSelection());\n }\n return savedInstanceState;\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 description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
{@inheritdoc} @param BaseBlock $object
[ "public function preUpdate($object)\n {\n $this->blockManager->get($object)->preUpdate($object);\n\n // fix weird bug with setter object not being call\n $object->setChildren($object->getChildren());\n\n if ($object->getPage() instanceof PageInterface) {\n $object->getPage(...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the Github comment about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
// NewParams creates new parameters based on the provided options
[ "func NewParams(opts []copts.Opt) *Params {\n\tparams := &Params{}\n\tcopts.Apply(params, opts)\n\treturn params\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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Handle the profile page submission
[ "public function handleProfile(array $request = [])\n {\n if (empty($request['update']) === false) {\n if (isset($request['name']) === true && $request['name'] === '') {\n unset($request['name']);\n }\n if (isset($request['email']) === true && $request['emai...
[ "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:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Returns the index where the given element would be inserted. @param {*} element @returns {Number}
[ "function sortedIndex(element) {\n /* jshint validthis:true */\n var index = binarySearch(toArray(this), element, this.comparator);\n\n if (index < 0) {\n // binarySearch decreases the negative index by one because otherwise the index 0 would stand for two results\n // @see https://github.com...
[ "function getPositionByKey(\n opts: Options,\n // The current value\n containerNode: Node,\n // Key of the node in desired position\n key: string\n): TablePosition {\n return TablePosition.create(opts, containerNode, key);\n}" ]
codesearchnet
{ "query": "Represent the Github instruction about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Create a form from the configuration @return \Zend\Form\ElementInterface
[ "private function getForm()\n {\n $coreConfig = $this->getServiceLocator()->get('MelisCoreConfig');\n $form = $coreConfig->getItem('melis_engine_setup/forms/melis_installer_platform_data');\n\n $factory = new \\Zend\\Form\\Factory();\n $formElements = $this->serviceLocator->get('FormE...
[ "protected function configureFormer()\n {\n // Use Bootstrap 3\n Config::set('former.framework', 'TwitterBootstrap3');\n\n // Reduce the horizontal form's label width\n Config::set('former.TwitterBootstrap3.labelWidths', []);\n\n // Change Former's required field HTML\n ...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
根据条件到gateway搜索数据 @param array $fields @param array $where @return array
[ "protected static function select($fields = array('session','uid','groups'), $where = array())\n {\n $t = microtime(true);\n $gateway_data = GatewayProtocol::$empty;\n $gateway_data['cmd'] = GatewayProtocol::CMD_SELECT;\n $gateway_data['ext_data'] = array('fields' => ...
[ "function hot(backendTplServer) {\n backendTplServer.app.get('/news/hot', function(request, response) {\n var data = Mock.mock({\n 'news|0-10': [news]\n });\n\n // 如果对象中有方法的定义, 最好不要放在 Mock.mock 中, 因为他会将方法定义变成直接的属性值(方法的返回值)\n data.__helper = __helper;\n\n response.ren...
codesearchnet
{ "query": "Represent the Github text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Invoke the handler with parameters. Can throw any exception the called handler can throw.
[ "public Schema handle(int version, Route route, Properties parms, String post_body) throws Exception {\n Class<? extends Schema> handler_schema_class = getHandlerMethodInputSchema(route._handler_method);\n Schema schema = Schema.newInstance(handler_schema_class);\n\n // If the schema has a real backing cla...
[ "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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Turns on WiFi Adapter<br> Requires READ_PHONE_STATE, ACCESS_NETWORK_STATE and CHANGE_WIFI_STATE permissions<br> @param context
[ "public void setWifiEnabled(Context context) {\n\t\tWifiManager wifiMan = (WifiManager) context\n\t\t\t\t.getSystemService(Context.WIFI_SERVICE);\n\t\twifiMan.setWifiEnabled(true);\n\t}" ]
[ "@Override\n protected void handlePermission(@NonNull File path) {\n// Should we show an explanation?\n// if (shouldShowRequestPermissionRationale(\n// Manifest.permission.WRITE_EXTERNAL_STORAGE)) {\n// Explain to the user why we need permission\n// }\n\n m...
codesearchnet
{ "query": "Represent the summarization:", "pos": "Represent the code:", "neg": "Represent the code:" }
Returns a map of attributes. @return a map of this node's attributes.
[ "public @Nonnull Map<String, String> attr() {\n synchronized (this) {\n if (attrMap.get() == null) {\n attrMap.set(\n Optional.ofNullable(node.getAttributes())\n .map(XQuery::attributesToMap)\n .map(Collections::unmodi...
[ "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 Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code:" }
Loads the plugins for the inputed dialog. :param plugins | [<XWizardPlugin>, ..]
[ "def setPlugins( self, plugins ):\n \n langs = {}\r\n icons = {}\r\n \r\n for plugin in plugins:\r\n wlang = plugin.wizardType()\r\n wgrp = plugin.wizardGroup()\r\n \r\n langs.setdefault(wlang, {})\r\n langs[wlang].setdefault...
[ "def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
// SuggestField specifies which field to use for suggestions.
[ "func (s *DeleteByQueryService) SuggestField(suggestField string) *DeleteByQueryService {\n\ts.suggestField = suggestField\n\treturn s\n}" ]
[ "function PbfSplicer(options) {\n // tag which will be auto-removed and auto-injected. Usually 'name'\n this.nameTag = options.nameTag;\n // tag that contains JSON initially, and which works as a prefix for multiple values\n this.multiTag = options.multiTag;\n\n // If options.namePicker is given, this class co...
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Sets the build variables (i.e. removes old ones, adds new ones) :param variables: the build variables to set
[ "def set(self, variables: Dict[str, str]):\n \n current_variables = self.get()\n difference = DictDiffer(variables, current_variables)\n\n removed_keys = difference.removed()\n self.remove(removed_keys)\n\n changed_keys = difference.added() | difference.changed()\n c...
[ "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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// SetCertificateChain sets the CertificateChain field's value.
[ "func (s *UploadServerCertificateInput) SetCertificateChain(v string) *UploadServerCertificateInput {\n\ts.CertificateChain = &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 Github post about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about programming:" }
Generate a list of column name-value pairs for an AR object
[ "def list_model_columns(obj)\n items = obj.class.columns.map{ |col| info_pair(col.name, obj[col.name]) }\n content_tag(:ul, convert_to_list_items(items), :class => \"model_columns\")\n end" ]
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Change type of color theme
[ "function changeColorTheme(configName, e) {\n if (e && e instanceof Event) {\n e.preventDefault();\n }\n\n var $book = gitbook.state.$book;\n\n // Remove currently applied color theme\n if (fontState.theme !== 0)\n $book.removeClass(\"color-theme-\" + fontState.theme);\n\n // Set new col...
[ "def transform_cb(self, setting, value):\n \"\"\"\"\"\"\n self.make_callback('transform')\n\n # whence=0 because need to calculate new extents for proper\n # cutout for rotation (TODO: always make extents consider\n # room for rotation)\n whence = 0\n self.redraw(wh...
codesearchnet
{ "query": "Represent the Github comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Gets the current value of an property. @param string $key The property key. @return mixed
[ "public function get($key)\n {\n if ($this->willRemove($key)) {\n return null;\n }\n if (true === $this->willChange($key)) {\n return $this->getCurrent($key);\n }\n return $this->getOriginal($key);\n }" ]
[ "def initialize(self, id=None, text=None):\n self.id = none_or(id, int)\n \n\n self.text = none_or(text, str)\n \"\"\"\n Username or IP address of the user at the time of the edit : str | None\n \"\"\"" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// oidcProvider lazily initializes, memoizes, and returns the OIDC provider.
[ "func (p *providerImpl) provider() (*gooidc.Provider, error) {\n\tif p.goOIDCProvider != nil {\n\t\treturn p.goOIDCProvider, nil\n\t}\n\tprov, err := p.newGoOIDCProvider()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.goOIDCProvider = prov\n\treturn p.goOIDCProvider, nil\n}" ]
[ "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n GetField fields = in.readFields();\n beginDefaultContext = fields.get(BEGIN_DEFAULT, true);\n\n // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadCo...
codesearchnet
{ "query": "Represent the Github post about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
Prints the contents of a Cursor to a PrintSteam. The position is restored after printing. @param cursor the cursor to print @param stream the stream to print to
[ "public static void dumpCursor(Cursor cursor, PrintStream stream) {\n stream.println(\">>>>> Dumping cursor \" + cursor);\n if (cursor != null) {\n int startPos = cursor.getPosition();\n\n cursor.moveToPosition(-1);\n while (cursor.moveToNext()) {\n dump...
[ "public static void reset(File directory, int processNumber) {\n try (DefaultProcessCommands processCommands = new DefaultProcessCommands(directory, processNumber, true)) {\n // nothing else to do than open file and reset the space of specified process\n }\n }" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
:param **kwargs: any kwargs accepted by dateutil.parse function.
[ "def parse(self, date, **kwargs):\n '''\n \n '''\n qualifiers = []\n if dateutil_parser is None:\n return None\n date = orig_date = date.strip()\n\n # various normalizations\n # TODO: call .lower() first\n date = date.replace('B.C.E.', 'BC')\...
[ "def coerce_one(schema=str):\n \n def validate(val):\n \"\"\"Unpack a single item from the inputs sequence and run validation.\n\n NOTE(larsbutler): This code is highly opinionated for bottle, since\n bottle query params are wrapped in a list, even if there is just a\n single value...
codesearchnet
{ "query": "Represent the summarization about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Add a CSS asset to the beginning of the queue. It checks for duplicates. You may prepend more than one asset passing an array as argument. @param mixed $asset @return Manager
[ "public function prependCss($asset)\n\t{\n\t\tif(is_array($asset))\n\t\t{\n\t\t\tforeach(array_reverse($asset) as $a)\n\t\t\t\t$this->prependCss($a);\n\n\t\t\treturn $this;\n\t\t}\n\n\t\tif( ! $this->isRemoteLink($asset))\n\t\t\t$asset = $this->buildLocalLink($asset, $this->css_dir);\n\n\t\tif( ! in_array($asset, $...
[ "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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Initialize from ASN.1. @param Sequence $seq @return self
[ "public static function fromASN1(Sequence $seq): Extension\n {\n $extnID = $seq->at(0)\n ->asObjectIdentifier()\n ->oid();\n $critical = false;\n $idx = 1;\n if ($seq->has($idx, Element::TYPE_BOOLEAN)) {\n $critical = $seq->at($idx++)\n ...
[ "def :\n \"\"\"\"\"\"\n CheckParent(self)\n\n return _fitz.Annot_" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// Commit saves the completed build as an image with the provided tag. It will // stop the container, commit the image, and then remove the container.
[ "func (e *ClientExecutor) Commit(b *imagebuilder.Builder) error {\n\tconfig := b.Config()\n\n\tif e.Container.State.Running {\n\t\tglog.V(4).Infof(\"Stopping container %s ...\", e.Container.ID)\n\t\tif err := e.Client.StopContainer(e.Container.ID, 0); err != nil {\n\t\t\treturn fmt.Errorf(\"unable to stop build con...
[ "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 comment about Container management:", "pos": "Represent the code about Container management:", "neg": "Represent the code about Software development:" }
Sets the appropriate flags to enable virtual terminal sequences in a Windows command prompt. Reference: https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
[ "def enable_windows_virtual_terminal_sequences():\n \n\n try:\n from ctypes import windll, byref\n from ctypes.wintypes import DWORD, HANDLE\n\n kernel32 = windll.kernel32\n virtual_terminal_flag = 0x04 # ENABLE_VIRTUAL_TERMINAL_PROCESSING\n\n # Obtain our stdout/stderr han...
[ "def session_preparation(self):\n \"\"\"\"\"\"\n self.ansi_escape_codes = True\n self._test_channel_read()\n self.set_base_prompt()\n self.disable_paging()\n self.set_terminal_width(command=\"terminal width 511\")\n # Clear the read buffer\n time.sleep(0.3 * s...
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Technology:" }
/* (non-Javadoc) @see org.kaazing.gateway.client.transport.http.HttpRequestDelegate#abort()
[ "public void processAbort() {\n LOG.entering(CLASS_NAME, \"abort\");\n if (reader != null) {\n reader.stop();\n reader = null;\n }\n }" ]
[ "private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(pl.setblack.airomem.direct.banksample.rest.BankResource.class);\n }" ]
codesearchnet
{ "query": "Represent the Github summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Create valid MongoId (ObjectID now) object based on string or id provided from client side. @param mixed $mongoID String or MongoId object. @return ObjectID|null
[ "public static function mongoID($mongoID)\n {\n if (empty($mongoID)) {\n return null;\n }\n\n if (!is_object($mongoID)) {\n //Old versions of mongo api does not throws exception on invalid mongo id (1.2.1)\n if (!is_string($mongoID) || !preg_match('/[0-9a-f]{...
[ "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 Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Adds a reference of Neighbour to this Bus group @param neighbour The neighbour to be added to the group
[ "void addNeighbour(Neighbour neighbour)\n {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(tc, \"addNeighbour\", neighbour);\n\n final Neighbour[] tmp = new Neighbour[iNeighbours.length + 1];\n System.arraycopy(iNeighbours, 0, tmp, 0, iNeighbours.length);\n tmp[iN...
[ "@Override\n public <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator) {\n checkNotNull(operator, \"operator cannot be null\");\n\n // By default, NoneStreamGrouping stategy is used. In this stategy, tuples are forwarded\n // from parent component to a ramdon one of all the instances of the...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code about Programming:" }
Dispatch the next available middleware and return the response. @param Request $request @return Response
[ "public function next(Request $request)\n {\n $response = $this->middleware->process($request, $this->nextDelegate);\n\n // Negotiate PSR7 responses\n if ($response instanceof ResponseInterface) {\n return $this->foundationFactory->createResponse($response);\n }\n\n ...
[ "private function processAuthenticate(Session $session, AuthenticateMessage $msg)\n {\n $session->abort(new \\stdClass(), 'thruway.error.internal');\n Logger::error($this, 'Authenticate sent to realm without auth manager.');\n }" ]
codesearchnet
{ "query": "Represent the sentence about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Programming:" }
Returns {@code [--name=filePath]} or {@code []} if file=null.
[ "public static List<String> get(String name, @Nullable Path file) {\n if (file != null) {\n if (!file.toString().isEmpty()) {\n return Arrays.asList(\"--\" + name + \"=\" + file.toString());\n }\n }\n return Collections.emptyList();\n }" ]
[ "def setTargets(self, targets):\n \n if not self.verifyArguments(targets) and not self.patterned:\n raise NetworkError('setTargets() requires [[...],[...],...] or [{\"layerName\": [...]}, ...].', targets)\n self.targets = targets" ]
codesearchnet
{ "query": "Represent the instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Determine if the given user can delete the given resume. @param UserPolicy $user @param Resume $resume @return bool
[ "public function destroy(UserPolicy $user, Resume $resume)\n {\n return $resume->user_id == user_id() && $resume->user_type == user_type();\n }" ]
[ "@RequestMapping(value = \"/api/profile/{profileIdentifier}\", method = RequestMethod.DELETE)\n public\n @ResponseBody\n HashMap<String, Object> removeFromList(Model model, @PathVariable String profileIdentifier) throws Exception {\n Integer profileId = ControllerUtils.convertProfileIdentifier(profi...
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about Software development:" }
Print a list with available commands.
[ "async def commands(self):\n \"\"\"\"\"\"\n _print_commands('Remote control', interface.RemoteControl)\n _print_commands('Metadata', interface.Metadata)\n _print_commands('Playing', interface.Playing)\n _print_commands('AirPlay', interface.AirPlay)\n _print_commands('Device...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the description about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code:" }
build the grpc channel used for both publisher and subscriber :return: None
[ "def _init_channel(self):\n \n host = self._get_host()\n port = self._get_grpc_port()\n\n if 'TLS_PEM_FILE' in os.environ:\n with open(os.environ['TLS_PEM_FILE'], mode='rb') as f: # b is important -> binary\n file_content = f.read()\n credentials = g...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Default signal handler @param int $signal
[ "protected function signalHandlerDefault($signal)\n {\n switch ($signal) {\n case SIGTERM:\n case SIGINT:\n // Check children\n while ($this->children) {\n foreach ($this->children as $child) {\n $ok = $child->ki...
[ "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 comment:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
// SetKmsKeyId sets the KmsKeyId field's value.
[ "func (s *CreateDBInstanceReadReplicaInput) SetKmsKeyId(v string) *CreateDBInstanceReadReplicaInput {\n\ts.KmsKeyId = &v\n\treturn s\n}" ]
[ "function(apiClient) {\n this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;\n\n\n this.setApiClient = function(apiClient) {\n this.apiClient = apiClient;\n };\n\n this.getApiClient = function() {\n return this.apiClient;\n };\n\n\n /**\n ...
codesearchnet
{ "query": "Represent the Github comment about Programming:", "pos": "Represent the Github code about Programming:", "neg": "Represent the Github code about Software development:" }
Loads an {@link Inputs} object from am XML file. @param file @return @throws JAXBException
[ "public static Inputs load(InputStream in) throws JAXBException {\n JAXBContext context = JAXBContext.newInstance(Inputs.class, RF2Input.class, OWLInput.class);\n Unmarshaller u = context.createUnmarshaller();\n Inputs inputs = (Inputs) u.unmarshal(in);\n return inputs;\n }" ]
[ "public ExportSection loadExportSection() throws IOException {\n Optional<ExportSection> edata = maybeLoadExportSection();\n return (ExportSection) getOrThrow(edata,\n \"unable to load export section\");\n }" ]
codesearchnet
{ "query": "Represent the comment about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code about programming:" }
/* Optional quartz configuration - by default same data source is used for transactional Quartz work and new one (from properties quartz.datasource) for unmanaged access
[ "@Bean\n @ConditionalOnMissingBean(name = \"quartzDataSource\")\n @ConditionalOnProperty(name = {\"jbpm.quartz.enabled\", \"jbpm.quartz.db\"}, havingValue=\"true\")\n public DataSource quartzDataSource(DataSource dataSource) {\n return dataSource;\n }" ]
[ "@Scheduled(initialDelayString = PROP_SCHEDULER_DELAY_PLACEHOLDER, fixedDelayString = PROP_SCHEDULER_DELAY_PLACEHOLDER)\n public void autoAssignScheduler() {\n LOGGER.debug(\"auto assign schedule checker has been triggered.\");\n // run this code in system code privileged to have the necessary\n ...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code:" }
Unpacks an specified exception and returns its cause. Otherwise the given {@link Throwable} is returned. @param throwableToStrip to strip @param typeToStrip type to strip @return Unpacked cause or given Throwable if not packed
[ "public static Throwable stripException(Throwable throwableToStrip, Class<? extends Throwable> typeToStrip) {\n\t\twhile (typeToStrip.isAssignableFrom(throwableToStrip.getClass()) && throwableToStrip.getCause() != null) {\n\t\t\tthrowableToStrip = throwableToStrip.getCause();\n\t\t}\n\n\t\treturn throwableToStrip;\...
[ "public static void check(final Object result, final Class<?> targetType) {\n if (result != null && !targetType.isAssignableFrom(result.getClass())) {\n // note: conversion logic may go wrong (e.g. because converter expect collection input mostly and may\n // not work correctly for sing...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about programming:" }
Sets the window padding to top, right, bottom, and right sides. This is useful in cases where the window has areas that the drop-down menu should not cover - for instance a fixed header. @param top @param right @param bottom @param left
[ "public void setWindowPaddingTopRightBottomLeft(final int top, final int right,\n final int bottom, final int left) {\n JsArrayNumber array = JavaScriptObject.createArray(4).cast();\n array.push(top);\n array.push(right);\n array.push(bottom);\n array.push(left);\n ...
[ "function get_margin_width()\n {\n //ignore image width, use same width as on predefined bullet ListBullet\n //for proper alignment of bullet image and text. Allow image to not fitting on left border.\n //This controls the extra indentation of text to make room for the bullet image.\n ...
codesearchnet
{ "query": "Represent the Github text:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Determine if an attribute exists on the model. @param string $key @return bool
[ "public function __isset($key)\n {\n return (isset($this->attributes[$key]) && null !== $this->getAttributeValue($key));\n }" ]
[ "public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)\n {\n // @todo: Is it possible to store a default value in the DB?\n $fieldDef->defaultValue = new FieldValue();\n $fieldDef->defaultValue->data = array('text' => null);\n }" ]
codesearchnet
{ "query": "Represent the sentence about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
// Disk ディスクビルダーの作成
[ "func Disk(client APIClient, name string) *DiskBuilder {\n\treturn &DiskBuilder{\n\t\tbaseBuilder: &baseBuilder{\n\t\t\tclient: client,\n\t\t},\n\t\tbuildEventHandlers: map[DiskBuildEvents]DiskBuildEventHandler{},\n\t\tname: name,\n\t\tsize: DefaultDiskSize,\n\t\tplanID: Defa...
[ "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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
/* (non-Javadoc) @see org.biojava.nbio.core.sequence.io.ProteinSequenceCreator#getSequence(java.lang.String, long)
[ "@Override\n\tpublic AbstractSequence<AminoAcidCompound> getSequence(String sequence,\n\t\t\tlong index) throws CompoundNotFoundException {\n\t\tAbstractSequence<AminoAcidCompound> seq = super.getSequence(sequence.toUpperCase(Locale.ENGLISH), index);\n\t\tseq.setUserCollection(getStringCase(sequence));\n\t\treturn ...
[ "public static void main(String[] args) throws IOException, StructureException {\n\t\tStructure structure = MmtfActions.readFromWeb(\"4cup\");\n\t\tSystem.out.println(structure.getChains().size());\n\t}" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Try and find the phpunit XML config file. @param $buildPath @return null|string
[ "public static function findConfigFile($buildPath)\n {\n if (file_exists($buildPath . 'phpunit.xml')) {\n return 'phpunit.xml';\n }\n\n if (file_exists($buildPath . 'tests' . DIRECTORY_SEPARATOR . 'phpunit.xml')) {\n return 'tests' . DIRECTORY_SEPARATOR . 'phpunit.xml';...
[ "private function cmdGenerate()\n {\n //check if path exists\n if (!is_dir($this->configKeyPath)) {\n Main::copyDirectoryContents(dirname(__DIR__).'/Config/Devbr/Key', $this->configKeyPath);\n }\n //Now, OPEN_SSL\n $this->createKeys();\n return \"\\n Can, Ope...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// Run the http server. Listening on os.GetEnv("PORT") or 3000 by default.
[ "func (m *Martini) Run() {\n\tport := os.Getenv(\"PORT\")\n\tif len(port) == 0 {\n\t\tport = \"3000\"\n\t}\n\n\thost := os.Getenv(\"HOST\")\n\n\tm.RunOnAddr(host + \":\" + port)\n}" ]
[ "func (o *CombinedInsecureServingOptions) AddFlags(fs *pflag.FlagSet) {\n\tif o == nil {\n\t\treturn\n\t}\n\n\tfs.StringVar(&o.BindAddress, \"address\", o.BindAddress, \"DEPRECATED: the IP address on which to listen for the --port port (set to 0.0.0.0 for all IPv4 interfaces and :: for all IPv6 interfaces). See --b...
codesearchnet
{ "query": "Represent the sentence about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about programming:" }
remove a file from the worker
[ "def runRmFile(self, path, timeout=None, **kwargs):\n \n cmd_args = {'path': path, 'logEnviron': self.logEnviron}\n if timeout:\n cmd_args['timeout'] = timeout\n if self.workerVersionIsOlderThan('rmfile', '3.1'):\n cmd_args['dir'] = os.path.abspath(path)\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 sentence:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
// ProxyWithConfig returns a Proxy middleware with config. // See: `Proxy()`
[ "func ProxyWithConfig(config ProxyConfig) echo.MiddlewareFuncd {\n\t// Defaults\n\tif config.Skipper == nil {\n\t\tconfig.Skipper = DefaultProxyConfig.Skipper\n\t}\n\tif config.Handler == nil {\n\t\tconfig.Handler = DefaultProxyConfig.Handler\n\t}\n\tif config.Balancer == nil {\n\t\tpanic(\"echo: proxy middleware r...
[ "func WithNamespace(ctx context.Context, namespace string) context.Context {\n\tctx = context.WithValue(ctx, namespaceKey{}, namespace) // set our key for namespace\n\n\t// also store on the grpc headers so it gets picked up by any clients that\n\t// are using this.\n\treturn withGRPCNamespaceHeader(ctx, namespace)...
codesearchnet
{ "query": "Represent the summarization about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about consul address:" }