code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Franc(Money): <NEW_LINE> <INDENT> def times(self, multiplier: int) -> Money: <NEW_LINE> <INDENT> return Franc(self._amount * multiplier) | フラン通貨を表します。 | 62599081442bda511e95dabd |
class Climb(FlightPhaseNode): <NEW_LINE> <INDENT> def derive(self, toc=KTI('Top Of Climb'), eot=KTI('Climb Start')): <NEW_LINE> <INDENT> toc_list = [] <NEW_LINE> for this_toc in toc: <NEW_LINE> <INDENT> toc_list.append(this_toc.index) <NEW_LINE> <DEDENT> for this_eot in eot: <NEW_LINE> <INDENT> eot = this_eot.index <NE... | This phase goes from 1000 feet (top of Initial Climb) in the climb to the
top of climb | 6259908126068e7796d4e40e |
class _Options(object): <NEW_LINE> <INDENT> host = 'localhost' <NEW_LINE> port = 27017 <NEW_LINE> indices = () <NEW_LINE> database = None <NEW_LINE> collection = None <NEW_LINE> username = None <NEW_LINE> password = None <NEW_LINE> auto_index = True <NEW_LINE> collection_class = Collection <NEW_LINE> field_map = () <NE... | Container class for model metadata.
You shouldn't modify this class directly, :func:`_configure` should
be used instead. | 625990813346ee7daa3383c9 |
class Phdr64(Struct): <NEW_LINE> <INDENT> type = enums.PType <NEW_LINE> flags = Int2 <NEW_LINE> offset, vaddr, paddr, filesz, memsz, align = 6*(Int3,) | 64 bit program segment header | 6259908197e22403b383c9ce |
class PersonNotFoundException(Exception): <NEW_LINE> <INDENT> pass | Raised when given person was not found on endpoint | 62599081bf627c535bcb2fa0 |
class ExcessStruct(Struct, size=10): <NEW_LINE> <INDENT> _layout_ = dict( a=dict( offset=0, width=32 ) ) <NEW_LINE> a: int | Specified size is larger than fields | 625990813617ad0b5ee07c1e |
class Profile(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User) <NEW_LINE> activation_key = models.CharField(max_length=255, help_text="E-mail activation key.") <NEW_LINE> key_expires = models.DateTimeField(null=True, help_text="Expiration date of activation key.") <NEW_LINE> class Meta(object): <NEW... | Holds additional profile fields of every User like the API keys.
Can be retrieved by the method get_profile() of the User class. | 62599081be7bc26dc9252bbd |
class itkRGBToLuminanceImageFilterIRGBUS3IUS3_Superclass(itkInPlaceImageFilterAPython.itkInPlaceImageFilterIRGBUS3IUS3): <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 co... | Proxy of C++ itkRGBToLuminanceImageFilterIRGBUS3IUS3_Superclass class | 625990817cff6e4e811b7510 |
class EntryForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Entry <NEW_LINE> fields = ['text'] <NEW_LINE> labels = {'text': ''} <NEW_LINE> widgets = {'text': forms.Textarea(attrs={'cols': 80})} | Class for entry forms. | 6259908197e22403b383c9cf |
class CipherTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_one_to_one(self): <NEW_LINE> <INDENT> self.assertTrue(sub_cipher('toot', 'peep')) <NEW_LINE> <DEDENT> def test_one_to_two_correspondence(self): <NEW_LINE> <INDENT> self.assertFalse(sub_cipher('lambda', 'school')) <NEW_LINE> <DEDENT> def test_two_to_one_... | Run several error tests | 625990811f5feb6acb1646c9 |
class IStompServerProtocolFactory(IStompProtocolFactory): <NEW_LINE> <INDENT> pass | Marker interface for a stomp server protocol factory | 625990815166f23b2e244ea8 |
class TestSimpleChanges: <NEW_LINE> <INDENT> def test1(self, spiketrain, weights): <NEW_LINE> <INDENT> neurons, timesteps = spiketrain.shape <NEW_LINE> weights_before = weights.copy() <NEW_LINE> last_spike = spiketrain[:,-1].reshape((neurons, 1)) <NEW_LINE> suggested_weights = np.where(weights_before != 0, weights_befo... | Test simple changes | 6259908166673b3332c31ecf |
class MenuBar(Frame): <NEW_LINE> <INDENT> def __init__(self, boss=None): <NEW_LINE> <INDENT> Frame.__init__(self, borderwidth=2, relief=GROOVE) <NEW_LINE> file_menu = Menubutton(self, text='File') <NEW_LINE> file_menu.pack(side=LEFT, padx=5) <NEW_LINE> me1 = Menu(file_menu) <NEW_LINE> me1.add_command(label='Restart', u... | bar of menu rolling | 62599081d268445f2663a8c6 |
class AlgorithmResultDatabase: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.results = {} <NEW_LINE> self.results_dataset = {} <NEW_LINE> <DEDENT> def get_result(self, algorithm_name: str, test_case: str): <NEW_LINE> <INDENT> return self.results[algorithm_name][test_case] <NEW_LINE> <DEDENT> def has_... | Class to store and retrieve results from algorithms | 62599081656771135c48ad98 |
class TestPatchTodoItem(APITestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> response = createItem(self.client) <NEW_LINE> self.assertEqual(TodoItem.objects.get().completed, False) <NEW_LINE> url = response['Location'] <NEW_LINE> data = {'title': 'perform unit testing', 'completed': True} <NEW_LINE> s... | Ensure that we can update an existing todo item using PATCH | 625990815fdd1c0f98e5fa50 |
class StatusResponse: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.invalid_data = {"Error": "Invalid data accepted"} <NEW_LINE> self.user_not_exist = {"Info": "The user does not exist"} <NEW_LINE> self.no_orders = {"Info": "The user has no orders"} <NEW_LINE> self.no_books = {"Info": "There are no b... | The class contains some statuses
response, which server will return
to users. | 62599081aad79263cf43028c |
class SNLinear(Linear): <NEW_LINE> <INDENT> def __init__(self, in_size, out_size, use_gamma=False, nobias=False, initialW=None, initial_bias=None, Ip=1): <NEW_LINE> <INDENT> self.Ip = Ip <NEW_LINE> self.u = None <NEW_LINE> self.use_gamma = use_gamma <NEW_LINE> super(SNLinear, self).__init__( in_size, out_size, nobias, ... | Linear layer with Spectral Normalization.
Args:
in_size (int): Dimension of input vectors. If ``None``, parameter
initialization will be deferred until the first forward data pass
at which time the size will be determined.
out_size (int): Dimension of output vectors.
wscale (float): Scaling... | 625990817cff6e4e811b7512 |
class NotFound(Exception): <NEW_LINE> <INDENT> def __init__(self, details): <NEW_LINE> <INDENT> self.details = details <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.details | A resource was not found (yields a 404 response). | 6259908197e22403b383c9d1 |
class QActionEvent(__PyQt4_QtCore.QEvent): <NEW_LINE> <INDENT> def action(self): <NEW_LINE> <INDENT> return QAction <NEW_LINE> <DEDENT> def before(self): <NEW_LINE> <INDENT> return QAction <NEW_LINE> <DEDENT> def __init__(self, *__args): <NEW_LINE> <INDENT> pass | QActionEvent(int, QAction, QAction before=None)
QActionEvent(QActionEvent) | 625990815166f23b2e244eaa |
class PusherMissingInstanceError(PusherError, KeyError): <NEW_LINE> <INDENT> pass | Error thrown when the instance id used does not exist | 625990817c178a314d78e953 |
@dataclass(frozen=True) <NEW_LINE> class PCMFormat: <NEW_LINE> <INDENT> rate: int <NEW_LINE> sample_fmt: PCMSampleFormat <NEW_LINE> channels: int <NEW_LINE> @property <NEW_LINE> def sample_duration(self) -> float: <NEW_LINE> <INDENT> return 1.0 / self.rate <NEW_LINE> <DEDENT> @property <NEW_LINE> def pyaudio_args(self)... | A dataclass to raw PCM format parameters | 62599081091ae35668706711 |
class LayerAdaptor(nn.Module): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> if config.adaptor_type == 'bottleneck': <NEW_LINE> <INDENT> self.self = EfficientAdaptorLayer(config) <NEW_LINE> <DEDENT> if 'film' in config.adaptor_type: <NEW_LINE> <INDENT> self.self = App... | this can be three things:
- a parametrized MLP on hidden states
- FiLM, where the parameters are amortized (given by a function of a task_embedding)
- low rank transform on hidden states, where parameters amortized as above | 625990817d847024c075deaf |
class MuscleDeleteView(WgerDeleteMixin, DeleteView, WgerPermissionMixin): <NEW_LINE> <INDENT> model = Muscle <NEW_LINE> success_url = reverse_lazy('muscle-overview') <NEW_LINE> permission_required = 'exercises.delete_muscle' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(MuscleDele... | Generic view to delete an existing muscle | 625990812c8b7c6e89bd52b7 |
class StackedBiLSTMDenseHParams(TrainHParams): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(StackedBiLSTMDenseHParams, self).__init__() <NEW_LINE> self.bilstm_retseq_layer_num = 2 <NEW_LINE> self.state_dim = 300 <NEW_LINE> self.lstm_p_dropout = 0.5 <NEW_LINE> self.kernel_l2_lambda = 1e-5 <NEW_LINE>... | The best result is a val_accuracy of about 90.12%. | 6259908123849d37ff852b8b |
class BlogAuthor(models.Model): <NEW_LINE> <INDENT> name = models.ForeignKey(User,on_delete=models.PROTECT) <NEW_LINE> biography = models.TextField() <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name.username <NEW_LINE> <DEDENT> def get_absolute_url(self): <NEW_LINE> <INDENT> return reverse('blog-autho... | Model representing a blog author. | 62599081a05bb46b3848be91 |
class Config(object): <NEW_LINE> <INDENT> address = '0.0.0.0' <NEW_LINE> port = 8088 <NEW_LINE> incl_access_control_allow_origin = False <NEW_LINE> incl_access_control_allow_credentials = False <NEW_LINE> validate_callback = None <NEW_LINE> validate_exclude_paths = None <NEW_LINE> mapper_name = None | Config to be passed to the Server
Attributes:
address (str): The address to be used by the server.
port (int): The port to be used by the server.
incl_access_control_allow_origin (bool): Determines if
'Access-Control-Allow-Origin' should be includedin the servers
response header or not.
... | 625990813617ad0b5ee07c22 |
class Integer(int): <NEW_LINE> <INDENT> MAX_VALUE = sys.maxsize <NEW_LINE> @staticmethod <NEW_LINE> def parseInt(text): <NEW_LINE> <INDENT> return int(text or 0) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def parseLong(text): <NEW_LINE> <INDENT> try: return int(text or 0) <NEW_LINE> except: return int(text or 0) | Partial implementation of Java Integer type.
| 6259908171ff763f4b5e927f |
class HttpClientTestFailureReason(Base): <NEW_LINE> <INDENT> __tablename__ = 'HttpClientTestFailureReason' <NEW_LINE> __table_args__ = {'useexisting' : True} <NEW_LINE> id = Column("Id", Integer, primary_key=True) <NEW_LINE> reason = Column("Reason", String(5000), nullable=False) | For the Failed tests on the client side
we store the reason of failure in this Table | 625990814428ac0f6e65a002 |
class Segment(object): <NEW_LINE> <INDENT> def __init__(self, begin, end, label=None, signal=None): <NEW_LINE> <INDENT> self._begin = begin <NEW_LINE> self._end = end <NEW_LINE> self._label = label <NEW_LINE> self._signal = signal <NEW_LINE> <DEDENT> def get_begin_time(self): <NEW_LINE> <INDENT> return self._begin <NEW... | Base Segment, a time begin-end pair with a reference to the base signal and a name. | 62599081ec188e330fdfa37e |
class Conversation(core_models.TimeStampedModel): <NEW_LINE> <INDENT> participants = models.ManyToManyField( "users.User", related_name="conversation", blank=True ) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> usernames = [] <NEW_LINE> for user in self.participants.all(): <NEW_LINE> <INDENT> usernames.append(user)... | Conversation Model Definition | 625990811f5feb6acb1646cd |
class LGeoControl(tornado.web.UIModule): <NEW_LINE> <INDENT> def render(self, host="localhost:8080/mapapi", earth="earth",map="lmap"): <NEW_LINE> <INDENT> return self.render_string('template/ui_templates/plugin-geo-control.html', host=host, map=map, earth=earth, ) | this is a controller to controll geo. | 625990815fdd1c0f98e5fa53 |
class UnionFind: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.weights = {} <NEW_LINE> self.parents = {} <NEW_LINE> <DEDENT> def __getitem__(self, object): <NEW_LINE> <INDENT> if object not in self.parents: <NEW_LINE> <INDENT> self.parents[object] = object <NEW_LINE> self.weights[object] = 1 <NEW_LIN... | Union-find data structure.
Each unionFind instance X maintains a family of disjoint sets of
hashable objects, supporting the following two methods:
- X[item] returns a name for the set containing the given item.
Each set is named by an arbitrarily-chosen one of its members; as
long as the set remains unchanged it... | 625990814f88993c371f128c |
class pet: <NEW_LINE> <INDENT> max_energy = 100 <NEW_LINE> max_toilet = 100 <NEW_LINE> max_health = 100 <NEW_LINE> def __init__(self, pet_name = 'Peto'): <NEW_LINE> <INDENT> self.hunger_level = 0 <NEW_LINE> self.happiness_level = 50 <NEW_LINE> self.name = pet_name <NEW_LINE> self.energy_level = 100 <NEW_LINE> self.toil... | Encompases the data and methods that are possible with the pet | 625990813346ee7daa3383cc |
class ModelSelector(object): <NEW_LINE> <INDENT> def __init__(self, words: dict, hwords: dict, this_word: str, n_constant=3, min_n_components=2, max_n_components=10, random_state=None, verbose=False): <NEW_LINE> <INDENT> self.words = words <NEW_LINE> self.hwords = hwords <NEW_LINE> self.sequences = words[this_word] <NE... | base class for model selection (strategy design pattern) | 625990814f6381625f19a219 |
class GPImportCache(CoClass): <NEW_LINE> <INDENT> _reg_clsid_ = GUID('{111FE3A4-4E66-4AF2-A95A-50DD7A7960D1}') <NEW_LINE> _idlflags_ = [] <NEW_LINE> _typelib_path_ = typelib_path <NEW_LINE> _reg_typelib_ = ('{C031A050-82C6-4F8F-8836-5692631CFFE6}', 10, 2) | Import pre-rendered tile cache. | 62599081099cdd3c63676164 |
class DensityMatrix: <NEW_LINE> <INDENT> def __init__(self, header, origin, density, pdbid): <NEW_LINE> <INDENT> self.pdbid = pdbid <NEW_LINE> self.header = header <NEW_LINE> self.origin = origin <NEW_LINE> self.densityArray = density <NEW_LINE> self.density = np.array(density).reshape(header.ncrs[2], header.ncrs[1], h... | :class:`pdb_eda.ccp4.DensityMatrix` that stores data and methods of a ccp4 file. | 625990818a349b6b43687d32 |
@dataclass <NEW_LINE> class SensorSISO(SensorAttributeBase): <NEW_LINE> <INDENT> source: Optional[BaseElement] = None <NEW_LINE> def __post_init__(self) -> None: <NEW_LINE> <INDENT> super().__post_init__() <NEW_LINE> assert self.source <NEW_LINE> assert isinstance(self.source, BaseElement) <NEW_LINE> assert self.attrib... | A sensor for extracting a single element attribute. | 6259908167a9b606de547811 |
class ApplicationGatewaySku(Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'tier': {'key': 'tier', 'type': 'str'}, 'capacity': {'key': 'capacity', 'type': 'int'}, } <NEW_LINE> def __init__(self, name=None, tier=None, capacity=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE>... | SKU of an application gateway.
:param name: Name of an application gateway SKU. Possible values are:
'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', and
'WAF_Large'. Possible values include: 'Standard_Small', 'Standard_Medium',
'Standard_Large', 'WAF_Medium', 'WAF_Large'
:type name: str or :cla... | 62599081be7bc26dc9252bc0 |
class Migration(migrations.Migration): <NEW_LINE> <INDENT> operations = ops | Used for gis-specific migration tests. | 625990815fcc89381b266ec7 |
class RefTable: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._table = None <NEW_LINE> <DEDENT> def initialize(self, content): <NEW_LINE> <INDENT> cols = ['idx', 'param', 'sumstat', 'distance'] <NEW_LINE> self._table = pd.DataFrame(content, columns=cols) <NEW_LINE> <DEDENT> def getRefTable(self): <NE... | Holds the final ABC Table where each row corresponds to one simulation.
Contains information about:
- model index
- summary statistics
- drawn parameters
- distance to observed data | 625990813346ee7daa3383cd |
class Include(Element): <NEW_LINE> <INDENT> @capture_kwargs <NEW_LINE> def __init__( self, file, ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.file = file <NEW_LINE> self._attribute_names = ['file'] | This element does not strictly speaking belong to MJCF. Instead it is
a meta-element, used to assemble multiple XML files in a single document
object model (DOM) before parsing. The included file must be a valid XML
file with a unique top-level element. This top-level element is removed by
the parser, and the elem... | 62599081167d2b6e312b8300 |
class FixedWidthReaderTest(_TabularReaderTest): <NEW_LINE> <INDENT> TEST_CLASS = FixedWidthReader <NEW_LINE> @pytest.fixture <NEW_LINE> def kwargs(self): <NEW_LINE> <INDENT> fields = ( IntField("int", (0, 4), "3d"), ListField("arr", (4, None), ( StringField("x", (0, 4)), StringField("y", (4, 8))))) <NEW_LINE> return {"... | Unit testing for the FixedWidthReader class.
| 6259908160cbc95b06365ad7 |
class UserViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = User.objects.all().order_by('-date_joined') <NEW_LINE> serializer_class = UserSerializer | API endpoint that allows users to be viewed/edited. | 6259908197e22403b383c9d6 |
class State(Printable): <NEW_LINE> <INDENT> _INTERNAL_KEY = 0 <NEW_LINE> def __init__(self, age=0): <NEW_LINE> <INDENT> self.val = { State._INTERNAL_KEY: 0 } <NEW_LINE> self.next_key = State._INTERNAL_KEY + 1 <NEW_LINE> self.age = age <NEW_LINE> <DEDENT> def add_remote(self, age=0): <NEW_LINE> <INDENT> res = self.next_... | Represents the local displacement from the "initial value".
The "initial value" is what the local server was initilzied with, ie empty for
a central server of the value given to a remote server.
The displacement distance is tracked in terms of the number of changes made,
in the positive "axis" of the remote that made... | 625990814f6381625f19a21a |
class linear_regression_2: <NEW_LINE> <INDENT> def __init__(self, train_data, theta = 0): <NEW_LINE> <INDENT> self.theta = theta <NEW_LINE> self.train_dat = train_data <NEW_LINE> <DEDENT> def train(self ,variable_name, poly_order): <NEW_LINE> <INDENT> y = self.train_dat.mpg.values <NEW_LINE> self.var = variable_name <N... | modify the linear regression solver to train all variable | 625990813617ad0b5ee07c26 |
class EnumField(TextField): <NEW_LINE> <INDENT> enum_types_list = dict() <NEW_LINE> def __init__(self, choices, enum_type = None, **kwargs): <NEW_LINE> <INDENT> self.enum_type = enum_type <NEW_LINE> self.choices = {} <NEW_LINE> self.localized = {} <NEW_LINE> for key, value in choices.iteritems(): <NEW_LINE> <INDENT> tr... | Field that may contain one of the many predefined values. | 6259908155399d3f05627feb |
class InDir(object): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> self.new_path = path <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.old_path = os.getcwd() <NEW_LINE> os.chdir(self.new_path) <NEW_LINE> <DEDENT> def __exit__(self, type, value, traceback): <NEW_LINE> <INDENT> os.c... | A Context Manager that changes directories temporarily and safely. | 625990811f5feb6acb1646d1 |
class IngredientViewSet(BaseRecipeAttrViewSet): <NEW_LINE> <INDENT> queryset = Ingredient.objects.all() <NEW_LINE> serializer_class = serializers.IngredientSerializer | Manage Ingredients in the databases | 62599081e1aae11d1e7cf57e |
class AdminAjaxUsersHandler(BaseHandler): <NEW_LINE> <INDENT> @restrict_ip_address <NEW_LINE> @authenticated <NEW_LINE> @authorized(ADMIN_PERMISSION) <NEW_LINE> def get(self, *args, **kwargs): <NEW_LINE> <INDENT> uuid = self.get_argument('uuid', '') <NEW_LINE> user = User.by_uuid(uuid) <NEW_LINE> if user is not None: <... | Handles AJAX data for admin handlers | 6259908150812a4eaa621931 |
class PowerControlDeviceOutletResource(DeleteablePowerObjectResource): <NEW_LINE> <INDENT> device = fields.ToOneField('chroma_api.power_control.PowerControlDeviceResource', 'device') <NEW_LINE> host = fields.ToOneField('chroma_api.host.HostResource', 'host', null = True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> query... | An outlet (individual host power control entity) associated with a
Power Control Device. | 62599081adb09d7d5dc0c031 |
class ValidateAvaRigFormat(pyblish.api.InstancePlugin): <NEW_LINE> <INDENT> label = "Rig Format" <NEW_LINE> order = pyblish.api.ValidatorOrder <NEW_LINE> hosts = ["maya"] <NEW_LINE> families = ["ava.rig"] <NEW_LINE> def process(self, instance): <NEW_LINE> <INDENT> from maya import cmds <NEW_LINE> missing = list() <NEW_... | A rig must have a certain hierarchy and members
- Must reside within `rig_GRP` transform
- out_SET
- controls_SET
- in_SET (optional)
- resources_SET (optional) | 62599081f9cc0f698b1c6038 |
class UnicodeInput(IOBase): <NEW_LINE> <INDENT> def __init__(self, hConsole, name, bufsize=1024): <NEW_LINE> <INDENT> self._hConsole = hConsole <NEW_LINE> self.bufsize = bufsize <NEW_LINE> self.buffer = create_unicode_buffer(bufsize) <NEW_LINE> self.name = name <NEW_LINE> self.encoding = 'utf-8' <NEW_LINE> <DEDENT> def... | Unicode terminal input class. | 62599081bf627c535bcb2faa |
class Solver (object): <NEW_LINE> <INDENT> def solve (self, tripcode, *args): <NEW_LINE> <INDENT> raise NotImplementedError ( 'Solver derivatives must implement this method!' ) | Base class for solvers. | 625990817047854f46340e8d |
class IPMR2AboveContentBodyPortlets(IPortletManager): <NEW_LINE> <INDENT> pass | PMR2 Portlets that sits above the content body.
| 62599081283ffb24f3cf5379 |
class VivadoSessionContextAdapter(object): <NEW_LINE> <INDENT> def __init__(self, aManager, aCloseOnExit, aSId): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._console = None <NEW_LINE> self._mgr = aManager <NEW_LINE> self._sid = aSId <NEW_LINE> self._closeonexit = aCloseOnExit <NEW_LINE> <DEDENT> def __enter_... | Summary
| 6259908155399d3f05627fed |
class DuplicationError(Exception): <NEW_LINE> <INDENT> implements(IDuplicationError) | A duplicate registration was attempted | 6259908150812a4eaa621932 |
class requestObjMsg( negGuiObjMsg ): <NEW_LINE> <INDENT> def __init__(self, requestNr, typeNr, parentKey, params =None): <NEW_LINE> <INDENT> negGuiMsg.__init__(self, REQUEST_OBJ_SIGNAL, requestNr, parentKey) <NEW_LINE> self.typeNr = typeNr <NEW_LINE> self.params = params <NEW_LINE> <DEDENT> def send(self): <NEW_LINE> <... | msg from gui to negotiator to request a new object | 6259908197e22403b383c9d9 |
class ConsoleValidationException(Exception): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> Exception.__init__(self, *args, **kwargs) | Clasa de erori pentru console | 625990814a966d76dd5f09c0 |
class Notebook(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.notes = [] <NEW_LINE> <DEDENT> def find_note(self, note_id): <NEW_LINE> <INDENT> for note in self.notes: <NEW_LINE> <INDENT> if note.id == note: <NEW_LINE> <INDENT> return note <NEW_LINE> <DEDENT> <DEDENT> return None <NEW_LINE> <DEDENT>... | Represent a collection of notes that can be tagged,
modified, and searched. | 6259908144b2445a339b76ca |
class AlgorithmHandler(object): <NEW_LINE> <INDENT> def start_algorithm(self): <NEW_LINE> <INDENT> config = configparser.ConfigParser() <NEW_LINE> config.read(os.path.dirname(os.path.abspath(__file__)) + "/config.ini") <NEW_LINE> dataset = os.path.join(os.path.dirname(os.path.abspath(__file__)) + r"/tweets.json") <NEW_... | class for starting the algorithm | 6259908155399d3f05627fef |
class FluentAppIndexDashboard(AppIndexDashboard): <NEW_LINE> <INDENT> title = '' <NEW_LINE> def __init__(self, app_title, models, **kwargs): <NEW_LINE> <INDENT> super(FluentAppIndexDashboard, self).__init__(app_title, models, **kwargs) <NEW_LINE> self.children += ( self.get_model_list_module(), self.get_recent_actions_... | A custom application index page for the Django admin interface.
This dashboard is displayed when one specific application is opened via the breadcrumb.
It displays the models and recent actions of the specific application.
To activate the dashboards add the following to your settings.py::
ADMIN_TOOLS_APP_INDEX_DA... | 625990814428ac0f6e65a00a |
class command_grep(HoneyPotCommand): <NEW_LINE> <INDENT> def grep_get_contents(self, filename, match): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> contents = self.fs.file_contents(filename) <NEW_LINE> self.grep_application(contents, match) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> self.errorWrite("grep: {}: No s... | grep command | 625990813d592f4c4edbc8cd |
class DataContainer(VtkWidget): <NEW_LINE> <INDENT> _model_name = Unicode('DataContainerModel').tag(sync=True) <NEW_LINE> kind = Unicode().tag(sync=True) <NEW_LINE> attributes = Dict().tag(sync=True) <NEW_LINE> data_arrays = VarTuple(Instance(DataArray)).tag(sync=True, **widget_serialization) <NEW_LINE> def __init__(se... | A structure that holds a sequence of DataArrays.
Represents things like Cells, Points, Verts, Lines, Strips, Polys,
CellData, and PointData. | 62599081fff4ab517ebcf2f2 |
class BlockWithTimestampMixin(object): <NEW_LINE> <INDENT> __slots__ = [] <NEW_LINE> @property <NEW_LINE> def timestamp(self): <NEW_LINE> <INDENT> return ( (self.timestamp_high << 32) + self.timestamp_low ) * self.timestamp_resolution <NEW_LINE> <DEDENT> @property <NEW_LINE> def timestamp_resolution(self): <NEW_LINE> <... | Block mixin adding properties to better access timestamps
of blocks that provide one. | 62599081ad47b63b2c5a932d |
class Square: <NEW_LINE> <INDENT> pass | empty Square class | 6259908160cbc95b06365ada |
@py2to3 <NEW_LINE> class Message(ModelObject): <NEW_LINE> <INDENT> __slots__ = ['message', 'level', 'html', 'timestamp', '_sort_key'] <NEW_LINE> def __init__(self, message='', level='INFO', html=False, timestamp=None, parent=None): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> self.level = level <NEW_LINE> self... | A message outputted during the test execution.
The message can be a log message triggered by a keyword, or a warning
or an error occurred during the test execution. | 62599081adb09d7d5dc0c035 |
class TestGMT(unittest.TestCase): <NEW_LINE> <INDENT> def test_parse_standard(self): <NEW_LINE> <INDENT> x = list(parse_gmt_file(TEST_GMT_PATH)) <NEW_LINE> self.assertEqual(3, len(x)) <NEW_LINE> self.assertEqual("HALLMARK_TNFA_SIGNALING_VIA_NFKB", x[0][0]) <NEW_LINE> self.assertEqual( "http://www.gsea-msigdb.org/gsea/m... | Test parsing GMT files. | 625990814f6381625f19a21d |
class UserProFileAdmin(object): <NEW_LINE> <INDENT> list_display = ['id', "name", "nickName", "mobile", "gender", 'language', 'country', 'province', 'city'] <NEW_LINE> search_fields = ["name", "nickName", "mobile", "gender", 'language', 'country', 'province', 'city'] <NEW_LINE> list_filter = ["name", "nickName", "mobil... | 用户表显示 | 62599081d8ef3951e32c8bce |
class ContentRichTextPlugin(IntegrationFormElementPlugin, DRFSubmitPluginFormDataMixin): <NEW_LINE> <INDENT> uid = UID <NEW_LINE> integrate_with = INTEGRATE_WITH_UID <NEW_LINE> name = _("Content rich text") <NEW_LINE> group = _("Content") <NEW_LINE> def get_custom_field_instances(self, form_element_plugin, request=None... | Content rich text (CharField) plugin. | 625990815fcc89381b266ecb |
class Stacked(Network): <NEW_LINE> <INDENT> def __init__(self,nets): <NEW_LINE> <INDENT> self.nets = nets <NEW_LINE> <DEDENT> def forward(self,xs): <NEW_LINE> <INDENT> for i,net in enumerate(self.nets): <NEW_LINE> <INDENT> xs = net.forward(xs) <NEW_LINE> <DEDENT> return xs | Stack two networks on top of each other. | 6259908199fddb7c1ca63b48 |
class EncodeOrReplaceWriter(object): <NEW_LINE> <INDENT> def __init__(self, out): <NEW_LINE> <INDENT> self._encoding = getattr(out, 'encoding', None) or 'ascii' <NEW_LINE> self._write = out.write <NEW_LINE> <DEDENT> def write(self, data): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self._write(data) <NEW_LINE> <DEDENT... | Write-only file-ish object which replaces unsupported chars when
underlying file rejects them. | 625990812c8b7c6e89bd52c3 |
class HPUXNetwork(Network): <NEW_LINE> <INDENT> platform = 'HP-UX' <NEW_LINE> def populate(self): <NEW_LINE> <INDENT> netstat_path = self.module.get_bin_path('netstat') <NEW_LINE> if netstat_path is None: <NEW_LINE> <INDENT> return self.facts <NEW_LINE> <DEDENT> self.get_default_interfaces() <NEW_LINE> interfaces = sel... | HP-UX-specifig subclass of Network. Defines networking facts:
- default_interface
- interfaces (a list of interface names)
- interface_<name> dictionary of ipv4 address information. | 62599081442bda511e95dac5 |
class Solution: <NEW_LINE> <INDENT> def fullJustify(self, words, maxWidth): <NEW_LINE> <INDENT> if not words: <NEW_LINE> <INDENT> return [""] <NEW_LINE> <DEDENT> line, length = [], 0 <NEW_LINE> results = [] <NEW_LINE> for w in words: <NEW_LINE> <INDENT> if length + len(w) + len(line) <= maxWidth: <NEW_LINE> <INDENT> le... | @param words: an array of string
@param maxWidth: a integer
@return: format the text such that each line has exactly maxWidth characters and is fully | 625990813d592f4c4edbc8ce |
class NoHandler(AbstractRequestHandler): <NEW_LINE> <INDENT> def can_handle(self, handler_input): <NEW_LINE> <INDENT> playback_info = util.get_playback_info(handler_input) <NEW_LINE> return (not playback_info.get("in_playback_session") and is_intent_name("AMAZON.NoIntent")( handler_input)) <NEW_LINE> <DEDENT> def handl... | Handler for No intent when audio is not playing. | 625990817cff6e4e811b751e |
class StdLibProbe(Probe): <NEW_LINE> <INDENT> def get_distro(self): <NEW_LINE> <INDENT> name = None <NEW_LINE> version = UNKNOWN_DISTRO_VERSION <NEW_LINE> release = UNKNOWN_DISTRO_RELEASE <NEW_LINE> arch = UNKNOWN_DISTRO_ARCH <NEW_LINE> d_name, d_version_release, d_codename = platform.dist() <NEW_LINE> if d_name: <NEW_... | Probe that uses the Python standard library builtin detection
This Probe has a lower score on purporse, serving as a fallback
if no explicit (and hopefully more accurate) probe exists. | 6259908166673b3332c31edd |
class ArchiveToStageTransformer(Transformer): <NEW_LINE> <INDENT> @log_aware(log) <NEW_LINE> def __init__(self, origin_structure): <NEW_LINE> <INDENT> log_init_attempt(self, log, locals()) <NEW_LINE> self.origin_structure = origin_structure <NEW_LINE> self.destination_structure = None <NEW_LINE> log_init_success(self, ... | The StageToARrchiveTransformer takes an instance of a Stage structure
and copies its contents into an instance of an Archive structure | 6259908197e22403b383c9dd |
class Calle(models.Model): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Calle, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> ciudad = models.ForeignKey(Ciudad) <NEW_LINE> calle = models.CharField(max_length=100) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.ca... | docstring for Calle | 625990815fdd1c0f98e5fa5e |
class WM_OT_blenderplayer_start(Operator): <NEW_LINE> <INDENT> bl_idname = "wm.blenderplayer_start" <NEW_LINE> bl_label = "Start Game In Player" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> import os <NEW_LINE> import sys <NEW_LINE> import subprocess <NEW_LINE> gs = context.scene.game_settings <NEW_LINE> ... | Launch the blender-player with the current blend-file | 62599081f9cc0f698b1c603b |
class ReplaceVocabUnslicer(LeafUnslicer): <NEW_LINE> <INDENT> opentype = ('set-vocab',) <NEW_LINE> unslicerRegistry = BananaUnslicerRegistry <NEW_LINE> maxKeys = None <NEW_LINE> valueConstraint = ByteStringConstraint(100) <NEW_LINE> def setConstraint(self, constraint): <NEW_LINE> <INDENT> if isinstance(constraint, Any)... | Much like DictUnslicer, but keys must be numbers, and values must be
strings. This is used to set the entire vocab table at once. To add
individual tokens, use AddVocabUnslicer by sending an (add-vocab num
string) sequence. | 62599081099cdd3c63676169 |
class MethodValidateMiddleware: <NEW_LINE> <INDENT> def __init__(self, get_response): <NEW_LINE> <INDENT> self.get_response = get_response <NEW_LINE> <DEDENT> def __call__(self, request: HttpRequest): <NEW_LINE> <INDENT> response = self.get_response(request) <NEW_LINE> return response <NEW_LINE> <DEDENT> def process_vi... | 处理请求 Method 的中间件 | 625990813617ad0b5ee07c2e |
class Grammar(object): <NEW_LINE> <INDENT> instance = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.variables = dict() <NEW_LINE> self.declarations = dict() <NEW_LINE> self.constants = dict() <NEW_LINE> <DEDENT> def process(self): <NEW_LINE> <INDENT> for key in JavaToPyConfig.declarations: <NEW_LINE> <IN... | Read a complete grammar into memory. | 6259908144b2445a339b76cc |
class ImportJobs: <NEW_LINE> <INDENT> def __init__(self, lime_client): <NEW_LINE> <INDENT> self.lime_client = lime_client <NEW_LINE> <DEDENT> def create(self, import_config): <NEW_LINE> <INDENT> url = '/importjobs/' <NEW_LINE> job = ImportJob.create(import_config, self.lime_client) <NEW_LINE> r = self.lime_client.post(... | Handles the creation of a new import job.
:param lime_client: a logged in :class:`LimeClient` instance | 62599081283ffb24f3cf537f |
class MinimumSectionTimeValidator(Validator): <NEW_LINE> <INDENT> def rule_name(self): <NEW_LINE> <INDENT> return "Minimum section time" <NEW_LINE> <DEDENT> def validate(self, problem, solution): <NEW_LINE> <INDENT> errors = [] <NEW_LINE> return errors | Planning rule #103
Minimum section time
For each *train_run_section* the following holds:
t_exit - t_entry >= minimum_running_time + min_stopping_time,
where t_entry, t_exit are the entry and exit times into this *train_run_section*,
*minimum_running_time* is given by the *route_section* corresponding to this *train... | 62599081d8ef3951e32c8bcf |
class RunSubCommand(SubCommand): <NEW_LINE> <INDENT> NAME = None <NEW_LINE> DESCRIPTION = None <NEW_LINE> def add_specific_arguments(self, parser): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def add_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument( "topology_jar", metavar="TOPOLOGY_JAR", help="Path to... | Run subcommand class. | 625990812c8b7c6e89bd52c5 |
class TestRecomVirtualCategory(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 testRecomVirtualCategory(self): <NEW_LINE> <INDENT> pass | RecomVirtualCategory unit test stubs | 62599081091ae3566870671f |
class LoginPage(Page): <NEW_LINE> <INDENT> url = '/index' <NEW_LINE> login_username_loc = (By.NAME, "username") <NEW_LINE> login_password_loc = (By.ID, "pass") <NEW_LINE> login_button_loc = (By.CLASS_NAME, "but") <NEW_LINE> def login_username(self, username): <NEW_LINE> <INDENT> self.find_element(*self.login_username_l... | 用户登录页面 | 625990814f88993c371f1292 |
class InputSchema(object): <NEW_LINE> <INDENT> def __init__(self, schema): <NEW_LINE> <INDENT> self.__context = msgs.INPUT_EV_CONTEXT_BROWSER <NEW_LINE> self.__event = None <NEW_LINE> self.__mapping = {} <NEW_LINE> try: <NEW_LINE> <INDENT> logging.debug("parsing schema") <NEW_LINE> self.__parse_schema(schema) <NEW_LINE... | Class for parsing and representing an input schema. The input schema is
a state machine. | 62599081ad47b63b2c5a9331 |
@content( 'workinggroup', icon='glyphicon glyphicon-align-left', ) <NEW_LINE> @implementer(IWorkingGroup) <NEW_LINE> class WorkingGroup(VisualisableElement, Entity): <NEW_LINE> <INDENT> name = renamer() <NEW_LINE> template = 'pontus:templates/visualisable_templates/object.pt' <NEW_LINE> proposal = SharedUniqueProperty(... | Working group class | 62599081656771135c48ada0 |
class FastqSampleExtractAgent(Agent): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> super(FastqSampleExtractAgent, self).__init__(parent) <NEW_LINE> options = [ {"name": "in_fastq", "type": "infile", "format": "sequence.fastq"}, {"name": "file_sample_list", "type": "outfile", "format": "sequence.i... | 从fastq或者fastq文件夹里提取样本的信息 | 625990814c3428357761bd9c |
class InputFile(base.TelegramObject): <NEW_LINE> <INDENT> def __init__(self, path_or_bytesio: Union[str, io.IOBase, Path, '_WebPipe'], filename=None, conf=None): <NEW_LINE> <INDENT> super(InputFile, self).__init__(conf=conf) <NEW_LINE> if isinstance(path_or_bytesio, str): <NEW_LINE> <INDENT> self._file = open(path_or_b... | This object represents the contents of a file to be uploaded.
Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.
Also that is not typical TelegramObject!
https://core.telegram.org/bots/api#inputfile | 6259908144b2445a339b76cd |
class Alias(Base, Email): <NEW_LINE> <INDENT> __tablename__ = "alias" <NEW_LINE> domain = db.relationship(Domain, backref=db.backref('aliases', cascade='all, delete-orphan')) <NEW_LINE> wildcard = db.Column(db.Boolean(), nullable=False, default=False) <NEW_LINE> destination = db.Column(CommaSeparatedList, nullable=Fals... | An alias is an email address that redirects to some destination.
| 62599081d8ef3951e32c8bd0 |
class CallValidation(GlobalValidationToken, Generic[T]): <NEW_LINE> <INDENT> def __init__(self, func: Callable[..., T], *args, **kwargs): <NEW_LINE> <INDENT> self.func = func <NEW_LINE> self.args = args <NEW_LINE> self.kwargs = kwargs <NEW_LINE> <DEDENT> def inner(self, v): <NEW_LINE> <INDENT> return self.func(v, *self... | An validation token to call arbitrary functions | 625990811f5feb6acb1646db |
class BaseGeometry: <NEW_LINE> <INDENT> def area(self): <NEW_LINE> <INDENT> raise Exception('area() is not implemented') <NEW_LINE> <DEDENT> def integer_validator(self, name, value): <NEW_LINE> <INDENT> if type(value) != int: <NEW_LINE> <INDENT> raise TypeError("{} must be an integer".format(name)) <NEW_LINE> <DEDENT> ... | Defines BaseGeometry. | 62599081ec188e330fdfa38c |
class GeoIndex(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.index = {} <NEW_LINE> self.search_service = lookup("SearchService") <NEW_LINE> self.id_service = lookup("IdLookup") <NEW_LINE> self.kdindex = kdtree.create(dimensions=2) <NEW_LINE> <DEDENT> def add(self, record): <NEW_LINE> <INDENT... | Geo index service using lang, lat | 625990814f88993c371f1293 |
class NestedDict(dict): <NEW_LINE> <INDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return self.setdefault(key, self.__class__()) | Automated nested dictionary.
>>> nd = NestedDict()
>>> nd['a']['b']['c'] = 1
>>> nd
{'a': {'b': {'c': 1}}} | 62599081656771135c48ada1 |
class PluginNotFound(Exception): <NEW_LINE> <INDENT> pass | Raised when the plugin could not be found in the rendering process. | 62599081f548e778e596d074 |
class TaskList(models.Model): <NEW_LINE> <INDENT> title = models.CharField( max_length=50, unique=True, ) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.title <NEW_LINE> <DEDENT> def is_complete(self): <NEW_LINE> <INDENT> return all(task.is_done for task in self.task_set.all()) | List of tasks. | 6259908150812a4eaa621936 |
class LinearWarmup(LambdaLR): <NEW_LINE> <INDENT> def __init__(self, optimizer, warmup_steps, last_epoch=-1): <NEW_LINE> <INDENT> self.warmup_steps = warmup_steps <NEW_LINE> self.complete = False <NEW_LINE> super(LinearWarmup, self).__init__(optimizer, self.lr_lambda, last_epoch=last_epoch) <NEW_LINE> <DEDENT> def lr_l... | Linear warmup and then constant.
Linearly increases learning rate schedule from 0 to 1 over `warmup_steps` training steps.
Keeps learning rate schedule equal to 1. after warmup_steps.
From https://bit.ly/39o2W1f | 625990811f5feb6acb1646dd |
class JavaObject(object): <NEW_LINE> <INDENT> def __init__(self, full_class_name=None, args_list=None,): <NEW_LINE> <INDENT> self.full_class_name = full_class_name <NEW_LINE> self.args_list = args_list <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.... | Attributes:
- full_class_name
- args_list | 6259908155399d3f05627ff7 |
class TrainModel: <NEW_LINE> <INDENT> def __init__(self, run_id, data_path): <NEW_LINE> <INDENT> self.run_id = run_id <NEW_LINE> self.data_path = data_path <NEW_LINE> self.logger = Logger(self.run_id, 'TrainModel', 'training') <NEW_LINE> self.loadValidate = LoadValidate(self.run_id, self.data_path, 'training') <NEW_LIN... | *****************************************************************************
*
* filename: TrainModel.py
* version: 1.0
* author:
* creation date:
*
*
*
*
* description: Class to training the models
*
**************************************************************************** | 625990817cff6e4e811b7525 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.