function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def __init__(self): import tty, sys
tpainter/df_everywhere
[ 13, 3, 13, 1, 1401129417 ]
def __init__(self): import msvcrt
tpainter/df_everywhere
[ 13, 3, 13, 1, 1401129417 ]
def __init__(self, config, stage_type, ar_globals): """The constructor""" self.config = config self.type = stage_type self.LOG = ar_globals['LOG'] try: self.url = config.get(self.type, 'url') self.method = config.get(self.type, 'method') self.s...
sherpya/archiver
[ 3, 2, 3, 1, 1251993966 ]
def __init__(self, parent=None): QAbstractListModel.__init__(self, parent) self.cards = Cards()
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def _checkActive(self): if not self.isActive(): raise CardModel.ModelNotActiveError, "Model is not active. Use open first."
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def close(self): self.emit(SIGNAL('modelAboutToBeReset()')) self.cards.close() self.reset()
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def isActive(self): return self.cards.isOpen()
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def rowCount(self, parent=QModelIndex()): if parent.isValid(): return 0 else: if self.cards.isOpen(): return self.cards.getCardsCount() else: return 0
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def index(self, row, column, parent=QModelIndex()): if row < 0 or column < 0 or not self.cards.isOpen(): return QModelIndex() else: # returns index with given card id header = self.cards.getCardHeaders('', row, row + 1) if len(header) == 1: ...
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def data(self, index, role=Qt.DisplayRole): self._checkIndex(index) if role not in (Qt.DisplayRole, Qt.UserRole): return QVariant() card = self.cards.getCard(index.internalId()) if role == Qt.UserRole: return card else: if index.column() == 0:...
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def headerData(self, section, orientation, role=Qt.DisplayRole): if role == Qt.DisplayRole: if orientation == Qt.Horizontal: if section == 0: return QVariant("Question") elif section == 1: return QVariant("Answer") ...
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def getNextIndex(self, index): """Returns next index after given or given if it's last.""" self._checkIndex(index) if index.row() == self.rowCount() - 1: return index else: return self.index(index.row() + 1, 0) # get row after ?
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def addNewCard(self): """Adds a new empty card.""" self.emit(SIGNAL('modelAboutToBeReset()')) rowid = self.cards.addCard(Card()) # TODO is it ok to return it here? result = self.createIndex(self.cards.getCardsCount(), 0, rowid) # cards.addCard(Card()) # TODO ...
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def updateCard(self, index, question, answer): self._checkIndex(index) card = Card(index.internalId(), question, answer) self.cards.updateCard(card) # update data in the model self.emit(SIGNAL('dataChanged(QModelIndex)'), index)
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def importQAFile(self, file, clean=True): """Import cards from given question&answer file. @param file can be file name or file like object """ self.emit(SIGNAL('modelAboutToBeReset()')) self._checkActive() if isstring(file): file = open(file, 'rt') if...
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def __init__(self, parent=None): QAbstractItemModel.__init__(self, parent) self.cards = []
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def rowCount(self, parent=QModelIndex()): if parent.isValid(): return 0 else: return len(self.cards)
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def index(self, row, column, parent=QModelIndex()): if parent.isValid(): return QModelIndex() else: if row >= 0 and row < len(self.cards) and column == 0: return self.createIndex(row, column, None) else: return QModelIndex()
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def headerData(self, section, orientation, role=Qt.DisplayRole): return QVariant(str(section)) # return QAbstractItemModel.headerData(self, section, orientation, role)
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def addCard(self, card): self.emit(SIGNAL('modelAboutToBeReset()')) self.cards.append(card) self.reset()
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def selectNextCard(self): # take from the stack and put it on top if len(self.cards) > 0: self.emit(SIGNAL('modelAboutToBeReset()')) result = self.cards[0] self.cards = self.cards[1:] self.cards.append(result) self.reset() return re...
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def scoreCard(self, card, score): if score == DrillModel.Good: log("Card: $card will be removed from drill.") self.removeCard(card)
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def printCards(self): print "Printing cards..." sys.stdout.flush() i = 0 for card in self.cards: print "%d %s\n" % (i, str(card)) sys.stdout.flush() i += 1 print "Done." sys.stdout.flush()
afolmert/mentor
[ 7, 3, 7, 1, 1208166911 ]
def __init__(self): self.priority = 1 self.language = ['de'] self.domains = ['tata.to'] self.base_link = 'http://tata.to' self.search_link = '/filme?suche=%s&type=alle' self.ajax_link = '/ajax/stream/%s'
repotvsupertuga/tvsupertuga.repository
[ 1, 8, 1, 4, 1493763534 ]
def tvshow(self, imdb, tvdb, tvshowtitle, localtvshowtitle, aliases, year): try: url = {'imdb': imdb, 'tvdb': tvdb, 'tvshowtitle': tvshowtitle, 'localtvshowtitle': localtvshowtitle, 'aliases': aliases, 'year': year} url = urllib.urlencode(url) return url ...
repotvsupertuga/tvsupertuga.repository
[ 1, 8, 1, 4, 1493763534 ]
def sources(self, url, hostDict, hostprDict): sources = [] try: if not url: return sources ref = urlparse.urljoin(self.base_link, url) url = urlparse.urljoin(self.base_link, self.ajax_link % re.findall('-(\w+)$', ref)[0]) headers = {'Refe...
repotvsupertuga/tvsupertuga.repository
[ 1, 8, 1, 4, 1493763534 ]
def __search_movie(self, imdb, year): try: query = urlparse.urljoin(self.base_link, self.search_link % imdb) y = ['%s' % str(year), '%s' % str(int(year) + 1), '%s' % str(int(year) - 1), '0'] r = client.request(query) r = dom_parser.parse_dom(r, 'div', attrs={'c...
repotvsupertuga/tvsupertuga.repository
[ 1, 8, 1, 4, 1493763534 ]
def do_PUT(self): print(self.path, flush=True) content_encoding = self.headers['X-Endless-Content-Encoding'] print(content_encoding, flush=True) content_length = int(self.headers['Content-Length']) compressed_request_body = self.rfile.read(content_length) decompressed_r...
endlessm/eos-event-recorder-daemon
[ 4, 2, 4, 1, 1380568451 ]
def __init__(self): SERVER_ADDRESS = ('localhost', 0) super().__init__(SERVER_ADDRESS, PrintingHTTPRequestHandler)
endlessm/eos-event-recorder-daemon
[ 4, 2, 4, 1, 1380568451 ]
def __repr__(self): return '<factory>'
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def __init__(self, name): self.name = name
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def __getitem__(self, params): return self
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def __init__(self, default, default_factory, init, repr, hash, compare, metadata): self.name = None self.type = None self.default = default self.default_factory = default_factory self.init = init self.repr = repr self.hash = hash self.comp...
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def __set_name__(self, owner, name): func = getattr(type(self.default), '__set_name__', None) if func: # There is a __set_name__ method on the descriptor, call # it. func(self.default, owner, name)
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def __init__(self, init, repr, eq, order, unsafe_hash, frozen): self.init = init self.repr = repr self.eq = eq self.order = order self.unsafe_hash = unsafe_hash self.frozen = frozen
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def field(*, default=MISSING, default_factory=MISSING, init=True, repr=True, hash=None, compare=True, metadata=None): """Return an object to identify dataclass fields. default is the default value of the field. default_factory is a 0-argument function called to initialize a field's value. If in...
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def _recursive_repr(user_function): # Decorator to make a repr function return "..." for a recursive # call. repr_running = set() @functools.wraps(user_function) def wrapper(self): key = id(self), _thread.get_ident() if key in repr_running: return '...' repr_runn...
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def _field_assign(frozen, name, value, self_name): # If we're a frozen class, then assign to our fields in __init__ # via object.__setattr__. Otherwise, just use a simple # assignment. # # self_name is what "self" is called in this function: don't # hard-code "self", since that might be a field...
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def _init_param(f): # Return the __init__ parameter string for this field. For # example, the equivalent of 'x:int=3' (except instead of 'int', # reference a variable set to int, and instead of '3', reference a # variable set to 3). if f.default is MISSING and f.default_factory is MISSING: ...
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def _repr_fn(fields): fn = _create_fn('__repr__', ('self',), ['return self.__class__.__qualname__ + f"(' + ', '.join([f"{f.name}={{self.{f.name}!r}}" for f in fields]) + ')"']) return _recursive_rep...
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def _cmp_fn(name, op, self_tuple, other_tuple): # Create a comparison function. If the fields in the object are # named 'x' and 'y', then self_tuple is the string # '(self.x,self.y)' and other_tuple is the string # '(other.x,other.y)'. return _create_fn(name, ('self', 'other'...
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def _is_classvar(a_type, typing): # This test uses a typing internal class, but it's the best way to # test if this is a ClassVar. return (a_type is typing.ClassVar or (type(a_type) is typing._GenericAlias and a_type.__origin__ is typing.ClassVar))
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def _is_type(annotation, cls, a_module, a_type, is_type_predicate): # Given a type annotation string, does it refer to a_type in # a_module? For example, when checking that annotation denotes a # ClassVar, then a_module is typing, and a_type is # typing.ClassVar. # It's possible to look up a_modul...
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def _set_new_attribute(cls, name, value): # Never overwrites an existing attribute. Returns True if the # attribute already exists. if name in cls.__dict__: return True setattr(cls, name, value) return False
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def _hash_set_none(cls, fields): return None
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def _hash_exception(cls, fields): # Raise an exception. raise TypeError(f'Cannot overwrite attribute __hash__ ' f'in class {cls.__name__}')
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen): # Now that dicts retain insertion order, there's no reason to use # an ordered dict. I am leveraging that ordering here, because # derived class fields overwrite base class fields, but the order # is defined by the base class, which i...
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def dataclass(_cls=None, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False): """Returns the same class as was passed in, with dunder methods added based on the fields defined in the class. Examines PEP 526 __annotations__ to determine fields. If init is true,...
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def _is_dataclass_instance(obj): """Returns True if obj is an instance of a dataclass.""" return not isinstance(obj, type) and hasattr(obj, _FIELDS)
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def asdict(obj, *, dict_factory=dict): """Return the fields of a dataclass instance as a new dictionary mapping field names to field values. Example usage: @dataclass class C: x: int y: int c = C(1, 2) assert asdict(c) == {'x': 1, 'y': 2} If given, 'dict_f...
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def astuple(obj, *, tuple_factory=tuple): """Return the fields of a dataclass instance as a new tuple of field values. Example usage:: @dataclass class C: x: int y: int c = C(1, 2) assert astuple(c) == (1, 2) If given, 'tuple_factory' will be used instead of built...
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False): """Return a new dynamically created dataclass. The dataclass name will be 'cls_name'. 'fields' is an iterable of either (nam...
FFMG/myoddweb.piger
[ 16, 2, 16, 2, 1456065110 ]
def test_database_undefined(self): with self.assertRaises(DatabaseUndefined): validate_database(settings.DATABASES, settings.DEFAULT_DATABASE, settings.DEBUG)
colab/colab
[ 22, 22, 22, 14, 1373661047 ]
def test_load_py_file_with_syntax_error(self): with file('/tmp/settings_with_syntax_error.py', 'w') as temp_settings: temp_settings.write('(') self.assertRaises(InaccessibleSettings, _load_py_file, 'settings_with_syntax_error', '/tmp')
colab/colab
[ 22, 22, 22, 14, 1373661047 ]
def test_load_py_settings_with_inaccessible_settings(self, mock): self.assertRaises(InaccessibleSettings, load_py_settings)
colab/colab
[ 22, 22, 22, 14, 1373661047 ]
def test_load_py_settings_with_settings_d(self, mock_py, mock_listdir): py_settings = load_py_settings(test_files_dir + '/settings.d/') self.assertIn('SOCIAL_NETWORK_ENABLED', py_settings) self.assertTrue(py_settings['SOCIAL_NETWORK_ENABLED']) self.assertIn('EMAIL_PORT', py_settings) ...
colab/colab
[ 22, 22, 22, 14, 1373661047 ]
def test_load_colab_apps_without_plugins_d_directory(self, mock): colab_apps = load_colab_apps() self.assertIn('COLAB_APPS', colab_apps) self.assertEquals(colab_apps['COLAB_APPS'], {})
colab/colab
[ 22, 22, 22, 14, 1373661047 ]
def test_load_colab_apps_with_plugins_d_directory(self, os_getenv): sys.path.insert(0, os_getenv.return_value) colab_apps = load_colab_apps() self.assertIn('gitlab', colab_apps['COLAB_APPS']) self.assertIn('noosfero', colab_apps['COLAB_APPS']) sys.path.remove(os_getenv.return_va...
colab/colab
[ 22, 22, 22, 14, 1373661047 ]
def test_load_widgets_settings_without_settings(self, mock): self.assertIsNone(load_widgets_settings())
colab/colab
[ 22, 22, 22, 14, 1373661047 ]
def test_load_widgets_settings_without_settings_d(self, mock): self.assertIsNone(load_widgets_settings())
colab/colab
[ 22, 22, 22, 14, 1373661047 ]
def __init__(self, plugin_administrator, config=None, recursive=True, timeout=300): super().__init__(plugin_administrator, config=config, recursive=recursive, timeout=timeout, plugin_path=__file__)
fkie-cad/FACT_core
[ 980, 203, 980, 61, 1505832491 ]
def setUp(self): self.oFile = vhdlFile.vhdlFile(lFile) self.assertIsNone(eError)
jeremiah-c-leary/vhdl-style-guide
[ 129, 31, 129, 57, 1499106283 ]
def __new__(cls, startpage, style=defaults["style"], prefix=defaults["prefix"], firstpagenum=defaults["firstpagenum"]): if style not in styles: raise ValueError("PageLabel style must be one of %s" % cls.styles()) return super().__new__(cls, int...
lovasoa/pagelabels-py
[ 52, 10, 52, 2, 1456746991 ]
def from_pdf(cls, pagenum, opts): """Returns a new PageLabel using options from a pdfrw object""" return cls(pagenum, style=stylecodes.get(opts.S, defaults["style"]), prefix=(opts.P and opts.P.decode() or defaults["prefix"]), firstpagenum=(opts.St...
lovasoa/pagelabels-py
[ 52, 10, 52, 2, 1456746991 ]
def styles(): """List of the allowed styles""" return styles.keys()
lovasoa/pagelabels-py
[ 52, 10, 52, 2, 1456746991 ]
def verifyCallback(connection, x509, errnum, errdepth, ok): if not ok: cslog.debug('invalid server cert: %s' % x509.get_subject()) return False return True
AdamISZ/CoinSwapCS
[ 30, 14, 30, 19, 1493059952 ]
def getContext(self): ctx = ssl.ClientContextFactory.getContext(self) #TODO: replace VERIFY_NONE with VERIFY_PEER when we have #a real server with a valid CA signed cert. If that doesn't #work it'll be possible to use self-signed certs, if they're distributed, #by placing the cer...
AdamISZ/CoinSwapCS
[ 30, 14, 30, 19, 1493059952 ]
def __init__(self, host, port, json_callback=None, backout_callback=None, usessl=False): self.host = host self.port = int(port) #Callback fired on receiving response to send() self.json_callback = json_callback #Callback fired on receiving any response failure ...
AdamISZ/CoinSwapCS
[ 30, 14, 30, 19, 1493059952 ]
def error(self, errmsg): """error callback implies we must back out at this point. Note that this includes stateless queries, as any malformed or non-response must be interpreted as malicious. """ self.backout_callback(str(errmsg))
AdamISZ/CoinSwapCS
[ 30, 14, 30, 19, 1493059952 ]
def send_poll_unsigned(self, method, callback, *args): """Stateless queries outside of a coinswap run use this query method; no nonce, sessionid or signature needed. """ d = self.proxy.callRemote(method, *args) d.addCallback(callback).addErrback(self.error)
AdamISZ/CoinSwapCS
[ 30, 14, 30, 19, 1493059952 ]
def __init__(self, wallet, testing_mode=False, carol_class=CoinSwapCarol, fail_carol_state=None): self.testing_mode = testing_mode self.wallet = wallet self.carol_class = carol_class self.fail_carol_state = fail_carol_state self.carols = {} self.fee_polic...
AdamISZ/CoinSwapCS
[ 30, 14, 30, 19, 1493059952 ]
def refresh_carols(self): """Remove CoinSwapCarol instances that are flagged complete from the running dict.""" to_remove = [] for k, v in self.carols.iteritems(): if v.completed: to_remove.append(k) for x in to_remove: self.carols.pop(x, N...
AdamISZ/CoinSwapCS
[ 30, 14, 30, 19, 1493059952 ]
def jsonrpc_status(self): """This can be polled at any time. The call to get_balance_by_mixdepth does not involve sync, so is not resource intensive. """ return self.update_status()
AdamISZ/CoinSwapCS
[ 30, 14, 30, 19, 1493059952 ]
def consume_nonce(self, nonce, sessionid): if sessionid not in self.carols: return False return self.carols[sessionid].consume_nonce(nonce)
AdamISZ/CoinSwapCS
[ 30, 14, 30, 19, 1493059952 ]
def jsonrpc_coinswap(self, *paramlist): """To get round txjsonrpc's rather funky function naming trick, we use 1 generic json rpc method and then read the real method as a field. This allows us to handle generic features like signatures and nonces in this function before deferring actual...
AdamISZ/CoinSwapCS
[ 30, 14, 30, 19, 1493059952 ]
def __init__(self, name, *args, **kwargs): """ create QcFrame object. name: name of the frame molecule """ # mandatory parameter self._name = name self._fragments = OrderedDict() self._charge = 0 self._state = {} # 状態保持 self._cmds = self....
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _copy_constructor(self, rhs): self._name = rhs._name self._fragments = copy.deepcopy(rhs._fragments) self._charge = rhs._charge self._state = copy.deepcopy(rhs._state) self._cmds = copy.copy(rhs._cmds)
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _initialize(self, *args, **kwargs): pass
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _load(self): path = os.path.join(self.work_dir, "qcframe.mpac") if os.path.exists(path): logger.info("load the fragment state: {}".format(path)) state_dat = bridge.load_msgpack(path) self.set_by_raw_data(state_dat) else: logger.debug("not found...
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def get_raw_data(self): return self.__getstate__()
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def __getstate__(self): state = {} state["name"] = self.name tmp_frgs = [] for k, frg in self.fragments(): tmp_frgs.append((k, frg.get_raw_data())) state["fragments"] = tmp_frgs state["charge"] = self.charge state["state"] = self._state state["...
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _get_pdfparam(self): """ pdfparamオブジェクトを返す """ pdfparam_path = os.path.abspath( os.path.join(self.work_dir, self._pdfparam_filename) ) if "pdfparam" not in self._cache: if os.path.exists(pdfparam_path): mpac_data = bridge.load_...
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def set_db_filename(self, filename): assert filename is not None self._db_filename = str(filename) logger.debug("set_db_filename: {}".format(self._db_filename))
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def get_pdfarchive(self): """ pdfArchiveオブジェクトを返す """ logger.debug("get_pdfarchive db_path={}".format(self.db_path)) pdfarc = None if self._cmds.get("archive", None) == "archive": pdfarc = pdf.PdfArchive(self.db_path) else: pdfarc = pdf.Pdf...
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def set_command_alias(self, cmd_alias_dict): for k, v in cmd_alias_dict.items(): logger.debug("command update: {} -> {}".format(k, v)) self._cmds[k] = v
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _get_work_dir(self): return self._work_dir
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _get_name(self): return self._name
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _set_basisset(self, pdfparam): for fragment_name, fragment in self.fragments(): fragment.set_basisset(pdfparam)
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _get_frame_molecule(self): """ モデリングされた分子構造をAtomGroupオブジェクトで返す """ if "frame_molecule" not in self._cache: logger.info("create frame molecule coordinates.") frame_molecule = bridge.AtomGroup() for frg_name, frg in self._fragments.items(): ...
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _get_fragments_atom_ids(self): fragments_atom_ids = [] for fragment_name, fragment in self.fragments(): fragment_atomgroup = fragment.get_AtomGroup() fragment_atomgroup *= pdf.ANG2AU # angstrom -> a.u. fragment_atom_list = fragment_atomgroup.get_atom_list() ...
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _prepare_work_dir(self): """ カレントディレクトリ下に作業ディレクトリとなる nameのディレクトリを作成する。 """ # assert(len(self.name) > 0) if len(self.name) == 0: logger.critical("frame name is not defined.") raise self._work_dir = os.path.abspath(os.path.join(os.curdir,...
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def restore_cwd(self): """ self.cd_work_dir() 以前のディレクトリに戻す """ os.chdir(self._prev_dir) logger.debug( "{header} < (prev_dir: {path})".format( header=self.header, path=self._prev_dir ) )
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _get_charge(self): return int(self._charge)
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def get_number_of_AOs(self): """ return the number of atomic orbitals. """ num_of_AOs = 0 for frg_name, frg in self.fragments(): num_of_AOs += frg.get_number_of_AOs() return num_of_AOs
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _get_state_finished_guess_density(self): self._state.setdefault("is_finished_guess_density", False) return self._state["is_finished_guess_density"]
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _get_state_finished_guess_QCLO(self): self._state.setdefault("is_finished_guess_QCLO", False) return self._state["is_finished_guess_QCLO"]
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _get_state_finished_prescf(self): self._state.setdefault("is_finished_prescf", False) return self._state["is_finished_prescf"]
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _get_state_finished_scf(self): self._state.setdefault("is_finished_scf", False) return self._state["is_finished_scf"]
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _get_state_finished_force(self): self._state.setdefault("is_finished_force", False) return self._state["is_finished_force"]
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]
def _get_state_finished_pickup_density_matrix(self): self._state.setdefault("is_finished_pickup_density_matrix", False) return self._state["is_finished_pickup_density_matrix"]
ProteinDF/QCLObot
[ 4, 1, 4, 5, 1408759315 ]