code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Modem(object): <NEW_LINE> <INDENT> __LOCK_PWR = "PWR" <NEW_LINE> __LOCK_TIMEOUT = 60.0 <NEW_LINE> @classmethod <NEW_LINE> def __lock_name(cls, func): <NEW_LINE> <INDENT> return "%s-%s" % (cls.__name__, func) <NEW_LINE> <DEDENT> def __init__(self): <NEW_LINE> <INDENT> self.__module = GE910() <NEW_LINE> s... | Modem with Telit GE910 and NXP PCA8574 remote 8-bit I/O expander | 62598fa83d592f4c4edbae01 |
class RunStop(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.init_successful = True <NEW_LINE> try: <NEW_LINE> <INDENT> rospy.wait_for_service('pr2_etherCAT/halt_motors', 5) <NEW_LINE> self.halt_motors_client=rospy.ServiceProxy('pr2_etherCAT/halt_motors',Empty) <NEW_LINE> rospy.loginfo("Found... | Provide utility functions for starting/stopping PR2. | 62598fa8435de62698e9bd29 |
class CanvasGridStyle(HasTraits): <NEW_LINE> <INDENT> x_interval = Int(16) <NEW_LINE> y_interval = Int(16) <NEW_LINE> antialias = Bool(False) <NEW_LINE> line_dash = List([3,2]) <NEW_LINE> line_color = RGBAColor((.73, .83, .86)) <NEW_LINE> line_width = Int(1) <NEW_LINE> visible = Bool(True) | Grid line style settings.
Note: I've made the default y_interval 1 pixel larger to deal with
the aspect ration of the screen pixels. This is almost surely
screen dependent, and we should probably deal with this in a
more intelligent way. | 62598fa876e4537e8c3ef4e1 |
class CompilerProxy(Proxy, SQLCompiler): <NEW_LINE> <INDENT> def as_sql(self, *args, **kwargs): <NEW_LINE> <INDENT> sql, params = self._target.as_sql(*args, **kwargs) <NEW_LINE> if not sql: <NEW_LINE> <INDENT> return sql, params <NEW_LINE> <DEDENT> qn = self.quote_name_unless_alias <NEW_LINE> qn2 = self.connection.ops.... | A proxy to a compiler. | 62598fa82ae34c7f260ab015 |
class Layer(object): <NEW_LINE> <INDENT> property_definitions = None <NEW_LINE> properties = None <NEW_LINE> @classmethod <NEW_LINE> def create_properties(cls, layer_model, property_class): <NEW_LINE> <INDENT> properties = collections.OrderedDict() <NEW_LINE> for k, v in cls.property_definitions.iteritems(): <NEW_LINE>... | A layer contains a dictionary with definitions of all available properties.
If a property is missing in one layer it must be added to the data
structure containing its default value. | 62598fa80c0af96317c562b6 |
class BayesianTargetEncodingTransformer(TargetEncodingTransformer): <NEW_LINE> <INDENT> def __init__(self, target, n_splits, cvfold, len_train, l=100, param_dict=None): <NEW_LINE> <INDENT> super().__init__(target, n_splits, cvfold, len_train, param_dict) <NEW_LINE> self.l = l <NEW_LINE> self.agg = ['bayesian_encoding']... | Example
-------
param_dict = [
{
'key': ['ip','hour'],
}
] | 62598fa8925a0f43d25e7f72 |
class EntropyJudger: <NEW_LINE> <INDENT> def __init__(self, document, least_cnt_threshold=5, solid_rate_threshold=0.018, entropy_threshold=1.92): <NEW_LINE> <INDENT> self._least_cnt_threshold = least_cnt_threshold <NEW_LINE> self._solid_rate_threshold = solid_rate_threshold <NEW_LINE> self._entropy_threshold = entropy_... | Use entropy and solid rate to judge whether a candidate is a chinese word or not. | 62598fa867a9b606de545eff |
class OuputUnits(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.unitsScaleLoads=1.0 <NEW_LINE> self.unitsLoads='units:[m,kN]' <NEW_LINE> self.vectorScaleLoads=1.0 <NEW_LINE> self.vectorScalePointLoads=1.0 <NEW_LINE> self.unitsScaleDispl=1.0 <NEW_LINE> self.unitsDispl='[m]' <NEW_LINE> self.sca... | Unit for the generation of graphic files report files.
:ivar unitsScaleLoads: factor to apply to loads if we want to change
the units (defaults to 1).
:ivar unitsLoads: text to especify the units in which loads are
represented (defaults to 'units:[m,kN]')
:ivar vectorScaleLoads: fact... | 62598fa8f548e778e596b4d8 |
class BGPProfile(Element): <NEW_LINE> <INDENT> typeof = 'bgp_profile' <NEW_LINE> @classmethod <NEW_LINE> def create(cls, name, port=179, external_distance=20, internal_distance=200, local_distance=200, subnet_distance=None): <NEW_LINE> <INDENT> json = {'name': name, 'external': external_distance, 'internal': internal_d... | A BGP Profile specifies settings specific to an engine level BGP
configuration. A profile specifies engine specific settings such
as distance, redistribution, and aggregation and port.
These settings are always in effect:
* BGP version 4/4+
* No autosummary
* No synchronization
* Graceful restart
Example of creating... | 62598fa83539df3088ecc1e8 |
class ZeroEstimator(BaseEstimator): <NEW_LINE> <INDENT> def fit(self, X, y, sample_weight=None): <NEW_LINE> <INDENT> if np.issubdtype(y.dtype, int): <NEW_LINE> <INDENT> self.n_classes = np.unique(y).shape[0] <NEW_LINE> if self.n_classes == 2: <NEW_LINE> <INDENT> self.n_classes = 1 <NEW_LINE> <DEDENT> <DEDENT> else: <NE... | An estimator that simply predicts zero. | 62598fa8dd821e528d6d8e69 |
@dataclass(frozen=True) <NEW_LINE> class BackendUpdateEnvironments: <NEW_LINE> <INDENT> available_environments: Dict[str, List[str]] | Update the information about the environments on the client, from the informations retrieved from the agents | 62598fa863d6d428bbee26e5 |
class SavedObject(SONManipulator): <NEW_LINE> <INDENT> def will_copy(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def _transform_value(self, value): <NEW_LINE> <INDENT> if isinstance(value, list): <NEW_LINE> <INDENT> return map(self._transform_value, value) <NEW_LINE> <DEDENT> if isinstance(value, dict): ... | Сonverts saved documents into class instance, the class name with path of
class module keep in document :_class: parameter e.g.::
{'name': 'John', 'age': 18, '_class': 'my_project.account.User'} -
will convert into class User
Embedded documents will convert, if they have :_class: parameter
TODO: this only wor... | 62598fa82c8b7c6e89bd36f9 |
class HelperViewTest(unittest.TestCase): <NEW_LINE> <INDENT> layer = INTEGRATION_TESTING <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.portal = self.layer['portal'] <NEW_LINE> self.request = self.portal.REQUEST <NEW_LINE> pp = api.portal.get_tool('portal_properties') <NEW_LINE> self.barra_helper = api.content.ge... | Caso de teste da Browser View BarraHelper | 62598fa86aa9bd52df0d4dfd |
class TestRunner: <NEW_LINE> <INDENT> def __init__(self, executable: str, args: Sequence[str], tests: Iterable[Test]): <NEW_LINE> <INDENT> self._executable: str = executable <NEW_LINE> self._args: Sequence[str] = args <NEW_LINE> self._tests: List[Test] = list(tests) <NEW_LINE> <DEDENT> async def run_tests(self) -> None... | Runs unit tests by calling out to a runner script. | 62598fa81f5feb6acb162b55 |
class InputParameterVerificationError(Exception): <NEW_LINE> <INDENT> pass | Самописный Exception. | 62598fa88c0ade5d55dc362b |
class AclOption(models.Model): <NEW_LINE> <INDENT> id = models.PositiveIntegerField(primary_key=True, db_column="auth_option_id", help_text="primary key" ) <NEW_LINE> auth_option = models.CharField(max_length=50, unique=True, help_text="the name of the permission, e.g. 'f_post'" ) <NEW_LINE> is_global = models.Positive... | List of possible permissions | 62598fa81b99ca400228f4ca |
class ValidateScreenerRule(Rule): <NEW_LINE> <INDENT> consequence = RemoveMatch <NEW_LINE> priority = 64 <NEW_LINE> def when(self, matches, context): <NEW_LINE> <INDENT> ret = [] <NEW_LINE> for screener in matches.named('other', lambda match: 'other.validate.screener' in match.tags): <NEW_LINE> <INDENT> format_match = ... | Validate tag other.validate.screener | 62598fa8e5267d203ee6b840 |
class Attention(tf.layers.Layer): <NEW_LINE> <INDENT> def __init__(self, hidden_size, num_heads, attention_dropout, train): <NEW_LINE> <INDENT> if hidden_size % num_heads != 0: <NEW_LINE> <INDENT> raise ValueError("Hidden size must be evenly divisible by the number of " "heads.") <NEW_LINE> <DEDENT> super(Attention, se... | Multi-headed attention layer. | 62598fa8090684286d593676 |
class BeamSearchDecoderOutput( collections.namedtuple( "BeamSearchDecoderOutput", ("scores", "predicted_ids", "parent_ids") ) ): <NEW_LINE> <INDENT> pass | Outputs of a `BeamSearchDecoder` step.
Contains:
- `scores`: The scores for this step, which are the log probabilities
over the output vocabulary, possibly penalized by length and attention
coverage.
A `float32` `Tensor` of shape `[batch_size, beam_width, vocab_size]`.
- `predicted_ids`: The token IDs... | 62598fa8a219f33f346c674c |
class TestFlickrRipper(TestCase): <NEW_LINE> <INDENT> net = True <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> if os.environ.get('PYWIKIBOT2_TEST_GUI', '0') != '1': <NEW_LINE> <INDENT> raise unittest.SkipTest('FlickrRipper tests are disabled on Travis-CI') <NEW_LINE> <DEDENT> super(TestFli... | Test Tkdialog. | 62598fa8ac7a0e7691f72440 |
class ApiRDFValueReflectionRenderer(api_call_renderers.ApiCallRenderer): <NEW_LINE> <INDENT> args_type = ApiRDFValueReflectionRendererArgs <NEW_LINE> def RenderRDFStruct(self, cls): <NEW_LINE> <INDENT> fields = [] <NEW_LINE> for field_desc in cls.type_infos: <NEW_LINE> <INDENT> repeated = isinstance(field_desc, type_in... | Renders descriptor of a given RDFValue type. | 62598fa8d58c6744b42dc270 |
class RouteDependency(object): <NEW_LINE> <INDENT> def __init__(self, model_class, primary_key_elements): <NEW_LINE> <INDENT> self.model_class = model_class <NEW_LINE> self.primary_key_elements = primary_key_elements <NEW_LINE> <DEDENT> def __call__(self, context, request): <NEW_LINE> <INDENT> return (self.model_class,... | Model dependency based on matched route segments.
Use to specify the relationships between the matched route segment elements
and the column names of the model primary keys.
For example, for a view where the route pattern `r'/users/{user_id}'`,
and the `user_id` element is related to the `id` column of the `User`
mod... | 62598fa8a8370b77170f0310 |
class AutoCompleteSelectWidget(forms.widgets.TextInput): <NEW_LINE> <INDENT> add_link = None <NEW_LINE> def __init__(self, channel, help_text = u'', show_help_text = True, plugin_options = {}, *args, **kwargs): <NEW_LINE> <INDENT> self.plugin_options = plugin_options <NEW_LINE> super(forms.widgets.TextInput, self).__in... | widget to select a model and return it as text | 62598fa8d486a94d0ba2bf03 |
class get_last_period_usage(Command): <NEW_LINE> <INDENT> ARGS = [ Hex('MeterMacId'), ] | Send the GET_LAST_PERIOD_USAGE command to get the previous period
accumulation data from the RAVEn(TM). | 62598fa830dc7b766599f783 |
class CleanData(Attack): <NEW_LINE> <INDENT> name = 'clean' <NEW_LINE> def __call__(self, model_fn, images_batch_nhwc, y_np): <NEW_LINE> <INDENT> del y_np, model_fn <NEW_LINE> return images_batch_nhwc | Also known as the "null attack". Just returns the unaltered clean image | 62598fa88e7ae83300ee8fd8 |
class TestEnvironmentCatalog(_messages.Message): <NEW_LINE> <INDENT> androidDeviceCatalog = _messages.MessageField('AndroidDeviceCatalog', 1) <NEW_LINE> iosDeviceCatalog = _messages.MessageField('IosDeviceCatalog', 2) <NEW_LINE> networkConfigurationCatalog = _messages.MessageField('NetworkConfigurationCatalog', 3) | A description of a test environment.
Fields:
androidDeviceCatalog: Android devices suitable for running Android
Instrumentation Tests.
iosDeviceCatalog: Supported iOS devices
networkConfigurationCatalog: Supported network configurations | 62598fa867a9b606de545f01 |
class ROSTopicCondition(Condition): <NEW_LINE> <INDENT> def __init__(self, state_name, topic, topic_class, field=None, msgeval=None): <NEW_LINE> <INDENT> Condition.__init__(self, state_name) <NEW_LINE> self._topic = topic <NEW_LINE> self._field = field <NEW_LINE> self._subscriber = rospy.Subscriber(topic, topic_class, ... | Mirrors a ROS message field of a topic as its value.
Note that this Condition's value remains None until a message is received. | 62598fa84e4d56256637235b |
class PolyLines(ShapeObject): <NEW_LINE> <INDENT> def __init__(self, points, **attr): <NEW_LINE> <INDENT> self.points = points <NEW_LINE> ShapeObject.__init__(self, attr) <NEW_LINE> <DEDENT> def show(self, window): <NEW_LINE> <INDENT> self.object = visual.curve(pos = map(tuple, self.points), color = window.foreground) | Multiple connected lines | 62598fa8d268445f26639b1e |
class WorkoutLogForm(ModelForm): <NEW_LINE> <INDENT> repetition_unit = ModelChoiceField(queryset=RepetitionUnit.objects.all(), label=_('Unit'), required=False) <NEW_LINE> weight_unit = ModelChoiceField(queryset=WeightUnit.objects.all(), label=_('Unit'), required=False) <NEW_LINE> exercise = ModelChoiceField(queryset=Ex... | Helper form for a WorkoutLog.
These fields are re-defined here only to make them optional | 62598fa8656771135c4895b7 |
class FilterWheelDeviceWrapper(DeviceWrapper): <NEW_LINE> <INDENT> def __init__(self, name="arcticfilterwheel", port=0 ): <NEW_LINE> <INDENT> controllerWrapper = ArcticFWActorWrapper( name="arcticFWActorWrapper", ) <NEW_LINE> DeviceWrapper.__init__(self, name=name, stateCallback=None, controllerWrapper=controllerWrappe... | !A wrapper for an FilterWheelDevice talking to a fake filter wheel controller
| 62598fa8bd1bec0571e1505e |
class NVB_OT_amt_event_new(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = 'kb.amt_event_new' <NEW_LINE> bl_label = 'Create new animation event' <NEW_LINE> bl_options = {'UNDO'} <NEW_LINE> @classmethod <NEW_LINE> def poll(self, context): <NEW_LINE> <INDENT> return context.object and context.object.type == 'ARMATUR... | Add a new event to the event list | 62598fa8a17c0f6771d5c16b |
class TestAdditionalServiceDefinitionRequest(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> ret... | AdditionalServiceDefinitionRequest unit test stubs | 62598fa82c8b7c6e89bd36fb |
class InvalidFetcherClassName(InvalidFetcherError): <NEW_LINE> <INDENT> pass | Indicates the given fetcher class name cannot be imported. | 62598fa87d847024c075c2fa |
class EllipticCurve: <NEW_LINE> <INDENT> def __init__(self, p, a, b, g, n): <NEW_LINE> <INDENT> self.p = p <NEW_LINE> self.a = a <NEW_LINE> self.b = b <NEW_LINE> self.g = g <NEW_LINE> self.n = n <NEW_LINE> assert pow(2, p - 1, p) == 1 <NEW_LINE> assert (4 * a * a * a + 27 * b * b) % p != 0 <NEW_LINE> assert self.lying_... | An elliptic curve over a prime field.
The field is specified by the parameter 'p'.
The curve coefficients are 'a' and 'b'.
The base point of the cyclic subgroup is 'g'.
The order of the subgroup is 'n'. | 62598fa891af0d3eaad39d45 |
class proxytype_(object): <NEW_LINE> <INDENT> def __init__(self,ob): <NEW_LINE> <INDENT> self.ob_ = ob <NEW_LINE> <DEDENT> def __getattr__(self,attr): <NEW_LINE> <INDENT> return self.__dict__.get(attr,self.__dict__['ob_'].__getattr__(attr)) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return self.__dict_... | each tuple member is encapsulated within a proxytype_,
having all the attribute requests (except for few) proxied through | 62598fa8167d2b6e312b6ea7 |
class BaseEntity(object): <NEW_LINE> <INDENT> def __init__(self, node): <NEW_LINE> <INDENT> self.node = node <NEW_LINE> <DEDENT> @property <NEW_LINE> def version_number(self): <NEW_LINE> <INDENT> return self.node.version_number <NEW_LINE> <DEDENT> @property <NEW_LINE> def config(self): <NEW_LINE> <INDENT> return self.n... | Base class for all resources to derive from
This BaseEntity class should not be directly instatiated. It is
designed to be implemented by all resource classes to provide common
methods.
Attributes:
node (Node): The node instance this resource will perform operations
against for configuration
config (... | 62598fa863b5f9789fe8509b |
class JSON(object): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self.value == json.loads(other) <NEW_LINE> <DEDENT> except ValueError: <NEW_LINE> <INDENT> return False <NEW_LINE> <D... | Helper object that is equal to any JSON string representing a specific value. | 62598fa867a9b606de545f02 |
class svn_error_t: <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, svn_error_t, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, svn_error_t, name) <NEW_LINE> __repr__ = _swig_repr <NEW_LI... | Proxy of C svn_error_t struct | 62598fa856b00c62f0fb27ea |
class AccountDeleteViewTest(LoginTestMixin, TestCase): <NEW_LINE> <INDENT> user_permissions = ( APP_NAME + '.view_account', APP_NAME + '.delete_account', ) <NEW_LINE> def test_get(self): <NEW_LINE> <INDENT> account = Account.objects.create( user_id='test_user', expires=now(), token='12345', site_id=0, ) <NEW_LINE> self... | Tests for the ``AccountDeleteView`` view | 62598fa80c0af96317c562b9 |
class SMSIntegration(BaseIntegration): <NEW_LINE> <INDENT> def test_connection(self, data): <NEW_LINE> <INDENT> errors = {} <NEW_LINE> fields = ["from_phone", "to_phone", "twilio_account_sid", "twilio_auth_token"] <NEW_LINE> for field in fields: <NEW_LINE> <INDENT> if not data.get(field): <NEW_LINE> <INDENT> errors[fie... | An integration to send SMS messages to a defined phone number on Honeycomb alerts. | 62598fa8cc0a2c111447af47 |
class WBSDefinition(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swaggerTypes = { 'CodePrefix': 'str', 'GenerateWBSCode': 'bool', 'VerifyUniqueness': 'bool', 'CodeMaskCollection': 'list[WBSCodeMask]' } <NEW_LINE> self.attributeMap = { 'CodePrefix': 'CodePrefix','GenerateWBSCode': 'GenerateW... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598fa85166f23b2e24330f |
class MovieGenreView(APIView): <NEW_LINE> <INDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> moviegenre = MovieGenre.objects.select_related().get(slug=kwargs['moviegenre_slug']) <NEW_LINE> serializer = MovieGenreSerializer(moviegenre) <NEW_LINE> return Response(serializer.dat... | Movie genre api-view | 62598fa8d486a94d0ba2bf05 |
class TimeoutError(RuntimeError): <NEW_LINE> <INDENT> pass | Timeout error of command execution. | 62598fa844b2445a339b690b |
class IndexPage(PageObject): <NEW_LINE> <INDENT> url = 'http://localhost:{}/index.html'.format(PORT) <NEW_LINE> def is_browser_on_page(self): <NEW_LINE> <INDENT> return self.browser.title == 'PyTube.org' <NEW_LINE> <DEDENT> def search(self, phrase): <NEW_LINE> <INDENT> selector = 'input.gsc-input' <NEW_LINE> self.wait_... | Testing representation of the main page of the site | 62598fa876e4537e8c3ef4e5 |
class TinyMCEWidget(forms.Textarea): <NEW_LINE> <INDENT> class Media: <NEW_LINE> <INDENT> extend = False <NEW_LINE> js = ('//tinymce.cachefly.net/4.0/tinymce.min.js',) <NEW_LINE> <DEDENT> def __init__(self, attrs=None): <NEW_LINE> <INDENT> final_attrs = { 'class': 'tinymce', 'style': 'display: inline-block;' } <NEW_LIN... | TinyMCE HTML editor widget | 62598fa8e5267d203ee6b843 |
class PublicUserApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> <DEDENT> def test_create_valid_user_success(self): <NEW_LINE> <INDENT> payload = { 'email': 'test@q.com', 'password': 'testpass', 'name': 'Test name' } <NEW_LINE> res = self.client.post(CREA... | Test the users API (public) | 62598fa8bd1bec0571e1505f |
class RedisConfigForm(BaseForm): <NEW_LINE> <INDENT> name = fields.StringField(validators=[validators.DataRequired(message='请填写容器名称')]) <NEW_LINE> def validate_name(self, field): <NEW_LINE> <INDENT> name = field.data <NEW_LINE> resource = self.resource.data <NEW_LINE> if not resource.get_container(name=name): <NEW_LINE... | redis config的form校验类 | 62598fa88a43f66fc4bf20b4 |
class AndSpec(Specification): <NEW_LINE> <INDENT> def __init__(self, *specs: Specification) -> None: <NEW_LINE> <INDENT> self.specs = specs <NEW_LINE> <DEDENT> def is_satisfied(self, item: Product) -> bool: <NEW_LINE> <INDENT> return all(spec.is_satisfied(item) for spec in self.specs) | Combinator specification - combines multiple specifications into one. | 62598fa84e4d56256637235d |
class NSOperationSyntheticProvider(NSObject.NSObjectSyntheticProvider): <NEW_LINE> <INDENT> def __init__(self, value_obj, internal_dict): <NEW_LINE> <INDENT> super(NSOperationSyntheticProvider, self).__init__(value_obj, internal_dict) <NEW_LINE> self.type_name = "NSOperation" <NEW_LINE> self.register_child_value("priva... | Class representing NSOperation. | 62598fa8435de62698e9bd2e |
class ContentHandlerException(TableauPyException): <NEW_LINE> <INDENT> _message_template = 'An error occurred with ContentHandler' | raised when an exception is thrown by a ContentHandlers | 62598fa87d43ff248742739e |
class NoNetworkError(GeneWikiError): <NEW_LINE> <INDENT> def __init__(self,message = None): <NEW_LINE> <INDENT> super(GeneWikiError,self).__init__(message) | Exception for GeneWiki errors specifically related to network. | 62598fa892d797404e388b01 |
class end_process_keyword(parser.keyword): <NEW_LINE> <INDENT> def __init__(self, sString): <NEW_LINE> <INDENT> parser.keyword.__init__(self, sString) | unique_id = process_statement : end_process_keyword | 62598fa856b00c62f0fb27ec |
class ContainerH5TableDataset(ContainerResolverMixin, AbstractH5TableDataset): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_inverse_class(cls): <NEW_LINE> <INDENT> return BuilderH5TableDataset | A reference-resolving dataset for resolving references inside tables
(i.e. compound dtypes) that returns resolved references as Containers | 62598fa8cb5e8a47e493c114 |
class TypeValue(object): <NEW_LINE> <INDENT> pass | A Stub-Object to parse the received data
| 62598fa832920d7e50bc5f8e |
class Rectangle: <NEW_LINE> <INDENT> number_of_instances = 0 <NEW_LINE> print_symbol = "#" <NEW_LINE> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.width = width <NEW_LINE> self.height = height <NEW_LINE> type(self).number_of_instances += 1 <NEW_LINE> <DEDENT> @property <NEW_LINE> def width(self): <NE... | Represent an empty rectangle.
Attributes:
number_of _instances (int): number of rectangles created.
print_symbol (any): symbol used as rectangle represetnation. | 62598fa823849d37ff850fed |
class ROSBagException(Exception): <NEW_LINE> <INDENT> def __init__(self, value=None): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> self.args = (value,) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.value | Base class for exceptions in rosbag. | 62598fa83539df3088ecc1ed |
class TestBasicPolicyNegative(BasePolicyTest): <NEW_LINE> <INDENT> _interface = 'json' <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> super(TestBasicPolicyNegative, cls).setUpClass() <NEW_LINE> <DEDENT> def runTest(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @test.attr(type=['sanity... | Negative tests | 62598fa856ac1b37e6302125 |
class EditorCalltipsQScintillaPage(ConfigurationPageBase, Ui_EditorCalltipsQScintillaPage): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(EditorCalltipsQScintillaPage, self).__init__() <NEW_LINE> self.setupUi(self) <NEW_LINE> self.setObjectName("EditorCalltipsQScintillaPage") <NEW_LINE> ctContext = ... | Class implementing the QScintilla Calltips configuration page. | 62598fa8462c4b4f79dbb946 |
class LeaveOneOut(object): <NEW_LINE> <INDENT> def __init__(self, n, indices=True): <NEW_LINE> <INDENT> self.n = n <NEW_LINE> self.indices = indices <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> n = self.n <NEW_LINE> for i in xrange(n): <NEW_LINE> <INDENT> test_index = np.zeros(n, dtype=np.bool) <NEW_LINE... | Leave-One-Out cross validation iterator.
Provides train/test indices to split data in train test sets. Each
sample is used once as a test set (singleton) while the remaining
samples form the training set.
Due to the high number of test sets (which is the same as the
number of samples) this cross validation method can... | 62598fa85166f23b2e243311 |
class InstanceNotFound(VmOrInstanceNotFound): <NEW_LINE> <INDENT> pass | Raised if a specific instance cannot be found. | 62598fa8097d151d1a2c0f62 |
class MediaUpload(object): <NEW_LINE> <INDENT> def chunksize(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def mimetype(self): <NEW_LINE> <INDENT> return 'application/octet-stream' <NEW_LINE> <DEDENT> def size(self): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def resumable(self): <... | Describes a media object to upload.
Base class that defines the interface of MediaUpload subclasses.
Note that subclasses of MediaUpload may allow you to control the chunksize
when uploading a media object. It is important to keep the size of the chunk
as large as possible to keep the upload efficient. Other factors ... | 62598fa88e7ae83300ee8fdb |
class BlancClass(object): <NEW_LINE> <INDENT> pass | blanc container class to have a collection of attributes.
For rapid shell- or prototyping. In the process of improving the code
this class might/can/will at some point be replaced with a more
tailored class.
Usage:
>>> from cma.utilities.utils import BlancClass
>>> p = BlancClass()
>>> p.value1 = 0
>>> p.value2 = 1 | 62598fa8baa26c4b54d4f1ea |
class Converter(object): <NEW_LINE> <INDENT> extract_map = {'.ape': ApeType, '.flac': FlacType, '.m4a': M4aType, '.mp3': Mp3Type, '.ogg': OggType, '.wav': WavType, '.wv': WvType} <NEW_LINE> def __init__(self, split=False, files=tuple()): <NEW_LINE> <INDENT> self.files = files <NEW_LINE> self._file_objs = [] <NEW_LINE> ... | Main class for converting files | 62598fa84e4d56256637235e |
class ServiceBox(gtk.ScrolledWindow): <NEW_LINE> <INDENT> def __init__(self, callback_func): <NEW_LINE> <INDENT> gtk.ScrolledWindow.__init__(self) <NEW_LINE> self._func = callback_func <NEW_LINE> self.vbox = gtk.VBox(spacing=5) <NEW_LINE> self.services = {} <NEW_LINE> self._set_style() <NEW_LINE> self._create_ui() <NEW... | holds ServiceItems | 62598fa87cff6e4e811b5963 |
class ProtocolError(Exception): <NEW_LINE> <INDENT> pass | A protocol error | 62598fa8e76e3b2f99fd896f |
class LinearRegression(object): <NEW_LINE> <INDENT> def __init__(self, train_labels, test_labels, item_based_ratings, collaborative_ratings, training_data_mask): <NEW_LINE> <INDENT> self.item_based_ratings = item_based_ratings <NEW_LINE> self.collaborative_ratings = collaborative_ratings <NEW_LINE> self.item_based_rati... | Linear regression to combine the results of two matrices. | 62598fa8f9cc0f698b1c5265 |
class RawStream(RawInputStream, RawOutputStream): <NEW_LINE> <INDENT> def __init__(self, samplerate=None, blocksize=None, device=None, channels=None, dtype=None, latency=None, extra_settings=None, callback=None, finished_callback=None, clip_off=None, dither_off=None, never_drop_input=None, prime_output_buffers_using_st... | Raw stream for playback and recording. See __init__(). | 62598fa844b2445a339b690c |
class LoadBalancerStatus(object): <NEW_LINE> <INDENT> def __init__(self, load_balancer_id, load_balancer_name, status): <NEW_LINE> <INDENT> self.load_balancer_id = load_balancer_id <NEW_LINE> self.status = status <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return ( '<LoadBalancerStatus %s is %s at %s>' ... | Simple status of SLB
Args:
load_balancer_id (str): LoadBalancerId unique identifier of the SLB.
load_balancer_name (str): name of the SLB.
status (str): SLB status. | 62598fa8f7d966606f747f1e |
class FeiraLivreRetrieveTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.feira_um = FeiraLivre.objects.create(nome_feira='Feira test1') <NEW_LINE> self.feira_dois = FeiraLivre.objects.create(nome_feira='Feira test2') <NEW_LINE> self.feira_tres = FeiraLivre.objects.create(nome_feira='Feira t... | Módulo de teste para o GET de uma só FeiraLivre | 62598fa8d7e4931a7ef3bfd5 |
class IVolunteerteamLocator (IArticleLocator): <NEW_LINE> <INDENT> pass | Volunteerteam table add row donor | 62598fa855399d3f0562645e |
class LoadData(ImpalaDDL): <NEW_LINE> <INDENT> def __init__( self, table_name, path, database=None, partition=None, partition_schema=None, overwrite=False, ): <NEW_LINE> <INDENT> self.table_name = table_name <NEW_LINE> self.database = database <NEW_LINE> self.path = path <NEW_LINE> self.partition = partition <NEW_LINE>... | Generate DDL for LOAD DATA command. Cannot be cancelled | 62598fa84f6381625f19945b |
class PathTool: <NEW_LINE> <INDENT> def _getProxy(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def cmdline_path(self, path): <NEW_LINE> <INDENT> raise NotImplemented() <NEW_LINE> <DEDENT> def absolutePath(self, path): <NEW_LINE> <INDENT> return self._getProxy().abspath(path) <NEW_LINE> <DE... | Abstract path class that defines an interface
| 62598fa8167d2b6e312b6eab |
class ValueConverter(object): <NEW_LINE> <INDENT> klasses = set() <NEW_LINE> def __new__(cls, klass): <NEW_LINE> <INDENT> if cls is ValueConverter: <NEW_LINE> <INDENT> converter = cls.get_converter(klass) <NEW_LINE> if converter: <NEW_LINE> <INDENT> return converter <NEW_LINE> <DEDENT> <DEDENT> return super(ValueConver... | Handle conversions between C# values and Python values for a particular C# class.
Attributes:
klasses (set): The C# class we're converting from. Not a RuntimeType, but an actual class. | 62598fa891af0d3eaad39d49 |
class ProcessorGroup(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, ProcessorGroup, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, ProcessorGroup, name) <NEW_LINE> def __init_... | 1 | 62598fa826068e7796d4c894 |
class Command(BaseCommand): <NEW_LINE> <INDENT> option_list = BaseCommand.option_list + ( make_option('--json', action='store_true', dest='json', default=False, help='Output the result encoded as a JSON object'), ) <NEW_LINE> help = ( "Get some statistics about the Package Tracking System\n" "- Total number of source p... | A Django management command which outputs some statistics about the PTS. | 62598fa863d6d428bbee26ec |
class Node: <NEW_LINE> <INDENT> def __init__(self, data, next=None): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.next = next <NEW_LINE> <DEDENT> def get_next(self): <NEW_LINE> <INDENT> return self.next <NEW_LINE> <DEDENT> def get_data(self): <NEW_LINE> <INDENT> return self.data <NEW_LINE> <DEDENT> def set_next... | This class represents the Node of the List.
The Node contains the data and points to next element (Node). | 62598fa830bbd72246469915 |
class ListDetailViewSet(ViewSet): <NEW_LINE> <INDENT> queryset = todo_models.List.objects.all() <NEW_LINE> def detail(self, *args, **kwargs): <NEW_LINE> <INDENT> list_obj = get_object_or_404(self.queryset, pk=kwargs['list_id']) <NEW_LINE> serializer = todo_serializers.ListSerializer(list_obj) <NEW_LINE> return Response... | Viewing details for List
| 62598fa801c39578d7f12cba |
class RestoreDatabaseMetadata(_messages.Message): <NEW_LINE> <INDENT> class SourceTypeValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> TYPE_UNSPECIFIED = 0 <NEW_LINE> BACKUP = 1 <NEW_LINE> <DEDENT> backupInfo = _messages.MessageField('BackupInfo', 1) <NEW_LINE> cancelTime = _messages.StringField(2) <NEW_LINE> name ... | A RestoreDatabaseMetadata object.
Enums:
SourceTypeValueValuesEnum: The type of the restore source.
Fields:
backupInfo: Information about the backup used to restore the database.
cancelTime: The time at which this operation was cancelled. If set, this
operation is in the process of undoing itself (which is ... | 62598fa81f037a2d8b9e4027 |
class TimedPOMDPMaze(POMDPMaze): <NEW_LINE> <INDENT> def __init__(self, maze_game, **kwargs): <NEW_LINE> <INDENT> super().__init__(maze_game, **kwargs) <NEW_LINE> self.delay = kwargs.get("delay") if kwargs.get("delay") else 5 <NEW_LINE> self.ticks = 0 <NEW_LINE> <DEDENT> def on_start(self): <NEW_LINE> <INDENT> self.tic... | The TimedPOMDPMaze. Adds FOW after a delay (ticks)
:param maze_game: MazeGame instance
:param kwargs: dict of custom arguments | 62598fa83617ad0b5ee0608f |
class PlayerProgram(ctypes.Structure): <NEW_LINE> <INDENT> pass | Add a slave to the current media player.
ote if the player is playing, the slave will be added directly. this call
will also update the slave list of the attached libvlc_media_t.
ersion libvlc 3.0.0 and later.
See libvlc_media_slaves_add
\param p_mi the media player
\param i_type subtitle or audio
\param psz_uri uri ... | 62598fa8379a373c97d98f4d |
class __Node: <NEW_LINE> <INDENT> def __init__(self, e, prevNode, nextNode): <NEW_LINE> <INDENT> self.__element = e <NEW_LINE> self.__nextNode = nextNode <NEW_LINE> self.__prevNode = prevNode <NEW_LINE> <DEDENT> def nextNode(self, node): <NEW_LINE> <INDENT> if node is None: <NEW_LINE> <INDENT> return self.__nextNode <N... | Class represent a node in the LL | 62598fa8e76e3b2f99fd8971 |
class Compound(models.Model): <NEW_LINE> <INDENT> front = models.CharField(max_length=50, unique=True) <NEW_LINE> reading = models.CharField(max_length=500, null=True, blank=True) <NEW_LINE> gloss = models.CharField(max_length=5000, null=True, blank=True) <NEW_LINE> pos = models.CharField(max_length=500, null=True, bla... | Kanji compound, usually word or expression, may include kana | 62598fa88da39b475be0311f |
class NoEnvLoad(Package): <NEW_LINE> <INDENT> def __init__(self, package: Package): <NEW_LINE> <INDENT> self.package = package <NEW_LINE> <DEDENT> def install_env(self, ctx: Namespace): <NEW_LINE> <INDENT> ctx.log.debug('cancel installation of %s in env' % self.ident()) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW... | Wrapper class for packages that avoids them being loaded into PATH and
LD_LIBRARY_PATH by the default :func:`Package.install_env` method.
This is useful for packages that are used by referening direct paths,
instead of counting on their presence when calling :func:`util.run`. | 62598fa8925a0f43d25e7f7a |
class Ai(base.BaseAi): <NEW_LINE> <INDENT> def move(self, bots, events): <NEW_LINE> <INDENT> response = [] <NEW_LINE> for bot in bots: <NEW_LINE> <INDENT> if not bot.alive: <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> move_pos = random.choice(list(self.get_valid_moves(bot))) <NEW_LINE> response.append(actions.Move(... | Dummy bot that moves randomly around the board. | 62598fa8851cf427c66b8204 |
class CustomQCompleter(QCompleter): <NEW_LINE> <INDENT> def __init__(self, parent=None,model=None,proxy=None,columns=None,*args): <NEW_LINE> <INDENT> self.columnind=0 <NEW_LINE> super(CustomQCompleter, self).__init__(parent,*args) <NEW_LINE> self.setCaseSensitivity(QtCore.Qt.CaseInsensitive) <NEW_LINE> self.parent=pare... | adapted from: http://stackoverflow.com/a/7767999/2156909 | 62598fa8f7d966606f747f20 |
class QuantumRegisters: <NEW_LINE> <INDENT> def __init__(self, env): <NEW_LINE> <INDENT> self.env = env <NEW_LINE> self.registerDict = {} <NEW_LINE> <DEDENT> def __getitem__(self, index): <NEW_LINE> <INDENT> value = self.registerDict.get(index) <NEW_LINE> if value is not None: <NEW_LINE> <INDENT> return value <NEW_LINE... | The quantum register dict | 62598fa8d7e4931a7ef3bfd7 |
class LoggedInUser(Singleton): <NEW_LINE> <INDENT> __metaclass__ = Singleton <NEW_LINE> request = None <NEW_LINE> user = None <NEW_LINE> address = None <NEW_LINE> def set_data(self, request): <NEW_LINE> <INDENT> self.request = id(request) <NEW_LINE> if request.user.is_authenticated: <NEW_LINE> <INDENT> self.user = requ... | Синглтон для хранения пользователя,
от имени которого выполняется запрос | 62598fa8eab8aa0e5d30bcc6 |
class StepMethodNeedsMoreThanOneArgument(HitchStoryException): <NEW_LINE> <INDENT> pass | Method in story engine takes more than one argument. | 62598fa83539df3088ecc1f0 |
class JsonPlugin(monasca_setup.detection.ArgsPlugin): <NEW_LINE> <INDENT> def __init__(self, template_dir, overwrite=True, args=None): <NEW_LINE> <INDENT> super(JsonPlugin, self).__init__( template_dir, overwrite, args) <NEW_LINE> <DEDENT> def _detect(self): <NEW_LINE> <INDENT> self.available = False <NEW_LINE> if os.p... | Detect if /var/cache/monasca_json_plugin exists
This builds a config for the json_plugin. This detects if
/var/cache/monasca_json_plugin exists and if so,
builds a configuration for it.
Users are free to add their own configs. | 62598fa84e4d562566372361 |
class Document(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.bundles = [] <NEW_LINE> self._highest_bundle_id = 0 <NEW_LINE> self.meta = {} <NEW_LINE> self.json = {} <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return iter(self.bundles) <NEW_LINE> <DEDENT> def create_bundle(sel... | Document is a container for Universal Dependency trees. | 62598fa866656f66f7d5a32c |
class IHTMLTextAreaWidget(IHTMLFormElement): <NEW_LINE> <INDENT> rows = zope.schema.Int( title=u'Rows', description=(u'This attribute specifies the number of visible text ' u'lines.'), required=False) <NEW_LINE> cols = zope.schema.Int( title=u'columns', description=(u'This attribute specifies the visible width in avera... | A widget using the HTML TEXTAREA element. | 62598fa82c8b7c6e89bd3702 |
class CountryDevices(Metric): <NEW_LINE> <INDENT> def __init__(self, name, series, buckets, status, private): <NEW_LINE> <INDENT> super().__init__(name, series, buckets, status) <NEW_LINE> self.private = private <NEW_LINE> self.users_by_country = self._calculate_metrics_countries() <NEW_LINE> self.country_data = self._... | Metrics for the devices in countries.
:var name: The name of the metric
:var series: The series dictionary from the metric
:var buckets: The buckets dictionary from the metric
:var status: The status of the metric
:var private: Boolean, True to add private information
displayed for publisher, False if not
:var users_b... | 62598fa8435de62698e9bd32 |
class XMLRPCDispatcher(SimpleXMLRPCServer.SimpleXMLRPCDispatcher): <NEW_LINE> <INDENT> def __init__(self, allow_none, encoding): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> SimpleXMLRPCServer.... | An XML-RPC dispatcher. | 62598fa867a9b606de545f08 |
@admin.register(UserSettings) <NEW_LINE> class UserSettingsAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('user',) | UserSettingsAdmin. | 62598fa85fcc89381b2660eb |
class TestHg(AdapterTestHelper): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestHg, self).setUp(Hg) <NEW_LINE> <DEDENT> def test_status(self): <NEW_LINE> <INDENT> self.adapter.status() <NEW_LINE> self.assert_executed_command("hg status") <NEW_LINE> <DEDENT> def test_update(self): <NEW_LINE> <INDENT>... | Hg adapter test suite. | 62598fa84428ac0f6e65845f |
class SamiInstrumentDriver(SingleConnectionInstrumentDriver): <NEW_LINE> <INDENT> pass | SamiInstrumentDriver baseclass
Subclasses SingleConnectionInstrumentDriver with connection state
machine.
Needs to be subclassed in the specific driver module. | 62598fa810dbd63aa1c70aef |
class People(Amity): <NEW_LINE> <INDENT> _table = "people" <NEW_LINE> validators = {"firstname":r"([a-zA-Z]+)", "lastname": r"([a-zA-Z]+)", "file":r"([a-zA-Z]+)" } <NEW_LINE> def __init__(self,oid=0): <NEW_LINE> <INDENT> super(People,self).__init__(oid,People._table) <NEW_LINE> <DEDENT> def typeIs(self,type): <NEW_LINE... | docstring for Room | 62598fa8dd821e528d6d8e72 |
@app.route("/signup") <NEW_LINE> @as_view(name="signup") <NEW_LINE> class SignUpView(MethodView): <NEW_LINE> <INDENT> def prepare(self): <NEW_LINE> <INDENT> self.form = SignUpForm() <NEW_LINE> self.user = User() <NEW_LINE> self.service = SignUpService(self.user) <NEW_LINE> <DEDENT> def get(self): <NEW_LINE> <INDENT> re... | The view to sign up. | 62598fa84527f215b58e9e1f |
class ScheduleFieldDisplayType(Enum,IComparable,IFormattable,IConvertible): <NEW_LINE> <INDENT> def __eq__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __format__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __ge__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __gt__(se... | Display type of schedule field.
enum ScheduleFieldDisplayType,values: Max (3),Min (4),MinMax (2),Standard (0),Totals (1) | 62598fa857b8e32f525080b9 |
class TestOFPEchoReply(unittest.TestCase): <NEW_LINE> <INDENT> version = ofproto.OFP_VERSION <NEW_LINE> msg_type = ofproto.OFPT_ECHO_REPLY <NEW_LINE> msg_len = ofproto.OFP_HEADER_SIZE <NEW_LINE> xid = 2495926989 <NEW_LINE> def test_init(self): <NEW_LINE> <INDENT> c = OFPEchoReply(_Datapath) <NEW_LINE> eq_(c.data, None)... | Test case for ofproto_v1_2_parser.OFPEchoReply
| 62598fa8fff4ab517ebcd722 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.