""" Title 모듈과 패키지 | module and package Author kadragon Date 2018.09.05 """ from sample import sample_func x = 222 def main_func(): print('x is: ', x) print("sample.sample_func()") sample_func() print() print("main_func()") main_func()
""" Title 모듈과 패키지 | module and package Author kadragon Date 2018.09.05 """ import sample as sp print(sp.sample_func())
"""Just a script that Displays Hello world.""" # tested versions: 2018 __title__ = 'Hello\nWorld' __author__ = 'Michael Spencer Quinto' # __context__ = 'Selection' # Tools are active even when there are no documents available/open in Revit # __context__ = 'zerodoc' from Autodesk.Revit.UI import TaskDialog TaskDialog.Show('spencerCorePyRevut', 'Hello World!') if __name__ == '__main__': from sample import sample_func print(sample_func())
def test_sample_func(self): result = sample.sample_func(1) self.assertEqual(result, "One")
def test_one(self): """Test one""" self.assertTrue(sample.sample_func(False))
def cached_sample_func(model, phrase, n_samples, sampler, beam_search): global cache k = (tuple(phrase), n_samples) if not k in cache: cache[k] = sample_func(model, phrase, n_samples, sampler, beam_search) return cache[k]