code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class DBSearchResult: <NEW_LINE> <INDENT> def __init__(self, output_reads, search_result, hit_read_count, slash_endings): <NEW_LINE> <INDENT> self.output_reads = output_reads <NEW_LINE> self.search_result = search_result <NEW_LINE> self.hit_count = hit_read_count <NEW_LINE> self.slash_endings = slash_endings <NEW... | DBSearchResult - Class for containing results from search pipeline in GraftM | 62598f77cad5886f8bdc4c34 |
class _HostPythonConfiguration: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.platform = sys.platform <NEW_LINE> self.version = sys.hexversion >> 8 <NEW_LINE> self.inc_dir = sysconfig.get_python_inc() <NEW_LINE> self.venv_inc_dir = sysconfig.get_python_inc(prefix=sys.prefix) <NEW_LINE> self.module_di... | A container for the host Python configuration. | 62598f7750485f2cf55da881 |
class Generated_Twitter_Test(DataSet): <NEW_LINE> <INDENT> def __init__(self, inst=None): <NEW_LINE> <INDENT> DataSet.__init__(self, inst=inst) <NEW_LINE> if inst is None: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return "gen_twittertest" <NEW_LINE> <... | Manually generated Twitter testing dataset. | 62598f7723e79379d538be0b |
class map(models.Model): <NEW_LINE> <INDENT> url = models.CharField(max_length=1000, unique=True) <NEW_LINE> name = models.CharField(max_length=255) | Database model for users in the system | 62598f771d351010ab8f3451 |
class Ingredient(models.Model): <NEW_LINE> <INDENT> name = models.CharField(unique=True, max_length=255) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> ordering = ['name'] <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.name | Stores list of ingredients | 62598f7715fb5d323ce7e63a |
class MlMain: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.dataset = [] <NEW_LINE> self.domain = [] <NEW_LINE> self.sensor_name = [] <NEW_LINE> self.algorithm_name = str <NEW_LINE> self.is_append_intention = bool <NEW_LINE> self.intention_id = str <NEW_LINE> self.conditional_keys = [] <NEW_LINE> <DE... | This class maintains total procedure of collecting dataset, user intention,
training model and Firebase application triggering.
Parameters
----------
dataset : list
Training dataset.
domain : list
List of domains. [domain, subdomain1, subdomain2, ...]
sensor_name : list
List of sen... | 62598f77b57a9660fecd1390 |
class BioSphere: <NEW_LINE> <INDENT> def __init__(self, name, logging_q, max_critters=MAX_CRITTERS, max_qlen=MAX_QUEUE_LEN): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.logging_q = logging_q <NEW_LINE> self._quit = mp.Event() <NEW_LINE> self.max = max_critters <NEW_LINE> self.dna_q = mp.Queue(max_qlen) <NEW_LI... | A BioSphere is a process in charge of running the threads of
multiple Critters. If a critter destabilizes a process, it brings
down a BioSphere without destroying the whole program. | 62598f77d10714528d69d7e0 |
class Config(object): <NEW_LINE> <INDENT> SHORTCUTS = 'shortcuts' <NEW_LINE> MAIN = 'main' <NEW_LINE> THEME = 'theme' <NEW_LINE> LOG_FILE = 'log_file' <NEW_LINE> LOG_LEVEL = 'log_level' <NEW_LINE> COLOR = 'color_output' <NEW_LINE> FUZZY = 'fuzzy_match' <NEW_LINE> SHORTCUT = 'shortcut_match' <NEW_LINE> def get_shortcuts... | Reads and writes the config file `sawsrc`.
Attributes:
* SHORTCUTS: A string that represents the start of shortcuts in
the config file ~/.sawsrc.
* MAIN: A string that represents the main set of configs in
~/.sawsrc.
* THEME: A string that represents the config theme.
* LOG_FILE: A stri... | 62598f778e05c05ec3f6eacf |
class ConnectWidget(object): <NEW_LINE> <INDENT> mx_types = { 'connect_widget_url': 'str', 'guid': 'str' } <NEW_LINE> attribute_map = { 'connect_widget_url': 'connect_widget_url', 'guid': 'guid' } <NEW_LINE> def __init__(self, connect_widget_url=None, guid=None): <NEW_LINE> <INDENT> self._connect_widget_url = None <NEW... | Attributes:
mx_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition. | 62598f778c3a8732951f5e61 |
class _BinaryMismatch(Mismatch): <NEW_LINE> <INDENT> def __init__(self, expected, mismatch_string, other): <NEW_LINE> <INDENT> self.expected = expected <NEW_LINE> self._mismatch_string = mismatch_string <NEW_LINE> self.other = other <NEW_LINE> <DEDENT> def _format(self, thing): <NEW_LINE> <INDENT> if istext(thing) or _... | Two things did not match. | 62598f773eb6a72ae0389f54 |
class TabHandler(BaseHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> Category(id="house", name="House", description="", image_url="/img/house.png").put() <NEW_LINE> Category(id="garden", name="Garden", description="", image_url="/img/garden.png").put() <NEW_LINE> Category(id="dinner", name="Dinner", de... | docstring for TabHandler | 62598f7763f4b57ef00859f8 |
class CustomSelectorLoopSession(asyncio.SelectorEventLoop): <NEW_LINE> <INDENT> pass | A subclass with no overrides, just to test for presence. | 62598f77b830903b9686e0fc |
class SMTPAuthReqError(smtp.SMTPServerError): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> smtp.SMTPServerError.__init__(self, 550, 'Authentication required!') | Класс исключения. Сообщает о необходимости авторизации. | 62598f778a43f66fc4bf1a91 |
class EUCLIDpowerFEEsim_BS(ApplicationSoftwareImpl): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ApplicationSoftwareImpl.__init__(self) <NEW_LINE> self.commandingMode = EPWR_CMD_LOCAL <NEW_LINE> self.operationMode = EPWR_OP_OFFLINE <NEW_LINE> <DEDENT> def processFunctionService(self, apid, tcFunctionId,... | Implementation of the EUCLID BS Power Frontend Simulation | 62598f77a05bb46b3848a191 |
class ModalTimerOperator(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "wm.modal_timer_operator" <NEW_LINE> bl_label = "Modal Timer Operator" <NEW_LINE> limits = bpy.context.scene.play_from <NEW_LINE> _timer = None <NEW_LINE> _time = time.time() <NEW_LINE> _uuid = mu.rand_letters(5) <NEW_LINE> def modal(self, co... | Operator which runs its self from a timer | 62598f771d351010ab8f3452 |
class IllegalSecondError(RangeError): <NEW_LINE> <INDENT> def __init__(self, second): <NEW_LINE> <INDENT> self.second = second <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "An invalid value for 'second' was found ('{0}'); must be in the range [0,60).".format(self.second) | Raised when an second value (time) is not in the range [0,60).
Usage:
if not 0 <= sec < 60:
raise IllegalSecondError(second)
Parameters
----------
second : int, float | 62598f7750485f2cf55da883 |
class Parser(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.json_file = None <NEW_LINE> self.line = None <NEW_LINE> self.logger = getLogger('LOGGER') <NEW_LINE> <DEDENT> def get_event(self, json_file): <NEW_LINE> <INDENT> if json_file is None or self.json_file == json_file: <NEW_LINE> <INDENT... | Methods of parsing of JSON files. | 62598f7726068e7796d4c26f |
class Tokens(list): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> list.__init__(self) <NEW_LINE> self.identifiers = [] <NEW_LINE> self.constants = [] <NEW_LINE> self.labels = [] <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return ' '.join([str(token) for token in self]) <NEW_LINE> <DEDENT> d... | Class, thar wraps list for storing tokens (class Token) | 62598f779b70327d1c57e6c4 |
class ApiResponse(JsonResponse): <NEW_LINE> <INDENT> def __init__(self, data=None, status=200): <NEW_LINE> <INDENT> if data is None: <NEW_LINE> <INDENT> data = {} <NEW_LINE> <DEDENT> if status < 400: <NEW_LINE> <INDENT> wrapped_data = { 'status': 'ok', 'data': data, } <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> wrapp... | A JsonResponse class that wrappes response data in a dictionary with
a `status` key and either `data` or `error` based on the status_code. | 62598f771f5feb6acb16254a |
class Section(ReadOnly): <NEW_LINE> <INDENT> def __init__(self, y, E, nu, b, rho, kappa, name=''): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> y = y if np.iterable(y) else [y] <NEW_LINE> self.y = np.array(y) <NEW_LINE> n = len(self.y) - 1 <NEW_LINE> E = E if np.iterable(E) else [E] <NEW_LINE> self.E = np.array(E)... | Define a Section of a beam.
Paremeters
----------
y: iterable
Coordinate of each layer, length should be number of layers + 1
E: float or iterable
Young's modulus for each layer.
nu: float or iterable between 0 and 0.5
Possion's ratio for each layer.
b: float or iterable
Width of the corss-section f... | 62598f77d10714528d69d7e2 |
class LabReportForm(forms.Form): <NEW_LINE> <INDENT> required_css_class = "required" <NEW_LINE> error_css_class = "error" <NEW_LINE> parent_category = forms.ModelChoiceField( queryset=Category.objects.filter(parent__parent__isnull=True).filter( parent__isnull=False ), label=PARENT_CATEGORY, ) <NEW_LINE> def __init__(se... | displays form for Consultancy Funds | 62598f7766656f66f7d59d06 |
class IndexOutOfBoundsException(GirlFriendSysException): <NEW_LINE> <INDENT> pass | 索引越界时抛出此异常
| 62598f77711fe17d825dfffb |
class Node(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.color_index = random.randint(color.MIN_COLOR, color.MAX_COLOR) <NEW_LINE> self.aabb = AABB([0.0, 0.0, 0.0], [0.5, 0.5, 0.5]) <NEW_LINE> self.translation_matrix = numpy.identity(4) <NEW_LINE> self.scaling_matrix = numpy.identity(4) <NEW... | Base class for scene elements | 62598f77fb3f5b602db47e3b |
class Cmd_User_Add_Test(CmdTestCase): <NEW_LINE> <INDENT> @set_users() <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(Cmd_User_Add_Test, self).setUp() <NEW_LINE> User.objects.all().delete() <NEW_LINE> <DEDENT> def test_add(self): <NEW_LINE> <INDENT> argv = ['', 'user', 'add', '-u', 'TESTUSER', '-p', 'pass'] <NEW... | Test ``manage.py user add``. | 62598f7721bff66bcd722579 |
@pytest.mark.usefixtures <NEW_LINE> class TestModulehybrid_analysis(unittest.TestCase): <NEW_LINE> <INDENT> def test_opts(self): <NEW_LINE> <INDENT> module = sfp_hybrid_analysis() <NEW_LINE> self.assertEqual(len(module.opts), len(module.optdescs)) <NEW_LINE> <DEDENT> def test_setup(self): <NEW_LINE> <INDENT> sf = Spide... | Test modules.sfp_hybrid_analysis | 62598f77287bf620b62714cd |
class Dwhite(DUGen): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _ordered_input_names = ( 'minimum', 'maximum', 'length', ) <NEW_LINE> def __init__( self, length=float('inf'), maximum=1, minimum=0, ): <NEW_LINE> <INDENT> if length is None: <NEW_LINE> <INDENT> length = float('inf') <NEW_LINE> <DEDENT> DUGen.__init__( ... | A demand-rate white noise random generator.
::
>>> dwhite = ugentools.Dwhite.new(
... length=float('inf'),
... maximum=1,
... minimum=0,
... )
>>> dwhite
Dwhite() | 62598f7723e79379d538be0f |
class ProjectCategory(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name | A Category such as "Place, Community, Platform, ..." | 62598f77d10714528d69d7e3 |
class SkipVersioningOfLargeFilesAndImages(AbortVersioningOfLargeFilesAndImages): <NEW_LINE> <INDENT> implements(IConditionalTalesModifier, ICloneModifier, ISaveRetrieveModifier) <NEW_LINE> def getOnCloneModifiers(self, obj): <NEW_LINE> <INDENT> refs = {} <NEW_LINE> ref_list = [] <NEW_LINE> for storage, name, val in sel... | Replaces any excessively large file and images stored as
annotations or attributes on the object with a marker. On
retrieve, the marker will be replaced with the current value.. | 62598f77d53ae8145f917dab |
class CUDAScheme(Scheme): <NEW_LINE> <INDENT> def __init__(self, device_num=0): <NEW_LINE> <INDENT> Scheme.__init__(self) <NEW_LINE> if not pycbc.HAVE_CUDA: <NEW_LINE> <INDENT> raise RuntimeError("Install PyCUDA to use CUDA processing") <NEW_LINE> <DEDENT> import pycuda.driver <NEW_LINE> pycuda.driver.init() <NEW_LINE>... | Context that sets PyCBC objects to use a CUDA processing scheme. | 62598f778da39b475be02af8 |
class SessionObjectWizardView( ObjectWizardViewInterface, djarg.views.SessionObjectWizardView ): <NEW_LINE> <INDENT> pass | Same as `daf.admin.ObjectWizardView`, but uses a session backend by
default. | 62598f7726068e7796d4c271 |
class ServerVersionMiddle: <NEW_LINE> <INDENT> def __init__(self, get_response): <NEW_LINE> <INDENT> self.get_response = get_response <NEW_LINE> <DEDENT> def __call__(self, request): <NEW_LINE> <INDENT> response = self.get_response(request) <NEW_LINE> response['X-Server-Version'] = server_version() <NEW_LINE> return re... | Middleware class to flow server version to clients. | 62598f7716aa5153ce3ffe14 |
class Add: <NEW_LINE> <INDENT> def __init__(self, in_headers, args): <NEW_LINE> <INDENT> raise Exception("TODO") <NEW_LINE> <DEDENT> def process_row(self,row): <NEW_LINE> <INDENT> raise Exception("TODO") <NEW_LINE> <DEDENT> def get_aggregate(self): <NEW_LINE> <INDENT> raise Exception("TODO") | Add a new column to the database. Like Update, Add consumes two arguments
from args: a column name and a python expression. Raise an exception if
the column is in in_headers.
Tip: use "x not in l" to check if x is *not* an element of l.
"not (x in l)" also works. | 62598f7730c21e258be9811c |
class FakeConnectionHmip(BaseFakeHmip): <NEW_LINE> <INDENT> js_response = {"response": True} <NEW_LINE> def add_routes(self): <NEW_LINE> <INDENT> self.app.router.add_routes( [ web.post("/go_404", self.go_404), web.post("/go_200_no_json", self.go_200_no_json), web.post("/go_200_json", self.go_200_json), ] ) <NEW_LINE> <... | Test various connection issues | 62598f77d4950a0f3b110ac1 |
class TrackPendingRequests(): <NEW_LINE> <INDENT> _pending_requests_all = 0 <NEW_LINE> _pending_requests_user = {} <NEW_LINE> def increment(self, username: str) -> None: <NEW_LINE> <INDENT> self._pending_requests_all += 1 <NEW_LINE> cur_val = int(self._pending_requests_user.get(username, 0)) <NEW_LINE> self._pending_re... | Simple class to track (increment/decrement) pending kernel start requests, both total and per user.
This tracking is necessary due to an inherent race condition that occurs now that kernel startup is
asynchronous. As a result, multiple/simultaneous requests must be considered, in addition all existing
kernel sessions... | 62598f77d6c5a102081e1a5c |
class ParallelEnsembleFidelity(FidelityBase): <NEW_LINE> <INDENT> def __init__(self, ensemble, fidelity, **params): <NEW_LINE> <INDENT> super(ParallelEnsembleFidelity, self).__init__(ensemble) <NEW_LINE> self.fidelities = [fidelity(sys, **params) for sys in ensemble.systems] <NEW_LINE> self.pool = mp.Pool() <NEW_LINE> ... | With a given Ensemble, and a FidelityComputer,
calculate the average fidelity over the whole ensemble. | 62598f777c178a314d78cdbe |
class Main: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.config() <NEW_LINE> sys.exit(self.run()) <NEW_LINE> <DEDENT> except (EOFError, KeyboardInterrupt): <NEW_LINE> <INDENT> sys.exit(114) <NEW_LINE> <DEDENT> except SystemExit as exception: <NEW_LINE> <INDENT> sys.e... | Main class | 62598f7766656f66f7d59d08 |
class ProgressIndicator(object): <NEW_LINE> <INDENT> States = ("|", "/", "-", "\\") <NEW_LINE> def __init__(self, prefix="", f=sys.stdout): <NEW_LINE> <INDENT> self.n = 0 <NEW_LINE> self.f = f <NEW_LINE> self.prev_len = 0 <NEW_LINE> self.prefix = prefix <NEW_LINE> self.prefix_lens = [] <NEW_LINE> <DEDENT> def pushprefi... | Simple progress indicator.
Displayed as a spinning character by default, but can be customized
by passing custom messages that overrides the spinning character. | 62598f7882261d6c5272fb61 |
class SSHCustomModuleTest(integration.SSHCase): <NEW_LINE> <INDENT> def test_ssh_regular_module(self): <NEW_LINE> <INDENT> expected = 'hello' <NEW_LINE> cmd = self.run_function('test.echo', arg=['hello']) <NEW_LINE> self.assertEqual(expected, cmd) <NEW_LINE> <DEDENT> def test_ssh_custom_module(self): <NEW_LINE> <INDENT... | Test sls with custom module functionality using ssh | 62598f7815baa72349461897 |
class ConanContainer(container.new_container_for("conan", version)): <NEW_LINE> <INDENT> def __init__(self, version, installation, shell): <NEW_LINE> <INDENT> super(ConanContainer, self).__init__(installation, "conan", version, shell) <NEW_LINE> assert os.path.exists(self._installation) <NEW_LINE> <DEDENT> def clean(se... | A container representing an active conan installation. | 62598f7830dc7b766599f173 |
class SynapsesMetadata(MultiFieldExtendableMetadata): <NEW_LINE> <INDENT> fields = list(SynapsesVector.fields) | Метаданные для нейронов | 62598f788da39b475be02afa |
class MultiRelationship(AbstractRelationship): <NEW_LINE> <INDENT> def _handle_data(self, data): <NEW_LINE> <INDENT> super()._handle_data(data) <NEW_LINE> self._resource_identifiers = [ResourceIdentifier(self.session, d) for d in self._resource_data] <NEW_LINE> del self._resource_data <NEW_LINE> <DEDENT> @property <NEW... | Relationship class for to-many type relationships, that are received from
server as ResourceIdentifiers. | 62598f786e29344779afff79 |
class TestOpenHardwareMonitorSetup(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.hass = get_test_home_assistant() <NEW_LINE> self.config = { 'sensor': { 'platform': 'openhardwaremonitor', 'host': 'localhost', 'port': 8085 } } <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT... | Test the Open Hardware Monitor platform. | 62598f78d10714528d69d7e6 |
class CredentialType(Schema): <NEW_LINE> <INDENT> class Credential(Schema): <NEW_LINE> <INDENT> effective_date = fields.Nested(CredentialMapping(), required=True) <NEW_LINE> inactive = fields.Nested(CredentialMapping(), required=False) <NEW_LINE> revoked_date = fields.Nested(CredentialMapping(), required=False) <NEW_LI... | Issuer credential type schema. | 62598f787c178a314d78cdc0 |
class DimensionedPort(Port, ExpressionSymbol): <NEW_LINE> <INDENT> defining_attributes = ('name', 'dimension') <NEW_LINE> __metaclass__ = ABCMeta <NEW_LINE> def __init__(self, name, dimension=None): <NEW_LINE> <INDENT> super(DimensionedPort, self).__init__(name) <NEW_LINE> self._dimension = dimension if dimension is no... | DimensionedPort
A |DimensionedPort| is the base class for ports with dimensions (e.g.
Analog and Property ports). | 62598f788e05c05ec3f6ead2 |
class _Enumeration(object): <NEW_LINE> <INDENT> def __init__(self, enums, type): <NEW_LINE> <INDENT> self.enums = OrderedDict() <NEW_LINE> prefix = "" <NEW_LINE> if type == _EnumerationType.Type: <NEW_LINE> <INDENT> prefix = "packet_type_" <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> prefix = "packet_opcode_" <NEW_LIN... | Represents a C enum structure | 62598f784e696a045264da8b |
class BioThingsAuthenticationProviderInterface(abc.ABC): <NEW_LINE> <INDENT> WWW_AUTHENTICATE_HEADER: Optional[str] = None <NEW_LINE> def __init__(self, handler: BaseAPIHandler, **kwargs): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.handler = handler <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def get... | Authentication Provider Interface for BioThings API Endpoints
BioThingsAuthnMixin depends on this interface. Any authentication for
the API endpoints is recommended to be implemented using this
interface.
A provider will be initialized with the API Handler calling it, so it will
have access to the request, and other ... | 62598f783eb6a72ae0389f5a |
class OperationsAsyncClient: <NEW_LINE> <INDENT> def __init__(self, channel, client_config=operations_client_config.config): <NEW_LINE> <INDENT> self.operations_stub = operations_pb2.OperationsStub(channel) <NEW_LINE> interfaces = client_config["interfaces"] <NEW_LINE> interface_config = interfaces["google.longrunning.... | Async client for interacting with long-running operations.
Args:
channel (aio.Channel): The gRPC AsyncIO channel associated with the
service that implements the ``google.longrunning.operations``
interface.
client_config (dict):
A dictionary of call options for each method. If not specif... | 62598f78b57a9660fecd1397 |
class DirectoryServer(atom_core.XmlElement): <NEW_LINE> <INDENT> _qname = CONTACTS_TEMPLATE % 'directoryServer' | A directory server associated with this contact.
May not be repeated. | 62598f787b25080760ed6db9 |
class FloorForm(forms.ModelForm): <NEW_LINE> <INDENT> location_id = HiddenField("Location id") <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = models.Floor | Base form for creating / updating Floor | 62598f78bde94217f37072f3 |
@skipIf(NO_MOCK, NO_MOCK_REASON) <NEW_LINE> class StateCompilerTestCase(TestCase): <NEW_LINE> <INDENT> def test_format_log_non_ascii_character(self): <NEW_LINE> <INDENT> ret = {'changes': {u'Français': {'old': 'something old', 'new': 'something new'}}, 'result': True} <NEW_LINE> state.format_log(ret) | TestCase for the state compiler. | 62598f7896565a6dacd2cc07 |
class XST(statData): <NEW_LINE> <INDENT> def __init__(self, station=None, rcumode=None, ts=None, hbaStr=None, special=None, rawfile=None, integration=None, sb=None, nants=96, npol=2): <NEW_LINE> <INDENT> self.setStation(station) <NEW_LINE> self.setRCUmode(rcumode) <NEW_LINE> self.setTimestamp(ts) <NEW_LINE> self.setHBA... | XST cross-correlation class
Attributes: | 62598f7807d97122c42165bb |
class case_existing_file(Case): <NEW_LINE> <INDENT> def test(self, handler): <NEW_LINE> <INDENT> return os.path.isfile(handler.full_path) <NEW_LINE> <DEDENT> def act(self, handler): <NEW_LINE> <INDENT> self.handle_file(handler, handler.full_path) | File exists! | 62598f7821bff66bcd72257d |
class CosFace(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_features, out_features, device_id, s=64.0, m=0.35): <NEW_LINE> <INDENT> super(CosFace, self).__init__() <NEW_LINE> self.in_features = in_features <NEW_LINE> self.out_features = out_features <NEW_LINE> self.device_id = device_id <NEW_LINE> self.s = s <N... | Implement of CosFace (https://arxiv.org/pdf/1801.09414.pdf):
Args:
in_features: size of each input sample
out_features: size of each output sample
device_id: the ID of GPU where the model will be trained by model parallel.
if device_id=None, it will be trained on CPU without model paralle... | 62598f7866673b3332c2fcdb |
class SectionPlotly(Section): <NEW_LINE> <INDENT> def __init__( self, data, variable, levels ): <NEW_LINE> <INDENT> super().__init__(data, variable, levels) <NEW_LINE> <DEDENT> def render(self): <NEW_LINE> <INDENT> super().render() <NEW_LINE> layers, titles, lat, lon, depth = self.make_layers() <NEW_LINE> for i in rang... | Use this class to make section graphs using plotly library. | 62598f7850485f2cf55da889 |
class TestParseVariable(unittest.TestCase): <NEW_LINE> <INDENT> def test_variable(self): <NEW_LINE> <INDENT> line = 'float temperature(time, lat, lon)' <NEW_LINE> name, nctype, shape = parse_variable(line) <NEW_LINE> self.assertEqual(name, 'temperature') <NEW_LINE> self.assertEqual(nctype, 'float') <NEW_LINE> self.asse... | Testing the parse_variable function | 62598f7871ff763f4b5e7086 |
class ExawindCfgManager(cfg.ConfigManager): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def rc_type(): <NEW_LINE> <INDENT> return "yaml" <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def rc_base(): <NEW_LINE> <INDENT> return "exawind" <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def cfg_class(): <NEW_LINE> <INDENT> ret... | Configuration manager object for Exawind Python Library | 62598f78d53ae8145f917daf |
class VirtualMachine(ApiObject): <NEW_LINE> <INDENT> def __init__(self, id='', label='', session=E24sess.default_session): <NEW_LINE> <INDENT> print (E24sess.default_session) <NEW_LINE> print (session) <NEW_LINE> super().__init__(type='virtual_machine', id=id, label=label, session=session) <NEW_LINE> self.state = self.... | Represents a vm resource. | 62598f78baa26c4b54d4ebcc |
class PrecedenceTable: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.table = {} <NEW_LINE> self.priorityCounter = 0 <NEW_LINE> <DEDENT> def addPrecedence(self, direction, terms): <NEW_LINE> <INDENT> directions = ('left', 'right') <NEW_LINE> if direction not in directions: <NEW_LINE> <INDENT> raise Va... | Represents Precedence table. | 62598f78d10714528d69d7e7 |
class MedTreeComboBox(QtGui.QComboBox): <NEW_LINE> <INDENT> def __init__(self,parent): <NEW_LINE> <INDENT> QtGui.QComboBox.__init__(self) <NEW_LINE> self.proxyParent = parent <NEW_LINE> self.setFocusPolicy(QtCore.Qt.StrongFocus) <NEW_LINE> self.connect(self,QtCore.SIGNAL("activated(QString)"),self.proxyParent.parentIte... | This class is a comboBox embed in a ProxyWidget
Most of its is reimplemented from QtGui.QGraphicsProxyWidget
It is used as a graphical way for the user to present a list of primitive that can replace its associated node | 62598f788da39b475be02afc |
class TranslationPriceDto(object): <NEW_LINE> <INDENT> swagger_types = { 'workflow_step': 'WorkflowStepDto', 'price': 'float' } <NEW_LINE> attribute_map = { 'workflow_step': 'workflowStep', 'price': 'price' } <NEW_LINE> def __init__(self, workflow_step=None, price=None): <NEW_LINE> <INDENT> self._workflow_step = None <... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f78a8ecb03325870b22 |
class LazySelect(LazyChoicesMixin, widgets.Select): <NEW_LINE> <INDENT> def __deepcopy__(self, memo): <NEW_LINE> <INDENT> obj = copy.copy(self) <NEW_LINE> obj.attrs = self.attrs.copy() <NEW_LINE> obj.choices = copy.copy(self._choices) <NEW_LINE> memo[id(self)] = obj <NEW_LINE> return obj | A form Select widget that respects choices being a lazy object. | 62598f788c3a8732951f5e68 |
class Customer(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField( CustomUser, models.CASCADE, primary_key=True ) | Model for a customer. | 62598f785e10d32532ce357a |
class reco_args(object): <NEW_LINE> <INDENT> def __init__(self, imgstr=None,): <NEW_LINE> <INDENT> self.imgstr = imgstr <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: <NEW_LINE>... | Attributes:
- imgstr | 62598f7866656f66f7d59d0c |
class InvisibleCharacters(Rule): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Rule.__init__(self, name='invisible-characters', description='File contains invisible characters (found {count})', suggestion='Delete each occurrence or replace with whitespace.') <NEW_LINE> <DEDENT> INVISIBLES = ['\u200b', '\u... | Don't put invisible characters in code.
Invisible characters (in code, i.e. not in literals) serve no useful purpose and may confuse
both editing tools and readers. | 62598f78bde94217f37072f4 |
class NoEncryption(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'enabled_protocols': {'key': 'enabledProtocols', 'type': 'EnabledProtocols'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(NoEncryption, self).__init__(**kwargs) <NEW_LINE> self.enabled_protocols = kwargs.ge... | Class for NoEncryption scheme.
:param enabled_protocols: Representing supported protocols.
:type enabled_protocols: ~azure.mgmt.media.models.EnabledProtocols | 62598f78287bf620b62714d3 |
class IdentityProvider(Entity): <NEW_LINE> <INDENT> def __init__(self, idpel): <NEW_LINE> <INDENT> Entity.__init__(self, idpel) <NEW_LINE> self.ars = {} <NEW_LINE> self.slo = {} <NEW_LINE> self.mnid = {} <NEW_LINE> self.sso = {} <NEW_LINE> for entry in self.el.IDPSSODescriptor.SingleSignOnService: <NEW_LINE> <INDENT> s... | Class holding a SAML Identity Provider | 62598f78d164cc6175820891 |
class NotCriteria(Criteria): <NEW_LINE> <INDENT> def __init__(self, criteria: 'Callable[[Order, Exchange], bool]') -> None: <NEW_LINE> <INDENT> self.criteria = criteria <NEW_LINE> <DEDENT> def check(self, order: 'Order', exchange: 'Exchange') -> bool: <NEW_LINE> <INDENT> return not self.criteria(order, exchange) <NEW_L... | A criteria to invert the truth value of another criteria.
Parameters
----------
criteria : `Callable[[Order, Exchange], bool]`
The criteria to invert the truth value of. | 62598f78fb3f5b602db47e3e |
class ClouderImageVersion(models.Model): <NEW_LINE> <INDENT> _name = 'clouder.image.version' <NEW_LINE> _description = 'Clouder Image Version' <NEW_LINE> _inherit = ['clouder.model'] <NEW_LINE> _order = 'create_date desc' <NEW_LINE> _sql_constraints = [ ('name_uniq', 'unique(image_id,name)', 'Version name must be uniqu... | Define the image.version object, which represent each build of
the image. | 62598f78a05bb46b3848a199 |
class IMegaphone(Interface): <NEW_LINE> <INDENT> pass | A PloneFormGen form masquerading as a Megaphone action letter or petition.
| 62598f7873bcbd0ca4bc9b69 |
class getDeviceStreamProfile_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRING, 'success', None, None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProt... | Attributes:
- success | 62598f788da39b475be02afe |
class SubNet(nn.Module): <NEW_LINE> <INDENT> def __init__(self, mode, anchors, classes, depth, base_activation, output_activation): <NEW_LINE> <INDENT> super(SubNet, self).__init__() <NEW_LINE> self.anchors = anchors <NEW_LINE> self.classes = classes <NEW_LINE> self.depth = depth <NEW_LINE> self.base_activation = base_... | Subnet, described in Focal Loss for Dense Object Detection.
ref: https://arxiv.org/abs/1708.02002 | 62598f78dc8b845886d52ecf |
class InKernelCallable(ImmutableRecord): <NEW_LINE> <INDENT> hash_fields = ("name", "arg_id_to_dtype", "arg_id_to_descr") <NEW_LINE> def __init__(self, name, arg_id_to_dtype=None, arg_id_to_descr=None): <NEW_LINE> <INDENT> super().__init__(name=name, arg_id_to_dtype=arg_id_to_dtype, arg_id_to_descr=arg_id_to_descr) <NE... | An abstract interface to define a callable encountered in a kernel.
.. attribute:: name
The name of the callable which can be encountered within expressions in
a kernel.
.. attribute:: arg_id_to_dtype
A mapping which indicates the arguments types and result types of the
callable.
.. attribute:: arg... | 62598f780fa83653e46f480c |
class PythonLossModule(PythonModule): <NEW_LINE> <INDENT> def __init__(self, name='pyloss', data_names=('data'), label_names=('softmax_label'), logger=logging, grad_func=None): <NEW_LINE> <INDENT> super(PythonLossModule, self).__init__(data_names, label_names, [name + '_output'], logger=logger) <NEW_LINE> self._name = ... | A convenient module class that implements many of the module APIs as
empty functions.
Parameters
----------
name : str
Names of the module. The outputs will be named `[name + '_output']`.
data_names : list of str
Default `['data']`. Names of the data expected by this module.
Should be a list of only one na... | 62598f78d4950a0f3b110ac4 |
class StringHelpers: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def generate_random_string(length: int) -> str: <NEW_LINE> <INDENT> letters = string.ascii_lowercase <NEW_LINE> result_str = ''.join(random.choice(letters) for i in range(length)) <NEW_LINE> return result_str | Simple functions for operating on strings. | 62598f7823e79379d538be16 |
class BatchFile(): <NEW_LINE> <INDENT> @property <NEW_LINE> def filename(self): <NEW_LINE> <INDENT> return self._filename <NEW_LINE> <DEDENT> @property <NEW_LINE> def file(self): <NEW_LINE> <INDENT> return self._file <NEW_LINE> <DEDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self._logger = logging.getLogger(... | Represents an open batch file. Automatically closes file on deletion. | 62598f7826238365f5fac490 |
class MyTagSearchAPIView(APIView): <NEW_LINE> <INDENT> queryset = MyTag.objects.all() <NEW_LINE> serializer_class = MyTagSerializer <NEW_LINE> permission_classes = (AlreadyLoginUser,) <NEW_LINE> @ExceptionHandler <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> public_key = get_header(self.request) <NEW_LINE> que... | API endpoint that allows query my tag. | 62598f78d99f1b3c44d04fc9 |
class JavaPorter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Grammar.instance.process() <NEW_LINE> self.chooser = StatementChooser() <NEW_LINE> <DEDENT> def topy(self, filepos, writer): <NEW_LINE> <INDENT> tok = Tokenizer(filepos) <NEW_LINE> Grammar.instance.parse(tok) <NEW_LINE> return <NEW_LI... | Ports a Java file. | 62598f78bde94217f37072f5 |
class UserJSONRenderer(JSONRenderer): <NEW_LINE> <INDENT> charset = 'utf-8' <NEW_LINE> def render(self, data, media_type=None, renderer_context=None): <NEW_LINE> <INDENT> token = data.get('token', None) <NEW_LINE> errors = data.get('errors', None) <NEW_LINE> if errors is not None: <NEW_LINE> <INDENT> return super(UserJ... | Renderers take the intermediate step of template and context
and converts it to the final byte stream served to the client. | 62598f78287bf620b62714d4 |
class WagtailImagesSettings(AppConf): <NEW_LINE> <INDENT> IMAGE_MODEL = 'wapps.WappsImage' <NEW_LINE> class Meta: <NEW_LINE> <INDENT> prefix = 'wagtailimages' | Wagtail images default settings | 62598f7896565a6dacd2cc09 |
class Meta: <NEW_LINE> <INDENT> verbose_name_plural = "Research" | Meta class. | 62598f78a4f1c619b294df08 |
class FlagTypeChangeEvent(ChangeEvent): <NEW_LINE> <INDENT> def __init__(self, action, flagType): <NEW_LINE> <INDENT> self.action = action <NEW_LINE> self.flagType = flagType | FlagTypeChangeEvent are used when a flagtype is added, changed or deleted. | 62598f788c3a8732951f5e6c |
class RestApiDetail(APIView): <NEW_LINE> <INDENT> def get_object(self, pk): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return Rest_framework.objects.get(pk=pk) <NEW_LINE> <DEDENT> except Rest_framework.DoesNotExist: <NEW_LINE> <INDENT> raise Http404 <NEW_LINE> <DEDENT> <DEDENT> def get(self, request, pk, format=None)... | Retrieve, update or delete a user instance. | 62598f78a4f1c619b294df09 |
class ControlPanel(QMainWindow): <NEW_LINE> <INDENT> if os.name == 'nt': <NEW_LINE> <INDENT> datefmt = '%Y-%m-%d %H-%M-%S' <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> datefmt = '%Y-%m-%d %H:%M:%S' <NEW_LINE> <DEDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self._pdir =... | The QApplication main window for Qt smartlink control. | 62598f781f5feb6acb162554 |
class Solution: <NEW_LINE> <INDENT> def addStrings(self, num1, num2): <NEW_LINE> <INDENT> if not num1 and not num2: <NEW_LINE> <INDENT> return "" <NEW_LINE> <DEDENT> if not num1: <NEW_LINE> <INDENT> return num2 <NEW_LINE> <DEDENT> if not num2: <NEW_LINE> <INDENT> return num1 <NEW_LINE> <DEDENT> res = "" <NEW_LINE> carr... | @param num1: a non-negative integers
@param num2: a non-negative integers
@return: return sum of num1 and num2 | 62598f784d74a7450cd58b65 |
class ILiveSearchEntry(Interface): <NEW_LINE> <INDENT> pass | Adaptation from a search result to provide a result dictionary
the adaptation itself generates the dictionary | 62598f7823e79379d538be18 |
class CodeTemplateManager(Manager): <NEW_LINE> <INDENT> def __init__(self, main_window): <NEW_LINE> <INDENT> Manager.__init__(self, main_window, "Code Template Manager") <NEW_LINE> self.element = CodeTemplate() <NEW_LINE> self.get_items = System.get_code_templates <NEW_LINE> self.editor = CodeTemplateEditor <NEW_LINE> ... | This class contains methods related the CodeTemplateManager class | 62598f781f037a2d8b9e3a0a |
class OpBasedBlip(model.Blip): <NEW_LINE> <INDENT> def __init__(self, data, context): <NEW_LINE> <INDENT> super(OpBasedBlip, self).__init__(data, OpBasedDocument(data, context)) <NEW_LINE> self.__context = context <NEW_LINE> <DEDENT> def CreateChild(self): <NEW_LINE> <INDENT> blip_data = self.__context.builder.BlipCrea... | Subclass of the blip model capable of generating operations.
Any mutation-based methods will likely result in one or more operations
being applied locally and sent to the server. | 62598f78d10714528d69d7ec |
class HomeView(TemplateView): <NEW_LINE> <INDENT> template_name = 'promotions/home.html' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> if 'best_sellers' not in kwargs: <NEW_LINE> <INDENT> best_sellers = Category.objects.get(slug='best-sellers') <NEW_LINE> kwargs['best_sellers'] = best_sellers.get... | This is the home page and will typically live at /. | 62598f788c3a8732951f5e6d |
class RedisPool(object): <NEW_LINE> <INDENT> def __init__(self, **redis_config): <NEW_LINE> <INDENT> if redis_config: <NEW_LINE> <INDENT> self.redis_pool = redis.ConnectionPool(redis_config) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if settings.REDIS_DATABASE: <NEW_LINE> <INDENT> redis_config = settings.REDIS_DATAB... | Generate a redis connection pool | 62598f7815baa7234946189e |
class ProductsRequest(Request): <NEW_LINE> <INDENT> def __init__(self, ids=None, names=None, match=None, **kw): <NEW_LINE> <INDENT> super().__init__(**kw) <NEW_LINE> if ids is None and names is None: <NEW_LINE> <INDENT> self.params['type'] = ['accessible'] <NEW_LINE> self.options.append('all user-accessible products') ... | Construct a products request. | 62598f78711fe17d825e0005 |
class Dipole_util(object): <NEW_LINE> <INDENT> def com(self, center1_x, center1_y, center2_x, center2_y, Fm): <NEW_LINE> <INDENT> com_x = (Fm * center1_x + center2_x)/(Fm + 1.) <NEW_LINE> com_y = (Fm * center1_y + center2_y)/(Fm + 1.) <NEW_LINE> return com_x, com_y <NEW_LINE> <DEDENT> def mass_ratio(self, phi_E, phi_E_... | pre-calculation of dipole properties | 62598f780a366e3fb87dc2e8 |
class DrawBufsizeError(PeroException): <NEW_LINE> <INDENT> message = __doc__ | The draw method can not be used when the buffer size is set to 1 | 62598f7850485f2cf55da88e |
class TestLogDecoding_FilmLightTLog(unittest.TestCase): <NEW_LINE> <INDENT> def test_log_decoding_FilmLightTLog(self): <NEW_LINE> <INDENT> self.assertAlmostEqual( log_decoding_FilmLightTLog(0.075), 0.0, places=7 ) <NEW_LINE> self.assertAlmostEqual( log_decoding_FilmLightTLog(0.396567801298332), 0.18, places=7 ) <NEW_LI... | Define :func:`colour.models.rgb.transfer_functions.filmlight_tlog.log_decoding_FilmLightTLog` definition unit tests methods. | 62598f7863f4b57ef00859fe |
class OrderSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = OrderInfo <NEW_LINE> fields = ('address', 'pay_method', 'order_id') <NEW_LINE> read_only_fields = ('order_id',) <NEW_LINE> extra_kwargs = { 'address': { 'write_only': True }, 'pay_method': { 'write_only': Tru... | 订单序列化器类 | 62598f7815fb5d323ce7e648 |
class TestUtils(unittest.TestCase): <NEW_LINE> <INDENT> def test_evaluate_population(self): <NEW_LINE> <INDENT> mock_fitness = 1 <NEW_LINE> mock_evaulate_fn = lambda x: mock_fitness <NEW_LINE> mock_ind_1 = mock.Mock() <NEW_LINE> mock_ind_2 = mock.Mock() <NEW_LINE> mock_population = [mock_ind_1, mock_ind_2] <NEW_LINE> e... | Test the util functions. | 62598f785e10d32532ce357d |
class TorqueSensor(Entity): <NEW_LINE> <INDENT> def __init__(self, name, unit): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._unit = unit <NEW_LINE> self._state = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self._name <NEW_LINE> <DEDENT> @property <NEW_LINE> def uni... | Represents a Torque sensor. | 62598f78d4950a0f3b110ac6 |
class AlternateEmail(object): <NEW_LINE> <INDENT> def __init__(self, props=None, base_obj=None): <NEW_LINE> <INDENT> self._base = None <NEW_LINE> if base_obj is not None: <NEW_LINE> <INDENT> self._base = base_obj <NEW_LINE> <DEDENT> self._pre_request_filter = None <NEW_LINE> self._log = logging.getLogger(__name__) <NEW... | Smartsheet AlternateEmail data model. | 62598f780383005118f6d021 |
class itkMaskImageFilterICVF22IUL2ICVF22(itkMaskImageFilterICVF22IUL2ICVF22_Superclass): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") <NEW_LINE> _... | Proxy of C++ itkMaskImageFilterICVF22IUL2ICVF22 class | 62598f78e76e3b2f99fd8352 |
class BoundLineSet(primitive.BoundPrimitive): <NEW_LINE> <INDENT> def __init__(self, ls, matrix, materialnodebysymbol): <NEW_LINE> <INDENT> M = numpy.asmatrix(matrix).transpose() <NEW_LINE> self._vertex = None <NEW_LINE> if ls._vertex is not None: <NEW_LINE> <INDENT> self._vertex = numpy.asarray(ls._vertex * M[:3,:3]) ... | A line set bound to a transform matrix and materials mapping.
* If ``bs`` is an instance of :class:`collada.lineset.BoundLineSet`, ``len(bs)``
returns the number of lines in the set and ``bs[i]`` returns the i\ :superscript:`th`
line in the set. | 62598f7826068e7796d4c27c |
class Tweet(object): <NEW_LINE> <INDENT> def __init__(self, id, author, author_id, created_at, text, entities, favorite_count, retweet_count): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.author = author <NEW_LINE> self.author_id = author_id <NEW_LINE> self.created_at = created_at <NEW_LINE> self.text = text <NEW_L... | docstring for Tweet | 62598f7807d97122c42165c2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.