code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class BlogTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> APP = create_app(config_name="testing") <NEW_LINE> APP.testing = True <NEW_LINE> self.app = APP.test_client() <NEW_LINE> create_tables() <NEW_LINE> self.test_user = test_user <NEW_LINE> payload = { "user_name": self.test_use... | This class represents the questions test cases | 625990804428ac0f6e659fea |
class mesh(np.ndarray): <NEW_LINE> <INDENT> def __new__(cls, init, val=0.0, offset=0, buffer=None, strides=None, order=None): <NEW_LINE> <INDENT> if isinstance(init, mesh): <NEW_LINE> <INDENT> obj = np.ndarray.__new__(cls, shape=init.shape, dtype=init.dtype, buffer=buffer, offset=offset, strides=strides, order=order) <... | Numpy-based datatype for serial or parallel meshes.
Can include a communicator and expects a dtype to allow complex data.
Attributes:
_comm: MPI communicator or None | 625990807c178a314d78e948 |
class Thermal(base.ResourceBase): <NEW_LINE> <INDENT> identity = base.Field('Id') <NEW_LINE> name = base.Field('Name') <NEW_LINE> status = common.StatusField('Status') <NEW_LINE> fans = FansListField('Fans', default=[]) <NEW_LINE> temperatures = TemperaturesListField('Temperatures', default=[]) | This class represents a Thermal resource. | 6259908063b5f9789fe86c23 |
class CloudForgotPasswordView(HomeAssistantView): <NEW_LINE> <INDENT> url = "/api/cloud/forgot_password" <NEW_LINE> name = "api:cloud:forgot_password" <NEW_LINE> @_handle_cloud_errors <NEW_LINE> @RequestDataValidator(vol.Schema({vol.Required("email"): str})) <NEW_LINE> async def post(self, request, data): <NEW_LINE> <I... | View to start Forgot Password flow.. | 625990805fcc89381b266eba |
class ConfigurationManipulator(ConfigurationManipulatorBase): <NEW_LINE> <INDENT> def __init__(self, params=None, config_type=dict, seed_config=None, **kwargs): <NEW_LINE> <INDENT> if params is None: <NEW_LINE> <INDENT> params = [] <NEW_LINE> <DEDENT> self.params = list(params) <NEW_LINE> self.config_type = config_type... | a configuration manipulator using a fixed set of parameters and storing
configs in a dict-like object | 625990801f5feb6acb1646b5 |
class QueueDepthByPriority(models.Model): <NEW_LINE> <INDENT> priority = models.IntegerField() <NEW_LINE> depth_time = models.DateTimeField(db_index=True) <NEW_LINE> depth = models.IntegerField() <NEW_LINE> objects = QueueDepthByPriorityManager() <NEW_LINE> class Meta(object): <NEW_LINE> <INDENT> db_table = 'queue_dept... | Represents the queue depth counts for each priority level at various points in time
:keyword priority: The priority level
:type priority: :class:`django.db.models.IntegerField`
:keyword depth_time: When the depth was measured
:type depth_time: :class:`django.db.models.DateTimeField`
:keyword depth: The queue depth for... | 6259908092d797404e3898ba |
class NotFound(Exception): <NEW_LINE> <INDENT> pass | Throw when the Resource could not be found | 625990802c8b7c6e89bd52a1 |
class HttpRequest(object): <NEW_LINE> <INDENT> def __init__(self, http_method, query_url, headers = None, query_parameters = None, parameters = None, files = None, username = None, password = None): <NEW_LINE> <INDENT> self.http_method = http_method <NEW_LINE> self.query_url = query_url <NEW_LINE> self.headers = header... | Information about an HTTP Request including its method, headers,
parameters, URL, and Basic Auth details
Attributes:
http_method (HttpMethodEnum): The HTTP Method that this request should
perform when called.
headers (dict): A dictionary of headers (key : value) that should be
... | 62599080d486a94d0ba2da73 |
class PersonTelephone(BaseModel): <NEW_LINE> <INDENT> person_telephone_id = models.AutoField( 'person_telephone_id', primary_key=True ) <NEW_LINE> person = models.ForeignKey("Person", verbose_name='person') <NEW_LINE> telephone_number = models.CharField('telephone_number', max_length=24, null=False, blank=False) <NEW_L... | A person may be linked to zero or more telephone numbers. | 625990804527f215b58eb6fe |
class Motocicleta(Vehiculo): <NEW_LINE> <INDENT> def __init__(self, arg): <NEW_LINE> <INDENT> self.cilindradas = "" <NEW_LINE> <DEDENT> def set_cilindradas(self, cilindradas): <NEW_LINE> <INDENT> self.cilindradas = cilindradas <NEW_LINE> <DEDENT> def get_cilindradas(self): <NEW_LINE> <INDENT> return self.cilindradas | docstring for Motocicleta. | 62599080f548e778e596d04e |
class GeoPXRecord(PXRecord): <NEW_LINE> <INDENT> def __init__(self, label=None, ttl=None, *args, **kwargs): <NEW_LINE> <INDENT> kwargs['create'] = False <NEW_LINE> super(GeoPXRecord, self).__init__(*args, **kwargs) <NEW_LINE> self.label = label <NEW_LINE> self._ttl = ttl | An :class:`PXRecord` object which is able to store additional data for
use by a :class:`Geo` service. | 62599080656771135c48ad8e |
class JceTransformationError(DynamodbEncryptionSdkError): <NEW_LINE> <INDENT> pass | Otherwise undifferentiated errors encountered when attempting to read a JCE transformation. | 625990803346ee7daa3383c0 |
class FormComponentViewset(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> serializer_class = FormComponentSerializer <NEW_LINE> filterset_class = FormComponentFilter <NEW_LINE> queryset = ( FormComponent.objects .all() .order_by('area__area_num', 'component_num', 'component_letter') .select_related('area') ) | PER Form Components Viewset | 6259908071ff763f4b5e9269 |
class MAVLink_filt_rot_vel_message(MAVLink_message): <NEW_LINE> <INDENT> def __init__(self, rotVel): <NEW_LINE> <INDENT> MAVLink_message.__init__(self, MAVLINK_MSG_ID_FILT_ROT_VEL, 'FILT_ROT_VEL') <NEW_LINE> self._fieldnames = ['rotVel'] <NEW_LINE> self.rotVel = rotVel <NEW_LINE> <DEDENT> def pack(self, mav): <NEW_LINE... | filtered rotational velocity | 6259908066673b3332c31ebd |
class SetLampStrikes(TestMixins.SetUInt32Mixin, OptionalParameterTestFixture): <NEW_LINE> <INDENT> CATEGORY = TestCategory.POWER_LAMP_SETTINGS <NEW_LINE> PID = 'LAMP_STRIKES' <NEW_LINE> EXPECTED_FIELD = 'strikes' <NEW_LINE> PROVIDES = ['set_lamp_strikes_supported'] <NEW_LINE> REQUIRES = ['lamp_strikes'] <NEW_LINE> def ... | Attempt to SET the lamp strikes. | 62599080796e427e53850238 |
class RtreeContainer(Rtree): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if args: <NEW_LINE> <INDENT> if isinstance(args[0], rtree.index.string_types) or isinstance(args[0], bytes) or isinstance(args[0], rtree.index.ICustomStorage): <NEW_LINE> <INDE... | An R-Tree, MVR-Tree, or TPR-Tree indexed container for python objects | 625990805fdd1c0f98e5fa3d |
class SMB2CreateEABuffer(Structure): <NEW_LINE> <INDENT> NAME = CreateContextName.SMB2_CREATE_EA_BUFFER <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.fields = OrderedDict([ ('next_entry_offset', IntField(size=4)), ('flags', FlagField( size=1, flag_type=EAFlags )), ('ea_name_length', IntField( size=1, default=... | [MS-SMB2] 2.2.13.2.1 SMB2_CREATE_EA_BUFFER
[MS-FSCC] 2.4.15 FileFullEaInformation
Used to apply extended attributes as part of creating a new file. | 625990804f88993c371f1281 |
class MicrosoftAzureTestUrl(object): <NEW_LINE> <INDENT> def __init__( self, credentials, subscription_id, base_url=None): <NEW_LINE> <INDENT> self.config = MicrosoftAzureTestUrlConfiguration(credentials, subscription_id, base_url) <NEW_LINE> self._client = ServiceClient(self.config.credentials, self.config) <NEW_LINE>... | Some cool documentation.
:ivar config: Configuration for client.
:vartype config: MicrosoftAzureTestUrlConfiguration
:ivar group: Group operations
:vartype group: .operations.GroupOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
... | 625990803346ee7daa3383c1 |
class Smmry(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__stemmer = Stemmer() <NEW_LINE> self.__splitter = SentenceSplitter() <NEW_LINE> <DEDENT> def __create_counter(self, words): <NEW_LINE> <INDENT> stemmed = [] <NEW_LINE> for word in words: <NEW_LINE> <INDENT> stemmed.append(self.__stem... | Notes:
Class to summarize given text. Returns most popular sentences and words
Attributes:
__stemmer: Stemmer object to tokenize words in given text
__splitter: SentenceSplitter object to split given text into sentences | 625990805fc7496912d48fca |
class BaseModel(type): <NEW_LINE> <INDENT> def __new__(cls, name, bases, attrs): <NEW_LINE> <INDENT> if name == _METACLASS_ or bases[0].__name__ == _METACLASS_: <NEW_LINE> <INDENT> return super(BaseModel, cls).__new__(cls, name, bases, attrs) <NEW_LINE> <DEDENT> meta_options = {} <NEW_LINE> meta = attrs.pop('Meta', Non... | Metaclass for all models. | 62599080099cdd3c63676159 |
class DecomposeAssembly(BaseAssembly): <NEW_LINE> <INDENT> def _set_mapping(self): <NEW_LINE> <INDENT> self.l2g = numpy.empty(self.nElems, dtype=numpy.ndarray) <NEW_LINE> cnt = self.nElems + 1 <NEW_LINE> for i, e in enumerate(self.elems): <NEW_LINE> <INDENT> self.l2g[i] = numpy.array( [i] + list(range(cnt, cnt+e.n_node... | 1D global assembly that decomposes boundary and interior nodes | 6259908097e22403b383c9bf |
class DLL: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.head = None <NEW_LINE> self.tail = None <NEW_LINE> <DEDENT> def insert(self, val): <NEW_LINE> <INDENT> node = Node(val, self.head, None) <NEW_LINE> if not self.head: <NEW_LINE> <INDENT> self.head = self.tail = node <NEW_LINE> <DEDENT> else: <NE... | Doubly linked list. | 62599080aad79263cf430279 |
class TaskTemplateRequirementsSerializer(serializers.Serializer): <NEW_LINE> <INDENT> trigger_conditions = serializers.SerializerMethodField() <NEW_LINE> end_conditions = serializers.SerializerMethodField() <NEW_LINE> task_templates = serializers.SerializerMethodField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> fields... | Task template requirements serializer. | 625990807c178a314d78e94a |
class SteinerHandler(Handler): <NEW_LINE> <INDENT> def __init__(self, city: str, path: str): <NEW_LINE> <INDENT> super().__init__(path) <NEW_LINE> self.radar = CAPPI(city) <NEW_LINE> <DEDENT> def save_steiner(self): <NEW_LINE> <INDENT> old_name = self.radar.file_name + "" <NEW_LINE> new_name = old_name.replace("raw.gz"... | The SteinerHandler class is a subclass of Handler that deals with the
Steiner method. While it is almost the same, it implements the iterator
differently, and also saves the output as a file. | 6259908060cbc95b06365acc |
class SDLError(Exception): <NEW_LINE> <INDENT> pass | Generic SDL error. | 625990805fcc89381b266ebc |
class AR1Image(MathsCommand): <NEW_LINE> <INDENT> input_spec = AR1ImageInput <NEW_LINE> _suffix = "_ar1" | Use fslmaths to generate an AR1 coefficient image across a
given dimension. (Should use -odt float and probably demean first) | 6259908023849d37ff852b79 |
class TestApi(TestPyZWave): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(self): <NEW_LINE> <INDENT> super(TestApi, self).setUpClass() <NEW_LINE> self.options = ZWaveOption(device=self.device, user_path=self.userpath) <NEW_LINE> self.options.set_log_file("OZW_Log.log") <NEW_LINE> self.options.set_append_lo... | Parent test class for api | 6259908097e22403b383c9c0 |
class Benktander(MethodBase): <NEW_LINE> <INDENT> def __init__(self, apriori=1.0, n_iters=1): <NEW_LINE> <INDENT> self.apriori = apriori <NEW_LINE> self.n_iters = n_iters <NEW_LINE> <DEDENT> def fit(self, X, y=None, sample_weight=None): <NEW_LINE> <INDENT> super().fit(X, y, sample_weight) <NEW_LINE> self.sample_weight_... | The Benktander (or iterated Bornhuetter-Ferguson) IBNR model
Parameters
----------
apriori : float, optional (default=1.0)
Multiplier for the sample_weight used in the Benktander method
method. If sample_weight is already an apriori measure of ultimate,
then use 1.0
n_iters : int, optional (default=1)
... | 625990805fc7496912d48fcb |
class Pathways(DynamicDocument): <NEW_LINE> <INDENT> pathwayname = StringField(max_length=20, unique=True) <NEW_LINE> hyperlink = StringField(max_length=100) <NEW_LINE> source1 = StringField(max_length=20) <NEW_LINE> source2 = StringField(max_length=20) <NEW_LINE> source3 = StringField(max_length=20) <NEW_LINE> source4... | 通路基本信息 | 62599080099cdd3c6367615a |
class NewMailEvent(TimestampEvent): <NEW_LINE> <INDENT> ELEMENT_NAME = "NewMailEvent" | MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/newmailevent | 625990808a349b6b43687d1e |
class ParseLimitsTest(BaseLimitTestSuite): <NEW_LINE> <INDENT> def test_invalid(self): <NEW_LINE> <INDENT> self.assertRaises(ValueError, limits.Limiter.parse_limits, ';;;;;') <NEW_LINE> <DEDENT> def test_bad_rule(self): <NEW_LINE> <INDENT> self.assertRaises(ValueError, limits.Limiter.parse_limits, 'GET, *, .*, 20, minu... | Tests for the default limits parser in the in-memory
`limits.Limiter` class. | 62599080442bda511e95dab7 |
class DefaultInitApi(InitApi): <NEW_LINE> <INDENT> def __init__(self, api_url: str, connect_retries: int, backoff_factor: float, context: EndpointContext): <NEW_LINE> <INDENT> session = requests.Session() <NEW_LINE> retry = Retry(connect=connect_retries, backoff_factor=backoff_factor) <NEW_LINE> adapter = HTTPAdapter(m... | Default, HTTP/JSON based :class:`InitApi` implementation. | 6259908097e22403b383c9c1 |
class Species: <NEW_LINE> <INDENT> def __init__(self, genome: np.ndarray, fitness: float): <NEW_LINE> <INDENT> self.fitness = fitness <NEW_LINE> self.genome = genome <NEW_LINE> self.len = len(self.genome) <NEW_LINE> six_hex_digits = hex(int(self.fitness * 16 ** 8))[2:8] <NEW_LINE> self._name = 'V' + six_hex_digits <NEW... | A vehicle is a set of Replicants, fighting for survival together.
They are represented in a numpy vector.
0 -> gene not contained.
1 -> gene contained. | 62599080aad79263cf43027c |
class SimpleCOAtomAbund(ChemicalAbund): <NEW_LINE> <INDENT> def __init__(self, *sizes): <NEW_LINE> <INDENT> atom_ids = ['C', 'O', 'Si'] <NEW_LINE> masses = [ 12., 16., 28. ] <NEW_LINE> super(SimpleCOAtomAbund, self).__init__(atom_ids, masses, *sizes) <NEW_LINE> <DEDENT> def set_solar_abundances(self, muH=1.28): <NEW_... | Class to hold the raw atomic abundaces of C/O/Si for the CO chemistry | 625990804c3428357761bd7c |
class CalculatorTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_add(self): <NEW_LINE> <INDENT> result = calculator.add(10, 20) <NEW_LINE> self.assertEqual(result, 30) <NEW_LINE> <DEDENT> def test_subtract(self): <NEW_LINE> <INDENT> result = calculator.subtract(10, 20) <NEW_LINE> self.assertEqual(result, -10) ... | Testcase for calculator functions | 6259908066673b3332c31ec1 |
class BinaryManager(object): <NEW_LINE> <INDENT> def __init__(self, configs): <NEW_LINE> <INDENT> self._dependency_manager = dependency_manager.DependencyManager(configs) <NEW_LINE> <DEDENT> def FetchPath(self, binary_name, arch, os_name, os_version=None): <NEW_LINE> <INDENT> platform = '%s_%s' % (os_name, arch) <NEW_L... | This class is effectively a subclass of dependency_manager, but uses a
different number of arguments for FetchPath and LocalPath. | 62599080796e427e5385023c |
class LazyLoaderReloadingTest(TestCase): <NEW_LINE> <INDENT> module_name = 'loadertest' <NEW_LINE> module_key = 'loadertest.test' <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.opts = _config = minion_config(None) <NEW_LINE> self.tmp_dir = tempfile.mkdtemp(dir=tests.integration.TMP) <NEW_LINE> self.count = 0 <NEW... | Test the loader of salt with changing modules | 625990805fcc89381b266ebd |
class AumSortedConcatenate(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ans = {} <NEW_LINE> <DEDENT> def step(self, ndx, author, sort, link): <NEW_LINE> <INDENT> if author is not None: <NEW_LINE> <INDENT> self.ans[ndx] = ':::'.join((author, sort, link)) <NEW_LINE> <DEDENT> <DEDENT> def fina... | String concatenation aggregator for the author sort map | 625990805fdd1c0f98e5fa41 |
class ClassificationGBDTModelAnalysis(GBDTModelAnalysis, ClassificationTreeModelAnalysis): <NEW_LINE> <INDENT> pass | Class for gradient boosting classification model analysis | 625990801f5feb6acb1646bb |
class HourOfDayField(metaclass=IntFieldMeta, seg_y_type='int16', min_value=0, max_value=24): <NEW_LINE> <INDENT> pass | Hour of day. (24 hour clock). | 6259908092d797404e3898bd |
class BotBeepCMD(Command): <NEW_LINE> <INDENT> key = "botbeep" <NEW_LINE> def parse(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def func(self): <NEW_LINE> <INDENT> self.caller.location.msg_contents("ROBOT SAYS BEEP.") | Test command that makes the constructor bot make a noise. Should only be accessible in the room
where the ConstructorBot is currently residing. | 625990803d592f4c4edbc8c0 |
class ConnectionError(Error): <NEW_LINE> <INDENT> pass | Base class for any socket-level connection issues | 625990804f88993c371f1283 |
class TrustStore: <NEW_LINE> <INDENT> def __init__( self, platform: PlatformEnum, version: Optional[str], url: str, date_fetched: datetime.date, trusted_certificates: Set[RootCertificateRecord], blocked_certificates: Set[RootCertificateRecord]=None, ) -> None: <NEW_LINE> <INDENT> if blocked_certificates is None: <NEW_L... | The set of root certificates that compose the trust store of one platform at a specific time.
| 625990807b180e01f3e49dc6 |
class Namespace(pulumi.CustomResource): <NEW_LINE> <INDENT> def __init__(__self__, __name__, __opts__=None, location=None, name=None, resource_group_name=None, sku=None, tags=None): <NEW_LINE> <INDENT> if not __name__: <NEW_LINE> <INDENT> raise TypeError('Missing resource name argument (for URN creation)') <NEW_LINE> <... | Manages an Azure Relay Namespace. | 6259908097e22403b383c9c2 |
@dataclass <NEW_LINE> class JoplinNotebook(JoplinNodeWithTitle): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def type(cls) -> NodeType: <NEW_LINE> <INDENT> return NodeType.NOTEBOOK | Dataclass for Joplin "notebook" node types. | 62599080bf627c535bcb2f94 |
class Solution: <NEW_LINE> <INDENT> def rotate(self, matrix: List[List[int]]) -> None: <NEW_LINE> <INDENT> self.rotate_side(matrix, 0) <NEW_LINE> <DEDENT> def rotate_side(self, matrix: List[List[int]], start): <NEW_LINE> <INDENT> n = len(matrix) <NEW_LINE> end = n - 1 - start <NEW_LINE> if start >= end: <NEW_LINE> <IND... | 20190815 | 625990807047854f46340e78 |
class Map: <NEW_LINE> <INDENT> def __init__ (self, gridXDimension, gridYDimension, townGridDimension, cdfHouseClasses, ukMap, ukClassBias, densityModifier, lha1, lha2, lha3, lha4): <NEW_LINE> <INDENT> self.towns = [] <NEW_LINE> self.allHouses = [] <NEW_LINE> self.occupiedHouses = [] <NEW_LINE> ukMap = np.array(ukMap) <... | Contains a collection of towns to make up the whole country being simulated. | 62599080442bda511e95dab8 |
class ExactInference(InferenceModule): <NEW_LINE> <INDENT> def initializeUniformly(self, gameState): <NEW_LINE> <INDENT> self.beliefs = util.Counter() <NEW_LINE> for p in self.legalPositions: self.beliefs[p] = 1.0 <NEW_LINE> self.beliefs.normalize() <NEW_LINE> <DEDENT> def observe(self, observation, gameState): <NEW_LI... | The exact dynamic inference module should use forward-algorithm
updates to compute the exact belief function at each time step. | 6259908097e22403b383c9c3 |
class AirSimCarEnv(gym.Env): <NEW_LINE> <INDENT> metadata = {'render.modes': ['human']} <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> config = ConfigParser() <NEW_LINE> config.read(join(dirname(dirname(abspath(__file__))), 'config.ini')) <NEW_LINE> self.action_space = spaces.Discrete(... | Custom Environment that follows gym interface | 62599080283ffb24f3cf5364 |
class ProxyCloner(object): <NEW_LINE> <INDENT> def __init__(self, proxy_class, session): <NEW_LINE> <INDENT> for name, _ in inspect.getmembers(proxy_class, predicate=inspect.ismethod): <NEW_LINE> <INDENT> setattr(self, name, _ProxyMethod(name, session)) <NEW_LINE> <DEDENT> self.session = session | Class that will mimic an object methods but in fact
send the calls over the networks | 625990807c178a314d78e94c |
class VideoPlaceholderNode(PlaceholderNode): <NEW_LINE> <INDENT> widget = VideoWidget <NEW_LINE> def render(self, context): <NEW_LINE> <INDENT> content = self.get_content_from_context(context) <NEW_LINE> if not content: <NEW_LINE> <INDENT> return '' <NEW_LINE> <DEDENT> if content: <NEW_LINE> <INDENT> video_url, w, h = ... | A youtube `PlaceholderNode`, just here as an example. | 625990801f5feb6acb1646bd |
class Display: <NEW_LINE> <INDENT> def showImage(self, image): <NEW_LINE> <INDENT> print("图片大小:%d x %d, 图片内容:%s" % (image.getWidth(), image.getHeight(), image.getPix())) | 显示器 | 625990805166f23b2e244e9c |
class VariableRenamer(ast.Transformer): <NEW_LINE> <INDENT> def visit_Variable(self, node): <NEW_LINE> <INDENT> return ast.Variable(node.location, '_' + node.name) | Add an underscore to all names of variables in an ast. | 62599080d268445f2663a8c0 |
class DataGeneration(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.transaction_count = AppConfig.get('transaction_count') <NEW_LINE> self.data_set = AppConfig.get('data_set') <NEW_LINE> <DEDENT> def get_transaction_data_cardinality(self): <NEW_LINE> <INDENT> return random.randint(1, len(self.data_... | DataGeneration is a helper class with several utility methods
for generating random data sets for transactions and data operations | 625990803346ee7daa3383c4 |
class CMEErrorSIMPINRequired(CMEError): <NEW_LINE> <INDENT> pass | Exception raised with +CME ERROR: SIM PIN required | 6259908097e22403b383c9c4 |
class Gather(tile.Operation): <NEW_LINE> <INDENT> def __init__(self, value, indicies): <NEW_LINE> <INDENT> outshape = tile.Shape(value.shape.dtype, list(indicies.shape.dims) + list(value.shape.dims[1:])) <NEW_LINE> super(Gather, self).__init__('function (V, I) -> (O) { O = gather(V, I); }', [('V', value), ('I', indicie... | Gathers elements of a tensor. | 62599080656771135c48ad92 |
class Game: <NEW_LINE> <INDENT> def __init__(self, board_size=3, save_history=True): <NEW_LINE> <INDENT> self.board_size = board_size <NEW_LINE> self.state = np.zeros((board_size, board_size), dtype=int) <NEW_LINE> self.save_history = save_history <NEW_LINE> self.history = [self.state.copy()] <NEW_LINE> self.last_play ... | TicTacToe game implementation to be used by Monte Carlo Tree Search
https://en.wikipedia.org/wiki/Tic-tac-toe | 625990805fc7496912d48fcd |
class PerlMoose(PerlPackage): <NEW_LINE> <INDENT> homepage = "http://search.cpan.org/~ether/Moose-2.2006/lib/Moose.pm" <NEW_LINE> url = "http://search.cpan.org/CPAN/authors/id/E/ET/ETHER/Moose-2.2006.tar.gz" <NEW_LINE> version('2.2010', '636238ac384818ee1e92eff6b9ecc50a') <NEW_LINE> version('2.2009', '5527b1a5abc2... | A postmodern object system for Perl 5 | 62599080f9cc0f698b1c602e |
class EspressoCzar(MP): <NEW_LINE> <INDENT> def __init__(self, max_coffee_bean_units): <NEW_LINE> <INDENT> MP.__init__(self) <NEW_LINE> self.sema_empty = self.Semaphore("machine empty", max_coffee_bean_units) <NEW_LINE> self.sema_full = self.Semaphore("machine full", 0) <NEW_LINE> self.queue = list() <NEW_LINE> self.lo... | Three years into the future...
You are a PhD student at Cornell University and have recently been
elected to manage the CS Department coffee supply as the Espresso Czar. In
other words, you are now the go-to person whenever the Gates Hall espresso
machine is empty. Congrats!
With the CS Department's shared love of co... | 6259908044b2445a339b76bf |
class CouchDBStorageSettingsForm(SiteSettingsForm): <NEW_LINE> <INDENT> couchdb_default_server = forms.CharField( label=_('Default server'), help_text=_('For example, "http://couchdb.local:5984"'), required=True) <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(CouchDBStorageSettingsForm, self)... | Settings subform for CouchDB-based file storage.
Note that this is currently unused. It's here for legacy reasons and
future support. | 62599080aad79263cf430280 |
class TestV1ClusterRole(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 testV1ClusterRole(self): <NEW_LINE> <INDENT> pass | V1ClusterRole unit test stubs | 6259908063b5f9789fe86c2d |
class AntlrObjectiveCLexer(DelegatingLexer): <NEW_LINE> <INDENT> name = 'ANTLR With ObjectiveC Target' <NEW_LINE> aliases = ['antlr-objc'] <NEW_LINE> filenames = ['*.G', '*.g'] <NEW_LINE> def __init__(self, **options): <NEW_LINE> <INDENT> super(AntlrObjectiveCLexer, self).__init__(ObjectiveCLexer, AntlrLexer, **options... | `ANTLR`_ with Objective-C Target
*New in Pygments 1.1.* | 6259908126068e7796d4e406 |
class CONSOLE_SCREEN_BUFFER_INFO(ctypes.Structure): <NEW_LINE> <INDENT> _fields_ = [ ("dwSize", COORD), ("dwCursorPosition", COORD), ("wAttributes", WORD), ("srWindow", SMALL_RECT), ("dwMaximumWindowSize", COORD) ] | struct in wincon.h. | 625990817d847024c075dea3 |
class LineDLayer(DLayer): <NEW_LINE> <INDENT> def __init__(self, name, dmap): <NEW_LINE> <INDENT> super(LineDLayer, self).__init__(name, dmap) <NEW_LINE> <DEDENT> def addFeature(self, feature, feature_id = None): <NEW_LINE> <INDENT> if feature_id: feature_id = str(feature_id) <NEW_LINE> line_shp = shapeObj(MS_SHAPE_LIN... | A line-specialized DLayer subclass. | 625990813d592f4c4edbc8c2 |
class PointTnf(object): <NEW_LINE> <INDENT> def __init__(self, use_cuda=True): <NEW_LINE> <INDENT> self.use_cuda=use_cuda <NEW_LINE> self.tpsTnf = TpsGridGen(use_cuda=self.use_cuda) <NEW_LINE> <DEDENT> def tpsPointTnf(self,theta,points): <NEW_LINE> <INDENT> points=points.unsqueeze(3).transpose(1,3) <NEW_LINE> warped_po... | Class with functions for transforming a set of points with affine/tps transformations | 625990814f88993c371f1285 |
class CertificateManager( CertificateManagerMixin["Certificate", "CertificateQuerySet"], CertificateManagerBase ): <NEW_LINE> <INDENT> if TYPE_CHECKING: <NEW_LINE> <INDENT> def expired(self) -> "CertificateQuerySet": <NEW_LINE> <INDENT> ... <NEW_LINE> <DEDENT> def not_yet_valid(self) -> "CertificateQuerySet": <NEW_LINE... | Model manager for the Certificate model. | 625990817b180e01f3e49dc8 |
class PathInfo: <NEW_LINE> <INDENT> def __init__(self, params) : <NEW_LINE> <INDENT> self.params = params <NEW_LINE> <DEDENT> def getStatsPath(self) : <NEW_LINE> <INDENT> return os.path.join(self.params.workDir,"alignmentStats.txt") <NEW_LINE> <DEDENT> def getChromDepth(self) : <NEW_LINE> <INDENT> return os.path.join(s... | object to centralize shared workflow path names | 6259908197e22403b383c9c6 |
class MissingParameterError(Exception): <NEW_LINE> <INDENT> pass | Error related to proxy.
Raised when some compulsory parameter is missing
from both its attribute and argument set
of the method invocation. | 6259908163b5f9789fe86c2f |
class Image(object): <NEW_LINE> <INDENT> def __init__(self, width, height): <NEW_LINE> <INDENT> self.iterations = 0 <NEW_LINE> self.width = width <NEW_LINE> self.height = height <NEW_LINE> self.image = [[0 for i in xrange(width*3)] for j in xrange(height)] <NEW_LINE> self.writer = png.Writer(width = self.width, height ... | Image-class takes care of turning incoming binary data into images.
Averages multiple pass images to one and writes png-files. | 625990817cff6e4e811b7508 |
class Laplace(Distribution): <NEW_LINE> <INDENT> arg_constraints = {'loc': constraints.real, 'scale': constraints.positive} <NEW_LINE> support = constraints.real <NEW_LINE> has_rsample = True <NEW_LINE> @property <NEW_LINE> def mean(self): <NEW_LINE> <INDENT> return self.loc <NEW_LINE> <DEDENT> @property <NEW_LINE> def... | Creates a Laplace distribution parameterized by :attr:`loc` and :attr:'scale'.
Example::
>>> m = Laplace(torch.tensor([0.0]), torch.tensor([1.0]))
>>> m.sample() # Laplace distributed with loc=0, scale=1
tensor([ 0.1046])
Args:
loc (float or Tensor): mean of the distribution
scale (float or Tens... | 625990815fcc89381b266ec0 |
class Schedule(object): <NEW_LINE> <INDENT> def __init__(self, schedule_id, name=None, description=None, entity_ids=None, days=None): <NEW_LINE> <INDENT> self.schedule_id = schedule_id <NEW_LINE> self.name = name <NEW_LINE> self.description = description <NEW_LINE> self.entity_ids = entity_ids or [] <NEW_LINE> self.day... | A Schedule | 625990815166f23b2e244ea0 |
class TestPrimitive_C_CANCEL(unittest.TestCase): <NEW_LINE> <INDENT> def test_assignment(self): <NEW_LINE> <INDENT> primitive = C_CANCEL() <NEW_LINE> primitive.MessageIDBeingRespondedTo = 13 <NEW_LINE> self.assertEqual(primitive.MessageIDBeingRespondedTo, 13) <NEW_LINE> with self.assertRaises(ValueError): <NEW_LINE> <I... | Test DIMSE C-CANCEL operations. | 6259908192d797404e3898c0 |
class RemovingSetWrapper(set): <NEW_LINE> <INDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> if len(self): <NEW_LINE> <INDENT> return self.pop() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise StopIteration | RemovingSetWrapper removes elements on iteration.
**Note:** Usually used internally only.
When iterating over RemovingSetWrapper, the iterated element is removed.
This manages basically which points are still needed to iterate over in the viability
algorithm. | 625990813d592f4c4edbc8c3 |
@StatusCodes.EBADF <NEW_LINE> class BadFileDescriptorError(UVError, common.builtins.IOError): <NEW_LINE> <INDENT> pass | Bad file descriptor. | 625990814f88993c371f1286 |
class Echo(ProtoMessage): <NEW_LINE> <INDENT> message = pmessages.StringField(1, default='Hello, world!') | I am rubber and you are glue... | 62599081d268445f2663a8c2 |
class TestTopology(TopologyBuilder): <NEW_LINE> <INDENT> def __init__(self, input_file, logger_config): <NEW_LINE> <INDENT> TopologyBuilder.__init__(self, input_file, logger_config) <NEW_LINE> self.resolved_topology = [] <NEW_LINE> self.topology = None <NEW_LINE> with open(self.input_file, 'r') as file_desc: <NEW_LINE>... | Test topology class | 625990817b180e01f3e49dc9 |
class AlcatelAosSSH(CiscoSSHConnection): <NEW_LINE> <INDENT> def session_preparation(self): <NEW_LINE> <INDENT> self._test_channel_read(pattern=r"[>#]") <NEW_LINE> self.set_base_prompt() <NEW_LINE> time.sleep(0.3 * self.global_delay_factor) <NEW_LINE> self.clear_buffer() <NEW_LINE> <DEDENT> def check_enable_mode(self, ... | Alcatel-Lucent Enterprise AOS support (AOS6 and AOS8). | 625990815fc7496912d48fcf |
class Status : <NEW_LINE> <INDENT> node2com = {} <NEW_LINE> total_weight = 0 <NEW_LINE> internals = {} <NEW_LINE> degrees = {} <NEW_LINE> gdegrees = {} <NEW_LINE> def __init__(self) : <NEW_LINE> <INDENT> self.node2com = dict([]) <NEW_LINE> self.total_weight = 0 <NEW_LINE> self.degrees = dict([]) <NEW_LINE> self.gdegree... | To handle several data in one struct.
Could be replaced by named tuple, but don't want to depend on python 2.6 | 62599081bf627c535bcb2f9a |
class BestNewswireFile(_BaseBestFile): <NEW_LINE> <INDENT> data_type = 'news' <NEW_LINE> def _build_source_fname(self, dir="source"): <NEW_LINE> <INDENT> return os.path.join(self.data_root, dir, '{}.xml'.format(self.doc_id)) | Newswire data | 62599081283ffb24f3cf5369 |
class Cancel(Message): <NEW_LINE> <INDENT> MESSAGE_TYPE = 49 <NEW_LINE> SKIP = u'skip' <NEW_LINE> ABORT = u'abort' <NEW_LINE> KILL = u'kill' <NEW_LINE> def __init__(self, request, mode=None): <NEW_LINE> <INDENT> assert(type(request) in six.integer_types) <NEW_LINE> assert(mode is None or type(mode) == six.text_type) <N... | A WAMP ``CANCEL`` message.
Format: ``[CANCEL, CALL.Request|id, Options|dict]`` | 625990817cff6e4e811b750a |
class Consuming(MonitorTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(Consuming, self).setUp() <NEW_LINE> self.controller = controller.HttpConsuming() <NEW_LINE> self.controller.respond = lambda x, y: None <NEW_LINE> <DEDENT> def test_get(self): <NEW_LINE> <INDENT> self.controller.get() <NEW_LINE... | Test the "HttpConsuming" controller. | 62599081a8370b77170f1e9b |
class ScaledOrthogonalAlignment(Alignment): <NEW_LINE> <INDENT> def __init__(self, scaling=True): <NEW_LINE> <INDENT> self.scaling = scaling <NEW_LINE> self.scale = 1 <NEW_LINE> <DEDENT> def fit(self, X, Y): <NEW_LINE> <INDENT> R, sc = scaled_procrustes(X, Y, scaling=self.scaling) <NEW_LINE> self.scale = sc <NEW_LINE> ... | Compute a mixing matrix R and a scaling sc such that Frobenius norm
||sc RX - Y||^2 is minimized and R is an orthogonal matrix
Parameters
---------
scaling : boolean, optional
Determines whether a scaling parameter is applied to improve transform.
R : ndarray (n_features, n_features)
Optimal orthogonal transfo... | 6259908123849d37ff852b83 |
class Child(Father, Mother): <NEW_LINE> <INDENT> pass | Implementation class: must not appear in specifications | 625990814527f215b58eb705 |
class Zcertstore(object): <NEW_LINE> <INDENT> def __init__(self, location): <NEW_LINE> <INDENT> p = utils.lib.zcertstore_new(utils.to_bytes(location)) <NEW_LINE> if p == utils.ffi.NULL: <NEW_LINE> <INDENT> raise MemoryError("Could not allocate person") <NEW_LINE> <DEDENT> self._p = utils.ffi.gc(p, libczmq_destructors.z... | work with CURVE security certificate stores | 625990815fc7496912d48fd0 |
class NamedLink(object): <NEW_LINE> <INDENT> def __init__(self, url, name): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.name = name <NEW_LINE> <DEDENT> def get_path(self): <NEW_LINE> <INDENT> return urlparse.urlparse(self.url).path[1:] <NEW_LINE> <DEDENT> def __hash__(self): <NEW_LINE> <INDENT> return hash(self.... | Holds a url with an additional name attribute. Used when scraping all the
urls from the main page into a single set of urls. | 62599081f9cc0f698b1c6031 |
class StupidCrypto(cryptosystem.Pkc): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_name(cls): <NEW_LINE> <INDENT> return "StupidPkc" <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_priority(cls): <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> def encrypt_public(self, message): <NEW_LINE> <INDENT> return me... | A cryptosystem that makes no changes to the plaintext. | 625990814a966d76dd5f09b0 |
class Glyph(QtWidgets.QGraphicsItem): <NEW_LINE> <INDENT> def __init__(self, pixmap, char, leftMargin=0, charWidth=0, fullWidth=0): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.char = char <NEW_LINE> self.leftMargin = leftMargin <NEW_LINE> self.charWidth = charWidth <NEW_LINE> self.fullWidth = fullWidth <NEW_... | Class for a character glyph | 62599081bf627c535bcb2f9c |
class Zeus_1d_file(Zeus_file): <NEW_LINE> <INDENT> def open_density(self): <NEW_LINE> <INDENT> super(Zeus_1d_file,self).open_density() <NEW_LINE> self.rho = self.rho[0,0,:] <NEW_LINE> <DEDENT> def open_energy(self): <NEW_LINE> <INDENT> super(Zeus_1d_file,self).open_energy() <NEW_LINE> self.e = self.e[0,0,:] <NEW_LINE> ... | assumes x-direction variation | 6259908155399d3f05627fdf |
class DeleteUser(command.Command): <NEW_LINE> <INDENT> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(DeleteUser, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( 'users', metavar='<user>', nargs="+", help='User(s) to delete (name or ID)', ) <NEW_LINE> parser.add_argument( '--domain', me... | Delete user(s) | 625990815fcc89381b266ec2 |
class Movie(object): <NEW_LINE> <INDENT> VALID_RATINGS = ['G', 'PG', 'PG-13', 'R'] <NEW_LINE> def __init__(self, movie_title, movie_storyline, poster_url, trailer_url): <NEW_LINE> <INDENT> self.title = movie_title <NEW_LINE> self.storyline = movie_storyline <NEW_LINE> self.poster_image_url = poster_url <NEW_LINE> self.... | This class provides a way to store movie related information. | 62599081091ae3566870670b |
class TsObject(object): <NEW_LINE> <INDENT> def __init__(self, client, table, rows=[], columns=[]): <NEW_LINE> <INDENT> if not isinstance(table, Table): <NEW_LINE> <INDENT> raise ValueError('table must be an instance of Table.') <NEW_LINE> <DEDENT> self.client = client <NEW_LINE> self.table = table <NEW_LINE> self.rows... | The TsObject holds information about Timeseries data, plus the data
itself. | 6259908199fddb7c1ca63b3f |
class StatusResourceView(ViewSet): <NEW_LINE> <INDENT> @never_cache <NEW_LINE> def status(self, request, *args, **kwargs): <NEW_LINE> <INDENT> plugins = sorted(( plugin_class(**copy.deepcopy(options)) for plugin_class, options in plugin_dir._registry ), key=lambda plugin: plugin.identifier()) <NEW_LINE> errors = _run_c... | status:
Check the status of the system and its dependencies. | 6259908123849d37ff852b85 |
class SaltExecutionFunction(SaltTargettedStep): <NEW_LINE> <INDENT> @property <NEW_LINE> def function(self): <NEW_LINE> <INDENT> return self.step_dict['name'] <NEW_LINE> <DEDENT> @property <NEW_LINE> def args(self): <NEW_LINE> <INDENT> args = [] <NEW_LINE> if 'm_name' in self.step_dict: <NEW_LINE> <INDENT> args.append(... | Class to represent a Salt module.run step | 625990813346ee7daa3383c8 |
class ImageDatasetColor(torch.utils.data.Dataset): <NEW_LINE> <INDENT> def __init__(self, size, text_function, map_function, fonts, device = None): <NEW_LINE> <INDENT> self.text_function = text_function <NEW_LINE> self.fonts = fonts <NEW_LINE> self.size = size <NEW_LINE> self.device = device <NEW_LINE> token_to_index, ... | Generated dataset for a mono masking process.
The dataset distribution is customizable | 62599081f548e778e596d05e |
class AuthPluginOptionsMissing(AuthorizationFailure): <NEW_LINE> <INDENT> def __init__(self, opt_names): <NEW_LINE> <INDENT> super(AuthPluginOptionsMissing, self).__init__( "Authentication failed. Missing options: %s" % ", ".join(opt_names)) <NEW_LINE> self.opt_names = opt_names | Auth plugin misses some options. | 62599081ad47b63b2c5a931d |
class CheckerRouter: <NEW_LINE> <INDENT> def db_for_read(self, model, **hints): <NEW_LINE> <INDENT> if model._meta.app_label == 'college': <NEW_LINE> <INDENT> return 'college' <NEW_LINE> <DEDENT> elif model._meta.app_label == 'school': <NEW_LINE> <INDENT> return 'school' <NEW_LINE> <DEDENT> return 'default' <NEW_LINE> ... | A router to control all database operations on models in the
user application. | 62599081f548e778e596d05f |
class Shared_Term_Do_Construct(Base): <NEW_LINE> <INDENT> subclass_names = ['Outer_Shared_Do_Construct', 'Inner_Shared_Do_Construct'] | <shared-term-do-construct> = <outer-shared-do-construct>
| <inner-shared-do-construct> | 62599081aad79263cf430287 |
class K8SNamespaceInfo(StructuredRel, models.Relation): <NEW_LINE> <INDENT> adopted_since = IntegerProperty() | k8s namespace information model (for relationship) | 625990814c3428357761bd88 |
class MessageBusBackend: <NEW_LINE> <INDENT> def produce(self, value: dict, key: str = None, **kwargs) -> None: <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_consumer(self): <NEW_LINE> <INDENT> raise NotImplementedError() | Message bus interface. | 62599081be7bc26dc9252bbc |
class IsBusinessAdmin(permissions.BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> print('entro a has perm') <NEW_LINE> try: <NEW_LINE> <INDENT> if request.user: <NEW_LINE> <INDENT> print(request.user) <NEW_LINE> try: <NEW_LINE> <INDENT> empleado=Empleado.objects.get(usu... | Object-level permission to only allow owners of an object to edit it.
Assumes the model instance has an `owner` attribute. | 6259908197e22403b383c9cd |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.