Skip to content

Instantly share code, notes, and snippets.

View RyanKor's full-sized avatar
🎯
Focusing

SeungTaeKim RyanKor

🎯
Focusing
View GitHub Profile
@RyanKor
RyanKor / uptime.py
Created November 6, 2021 02:33
uptime
class UpTimeHypervisor(command.ShowOne):
_description = _("Display the uptime of the specified hypervisor.")
def get_parser(self, prog_name):
parser = super(UpTimeHypervisor, self).get_parser(prog_name)
parser.add_argument(
"hypervisor",
metavar="<hypervisor>",
help=_("Hypervisor to display (name or ID)")
)
#!/usr/bin/env python
# coding: utf-8
import tensorflow as tf
import numpy as np
from tensorflow.keras.layers import Input, Add, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv2D, AveragePooling2D, MaxPooling2D, GlobalMaxPooling2D
from tensorflow.keras.models import Model, load_model
from tensorflow.keras.initializers import random_uniform, glorot_uniform, constant, identity
from keras.utils import np_utils
get_ipython().run_line_magic('matplotlib', 'inline')
task_id = "53326486-2089-4679-8d24-0b09192ad2d8"
task_owner = "1565f71789534d35b188781d7ec3e30e"
task_type = "import"
task_status = "pending"
TASK = {
'id': task_id,
'type': task_type,
'owner': task_owner,
'status': task_status,
class TestTaskList(TestTask):
_data = task_fakes.FakeTask.create_one_task()
columns = (
'ID', 'Type', 'Status', 'Owner'
)
datalist = (
_data.id,
class TaskImage(command.Lister):
_description = _("Retrieve a listing of Task objects.")
def get_parser(self, prog_name):
parser = super(TaskImage, self).get_parser(prog_name)
parser.add_argument(
'--sort-key',
metavar="<key>[:<field>]",
help=_("Sorts the response by one of the following attributes: "
class TaskImage(command.Lister):
_description = _("Retrieve a listing of Task objects.")
def get_parser(self, prog_name):
parser = super(TaskImage, self).get_parser(prog_name)
parser.add_argument(
'--sort-key',
metavar="<key>[:<direction>]",
default='name:asc',
def __init__(self):
self.compute = None
self.identity = None
self.image = None
self.object_store = None
self.volume = None
self.network = None
self.session = None
self.auth_ref = None
self.auth_plugin_name = None
@RyanKor
RyanKor / test_configuration.py
Created October 10, 2021 15:44
테스트 케이스 수정본
@mock.patch("keystoneauth1.loading.base.get_plugin_options",
return_value=opts)
def test_show_mask_with_cloud_config(self, m_get_plugin_opts):
arglist = ['--mask']
verifylist = [('mask', True)]
self.app.client_manager.configuration_type = "cloud_config"
cmd = configuration.ShowConfiguration(self.app, None)
parsed_args = self.check_parser(cmd, arglist, verifylist)
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import numpy as np
import glob
...
tf.keras.layers.Dense(128, activation='relu'),
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(32, activation='relu'),
...