code stringlengths 3 6.57k |
|---|
PluginApi(ModuleApi) |
namedtuple('PluginInfo', [camel_to_snake(name) |
get_list(self, team_id, filters=None) |
self.get_list_all_pages('plugins.list', {ApiField.TEAM_ID: team_id, ApiField.FILTER: filters or []}) |
get_info_by_id(self, team_id, plugin_id) |
self._get_info_by_filters(team_id, filters) |
Copyright (c) |
ExpandingResNet(nn.Module) |
__init__(self, num_init_features, args) |
super() |
__init__() |
Linear(num_features, num_features // args.divide_channels) |
nn.ModuleList([]) |
range(num_layers) |
print('Layer ', i, kernel_size) |
self.residual_blocks.append(_ResLayer(num_features, kernel_size, args) |
self.reduce_channels(x) |
_ResLayer(nn.Module) |
x (k // 2) |
__init__(self, num_features, kernel_size, args) |
super() |
__init__() |
ValueError('Could not maintain the resolution with stride=%d' % stride) |
Linear(num_features, ffn_dim) |
Linear(ffn_dim, num_features) |
x.permute(0, 3, 1, 2) |
self.conv1(x) |
F.relu(x) |
self.mconv2(x, incremental_state) |
x.masked_fill(encoder_mask.unsqueeze(1) |
unsqueeze(1) |
x.masked_fill(decoder_mask.unsqueeze(1) |
unsqueeze(-1) |
F.dropout(x, p=self.drop_rate, training=self.training) |
x.permute(0, 2, 3, 1) |
self.fc1(x) |
F.relu(x) |
self.fc2(x) |
F.dropout(x, p=self.drop_rate, training=self.training) |
Linear(in_features, out_features, bias=True) |
nn.Linear(in_features, out_features, bias) |
nn.init.xavier_uniform_(m.weight) |
nn.init.constant_(m.bias, 0.) |
TestClass(unittest.TestCase) |
assertIO(self, input, output) |
StringIO() |
StringIO(input) |
resolve() |
sys.stdout.seek(0) |
sys.stdout.read() |
print('------------') |
print(out) |
print('------------') |
self.assertEqual(out, output) |
_1(self) |
self.assertIO(input, output) |
_2(self) |
self.assertIO(input, output) |
_3(self) |
self.assertIO(input, output) |
unittest.main() |
Imagewang(ImageClassificationDataset) |
Imagewang160(ImageClassificationDataset) |
Imagewang320(ImageClassificationDataset) |
Foundation (ASF) |
SQLContext(object) |
data (rows and columns) |
__init__(self, sparkContext, sparkSession=None, jsqlContext=None) |
SQLContext(sc) |
Row(a=1) |
datetime(2014, 8, 1, 14, 1, 5) |
allTypes.toDF() |
df.createOrReplaceTempView("allTypes") |
collect() |
Row((i + CAST(1 AS BIGINT) |
CAST(1 AS DOUBLE) |
datetime.datetime(2014, 8, 1, 14, 1, 5) |
df.rdd.map(lambda x: (x.i, x.s, x.d, x.l, x.b, x.time, x.row.a, x.list) |
collect() |
datetime.datetime(2014, 8, 1, 14, 1, 5) |
SparkSession(sparkContext) |
_monkey_patch_RDD(self.sparkSession) |
install_exception_handler() |
_ssql_ctx(self) |
since(1.6) |
getOrCreate(cls, sc) |
sc._jvm.SQLContext.getOrCreate(sc._jsc.sc() |
SparkSession(sc, jsqlContext.sparkSession() |
cls(sc, sparkSession, jsqlContext) |
since(1.6) |
newSession(self) |
self.__class__(self._sc, self.sparkSession.newSession() |
since(1.3) |
setConf(self, key, value) |
self.sparkSession.conf.set(key, value) |
since(1.3) |
getConf(self, key, defaultValue=None) |
sqlContext.getConf("spark.sql.shuffle.partitions") |
sqlContext.getConf("spark.sql.shuffle.partitions", u"10") |
sqlContext.setConf("spark.sql.shuffle.partitions", u"50") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.