Returns data shapes of the encoder module.

        :param bucket_key: Maximum input length.
        :return: List of data descriptions.
199829
def _get_encoder_data_shapes(self, bucket_key: int, batch_size: int) -> List[mx.io.DataDesc]:
        
        return [mx.io.DataDesc(name=C.SOURCE_NAME,
                               shape=(batch_size, bucket_key, self.num_source_factors),
                               layout=C.BATCH_MAJOR)]
815148
def entry(bucket, key):
    
    if key is None:
        return urlsafe_base64_encode('{0}'.format(bucket))
    else:
        return urlsafe_base64_encode('{0}:{1}'.format(bucket, key))
1299035
def get_bucket(self, hash_name, bucket_key):
        
        results = []
        for row in self._get_bucket_rows(hash_name, bucket_key):
            val_dict = pickle.loads(row)
            # Depending on type (sparse or not) reconstruct vector
            if 'sparse' in val_dict:

                # Fill these for COO creation
                row = []
                col = []
                data = []

                # For each non-zero element, append values
                for e in val_dict['nonzeros']:
                    row.append(e[0])  # Row index
                    data.append(e[1])  # Value
                    col.append(0)  # Column index (always 0)

                # Create numpy arrays for COO creation
                coo_row = numpy.array(row, dtype=numpy.int32)
                coo_col = numpy.array(col, dtype=numpy.int32)
                coo_data = numpy.array(data)

                # Create COO sparse vector
                vector = scipy.sparse.coo_matrix((coo_data, (coo_row, coo_col)), shape=(val_dict['dim'], 1))

            else:
                vector = numpy.fromstring(val_dict['vector'],
                                          dtype=val_dict['dtype'])

            # Add data to result tuple, if present
            results.append((vector, val_dict.get('data')))

        return results
370454
def data_names(self):
        """"""
        if self.binded:
            return self._curr_module.data_names
        else:
            _, data_names, _ = self._call_sym_gen(self._default_bucket_key)
            return data_names
713112
def schema(self, hash_key):
        
        key_schema = [hash_key.hash_schema()]
        if self.range_key is not None:
            key_schema.append(self.range_key.range_schema())
        schema_data = {
            'IndexName': self.name,
            'KeySchema': key_schema,
            'Projection': {
                'ProjectionType': self.projection_type,
            }
        }
        if self.include_fields is not None:
            schema_data['Projection']['NonKeyAttributes'] = self.include_fields
        return schema_data
1025535
def _bucket_key(self):
        
        return "{}.size.{}".format(
            self.prefix, (self._hashed_key//1000)
            if self._hashed_key > 1000 else self._hashed_key)
1211071
def get_size(
            self,
            bucket: str,
            key: str
    ) -> int:
        
        blob_obj = self._get_blob_obj(bucket, key)
        return blob_obj.size
145834
def _ipython_key_completions_(self):
        
        return [key for key in self._dataset._ipython_key_completions_()
                if key not in self._dataset._coord_names]
398349
def get(self, bucket: str, key: str) -> bytes:
        
        try:
            response = self.s3_client.get_object(
                Bucket=bucket,
                Key=key
            )
            return response['Body'].read()
        except botocore.exceptions.ClientError as ex:
            if ex.response['Error']['Code'] == "NoSuchKey":
                raise BlobNotFoundError(f"Could not find s3://{bucket}/{key}") from ex
            raise BlobStoreUnknownError(ex)
828633
def get_bucket_list():
    
    args = parser.parse_args()
    for b in s3_conn(args.aws_access_key_id, args.aws_secret_access_key).get_all_buckets():
        print(''.join([i if ord(i) < 128 else ' ' for i in b.name]))
417097
def keys(self, prefix=None, delimiter=None):
        
        if delimiter:
            # WE REALLY DO NOT GET KEYS, BUT RATHER Prefix OBJECTS
            # AT LEAST THEY ARE UNIQUE
            candidates = [k.name.rstrip(delimiter) for k in self.bucket.list(prefix=prefix, delimiter=delimiter)]
        else:
            candidates = [strip_extension(k.key) for k in self.bucket.list(prefix=prefix)]

        if prefix == None:
            return set(c for c in candidates if c != "0.json")
        else:
            return set(k for k in candidates if k == prefix or k.startswith(prefix + ".") or k.startswith(prefix + ":"))
1306865
public static Key encodeKey(String bucket, String key) {
    Key res = encodeKeyImpl(bucket, key);
//    assert checkBijection(res, bucket, key);
    return res;
  }
564491
def get_size(
            self,
            bucket: str,
            key: str
    ) -> int:
        
        try:
            response = self.get_all_metadata(bucket, key)
            size = response['ContentLength']
            return size
        except botocore.exceptions.ClientError as ex:
            if str(ex.response['Error']['Code']) == str(requests.codes.not_found):
                raise BlobNotFoundError(f"Could not find s3://{bucket}/{key}") from ex
            raise BlobStoreUnknownError(ex)
1252563
def _gcs_get_keys(bucket, pattern):
  
  return [obj for obj in list(bucket.objects()) if fnmatch.fnmatch(obj.metadata.name, pattern)]
1189991
def list(
            self,
            bucket: str,
            prefix: str=None,
            delimiter: str=None,
    ) -> typing.Iterator[str]:
        
        kwargs = dict()
        if prefix is not None:
            kwargs['prefix'] = prefix
        if delimiter is not None:
            kwargs['delimiter'] = delimiter
        bucket_obj = self._ensure_bucket_loaded(bucket)
        for blob_obj in bucket_obj.list_blobs(**kwargs):
            yield blob_obj.name
385205
def get_buckets(min_length, max_length, bucket_count):
    '''
    
    '''
    if bucket_count <= 0:
        return [max_length]
    unit_length = int((max_length - min_length) // (bucket_count))
    buckets = [min_length + unit_length *
               (i + 1) for i in range(0, bucket_count)]
    buckets[-1] = max_length
    return buckets
1033506
def get_keys(self, bucket, timeout=None):
        
        bucket_type = self._get_bucket_type(bucket.bucket_type)
        url = self.key_list_path(bucket.name, bucket_type=bucket_type,
                                 timeout=timeout)
        status, _, body = self._request('GET', url)

        if status == 200:
            props = json.loads(bytes_to_str(body))
            return props['keys']
        else:
            raise RiakError('Error listing keys.')