code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class LocalConfig(LocalBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> LocalBase.__init__(self, 'flink') <NEW_LINE> self.source = 'http://mirrors.shu.edu.cn/apache/flink/flink-1.7.1/flink-1.7.1-bin-scala_2.11.tgz' | 默认配置
| 62598f12d8ef3951e32c746b |
class B: <NEW_LINE> <INDENT> def m1(self): <NEW_LINE> <INDENT> print("Parent Class B") | This is Parent Class | 62598f12a219f33f346c545a |
class FortranModuleIndex(Index): <NEW_LINE> <INDENT> name = 'modindex' <NEW_LINE> localname = l_('Fortran Module Index') <NEW_LINE> shortname = l_('fortran modules') <NEW_LINE> def generate(self, docnames=None): <NEW_LINE> <INDENT> content = {} <NEW_LINE> ignores = self.domain.env.config['modindex_common_prefix'] <NEW_... | Index subclass to provide the Fortran module index. | 62598f12091ae35668703839 |
class UserViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = User.objects.all() <NEW_LINE> serializer_class = UserSerializer <NEW_LINE> permission_classes = [permissions.IsAuthenticated] | API endpoint that allows Users to be viewed or edited. | 62598f12656771135c4882bb |
class DisableReadWriteProxyInternetAccessRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(DisableReadWriteProxyInternetAccessRequest, self).__init__( '/regions/{regionId}/readWriteProxy/{readWriteProxyId}:disableReadWriteProxyInternetAcces... | 关闭读写分离代理服务的外网访问功能。关闭后,用户无法通过 Internet 连接读写分离代理服务,但可以在京东云内网通过内网域名连接<br>- 仅支持MySQL | 62598f1250812a4eaa620204 |
class NumberMaze(Maze): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> super().__init__(filename) <NEW_LINE> <DEDENT> def isWall(self, square): <NEW_LINE> <INDENT> return square == '1' <NEW_LINE> <DEDENT> def isOpen(self, square): <NEW_LINE> <INDENT> return square == '0' <NEW_LINE> <DEDENT> def i... | A subclass of Maze that works with a file-format in which the types of squares in the maze are written as numbers | 62598f12a05bb46b384894ab |
class RegistroB990(Registro): <NEW_LINE> <INDENT> campos = [ CampoFixo(1, 'REG', 'B990'), CampoNumerico(2, 'QTD_LIN_B', 2), ] | ENCERRAMENTO DO BLOCO B | 62598f12adb09d7d5dc091d8 |
class ComplexAbs(ComplexLinear): <NEW_LINE> <INDENT> def __init__(self, idim, odim, rng=None, irange=0.1): <NEW_LINE> <INDENT> super(ComplexAbs, self).__init__(idim, odim, rng, irange) <NEW_LINE> <DEDENT> def fprop(self, inputs): <NEW_LINE> <INDENT> if inputs.ndim > 2: <NEW_LINE> <INDENT> inputs = inputs.reshape(input... | Implements an ADFT (Spectral layer) with $|a|^{2}$ based
activation functions. | 62598f12091ae3566870383b |
class AssessmentStates(BaseStates): <NEW_LINE> <INDENT> NOT_STARTED = "Not Started" <NEW_LINE> READY_FOR_REVIEW = "Ready for Review" <NEW_LINE> VERIFIED = "Verified" | States for Assessments objects. | 62598f12ec188e330fdf74e7 |
class MockImage(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.format = None <NEW_LINE> self.size = None | A mock PIL Image object. | 62598f1250812a4eaa620205 |
class CleanCommand(Command): <NEW_LINE> <INDENT> user_options = [("all", "a", "")] <NEW_LINE> def initialize_options(self): <NEW_LINE> <INDENT> packages = ("pyoperators", "pyoperators.iterative", "pyoperators.utils",) <NEW_LINE> self._clean_me = [] <NEW_LINE> self._clean_trees = [] <NEW_LINE> for toplevel in packages: ... | Custom distutils command to clean the .so and .pyc files. | 62598f129f2886367281742b |
class DailyForvoLimitExceeded(Exception): <NEW_LINE> <INDENT> pass | Used when the daily Forvo API limit is exceeded. | 62598f124a966d76dd5edb07 |
class testScraperBase(unittest.TestCase): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.scraper = kwargs.pop('scraper') <NEW_LINE> self.postSearch = kwargs.pop('postSearch') <NEW_LINE> self.tfile = "test_scraper.yaml" <NEW_LINE> super(testScraperBase, self).__init__(*args, **kwargs) ... | Test the results of search() and postSearch() from a list of
expected results stored in a yaml file. | 62598f120fa83653e46f3b19 |
class SystemRelease(base.Base): <NEW_LINE> <INDENT> CPE_FILE = "/etc/system-release-cpe" <NEW_LINE> VENDOR = None <NEW_LINE> PRODUCT = None <NEW_LINE> VERSION = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(SystemRelease, self).__init__() <NEW_LINE> self.load() <NEW_LINE> <DEDENT> def load(self): <NEW_L... | Informations about the OS based on /etc/system-release-cpe
Use openscap_api.cpe.name_new(str) from openscap-python for an official
way. | 62598f123d592f4c4edb9b19 |
class BodyTemplate4Test(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.template = BodyTemplate4() <NEW_LINE> self.template.set_plain_content('test') <NEW_LINE> self.template.set_image('http://www.baidu.com') <NEW_LINE> self.template.set_background_image('http://www.baidu.com') <NEW_LI... | bodyTemplate测试 | 62598f12091ae3566870383d |
class TradingTime(object): <NEW_LINE> <INDENT> def __init__(self, date, session): <NEW_LINE> <INDENT> mon_thu = [0, 1, 2, 3] <NEW_LINE> fri = 4 <NEW_LINE> if session == 1: <NEW_LINE> <INDENT> self.start = datetime.time( hour=conf_1['start']['hour'], minute=conf_1['start']['minute'] ) <NEW_LINE> if date in mon_thu: <NEW... | Get Trading Time | 62598f1250812a4eaa620206 |
class KnotHash: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.pos = 0 <NEW_LINE> self.step = 0 <NEW_LINE> self.round = 0 <NEW_LINE> self.arr = list(range(0,256)) <NEW_LINE> self.srclens = [] <NEW_LINE> self.hexsrc = list() <NEW_LIN... | calculate a knot hash of a given string input. | 62598f129f2886367281742d |
class NokiaSrosSSH(NokiaSros): <NEW_LINE> <INDENT> pass | Nokia SR OS SSH driver. | 62598f12adb09d7d5dc091dc |
class UnwrappedLine(object): <NEW_LINE> <INDENT> def __init__(self, depth, tokens=None): <NEW_LINE> <INDENT> self.depth = depth <NEW_LINE> self._tokens = tokens or [] <NEW_LINE> self.disable = False <NEW_LINE> if self._tokens: <NEW_LINE> <INDENT> for index, tok in enumerate(self._tokens[1:]): <NEW_LINE> <INDENT> tok.pr... | Represents a single unwrapped line in the output.
Attributes:
depth: indentation depth of this line. This is just a numeric value used to
distinguish lines that are more deeply nested than others. It is not the
actual amount of spaces, which is style-dependent. | 62598f12283ffb24f3cf24dc |
class CsvFile(IFile): <NEW_LINE> <INDENT> def read(self, fileName, isHasTitle=True): <NEW_LINE> <INDENT> dataList = [] <NEW_LINE> with open(fileName, 'r') as fp: <NEW_LINE> <INDENT> reader = csv.reader(fp) <NEW_LINE> for data in reader: <NEW_LINE> <INDENT> if isHasTitle: <NEW_LINE> <INDENT> isHasTitle = False <NEW_LINE... | # 读取csv文件数据
# @params string fileName 要读取的csv文件名
# @params bool isHasTitle 文件中是否有title
#
# @return list dataList 从文件中读取的数据 | 62598f12d8ef3951e32c746f |
class ChangeMessageVisibilityCommand(BaseRSMQCommand): <NEW_LINE> <INDENT> PARAMS = {'qname': {'required': True, 'value': None}, 'id': {'required': True, 'value': None}, 'vt': {'required': False, 'value': None}, 'quiet': {'required': False, 'value': False} } <NEW_LINE> def exec_command(self): <NEW_LINE> <INDENT> client... | Change Message Visibility Timeout Command | 62598f1250812a4eaa620207 |
class OrganizationClientAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('organization', 'client') <NEW_LINE> list_filter = ['organization'] | The Organization Client Admin. | 62598f12ad47b63b2c5a6446 |
class CustomPlaceholder(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'custom_placeholders' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String) <NEW_LINE> original_image_url = db.Column(db.String, nullable=False) <NEW_LINE> thumbnail_image_url = db.Column(db.String, nullable=... | email notifications model class | 62598f1226238365f5fab7c1 |
class DiscoveryList(dict): <NEW_LINE> <INDENT> TEST_URL = 'http://keystone.host:5000/' <NEW_LINE> @utils.positional(2) <NEW_LINE> def __init__(self, href=None, v2=True, v3=True, v2_id=None, v3_id=None, v2_status=None, v2_updated=None, v2_html=True, v2_pdf=True, v3_status=None, v3_updated=None, v3_json=True, v3_xml=True... | A List of version elements.
Creates a correctly structured list of identity service endpoints for
use in testing with discovery.
:param string href: The url that this should be based at.
:param bool v2: Add a v2 element.
:param bool v3: Add a v3 element.
:param string v2_status: The status to use for the v2 element.
... | 62598f1255399d3f0562515c |
class BlockType(SQLAlchemyObjectType): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = BlocktypeModel <NEW_LINE> interfaces = (relay.Node, ) | Таблица учебных модулей. | 62598f12fbf16365ca792cd6 |
class Mod349PartnerRecord(models.Model): <NEW_LINE> <INDENT> _name = 'l10n.es.aeat.mod349.partner_record' <NEW_LINE> _description = 'AEAT 349 Model - Partner record' <NEW_LINE> _rec_name = 'partner_vat' <NEW_LINE> _order = 'operation_key asc' <NEW_LINE> @api.one <NEW_LINE> @api.depends('partner_vat', 'country_id', 'tot... | AEAT 349 Model - Partner record
Shows total amount per operation key (grouped) for each partner | 62598f12956e5f7376df4c98 |
class Reaction(object): <NEW_LINE> <INDENT> def __init__(self, reactant, product, ts, reactant_file=None, product_file=None, ts_file=None): <NEW_LINE> <INDENT> self.reactant = reactant <NEW_LINE> self.product = product <NEW_LINE> self.ts = ts <NEW_LINE> self.reactant_file = reactant_file <NEW_LINE> self.product_file = ... | Simple class to store a reaction. | 62598f12283ffb24f3cf24de |
class TestOFPErrorMsg(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 test_init(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_parser(self): <NEW_LINE> <INDENT> version = {'buf': b'\x... | Test case for ofproto_v1_0_parser.OFPErrorMsg
| 62598f12ad47b63b2c5a6447 |
class SessionAndCookieTestCase(TestCase): <NEW_LINE> <INDENT> def test_session_and_cookie(self): <NEW_LINE> <INDENT> engine = import_module(settings.SESSION_ENGINE) <NEW_LINE> store = engine.SessionStore() <NEW_LINE> store.save() <NEW_LINE> self.client.cookies[settings.SESSION_COOKIE_NAME] = store.session_key <NEW_LINE... | def post_comment(request, new_comment):
if request.session.get('has_commented', False):
return HttpResponse("You've already commented.")
c = comments.Comment(comment=new_comment)
c.save()
request.session['has_commented'] = True
return HttpResponse('Thanks for your comment!') | 62598f1360cbc95b06362f69 |
class Arrays(object): <NEW_LINE> <INDENT> swagger_types = { 'arrays': 'list[FixedReferenceFqdn]' } <NEW_LINE> attribute_map = { 'arrays': 'arrays' } <NEW_LINE> required_args = { } <NEW_LINE> def __init__( self, arrays=None, ): <NEW_LINE> <INDENT> if arrays is not None: <NEW_LINE> <INDENT> self.arrays = arrays <NEW_LINE... | Attributes:
swagger_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. | 62598f1397e22403b3839b1c |
class BaseDBConnection(object): <NEW_LINE> <INDENT> _handle = None <NEW_LINE> _connected = False <NEW_LINE> provider = None <NEW_LINE> placeholder = '?' <NEW_LINE> testing = False <NEW_LINE> def __init__(self, testing: bool = False): <NEW_LINE> <INDENT> self.testing = testing <NEW_LINE> <DEDENT> def __del__(self): <NEW... | Base Connection Object | 62598f13ab23a570cc2d4389 |
class CaptureBuildStartTime(CaptureBuildTimes): <NEW_LINE> <INDENT> def __init__(self, builder_name, callback=None): <NEW_LINE> <INDENT> def default_callback(start_time): <NEW_LINE> <INDENT> return start_time.isoformat() <NEW_LINE> <DEDENT> if not callback: <NEW_LINE> <INDENT> callback = default_callback <NEW_LINE> <DE... | Capture methods for capturing build start times. | 62598f13377c676e912f6382 |
@attr.s(slots=True, frozen=True, init=False) <NEW_LINE> class PhaseSequence(PhaseCollectionNode): <NEW_LINE> <INDENT> nodes = attr.ib(type=Tuple[phase_nodes.PhaseNode, ...]) <NEW_LINE> name = attr.ib(type=Optional[Text], default=None) <NEW_LINE> def __init__(self, *args: SequenceInitializerT, **kwargs: Any): <NEW_LINE>... | A node that collects a sequence of phase nodes.
This object is immutable. | 62598f1350812a4eaa620209 |
class Viter(object): <NEW_LINE> <INDENT> def invite_emails(self, emails, **kwargs): <NEW_LINE> <INDENT> for email in emails: <NEW_LINE> <INDENT> invitation = self.generate(email=email, **kwargs) <NEW_LINE> self.send_by_mail(invitation, **kwargs) <NEW_LINE> <DEDENT> <DEDENT> def generate(self, **kwargs): <NEW_LINE> <IND... | Main interface class | 62598f1360cbc95b06362f6b |
class NoManifestError(Error): <NEW_LINE> <INDENT> pass | Repository has no manifest. | 62598f13ad47b63b2c5a644a |
class Student: <NEW_LINE> <INDENT> def __init__(self, firstname, lastname): <NEW_LINE> <INDENT> self.firstname = firstname <NEW_LINE> self.lastname = lastname | This class represents the student instance variables in the dictionary form | 62598f139f28863672817433 |
class TestAddObjectAccessList(): <NEW_LINE> <INDENT> def preprocess_url(self, request_url: str): <NEW_LINE> <INDENT> request_url = urllib.parse.unquote(request_url) <NEW_LINE> request_url = urllib.parse.quote(request_url, safe=':/') <NEW_LINE> if re.fullmatch('.*/+', request_url) is None: <NEW_LINE> <INDENT> return req... | Test Class for add_object_access_list | 62598f134a966d76dd5edb10 |
class Trigger(object): <NEW_LINE> <INDENT> def __init__(self, trigger, code, regexp = True, stop = False, mode = 'exec', title = None): <NEW_LINE> <INDENT> if regexp: <NEW_LINE> <INDENT> self.trigger = re.compile(trigger) <NEW_LINE> triggers.append(self) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.trigger = trig... | A trigger object. | 62598f134527f215b58e8b34 |
class All(Predefined): <NEW_LINE> <INDENT> pass | <dl>
<dt>'All'
<dd>is a possible option value for 'Span', 'Quiet', 'Part' and related functions. 'All' specifies all parts at a particular level.
</dl> | 62598f1331939e2706ed107f |
class InvalidRecordError(Exception): <NEW_LINE> <INDENT> pass | Raised when invalid record encountered. | 62598f1360cbc95b06362f6d |
class Fmgr(Form): <NEW_LINE> <INDENT> handle = FileField(_('Image file')) <NEW_LINE> newName = TextField(_('File name')) | FM upload form | 62598f1326238365f5fab7c7 |
class Parameter(sql.Base, abstract.Parameter): <NEW_LINE> <INDENT> __resource__ = 'parameters' <NEW_LINE> __tablename__ = 'parameter' <NEW_LINE> __table_args__ = sql.table_args() <NEW_LINE> id = sa.Column(sa.Integer, primary_key=True, autoincrement=True) <NEW_LINE> plan_id = sa.Column(sa.Integer, sa.ForeignKey('plan.id... | Represent a parameter in sqlalchemy. | 62598f134527f215b58e8b36 |
class LockKeyBlobTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_lock_key_blob(self): <NEW_LINE> <INDENT> lock_key_blob_obj = LockKeyBlob() <NEW_LINE> self.assertNotEqual(lock_key_blob_obj, None) | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f137b180e01f3e48667 |
class Thumbnail(tk.Frame): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> tk.Frame.__init__(self, parent, bg=THUMBNAIL_BG) <NEW_LINE> self.default_img = atk.create_image(b64=wmap_icon, color=THUMBNAIL_FG) <NEW_LINE> self.current_img = None <NEW_LINE> tk.Label(self, text='Thumbnail:', bg=MAIN_BG, fg... | Thumbnail image in home tab | 62598f13fbf16365ca792cde |
class AvgCovSingular(Exception): <NEW_LINE> <INDENT> def __init__(self, message=''): <NEW_LINE> <INDENT> print("***ERROR***") <NEW_LINE> print("Average covariance matrix is singular") <NEW_LINE> super(AvgCovSingular, self).__init__(message) <NEW_LINE> self.message = message | Exception for bad jackknife distribution | 62598f137cff6e4e811b462a |
class Music163Pipeline(FilesPipeline): <NEW_LINE> <INDENT> FILES_STORE = get_project_settings().get("FILES_STORE") <NEW_LINE> DEFAULT_REQUEST_HEADERS = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'zh-CN,zh;q=0.8,en;q=0.... | 自定义文件下载管道 | 62598f130fa83653e46f3b25 |
class BinarySensorDevice(Entity): <NEW_LINE> <INDENT> @property <NEW_LINE> def is_on(self): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> @property <NEW_LINE> def state(self): <NEW_LINE> <INDENT> return STATE_ON if self.is_on else STATE_OFF <NEW_LINE> <DEDENT> @property <NEW_LINE> def device_class(self): <NEW_LIN... | Represent a binary sensor. | 62598f13956e5f7376df4c9c |
class Cell: <NEW_LINE> <INDENT> def __init__(self, coords): <NEW_LINE> <INDENT> self.north_cell = None <NEW_LINE> self.east_cell = None <NEW_LINE> self.south_cell = None <NEW_LINE> self.west_cell = None <NEW_LINE> self.north_wall = True <NEW_LINE> self.east_wall = True <NEW_LINE> self.south_wall = True <NEW_LINE> self.... | A cell that is part of a maze keep track of various state information.
It consists of the following:
* 4 walls
* 4 neighbour cells
* Coordinates
Also contains helper functions for maze and path generation.
Args:
coords (tuple): The coordinates on the cell. | 62598f13091ae35668703849 |
class TimeLogTemplateView(LoginRequiredMixin, TimeLogMixin, TimeSheetMixin, TemplateView): <NEW_LINE> <INDENT> template_name = 'projects/timelog.html' <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> today = timezone.now().date() <NEW_LINE> user_timesheet = self.user_timesheet(user=request.user) <NEW_LINE> timesh... | User time-in and time-out
TODO: remove once api is working | 62598f13a219f33f346c546a |
class StopException(Exception): <NEW_LINE> <INDENT> pass | Signal that we want to stop the program. | 62598f13d8ef3951e32c7474 |
class NormalDistribution01(Generator): <NEW_LINE> <INDENT> def __init__(self, u_gen: Generator = None, v_gen: Generator = None): <NEW_LINE> <INDENT> self.mean = 0 <NEW_LINE> self.std = 1 <NEW_LINE> if u_gen is None: <NEW_LINE> <INDENT> u_gen = StdRealUniformGenerator() <NEW_LINE> <DEDENT> if v_gen is None: <NEW_LINE> <... | This is fast.
An object of this class generates numbers from Normal Distribution.
The constructor takes any two Uniform [0,1) number generators to accomplish its goal.
Uses Box-Muller method. | 62598f139f28863672817439 |
class _SequenceItem(TraitType): <NEW_LINE> <INDENT> def __init__(self, var_root={}, index=-1, environment={}, on_change=None, **metadata): <NEW_LINE> <INDENT> self.var_root = var_root <NEW_LINE> self.index = index <NEW_LINE> self.environment = environment <NEW_LINE> self.on_change = on_change <NEW_LINE> self._type = No... | representation of value from list in a TableEditor
| 62598f1355399d3f05625166 |
class PyVcloudProviderServicer(object): <NEW_LINE> <INDENT> def Login(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def ReadCatalog... | Interface exported by the server.
| 62598f13956e5f7376df4c9d |
class ABI(object): <NEW_LINE> <INDENT> register_arguments = [] <NEW_LINE> arg_alignment = 1 <NEW_LINE> stack_minimum = 0 <NEW_LINE> returns = True <NEW_LINE> def __init__(self, regs, align, minimum): <NEW_LINE> <INDENT> self.register_arguments = regs <NEW_LINE> self.arg_alignment = align <NEW_LI... | Encapsulates information about a calling convention. | 62598f13099cdd3c636749f8 |
class Timer(object): <NEW_LINE> <INDENT> def __init__(self, duration): <NEW_LINE> <INDENT> self.duration = duration <NEW_LINE> self.start() <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> self.target = time.time() + self.duration <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.start() <NEW_LINE> ... | The timer class. A simple chronometer. | 62598f134527f215b58e8b3a |
class CustomImagePropertiesFromVm(Model): <NEW_LINE> <INDENT> _attribute_map = { 'source_vm_id': {'key': 'sourceVmId', 'type': 'str'}, 'windows_os_info': {'key': 'windowsOsInfo', 'type': 'WindowsOsInfo'}, 'linux_os_info': {'key': 'linuxOsInfo', 'type': 'LinuxOsInfo'}, } <NEW_LINE> def __init__(self, source_vm_id=None, ... | Properties for creating a custom image from a virtual machine.
:param source_vm_id: The source vm identifier.
:type source_vm_id: str
:param windows_os_info: The Windows OS information of the VM.
:type windows_os_info: ~azure.mgmt.devtestlabs.models.WindowsOsInfo
:param linux_os_info: The Linux OS information of the V... | 62598f13a219f33f346c546c |
class Test_check_pdf_list(): <NEW_LINE> <INDENT> def test_check_pdf_37(self,login_xadmin): <NEW_LINE> <INDENT> s = login_xadmin <NEW_LINE> pdf_01 = check_pdf(s, contractNo=20090900006) <NEW_LINE> assert pdf_01['success'] == True <NEW_LINE> assert pdf_01['data'] == None <NEW_LINE> <DEDENT> def test_check_pdf_38(self,log... | checkpdf是否存在 | 62598f13d8ef3951e32c7475 |
class Filter(logging.Filter): <NEW_LINE> <INDENT> def __init__(self, trim_amount=5): <NEW_LINE> <INDENT> self.trim_amount = trim_amount <NEW_LINE> <DEDENT> def filter(self, record): <NEW_LINE> <INDENT> import traceback <NEW_LINE> if record.levelno >= logging.WARNING: <NEW_LINE> <INDENT> record.stack_info = ''.join( str... | add stack info while logging level >= Error | 62598f13fbf16365ca792ce2 |
class GlobalHotKeys(object): <NEW_LINE> <INDENT> key_mapping = [] <NEW_LINE> user32 = ctypes.windll.user32 <NEW_LINE> MOD_ALT = win32con.MOD_ALT <NEW_LINE> MOD_CTRL = win32con.MOD_CONTROL <NEW_LINE> MOD_CONTROL = win32con.MOD_CONTROL <NEW_LINE> MOD_SHIFT = win32con.MOD_SHIFT <NEW_LINE> MOD_WIN = win32con.MOD_WIN <NEW_L... | Register a key using the register() method, or using the @register decorator
Use listen() to _start the message pump
Example:
from globalhotkeys import GlobalHotKeys
@GlobalHotKeys.register(GlobalHotKeys.VK_F1)
def hello_world():
printf 'Hello World'
GlobalHotKeys.listen() | 62598f138a349b6b43684e87 |
class Window(QMainWindow): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.setWindowTitle("Coffee Database PyQt4 SQL") <NEW_LINE> self.resize(350,400) <NEW_LINE> self.icon = QIcon(QPixmap("./images/coffeeIcon.png")) <NEW_LINE> self.setWindowIcon(self.icon) <NEW_LINE> self.... | simple window layout | 62598f130fa83653e46f3b29 |
class ECA: <NEW_LINE> <INDENT> def __init__(self, rule): <NEW_LINE> <INDENT> self.rule = rule <NEW_LINE> self.transition = util.get_elementary_rule(rule) <NEW_LINE> <DEDENT> def step(self, config): <NEW_LINE> <INDENT> size = len(config) <NEW_LINE> next_config = [0b0] * size <NEW_LINE> transition = self.transition <NEW_... | The class that holds the elementary cellular automaton. | 62598f1331939e2706ed1083 |
class LeafBatterySensor(LeafEntity): <NEW_LINE> <INDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self.car.leaf.nickname + " Charge" <NEW_LINE> <DEDENT> @property <NEW_LINE> def device_class(self): <NEW_LINE> <INDENT> return DEVICE_CLASS_BATTERY <NEW_LINE> <DEDENT> @property <NEW_LINE> def state(... | Nissan Leaf Battery Sensor. | 62598f13a05bb46b384894bd |
class GroupCreateView(LoginRequiredMixin, PermissionMixin, CreateView): <NEW_LINE> <INDENT> model = Group <NEW_LINE> template_name = 'groups/list.html' <NEW_LINE> form_class = StudentGroupForm <NEW_LINE> permissions_required = [ 'change_own_group' ] <NEW_LINE> def get_failure_redirect_path(self): <NEW_LINE> <INDENT> me... | View to create a new group to discipline. | 62598f13ec188e330fdf74f9 |
class TaskFolder(gdef.ITaskFolder): <NEW_LINE> <INDENT> path = generate_simple_getter("get_Path", gdef.BSTR) <NEW_LINE> name = generate_simple_getter("get_Name", gdef.BSTR) <NEW_LINE> @property <NEW_LINE> def folders(self): <NEW_LINE> <INDENT> res = TaskFolderCollection() <NEW_LINE> self.GetFolders(0, res) <NEW_LINE> r... | A folder of tasks | 62598f13ad47b63b2c5a6454 |
class SixNimmt(Game): <NEW_LINE> <INDENT> def __init__(self, name="6 Nimmt!", equipments=SixNimmtEquipments(), winConditions=[], history=None): <NEW_LINE> <INDENT> super().__init__(name,equipments,winConditions,history) <NEW_LINE> <DEDENT> def prepare(self, players): <NEW_LINE> <INDENT> equipments = self.getEquipments(... | Here, we define the class for the 6 Nimmt! game | 62598f13656771135c4882cf |
class ExpandoRequest(object): <NEW_LINE> <INDENT> def __init__(self, req): <NEW_LINE> <INDENT> self.__dict__["_ExpandoRequest__req"] = req <NEW_LINE> <DEDENT> def __getattr__(self, attr): <NEW_LINE> <INDENT> return getattr(self.__req, attr) <NEW_LINE> <DEDENT> def __setattr__(self, attr, value): <NEW_LINE> <INDENT> try... | Proxy class for setting arbitrary attributes on a request.
This class allows us to easily stub out various derived properties of
a Request object. Mostly notable, Request.host_url which is usually
a read-only property derviced from the request evnironment. | 62598f133617ad0b5ee04d74 |
class VpnConnection(TaggedEC2Object): <NEW_LINE> <INDENT> def __init__(self, connection=None): <NEW_LINE> <INDENT> TaggedEC2Object.__init__(self, connection) <NEW_LINE> self.id = None <NEW_LINE> self.state = None <NEW_LINE> self.customer_gateway_configuration = None <NEW_LINE> self.type = None <NEW_LINE> self.customer_... | Represents a VPN Connection
:ivar id: The ID of the VPN connection.
:ivar state: The current state of the VPN connection.
Valid values: pending | available | deleting | deleted
:ivar customer_gateway_configuration: The configuration information for the
VPN connection's customer gateway (in the native XML forma... | 62598f138a349b6b43684e89 |
class SimpleExchangeBackend(BaseExchangeBackend): <NEW_LINE> <INDENT> def get_rates(self, **params): <NEW_LINE> <INDENT> response = self.get_response(**params) <NEW_LINE> return self.parse_json(response)['rates'] | Simple backend implementation.
Assumes JSON response with `rates` key inside. | 62598f137cff6e4e811b4630 |
class levelBeam: <NEW_LINE> <INDENT> def Activated(self): <NEW_LINE> <INDENT> import FreeCAD, FreeCADGui, fCmd, fObservers <NEW_LINE> selex=Gui.Selection.getSelectionEx() <NEW_LINE> faces=fCmd.faces(selex) <NEW_LINE> beams=[sx.Object for sx in selex] <NEW_LINE> if len(faces)==len(beams)>1: <NEW_LINE> <INDENT> FreeCAD.a... | Tool to flush the parallel faces of two objects.
Note: - actually the command takes to the same level, respect the
position and orientation of the first face selected, the center-of-mass
of all faces selected. Thus it translates the objects even if the
faces are not parallel. | 62598f13091ae3566870384f |
class MetricRelay(shumway.MetricRelay): <NEW_LINE> <INDENT> def __init__(self, default_key, ffwd_ip=FFWD_IP, ffwd_port=FFWD_PORT, loop=None): <NEW_LINE> <INDENT> super().__init__(default_key, ffwd_ip, ffwd_port) <NEW_LINE> if loop is None: <NEW_LINE> <INDENT> loop = asyncio.get_event_loop() <NEW_LINE> <DEDENT> self.loo... | Manage creating and sending metrics to FFWD.
Args:
default_key (str): Key assigned to each metric.
ffwd_ip (str): IP address of FFWD agent.
ffwd_port (int): Port that FFWD agents listens on.
loop (obj): an asyncio.AbstractEventLoop-compatible event loop. | 62598f13a05bb46b384894bf |
class RootRoute(Handler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> self.response.set_header('Access-Control-Allow-Origin', '*') <NEW_LINE> return { 'empty': ' as my mind' } | / | 62598f13377c676e912f6389 |
class QLearningAgent(ReinforcementAgent): <NEW_LINE> <INDENT> def __init__(self, **args): <NEW_LINE> <INDENT> ReinforcementAgent.__init__(self, **args) <NEW_LINE> self.QValues = util.Counter() <NEW_LINE> <DEDENT> def getQValue(self, state, action): <NEW_LINE> <INDENT> return self.QValues.get((state, action), 0.0) <NEW_... | Q-Learning Agent
Functions you should fill in:
- getQValue
- getAction
- getValue
- getPolicy
- update
Instance variables you have access to
- self.epsilon (exploration prob)
- self.alpha (learning rate)
- self.discount (discount rate)
Functions you should use
- self.getLegalActions(state)
whic... | 62598f13ab23a570cc2d4390 |
class BannedUser(models.Model): <NEW_LINE> <INDENT> target_ct = models.ForeignKey(ContentType, verbose_name=_('Target content type')) <NEW_LINE> target_id = models.PositiveIntegerField(_('Target id')) <NEW_LINE> user = models.ForeignKey(User, verbose_name=_('Banned author')) <NEW_LINE> target = CachedGenericForeignKey(... | model with generic relation on object
same as in comment model
ban is global if there is no relation | 62598f130fa83653e46f3b2d |
class ModelStructure: <NEW_LINE> <INDENT> def __init__(self, freq_matrix_path): <NEW_LINE> <INDENT> self.freq_matrix_path = freq_matrix_path <NEW_LINE> self.freq_matrix = [] <NEW_LINE> self.__read_matrix() <NEW_LINE> <DEDENT> def set_up(self): <NEW_LINE> <INDENT> if not self.freq_matrix: <NEW_LINE> <INDENT> print("Freq... | Create facade for reading frequency matrix and transforming it
to digraph (structure of the model) with zero-weighted edges | 62598f139f28863672817440 |
class DetectionMethod(SpikepyMethod): <NEW_LINE> <INDENT> requires = ['df_traces', 'df_sampling_freq'] <NEW_LINE> provides = ['event_times'] | This class should be subclassed in order for developers to add a new
spike detection method to spikepy.
There is no need to instantiate (create an object from) the subclass,
spikepy will handle that internally. Therefore it is important to have
an __init__ method which requires no arguments (asside from 'se... | 62598f13283ffb24f3cf24ee |
class Profile(pulumi.CustomResource): <NEW_LINE> <INDENT> def __init__(__self__, __name__, __opts__=None, location=None, name=None, resource_group_name=None, sku=None, tags=None): <NEW_LINE> <INDENT> if not __name__: <NEW_LINE> <INDENT> raise TypeError('Missing resource name argument (for URN creation)') <NEW_LINE> <DE... | Manage a CDN Profile to create a collection of CDN Endpoints. | 62598f134527f215b58e8b40 |
class string(aetools.ComponentItem): <NEW_LINE> <INDENT> want = 'TEXT' | string - a string of characters | 62598f13d8ef3951e32c7478 |
class Interface(ArrayParsing): <NEW_LINE> <INDENT> def __init__(self, xl_sheet): <NEW_LINE> <INDENT> super().__init__(xl_sheet) <NEW_LINE> <DEDENT> def get_by_equipment_and_function(self, equipment, function): <NEW_LINE> <INDENT> myList = list() <NEW_LINE> for row in range(1, self.delimitation_between_indexes_and_comma... | This class provides methods to deal with interfaces of an equipemnt.
| 62598f13099cdd3c636749fb |
class GCEpoch(object): <NEW_LINE> <INDENT> def __init__(self,fname=None,sharedir='data'): <NEW_LINE> <INDENT> if fname=='None': <NEW_LINE> <INDENT> fn = os.path.join(sharedir,'stages') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> fn = fname <NEW_LINE> <DEDENT> self.data = [] <NEW_LINE> self.timescale = 0.001 <NEW_LINE... | Handle epochs. | 62598f139f28863672817442 |
class counter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._count = -1 <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> self._count += 1 <NEW_LINE> return self._count | A counter which can be used with `defaultdict` to assign unique integers
to objects. | 62598f13283ffb24f3cf24f0 |
class BooleanField(Field): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(BooleanField, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def validate(self, value): <NEW_LINE> <INDENT> base_problems = super(BooleanField, self).validate(value) <NEW_LINE> if base_problems: <NEW_LINE>... | Field containing only boolean (true or false) values.
>>> f = BooleanField()
>>> f.validate(None)
'missing'
>>> f.validate('aString')
'not a boolean value'
>>> f.validate(1)
'not a boolean value'
>>> f.validate(True)
>>> f.validate(False) | 62598f1331939e2706ed1086 |
class Organisation(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> ordering = ['name'] <NEW_LINE> <DEDENT> name = models.CharField(max_length=50) <NEW_LINE> postal_address = models.CharField(max_length=150, null=True, blank=True) <NEW_LINE> bank_account_name = models.CharField(max_length=100, null=Tr... | An `Organisation` is an entity to which
`Member` belong | 62598f133d592f4c4edb9b2f |
class QuestRequirement(Dispatcher): <NEW_LINE> <INDENT> _events_ = ['completed'] <NEW_LINE> def __init__(self, description): <NEW_LINE> <INDENT> self.description = description <NEW_LINE> self.is_complete = False <NEW_LINE> <DEDENT> def mark_complete(self): <NEW_LINE> <INDENT> self.is_complete = False <NEW_LINE> self.em... | A base class for a quest requirement. Must be completed to complete a quest.
Attributes:
description (str): The description text for this quest requirement.
is_complete (bool): True if the quest requirement is completed. False otherwise. Read only.
Events:
completed: Called when the quest requirement is c... | 62598f13ec188e330fdf74ff |
class IotHubReplicaRoleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> PRIMARY = "primary" <NEW_LINE> SECONDARY = "secondary" | The role of the region, can be either primary or secondary. The primary region is where the IoT
hub is currently provisioned. The secondary region is the Azure disaster recovery (DR) paired
region and also the region where the IoT hub can failover to. | 62598f1350812a4eaa620211 |
class Underlying(models.Model): <NEW_LINE> <INDENT> WordType = models.ForeignKey('WordType') <NEW_LINE> SegmentType = models.ForeignKey(SegmentType) <NEW_LINE> Ordering = models.IntegerField() <NEW_LINE> Stressed = models.IntegerField(blank=True,null=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return str(se... | Many-to-many relation between words and their underlying/canonical
segments.
Contains ordering information and stress values for vowels | 62598f137cff6e4e811b4636 |
class HyperInteger(HyperSpace, Integer): <NEW_LINE> <INDENT> def __init__(self, low, high, transform=None, overlap=0.25, name=None): <NEW_LINE> <INDENT> super().__init__(low, high, transform) <NEW_LINE> self.overlap = overlap <NEW_LINE> self.name = name <NEW_LINE> self.space0_low = None <NEW_LINE> self.space0_high = No... | HyperSpace for Integers.
Parameters
----------
* `low` [int]:
Lower bound (inclusive).
* `high` [int]:
Upper bound (inclusive).
* `transform` ["identity", "normalize", optional]:
The following transformations are supported.
- "identity", (default) the transformed space is the same as the
orig... | 62598f139f28863672817444 |
class DQN(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_shape, n_actions): <NEW_LINE> <INDENT> super(DQN, self).__init__() <NEW_LINE> self.conv = nn.Sequential( nn.Conv2d(input_shape[0], 32, kernel_size=8, stride=4), nn.ReLU(), nn.Conv2d(32, 64, kernel_size=4, stride=2), nn.ReLU(), nn.Conv2d(64, 64, kernel_s... | 构建卷积神经网络 | 62598f13a05bb46b384894c5 |
class Vector: <NEW_LINE> <INDENT> def __init__(self, x=0, y=0, z=0): <NEW_LINE> <INDENT> self._x = x <NEW_LINE> self._y = y <NEW_LINE> self._z = z <NEW_LINE> <DEDENT> def norm(self): <NEW_LINE> <INDENT> return (self._x**2+self._y**2+self._z**2)**(1/2) <NEW_LINE> <DEDENT> def dot_product(self, vector): <NEW_LINE> <INDEN... | Vector Class. | 62598f1331939e2706ed1087 |
class Debug(Algo): <NEW_LINE> <INDENT> def __call__(self, target): <NEW_LINE> <INDENT> import pdb <NEW_LINE> pdb.set_trace() <NEW_LINE> return True | Utility Algo that calls pdb.set_trace when triggered.
In the debug session, 'target' is available and can be examined through the
StrategyBase interface. | 62598f1350812a4eaa620212 |
class DuplicatesPipeline(object): <NEW_LINE> <INDENT> def process_item(self, item, spider): <NEW_LINE> <INDENT> if Redis.exists('url:%s' % item['url']): <NEW_LINE> <INDENT> raise DropItem("Duplicate item found: %s" % item) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> Redis.set('url:%s' % item['url'], 1) <NEW_LINE> ret... | Item去重复 | 62598f133617ad0b5ee04d7c |
class Tsunami(Base): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.analysis = Analysis() | Intialize a tsunami module instance
Keyword arguments: | 62598f130fa83653e46f3b33 |
class SignUp(tasks.CreateProjectAndUser): <NEW_LINE> <INDENT> url = r"^openstack/sign-up/?$" <NEW_LINE> pass | The openstack endpoint for signups. | 62598f13a05bb46b384894c7 |
class TeacherDetailView(View): <NEW_LINE> <INDENT> def get(self, request, teacher_id): <NEW_LINE> <INDENT> teacher_detail = Teacher.objects.get(pk=int(teacher_id)) <NEW_LINE> teacher_detail.click_nums += 1 <NEW_LINE> teacher_detail.save() <NEW_LINE> teacher_courses = Course.objects.filter(teachers=teacher_detail) <NEW_... | 教师详情页:具体教师的课程、教师的机构、收藏(教师、机构) | 62598f13ad47b63b2c5a645d |
class SingletonRule(ConstantRule): <NEW_LINE> <INDENT> def __init__(self, fun): <NEW_LINE> <INDENT> ConstantRule.__init__(self) <NEW_LINE> self._fun = fun <NEW_LINE> self._valuation = 1 <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Singleton" <NEW_LINE> <DEDENT> def fun(self, x): <NEW_LINE> <INDEN... | Représente un ensemble composé d'un objet unique de taille 1 | 62598f13adb09d7d5dc091f5 |
class Actor(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, seed, fc1_units=200, fc2_units=100): <NEW_LINE> <INDENT> super(Actor, self).__init__() <NEW_LINE> self.seed = torch.manual_seed(seed) <NEW_LINE> self.input = torch.nn.BatchNorm1d(state_size) <NEW_LINE> self.fc1 = nn.Linear(state_siz... | Actor (Policy) Model. | 62598f137b180e01f3e4866f |
class AllTopicNamesHandlerTest(test_utils.GenericTestBase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(AllTopicNamesHandlerTest, self).setUp() <NEW_LINE> self.signup(self.CURRICULUM_ADMIN_EMAIL, self.CURRICULUM_ADMIN_USERNAME) <NEW_LINE> self.signup(self.OWNER_EMAIL, self.OWNER_USERNAME) <NEW_LINE> ... | Test for the AllTopicNamesHandler. | 62598f13ec188e330fdf7503 |
@implementer(ITALESIterator) <NEW_LINE> class Iterator(object): <NEW_LINE> <INDENT> def __init__(self, name, seq, context): <NEW_LINE> <INDENT> self._seq = seq <NEW_LINE> self._iter = i = iter(seq) <NEW_LINE> self._nextIndex = 0 <NEW_LINE> self._name = name <NEW_LINE> self._setLocal = context.setLocal <NEW_LINE> self._... | TALES Iterator
| 62598f13d8ef3951e32c747b |
class testcase_readermonitorstress(unittest.TestCase): <NEW_LINE> <INDENT> def testcase_readermonitorthread(self): <NEW_LINE> <INDENT> insertionthread = readerInsertionThread() <NEW_LINE> removalthread = readerRemovalThread() <NEW_LINE> readermonitor = ReaderMonitor(readerProc=getReaders, period=period) <NEW_LINE> obse... | Test smartcard framework reader monitoring | 62598f138a349b6b43684e93 |
class SpaceFeed(Feed): <NEW_LINE> <INDENT> def get_object(self, request, space_name): <NEW_LINE> <INDENT> current_space = get_object_or_404(Space, url=space_name) <NEW_LINE> return current_space <NEW_LINE> <DEDENT> def title(self, obj): <NEW_LINE> <INDENT> return _("%s feed") % obj.name <NEW_LINE> <DEDENT> def link(sel... | Returns a space feed with the content of various applciations. In the future
this function must detect applications and returns their own feeds. | 62598f1355399d3f05625176 |
class SchemaValidator(object): <NEW_LINE> <INDENT> validator_org = jsonschema.Draft4Validator <NEW_LINE> def __init__(self, schema, is_body=True): <NEW_LINE> <INDENT> self.is_body = is_body <NEW_LINE> validators = { 'minimum': self._validate_minimum, 'maximum': self._validate_maximum } <NEW_LINE> validator_cls = jsonsc... | Resource reference validator class. | 62598f133d592f4c4edb9b37 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.