code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class BaseTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def show(self, textin): <NEW_LINE> <INDENT> if isinstance(textin, list): <NEW_LINE> <INDENT> result = [] <NEW_LINE> for i in range(len(textin)): <NEW_LINE> <INDENT> result.append(" %d: %r" % (i, textin[i])) <NEW_LINE> <DEDENT> result = "\n".join(result) if res... | Parent class with utility methods for textwrap tests. | 62598edfe64d504609df86a3 |
class KB: <NEW_LINE> <INDENT> def __init__(self, sentence=None): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def tell(self, sentence): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def ask(self, query): <NEW_LINE> <INDENT> return first(self.ask_generator(query), default=False) ... | A knowledge base to which you can tell and ask sentences.
To create a KB, first subclass this class and implement
tell, ask_generator, and retract. Why ask_generator instead of ask?
The book is a bit vague on what ask means --
For a Propositional Logic KB, ask(P & Q) returns True or False, but for an
FOL KB, something... | 62598edf8a43f66fc4bf0739 |
class Warning(Channel, active=True, fatal=False): <NEW_LINE> <INDENT> from .exceptions import ApplicationError <NEW_LINE> def record(self): <NEW_LINE> <INDENT> self.device.alert(entry=self.entry) <NEW_LINE> return self <NEW_LINE> <DEDENT> severity = "warning" <NEW_LINE> fatalError = ApplicationError | Warning channels are used to communicate application progress to users.
Typically, they indicate that the application has encountered a condition that is
potentially problematic, but the application has identified a workaround. | 62598edf1b99ca400228e7f0 |
class Mutex(Argument): <NEW_LINE> <INDENT> def __init__(self, *args, required=False): <NEW_LINE> <INDENT> super().__init__(*args) <NEW_LINE> self.required = required <NEW_LINE> <DEDENT> def register(self, parser): <NEW_LINE> <INDENT> group = parser.add_mutually_exclusive_group(required=self.required) <NEW_LINE> for a i... | Mutually exclusive group.
.. versionadded:: 1.9
.. code-block::
class Foo(Root):
__arguments__ = [
Mutex(
Argument('--bar'),
Argument('--baz')
)
]
... | 62598edf3eb6a72ae0388c08 |
class ResourceExtension(object): <NEW_LINE> <INDENT> def __init__(self, collection, controller=None, parent=None, collection_actions=None, member_actions=None, custom_routes_fn=None, inherits=None): <NEW_LINE> <INDENT> if not collection_actions: <NEW_LINE> <INDENT> collection_actions = {} <NEW_LINE> <DEDENT> if not mem... | Add top level resources to the OpenStack API in nova. | 62598edfe5267d203ee69eca |
class MediaWindowsError(Exception): <NEW_LINE> <INDENT> pass | Generic error class for graphics module exceptions. | 62598edf4f6381625f1987a0 |
class SendOpDesc: <NEW_LINE> <INDENT> def __init__(self, partition_index, dst): <NEW_LINE> <INDENT> self._dst = dst <NEW_LINE> self._partition_index = partition_index <NEW_LINE> self._desc = "send" <NEW_LINE> <DEDENT> @property <NEW_LINE> def partition_index(self): <NEW_LINE> <INDENT> return self._partition_index <NEW_... | Describe the send op in the reshard phase.
Args:
partition_index (list): The index of partition in complete tensor.
dst (int): The destination process to receive. | 62598edfadb09d7d5dc08b8e |
class WorkflowRunListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[WorkflowRun]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(WorkflowRunListResult, self).__init__(**kwargs) <NEW... | The list of workflow runs.
:param value: A list of workflow runs.
:type value: list[~azure.mgmt.logic.models.WorkflowRun]
:param next_link: The URL to get the next set of results.
:type next_link: str | 62598edfd7e4931a7ef3a664 |
class SimulationLoopHagedorn(SimulationLoop): <NEW_LINE> <INDENT> def __init__(self, parameters): <NEW_LINE> <INDENT> self.parameters = parameters <NEW_LINE> self.propagator = None <NEW_LINE> self.IOManager = None <NEW_LINE> self._tm = TimeManager(self.parameters) <NEW_LINE> self.IOManager = IOManager() <NEW_LINE> self... | This class acts as the main simulation loop. It owns a propagator that
propagates a set of initial values during a time evolution. | 62598edfa79ad161977685e4 |
class PriorityQueue: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.elements = [] <NEW_LINE> <DEDENT> def empty(self): <NEW_LINE> <INDENT> return len(self.elements)==0 <NEW_LINE> <DEDENT> def put(self, item, priority): <NEW_LINE> <INDENT> heapq.heappush(self.elements,(priority,item)) <NEW_LINE> <DEDEN... | Queue implementation using binary heaps | 62598edf442bda511e95aa2f |
class HelpHandler(object): <NEW_LINE> <INDENT> def __init__(self, dialog): <NEW_LINE> <INDENT> self.dialog = dialog <NEW_LINE> <DEDENT> def on_about_selected(self): <NEW_LINE> <INDENT> self.dialog.about_dialog('emesene', '2.0', 'marianoguerra', 'A simple yet powerful MSN & Gtalk client', 'GPL v3', 'http://www.emesene.o... | this handler contains all the handlers needed to handle the help
menu items | 62598edf498bea3a75a560fe |
class Square: <NEW_LINE> <INDENT> def __init__(self, size=0): <NEW_LINE> <INDENT> if type(size) != int: <NEW_LINE> <INDENT> raise TypeError("size must be an integer") <NEW_LINE> <DEDENT> elif size < 0: <NEW_LINE> <INDENT> raise ValueError("size must be >= 0") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.__size = ... | Square Class | 62598edf236d856c2adc86f7 |
class MainThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.events = [] <NEW_LINE> self._stop = False <NEW_LINE> self.eventWait = threading.Event() <NEW_LINE> self.name = "PIR" <NEW_LINE> print("Created new '{name}' thread".format(name ... | Template thread | 62598edf796e427e5384cd60 |
class IClusterPlugin(IPlugin): <NEW_LINE> <INDENT> def cluster_results(self, method_name, dist_matrix): <NEW_LINE> <INDENT> return [] | Plugins that cluster items given a distance matrix | 62598edf23849d37ff84f682 |
class MovingDataTests(TestCase): <NEW_LINE> <INDENT> @require_flocker_cli <NEW_LINE> @require_mongo <NEW_LINE> def test_moving_data(self): <NEW_LINE> <INDENT> getting_nodes = get_nodes(self, num_nodes=2) <NEW_LINE> volume_application = { u"version": 1, u"applications": { MONGO_APPLICATION: { u"image": MONGO_IMAGE, u"po... | Tests for movement of data across nodes. | 62598edff548e778e5969b5d |
class Space(object): <NEW_LINE> <INDENT> AXES = {'x' : [0], 'y': [1], 'z': [2], 'xy': [0,1], 'yz': [1,2], 'xz': [0,2], 'xyz': range(3), None: range(3)} <NEW_LINE> def __init__(self, axes=None, scale_factor=1.0, offset=0.0, periodic_boundaries=None): <NEW_LINE> <INDENT> self.periodic_boundaries = periodic_boundari... | Class representing a space within distances can be calculated. The space
is Cartesian, may be 1-, 2- or 3-dimensional, and may have periodic
boundaries in any of the dimensions.
Arguments:
axes:
if not supplied, then the 3D distance is calculated. If supplied,
axes should be a string containing the... | 62598edf30dc7b766599de4f |
class Account: <NEW_LINE> <INDENT> def __init__(self, filepath): <NEW_LINE> <INDENT> self.filepath = filepath <NEW_LINE> with open(filepath, 'r') as file: <NEW_LINE> <INDENT> self.balance = int(file.read()) <NEW_LINE> <DEDENT> <DEDENT> def withdraw(self, amount): <NEW_LINE> <INDENT> self.balance -= amount <NEW_LINE> <D... | This class is a generic account class | 62598ee0097d151d1a2bf5e7 |
class OdometryData(Ice.Object): <NEW_LINE> <INDENT> def __init__(self, odometry=None): <NEW_LINE> <INDENT> self.odometry = odometry <NEW_LINE> <DEDENT> def ice_ids(self, current=None): <NEW_LINE> <INDENT> return ('::Ice::Object', '::jderobot::OdometryData') <NEW_LINE> <DEDENT> def ice_id(self, current=None): <NEW_LINE>... | camera odometry | 62598ee0656771135c487c59 |
class PilotCommand(): <NEW_LINE> <INDENT> def __init__(self, limit_forward=6.0, limit_reverse=3.0): <NEW_LINE> <INDENT> self.reconfigure(limit_forward, limit_reverse) <NEW_LINE> self.pstate = PilotState() <NEW_LINE> self.car_ctl = CarDrive() <NEW_LINE> self.car_msg = CarDriveStamped() <NEW_LINE> self.pub = rospy.Publis... | ART pilot command interface. | 62598ee09b70327d1c57d383 |
class DropletApp(tkinter.Frame): <NEW_LINE> <INDENT> def __init__(self, master, width, height, font = None, printTraceback = False, patterns = None, exclPatterns = ".*", dirPatterns = None, exclDirPatterns = ".*", recursionDepth = None, processDirs = False, doneMsg = "Done", ): <NEW_LINE> <INDENT> tkinter.Frame.__init_... | Run an application as a droplet (an application onto which you drop files)
You must subclass this class and override processFile.
Your typical code will look like the example at the end. | 62598ee067a9b606de544597 |
class LogScale(ScaleBase): <NEW_LINE> <INDENT> name = 'log' <NEW_LINE> LogTransformBase = LogTransformBase <NEW_LINE> Log10Transform = Log10Transform <NEW_LINE> InvertedLog10Transform = InvertedLog10Transform <NEW_LINE> Log2Transform = Log2Transform <NEW_LINE> InvertedLog2Transform = InvertedLog2Transform <NEW_LINE> Na... | A standard logarithmic scale. Care is taken to only plot positive values. | 62598ee099cbb53fe682f47a |
class Projector( OTObject ): <NEW_LINE> <INDENT> def __init__( self , M , N , P , kernel ): <NEW_LINE> <INDENT> OTObject.__init__( self , M , N , P ) <NEW_LINE> self.kernel = kernel <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return ( 'Projector on an affine space.' ) <NEW_LINE> <DEDENT> def A(self, vec... | Default class for a projector on an affine space | 62598ee0baa26c4b54d4d899 |
class Memoize(): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> self._cache = {} <NEW_LINE> self._func = func <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> key = flexi_hash(args) + flexi_hash(kwargs) <NEW_LINE> if key not in self._cache: <NEW_LINE> <INDENT> self._cache[... | Function decorator
| 62598ee0e5267d203ee69ecc |
class APIExpandResultFailed(APIError): <NEW_LINE> <INDENT> pass | Raised when the :py:meth:`API.call_api_autoiter_ids` fails to expand an API
response while iterating over the split ID set. | 62598ee03d592f4c4edb94bd |
class getLinkedEntityByMemeTag(object): <NEW_LINE> <INDENT> def execute(self, params): <NEW_LINE> <INDENT> members = [] <NEW_LINE> try: <NEW_LINE> <INDENT> entity = entityRepository.getEntity(params[0]) <NEW_LINE> if entity.depricated != True: <NEW_LINE> <INDENT> entity.entityLock.acquire(True) <NEW_LINE> try: <NEW_LIN... | Three params: entity, tag, membership type = 0 | 62598ee0462c4b4f79db9fc2 |
class SortA: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> @timer <NEW_LINE> def sort(array: List[int]) -> str: <NEW_LINE> <INDENT> array.sort() <NEW_LINE> return '.sort()' | Class for sorting a list with .sort(). | 62598ee0adb09d7d5dc08b8f |
class Comicbook_Detail(Entidades.Init.Base): <NEW_LINE> <INDENT> __tablename__ = 'comicbooks_detail' <NEW_LINE> PAGE_TYPE_COMMON_PAGE = 0 <NEW_LINE> PAGE_TYPE_COVER = 1 <NEW_LINE> comicbook_id = Column(Integer, primary_key=True) <NEW_LINE> indicePagina = Column(Integer, default=0, primary_key=True) <NEW_LINE> ordenPagi... | Clase que va a mantener la info del archivo, cantidad de paginas, para cada imagen dentro del archivo asignarle
un numero y una tipificacion por ejemplo, pagina, tapa, contra tapa, etc | 62598ee0009cb60464cffb17 |
class SetNonUnicastIdentifyMixin(object): <NEW_LINE> <INDENT> REQUIRES = ['identify_state'] <NEW_LINE> def States(self): <NEW_LINE> <INDENT> return [ self.TurnOn, self.VerifyOn, self.TurnOff, self.VerifyOff, ] <NEW_LINE> <DEDENT> def NextState(self): <NEW_LINE> <INDENT> self._current_state += 1 <NEW_LINE> try: <NEW_LIN... | Sets the identify device state.
To avoid sending a broadcast identify on (which may strike all lamps in a
large rig), we instead turn identify on and then send a broadcast off. | 62598ee085dfad0860cbed4e |
class GetTopology(RestSdwan): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def all_device_id(self): <NEW_LINE> <INDENT> response = self.get_request('/device', 'json') <NEW_LINE> id_devices = list() <NEW_LINE> for data in response['dat... | Get topology from BSD session | 62598ee0d58c6744b42db59b |
class LaunchConfig(dict): <NEW_LINE> <INDENT> def __init__(self, base=None, custom={}): <NEW_LINE> <INDENT> defaults = { "confname": None, "username": None, "password": None, "gamepath": None, "serverid": None, "selected": None, "console": None, "winecmd": None, "wineflags": None, } <NEW_LINE> defaults.update(custom) <... | Holds the settings for a given launch configuration.
Takes another LaunchConfig as a base, so that we can have one "default"
account which sets the common things like where the game is installed,
then seperate sub-launches inheriting from that which store the
usernames & passwords. | 62598ee045492302aabfaa7c |
class TestReceiverInfo(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 testReceiverInfo(self): <NEW_LINE> <INDENT> pass | ReceiverInfo unit test stubs | 62598ee03617ad0b5ee046f7 |
class MinimaxAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> num_agents = gameState.getNumAgents() <NEW_LINE> def terminalTest(state, depth): <NEW_LINE> <INDENT> return state.isWin() or state.isLose() or depth == 0 <NEW_LINE> <DEDENT> def minimaxDecision(state): <NE... | Your minimax agent (question 2) | 62598ee0f7d966606f7465b9 |
@python_2_unicode_compatible <NEW_LINE> class Category(MPTTModel): <NEW_LINE> <INDENT> title = models.CharField(_(u'title'), max_length=100) <NEW_LINE> slug = models.SlugField(_(u'slug'), max_length=60, unique=True) <NEW_LINE> parent = TreeForeignKey( 'self', null=True, blank=True, related_name='children', verbose_name... | The model of page category | 62598ee091af0d3eaad383e1 |
class RazerBlackWidowChromaV2(_RippleKeyboard): <NEW_LINE> <INDENT> EVENT_FILE_REGEX = re.compile(r'.*BlackWidow_Chroma_V2(-if01)?-event-kbd') <NEW_LINE> USB_VID = 0x1532 <NEW_LINE> USB_PID = 0x0221 <NEW_LINE> HAS_MATRIX = True <NEW_LINE> DEDICATED_MACRO_KEYS = True <NEW_LINE> MATRIX_DIMS = [6, 22] <NEW_LINE> METHODS =... | Class for the BlackWidow Chroma V2 | 62598ee0435de62698e9a39f |
class AmbariClient(RestResource): <NEW_LINE> <INDENT> def __init__(self, host_name, port=None,user_name="admin", password="admin", version=API_VERSION , client = None): <NEW_LINE> <INDENT> self._version = version <NEW_LINE> protocol = "http" <NEW_LINE> if port is None: <NEW_LINE> <INDENT> port = 8080 <NEW_LINE> <DEDENT... | AmbariClient top-level root resources. | 62598ee08da39b475be01773 |
class KeywordPromotion(LinkedPromotion): <NEW_LINE> <INDENT> keyword = models.CharField(_("Keyword"), max_length=200) <NEW_LINE> filter = models.CharField(_("Filter"), max_length=200, blank=True, null=True) <NEW_LINE> def get_link(self): <NEW_LINE> <INDENT> return reverse('promotions:keyword-click', kwargs={'keyword_pr... | A promotion linked to a specific keyword.
This can be used on a search results page to show promotions
linked to a particular keyword. | 62598ee01f037a2d8b9e26cf |
class OEDCommand(qmk.Command): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._name = 'oed' <NEW_LINE> self._help = self.__doc__ <NEW_LINE> self.__baseURL = ( 'http://www.oxforddictionaries.com/search/english/?q=%s') <NEW_LINE> <DEDENT> @qmk.Command.actionRequiresArgument <NEW_LINE> def action(self, a... | Look up the given argument using Oxford's dictionary search. A new tab
will be opened with the results. | 62598ee0442bda511e95aa31 |
class StudentScholarForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = StudentScholar <NEW_LINE> fields = ('scholarship',) | Form definition for StudentScholar. | 62598ee0eab8aa0e5d30a341 |
class Container(object): <NEW_LINE> <INDENT> __slots__ = ["data", "namespaces"] <NEW_LINE> @classmethod <NEW_LINE> def new_instance(type, frum, schema=None): <NEW_LINE> <INDENT> if not type2container: <NEW_LINE> <INDENT> _delayed_imports() <NEW_LINE> <DEDENT> if isinstance(frum, Container): <NEW_LINE> <INDENT> return f... | Containers are data storage capable of handing queries on that storage | 62598ee029b78933be2693b4 |
class GPFSDeviceInfo(DeviceInfo): <NEW_LINE> <INDENT> implements(INetGPFSDeviceInfo) <NEW_LINE> disk_count = ProxyProperty('disk_count') | Defines API access for this datasource. | 62598ee04a966d76dd5ed4ad |
class TestEventsApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = clever.apis.events_api.EventsApi() <NEW_LINE> self.api.api_client.configuration.access_token = 'TEST_TOKEN' <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_get_event(... | EventsApi unit test stubs | 62598ee097e22403b38394b9 |
class BasePipeline(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> RESOURCE_NAME = None <NEW_LINE> MYSQL_DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S' <NEW_LINE> def __init__(self, cycle_timestamp, global_configs, api_client, dao): <NEW_LINE> <INDENT> self.cycle_timestamp = cycle_timestamp <NEW_LINE> self.g... | Base client for a specified GCP API and credentials. | 62598ee02c8b7c6e89bd1d89 |
class UseResultOfTask(LogEntry): <NEW_LINE> <INDENT> pass | The result of a task was reused. | 62598ee04e4d5625663709e3 |
class DynamicConstraint(Constraint): <NEW_LINE> <INDENT> pass | Dynamic constraint. | 62598ee07b25080760ed5a64 |
class Origin(models.Model): <NEW_LINE> <INDENT> country = models.ForeignKey(Country, null=True, blank=True, on_delete=models.SET_NULL) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name | Defines an origin for an ingredient (I.e. Where the ingredient came from) | 62598ee067a9b606de544599 |
class DarwinDeadProcesses(common.DarwinPlugin): <NEW_LINE> <INDENT> __name = "dead_procs" <NEW_LINE> def render(self, renderer): <NEW_LINE> <INDENT> proc_zone = self.session.entities.find_first( "AllocationZone/name is 'proc'")["Struct/base"] <NEW_LINE> procs = [] <NEW_LINE> for allocation in proc_zone.free_elements.wa... | Show deallocated processes which still exist in the zone allocator. | 62598ee0d268445f26638e73 |
class FluxConfigOperationStatusOperations: <NEW_LINE> <INDENT> models = _models <NEW_LINE> def __init__(self, client, config, serializer, deserializer) -> None: <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self._config = config ... | FluxConfigOperationStatusOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.kubernetesconfig... | 62598ee09c8ee8231303f43d |
class PluginRegistryTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> o = Organizer.objects.create(name='Dummy', slug='dummy') <NEW_LINE> self.event = Event.objects.create( organizer=o, name='Dummy', slug='dummy', date_from=now(), ) <NEW_LINE> <DEDENT> def test_plugin_names(self): <NEW_LINE> <IND... | This test case performs tests for the plugin registry. | 62598ee01b99ca400228e7f2 |
class BaseIpblockAttrName(n.Netdot): <NEW_LINE> <INDENT> resource = 'IpblockAttrName/' <NEW_LINE> id_field = 'id' <NEW_LINE> _fields = [ f.StringField('info', display_name='Comments'), f.StringField('name', display_name='Name'), ] <NEW_LINE> _views = {'all': ['name', 'info'], 'brief': ['name']} <NEW_LINE> @property <NE... | An Ipblock Attributes Name
Attributes:
info:
name:
attributes: List of IpblockAttr objects | 62598ee099cbb53fe682f47d |
class EditorApi(object): <NEW_LINE> <INDENT> def __init__(self, api_client=None): <NEW_LINE> <INDENT> if api_client is None: <NEW_LINE> <INDENT> api_client = ApiClient() <NEW_LINE> <DEDENT> self.api_client = api_client <NEW_LINE> <DEDENT> def editor_api_router_get_token(self, x_account_api_key, **kwargs): <NEW_LINE> <I... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen | 62598ee0e1aae11d1e7cdb24 |
class AddrMapMdl(gtk.ListStore): <NEW_LINE> <INDENT> (NAME_COL, BASE_COL, FIXED_COL, UVM_COL, WIDTH_COL, ACCESS_COL) = range(6) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> gtk.ListStore.__init__(self, str, str, bool, bool, str, str) <NEW_LINE> <DEDENT> def new_instance(self): <NEW_LINE> <INDENT> node = self.appe... | Provides the list of instances for the module. Instances consist of the
symbolic ID name and the base address. | 62598ee010dbd63aa1c6f13c |
class IExample(ibc.Iface): <NEW_LINE> <INDENT> @decorators.property <NEW_LINE> def value(self): <NEW_LINE> <INDENT> return None | Example interface. | 62598ee085dfad0860cbed4f |
class InternalServerError(HttpServerError): <NEW_LINE> <INDENT> http_status = 500 <NEW_LINE> message = "Internal Server Error" | HTTP 500 - Internal Server Error.
A generic error message, given when no more specific message is suitable. | 62598ee0851cf427c66b689c |
class CustomerSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Customer <NEW_LINE> fields = ['id','user','name','phone', 'created_at'] | Serializer for the Customer model. | 62598ee0a05bb46b38488e49 |
class Mode(Enum): <NEW_LINE> <INDENT> LOAD = 0x0 <NEW_LINE> RESET = 0x10 <NEW_LINE> PAUSE = 0x08 <NEW_LINE> RUN = 0x18 <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name | Current machine mode. | 62598ee016aa5153ce3feac7 |
class ReferendumSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> url = serializers.CharField(source='get_absolute_url', read_only=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Referendum | Serializaer for Referendum Model | 62598ee0a79ad161977685e8 |
class Link(html._Renderable): <NEW_LINE> <INDENT> def __init__(self, destination): <NEW_LINE> <INDENT> html._Renderable.__init__(self) <NEW_LINE> self.destination = destination <NEW_LINE> <DEDENT> def __call__(self, valobj=None, **kwargs): <NEW_LINE> <INDENT> return html._Renderable.__call__(self, valobj, **kwargs) <NE... | A standard href link. | 62598ee0236d856c2adc86f9 |
class StudentProfile(models.Model): <NEW_LINE> <INDENT> lecture_class = models.ForeignKey(Profession, null=True, blank=True, verbose_name=_('Lecture Class')) <NEW_LINE> period = models.CharField(_('Student Class Period'), max_length=255, null=True, blank=True) <NEW_LINE> class_duration = models.CharField(_('Student Cla... | This class represents the student profile | 62598ee0435de62698e9a3a2 |
class CV2Process: <NEW_LINE> <INDENT> def __init__(self, path='./datasets/test_pdf_imgs/*.png', min_acontourAre=50000): <NEW_LINE> <INDENT> self.min_acontourAre = min_acontourAre <NEW_LINE> self.im_paths = glob.glob(path) <NEW_LINE> self.croped_images = {} <NEW_LINE> <DEDENT> def gen_crop_images(self): <NEW_LINE> <INDE... | 将单页的 pdf 图片进行处理,并从中提取出蛇类的图片 | 62598ee0596a89723612622b |
class TURN(enum.Enum): <NEW_LINE> <INDENT> SAME = None <NEW_LINE> TOGGLE = '' <NEW_LINE> FACEUP = True <NEW_LINE> FACEDOWN = False | Cards facing. | 62598ee04428ac0f6e656b1e |
class DisciplineGroup(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=60, blank=False, null=False, verbose_name="Cluster Name", help_text='An arbitrary "name" for this cluster of cases') <NEW_LINE> offering = models.ForeignKey(CourseOffering, help_text="The course this cluster is associated with")... | A set of discipline cases that are related. | 62598ee097e22403b38394bb |
class CaptchaCount: <NEW_LINE> <INDENT> count: int = 0 | Class to count captchas to prevent duplicates in the captchas dictionary. | 62598ee06e29344779afebfa |
class UserSpawnHandler(BaseHandler): <NEW_LINE> <INDENT> @gen.coroutine <NEW_LINE> def get(self, name): <NEW_LINE> <INDENT> current_user = self.get_current_user() <NEW_LINE> if current_user and current_user.name == name: <NEW_LINE> <INDENT> if current_user.spawner: <NEW_LINE> <INDENT> if current_user.spawn_pending: <NE... | Requests to /user/name handled by the Hub
should result in spawning the single-user server and
being redirected to the original. | 62598ee08e7ae83300ee765b |
class HansStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.GetMembership = channel.unary_unary( '/Hans/GetMembership', request_serializer=protobufs_dot_messages_dot_hans__pb2.GetMembershipReq.SerializeToString, response_deserializer=protobufs_dot_messages_dot_hans__pb2.GetMembersh... | Hans talks directly to Mailman.
| 62598ee02eb69b55b15a066f |
class TileSet(dict): <NEW_LINE> <INDENT> def __init__(self, id, properties): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.properties = properties <NEW_LINE> <DEDENT> tile_id = 0 <NEW_LINE> @classmethod <NEW_LINE> def generate_id(cls): <NEW_LINE> <INDENT> cls.tile_id += 1 <NEW_LINE> return str(cls.tile_id) <NEW_LINE... | Contains a set of Tile objects referenced by some id.
| 62598ee067a9b606de54459a |
class WorkersStrategy(object): <NEW_LINE> <INDENT> def __init__(self, conf, logger): <NEW_LINE> <INDENT> self.conf = conf <NEW_LINE> self.logger = logger <NEW_LINE> self.sock = None <NEW_LINE> self.children = [] <NEW_LINE> self.worker_count = config_auto_int_value(conf.get('workers'), CPU_COUNT) <NEW_LINE> <DEDENT> def... | WSGI server management strategy object for a single bind port and listen
socket shared by a configured number of forked-off workers.
Used in :py:func:`run_wsgi`.
:param dict conf: Server configuration dictionary.
:param logger: The server's :py:class:`~swift.common.utils.LogAdaptor`
object. | 62598ee0097d151d1a2bf5eb |
class Role(Base): <NEW_LINE> <INDENT> __tablename__ = 'role' <NEW_LINE> id = Column(Integer, primary_key=True,autoincrement=True) <NEW_LINE> title = Column(String(32)) <NEW_LINE> users = relationship('User',secondary='user2role',backref='user_roles',passive_deletes=True) <NEW_LINE> permission = relationship('Permission... | 角色表 | 62598ee032920d7e50bc45fa |
class ArgMin: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.result = [] <NEW_LINE> <DEDENT> def step(self, arg, value, limit): <NEW_LINE> <INDENT> if limit is not None and limit <= 0: <NEW_LINE> <INDENT> raise Exception('ArgMin\'s limit must be positive.') <NEW_LINE> <DEDENT> if len(self.result) > 0:... | ArgMin user defined aggregate function. | 62598ee063b5f9789fe8373d |
class DataclassMetricMixin: <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def update(self, example: Example, pred: Prediction) -> None: <NEW_LINE> <INDENT> ... | Mixin for :class`tm.Metric` subclasses that implement :func:`update` using
:class:`Prediction` and :class:`Example` dataclasses as input | 62598ee067a9b606de54459b |
class FloatEntry (_NumEntry): <NEW_LINE> <INDENT> def __init__ (self, master, minValue = None, maxValue = None, defValue = None, defFormat = "%.2f", allowExp = 0, **kargs): <NEW_LINE> <INDENT> self.allowExp = allowExp <NEW_LINE> kargs.setdefault("justify", "right") <NEW_LINE> _NumEntry.__init__(self, master = master, m... | A widget for entering floating point numbers with validity and range checking.
Inputs:
- master master Tk widget -- typically a frame or window
- minValue minimum acceptable value, as a numer or formatted string
- maxValue maximum acceptable value, as a numer or formatted string
- defFormat default format used wh... | 62598ee01b99ca400228e7f3 |
class InvenioOaiHarvestWebTest(InvenioWebTestCase): <NEW_LINE> <INDENT> def test_insert_oai_source(self): <NEW_LINE> <INDENT> self.browser.get(CFG_SITE_SECURE_URL) <NEW_LINE> self.login(username="admin", password="") <NEW_LINE> self.find_element_by_link_text_with_timeout("Administration") <NEW_LINE> self.browser.find_e... | OaiHarvest web tests. | 62598ee02c8b7c6e89bd1d8c |
class _sensitive_item_formats(Enum): <NEW_LINE> <INDENT> cisco_type7 = 1 <NEW_LINE> numeric = 2 <NEW_LINE> hexadecimal = 3 <NEW_LINE> md5 = 4 <NEW_LINE> text = 5 <NEW_LINE> sha512 = 6 <NEW_LINE> juniper_type9 = 7 | Enum for recognized sensitive item formats (e.g. type7, md5, text). | 62598ee076e4537e8c3edb84 |
class ICMP(dpkt.Packet): <NEW_LINE> <INDENT> __hdr__ = ( ('type', 'B', 8), ('code', 'B', 0), ('sum', 'H', 0) ) <NEW_LINE> class Echo(dpkt.Packet): <NEW_LINE> <INDENT> __hdr__ = (('id', 'H', 0), ('seq', 'H', 0)) <NEW_LINE> <DEDENT> class Quote(dpkt.Packet): <NEW_LINE> <INDENT> __hdr__ = (('pad', 'I', 0),) <NEW_LINE> def... | Internet Control Message Protocol.
TODO: Longer class information....
Attributes:
__hdr__: Header fields of ICMP.
TODO. | 62598ee08c0ade5d55dc296a |
class Constant(MeanFunction): <NEW_LINE> <INDENT> def __init__(self, c=np.zeros(1)): <NEW_LINE> <INDENT> MeanFunction.__init__(self) <NEW_LINE> self.c = Param(c) <NEW_LINE> <DEDENT> def __call__(self, X): <NEW_LINE> <INDENT> shape = tf.pack([tf.shape(X)[0], 1]) <NEW_LINE> return tf.tile(tf.reshape(self.c, (1, -1)), sha... | y_i = c,, | 62598ee0a8370b77170ee9b8 |
class Config(object): <NEW_LINE> <INDENT> batch_size = 100 <NEW_LINE> embed_size = 80 <NEW_LINE> hidden_size = 80 <NEW_LINE> answer_size = 150 <NEW_LINE> max_epochs = 200 <NEW_LINE> early_stopping = 20 <NEW_LINE> dropout = 0.9 <NEW_LINE> lr = 0.001 <NEW_LINE> l2 = 0.001 <NEW_LINE> cap_grads = False <NEW_LINE> max_grad_... | Holds model hyperparams and data information. | 62598ee0851cf427c66b689e |
class PolicyBody(Sequence): <NEW_LINE> <INDENT> def __init__(self, json, variables=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> d = loads(strip_comments(Template(json).substitute(variables))) <NEW_LINE> <DEDENT> except JSONDecodeError as e: <NEW_LINE> <INDENT> raise PolicyBodyException(lineno=e.lineno, colno=e.c... | A policy body is just a sequence of clauses, possibly with a name.
Conversion to and from JSON representations (with
canonicalisation), and hash generation from the canonical
representation.
Can be composed into permission sets, so for convenience allow for
iteration over individual (action, object) pairs (note that e... | 62598ee0460517430c430a56 |
class Divide(StatelessLayer): <NEW_LINE> <INDENT> def __init__(self, impute=0): <NEW_LINE> <INDENT> super().__init__(impute=impute) <NEW_LINE> <DEDENT> def transform(self, X1, X2): <NEW_LINE> <INDENT> impute_array = np.ones_like(X1) * self.kwargs['impute'] <NEW_LINE> return np.divide(X1.astype(np.float16), X2, out=impu... | Divide given array by another given array element-wise.
Parameters
----------
impute : int/float or None
the value to impute when encountering a divide by zero. | 62598ee024f1403a92684b8b |
class Money(__BaseDictObject): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> super().__init__(data) <NEW_LINE> if "currencyCode" in data: <NEW_LINE> <INDENT> self.currencyCode: str = self._get_value(str, "currencyCode") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.currencyCode: str = None <NEW... | An amount of money, including units in the form of currency. | 62598ee04527f215b58e84d2 |
class Person: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name | Trivial Person class.
| 62598ee030bbd72246468205 |
class ListFollowersResultSet(ResultSet): <NEW_LINE> <INDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) | Retrieve the value for the "Response" output from this choreography execution. (The response from Foursquare. Corresponds to the ResponseFormat input. Defaults to JSON.) | 62598ee038b623060ffa7662 |
class FloatInput(NumericInput): <NEW_LINE> <INDENT> jsClass = u'Methanal.View.FloatInput' <NEW_LINE> def __init__(self, minimumValue=NumericInput.NO_BOUNDS, maximumValue=NumericInput.NO_BOUNDS, **kw): <NEW_LINE> <INDENT> super(FloatInput, self).__init__( minimumValue=minimumValue, maximumValue=maximumValue, **kw) <NEW_... | Float input. | 62598ee07cff6e4e811b3fbb |
class PrivateIngredientsApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self) -> None: <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> self.user = get_user_model().objects.create_user( 'test@test.com', 'testpass' ) <NEW_LINE> self.client.force_authenticate(self.user) <NEW_LINE> <DEDENT> def test_retrieve_ing... | Test the private ingredient api | 62598ee0435de62698e9a3a3 |
class ExpressionType(Type): <NEW_LINE> <INDENT> def __init__(self, op, exprs): <NEW_LINE> <INDENT> super(ExpressionType, self).__init__(op=op, exprs=exprs) <NEW_LINE> <DEDENT> def iscombined(self): <NEW_LINE> <INDENT> return any(expr.iscombined() for expr in self.exprs) <NEW_LINE> <DEDENT> def generate(self, ctx): <NEW... | Result type of an operator call. | 62598ee04f6381625f1987a3 |
class AddonFeedMixin(object): <NEW_LINE> <INDENT> def item_link(self, addon): <NEW_LINE> <INDENT> return absolutify(reverse('addons.detail', args=[addon.slug])) <NEW_LINE> <DEDENT> def item_title(self, addon): <NEW_LINE> <INDENT> version = '' <NEW_LINE> if addon.current_version: <NEW_LINE> <INDENT> version = u' %s' % a... | Common pieces for add-ons in a feed. | 62598ee091af0d3eaad383e5 |
class Units(RMGObject): <NEW_LINE> <INDENT> conversionFactors = {'cm^-1': 1.0} <NEW_LINE> def __init__(self, units=''): <NEW_LINE> <INDENT> if units in NOT_IMPLEMENTED_UNITS: <NEW_LINE> <INDENT> raise NotImplementedError( 'The units {} are not yet supported. Please choose SI units.'.format(units) ) <NEW_LINE> <DEDENT> ... | The :class:`Units` class provides a representation of the units of a
physical quantity. The attributes are:
=================== ========================================================
Attribute Description
=================== ========================================================
`units` A str... | 62598ee0dd821e528d6d7514 |
@python_2_unicode_compatible <NEW_LINE> class Diff(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_storage(cls, diff_str, timestamp=None): <NEW_LINE> <INDENT> diff = json.loads(diff_str.decode('utf-8')) <NEW_LINE> return cls(diff['data'], diff['created'], timestamp) <NEW_LINE> <DEDENT> def __init__(self, ... | Model class that represents a single change to a model | 62598ee0a79ad161977685ea |
class Thermal(Subsystem): <NEW_LINE> <INDENT> pass | Thermal subsystem class. | 62598ee001c39578d7f11375 |
class Grayscale(object): <NEW_LINE> <INDENT> def __init__(self, num_output_channels=1): <NEW_LINE> <INDENT> self.num_output_channels = num_output_channels <NEW_LINE> <DEDENT> def __call__(self, img): <NEW_LINE> <INDENT> return to_grayscale(img, num_output_channels=self.num_output_channels) | Convert image to grayscale.
Args:
num_output_channels (int): (1 or 3) number of channels desired for output image
Returns:
PIL Image: Grayscale version of the input.
- If num_output_channels == 1 : returned image is single channel
- If num_output_channels == 3 : returned image is 3 channel with r == g =... | 62598ee0eab8aa0e5d30a345 |
class Command(BaseCommand): <NEW_LINE> <INDENT> def add_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument( "index_name", help="") <NEW_LINE> parser.add_argument( "--role-back", dest="role_back", default=False, action="store_true", help="role back a single migration.") <NEW_LINE> parser.add_argument( "--m... | here we will handle the clients request to migrate an index
| 62598ee02ae34c7f260a96b5 |
class Player(object): <NEW_LINE> <INDENT> IN_GAME_ATTRS = set(['bat_order', 'current_position', 'game_position']) <NEW_LINE> PITCHER_ATTRS = set(['era', 'losses', 'wins']) <NEW_LINE> COMMON_ATTRS = set([ 'avg', 'bats', 'boxname', 'first', 'hr', 'id', 'last', 'num', 'parent_team_abbrev', 'parent_team_id', 'position', 'r... | Store player data. | 62598ee0627d3e7fe0e05455 |
@ns_moodle.route("/moodle/x5plgn/freacs") <NEW_LINE> class X5plgnfreacsMoodle(Resource): <NEW_LINE> <INDENT> @ns_moodle.expect(input_def, validate=True) <NEW_LINE> def post(self): <NEW_LINE> <INDENT> return {"output": store_mdl_group_data(request.json)} <NEW_LINE> <DEDENT> @ns_moodle.errorhandler <NEW_LINE> def default... | This is a test | 62598ee0b7558d5895461c1a |
class WatchDog(object): <NEW_LINE> <INDENT> def __init__(self, timeout=os.environ.get( "TF_CLUSTER_COORDINATOR_WATCH_DOG_TIMEOUT", -1), traceback_file=sys.stdout, on_triggered=None): <NEW_LINE> <INDENT> self._timeout = timeout <NEW_LINE> self._last_activity_time = time.time() <NEW_LINE> self._traceback_file = traceback... | A class to dump stack traces if no activity happens in ClusterCoordinator. | 62598ee092d797404e387e62 |
class Permanent(Percolation): <NEW_LINE> <INDENT> def __init__(self, edges): <NEW_LINE> <INDENT> if not len(edges): <NEW_LINE> <INDENT> raise ValueError("there must be at least one percolation") <NEW_LINE> <DEDENT> if min(edges) < 0: <NEW_LINE> <INDENT> raise ValueError("edge numbers must be positive") <NEW_LINE> <DEDE... | Class for generating permanent mesh percolations. | 62598ee01f5feb6acb16121f |
class CipherSuite(object): <NEW_LINE> <INDENT> def __init__(self, code, name, kx, auth, encoding, mac): <NEW_LINE> <INDENT> self.code = code <NEW_LINE> self.name = name <NEW_LINE> self.kx = kx <NEW_LINE> self.auth = auth <NEW_LINE> self.encoding = encoding <NEW_LINE> self.mac = mac <NEW_LINE> <DEDENT> def __repr__(self... | Encapsulates a cipher suite.
Members/args:
* code: two-byte ID code, as int
* name: as in 'TLS_RSA_WITH_RC4_40_MD5'
* kx: key exchange algorithm, string
* auth: authentication algorithm, string
* encoding: encoding algorithm
* mac: message authentication code algorithm | 62598ee0097d151d1a2bf5ed |
class ModifyClusterAsGroupAttributeResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.RequestId = params.get("RequestId") | ModifyClusterAsGroupAttribute response structure.
| 62598ee09b70327d1c57d389 |
class FamilyModule(MainModule): <NEW_LINE> <INDENT> def __init__(self, server="127.0.0.1", server_port=5000, base_uri='/api/1.0/'): <NEW_LINE> <INDENT> super(FamilyModule, self).__init__(server, server_port, base_uri) <NEW_LINE> <DEDENT> def create_family(self, name, parent=None, tlp_level=3): <NEW_LINE> <INDENT> self.... | Utilities to manage families | 62598ee0a79ad161977685eb |
class WebServer: <NEW_LINE> <INDENT> def __init__(self, port, host=''): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> self.port = port <NEW_LINE> self.paused = False <NEW_LINE> self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) <NEW_LINE> self.actions = [] <NEW_LINE> self.info = [] <NEW_LINE> <DEDENT> d... | Our Webserver engine which has some features like starting and registering actions on it. | 62598ee067a9b606de54459d |
class AbstractRagAsawari(AbstractScale): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.type = 'Abstract Rag Asawari' <NEW_LINE> self.octaveDuplicating = True <NEW_LINE> self.dominantDegree: int = -1 <NEW_LINE> self.buildNetwork() <NEW_LINE> <DEDENT> def buildNetwork(self... | A pseudo raga-scale. | 62598ee063b5f9789fe8373f |
class AbstractBaseTransation(models.Model): <NEW_LINE> <INDENT> from_user = models.ForeignKey(User,on_delete = models.PROTECT,related_name = "from_user") <NEW_LINE> to_user = models.ForeignKey(User,on_delete = models.PROTECT,related_name = "to_user") <NEW_LINE> amount = models.DecimalField(max_digits = 7, decimal_place... | Every unit of Transation | 62598ee0d268445f26638e75 |
class TemporalMemoryShim(TPClass): <NEW_LINE> <INDENT> def __init__(self, columnDimensions=(2048,), cellsPerColumn=32, activationThreshold=13, initialPermanence=0.21, connectedPermanence=0.50, minThreshold=10, maxNewSynapseCount=20, permanenceIncrement=0.10, permanenceDecrement=0.10, seed=42): <NEW_LINE> <INDENT> numbe... | Temporal Memory => TP shim class. | 62598ee0d6c5a102081e06ff |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.