query
stringlengths
16
255
pos
list
neg
list
task
stringclasses
1 value
instruction
dict
Build an XML string that contains a square for each city
[ "def getCitiesDrawingXML(points):\n ''' '''\n xml = \"\"\n for p in points:\n x = str(p.x)\n z = str(p.y)\n xml += '<DrawBlock x=\"' + x + '\" y=\"7\" z=\"' + z + '\" type=\"beacon\"/>'\n xml += '<DrawItem x=\"' + x + '\" y=\"10\" z=\"' + z + '\" type=\"ender_pearl\"/>'\n ret...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the post:", "pos": "Represent the code:", "neg": "Represent the code:" }
Redefines singleton_method_added and method_added methods so they are monitored If new method is added we will apply to it appropriate advices
[ "def add_method_hooks\n eigen_class = @target.singleton_class\n\n if @options[:class_methods]\n return unless @target.is_a?(Module)\n\n orig_singleton_method_added = @target.method(:singleton_method_added)\n\n eigen_class.send :define_method, :singleton_method_added do |method|\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 description:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
Return a format string that will produce a reasonable standard way for formatting time (but still using the current locale) @return The format string
[ "private static DateFormat getDateFormat() {\n String pattern;\n int patternLength;\n int endOfSecsIndex;\n // Retrieve a standard Java DateFormat object with desired format.\n DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);\n if ...
[ "def GetDictToFormat(self):\n \"\"\"\"\"\"\n d = {}\n for k, v in self.__dict__.items():\n # TODO: Better handling of unicode/utf-8 within Schedule objects.\n # Concatinating a unicode and utf-8 str object causes an exception such\n # as \"UnicodeDecodeError: 'ascii' codec can't decode byte ...
codesearchnet
{ "query": "Represent the comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Set any coupons associated with this transaction event @param coupon {@link String } with any coupon value @return This object for chaining builder methods
[ "public BranchEvent setCoupon(String coupon) {\n return addStandardProperty(Defines.Jsonkey.Coupon.getKey(), coupon);\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 Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
:class:`Asset`: The same operation as :meth:`Guild.splash_url_as`.
[ "def splash_url_as(self, *, format='webp', size=2048):\n \"\"\"\"\"\"\n return Asset._from_guild_image(self._state, self.id, self.splash, 'splashes', format=format, size=size)" ]
[ "def unused(self):\n \n self._params.update(\n href=self._resource.get('search_unused'))\n return self" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Write the error information to the screen and exit. @param string[] $errors @return void
[ "protected function writeErrorAndDie(array $errors)\n {\n $output = (new ConsoleOutput)->getErrorOutput();\n\n foreach ($errors as $error) {\n $output->writeln($error);\n }\n\n die(1);\n }" ]
[ "def _print_help(self):\n \"\"\"\"\"\"\n msg = \"\"\"Commands (type help <command> for details)\n\nCLI: help history exit quit\nSession, General: set load save reset\nSession, Access Control: allowaccess denyaccess clearaccess\nSession, Replication: allowrep denyrep prefe...
codesearchnet
{ "query": "Represent the Github summarization about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
big 1d model for conditional image generation.
[ "def imagetransformer_b10l_4h_big_uncond_dr01_tpu():\n \"\"\"\"\"\"\n hparams = imagetransformer_b12l_4h_big_uncond_dr03_tpu()\n # num_hidden_layers\n hparams.num_decoder_layers = 10\n hparams.num_heads = 4\n hparams.hidden_size = 1024\n hparams.filter_size = 4096\n hparams.batch_size = 1\n hparams.layer_p...
[ "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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Marshall the given parameter object.
[ "public void marshall(DescribeVaultOutput describeVaultOutput, ProtocolMarshaller protocolMarshaller) {\n\n if (describeVaultOutput == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(describe...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
{@inheritDoc} @see org.audit4j.core.ConfigProvider#readConfig(java.io.InputStream)
[ "@SuppressWarnings(\"unchecked\")\n @Override\n public T readConfig(InputStream fileAsStream) throws ConfigurationException {\n XStream xstream = new XStream(new StaxDriver());\n xstream.alias(\"configuration\", clazz);\n return (T) xstream.fromXML(fileAsStream);\n }" ]
[ "@Override\n public void serialize(List<org.audit4j.core.dto.Field> auditFields, Object object,\n String objectName, DeIdentify deidentify) {\n visited.clear();\n String text = toString(object, deidentify);\n auditFields.add(new org.audit4j.core.dto.Field(objectName, text, object....
codesearchnet
{ "query": "Represent the description about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
Logs your user out
[ "def logout(self):\n \"\"\"\"\"\"\n\n if not self.logged_in:\n raise RuntimeError(\"User is not logged in\")\n if self.conn.connected:\n params = {\"room\": self.conn.room.room_id}\n resp = self.conn.make_api_call(\"logout\", params)\n if not resp.get...
[ "protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this...
codesearchnet
{ "query": "Represent the description:", "pos": "Represent the code:", "neg": "Represent the code about Data synchronization:" }
Gets the bank list resulting from a search. return: (osid.assessment.BankList) - the bank list raise: IllegalState - the bank list has already been retrieved *compliance: mandatory -- This method must be implemented.*
[ "def get_banks(self):\n \n if self.retrieved:\n raise errors.IllegalState('List has already been retrieved.')\n self.retrieved = True\n return objects.BankList(self._results, runtime=self._runtime)" ]
[ "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 post about Agent Identity Management:", "pos": "Represent the code about Agent Identity Management:", "neg": "Represent the code about Software development:" }
// OnUpdateExpiration will re-set the database's session's entry ttl. // https://redis.io/commands/expire#refreshing-expires
[ "func (db *Database) OnUpdateExpiration(sid string, newExpires time.Duration) error {\n\treturn db.redis.UpdateTTLMany(sid, int64(newExpires.Seconds()))\n}" ]
[ "def set_pttl(self, key, ttl):\n \n return self._client.pexpire(self.get_key(key), ttl)" ]
codesearchnet
{ "query": "Represent the Github instruction:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Converts a string to upper camel case. @param string $string The string to be converted. @return string An upper camel case string.
[ "public function toUpperCamelCase($string)\n {\n $string = str_replace(array('-', '_'), ' ', $string);\n $string = ucwords(strtolower($string));\n $string = str_replace(' ', '', $string);\n\n return $string;\n }" ]
[ "function Match(self, shift) {\n var start = self.__index__,\n end = self.__last_index__,\n text = self.__text_cache__.slice(start, end);\n\n /**\n * Match#schema -> String\n *\n * Prefix (protocol) for matched string.\n **/\n this.schema = self.__schema__.toLowerCase();\n /**\n * Matc...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
Get property in MB_Configuration instance. @param string $key The name of property to get. @param boolean $notifyWarnings Flag to enable / disable warning and traceback if property not found.
[ "public function getProperty($key, $notifyWarnings = true)\n {\n if (!(isset($this->configSettings[$key])) && $notifyWarnings) {\n echo 'MB_Configuration->getProperty() - Warning: \"' . $key . '\" not defined.', PHP_EOL;\n $callers = debug_backtrace();\n echo '- Called from: ' . $callers[1]['func...
[ "protected function getSingleFieldValue($value, FieldDefinition $fieldDefinition, $contentTypeIdentifier, array $context = array())\n {\n // booleans were handled here. They are now handled as complextypes\n\n // q: do we really want this to happen by default on all scalar field values?\n //...
codesearchnet
{ "query": "Represent the comment about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
Set the iterator to its previous value @throws PHPExcel_Exception
[ "public function prev()\n {\n if ($this->position <= $this->startColumn) {\n throw new PHPExcel_Exception(\n \"Column is already at the beginning of range (\" .\n PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . \" - \" .\n PHPExcel_Cell::str...
[ "func (s *StringCodeGenerator) Init() {\n\ts.Position = vm.Position{State: vm.NewState()}\n\ts.Lines = []string{\"(Exported by gocnc)\", \"G21G90\\n\"}\n}" ]
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// New returns a new http *Client using the default net/http client.
[ "func New(credentials *auth.Credentials, apiVersion string, logger *log.Logger) *Client {\n\treturn &Client{*http.DefaultClient, MaxSendAttempts, credentials, apiVersion, logger, false}\n}" ]
[ "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 instruction about Computer Science:", "pos": "Represent the code about Computer Science:", "neg": "Represent the code about consul address:" }
Returns a new list with all the elements in order @return a list
[ "public List<ElementType> toList() {\n List<ElementType> result = new ArrayList<ElementType>(size());\n for (ElementType e : this) result.add(e);\n return result;\n }" ]
[ "def getValue(words):\n \"\"\"\"\"\"\n value = 0\n for word in words:\n for letter in word:\n # shared.getConst will evaluate to the dictionary broadcasted by\n # the root Future\n value += shared.getConst('lettersValue')[letter]\n return value" ]
codesearchnet
{ "query": "Represent the text about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Natural Language Processing:" }
// MockCreateChain used for creating a ledger for a chain for tests // without having to join
[ "func MockCreateChain(cid string) error {\n\tvar ledger ledger.PeerLedger\n\tvar err error\n\n\tif ledger = GetLedger(cid); ledger == nil {\n\t\tgb, _ := configtxtest.MakeGenesisBlock(cid)\n\t\tif ledger, err = ledgermgmt.CreateLedger(gb); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tchains.Lock()\n\tdefer chain...
[ "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:" }
Reads in a file as a byte[]
[ "public static byte[] readBytesFromFile(File f) {\r\n byte[] bytes = null;\r\n try {\r\n int filesize = (int) f.length();\r\n bytes = new byte[filesize];\r\n DataInputStream in = new DataInputStream(new FileInputStream(f));\r\n in.readFully(bytes);\r\n ...
[ "def _get_generic_schema(self):\n \n schema = Schema(\n vid=ID(stored=True, unique=True), # Object id\n title=NGRAMWORDS(),\n keywords=KEYWORD, # Lists of coverage identifiers, ISO time values and GVIDs, source names, source abbrev\n doc=TEXT) # Generated...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Get the screen height. @param context @return the screen height
[ "@SuppressWarnings(\"deprecation\")\n @SuppressLint(\"NewApi\")\n public static int getScreenHeight(Activity context) {\n\n Display display = context.getWindowManager().getDefaultDisplay();\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n Point size = new Point();...
[ "def isKeyboardShown(self):\n '''\n \n '''\n\n self.__checkTransport()\n dim = self.shell('dumpsys input_method')\n if dim:\n # FIXME: API >= 15 ?\n return \"mInputShown=true\" in dim\n return False" ]
codesearchnet
{ "query": "Represent the Github sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
@param IOInterface $io @param string $message @return void
[ "private static function write(IOInterface $io, string $message)\n {\n $msg = [\n '[Panthor]: ' . $message,\n ];\n\n $io->write($msg);\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 Github instruction about PHP programming:", "pos": "Represent the Github code about PHP programming:", "neg": "Represent the Github code about programming:" }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageChangeTrigger.
[ "func (in *ImageChangeTrigger) DeepCopy() *ImageChangeTrigger {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ImageChangeTrigger)\n\tin.DeepCopyInto(out)\n\treturn out\n}" ]
[ "func (resource *Flag) MarshalJSON() ([]byte, error) {\n\tresource.ResourceType = \"Flag\"\n\t// Dereferencing the pointer to avoid infinite recursion.\n\t// Passing in plain old x (a pointer to Flag), would cause this same\n\t// MarshallJSON function to be called again\n\treturn json.Marshal(*resource)\n}" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Renders a tree node. @param string|array $node the node to render. @return string the rendering result. @throws InvalidConfigException
[ "protected function renderNode($node)\n {\n if (is_string($node)) {\n $node = ['name' => $node];\n }\n if (!isset($node['name'])) {\n throw new InvalidConfigException(\"The 'name' option is required.\");\n }\n\n $lines = [];\n\n $nodeOptions = array...
[ "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 post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Software Development:" }
// Update takes the representation of a aPIService and updates it. Returns the server's representation of the aPIService, and an error, if there is any.
[ "func (c *FakeAPIServices) Update(aPIService *v1beta1.APIService) (result *v1beta1.APIService, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewRootUpdateAction(apiservicesResource, aPIService), &v1beta1.APIService{})\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1beta1.APIService), err\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 text about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software development:" }
Fetches a list of current user's photosets (albums) on flickr. @return array (int)id => (string)title
[ "private function get_sets() {\n\n if (empty($this->raw_sets)) {\n $this->raw_sets = $this->flickr->call('photosets.getList');\n }\n\n if ($this->raw_sets === false) {\n // Authentication failed, drop the locally stored token to force re-authentication.\n $this-...
[ "def fetch(self, card_id, data={}, **kwargs):\n \"\n return super(Card, self).fetch(card_id, data, **kwargs)" ]
codesearchnet
{ "query": "Represent the Github post about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
assumes byGroup() creates new collections that can be safely mutated
[ "function findSetIndex(ele) {\n for (var i = 0; i < forest.length; i++) {\n var eles = forest[i];\n\n if (eles.has(ele)) {\n return i;\n }\n }\n }" ]
[ "private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
Auto Generated Code
[ "def get_system_uptime_output_show_system_uptime_days(self, **kwargs):\n \n config = ET.Element(\"config\")\n get_system_uptime = ET.Element(\"get_system_uptime\")\n config = get_system_uptime\n output = ET.SubElement(get_system_uptime, \"output\")\n show_system_uptime = ET...
[ "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 summarization about Natural Language Processing:", "pos": "Represent the Github code about Natural Language Processing:", "neg": "Represent the Github code about File management:" }
// AllManifests returns all non-list manifests, the list manifest (if any), the digest the from refers to, or an error.
[ "func AllManifests(ctx context.Context, from imagereference.DockerImageReference, repo distribution.Repository) (map[digest.Digest]distribution.Manifest, *manifestlist.DeserializedManifestList, digest.Digest, error) {\n\tvar srcDigest digest.Digest\n\tif len(from.Tag) > 0 {\n\t\tdesc, err := repo.Tags(ctx).Get(ctx,...
[ "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 summarization about software development:", "pos": "Represent the Github code about software development:", "neg": "Represent the Github code about Software development:" }
Returns the cached version if exists; does not update the entity from the database in that case
[ "protected CaseDefinitionEntity loadCaseDefinition(String caseDefinitionId) {\n ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();\n DeploymentCache deploymentCache = configuration.getDeploymentCache();\n\n CaseDefinitionEntity caseDefinition = deploymentCache.findCaseD...
[ "static function removeExpiryCacheFromDisk( $expiryCachePath )\n {\n $fileHandler = eZClusterFileHandler::instance();\n if ( $fileHandler instanceof eZFSFileHandler )\n {\n // We will only delete files if the FS file handler is used,\n // if the DB file handler is in us...
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Software development:" }
// popcnt is the number of bits set to 1 in x. // It's the same as math/bits.OnesCount64, copied here so that we can build // on versions of go that don't have math/bits.
[ "func popcnt(x uint64) int {\n\tconst m0 = 0x5555555555555555 // 01010101 ...\n\tconst m1 = 0x3333333333333333 // 00110011 ...\n\tconst m2 = 0x0f0f0f0f0f0f0f0f // 00001111 ...\n\tconst m = 1<<64 - 1\n\tx = x>>1&(m0&m) + x&(m0&m)\n\tx = x>>2&(m1&m) + x&(m1&m)\n\tx = (x>>4 + x) & (m2 & m)\n\tx += x >> 8\n\tx += x >> ...
[ "public void fastClear(int index) {\n assert index >= 0 && index < numBits;\n int wordNum = index >> 6;\n int bit = index & 0x03f;\n long bitmask = 1L << bit;\n bits[wordNum] &= ~bitmask;\n // hmmm, it takes one more instruction to clear than it does to set... any\n ...
codesearchnet
{ "query": "Represent the instruction about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
Remove all traces
[ "function tidy(input, callback) {\n if (input.data(_iCheck)) {\n\n // Remove everything except input\n input.parent().html(input.attr('style', input.data(_iCheck).s || ''));\n\n // Callback\n if (callback) {\n input[_callback](callback);\n };\n\n // Unbind events\n input...
[ "protected function addSynchronizationInformation()\n {\n $this->html->pInfo($this->_(\n 'Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes.'\n ));\n $this...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about Data synchronization:" }
Disables all cache levels.
[ "public static function disableAll()\n {\n $app = Application::getFacadeApplication();\n $app->make('cache/request')->disable();\n $app->make('cache/expensive')->disable();\n $app->make('cache')->disable();\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 post about Technology:", "pos": "Represent the code about Technology:", "neg": "Represent the code about programming:" }
Make a series GitHub calls and aggregate the data into the `user` object defined below.
[ "function queryUserInfo(parentSpan, username, callback) {\n // Aggregated user information across multiple API calls\n var user = {\n login : null,\n type : null,\n repoNames : [],\n recentEvents : 0,\n eventCounts : {},\n };\n\n // Call the callback...
[ "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 about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// SetVersionId sets the VersionId field's value.
[ "func (s *ResourceMetadata) SetVersionId(v string) *ResourceMetadata {\n\ts.VersionId = &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 sentence about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// SetDomainName sets the DomainName field's value.
[ "func (s *JoinDomainInput) SetDomainName(v string) *JoinDomainInput {\n\ts.DomainName = &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 summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
Makes a ``PUT`` request with the content in the body. :raise: An :exc:`requests.RequestException` if it is not 2xx.
[ "def put_content(self, content):\n \n\n r = requests.request(self.method if self.method else 'PUT', self.url, data=content, **self.storage_args)\n if self.raise_for_status: r.raise_for_status()" ]
[ "def _send(data):\n \n url = data.get('url', CLOWDER_API_URL)\n\n _validate_data(data)\n\n if api_key is not None:\n data['api_key'] = api_key\n\n if 'value' not in data:\n data['value'] = data.get('status', 1)\n\n if 'frequency' in data:\n data['frequency'] = _clean_frequency...
codesearchnet
{ "query": "Represent the instruction about Web development:", "pos": "Represent the code about Web development:", "neg": "Represent the code about Software Development:" }
// GetDestinations provides a mock function with given fields: svc
[ "func (_m *Balancer) GetDestinations(svc *types.Service) ([]types.Destination, error) {\n\tret := _m.Called(svc)\n\n\tvar r0 []types.Destination\n\tif rf, ok := ret.Get(0).(func(*types.Service) []types.Destination); ok {\n\t\tr0 = rf(svc)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).([]types.Desti...
[ "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 about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
// ID returns the ID of the packfile, which is the checksum at the end of it.
[ "func (p *Packfile) ID() (plumbing.Hash, error) {\n\tprev, err := p.file.Seek(-20, io.SeekEnd)\n\tif err != nil {\n\t\treturn plumbing.ZeroHash, err\n\t}\n\n\tvar hash plumbing.Hash\n\tif _, err := io.ReadFull(p.file, hash[:]); err != nil {\n\t\treturn plumbing.ZeroHash, err\n\t}\n\n\tif _, err := p.file.Seek(prev,...
[ "def template(self):\n \n\n # First try props\n if self.props.template:\n return self.props.template\n else:\n # Return the wtype of the widget, and we'll presume that,\n # like resources, there's a .html file in that directory\n return self.wt...
codesearchnet
{ "query": "Represent the Github sentence about File management:", "pos": "Represent the Github code about File management:", "neg": "Represent the Github code:" }
Extracts qualifier namespace part from given qualifier string. @param qualifierAsString qualifier string. @return qualifier namespace.
[ "public static String getQualifierNamespace(String qualifierAsString) {\n int pos = qualifierAsString.indexOf(DELIMITER, 1);\n if (pos == -1) {\n throw new IllegalArgumentException(\"Wrong qualifier format: '\" + qualifierAsString + \"'\");\n }\n return qualifierAsString.substring(1, pos);\n }" ]
[ "public void addClass(ClassDescriptorDef classDef)\r\n {\r\n classDef.setOwner(this);\r\n // Regardless of the format of the class name, we're using the fully qualified format\r\n // This is safe because of the package & class naming constraints of the Java language\r\n _classDefs.put...
codesearchnet
{ "query": "Represent the Github description about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about programming:" }
获取某个参数(参数或者数据模型的属性)的 mock 值 @param {Object} param - 参数 @param {Array} traversePath - 遍历路径
[ "function (param, traversePath) {\n if (param.isArray) {\n // 参数是数组类别\n return this._getArrayMockByArrEleType({\n defaultValue: param.defaultValue,\n genExpression: param.genExpression,\n type: param.type\n }, 3, traversePath);\n } else {\n var dataty...
[ "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 instruction about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code:" }
Updates a submitted value. @param row @param col @param value
[ "public void setSubmittedValue(final FacesContext context, final String rowKey, final int col, final String value) {\n submittedValues.put(new SheetRowColIndex(rowKey, col), value);\n }" ]
[ "def get_pointer_mapping(self):\n \"\"\"\"\"\"\n r = request.GetPointerMapping(display = self.display)\n return r.map" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// Run executes the Bee's event loop.
[ "func (mod *MumbleBee) Run(eventChan chan bees.Event) {\n\tif len(mod.server) == 0 {\n\t\treturn\n\t}\n\n\t// channel signaling mumble connection status\n\tmod.connectedState = make(chan bool)\n\n\thost, port, err := net.SplitHostPort(mod.server)\n\tif err != nil {\n\t\thost = mod.server\n\t\tport = strconv.Itoa(gu...
[ "@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 comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
get time increase value from method name
[ "function getTimeIncreaseFromName(methodName) {\n const matchNumbers = String(methodName).match(/_increaseTimeBy(\\d+)/);\n\n if (matchNumbers !== null\n && typeof matchNumbers[1] === 'string') {\n return parseInt(matchNumbers[1], 10);\n }\n\n return 0;\n}" ]
[ "function make_event(event, target) {\n return string_p(event)? Event.make(event, target)\n : /* otherwise */ event }" ]
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code:" }
Summary format: object mag stdev dist ..E nobs time av_xres av_yres max_x max_y a ..E e ..E i ..E node ..E argperi ..E M ..E ra_dis dec_dis
[ "def from_summary_line(cls, summaryLine, version=4, existing_object=None):\n ''' \n '''\n if not summaryLine:\n raise ValueError('No summary line given')\n if version == 4:\n params = summaryLine.split()\n if len(params) != 25:\n print para...
[ "def tas2mach(tas, h):\n \n a = vsound(h)\n M = tas / a\n return M" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
Set the value of [code] column. @param string $v new value @return Country The current object (for fluent API support)
[ "public function setCode($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->code !== $v) {\n $this->code = $v;\n $this->modifiedColumns[] = CountryPeer::CODE;\n }\n\n\n return $this;\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 text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
// onListClusters executes 'tsh clusters' command
[ "func onListClusters(cf *CLIConf) {\n\ttc, err := makeClient(cf, true)\n\tif err != nil {\n\t\tutils.FatalError(err)\n\t}\n\tproxyClient, err := tc.ConnectToProxy(cf.Context)\n\tif err != nil {\n\t\tutils.FatalError(err)\n\t}\n\tdefer proxyClient.Close()\n\n\tvar sites []services.Site\n\terr = client.RetryWithRelog...
[ "def remove_all_servers(self):\n \n # 'no ntp' removes all server entries.\n # For command_builder, disable command 'ntp' gives the desired command\n cmd = self.command_builder('ntp', disable=True)\n return self.configure(cmd)" ]
codesearchnet
{ "query": "Represent the post about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Networking:" }
Update directory @param string $key @param int $ttl @return array $body @throws EtcdException
[ "public function updateDir($key, $ttl)\n {\n if (!$ttl) {\n throw new EtcdException('TTL is required', 204);\n }\n\n $condition = array(\n 'dir' => 'true',\n 'prevExist' => 'true'\n );\n\n $response = $this->guzzleclient->put(\n $this...
[ "public function antiLight(array $req): void\n {\n $this->isConfigDebug ? print('anti light') : null;\n $this->log(configDefault('anti/light', 'log', 'anti', 'light'), $req);\n }" ]
codesearchnet
{ "query": "Represent the sentence about Encryption:", "pos": "Represent the code about Encryption:", "neg": "Represent the code about programming:" }
Import the attribute map from a dictionary :param mapdict: The dictionary
[ "def from_dict(self, mapdict):\n \n\n self.name_format = mapdict[\"identifier\"]\n try:\n self._fro = dict(\n [(k.lower(), v) for k, v in mapdict[\"fro\"].items()])\n except KeyError:\n pass\n try:\n self._to = dict([(k.lower(), v) f...
[ "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 sentence about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
To send email to user :param template: :param kwargs: :return:
[ "def send_email(self, template, **kwargs):\n \n user_data = {\n \"id\": self.id,\n \"username\": self.username,\n \"name\": self.name,\n \"first_name\": self.first_name,\n \"last_name\": self.last_name,\n \"email\": self.email\n ...
[ "def get_user(self, user_id):\n \n if user_id in self._users:\n return self._users.get(user_id)\n else:\n # Load user\n # Save user in cache\n return" ]
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Get the stacks for the current action. Handles configuring the :class:`stacker.stack.Stack` objects that will be used in the current action. Returns: list: a list of :class:`stacker.stack.Stack` objects
[ "def get_stacks(self):\n \n if not hasattr(self, \"_stacks\"):\n stacks = []\n definitions = self._get_stack_definitions()\n for stack_def in definitions:\n stack = Stack(\n definition=stack_def,\n context=self,\n ...
[ "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:" }
returns file names :param files: list of strings and\\or :class:`file_configuration_t` instances. :type files: list
[ "def get_os_file_names(files):\n \n\n fnames = []\n for f in files:\n if utils.is_str(f):\n fnames.append(f)\n elif isinstance(f, file_configuration_t):\n if f.content_type in (\n file_configuration_t.CONTENT_TYPE.STANDA...
[ "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 summarization about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code:" }
// NewPubKeyMultisigThreshold returns a new PubKeyMultisigThreshold. // Panics if len(pubkeys) < k or 0 >= k.
[ "func NewPubKeyMultisigThreshold(k int, pubkeys []crypto.PubKey) crypto.PubKey {\n\tif k <= 0 {\n\t\tpanic(\"threshold k of n multisignature: k <= 0\")\n\t}\n\tif len(pubkeys) < k {\n\t\tpanic(\"threshold k of n multisignature: len(pubkeys) < k\")\n\t}\n\treturn PubKeyMultisigThreshold{uint(k), pubkeys}\n}" ]
[ "func (m *VoteSetBitsMessage) ValidateBasic() error {\n\tif m.Height < 0 {\n\t\treturn errors.New(\"Negative Height\")\n\t}\n\tif m.Round < 0 {\n\t\treturn errors.New(\"Negative Round\")\n\t}\n\tif !types.IsVoteTypeValid(m.Type) {\n\t\treturn errors.New(\"Invalid Type\")\n\t}\n\tif err := m.BlockID.ValidateBasic();...
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
// SetS3BackupConfiguration sets the S3BackupConfiguration field's value.
[ "func (s *ExtendedS3DestinationConfiguration) SetS3BackupConfiguration(v *S3DestinationConfiguration) *ExtendedS3DestinationConfiguration {\n\ts.S3BackupConfiguration = v\n\treturn s\n}" ]
[ "func NewTarTimeoutError() error {\n\treturn Error{\n\t\tMessage: fmt.Sprintf(\"timeout waiting for tar stream\"),\n\t\tDetails: nil,\n\t\tErrorCode: TarTimeoutError,\n\t\tSuggestion: \"check the Source-To-Image scripts if it accepts tar stream for assemble and sends for save-artifacts\",\n\t}\n}" ]
codesearchnet
{ "query": "Represent the Github instruction about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
http://alienryderflex.com/hsp.html
[ "function rgb2lum(r,g,b) {\n\t\treturn Math.sqrt(\n\t\t\tPr * r*r +\n\t\t\tPg * g*g +\n\t\t\tPb * b*b\n\t\t);\n\t}" ]
[ "function(inlines) {\n var m;\n var dest;\n if ((m = this.match(/^<([a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/))) { // email autolink\n dest = m.slice(1,-1);\n inlines.push({ t: 'Link', label: [{ t: 'Str', c: des...
codesearchnet
{ "query": "Represent the Github post:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
// 设置定时器, // @id为定时器唯一标识, // @bell==nil时为倒计时器,此时@tol为睡眠时长, // @bell!=nil时为闹铃,此时@tol用于指定醒来时刻(从now起遇到的第tol个bell)。
[ "func (self *Context) SetTimer(id string, tol time.Duration, bell *Bell) bool {\n\treturn self.spider.SetTimer(id, tol, bell)\n}" ]
[ "protected boolean isVirtualDns(Host host) {\n\t\tlong millis = host.getExpiration() - System.currentTimeMillis();\n\t\t// JVM的DNS缓存默认是30秒过期,如果过期时间大于1年则表示自定义的域名解析记录\n\t\t// 在要求特别准确的情况下请注意:如果自定义了JVM DNS缓存时间超过1年,则会返回错误数据.\n\t\treturn (millis > ABOUT_YEAR);\n\t}" ]
codesearchnet
{ "query": "Represent the Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Return a string representation of the constructor arguments from an associative constructor array. @param array $constructor @param string $equator @param string $separator @return string
[ "public static function stringify(array $constructor, string $equator = '=', string $separator = ' ') : string\n {\n $strings = [];\n\n foreach ($constructor as $arg => $param) {\n if (is_object($param)) {\n $param = self::shortName($param);\n }\n\n i...
[ "function typecastPropertyValue ($name, $v)\n {\n if ($this->isScalar ($name) && $this->isEnum ($name))\n $this->validateEnum ($name, $v);\n\n $type = $this->getTypeOf ($name);\n if ($type && !type::validate ($type, $v))\n throw new ComponentException ($this->component,\n sprintf (\n ...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
Plots the convergence graph: iterations vs number of columns. Each curve shows the convergence for a given number of unique features.
[ "def plotConvergenceByColumnTopology(results, columnRange, featureRange, networkType, numTrials):\n \n ########################################################################\n #\n # Accumulate all the results per column in a convergence array.\n #\n # Convergence[f, c, t] = how long it took it to converge ...
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Trigger find of serialized sources and build objects
[ "def map(self, options=None):\n \"\"\"\"\"\"\n for path, data in self.paths.items():\n references = data.get(\"references\", [])\n for item in data[\"items\"]:\n for obj in self.create_class(item, options, references=references):\n self.add_objec...
[ "def start(self, timeout=None):\n \n\n started = super(Node, self).start(timeout=timeout)\n if started:\n # TODO : return something produced in the context manager passed\n return self._svc_address # returning the zmp url as a way to connect to the node\n # CAR...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code about programming:" }
@param string $path @param string $sizing @param string $mode @param string $filter @return \Symfony\Component\HttpFoundation\RedirectResponse
[ "public function filterRuntimeAction($path, $sizing, $mode = 'inset', $filter = 'strip')\n {\n if ($path instanceof ImageInterface) {\n $path = $path->getPath();\n }\n\n $runtimeConfig = [\n 'thumbnail' => [\n 'size' => explode('x', strtolower($sizing)),\...
[ "final public function build()\n {\n return new ImageManager($this->getPath(), $this->getRootDir(), $this->getRootUrl(), $this->getConfig());\n }" ]
codesearchnet
{ "query": "Represent the comment about Symfony:", "pos": "Represent the code about Symfony:", "neg": "Represent the code:" }
Fetch one resultset from previous select statement as an object. @param object $object to insert values into. @return array with resultset.
[ "public function fetchInto($object)\n {\n $this->stmt->setFetchMode(\\PDO::FETCH_INTO, $object);\n return $this->stmt->fetch();\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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Software Development:" }
convert a DataStorage object to a dictionary (useful for saving); it should work for other objects too
[ "def toDict(datastorage_obj, recursive=True):\n \n # if not a DataStorage, convert to it first\n if \"items\" not in dir(datastorage_obj): datastorage_obj = DataStorage(datastorage_obj)\n return _toDict(datastorage_obj)" ]
[ "def path(self, path):\n \"\"\"\"\"\"\n\n # pylint: disable=attribute-defined-outside-init\n self._path = copy_.copy(path)\n\n # The provided path is shallow copied; it does not have any attributes\n # with mutable types.\n\n # We perform this check after the initialization...
codesearchnet
{ "query": "Represent the Github sentence:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic void eUnset(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.PPO__RG:\n\t\t\t\tgetRG().clear();\n\t\t\t\treturn;\n\t\t}\n\t\tsuper.eUnset(featureID);\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 post about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
@deprecated Use {@link #addInt(CharSequence, int)} instead. Adds a new integer header with the specified name and value.
[ "@Deprecated\n public static void addIntHeader(HttpMessage message, CharSequence name, int value) {\n message.headers().addInt(name, value);\n }" ]
[ "private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {\n /*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (And it's better to have it in the value, rather\n * tha...
codesearchnet
{ "query": "Represent the post about text processing:", "pos": "Represent the code about text processing:", "neg": "Represent the code about programming:" }
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "@Override\n\tpublic void eUnset(int featureID) {\n\t\tswitch (featureID) {\n\t\t\tcase AfplibPackage.BEGIN_SEGMENT_COMMAND__LENGTH:\n\t\t\t\tsetLENGTH(LENGTH_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackage.BEGIN_SEGMENT_COMMAND__NAME:\n\t\t\t\tsetNAME(NAME_EDEFAULT);\n\t\t\t\treturn;\n\t\t\tcase AfplibPackag...
[ "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 summarization about Text generation:", "pos": "Represent the Github code about Text generation:", "neg": "Represent the Github code:" }
Marshall the given parameter object.
[ "public void marshall(Operation operation, ProtocolMarshaller protocolMarshaller) {\n\n if (operation == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(operation.getId(), ID_BINDING);\n ...
[ "def post_build(self, p, pay):\n \n p += pay\n if self.auxdlen != 0:\n print(\"NOTICE: A properly formatted and complaint V3 Group Record should have an Auxiliary Data length of zero (0).\")\n print(\" Subsequent Group Records are lost!\")\n return p" ]
codesearchnet
{ "query": "Represent the text about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code:" }
// AvailableDevice finds an available device and returns it. Note that // you should externally hold a flock or something in order to guarantee // that this device is available across processes.
[ "func AvailableDevice() (string, error) {\n\tprefix, err := devicePrefix()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tletters := \"fghijklmnop\"\n\tfor _, letter := range letters {\n\t\tdevice := fmt.Sprintf(\"/dev/%s%c\", prefix, letter)\n\n\t\t// If the block device itself, i.e. /dev/sf, exists, then we\n...
[ "func (h Handler) GetE(cmd common.GetRequest) (<-chan common.GetEResponse, <-chan error) {\n\t// Being minimalist, not lazy. The chunked handler is not meant to be used with a\n\t// backing store that supports the GetE protocol extension. It would be a waste of\n\t// time and effort to support it here if it would \...
codesearchnet
{ "query": "Represent the comment about Data processing:", "pos": "Represent the code about Data processing:", "neg": "Represent the code about Software development:" }
Update the terminal period solution. This method should be run when a new AgentType is created or when CRRA changes. Parameters ---------- None Returns ------- None
[ "def updateSolutionTerminal(self):\n '''\n \n '''\n AggShockConsumerType.updateSolutionTerminal(self)\n\n # Make replicated terminal period solution\n StateCount = self.MrkvArray.shape[0]\n self.solution_terminal.cFunc = StateCount*[self.solution_terminal.cFunc]\n ...
[ "def arg_to_array(func):\n \n def fn(self, arg, *args, **kwargs):\n \"\"\"Function\n\n Parameters\n ----------\n arg : array-like\n Argument to convert.\n *args : tuple\n Arguments.\n **kwargs : dict\n Keyword arguments.\n\n Ret...
codesearchnet
{ "query": "Represent the Github post about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
{.predicate?} Here we execute the first clause that evaluates to true, and then stop.
[ "def _DoPredicates(args, context, callback, trace):\n \n block = args\n value = context.Lookup('@')\n for (predicate, args, func_type), statements in block.clauses:\n if func_type == ENHANCED_FUNC:\n do_clause = predicate(value, context, args)\n else:\n do_clause = pr...
[ "function skip1(previousExpr) {\n \n \n if( previousExpr == always ) {\n /* If there is no previous expression this consume command \n is at the start of the jsonPath.\n Since JSONPath specifies what we'd like to find but not \n necessarily everything leading down t...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }
Introspects the given embedded field and returns its metadata. @param field the embedded field to introspect @param entityMetadata metadata of the owning entity @return the metadata of the embedded field
[ "public static EmbeddedMetadata introspect(EmbeddedField field, EntityMetadata entityMetadata) {\n EmbeddedIntrospector introspector = new EmbeddedIntrospector(field, entityMetadata);\n introspector.process();\n return introspector.metadata;\n }" ]
[ "def reset ():\n \n global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache\n\n __register_features ()\n\n # Stores suffixes for generated targets.\n __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]\n\n # Maps suffixes to types...
codesearchnet
{ "query": "Represent the Github instruction about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code:" }
Exclude those features which do not pass the feature count cutoff threshold (bias features will be kept separately).
[ "private void excludeByFeatCount(IntIntDenseVector[][] counts) {\n for (int t=0; t<included.length; t++) {\n for (int c = 0; c < included[t].length; c++) {\n for (int k = 0; k < included[t][c].length; k++) {\n boolean exclude = (counts[t][c].get(k) < prm.featCount...
[ "def rs_calc_syndromes(msg, nsym, fcr=0, generator=2):\n '''\n '''\n # Note the \"[0] +\" : we add a 0 coefficient for the lowest degree (the constant). This effectively shifts the syndrome, and will shift every computations depending on the syndromes (such as the errors locator polynomial, errors evaluato...
codesearchnet
{ "query": "Represent the Github instruction about Bioinformatics:", "pos": "Represent the Github code about Bioinformatics:", "neg": "Represent the Github code about Natural Language Processing:" }
Repackages old calls with new arguments, but only if two differ. @param Call $call @param array $arguments @return Call @throws UnsupportedCallException if given call is not DefinitionCall or TransformationCall
[ "private function repackageCallIfNewArguments(Call $call, array $arguments)\n {\n if ($arguments === $call->getArguments()) {\n return $call;\n }\n\n return $this->repackageCallWithNewArguments($call, $arguments);\n }" ]
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the summarization about Software Development:", "pos": "Represent the code about Software Development:", "neg": "Represent the code:" }
Check CSRF token is valid. Note: Also checks POST data to see if a Moneris RVAR CSRF token exists. @return void @throws \Exception
[ "public function check() {\n if (! self::$active) {\n return;\n }\n \n // Check sessions are enabled.\n if (session_id() === '') {\n throw new \\Exception('Sessions are required to use the CSRF Guard middleware.');\n }\n \n if (isset($_SE...
[ "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 Github description about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about Programming:" }
// Exists returns true if the given key is present in the session data.
[ "func (s *Session) Exists(ctx context.Context, key string) bool {\n\tsd := s.getSessionDataFromContext(ctx)\n\n\tsd.mu.Lock()\n\t_, exists := sd.Values[key]\n\tsd.mu.Unlock()\n\n\treturn exists\n}" ]
[ "function(loader) {\n // public\n this.maxRecursion = 5;\n this.loader = (typeof loader === 'function') ? loader : null;\n\n // internal\n this._schemaRegistry = new SchemaRegistry();\n this._customFormatHandlers = {};\n\n // _refsRequested is an object where the key is the normalized ID\n // of the schema ...
codesearchnet
{ "query": "Represent the Github summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code:" }
Writes {@code model} to {@code out}.
[ "public static void write (SimpleMisoSceneModel model, Json.Writer out) {\n out.object(); // outer\n out.value(\"width\", model.width);\n out.value(\"height\", model.height);\n out.value(\"viewwidth\", model.vwidth);\n out.value(\"viewheight\", model.vheight);\n\n out.array...
[ "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 summarization about writing:", "pos": "Represent the Github code about writing:", "neg": "Represent the Github code about File management:" }
Returns true if a type implements Parcelable
[ "static boolean isParcelable(Elements elements, Types types, TypeMirror type) {\n TypeMirror parcelableType = elements.getTypeElement(PARCELABLE_CLASS_NAME).asType();\n return types.isAssignable(type, parcelableType);\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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Check whether a city already exist using given name within province. @param string $name @param integer $countryId @param integer $provinceId @return boolean
[ "public static function isUniqueExist( $name, $countryId, $provinceId ) {\n\n\t\t$city = self::findUnique( $name, $countryId, $provinceId );\n\n\t\treturn isset( $city );\n\t}" ]
[ "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 Github summarization about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// ProcessMembershipChanges takes a slice of membership.MemberChange's and // applies them to the hashring by adding and removing members accordingly to // the changes passed in.
[ "func (r *HashRing) ProcessMembershipChanges(changes []membership.MemberChange) {\n\tr.Lock()\n\tchanged := false\n\tvar added, updated, removed []string\n\tfor _, change := range changes {\n\t\tif change.Before == nil && change.After != nil {\n\t\t\t// new member\n\t\t\tif r.addMemberNoLock(change.After) {\n\t\t\t...
[ "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 summarization:", "pos": "Represent the Github code:", "neg": "Represent the Github code about Software development:" }
Adds a new PolymorphicIndexable to the registry.
[ "def register(self, cls):\n \"\"\"\"\"\"\n doc_type = cls.search_objects.mapping.doc_type\n\n self.all_models[doc_type] = cls\n base_class = cls.get_base_class()\n if base_class not in self.families:\n self.families[base_class] = {}\n self.families[base_class][do...
[ "@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 comment:", "pos": "Represent the code:", "neg": "Represent the code about programming:" }
Add the constraints for a relationship count query. @param Query $query @param Query $parent @return Query
[ "public function getRelationCountQuery(Query $query, Query $parent)\n {\n $query->select(new Expression('count(*)'));\n\n $otherKey = $this->wrap($query->getTable().'.'.$this->otherKey);\n\n return $query->where($this->getQualifiedForeignKey(), '=', new Expression($otherKey));\n }" ]
[ "public function handleManipulateAST(ManipulateAST $ManipulateAST): void\n {\n $ManipulateAST->documentAST = ASTHelper::attachDirectiveToObjectTypeFields(\n $ManipulateAST->documentAST,\n PartialParser::directive('@deferrable')\n );\n\n $ManipulateAST->documentAST->setD...
codesearchnet
{ "query": "Represent the Github description about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
移除tag中的内容 //@xxx--begin contents to be removed //@xxx--end @param { stirng } contents 需要移除标签的内容 @param { stirng } tagId 命名的tag id(@id),也可以是正则表达式.*
[ "function removeTagContents(contents, tagId) {\n //mac linux\n var reg = new RegExp(\n `\\n(.*)\\/\\/≤${tagId}--begin[^≤]*\\/\\/≤${tagId}--end`,\n 'g'\n );\n contents = contents.replace(reg, '');\n return contents;\n}" ]
[ "public Select parseSelect(MySqlSelectQueryBlock query) throws SqlParseException {\n\n Select select = new Select();\n /*zhongshu-comment SqlParser类没有成员变量,里面全是方法,所以将this传到WhereParser对象时是无状态的,\n 即SqlParser对象并没有给WhereParser传递任何属性,也不存在WhereParser修改SqlParser的成员变量值这一说\n ...
codesearchnet
{ "query": "Represent the Github description about Work management:", "pos": "Represent the Github code about Work management:", "neg": "Represent the Github code about programming:" }
Checks if a given type is nonable, meaning that it explicitly or implicitly declares a Union with NoneType. Nested TypeVars and Unions are supported. :param typ: :return:
[ "def is_pep484_nonable(typ):\n \n # TODO rely on typing_inspect if there is an answer to https://github.com/ilevkivskyi/typing_inspect/issues/14\n if typ is type(None):\n return True\n elif is_typevar(typ) or is_union_type(typ):\n return any(is_pep484_nonable(tt) for tt in get_alternate_ty...
[ "NameAndType nameType(Symbol sym) {\n return new NameAndType(sym.name, sym.externalType(types), types);\n // the NameAndType is generated from a symbol reference, and the\n // adjustment of adding an additional this$n parameter needs to be made.\n }" ]
codesearchnet
{ "query": "Represent the Github text about Software development:", "pos": "Represent the Github code about Software development:", "neg": "Represent the Github code about programming:" }
Writes len bytes from the specified byte array starting at offset off to this file output stream. @param b The array @throws IOException if a network error occurs
[ "@Override\n public void write ( byte[] b, int off, int len ) throws IOException {\n writeDirect(b, off, len, 0);\n }" ]
[ "@Override\n public void reset() throws JMSException {\n if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())\n SibTr.entry(this, tc, \"reset\");\n\n // After reset has been called, the message body is immutable (the only way of changing it is to\n // call clearBody an...
codesearchnet
{ "query": "Represent the instruction about Programming:", "pos": "Represent the code about Programming:", "neg": "Represent the code about Java programming:" }
a generator function for retrieving data in a nested dictionary :param input_data: dictionary or list with nested data :return: string with dot_path, object with value of endpoint
[ "def walk_data(input_data):\n\n ''' \n '''\n\n def _walk_dict(input_dict, path_to_root):\n if not path_to_root:\n yield '.', input_dict\n for key, value in input_dict.items():\n key_path = '%s.%s' % (path_to_root, key)\n type_name = value.__class__.__name__\n ...
[ "def run_objective(objective, _name, raw_output, output_files, threads)\n # output is a, array: [raw_output, output_files].\n # output_files is a hash containing the absolute paths\n # to file(s) output by the target in the format expected by the\n # objective function(s), with keys as the keys ...
codesearchnet
{ "query": "Represent the Github comment about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
====================================================
[ "public function getOffset(){\n\t\tif(!empty($this->offset)){\n\t\t\treturn $this->offset;\n\t\t\t}\n\t\tif($this->type==PTYPE_GET){\n\t\t\t$this->offset=$this->getPage()*$this->getLimit();\t\n\t\t\t}\n\t\treturn $this->offset;\n\t\t}" ]
[ "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 description about Language and Writing:", "pos": "Represent the code about Language and Writing:", "neg": "Represent the code:" }
Save a template with the current params. Writes file to `Create::$path`. @param array $params @return string|boolean A result string on success of writing the file. If any errors occur along the way such as missing information boolean false is returned.
[ "protected function _save(array $params = []) {\n\t\t$defaults = ['namespace' => null, 'class' => null];\n\t\t$params += $defaults;\n\n\t\tif (empty($params['class']) || empty($this->_library['path'])) {\n\t\t\treturn false;\n\t\t}\n\t\t$contents = $this->_template();\n\t\t$result = Text::insert($contents, $params)...
[ "private function cache(string $key, string $value, int $cacheTime = null)\n {\n try {\n $this->client->set($key, $value);\n\n if ($cacheTime !== null) {\n $this->client->expire($key, $cacheTime);\n }\n } catch (\\Exception $e) {\n // We do...
codesearchnet
{ "query": "Represent the description about Software development:", "pos": "Represent the code about Software development:", "neg": "Represent the code about Programming:" }
@param callable $method Method to execute. @param mixed ...$args Arguments to pass to function. @return \Generator @resolve \Amp\Sql\CommandResult|\pq\Statement @throws FailureException
[ "private function send(callable $method, ...$args): \\Generator\n {\n while ($this->busy) {\n try {\n yield $this->busy->promise();\n } catch (\\Throwable $exception) {\n // Ignore failure from another operation.\n }\n }\n\n if (...
[ "private function handleErrorUnit(Invoke\\Error $unit): Result\\AbstractResult\n {\n return new Result\\Error(null, $unit->getBaseException());\n }" ]
codesearchnet
{ "query": "Represent the Github summarization about Software Development:", "pos": "Represent the Github code about Software Development:", "neg": "Represent the Github code about Software development:" }
@param GestpayMethod $gestpayMethod @return bool
[ "private function isValidTransaction(GestpayMethod $gestpayMethod)\n {\n if ('OK' != $gestpayMethod->getTransactionResult()) {\n return false;\n }\n\n if ($gestpayMethod->getAmount() * 100 != $this->paymentBridge->getAmount()) {\n return false;\n }\n\n ret...
[ "final protected function c() {return dfc($this, function() {/** @var int|null $id $id */return\n\t\t!($id = $this->o()->getCustomerId()) ? null : df_customer($id)\n\t;});}" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// NewFloat64s returns a *Float64s with customized less func and initial capacity.
[ "func NewFloat64s(less func(x, y float64) bool, cap int) *Float64s {\n\th := &Float64s{}\n\n\tif less != nil {\n\t\th.less = func(i, j int) bool {\n\t\t\treturn less(h.list[i], h.list[j])\n\t\t}\n\t}\n\tif cap > 0 {\n\t\th.list = make([]float64, 0, cap)\n\t}\n\n\treturn h\n}" ]
[ "func (zip GobMeddler) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error) {\n\t// give a pointer to a byte buffer to grab the raw data\n\treturn new([]byte), nil\n}" ]
codesearchnet
{ "query": "Represent the Github instruction about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// post handles post requests to create a daily todo item.
[ "func (s *Service) post(w http.ResponseWriter, r *http.Request, _ mux.Params) {\n\t// Read request body's json payload into buffer.\n\tb, err := ioutil.ReadAll(r.Body)\n\ttodo, err := decode(b)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), 500)\n\t}\n\n\t// Use the url path as key.\n\tkey := []byte(r.URL.Strin...
[ "function(list){\n localStorage.setItem(localStorageKey, JSON.stringify(list));\n // if we used a real database, we would likely do the below in a callback\n this.list = list;\n this.trigger(list); // sends the updated list to all listening components (TodoApp)\n }...
codesearchnet
{ "query": "Represent the Github summarization about Web development:", "pos": "Represent the Github code about Web development:", "neg": "Represent the Github code:" }
Start the user's pod
[ "def _start(self):\n \"\"\"\"\"\"\n\n # load user options (including profile)\n yield self.load_user_options()\n\n # record latest event so we don't include old\n # events from previous pods in self.events\n # track by order and name instead of uid\n # so we get even...
[ "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:" }
// NewKillCommand creates a new cobra.Command for `docker kill`
[ "func NewKillCommand(dockerCli command.Cli) *cobra.Command {\n\tvar opts killOptions\n\n\tcmd := &cobra.Command{\n\t\tUse: \"kill [OPTIONS] CONTAINER [CONTAINER...]\",\n\t\tShort: \"Kill one or more running containers\",\n\t\tArgs: cli.RequiresMinArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error ...
[ "func (r *printRun) RegisterIDFlag() {\n\tr.Flags.BoolVar(&r.id, \"id\", false, doc(`\n\t\tPrint only build ids.\n\n\t\tIntended for piping the output into another bb subcommand:\n\t\t\tbb ls -cl myCL -id | bb cancel\n\t`))\n}" ]
codesearchnet
{ "query": "Represent the post about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about Software Development:" }
persist the field values of this orm
[ "def insert(self):\n \"\"\"\"\"\"\n ret = True\n\n schema = self.schema\n fields = self.depopulate(False)\n\n q = self.query\n q.set_fields(fields)\n pk = q.insert()\n if pk:\n fields = q.fields\n fields[schema.pk.name] = pk\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 comment:", "pos": "Represent the code:", "neg": "Represent the code:" }
Return a Flo object that can be written to to send data to S3. This will result in a multi-part upload, possibly with each part being sent in its own thread
[ "def put_stream(self, rel_path, metadata=None, cb=None):\n ''' '''\n\n import Queue\n import time\n import threading\n\n md5 = metadata.get('md5', None) if metadata else None\n\n # Horrible, but doing it anyway because I can.\n acl = ('public-read' if metadata.get('p...
[ "function onChunk(count) {\n // If chunk read has no bytes than there is nothing left, so end a\n // collection.\n if (count === 0) return next(end)\n\n // Move a offset `position` with `count` towards the end unless\n // position was a `null` in which case we just keep it (`null` means\n ...
codesearchnet
{ "query": "Represent the sentence:", "pos": "Represent the code:", "neg": "Represent the code about File management:" }
//CAClientCert read configuration for the fabric CA client cert bytes for given org
[ "func (c *IdentityConfig) CAClientCert(org string) ([]byte, bool) {\n\tcaConfigs, ok := c.caConfigsByOrg[strings.ToLower(org)]\n\tif ok {\n\t\t//for now, we're only loading the first Cert Authority by default.\n\t\treturn caConfigs[0].TLSCAClientCert, true\n\t}\n\n\treturn nil, false\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 programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code about programming:" }
{@inheritdoc} @api @param \Generated\Shared\Transfer\DataImporterConfigurationTransfer|null $dataImporterConfigurationTransfer @return \Generated\Shared\Transfer\DataImporterReportTransfer
[ "public function importProductMeasurementUnit(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer\n {\n return $this->getFactory()\n ->getProductMeasurementUnitDataImporter()\n ->import($dataImporterConfigurationTransfer);\n }"...
[ "public function choices(): HasMany\n {\n return $this->hasMany(\\Iocaste\\Microservice\\Foundation\\Data\\Models\\Parameter\\Choice::class);\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:" }
@param Request $request @return \Symfony\Component\HttpFoundation\Response
[ "public function indexAction(Request $request)\n {\n $errorMessage = '';\n $hasDB = false;\n $installed = false;\n try {\n /** @var $page Page */\n $pageManager = $this->get('networking_init_cms.page_manager');\n $page = $pageManager->findOneBy(\n ...
[ "public function createApplicationPassword(ApplicationPassword $application)\n {\n return $this->createCommand()\n ->setRequest($this->client->post('application'))\n ->setBodyEntity($application, 'json')\n ->setResponseClass('Maba\\OAuthCommerceInternalClient\\Entity\\Appl...
codesearchnet
{ "query": "Represent the post about Symfony:", "pos": "Represent the code about Symfony:", "neg": "Represent the code about Programming:" }
Add both the --no-wait and --wait options.
[ "protected function addWaitOptions()\n {\n $this->addOption('no-wait', 'W', InputOption::VALUE_NONE, 'Do not wait for the operation to complete');\n if ($this->detectRunningInHook()) {\n $this->addOption('wait', null, InputOption::VALUE_NONE, 'Wait for the operation to complete');\n ...
[ "def remove_all_servers(self):\n \n # 'no ntp' removes all server entries.\n # For command_builder, disable command 'ntp' gives the desired command\n cmd = self.command_builder('ntp', disable=True)\n return self.configure(cmd)" ]
codesearchnet
{ "query": "Represent the text:", "pos": "Represent the code:", "neg": "Represent the code about Networking:" }
// GetMap retrieves a Map by its ID.
[ "func (c *CloudPersister) GetMap(id int64) (*models.Map, error) {\n\tctx := context.Background()\n\tk := datastore.NewKey(ctx, \"Map\", \"\", id, nil)\n\tMap := &models.Map{}\n\tif err := c.DatastoreClient().Get(ctx, k, Map); err != nil {\n\t\treturn nil, fmt.Errorf(\"datastoredb: could not get Map: %v\", err)\n\t}...
[ "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 comment about programming:", "pos": "Represent the code about programming:", "neg": "Represent the code about programming:" }
// READ Boolean Locked;
[ "func (item *Item) Locked() (bool, error) {\n val, err := item.dbus.GetProperty(\"org.freedesktop.Secret.Item.Locked\")\n if err != nil {\n return true, err\n }\n\n return val.Value().(bool), nil\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 about programming:", "pos": "Represent the Github code about programming:", "neg": "Represent the Github code:" }
// GetAccurateCmpType uses a more complex logic to decide the EvalType of the two args when compare with each other than // getBaseCmpType does.
[ "func GetAccurateCmpType(lhs, rhs Expression) types.EvalType {\n\tlhsFieldType, rhsFieldType := lhs.GetType(), rhs.GetType()\n\tlhsEvalType, rhsEvalType := lhsFieldType.EvalType(), rhsFieldType.EvalType()\n\tcmpType := getBaseCmpType(lhsEvalType, rhsEvalType, lhsFieldType, rhsFieldType)\n\tif (lhsEvalType.IsStringK...
[ "public LHS toLHS( CallStack callstack, Interpreter interpreter)\n throws EvalError\n {\n // loosely typed map expression new {a=1, b=2} are treated\n // as non assignment (LHS) to retrieve Map.Entry key values\n // then wrapped in a MAP_ENTRY type LHS for value assignment.\n r...
codesearchnet
{ "query": "Represent the Github description:", "pos": "Represent the Github code:", "neg": "Represent the Github code:" }