code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ListBackup(lister.Lister): <NEW_LINE> <INDENT> log = logging.getLogger(__name__ + '.ListBackup') <NEW_LINE> def take_action(self, parsed_args): <NEW_LINE> <INDENT> self.log.debug('take_action(%s)', parsed_args) <NEW_LINE> columns = ( 'ID', 'Display Name', 'Display Description', 'Status', 'Size' ) <NEW_LINE> data ... | List backup command | 62598f8f5f7d997b871f91e1 |
class mediumAI(AI): <NEW_LINE> <INDENT> def __init__(self, lengthOfMap): <NEW_LINE> <INDENT> self.shipsLeft = 12 <NEW_LINE> super().__init__(lengthOfMap) | Medium difficulty AI, designed to be same skill level as a normal human. | 62598f8f96565a6dacd2cd80 |
class TriggerProxy(CommandProxy): <NEW_LINE> <INDENT> def __call__(self, objective: str) -> str: <NEW_LINE> <INDENT> return self._run('objective') <NEW_LINE> <DEDENT> def add(self, objective: str, value: int) -> str: <NEW_LINE> <INDENT> return self._run('add', objective, value) <NEW_LINE> <DEDENT> def set(self, objecti... | Proxy for trigger commands. | 62598f8fdc8b845886d531ca |
class VecEnv(ABC): <NEW_LINE> <INDENT> closed = False <NEW_LINE> viewer = None <NEW_LINE> metadata = { 'render.modes': ['human', 'rgb_array'] } <NEW_LINE> def __init__(self, num_envs, observation_space, action_space, spec, env_type): <NEW_LINE> <INDENT> self.num_envs = num_envs <NEW_LINE> self.observation_space = obser... | An abstract asynchronous, vectorized environment.
Used to batch data from multiple copies of an environment, so that
each observation becomes an batch of observations, and expected action is a batch of actions to
be applied per-environment. | 62598f8f004d5f362081ee02 |
class DecoderLayer(tf.keras.layers.Layer): <NEW_LINE> <INDENT> def __init__(self, d_model, num_heads, dff, rate=0.1): <NEW_LINE> <INDENT> super(DecoderLayer, self).__init__() <NEW_LINE> self.mha1 = layers.MultiHeadAttention(d_model, num_heads) <NEW_LINE> self.mha2 = layers.MultiHeadAttention(d_model, num_heads) <NEW_LI... | Decoder layer as described in the paper.
| 62598f8fdd821e528d6d8b41 |
class FileServer(object): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> <DEDENT> def __call__(self, environ, start_response): <NEW_LINE> <INDENT> path_info = environ["PATH_INFO"] <NEW_LINE> if not path_info: <NEW_LINE> <INDENT> return self._not_found(start_response) <NEW_... | Serves static files from a directory.
| 62598f8f3539df3088ecbecd |
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): <NEW_LINE> <INDENT> VERSION = 1 <NEW_LINE> async def async_step_user(self, user_input=None): <NEW_LINE> <INDENT> self._async_abort_entries_match() <NEW_LINE> errors = {} <NEW_LINE> if user_input is not None: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> await s... | Handle a config flow for Mullvad VPN. | 62598f8f3c8af77a43b67d40 |
class xml_generator_configuration_t(parser_configuration_t): <NEW_LINE> <INDENT> def __init__( self, gccxml_path='', xml_generator_path='', working_directory='.', include_paths=None, define_symbols=None, undefine_symbols=None, start_with_declarations=None, ignore_gccxml_output=False, cflags="", compiler=None, xml_gener... | Configuration object to collect parameters for invoking gccxml or castxml.
This class serves as a container for the parameters that can be used
to customize the call to gccxml or castxml. | 62598f8fa17c0f6771d5be49 |
class MissingParameterException(EOxSException): <NEW_LINE> <INDENT> pass | This exception shall be raised if an expected parameter is not found. | 62598f8fd6c5a102081e1d54 |
@register_packet(Packet.OP_SEND_PKT, Packet.F_CMD) <NEW_LINE> class SendPacketCommand(Packet): <NEW_LINE> <INDENT> def __init__(self, payload): <NEW_LINE> <INDENT> super().__init__(Packet.OP_SEND_PKT, payload, Packet.F_CMD) | Send a BLUETOOTH_LE_LL packet. | 62598f8f8e7ae83300ee8cb3 |
class Student(SchoolMember): <NEW_LINE> <INDENT> def __init__(self,name,age,marks): <NEW_LINE> <INDENT> SchoolMember.__init__(self,name,age) <NEW_LINE> self.marks = marks <NEW_LINE> print('initialized student: {}'.format(self.name)) <NEW_LINE> <DEDENT> def tell(self): <NEW_LINE> <INDENT> SchoolMember.tell(self) <NEW_LI... | a student | 62598f8f01c39578d7f12995 |
class Player(Block): <NEW_LINE> <INDENT> def update(self): <NEW_LINE> <INDENT> pos = pygame.keyboard.get_pos() <NEW_LINE> self.rect.x = pos[0] <NEW_LINE> self.rect.y = pos[1] | The player class derives from Block, but overrides the 'update'
functionality with new a movement function that will move the block
with the mouse. | 62598f8f26068e7796d4c56f |
class Ismkl(IccIfort, Mpich2, IntelMKL, IntelFFTW): <NEW_LINE> <INDENT> NAME = 'ismkl' <NEW_LINE> SUBTOOLCHAIN = [IccIfort.NAME, Iimkl.NAME] | Compiler toolchain with Intel compilers (icc/ifort), MPICH2 (ScaleMP MPI),
Intel Math Kernel Library (MKL) and Intel FFTW wrappers. | 62598f8f0c0af96317c55f93 |
class Adagrad(Optimizer): <NEW_LINE> <INDENT> def __init__(self, lr=0.01, epsilon=1e-8, **kwargs): <NEW_LINE> <INDENT> super(Adagrad, self).__init__(**kwargs) <NEW_LINE> self.__dict__.update(locals()) <NEW_LINE> self.lr = K.variable(lr) <NEW_LINE> <DEDENT> def get_updates(self, params, constraints, loss): <NEW_LINE> <I... | Adagrad optimizer.
It is recommended to leave the parameters of this optimizer
at their default values.
# Arguments
lr: float >= 0. Learning rate.
epsilon: float >= 0. | 62598f8f16aa5153ce400117 |
class ExpandDimsLayer(Layer): <NEW_LINE> <INDENT> def __init__( self, layer = None, axis = None, name = 'expand_dims', ): <NEW_LINE> <INDENT> Layer.__init__(self, name=name) <NEW_LINE> self.inputs = layer.outputs <NEW_LINE> print(" [TL] ExpandDimsLayer %s: axis:%d" % (self.name, axis)) <NEW_LINE> with tf.variable_sco... | The :class:`ExpandDimsLayer` class inserts a dimension of 1 into a tensor's shape,
see `tf.expand_dims() <https://www.tensorflow.org/api_docs/python/array_ops/shapes_and_shaping#expand_dims>`_ .
Parameters
----------
layer : a :class:`Layer` instance
The `Layer` class feeding into this layer.
axis : int, 0-D (scal... | 62598f8fe64d504609df91bc |
class Renderer(base.Renderer): <NEW_LINE> <INDENT> render = ViewPageTemplateFile('templates/photowall.pt') <NEW_LINE> @property <NEW_LINE> def available(self): <NEW_LINE> <INDENT> show = False <NEW_LINE> if getattr(self.request, 'listing_id', None) is not None: <NEW_LINE> <INDENT> show = True <NEW_LINE> <DEDENT> return... | PhotoWall Portlet Renderer. | 62598f8f71ff763f4b5e7383 |
class NodeInstall(NodeTask): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def prepare(cls, options, round_manager): <NEW_LINE> <INDENT> super(NodeInstall, cls).prepare(options, round_manager) <NEW_LINE> round_manager.require_data(NodePathsLocal) <NEW_LINE> <DEDENT> def execute(self): <NEW_LINE> <INDENT> for target in se... | Installs a node_module target into the directory that the target is defined in.
Note:
Running the node install on an example_project will install into the local source dir
rather than in the typical .pants.d working directory.
This task is intended to set up the environment for development purposes rather than
... | 62598f8fbde94217f370746f |
class UpdateCommand(BaseCommand): <NEW_LINE> <INDENT> name = 'update' <NEW_LINE> def cmd(self, repo_config, namespace): <NEW_LINE> <INDENT> pass | Update the repository from the sources list | 62598f8f435de62698e9ba01 |
class TestNoDataImage(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> channel = np.ma.array([[0, 0.5, 0.5], [0.5, 0.25, 0.25]], mask=[[1, 1, 1], [1, 1, 1]]) <NEW_LINE> self.img = image.Image(channels=[channel] * 3, mode="RGB") <NEW_LINE> self.modes = ["L", "LA", "RGB", "RGBA", "YCbCr", "YCb... | Test an image filled with no data. | 62598f8feab8aa0e5d30b98d |
class Validator: <NEW_LINE> <INDENT> def validate(self, package: Package) -> dict: <NEW_LINE> <INDENT> raise NotImplementedError | Abstract class for validators used by the-new-hotness to validate the package.
This class must be inherited by every external validator. | 62598f8f6fece00bbaccb59e |
class DatabaseOpenCloseMixin(): <NEW_LINE> <INDENT> def _backup_database(self) -> NoReturn: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> backup_file_path = os.path.abspath("shopDataBaseBackup.json") <NEW_LINE> shutil.copyfile(os.path.abspath("shopDataBase.json"), backup_file_path) <NEW_LINE> <DEDENT> except FileNotFoun... | Mixin class created for reading, writing and backup of an impromptu database | 62598f8f004d5f362081ee03 |
class ColoredFormatter(logging.Formatter): <NEW_LINE> <INDENT> def __init__(self, msg, use_color=True): <NEW_LINE> <INDENT> logging.Formatter.__init__(self, msg) <NEW_LINE> self.use_color = use_color <NEW_LINE> <DEDENT> def format(self, record): <NEW_LINE> <INDENT> COLOR_SEQ = "\033[1;%dm" <NEW_LINE> RESET_SEQ = "\033[... | Custom logger class for changing levels color | 62598f8fb57a9660fecd1690 |
class TensorConfigState(IntEnum): <NEW_LINE> <INDENT> BOUNDARY = 0 <NEW_LINE> INTERIOR = 1 | The 'state' of a TensorConfig as used in the Plan generation algorithm.
BOUNDARY - Should describe a Plan input/output Tensor.
INTERIOR - Should describe an intermediate Tensor in a 'closed' Plan. | 62598f8f7b25080760ed70be |
class FilepathType(DataType): <NEW_LINE> <INDENT> REGEX = re.compile(r'(\/.*)|([A-Z]:\\.*)') <NEW_LINE> def matches(self, data): <NEW_LINE> <INDENT> if isinstance(data, str) or isinstance(data, unicode): <NEW_LINE> <INDENT> if self.REGEX.match(data) is not None: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> <DEDE... | Files and paths can be opened. | 62598f8f097d151d1a2c0c3b |
class LockWatchdog(threading.Thread): <NEW_LINE> <INDENT> threads = [] <NEW_LINE> def __init__(self, lockfile): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.lockfile = lockfile <NEW_LINE> self.trigger = threading.Event() <NEW_LINE> self.finished = threading.Event() <NEW_LINE> <DEDENT> def stop_wa... | Touch the given file every 10 seconds until asked to stop. | 62598f8f7d847024c075bfe2 |
class ActuatorData(): <NEW_LINE> <INDENT> name= 'Not set' <NEW_LINE> hasError= False <NEW_LINE> command= 0 <NEW_LINE> errCode= 0 <NEW_LINE> statusCode = 0 <NEW_LINE> stateData = None <NEW_LINE> val= 0.0 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.updateTimeStamp() <NEW_LINE> <DEDENT> def getCommand(sel... | classdocs | 62598f8f596a89723612788b |
class NotifyTable: <NEW_LINE> <INDENT> __changed = False <NEW_LINE> __active = True <NEW_LINE> @classmethod <NEW_LINE> def NTtouch(cls, *args, **kwargs): <NEW_LINE> <INDENT> cls.__changed = True <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def NTclear(cls, *args, **kwargs): <NEW_LINE> <INDENT> cls.__changed = False <NEW... | Helper class tracking inserts and deletes.
Automatically calls derived classes `_commit` method to react accordingly | 62598f8f3cc13d1c6d46537b |
class DummyContained(controller.Controller, controller.ControllerProvider): <NEW_LINE> <INDENT> implements(interfaces.IController) <NEW_LINE> name = 'DummyContained' <NEW_LINE> desc = 'I am a dummy contained created for tests purposes' <NEW_LINE> loaded = False <NEW_LINE> _container = 'container' <NEW_LINE> __route__ =... | I am a dummy controller to test Mamba | 62598f8f8e7ae83300ee8cb5 |
class Old5(meta.ProtocoledClass): <NEW_LINE> <INDENT> pass | message Old5 {
required uint32 a = 1;
} | 62598f8f6aa9bd52df0d4adf |
class CsvDictsAdapter(object): <NEW_LINE> <INDENT> def __init__(self, source_generator): <NEW_LINE> <INDENT> self.source = source_generator <NEW_LINE> self.buffer = StringIO() <NEW_LINE> self.csv = None <NEW_LINE> self.add_header = False <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE>... | Provide a DataChange generator and it provides a file-like object which returns csv data | 62598f8fa4f1c619b294e1fb |
class DepositoForm(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Deposito <NEW_LINE> fields = ["Referencia","Postiza"] | Form para añadir una instancia a la tabla de Deposito
de pago. | 62598f8f8da39b475be02df1 |
class SimpleOffsetTzInfo(tzinfo): <NEW_LINE> <INDENT> def __init__(self, offsetInHours=None): <NEW_LINE> <INDENT> if offsetInHours != None: <NEW_LINE> <INDENT> self.offsetInHours = offsetInHours <NEW_LINE> <DEDENT> <DEDENT> def utcoffset(self, dt): <NEW_LINE> <INDENT> return timedelta(hours=self.offsetInHours) <NEW_LIN... | Very simple implementation of datetime.tzinfo offering set timezone offset for datetime instances | 62598f8f3eb6a72ae038a249 |
class LocationInstanceCreateTest(FictionOutlineAbstractTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.o4 = Outline(title="Test valid outline", description='Hi there.', user=self.user1) <NEW_LINE> self.o4.save() <NEW_LINE> <DEDENT> def test_login_required(self): <NEW_... | Test case for creating location instances. | 62598f8f76e4537e8c3ef1c1 |
class Queue: <NEW_LINE> <INDENT> _attempt_delay = 0.01 <NEW_LINE> def __init__(self, maxsize=0): <NEW_LINE> <INDENT> self.maxsize = maxsize <NEW_LINE> self._queue = deque() <NEW_LINE> <DEDENT> def _get(self): <NEW_LINE> <INDENT> return self._queue.popleft() <NEW_LINE> <DEDENT> def get(self): <NEW_LINE> <INDENT> while n... | A queue, useful for coordinating producer and consumer coroutines.
If maxsize is less than or equal to zero, the queue size is infinite. If it
is an integer greater than 0, then "yield from put()" will block when the
queue reaches maxsize, until an item is removed by get().
Unlike the standard library Queue, you can ... | 62598f8f507cdc57c63a49a3 |
class ComponentJoint(Posable): <NEW_LINE> <INDENT> PARENT_FRAME = True <NEW_LINE> def __init__(self, joint_type, parent, child, pose=None, axis=None, axis2=None, after_create=None, **kwargs): <NEW_LINE> <INDENT> super(ComponentJoint, self).__init__("", pose=pose) <NEW_LINE> self.after_create = after_create <NEW_LINE> s... | Since we're constructing robots out of conceptual components (which
are not actually SDF body parts), we need a way of joint creation
that is not the SDF joint (since this joins links concretely).
This is what this class is for. It can be instantiated and positioned
like a regular SDF joint, only it has some magic rega... | 62598f8f21a7993f00c65b8c |
class PathList(typed_list): <NEW_LINE> <INDENT> def is_empty(self): <NEW_LINE> <INDENT> if (len(self) == 0): return True <NEW_LINE> for e in self: <NEW_LINE> <INDENT> if not e.is_empty(): return False <NEW_LINE> <DEDENT> return True <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> if isinstance(key, ... | A list of Structure objects | 62598f8fe76e3b2f99fd8646 |
class YangUIPage (NavigationPage): <NEW_LINE> <INDENT> def __init__(self, driver, conf): <NEW_LINE> <INDENT> super(YangUIPage, self).__init__(driver, conf) <NEW_LINE> self._page_title = "Yang UI" | Login Page | 62598f8f004d5f362081ee04 |
class TestConfig(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.config = ha.Config(None) <NEW_LINE> assert self.config.config_dir is None <NEW_LINE> <DEDENT> def test_path_with_file(self): <NEW_LINE> <INDENT> self.config.config_dir = "/test/ha-config" <NEW_LINE> assert "/test/ha-confi... | Test configuration methods. | 62598f8fa17c0f6771d5be4c |
class GenericAction(CaptureActionBase): <NEW_LINE> <INDENT> def __init__(self, callback_on_frame, frame_interval, format="PIL"): <NEW_LINE> <INDENT> self.__generic_action_callback = callback_on_frame <NEW_LINE> self.__event_executor = ThreadPoolExecutor() <NEW_LINE> self.__frame_interval = frame_interval <NEW_LINE> sel... | Class that executes the provided :data:`callback` whenever a camera
frame is processed.
:param function callback_on_frame: A callback function that will be called with each new frame as the first argument.
:param int frame_interval: The callback will run every frame_interval frames, decreasing the frame rate of proces... | 62598f8f7b25080760ed70c0 |
class ClanoviSkole: <NEW_LINE> <INDENT> def __init__(self, ime, godine): <NEW_LINE> <INDENT> self.ime = ime <NEW_LINE> self.godine = godine <NEW_LINE> print("(Inicijalizujem ClanoveSkole: {0})".format(self.ime)) <NEW_LINE> <DEDENT> def kazi(self): <NEW_LINE> <INDENT> print("Ime: {0}, Godine: {1}".format(self.ime, self.... | Predstavlja bilo kojeg clana skole | 62598f8fb57a9660fecd1692 |
class User(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> email = models.EmailField(max_length=255, unique=True) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> is_active = models.BooleanField(default=True) <NEW_LINE> is_staff = models.BooleanField(default=False) <NEW_LINE> objects = UserManager... | Custom user model that supports ermail instead of username | 62598f8f3c8af77a43b67d42 |
class DoorSwitchSensor(OccpSensor): <NEW_LINE> <INDENT> def __init__(self,node,freq,instID): <NEW_LINE> <INDENT> OccpSensor.__init__(self,node,freq,instID) <NEW_LINE> self.mesureType = 'Contact switch' <NEW_LINE> self.mesureUnit ='binary' <NEW_LINE> self.instType = '' <NEW_LINE> self.dbTable = 'DOOROPENINGS' <NEW_LINE>... | Abstract class for the door contact switch family of sensors. Here only some specific
attributes are specified, no method implementation | 62598f8fcb5e8a47e493bf7a |
class UserEditingForm(forms.Form): <NEW_LINE> <INDENT> username = forms.CharField(max_length=30, required=True) <NEW_LINE> first_name = forms.CharField(max_length=30, required=False) <NEW_LINE> last_name = forms.CharField(max_length=30, required=False) <NEW_LINE> email = forms.EmailField() <NEW_LINE> primary_key = form... | This will be the form that will take care of letting the user
edit his or her account. I would use a ModelForm, but I want more
control, so I'll do this. | 62598f8f8e7ae83300ee8cb7 |
class UnknownRequestMethodException(Exception): <NEW_LINE> <INDENT> pass | Unknown request method exception | 62598f8f6e29344779b0026a |
class SceneSetup(object): <NEW_LINE> <INDENT> def __init__(self, dice_setups : List[DiceSetup]): <NEW_LINE> <INDENT> self.dice_setups = dice_setups <NEW_LINE> <DEDENT> def get_number_of_dice(self): <NEW_LINE> <INDENT> return len(self.dice_setups) | Setup information for all die in a scene. | 62598f8f55399d3f0562612f |
class FilterModel(model_base.DataModel): <NEW_LINE> <INDENT> schema_url = "filter.schema.yaml" <NEW_LINE> def __init__(self, init=None, filter_table=None, **kwargs): <NEW_LINE> <INDENT> super(FilterModel, self).__init__(init=init, **kwargs) <NEW_LINE> if filter_table is not None: <NEW_LINE> <INDENT> self.filter_table =... | A data model for filter throughput. | 62598f8f0c0af96317c55f97 |
class SearchMangasProvider(search_provider.SearchProvider): <NEW_LINE> <INDENT> _SEARCH_NAME = 'manga' <NEW_LINE> _SEARCHED_URL_SUFFIX = '/manga/' <NEW_LINE> def _SEARCHED_OBJECT(self, mal_url: str): <NEW_LINE> <INDENT> from pymal import manga <NEW_LINE> mal_id = int(mal_url.split('/')[0]) <NEW_LINE> return manga.Manga... | Searching for mangas. | 62598f8fb830903b9686e27d |
class GraphFrame(pg.GraphicsWindow): <NEW_LINE> <INDENT> def __init__(self, pxCycle, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.pxCycle = pxCycle <NEW_LINE> self.plot = self.addPlot(row=1, col=0) <NEW_LINE> self.plot.setYRange(0, 1) <NEW_LINE> self.plot.showGrid(x=False, y=F... | Creates the plot that plots the preview of the pulses.
Fcn update() updates the plot of "device" with signal "signal". | 62598f8f435de62698e9ba04 |
class Operation(Enum): <NEW_LINE> <INDENT> DELETED = 1 <NEW_LINE> INSERTED = 2 <NEW_LINE> SUBSTITUTED = 3 <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return str(self.name.lower()) | Operations | 62598f8fa4f1c619b294e1fd |
class PowerConfiguration1CRXCluster(DoublingPowerConfigurationCluster): <NEW_LINE> <INDENT> BATTERY_VOLTAGE = 0x0020 <NEW_LINE> BATTERY_SIZES = 0x0031 <NEW_LINE> BATTERY_QUANTITY = 0x0033 <NEW_LINE> BATTERY_RATED_VOLTAGE = 0x0034 <NEW_LINE> _CONSTANT_ATTRIBUTES = { BATTERY_VOLTAGE: 0, BATTERY_SIZES: 10, BATTERY_QUANTIT... | Updating Power attributes 1 CR2032 and Zero voltage. | 62598f8fbde94217f3707471 |
class new_feature(object): <NEW_LINE> <INDENT> name = 'new_feature' <NEW_LINE> mutual_info = 0 <NEW_LINE> model_score = 0 <NEW_LINE> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def drop_feature(self, df): <NEW_LINE> <INDENT> df.drop([self.name]) <NEW_LINE> <DEDENT> def get_info(se... | can do drop feature, and compute mutual info | 62598f8f63b5f9789fe84d87 |
class DependentBulkGenerator(DependentGenerator): <NEW_LINE> <INDENT> def __init__(self, element_generator): <NEW_LINE> <INDENT> DependentGenerator.__init__(self) <NEW_LINE> self.element_generator = element_generator <NEW_LINE> <DEDENT> def generate(self, observations): <NEW_LINE> <INDENT> def f(bulk_size): <NEW_LINE> ... | Dependent Generator that transforms that observations into a list of
observation elements that are generated through element_generator. | 62598f8f435de62698e9ba05 |
class TestListMatchingEbuilds(TestCase): <NEW_LINE> <INDENT> pass | Need to setup a temporary portage directory for these tests | 62598f8f379a373c97d98c2c |
class MissingDependency(SanjabError): <NEW_LINE> <INDENT> pass | Raised when a library a backend depends on can not be found. | 62598f8f76d4e153a661c82e |
class ModelAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> def has_delete_permission(self, request, obj=None): <NEW_LINE> <INDENT> return False | deletion of top level objects is evil | 62598f8fe76e3b2f99fd8648 |
class PowerDist(ColorDistBase): <NEW_LINE> <INDENT> def __init__(self, hashsize, colorlen=None, exp=1000.0): <NEW_LINE> <INDENT> self.exp = exp <NEW_LINE> super(PowerDist, self).__init__(hashsize, colorlen=colorlen) <NEW_LINE> <DEDENT> def calc_hash(self): <NEW_LINE> <INDENT> base = numpy.arange(0.0, float(self.hashsiz... | y = ((a ** x) - 1) / a
where x in (0..1) | 62598f8fcad5886f8bdc4e96 |
class PredefinedRequestHandler(http_server.TestingHTTPRequestHandler): <NEW_LINE> <INDENT> def handle_one_request(self): <NEW_LINE> <INDENT> tcs = self.server.test_case_server <NEW_LINE> requestline = self.rfile.readline() <NEW_LINE> self.MessageClass(self.rfile, 0) <NEW_LINE> if requestline.startswith('POST'): <NEW_LI... | Request handler for a unique and pre-defined request.
The only thing we care about here is that we receive a connection. But
since we want to dialog with a real http client, we have to send it correct
responses.
We expect to receive a *single* request nothing more (and we won't even
check what request it is), the tes... | 62598f8f7b25080760ed70c2 |
class MetricsBase(object): <NEW_LINE> <INDENT> @reify <NEW_LINE> def dpi(self): <NEW_LINE> <INDENT> custom_dpi = environ.get('KIVY_DPI') <NEW_LINE> if custom_dpi: <NEW_LINE> <INDENT> return float(custom_dpi) <NEW_LINE> <DEDENT> if platform == 'android': <NEW_LINE> <INDENT> if USE_SDL2: <NEW_LINE> <INDENT> import jnius ... | Class that contains the default attributes for Metrics. Don't use this
class directly, but use the `Metrics` instance. | 62598f8fd4950a0f3b110c41 |
class RendererMixin(object): <NEW_LINE> <INDENT> def setUp(self, *args, **kwargs): <NEW_LINE> <INDENT> super(RendererMixin, self).setUp(*args, **kwargs) <NEW_LINE> self.root_dir = tempfile.mkdtemp('pyobjects_test_root') <NEW_LINE> self.config = minion_config(None) <NEW_LINE> self.config.update({ 'file_client': 'local',... | This is a mixin that adds a ``.render()`` method to render a template
It must come BEFORE ``TestCase`` in the declaration of your test case
class so that our setUp & tearDown get invoked first, and super can
trigger the methods in the ``TestCase`` class. | 62598f8fbe383301e0253416 |
class Error(Exception): <NEW_LINE> <INDENT> pass | Handle MaxCount errors. | 62598f8f3539df3088ecbed3 |
class GPUCBPESearcher(Searcher): <NEW_LINE> <INDENT> def __init__(self, n_output_node, input_shape, path, metric, loss, generators, verbose, trainer_args=None, default_model_len=None, default_model_width=None, t_min=None, n_parralel=1): <NEW_LINE> <INDENT> super(GPUCBPESearcher, self).__init__(n_output_node, input_shap... | Class to search for neural architectures using Bayesian search strategy.
Attribute:
optimizer: An instance of BayesianOptimizer.
t_min: A float. The minimum temperature during simulated annealing. | 62598f8f925a0f43d25e7c4e |
class BitcoinSealWitness(SingleUseSeal): <NEW_LINE> <INDENT> __slots__ = ['seal','txoutproof'] <NEW_LINE> SERIALIZED_ATTRS = [('seal', BitcoinSingleUseSeal), ('txinproof', proofchains.core.bitcoin.TxInProof), ('txoutproof', proofchains.core.bitcoin.TxOutProof)] <NEW_LINE> HASHTAG = HashTag('2ca464a0-1b8c-4aa5-8e72... | Witness to the use of a BitcoinSingleUseSeal | 62598f8f0c0af96317c55f99 |
class ServiceType(GXIntEnum): <NEW_LINE> <INDENT> TCP = 0 <NEW_LINE> UDP = 1 <NEW_LINE> FTP = 2 <NEW_LINE> SMTP = 3 <NEW_LINE> SMS = 4 <NEW_LINE> HDLC = 5 <NEW_LINE> M_BUS = 6 <NEW_LINE> ZIGBEE = 7 | Type of service used to push the data. | 62598f8ff8510a7c17d7df82 |
class Category(Model): <NEW_LINE> <INDENT> pass | A class representing an item category.
```js
{
"Name": "Buds",
"ProductCategoryType": "Buds",
"QuantityType": "WeightBased",
"RequiresStrain": true,
"RequiresItemBrand": false,
"RequiresAdministrationMethod": false,
"RequiresUnitCbdPercent": false,
"Re... | 62598f8f24f1403a926856ba |
class Timeout(Exception): <NEW_LINE> <INDENT> pass | Timeout. | 62598f8fbaa26c4b54d4eecc |
class CareerStageEditView(BaseAdminEditView): <NEW_LINE> <INDENT> route_name = CAREER_STAGE_ITEM_URL <NEW_LINE> schema = get_career_stage_schema() <NEW_LINE> factory = CareerStage <NEW_LINE> title = u"Modifier une étape de parcours" | Edit view | 62598f8f8c0ade5d55dc3497 |
class SettingSaslauthd(Subcommand): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SettingSaslauthd, self).__init__() <NEW_LINE> self.parser.prog = "couchbase-cli setting-saslauthd" <NEW_LINE> group = self.parser.add_argument_group("saslauthd settings") <NEW_LINE> group.add_argument("--enabled", dest... | The setting sasl subcommand | 62598f8fdc8b845886d531d2 |
class AccessTokenView(_DispatchingView): <NEW_LINE> <INDENT> dot_view = dot_views.TokenView <NEW_LINE> dop_view = dop_views.AccessTokenView <NEW_LINE> @cached_property <NEW_LINE> def claim_handlers(self): <NEW_LINE> <INDENT> return { 'email': self._attach_email_claim, 'profile': self._attach_profile_claim } <NEW_LINE> ... | Handle access token requests. | 62598f8f004d5f362081ee06 |
class SuppressPrints(object): <NEW_LINE> <INDENT> def __enter__(self): <NEW_LINE> <INDENT> self._original_stdout = sys.stdout <NEW_LINE> sys.stdout = open(os.devnull, 'w') <NEW_LINE> <DEDENT> def __exit__(self, exc_type, exc_val, exc_tb): <NEW_LINE> <INDENT> sys.stdout.close() <NEW_LINE> sys.stdout = self._original_std... | The class is a context manager class that could suppress any
prints that being called within the block. This functionality
is needed when there is third-party logging nor prints that
obscuring actual log. | 62598f8f45492302aabfc0ed |
class SymbolResolverMixin(object): <NEW_LINE> <INDENT> def resolve_dependency(self, xml_path): <NEW_LINE> <INDENT> with open(xml_path, "rb") as xml_file: <NEW_LINE> <INDENT> symbol_xml = xml_file.read() <NEW_LINE> <DEDENT> updated_xml = fix_xml_node( symbol_xml, str(self.collection_path), QgsApplication.svgPaths() ) <N... | Mixin for Resources Handlers that need to resolve SVG
and image symbol paths. | 62598f8fbe383301e0253418 |
class Sigmoid(Activation): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Sigmoid, self).__init__() <NEW_LINE> <DEDENT> def forward(self, x): <NEW_LINE> <INDENT> self.state = 1 / (1 + np.exp(-x)) <NEW_LINE> self._argument = x <NEW_LINE> return self.state <NEW_LINE> <DEDENT> def derivative(self): <NEW... | Sigmoid non-linearity | 62598f8fdd821e528d6d8b49 |
class cd: <NEW_LINE> <INDENT> def __init__(self, newPath): <NEW_LINE> <INDENT> self.newPath = os.path.expanduser(newPath) <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.savedPath = os.getcwd() <NEW_LINE> os.chdir(self.newPath) <NEW_LINE> <DEDENT> def __exit__(self, etype, value, traceback): <NEW_LINE... | Context manager for changing the current working directory
Thank you, Brian M. Hunt from StackOverflow. | 62598f8f442bda511e95c078 |
class Category(models.Model): <NEW_LINE> <INDENT> nid = models.AutoField(primary_key=True) <NEW_LINE> title = models.CharField(max_length=32) <NEW_LINE> blog = models.ForeignKey(to="Blog", to_field="nid", on_delete=models.DO_NOTHING) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.title <NEW_LINE> <DEDENT... | 个人博客文章分类 | 62598f8f596a897236127891 |
class TestScriptVariable(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_name = "TestScriptVariable" <NEW_LINE> def __init__(self, jsondict=None, strict=True): <NEW_LINE> <INDENT> self.headerField = None <NEW_LINE> self.name = None <NEW_LINE> self.path = None <NEW_LINE> self.sourceId = None <NEW_LINE> su... | Placeholder for evaluated elements.
Variable is set based either on element value in response body or on header
field value in the response headers. | 62598f8f8e7ae83300ee8cba |
class VirtuelEnv(object): <NEW_LINE> <INDENT> VENV_ENV_NAME = "QTAF_VENV" <NEW_LINE> def __init__(self, dist_pkg_path, path=None, recreate=False): <NEW_LINE> <INDENT> self._dist_pkg_path = dist_pkg_path <NEW_LINE> self._venv = path <NEW_LINE> self._recreate_venv = recreate <NEW_LINE> <DEDENT> def activate(self): <NEW_L... | virtual env for QTA test project
| 62598f8f925a0f43d25e7c50 |
class CiscoWebexTeamsNotificationService(BaseNotificationService): <NEW_LINE> <INDENT> def __init__(self, client, room): <NEW_LINE> <INDENT> self.room = room <NEW_LINE> self.client = client <NEW_LINE> <DEDENT> def send_message(self, message="", **kwargs): <NEW_LINE> <INDENT> title = "" <NEW_LINE> if kwargs.get(ATTR_TIT... | The Cisco Webex Teams Notification Service. | 62598f8fd6c5a102081e1d5c |
class Polygon3d(object): <NEW_LINE> <INDENT> def __init__(self, lines): <NEW_LINE> <INDENT> self.lines = lines <NEW_LINE> self.points = set() <NEW_LINE> for l in lines: <NEW_LINE> <INDENT> if not l.a in self.points: <NEW_LINE> <INDENT> self.points.add(l.a) <NEW_LINE> <DEDENT> if not l.b in self.points: <NEW_LINE> <INDE... | A 3-dimensional shape | 62598f8f07f4c71912baf05f |
class FakeSwiftConnection2(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.tempdir = tempfile.mkdtemp() <NEW_LINE> <DEDENT> def head_container(self, container): <NEW_LINE> <INDENT> LOG.debug("fake head_container(%s)", container) <NEW_LINE> if container == 'missing_container': ... | Logging calls instead of executing. | 62598f8fe64d504609df91c0 |
class SocialContext(models.Model): <NEW_LINE> <INDENT> name = models.CharField("Social context", choices=build_choice_list(SPEECHCORPUS_SOCIALCONTEXT), max_length=5, help_text=get_help(SPEECHCORPUS_SOCIALCONTEXT), default='0') <NEW_LINE> resource = models.ForeignKey("Resource", blank=False, null=False, default=-1 , on_... | Social context | 62598f8f0a50d4780f704fea |
class AsynchronousAsciiClient(Runner, unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(Runner, self).setUp() <NEW_LINE> self.client = ModbusClient(method='ascii') <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.client.close() <NEW_LINE> self.shutdown() | These are the integration tests for the asynchronous
serial ascii client. | 62598f8f3539df3088ecbed5 |
class Handler(object): <NEW_LINE> <INDENT> def __init__(self, callback): <NEW_LINE> <INDENT> self.callback = callback <NEW_LINE> <DEDENT> def check_event(self, event): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def handle_event(self, event): <NEW_LINE> <INDENT> raise NotImplementedError | The base class for all event handlers. You can create your own handlers by inheriting from
this class.
Attributes:
callback (:obj:`callable`): The callback function for this handler.
Args:
callback (:obj:`callable`): A function that takes ``event, **kwargs`` as arguments.
It will be called when the :a... | 62598f8fa219f33f346c6431 |
class DivisionTimes(object): <NEW_LINE> <INDENT> def __init__(self,**kwargs): <NEW_LINE> <INDENT> self.min_divtime = kwargs.get("mindivtime",0) <NEW_LINE> self.avg_divtime = kwargs.get("avgdivtime",1.) <NEW_LINE> self.var_divtime = kwargs.get("vardivtime",.04) <NEW_LINE> self.stddev_divtime = np.sq... | Object to provide basic functionality
Provides access to 'DrawDivisionTimes' and the internal variables 'mean' and 'variance'
In this simplest implementation does not rely on inheritance of information, division times are normally distributed | 62598f8f24f1403a926856bb |
class TestScriptSetupActionAssert(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_name = "TestScriptSetupActionAssert" <NEW_LINE> def __init__(self, jsondict=None): <NEW_LINE> <INDENT> self.compareToSourceId = None <NEW_LINE> self.compareToSourcePath = None <NEW_LINE> self.contentType = None <NEW_LINE> s... | The assertion to perform.
Evaluates the results of previous operations to determine if the server
under test behaves appropriately. | 62598f8fbde94217f3707473 |
class KeyUsageExt(BaseModel): <NEW_LINE> <INDENT> def __init__(self, asn1_keyUsage): <NEW_LINE> <INDENT> self.digitalSignature = False <NEW_LINE> self.nonRepudiation = False <NEW_LINE> self.keyEncipherment = False <NEW_LINE> self.dataEncipherment = False <NEW_LINE> self.keyAgreement = False <NEW_LINE> self.keyCertSign ... | Key usage extension. | 62598f8fbaa26c4b54d4eece |
class OrthogonalPolynomial(Function): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def _eval_at_order(cls, n, x): <NEW_LINE> <INDENT> if n.is_integer and n >= 0: <NEW_LINE> <INDENT> return cls._ortho_poly(int(n), _x).subs(_x, x) <NEW_LINE> <DEDENT> <DEDENT> def _eval_conjugate(self): <NEW_LINE> <INDENT> return self.func... | Base class for orthogonal polynomials.
| 62598f8f8c0ade5d55dc3498 |
class Color: <NEW_LINE> <INDENT> if sys.platform != 'win32': <NEW_LINE> <INDENT> RED = '\33[91m' <NEW_LINE> GREEN = '\33[92m' <NEW_LINE> END = '\33[0m' <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> RED, GREEN, END = '', '', '' | Set the font color. This functionality relies on ANSI espace sequences
and is currently disabled for Windows | 62598f8fd7e4931a7ef3bcb8 |
class XRayRoom(object): <NEW_LINE> <INDENT> def __init__(self, id): <NEW_LINE> <INDENT> super(XRayRoom, self).__init__() <NEW_LINE> self.id = id <NEW_LINE> self.xray = XRay(1) <NEW_LINE> self.patients = [] <NEW_LINE> create_entities('sala_radiografia', self.id ) <NEW_LINE> <DEDENT> def assign_patient(self, patient): <N... | docstring for XRayRoom. | 62598f8fb7558d5895463244 |
class SshDestinationError(DestinationError): <NEW_LINE> <INDENT> pass | SSH destination errors | 62598f8ffbf16365ca793cc9 |
class Node: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.id = None <NEW_LINE> self.seen = False <NEW_LINE> self.use_id = True <NEW_LINE> <DEDENT> def emit(self): <NEW_LINE> <INDENT> if self.use_id and self.seen and self.id is not None: <NEW_LINE> <INDENT> return {'_ref': self.id} <NEW_LINE> <DEDENT>... | Intermediate representation of a packed value. Subclasses represent a particular value
type, and implement emit_verbose (returns a dict representation of a value that can have
an _id attached) and emit_compact (returns a compact representation of the value, in any
JSON-serialisable type).
If this node is assigned an i... | 62598f8f45492302aabfc0ef |
class EffectiveVirtualNetworksListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[EffectiveVirtualNetwork]'}, 'skip_token': {'key': 'skipToken', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(EffectiveVirtualNetworksL... | Result of the request to list Effective Virtual Network. It contains a list of groups and a URL link to get the next set of results.
:param value: Gets a page of EffectiveVirtualNetwork.
:type value: list[~azure.mgmt.network.v2021_02_01_preview.models.EffectiveVirtualNetwork]
:param skip_token: When present, the value... | 62598f8f82261d6c5272fce2 |
class AudioController(object): <NEW_LINE> <INDENT> def __init__(self, bot, guild, volume): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> self._volume = volume <NEW_LINE> self.playlist = Playlist() <NEW_LINE> self.guild = guild <NEW_LINE> self.voice_client = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def volume(self)... | Controls the playback of audio and the sequential playing of the songs.
Attributes:
bot: The instance of the bot that will be playing the music.
_volume: the volume of the music being played.
playlist: A Playlist object that stores the history and queue of songs.
current_songinfo: A Songinfo object tha... | 62598f8f0fa83653e46f4b00 |
class Census(DataTable): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def read(file_path): <NEW_LINE> <INDENT> data = pandas.read_csv(file_path, encoding='ISO-8859-1', header=1) <NEW_LINE> if 'Geography.2' in data: <NEW_LINE> <INDENT> def parse_city_and_state(row): <NEW_LINE> <INDENT> city, state = row['Geography.2'].l... | Table of Census data. | 62598f8fd486a94d0ba2bbea |
class CmdVent(Commande): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Commande.__init__(self, "vent", "wind") <NEW_LINE> self.groupe = "administrateur" <NEW_LINE> self.aide_courte = "manipulation des vents" <NEW_LINE> self.aide_longue = "Cette commande permet de manipuler les vents, connaître ... | Commande 'vent'.
| 62598f8fa79ad16197769c80 |
class SecurityDevice(models.Model): <NEW_LINE> <INDENT> asset = models.OneToOneField('Asset', on_delete=models.SET_NULL, null=True) <NEW_LINE> sub_assset_type_choices = ( (0, '防火墙'), (1, '入侵检测设备'), (2, '互联网网关'), (4, '运维审计系统'), ) <NEW_LINE> sub_asset_type = models.SmallIntegerField(choices=sub_assset_type_choices, verbo... | 安全设备 | 62598f8f07f4c71912baf061 |
class Boiler(fs.Node): <NEW_LINE> <INDENT> def __init__(self, fuel=None, taxation=None, Fmax=None, eta=None, investment_cost = None, running_cost=0, max_capacity=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> with fs.namespace(self): <NEW_LINE> <INDENT> F = fs.VariableCollection(lb=0, ub=Fma... | docstring for Boiler | 62598f8fe64d504609df91c1 |
class TestInlineResponse20024Participants(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testInlineResponse20024Participants(self): <NEW_LINE> <INDENT> pass | InlineResponse20024Participants unit test stubs | 62598f8fdd821e528d6d8b4c |
class UserGroupResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'group': 'UserGroup' } <NEW_LINE> attribute_map = { 'group': 'group' } <NEW_LINE> def __init__(self, group=None): <NEW_LINE> <INDENT> self._group = None <NEW_LINE> self.discriminator = None <NEW_LINE> if group is not None: <NEW_LINE> <INDENT> self.g... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f8f7cff6e4e811b5631 |
class PrivateUserApiTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = create_user( email = 'test@gmail.com', password = 'test1234', name = 'name', ) <NEW_LINE> self.client = APIClient() <NEW_LINE> self.client.force_authenticate(user=self.user) <NEW_LINE> <DEDENT> def test_retrieve_pro... | test api userthat require authentication. | 62598f8f29b78933be269ee9 |
class AfishaParser: <NEW_LINE> <INDENT> AFISHA_API = 'http://img.afisha.net/export-vk/' <NEW_LINE> def __init__(self, path): <NEW_LINE> <INDENT> if os.path.isfile(path): <NEW_LINE> <INDENT> f = open(path, 'r') <NEW_LINE> data = f.read() <NEW_LINE> f.close() <NEW_LINE> self.data = data <NEW_LINE> <DEDENT> else: <NEW_LIN... | Usage:
parser = AfishaParser('pathTo.Xml')
data = parser.parse() | 62598f8f5f7d997b871f91e7 |
class ComboBox(wx.ComboBox): <NEW_LINE> <INDENT> def __init__(self, var_name, item_list, label='', dtype=str): <NEW_LINE> <INDENT> self.var_name = var_name <NEW_LINE> self.item_list = item_list <NEW_LINE> self.label = label <NEW_LINE> self.name = ('combo_'+self.label).replace(' ', '_') <NEW_LINE> self.label_name = ('la... | Extension of the ComboBox Widget.
Bind to 'var' and update every time new option selected. | 62598f8f004d5f362081ee08 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.