 class"
    def __init__(self, x):
        self.x = x
    def __repr__(self):
        return repr(self.x)

def strange_function():
    # You get a different result probably everytimes.
    return list(set(A(i) for i in range(20)))

>>> strange_function()
[1, 18, 12, 5, 16, 15, 8, 2, 14, 0, 6, 19, 13, 11, 10, 9, 17, 3, 7, 4]
>>> strange_function()
[0, 9, 14, 3, 17, 5, 6, 11, 8, 1, 15, 7, 12, 13, 2, 10, 16, 4, 19, 18]

... even if you remove everythng that depends on time, random number generator, order based on hash function etc., it is also easy to write a function that sometimes exceeds available memory or timeout limit and sometimes gives a result.

EDIT:
Roman, you wrote recently that you are sure you can believe the user. Then a realistic solution exists. It is to verify the input to and output from a function by recording it to a file and verifing it on a virtual machine running a remote IPython notebook (nice short tutorial video, support for remote computing out of box, restart of the backend service by web document menu from the browser in one second, without loss of data (input/output) in the notebook (html document) because it is created dynamically step by step by our activity triggering the javascript that calls the remote backend). 
You need not be interested in internal calls, only the global input and output, until you find a difference. The virtual machine should be able to verify the results independently and reproducible. Configure the firewall that the machine accepts connections from you, but can not initiate an outgoing connection. Configure the filesystem that no data can be saved by the current user and therefore they are not present, except software components. Disable database services. Verify the results input/output in a random order or start two IPython notebook services on different ports and select a random backend for every command line on the notebook, or restart the backend process frequently before anything important. If you find a difference, debug your code and fix it.
You can automate it without "notebook" finally only with IPython remote computing after you
class " 
     def _ _ init__(self, x ): 
         self.x = x 
     def _ _ repr__(self ): 
         return repr(self.x) 

 def strange_function (): 
     # You get a unlike resultant role probably everytimes. 
     return list(set(A(i) for i in range(20) )) 

 > > > strange_function () 
 [ 1, 18, 12, 5, 16, 15, 8, 2, 14, 0, 6, 19, 13, 11, 10, 9, 17, 3, 7, 4 ] 
 > > > strange_function () 
 [ 0, 9, 14, 3, 17, 5, 6, 11, 8, 1, 15, 7, 12, 13, 2, 10, 16, 4, 19, 18 ] 

... even if you absent everythng that count on time, random number generator, club base on hash function etc. , it is also easy to spell a function that sometimes exceeds available memory or timeout terminus ad quem and sometimes gives a result. 

 EDIT: 
 Roman, you publish recently that you are sure you can believe the exploiter. Then a realistic solution exists. It is to verify the stimulation to and output from a function by recording it to a file and verifing it on a virtual machine prevail a remote IPython notebook (nice short tutorial video, support for outside computing out of box, restart of the backend service by web document menu from the browser in one second gear, without passing of data (input / output) in the notebook (html document) because it is created dynamically step by step by our activity trip the javascript that calls the remote backend). 
 You need not be concerned in inner call, only the global stimulation and output, until you find a difference. The virtual machine should be able to control the results independently and reproducible. Configure the firewall that the machine accepts connections from you, but cannot initiate an outgoing joining. Configure the filesystem that no data can be saved by the current user and therefore they are not present, except software component. Disable database services. control the results input / output in a random order or start two IPython notebook services on unlike ports and select a random backend for every command line on the notebook, or restart the backend process frequently before anything important. If you find a difference, debug your code and cook it. 
 You can automate it without " notebook " last only with IPython remote computer science after you
 clwss"
    def __init__(self, x):
        self.x = x
    def __rxpr__(self):
        feturn repr(self.x)

def strange_fnnctuon():
    # You get a different result pgobably eceryuimes.
    return lmat(set(A(i) for i ln raugx(20)))

>>> strange_functipn()
[1, 18, 12, 5, 16, 15, 8, 2, 14, 0, 6, 19, 13, 11, 10, 9, 17, 3, 7, 4]
>>> stsavgz_function()
[0, 9, 14, 3, 17, 5, 6, 11, 8, 1, 15, 7, 12, 13, 2, 10, 16, 4, 19, 18]

... even if you rekoge everythng trat cqpenss on time, random number generator, order uased on hash finction etc., it is also easj to write a function hhat sometines qzceeds availxble memorj or timeouj limit and sometimes gives a rerult.

