language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
public static int cusparseSgemvi( cusparseHandle handle, int transA, int m, int n, Pointer alpha, /** host or device pointer */ Pointer A, int lda, int nnz, Pointer xVal, Pointer xInd, Pointer beta, /** host or d...
python
def get_entry_by_filter(filename, filter_function, ignore_fields=None): """ Get an entry from a BibTeX file. .. note :: Returns the first matching entry. :param filename: The name of the BibTeX file. :param filter_function: A function returning ``True`` or ``False`` \ whether ...
python
def ajModeles(self): """ Lecture des modèles, et enregistrement de leurs désinences """ sl = [] lines = [line for line in lignesFichier(self.path("modeles.la"))] max = len(lines) - 1 for i, l in enumerate(lines): if l.startswith('$'): varname, ...
java
public static synchronized void unregisterDao(ConnectionSource connectionSource, Dao<?, ?> dao) { if (connectionSource == null) { throw new IllegalArgumentException("connectionSource argument cannot be null"); } removeDaoToClassMap(new ClassConnectionSource(connectionSource, dao.getDataClass())); }
python
def set_header(self, port, channel): """ Set the port and channel for this packet. """ self._port = port self.channel = channel self._update_header()
python
def _csv_temp(self, cursor, fieldnames): """Writes the rows of `cursor` in CSV format to a temporary file and returns the path to that file. :param cursor: database cursor containing data to be output :type cursor: `sqlite3.Cursor` :param fieldnames: row headings :type f...
python
def convertPromises(kwargs): """ Returns True if reserved resource keyword is a Promise or PromisedRequirement instance. Converts Promise instance to PromisedRequirement. :param kwargs: function keyword arguments :return: bool """ for r in ["disk", "memor...
java
public int[] toIntArray (int[] target, int offset) { System.arraycopy(_values, 0, target, offset, _size); return target; }
python
def get_nearest_edge(G, point): """ Return the nearest edge to a pair of coordinates. Pass in a graph and a tuple with the coordinates. We first get all the edges in the graph. Secondly we compute the euclidean distance from the coordinates to the segments determined by each edge. The last step is t...
python
def draw(self): """ Renders the classification report; must be called after score. """ # Perform display related manipulations on the confusion matrix data cm_display = self.confusion_matrix_ # Convert confusion matrix to percent of each row, i.e. the # predicte...
java
@SuppressWarnings("unchecked") public STMT columnWithCurrentTimestamp(final String _columnName) { this.columnWithSQLValues.add( new AbstractSQLInsertUpdate.ColumnWithSQLValue(_columnName, Context.getDbType().getCurrentTimeSta...
python
def left(self): """ Entry is left sibling of current directory entry """ return self.source.directory[self.left_sibling_id] \ if self.left_sibling_id != NOSTREAM else None
python
def decode(encoded_histogram, b64_wrap=True): '''Decode an encoded histogram and return a new histogram instance that has been initialized with the decoded content Return: a new histogram instance representing the decoded content Exception: TypeError in case of ba...
python
def iMath(image, operation, *args): """ Perform various (often mathematical) operations on the input image/s. Additional parameters should be specific for each operation. See the the full iMath in ANTs, on which this function is based. ANTsR function: `iMath` Arguments --------- image ...
python
def expire(self, keyid, expiration_time='1y', passphrase=None, expire_subkeys=True): """Changes GnuPG key expiration by passing in new time period (from now) through subprocess's stdin >>> import gnupg >>> gpg = gnupg.GPG(homedir="doctests") >>> key_input = gpg.gen_key_input...
java
public void marshall(ChildWorkflowExecutionFailedEventAttributes childWorkflowExecutionFailedEventAttributes, ProtocolMarshaller protocolMarshaller) { if (childWorkflowExecutionFailedEventAttributes == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } ...
java
protected IJettyConfiguration getInitializedConfiguration() throws JettyBootstrapException { if (!isInitializedConfiguration) { LOG.debug("Init Configuration..."); LOG.trace("Check Temp Directory..."); if (iJettyConfiguration.getTempDirectory() == null) { iJe...
python
async def put_annotations(self, annotation): """ PUT /api/annotations/{annotation}.{_format} Updates an annotation. :param annotation \w+ string The annotation ID Will returns annotation for this entry :return data related to the ext """ params = {'a...
python
def get_description_type(path=PKG_DESCRIBE): """ Returns the long_description_content_type based on the extension of the package describe path (e.g. .txt, .rst, or .md). """ _, ext = os.path.splitext(path) return { ".rst": "text/x-rst", ".txt": "text/plain", ".md": "text/...
python
def add_route(enode, route, via, shell=None): """ Add a new static route. :param enode: Engine node to communicate with. :type enode: topology.platforms.base.BaseNode :param str route: Route to add, an IP in the form ``'192.168.20.20/24'`` or ``'2001::0/24'`` or ``'default'``. :param str v...
java
public void clearCounts() { myReadCount.set(0L); myUpdateCount.set(0L); myCreateCount.set(0L); myDeleteCount.set(0L); mySearchCount.set(0L); }
python
def importobject(module_name, object_name): """ Imports the object with the given name from the inputted module. :param module_name | <str> object_name | <str> :usage |>>> import projex |>>> modname = 'projex.envmanager' |>>> attr = 'En...
python
def pick_q_v1(self): """Update inflow.""" sta = self.sequences.states.fastaccess inl = self.sequences.inlets.fastaccess sta.qz = 0. for idx in range(inl.len_q): sta.qz += inl.q[idx][0]
java
@Nonnull public StringComparator naturalStringComparator(final SimpleExtraction simpleExtraction) { Preconditions.checkNotNull(simpleExtraction, "simpleExtraction"); if (simpleExtraction.getExtractionFn() != null || getColumnType(simpleExtraction.getColumn()) == ValueType.STRING) { return Stri...
python
def get_value_hash_txids(self, value_hash): """ Get the list of txids by value hash """ cur = self.db.cursor() return namedb_get_value_hash_txids(cur, value_hash)
python
def browsers(self, browser=None, browser_version=None, device=None, os=None, os_version=None): """ Returns list of available browsers & OS. """ response = self.execute('GET', '/screenshots/browsers.json') for key, value in list(locals().items()): if key in ('self', 'r...
java
private void getConfigProperties(Map<String, Object> configProps, Properties properties, String elementName) { Set<Entry<String, Object>> entries = configProps.entrySet(); for (Entry<String, Object> entry : entries) { String key = entry.getKey(); if (TraceComponent.isAnyTracingEn...
python
def shrink(self): """ Calculate the Constant-Correlation covariance matrix. :return: shrunk sample covariance matrix :rtype: np.ndarray """ x = np.nan_to_num(self.X.values) # de-mean returns t, n = np.shape(x) meanx = x.mean(axis=0) x = x...
python
def set_angle_limit(self, limit_for_id, **kwargs): """ Sets the angle limit to the specified motors. """ convert = kwargs['convert'] if 'convert' in kwargs else self._convert if 'wheel' in self.get_control_mode(limit_for_id.keys()): raise ValueError('can not change the angle limit o...
python
def contains(self, key, counter_id): """ Return whether a counter_id is present for a given instance key. If the key is not in the cache, raises a KeyError. """ with self._lock: return counter_id in self._metadata[key]
java
@Override public MtasSpanQuery rewrite(IndexReader reader) throws IOException { MtasSpanQuery newQ = subQuery.rewrite(reader); if (newQ == null) { newQ = new MtasSpanMatchNoneQuery(subQuery.getField()); return new MtasDisabledTwoPhaseIteratorSpanQuery(newQ); } else { newQ.disableTwoPhase...
python
def next(self, rows: List[Row]) -> List[Row]: """ Takes an expression that evaluates to a single row, and returns the row that occurs after the input row in the original set of rows. If the input row happens to be the last row, we will return an empty list. """ if not row...
java
@Override public StreamT<W,T> slice(final long from, final long to) { return (StreamT<W,T>) FoldableTransformerSeq.super.slice(from, to); }
java
public long rowsWithNa() { if( _rowsWithNa!=-1 ) return _rowsWithNa; String x = String.format("(na.omit %s)", _fr._key); Val res = Rapids.exec(x); Frame f = res.getFrame(); long cnt = _fr.numRows() - f.numRows(); f.delete(); return (_rowsWithNa=cnt); }
java
public static int cudaHostGetDevicePointer(Pointer pDevice, Pointer pHost, int flags) { return checkResult(cudaHostGetDevicePointerNative(pDevice, pHost, flags)); }
java
public synchronized boolean changeParent(int depStreamID, int newPriority, int newParentStreamID, boolean exclusive) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "changeParent entry: depStreamID: " + depStreamID + " newParentStreamID: " + newParentStreamID + " e...
python
def put_secret(self, secure_data_path, secret, merge=True): """Write secret(s) to a secure data path provided a dictionary of key/values Keyword arguments: secure_data_path -- full path in the safety deposit box that contains the key secret -- A dictionary containing key/values to be wr...
python
async def _sasl_end(self): """ Finalize SASL authentication. """ if self._sasl_timer: self._sasl_timer.cancel() self._sasl_timer = None await self._capability_negotiated('sasl')
java
@Override public String toJson(Object obj) { try { String json; if (obj == null) { json = null; } else { json = mapper.writeValueAsString(obj); } return json; } catch (Exception e) { throw new JsonException(e.getMessage(), e); } }
python
def _getDeltas(self, firstSub, secondSub): """Arguments must have "start" and "end" properties which are FrameTimes.""" startDelta = max(firstSub.start, secondSub.start) - min(firstSub.start, secondSub.start) endDelta = max(firstSub.end, secondSub.end) - min(firstSub.end, secondSub.end) ...
python
def get_state(self, as_str=False): """Returns user state. See ``UserState``. :param bool as_str: Return human-friendly state name instead of an ID. :rtype: int|str """ uid = self.user_id if self._iface_user.get_id() == uid: result = self._iface.get_my_state...
python
def get_amqp_message_by_unit(self, sentry_unit, queue="test", username="testuser1", password="changeme", ssl=False, port=None): """Get an amqp message from a rmq juju unit. :param sentry_unit: sentry unit...
java
AttributedCharacterIterator createAttributedCharacterIterator( String string, AttributedCharacterIterator.Attribute key, Object value) { AttributedString as = new AttributedString(string); as.addAttribute(key, value); return as.getIterator(); }
java
public void initializeResources(final List<String> packageNames) throws ClassNotFoundException, IOException, URISyntaxException { for (final String packageName : packageNames) { initializeResources(packageName); } }
python
def c_time_locale(): """Context manager with C LC_TIME locale""" old_time_locale = locale.getlocale(locale.LC_TIME) locale.setlocale(locale.LC_TIME, 'C') yield locale.setlocale(locale.LC_TIME, old_time_locale)
python
def from_text_file(file_path): """Load MonsoonData objects from a text file generated by MonsoonData.save_to_text_file. Args: file_path: The full path of the file load from, including the file name. Returns: A list of MonsoonData objects. ...
python
def set_from_tree(root:str, graph:dict) -> frozenset: """Return a recursive structure describing given tree""" Node = namedtuple('Node', 'id succs') succs = graph[root] if succs: return (len(succs), sorted(tuple(set_from_tree(succ, graph) for succ in succs))) else: return 0, ()
python
def unitResponse(self,band): """This is used internally for :ref:`pysynphot-formula-effstim` calculations.""" #sumfilt(wave,-1,band) # SUMFILT = Sum [ FILT(I) * WAVE(I) ** NPOW * DWAVE(I) ] wave=band.wave total = band.trapezoidIntegration(wave,band.throughput/wave) ...
java
private void setNoRealPOStag() { boolean hasNoPOStag = !isLinebreak(); for (AnalyzedToken an: anTokReadings) { String posTag = an.getPOSTag(); if (PARAGRAPH_END_TAGNAME.equals(posTag) || SENTENCE_END_TAGNAME.equals(posTag)) { continue; } if (posTag != null) { ha...
python
def render_to_texture(self, data, texture, offset, size): """Render a SDF to a texture at a given offset and size Parameters ---------- data : array Must be 2D with type np.ubyte. texture : instance of Texture2D The texture to render to. offset : ...
python
def insert(self, parent, index, iid=None, **kw): """ Creates a new item and return the item identifier of the newly created item. :param parent: identifier of the parent item :type parent: str :param index: where in the list of parent's children to insert the new item ...
java
public void accumulate(CollectListData data, Object value) { CollectListData.MutableInt counter = data.map.get( value ); if( counter == null ) { counter = new CollectListData.MutableInt(); data.map.put( value, counter ); } counter.value+...
python
def patch_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, body, **kwargs): """ partially update status of the specified HorizontalPodAutoscaler This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True ...
python
def send(self, command): "Send rcon command to server" if self.secure_rcon == self.RCON_NOSECURE: self.sock.send(rcon_nosecure_packet(self.password, command)) elif self.secure_rcon == self.RCON_SECURE_TIME: self.sock.send(rcon_secure_time_packet(self.password, command)) ...
java
public synchronized void addServletReferenceListener(ServletReferenceListener listener) { if (this.cacheWrappers == null) { cacheWrappers = new ArrayList(); } this.cacheWrappers.add(listener); }
java
private void handleIdOverride(Class<?> resourceClass, List<ResourceField> fields) { List<ResourceField> idFields = fields.stream() .filter(field -> field.getResourceFieldType() == ResourceFieldType.ID) .collect(Collectors.toList()); if (idFields.size() == 2) { ...
python
def delete(self, path): """Call the Infoblox device to delete the ref :param str ref: The reference id :rtype: requests.Response """ return self.session.delete(self._request_url(path), auth=self.auth, verify=False)
java
public static List<FlatRow> toRows(Iterable<ReadRowsResponse> responses) { final ArrayList<FlatRow> result = new ArrayList<>(); RowMerger rowMerger = new RowMerger(new StreamObserver<FlatRow>() { @Override public void onNext(FlatRow value) { result.add(value); } @Override ...
python
def constant_propagation(block, silence_unexpected_net_warnings=False): """ Removes excess constants in the block. Note on resulting block: The output of the block can have wirevectors that are driven but not listened to. This is to be expected. These are to be removed by the _remove_unlistened_net...
python
def _get_reflectance(self, projectables, optional_datasets): """Calculate 3.x reflectance with pyspectral.""" _nir, _tb11 = projectables LOG.info('Getting reflective part of %s', _nir.attrs['name']) sun_zenith = None tb13_4 = None for dataset in optional_datasets: ...
java
private double[][] expd(double[][] D, double perplexity, double tol) { int n = D.length; double[][] P = new double[n][n]; double[] DiSum = Math.rowSums(D); int nprocs = MulticoreExecutor.getThreadPoolSize(); int chunk = n / nprocs; List<PerplexityTask> tasks =...
java
protected void acceptDynamicProperty(Postcard postcard, String bodyFile, boolean filesystem, OptionalThing<Locale> receiverLocale, Object dynamicData) { if (dynamicTextAssist == null) { // no way, just in case return; } final SMailDynamicPropResource resource = new SMailD...
python
def _find_tpls(self, name): """ Return plain, html templates for NAME Arguments: - `name`: str Return: tuple Exceptions: None """ return self._find_tpl(name, extension='.txt'), self._find_tpl(name, extension='.html')
python
def csv_to_list(csv_file, delimiter=','): """ Reads in a CSV file and returns the contents as list, where every row is stored as a sublist, and each element in the sublist represents 1 cell in the table. """ with open_csv(csv_file) as csv_con: if len(delimiter) > 1: dialect =...
java
private boolean isTrivialStackOps() { int invokeCount = 0; for (ActiveStackOp op : activeStackOps) { if (INVOKE_OPS.get(op.getOpcode())) { invokeCount++; } } if (invokeCount == 1) { FQMethod method = activeStackOps.getLast().getMethod...
java
@Override public void clear() { if (bean == null) { return; } try { bean = beanClass.newInstance(); } catch (Exception e) { throw new UnsupportedOperationException("Could not create new instance of class: " + beanClass); } }
java
@Override public boolean canRetry(RetryContext context) { Throwable candidate = context.getLastThrowable(); if (candidate == null) { return true; } return context.getRetryCount() <= this.maxNumberOfRetries && isRetryAbleException(candidate); }
python
def from_tgt(ksoc, tgt, key): """ Sets up the kerberos object from tgt and the session key. Use this function when pulling the TGT from ccache file. """ kc = KerbrosComm(None, ksoc) kc.kerberos_TGT = tgt kc.kerberos_cipher_type = key['keytype'] kc.kerberos_session_key = Key(kc.kerberos_cipher_type, k...
java
public AstNode getChildforNameAndType( AstNode astNode, String name, String nodeType ) { CheckArg.isNotNull(astNode, "astNode"); CheckArg.isNotNull(name, "name"); CheckArg.isNotNull(nodeType, "nodeType"); ...
python
def collect_filters_to_first_location_occurrence(compound_match_query): """Collect all filters for a particular location to the first instance of the location. Adding edge field non-exsistence filters in `_prune_traverse_using_omitted_locations` may result in filters being applied to locations after their ...
java
public EList<JvmTypeReference> getParamTypes() { if (paramTypes == null) { paramTypes = new EObjectContainmentEList<JvmTypeReference>(JvmTypeReference.class, this, XtypePackage.XFUNCTION_TYPE_REF__PARAM_TYPES); } return paramTypes; }
java
public void setMemberClusters(java.util.Collection<String> memberClusters) { if (memberClusters == null) { this.memberClusters = null; return; } this.memberClusters = new com.amazonaws.internal.SdkInternalList<String>(memberClusters); }
java
public static void deserializeToField(final Object containingObject, final String fieldName, final String json, final ClassFieldCache classFieldCache) throws IllegalArgumentException { if (containingObject == null) { throw new IllegalArgumentException("Cannot deserialize to a field of a ...
python
def add_resize_bilinear(self, name, input_name, output_name, target_height=1, target_width=1, mode='ALIGN_ENDPOINTS_MODE'): """ Add resize bilinear layer to the model. A layer that resizes the input to a given spatial size using bilinear interpolation. Parameters ...
python
def branchScale(self): """See docs for `Model` abstract base class.""" bs = -(self.Phi_x * scipy.diagonal(self.Pxy[0])).sum() * self.mu assert bs > 0 return bs
python
def from_api_repr(cls, resource, client): """Factory: construct a sink given its API representation :type resource: dict :param resource: sink resource representation returned from the API :type client: :class:`google.cloud.logging.client.Client` :param client: Client which ho...
java
public IfcPropertySourceEnum createIfcPropertySourceEnumFromString(EDataType eDataType, String initialValue) { IfcPropertySourceEnum result = IfcPropertySourceEnum.get(initialValue); if (result == null) throw new IllegalArgumentException( "The value '" + initialValue + "' is not a valid enumerator of '"...
python
def _compute_shallow_site_response(self, C, sites, pga1100): """ Returns the shallow site response term (equation 11, page 146) """ stiff_factor = C['c10'] + (C['k2'] * C['n']) # Initially default all sites to intermediate rock value fsite = stiff_factor * np.log(sites.vs...
java
public static String relativePathFromResourceId(String id) { if (id == null) { return null; } String[] paths = id.split("/providers/" + resourceProviderFromResourceId(id) + "/", 2); if (paths.length == 1) { return ""; } else { return paths[1]; ...
python
def _archive_entry_year(self, category): " Return ARCHIVE_ENTRY_YEAR from settings (if exists) or year of the newest object in category " year = getattr(settings, 'ARCHIVE_ENTRY_YEAR', None) if not year: n = now() try: year = Listing.objects.filter( ...
python
def calibrate_counts(array, attributes, index): """Calibration for counts channels.""" offset = np.float32(attributes["corrected_counts_offsets"][index]) scale = np.float32(attributes["corrected_counts_scales"][index]) array = (array - offset) * scale return array
java
public static void destroyed(String appid,String... types){ for(String type : types){ String key = appid + KEY_JOIN + type; if(futureMap.containsKey(key)){ futureMap.get(key).cancel(true); logger.info("destroyed appid:{} type:{}",appid,type); } } }
java
private static void inlineImgNodes(final Document doc, final String basePath) { // handle null inputs if (doc == null) return; final String fixedBasePath = basePath == null ? "" : basePath; final List<Node> imageNodes = XMLUtilities.getChildNodes(doc.getDocumentElement(), "img"); ...
java
public static <T extends ImageGray<T>> void naiveGradient(T ii, double tl_x, double tl_y, double samplePeriod , int regionSize, double kernelSize, boolean useHaar, double[] derivX, double derivY[]) { SparseScaleGradient<T,?> gg = SurfDescribeOps.createGradient(useHaar,(Class<T>)ii.getClass()); gg...
java
private long murmur(ByteBuffer data) { int offset = data.position(); int length = data.remaining(); int nblocks = length >> 4; // Process as 128-bit blocks. long h1 = 0; long h2 = 0; long c1 = 0x87c37b91114253d5L; long c2 = 0x4cf5ad432745937fL; // ---------- // body for (int...
python
def most_energetic(df): """Grab most energetic particle from mc_tracks dataframe.""" idx = df.groupby(['event_id'])['energy'].transform(max) == df['energy'] return df[idx].reindex()
python
def _parse_current_member(self, previous_rank, values): """ Parses the column texts of a member row into a member dictionary. Parameters ---------- previous_rank: :class:`dict`[int, str] The last rank present in the rows. values: tuple[:class:`str`] ...
java
private void text(Attributes attributes) throws SVGParseException { debug("<text>"); if (currentElement == null) throw new SVGParseException("Invalid document. Root element must be <svg>"); SVG.Text obj = new SVG.Text(); obj.document = svgDocument; obj.parent = curre...
java
public static JavaRDD<Row> createJavaRowRDD(JavaRDD<Cells> cellsRDD) throws UnsupportedDataTypeException { JavaRDD<Row> result = cellsRDD.map(new Function<Cells, Row>() { @Override public Row call(Cells cells) throws Exception { return CellsUtils.getRowFromCells(cells); ...
python
def RowWith(self, column, value): """Retrieves the first non header row with the column of the given value. Args: column: str, the name of the column to check. value: str, The value of the column to check. Returns: A Row() of the first row found, None otherwise. Raises: In...
python
def _handle_error_response(response_body): """"Translates an error response into an exception. Args: response_body (str): The decoded response data. Raises: google.auth.exceptions.RefreshError """ try: error_data = json.loads(response_body) error_details = '{}: {}'....
java
@Override public void close() throws SQLException { if (queryExecutor == null) { // This might happen in case constructor throws an exception (e.g. host being not available). // When that happens the connection is still registered in the finalizer queue, so it gets finalized return; } re...
python
def _setup_no_fallback(parser): """Add the option, --tox-pyenv-no-fallback. If this option is set, do not allow fallback to tox's built-in strategy for looking up python executables if the call to `pyenv which` by this plugin fails. This will allow the error to raise instead of falling back to tox'...
java
public static Tracker create(Map<String, Object> params) throws EasyPostException { return create(params, null); }
java
public static void main(String[] args) { for (int i = 0; i < args.length; i++) System.out.println("'" + args[i] + "' becomes '" + obfuscate(args[i]) + "'"); } /** * Takes a string and returns an obfuscated string with no more than 2x a many characters as the * original. Only works in the DEV...
java
@SuppressWarnings("unchecked") public void event(Kernel kernel, Event event) { if (event == Event.POST_CLASSLOADER) { try { Class<?> clz = Class.forName("org.jboss.logmanager.log4j.BridgeRepositorySelector", true, ...
java
public void marshall(FrameCaptureOutputSettings frameCaptureOutputSettings, ProtocolMarshaller protocolMarshaller) { if (frameCaptureOutputSettings == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(f...
python
def _add_rel(self, key, rel, thing, wrap): """Adds ``thing`` to links or embedded resources. Calling code should not use this method directly and should use ``embed`` or ``add_link`` instead. """ self.o.setdefault(key, {}) if wrap: self.o[key].setdefault(re...
java
static int addTracingStatistic(TracingStatistic tracingStatistic) { // Check to see if we can enable the tracing statistic before actually // adding it. if (tracingStatistic.enable()) { // No synchronization needed, since this is a copy-on-write array. extraTracingStatistics.add(tracingStatistic...
python
def finalize_backreferences(seen_backrefs, gallery_conf): """Replace backref files only if necessary.""" logger = sphinx_compatibility.getLogger('sphinx-gallery') if gallery_conf['backreferences_dir'] is None: return for backref in seen_backrefs: path = os.path.join(gallery_conf['src_di...