language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
public static Single<XianTransaction> getTransaction(String transactionId, boolean readOnly) { if (BaseLocalTransaction.getExistedLocalTrans(transactionId) != null) { return Single.just(BaseLocalTransaction.getExistedLocalTrans(transactionId)); } if (readOnly) { return Po...
python
def _parse_simple_model(topology, parent_scope, model, inputs, outputs): ''' Parse a model containing only one operator (aka simple model). Steps: 1. Create local scope for allocating local variables and operators 2. Create operator and then feed the model's inputs and outputs to the operato...
java
public static Long getLong(String name, Long defaultValue) { return Long.getLong(name, defaultValue); }
java
public void addSubFileFilter() { this.getMainRecord().addListener(new SubFileFilter(ProjectTaskPredecessor.PROJECT_TASK_ID_KEY, this.getHeaderRecord().getField(ProjectTask.ID))); }
java
public CMAAssetFile setUploadFrom(CMALink uploadFrom) { this.uploadFrom = uploadFrom; this.upload = null; this.url = null; this.details = null; return this; }
python
def destination_present(name, physical, restype='queue', description='', enabled=True, server=None): ''' Ensures that the JMS Destination Resource (queue or topic) is present name ...
java
private synchronized void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { // todo: for multithreaded usage this block needs to be synchronized in.defaultReadObject(); initialize(); // only deserialize child if not using a peer if (this.equals(getPee...
java
public URLConnection getResourceConnection(String resourceName) throws ResourceException { // Get the URLConnection URLConnection groovyScriptConn = null; ResourceException se = null; for (URL root : roots) { URL scriptURL = null; try { scriptURL ...
python
def shot_open_callback(self, *args, **kwargs): """Callback for the shot open button :returns: None :rtype: None :raises: None """ tf = self.browser.get_current_selection(1) if not tf: return if not os.path.exists(tf.path): msg = 'T...
python
def available_resources(self): """Get the current available cluster resources. This is different from `cluster_resources` in that this will return idle (available) resources rather than total resources. Note that this information can grow stale as tasks start and finish. Retur...
java
public static Node eq(Node expr1, Node expr2) { return binaryOp(Token.EQ, expr1, expr2); }
python
def verify_repo_matches_url(repo, url): """Verify ``url`` is a part of ``repo``. We were using ``startswith()`` for a while, which isn't a good comparison. This function allows us to ``urlparse`` and compare host and path. Args: repo (str): the repo url url (str): the url to verify is ...
java
public static WriteFutureEx newNotWrittenFuture(IoSession session, Throwable cause) { DefaultWriteFutureEx unwrittenFuture = new DefaultWriteFutureEx(session); unwrittenFuture.setException(cause); return unwrittenFuture; }
python
def root_endpoint(request, format=None): """ List of all the available resources of this RESTful API. """ endpoints = [] # loop over url modules for urlmodule in urlpatterns: # is it a urlconf module? if hasattr(urlmodule, 'urlconf_module'): is_urlconf_module = True ...
python
def auth_string(self): ''' Authenticate based on username and token which is base64-encoded ''' username_token = '{username}:{token}'.format(username=self.username, token=self.token) b64encoded_string = b64encode(username_token) auth_string = 'Token {b64}'.format(b64=b64...
java
public final boolean hasInterface(final SgClass intf) { if (intf == null) { throw new IllegalArgumentException("The argument 'intf' cannot be null!"); } if (!intf.isInterface()) { throw new IllegalArgumentException( "The argument 'intf' is a cl...
java
public static HierarchicalConfiguration getHierarchicalConfiguration(final Configuration configuration) { if (configuration instanceof CompositeConfiguration) { final CompositeConfiguration compositeConfig = (CompositeConfiguration) configuration; for (int i = 0; i < compositeConfig.getN...
java
public void print(String s) throws IOException { //PK89810, If WCCustomProperties.FINISH_RESPONSE_ON_CLOSE is set and stream is already obtained and closed. // We will not allow user to print more data if the above case is met, outputstreamClosed will be true and default is false. if (!(WCCustomProperties.FINIS...
java
@Override public int[] columns(String[] names) { int[] idxs = new int[_strs.length]; for (int i = 0; i < _strs.length; i++) { int idx = idxs[i] = water.util.ArrayUtils.find(names, _strs[i]); if (idx == -1) throw new IllegalArgumentException("Column " + _strs[i] + " not found"); } return id...
python
def negative_report(binary_report, sha256hash, project, patch_file): """ If no match is made and file is clean """ report_url = binary_report['permalink'] scan_date = binary_report['scan_date'] logger.info('File scan date for %s shows a clean status on: %s', patch_file, scan_date) logger.inf...
java
static ExecutorService startClientService(SystemMain system, ClientType clientType, AtomicInteger jobCounter) { switch (clientType) { case ALERT: return startAlertClientService(system, jobCounter); case COMMIT_SCHEMA: /* Alpha feature, not currently suppo...
java
public void setOnNonEmptyWorkDirectory(String value) { try { this.nonEmptyWorkDirAction = NonEmptyWorkDirectoryAction.valueOf(value.toUpperCase(Locale.ROOT)); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("OnNonEmptyWorkDirectory accepts any of: " + Arrays.toStr...
python
def validateFilepath( self ): """ Alters the color scheme based on the validation settings. """ if ( not self.isValidated() ): return valid = self.isValid() if ( not valid ): fg = self.invalidForeground() bg = self.invalidBackg...
python
def render_impl(self, template, context, **opts): """ Render given template file and return the result. :param template: Template file path :param context: A dict or dict-like object to instantiate given template file :param opts: Options such as: - at_pa...
java
private int advanceChar() throws JsonParserException { if (eof) return -1; int c = string.charAt(index); if (c == '\n') { linePos++; rowPos = index + 1; utf8adjust = 0; } index++; if (index >= bufferLength) eof = true; return c; }
java
private WebTarget createWebTarget(String restPath, Map<String, String> queryParams) { WebTarget webTarget; try { URI u = new URI(this.baseURI + "/plugins/restapi/v1/" + restPath); Client client = createRestClient(); webTarget = client.target(u); if (queryParams != null && !queryParams.isEmpty()) { ...
java
public void setNoteUpdatedAt(java.util.Collection<DateFilter> noteUpdatedAt) { if (noteUpdatedAt == null) { this.noteUpdatedAt = null; return; } this.noteUpdatedAt = new java.util.ArrayList<DateFilter>(noteUpdatedAt); }
java
public static int getLineCount(String str) { if (null == str || str.isEmpty()) { return 0; } int count = 1; for (char c : str.toCharArray()) { if ('\n' == c) { count++; } } return count; }
python
def sortData( self, column ): """ Returns the data to be used when sorting. If no sort data has been explicitly defined, then the value in the EditRole for this item's column will be used. :param column | <int> :return <variant> ...
java
private String nameHtml(final RenderingContext context, final Person person) { return nameRenderer(context, person).getNameHtml(); }
python
def get_isp(self, ip): ''' Get isp ''' rec = self.get_all(ip) return rec and rec.isp
java
public static TrifocalTensor createTrifocal( Se3_F64 P2 , Se3_F64 P3 , @Nullable TrifocalTensor ret ) { if( ret == null ) ret = new TrifocalTensor(); DMatrixRMaj R2 = P2.getR(); DMatrixRMaj R3 = P3.getR(); Vector3D_F64 T2 = P2.getT(); Vector3D_F64 T3 = P3.getT(); for( int col = 0; col < 3;...
java
public boolean containsKey(int key) { Entry tab[] = table; int index = (key & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.next) { if (e.key == key) { return true; } } return false; }
java
public static int netmaskToPrefix(InetAddress netmask) { byte[] mask = netmask.getAddress(); if (!isValidNetmask(mask)) throw new IllegalArgumentException("Not a valid netmask: " + netmask.getHostAddress()); int prefix = 0; for (int i = 0; i < mask.length; i++) { // drops-through all lower cases to a...
python
def mtspec(data, delta, time_bandwidth, nfft=None, number_of_tapers=None, quadratic=False, adaptive=True, verbose=False, optional_output=False, statistics=False, rshape=False, fcrit=False): """ Wrapper method for the mtspec subroutine in the library by German A. Prieto. ...
python
def _do_bulk_write_command( namespace, operation, command, docs, check_keys, opts, ctx): """Bulk write commands entry point.""" if ctx.sock_info.max_wire_version > 5: return _do_batched_op_msg( namespace, operation, command, docs, check_keys, opts, ctx) return _do_batched_write_c...
java
private static List<ImageConfiguration> filterImages(String nameFilter, List<ImageConfiguration> imagesToFilter) { List<ImageConfiguration> ret = new ArrayList<>(); for (ImageConfiguration imageConfig : imagesToFilter) { if (matchesConfiguredImages(nameFilter, imageConfig)) { ...
java
static String obfuscateCredentials(String originalUrl, HttpUrl parsedUrl) { String username = parsedUrl.username(); String password = parsedUrl.password(); if (username.isEmpty() && password.isEmpty()) { return originalUrl; } if (!username.isEmpty() && !password.isEmpty()) { String enco...
python
def types(self): ''' Returns an iterator over the types of the neurites in the object. If the object is a tree, then one value is returned. ''' neurites = self._obj.neurites if hasattr(self._obj, 'neurites') else (self._obj,) return (neu.type for neu in neurites)
python
def fitString(s, maxCol=79, newlineReplacement=None): r"""Truncate `s` if necessary to fit into a line of width `maxCol` (default: 79), also replacing newlines with `newlineReplacement` (default `None`: in which case everything after the first newline is simply discarded). Examples: >>> fitStr...
java
public AVIMConversation getConversation(String conversationId) { if (StringUtil.isEmpty(conversationId)) { return null; } return this.getConversation(conversationId, false, conversationId.startsWith(Conversation.TEMPCONV_ID_PREFIX)); }
java
public RollbackConfiguration withRollbackTriggers(RollbackTrigger... rollbackTriggers) { if (this.rollbackTriggers == null) { setRollbackTriggers(new com.amazonaws.internal.SdkInternalList<RollbackTrigger>(rollbackTriggers.length)); } for (RollbackTrigger ele : rollbackTriggers) { ...
python
def exclude_from_stock_ip_list(exclude_ip_list): """ 从stock_ip_list删除列表exclude_ip_list中的ip 从stock_ip_list删除列表future_ip_list中的ip :param exclude_ip_list: 需要删除的ip_list :return: None """ for exc in exclude_ip_list: if exc in stock_ip_list: stock_ip_list.remove(exc) # 扩展市场 ...
python
def repr_part(self): """String usable in a space's ``__repr__`` method.""" optargs = [('weighting', self.const, 1.0), ('exponent', self.exponent, 2.0)] return signature_string([], optargs, mod=':.4')
java
public Timestamp getTimestamp(final int columnIndex, final Calendar cal) throws SQLException { try { final Timestamp result = getValueObject(columnIndex).getTimestamp(cal); if (result == null) { return null; } return new Timestamp(result.getTime())...
python
def bytescale(data, cmin=None, cmax=None, high=255, low=0): """ Byte scales an array (image). Byte scaling means converting the input image to uint8 dtype and scaling the range to ``(low, high)`` (default 0-255). If the input image already has dtype uint8, no scaling is done. Parameters --...
java
public ServiceFuture<PolicyAssignmentInner> deleteAsync(String scope, String policyAssignmentName, final ServiceCallback<PolicyAssignmentInner> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(scope, policyAssignmentName), serviceCallback); }
python
def update_webhook(self, webhook, name=None, metadata=None): """ Updates the specified webhook. One or more of the parameters may be specified. """ return self.manager.update_webhook(self.scaling_group, policy=self, webhook=webhook, name=name, metadata=metadata)
python
def get_page_tags(page): """ Retrieves all the tags for a Page instance. :param page: a Page instance :return: list or queryset of attached tags :type: List """ from .models import PageTags try: return page.pagetags.tags.all() except PageTags.DoesNotExist: return []
java
private void indexCRL(X509CRL crl) { X500Principal issuer = crl.getIssuerX500Principal(); Object oldEntry = crlIssuers.put(issuer, crl); if (oldEntry != null) { // assume this is unlikely if (oldEntry instanceof X509CRL) { if (crl.equals(oldEntry)) { ...
python
def get_for_resource(resource): """ Get list of all price list items that should be used for resource. If price list item is defined for service - return it, otherwise - return default price list item. """ resource_content_type = ContentType.objects.get_for_model(resourc...
java
public int listChildren(SftpFile file, Vector<SftpFile> children) throws SftpStatusException, SshException { if (file.isDirectory()) { if (file.getHandle() == null) { file = openDirectory(file.getAbsolutePath()); if (file.getHandle() == null) { throw new SftpStatusException( SftpStatusExcept...
java
@Indexable(type = IndexableType.REINDEX) @Override public CommerceNotificationAttachment addCommerceNotificationAttachment( CommerceNotificationAttachment commerceNotificationAttachment) { commerceNotificationAttachment.setNew(true); return commerceNotificationAttachmentPersistence.update(commerceNotificationA...
java
public void doTag() throws JspException { DataGridTagModel dgm = DataGridUtil.getDataGridTagModel(getJspContext()); if(dgm == null) throw new JspException(Bundle.getErrorString("DataGridTags_MissingDataGridModel")); PagerModel pm = dgm.getState().getPagerModel(); as...
java
private boolean attemptDateRangeOptimization(BinaryExpression during, Retrieve retrieve, String alias) { if (retrieve.getDateProperty() != null || retrieve.getDateRange() != null) { return false; } Expression left = during.getOperand().get(0); Expression right = during.getOp...
python
def profile_view(request, user_id=None): """Displays a view of a user's profile. Args: user_id The ID of the user whose profile is being viewed. If not specified, show the user's own profile. """ if request.user.is_eighthoffice and "full" not in request.GET and user_id ...
python
def assert_allclose(actual, desired, rtol=1.e-5, atol=1.e-8, err_msg='', verbose=True): r"""wrapper for numpy.testing.allclose with default tolerances of numpy.allclose. Needed since testing method has different values.""" return assert_allclose_np(actual, desired, rtol=rtol, atol=atol, ...
python
def GetHandlers(self): """Retrieve the appropriate urllib2 handlers for the given configuration. Returns: A list of urllib2.BaseHandler subclasses to be used when making calls with proxy. """ handlers = [] if self.ssl_context: handlers.append(urllib2.HTTPSHandler(context=self.ssl...
python
def append(self, item): """Append item to end of model""" self.beginInsertRows(QtCore.QModelIndex(), self.rowCount(), self.rowCount()) self.items.append(item) self.endInsertRows()
java
@Override public void cacheResult(List<CPDefinitionInventory> cpDefinitionInventories) { for (CPDefinitionInventory cpDefinitionInventory : cpDefinitionInventories) { if (entityCache.getResult( CPDefinitionInventoryModelImpl.ENTITY_CACHE_ENABLED, CPDefinitionInventoryImpl.class, cpDefinitionInve...
python
def env(*_vars, **kwargs): """Search for the first defined of possibly many env vars. Returns the first environment variable defined in vars, or returns the default defined in kwargs. """ for v in _vars: value = os.environ.get(v, None) if value: return value return ...
python
def modify_account(self, account, attrs): """ :param account: a zobjects.Account :param attrs : a dictionary of attributes to set ({key:value,...}) """ attrs = [{'n': k, '_content': v} for k, v in attrs.items()] self.request('ModifyAccount', { 'id': self._get...
java
public void run(String... args) { int maxIteration = 10; int totalMoreFast = 0; int totalMoreFastWithThreadPool = 0; int totalMoreFastPacketThreadPool = 0; for (int i = 0; i < maxIteration; i++) { LOGGER.info("**********************************"); long jxn...
python
def _read_private_key_file(self, tag, filename, password=None): """ Read an SSH2-format private key file, looking for a string of the type ``"BEGIN xxx PRIVATE KEY"`` for some ``xxx``, base64-decode the text we find, and return it as a string. If the private key is encrypted and ...
python
def get_cohp(self, spin=None, integrated=False): """ Returns the COHP or ICOHP for a particular spin. Args: spin: Spin. Can be parsed as spin object, integer (-1/1) or str ("up"/"down") integrated: Return COHP (False) or ICOHP (True) Returns: ...
java
public static Object columnlist(PageContext pc, Object obj) throws PageException { if (obj instanceof Query) { Key[] columnNames = ((Query) obj).getColumnNames(); boolean upperCase = pc.getCurrentTemplateDialect() == CFMLEngine.DIALECT_CFML; StringBuilder sb = new StringBuilder(); for (int i = 0;...
java
protected void updateReporting(Reporting value, String xmlTag, Counter counter, Element element) { boolean shouldExist = value != null; Element root = updateElement(counter, element, xmlTag, shouldExist); if (shouldExist) { Counter innerCount = new Counter(counter.getDepth() + 1); ...
python
def fcoe_get_login_output_fcoe_login_list_fcoe_login_interface_name(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") fcoe_get_login = ET.Element("fcoe_get_login") config = fcoe_get_login output = ET.SubElement(fcoe_get_login, "output") fco...
java
public static void write(Image image, String format, OutputStream out) throws SlickException { write(image, format, out, DEFAULT_ALPHA_WRITE); }
python
def register_handler(self, name, metadata, callback): """Register subscriptions and their event handlers. :param str name: the subscription name as used by watchman :param dict metadata: a dictionary of metadata to be serialized and passed to the watchman subscribe command. t...
python
def textContent(self): ''' textContent - property, gets the text of this node and all inner nodes. Use .innerText for just this node's text @return <str> - The text of all nodes at this level or lower ''' def _collateText(curNode): ''' ...
java
public FutureData<HistoricsPreviewData> get(HistoricsPreview preview) { if (preview == null || preview.id() == null) { throw new IllegalArgumentException("A valid preview isntance is required"); } FutureData<HistoricsPreviewData> future = new FutureData<HistoricsPreviewData>(); ...
python
def fetch(self): """ Fetch more results from Dynamo """ self.limit.set_request_args(self.kwargs) data = self.connection.call(*self.args, **self.kwargs) self.limit.post_fetch(data) self.last_evaluated_key = data.get('LastEvaluatedKey') if self.last_evaluated_key is None: ...
java
@Override public java.util.concurrent.Future<DescribeAlarmsResult> describeAlarmsAsync( com.amazonaws.handlers.AsyncHandler<DescribeAlarmsRequest, DescribeAlarmsResult> asyncHandler) { return describeAlarmsAsync(new DescribeAlarmsRequest(), asyncHandler); }
python
def _mcon(self): """ Buffer IRC data and handle PING/PONG. """ with self.lock: sdata = ' ' while sdata[-1] != self._crlf[-1]: if sdata == ' ': sdata = '' try: sdata = sdata + \ self._socke...
python
def interconnect_all(self): """Propagate dependencies for provided instances""" for dep in topologically_sorted(self._provides): if hasattr(dep, '__injections__') and not hasattr(dep, '__injections_source__'): self.inject(dep)
java
public Map<String, String> getTags() { Map<String, String> distilledTags = new HashMap<String, String>(); for (Map.Entry<String, String> entry : potentialTags.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (tagCounts.get(key).equals(t...
python
def balance_scores_and_dont_scale(cat_scores, not_cat_scores): ''' median = np.median(cat_scores) scores = np.zeros(len(cat_scores)).astype(np.float) scores[cat_scores > median] = cat_scores[cat_scores > median] not_cat_mask = cat_scores < median if median != 0 else cat_scores <= median scores[not_cat_mask]...
java
public List<Template> list(){ String url = WxEndpoint.get("url.template.list"); logger.debug("template message, list templates."); String response = wxClient.get(url); TemplateListWrapper templateListWrapper = JsonMapper.defaultMapper().fromJson(response, TemplateListWrapper.class); ...
python
def transcribe(rune_sentence: str, runic_alphabet: list): """ From a runic inscription, the transcribe method gives a conventional transcription. :param rune_sentence: str, elements of this are from runic_alphabet or are punctuations :param runic_alphabet: list :return: "...
java
public ArrayList<Integer> getVisited() { if (0 == (this.registry.length - this.unvisitedCount)) { return new ArrayList<Integer>(); } ArrayList<Integer> res = new ArrayList<Integer>(this.registry.length - this.unvisitedCount); for (int i = 0; i < this.registry.length; i++) { if (ONE == this.r...
java
@Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.RPS__RLENGTH: return RLENGTH_EDEFAULT == null ? rlength != null : !RLENGTH_EDEFAULT.equals(rlength); case AfplibPackage.RPS__RPTDATA: return RPTDATA_EDEFAULT == null ? rptdata != null : !RPTDATA_EDEFAULT.equals(rpt...
java
public void prepare(String sql, int connectionFlags, CancellationSignal cancellationSignal, SQLiteStatementInfo outStatementInfo) { if (sql == null) { throw new IllegalArgumentException("sql must not be null."); } if (cancellationSignal != null) { cancellatio...
java
public RetryInterceptorBuilder<T> backOffOptions(long initialInterval, double multiplier, long maxInterval) { Assert.isNull(this.retryOperations, "cannot set the back off policy when a custom retryOperations has been set"); Assert.isTrue(!this.backOffPolicySet, "cannot set the back off options when a bac...
java
public void marshall(ListTagsForResourceRequest listTagsForResourceRequest, ProtocolMarshaller protocolMarshaller) { if (listTagsForResourceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(l...
java
public User getByEmail( Connection conn, String email) throws SQLException { ResultSetHandler<User> h = new BeanHandler<User>(User.class); String sql = "SELECT id,username,fullname,type,emailaddress,registered_ts,invited_by,enabled \n"+ "FROM userbase \n"+ "WHERE emai...
java
public GetSessionResponse getSession(GetSessionRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getSessionId(), "The parameter sessionId should NOT be null or empty string."); InternalRequest internalRequest = createRequest(HttpMe...
python
def read_varint64(self): """Reads a varint from the stream, interprets this varint as a signed, 64-bit integer, and returns the integer. """ i = self.read_var_uint64() if i > wire_format.INT64_MAX: i -= (1 << 64) return i
java
public void removeMember (FormationMember<T> member) { // Find the member's slot int slot = findMemberSlot(member); // Make sure we've found a valid result if (slot >= 0) { // Remove the slot // slotAssignments.removeIndex(slot); slotAssignmentStrategy.removeSlotAssignment(slotAssignments, slot); ...
java
public StringBuilder toStream(final StringBuilder iOutput, Object iValue) { if (iValue != null) { if (!(iValue instanceof OSerializableStream)) throw new OSerializationException("Cannot serialize the object since it's not implements the OSerializableStream interface"); OSerializableStream ...
java
public Object get(String name, ObjectFactory<?> factory) { ThreadScopeContext context = ThreadScopeContextHolder.getContext(); Object result = context.getBean(name); if (null == result) { result = factory.getObject(); context.setBean(name, result); } return result; }
java
private static void loadDisabledAlgorithmsMap( final String propertyName) { String property = AccessController.doPrivileged( new PrivilegedAction<String>() { public String run() { return Security.getProperty(propertyName); } ...
java
public final void variableDeclarators() throws RecognitionException { int variableDeclarators_StartIndex = input.index(); try { if ( state.backtracking>0 && alreadyParsedRule(input, 38) ) { return; } // src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:451:5: ( variableDeclarator ( ',' var...
java
public List<String> attrNames() { String[] names = this._getAttrNames(); if (null != names && names.length != 0) { return Arrays.asList(names); } Method[] methods = this._getUsefulClass().getMethods(); String methodName; List<String> attrs = new ArrayList<String>(); for (Method method : methods) { m...
python
def validate_arg(f, arg_name, *validation_func, # type: ValidationFuncs **kwargs ): # type: (...) -> Callable """ A decorator to apply function input validation for the given argument name, with the provided base validation function(s)...
python
def uninstalled(name): ''' Ensure an update is uninstalled from the minion Args: name(str): Name of the Windows KB ("KB123456") Example: .. code-block:: yaml KB123456: wusa.uninstalled ''' ret = {'name': name, 'changes': {}, 'r...
python
def connect_sqs(aws_access_key_id=None, aws_secret_access_key=None, **kwargs): """ :type aws_access_key_id: string :param aws_access_key_id: Your AWS Access Key ID :type aws_secret_access_key: string :param aws_secret_access_key: Your AWS Secret Access Key :rtype: :class:`boto.sqs.connection.S...
python
def set_cli_options(config, arguments=None): """Set any configuration options which have a CLI value set. Args: config (confpy.core.config.Configuration): A configuration object which has been initialized with options. arguments (iter of str): An iterable of strings which contains t...
python
def acquire_filename(self, name): """Acquire a file name and return its id and its signature. """ id_ = self.__id_lut.get(name) # Is this a new entry? if id_ is None: # then create one... id_ = self.__next_id self.__next_id += 1 se...
python
def unhexlify(blob): """ Takes a hexlified script and turns it back into a string of Python code. """ lines = blob.split('\n')[1:] output = [] for line in lines: # Discard the address, length etc. and reverse the hexlification output.append(binascii.unhexlify(line[9:-2])) # C...