def __getslice__(self,i=1,j=0): result = mkvar() code = ''' /* /* Extracting a slice from a list /* ''' self.writecode(code) if i != 1: code = '&s i %d\n' % i self.writecode(code) else: code = '&s i 1\n' self.writecode(code) if j != 0: code = '&s j %d\n' % j self.writecode(code) else: code = '&s j\n' self.writecode(code) # Generate code to extract a sublist. The sublist is stored in result code = AML.getslice(self.list,result) self.writecode(code) return List('[value %s]'% result,self.file)
def impt_aml_days(ystday, sysids): islogin = 1 loginaml = AML.login() if loginaml == 200: print('登录成功!') else: print('登录不成功,程序终止!') islogin = 0 check = [] for sysid in sysids: san_list = AML.getlist(ystday, ystday, sysid) if san_list['total'] == 0: check.append(sysid) print(sysid + '***' + str(ystday) + '***无业务发生') continue print(sysid + '***' + str(ystday) + '***' + str(san_list['total']) + '笔案例,开始抓取...') case_rows = [] black_rows = [] i = 0 while i <= len(san_list['rows']) - 1: caseid = san_list['rows'][i]['CAD_CASEID'] case_info = AML.getcase(caseid, sysid, i) case_rows.append(case_info[0]) black_rows.append(case_info[1]) i = i + 1 #print(i) print('抓取' + sysid + '案例完成,开始写入文件...') AML.store(ystday, sysid, black_rows, case_rows) AML.login_off() return check, islogin
def editfeature(self,feat): self.function = 'editfeature' # assert that we are in arcedit self.writecode(AML.ismodule(self.function,'ARCEDIT')) self.checktopology(feat) code = ''' editfeature %s ''' % feat self.writecode(code)
ACover.__init__(self,self.name,filename) # For conversion of units from meters to geo # in this case it is 1. self.sfactor = 1.0 class ALDCover(ACover): def __init__(self,name,filename): self.suf = 'ald' self.name = name + self.suf ACover.__init__(self,self.name,filename) # For conversion of units from meters to geo # in this case it is 100000. self.sfactor = 100000.0 code = AML.header() f = open('test.aml','a') f.write(code) f.close() c = AMCover('e5108','test.aml') #c.checkfeatcodes() #c.checktopology('point') #c.checkitems() c.checkextraitems() code = AML.bailout() f = open('test.aml','a') f.write(code) f.close()
from azureml.core.webservice import Webservice from azureml.core.image import ContainerImage import os from azureml.core.authentication import ServicePrincipalAuthentication from azureml.core import Workspace import AML aml = AML.AML() ws = aml.ws from azureml.core.model import Model from sklearn.externals import joblib mods = Model.list(ws, name=None, tags=None, properties=None, run_id=None, latest=False) print(mods) model_path = Model.get_model_path('diabetes', _workspace=ws) print(model_path) model = joblib.load(model_path) from azureml.core.webservice import AciWebservice aciconfig = AciWebservice.deploy_configuration(cpu_cores=1, memory_gb=1, tags={"data": "diabetes", "method": "sklearn"}, description='Predict diabetes with sklearn')
def isequal(self,other): result = mkvar() code = AML.isequal(self.list,other.list,result) self.writecode(code) return '[value %s]' % result