uid stringlengths 24 24 | split stringclasses 1
value | category stringclasses 2
values | content stringlengths 5 482k | signature stringlengths 1 14k | suffix stringlengths 1 482k | prefix stringlengths 9 14k | prefix_token_count int64 3 5.01k | prefix_token_budget int64 64 256 | element_token_count int64 1 292k | signature_token_count int64 1 5.01k | prefix_context_token_count int64 0 255 | repo stringlengths 7 112 | path stringlengths 4 208 | language stringclasses 1
value | name stringlengths 1 218 | qualname stringlengths 1 218 | start_line int64 1 26.7k | end_line int64 1 26.7k | signature_start_line int64 1 26.7k | signature_end_line int64 1 26.7k | source_hash stringlengths 40 40 | source_dataset stringclasses 1
value | source_split stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
244fea74045a4b2c3fbe613a | train | function | def YoloConvTiny(filters, name=None):
def yolo_conv(x_in):
if isinstance(x_in, tuple):
inputs = Input(x_in[0].shape[1:]), Input(x_in[1].shape[1:])
x, x_skip = inputs
# concat with skip connection
x = DarknetConv(x, filters, 1)
x = UpSampling2D(2)(... | def YoloConvTiny(filters, name=None):
| def yolo_conv(x_in):
if isinstance(x_in, tuple):
inputs = Input(x_in[0].shape[1:]), Input(x_in[1].shape[1:])
x, x_skip = inputs
# concat with skip connection
x = DarknetConv(x, filters, 1)
x = UpSampling2D(2)(x)
x = Concatenate()([x, x... | , filters, 1)
x = DarknetConv(x, filters * 2, 3)
x = DarknetConv(x, filters, 1)
return Model(inputs, x, name=name)(x_in)
return yolo_conv
def YoloConvTiny(filters, name=None):
| 64 | 64 | 149 | 10 | 53 | yichenj/facegate | models/yolov3/yolov3/models.py | Python | YoloConvTiny | YoloConvTiny | 122 | 137 | 122 | 122 | f6a035af05bdb94f6a5c49c80938e82b2a98256d | bigcode/the-stack | train |
24b415523f29857d675d859e | train | function | def DarknetConv(x, filters, size, strides=1, batch_norm=True):
if strides == 1:
padding = 'same'
else:
x = ZeroPadding2D(((1, 0), (1, 0)))(x) # top left half-padding
padding = 'valid'
x = Conv2D(filters=filters, kernel_size=size,
strides=strides, padding=padding,
... | def DarknetConv(x, filters, size, strides=1, batch_norm=True):
| if strides == 1:
padding = 'same'
else:
x = ZeroPadding2D(((1, 0), (1, 0)))(x) # top left half-padding
padding = 'valid'
x = Conv2D(filters=filters, kernel_size=size,
strides=strides, padding=padding,
use_bias=not batch_norm, kernel_regularizer=l2(0.000... | 169), (344, 319)],
np.float32) / 416
yolo_tiny_anchor_masks = np.array([[3, 4, 5], [0, 1, 2]])
def DarknetConv(x, filters, size, strides=1, batch_norm=True):
| 63 | 64 | 145 | 18 | 45 | yichenj/facegate | models/yolov3/yolov3/models.py | Python | DarknetConv | DarknetConv | 41 | 53 | 41 | 41 | ba7c61ffc47995bd17d8280d5ef0cd9b0b030d40 | bigcode/the-stack | train |
ccda524b17f8dc91d38a1b52 | train | function | def Darknet(name=None):
x = inputs = Input([None, None, 3])
x = DarknetConv(x, 32, 3)
x = DarknetBlock(x, 64, 1)
x = DarknetBlock(x, 128, 2) # skip connection
x = x_36 = DarknetBlock(x, 256, 8) # skip connection
x = x_61 = DarknetBlock(x, 512, 8)
x = DarknetBlock(x, 1024, 4)
return tf.... | def Darknet(name=None):
| x = inputs = Input([None, None, 3])
x = DarknetConv(x, 32, 3)
x = DarknetBlock(x, 64, 1)
x = DarknetBlock(x, 128, 2) # skip connection
x = x_36 = DarknetBlock(x, 256, 8) # skip connection
x = x_61 = DarknetBlock(x, 512, 8)
x = DarknetBlock(x, 1024, 4)
return tf.keras.Model(inputs, (x_3... | ([prev, x])
return x
def DarknetBlock(x, filters, blocks):
x = DarknetConv(x, filters, 3, strides=2)
for _ in range(blocks):
x = DarknetResidual(x, filters)
return x
def Darknet(name=None):
| 64 | 64 | 144 | 6 | 57 | yichenj/facegate | models/yolov3/yolov3/models.py | Python | Darknet | Darknet | 71 | 79 | 71 | 71 | a48f27bb8a4a3d1f392b76d15ca66dafae4d9861 | bigcode/the-stack | train |
609eced7c8454c22f1141bc6 | train | function | def yolo_boxes(pred, anchors, classes):
# pred: (batch_size, grid, grid, anchors, (x, y, w, h, obj, ...classes))
grid_size = tf.shape(pred)[1:3]
box_xy, box_wh, objectness, class_probs = tf.split(
pred, (2, 2, 1, classes), axis=-1)
box_xy = tf.sigmoid(box_xy)
objectness = tf.sigmoid(objectn... | def yolo_boxes(pred, anchors, classes):
# pred: (batch_size, grid, grid, anchors, (x, y, w, h, obj, ...classes))
| grid_size = tf.shape(pred)[1:3]
box_xy, box_wh, objectness, class_probs = tf.split(
pred, (2, 2, 1, classes), axis=-1)
box_xy = tf.sigmoid(box_xy)
objectness = tf.sigmoid(objectness)
class_probs = tf.sigmoid(class_probs)
pred_box = tf.concat((box_xy, box_wh), axis=-1) # original xywh f... | Lambda(lambda x: tf.reshape(x, (-1, tf.shape(x)[1], tf.shape(x)[2],
anchors, classes + 5)))(x)
return tf.keras.Model(inputs, x, name=name)(x_in)
return yolo_output
def yolo_boxes(pred, anchors, classes):
# pred: (batch_size, grid, grid, anchors, (x, y, w, h, ... | 93 | 93 | 311 | 38 | 54 | yichenj/facegate | models/yolov3/yolov3/models.py | Python | yolo_boxes | yolo_boxes | 151 | 174 | 151 | 152 | 558c2849fed53d7127819841df15e694d2dfa539 | bigcode/the-stack | train |
c94b9ff384041487f813f399 | train | function | def DarknetResidual(x, filters):
prev = x
x = DarknetConv(x, filters // 2, 1)
x = DarknetConv(x, filters, 3)
x = Add()([prev, x])
return x
| def DarknetResidual(x, filters):
| prev = x
x = DarknetConv(x, filters // 2, 1)
x = DarknetConv(x, filters, 3)
x = Add()([prev, x])
return x
| =padding,
use_bias=not batch_norm, kernel_regularizer=l2(0.0005))(x)
if batch_norm:
x = BatchNormalization()(x)
x = LeakyReLU(alpha=0.1)(x)
return x
def DarknetResidual(x, filters):
| 64 | 64 | 56 | 8 | 55 | yichenj/facegate | models/yolov3/yolov3/models.py | Python | DarknetResidual | DarknetResidual | 56 | 61 | 56 | 56 | 130cc39edfa2c6b6a7f3e061d9b8f566fd31ed6d | bigcode/the-stack | train |
99fea189f3f4c739b0d4cd12 | train | function | def yolo_nms(outputs, anchors, masks, classes):
# boxes, conf, type
b, c, t = [], [], []
for o in outputs:
b.append(tf.reshape(o[0], (tf.shape(o[0])[0], -1, tf.shape(o[0])[-1])))
c.append(tf.reshape(o[1], (tf.shape(o[1])[0], -1, tf.shape(o[1])[-1])))
t.append(tf.reshape(o[2], (tf.sh... | def yolo_nms(outputs, anchors, masks, classes):
# boxes, conf, type
| b, c, t = [], [], []
for o in outputs:
b.append(tf.reshape(o[0], (tf.shape(o[0])[0], -1, tf.shape(o[0])[-1])))
c.append(tf.reshape(o[1], (tf.shape(o[1])[0], -1, tf.shape(o[1])[-1])))
t.append(tf.reshape(o[2], (tf.shape(o[2])[0], -1, tf.shape(o[2])[-1])))
bbox = tf.concat(b, axis=1)... | anchors
box_x1y1 = box_xy - box_wh / 2
box_x2y2 = box_xy + box_wh / 2
bbox = tf.concat([box_x1y1, box_x2y2], axis=-1)
return bbox, objectness, class_probs, pred_box
def yolo_nms(outputs, anchors, masks, classes):
# boxes, conf, type
| 90 | 90 | 303 | 21 | 68 | yichenj/facegate | models/yolov3/yolov3/models.py | Python | yolo_nms | yolo_nms | 177 | 201 | 177 | 178 | f9fe5149adabed58a6f49a9e47a2e58b70b724ab | bigcode/the-stack | train |
7cb9e1e9dbaef35d8ed9cf5d | train | function | def DarknetTiny(name=None):
x = inputs = Input([None, None, 3])
x = DarknetConv(x, 16, 3)
x = MaxPool2D(2, 2, 'same')(x)
x = DarknetConv(x, 32, 3)
x = MaxPool2D(2, 2, 'same')(x)
x = DarknetConv(x, 64, 3)
x = MaxPool2D(2, 2, 'same')(x)
x = DarknetConv(x, 128, 3)
x = MaxPool2D(2, 2, 's... | def DarknetTiny(name=None):
| x = inputs = Input([None, None, 3])
x = DarknetConv(x, 16, 3)
x = MaxPool2D(2, 2, 'same')(x)
x = DarknetConv(x, 32, 3)
x = MaxPool2D(2, 2, 'same')(x)
x = DarknetConv(x, 64, 3)
x = MaxPool2D(2, 2, 'same')(x)
x = DarknetConv(x, 128, 3)
x = MaxPool2D(2, 2, 'same')(x)
x = x_8 = Darkn... | netBlock(x, 256, 8) # skip connection
x = x_61 = DarknetBlock(x, 512, 8)
x = DarknetBlock(x, 1024, 4)
return tf.keras.Model(inputs, (x_36, x_61, x), name=name)
def DarknetTiny(name=None):
| 76 | 76 | 254 | 7 | 69 | yichenj/facegate | models/yolov3/yolov3/models.py | Python | DarknetTiny | DarknetTiny | 82 | 97 | 82 | 82 | e6b3be96448d0952fb05960e6ba681dc52b465c1 | bigcode/the-stack | train |
10e3b2c18a020197c034d758 | train | function | def YoloConv(filters, name=None):
def yolo_conv(x_in):
if isinstance(x_in, tuple):
inputs = Input(x_in[0].shape[1:]), Input(x_in[1].shape[1:])
x, x_skip = inputs
# concat with skip connection
x = DarknetConv(x, filters, 1)
x = UpSampling2D(2)(x)
... | def YoloConv(filters, name=None):
| def yolo_conv(x_in):
if isinstance(x_in, tuple):
inputs = Input(x_in[0].shape[1:]), Input(x_in[1].shape[1:])
x, x_skip = inputs
# concat with skip connection
x = DarknetConv(x, filters, 1)
x = UpSampling2D(2)(x)
x = Concatenate()([x, x... | 512, 3)
x = MaxPool2D(2, 1, 'same')(x)
x = DarknetConv(x, 1024, 3)
return tf.keras.Model(inputs, (x_8, x), name=name)
def YoloConv(filters, name=None):
| 64 | 64 | 207 | 9 | 55 | yichenj/facegate | models/yolov3/yolov3/models.py | Python | YoloConv | YoloConv | 100 | 119 | 100 | 100 | 1c7040cb742023d1c8a86bc07b31683a7d1790b8 | bigcode/the-stack | train |
d71ff35c76ea60ef464148e7 | train | function | def YoloV3Tiny(size=None, channels=3, anchors=yolo_tiny_anchors,
masks=yolo_tiny_anchor_masks, classes=80, training=False):
x = inputs = Input([size, size, channels], name='input')
x_8, x = DarknetTiny(name='yolo_darknet')(x)
x = YoloConvTiny(256, name='yolo_conv_0')(x)
output_0 = YoloO... | def YoloV3Tiny(size=None, channels=3, anchors=yolo_tiny_anchors,
masks=yolo_tiny_anchor_masks, classes=80, training=False):
| x = inputs = Input([size, size, channels], name='input')
x_8, x = DarknetTiny(name='yolo_darknet')(x)
x = YoloConvTiny(256, name='yolo_conv_0')(x)
output_0 = YoloOutput(256, len(masks[0]), classes, name='yolo_output_0')(x)
x = YoloConvTiny(128, name='yolo_conv_1')((x, x_8))
output_1 = YoloOut... | )
outputs = Lambda(lambda x: yolo_nms(x, anchors, masks, classes),
name='yolo_nms')((boxes_0[:3], boxes_1[:3], boxes_2[:3]))
return Model(inputs, outputs, name='yolov3')
def YoloV3Tiny(size=None, channels=3, anchors=yolo_tiny_anchors,
masks=yolo_tiny_anchor_masks, classes=8... | 98 | 98 | 327 | 37 | 61 | yichenj/facegate | models/yolov3/yolov3/models.py | Python | YoloV3Tiny | YoloV3Tiny | 235 | 256 | 235 | 236 | 5501aa81562cabab393e0e166d0d898500788454 | bigcode/the-stack | train |
c6e3d4186c3692079734b629 | train | function | def YoloLoss(anchors, classes=80, ignore_thresh=0.5):
def yolo_loss(y_true, y_pred):
# 1. transform all pred outputs
# y_pred: (batch_size, grid, grid, anchors, (x, y, w, h, obj, ...cls))
pred_box, pred_obj, pred_class, pred_xywh = yolo_boxes(
y_pred, anchors, classes)
pr... | def YoloLoss(anchors, classes=80, ignore_thresh=0.5):
| def yolo_loss(y_true, y_pred):
# 1. transform all pred outputs
# y_pred: (batch_size, grid, grid, anchors, (x, y, w, h, obj, ...cls))
pred_box, pred_obj, pred_class, pred_xywh = yolo_boxes(
y_pred, anchors, classes)
pred_xy = pred_xywh[..., 0:2]
pred_wh = pred_xyw... | x)
output_0 = YoloOutput(256, len(masks[0]), classes, name='yolo_output_0')(x)
x = YoloConvTiny(128, name='yolo_conv_1')((x, x_8))
output_1 = YoloOutput(128, len(masks[1]), classes, name='yolo_output_1')(x)
if training:
return Model(inputs, (output_0, output_1), name='yolov3')
boxes_0 = L... | 254 | 254 | 849 | 18 | 236 | yichenj/facegate | models/yolov3/yolov3/models.py | Python | YoloLoss | YoloLoss | 259 | 322 | 259 | 259 | 0d1fd7ffd8d8145a813f3df573aeb9e814d455b3 | bigcode/the-stack | train |
ea61c8c5bb9f93fbe94896c1 | train | class | class StarcraftVideo(tfds.core.GeneratorBasedBuilder):
"""Starcraft video datasets."""
BUILDER_CONFIGS = [
StarcraftVideoConfig(
name="brawl_64",
description="Brawl map with 64x64 resolution.",
map_name="Brawl",
version="0.1.1",
resolution=64,
size_... | class StarcraftVideo(tfds.core.GeneratorBasedBuilder):
| """Starcraft video datasets."""
BUILDER_CONFIGS = [
StarcraftVideoConfig(
name="brawl_64",
description="Brawl map with 64x64 resolution.",
map_name="Brawl",
version="0.1.1",
resolution=64,
size_in_gb=6.3,
),
StarcraftVideoConfig(
... | title = {Towards Accurate Generative Models of Video: {A} New Metric and
Challenges},
journal = {CoRR},
volume = {abs/1812.01717},
year = {2018},
url = {http://arxiv.org/abs/1812.01717},
archivePrefix = {arXiv},
eprint = {1812.01717},
timestamp = {Tue, 01 Jan 2019 15... | 256 | 256 | 1,315 | 12 | 243 | NunoEdgarGFlowHub/datasets | tensorflow_datasets/video/starcraft.py | Python | StarcraftVideo | StarcraftVideo | 62 | 227 | 62 | 62 | 2198dcd111ed5a6b6890b8b138a05382bdbed063 | bigcode/the-stack | train |
e0ad9b88e5e11c50fd1c26db | train | class | class StarcraftVideoConfig(tfds.core.BuilderConfig):
@api_utils.disallow_positional_args
def __init__(self, map_name, resolution, size_in_gb, **kwargs):
super(StarcraftVideoConfig, self).__init__(**kwargs)
self.map_name = map_name
self.resolution = resolution
self.size_in_gb = size_in_gb
| class StarcraftVideoConfig(tfds.core.BuilderConfig):
@api_utils.disallow_positional_args
| def __init__(self, map_name, resolution, size_in_gb, **kwargs):
super(StarcraftVideoConfig, self).__init__(**kwargs)
self.map_name = map_name
self.resolution = resolution
self.size_in_gb = size_in_gb
| {https://dblp.org/rec/bib/journals/corr/abs-1812-01717},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
"""
class StarcraftVideoConfig(tfds.core.BuilderConfig):
@api_utils.disallow_positional_args
| 64 | 64 | 83 | 21 | 43 | NunoEdgarGFlowHub/datasets | tensorflow_datasets/video/starcraft.py | Python | StarcraftVideoConfig | StarcraftVideoConfig | 52 | 59 | 52 | 54 | cbb120427c3c8bc88e90e8941dda53e9be964712 | bigcode/the-stack | train |
195ae0a6eba906756c5d2511 | train | function | def paginate_help(page_number, loaded_modules, prefix):
number_of_rows = 5
number_of_cols = 2
helpable_modules = [p for p in loaded_modules if not p.startswith("_")]
helpable_modules = sorted(helpable_modules)
modules = [
custom.Button.inline("{} {}".format("🔹", x), data="ub_modul_{}".forma... | def paginate_help(page_number, loaded_modules, prefix):
| number_of_rows = 5
number_of_cols = 2
helpable_modules = [p for p in loaded_modules if not p.startswith("_")]
helpable_modules = sorted(helpable_modules)
modules = [
custom.Button.inline("{} {}".format("🔹", x), data="ub_modul_{}".format(x))
for x in helpable_modules
]
pairs ... | ALIVE_NAME` ConfigVar!'}"
)
await bot.send_message(BOTLOG_CHATID, message)
return True
# Global Variables
COUNT_MSG = 0
USERS = {}
COUNT_PM = {}
LASTMSG = {}
CMD_HELP = {}
ISAFK = False
AFKREASON = None
def paginate_help(page_number, loaded_modules, prefix):
| 78 | 78 | 263 | 11 | 66 | fitra17/UserButt | userbot/__init__.py | Python | paginate_help | paginate_help | 230 | 257 | 230 | 230 | 8d4702c50f60e5841fe091dae7ee226d415db23c | bigcode/the-stack | train |
9cc90e5e598c0ae185fe0064 | train | function | async def send_alive_status():
if BOTLOG_CHATID:
message = (
"**Bot is up and running!**\n\n"
f"**Telethon:** {version.__version__}\n"
f"**Python:** {python_version()}\n"
f"**User:** {ALIVE_NAME or 'Set `ALIVE_NAME` ConfigVar!'}"
)
await bot.se... | async def send_alive_status():
| if BOTLOG_CHATID:
message = (
"**Bot is up and running!**\n\n"
f"**Telethon:** {version.__version__}\n"
f"**Python:** {python_version()}\n"
f"**User:** {ALIVE_NAME or 'Set `ALIVE_NAME` ConfigVar!'}"
)
await bot.send_message(BOTLOG_CHATID, messa... | .get_entity(BOTLOG_CHATID)
if entity.default_banned_rights.send_messages:
LOGS.info(
"Your account doesn't have rights to send messages to BOTLOG_CHATID "
"group. Check if you typed the Chat ID correctly.")
quit(1)
async def send_alive_status():
| 64 | 64 | 100 | 6 | 58 | fitra17/UserButt | userbot/__init__.py | Python | send_alive_status | send_alive_status | 208 | 217 | 208 | 208 | f4f21b2131d5638ce9f1c3cf6a3a1561076083a0 | bigcode/the-stack | train |
d85ba09c01f81fe42bb5ba50 | train | function | async def check_botlog_chatid():
if not BOTLOG_CHATID:
return
entity = await bot.get_entity(BOTLOG_CHATID)
if entity.default_banned_rights.send_messages:
LOGS.info(
"Your account doesn't have rights to send messages to BOTLOG_CHATID "
"group. Check if you typed the C... | async def check_botlog_chatid():
| if not BOTLOG_CHATID:
return
entity = await bot.get_entity(BOTLOG_CHATID)
if entity.default_banned_rights.send_messages:
LOGS.info(
"Your account doesn't have rights to send messages to BOTLOG_CHATID "
"group. Check if you typed the Chat ID correctly.")
quit(... | if STRING_SESSION:
# pylint: disable=invalid-name
bot = TelegramClient(StringSession(STRING_SESSION), API_KEY, API_HASH)
else:
# pylint: disable=invalid-name
bot = TelegramClient("userbot", API_KEY, API_HASH)
async def check_botlog_chatid():
| 64 | 64 | 82 | 8 | 56 | fitra17/UserButt | userbot/__init__.py | Python | check_botlog_chatid | check_botlog_chatid | 196 | 205 | 196 | 196 | e49c1561b27676668048f6072ccad9357b8bdd5d | bigcode/the-stack | train |
7613df12ad51f5a5084ce264 | train | class | class Pascal_ScanState:
'''A class representing the state of the pascal line-oriented scan.'''
def __init__(self, d=None):
'''Pascal_ScanState.__init__'''
if d:
prev = d.get('prev')
self.context = prev.context
else:
self.context = ''
def __repr__... | class Pascal_ScanState:
| '''A class representing the state of the pascal line-oriented scan.'''
def __init__(self, d=None):
'''Pascal_ScanState.__init__'''
if d:
prev = d.get('prev')
self.context = prev.context
else:
self.context = ''
def __repr__(self):
'''Pasca... | .'''
if prev_state.context:
return False
line = lines[i]
for pattern in self.pascal_pattern_table:
m = pattern.match(line)
if m: return True
return False
#@-others
#@+node:ekr.20161126171035.6: ** class class Pascal_ScanState
class Pascal_ScanState... | 83 | 83 | 278 | 6 | 76 | gamtiq/leo-editor | leo/plugins/importers/pascal.py | Python | Pascal_ScanState | Pascal_ScanState | 106 | 140 | 106 | 106 | d6da32bcccd9b73b6f813f0e3d8aca240f841d0b | bigcode/the-stack | train |
834703528ca15eeb05b7c3dd | train | class | class Pascal_Importer(Importer):
'''The importer for the pascal lanuage.'''
def __init__(self, importCommands, **kwargs):
'''Pascal_Importer.__init__'''
super().__init__(
importCommands,
language = 'pascal',
state_class = Pascal_ScanState,
strict ... | class Pascal_Importer(Importer):
| '''The importer for the pascal lanuage.'''
def __init__(self, importCommands, **kwargs):
'''Pascal_Importer.__init__'''
super().__init__(
importCommands,
language = 'pascal',
state_class = Pascal_ScanState,
strict = False,
)
#@+others... | #@+leo-ver=5-thin
#@+node:ekr.20140723122936.18147: * @file ../plugins/importers/pascal.py
'''The @auto importer for the pascal language.'''
import re
import leo.core.leoGlobals as g
import leo.plugins.importers.linescanner as linescanner
Importer = linescanner.Importer
#@+others
#@+node:ekr.20161126171035.2: ** class ... | 115 | 256 | 963 | 7 | 107 | gamtiq/leo-editor | leo/plugins/importers/pascal.py | Python | Pascal_Importer | Pascal_Importer | 10 | 103 | 10 | 10 | b205488c74a3baa9ddd835356272b01d647ceffd | bigcode/the-stack | train |
c51be297ecafe7413b436561 | train | class | @unittest.skipIf(not torch.cuda.is_available(), reason="Skip if no CUDA device")
class CUDATester(Tester):
def setUp(self):
self.device = "cuda"
| @unittest.skipIf(not torch.cuda.is_available(), reason="Skip if no CUDA device")
class CUDATester(Tester):
| def setUp(self):
self.device = "cuda"
| = {}
self._test_class_op(
"RandomGrayscale", meth_kwargs=meth_kwargs, test_exact_match=False, tol=tol, agg_method="max"
)
@unittest.skipIf(not torch.cuda.is_available(), reason="Skip if no CUDA device")
class CUDATester(Tester):
| 64 | 64 | 40 | 27 | 37 | tejank10/vision | test/test_transforms_tensor.py | Python | CUDATester | CUDATester | 340 | 344 | 340 | 342 | 35ce4e3336857e7f5df3bdcad4dc4e76cfed9ba2 | bigcode/the-stack | train |
3044822fead77661709fddb3 | train | class | class Tester(TransformsTester):
def setUp(self):
self.device = "cpu"
def _test_functional_op(self, func, fn_kwargs):
if fn_kwargs is None:
fn_kwargs = {}
tensor, pil_img = self._create_data(height=10, width=10, device=self.device)
transformed_tensor = getattr(F, fun... | class Tester(TransformsTester):
| def setUp(self):
self.device = "cpu"
def _test_functional_op(self, func, fn_kwargs):
if fn_kwargs is None:
fn_kwargs = {}
tensor, pil_img = self._create_data(height=10, width=10, device=self.device)
transformed_tensor = getattr(F, func)(tensor, **fn_kwargs)
t... | import torch
from torchvision import transforms as T
from torchvision.transforms import functional as F
from PIL.Image import NEAREST, BILINEAR, BICUBIC
import numpy as np
import unittest
from common_utils import TransformsTester
class Tester(TransformsTester):
| 57 | 256 | 3,484 | 6 | 50 | tejank10/vision | test/test_transforms_tensor.py | Python | Tester | Tester | 14 | 337 | 14 | 15 | f13eeb91ac821c217c885e27b3f56a6444752ddc | bigcode/the-stack | train |
51acf262085a3f0fa9436df6 | train | class | class Py3status:
"""
"""
# available configuration parameters
cache_timeout = 10
check_pid = False
format = "VPN: {name}|VPN: no"
pidfile = "/sys/class/net/vpn0/dev_id"
def post_config_hook(self):
self.thread_started = False
self.active = []
def _start_handler_thre... | class Py3status:
| """
"""
# available configuration parameters
cache_timeout = 10
check_pid = False
format = "VPN: {name}|VPN: no"
pidfile = "/sys/class/net/vpn0/dev_id"
def post_config_hook(self):
self.thread_started = False
self.active = []
def _start_handler_thread(self):
... | True, act just like the default i3status module.
(default False)
format: Format of the output.
(default 'VPN: {name}|VPN: no')
pidfile: Same as i3status pidfile, checked when check_pid is True.
(default '/sys/class/net/vpn0/dev_id')
Format placeholders:
{name} The name and/or statu... | 212 | 212 | 707 | 5 | 206 | boucman/py3status | py3status/modules/vpn_status.py | Python | Py3status | Py3status | 44 | 143 | 44 | 44 | 837ba158da3285f404da53973e4446ce93353c5b | bigcode/the-stack | train |
961aab91e63c276f3f007a19 | train | function | def sympify_method_args(cls):
'''Decorator for a class with methods that sympify arguments.
The sympify_method_args decorator is to be used with the sympify_return
decorator for automatic sympification of method arguments. This is
intended for the common idiom of writing a class like
>>> from symp... | def sympify_method_args(cls):
| '''Decorator for a class with methods that sympify arguments.
The sympify_method_args decorator is to be used with the sympify_return
decorator for automatic sympification of method arguments. This is
intended for the common idiom of writing a class like
>>> from sympy.core.basic import Basic
... | .
The ``method_name`` argument is the name of the method of the other class
that will be called. Use this decorator in the following manner::
# Call other.__rmul__ if other._op_priority > self._op_priority
@call_highest_priority('__rmul__')
def __mul__(self, other):
...
... | 210 | 210 | 703 | 8 | 201 | MartinThoma/sympy | sympy/core/decorators.py | Python | sympify_method_args | sympify_method_args | 132 | 196 | 132 | 132 | 19b1d91c6e2886ca42aa6ac16d9dd6aabec26003 | bigcode/the-stack | train |
dc955d6c85c330fd917dcf2d | train | function | def __sympifyit(func, arg, retval=None):
"""decorator to _sympify `arg` argument for function `func`
don't use directly -- use _sympifyit instead
"""
# we support f(a,b) only
if not get_function_code(func).co_argcount:
raise LookupError("func not found")
# only b is _sympified
a... | def __sympifyit(func, arg, retval=None):
| """decorator to _sympify `arg` argument for function `func`
don't use directly -- use _sympifyit instead
"""
# we support f(a,b) only
if not get_function_code(func).co_argcount:
raise LookupError("func not found")
# only b is _sympified
assert get_function_code(func).co_varnames... | sympified, and the whole code restarted.
if _sympify(arg) fails, NotImplemented will be returned
see: __sympifyit
"""
def deco(func):
return __sympifyit(func, arg, retval)
return deco
def __sympifyit(func, arg, retval=None):
| 72 | 72 | 243 | 13 | 58 | MartinThoma/sympy | sympy/core/decorators.py | Python | __sympifyit | __sympifyit | 65 | 93 | 65 | 65 | 1e5e26bcfd67711db11c9a7aa64eb15f75147521 | bigcode/the-stack | train |
1576b93c0b251bc2bafc4d99 | train | function | def sympify_return(*args):
'''Function/method decorator to sympify arguments automatically
See the docstring of sympify_method_args for explanation.
'''
# Store a wrapper object for the decorated method
def wrapper(func):
return _SympifyWrapper(func, args)
return wrapper
| def sympify_return(*args):
| '''Function/method decorator to sympify arguments automatically
See the docstring of sympify_method_args for explanation.
'''
# Store a wrapper object for the decorated method
def wrapper(func):
return _SympifyWrapper(func, args)
return wrapper
| provide the
# cls argument which is used for forward string referencing.
for attrname, obj in cls.__dict__.items():
if isinstance(obj, _SympifyWrapper):
setattr(cls, attrname, obj.make_wrapped(cls))
return cls
def sympify_return(*args):
| 64 | 64 | 68 | 8 | 55 | MartinThoma/sympy | sympy/core/decorators.py | Python | sympify_return | sympify_return | 199 | 207 | 199 | 199 | 510a6136d3531a1531d698093a80288d5ab43c92 | bigcode/the-stack | train |
08e6c9916e30b58054b6999b | train | function | def deprecated(**decorator_kwargs):
"""This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used."""
from sympy.utilities.exceptions import SymPyDeprecationWarning
def _warn_deprecation(wrapped, stacklevel):
de... | def deprecated(**decorator_kwargs):
| """This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used."""
from sympy.utilities.exceptions import SymPyDeprecationWarning
def _warn_deprecation(wrapped, stacklevel):
decorator_kwargs.setdefault('feature',... | """
SymPy core decorators.
The purpose of this module is to expose decorators without any other
dependencies, so that they can be easily imported anywhere in sympy/core.
"""
from functools import wraps
from .sympify import SympifyError, sympify
from sympy.core.compatibility import get_function_code
def deprecated(**d... | 73 | 78 | 261 | 7 | 65 | MartinThoma/sympy | sympy/core/decorators.py | Python | deprecated | deprecated | 13 | 40 | 13 | 13 | 123e7cacbf060e10320afb78ddec78780724d0e3 | bigcode/the-stack | train |
f08bcab29d58abf23ae6b9c1 | train | function | def _sympifyit(arg, retval=None):
"""decorator to smartly _sympify function arguments
@_sympifyit('other', NotImplemented)
def add(self, other):
...
In add, other can be thought of as already being a SymPy object.
If it is not, the code is likely to catch an exception, then... | def _sympifyit(arg, retval=None):
| """decorator to smartly _sympify function arguments
@_sympifyit('other', NotImplemented)
def add(self, other):
...
In add, other can be thought of as already being a SymPy object.
If it is not, the code is likely to catch an exception, then other will
be explicitly _... | (wrapped)
def wrapper(*args, **kwargs):
_warn_deprecation(wrapped, 3)
return wrapped(*args, **kwargs)
wrapper._sympy_deprecated_func = wrapped
return wrapper
return deprecated_decorator
def _sympifyit(arg, retval=None):
| 64 | 64 | 145 | 11 | 52 | MartinThoma/sympy | sympy/core/decorators.py | Python | _sympifyit | _sympifyit | 43 | 62 | 43 | 43 | 32ad0e4528ee5733f6bf87c0e30365600d59aef2 | bigcode/the-stack | train |
7782331ffda999326ec996ba | train | class | class _SympifyWrapper:
'''Internal class used by sympify_return and sympify_method_args'''
def __init__(self, func, args):
self.func = func
self.args = args
def make_wrapped(self, cls):
func = self.func
parameters, retval = self.args
# XXX: Handle more than one par... | class _SympifyWrapper:
| '''Internal class used by sympify_return and sympify_method_args'''
def __init__(self, func, args):
self.func = func
self.args = args
def make_wrapped(self, cls):
func = self.func
parameters, retval = self.args
# XXX: Handle more than one parameter?
[(param... | dict__.items():
if isinstance(obj, _SympifyWrapper):
setattr(cls, attrname, obj.make_wrapped(cls))
return cls
def sympify_return(*args):
'''Function/method decorator to sympify arguments automatically
See the docstring of sympify_method_args for explanation.
'''
# Store a wrap... | 107 | 107 | 357 | 7 | 99 | MartinThoma/sympy | sympy/core/decorators.py | Python | _SympifyWrapper | _SympifyWrapper | 210 | 253 | 210 | 210 | 5a5f6439c5ac7a10cb4dc8d9458a7b3749d52a70 | bigcode/the-stack | train |
5215df4f009831d6d6531008 | train | function | def call_highest_priority(method_name):
"""A decorator for binary special methods to handle _op_priority.
Binary special methods in Expr and its subclasses use a special attribute
'_op_priority' to determine whose special method will be called to
handle the operation. In general, the object having the ... | def call_highest_priority(method_name):
| """A decorator for binary special methods to handle _op_priority.
Binary special methods in Expr and its subclasses use a special attribute
'_op_priority' to determine whose special method will be called to
handle the operation. In general, the object having the highest value of
'_op_priority' will... | b):
try:
# If an external class has _op_priority, it knows how to deal
# with sympy objects. Otherwise, it must be converted.
if not hasattr(b, '_op_priority'):
b = sympify(b, strict=True)
return func(a, b)
exce... | 92 | 92 | 309 | 8 | 83 | MartinThoma/sympy | sympy/core/decorators.py | Python | call_highest_priority | call_highest_priority | 96 | 129 | 96 | 96 | 735e6098f0eeb432e9a6d888871ebe85dd158fbd | bigcode/the-stack | train |
7dcc4b8b620c8d04685d4792 | train | class | class TaylorDiagram(object):
"""
Taylor diagram: plot model standard deviation and correlation
to reference (data) sample in a single-quadrant polar plot, with
r=stddev and theta=arccos(correlation).
Taylor diagram (Taylor, 2001) test implementation.
http://www-pcmdi.llnl.gov/about/staff/Taylo... | class TaylorDiagram(object):
| """
Taylor diagram: plot model standard deviation and correlation
to reference (data) sample in a single-quadrant polar plot, with
r=stddev and theta=arccos(correlation).
Taylor diagram (Taylor, 2001) test implementation.
http://www-pcmdi.llnl.gov/about/staff/Taylor/CV/Taylor_diagram_primer.ht... | import matplotlib.pyplot as plt
import numpy as np
__all__ = ["TaylorDiagram"]
class TaylorDiagram(object):
| 24 | 256 | 980 | 5 | 19 | ocefpaf/ioos_tools | ioos_tools/taylor_diagram.py | Python | TaylorDiagram | TaylorDiagram | 7 | 115 | 7 | 7 | 540e435cdbb17e8e037057faf14a239f3af85fb3 | bigcode/the-stack | train |
33b65c5e24159b38276dfda1 | train | class | @require_tokenizers
class ReduceMutableBorrowTests(unittest.TestCase):
def test_async_share_tokenizer(self):
# See https://github.com/huggingface/transformers/pull/12550
# and https://github.com/huggingface/tokenizers/issues/537
tokenizer = PreTrainedTokenizerFast.from_pretrained("robot-test... | @require_tokenizers
class ReduceMutableBorrowTests(unittest.TestCase):
| def test_async_share_tokenizer(self):
# See https://github.com/huggingface/transformers/pull/12550
# and https://github.com/huggingface/tokenizers/issues/537
tokenizer = PreTrainedTokenizerFast.from_pretrained("robot-test/dummy-tokenizer-wordlevel")
text = "The Matrix is a 1999 scien... | _change()
finally:
# Even if the test fails, we must be sure that the folder is deleted and that the default tokenizer
# is restored
shutil.rmtree(self.tmpdirname)
self.tmpdirname = tmpdirname_orig
@require_tokenizers
class ... | 64 | 64 | 213 | 14 | 49 | arunraja-hub/transformers | tests/test_tokenization_fast.py | Python | ReduceMutableBorrowTests | ReduceMutableBorrowTests | 96 | 110 | 96 | 97 | 46374b2c6fcaa6433290f46971d9cdcdfff7c20e | bigcode/the-stack | train |
bac2da38eb701e9f1001be5a | train | class | @require_tokenizers
class PreTrainedTokenizationFastTest(TokenizerTesterMixin, unittest.TestCase):
rust_tokenizer_class = PreTrainedTokenizerFast
test_slow_tokenizer = False
test_rust_tokenizer = True
from_pretrained_vocab_key = "tokenizer_file"
def setUp(self):
self.test_rust_tokenizer = F... | @require_tokenizers
class PreTrainedTokenizationFastTest(TokenizerTesterMixin, unittest.TestCase):
| rust_tokenizer_class = PreTrainedTokenizerFast
test_slow_tokenizer = False
test_rust_tokenizer = True
from_pretrained_vocab_key = "tokenizer_file"
def setUp(self):
self.test_rust_tokenizer = False # because we don't have pretrained_vocab_files_map
super().setUp()
self.test_... | # coding=utf-8
# Copyright 2019 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 202 | 203 | 677 | 22 | 179 | arunraja-hub/transformers | tests/test_tokenization_fast.py | Python | PreTrainedTokenizationFastTest | PreTrainedTokenizationFastTest | 27 | 93 | 27 | 28 | 5537e489c1698d61b09792d62da167ac5d93a68b | bigcode/the-stack | train |
e358177a955db8d795f53c7e | train | class | class SucursalbConfig(AppConfig):
name = 'SucursalB'
| class SucursalbConfig(AppConfig):
| name = 'SucursalB'
| from django.apps import AppConfig
class SucursalbConfig(AppConfig):
| 15 | 64 | 15 | 8 | 6 | UnopposedQuill/muedatos2 | sitioWeb/SucursalB/apps.py | Python | SucursalbConfig | SucursalbConfig | 4 | 5 | 4 | 4 | 54023243d4d06838ee4465757af739c5844e3307 | bigcode/the-stack | train |
705357c143b5b96da47681b2 | train | function | def main():
# Input parameters
columns, rows, num_commands = list(map(int,input().split()))
canvas = [[-1]*columns for i in range(rows)]
commands = []
for i in range(num_commands):
commands.append(list(map(str,input().split())))
for i in range(num_commands):
if (commands[i][0] =... | def main():
# Input parameters
| columns, rows, num_commands = list(map(int,input().split()))
canvas = [[-1]*columns for i in range(rows)]
commands = []
for i in range(num_commands):
commands.append(list(map(str,input().split())))
for i in range(num_commands):
if (commands[i][0] == 'C'):
canvas = clear(... | start = 0
if (end>columns):
end = columns
if (level<0):
level = 0
if (level>=rows):
i+=1
continue
canvas_np[level,start:end] = character
i+=1
return list(canvas_np)
def main():
# Input parameters
| 75 | 75 | 251 | 8 | 67 | uzakotim/programming_for_engineers_ctu | task2_drawing/main.py | Python | main | main | 142 | 171 | 142 | 143 | 66dc8bc7e162018af8d7ba6cb04fb8ec9169ef0a | bigcode/the-stack | train |
d35fe1e9af5199b8ecec30ab | train | function | def substitute(command, canvas,columns,rows):
if len(command)!=7:
print("Wrongly specified substitute command, should be: S x1 y1 x2 y2 char char")
return
else:
x1 = int(command[1])
y1 = int(command[2])
x2 = int(command[3])
y2 = int(command[4])
character_... | def substitute(command, canvas,columns,rows):
| if len(command)!=7:
print("Wrongly specified substitute command, should be: S x1 y1 x2 y2 char char")
return
else:
x1 = int(command[1])
y1 = int(command[2])
x2 = int(command[3])
y2 = int(command[4])
character_old = ord(command[5])
character_new = ... | rows:
x2 = rows
if y1>=columns:
y1 = columns
if y2>=columns:
y2 = columns
canvas_np = np.array(canvas)
canvas_np[x1:x2+1,y1:y2+1] = character
return list(canvas_np)
def substitute(command, canvas,columns,rows):
| 78 | 78 | 260 | 10 | 68 | uzakotim/programming_for_engineers_ctu | task2_drawing/main.py | Python | substitute | substitute | 73 | 105 | 73 | 73 | 92b3a8e8a1196ef5530b447c5896115b6247b8ea | bigcode/the-stack | train |
5acff1468da293847722dd02 | train | function | def pyramid(command, canvas,columns,rows):
if len(command)!=5:
print("Wrongly specified clear command, should be: P y1 x1 x2 char")
return
else:
y1 = int(command[1])
x1 = int(command[2])
x2 = int(command[3])
character = ord(command[4])
canvas_np = np.array(... | def pyramid(command, canvas,columns,rows):
| if len(command)!=5:
print("Wrongly specified clear command, should be: P y1 x1 x2 char")
return
else:
y1 = int(command[1])
x1 = int(command[2])
x2 = int(command[3])
character = ord(command[4])
canvas_np = np.array(canvas)
i = 0
start= 0
end =0
... | columns
canvas_np = np.array(canvas)
canvas_np[x1:x2+1,y1:y2+1][canvas_np[x1:x2+1,y1:y2+1] == character_old] = character_new
return list(canvas_np)
def pyramid(command, canvas,columns,rows):
| 65 | 65 | 219 | 10 | 55 | uzakotim/programming_for_engineers_ctu | task2_drawing/main.py | Python | pyramid | pyramid | 107 | 140 | 107 | 107 | 9cfd8f24f895f85ab761a6a8afe5cc48336a4b74 | bigcode/the-stack | train |
344d562144bc457381dc4d54 | train | function | def rectangle(command, canvas,columns,rows):
if len(command)!=6:
print("Wrongly specified clear command, should be: R x1 y1 x2 y2 char")
return
else:
x1 = int(command[1])
y1 = int(command[2])
x2 = int(command[3])
y2 = int(command[4])
character = ord(comma... | def rectangle(command, canvas,columns,rows):
| if len(command)!=6:
print("Wrongly specified clear command, should be: R x1 y1 x2 y2 char")
return
else:
x1 = int(command[1])
y1 = int(command[2])
x2 = int(command[3])
y2 = int(command[4])
character = ord(command[5])
if x1<0:
x1=0
if x2<0... | 1>=columns:
y1 = columns
if y2>=columns:
y2 = columns
canvas_np = np.array(canvas)
canvas_np[x1:x2+1,y1:y2+1] = -1
return list(canvas_np)
def rectangle(command, canvas,columns,rows):
| 68 | 68 | 228 | 10 | 58 | uzakotim/programming_for_engineers_ctu | task2_drawing/main.py | Python | rectangle | rectangle | 40 | 70 | 40 | 40 | f649cdd1d7661fcfaace17b9810ce7c5f9a59e8a | bigcode/the-stack | train |
db9767e147b666bbf6bea579 | train | function | def clear(command, canvas,columns,rows):
if len(command)!=5:
print("Wrongly specified clear command, should be: C x1 y1 x2 y2")
return
else:
x1 = int(command[1])
y1 = int(command[2])
x2 = int(command[3])
y2 = int(command[4])
if x1<0:
x1=0
if x2<... | def clear(command, canvas,columns,rows):
| if len(command)!=5:
print("Wrongly specified clear command, should be: C x1 y1 x2 y2")
return
else:
x1 = int(command[1])
y1 = int(command[2])
x2 = int(command[3])
y2 = int(command[4])
if x1<0:
x1=0
if x2<0:
x2=0
if y1<0:
y1=0... | #!/usr/bin/python3
# Programming for Engineers - KYR 2021
# Graphical Editor
# CVUT
# Timur Uzakov
import numpy as np
def clear(command, canvas,columns,rows):
| 47 | 66 | 221 | 10 | 36 | uzakotim/programming_for_engineers_ctu | task2_drawing/main.py | Python | clear | clear | 8 | 38 | 8 | 8 | ec6ed7d5018d459c7ae57a196cb993fa5f264fb0 | bigcode/the-stack | train |
c2458a384fcdc8daa18444fe | train | class | @register_pytree_node_class
class FactorialTransitions(Transitions):
"""
Transitions over several hidden states evolving in parallel.
"""
def __init__(self, transitions) -> None:
num_states = tuple(t.num_states for t in transitions)
self.num_groups = len(transitions)
self._trans... | @register_pytree_node_class
class FactorialTransitions(Transitions):
| """
Transitions over several hidden states evolving in parallel.
"""
def __init__(self, transitions) -> None:
num_states = tuple(t.num_states for t in transitions)
self.num_groups = len(transitions)
self._transitions = transitions
super(FactorialTransitions, self).__init... | from __future__ import annotations
from jax._src.numpy.lax_numpy import cov
import jax.numpy as np
from jax.tree_util import register_pytree_node_class
from tensorflow_probability.substrates import jax as tfp
tfd = tfp.distributions
from ssm.hmm.transitions import Transitions
@register_pytree_node_class
class Factori... | 84 | 115 | 385 | 15 | 68 | lindermanlab/ssm-jax-refactor | ssm/factorial_hmm/transitions.py | Python | FactorialTransitions | FactorialTransitions | 12 | 61 | 12 | 13 | 1c61ee79643bab34fff6a6e3e6b529f46271f998 | bigcode/the-stack | train |
7c7cff2051152628007cdfc0 | train | function | @client.event
async def on_message(message):
#Split the message into it's sections
message_parts = message.content.split(' ')
#If the message is a mock command
if (message_parts[0].lower() == '!wisdom'):
if len(message_parts)>1:
try:
chaos = min(max(2, int(message_par... | @client.event
async def on_message(message):
#Split the message into it's sections
| message_parts = message.content.split(' ')
#If the message is a mock command
if (message_parts[0].lower() == '!wisdom'):
if len(message_parts)>1:
try:
chaos = min(max(2, int(message_parts[1])),8)
except (ValueError, IndexError):
chaos = round((... | to file.')
with open('text_dumps/'+twitter_user+'.txt', 'w') as f:
f.write(tweet_texts)
print('Saved Tweets to file. Running application...')
#When we receive a message...
@client.event
async def on_message(message):
#Split the message into it's sections
| 68 | 68 | 229 | 19 | 49 | matt7045/FakeSpeak | fake_speak.py | Python | on_message | on_message | 40 | 58 | 40 | 42 | 19188fc4b37e56c85352440a5ae8ae5a42d13235 | bigcode/the-stack | train |
f19dc581dab5182c7fb3cd40 | train | function | @client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
print('Fetching Tweets from '+twitter_user+'...')
tweet_texts = twitterScraper.getTweetsAsString(twitter_user)
print('Fetched Tweets. Saving to file.')
with open('text_dumps/'+twitter_user+'.txt', 'w') as f:
... | @client.event
async def on_ready():
| print('We have logged in as {0.user}'.format(client))
print('Fetching Tweets from '+twitter_user+'...')
tweet_texts = twitterScraper.getTweetsAsString(twitter_user)
print('Fetched Tweets. Saving to file.')
with open('text_dumps/'+twitter_user+'.txt', 'w') as f:
f.write(tweet_texts)
print... | :
configuration = json.load(f)
twitter_user = configuration['twitter_user']
discord_token = configuration['discord_token']
#First, generate a global client we can use to talk to discord
client = discord.Client()
#Lets the console know we've successfully logged in
@client.event
async def on_ready():
| 64 | 64 | 98 | 9 | 54 | matt7045/FakeSpeak | fake_speak.py | Python | on_ready | on_ready | 27 | 35 | 27 | 28 | 63a35b2cba9a7a7af7b9537c05fd8a537985556e | bigcode/the-stack | train |
c7e9db3aec3603eeb45bc2f4 | train | function | def pixfun_complex():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_complex.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsAr... | def pixfun_complex():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_complex.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename ... | s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == 0):
return 'fail'
return 'success'
###############################################################################
# Verify imaginary part extraction from a real dataset.
def pixf... | 64 | 64 | 186 | 5 | 59 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_complex | pixfun_complex | 163 | 185 | 163 | 164 | 912a8db9e7de3a5ffafef9722d2450384eb1fcaf | bigcode/the-stack | train |
4a1163518d17881c61efc9ba | train | function | def pixfun_dB2pow():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_dB2pow.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArra... | def pixfun_dB2pow():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_dB2pow.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename =... | #if not numpy.alltrue(data == 10.**(refdata/20.)):
if not numpy.allclose(data, 10.**(refdata/20.)):
return 'fail'
return 'success'
###############################################################################
# Verify conversion from dB to power.
def pixfun_dB2pow():
| 67 | 67 | 225 | 8 | 59 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_dB2pow | pixfun_dB2pow | 901 | 925 | 901 | 902 | 7a9c87303e32bed95e4207b1bbcee0775aa536fa | bigcode/the-stack | train |
bcdcb0377929f9c46663a400 | train | function | def pixfun_log10_r():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_log10_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsAr... | def pixfun_log10_r():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_log10_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename ... | ilename)
return 'fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == numpy.sqrt(refdata)):
return 'fail'
return 'success'
###############################################################################
# Verify logarithm computation of real dataset.
def pixf... | 64 | 64 | 187 | 7 | 57 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_log10_r | pixfun_log10_r | 762 | 784 | 762 | 763 | 5a568a185c0bc5de8457d65ec644989aefbc0821 | bigcode/the-stack | train |
ced2c85ca20097a89aa33d88 | train | function | def pixfun_mod_r():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_mod_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray(... | def pixfun_mod_r():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_mod_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename = ... | return 'fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == numpy.abs(refdata)):
return 'fail'
return 'success'
###############################################################################
# Verify modulus extraction from a real (integer type) dataset.
def pixfu... | 64 | 64 | 183 | 6 | 58 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_mod_r | pixfun_mod_r | 219 | 241 | 219 | 220 | f7b1d69e2789de4a5a9653aba8ab5f9b631d1a3e | bigcode/the-stack | train |
70805a0301906ec605a8b0b2 | train | function | def pixfun_sum_r():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_sum_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray(... | def pixfun_sum_r():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_sum_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
if numpy_avail... | return 'fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == numpy.conj(refdata)):
return 'fail'
return 'success'
###############################################################################
# Verify the sum of 3 (real) datasets.
def pixfun_sum_r():
| 64 | 64 | 216 | 6 | 58 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_sum_r | pixfun_sum_r | 361 | 386 | 361 | 362 | 330ae5bd26e81080c7b5cd5f34d001c2332769ce | bigcode/the-stack | train |
dd5a8471ec5b91d61618f847 | train | function | def pixfun_mod_c():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_mod_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray(... | def pixfun_mod_c():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_mod_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename = ... | refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.allclose(data, refdata + 1j * refdata):
return 'fail'
return 'success'
###############################################################################
# Verify modulus extraction from a complex (float) dataset.
def pixfun_mod_c():
| 64 | 64 | 185 | 6 | 58 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_mod_c | pixfun_mod_c | 191 | 213 | 191 | 192 | aea6af011bcb1d26eeaae93eeb2e1ccfe774db92 | bigcode/the-stack | train |
77c622dc535c2f090af0a15c | train | function | def pixfun_cmul_c():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_cmul_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArra... | def pixfun_cmul_c():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_cmul_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename =... | fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == refdata*refdata):
return 'fail'
return 'success'
###############################################################################
# Verify the product with complex conjugate of a complex datasets.
def pixfun_cmul_c(... | 64 | 64 | 190 | 7 | 57 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_cmul_c | pixfun_cmul_c | 552 | 574 | 552 | 553 | 7ec5b2f7e121b3a0f7883b2827bfc3d08c4da115 | bigcode/the-stack | train |
07ddf531473ceca985a4a56f | train | function | def pixfun_dB_c():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_dB_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
... | def pixfun_dB_c():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_dB_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename = '... | fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.allclose(data, 20. * numpy.log10(refdata)):
return 'fail'
return 'success'
###############################################################################
# Verify dB computation of imag dataset.
def pixfun_dB_c():
| 64 | 64 | 196 | 7 | 57 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_dB_c | pixfun_dB_c | 845 | 866 | 845 | 846 | f9ebcfc418c5eee02554dda5173f8a9875663dd9 | bigcode/the-stack | train |
596d2a7ac25df88d8720809f | train | function | def pixfun_dB_r():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_dB_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
... | def pixfun_dB_r():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_dB_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename = '... | fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.allclose(data, numpy.log10(numpy.abs(refdata))):
return 'fail'
return 'success'
###############################################################################
# Verify dB computation of real dataset.
def pixfun_dB_r():
| 64 | 64 | 191 | 7 | 57 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_dB_r | pixfun_dB_r | 817 | 839 | 817 | 818 | c5c5b22818f7cc395a487bec080708cf2482913a | bigcode/the-stack | train |
9fedf3624b879f75d05d4d75 | train | function | def pixfun_diff_r():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_diff_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArra... | def pixfun_diff_r():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_diff_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename =... | open "%s" dataset.' % reffilename)
return 'fail'
refdata += refds.GetRasterBand(1).ReadAsArray(0, 0, 5, 6)
if not numpy.alltrue(data == refdata):
return 'fail'
return 'success'
###############################################################################
# Veri... | 84 | 84 | 281 | 6 | 78 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_diff_r | pixfun_diff_r | 423 | 452 | 423 | 424 | 4f85a700458d2d61e5e95f58da0c97b4a3144c7e | bigcode/the-stack | train |
d1671fc8fc2a74f3a6e600e8 | train | function | def pixfun_imag_c():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_imag_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArra... | def pixfun_imag_c():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_imag_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename =... | daltest.post_reason('Unable to open "%s" dataset.' % reffilename)
return 'fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == refdata.real):
return 'fail'
return 'success'
###############################################################################
# Veri... | 80 | 80 | 267 | 7 | 73 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_imag_c | pixfun_imag_c | 104 | 136 | 104 | 105 | 57d3600a2a64e466c492f3f6f6dd64926c241dae | bigcode/the-stack | train |
f7ae0e105a1bd8570d92341d | train | function | def pixfun_mul_c():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_mul_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray(... | def pixfun_mul_c():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_mul_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename = ... | ilename)
return 'fail'
refdata *= refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == refdata):
return 'fail'
return 'success'
###############################################################################
# Verify the product of 2 (complex) dataset... | 64 | 64 | 186 | 6 | 58 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_mul_c | pixfun_mul_c | 524 | 546 | 524 | 525 | 650a99bcb25ad975e41c6f4fa5aae0ca2bb48afa | bigcode/the-stack | train |
1d2c104d4b83079efb03779e | train | function | def pixfun_inv_r():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_inv_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray(... | def pixfun_inv_r():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_inv_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename = ... | ReadAsArray()
refdata2 = refdata2.astype('float64')
if not numpy.alltrue(data == refdata1 * refdata2.conj()):
return 'fail'
return 'success'
###############################################################################
# Verify computation of the inverse of a real datasets.
def pixfun_inv_r():... | 64 | 64 | 196 | 6 | 58 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_inv_r | pixfun_inv_r | 617 | 640 | 617 | 618 | f98794af32821fa793ad5e3750ee5a07b932d252 | bigcode/the-stack | train |
c6481c28665b0d6079b94ddb | train | function | def pixfun_conj_r():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_conj_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArra... | def pixfun_conj_r():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_conj_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename =... | 'fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == numpy.conj(refdata)):
return 'fail'
return 'success'
###############################################################################
# Verify cmplex conjugare computation on a real dataset.
def pixfun_conj_r():
| 64 | 64 | 186 | 7 | 57 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_conj_r | pixfun_conj_r | 333 | 355 | 333 | 334 | 170aca0f1a12a92011156f36fca87c5c67af1a62 | bigcode/the-stack | train |
7c172827cae2aaead808abc0 | train | function | def pixfun_inv_c():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_inv_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray(... | def pixfun_inv_c():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_inv_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename = ... | refdata = refds.GetRasterBand(1).ReadAsArray()
refdata = refdata.astype('float64')
if not numpy.alltrue(data == 1./refdata):
return 'fail'
return 'success'
###############################################################################
# Verify computation of the inverse of a complex datasets.
... | 69 | 69 | 232 | 6 | 63 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_inv_c | pixfun_inv_c | 646 | 672 | 646 | 647 | 040c0e56cce417c7ca7437255394de0ed99df8e4 | bigcode/the-stack | train |
a275d4abdd4148057a3766eb | train | function | def pixfun_phase_r():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_phase_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsAr... | def pixfun_phase_r():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_phase_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename ... | close(data, numpy.arctan2(refdata.imag, refdata.real)):
if not numpy.alltrue(data == numpy.arctan2(refdata.imag, refdata.real)):
return 'fail'
return 'success'
###############################################################################
# Verify phase extraction from a real dataset.
def pixfun_pha... | 64 | 64 | 193 | 6 | 58 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_phase_r | pixfun_phase_r | 277 | 299 | 277 | 278 | 4d3d39f44f091a0e5b530b73c022e671ae973800 | bigcode/the-stack | train |
20abf7588146ff7a535696fc | train | function | def pixfun_mul_r():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_mul_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray(... | def pixfun_mul_r():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_mul_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
if numpy_avail... | Band(1).ReadAsArray(0, 0, 5, 6)
if not numpy.alltrue(data == refdata1-refdata2):
return 'fail'
return 'success'
###############################################################################
# Verify the product of 3 (real) datasets.
def pixfun_mul_r():
| 64 | 64 | 216 | 6 | 58 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_mul_r | pixfun_mul_r | 493 | 518 | 493 | 494 | 1f8945c52c0e3d698ad0b078a54c79ce436609c8 | bigcode/the-stack | train |
aa248a060c56659d6ecd5969 | train | function | def pixfun_real_c():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_real_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArra... | def pixfun_real_c():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_real_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename =... | ###
import sys
try:
import numpy
numpy_available = True
except ImportError:
numpy_available = False
from osgeo import gdal
sys.path.append('../pymod')
import gdaltest
###############################################################################
# Verify real part extraction from a complex dataset.
d... | 64 | 64 | 184 | 6 | 58 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_real_c | pixfun_real_c | 48 | 70 | 48 | 49 | e92fb46a122e473983f3e6519872cae5ba3510e6 | bigcode/the-stack | train |
4e6ae4c885931f0575ccb0f1 | train | function | def pixfun_real_r():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_real_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArra... | def pixfun_real_r():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_real_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename =... | ffilename)
return 'fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == refdata.real):
return 'fail'
return 'success'
###############################################################################
# Verify real part extraction from a complex dataset.
def pix... | 64 | 64 | 182 | 6 | 58 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_real_r | pixfun_real_r | 76 | 98 | 76 | 77 | 5357c73884b24edcbd6b1e9ef282abdf1a664d5a | bigcode/the-stack | train |
b70f19e49325161ba62d38dc | train | function | def pixfun_phase_c():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_phase_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsAr... | def pixfun_phase_c():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_phase_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename ... | .' % reffilename)
return 'fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == numpy.abs(refdata)):
return 'fail'
return 'success'
###############################################################################
# Verify phase extraction from a complex dataset... | 67 | 67 | 226 | 6 | 61 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_phase_c | pixfun_phase_c | 247 | 271 | 247 | 248 | 32b6af758eb2b1c05c8549c27dff07911e62e2b9 | bigcode/the-stack | train |
cd4d2fdc6e1171111cd4fa8a | train | function | def pixfun_sum_c():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_sum_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray(... | def pixfun_sum_c():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_sum_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
if numpy_avail... | ilename)
return 'fail'
refdata += refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == refdata):
return 'fail'
return 'success'
###############################################################################
# Verify the sum of 3 (two complex and one ... | 68 | 68 | 229 | 6 | 62 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_sum_c | pixfun_sum_c | 392 | 417 | 392 | 393 | 60c68d52bd71fb495636c1481a9ca9e31010ac87 | bigcode/the-stack | train |
95b6aa19873fbd9d9ba4300b | train | function | def pixfun_conj_c():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_conj_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArra... | def pixfun_conj_c():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_conj_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename =... | data = refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == numpy.arctan2(0, refdata)):
return 'fail'
return 'success'
###############################################################################
# Verify cmplex conjugare computation on a complex dataset.
def pixfun_conj_c():
| 64 | 64 | 188 | 7 | 57 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_conj_c | pixfun_conj_c | 305 | 327 | 305 | 306 | c33c0ebc51aeab87fcc7099bb0c31db6ff1db0ef | bigcode/the-stack | train |
716c2db9d727be9654bc23de | train | function | def pixfun_imag_r():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_imag_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArra... | def pixfun_imag_r():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_imag_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
if not numpy.... | RasterBand(1).ReadAsArray()
copied_ds = None
if not numpy.alltrue(data == data_ds):
gdaltest.post_reason('fail')
return 'fail'
return 'success'
###############################################################################
# Verify imaginary part extraction from a real dataset.
def pixf... | 64 | 64 | 112 | 7 | 57 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_imag_r | pixfun_imag_r | 142 | 157 | 142 | 143 | e9b6773749b0d947e844e40c6704bc613b4d7082 | bigcode/the-stack | train |
69e0dbc165bead56c8586331 | train | function | def pixfun_dB2amp():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_dB2amp.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArra... | def pixfun_dB2amp():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_dB2amp.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename =... | = refds.GetRasterBand(1).ReadAsArray()
if not numpy.allclose(data, 20. * numpy.log10(numpy.abs(refdata))):
return 'fail'
return 'success'
###############################################################################
# Verify conversion from dB to amplitude.
def pixfun_dB2amp():
| 64 | 64 | 214 | 8 | 56 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_dB2amp | pixfun_dB2amp | 872 | 895 | 872 | 873 | ce721f224590e13417ddc8eaf1cad95a0cb6a8ea | bigcode/the-stack | train |
c8c21ec0027a41be16627d29 | train | function | def pixfun_intensity_r():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_intensity_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).... | def pixfun_intensity_r():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_intensity_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilen... | fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == (refdata*refdata.conj()).real):
return 'fail'
return 'success'
###############################################################################
# Verify intensity computation of real dataset.
def pixfun_intensity_r(... | 64 | 64 | 192 | 7 | 57 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_intensity_r | pixfun_intensity_r | 706 | 728 | 706 | 707 | 153b39690fe975681f033a7f119d5b388af66cdd | bigcode/the-stack | train |
3052b9f9ca46d4541694f581 | train | function | def pixfun_diff_c():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_diff_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArra... | def pixfun_diff_c():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_diff_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename =... | ffilename)
return 'fail'
refdata2 = refds.GetRasterBand(1).ReadAsArray(10, 10, 5, 6)
if not numpy.alltrue(data == refdata1-refdata2):
return 'fail'
return 'success'
###############################################################################
# Verify the difference of 2 (complex) data... | 81 | 81 | 272 | 6 | 75 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_diff_c | pixfun_diff_c | 458 | 487 | 458 | 459 | ef57df360f287ea5dfa312dd83cad82f2969aeb2 | bigcode/the-stack | train |
1e72cc5c76ab0554e28a0397 | train | function | def pixfun_intensity_c():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_intensity_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).... | def pixfun_intensity_c():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_intensity_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilen... | numpy.alltrue(abs(delta.real) < 1e-13):
return 'fail'
if not numpy.alltrue(abs(delta.imag) < 1e-13):
return 'fail'
return 'success'
###############################################################################
# Verify intensity computation of a complex dataset.
def pixfun_intensity_c():
| 64 | 64 | 193 | 7 | 57 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_intensity_c | pixfun_intensity_c | 678 | 700 | 678 | 679 | 3a90380d2f63fe121c199f84f01a6360e48cce67 | bigcode/the-stack | train |
a74e92ba50d96a15b5664a39 | train | function | def pixfun_cmul_r():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_cmul_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArra... | def pixfun_cmul_r():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_cmul_r.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename =... | daltest.post_reason('Unable to open "%s" dataset.' % reffilename)
return 'fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == refdata*refdata.conj()):
return 'fail'
return 'success'
############################################################################... | 87 | 87 | 290 | 7 | 80 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_cmul_r | pixfun_cmul_r | 580 | 611 | 580 | 581 | e114e21d6a1b601b5551882af92830f9a3dc61c4 | bigcode/the-stack | train |
7cf86a2f8417401fa305f3cc | train | function | def pixfun_log10_c():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_log10_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsAr... | def pixfun_log10_c():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_log10_c.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename ... | )
return 'fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == numpy.log10(refdata)):
return 'fail'
return 'success'
###############################################################################
# Verify logarithm computation of imag dataset.
def pixfun_log... | 64 | 64 | 192 | 7 | 57 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_log10_c | pixfun_log10_c | 790 | 811 | 790 | 791 | a293ff41af13dbc08289598de5e11a5c0f380233 | bigcode/the-stack | train |
83474c9a683b006252397e00 | train | function | def pixfun_sqrt():
if not numpy_available:
return 'skip'
filename = 'data/pixfun_sqrt.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
... | def pixfun_sqrt():
| if not numpy_available:
return 'skip'
filename = 'data/pixfun_sqrt.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
return 'fail'
data = ds.GetRasterBand(1).ReadAsArray()
reffilename = '... | return 'fail'
refdata = refds.GetRasterBand(1).ReadAsArray()
if not numpy.alltrue(data == (refdata*refdata.conj()).real):
return 'fail'
return 'success'
###############################################################################
# Verify square root computation.
def pixfun_sqrt():
| 64 | 64 | 184 | 6 | 58 | Symena/gdal | autotest/gcore/pixfun.py | Python | pixfun_sqrt | pixfun_sqrt | 734 | 756 | 734 | 735 | 0f4770072c4b5d46d42bef74fdbac117bbcb8bd8 | bigcode/the-stack | train |
ca79dcc7c0b1fe591e63cb51 | train | class | class User(BaseObject):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self, id=None, created_at=None, email=None, time_zone=None, updated_at=None, first_name=None, last_name=None, phone=None, mfa_enabled=None, disable_d... | class User(BaseObject):
| """
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self, id=None, created_at=None, email=None, time_zone=None, updated_at=None, first_name=None, last_name=None, phone=None, mfa_enabled=None, disable_daily_emails=None, locked... | # coding: utf-8
"""
ESP Documentation
The Evident Security Platform API (version 2.0) is designed to allow users granular control over their Amazon Web Service security experience by allowing them to review alerts, monitor signatures, and create custom signatures.
OpenAPI spec version: v2_sdk
Ge... | 110 | 256 | 3,656 | 5 | 104 | zimmermanc/esp-sdk-python | esp_sdk/models/user.py | Python | User | User | 20 | 638 | 20 | 20 | f28343de3ff4308d0221c9a61b7fd2bed2bd8674 | bigcode/the-stack | train |
e5b7c80ba56358de6ade85d9 | train | function | @transform(("pipeline.yml",),
regex("(.*)\.(.*)"),
r"\1.counts")
def count_words(infile, outfile):
'''count the number of words in the pipeline configuration files.'''
# the command line statement we want to execute
statement = '''awk 'BEGIN { printf("word\\tfreq\\n"); }
{for (i ... | @transform(("pipeline.yml",),
regex("(.*)\.(.*)"),
r"\1.counts")
def count_words(infile, outfile):
| '''count the number of words in the pipeline configuration files.'''
# the command line statement we want to execute
statement = '''awk 'BEGIN { printf("word\\tfreq\\n"); }
{for (i = 1; i <= NF; i++) freq[$i]++}
END { for (word in freq) printf "%%s\\t%%d\\n", word, freq[word] }'
< %(infile)s >... | genesets",
on_error_raise=__name__ == "__main__",
prefix="annotations_",
update_interface=True))
# ---------------------------------------------------
# Specific pipeline tasks
@transform(("pipeline.yml",),
regex("(.*)\.(.*)"),
r"\1.counts")
def count_words(infile, outfile):
| 66 | 66 | 221 | 31 | 34 | CristinaAlexandru/cgat-flow | CGATPipelines/pipeline_template_data/pipeline_template_full.py | Python | count_words | count_words | 94 | 113 | 94 | 97 | e304dc3de3744908ed81c5c014250d7d8c26ca54 | bigcode/the-stack | train |
e19c137172d8bb9c9af9d443 | train | function | @follows(load_word_counts)
def full():
pass
| @follows(load_word_counts)
def full():
| pass
| _words,
suffix(".counts"),
"_counts.load")
def load_word_counts(infile, outfile):
'''load results of word counting into database.'''
P.load(infile, outfile, "--add-index=word")
# ---------------------------------------------------
# Generic pipeline tasks
@follows(load_word_counts)
def f... | 64 | 64 | 13 | 10 | 53 | CristinaAlexandru/cgat-flow | CGATPipelines/pipeline_template_data/pipeline_template_full.py | Python | full | full | 126 | 128 | 126 | 127 | 557ed4f69ab7b61ab9d090caa6d18573550dd621 | bigcode/the-stack | train |
300eb8c3a5e9d9579b3195df | train | function | def main(argv=None):
if argv is None:
argv = sys.argv
P.main(argv)
| def main(argv=None):
| if argv is None:
argv = sys.argv
P.main(argv)
| "_counts.load")
def load_word_counts(infile, outfile):
'''load results of word counting into database.'''
P.load(infile, outfile, "--add-index=word")
# ---------------------------------------------------
# Generic pipeline tasks
@follows(load_word_counts)
def full():
pass
def main(argv=None):
| 64 | 64 | 22 | 5 | 58 | CristinaAlexandru/cgat-flow | CGATPipelines/pipeline_template_data/pipeline_template_full.py | Python | main | main | 131 | 134 | 131 | 131 | 0a7b47a2861b82bc85844f2e16961dd9a2997266 | bigcode/the-stack | train |
a3555aa8e6adf636d6fcaf9d | train | function | @transform(count_words,
suffix(".counts"),
"_counts.load")
def load_word_counts(infile, outfile):
'''load results of word counting into database.'''
P.load(infile, outfile, "--add-index=word")
| @transform(count_words,
suffix(".counts"),
"_counts.load")
def load_word_counts(infile, outfile):
| '''load results of word counting into database.'''
P.load(infile, outfile, "--add-index=word")
| that are declared in the calling
# function. For example, %(infile)s will we substituted with the
# contents of the variable "infile".
P.run(statement)
@transform(count_words,
suffix(".counts"),
"_counts.load")
def load_word_counts(infile, outfile):
| 64 | 64 | 49 | 24 | 40 | CristinaAlexandru/cgat-flow | CGATPipelines/pipeline_template_data/pipeline_template_full.py | Python | load_word_counts | load_word_counts | 116 | 121 | 116 | 119 | ae9cc5fdc964a8b98aea75891cf458f2d14b375c | bigcode/the-stack | train |
c51fe0f708a5305dab2bf87b | train | function | def remove_dollar(form_str):
"""Remove the dollar sign from a string and return a float"""
return float(form_str.replace('$', ''))
| def remove_dollar(form_str):
| """Remove the dollar sign from a string and return a float"""
return float(form_str.replace('$', ''))
| .required()])
other_phone= TextField('OTHER: Phone, internet', validators=[validators.required()])
other_other = TextField('OTHER: Please explain in section E (below)', validators=[validators.required()])
registration = TextField('Registration Fee:', validators=[validators.required()])
def remove_dollar(for... | 63 | 64 | 31 | 7 | 57 | stscicrawford/travelreform | travelreform.py | Python | remove_dollar | remove_dollar | 102 | 104 | 102 | 102 | c2b34843f3804be4003a1e0730b25cfe576c58d6 | bigcode/the-stack | train |
bff50abf5b628af638026864 | train | class | class TravelAdvance(Form):
need_advance = TextField('Do you need a travel advance?', validators=[validators.required()])
how_much_advance = TextField('How much?')
any_part_personal = TextField('Is any part of this trip personal?', validators=[validators.required()])
personal_travel_dates = DateField('If... | class TravelAdvance(Form):
| need_advance = TextField('Do you need a travel advance?', validators=[validators.required()])
how_much_advance = TextField('How much?')
any_part_personal = TextField('Is any part of this trip personal?', validators=[validators.required()])
personal_travel_dates = DateField('If so, specify dates:')
p... | forms import IntegerField
# App config.
DEBUG = True
app = Flask(__name__)
app.config.from_object(__name__)
app.config['SECRET_KEY'] = '7d441f27d441f27567d441f2b6176a'
wbs_flag = False
class TravelAdvance(Form):
| 64 | 64 | 91 | 5 | 58 | stscicrawford/travelreform | travelreform.py | Python | TravelAdvance | TravelAdvance | 13 | 18 | 13 | 13 | 3d8eb49f171b2e3e6d7e7659d31f280522be994f | bigcode/the-stack | train |
d8dae4c9f0373aa8f88cb4e6 | train | class | class BasicInfoForm(Form):
name = TextField('Name of Traveler:', validators=[validators.required()])
title = TextField('Traveler Title:', validators=[validators.required()])
phone = TextField('Phone:', validators=[validators.required()])
email = TextField('Email:', validators=[validators.required()])
... | class BasicInfoForm(Form):
| name = TextField('Name of Traveler:', validators=[validators.required()])
title = TextField('Traveler Title:', validators=[validators.required()])
phone = TextField('Phone:', validators=[validators.required()])
email = TextField('Email:', validators=[validators.required()])
date_start = DateField('S... | from flask import Flask, render_template, flash, request
from wtforms import Form, TextField, TextAreaField, SelectField
from wtforms import validators, StringField, SubmitField, DateField
from wtforms import IntegerField
# App config.
DEBUG = True
app = Flask(__name__)
app.config.from_object(__name__)
app.config['SEC... | 201 | 256 | 997 | 6 | 196 | stscicrawford/travelreform | travelreform.py | Python | BasicInfoForm | BasicInfoForm | 21 | 100 | 21 | 21 | e0d5494ae00b61a683c7986dfdccb5a4ac3847d8 | bigcode/the-stack | train |
ad1ec5958fbf3955a51263cb | train | function | @app.route("/", methods=['GET', 'POST'])
def hello():
form = BasicInfoForm(request.form)
print(form.errors)
if request.method == 'POST':
# wbs_flag = True
if form.validate():
registration = remove_dollar(request.form['registration'])
total_airfare = remove_dollar... | @app.route("/", methods=['GET', 'POST'])
def hello():
| form = BasicInfoForm(request.form)
print(form.errors)
if request.method == 'POST':
# wbs_flag = True
if form.validate():
registration = remove_dollar(request.form['registration'])
total_airfare = remove_dollar(request.form['airfare'])
total_hotel = in... | validators=[validators.required()])
other_phone= TextField('OTHER: Phone, internet', validators=[validators.required()])
other_other = TextField('OTHER: Please explain in section E (below)', validators=[validators.required()])
registration = TextField('Registration Fee:', validators=[validators.required()]... | 104 | 105 | 351 | 13 | 91 | stscicrawford/travelreform | travelreform.py | Python | hello | hello | 111 | 141 | 111 | 112 | 1a85e1812888e5b3b0062817e81ea7cbe962df93 | bigcode/the-stack | train |
024daf78aa77d6e6007970b9 | train | function | def get_image_index(save_path):
return len(glob.glob(save_path + '/*.png'))
| def get_image_index(save_path):
| return len(glob.glob(save_path + '/*.png'))
| IMAGE_HEIGHT = 600
render_settings = dict()
render_settings['renderImage'] = True
render_settings['renderDepthImage'] = True
render_settings['renderObjectImage'] = True
render_settings['renderClassImage'] = True
video_saver = VideoSaver()
def get_image_index(save_path):
| 64 | 64 | 20 | 7 | 57 | belindal/exploration | gen/scripts/augment_trajectories.py | Python | get_image_index | get_image_index | 43 | 44 | 43 | 43 | 8d5849c140d2a90c3163e87843507169f33d7426 | bigcode/the-stack | train |
ee4a7a550382a4a044cba0ba | train | function | def augment_traj(env, json_file):
# load json data
with open(json_file) as f:
traj_data = json.load(f)
# make directories
root_dir = json_file.replace(TRAJ_DATA_JSON_FILENAME, "")
orig_images_dir = os.path.join(root_dir, ORIGINAL_IMAGES_FORLDER)
high_res_images_dir = os.path.join(root_... | def augment_traj(env, json_file):
# load json data
| with open(json_file) as f:
traj_data = json.load(f)
# make directories
root_dir = json_file.replace(TRAJ_DATA_JSON_FILENAME, "")
orig_images_dir = os.path.join(root_dir, ORIGINAL_IMAGES_FORLDER)
high_res_images_dir = os.path.join(root_dir, HIGH_RES_IMAGES_FOLDER)
depth_images_dir = os.... | _path = os.path.join(save_path, HIGH_RES_IMAGES_FOLDER)
rgb_image = event.frame[:, :, ::-1]
# depth
depth_save_path = os.path.join(save_path, DEPTH_IMAGES_FOLDER)
depth_image = event.depth_frame
depth_image = depth_image * (255 / 10000)
depth_image = depth_image.astype(np.uint8)
# masks
... | 256 | 256 | 1,496 | 15 | 241 | belindal/exploration | gen/scripts/augment_trajectories.py | Python | augment_traj | augment_traj | 92 | 244 | 92 | 93 | 8a54b273ceeaf7f03eef1af1f621652caa32e6de | bigcode/the-stack | train |
3b00ff4659321eaf78bb167c | train | function | def save_images_in_events(events, root_dir):
for event in events:
save_image(event, root_dir)
| def save_images_in_events(events, root_dir):
| for event in events:
save_image(event, root_dir)
| % im_ind, rgb_image)
cv2.imwrite(depth_save_path + '/%09d.png' % im_ind, depth_image)
cv2.imwrite(mask_save_path + '/%09d.png' % im_ind, mask_image)
return im_ind
def save_images_in_events(events, root_dir):
| 64 | 64 | 24 | 10 | 53 | belindal/exploration | gen/scripts/augment_trajectories.py | Python | save_images_in_events | save_images_in_events | 81 | 83 | 81 | 81 | 86c98aa023da9460cbbfd4fb392eb0dec4c9da64 | bigcode/the-stack | train |
c1970e7bbb5d9e3f00e086e3 | train | function | def run():
'''
replay loop
'''
# start THOR env
env = ThorEnv(player_screen_width=IMAGE_WIDTH,
player_screen_height=IMAGE_HEIGHT)
skipped_files = []
while len(traj_list) > 0:
lock.acquire()
json_file = traj_list.pop()
lock.release()
print ... | def run():
| '''
replay loop
'''
# start THOR env
env = ThorEnv(player_screen_width=IMAGE_WIDTH,
player_screen_height=IMAGE_HEIGHT)
skipped_files = []
while len(traj_list) > 0:
lock.acquire()
json_file = traj_list.pop()
lock.release()
print ("Augmentin... | new_img_count = get_image_index(orig_images_dir)
print ("Original Image Count %d, New Image Count %d" % (orig_img_count, new_img_count))
if orig_img_count != new_img_count:
raise Exception("WARNING: the augmented sequence length doesn't match the original")
def run():
| 64 | 64 | 172 | 3 | 61 | belindal/exploration | gen/scripts/augment_trajectories.py | Python | run | run | 247 | 278 | 247 | 247 | d754f96fec3534c99b9d0acbee42e3ba1df6fb84 | bigcode/the-stack | train |
3be2c82d12e0f2a2fe0b2d6c | train | function | def clear_and_create_dir(path):
if os.path.exists(path):
shutil.rmtree(path)
os.mkdir(path)
| def clear_and_create_dir(path):
| if os.path.exists(path):
shutil.rmtree(path)
os.mkdir(path)
| % im_ind, depth_image)
cv2.imwrite(mask_save_path + '/%09d.png' % im_ind, mask_image)
return im_ind
def save_images_in_events(events, root_dir):
for event in events:
save_image(event, root_dir)
def clear_and_create_dir(path):
| 64 | 64 | 25 | 7 | 57 | belindal/exploration | gen/scripts/augment_trajectories.py | Python | clear_and_create_dir | clear_and_create_dir | 86 | 89 | 86 | 86 | fcb645912c62002d98abffc13653c2e25b077c28 | bigcode/the-stack | train |
68de9261ef6f24c9e80dc4fa | train | function | def save_image(event, save_path):
# rgb
rgb_save_path = os.path.join(save_path, HIGH_RES_IMAGES_FOLDER)
rgb_image = event.frame[:, :, ::-1]
# depth
depth_save_path = os.path.join(save_path, DEPTH_IMAGES_FOLDER)
depth_image = event.depth_frame
depth_image = depth_image * (255 / 10000)
de... | def save_image(event, save_path):
# rgb
| rgb_save_path = os.path.join(save_path, HIGH_RES_IMAGES_FOLDER)
rgb_image = event.frame[:, :, ::-1]
# depth
depth_save_path = os.path.join(save_path, DEPTH_IMAGES_FOLDER)
depth_image = event.depth_frame
depth_image = depth_image * (255 / 10000)
depth_image = depth_image.astype(np.uint8)
... | _index(save_path)
counts = constants.SAVE_FRAME_BEFORE_AND_AFTER_COUNTS[action['action']][direction]
for i in range(counts):
save_image(env.last_event, save_path)
env.noop()
return im_ind
def save_image(event, save_path):
# rgb
| 64 | 64 | 207 | 12 | 51 | belindal/exploration | gen/scripts/augment_trajectories.py | Python | save_image | save_image | 57 | 78 | 57 | 58 | 66a2727124f246807094d3a8893e3a807cd24b90 | bigcode/the-stack | train |
f1413396e635d72605e08cf1 | train | function | def save_image_with_delays(env, action,
save_path, direction=constants.BEFORE):
im_ind = get_image_index(save_path)
counts = constants.SAVE_FRAME_BEFORE_AND_AFTER_COUNTS[action['action']][direction]
for i in range(counts):
save_image(env.last_event, save_path)
env.... | def save_image_with_delays(env, action,
save_path, direction=constants.BEFORE):
| im_ind = get_image_index(save_path)
counts = constants.SAVE_FRAME_BEFORE_AND_AFTER_COUNTS[action['action']][direction]
for i in range(counts):
save_image(env.last_event, save_path)
env.noop()
return im_ind
| Image'] = True
render_settings['renderClassImage'] = True
video_saver = VideoSaver()
def get_image_index(save_path):
return len(glob.glob(save_path + '/*.png'))
def save_image_with_delays(env, action,
save_path, direction=constants.BEFORE):
| 63 | 64 | 79 | 21 | 42 | belindal/exploration | gen/scripts/augment_trajectories.py | Python | save_image_with_delays | save_image_with_delays | 47 | 54 | 47 | 48 | 9a89b1080f1482980cda9f4f0ac56b1ac0f9dd61 | bigcode/the-stack | train |
2eb5f6829c97561f4cd29b6a | train | class | class Fb(Screen):
def download_video(self, video_url, name):
try:
url = re.search('hd_src:"(.+?)"', video_url)[1]
self.ids.error.text = 'HD Video'
except:
try:
url = re.search('sd_src:"(.+?)"', video_url)[1]
self.ids.error.text = '4... | class Fb(Screen):
| def download_video(self, video_url, name):
try:
url = re.search('hd_src:"(.+?)"', video_url)[1]
self.ids.error.text = 'HD Video'
except:
try:
url = re.search('sd_src:"(.+?)"', video_url)[1]
self.ids.error.text = '480p Video'
... | from kivy.uix.screenmanager import Screen
import os
import re
import requests
import urllib.request
import os
import subprocess as s
class Fb(Screen):
| 35 | 76 | 254 | 4 | 30 | dirsoooo/social-media-downloader | downloader/gui/fb.py | Python | Fb | Fb | 10 | 43 | 10 | 10 | 5f73f148da62eca14ea0a09bdba6ef819131c359 | bigcode/the-stack | train |
88e19ca272ecf4b8f5a2b44c | train | function | def batchify(fn, chunk):
"""
Constructs a version of 'fn' that applies to smaller batches
"""
if chunk is None:
return fn
def ret(inputs):
return torch.cat([fn(inputs[i:i+chunk]) for i in range(0, inputs.shape[0], chunk)], 0)
return ret
| def batchify(fn, chunk):
| """
Constructs a version of 'fn' that applies to smaller batches
"""
if chunk is None:
return fn
def ret(inputs):
return torch.cat([fn(inputs[i:i+chunk]) for i in range(0, inputs.shape[0], chunk)], 0)
return ret
| )
real = np.expand_dims(np.real(spectro), axis=0)
imag = np.expand_dims(np.imag(spectro), axis=0)
spectro_two_channel = np.concatenate((real, imag), axis=0)
return spectro_two_channel
def batchify(fn, chunk):
| 64 | 64 | 73 | 7 | 56 | rhgao/ObjectFolder | ObjectFolder1.0/TouchNet_utils.py | Python | batchify | batchify | 44 | 52 | 44 | 44 | 52ab60529b18cea80d62f085ccf8c85ae8c4e620 | bigcode/the-stack | train |
026e69c4345cabcaa7c03ea3 | train | function | def generate_spectrogram_magphase(audio, stft_frame, stft_hop, n_fft, with_phase=False):
spectro = librosa.core.stft(audio, hop_length=stft_hop, n_fft=n_fft, win_length=stft_frame, center=True)
spectro_mag, spectro_phase = librosa.core.magphase(spectro)
spectro_mag = np.expand_dims(spectro_mag, axis=0)
... | def generate_spectrogram_magphase(audio, stft_frame, stft_hop, n_fft, with_phase=False):
| spectro = librosa.core.stft(audio, hop_length=stft_hop, n_fft=n_fft, win_length=stft_frame, center=True)
spectro_mag, spectro_phase = librosa.core.magphase(spectro)
spectro_mag = np.expand_dims(spectro_mag, axis=0)
if with_phase:
spectro_phase = np.expand_dims(np.angle(spectro_phase), axis=0)
... | _state_dict
def mkdirs(path, remove=False):
if os.path.isdir(path):
if remove:
shutil.rmtree(path)
else:
return
os.makedirs(path)
def generate_spectrogram_magphase(audio, stft_frame, stft_hop, n_fft, with_phase=False):
| 64 | 64 | 137 | 25 | 39 | rhgao/ObjectFolder | ObjectFolder1.0/TouchNet_utils.py | Python | generate_spectrogram_magphase | generate_spectrogram_magphase | 27 | 35 | 27 | 27 | 8e821b8490448c7a40c7bdd6bdc93e786f4fa354 | bigcode/the-stack | train |
a450e23fc2531d23b76aa4f0 | train | function | def run_network(inputs, viewdirs, fn, embed_fn, embeddirs_fn, netchunk=1024*64):
"""
Prepares inputs and applies network 'fn'.
"""
inputs_flat = torch.reshape(inputs, [-1, inputs.shape[-1]])
embedded = embed_fn(inputs_flat)
if viewdirs is not None:
input_dirs = viewdirs[:,None].expand(i... | def run_network(inputs, viewdirs, fn, embed_fn, embeddirs_fn, netchunk=1024*64):
| """
Prepares inputs and applies network 'fn'.
"""
inputs_flat = torch.reshape(inputs, [-1, inputs.shape[-1]])
embedded = embed_fn(inputs_flat)
if viewdirs is not None:
input_dirs = viewdirs[:,None].expand(inputs.shape)
input_dirs_flat = torch.reshape(input_dirs, [-1, input_dirs.... | def ret(inputs):
return torch.cat([fn(inputs[i:i+chunk]) for i in range(0, inputs.shape[0], chunk)], 0)
return ret
def run_network(inputs, viewdirs, fn, embed_fn, embeddirs_fn, netchunk=1024*64):
| 64 | 64 | 169 | 26 | 37 | rhgao/ObjectFolder | ObjectFolder1.0/TouchNet_utils.py | Python | run_network | run_network | 54 | 69 | 54 | 54 | 043748dc237129372523e326c578245761c07de6 | bigcode/the-stack | train |
1f91245237766b033916a4e4 | train | function | def create_nerf(args):
"""
Instantiate NeRF's MLP model.
"""
embed_fn, input_ch = get_embedder(args.multires, args.i_embed)
input_ch_views = 0
embeddirs_fn = None
if args.use_viewdirs:
embeddirs_fn, input_ch_views = get_embedder(args.multires_views, args.i_embed)
output_ch = 2
... | def create_nerf(args):
| """
Instantiate NeRF's MLP model.
"""
embed_fn, input_ch = get_embedder(args.multires, args.i_embed)
input_ch_views = 0
embeddirs_fn = None
if args.use_viewdirs:
embeddirs_fn, input_ch_views = get_embedder(args.multires_views, args.i_embed)
output_ch = 2
skips = [4]
mode... | ': True,
'periodic_fns': [torch.sin, torch.cos],
}
embedder_obj = Embedder(**embed_kwargs)
embed = lambda x, eo=embedder_obj: eo.embed(x)
return embed, embedder_obj.out_dim
"""
def create_nerf(args):
| 64 | 64 | 163 | 7 | 57 | rhgao/ObjectFolder | ObjectFolder1.0/TouchNet_utils.py | Python | create_nerf | create_nerf | 91 | 107 | 91 | 91 | ab24d3edda3de537446b68b6ea1b3cd29e4523e2 | bigcode/the-stack | train |
47ab2b0b34e264ddf8e3101c | train | function | def mkdirs(path, remove=False):
if os.path.isdir(path):
if remove:
shutil.rmtree(path)
else:
return
os.makedirs(path)
| def mkdirs(path, remove=False):
| if os.path.isdir(path):
if remove:
shutil.rmtree(path)
else:
return
os.makedirs(path)
| ())
if not all(key.startswith(prefix) for key in keys):
return state_dict
stripped_state_dict = OrderedDict()
for key, value in state_dict.items():
stripped_state_dict[key.replace(prefix, "")] = value
return stripped_state_dict
def mkdirs(path, remove=False):
| 64 | 64 | 36 | 8 | 55 | rhgao/ObjectFolder | ObjectFolder1.0/TouchNet_utils.py | Python | mkdirs | mkdirs | 19 | 25 | 19 | 19 | cde2bb72fe1cfd3d0db9a3c9fbb8a44de01c607a | bigcode/the-stack | train |
2d84f84799d4993a7beacad5 | train | function | def generate_spectrogram_complex(audio, stft_frame, stft_hop, n_fft):
spectro = librosa.core.stft(audio, hop_length=stft_hop, n_fft=n_fft, win_length=stft_frame, center=True)
real = np.expand_dims(np.real(spectro), axis=0)
imag = np.expand_dims(np.imag(spectro), axis=0)
spectro_two_channel = np.concaten... | def generate_spectrogram_complex(audio, stft_frame, stft_hop, n_fft):
| spectro = librosa.core.stft(audio, hop_length=stft_hop, n_fft=n_fft, win_length=stft_frame, center=True)
real = np.expand_dims(np.real(spectro), axis=0)
imag = np.expand_dims(np.imag(spectro), axis=0)
spectro_two_channel = np.concatenate((real, imag), axis=0)
return spectro_two_channel
| )
if with_phase:
spectro_phase = np.expand_dims(np.angle(spectro_phase), axis=0)
return spectro_mag, spectro_phase
else:
return spectro_mag
def generate_spectrogram_complex(audio, stft_frame, stft_hop, n_fft):
| 64 | 64 | 110 | 20 | 43 | rhgao/ObjectFolder | ObjectFolder1.0/TouchNet_utils.py | Python | generate_spectrogram_complex | generate_spectrogram_complex | 37 | 42 | 37 | 37 | 5fe725437aab27d7a6f32d527d892cf0a5d46ba7 | bigcode/the-stack | train |
03a7632d154090e0d8efaf22 | train | function | def strip_prefix_if_present(state_dict, prefix):
keys = sorted(state_dict.keys())
if not all(key.startswith(prefix) for key in keys):
return state_dict
stripped_state_dict = OrderedDict()
for key, value in state_dict.items():
stripped_state_dict[key.replace(prefix, "")] = value
retur... | def strip_prefix_if_present(state_dict, prefix):
| keys = sorted(state_dict.keys())
if not all(key.startswith(prefix) for key in keys):
return state_dict
stripped_state_dict = OrderedDict()
for key, value in state_dict.items():
stripped_state_dict[key.replace(prefix, "")] = value
return stripped_state_dict
| from scipy.io import wavfile
import librosa
import librosa.display
import numpy as np
import matplotlib.pyplot as plt
from TouchNet_model import *
import os
from collections import OrderedDict
def strip_prefix_if_present(state_dict, prefix):
| 52 | 64 | 73 | 10 | 41 | rhgao/ObjectFolder | ObjectFolder1.0/TouchNet_utils.py | Python | strip_prefix_if_present | strip_prefix_if_present | 10 | 17 | 10 | 10 | 9bba8384b774428b797f52eabf8543c22bad9ead | bigcode/the-stack | train |
47d9c1a31c2aa33ede759c0a | train | function | def verify_address(address_1, address_2=None, city=None, state=None,
postal=None, country=None):
"""
Required parameters: address_1, postal, country
Optional parameters: address_2, city, state
Note - postal and country default to None as you can't have non-default
argumen... | def verify_address(address_1, address_2=None, city=None, state=None,
postal=None, country=None):
| """
Required parameters: address_1, postal, country
Optional parameters: address_2, city, state
Note - postal and country default to None as you can't have non-default
arguments after default arguments, and preserving structural order
makes sense for addresses
"""
if ad... | import json
import requests
import urllib.parse
from microsetta_private_api.repo.transaction import Transaction
from microsetta_private_api.repo.melissa_repo import MelissaRepo
from microsetta_private_api.config_manager import SERVER_CONFIG
def verify_address(address_1, address_2=None, city=None, state=None,
... | 73 | 256 | 1,030 | 25 | 47 | charles-cowart/microsetta-private-api | microsetta_private_api/util/melissa.py | Python | verify_address | verify_address | 10 | 139 | 10 | 11 | b81787ad2cd7cb5c8f6f8a07754cb140a37e952e | bigcode/the-stack | train |
02fff6e3e792a01ec821a605 | train | class | class GoogleCloudStorage:
"""
initiate class, the class is taking the path to the file storing the credentials for the Google cloud storage,
the credentials itself, and the name of the bucket where the xml files resides as parameters
"""
def __init__(self, credentialspath, credentials, bucketname... | class GoogleCloudStorage:
| """
initiate class, the class is taking the path to the file storing the credentials for the Google cloud storage,
the credentials itself, and the name of the bucket where the xml files resides as parameters
"""
def __init__(self, credentialspath, credentials, bucketname):
# write the con... | from google.cloud import storage
import logging
from flask import abort
# class for reading files from a Google cloud storage
class GoogleCloudStorage:
| 30 | 126 | 422 | 5 | 24 | sesam-community/xml-translator | service/googlecloudstorage.py | Python | GoogleCloudStorage | GoogleCloudStorage | 7 | 60 | 7 | 7 | a34912fbc82e771b4c717ee2201f3920a72bc8b8 | bigcode/the-stack | train |
1ad3b88eb3368838d73e5d23 | train | class | class UserAddress(AddressBase):
"""Addresses and accesses user objects on the blockchain"""
def __init__(self):
AddressBase.__init__(self)
self._register()
@property
def address_type(self):
"""The address type from AddressSpace implemented by this class"""
return addres... | class UserAddress(AddressBase):
| """Addresses and accesses user objects on the blockchain"""
def __init__(self):
AddressBase.__init__(self)
self._register()
@property
def address_type(self):
"""The address type from AddressSpace implemented by this class"""
return addresser.AddressSpace.USER
@prop... | ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -----------------------------------------------------------------------------
"""Addresses and accesses user objects on the blockchain"""
from rbac.common import addresser
from ... | 64 | 64 | 166 | 6 | 57 | knagware9/sawtooth-next-directory | rbac/common/user/user_address.py | Python | UserAddress | UserAddress | 20 | 45 | 20 | 20 | 5bc6b1869c77fba4447177ef6492df7ea57eb32e | bigcode/the-stack | train |
34b466517a322f93f794d445 | train | function | def iopen(file, *args, **kwargs):
_open = open
if file.endswith('.gz'):
_open = gzip.open
elif file.endswith('.bz2'):
_open = bz2.open
return _open(file, *args, **kwargs)
| def iopen(file, *args, **kwargs):
| _open = open
if file.endswith('.gz'):
_open = gzip.open
elif file.endswith('.bz2'):
_open = bz2.open
return _open(file, *args, **kwargs)
| #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import gzip
import bz2
from tqdm import tqdm
import argparse
import logging
import sys
def iopen(file, *args, **kwargs):
| 52 | 64 | 59 | 11 | 40 | ravipatelxyz/kbc-meta | data/hetionet/split.py | Python | iopen | iopen | 16 | 22 | 16 | 16 | 1086e8a134e7b2a15982632541992d80ac0bc7ae | bigcode/the-stack | train |
2be458298295a2843be08b46 | train | function | def read_triples_incremental(path):
logging.debug('Importing the Knowledge Graph ..')
triples, symbols = [], set()
with iopen(path, mode='rt') as f:
for line in tqdm(f):
s, p, o = line.strip().split('\t')
triples += [(s, p, o)]
symbols |= {s, p, o}
sym2idx =... | def read_triples_incremental(path):
| logging.debug('Importing the Knowledge Graph ..')
triples, symbols = [], set()
with iopen(path, mode='rt') as f:
for line in tqdm(f):
s, p, o = line.strip().split('\t')
triples += [(s, p, o)]
symbols |= {s, p, o}
sym2idx = {sym: idx for idx, sym in enumerate... | (file, *args, **kwargs):
_open = open
if file.endswith('.gz'):
_open = gzip.open
elif file.endswith('.bz2'):
_open = bz2.open
return _open(file, *args, **kwargs)
def read_triples_incremental(path):
| 64 | 64 | 178 | 8 | 56 | ravipatelxyz/kbc-meta | data/hetionet/split.py | Python | read_triples_incremental | read_triples_incremental | 25 | 43 | 25 | 25 | 2a713bf3780e91efd929ef4261c21d1a478e721e | bigcode/the-stack | train |
95b048fc8a75b9f3060a268b | train | function | def main(argv):
def formatter(prog):
return argparse.HelpFormatter(prog, max_help_position=100, width=200)
parser = argparse.ArgumentParser('Knowledge Graph Splitter', formatter_class=formatter)
parser.add_argument('triples', type=str, default='/dev/stdin', help='Path of the file containing the KG... | def main(argv):
| def formatter(prog):
return argparse.HelpFormatter(prog, max_help_position=100, width=200)
parser = argparse.ArgumentParser('Knowledge Graph Splitter', formatter_class=formatter)
parser.add_argument('triples', type=str, default='/dev/stdin', help='Path of the file containing the KG triples')
... | **kwargs)
def read_triples_incremental(path):
logging.debug('Importing the Knowledge Graph ..')
triples, symbols = [], set()
with iopen(path, mode='rt') as f:
for line in tqdm(f):
s, p, o = line.strip().split('\t')
triples += [(s, p, o)]
symbols |= {s, p, o}
... | 185 | 185 | 619 | 4 | 180 | ravipatelxyz/kbc-meta | data/hetionet/split.py | Python | main | main | 46 | 110 | 46 | 46 | be7b6ec333cfec41c703f010906398b8a7232c8a | bigcode/the-stack | train |
d5b420236c9aa196dfdfb38f | train | class | class Sweep_wave(Generic_mission_state):
"""
Flies in a zig-zag fashion but with a fixed heading resulting in a potentially non-aligned heading and velocity
purpose is to test whether images on the outbound path are more familiar than those on the inbound path
:param args_in:
:return:
"""
... | class Sweep_wave(Generic_mission_state):
| """
Flies in a zig-zag fashion but with a fixed heading resulting in a potentially non-aligned heading and velocity
purpose is to test whether images on the outbound path are more familiar than those on the inbound path
:param args_in:
:return:
"""
def __init__(self,
stat... | from copy import copy
import rospy
from pyx4_base.mission_states import *
from pyx4_base.setpoint_bitmasks import MASK_XY_VEL__Z_POS__YAW_POS
from utils import pol2cart
class Sweep_wave(Generic_mission_state):
| 57 | 256 | 860 | 8 | 48 | jannsta1/torf | src/flight_states.py | Python | Sweep_wave | Sweep_wave | 9 | 107 | 9 | 9 | eeee6b535b5484de35526ac518c229084b3629d6 | bigcode/the-stack | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.