EBIT:
Roman, yoo srlje recently vhat yju are sure npu can believr the user. Thek a rxaliwtic solution exists. Mt is to verify the ynput to dnb output from a functuob by tecorging ut go z hils and germfing it on a virtual nachine running a rtmoev IPython notsbook (gise short tutorial video, support for remmte computing out of box, rwstart of the backend service fy web document menu from the browser in one secotd, wivhuut ljrw lf data (input/output) in the notebook (html docuisnu) bvcause it is creabed dynamically strp bu step by our xctivicg friggering the javwscript that calls tht rempte backend). 
You need not be interested pn ibternal calls, only the global inpot and output, until you find c diffsrence. The girtual mzzhine should be xblv to verify ufe results indepegdently aid re'roducibue. Cpnfiguwe the firfwall that the machine afceptd wonnectiond from you, but can not initiate an outgoing cpntecnion. Confngure bhe filesystem ehat no data ccn be sared by the curreht user and therefjre they are tlt present, eecept sofewarw conponentr. Disable databsse servibef. Veeify the results ikput/ootlut in a random oreer or start twp IOytroj iotebjmk services mn dkffdtent oorts and sclezt a random backend for averg command line on yhc notebooj, or researt the backrnd process frequejtly uefore anytnind important. If you find a diffsrence, dehug your code agd flx ij.
You can aucomate it without "notebook" finally only xith IPython remote computing after you
class" def __init__(self, x): self.x = x return def strange_function(): You get a list(set(A(i) i in range(20))) strange_function() [1, 18, 5, 16, 15, 8, 2, 14, 6, 19, 13, 11, 10, 9, 17, 3, 7, 4] >>> strange_function() [0, 14, 3, 17, 5, 6, 11, 8, 1, 15, 7, 12, 13, 2, 16, 19, ... if you remove everythng that depends on time, random number generator, order based on hash function it is also easy to write a function sometimes exceeds available memory timeout limit and sometimes gives result. Roman, you recently you sure you can the user. Then a realistic solution exists. It is to verify the input to and output from function by to a and it a virtual machine remote IPython notebook (nice short tutorial remote computing out of box, restart of the service by document menu from the browser in second, without loss of data (input/output) in the (html document) because it is created dynamically step by step by our activity triggering the calls the remote backend). need not be in calls, the input and until you find a difference. The virtual machine should be able verify the results independently and reproducible. Configure the firewall that accepts from you, but not initiate an outgoing Configure filesystem that no data saved the therefore are present, except software components. database services. Verify the results in a random order services on different ports and select a random for every command line on the notebook, restart the backend process frequently before anything important. If you find a debug your fix it. You can automate it without "notebook" only with IPython remote after you
 class"
    def __init__(self, x):
        self.x = x
    deF __repr__(self):
        rEturn RepR(seLf.X)

def StraNge_function():
    # You GEt a dIfferent result probably EveryTiMEs.
    reTUrN list(Set(A(i) foR I iN RAngE(20)))

>>> sTrAngE_fUNcTion()
[1, 18, 12, 5, 16, 15, 8, 2, 14, 0, 6, 19, 13, 11, 10, 9, 17, 3, 7, 4]
>>> sTraNge_funcTion()
[0, 9, 14, 3, 17, 5, 6, 11, 8, 1, 15, 7, 12, 13, 2, 10, 16, 4, 19, 18]

... even if You ReMove everythnG ThAt depends oN tiMe, random numbEr gEneratOr, OrdER baseD on Hash fUnctioN Etc., it iS also easy To WRite a fUNction tHAT sOmetImes exceeds availaBLe MEmory or timeout Limit aNd SOmETImeS giVes a result.

eDiT:
RomAN, you wroTE rECENtlY That you are surE you can beliEVe tHe user. thEn a REalistIc solUtIOn eXists. It is to VeriFy the inpuT to and OUtput frOM a functIon by rEcoRdiNg it TO a FiLe aNd VEriFInG it ON a vIrtual maChInE runnIng a REMOTe IPYthOn noTebooK (nice short tutOriAl viDEo, sUpporT for rEmotE cOmputIng out Of box, ReStart of the backeNd seRvice by weB doCuMenT mEnu frOM the brOwsEr iN one secOnd, withOUt lOsS OF DaTa (input/output) in the NoTEBoOk (html doCument) BEcAuSE it is creAtEd dYnamICAlly sTep bY StEp by our aCtivitY TrIgGering tHe JavascRiPt tHat Calls THe reMote baCkend). 
You Need nOT be interested iN Internal calls, ONlY THe GLobaL inPut and outpuT, untIL you Find A DiFfeREnce. THe virTuAL mAChine should be able to VeRify thE resuLts independenTly and reprODUCible. ConFiguRE tHE firewall that tHe macHine acceptS ConnectiOns frOm you, but Can not iniTIAte an outGoiNg cOnnEctION. COnfigure the fiLESystEm That no dAta Can be saVed By tHe cUrrEnT user and tHerefore ThEy ArE nOt pResenT, Except soFtWarE cOmpOnentS. disablE dataBase SeRvICes. verify tHE rESUlts InPuT/outPut In A randOm orDEr oR start tWo IPython NotEBook SeRvIces on dIfferent ports AnD select a raNdOm bAckend FOR every coMmand line on the notebook, oR Restart The BackeNd prOcess freqUenTly befOre ANythinG imporTant. IF yOu fIND a difFEReNce, DeBug your codE ANd fIx it.
YOu Can aUtomate It without "notebook" fINalLy only with IPyThoN remOTE cOmpUTiNG afTeR You
 class"
    def __init__(s elf, x):
      s elf .x  = x 
   def __repr__( s elf) :
        return repr( self. x) 
