code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Namespace(typing.NamedTuple): <NEW_LINE> <INDENT> images: typing.List[str] <NEW_LINE> selections: typing.List[typing.Tuple[str, str, str, str]] <NEW_LINE> cutelog_integration: bool <NEW_LINE> verbose: bool | Mocks the namespace generated by the ArgumentParser. Used for type checking | 62598ee32ae34c7f260a9712 |
class DailyMethod(DateMethod): <NEW_LINE> <INDENT> def ignore_date(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def get_plot(self, max_points_x=None): <NEW_LINE> <INDENT> result = [] <NEW_LINE> for each_method in self.method_data_all: <NEW_LINE> <INDENT> if each_method.time_start is None or each_method.ti... | The daily time-based method is similar to the time/date method, however it will repeat every day.
Therefore, it is essential that only the span of one day be set in this method.
The implementation is derived from DateMethod, as the calculation is essentially the same ignoring the date part. | 62598ee3baa26c4b54d4d8f9 |
class SafeTerminator(): <NEW_LINE> <INDENT> def __init__(self, logger, *axes): <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> self.axes = axes <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __exit__(self, exc_type, exc_val, exc_tb): <NEW_LINE> <INDENT> self.logger.debug('... | Context that can be used in a "with" statement to facilitate safe shutdown
of the test rig when the test ends (succeeds or fails). | 62598ee3a8370b77170eea0e |
class SocketReadException(DragonflowException): <NEW_LINE> <INDENT> message = _('Exception happened when read data from socket') | An exception for cases when read data from socket. | 62598ee330bbd72246468263 |
@total_ordering <NEW_LINE> class CustomComplex(complex): <NEW_LINE> <INDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return abs(self) == abs(other) and self.real == other.real and self.imag == other.imag <NEW_LINE> <DEDENT> def __lt__(self, other): <NEW_LINE> <INDENT> return abs(self)... | Wrapper class for complex type.
Implements various comparative operators (==, <, <=, >, >=) in order for
complex numbers to be compared and ordered.
Extends built-in complex type. | 62598ee33317a56b869bd87c |
class SyncGroupSchemaTable(Model): <NEW_LINE> <INDENT> _attribute_map = { 'columns': {'key': 'columns', 'type': '[SyncGroupSchemaTableColumn]'}, 'quoted_name': {'key': 'quotedName', 'type': 'str'}, } <NEW_LINE> def __init__(self, columns=None, quoted_name=None): <NEW_LINE> <INDENT> super(SyncGroupSchemaTable, self).__i... | Properties of table in sync group schema.
:param columns: List of columns in sync group schema.
:type columns: list[~azure.mgmt.sql.models.SyncGroupSchemaTableColumn]
:param quoted_name: Quoted name of sync group schema table.
:type quoted_name: str | 62598ee37d847024c075a9f9 |
class DocManager(DocManagerBase): <NEW_LINE> <INDENT> def __init__(self, url, unique_id='_id', **kwargs): <NEW_LINE> <INDENT> self.kafkaprod = KafkaProducer(client_id='mongotokafka-producer-mconnect', bootstrap_servers=[url]) <NEW_LINE> print("__init__ ran") <NEW_LINE> print(str(self.kafkaprod.config)) <NEW_LINE> self.... | Kafka implementation of the DocManager interface.
Receives documents from an OplogThread and takes the appropriate actions
to send to Kafka | 62598ee3ac7a0e7691f70b40 |
class LearningAgent(Agent): <NEW_LINE> <INDENT> def __init__(self, env, learning=False, epsilon=1.0, alpha=0.5): <NEW_LINE> <INDENT> super(LearningAgent, self).__init__(env) <NEW_LINE> self.planner = RoutePlanner(self.env, self) <NEW_LINE> self.valid_actions = self.env.valid_actions <NEW_LINE> self.learning = learning ... | An agent that learns to drive in the Smartcab world.
This is the object you will be modifying. | 62598ee30c0af96317c549c8 |
class LabelBoldFontAction(LabelAction): <NEW_LINE> <INDENT> name = Unicode("&Bold font") <NEW_LINE> def perform(self, event): <NEW_LINE> <INDENT> self.obj.style = 'bold' | The LabelNormalFontAction class is a action that sets a bold font for a
label's text. | 62598ee399cbb53fe682f4db |
class SubprocessAdapter(PanelAdapter, LogMixin): <NEW_LINE> <INDENT> def __init__(self, proc: List[str]) -> None: <NEW_LINE> <INDENT> self._proc_args = proc <NEW_LINE> <DEDENT> def _create_proc(self) -> Coroutine[Any, Any, asyncio.subprocess.Process]: <NEW_LINE> <INDENT> return asyncio.create_subprocess_exec(*self._pro... | A PanelAdapter that sends newline terminated lines to the stdin
of a process | 62598ee3d7e4931a7ef3a6c8 |
class UnexpectedJobState(RecoverableError, ValueError): <NEW_LINE> <INDENT> pass | Raised when a job state is gotten from the execution code, that
does not match what GC3Pie expects for the task.
Typically this is a synchronization issue (different parts of a
system update at different times), hence this error is marked as
"recoverable".
For instance, a task might be ``TERMINATED`` according to GC3... | 62598ee33eb6a72ae0388c6d |
class NetAppDirectNfsDriver (NetAppNFSDriver): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(NetAppDirectNfsDriver, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def do_setup(self, context): <NEW_LINE> <INDENT> self._context = context <NEW_LINE> self.check_for_setup_error() <N... | Executes commands related to volumes on NetApp filer | 62598ee30a50d4780f7039d5 |
class Context(object): <NEW_LINE> <INDENT> def setClock(self, hour): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def changeState(self, state): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def callSecurityCenter(self, msg): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LIN... | 负责管理状态和联系报警中心的接口 | 62598ee360cbc95b06362967 |
class ApproachDoorStateMachine(smach.StateMachine): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> smach.StateMachine.__init__(self, [succeeded, preempted, aborted]) <NEW_LINE> with self: <NEW_LINE> <INDENT> def door_goal_cb(userdata, old_goal): <NEW_LINE> <INDENT> door_goal = DoorDetectorGoal() <NEW_LINE>... | Gets the robot in front of the door handle.
Required parameters:
No parameters.
Optional parameters:
No optional parameters.
No input keys.
No output keys.
No io_keys.
Robot should be positioned in front of the door handle after this state. | 62598ee3462c4b4f79dba024 |
class UIDFetchItem(FetchItem): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> name = rb'UID' <NEW_LINE> @staticmethod <NEW_LINE> def build(atom_data, value) -> Any: <NEW_LINE> <INDENT> return value | UID
The unique identifier for the message. | 62598ee356ac1b37e6300817 |
class ValueListItem(models.Model): <NEW_LINE> <INDENT> group = models.ForeignKey(ValueList,verbose_name=_("list group"), on_delete=models.CASCADE) <NEW_LINE> group_code = models.CharField(max_length=const.DB_CHAR_CODE_6,blank=True,null=True) <NEW_LINE> code = models.CharField(_("item code"),max_length=const.DB_CHAR_COD... | 值列表项 | 62598ee356ac1b37e6300818 |
class CMDBDialog: <NEW_LINE> <INDENT> def __init__(self, category_const, field_name): <NEW_LINE> <INDENT> self.category = category_const <NEW_LINE> self.field = field_name <NEW_LINE> self.dialog_values = list() <NEW_LINE> self._load() <NEW_LINE> <DEDENT> def _load(self): <NEW_LINE> <INDENT> result = request('cmdb.dialo... | Representation of a dialog value set. | 62598ee3cc0a2c111447962e |
class FilePropertiesService(DocService): <NEW_LINE> <INDENT> PROPERTIES_ID = wx.NewIdRef() <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._customEventHandlers = [] <NEW_LINE> <DEDENT> def InstallControls(self, frame, menuBar=None, toolBar=None, statusBar=None, document=None): <NEW_LINE> <INDENT> fileMenu = men... | Service that installs under the File menu to show the properties of the file associated
with the current document. | 62598ee3090684286d5929f5 |
class SnifferError(Exception): <NEW_LINE> <INDENT> pass | This is the Exception class defined for all errors generated by
Sniffer-related modules. | 62598ee345492302aabfaad8 |
class VarianceDecompositionSoftKronecker_test(unittest.TestCase): <NEW_LINE> <INDENT> def genGeno(self): <NEW_LINE> <INDENT> X = (SP.rand(self.N,self.S)<0.2)*1. <NEW_LINE> self.D['X'] = X <NEW_LINE> <DEDENT> def genPheno(self): <NEW_LINE> <INDENT> dp = SP.ones(self.P); dp[1]=-1 <NEW_LINE> Y = SP.zeros((self.N,self.P))... | test class for VarianceDecomposition
THis testing class assumes tests the ability to | 62598ee3cb5e8a47e493b48f |
class SSHCloud(IpaCloud): <NEW_LINE> <INDENT> cloud = 'ssh' <NEW_LINE> def post_init(self): <NEW_LINE> <INDENT> self.cleanup = False <NEW_LINE> self.instance_ip = self.custom_args.get('ip_address') <NEW_LINE> if not self.instance_ip: <NEW_LINE> <INDENT> raise SSHCloudException( 'IP address is required to connect to ins... | Class for testing instances in Azure. | 62598ee376e4537e8c3edbe3 |
class TestSource(TestCaseWithRepository): <NEW_LINE> <INDENT> scenarios = all_repository_vf_format_scenarios() <NEW_LINE> def test_no_absent_records_in_stream_with_ghosts(self): <NEW_LINE> <INDENT> builder = self.make_branch_builder('repo') <NEW_LINE> builder.start_series() <NEW_LINE> builder.build_snapshot('tip', ['gh... | Tests for/about the results of Repository._get_source. | 62598ee3d7e4931a7ef3a6c9 |
class RepetitionScore( collections.namedtuple("Score", ["target_ratio", "prediction_ratio"])): <NEW_LINE> <INDENT> pass | Tuple containing ratio values for targets and predictions. | 62598ee367a9b606de5445fa |
class Conv2DBlock(): <NEW_LINE> <INDENT> def __init__(self, filters, kernel_size=5, strides=2, padding="same", use_instance_norm=False, res_block_follows=False, **kwargs): <NEW_LINE> <INDENT> self._name = kwargs.pop("name") if "name" in kwargs else _get_name( "conv_{}".format(filters)) <NEW_LINE> logger.debug("name: %s... | A standard Convolution 2D layer which applies user specified configuration to the
layer.
Adds reflection padding if it has been selected by the user, and other post-processing
if requested by the plugin.
Adds instance normalization if requested. Adds a LeakyReLU if a residual block follows.
Parameters
----------
fil... | 62598ee321a7993f00c64598 |
class Score(Base): <NEW_LINE> <INDENT> __tablename__ = 'scores' <NEW_LINE> __table_args__ = {'mysql_engine':'InnoDB'} <NEW_LINE> sid = Column(Integer, ForeignKey('senders.sid'), primary_key=True) <NEW_LINE> wid = Column(Integer, ForeignKey('words.wid'), primary_key=True) <NEW_LINE> score = Column(Float, nullable=False)... | ORM class and table declaration by SQLAlchemy | 62598ee3e76e3b2f99fd7065 |
class CreateViewStatement(Statement): <NEW_LINE> <INDENT> def __init__(self, view, replace=False): <NEW_LINE> <INDENT> super(CreateViewStatement, self).__init__(target=view, doc_based=False) <NEW_LINE> self._view = view <NEW_LINE> self._schema = view.schema <NEW_LINE> self._name = view.name <NEW_LINE> self._replace = r... | A statement for creating views.
Args:
view (mysqlx.View): The View object.
replace (Optional[bool]): `True` to add replace. | 62598ee332920d7e50bc4659 |
class DeletePlanAction(base.TripleOAction): <NEW_LINE> <INDENT> def __init__(self, container): <NEW_LINE> <INDENT> super(DeletePlanAction, self).__init__() <NEW_LINE> self.container = container <NEW_LINE> <DEDENT> def run(self, context): <NEW_LINE> <INDENT> error_text = None <NEW_LINE> try: <NEW_LINE> <INDENT> stack = ... | Deletes a plan and associated files
Deletes a plan by deleting the container matching plan_name. It
will not delete the plan if a stack exists with the same name.
Raises StackInUseError if a stack with the same name as plan_name
exists. | 62598ee392d797404e387e91 |
class Makedepend(AutotoolsPackage, XorgPackage): <NEW_LINE> <INDENT> homepage = "http://cgit.freedesktop.org/xorg/util/makedepend" <NEW_LINE> xorg_mirror_path = "util/makedepend-1.0.5.tar.gz" <NEW_LINE> version('1.0.5', sha256='503903d41fb5badb73cb70d7b3740c8b30fe1cc68c504d3b6a85e6644c4e5004') <NEW_LINE> depends_on('xp... | makedepend - create dependencies in makefiles. | 62598ee33cc13d1c6d463d99 |
class TestAffVstack(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.x = Variable(2, name='x') <NEW_LINE> self.y = Variable(2, name='y') <NEW_LINE> self.A = Variable(3,2, name='A') <NEW_LINE> self.B = Variable(5,2, name='B') <NEW_LINE> self.C = Constant([[1, 2], [1, 2]]) <NEW_LINE> self... | Unit tests for the expressions.affine module. | 62598ee34f88993c371ef7fc |
class ScriptCopyer(distlib.scripts.ScriptMaker): <NEW_LINE> <INDENT> def make(self, specification, options=None): <NEW_LINE> <INDENT> if get_export_entry(specification): <NEW_LINE> <INDENT> log.debug("Not building script: %s", specification) <NEW_LINE> return [] <NEW_LINE> <DEDENT> return super(ScriptCopyer, self).make... | A ScriptMaker which does not create script wrappers.
It does copy the scripts from the source. | 62598ee3e5267d203ee69f31 |
class TimeSpanEntry(datetime.timedelta): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def fromrstimespanstring(cls, timespan_string): <NEW_LINE> <INDENT> days = re.findall('(\d+)D', timespan_string) <NEW_LINE> days = int(days[0]) if days else 0 <NEW_LINE> minutes = re.findall('(\d+)M', timespan_string) <NEW_LINE> minute... | Timespan data type wrapping Revit Server timespan.
Wraps Revit Server string timespan in a typical python
datetime.timedelta subclass
Example:
>>> ts = TimeSpanEntry.fromrstimespanstring("PT11M42.5154811S")
TimeSpanEntry(0, 5856, 811000) | 62598ee3d7e4931a7ef3a6ca |
class RubyCommonClassifier: <NEW_LINE> <INDENT> def is_symbol_cb(self, tok): <NEW_LINE> <INDENT> return tok['text'][0] == ":" <NEW_LINE> <DEDENT> _quote_patterns = {ScintillaConstants.SCE_RB_STRING: re.compile( '^\"(.*)\"$'), ScintillaConstants.SCE_RB_CHARACTER: re.compile('^\'(.*)\'$'), ScintillaConstants.SCE_RB_STRIN... | Mixin class containing classifier callbacks | 62598ee31b99ca400228e823 |
class ProfileList(views.APIView): <NEW_LINE> <INDENT> renderer_classes = [renderers.TemplateHTMLRenderer] <NEW_LINE> template_name = 'profile_list.html' <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> queryset = Profile.objects.all() <NEW_LINE> return Response({'profiles': queryset}) <NEW_LINE> <DEDENT> def post... | Example to test TemplateHTMLRenderer. | 62598ee323849d37ff84f6e2 |
class EchoResult: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.FilePath = config.EnvironmentPath() <NEW_LINE> self.AllNews = {} <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def Is_Json(file: str) -> bool: <NEW_LINE> <INDENT> return file.split('.')[-1] == 'json' <NEW_LINE> <DEDENT> def ParseJson(self... | a class to manipulate results by reading, removing and updating them. | 62598ee310dbd63aa1c6f19e |
class TinyDbOption(CommandLineOption): <NEW_LINE> <INDENT> __depends_on__ = ['tinydb', 'hashfs', 'tinydb_serialization#tinydb-serialization'] <NEW_LINE> arg = 'BASEDIR' <NEW_LINE> @classmethod <NEW_LINE> def apply(cls, args, run): <NEW_LINE> <INDENT> location = cls.parse_tinydb_arg(args) <NEW_LINE> tinydb_obs = TinyDbO... | Add a TinyDB Observer to the experiment. | 62598ee376e4537e8c3edbe4 |
class TestSocketTransport(TransportCheck): <NEW_LINE> <INDENT> @pytest.fixture(autouse=True) <NEW_LINE> def set_up(self): <NEW_LINE> <INDENT> self.counter = 0 <NEW_LINE> <DEDENT> def get_server_arg(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> if self.counter == 0: <NEW_LINE> <INDENT> return '1' <NEW_LINE> <DEDEN... | Instantiation of the general transport test for the socket transport.
This test uses a 'hack' to ensure that real socket communication is
performed. The ``set_up`` fixture method resets a counter for each executed
test function that is used to set diverging connector options for the
different requests for connectors i... | 62598ee3d53ae8145f916ab9 |
class UnlinkBot(SingleSiteBot, BaseUnlinkBot): <NEW_LINE> <INDENT> summary_key = 'unlink-unlinking' <NEW_LINE> def __init__(self, pageToUnlink, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.pageToUnlink = pageToUnlink <NEW_LINE> self.generator = pageToUnlink.getReferences( namespaces=self.op... | A bot unlinking the given link from the current page. | 62598ee391af0d3eaad38441 |
class StoryValidation(Validation): <NEW_LINE> <INDENT> content_types = {"text": validate_text, "link": validate_link, "media": validate_media, } <NEW_LINE> def is_valid(self, bundle, request=None): <NEW_LINE> <INDENT> errors = {} <NEW_LINE> if not bundle.data.get('content_type', ""): <NEW_LINE> <INDENT> return {'conten... | Checks only one of the story fields (story_text, link, media_file) is defined | 62598ee3adb09d7d5dc08bf3 |
class SqlScript(base.BaseScript): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def create(cls, path, **opts): <NEW_LINE> <INDENT> cls.require_notfound(path) <NEW_LINE> src = Template(opts.pop('templates_path', None)).get_sql_script(theme=opts.pop('templates_theme', None)) <NEW_LINE> shutil.copy(src, path) <NEW_LINE> ret... | A file containing plain SQL statements. | 62598ee39c8ee8231303f46e |
class NoFilter(GrufError): <NEW_LINE> <INDENT> pass | No filter is available for the specified command | 62598ee3cc0a2c111447962f |
class Error(Model): <NEW_LINE> <INDENT> _validation = { 'code': {'required': True}, 'sub_code': {'readonly': True}, 'message': {'required': True}, 'more_details': {'readonly': True}, 'parameter': {'readonly': True}, 'value': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'code': {'key': 'code', 'type': 'ErrorCode'... | Defines the error that occurred.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:param code: Required. The error code that identifies the category of
error. Possible values include: 'None', 'ServerError', '... | 62598ee356b00c62f0fb0efd |
class NumpyNpzWriter(Writer): <NEW_LINE> <INDENT> formats = (Formats.NUMPY_NPZ,) <NEW_LINE> def __call__(self, spectrum, path): <NEW_LINE> <INDENT> with open(path, "wb") as f: <NEW_LINE> <INDENT> numpy.savez_compressed(f, channels=spectrum.channels(), resolution=spectrum.resolution(), labels=spectrum.labels()) | Saves the spectrum in a compressed :mod:`numpy` binary file. | 62598ee3236d856c2adc872a |
class BriefAndLong: <NEW_LINE> <INDENT> pass | Brief description
Long description | 62598ee3fff4ab517ebcbe11 |
class ToyGraph(EvaluationGraph): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def build(self, image_size, conv_layer_opts=[ LayerOpts(filter_size = 5, n_kernels = 16), LayerOpts(filter_size = 5, n_kernels = 32)], fc_layer_sizes=[400,2]): <NEW_LINE> <INDENT> self.input_tensor = tf... | Graph for the toy framework. | 62598ee3435de62698e9a403 |
class EB_MRtrix(EasyBlock): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(EB_MRtrix, self).__init__(*args, **kwargs) <NEW_LINE> if LooseVersion(self.version) >= LooseVersion('0.3'): <NEW_LINE> <INDENT> self.build_in_installdir = True <NEW_LINE> self.log.debug("Enabled build-in-insta... | Support for building/installing MRtrix. | 62598ee356ac1b37e630081a |
class DropDownMenuRegion(baseregion.BaseRegion): <NEW_LINE> <INDENT> _menu_container_locator = (by.By.CSS_SELECTOR, 'ul.dropdown-menu') <NEW_LINE> _menu_items_locator = (by.By.CSS_SELECTOR, 'ul.dropdown-menu > li > *') <NEW_LINE> _dropdown_locator = (by.By.CSS_SELECTOR, '.dropdown > a') <NEW_LINE> _active_cls = 'dropdo... | Drop down menu region. | 62598ee330bbd72246468266 |
class transformMEL(Transforms): <NEW_LINE> <INDENT> def __init__(self, ttype='mel', bins=48, frameSize=1024, hopSize=256, tffmin=25, tffmax=18000, iscale = 'lin', sampleRate=44100, window=np.hanning): <NEW_LINE> <INDENT> super(transformMEL, self).__init__(ttype='mel', bins=bins, frameSize=frameSize, hopSize=hopSize, tf... | A class to help computing the short time Fourier transform (STFT) | 62598ee367a9b606de5445fb |
class BiasFFTStatsConfig(BiasRaftTableAnalysisConfig): <NEW_LINE> <INDENT> infilekey = EOUtilOptions.clone_param('infilekey', default='biasfft') <NEW_LINE> filekey = EOUtilOptions.clone_param('filekey', default='biasfft-stats') | Configuration for BiasFFTStatsTask | 62598ee38c0ade5d55dc299a |
class ElectricCar(Car): <NEW_LINE> <INDENT> def __init__(self, make, model, year): <NEW_LINE> <INDENT> super().__init__(make, model, year) <NEW_LINE> self.battery_size = 70 <NEW_LINE> <DEDENT> def describe_battery(self): <NEW_LINE> <INDENT> print("This car has a " + str(self.battery_size) + "-kwh battery.") | 电动汽车的独特之处 | 62598ee355399d3f05624b5e |
class Field(BaseItem): <NEW_LINE> <INDENT> def __init__(self, schema: FieldSchema, evaluation_context: EvaluationContext) -> None: <NEW_LINE> <INDENT> super().__init__(schema, evaluation_context) <NEW_LINE> self.value = self._schema.default <NEW_LINE> self.eval_error = False <NEW_LINE> <DEDENT> def run_evaluate(self) -... | An individual field object responsible for retaining the field value | 62598ee3379a373c97d97628 |
class SmallAsteroid(Asteroid): <NEW_LINE> <INDENT> _damage_left = 2 <NEW_LINE> _normal_shape = {-1:".##.", 0:"####", 1:".##."} <NEW_LINE> _explosion_frames = [ (200, {-1:" ** ", 0:"****", 1:" ** "}), (600, {-1:" '' ", 0:"- -", 1:" .. "}), ] <NEW_LINE> def __init__(self, asteroid): <NEW_LINE> <INDENT> super(SmallAstero... | Small version of asteroid. | 62598ee3498bea3a75a56163 |
@override_settings(MEDIA_ROOT=MEDIA_ROOT) <NEW_LINE> class DirectoryCreationTests(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> if not os.path.isdir(MEDIA_ROOT): <NEW_LINE> <INDENT> os.makedirs(MEDIA_ROOT) <NEW_LINE> <DEDENT> <DEDENT> @classmethod <NEW_LINE> def tearDow... | Tests for error handling during directory creation
via _save_FIELD_file (ticket #6450) | 62598ee37b25080760ed5ac7 |
@export <NEW_LINE> class BnConv2D(tf.keras.layers.Layer): <NEW_LINE> <INDENT> def __init__( self, filters: int, kernel_size: Union[int, Tuple[int, int]], strides: Union[int, Tuple[int, int]] = 1, padding: str = 'valid', data_format: Optional[str] = None, activation: Optional[Union[str, callable]] = None, **kwargs ) -> ... | Parameters
----------
filters
kernel_size
strides
padding
data_format
activation
**kwargs | 62598ee3d268445f26638ea5 |
class CurvedEdges(EdgeLayout): <NEW_LINE> <INDENT> def __init__(self, curvature=0.15): <NEW_LINE> <INDENT> self._curvature = curvature <NEW_LINE> <DEDENT> def edges(self, vcoordinates, edges): <NEW_LINE> <INDENT> loops = edges.T[0] == edges.T[1] <NEW_LINE> if numpy.any(loops): <NEW_LINE> <INDENT> toyplot.log.warning("G... | Creates curved edges between graph vertices.
Parameters
----------
curvature : number
Controls the curvature of each edge's arc, as a percentage of the
distance between the edge's vertices. Use negative values to curve
edges in the opposite direction. | 62598ee33317a56b869bd87e |
class PageMapping(PyWebMvcObject): <NEW_LINE> <INDENT> def __init__(self, id, pythonClass): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.pythonClass = pythonClass <NEW_LINE> <DEDENT> def createInstance(self): <NEW_LINE> <INDENT> return self.pythonClass() | A mapping of the global L{ActionForward} id to a L{Page} one of its
subclasses that knows how to present the particular outcome of an action.
Each page instance is created just once and used to handle many requests. The
C{<page>} element takes just attributes, both of that are required:
- C{id} - The global L{ActionF... | 62598ee34e4d562566370a47 |
class State(models.Model): <NEW_LINE> <INDENT> run_state = models.CharField(max_length=10) <NEW_LINE> uph = models.IntegerField() <NEW_LINE> detection_num = models.IntegerField() <NEW_LINE> defect_num = models.IntegerField() <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return "<State: %s)>" % self.run_state <NEW_L... | 缺陷图片表单 | 62598ee357b8e32f5250741c |
class BaseWCS(object): <NEW_LINE> <INDENT> def __init__(self, logger): <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> self.header = None <NEW_LINE> self.wcs = None <NEW_LINE> self.coordsys = 'raw' <NEW_LINE> <DEDENT> def load_header(self, header, fobj=None): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def spectra... | Base class for WCS. | 62598ee3dd821e528d6d7573 |
@dataclass <NEW_LINE> class SizedBox: <NEW_LINE> <INDENT> x: float <NEW_LINE> y: float <NEW_LINE> width: float <NEW_LINE> height: float <NEW_LINE> @property <NEW_LINE> def x0(self) -> float: <NEW_LINE> <INDENT> return self.x <NEW_LINE> <DEDENT> @property <NEW_LINE> def x1(self) -> float: <NEW_LINE> <INDENT> return self... | A simple dataclass to represent a bounding box of a web element | 62598ee3ac7a0e7691f70b44 |
class Friend(User): <NEW_LINE> <INDENT> @handle_response() <NEW_LINE> def set_remark_name(self, remark_name): <NEW_LINE> <INDENT> return self.bot.core.set_alias(userName=self.user_name, alias=str(remark_name)) | 好友对象 | 62598ee376e4537e8c3edbe6 |
class StatusComment: <NEW_LINE> <INDENT> def __init__(self, status, comment=list()): <NEW_LINE> <INDENT> self.status = status <NEW_LINE> self.comment = comment <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "%s: %d" % (self.status, len(self.comment)) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE>... | without dictionary
Status is an object and comment must be an iterable object like list or tuple | 62598ee310dbd63aa1c6f1a0 |
class TestSegmentCreateParameters(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> return Segment... | SegmentCreateParameters unit test stubs | 62598ee360cbc95b0636296b |
class NewsTest(unitest,TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.new_news = Headlines(1234,'mist','nick','today there was alot of mist','') <NEW_LINE> <DEDENT> def test_instance(self): <NEW_LINE> <INDENT> self.assertTrue(isinstance(self.new_news,News)) | test class to test the behaviour of the headlines class | 62598ee3fff4ab517ebcbe13 |
class Flickr8k(VisionDataset): <NEW_LINE> <INDENT> def __init__( self, root: str, ann_file: str, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, ) -> None: <NEW_LINE> <INDENT> super(Flickr8k, self).__init__(root, transform=transform, target_transform=target_transform) <NEW_LINE> self.... | `Flickr8k Entities <http://hockenmaier.cs.illinois.edu/8k-pictures.html>`_ Dataset.
Args:
root (string): Root directory where images are downloaded to.
ann_file (string): Path to annotation file.
transform (callable, optional): A function/transform that takes in a PIL image
and returns a transforme... | 62598ee3e5267d203ee69f34 |
class PaymentTypeDeleteView(CompanyPermissionMixin, PaymentTypeMixin, DeleteView): <NEW_LINE> <INDENT> pass | Classic view to delete a payment type. | 62598ee3656771135c487cc2 |
class UserCommunitySubscriptionManager(BaseUserSubscriptionManager): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def subscribe(user, community_to_subscribe): <NEW_LINE> <INDENT> user.subscriptions.create(user_id=user.pk, content_object=community_to_subscribe) <NEW_LINE> UserCommunitySubscriptionManager._update_user_su... | Service that manages user-to-community subscription/unsubscription | 62598ee3c432627299fa15e6 |
class SearchResults(ItemList): <NEW_LINE> <INDENT> def __init__(self, owner, locatordict, row_class, row_class_locatordict): <NEW_LINE> <INDENT> super(SearchResults,self).__init__(owner,locatordict,row_class,row_class_locatordict) <NEW_LINE> self.update_locators_from_owner() <NEW_LINE> self.counts = TextReadOnly(self,{... | Specific type of ItemList used to iterate through lists that result
from searches.
Provides a header_counts() function, that returns the start, stop,
and total number of results displayed, as stated by the counts in
the table header. | 62598ee3498bea3a75a56164 |
class KNN: <NEW_LINE> <INDENT> def __init__(self, k) : <NEW_LINE> <INDENT> self.nodes = dict() <NEW_LINE> self.K = k <NEW_LINE> <DEDENT> def training(self, user_manager, artist_manager): <NEW_LINE> <INDENT> for user_id, user in user_manager.iteritems(): <NEW_LINE> <INDENT> self.nodes[user_id] = get_feature(user, artist... | initial for KNN opreator | 62598ee3bd1bec0571e143e3 |
class Ship(object): <NEW_LINE> <INDENT> def __init__(self, screen, settings): <NEW_LINE> <INDENT> self.screen = screen <NEW_LINE> self.image = pygame.image.load('images/ship.png') <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> self.screen_rect = screen.get_rect() <NEW_LINE> self.center = float(self.screen_rect... | Main ship class | 62598ee3442bda511e95aa96 |
@Registry.register <NEW_LINE> class MultipleChoices(Error): <NEW_LINE> <INDENT> MSGID = "HTTP-15978" <NEW_LINE> CODE = 300 | Multiple choices | 62598ee3d7e4931a7ef3a6cd |
class Amenity(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=125) <NEW_LINE> parks = models.ManyToManyField(HendersonPark) <NEW_LINE> created_on = models.DateTimeField(auto_now_add=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name | Also scraped from Henderson Parks and Rec.
ManyToMany Relationship with HendersonPark
Example amenities: 'Open Grass Field', 'Lighted Tennis Courts' | 62598ee3a8ecb0332586f818 |
class OutputChart(Chart): <NEW_LINE> <INDENT> def __init__(self, workload_info, zipped_size=1000, title="", description=""): <NEW_LINE> <INDENT> super(OutputChart, self).__init__(workload_info, zipped_size) <NEW_LINE> self.title = title <NEW_LINE> self.description = description <NEW_LINE> <DEDENT> def _map_iteration_va... | Base class for charts related to scenario output. | 62598ee38da39b475be017da |
class Color: <NEW_LINE> <INDENT> bold = _make_color(1) <NEW_LINE> red = _make_color(31) <NEW_LINE> bold_red = _make_color(31, 1) <NEW_LINE> green = _make_color(32) <NEW_LINE> magenta = _make_color(35, 1) | Helpers to surround text with ASCII color escapes | 62598ee3379a373c97d9762b |
class PasswordTooShort(AuthException): <NEW_LINE> <INDENT> pass | The matter of security password to be longer than 6 symbols. | 62598ee338b623060ffa76c5 |
class GUIRemoteControlCommands(object): <NEW_LINE> <INDENT> COMMAND_STR = b"$" <NEW_LINE> START = COMMAND_STR + b"SRT" <NEW_LINE> PAUSE = COMMAND_STR + b"PSE" <NEW_LINE> PING = COMMAND_STR + b"PNG" <NEW_LINE> QUIT = COMMAND_STR + b"QUT" <NEW_LINE> GET_FX1 = COMMAND_STR + b"gFX1" <NEW_LINE> GET_FX2 = COMMAND_STR + b"gF... | SET_THRESHOLDS needs to be followed by a threshold object
SET_RESPONSE_MINMAX_DETECTION needs to be followed an integer representing duration of sampling
feedback:
CHANGED_LEVEL+int from SET_LEVEL_CHANGE_DETECTION
RESPONSE_MINMAX+(int, int) from SET_RESPONSE_MINMAX_DETECTION
VALUE+float from GET_FX, GET_FY... | 62598ee33317a56b869bd87f |
class ConversionFailureError(Error): <NEW_LINE> <INDENT> pass | Thrown for complete conversion failures | 62598ee3f548e778e5969bc6 |
class TsfPageSimpleGroup(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TotalCount = None <NEW_LINE> self.Content = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TotalCount = params.get("TotalCount") <NEW_LINE> if params.get("Content") is not None: <... | TSF简单部署组分页列表
| 62598ee3796e427e5384cdc8 |
class LoginApiView(TokenObtainPairView): <NEW_LINE> <INDENT> serializer_class = serializers.LoginSerializer | Login api view with jwt token | 62598ee3cad5886f8bdc3930 |
class Activity(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.yuming = 'https://www-t.jfcaifu.com' <NEW_LINE> self.session = requests.session() <NEW_LINE> self.phone = '17302139300' <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def login(self, ph... | 日常活动 | 62598ee330bbd72246468269 |
class ProdConfig(Config): <NEW_LINE> <INDENT> ENV = 'production' <NEW_LINE> DEBUG = False <NEW_LINE> os.environ['FLASK_ENV'] = ENV | Production configuration. | 62598ee3e76e3b2f99fd7069 |
class SubNodeFuser(object): <NEW_LINE> <INDENT> def __call__(self, graph): <NEW_LINE> <INDENT> nodes = graph.nodes <NEW_LINE> fused_nodes = [] <NEW_LINE> for node in nodes: <NEW_LINE> <INDENT> if len(node.parents) != 1: <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> parent = node.get_only_parent() <NEW_LINE> if len(p... | An abstract helper for merging a single-child with its single-parent. | 62598ee30a50d4780f7039da |
class Rule(RedditBase): <NEW_LINE> <INDENT> STR_FIELD = "short_name" <NEW_LINE> @cachedproperty <NEW_LINE> def mod(self) -> "praw.models.reddit.rules.RuleModeration": <NEW_LINE> <INDENT> return RuleModeration(self) <NEW_LINE> <DEDENT> def __init__( self, reddit: "praw.Reddit", subreddit: Optional["praw.models.Subreddit... | An individual Rule object.
**Typical Attributes**
This table describes attributes that typically belong to objects of this class.
Since attributes are dynamically provided (see
:ref:`determine-available-attributes-of-an-object`), there is not a guarantee that
these attributes will always be present, nor is this list ... | 62598ee37cff6e4e811b401e |
class ImageResponseXMLFactory(ResponseXMLFactory): <NEW_LINE> <INDENT> def create_response_element(self, **kwargs): <NEW_LINE> <INDENT> return etree.Element("imageresponse") <NEW_LINE> <DEDENT> def create_input_element(self, **kwargs): <NEW_LINE> <INDENT> src = kwargs.get("src", "/static/image.jpg") <NEW_LINE> width = ... | Factory for producing <imageresponse> XML | 62598ee399cbb53fe682f4e2 |
class DataLine(): <NEW_LINE> <INDENT> def __init__(self,fname,depth,stiff,hard,line): <NEW_LINE> <INDENT> self.fname = fname <NEW_LINE> self.depth = depth <NEW_LINE> self.stiff = stiff <NEW_LINE> self.hard = hard <NEW_LINE> self.line = line <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> s = "DataLine(\"{}\... | Class representing the fields we care about from a single entry
from a summary file. | 62598ee3d58c6744b42db5cf |
class FdbInterface(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def add(cls, mac, dev): <NEW_LINE> <INDENT> return utils.execute(['bridge', 'fdb', 'add', mac, 'dev', dev], run_as_root=True) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def delete(cls, mac, dev): <NEW_LINE> <INDENT> return utils.execute(['bridge',... | provide basic functionality to edit the FDB table | 62598ee3eab8aa0e5d30a3a9 |
class BaiduTranslate(): <NEW_LINE> <INDENT> url = 'http://openapi.baidu.com/public/2.0/bmt/translate?' <NEW_LINE> def __init__(self, client_id, q='', fm='auto', to='auto'): <NEW_LINE> <INDENT> self.client_id = client_id <NEW_LINE> self.fm = fm <NEW_LINE> self.to = to <NEW_LINE> self.q = q <NEW_LINE> <DEDENT> def get_ur... | 百度翻译
| 62598ee36fb2d068a769313b |
class Environment: <NEW_LINE> <INDENT> def initial_percepts(self): <NEW_LINE> <INDENT> raise NotImplementedError('initial_percepts') <NEW_LINE> <DEDENT> def signal(self,action): <NEW_LINE> <INDENT> raise NotImplementedError('signal') | Essa classe implementa a interface para o ambiente | 62598ee3e5267d203ee69f36 |
class LoginActionTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> User.objects.create_user('Admin', 'admin@mail.com', 'admin123456') <NEW_LINE> self.c = Client() <NEW_LINE> <DEDENT> def test_login_action_username_password_null(self): <NEW_LINE> <INDENT> test_data = {'username': '', 'password': '... | 测试登录函数 | 62598ee3c432627299fa15e8 |
class BaseCustomSerializer(serializers.Serializer): <NEW_LINE> <INDENT> def _append_non_field_error(self, error): <NEW_LINE> <INDENT> errors = self.errors.get(api_settings.NON_FIELD_ERRORS_KEY, []) <NEW_LINE> errors.append(error) <NEW_LINE> self._errors.update({api_settings.NON_FIELD_ERRORS_KEY: errors}) <NEW_LINE> <DE... | Serializer de base | 62598ee3090684286d5929f8 |
class Ellipse(BorderMixin, AnnotationObject): <NEW_LINE> <INDENT> def __init__(self, annot, x, y, w, h, npoints=60, filled=True, border=True, **kwargs): <NEW_LINE> <INDENT> AnnotationObject.__init__(self, annot, **kwargs) <NEW_LINE> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.w = w <NEW_LINE> sel... | The ``Ellipse`` class is an :class:`AnnotationObject` which represents a
ellipse. | 62598ee332920d7e50bc465e |
class OneHotActionWrapper(gym.Wrapper): <NEW_LINE> <INDENT> def __init__(self, env): <NEW_LINE> <INDENT> super().__init__(env) <NEW_LINE> self.env = env <NEW_LINE> <DEDENT> def step(self, action): <NEW_LINE> <INDENT> if not isinstance(action, int): <NEW_LINE> <INDENT> action = action.argmax() <NEW_LINE> <DEDENT> return... | Allow to use one-hot action on a discrete action environment. | 62598ee34428ac0f6e656b84 |
class DesignAdmin(DisplayableAdmin): <NEW_LINE> <INDENT> inlines = (DesignAssetAdmin, DesignedProductAdmin) <NEW_LINE> form = DesignAdminForm <NEW_LINE> fieldsets = design_fieldsets <NEW_LINE> def save_model(self, request, obj, form, change): <NEW_LINE> <INDENT> super(DesignAdmin, self).save_model(request, obj, form, c... | This admin uses a similiar aproach as Cartridge's
ProductAdmin class. A selection of possible Products
is displayed. When selected, DesignedProducts of the selected
Products are created. | 62598ee366656f66f7d58a12 |
class ConvNetActions(nn.Module): <NEW_LINE> <INDENT> def __init__(self, num_features, num_layers=8, kernel_size=3): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.residual_blocks = nn.ModuleList([]) <NEW_LINE> for _ in range(num_layers): <NEW_LINE> <INDENT> self.residual_blocks.append(_ResLayer(num_features, ke... | A network of residual convolutional layers | 62598ee367a9b606de5445ff |
class ThermometerView(EasyFrame): <NEW_LINE> <INDENT> def __init__(self, model): <NEW_LINE> <INDENT> EasyFrame.__init__(self, title = "Temperature Converter") <NEW_LINE> self.model = model <NEW_LINE> self.celsiusScale = self.addScale(label = "Celsius", row = 0, column = 0, from_ = -273.15, to = 100.0, resolution = 0.01... | A temperature conversion program. Uses sliding scales. | 62598ee38e7ae83300ee76c1 |
class TestV1OrderHistoryEntryAction(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 testV1OrderHistoryEntryAction(self): <NEW_LINE> <INDENT> model = squareconnect.models.v1_order_history_entry_acti... | V1OrderHistoryEntryAction unit test stubs | 62598ee3cc0a2c1114479634 |
class MalformedSMSError(Exception): <NEW_LINE> <INDENT> pass | Exception raised when an error is received decodifying a SMS | 62598ee33317a56b869bd880 |
class TestSetup(unittest.TestCase): <NEW_LINE> <INDENT> layer = BGETEM_HAUTSCHUTZ_INTEGRATION_TESTING <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.portal = self.layer['portal'] <NEW_LINE> if get_installer: <NEW_LINE> <INDENT> self.installer = get_installer(self.portal, self.layer['request']) <NEW_LINE> <DEDENT>... | Test that bgetem.hautschutz is properly installed. | 62598ee3796e427e5384cdca |
class Item(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'bucketlist_items' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(255), nullable=False) <NEW_LINE> bucketlist_id = db.Column(db.Integer, db.ForeignKey( 'bucketlist.id', ondelete='CASCADE'), nullable=False) <NEW_LINE... | This class represents bucketlist items table. | 62598ee397e22403b3839522 |
class _Building(ArchFloor._Floor): <NEW_LINE> <INDENT> def __init__(self,obj): <NEW_LINE> <INDENT> ArchFloor._Floor.__init__(self,obj) <NEW_LINE> self.setProperties(obj) <NEW_LINE> obj.IfcRole = "Building" <NEW_LINE> <DEDENT> def setProperties(self,obj): <NEW_LINE> <INDENT> pl = obj.PropertiesList <NEW_LINE> if not "Bu... | The Building object | 62598ee391f36d47f22301bc |
class PostilokerolyhenneTekstiTyyppi (pyxb.binding.datatypes.string): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'PostilokerolyhenneTekstiTyyppi') <NEW_LINE> _XSDLocation = None <NEW_LINE> _Documentation = None | An atomic simple type. | 62598ee3e76e3b2f99fd706b |
class FileLock: <NEW_LINE> <INDENT> Error = FileLockException <NEW_LINE> def __init__(self, file_name, timeout=10, delay=.05): <NEW_LINE> <INDENT> self.file_name = os.path.abspath(file_name) <NEW_LINE> self.lockfile = os.path.abspath(file_name) + ".lock" <NEW_LINE> self.timeout = float(timeout) <NEW_LINE> self.delay = ... | A file locking mechanism that has context-manager support so you can use
it in a with statement. This should be relatively cross-compatible as it
doesn't rely on msvcrt or fcntl for the locking.
Taken from http://www.evanfosmark.com/2009/01/cross-platform-file-locking
-support-in-python/ | 62598ee332920d7e50bc465f |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.