code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class PlayGameState(GameState): <NEW_LINE> <INDENT> def __init__(self, window): <NEW_LINE> <INDENT> super(PlayGameState, self).__init__(window) <NEW_LINE> self.board.load_state('default') <NEW_LINE> self.load_interface('play.interface') <NEW_LINE> self.views.end_turn.on_press = self.board.pass_turn <NEW_LINE> self.view... | Handle the playing of the game. | 62598fc45166f23b2e2436b0 |
class UserRole(BaseCredentialSource): <NEW_LINE> <INDENT> def get(self, username, instance_role_name): <NEW_LINE> <INDENT> identity = clients.sts.get_caller_identity() <NEW_LINE> role_arn = ( 'arn:aws:iam::{account}:role/' + self.config.role_name_pattern ).format(account=identity['Account'], username=username) <NEW_LIN... | AssumeRole to an existing user-oriented role.
| 62598fc47b180e01f3e491b7 |
class GitHubEnterprise(GitHub): <NEW_LINE> <INDENT> def __init__(self, url, username='', password='', token='', verify=True): <NEW_LINE> <INDENT> super(GitHubEnterprise, self).__init__(username, password, token) <NEW_LINE> self.session.base_url = url.rstrip('/') + '/api/v3' <NEW_LINE> self.session.verify = verify <NEW_... | For GitHub Enterprise users, this object will act as the public API to
your instance. You must provide the URL to your instance upon
initialization and can provide the rest of the login details just like in
the :class:`GitHub <GitHub>` object.
There is no need to provide the end of the url (e.g., /api/v3/), that will
... | 62598fc4be7bc26dc9251fc3 |
class Item(object): <NEW_LINE> <INDENT> def __init__(self, text, name=None): <NEW_LINE> <INDENT> self.text = text <NEW_LINE> self._name = name <NEW_LINE> if not self._name: <NEW_LINE> <INDENT> for line in unfold(self.text): <NEW_LINE> <INDENT> if line.startswith("X-RADICALE-NAME:"): <NEW_LINE> <INDENT> self._name = lin... | Internal iCal item. | 62598fc4d486a94d0ba2c2a1 |
class RandomHorizontalFlip(object): <NEW_LINE> <INDENT> def __call__(self, inputs,target_depth,target_label): <NEW_LINE> <INDENT> if random.random() < 0.5: <NEW_LINE> <INDENT> inputs = np.flip(inputs,axis=0).copy() <NEW_LINE> target_depth = np.flip(target_depth,axis=0).copy() <NEW_LINE> <DEDENT> return inputs,target_de... | Randomly horizontally flips the given PIL.Image with a probability of 0.5
| 62598fc45fdd1c0f98e5e263 |
class OBJECTPATH(CIMElement): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> Element.__init__(self, 'OBJECTPATH') <NEW_LINE> self.appendChild(data) | The OBJECTPATH element is used to define a full path to a single
CIM Object (Class or Instance).
<!ELEMENT OBJECTPATH (INSTANCEPATH | CLASSPATH)> | 62598fc44f88993c371f0673 |
class PurpleAI(BlueAI): <NEW_LINE> <INDENT> body_image_name = "tank_corps_purple.png" <NEW_LINE> canon_image_name = "canon_purple.png" <NEW_LINE> def __init__(self, pos, target_pos, points_list=None): <NEW_LINE> <INDENT> BlueAI.__init__(self, pos, target_pos, points_list) <NEW_LINE> self.max_shots = 3 <NEW_LINE> self.n... | An AI that moves along a pre-defined path.
Shoots the player on sight.
A certain number of shots (3) are needed to kill it. | 62598fc4f9cc0f698b1c543a |
class StewartEtAl2016RegJPNVH(StewartEtAl2016VH): <NEW_LINE> <INDENT> VGMPE = boore_2014.StewartEtAl2016(region='JPN') <NEW_LINE> HGMPE = boore_2014.BooreEtAl2014LowQ() | This class implements the Stewart et al. (2016) V/H model considering the
correction to the path scaling term for Low Q regions (e.g. Japan) | 62598fc47047854f4633f6a4 |
class DescribeVideoGenerationTaskCallbackRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.SdkAppId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.SdkAppId = params.get("SdkAppId") | DescribeVideoGenerationTaskCallback请求参数结构体
| 62598fc47d847024c075c68f |
class UpdateQuoteView(UpdateView): <NEW_LINE> <INDENT> form_class = UpdateQuoteForm <NEW_LINE> template_name = "quotes/update_quote_form.html" <NEW_LINE> queryset = Quote.objects.all() | Create a new Quote object and store it in the database | 62598fc423849d37ff851385 |
class PluginCollection(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def add(cls, key, obj): <NEW_LINE> <INDENT> if 'key_to_obj' not in cls.__dict__: <NEW_LINE> <INDENT> cls.key_to_obj = {} <NEW_LINE> <DEDENT> if key in cls.key_to_obj: <NEW_LINE> <INDENT> raise Exception('Key {} is used both by {} and {}'.format... | A singleton dict for finding plugins -- usage:
1) Inherit to make a collection:
class FunkyPlugins(PluginCollection):
pass
3) Add plugins to the collection (usually, at module initialization):
FunkyPlugins.add('groovy', lambda x, y: '{} rocks {}'.format(x, y))
4) Access plugins via their keys... | 62598fc4d8ef3951e32c7fc5 |
class WikiPage(RedditBase): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def _revision_generator(subreddit, url, generator_kwargs): <NEW_LINE> <INDENT> for revision in ListingGenerator(subreddit._reddit, url, **generator_kwargs): <NEW_LINE> <INDENT> revision['author'] = Redditor(subreddit._reddit, _data=revision['autho... | An individual WikiPage object. | 62598fc4283ffb24f3cf3b57 |
class Join(models.Model): <NEW_LINE> <INDENT> email = models.EmailField() <NEW_LINE> ip_address = models.CharField(max_length=120, default='ABC') <NEW_LINE> timestamp = models.DateTimeField(auto_now_add=True, auto_now=False) <NEW_LINE> updated = models.DateTimeField(auto_now_add=False, auto_now=True) <NEW_LINE> def __u... | Model to save all the emails for people joining the web page | 62598fc563b5f9789fe85446 |
class Graph(object): <NEW_LINE> <INDENT> def __init__(self, connections, directed=False): <NEW_LINE> <INDENT> self._graph = defaultdict(set) <NEW_LINE> self._directed = directed <NEW_LINE> self.add_connections(connections) <NEW_LINE> <DEDENT> def add_connections(self, connections): <NEW_LINE> <INDENT> for node1, node2 ... | Graph class, undirected by default. | 62598fc54a966d76dd5ef1a8 |
class ReferenceValuesValidator: <NEW_LINE> <INDENT> implements(IValidator) <NEW_LINE> name = "referencevalues_validator" <NEW_LINE> def __call__(self, value, *args, **kwargs): <NEW_LINE> <INDENT> instance = kwargs['instance'] <NEW_LINE> request = kwargs.get('REQUEST', {}) <NEW_LINE> if instance.REQUEST.get('validated',... | Min value must be below max value
Percentage value must be between 0 and 100
Values must be numbers
Expected values must be between min and max values | 62598fc57b180e01f3e491b9 |
class EditContView(ContextualActionView): <NEW_LINE> <INDENT> __events__ = ('on_undo', 'on_redo', 'on_cut', 'on_copy', 'on_paste', 'on_delete', 'on_selectall', 'on_next_screen', 'on_prev_screen') <NEW_LINE> action_btn_next_screen = ObjectProperty(None, allownone=True) <NEW_LINE> action_btn_prev_screen = ObjectProperty(... | EditContView is a ContextualActionView, used to display Edit items:
Copy, Cut, Paste, Undo, Redo, Select All, Add Custom Widget. It has
events:
on_undo, emitted when Undo ActionButton is clicked.
on_redo, emitted when Redo ActionButton is clicked.
on_cut, emitted when Cut ActionButton is clicked.
on_copy, emitted when ... | 62598fc5a05bb46b3848ab3f |
class NewsSerializer(FlexFieldsModelSerializer): <NEW_LINE> <INDENT> expandable_fields = { "categories": (CategorySerializer, {"source": "categories", "many": True}), "language": (LanguageSerializer, {"source": "language"}), } <NEW_LINE> url = URLField(read_only=True, allow_null=True) <NEW_LINE> media = NewsMediaSerial... | ## Expansions
To activate relation expansion add the desired fields as a comma separated
list to the `expand` query parameter like this:
?expand=<field>,<field>,<field>,...
The following relational fields can be expanded:
* `categories`
* `language` | 62598fc5283ffb24f3cf3b58 |
class DiffbotControlPanel(ControlPanelForm): <NEW_LINE> <INDENT> form_fields = form.FormFields(IDiffbotSettings) <NEW_LINE> label = _(u"Diffbot API") <NEW_LINE> description = _(u"Diffbot API settings") <NEW_LINE> form_name = _(u"Diffbot settings") | Diffbot API
| 62598fc57047854f4633f6a6 |
class ANRException(UnexpectedUIStateException): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> super(ANRException, self).__init__(message) | Application Not Responded | 62598fc576e4537e8c3ef879 |
class ConverterABC(SubConverter): <NEW_LINE> <INDENT> registerFormats = ('abc',) <NEW_LINE> registerInputExtensions = ('abc',) <NEW_LINE> def parseData(self, strData, number=None): <NEW_LINE> <INDENT> from music21 import abcFormat <NEW_LINE> af = abcFormat.ABCFile() <NEW_LINE> abcHandler = af.readstr(strData, number=nu... | Simple class wrapper for parsing ABC.
Input only | 62598fc5377c676e912f6edf |
class Bullet(Sprite): <NEW_LINE> <INDENT> def __init__(self, ai_settings, screen, ship): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.screen = screen <NEW_LINE> self.rect = pygame.Rect( 0, 0, ai_settings.bullet_width, ai_settings.bullet_height) <NEW_LINE> self.rect.centerx = ship.rect.centerx <NEW_LINE> self.... | 一个对飞船发射的子弹进行管理的类 | 62598fc5f9cc0f698b1c543c |
class Capturing(list): <NEW_LINE> <INDENT> def __enter__(self): <NEW_LINE> <INDENT> self._stdout = sys.stdout <NEW_LINE> sys.stdout = self._stringio = StringIO() <NEW_LINE> return self <NEW_LINE> <DEDENT> def __exit__(self, *args): <NEW_LINE> <INDENT> self.extend(self._stringio.getvalue().splitlines()) <NEW_LINE> sys.s... | Context that captures the standard output of a function | 62598fc5283ffb24f3cf3b5a |
class ShowPlatformSudiPkiSchema(MetaParser): <NEW_LINE> <INDENT> schema = { Optional('Cisco Manufacturing CA III certificate') : str, Optional('Cisco Manufacturing CA') : str, Optional('Cisco Manufacturing CA III') : str, Optional('Cisco Manufacturing CA SHA2') : str, } | Schema for show platform sudi pki. | 62598fc55fc7496912d483e5 |
class updateComment(generics.GenericAPIView): <NEW_LINE> <INDENT> permissions_classes = [ permissions.IsAuthenticated ] <NEW_LINE> def post(self, request, commentId, *args, **kwargs): <NEW_LINE> <INDENT> print(request.data) <NEW_LINE> newContent = request.data.get('newContent') <NEW_LINE> queryset = Comment.objects.get... | 상품 댓글 수정
---
## `/product/updateComment/<int:commentId>` | 62598fc560cbc95b06364613 |
class HelpCmd(Cmd): <NEW_LINE> <INDENT> implements(ICmdArgumentsSyntax) <NEW_LINE> command('help') <NEW_LINE> @defer.inlineCallbacks <NEW_LINE> def arguments(self): <NEW_LINE> <INDENT> parser = VirtualConsoleArgumentParser() <NEW_LINE> choices = [i.name for i in (yield self._commands())] <NEW_LINE> parser.add_argument(... | Outputs the names of all commands. | 62598fc57cff6e4e811b5cfb |
class PyPythonHtmlgen(PythonPackage): <NEW_LINE> <INDENT> homepage = "https://github.com/srittau/python-htmlgen" <NEW_LINE> url = "https://github.com/srittau/python-htmlgen/archive/v1.2.2.tar.gz" <NEW_LINE> version('1.2.2', sha256='9dc60e10511f0fd13014659514c6c333498c21779173deb585cd4964ea667770') <NEW_LINE> confl... | Library to generate HTML from classes.
| 62598fc57047854f4633f6a8 |
class TestKendallTau(object): <NEW_LINE> <INDENT> def test_kendalltau(self): <NEW_LINE> <INDENT> X, _ = load_energy(return_dataset=True).to_numpy() <NEW_LINE> expected = np.array( [ [1.0, -1.0, -0.2724275, -0.7361443, 0.7385489, 0.0, 0.0, 0.0], [-1.0, 1.0, 0.2724275, 0.7361443, -0.7385489, 0.0, 0.0, 0.0], [-0.2724275, ... | Test the Kendall-Tau correlation metric | 62598fc5d486a94d0ba2c2a7 |
class OneDimNondeterministicCellLoop(NondeterministicCellLoopMixin,OneDimCellLoop): <NEW_LINE> <INDENT> pass | This Nondeterministic Cell Loop loops over one dimension, skipping cells
with a probability of probab. | 62598fc523849d37ff851389 |
class TBoolColumn: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.LIST, 'values', (TType.BOOL,None), None, ), (2, TType.STRING, 'nulls', None, None, ), ) <NEW_LINE> def __init__(self, values=None, nulls=None,): <NEW_LINE> <INDENT> self.values = values <NEW_LINE> self.nulls = nulls <NEW_LINE> <DEDENT> def read(self... | Attributes:
- values
- nulls | 62598fc5091ae35668704efe |
class BTreeST(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.root = Page(True, 0) <NEW_LINE> self.numpages = 1 <NEW_LINE> self.N = 0 <NEW_LINE> <DEDENT> def size(self): <NEW_LINE> <INDENT> return self.numpages, self.N <NEW_LINE> <DEDENT> def contains(self, key): <NEW_LINE> <INDENT> def helper... | balanced M order B-tree
underlying data structure for a reverse web index
each node (page) is stored as a file on disk
word => file that contains word | 62598fc5a8370b77170f06b1 |
class Mapping(Sized, Iterable, Container): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def __getitem__(self, key): <NEW_LINE> <INDENT> raise KeyError <NEW_LINE> <DEDENT> def get(self, key, default=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self[key] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <IN... | A Mapping is a generic container for associating key/value
pairs.
This class provides concrete generic implementations of all
methods except for __getitem__, __iter__, and __len__. | 62598fc50fa83653e46f51bd |
class UDPMCastServer(UDPServer): <NEW_LINE> <INDENT> def _create_socket(self): <NEW_LINE> <INDENT> self._addrinfo = addrinfo = socket.getaddrinfo(self._bind[0], None)[0] <NEW_LINE> sock = socket.socket(addrinfo[0], socket.SOCK_DGRAM) <NEW_LINE> sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) <NEW_LINE> sock.... | classdocs | 62598fc59f288636728189e7 |
class create(BrowserView): <NEW_LINE> <INDENT> def go(self): <NEW_LINE> <INDENT> imAlbumid="MyTestAlbum" <NEW_LINE> imPhotoid=("MyTestPhoto1","MyTestPhoto2","MyTestPhoto3","MyTestPhoto4") <NEW_LINE> debug="Creating imAlbum "+imAlbumid+"/n" <NEW_LINE> try: <NEW_LINE> <INDENT> self.context.invokeFactory(id=imAlbumid, typ... | a view | 62598fc571ff763f4b5e7a54 |
class AccountSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> user = serializers.PrimaryKeyRelatedField(read_only=True, default=serializers.CurrentUserDefault()) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Account <NEW_LINE> fields = '__all__' | Serializer for Account model | 62598fc55166f23b2e2436b8 |
class S20Switch(SwitchDevice): <NEW_LINE> <INDENT> def __init__(self, name, s20): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._s20 = s20 <NEW_LINE> self._state = False <NEW_LINE> self._exc = S20Exception <NEW_LINE> <DEDENT> @property <NEW_LINE> def should_poll(self): <NEW_LINE> <INDENT> return True <NEW_LINE>... | Representation of an S20 switch. | 62598fc53617ad0b5ee0641e |
@ISISSansSystemTest(SANSInstrument.SANS2D) <NEW_LINE> class SANS2DMinimalSingleReductionTest_V2(systemtesting.MantidSystemTest): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SANS2DMinimalSingleReductionTest_V2, self).__init__() <NEW_LINE> config['default.instrument'] = 'SANS2D' <NEW_LINE> self.tole... | Minimal script to perform full reduction in single mode | 62598fc560cbc95b06364615 |
class TestUtils(unittest.TestCase): <NEW_LINE> <INDENT> def test_overlap_p_1(self): <NEW_LINE> <INDENT> a = (0, 1, 0, 1) <NEW_LINE> b = (0.2, 2, 0.2, 2) <NEW_LINE> res = mht.utils.overlap_pa(a, b) <NEW_LINE> self.assertAlmostEqual(res, 0.64) <NEW_LINE> <DEDENT> def test_overlap_p_2(self): <NEW_LINE> <INDENT> a = (0, 1,... | Testshell for utilities. | 62598fc555399d3f056267ef |
class ClientPutInServer(_ListenerManager): <NEW_LINE> <INDENT> manager = client_put_in_server_listener_manager | Register/unregister a ClientPutInServer listener. | 62598fc5bf627c535bcb177f |
class ListIterator(JavaIterator): <NEW_LINE> <INDENT> def __init__(self, l): <NEW_LINE> <INDENT> self.nr_pairs = len(l) <NEW_LINE> self._iter = iter(l) <NEW_LINE> <DEDENT> def hasNext(self): <NEW_LINE> <INDENT> return self.nr_pairs > 0 <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> self.nr_pairs -= 1 <NEW_... | Adds the hasNext() method to the standard list iterator
>>> it = ListIterator([(1, 0), (2, 1), (3, 0)])
>>> it.next()
(1, 0)
>>> it.next()
(2, 1)
>>> it.next()
(3, 0)
>>> it.hasNext()
False | 62598fc5956e5f7376df57ea |
class Magic(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.MIME_TYPE = 0x000010 <NEW_LINE> self.PRESERVE_ATIME = 0x000080 <NEW_LINE> self.NO_CHECK_ENCODING = 0x200000 <NEW_LINE> self.DEFAULT = self.MIME_TYPE | self.PRESERVE_ATIME | self.NO_CHECK_ENCODING <NEW_LINE> libmagic = ctypes.util.find... | Magic wrapper | 62598fc5cc40096d6161a344 |
class Subtasks(object): <NEW_LINE> <INDENT> def __init__(self, api): <NEW_LINE> <INDENT> self.__api = api <NEW_LINE> <DEDENT> def new(self, task, title): <NEW_LINE> <INDENT> from tasks import Task <NEW_LINE> if isinstance(task, int): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> elif isinstance(task, Task): <NEW_LINE> <... | Subtasks give an interface for manage subtasks in Producteev. | 62598fc5851cf427c66b858d |
class GroupModifyLoop(GroupTest): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> port1, = openflow_ports(1) <NEW_LINE> msg = ofp.message.group_add( group_type=ofp.OFPGT_ALL, group_id=0, buckets=[ create_bucket(actions=[ofp.action.output(port1)])]) <NEW_LINE> self.controller.message_send(msg) <NEW_LINE> do_b... | A modification causing loop should result in OFPET_GROUP_MOD_FAILED/OFPGMFC_LOOP | 62598fc55fcc89381b2662b9 |
class LookUpTableBrain(Brain): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._table = {} <NEW_LINE> <DEDENT> def configure(self,**kargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def learn(self,dataset): <NEW_LINE> <INDENT> if dataset == {}: raise LookUpTableBrainException("Dataset for learning i... | Brain class based on Lookup table
Attributes:
_table - Look up table | 62598fc550812a4eaa620d51 |
class Ospf(VersionedPanObject): <NEW_LINE> <INDENT> NAME = None <NEW_LINE> CHILDTYPES = ( "network.OspfArea", "network.OspfAuthProfile", "network.OspfExportRules", ) <NEW_LINE> def _setup(self): <NEW_LINE> <INDENT> self._xpaths.add_profile(value='/protocol/ospf') <NEW_LINE> params = [] <NEW_LINE> params.append(Versione... | OSPF Process
Args:
enable (bool): Enable OSPF (Default: True)
router_id (str): Router ID in IP format (eg. 1.1.1.1)
reject_default_route (bool): Reject default route
allow_redist_default_route (bool): Allow redistribution in default route
rfc1583 (bool): rfc1583
spf_calculation_delay (int): SPF... | 62598fc55fdd1c0f98e5e26b |
class ScrapyPriorityQueue(PriorityQueue): <NEW_LINE> <INDENT> def __init__(self, crawler, qfactory, startprios=(), serialize=False): <NEW_LINE> <INDENT> super(ScrapyPriorityQueue, self).__init__(qfactory, startprios) <NEW_LINE> self.serialize = serialize <NEW_LINE> self.spider = crawler.spider <NEW_LINE> <DEDENT> @clas... | PriorityQueue which works with scrapy.Request instances and
can optionally convert them to/from dicts before/after putting to a queue. | 62598fc5a219f33f346c6ae0 |
class IBUCalculation(): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def tinseth_ibu(AA, m, u, c): <NEW_LINE> <INDENT> return c * u * m * AA | Container class for IBU calculations
| 62598fc5656771135c489948 |
class SubnetManagerInitializationError(Exception): <NEW_LINE> <INDENT> pass | Custom initialization exception
| 62598fc52c8b7c6e89bd3a9c |
class Supytube(callbacks.Plugin): <NEW_LINE> <INDENT> threaded = True <NEW_LINE> def doPrivmsg(self, irc, msg): <NEW_LINE> <INDENT> if(self.registryValue('enable', msg.args[0])): <NEW_LINE> <INDENT> if(msg.args[1].find("youtube") != -1 or msg.args[1].find("youtu.be") != -1): <NEW_LINE> <INDENT> youtube_pattern = re.com... | Add the help for "@plugin help Supytube" here
This should describe *how* to use this plugin. | 62598fc54a966d76dd5ef1ae |
class HomepageTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = Client() <NEW_LINE> self.url = reverse('homepage') <NEW_LINE> <DEDENT> def test_home_template_used(self): <NEW_LINE> <INDENT> response = self.client.get(self.url) <NEW_LINE> self.assertIn('public/home.html', respons... | Tests for the homepage view. | 62598fc5283ffb24f3cf3b5e |
class HTTPRuntimeException(ServiceHTTPException): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> ServiceHTTPException.__init__(self) <NEW_LINE> self.message = message <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "HTTP runtime exception - %s" % self.message | The HTTP runtime exception class. | 62598fc55fc7496912d483e7 |
class IotModelData(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Revision = None <NEW_LINE> self.ReleaseTime = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Revision = params.get("Revision") <NEW_LINE> self.ReleaseTime = params.get("ReleaseTime") <N... | 物模型历史版本
| 62598fc555399d3f056267f1 |
class PyPackageReaderVlab(AbstractPackageReader): <NEW_LINE> <INDENT> def register_packages(self, pkgmanager): <NEW_LINE> <INDENT> fn = _path(self.filename).abspath() <NEW_LINE> pkg_path = fn.dirname() <NEW_LINE> spec_file = fn.basename() <NEW_LINE> assert 'specification' in spec_file <NEW_LINE> vlab_package = vlab_obj... | Build a package from a vlab specification file. | 62598fc57047854f4633f6ac |
class UserTasksConfig(AppConfig): <NEW_LINE> <INDENT> name = 'user_tasks' <NEW_LINE> verbose_name = 'User Tasks' <NEW_LINE> def ready(self): <NEW_LINE> <INDENT> import user_tasks.signals | Configuration for the user_tasks Django application. | 62598fc5e1aae11d1e7ce992 |
class AdvancedImportSelect(ObjListWindow): <NEW_LINE> <INDENT> def __init__(self, bibs={}, parent=None): <NEW_LINE> <INDENT> self.bibs = bibs <NEW_LINE> super(AdvancedImportSelect, self).__init__(parent, gridLayout=True) <NEW_LINE> self.checkBoxes = [] <NEW_LINE> self.result = False <NEW_LINE> self.askCats = None <NEW_... | create a window for the advanced import | 62598fc54c3428357761a596 |
class PopenModuleRunner(ModuleRunner): <NEW_LINE> <INDENT> def run(self, cmd, inpLines=[], execStart=None): <NEW_LINE> <INDENT> inpLines.reverse() <NEW_LINE> inp, outp, errp = os.popen3(cmd) <NEW_LINE> pid = 0 <NEW_LINE> if execStart: <NEW_LINE> <INDENT> wx.CallAfter(execStart, pid) <NEW_LINE> <DEDENT> out = [] <NEW_LI... | Uses Python's popen2, output and errors are redirected and displayed
in a frame. | 62598fc5091ae35668704f02 |
class ItemViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Item.objects.all().order_by('-create_date') <NEW_LINE> serializer_class = ItemSerializer <NEW_LINE> @action(detail=True, methods=['post']) <NEW_LINE> def create_transaction(self, request, pk=None): <NEW_LINE> <INDENT> item = self.get_object() <NEW... | API endpoint allowing Item operations | 62598fc550812a4eaa620d52 |
class IntegrationTestCase(BaseTestCase): <NEW_LINE> <INDENT> layer = VNCCOLLAB_COMMON_INTEGRATION_TESTING | Base class for integration tests. | 62598fc50fa83653e46f51c1 |
class ArrayStack: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._data = [] <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self._data) <NEW_LINE> <DEDENT> def is_empty(self): <NEW_LINE> <INDENT> return len(self) == 0 <NEW_LINE> <DEDENT> def push(self, _e): <NEW_LINE> <INDENT> se... | LIFO Stack implementation using in-built Python-List for storage | 62598fc55fdd1c0f98e5e26e |
class TbilisiManager (models.Manager): <NEW_LINE> <INDENT> def get_query_set(self): <NEW_LINE> <INDENT> cityhall = Unit.objects.get(pk=2) <NEW_LINE> return cityhall.active_term.representatives.all() | Manager to return Tbilisi City Hall representatives in active term. | 62598fc57c178a314d78d77a |
@provider(IFormFieldProvider) <NEW_LINE> class IHPHWidgetContentAlias(Interface): <NEW_LINE> <INDENT> alias = schema.TextLine( title=u"Content Source", description=_(u"Please enter the unique identifier of the target " u"content item available via attaching @@uuid to the " u"target object's url"), required=True, ) | Content Widget to display external content via references | 62598fc57b180e01f3e491bd |
class Rastrigin(OptimizationTestProblem): <NEW_LINE> <INDENT> name = 'Rastrigin' <NEW_LINE> opt_f = 0 <NEW_LINE> opt_x = [0, 0] <NEW_LINE> x_min = [-5.12, -5.12] <NEW_LINE> x_max = [5.12, 5.12] <NEW_LINE> n_cons = 0 <NEW_LINE> n_eq_cons = 0 <NEW_LINE> def __call__(self, x): <NEW_LINE> <INDENT> f = 20 + x[0]**2 + x[1]**... | 2-dimensional Rastrigin function.
https://www.sfu.ca/~ssurjano/rastr.html
f* = 0, x* = (0, 0) | 62598fc5377c676e912f6ee2 |
class SourceStatus(): <NEW_LINE> <INDENT> def __init__(self, *, status: str = None, next_crawl: datetime = None) -> None: <NEW_LINE> <INDENT> self.status = status <NEW_LINE> self.next_crawl = next_crawl <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_dict(cls, _dict: Dict) -> 'SourceStatus': <NEW_LINE> <INDENT> ar... | Object containing source crawl status information.
:attr str status: (optional) The current status of the source crawl for this
collection. This field returns `not_configured` if the default configuration for
this source does not have a **source** object defined.
- `running` indicates that a crawl t... | 62598fc560cbc95b06364619 |
class VariantsMenu(walterWidgets.BaseVariantsMenu): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(VariantsMenu, self).__init__(parent) <NEW_LINE> <DEDENT> def _getVariantList(self, recursively=True): <NEW_LINE> <INDENT> return pm.walterStandin( getVariants=(self.nodePath, self.primPath,... | Menu for editing walter variants. | 62598fc57047854f4633f6ae |
class User(object): <NEW_LINE> <INDENT> def __init__(self, name, email, role): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.email = email <NEW_LINE> self.role = role | A minimal user class | 62598fc5956e5f7376df57ec |
class Game(object): <NEW_LINE> <INDENT> def __init__(self, column_id, game_id, teams, score, status, is_tb_game, start_time = 'add later'): <NEW_LINE> <INDENT> self.column_id = column_id <NEW_LINE> self.game_id = game_id <NEW_LINE> self.teams = teams <NEW_LINE> self.score = score <NEW_LINE> self.status = status <NEW_LI... | classdocs | 62598fc576e4537e8c3ef881 |
class SignalLink(object): <NEW_LINE> <INDENT> def __init__(self, widgetFrom, outputSignal, widgetTo, inputSignal, enabled=True, dynamic=False): <NEW_LINE> <INDENT> self.widgetFrom = widgetFrom <NEW_LINE> self.widgetTo = widgetTo <NEW_LINE> self.outputSignal = outputSignal <NEW_LINE> self.inputSignal = inputSignal <NEW_... | Back compatibility with old orngSignalManager, do not use. | 62598fc5adb09d7d5dc0a858 |
class CreateOWHLSkateSessionForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = OWHLSkateSession <NEW_LINE> exclude = ['paid'] <NEW_LINE> widgets = { 'skater': forms.HiddenInput(), 'skate_date': forms.HiddenInput(), 'goalie': forms.HiddenInput(), } <NEW_LINE> labels = {'goalie': 'Goalie?'... | Form used to sign up for OWHL Hockey skate sessions. | 62598fc50fa83653e46f51c3 |
class ConfigurationOptions(object): <NEW_LINE> <INDENT> pass | generic shell object for storing attributes | 62598fc55166f23b2e2436be |
class InforBaseStorage(AbstractComponent): <NEW_LINE> <INDENT> _name = 'infor.base.storage' <NEW_LINE> _inherit = ['infor.base'] <NEW_LINE> _usage = 'storage' <NEW_LINE> def write(self, verb, message_id, content): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def set_processed(self, message_id): <NE... | Manipulate files in the Infor storage
Base component, the various methods of writing the files
must be implemented in sub-components (sql or file). | 62598fc5656771135c48994c |
class NPEndPatternExtractor(SkillExtractor): <NEW_LINE> <INDENT> def __init__(self, endings, stop_phrases, only_bulleted_lines=True, confidence=95, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.endings = endings <NEW_LINE> self.stop_phrases = stop_phrases <NEW_LINE> self.only_... | Identify noun phrases with certain ending words (e.g 'skills', 'abilities') as skills
Args:
endings (list): Single words that should identify the ending of a noun phrase
as being a skill
stop_phrases (list): Noun phrases that should not be considered skills
only_bulleted_lines (bool, default True):... | 62598fc57c178a314d78d77c |
class SpeedValue: <NEW_LINE> <INDENT> def __lt__(self, other): <NEW_LINE> <INDENT> return self.to_native_units() < other.to_native_units() <NEW_LINE> <DEDENT> def __rmul__(self,other): <NEW_LINE> <INDENT> return self.__mul__(other) <NEW_LINE> <DEDENT> def to_native_units(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDE... | The base class for the SpeedValue classes.
Not meant to be used directly.
Use SpeedNativeUnits, SpeedPercent, SpeedRPS, SpeedRPM, SpeedDPS, SpeedDPM | 62598fc5a05bb46b3848ab49 |
class _PyAccessF(PyAccess): <NEW_LINE> <INDENT> def _post_init(self, *args, **kwargs): <NEW_LINE> <INDENT> self.pixels = ffi.cast("float **", self.image32) <NEW_LINE> <DEDENT> def get_pixel(self, x, y): <NEW_LINE> <INDENT> return self.pixels[y][x] <NEW_LINE> <DEDENT> def set_pixel(self, x, y, color): <NEW_LINE> <INDENT... | 32 bit float access | 62598fc5f548e778e596b87a |
class CohorteMaker(object): <NEW_LINE> <INDENT> def __init__(self, index_url): <NEW_LINE> <INDENT> self.index_url = index_url <NEW_LINE> self._index = {} <NEW_LINE> self._templates = {} <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _get_file_content(url): <NEW_LINE> <INDENT> return urllib2.urlopen(url).read() <NEW_L... | Utility class to construct home and bases folders | 62598fc526068e7796d4cc39 |
class InvalidConfigException(Exception): <NEW_LINE> <INDENT> pass | Thrown when the configuration for a question is invalid | 62598fc52c8b7c6e89bd3aa0 |
class NumberRange(object): <NEW_LINE> <INDENT> def __init__(self, min=None, max=None, message=None): <NEW_LINE> <INDENT> self.min = min <NEW_LINE> self.max = max <NEW_LINE> self.message = message <NEW_LINE> <DEDENT> def get_config(self): <NEW_LINE> <INDENT> return { 'name' : self.__class__.__name__, 'message' : self... | Validates that a number is of a minimum and/or maximum value, inclusive.
This will work with any comparable number type, such as floats and
decimals, not just integers.
:param min:
The minimum required value of the number. If not provided, minimum
value will not be checked.
:param max:
The maximum value of... | 62598fc5be7bc26dc9251fca |
class Hash(object): <NEW_LINE> <INDENT> def __init__(self, selector, id): <NEW_LINE> <INDENT> self.selector = selector <NEW_LINE> self.id = id <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '%s[%r#%s]' % ( self.__class__.__name__, self.selector, self.id) <NEW_LINE> <DEDENT> def specificity(self): <N... | Represents selector#id | 62598fc5ec188e330fdf8b72 |
class JsonErrorHandler(base_handler.JsonHandler): <NEW_LINE> <INDENT> def __init__(self, error): <NEW_LINE> <INDENT> self.error = error <NEW_LINE> self.json_response = {} <NEW_LINE> <DEDENT> def handle(self): <NEW_LINE> <INDENT> raise self.error | JsonHandler that raises an error when invoked. | 62598fc5e1aae11d1e7ce994 |
class DummyShell: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.handler = None <NEW_LINE> self.exc_tuple = None <NEW_LINE> <DEDENT> def set_custom_exc(self, exc_tuple, handler): <NEW_LINE> <INDENT> self.handler = handler <NEW_LINE> self.exc_tuple = exc_tuple <NEW_LINE> <DEDENT> def showtraceback(self... | Dummy class to emulate the iPython interactive shell.
https://ipython.org/ipython-doc/dev/api/generated/IPython.core.interactiveshell.html | 62598fc5091ae35668704f06 |
@attr.s(auto_attribs=True) <NEW_LINE> class Configuration: <NEW_LINE> <INDENT> appdaemon_path: str = "appdaemon/apps/" <NEW_LINE> appdaemon: bool = False <NEW_LINE> netdaemon_path: str = "netdaemon/apps/" <NEW_LINE> netdaemon: bool = False <NEW_LINE> config: dict = {} <NEW_LINE> config_entry: dict = {} <NEW_LINE> confi... | Configuration class. | 62598fc576e4537e8c3ef883 |
class ASFGUIDAttribute(ASFBaseAttribute): <NEW_LINE> <INDENT> TYPE = 0x0006 <NEW_LINE> def parse(self, data): <NEW_LINE> <INDENT> return data <NEW_LINE> <DEDENT> def _render(self): <NEW_LINE> <INDENT> return self.value <NEW_LINE> <DEDENT> def data_size(self): <NEW_LINE> <INDENT> return len(self.value) <NEW_LINE> <DEDEN... | GUID attribute. | 62598fc55fcc89381b2662bc |
class TriangleROI(ROI): <NEW_LINE> <INDENT> def __init__(self, pos, size, **args): <NEW_LINE> <INDENT> ROI.__init__(self, pos, [size, size], aspectLocked=True, **args) <NEW_LINE> angles = np.linspace(0, np.pi * 4 / 3, 3) <NEW_LINE> verticies = (np.array((np.sin(angles), np.cos(angles))).T + 1.0) / 2.0 <NEW_LINE> self.p... | Equilateral triangle ROI subclass with one scale handle and one rotation handle.
Arguments
pos (length-2 sequence) The position of the ROI's origin.
size (float) The length of an edge of the triangle.
\**args All extra keyword arguments are passed to ROI()
============== ====================... | 62598fc5a8370b77170f06b9 |
class Poll(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=200, verbose_name="Название") <NEW_LINE> text = models.TextField(max_length=200, verbose_name="Описание") <NEW_LINE> date_start = models.DateTimeField(verbose_name="Дата старта") <NEW_LINE> date_end = models.DateTimeField(verbose_name="Да... | Атрибуты опроса: название, дата старта, дата окончания, описание. | 62598fc599fddb7c1ca62f5c |
class ContainerRegistryManagementClientConfiguration(AzureConfiguration): <NEW_LINE> <INDENT> def __init__( self, credentials, subscription_id, base_url=None): <NEW_LINE> <INDENT> if credentials is None: <NEW_LINE> <INDENT> raise ValueError("Parameter 'credentials' must not be None.") <NEW_LINE> <DEDENT> if subscriptio... | Configuration for ContainerRegistryManagementClient
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param s... | 62598fc53317a56b869be6c0 |
class GetBucketLocationResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_LocationConstraint(self): <NEW_LINE> <INDENT> return self._output.get('LocationConstraint', None) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LIN... | A ResultSet with methods tailored to the values returned by the GetBucketLocation Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution. | 62598fc5283ffb24f3cf3b64 |
class Square: <NEW_LINE> <INDENT> def __init__(self, size=0): <NEW_LINE> <INDENT> self.__size = size <NEW_LINE> <DEDENT> @property <NEW_LINE> def size(self): <NEW_LINE> <INDENT> return self.__size <NEW_LINE> <DEDENT> @size.setter <NEW_LINE> def size(self, size): <NEW_LINE> <INDENT> if type(size) != int: <NEW_LINE> <IND... | class Square with private instance attribute size | 62598fc54a966d76dd5ef1b4 |
class ContourPoint(Point): <NEW_LINE> <INDENT> def SetPoint(self, P): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def __new__(self, P=None, C=None): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> Chamfer = property(lambda self: object(), lambda self, v: None, lambda self: None) | ContourPoint()
ContourPoint(P: Point, C: Chamfer) | 62598fc52c8b7c6e89bd3aa2 |
@req_cmd(Bugzilla4_4Rpc, cmd='fields') <NEW_LINE> class _FieldsRequest(FieldsRequest, RPCRequest): <NEW_LINE> <INDENT> def __init__(self, **kw): <NEW_LINE> <INDENT> super().__init__(command='Bug.fields', **kw) | Construct a fields request.
API docs: https://www.bugzilla.org/docs/4.4/en/html/api/Bugzilla/WebService/Bug.html#fields | 62598fc526068e7796d4cc3b |
class ArchFontPackage(object): <NEW_LINE> <INDENT> def __init__(self, pkg_dir, err_filename='makepkg.stderr.log'): <NEW_LINE> <INDENT> self.pkg_name = os.path.basename(pkg_dir) <NEW_LINE> self.pkg_dir = pkg_dir <NEW_LINE> self.status = {} <NEW_LINE> self.err_file = open(err_filename, 'a') <NEW_LINE> self.failed = [] <N... | Main class for an Archlinux font package.
It receives a package directory `pkg_dir` containing a PKGBUILD and
possible other files, as specified by ABS and AUR. | 62598fc5091ae35668704f08 |
class AugmentedNegativeBinomialCounts(GibbsSampling): <NEW_LINE> <INDENT> def __init__(self, X, counts, nbmodel): <NEW_LINE> <INDENT> assert counts.ndim == 1 <NEW_LINE> self.counts = counts <NEW_LINE> self.T = counts.shape[0] <NEW_LINE> self.X = X <NEW_LINE> self.model = nbmodel <NEW_LINE> self.omegas = np.ones(self.T)... | Class to keep track of a set of counts and the corresponding Polya-gamma
auxiliary variables associated with them. | 62598fc55fcc89381b2662bd |
class ConnectionError(Error): <NEW_LINE> <INDENT> def __init__(self, msg, details): <NEW_LINE> <INDENT> super(ConnectionError, self).__init__(msg) <NEW_LINE> self._details = details <NEW_LINE> <DEDENT> @property <NEW_LINE> def details(self): <NEW_LINE> <INDENT> return self._details <NEW_LINE> <DEDENT> def __repr__(self... | This exception indicates a problem with the connection to the HMC, below
the HTTP level. HTTP errors are indicated via :exc:`~zhmcclient.HTTPError`.
A retry by the user code is not likely to be successful, unless connect or
read retries had been disabled when creating the session (see
:class:`~zhmcclient.Session`).
E... | 62598fc5656771135c489950 |
class UNet(dygraph.Layer): <NEW_LINE> <INDENT> def __init__(self, num_inp=3, num_out=59, act="relu"): <NEW_LINE> <INDENT> super(UNet, self).__init__() <NEW_LINE> self.encoder = Encoder(num_inp) <NEW_LINE> self.middle_layer = Sequential( Conv2D(512, 1024, filter_size=3, stride=1, padding=0, act=None), BatchNorm(1024, ac... | 4 downsample.
4 upsample. | 62598fc5ff9c53063f51a92d |
class RelatedUserBase(models.Model, AbstractIsAdmin): <NEW_LINE> <INDENT> period = models.ForeignKey(Period, verbose_name='Period', help_text="The period.") <NEW_LINE> user = models.ForeignKey(User, help_text="The related user.") <NEW_LINE> tags = models.TextField(blank=True, null=True, help_text="Comma-separated list ... | Common fields for examiners and students related to a period.
.. attribute:: period
The period that the user is related to.
.. attribute:: user
A django.contrib.auth.models.User_ object. Must be unique within this
period.
.. attribute:: tags
Comma-separated list of tags. Each tag is a word with th... | 62598fc54527f215b58ea1b0 |
class ResultNotReady(Error): <NEW_LINE> <INDENT> pass | Raised when you access a data from a Future before it is assigned. | 62598fc5adb09d7d5dc0a85c |
class PIMD(QuaggaDaemon): <NEW_LINE> <INDENT> NAME = 'pimd' <NEW_LINE> DEPENDS = (Zebra,) <NEW_LINE> KILL_PATTERNS = (NAME,) <NEW_LINE> def __init__(self, node, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(node=node, *args, **kwargs) <NEW_LINE> <DEDENT> def build(self): <NEW_LINE> <INDENT> cfg = super().build... | This class configures a PIM daemon to responds to IGMP queries in order
to setup multicast routing in the network. | 62598fc592d797404e388cd2 |
class ProcessController(BasicController): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> def __init__(self, disk, backup_id, config): <NEW_LINE> <INDENT> super(ProcessController, self).__init__(backup_id) <NEW_LINE> self.disk = disk <NEW_LINE> self.config = config <NEW_LINE> self.backup_dir = ConfigHelper.confi... | This class defines the common structure for Backup and Restoration controllers
which need to be executed on threads separate from the standard server response thread pool. | 62598fc571ff763f4b5e7a5f |
class TimersResponse(object): <NEW_LINE> <INDENT> deserialized_types = { 'total_count': 'int', 'timers': 'list[ask_sdk_model.services.timer_management.timer_response.TimerResponse]', 'next_token': 'str' } <NEW_LINE> attribute_map = { 'total_count': 'totalCount', 'timers': 'timers', 'next_token': 'nextToken' } <NEW_LINE... | Timers object with paginated list of multiple timers
:param total_count: Total count of timers returned.
:type total_count: (optional) int
:param timers: List of multiple Timer objects
:type timers: (optional) list[ask_sdk_model.services.timer_management.timer_response.TimerResponse]
:param next_token: Link to retrie... | 62598fc50fa83653e46f51c7 |
class RelatedItemsModifier(object): <NEW_LINE> <INDENT> implements(ISurfResourceModifier) <NEW_LINE> adapts(IBaseContent) <NEW_LINE> def __init__(self, context): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> <DEDENT> def run(self, resource, *args, **kwds): <NEW_LINE> <INDENT> if not getattr(self.context, 'getRe... | Adds dcterms:references
| 62598fc599fddb7c1ca62f5d |
class _IdentityWrap: <NEW_LINE> <INDENT> __slots__ = ["unit_system", "ref"] <NEW_LINE> def __init__(self, obj: AbstractValueWithQuantityObject, unit_system: UnitSystemManager): <NEW_LINE> <INDENT> self.unit_system = unit_system <NEW_LINE> self.ref = weakref.ref(obj, self._OnRefKilled) <NEW_LINE> <DEDENT> def _OnRefKill... | Helper class to remove an object from the unit system references.
It's used so that we create a wrapper that'll give the __hash__ and __eq__ based on
the object id. | 62598fc57c178a314d78d780 |
class ADFSPTest(GenericSPTest): <NEW_LINE> <INDENT> mass_precision = 0.3 <NEW_LINE> foverlap00 = 1.00003 <NEW_LINE> foverlap11 = 1.02672 <NEW_LINE> foverlap22 = 1.03585 <NEW_LINE> b3lyp_energy = -140 <NEW_LINE> def testfoverlaps(self): <NEW_LINE> <INDENT> self.assertEquals(self.data.fooverlaps.shape, (self.data.nbasis,... | Customized restricted single point unittest | 62598fc5dc8b845886d5389c |
@util.export <NEW_LINE> class TempDir(base.Base): <NEW_LINE> <INDENT> def _clear(self): <NEW_LINE> <INDENT> self.logger.debug("removing directory '%s'", self._dir) <NEW_LINE> if os.path.exists(self._dir): <NEW_LINE> <INDENT> shutil.rmtree(self._dir) <NEW_LINE> <DEDENT> <DEDENT> def __init__(self, dir): <NEW_LINE> <INDE... | Temporary directory scope management
Usage:
with TempDir(directory):
pass | 62598fc5a05bb46b3848ab4c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.