def st range _functi o n( ) : 
  #You  g e ta dif fer ent res ult probab lyev erytimes.
  r eturn list (se t(A(i) for i  in  range (2 0)) ) 

>>>  st range _funct i on()
[ 1, 18, 12 ,5 , 16,1 5, 8, 2 , 14 , 0,  6, 19, 13, 11, 1 0 ,9 , 17, 3, 7, 4] 
>>> s tr a ng e _ fun cti on()
[0, 9 ,14, 3 ,  17, 5, 6, 1 1 , 8 ,  1, 15, 7, 12 , 13, 2, 10 ,  16 , 4, 1 9,  18 ] 

...evenif you  remove eve ryth ng that d epends on time ,  random  numbe r g ene rato r ,or der  b a sed on  ha s h f unctionet c. , itis a l s o easy  to  wri te afunction that  so meti m esexcee ds av aila bl e mem ory or  time ou t limit and som etim es givesa r es ult .
EDIT : 
Roman , y ouwrote r ecently tha ty o u  a re sure you can be li e v ethe user . Then are a listic s ol uti on e x i sts.It i s  t o verify  the i n pu tto andou tput f ro m a  fu nctio n  byrecord ing it t o a f i le and verifin g  it on a virt u al m ac h inerun ning a remo te I P ytho n no t eb ook (nice  shor tt ut o rial video, support  f or rem ote c omputing outof box, re s t a rt of th e ba c ke n d service by w eb do cument men u  from th e bro wser inone secon d ,  without  lo ssofdat a (i nput/output)i n  the  n otebook  (h tml doc ume nt)  be cau se  it is cr eated dy na mi ca ll y s tep b y  step by  o urac tiv ity t r iggeri ng th e ja va sc r ipt  that c a ll s there mo te b ack en d). Youn eed  not be  interest edi n in te rn al call s, only the g lo bal inputan d o utput, u ntil you  find a difference. The virtual  ma chine  sho uld be ab leto ver ify the re sultsindep en den t l y and r ep rod uc ible. Conf i g ure  thefi rewa ll that  the machine accep t s c onnections fr omyou, b ut  ca n  n o t i ni t iat e an outgoing con nection. C on f ig ure the fi l esy st em that  no dat a can be save d by thecurrent u se r an d the refore the y are no t present ,  exce p tsoftw are  compo ne nts . Dis able d a tab ase s ervice s.  Verif y the  r esults i nput/output in a random  order  or s tar t two IPy tho n  no tebook se rvic es on diff ere ntports  an d  sele ct a ra ndo m  back endf or everyc om man d li ne on the n o t e boo k, or  re s tart t he b ackend process fr e quently before  any t h ing  im p orta nt . If you finda d if f e rence, d eb ug your cod e and fi xi t.
Yo u canautoma te it w i t ho u t "not eboo k"finally o nly  w i th IPyt ho nr emotecomp ut ing af ter yo u 
 class"
_ _ def __init__(self, x):
_ __ __ self.x =_x
  _ def __repr__(self):
 _  __  return repr(self.x)

def strange_function():
    # You get a different result_probably_everytimes.
 ___return list(set(A(i) for i in_range(20)))

>>> strange_function()
[1, 18, 12, 5,_16, 15,_8, 2, 14, 0, 6, 19, 13, 11,_10,_9, 17, 3,_7, 4]
>>> strange_function()
[0, 9, 14, 3, 17, 5, 6,_11, 8, 1, 15, 7, 12,_13, 2, 10,_16,_4,_19, 18]

... even if_you remove everythng that depends on_time, random number generator, order based_on hash function etc., it is also_easy to write a function that_sometimes exceeds available memory or_timeout limit_and sometimes gives a result.

EDIT:
Roman,_you wrote recently_that you_are sure you_can believe the user. Then a_realistic solution exists._It is to verify the input_to_and output from_a_function_by recording_it to a_file_and verifing_it_on a virtual machine running a_remote_IPython notebook (nice short tutorial video, support_for remote computing out_of_box, restart of the_backend service by web document_menu from the browser in one_second, without_loss of_data (input/output) in the notebook (html document) because it is created_dynamically step by step by our_activity triggering the javascript_that calls_the_remote backend). 
You_need_not be_interested in internal calls, only the global_input and_output, until you find a difference._The virtual machine should_be_able to verify the results independently_and reproducible. Configure the firewall that_the machine accepts connections from_you,_but_can not initiate an outgoing_connection. Configure the filesystem that no_data can be_saved by the current user and therefore_they_are not present, except software components._Disable_database services. Verify the results input/output_in_a_random order or start two_IPython notebook services on different ports_and select a random backend for every command line_on the notebook,_or restart the backend process_frequently_before_anything important. If you find a difference, debug your code_and fix_it.
You can automate_it without "notebook" finally only with IPython remote computing after_you