prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>value.py<|end_file_name|><|fim▁begin|>from keras.models import Sequential from keras.layers import convolutional from keras.layers.core import Dense, Flatten from SGD_exponential_decay import SGD_exponential_decay as SGD ### Parameters obtained from paper ### K = 152 # depth of convo...
trainer = value_trainer() # TODO command line instantiation
<|file_name|>value.py<|end_file_name|><|fim▁begin|>from keras.models import Sequential from keras.layers import convolutional from keras.layers.core import Dense, Flatten from SGD_exponential_decay import SGD_exponential_decay as SGD ### Parameters obtained from paper ### K = 152 # depth of convo...
__init__
<|file_name|>value.py<|end_file_name|><|fim▁begin|>from keras.models import Sequential from keras.layers import convolutional from keras.layers.core import Dense, Flatten from SGD_exponential_decay import SGD_exponential_decay as SGD ### Parameters obtained from paper ### K = 152 # depth of convo...
get_samples
<|file_name|>value.py<|end_file_name|><|fim▁begin|>from keras.models import Sequential from keras.layers import convolutional from keras.layers.core import Dense, Flatten from SGD_exponential_decay import SGD_exponential_decay as SGD ### Parameters obtained from paper ### K = 152 # depth of convo...
train
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
res = copy.copy(self.settings) if new_settings: # Invalidate the current subsettings if the parent setting changes # Example: new_settings declare a different "compiler", so invalidate the current "compiler.XXX"
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): <|fim_middle|> <|fim▁e...
"""A profile contains a set of setting (with values), environment variables """ def __init__(self): # Sections self.settings = OrderedDict() self.package_settings = defaultdict(OrderedDict) self.env_values = EnvValues() self.options = OptionsValues() self.bui...
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
self.settings = OrderedDict() self.package_settings = defaultdict(OrderedDict) self.env_values = EnvValues() self.options = OptionsValues() self.build_requires = OrderedDict() # conan_ref Pattern: list of conan_ref
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
return Values.from_list(list(self.settings.items()))
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
result = {} for pkg, settings in self.package_settings.items(): result[pkg] = list(settings.items()) return result
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
result = ["[settings]"] for name, value in self.settings.items(): result.append("%s=%s" % (name, value)) for package, values in self.package_settings.items(): for name, value in values.items(): result.append("%s:%s=%s" % (package, name, value)) re...
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
self.update_settings(other.settings) self.update_package_settings(other.package_settings) # this is the opposite other.env_values.update(self.env_values) self.env_values = other.env_values self.options.update(other.options) for pattern, req_list in other.build_req...
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
"""Mix the specified settings with the current profile. Specified settings are prioritized to profile""" assert(isinstance(new_settings, OrderedDict)) # apply the current profile res = copy.copy(self.settings) if new_settings: # Invalidate the current subset...
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
"""Mix the specified package settings with the specified profile. Specified package settings are prioritized to profile""" for package_name, settings in package_settings.items(): self.package_settings[package_name].update(settings)
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
for name, value in new_settings.items(): if "." not in name: if name in self.settings and self.settings[name] != value: for cur_name, _ in self.settings.items(): if cur_name.startswith("%s." % name): ...
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
if name in self.settings and self.settings[name] != value: for cur_name, _ in self.settings.items(): if cur_name.startswith("%s." % name): del res[cur_name]
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
for cur_name, _ in self.settings.items(): if cur_name.startswith("%s." % name): del res[cur_name]
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
del res[cur_name]
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
__init__
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
settings_values
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
package_settings_values
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
dumps
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
update
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
update_settings
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>import copy from collections import OrderedDict from collections import defaultdict from conans.model.env_info import EnvValues from conans.model.options import OptionsValues from conans.model.values import Values class Profile(object): """A profile contains a...
update_package_settings
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import # Copyright (c) 2010-2017 openpyxl from .cell import Cell, WriteOnlyCell<|fim▁hole|><|fim▁end|>
from .read_only import ReadOnlyCell
<|file_name|>del_cluster_systemlist.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you m...
from aquilon.aqdb.model import SystemList from aquilon.worker.broker import BrokerCommand # pylint: disable=W0611 from aquilon.worker.commands.del_cluster_member_priority import \ CommandDelClusterMemberPriority
<|file_name|>del_cluster_systemlist.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you m...
required_parameters = ["cluster", "hostname"] resource_class = SystemList def render(self, hostname, **kwargs): super(CommandDelClusterSystemList, self).render(hostname=None, metacluster=None, ...
<|file_name|>del_cluster_systemlist.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you m...
super(CommandDelClusterSystemList, self).render(hostname=None, metacluster=None, comments=None, member=hostname, ...
<|file_name|>del_cluster_systemlist.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you m...
render
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db.models import Transform from django.db.models import DateTimeField, TimeField from django.utils.functional import cached_property class TimeValue(Transform): lookup_name = 'time' function = 'time' def as_sql(self, compiler, connection): ...
DateTimeField.register_lookup(TimeValue)
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db.models import Transform from django.db.models import DateTimeField, TimeField from django.utils.functional import cached_property class TimeValue(Transform): <|fim_middle|> DateTimeField.register_lookup(TimeValue)<|fim▁end|>
lookup_name = 'time' function = 'time' def as_sql(self, compiler, connection): lhs, params = compiler.compile(self.lhs) return 'TIME({})'.format(lhs), params @cached_property def output_field(self): return TimeField()
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db.models import Transform from django.db.models import DateTimeField, TimeField from django.utils.functional import cached_property class TimeValue(Transform): lookup_name = 'time' function = 'time' def as_sql(self, compiler, connection): ...
lhs, params = compiler.compile(self.lhs) return 'TIME({})'.format(lhs), params
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db.models import Transform from django.db.models import DateTimeField, TimeField from django.utils.functional import cached_property class TimeValue(Transform): lookup_name = 'time' function = 'time' def as_sql(self, compiler, connection): ...
return TimeField()
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db.models import Transform from django.db.models import DateTimeField, TimeField from django.utils.functional import cached_property class TimeValue(Transform): lookup_name = 'time' function = 'time' def <|fim_middle|>(self, compiler, connec...
as_sql
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db.models import Transform from django.db.models import DateTimeField, TimeField from django.utils.functional import cached_property class TimeValue(Transform): lookup_name = 'time' function = 'time' def as_sql(self, compiler, connection): ...
output_field
<|file_name|>euctwprober.py<|end_file_name|><|fim▁begin|>######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright ...
<|file_name|>euctwprober.py<|end_file_name|><|fim▁begin|>######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright ...
def __init__(self): super(EUCTWProber, self).__init__() self.coding_sm = CodingStateMachine(EUCTW_SM_MODEL) self.distribution_analyzer = EUCTWDistributionAnalysis() self.reset() @property def charset_name(self): return "EUC-TW" @property def langu...
<|file_name|>euctwprober.py<|end_file_name|><|fim▁begin|>######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright ...
super(EUCTWProber, self).__init__() self.coding_sm = CodingStateMachine(EUCTW_SM_MODEL) self.distribution_analyzer = EUCTWDistributionAnalysis() self.reset()
<|file_name|>euctwprober.py<|end_file_name|><|fim▁begin|>######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright ...
return "EUC-TW"
<|file_name|>euctwprober.py<|end_file_name|><|fim▁begin|>######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright ...
return "Taiwan"
<|file_name|>euctwprober.py<|end_file_name|><|fim▁begin|>######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright ...
__init__
<|file_name|>euctwprober.py<|end_file_name|><|fim▁begin|>######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright ...
charset_name
<|file_name|>euctwprober.py<|end_file_name|><|fim▁begin|>######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright ...
language
<|file_name|>plot_error.py<|end_file_name|><|fim▁begin|>from matplotlib import pyplot as plt path = "C:/Temp/mnisterrors/chunk" + str(input("chunk: ")) + ".txt" <|fim▁hole|>plt.plot(errorhistory) plt.show()<|fim▁end|>
with open(path, "r") as f: errorhistory = [float(line.rstrip('\n')) for line in f]
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): <|fim_middle|> cwrapper = CWrapper(ENKF_LIB) cwrapper.registerObjectType("summary_key_matcher", Summary...
def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatcher, self).__init__(c_ptr) def addSummaryKey(self, key): assert isinstance(key, str) return SummaryKeyMatcher.cNamespace().add_key(self, key) def __len__(self): return SummaryKey...
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): <|fim_middle|> def addSummaryKey(self, key): assert isinstance(k...
c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatcher, self).__init__(c_ptr)
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
assert isinstance(key, str) return SummaryKeyMatcher.cNamespace().add_key(self, key)
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
return SummaryKeyMatcher.cNamespace().size(self)
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
return SummaryKeyMatcher.cNamespace().match_key(self, key)
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
""" @rtype: bool """ return SummaryKeyMatcher.cNamespace().is_required(self, key)
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
""" @rtype: StringList """ return SummaryKeyMatcher.cNamespace().keys(self)
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
SummaryKeyMatcher.cNamespace().free(self)
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def <|fim_middle|>(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKey...
__init__
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
addSummaryKey
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
__len__
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
__contains__
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
isRequired
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
keys
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
free
<|file_name|>simpleSound.py<|end_file_name|><|fim▁begin|># simpleSound.py # Plays audio files on Linux and Windows. # Written Jan-2008 by Timothy Weber. # Based on (reconstituted) code posted by Bill Dandreta at <http://www.velocityreviews.com/forums/t337346-how-to-play-sound-in-python.html>. import platform if platf...
dsp.write(data) dsp.close()
<|file_name|>simpleSound.py<|end_file_name|><|fim▁begin|># simpleSound.py # Plays audio files on Linux and Windows. # Written Jan-2008 by Timothy Weber. # Based on (reconstituted) code posted by Bill Dandreta at <http://www.velocityreviews.com/forums/t337346-how-to-play-sound-in-python.html>. import platform if platf...
"""Plays the sound in the given filename, asynchronously.""" if platform.system().startswith('Win'): PlaySound(filename, SND_FILENAME|SND_ASYNC) elif platform.system().startswith('Linux'): try: s = waveOpen(filename,'rb') (nc,sw,fr,nf,comptype, compname) = s.getparams...
<|file_name|>simpleSound.py<|end_file_name|><|fim▁begin|># simpleSound.py # Plays audio files on Linux and Windows. # Written Jan-2008 by Timothy Weber. # Based on (reconstituted) code posted by Bill Dandreta at <http://www.velocityreviews.com/forums/t337346-how-to-play-sound-in-python.html>. import platform if platf...
from winsound import PlaySound, SND_FILENAME, SND_ASYNC
<|file_name|>simpleSound.py<|end_file_name|><|fim▁begin|># simpleSound.py # Plays audio files on Linux and Windows. # Written Jan-2008 by Timothy Weber. # Based on (reconstituted) code posted by Bill Dandreta at <http://www.velocityreviews.com/forums/t337346-how-to-play-sound-in-python.html>. import platform if platf...
from wave import open as waveOpen from ossaudiodev import open as ossOpen try: from ossaudiodev import AFMT_S16_NE except ImportError: if byteorder == "little": AFMT_S16_NE = ossaudiodev.AFMT_S16_LE else: AFMT_S16_NE = ossaudiodev.AFMT_S16_BE
<|file_name|>simpleSound.py<|end_file_name|><|fim▁begin|># simpleSound.py # Plays audio files on Linux and Windows. # Written Jan-2008 by Timothy Weber. # Based on (reconstituted) code posted by Bill Dandreta at <http://www.velocityreviews.com/forums/t337346-how-to-play-sound-in-python.html>. import platform if platf...
AFMT_S16_NE = ossaudiodev.AFMT_S16_LE
<|file_name|>simpleSound.py<|end_file_name|><|fim▁begin|># simpleSound.py # Plays audio files on Linux and Windows. # Written Jan-2008 by Timothy Weber. # Based on (reconstituted) code posted by Bill Dandreta at <http://www.velocityreviews.com/forums/t337346-how-to-play-sound-in-python.html>. import platform if platf...
AFMT_S16_NE = ossaudiodev.AFMT_S16_BE
<|file_name|>simpleSound.py<|end_file_name|><|fim▁begin|># simpleSound.py # Plays audio files on Linux and Windows. # Written Jan-2008 by Timothy Weber. # Based on (reconstituted) code posted by Bill Dandreta at <http://www.velocityreviews.com/forums/t337346-how-to-play-sound-in-python.html>. import platform if platf...
PlaySound(filename, SND_FILENAME|SND_ASYNC)
<|file_name|>simpleSound.py<|end_file_name|><|fim▁begin|># simpleSound.py # Plays audio files on Linux and Windows. # Written Jan-2008 by Timothy Weber. # Based on (reconstituted) code posted by Bill Dandreta at <http://www.velocityreviews.com/forums/t337346-how-to-play-sound-in-python.html>. import platform if platf...
try: s = waveOpen(filename,'rb') (nc,sw,fr,nf,comptype, compname) = s.getparams( ) dsp = ossOpen('/dev/dsp','w') dsp.setparameters(AFMT_S16_NE, nc, fr) data = s.readframes(nf) s.close() dsp.write(data) dsp.close() ...
<|file_name|>simpleSound.py<|end_file_name|><|fim▁begin|># simpleSound.py # Plays audio files on Linux and Windows. # Written Jan-2008 by Timothy Weber. # Based on (reconstituted) code posted by Bill Dandreta at <http://www.velocityreviews.com/forums/t337346-how-to-play-sound-in-python.html>. import platform if platf...
Play
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
description = 'Run the Voter synchronous benchmark.') def sync(runner): runner.call('build', '-C') runner.go()
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
if not runner.opts.conditional or not os.path.exists('voter.jar'): runner.java.compile('obj', 'src/voter/*.java', 'src/voter/procedures/*.java') runner.call('volt.compile', '-c', 'obj', '-o', 'voter.jar', 'ddl.sql')
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
runner.shell('rm', '-rfv', 'obj', 'debugoutput', 'voter.jar', 'voltdbroot')
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
runner.call('build', '-C') runner.go()
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
runner.call('build', '-C') runner.go()
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
runner.call('build', '-C') runner.go()
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
runner.call('build', '-C') runner.go()
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
runner.call('build', '-C') runner.go()
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
runner.java.compile('obj', 'src/voter/*.java', 'src/voter/procedures/*.java')
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
build
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
clean
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
server
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
async
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
sync
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
jdbc
<|file_name|>voter.py<|end_file_name|><|fim▁begin|># This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, ...
simple
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|> The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', v...
# -*- coding: utf-8 -*- """proyectoP4 URL Configuration
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """proyectoP4 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views ...
urlpatterns += patterns( 'django.views.static', (r'media/(?P<path>.*)', 'serve', {'document_root': settings.MEDIA_ROOT}), )
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """proyectoP4 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views ...
urlpatterns += patterns('', url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_PATH}), )
<|file_name|>R6.1A.py<|end_file_name|><|fim▁begin|># Given the list values = [] , write code that fills the list with each set of numbers below. # a.1 2 3 4 5 6 7 8 9 10 list = [] <|fim▁hole|> list.append(i) print(list)<|fim▁end|>
for i in range(11):
<|file_name|>q2.py<|end_file_name|><|fim▁begin|>test = { 'name': 'Question 2', 'points': 2, 'suites': [ { 'type': 'sqlite', 'setup': r""" sqlite> .open hw1.db """, 'cases': [ { 'code': r""" sqlite> select * from colors; red|primary ...
<|file_name|>plot_afq_reco80.py<|end_file_name|><|fim▁begin|>""" ========================== RecoBundles80 using AFQ API ========================== An example using the AFQ API to run recobundles with the `80 bundle atlas <https://figshare.com/articles/Advanced_Atlas_of_80_Bundles_in_MNI_space/7375883>`_. """ import o...
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages setup( name = "CyprjToMakefile", version = "0.1", author = "Simon Marchi", author_email = "simon.marchi@polymtl.ca", description = "Generate Makefiles from Cypress cyprj files.", license = "GPLv3", ...
entry_points = { 'console_scripts': [ 'cyprj-to-makefile = cyprj_to_makefile.cyprj_to_makefile:main',
<|file_name|>jano.py<|end_file_name|><|fim▁begin|>import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate...
<|file_name|>jano.py<|end_file_name|><|fim▁begin|>import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate...
mobileTemplate = MobileTemplate() mobileTemplate.setCreatureName('tatooine_opening_jano') mobileTemplate.setLevel(1) mobileTemplate.setDifficulty(Difficulty.NORMAL) mobileTemplate.setSocialGroup("township") mobileTemplate.setOptionsBitmask(Options.INVULNERABLE | Options.CONVERSABLE) templates = Vector() te...
<|file_name|>jano.py<|end_file_name|><|fim▁begin|>import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def <|fim_middl...
addTemplate
<|file_name|>alertview.py<|end_file_name|><|fim▁begin|>import kivy kivy.require('1.9.1') from kivy.uix.popup import Popup from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.metrics import dp from kivy.app import Builder from kivy.properties import StringProperty, ObjectProperty from k...
<|file_name|>alertview.py<|end_file_name|><|fim▁begin|>import kivy kivy.require('1.9.1') from kivy.uix.popup import Popup from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.metrics import dp from kivy.app import Builder from kivy.properties import StringProperty, ObjectProperty from k...
popup = Popup(title = title, content=Label(text = msg), size_hint=(None, None), size=(dp(600), dp(200))) popup.open()
<|file_name|>alertview.py<|end_file_name|><|fim▁begin|>import kivy kivy.require('1.9.1') from kivy.uix.popup import Popup from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.metrics import dp from kivy.app import Builder from kivy.properties import StringProperty, ObjectProperty from k...
content = ConfirmPopup(text=msg) content.bind(on_answer=answerCallback) popup = Popup(title=title, content=content, size_hint=(None, None), size=(dp(600),dp(200)), auto_dismiss= False) popup.open() return popup
<|file_name|>alertview.py<|end_file_name|><|fim▁begin|>import kivy kivy.require('1.9.1') from kivy.uix.popup import Popup from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.metrics import dp from kivy.app import Builder from kivy.properties import StringProperty, ObjectProperty from k...
text = StringProperty() def __init__(self,**kwargs): self.register_event_type('on_answer') super(ConfirmPopup,self).__init__(**kwargs) def on_answer(self, *args): pass
<|file_name|>alertview.py<|end_file_name|><|fim▁begin|>import kivy kivy.require('1.9.1') from kivy.uix.popup import Popup from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.metrics import dp from kivy.app import Builder from kivy.properties import StringProperty, ObjectProperty from k...
self.register_event_type('on_answer') super(ConfirmPopup,self).__init__(**kwargs)