language
stringclasses
2 values
func_code_string
stringlengths
63
466k
python
def value(self, observation, input_actions=None): """ Calculate value for given state """ action, value = self(observation, input_actions) return value
python
def drop_table(self, table_name, database=None, force=False): """ Drop an MapD table Parameters ---------- table_name : string database : string, default None (optional) force : boolean, default False Database may throw exception if table does not exist...
python
def factory(cls, endpoint, timeout, *args, **kwargs): """ A factory function which returns connections which have succeeded in connecting and are ready for service (or raises an exception otherwise). """ start = time.time() kwargs['connect_timeout'] = timeout ...
python
def support_autoupload_param_hostip(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") support = ET.SubElement(config, "support", xmlns="urn:brocade.com:mgmt:brocade-ras") autoupload_param = ET.SubElement(support, "autoupload-param") hostip = ET.Sub...
python
def _get_total_services_not_monitored(self): """ Get the number of service not monitored (active and passive checks disabled) :return: Number of services which are not monitored :rtype: int """ return sum(1 for s in self.services if not s.active_checks_enabled and ...
python
def setDragData(self, format, value): """ Sets the drag information that is associated with this tree widget item for the given format. :param format | <str> value | <variant> """ if value is None: self._dragData.pop...
java
protected ObjectMapper configure(ObjectMapper mapper) { mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true); mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); return mapper; }
python
def on_timer(self, event): """Timer event handler Parameters ---------- event : instance of Event The event. """ # Set relative speed and acceleration rel_speed = event.dt rel_acc = 0.1 # Get what's forward pf, pr, pl, pu = s...
java
public ServiceFuture<ImageCreateSummary> createImagesFromFilesAsync(UUID projectId, ImageFileCreateBatch batch, final ServiceCallback<ImageCreateSummary> serviceCallback) { return ServiceFuture.fromResponse(createImagesFromFilesWithServiceResponseAsync(projectId, batch), serviceCallback); }
java
public int compare(ByteBuffer o1, ByteBuffer o2) { if (!o1.hasRemaining() || !o2.hasRemaining()) return o1.hasRemaining() ? 1 : o2.hasRemaining() ? -1 : 0; // False is 0, True is anything else, makes False sort before True. byte b1 = o1.get(o1.position()); byte b2 = o2.g...
python
def build_response(headers: Headers, key: str) -> None: """ Build a handshake response to send to the client. ``key`` comes from :func:`check_request`. """ headers["Upgrade"] = "websocket" headers["Connection"] = "Upgrade" headers["Sec-WebSocket-Accept"] = accept(key)
python
def looking_for_friends(self): '''Look for friends to drink with''' self.info('I am looking for friends') available_friends = list(self.get_agents(drunk=False, pub=None, state_id=self.looking_for_fr...
java
protected DataStore<byte[], byte[]> createDataStore(File homeDir, int initialCapacity) throws Exception { StoreConfig config = new StoreConfig(homeDir, initialCapacity); config.setSegmentFactory(new MemorySegmentFactory()); config.setSegmentFileSizeMB(64); return StoreFactory.cr...
python
def get_mentions(self, message): """ Remove duplicates in a case-insensitive way while preserving the original order Return all mentions in lower case *without* their prefixes. (So return ['clyde'], not ['@clyde']) >>> BaseBot().get_mentions("This is a @user") ['user'] >>> Ba...
java
public BackupChain findBackup(String backupId) { Iterator<BackupChain> it = currentBackups.iterator(); while (it.hasNext()) { BackupChain chain = it.next(); if (backupId.equals(chain.getBackupId())) { return chain; } } return null; }
java
public static <R> short readShort(ByteAccessStrategy<R> strategy, R resource, long offset, boolean useBigEndian) { return useBigEndian ? readShortB(strategy, resource, offset) : readShortL(strategy, resource, offset); }
python
def _init_map(self): """call these all manually because non-cooperative""" DecimalValuesFormRecord._init_map(self) IntegerValuesFormRecord._init_map(self) TextAnswerFormRecord._init_map(self) FilesAnswerFormRecord._init_map(self) FeedbackAnswerFormRecord._init_map(self) ...
java
@Override public void removeBySent(boolean sent) { for (CommerceNotificationQueueEntry commerceNotificationQueueEntry : findBySent( sent, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceNotificationQueueEntry); } }
python
def append(self, new_leaf: bytes) -> List[bytes]: """Append a new leaf onto the end of this tree and return the audit path""" auditPath = list(reversed(self.__hashes)) self._push_subtree([new_leaf]) return auditPath
python
def devices(self): """Manages users enrolled u2f devices""" self.verify_integrity() if session.get('u2f_device_management_authorized', False): if request.method == 'GET': return jsonify(self.get_devices()), 200 elif request.method == 'DELETE': ...
python
def restore(self): """Restore snapshotted state.""" if not self._snapshot: return yield from self.set_name(self._snapshot['name']) yield from self.set_volume(self._snapshot['volume']) yield from self.set_muted(self._snapshot['muted']) yield from self.set_laten...
java
public ChartConfiguration<T> setLabelX(String label) { if (label != null) { axesInstance().xAxisInstance().setLabel(label); } return this; }
python
def get_question_form_for_update(self, question_id): """Gets the question form for updating an existing question. A new question form should be requested for each update transaction. arg: question_id (osid.id.Id): the ``Id`` of the ``Question`` return: (osid.assessment.Quest...
java
public GeometryIndex parse(String id) throws GeometryIndexNotFoundException { try { GeometryIndex index = parseRecursive(id.toLowerCase()); if (index == null) { throw new GeometryIndexNotFoundException("Could not parse '" + id + "' as a GeometryIndex."); } return index; } catch (GeometryIndexNotFoun...
python
def _find_executables(self): """Finds the list of executables that pass the requirements necessary to have a wrapper created for them. """ if len(self.needs) > 0: return for execname, executable in list(self.module.executables.items()): skip = Fal...
java
public static int[] parseSequence(CharSequence sequenceDef) { // Match the sequence definition against the regular expression for sequences. Matcher matcher = SEQUENCE_PATTERN.matcher(sequenceDef); // Check that the argument is of the right format accepted by this method. if (!match...
python
def get_total_per_atom_sasa(self): """Return average SASA of the atoms.""" total_sasa = defaultdict(int) for traj in range(len(self.atom_sasa)): for atom in self.atom_sasa[traj]: total_sasa[atom]+=float(sum((self.atom_sasa[traj][atom])))/len(self.atom_sasa[traj][atom]) for atom in total_sasa: total_sa...
java
public static Object invokeMethod(final Object obj, final String methodName, final Object[] params, final Class[] paramTypes) { Object res = null; try { Class cls = obj.getClass(); Method method = cls.getMethod(methodName, paramTypes); res = method.invoke(obj, params); } catch (SecurityException e) {...
python
def run_trial(self, trial_id=0): """Run a single trial of the simulation Parameters ---------- trial_id : int """ # Set-up trial environment and graph self.env = NetworkEnvironment(self.G.copy(), initial_time=0, **self.environment_params) # self.G = self....
python
def convert_custom(net, node, module, builder): """Convert highly specific ops""" input_name, output_name = _get_input_output_name(net, node) name = node['name'] param = _get_attr(node) if param['op_type'] == 'special-darknet-maxpool': _add_pooling.add_pooling_with_padding_types( ...
java
public OvhNewMessageInfo tickets_create_POST(String body, OvhTicketCategoryEnum category, OvhTicketProductEnum product, String serviceName, OvhTicketSubCategoryEnum subcategory, String subject, OvhTicketTypeEnum type) throws IOException { String qPath = "/support/tickets/create"; StringBuilder sb = path(qPath); H...
java
static SecretKeySpec readSecretKey(DecryptionSetup ds) { Keyed<?> ksObject = DKV.getGet(ds._keystore_id); ByteVec ksVec = (ByteVec) (ksObject instanceof Frame ? ((Frame) ksObject).vec(0) : ksObject); InputStream ksStream = ksVec.openStream(null /*job key*/); try { KeyStore keystore = KeyStore.getI...
python
def listRoles(self, *args, **kwargs): """ List Roles Get a list of all roles, each role object also includes the list of scopes it expands to. This method gives output: ``v1/list-roles-response.json#`` This method is ``stable`` """ return self._makeApi...
java
public static long nextPowerOfTwo(long x) { if (x == 0L) { return 1L; } else { --x; x |= x >> 1; x |= x >> 2; x |= x >> 4; x |= x >> 8; x |= x >> 16; return (x | x >> 32) + 1L; } }
java
@GET @Produces(MediaType.APPLICATION_JSON) @Path("/{batchId}") @Description("Return a batch query's status and results if done") public Response getBatchById(@Context HttpServletRequest req, @PathParam("batchId") String batchId) { _validateBatchId(batchId); ...
python
def convert_to_uri(self, value, strip_iri=True): ''' converts a prefixed rdf ns equivalent value to its uri form. If not found returns the value as is args: value: the URI/IRI to convert strip_iri: removes the < and > signs rdflib_uri: ret...
python
def parse(stream, with_text=False): # type: (Iterator[str], bool) -> Iterator[Union[Tuple[str, LexicalUnit], LexicalUnit]] """Generates lexical units from a character stream. Args: stream (Iterator[str]): A character stream containing lexical units, superblanks and other text. with_text (Optio...
java
public final Iterable<ObjectType> getImplicitPrototypeChain() { final ObjectType self = this; return () -> new AbstractIterator<ObjectType>() { private ObjectType next = self; // We increment past this type before first access. @Override public ObjectType computeNext() {...
java
public ServiceFuture<DetectorResponseInner> getSiteDetectorResponseAsync(String resourceGroupName, String siteName, String detectorName, final ServiceCallback<DetectorResponseInner> serviceCallback) { return ServiceFuture.fromResponse(getSiteDetectorResponseWithServiceResponseAsync(resourceGroupName, siteName, ...
python
def GetPathSegmentAndSuffix(self, base_path, path): """Determines the path segment and suffix of the path. None is returned if the path does not start with the base path and an empty string if the path exactly matches the base path. Args: base_path (str): base path. path (str): path. ...
java
public static TypeDescriptor map(Class<?> mapType, TypeDescriptor keyTypeDescriptor, TypeDescriptor valueTypeDescriptor) { if (!Map.class.isAssignableFrom(mapType)) { throw new IllegalArgumentException("mapType must be a java.util.Map"); } return new TypeDescriptor(mapType, keyTypeDescriptor, valueTypeDescript...
python
def device_add_rule(self, direction, action, src, dst, target=None): """Adds a tuntap device rule. To be used in a vassal. :param str|unicode direction: Direction: * in * out. :param str|unicode action: Action: * allow * deny ...
python
def new_result(self, job): """ function to register finished runs Every time a run has finished, this function should be called to register it with the result logger. If overwritten, make sure to call this method from the base class to ensure proper l...
java
private void checkSunPKCS11Solaris() { Boolean o = AccessController.doPrivileged( new PrivilegedAction<Boolean>() { public Boolean run() { File file = new File("/usr/lib/libpkcs11.so"); if (file.exists() == false) { ...
java
public void init(CmsObject cms, Locale locale, List<CmsResource> content) { m_cms = cms; m_locale = locale; m_content = convertResourceList(m_cms, m_locale, content); }
java
private InputStream getDownloadedFile(String response) throws FMSException { if (response != null) { try { URL url = new URL(response); return url.openStream(); } catch (Exception e) { throw new FMSException("Exception while downloading the file from URL.", e); } } return null; }
java
public Mutations<S> combineWith(final Mutations<S> other) { IntArrayList result = new IntArrayList(mutations.length + other.mutations.length); //mut2 pointer int p2 = 0, position0 = 0, delta = 0; for (int p1 = 0; p1 < mutations.length; ++p1) { position0 = getPosition(mutat...
python
def element_wise_op(array, other, op, ty): """ Operation of series and other, element-wise (binary operator add) Args: array (WeldObject / Numpy.ndarray): Input array other (WeldObject / Numpy.ndarray): Second Input array op (str): Op string used to compute element-wise operation (+...
java
public static FieldDeclaration createFieldDeclaration(int modifiers, Type type, String name) { VariableDeclaratorId id = new VariableDeclaratorId(name); VariableDeclarator variable = new VariableDeclarator(id); return createFieldDeclaration(modifiers, type, variable); }
python
def hist(data, cmap='hot', alpha=220, colorscale='sqrt', binsize=16, show_tooltip=False, scalemin=0, scalemax=None, f_group=None, show_colorbar=True): """Create a 2D histogram :param data: data access object :param cmap: colormap name :param alpha: color alpha :param colorscale: scaling [l...
python
def remove_page(self, page_id, status=None, recursive=False): """ This method removes a page, if it has recursive flag, method removes including child pages :param page_id: :param status: OPTIONAL: type of page :param recursive: OPTIONAL: if True - will recursively delete all chi...
python
def filter_published(self, queryset): """Filter the given pages :class:`QuerySet` to obtain only published page.""" if settings.PAGE_USE_SITE_ID: queryset = queryset.filter(sites=global_settings.SITE_ID) queryset = queryset.filter(status=self.model.PUBLISHED) if set...
python
def noun_chunks(obj): """ Detect base noun phrases. Works on both Doc and Span. """ # It follows the logic of the noun chunks finder of English language, # adjusted to some Greek language special characteristics. # obj tag corrects some DEP tagger mistakes. # Further improvement of the model...
python
def shapeRecords(self): """Returns a list of combination geometry/attribute records for all records in a shapefile.""" return ShapeRecords([ShapeRecord(shape=rec[0], record=rec[1]) \ for rec in zip(self.shapes(), self.records())])
python
def visit_Call(self, node): """ Function calls are not handled for now. >>> import gast as ast >>> from pythran import passmanager, backend >>> node = ast.parse(''' ... def foo(): ... a = __builtin__.range(10)''') >>> pm = passmanager.PassManager("test") ...
java
public List<String> getSpannedWords() { if (isTerminal()) { return words; } else { List<String> words = Lists.newArrayList(); words.addAll(left.getSpannedWords()); words.addAll(right.getSpannedWords()); return words; } }
python
def extract_version(): """Extract the version from the package.""" with open('pdftools/__init__.py', 'r') as f: content = f.read() version_match = _version_re.search(content) version = str(ast.literal_eval(version_match.group(1))) return version
python
def warn( callingClass, astr_key, astr_extraMsg="" ): ''' Convenience dispatcher to the error_exit() method. Will raise "warning" error, i.e. script processing continues. ''' b_exitToOS = False report( callingClass, astr_key, b_exitToOS, astr_extraMsg )
python
def transform(self, X, y=None): """ Generate a set of multi-resolution ANTsImage types Arguments --------- X : ANTsImage image to transform y : ANTsImage (optional) another image to transform Example ------- >>> import an...
java
public static Object toObject(VectorTile.Tile.Value value) { Object result = null; if(value.hasDoubleValue()) { result = value.getDoubleValue(); } else if(value.hasFloatValue()) { result = value.getFloatValue(); } else if(value.hasIntValue()) { resu...
java
public static <T> T nullOf(Class<T> objClass) { Object result = NULL_CACHE.get(objClass); if (result == null) { synchronized (NULL_CACHE) { result = NULL_CACHE.get(objClass); if (result == null) { if (objClass.isArray()) { // arrays are special because we need to comp...
python
def get_upstream_causal_subgraph(graph, nbunch: Union[BaseEntity, Iterable[BaseEntity]]): """Induce a sub-graph from all of the upstream causal entities of the nodes in the nbunch. :type graph: pybel.BELGraph :rtype: pybel.BELGraph """ return get_subgraph_by_edge_filter(graph, build_upstream_edge_p...
python
def alert_policy_exists(self, policy_name): """Check to see if an alert policy exists in NewRelic. Return True if so, False if not""" if next((policy for policy in self.all_alerts if policy['name'] == policy_name), False): return True
python
def _map_arguments(self, args): """Map from the top-level arguments to the arguments provided to the indiviudal links """ data = args.get('data') comp = args.get('comp') ft1file = args.get('ft1file') scratch = args.get('scratch', None) dry_run = args.get('dry_run'...
python
def parseEvent(self, result, i): """Parse the current event and extract data.""" fmt = '%Y-%m-%dT%H:%M:%SZ' due = 0 delay = 0 real_time = 'n' number = result['stopEvents'][i]['transportation']['number'] planned = datetime.strptime(result['stopEvents'][i] ...
java
public static Transformer<MethodDescription> withModifiers(List<? extends ModifierContributor.ForMethod> modifierContributors) { return new ForMethod(new MethodModifierTransformer(ModifierContributor.Resolver.of(modifierContributors))); }
python
def write_int(self, number): """ Writes a integer to the underlying output file as a 4-byte value. """ buf = pack(self.byte_order + "i", number) self.write(buf)
python
def masked_within_block_local_attention_1d(q, k, v, block_length=64, name=None): """Attention to the source and a neighborhood to the left within a block. The sequence is divided into blocks of length block_length. Attention for a given query position can only see memory positions less than or equal to the que...
python
def decline(self, lemma, flatten=False, collatinus_dict=False): """ Decline a lemma .. warning:: POS are incomplete as we do not detect the type outside of verbs, participle and adjective. :raise UnknownLemma: When the lemma is unknown to our data :param lemma: Lemma (Canonical form) ...
python
def parse_md_code_options(options): """Parse 'python class key="value"' into [('python', None), ('class', None), ('key', 'value')]""" metadata = [] while options: name_and_value = re.split(r'[\s=]+', options, maxsplit=1) name = name_and_value[0] # Equal sign in between name and wha...
python
def backup(self, backup_name, folder_key=None, folder_name=None): """Copies the google spreadsheet to the backup_name and folder specified. Args: backup_name (str): The name of the backup document to create. folder_key (Optional) (str): The key of a folder that the n...
python
def doScript(self, script_name, params=None, return_all=False): """This function executes the script for given layout for the current db.""" request = [ uu({'-db': self._db }), uu({'-lay': self._layout }), uu({'-script': script_name}) ] if params: request.append(uu({'-script.param': params })) r...
java
public StringBuffer getRequestURL() { StringBuffer result = null; if(requestURL != null){ result = new StringBuffer(requestURL); } return result; }
java
public int sumConsumptions(Collection<VM> ids, boolean undef) { int s = 0; for (VM u: ids) { if (consumptionDefined(u) || undef) { s += vmsConsumption.get(u); } } return s; }
java
public String handleBooleanAnnotation(String annotation, Boolean value, String message, String validate) { if (!Boolean.TRUE.equals(value)) return ""; // if validate contains annotation, do nothing if (validate != null && validate.toLowerCase().matches(".*@" + annotation.toLowerCase() + ".*")) return ""; ...
java
public static ImmutableList<Integer> toCodepoints(final String s) { final ImmutableList.Builder<Integer> ret = ImmutableList.builder(); for (int offset = 0; offset < s.length();) { final int codePoint = s.codePointAt(offset); ret.add(codePoint); offset += Character.charCount(codePoint); } ...
python
def sortarai(self,datablock,s,Zdiff): """ sorts data block in to first_Z, first_I, etc. """ # print "calling sortarai()" first_Z,first_I,zptrm_check,ptrm_check,ptrm_tail=[],[],[],[],[] field,phi,theta="","","" starthere=0 Treat_I,Treat_Z,Treat_PZ,Treat_PI,...
python
def restrict(self, index_array): """Generate a view restricted to a subset of indices. """ new_shape = index_array.shape[0], index_array.shape[0] return OnFlySymMatrix(self.get_row, new_shape, DC_start=self.DC_start, DC_end=self.DC_end, ...
java
public UpdateBuilder<T, ID> updateColumnExpression(String columnName, String expression) throws SQLException { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new SQLException("Can't update foreign colletion field: " + columnName); } addUpdateColumnToList(colu...
java
@SuppressWarnings("serial") private Component createCloseButton() { Button closeBtn = CmsToolBar.createButton( FontOpenCms.CIRCLE_INV_CANCEL, m_messages.key(Messages.GUI_BUTTON_CANCEL_0)); closeBtn.addClickListener(new ClickListener() { public void buttonClick(C...
python
def _is_variant(self, gemini_variant, ind_objs): """Check if the variant is a variation in any of the individuals Args: gemini_variant (GeminiQueryRow): The gemini variant ind_objs (list(puzzle.models.individual)): A list of individuals to check Returns: boo...
java
public java.util.List<String> getLoadBalancerNames() { if (loadBalancerNames == null) { loadBalancerNames = new com.amazonaws.internal.SdkInternalList<String>(); } return loadBalancerNames; }
python
def save(self, *args, **kwargs): """Saves an animation A wrapper around :meth:`matplotlib.animation.Animation.save` """ self.timeline.index -= 1 # required for proper starting point for save self.animation.save(*args, **kwargs)
python
def __attr_name(self, name): """ Return suitable and valid attribute name. This method replaces dash char to underscore. If name is invalid ValueError exception is raised :param name: cookie attribute name :return: str """ if name not in self.cookie_attr_value_compliance.keys(): suggested_name = name.re...
python
def out_of_china(lng, lat): """ 判断是否在国内,不在国内不做偏移 :param lng: :param lat: :return: """ if lng < 72.004 or lng > 137.8347: return True if lat < 0.8293 or lat > 55.8271: return True return False
java
public java.util.Map<String, String> getFriday() { if (friday == null) { friday = new com.amazonaws.internal.SdkInternalMap<String, String>(); } return friday; }
java
public synchronized void updateAliases(CmsObject cms, Collection<CmsAlias> toDelete, Collection<CmsAlias> toAdd) throws CmsException { checkPermissionsForMassEdit(cms); Set<CmsUUID> allKeys = new HashSet<CmsUUID>(); Multimap<CmsUUID, CmsAlias> toDeleteMap = ArrayListMultimap.create(); ...
java
private void _registerDirRecursive (@Nonnull final Path aStartDir) throws IOException { // register directory and sub-directories Files.walkFileTree (aStartDir, new SimpleFileVisitor <Path> () { @Override public FileVisitResult preVisitDirectory (final Path dir, final BasicFileAttributes attrs...
python
def filter(self, value=None, model=None, context=None): """ Sequentially applies all the filters to provided value :param value: a value to filter :param model: parent entity :param context: filtering context, usually parent entity :return: filtered value """ ...
java
@XmlElementDecl(namespace = "http://schema.intuit.com/finance/v3", name = "Payment", substitutionHeadNamespace = "http://schema.intuit.com/finance/v3", substitutionHeadName = "IntuitObject") public JAXBElement<Payment> createPayment(Payment value) { return new JAXBElement<Payment>(_Payment_QNAME, Payment.cl...
java
public Entry createFolder(String path) { OAuthRequest request = new OAuthRequest(Verb.GET, FILE_OPS_CREATE_FOLDER_URL); request.addQuerystringParameter("root", "dropbox"); request.addQuerystringParameter("path", encode(path)); service.signRequest(accessToken, request); String co...
python
def DeleteClass(self, ClassName, namespace=None, **extra): # pylint: disable=invalid-name,line-too-long """ Delete a class. This method performs the DeleteClass operation (see :term:`DSP0200`). See :ref:`WBEM operations` for a list of all methods performing such operatio...
java
public FluoConfiguration setTransactionRollbackTime(long time, TimeUnit tu) { return setPositiveLong(TRANSACTION_ROLLBACK_TIME_PROP, tu.toMillis(time)); }
python
def installed(name, updates=None): ''' Ensure Microsoft Updates are installed. Updates will be downloaded if needed. Args: name (str): The identifier of a single update to install. updates (list): A list of identifiers for updates to be installed. Overrides ...
python
def _parse_single_request_trap_errors(cls, request_data): """Traps exceptions generated by __parse_single_request and converts them into values of request_id and error in the returned tuple. :Returns: (method_name, params_object, request_id, error) Where: ...
python
def invoke_common_options(f): """ Common CLI options shared by "local invoke" and "local start-api" commands :param f: Callback passed by Click """ invoke_options = [ template_click_option(), click.option('--env-vars', '-n', type=click.Path(exists=True), ...
python
def _points(self, x_pos): """ Convert given data values into drawable points (x, y) and interpolated points if interpolate option is specified """ for serie in self.all_series: serie.points = [(x_pos[i], v) for i, v in enumerate(serie.values)] if serie.poi...
java
@Nonnull public static <T> LObjBoolPredicateBuilder<T> objBoolPredicate(Consumer<LObjBoolPredicate<T>> consumer) { return new LObjBoolPredicateBuilder(consumer); }
python
def get_library_progress(self): """Returns the reading progress for all books in the kindle library. Returns: A mapping of ASINs to `ReadingProgress` instances corresponding to the books in the current user's library. """ kbp_dict = self._get_api_call('get_library_progress') return {asi...
python
def osm_filter(network_type): """ Create a filter to query Overpass API for the specified OSM network type. Parameters ---------- network_type : string, {'walk', 'drive'} denoting the type of street network to extract Returns ------- osm_filter : string """ filters = {} ...