text
stringlengths
0
1.05M
meta
dict
""" Filters the original item model. """ from PyQt4 import QtCore, QtGui from datafinder.gui.user.models.repository.filter.base_filter import BaseRepositoryFilter __version__ = "$Revision-Id:$" class LeafFilter(BaseRepositoryFilter, QtGui.QSortFilterProxyModel): """ This Model wraps ...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/models/repository/filter/leaf_filter.py", "copies": "1", "size": "4159", "license": "bsd-3-clause", "hash": -1782452074379508000, "line_mean": 34.4824561404, "line_max": 115, "alpha_frac": 0.6864630921, "autogenerated": false, "r...
""" Implements aggregated type-specific validation functionalities. """ from datetime import datetime from decimal import Decimal from datafinder.core.configuration.properties.validators import base_validators __version__ = "$Revision-Id:$" class StringValidator(base_validators.AndValidator):...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/configuration/properties/validators/type_validators.py", "copies": "1", "size": "6957", "license": "bsd-3-clause", "hash": 2909858175148151000, "line_mean": 42.8838709677, "line_max": 114, "alpha_frac": 0.6760097743, "autogenerated": f...
""" Implements factory methods for objects that can be used to access a WebDAV file system. """ __version__ = "$Revision-Id:$" import logging from webdav.Connection import WebdavError from datafinder.persistence.adapters.webdav_.configuration import Configuration from datafinder.persistence.ad...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/adapters/webdav_/factory.py", "copies": "1", "size": "10559", "license": "bsd-3-clause", "hash": -8050509645168745000, "line_mean": 43.5172413793, "line_max": 137, "alpha_frac": 0.692679231, "autogenerated": false, "ratio": 4....
""" Implements the model component of the create configuration dialog. """ __version__ = "$Revision-Id:$" from datafinder.common import logger from datafinder.core.error import ConfigurationError _logger = logger.getDefaultLogger() class CreateConfigurationModel(object): """ Implements...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/admin/create_configuration_dialog/model.py", "copies": "1", "size": "5321", "license": "bsd-3-clause", "hash": -8462154764590047000, "line_mean": 38.9307692308, "line_max": 119, "alpha_frac": 0.6211238489, "autogenerated": false, "rat...
""" This is the main controller component of the wizard """ from PyQt4 import QtGui, QtCore from datafinder.common.logger import getDefaultLogger from datafinder.gui.gen.user.creation_wizard_ui import Ui_Wizard from datafinder.gui.user.common.progress_dialog import ProgressDialog from datafinder.gui.u...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/dialogs/creation_wizard/main.py", "copies": "1", "size": "14287", "license": "bsd-3-clause", "hash": -6330458124206628000, "line_mean": 43.5, "line_max": 138, "alpha_frac": 0.6792188703, "autogenerated": false, "ratio": 4.6689542...
""" This module contains all custom widgets for the datafinder guis. """ import functools from PyQt4 import QtCore, QtGui from PyQt4.QtCore import Qt __version__ = "$Revision-Id$" class _Tab(object): """ Tab class to store tab informations. Only used in the L{datafinder.gui.use...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/common/widget/widget.py", "copies": "1", "size": "14327", "license": "bsd-3-clause", "hash": 6878227478979152000, "line_mean": 34.7358974359, "line_max": 114, "alpha_frac": 0.5870035597, "autogenerated": false, "ratio": 4.3560352...
""" This module defines a basic set of validation functions / classes for value verification. """ import decimal import re import sys __version__ = "$Revision-Id:$" class IsInRange(object): """ Checks whether a given value is in a specific range. The requirement is that min...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/configuration/properties/validators/base_validators.py", "copies": "1", "size": "13874", "license": "bsd-3-clause", "hash": -4670276932198831000, "line_mean": 31.4313253012, "line_max": 119, "alpha_frac": 0.5808706934, "autogenerated":...
""" This module provides common functionality used in different build targets. """ import os __version__ = "$Revision-Id:$" def setVersion(versionString): """ Sets the version name within the DataFinder ...""" relativeVersionFilePath = "src/datafinder/core/configuration/constants....
{ "repo_name": "DLR-SC/DataFinder", "path": "build_scripts/distutils/src/datafinder_distutils/utils.py", "copies": "1", "size": "3034", "license": "bsd-3-clause", "hash": 8828410342400932000, "line_mean": 36.4050632911, "line_max": 110, "alpha_frac": 0.7142386289, "autogenerated": false, "ratio": ...
""" This module provides constants for the L{datafinder.core.item} package. """ __version__ = "$Revision-Id:$" # ItemState -> Indicates whether and how the item is accessible ITEM_STATE_NULL = "ItemState:NULL" ITEM_STATE_INACCESSIBLE = "ItemState:INACCESSIBLE" ITEM_STATE_ACCESSIBLE = "ItemState:ACCE...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/item/data_persister/constants.py", "copies": "1", "size": "2317", "license": "bsd-3-clause", "hash": -6492248555707790000, "line_mean": 40.9074074074, "line_max": 84, "alpha_frac": 0.7544238239, "autogenerated": false, "ratio": 3.767...
""" This module provides the definition of a property representations. """ from datafinder.core.configuration.gen.datamodel import property as property_ from datafinder.core.configuration.properties import constants, property_type from datafinder.core.error import ConfigurationError, PropertyError _...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/configuration/properties/property_definition.py", "copies": "1", "size": "10958", "license": "bsd-3-clause", "hash": 1814740226480722000, "line_mean": 38.5851851852, "line_max": 116, "alpha_frac": 0.6442781529, "autogenerated": false, ...
""" Creates a sample Lucene index for the full-text search feature. """ import lucene import sys if __name__ == "__main__": lucene.initVM() indexDir = "D:/Downloads/index" dir_ = lucene.SimpleFSDirectory(lucene.File(indexDir)) analyzer = lucene.StandardAnalyzer(lucene.Version.LUCENE_C...
{ "repo_name": "DLR-SC/DataFinder", "path": "contrib/lucene/create_sample_index.py", "copies": "1", "size": "3377", "license": "bsd-3-clause", "hash": -5002695304426668000, "line_mean": 42.4342105263, "line_max": 98, "alpha_frac": 0.7157240154, "autogenerated": false, "ratio": 3.600213219616205, ...
""" Constant definitions for connection handling. """ from webdav.Constants import NS_DAV, PROP_RESOURCE_TYPE __version__ = "$Revision-Id:$" # Constants for connection pooling MAX_POOL_NUMBER = 10 MAX_CONNECTION_NUMBER = 4 # Defines special WebDAV properties LINK_TARGET_PROPERTY = ("http://...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/adapters/webdav_/constants.py", "copies": "1", "size": "2101", "license": "bsd-3-clause", "hash": -2543982314989028400, "line_mean": 36.2, "line_max": 72, "alpha_frac": 0.7429795336, "autogenerated": false, "ratio": 3.90520446...
""" Constant definitions. """ __version__ = "$Revision-Id:$" DEFAULT_SSH_PORT = 22 MAXIMUM_RECEIVED_BYTES = 1024 CONNECTION_TIMEOUT = 500.0 MAX_POOL_NUMBER = 10
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/adapters/tsm/constants.py", "copies": "1", "size": "1877", "license": "bsd-3-clause", "hash": 2357127403117883400, "line_mean": 36.306122449, "line_max": 72, "alpha_frac": 0.7416089505, "autogenerated": false, "ratio": 3.93501...
""" Constants definitions of the meta data support. """ from datafinder.core.configuration.properties import constants as const __version__ = "$Revision-Id:$" # Property categories USER_PROPERTY_CATEGORY = const.USER_PROPERTY_CATEGORY MANAGED_SYSTEM_PROPERTY_CATEGORY = const.MANAGED_SYSTEM_PRO...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/script_api/properties/constants.py", "copies": "1", "size": "3022", "license": "bsd-3-clause", "hash": 2044777892360740000, "line_mean": 40.5633802817, "line_max": 77, "alpha_frac": 0.7673726009, "autogenerated": false, "ratio": 3.6235011...
""" Contains wrapper class around the property representation used in the core package. """ __version__ = "$Revision-Id:$" class PropertyDescription(object): """ Wrapper around the internal property representation giving restricted access to the relevant parameters. All instance ...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/script_api/properties/property_description.py", "copies": "1", "size": "7285", "license": "bsd-3-clause", "hash": 6682999860754484000, "line_mean": 36.1413612565, "line_max": 118, "alpha_frac": 0.6322580645, "autogenerated": false, "ratio...
""" Defines data associated with a principal, i.e. user / role. """ from datafinder.persistence.principal_search import constants __version__ = "$Revision-Id:$" class Principal(object): """ Represents a principal. """ def __init__(self, identifier, **kwargs): """ Construc...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/principal_search/principal.py", "copies": "1", "size": "2719", "license": "bsd-3-clause", "hash": -1916695395209044000, "line_mean": 35.2465753425, "line_max": 72, "alpha_frac": 0.6730415594, "autogenerated": false, "ratio": 4...
""" Defines the set of lucene-specific configuration parameters. """ from datafinder.persistence.error import PersistenceError __version__ = "$Revision-Id:$" _LUCENE_SCHEME_PREFIX = "lucene+" _LUCENE_PLUS_FILE_SCHEME_PREFIX = _LUCENE_SCHEME_PREFIX + "file" class Configuration(object): ...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/adapters/lucene/configuration.py", "copies": "1", "size": "3107", "license": "bsd-3-clause", "hash": 1364757609580828000, "line_mean": 39.4266666667, "line_max": 116, "alpha_frac": 0.6968136466, "autogenerated": false, "ratio"...
""" Defines two classes to support domain objects. Domain objects allow you to model meta data in a more compact way. Domain objects should always be inherited from C{DomainObject}. Then the required properties should be defined on class level using C{DomainProperty}. Here an example: >>> class Author(...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/configuration/properties/domain.py", "copies": "1", "size": "6707", "license": "bsd-3-clause", "hash": 3704548010168181000, "line_mean": 35.469273743, "line_max": 84, "alpha_frac": 0.6250186372, "autogenerated": false, "ratio": 4.584...
""" Factory for creation of data persister. """ import logging from datafinder.core.configuration.datastores.constants import DEFAULT_STORE, OFFLINE_STORE, STORAGE_REALISATION_MODE_ENUM from datafinder.core.configuration.properties import constants as property_constants from datafinder.core.item.data_p...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/item/data_persister/factory.py", "copies": "1", "size": "8169", "license": "bsd-3-clause", "hash": -4236973658306092500, "line_mean": 46.3372781065, "line_max": 131, "alpha_frac": 0.6731546089, "autogenerated": false, "ratio": 4.5636...
""" Handler for create collection wizard. """ from datafinder.gui.user.dialogs.creation_wizard.constants import PROPERTY_PAGE_ID, SOURCE_PAGE_ID from datafinder.gui.user.dialogs.creation_wizard.state_handler.base_state_handler import BaseStateHandler from datafinder.gui.user.models.repository.filter.leaf_...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/dialogs/creation_wizard/state_handler/create_collection_state_handler.py", "copies": "1", "size": "4712", "license": "bsd-3-clause", "hash": 7402252968879238000, "line_mean": 42.0373831776, "line_max": 137, "alpha_frac": 0.6536502547...
""" Handler for export of item to the unmanaged repository. """ from PyQt4 import QtGui from datafinder.gui.user.dialogs.creation_wizard.constants import SOURCE_PAGE_ID, TARGET_PAGE_ID from datafinder.gui.user.dialogs.creation_wizard.state_handler.base_state_handler import BaseStateHandler from datafin...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/dialogs/creation_wizard/state_handler/export_state_handler.py", "copies": "1", "size": "5689", "license": "bsd-3-clause", "hash": 8104145582584221000, "line_mean": 45.0165289256, "line_max": 134, "alpha_frac": 0.651608367, "autogen...
""" Implements actions of the data repository. """ import sys from datafinder.core.configuration.properties.constants import UNMANAGED_SYSTEM_PROPERTY_CATEGORY, MANAGED_SYSTEM_PROPERTY_CATEGORY from datafinder.core.error import ItemError, PropertyError from datafinder.gui.user.common.util impor...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/models/repository/action_handler.py", "copies": "1", "size": "19922", "license": "bsd-3-clause", "hash": 6192404126138526000, "line_mean": 40.4776119403, "line_max": 131, "alpha_frac": 0.6250878426, "autogenerated": false, "ratio...
""" Implements adapter for accessing the file system. """ from datetime import datetime import mimetypes import os from datafinder.persistence.error import PersistenceError from datafinder.persistence.metadata import constants, value_mapping from datafinder.persistence.metadata.metadatastorer imp...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/adapters/filesystem/metadata/adapter.py", "copies": "1", "size": "4811", "license": "bsd-3-clause", "hash": 6896586868499910000, "line_mean": 41.7363636364, "line_max": 121, "alpha_frac": 0.6929952193, "autogenerated": false, ...
""" Implements adapter for manipulating a AmazonS3 file system. It needs a bucketname from an Amazon S3 bucket. In the bucket the data items are stored. A bucket is used similar to a directory. Only that collections cannot be created within. The keys with the identifier of the item are stored in the buc...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/adapters/amazonS3/data/adapter.py", "copies": "1", "size": "11697", "license": "bsd-3-clause", "hash": 1748728832780645000, "line_mean": 37.2583892617, "line_max": 116, "alpha_frac": 0.5992989655, "autogenerated": false, "rati...
""" Implements a registry for data formats. """ from copy import copy from mimetypes import guess_type from datafinder.core.configuration.dataformats.dataformat import DataFormat __version__ = "$Revision-Id:$" class DataFormatRegistry(object): """ Implements a registry for data formats. ...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/configuration/dataformats/registry.py", "copies": "1", "size": "10048", "license": "bsd-3-clause", "hash": 5928433387172368000, "line_mean": 42.2643171806, "line_max": 137, "alpha_frac": 0.6227109873, "autogenerated": false, "ratio":...
""" Implements test cases for the privileges mapping. """ import unittest from webdav.Constants import TAG_READ, TAG_READ_ACL, TAG_WRITE, TAG_WRITE_ACL, TAG_ALL, \ TAG_WRITE_CONTENT, TAG_WRITE_PROPERTIES, TAG_BIND, TAG_UNBIND, \ TAG_READ_CURRENT...
{ "repo_name": "DLR-SC/DataFinder", "path": "test/unittest/datafinder_test/persistence/adapters/webdav_/privileges/privileges_mapping_test.py", "copies": "1", "size": "7464", "license": "bsd-3-clause", "hash": 2939977557647336400, "line_mean": 44.9433962264, "line_max": 127, "alpha_frac": 0.640943194,...
""" Implements test cases for the WebDAV-specific file system factory. """ import unittest from datafinder.persistence.adapters.sftp import factory from datafinder.persistence.error import PersistenceError class ParseDiskFreeOutpoutParserTestCase(unittest.TestCase): def testExpectedDefau...
{ "repo_name": "DLR-SC/DataFinder", "path": "test/unittest/datafinder_test/persistence/adapters/sftp/factory_test.py", "copies": "1", "size": "3879", "license": "bsd-3-clause", "hash": -6245098647549124000, "line_mean": 42.5862068966, "line_max": 101, "alpha_frac": 0.6976024749, "autogenerated": fal...
""" Implements the data format representation. """ from datafinder.core.configuration.dataformats.constants import DEFAULT_DATAFORMAT_ICONNAME, STANDARD_FORMAT_TYPE __version__ = "$Revision-Id:$" class DataFormat(object): """ Represents a data type. """ def __init__(self, name, mi...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/configuration/dataformats/dataformat.py", "copies": "1", "size": "3587", "license": "bsd-3-clause", "hash": 3425982221879211000, "line_mean": 37.4175824176, "line_max": 140, "alpha_frac": 0.676888765, "autogenerated": false, "ratio":...
""" Implements the editor for search queries. """ from PyQt4 import QtCore, QtGui from PyQt4.QtCore import Qt from datafinder.gui.user.dialogs.search_dialog.utils import SearchQueryAnalyzer __version__ = "$Revision-Id:$" class SearchQueryEditor(QtGui.QTextEdit): """ Implement an...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/dialogs/search_dialog/search_query_editor.py", "copies": "1", "size": "14560", "license": "bsd-3-clause", "hash": -8482501809231218000, "line_mean": 38.1101928375, "line_max": 131, "alpha_frac": 0.6159340659, "autogenerated": false...
""" Implements the model for logging messages. """ import os import sys import time import logging from PyQt4 import QtCore, QtGui __version__ = "$Revision-Id:$" _DATETIME_FORMAT = "%d.%m.%y %X" class LoggerHandler(logging.Handler, QtCore.QObject): """ Implements a logging handler...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/models/logger.py", "copies": "1", "size": "11656", "license": "bsd-3-clause", "hash": 266018881873642800, "line_mean": 31.7855072464, "line_max": 108, "alpha_frac": 0.5972889499, "autogenerated": false, "ratio": 4.40347563279184,...
""" Implements the principal search WebDAV-specific """ import os from webdav.Condition import ContainsTerm from webdav.Connection import WebdavError from webdav.Constants import NS_DAV, PROP_DISPLAY_NAME from datafinder.persistence.error import PersistenceError from datafinder.persistence.princip...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/adapters/webdav_/principal_search/adapter.py", "copies": "1", "size": "6428", "license": "bsd-3-clause", "hash": 359522353945374600, "line_mean": 44.9197080292, "line_max": 127, "alpha_frac": 0.7005289359, "autogenerated": false...
""" Implements the specific property wizard page. """ from PyQt4 import QtCore from datafinder.core.configuration.properties.constants import DATATYPE_ID, DATASTORE_NAME_ID from datafinder.gui.user.dialogs.creation_wizard.constants import INCOMPLETE_PROPERTY_DEFINITION from datafinder.gui.user.dialogs....
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/dialogs/creation_wizard/pages/property_page.py", "copies": "1", "size": "6636", "license": "bsd-3-clause", "hash": -6686415911719897000, "line_mean": 44.4055944056, "line_max": 125, "alpha_frac": 0.6571729958, "autogenerated": fals...
""" Maps the interface-specific privilege definition to the WebDAV-specific one and vice versa. """ import os from webdav.Constants import TAG_ALL, TAG_READ, TAG_WRITE, \ TAG_WRITE_CONTENT, TAG_WRITE_PROPERTIES, \ TAG_BIND, TAG_UNBIND, \ ...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/adapters/webdav_/privileges/privileges_mapping.py", "copies": "1", "size": "11020", "license": "bsd-3-clause", "hash": 1649881398474181600, "line_mean": 45.7056277056, "line_max": 112, "alpha_frac": 0.6299455535, "autogenerated"...
""" Principal search specific constants. """ __version__ = "$Revision-Id:$" # principal search constants SEARCH_MODE_USER_ONLY = 0 SEARCH_MODE_GROUP_ONLY = 1 SEARCH_MODE_USER_AND_GROUP = 2 # special principals ALL_PRINCIPAL = "____allprincipal____" AUTHENTICATED_PRINCIPAL = "____authenticatedp...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/principal_search/constants.py", "copies": "1", "size": "2236", "license": "bsd-3-clause", "hash": 4418645345292622000, "line_mean": 35.8983050847, "line_max": 72, "alpha_frac": 0.7307692308, "autogenerated": false, "ratio": 3....
""" Provides access to certain states of the user GUI. """ from PyQt4.QtGui import QDialog from datafinder.gui.user.common.item_selection_dialog import ItemSelectionDialog from datafinder.gui.user.common.progress_dialog import ProgressDialog from datafinder.gui.user.models.repository.filter.leaf_filter...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/script_api.py", "copies": "1", "size": "9604", "license": "bsd-3-clause", "hash": 8954389017884758000, "line_mean": 36.7258064516, "line_max": 115, "alpha_frac": 0.7178259059, "autogenerated": false, "ratio": 4.628433734939759, ...
""" Provides file storer implementation allowing access to an item on a specific storage system. """ import os from tempfile import NamedTemporaryFile, mkstemp from datafinder.persistence.error import PersistenceError __version__ = "$Revision-Id:$" _BLOCK_SIZE = 30000 class FileS...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/filestorer.py", "copies": "1", "size": "15736", "license": "bsd-3-clause", "hash": -3820979819607770600, "line_mean": 34.4259259259, "line_max": 119, "alpha_frac": 0.5924631418, "autogenerated": false, "ratio": 4.8137044967880...
""" Provides some general functionalities commonly used by different pages. """ __version__ = "$Revision-Id:$" def determineTargetDataTypes(baseRepositoryModel, index): """ Determines the target data types for the given index. """ targetDataTypes = list() item = baseRepositoryMode...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/dialogs/creation_wizard/pages/utils.py", "copies": "1", "size": "3149", "license": "bsd-3-clause", "hash": -8367484879386014000, "line_mean": 38.3717948718, "line_max": 111, "alpha_frac": 0.7361067005, "autogenerated": false, "ra...
""" Represents an user / group / role. """ from datafinder.core.error import PrincipalError from datafinder.persistence.principal_search.principal import constants, Principal as PersistedPrincipal __version__ = "$Revision-Id:$" class _PrincipalType(object): """ This class defines avail...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/item/privileges/principal.py", "copies": "1", "size": "6528", "license": "bsd-3-clause", "hash": -9053203207434615000, "line_mean": 36.1754385965, "line_max": 112, "alpha_frac": 0.6564031863, "autogenerated": false, "ratio": 4.527045...
""" Implements the meta data search dialog including results view. """ import bisect from PyQt4 import QtCore, QtGui from datafinder.common.logger import getDefaultLogger from datafinder.core import search_restriction from datafinder.gui.gen.user.search_dialog_ui import Ui_searchDialog from datafi...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/dialogs/search_dialog/main.py", "copies": "1", "size": "24338", "license": "bsd-3-clause", "hash": 8203573779657564000, "line_mean": 40.0345423143, "line_max": 140, "alpha_frac": 0.6416303723, "autogenerated": false, "ratio": 4.6...
""" Tests for the property editor factory. """ import unittest, sys, datetime from PyQt4 import QtGui, QtCore from datafinder.core.configuration.properties import constants from datafinder.core.configuration.properties.property_type import PROPERTY_TYPE_NAMES from datafinder.gui.user.common.widget.p...
{ "repo_name": "DLR-SC/DataFinder", "path": "test/unittest/datafinder_test/gui/user/common/widget/property/editors/factory_test.py", "copies": "1", "size": "7807", "license": "bsd-3-clause", "hash": 4962720561371037000, "line_mean": 40.2, "line_max": 111, "alpha_frac": 0.648904829, "autogenerated": ...
""" Tests of the data type representation. """ import unittest from datafinder.core.configuration.datamodel import datatype from datafinder.core.configuration.properties.constants import DATAMODEL_PROPERTY_CATEGORY from datafinder_test.mocks import SimpleMock __version__ = "$Revision-Id:$" c...
{ "repo_name": "DLR-SC/DataFinder", "path": "test/unittest/datafinder_test/core/configuration/datamodel/datatype_test.py", "copies": "1", "size": "4772", "license": "bsd-3-clause", "hash": -696258209623771000, "line_mean": 43.0188679245, "line_max": 108, "alpha_frac": 0.6919530595, "autogenerated": ...
""" Tests utility functionality. """ __version__ = "$Revision-Id:$" import unittest from datafinder.persistence.adapters.webdav_ import util _PERSISTENCE_ID = "http://test.de:80/hhh/j/c:/lll/" _INTERFACE_ID = "/c:/lll" class ItemIdentifierMapperTestCase(unittest.TestCase): """ Tests...
{ "repo_name": "DLR-SC/DataFinder", "path": "test/unittest/datafinder_test/persistence/adapters/webdav_/util_test.py", "copies": "1", "size": "4877", "license": "bsd-3-clause", "hash": 7027054706762138000, "line_mean": 45.8137254902, "line_max": 108, "alpha_frac": 0.6996104162, "autogenerated": fals...
""" The module defines available privileges. """ from datafinder.core.error import PrivilegeError from datafinder.persistence.privileges import constants __version__ = "$Revision-Id:$" class _Privilege(object): """ This class defines available properties of a privilege. The class ...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/item/privileges/privilege.py", "copies": "1", "size": "7047", "license": "bsd-3-clause", "hash": 9160348121903685000, "line_mean": 39.9464285714, "line_max": 139, "alpha_frac": 0.67915425, "autogenerated": false, "ratio": 4.291717417...
""" The module provides a text editor. """ from PyQt4 import QtGui, QtCore from PyQt4.Qt import Qt from datafinder.gui.gen.user.text_editor_dialog_ui import Ui_textEditorDialog __version__ = "$Revision-Id:$" class TextEditor(QtGui.QLineEdit): """ This widget widget is a specialized ...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/common/widget/property/editors/text_editor.py", "copies": "1", "size": "4483", "license": "bsd-3-clause", "hash": -8313688464511776000, "line_mean": 33.5793650794, "line_max": 91, "alpha_frac": 0.6442114655, "autogenerated": false,...
""" This implementation of NullDataStorer can read out of and write into ZIP compressed archives. """ __version__ = "$Revision-Id$" import codecs import types from zipfile import ZipInfo from datafinder.persistence.data.datastorer import NullDataStorer from datafinder.persistence.error import ...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/adapters/archive/data/adapter.py", "copies": "1", "size": "5325", "license": "bsd-3-clause", "hash": -6672894765059395000, "line_mean": 38.3409090909, "line_max": 140, "alpha_frac": 0.6584037559, "autogenerated": false, "ratio...
""" This module contains the HistoryModel. """ from PyQt4 import QtCore __version__ = "$Revision-Id:$" class HistoryModel(QtCore.QAbstractItemModel): """ The History model implements a mechanism to store and restore L{QModelIndex<PyQt4.QtCore.QModelIndex>} objects. That is necessar...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/models/repository/history.py", "copies": "1", "size": "8394", "license": "bsd-3-clause", "hash": -1245409710228574200, "line_mean": 33.5677966102, "line_max": 115, "alpha_frac": 0.60447939, "autogenerated": false, "ratio": 4.4506...
""" This module provides a simple clip-board for internal copy-cut-paste actions. """ from datafinder.gui.user.models import constants __version__ = "$Revision-Id:$" class ItemClipboard(object): """ Implements the clip-board. """ def __init__(self, repositoryModel): """ ...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/models/repository/clipboard.py", "copies": "1", "size": "5974", "license": "bsd-3-clause", "hash": -9116586161005526000, "line_mean": 35.8101265823, "line_max": 103, "alpha_frac": 0.6288918647, "autogenerated": false, "ratio": 4....
"""" Module provides access to a configured logger instance. """ import logging import os from datafinder.core.configuration import constants __version__ = "$Revision-Id:$" _fileLogFormat = "%(asctime)s: %(levelname)s: %(message)s" _logFileName = "debug.log" _webdavLogFileName = "webdav.log...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/common/logger.py", "copies": "1", "size": "2957", "license": "bsd-3-clause", "hash": 4114739541944627700, "line_mean": 33.6265060241, "line_max": 91, "alpha_frac": 0.7159283057, "autogenerated": false, "ratio": 4.045143638850889, "confi...
""" Base class for the adaptor specific file system factory implementations. """ import decimal from datafinder.persistence.common import character_constants as char_const from datafinder.persistence.data.datastorer import NullDataStorer from datafinder.persistence.metadata.metadatastorer import NullMe...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/common/base_factory.py", "copies": "1", "size": "8251", "license": "bsd-3-clause", "hash": -6972693561341776000, "line_mean": 35.5045454545, "line_max": 120, "alpha_frac": 0.6440431463, "autogenerated": false, "ratio": 4.78596...
""" This module implements how the meta data is persisted on the SVN server. """ import datetime import logging import mimetypes from datafinder.persistence.adapters.svn.constants import JSON_PROPERTY_NAME from datafinder.persistence.adapters.svn.error import SubversionError from datafinder.persisten...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/adapters/svn/metadata/adapter.py", "copies": "1", "size": "7959", "license": "bsd-3-clause", "hash": -4928843757952398000, "line_mean": 43.2215909091, "line_max": 109, "alpha_frac": 0.6662897349, "autogenerated": false, "ratio...
""" This module implements how the meta data is persisted on the WebDAV server. """ from webdav.Connection import WebdavError from webdav import Constants from webdav.NameCheck import WrongNameError from datafinder.persistence.adapters.webdav_.metadata import identifier_mapping from datafinder.persis...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/adapters/webdav_/metadata/adapter.py", "copies": "1", "size": "9993", "license": "bsd-3-clause", "hash": 4243594167960795600, "line_mean": 48.4696969697, "line_max": 124, "alpha_frac": 0.6644651256, "autogenerated": false, "ra...
""" Provides a dialog to handle credential/authentication information updates for data store. Via callbacks the authentication information of the centrally managed file systems can be directly updated. Currently, we just support simple username/password authentication. """ from PyQt4 import QtGui from ...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/dialogs/datastore_dialog/credential_update_dialog.py", "copies": "1", "size": "5593", "license": "bsd-3-clause", "hash": 7255814150311223000, "line_mean": 38.5289855072, "line_max": 135, "alpha_frac": 0.6799570892, "autogenerated":...
""" This module implements some sanity checks based on the visitor/tree walker classes defined in this package. """ import logging from datafinder.core.item.base import ItemBase from datafinder.core.item.collection import ItemRoot, ItemCollection from datafinder.core.item.data_persister import constant...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/item/visitor/checks.py", "copies": "1", "size": "20884", "license": "bsd-3-clause", "hash": 5893060359118241000, "line_mean": 40.1898989899, "line_max": 116, "alpha_frac": 0.6354625551, "autogenerated": false, "ratio": 4.451929226177...
""" Module implementing a wizard handler for archive creation. """ from datetime import datetime, timedelta from datafinder.core.configuration.properties.constants import DATASTORE_NAME_ID, \ ARCHIVE_RETENTION_EXCEEDED_DATETIME_ID from datafinder.gui.u...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/gui/user/dialogs/creation_wizard/state_handler/create_archive_state_handler.py", "copies": "1", "size": "6854", "license": "bsd-3-clause", "hash": 887152385997534000, "line_mean": 47.7, "line_max": 140, "alpha_frac": 0.6692442369, "autogene...
""" Test case for the item support module. """ import unittest from datafinder.core.error import ItemError from datafinder.script_api.error import ItemSupportError from datafinder.script_api.item import item_support from datafinder_test.mocks import SimpleMock __version__ = "$Revision-Id:$" class ItemSupport...
{ "repo_name": "DLR-SC/DataFinder", "path": "test/unittest/datafinder_test/script_api/item/item_support_test.py", "copies": "1", "size": "5915", "license": "bsd-3-clause", "hash": 8734669603307466000, "line_mean": 34.8475609756, "line_max": 96, "alpha_frac": 0.646830093, "autogenerated": false, "r...
""" Implements the data adapter to access files/directories via SFTP. """ __version__ = "$Revision-Id:$" import errno import stat import StringIO import sys import tempfile from paramiko.ssh_exception import SSHException from datafinder.persistence.error import PersistenceError from datafinde...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/persistence/adapters/sftp/data/adapter.py", "copies": "1", "size": "15344", "license": "bsd-3-clause", "hash": -5391806408292138000, "line_mean": 41.4674220963, "line_max": 117, "alpha_frac": 0.6377085506, "autogenerated": false, "ratio":...
""" This module provides a tree walker that copies all items from one repository to another. """ from datafinder.common import logger from datafinder.core.configuration.properties.constants import CONTENT_CREATION_DATETIME_PROPERTY_ID, \ CREATION...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/item/visitor/importer.py", "copies": "1", "size": "12969", "license": "bsd-3-clause", "hash": 6514658418624894000, "line_mean": 46.7556390977, "line_max": 127, "alpha_frac": 0.6469272881, "autogenerated": false, "ratio": 4.7697682971...
""" Contains constants to be used by DataFinder classes. """ import os __version__ = "$Revision-Id:$" DATAMODEL_FILENAME = "datamodel.xml" DATASTORE_FILENAME = "datastores.xml" ICON_DIRECTORYNAME = "icons" SCRIPT_DIRECTORYNAME = "scripts" # Path to the working directory WORKING_PATH = os.pa...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/configuration/constants.py", "copies": "1", "size": "2410", "license": "bsd-3-clause", "hash": 6810543078689737000, "line_mean": 33.9701492537, "line_max": 114, "alpha_frac": 0.7369294606, "autogenerated": false, "ratio": 3.795275590...
""" This module implements the visitor pattern in a reusable way by providing an abstract base class upon which concrete implementations can be build. """ from datafinder.core.item.base import ItemBase from datafinder.core.item.collection import ItemRoot, ItemCollection from datafinder.core.item.leaf impo...
{ "repo_name": "DLR-SC/DataFinder", "path": "src/datafinder/core/item/visitor/base.py", "copies": "1", "size": "8128", "license": "bsd-3-clause", "hash": -4316065648001340400, "line_mean": 40.7789473684, "line_max": 127, "alpha_frac": 0.6274606299, "autogenerated": false, "ratio": 4.38640043173232...
""" Operating system independent start script (Win32 and UN*X) for the DataFinder application. """ import os import locale import sys from datafinder.gui.admin import admin_application __version__ = "$Revision-Id:$" # set the encoding encoding = "UTF-8" if not locale.getdefaultlocale()[1] ...
{ "repo_name": "DLR-SC/DataFinder", "path": "bin/datafinder-admin-client.py", "copies": "1", "size": "2371", "license": "bsd-3-clause", "hash": 709299695272273500, "line_mean": 33.9242424242, "line_max": 72, "alpha_frac": 0.7326022775, "autogenerated": false, "ratio": 3.9516666666666667, "config...
""" Operating system independent start script (Win32 and UN*X) for the DataFinder application. """ import os import locale import sys from datafinder.gui.user import application __version__ = "$Revision-Id:$" dfStart = os.environ.get("DF_START") profile = os.environ.get("DF_PROFILE") debug...
{ "repo_name": "DLR-SC/DataFinder", "path": "bin/datafinder-client.py", "copies": "1", "size": "2591", "license": "bsd-3-clause", "hash": -7805308713296167000, "line_mean": 32.5466666667, "line_max": 72, "alpha_frac": 0.7217290621, "autogenerated": false, "ratio": 3.8614008941877795, "config_tes...
# $__FILE__ import collectd import re DEBUG = False def values_to_dict(values): """ Convert `collectd.Values` instance to dictionary. :param values: Instance of `collectd.Values`. :returns: Dictionary representing `collectd.Values`. """ assert isinstance(values, collectd.Values) val...
{ "repo_name": "mjuenema/collectd-plugins", "path": "include/collectdlib.py", "copies": "1", "size": "5359", "license": "mit", "hash": 5666157672841035000, "line_mean": 28.938547486, "line_max": 105, "alpha_frac": 0.5607389438, "autogenerated": false, "ratio": 4.135030864197531, "config_test": f...
# $__FILE__ import Queue as queue import threading import collectd class BaseWriter(threading.Thread): """ Base class for all writers. :param formatter: Formatter instance. """ MAX_BUFFER_SIZE = 1000 """The maximum size of values in the output buffer.""" def __init__(self, formatter...
{ "repo_name": "mjuenema/collectd-plugins", "path": "include/_basewriter.py", "copies": "1", "size": "1563", "license": "mit", "hash": -7344210796577761000, "line_mean": 21.9852941176, "line_max": 86, "alpha_frac": 0.5649392194, "autogenerated": false, "ratio": 4.235772357723577, "config_test": ...
"""$ fio bounds""" import json import logging import click from cligj import precision_opt, use_rs_opt import fiona from fiona.fio.helpers import obj_gen @click.command(short_help="Print the extent of GeoJSON objects") @precision_opt @click.option('--explode/--no-explode', default=False, help="Explo...
{ "repo_name": "perrygeo/Fiona", "path": "fiona/fio/bounds.py", "copies": "2", "size": "3279", "license": "bsd-3-clause", "hash": 8879716352329089000, "line_mean": 36.2613636364, "line_max": 71, "alpha_frac": 0.4977127173, "autogenerated": false, "ratio": 4.008557457212714, "config_test": false,...
"""$ fio cat""" import json import logging import warnings import click import cligj import fiona from fiona.transform import transform_geom from fiona.fio import options warnings.simplefilter('default') # Cat command @click.command(short_help="Concatenate and print the features of datasets") @cligj.files_in_ar...
{ "repo_name": "perrygeo/Fiona", "path": "fiona/fio/cat.py", "copies": "1", "size": "2273", "license": "bsd-3-clause", "hash": 6099740639182791000, "line_mean": 31.9420289855, "line_max": 75, "alpha_frac": 0.543774747, "autogenerated": false, "ratio": 4.102888086642599, "config_test": false, "...
"""$ fio collect""" from functools import partial import json import logging import click import cligj from fiona.fio import helpers from fiona.fio import options from fiona.transform import transform_geom @click.command(short_help="Collect a sequence of features.") @cligj.precision_opt @cligj.indent_opt @cligj.c...
{ "repo_name": "perrygeo/Fiona", "path": "fiona/fio/collect.py", "copies": "2", "size": "7908", "license": "bsd-3-clause", "hash": 1833212056278169600, "line_mean": 35.7813953488, "line_max": 78, "alpha_frac": 0.4782498735, "autogenerated": false, "ratio": 4.715563506261181, "config_test": false...
"""$ fio distrib""" import json import logging import click import cligj from fiona.fio import helpers @click.command() @cligj.use_rs_opt @click.pass_context def distrib(ctx, use_rs): """Distribute features from a collection. Print the features of GeoJSON objects read from stdin. """ verbosity ...
{ "repo_name": "perrygeo/Fiona", "path": "fiona/fio/distrib.py", "copies": "2", "size": "1131", "license": "bsd-3-clause", "hash": -452608748002256260, "line_mean": 26.5853658537, "line_max": 62, "alpha_frac": 0.5720601238, "autogenerated": false, "ratio": 3.77, "config_test": false, "has_no_k...
"""$ fio dump""" from functools import partial import json import logging import click import cligj import fiona from fiona.fio import helpers from fiona.transform import transform_geom @click.command(short_help="Dump a dataset to GeoJSON.") @click.argument('input', type=click.Path(), required=True) @click.option...
{ "repo_name": "perrygeo/Fiona", "path": "fiona/fio/dump.py", "copies": "1", "size": "7255", "license": "bsd-3-clause", "hash": 8577487071796888000, "line_mean": 40.2215909091, "line_max": 79, "alpha_frac": 0.4372157133, "autogenerated": false, "ratio": 5.23071377072819, "config_test": false, ...
"""$ fio filter""" import json import logging import click from cligj import use_rs_opt from fiona.fio.helpers import obj_gen, eval_feature_expression @click.command() @click.argument('filter_expression') @use_rs_opt @click.pass_context def filter(ctx, filter_expression, use_rs): """ Filter GeoJSON featur...
{ "repo_name": "perrygeo/Fiona", "path": "fiona/fio/filter.py", "copies": "1", "size": "1617", "license": "bsd-3-clause", "hash": -8593765650833143000, "line_mean": 28.4, "line_max": 78, "alpha_frac": 0.6345083488, "autogenerated": false, "ratio": 4.093670886075949, "config_test": false, "has_...
"""$ fio info""" import logging import json import click from cligj import indent_opt import fiona import fiona.crs from fiona.fio import options @click.command() # One or more files. @click.argument('input', type=click.Path(exists=True)) @click.option('--layer', metavar="INDEX|NAME", callback=options.cb_layer, ...
{ "repo_name": "perrygeo/Fiona", "path": "fiona/fio/info.py", "copies": "1", "size": "2740", "license": "bsd-3-clause", "hash": -8525050485044526000, "line_mean": 36.5342465753, "line_max": 79, "alpha_frac": 0.5693430657, "autogenerated": false, "ratio": 4.0773809523809526, "config_test": false,...
"""$ fio insp""" import code import logging import sys import click import fiona @click.command(short_help="Open a dataset and start an interpreter.") @click.argument('src_path', type=click.Path(exists=True)) @click.option('--ipython', 'interpreter', flag_value='ipython', help="Use IPython as interp...
{ "repo_name": "perrygeo/Fiona", "path": "fiona/fio/insp.py", "copies": "1", "size": "1482", "license": "bsd-3-clause", "hash": -7100327972204072000, "line_mean": 31.2173913043, "line_max": 76, "alpha_frac": 0.5715249663, "autogenerated": false, "ratio": 4.234285714285714, "config_test": false, ...
"""$ fio load""" from functools import partial import itertools import json import logging import click import fiona from fiona.fio import options from fiona.transform import transform_geom FIELD_TYPES_MAP_REV = dict([(v, k) for k, v in fiona.FIELD_TYPES_MAP.items()]) @click.command(short_help="Load GeoJSON to ...
{ "repo_name": "perrygeo/Fiona", "path": "fiona/fio/load.py", "copies": "1", "size": "3824", "license": "bsd-3-clause", "hash": -3181918525697732600, "line_mean": 34.738317757, "line_max": 78, "alpha_frac": 0.5635460251, "autogenerated": false, "ratio": 4.239467849223947, "config_test": false, ...
"""fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols. """ __author__ = 'Dug Song <dugsong@monkey.org>' __copyright__ = 'Copyright (c) 2004 Dug Song' __license__ = 'BSD' __url__ = 'http://monkey.org/~dugsong/dpkt/' __version__ = '1.2' try: from itertools import izip as _it_iz...
{ "repo_name": "eriknstr/ThinkPad-FreeBSD-setup", "path": "FreeBSD/tests/sys/opencrypto/dpkt.py", "copies": "2", "size": "5223", "license": "isc", "hash": -3959888973692892000, "line_mean": 31.64375, "line_max": 278, "alpha_frac": 0.4826727934, "autogenerated": false, "ratio": 3.550645819170632, ...
# $FreeBSD$ #!/usr/bin/env python from __future__ import print_function """ This script parses each "meta" file and extracts the information needed to deduce build and src dependencies. It works much the same as the original shell script, but is *much* more efficient. The parsing work is handled by the class MetaFi...
{ "repo_name": "TigerBSD/TigerBSD", "path": "FreeBSD/share/mk/meta2deps.py", "copies": "2", "size": "22678", "license": "isc", "hash": -1391275719489034000, "line_mean": 30.7619047619, "line_max": 97, "alpha_frac": 0.5050709939, "autogenerated": false, "ratio": 3.7935764469722315, "config_test":...
# $Header$ # $Name$ from __future__ import print_function import sys import numpy as np import matplotlib.pyplot as plt import matplotlib.tri as tri def contourf(*arguments, **kwargs): """Call signatures:: contourf(X, Y, C, N, **kwargs) contourf(X, Y, C, V, **kwargs) Create a contourf plot of a 2...
{ "repo_name": "altMITgcm/MITgcm66h", "path": "utils/python/MITgcmutils/MITgcmutils/llc.py", "copies": "1", "size": "17054", "license": "mit", "hash": -209563794158961020, "line_mean": 31.2381852552, "line_max": 80, "alpha_frac": 0.4966576756, "autogenerated": false, "ratio": 3.0491686036116574, ...
# $Header$ # $Name$ # # created by mlosch on 2002-08-09 # converted to python by jahn on 2010-04-29 import sys import numpy as np __doc__ = """ Density of Sea Water using Jackett and McDougall 1995 (JAOT 12) polynomial Functions: dens :: computes in-situ density from salinity, potential temperature and pres...
{ "repo_name": "altMITgcm/MITgcm66h", "path": "utils/python/MITgcmutils/MITgcmutils/jmd95.py", "copies": "1", "size": "6013", "license": "mit", "hash": -4769491135905674000, "line_mean": 25.6061946903, "line_max": 76, "alpha_frac": 0.4452020622, "autogenerated": false, "ratio": 2.9856007944389273,...
#$ header class MPI_(public) #$ header method __init__(MPI_) from pyccel.stdlib.internal.mpi import mpi_comm_world from pyccel.stdlib.internal.mpi import mpi_comm_rank from pyccel.stdlib.internal.mpi import mpi_comm_size from pyccel.stdlib.internal.mpi import mpi_send from pyccel.stdlib.internal.mpi import mpi_ssen...
{ "repo_name": "ratnania/pyccel", "path": "tests/macro/scripts/MPI/mpi4py.py", "copies": "1", "size": "7894", "license": "mit", "hash": -4386461861454674400, "line_mean": 44.8953488372, "line_max": 263, "alpha_frac": 0.6931846972, "autogenerated": false, "ratio": 2.8990084465662873, "config_test...
#$ header func(double) reuslts(double) def func(t): y=pow(t,2) return y xStart = array((1,2,5),float) side = 0.1 tol = 1.0e-6 n = len(xStart) n = n+1 k = n-1 # Number of variables x = zeros(n, double) f = zeros(n, double) # Generate starting simplex x[0] = xStart for i in range(1,n): x[i] = xS...
{ "repo_name": "ratnania/pyccel", "path": "src_old/tests/scripts/core/ex18.py", "copies": "1", "size": "1667", "license": "mit", "hash": 1804656444876378600, "line_mean": 21.8356164384, "line_max": 55, "alpha_frac": 0.4577084583, "autogenerated": false, "ratio": 2.8940972222222223, "config_test"...
#$ header metavar module_name='mpi4py' #$ header metavar module_version='3.1' #$ header metavar ignore_at_import=True #$ header metavar import_all=True from pyccel.stdlib.internal.mpi import mpi_comm_world from pyccel.stdlib.internal.mpi import mpi_comm_rank from pyccel.stdlib.internal.mpi import mpi_comm_size from p...
{ "repo_name": "ratnania/pyccel", "path": "pyccel/stdlib/external/mpi4py.py", "copies": "1", "size": "8533", "license": "mit", "hash": 8640236211763993000, "line_mean": 46.4055555556, "line_max": 261, "alpha_frac": 0.6817063167, "autogenerated": false, "ratio": 2.9444444444444446, "config_test":...
#$ header metavar print=True from pyccel.stdlib.internal.dfftpack import dffti from pyccel.stdlib.internal.dfftpack import dfftf from pyccel.stdlib.internal.dfftpack import dfftb from pyccel.stdlib.internal.dfftpack import dzffti from pyccel.stdlib.internal.dfftpack import dzfftf from pyccel.stdlib.internal.dfftpack ...
{ "repo_name": "ratnania/pyccel", "path": "pyccel/stdlib/external/dfftpack.py", "copies": "1", "size": "1937", "license": "mit", "hash": -7794478542784123000, "line_mean": 27.0724637681, "line_max": 62, "alpha_frac": 0.6969540527, "autogenerated": false, "ratio": 2.712885154061625, "config_test"...
# ${header} # This is a simple class to represent the ${obj_key} object in the game. You can extend it by adding utility functions here in this file. <%include file="functions.noCreer" /><% parent_classes = obj['parentClasses'] %> % if len(parent_classes) > 0: % for parent_class in parent_classes: from games.${undersco...
{ "repo_name": "brhoades/megaminer16-anarchy", "path": "_creer/games/${underscore(game_name)}/${underscore(obj_key)}.py", "copies": "1", "size": "3103", "license": "mit", "hash": -5064488761453006000, "line_mean": 34.6666666667, "line_max": 204, "alpha_frac": 0.6187560425, "autogenerated": false, ...
# ${header} # This is where you build your AI for the ${game_name} game. <%include file="functions.noCreer" /> from joueur.base_ai import BaseAI ${merge("# ", "imports", "# you can add addtional import(s) here")} class AI(BaseAI): """ the basic AI functions that are the same between games """ def get_na...
{ "repo_name": "brhoades/megaminer16-anarchy", "path": "_creer/games/${underscore(game_name)}/ai.py", "copies": "1", "size": "2515", "license": "mit", "hash": 5370203120698734000, "line_mean": 33.9305555556, "line_max": 160, "alpha_frac": 0.5868787276, "autogenerated": false, "ratio": 3.8455657492...
#!$HOME/anaconda/bin/python # -*- coding: utf-8 -*- ''' Ripped from template.py - makes an apollonian gasket ''' import inkex # Required import simplestyle # will be needed here for styles support import ag __version__ = '0.0' inkex.localize() ### Your helper functions go here def cplxs2pts(zs): tt = ...
{ "repo_name": "macbuse/Apollonian", "path": "apollon_inx.py", "copies": "1", "size": "5516", "license": "mit", "hash": -8685216098883638000, "line_mean": 35.0522875817, "line_max": 107, "alpha_frac": 0.470630892, "autogenerated": false, "ratio": 4.2726568551510455, "config_test": false, "has_...
import logging import debug log = logging.getLogger('rfc1157') from rfc1155 import * asnTagNumbers['Get'] = 0x00 asnTagNumbers['GetNext'] = 0x01 asnTagNumbers['Response'] = 0x02 asnTagNumbers['Set'] = 0x03 asnTagNumbers['Trap'] = 0x04 class ErrorStatus(Integer): """ Error Status """ # define a dictionar...
{ "repo_name": "jpwarren/libsnmp", "path": "lib/libsnmp/rfc1157.py", "copies": "1", "size": "7845", "license": "mit", "hash": 1553658741419499800, "line_mean": 29.4069767442, "line_max": 134, "alpha_frac": 0.5928616953, "autogenerated": false, "ratio": 3.811953352769679, "config_test": false, ...
import socket import logging import time from libsnmp import debug from libsnmp import rfc1155 from libsnmp import rfc1157 log = logging.getLogger('v1.SNMP') class manager: def __init__(self, dest, interface=('0.0.0.0', 0), socksize=0x10000): self.dest = dest self.interface = inter...
{ "repo_name": "jpwarren/libsnmp", "path": "lib/libsnmp/role.py", "copies": "1", "size": "1495", "license": "mit", "hash": -8170934413562186000, "line_mean": 21.6515151515, "line_max": 82, "alpha_frac": 0.5658862876, "autogenerated": false, "ratio": 3.976063829787234, "config_test": false, "ha...
import sys import asyncore import types from libsnmp import rfc1155 from libsnmp import rfc1157 from libsnmp import role class manager(asyncore.dispatcher): def __init__(self, (cb_fun, cb_ctx), dst=(None, 0), interface=('0.0.0.0', 0), timeout=0.25): if not callable(cb_fun): rais...
{ "repo_name": "jpwarren/libsnmp", "path": "lib/libsnmp/asynrole.py", "copies": "1", "size": "1749", "license": "mit", "hash": -2403174374758568400, "line_mean": 25.5, "line_max": 96, "alpha_frac": 0.5803316181, "autogenerated": false, "ratio": 3.7292110874200426, "config_test": false, "has_no...
## An snmpmanager understands SNMPv1 and SNMPv2c messages ## and so it can encode and decode both. import socket import select import logging import Queue import time import os import asyncore from libsnmp import debug from libsnmp import asynrole from libsnmp import rfc1157 from libsnmp import rfc1905 from libsnm...
{ "repo_name": "jpwarren/libsnmp", "path": "lib/libsnmp/snmpmanager.py", "copies": "1", "size": "12829", "license": "mit", "hash": 4240019484947737600, "line_mean": 33.1196808511, "line_max": 124, "alpha_frac": 0.5984098527, "autogenerated": false, "ratio": 4.022891188460332, "config_test": fals...
import socket import select import logging import Queue import time import os import asyncore from libsnmp import debug from libsnmp import asynrole from libsnmp.rfc1157 import * log = logging.getLogger('v1.SNMP') log.setLevel(logging.INFO) class SNMP(asynrole.manager): nextRequestID = 0L # global counte...
{ "repo_name": "jpwarren/libsnmp", "path": "lib/libsnmp/v1.py", "copies": "1", "size": "9076", "license": "mit", "hash": -7805561379218646000, "line_mean": 34.3151750973, "line_max": 113, "alpha_frac": 0.599052446, "autogenerated": false, "ratio": 4.186346863468635, "config_test": false, "has_...
import logging import debug import rfc1157 from rfc1902 import * log = logging.getLogger('rfc1905') asnTagNumbers['GetBulk'] = 0x05 asnTagNumbers['Inform'] = 0x06 asnTagNumbers['TrapV2'] = 0x07 asnTagNumbers['Report'] = 0x08 max_bindings = 2147483647L class VarBind(rfc1157.VarBind): """ VarBind redefined here...
{ "repo_name": "jpwarren/libsnmp", "path": "lib/libsnmp/rfc1905.py", "copies": "1", "size": "6667", "license": "mit", "hash": 1303991376097038300, "line_mean": 28.7633928571, "line_max": 102, "alpha_frac": 0.6341682916, "autogenerated": false, "ratio": 3.418974358974359, "config_test": false, ...
#import socket #import select import logging #import Queue #import time #import os #import asyncore import traceback from libsnmp import debug from libsnmp import rfc1155 from libsnmp import rfc1157 from libsnmp import rfc1902 from libsnmp import rfc1905 #from libsnmp import asynrole from libsnmp import v1 log = lo...
{ "repo_name": "jpwarren/libsnmp", "path": "lib/libsnmp/v2.py", "copies": "1", "size": "7369", "license": "mit", "hash": -2463921900430932500, "line_mean": 36.5969387755, "line_max": 112, "alpha_frac": 0.6250508889, "autogenerated": false, "ratio": 3.9983722192078135, "config_test": false, "ha...
import util import debug import logging import types from rfc1155 import * log = logging.getLogger('rfc1902') ## change logging level.. options of: ## ## logging.CRITICAL ## logging.ERROR ## logging.WARN ## logging.INFO ## logging.DEBUG log.setLevel(logging.INFO) # Add a new TagNumber for encoding purposes asnTag...
{ "repo_name": "jpwarren/libsnmp", "path": "lib/libsnmp/rfc1902.py", "copies": "1", "size": "1489", "license": "mit", "hash": -7154582475362335000, "line_mean": 19.6805555556, "line_max": 76, "alpha_frac": 0.678307589, "autogenerated": false, "ratio": 3.3917995444191344, "config_test": false, ...
# I've included here all the basic SNMPv1 types, since they are used # by SNMPv2 and v3. import util import debug import logging import types import copy log = logging.getLogger('Asn1Object') ## change logging level.. options of: ## ## logging.CRITICAL ## logging.ERROR ## logging.WARN ## logging.INFO ## logging.DEB...
{ "repo_name": "jpwarren/libsnmp", "path": "lib/libsnmp/rfc1155.py", "copies": "1", "size": "29455", "license": "mit", "hash": 4102769776658135000, "line_mean": 25.875, "line_max": 128, "alpha_frac": 0.5102359531, "autogenerated": false, "ratio": 4.39889486260454, "config_test": false, "has_no...
# $Id$ # $URL$ """A few things that didn't seem to fit anywhere else.""" import os, os.path import pwd import tempfile import fcntl import errno import threading import subprocess import logger PID_FILE = '/var/run/nodemanager.pid' #################### def get_default_if(): interface = get_if_from_hwaddr(get_h...
{ "repo_name": "planetlab/NodeManager", "path": "tools.py", "copies": "1", "size": "6769", "license": "bsd-3-clause", "hash": -5963957590108943000, "line_mean": 33.7128205128, "line_max": 324, "alpha_frac": 0.6218052888, "autogenerated": false, "ratio": 3.4430315361139368, "config_test": false, ...
# $Id$ # $URL$ """An extremely simple interface to the signing/verifying capabilities of gnupg. You must already have the key in the keyring. """ from subprocess import PIPE, Popen from xmlrpclib import dumps, loads GPG = '/usr/bin/gpg' def _popen_gpg(*args): """Return a Popen object to GPG.""" return Pope...
{ "repo_name": "planetlab/NodeManager", "path": "ticket.py", "copies": "1", "size": "1269", "license": "bsd-3-clause", "hash": 7052532039179568000, "line_mean": 27.8409090909, "line_max": 106, "alpha_frac": 0.6201733649, "autogenerated": false, "ratio": 3.3307086614173227, "config_test": false, ...
# $Id$ # $URL$ """configuration files""" import grp import os import pwd try: from hashlib import sha1 as sha except ImportError: from sha import sha import string import curlwrapper import logger import tools import xmlrpclib from config import Config # right after net priority = 2 class conf_files: d...
{ "repo_name": "planetlab/NodeManager", "path": "conf_files.py", "copies": "1", "size": "4265", "license": "bsd-3-clause", "hash": 4790541881196973000, "line_mean": 33.674796748, "line_max": 140, "alpha_frac": 0.5939038687, "autogenerated": false, "ratio": 3.602195945945946, "config_test": true,...
# $Id$ # $URL$ """network configuration""" # system provided modules import os, string, time, socket # PlanetLab system modules import sioc, plnet # local modules import bwlimit, logger, iptables, tools # we can't do anything without a network priority=1 dev_default = tools.get_default_if() def start(): log...
{ "repo_name": "planetlab/NodeManager", "path": "net.py", "copies": "1", "size": "5908", "license": "bsd-3-clause", "hash": 7833433080532858000, "line_mean": 32.9540229885, "line_max": 132, "alpha_frac": 0.55788761, "autogenerated": false, "ratio": 3.9099933818663137, "config_test": false, "ha...
# $Id$ # $URL$ """ vsys sub-configurator. Maintains configuration parameters associated with vsys scripts. All slice attributes with the prefix vsys_ are written into configuration files on the node for the reference of vsys scripts. """ import logger import os VSYS_PRIV_DIR = "/etc/planetlab/vsys-attributes" def ...
{ "repo_name": "planetlab/NodeManager", "path": "plugins/vsys_privs.py", "copies": "1", "size": "4123", "license": "bsd-3-clause", "hash": 5562344780138080000, "line_mean": 30, "line_max": 88, "alpha_frac": 0.5241329129, "autogenerated": false, "ratio": 3.6358024691358026, "config_test": false, ...
# $Id$ # $URL$ """vsys configurator. Maintains ACLs and script pipes inside vservers based on slice attributes.""" import logger import os VSYSCONF="/etc/vsys.conf" VSYSBKEND="/vsys" def start(): logger.log("vsys: plugin starting up...") def GetSlivers(data, config=None, plc=None): """For each sliver with...
{ "repo_name": "planetlab/NodeManager", "path": "plugins/vsys.py", "copies": "1", "size": "5283", "license": "bsd-3-clause", "hash": 5882340575905811000, "line_mean": 33.9867549669, "line_max": 128, "alpha_frac": 0.5884913875, "autogenerated": false, "ratio": 3.736209335219236, "config_test": fa...
""" Additional support for Pygments formatter. """ import pygments import pygments.formatter class OdtPygmentsFormatter(pygments.formatter.Formatter): def __init__(self, rststyle_function, escape_function): pygments.formatter.Formatter.__init__(self) self.rststyle_function = rststyle_function...
{ "repo_name": "timonwong/OmniMarkupPreviewer", "path": "OmniMarkupLib/Renderers/libs/python2/docutils/writers/odf_odt/pygmentsformatter.py", "copies": "4", "size": "4613", "license": "mit", "hash": 1936637410140328400, "line_mean": 41.3211009174, "line_max": 79, "alpha_frac": 0.5063949707, "autogen...
""" Open Document Format (ODF) Writer. """ VERSION = '1.0a' __docformat__ = 'reStructuredText' import sys import os import os.path import tempfile import zipfile from xml.dom import minidom import time import re import io import copy import urllib.request, urllib.error, urllib.parse import docutils from docutils ...
{ "repo_name": "Lyleo/OmniMarkupPreviewer", "path": "OmniMarkupLib/Renderers/libs/python3/docutils/writers/odf_odt/__init__.py", "copies": "2", "size": "125332", "license": "mit", "hash": 370985868924609340, "line_mean": 37.1528158295, "line_max": 103, "alpha_frac": 0.5363514505, "autogenerated": fa...