prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest from tests.base import Author, Post, Comment, Keyword, fake def make_author(): return Author( id=fake.random_int(), first_name=fake.first_name(), last_name=fake.last_name(), twitter=fake.domain_word(), ) def...
return [make_post() for _ in range(3)]
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest from tests.base import Author, Post, Comment, Keyword, fake def <|fim_middle|>(): return Author( id=fake.random_int(), first_name=fake.first_name(), last_name=fake.last_name(), twitter=fake.domain_word(), ) ...
make_author
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest from tests.base import Author, Post, Comment, Keyword, fake def make_author(): return Author( id=fake.random_int(), first_name=fake.first_name(), last_name=fake.last_name(), twitter=fake.domain_word(), ) def...
make_post
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest from tests.base import Author, Post, Comment, Keyword, fake def make_author(): return Author( id=fake.random_int(), first_name=fake.first_name(), last_name=fake.last_name(), twitter=fake.domain_word(), ) def...
make_comment
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest from tests.base import Author, Post, Comment, Keyword, fake def make_author(): return Author( id=fake.random_int(), first_name=fake.first_name(), last_name=fake.last_name(), twitter=fake.domain_word(), ) def...
make_keyword
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest from tests.base import Author, Post, Comment, Keyword, fake def make_author(): return Author( id=fake.random_int(), first_name=fake.first_name(), last_name=fake.last_name(), twitter=fake.domain_word(), ) def...
author
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest from tests.base import Author, Post, Comment, Keyword, fake def make_author(): return Author( id=fake.random_int(), first_name=fake.first_name(), last_name=fake.last_name(), twitter=fake.domain_word(), ) def...
authors
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest from tests.base import Author, Post, Comment, Keyword, fake def make_author(): return Author( id=fake.random_int(), first_name=fake.first_name(), last_name=fake.last_name(), twitter=fake.domain_word(), ) def...
comments
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest from tests.base import Author, Post, Comment, Keyword, fake def make_author(): return Author( id=fake.random_int(), first_name=fake.first_name(), last_name=fake.last_name(), twitter=fake.domain_word(), ) def...
post
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest from tests.base import Author, Post, Comment, Keyword, fake def make_author(): return Author( id=fake.random_int(), first_name=fake.first_name(), last_name=fake.last_name(), twitter=fake.domain_word(), ) def...
post_with_null_comment
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest from tests.base import Author, Post, Comment, Keyword, fake def make_author(): return Author( id=fake.random_int(), first_name=fake.first_name(), last_name=fake.last_name(), twitter=fake.domain_word(), ) def...
post_with_null_author
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest from tests.base import Author, Post, Comment, Keyword, fake def make_author(): return Author( id=fake.random_int(), first_name=fake.first_name(), last_name=fake.last_name(), twitter=fake.domain_word(), ) def...
posts
<|file_name|>counters.py<|end_file_name|><|fim▁begin|>from baroque.entities.event import Event class EventCounter: """A counter of events.""" def __init__(self):<|fim▁hole|> self.events_count = 0 self.events_count_by_type = dict() def increment_counting(self, event): """Counts an ...
<|file_name|>counters.py<|end_file_name|><|fim▁begin|>from baroque.entities.event import Event class EventCounter: <|fim_middle|> <|fim▁end|>
"""A counter of events.""" def __init__(self): self.events_count = 0 self.events_count_by_type = dict() def increment_counting(self, event): """Counts an event Args: event (:obj:`baroque.entities.event.Event`): the event to be counted """ asser...
<|file_name|>counters.py<|end_file_name|><|fim▁begin|>from baroque.entities.event import Event class EventCounter: """A counter of events.""" def __init__(self): <|fim_middle|> def increment_counting(self, event): """Counts an event Args: event (:obj:`baroque.entiti...
self.events_count = 0 self.events_count_by_type = dict()
<|file_name|>counters.py<|end_file_name|><|fim▁begin|>from baroque.entities.event import Event class EventCounter: """A counter of events.""" def __init__(self): self.events_count = 0 self.events_count_by_type = dict() def increment_counting(self, event): <|fim_middle|> def...
"""Counts an event Args: event (:obj:`baroque.entities.event.Event`): the event to be counted """ assert isinstance(event, Event) self.events_count += 1 t = type(event.type) if t in self.events_count_by_type: self.events_count_by_type[t] ...
<|file_name|>counters.py<|end_file_name|><|fim▁begin|>from baroque.entities.event import Event class EventCounter: """A counter of events.""" def __init__(self): self.events_count = 0 self.events_count_by_type = dict() def increment_counting(self, event): """Counts an event ...
"""Tells how many events have been counted globally Returns: int """ return self.events_count
<|file_name|>counters.py<|end_file_name|><|fim▁begin|>from baroque.entities.event import Event class EventCounter: """A counter of events.""" def __init__(self): self.events_count = 0 self.events_count_by_type = dict() def increment_counting(self, event): """Counts an event ...
"""Tells how many events have been counted of the specified type Args: eventtype (:obj:`baroque.entities.eventtype.EventType`): the type of events to be counted Returns: int """ return self.events_count_by_type.get(type(eventtype), 0)
<|file_name|>counters.py<|end_file_name|><|fim▁begin|>from baroque.entities.event import Event class EventCounter: """A counter of events.""" def __init__(self): self.events_count = 0 self.events_count_by_type = dict() def increment_counting(self, event): """Counts an event ...
self.events_count_by_type[t] += 1
<|file_name|>counters.py<|end_file_name|><|fim▁begin|>from baroque.entities.event import Event class EventCounter: """A counter of events.""" def __init__(self): self.events_count = 0 self.events_count_by_type = dict() def increment_counting(self, event): """Counts an event ...
self.events_count_by_type[t] = 1
<|file_name|>counters.py<|end_file_name|><|fim▁begin|>from baroque.entities.event import Event class EventCounter: """A counter of events.""" def <|fim_middle|>(self): self.events_count = 0 self.events_count_by_type = dict() def increment_counting(self, event): """Counts an event...
__init__
<|file_name|>counters.py<|end_file_name|><|fim▁begin|>from baroque.entities.event import Event class EventCounter: """A counter of events.""" def __init__(self): self.events_count = 0 self.events_count_by_type = dict() def <|fim_middle|>(self, event): """Counts an event ...
increment_counting
<|file_name|>counters.py<|end_file_name|><|fim▁begin|>from baroque.entities.event import Event class EventCounter: """A counter of events.""" def __init__(self): self.events_count = 0 self.events_count_by_type = dict() def increment_counting(self, event): """Counts an event ...
count_all
<|file_name|>counters.py<|end_file_name|><|fim▁begin|>from baroque.entities.event import Event class EventCounter: """A counter of events.""" def __init__(self): self.events_count = 0 self.events_count_by_type = dict() def increment_counting(self, event): """Counts an event ...
count
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
"""Retrieve the given page.""" return urllib2.urlopen(url).read()
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
"""Parse coefficients from the page.""" coeffs = {} coeffs['datetime'] = [] coeffs['slope1'] = [] coeffs['intercept1'] = [] coeffs['slope2'] = [] coeffs['intercept2'] = [] slope1_idx, intercept1_idx, slope2_idx, intercept2_idx = \ None, None, None, None date_idx = 0 for...
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
"""Get all available calibration coefficients for the satellites.""" coeffs = {} for platform in URLS: if platform not in coeffs: coeffs[platform] = {} for chan in URLS[platform].keys(): url = URLS[platform][chan] print(url) page = get_page(ur...
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
"""Save calibration coefficients to HDF5 files.""" for platform in coeffs.keys(): fname = os.path.join(out_dir, "%s_calibration_data.h5" % platform) fid = h5py.File(fname, 'w') for chan in coeffs[platform].keys(): fid.create_group(chan) fid[chan]['datetime'] = co...
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
"""Create calibration coefficient files for AVHRR.""" out_dir = sys.argv[1] coeffs = get_all_coeffs() save_coeffs(coeffs, out_dir=out_dir)
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
continue
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
slope1_idx = row.index('slope_lo') intercept1_idx = row.index('int_lo') slope2_idx = row.index('slope_hi') intercept2_idx = row.index('int_hi') continue
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
continue
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
continue
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
coeffs[platform] = {}
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
main()
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
get_page
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
get_coeffs
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
get_all_coeffs
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
save_coeffs
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
main
<|file_name|>nonFinalPublic.py<|end_file_name|><|fim▁begin|><|fim▁hole|> modifiers = astTuple.ast.modifiers nonFinalPublic = modifiers.isSet(Modifier.ModifierFlag.Public) and not modifiers.isSet(Modifier.ModifierFlag.Final) if not nonFinalPublic: Query.input.remove(astTuple) Query.re...
for astTuple in Query.input.tuples('ast'): if type(astTuple.ast) is Field:
<|file_name|>nonFinalPublic.py<|end_file_name|><|fim▁begin|>for astTuple in Query.input.tuples('ast'): if type(astTuple.ast) is Field: <|fim_middle|> Query.result = Query.input<|fim▁end|>
modifiers = astTuple.ast.modifiers nonFinalPublic = modifiers.isSet(Modifier.ModifierFlag.Public) and not modifiers.isSet(Modifier.ModifierFlag.Final) if not nonFinalPublic: Query.input.remove(astTuple)
<|file_name|>nonFinalPublic.py<|end_file_name|><|fim▁begin|>for astTuple in Query.input.tuples('ast'): if type(astTuple.ast) is Field: modifiers = astTuple.ast.modifiers nonFinalPublic = modifiers.isSet(Modifier.ModifierFlag.Public) and not modifiers.isSet(Modifier.ModifierFlag.Final) if not...
Query.input.remove(astTuple)
<|file_name|>smri_freesurfer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ ================ sMRI: FreeSurfer ================ This script, smri_freesurfer.py, demonstrates the ability to call reconall on a set of subjects and then make an average subject. python smri_freesurfer.py Import necessary mo...
wf.connect(datasource, 'struct', recon_all, 'T1_files') """
<|file_name|>smri_freesurfer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ ================ sMRI: FreeSurfer ================ This script, smri_freesurfer.py, demonstrates the ability to call reconall on a set of subjects and then make an average subject. python smri_freesurfer.py Import necessary mo...
os.mkdir(subjects_dir)
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
self.write(cr, uid, ids, {'state': 'ready'}) for production in self.browse(cr, uid, ids, context=context):
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
inherit = 'mrp.production' def _action_compute_lines(self, cr, uid, ids, properties=None, context=None): """ Computes bills of material of a product. @param properties: List containing dictionaries of properties. @return: No. of products. """ if properties is None: ...
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
"" Computes bills of material of a product. @param properties: List containing dictionaries of properties. @return: No. of products. """ if properties is None: properties = [] results = [] bom_obj = self.pool.get('mrp.bom') uom_obj = self.pool....
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
"" Changes the production state to Ready and location id of stock move. @return: True """ move_obj = self.pool.get('stock.move') self.write(cr, uid, ids, {'state': 'ready'}) for production in self.browse(cr, uid, ids, context=context): if not prod...
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
roduction = self.browse(cr, uid, production_id, context=context) if not production.bom_id and production.state == 'ready': wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce', cr) return super(mrp_pro...
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
roperties = []
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
om_id = bom_obj._bom_find(cr, uid, production.product_id.id, production.product_uom.id, properties) if bom_id: bom_point = bom_obj.browse(cr, uid, bom_id) routing_id = bom_point.routing_id.id or False self.write(cr, uid, [produc...
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
om_point = bom_obj.browse(cr, uid, bom_id) routing_id = bom_point.routing_id.id or False self.write(cr, uid, [production.id], {'bom_id': bom_id, 'routing_id': routing_id})
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
ontinue
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
roduce_move_id = self._make_production_produce_line(cr, uid, production, context=context)
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
ove_obj.write(cr, uid, [production.move_prod_id.id], {'location_id': production.location_dest_id.id})
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
f_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce', cr)
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
action_compute_lines(
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
ction_ready(
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) import time from datetime import datetime import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from...
ction_produce(
<|file_name|>tests.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
#This is where the tests go.
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
def __str__(self): return "NoncentralTDistr(df={0},mu={1})#{2}".format(self.df, self.mu, self.id()) def getName(self): return "NoncT({0},{1})".format(self.df, self.mu)
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): <|fim_middle|> class Noncentr...
def __init__(self, df = 2, mu = 0): d1 = NormalDistr(mu, 1) d2 = distr_sqrt(ChiSquareDistr(df) / df) super(NoncentralTDistr, self).__init__(d1, d2) self.df = df self.mu = mu def __str__(self): return "NoncentralTDistr(df={0},mu={1})#{2}".format(self.df, self.mu, s...
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
d1 = NormalDistr(mu, 1) d2 = distr_sqrt(ChiSquareDistr(df) / df) super(NoncentralTDistr, self).__init__(d1, d2) self.df = df self.mu = mu
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
return "NoncentralTDistr(df={0},mu={1})#{2}".format(self.df, self.mu, self.id())
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
return "NoncT({0},{1})".format(self.df, self.mu)
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
def __new__(cls, df, lmbda = 0): assert df >= 1 d1 = NormalDistr(sqrt(lmbda))**2 if df == 1: return d1 d2 = ChiSquareDistr(df - 1) ncc2 = super(NoncentralChiSquareDistr, cls).__new__(cls, d1, d2) super(NoncentralChiSquareDistr, ncc2).__init__(d1, d2) ...
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
assert df >= 1 d1 = NormalDistr(sqrt(lmbda))**2 if df == 1: return d1 d2 = ChiSquareDistr(df - 1) ncc2 = super(NoncentralChiSquareDistr, cls).__new__(cls, d1, d2) super(NoncentralChiSquareDistr, ncc2).__init__(d1, d2) ncc2.df = df ncc2.lmbda = ...
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
pass
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
return "NoncentralChiSquare(df={0},lambda={1})#{2}".format(self.df, self.lmbda, self.id())
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
return "NoncChi2({0},{1})".format(self.df, self.lmbda)
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
def __init__(self, alpha = 1, beta = 1, lmbda = 0): d = 1 + ChiSquareDistr(2.0 * beta) / NoncentralChiSquareDistr(2 * alpha, lmbda) super(NoncentralBetaDistr, self).__init__(d) self.alpha = alpha self.beta = beta self.lmbda = lmbda def __str__(self): return "Nonce...
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
d = 1 + ChiSquareDistr(2.0 * beta) / NoncentralChiSquareDistr(2 * alpha, lmbda) super(NoncentralBetaDistr, self).__init__(d) self.alpha = alpha self.beta = beta self.lmbda = lmbda
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
return "NoncentralBetaDistr(alpha={0},beta={1},lambda={2})#{3}".format(self.alpha, self.beta, self.lmbda, self.id())
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
return "NoncBeta({0},{1},{2})".format(self.alpha, self.beta, self.lmbda)
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
def __init__(self, df1 = 1, df2 = 1, lmbda = 0): d1 = NoncentralChiSquareDistr(df1, lmbda) / df1 d2 = ChiSquareDistr(df2) / df2 super(NoncentralFDistr, self).__init__(d1, d2) self.df1 = df1 self.df2 = df2 self.lmbda = lmbda def __str__(self): return "Nonce...
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
d1 = NoncentralChiSquareDistr(df1, lmbda) / df1 d2 = ChiSquareDistr(df2) / df2 super(NoncentralFDistr, self).__init__(d1, d2) self.df1 = df1 self.df2 = df2 self.lmbda = lmbda
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
return "NoncentralFDistr(df1={0},df2={1},lambda={2})#{3}".format(self.df1, self.df2, self.lmbda, self.id())
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
return "NoncF({0},{1},{2})".format(self.df1, self.df2, self.lmbda)
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
return d1
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def <|fim_middle|>(self, df = 2...
__init__
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
__str__
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
getName
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
__new__
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
__init__
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
__str__
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
getName
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
__init__
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
__str__
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
getName
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
__init__
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
__str__
<|file_name|>noncentral_distr.py<|end_file_name|><|fim▁begin|>from numpy import sqrt from pacal.standard_distr import NormalDistr, ChiSquareDistr from pacal.distr import Distr, SumDistr, DivDistr, InvDistr from pacal.distr import sqrt as distr_sqrt class NoncentralTDistr(DivDistr): def __init__(self, df = 2, mu =...
getName
<|file_name|>pythonutil.py<|end_file_name|><|fim▁begin|>from socket import inet_ntoa from struct import pack <|fim▁hole|> for i in xrange(32 - mask, 32): bits |= (1 << i) packed_value = pack('!I', bits) addr = inet_ntoa(packed_value) return addr<|fim▁end|>
def calcDottedNetmask(mask): bits = 0
<|file_name|>pythonutil.py<|end_file_name|><|fim▁begin|>from socket import inet_ntoa from struct import pack def calcDottedNetmask(mask): <|fim_middle|> <|fim▁end|>
bits = 0 for i in xrange(32 - mask, 32): bits |= (1 << i) packed_value = pack('!I', bits) addr = inet_ntoa(packed_value) return addr
<|file_name|>pythonutil.py<|end_file_name|><|fim▁begin|>from socket import inet_ntoa from struct import pack def <|fim_middle|>(mask): bits = 0 for i in xrange(32 - mask, 32): bits |= (1 << i) packed_value = pack('!I', bits) addr = inet_ntoa(packed_value) return addr <|fim▁end|>
calcDottedNetmask
<|file_name|>TurtleCommands.py<|end_file_name|><|fim▁begin|>__author__ = 'Alex' from Movement import Movement class BaseCommand: def __init__(self, movement): assert isinstance(movement, Movement) self.name = 'unknown' self.m = movement def execute(selfself):pass class Forward(BaseCo...
class Left(BaseCommand): def __init__(self, movement): assert isinstance(movement, Movement)
<|file_name|>TurtleCommands.py<|end_file_name|><|fim▁begin|>__author__ = 'Alex' from Movement import Movement class BaseCommand: <|fim_middle|> class Forward(BaseCommand): def __init__(self, movement): assert isinstance(movement, Movement) self.name = 'forward' self.m = movement ...
def __init__(self, movement): assert isinstance(movement, Movement) self.name = 'unknown' self.m = movement def execute(selfself):pass
<|file_name|>TurtleCommands.py<|end_file_name|><|fim▁begin|>__author__ = 'Alex' from Movement import Movement class BaseCommand: def __init__(self, movement): <|fim_middle|> def execute(selfself):pass class Forward(BaseCommand): def __init__(self, movement): assert isinstance(movement, ...
assert isinstance(movement, Movement) self.name = 'unknown' self.m = movement