def getTrafficCharacteristics():
		if(TrafficCharacteristics.UNIFORM_RANDOM == cfg.defaultTrafficCharacteristics):
			if(TrafficType.FLOW == cfg.defaultTrafficType):
				return characteristics.__getUniformInfiniteFlowCharacteristics()
			else:
				raise NotImplementedError("Not implemented for other traffic types")
		else:
			raise NotImplementedError("Not implemented for other distributions")
Example #2
0
    def __init__(self, **kwargs):
        if not (self.is_block or self.is_trigger or self.is_action):
            msg = 'Boolean is_block, is_trigger or is_action must be specified'
            raise NotImplementedError(msg)

        if not self.block_definition:
            raise NotImplementedError('block_definition not defined')

        return super(WebPypeMixin, self).__init__(**kwargs)
Example #3
0
    def get_server_response(self, endpoint='', params={}, method='default'):
        # Checks to make sure that the carrier overrode the endpoint
        if not endpoint:
            raise NotImplementedError(
                'Failed to specify the %s service endpoint.' % method)

        # Add default params
        params.update({'username': self.username, 'password': self.password})

        # Make a request to the specified URL
        self.last_endpoint = endpoint.format(**params)
        response = requests.get(self.last_endpoint)

        # Check if we got a success, parse the results and construct the TrackingResponse object
        if response.status_code == 200:
            # Save the response object for user inspection
            self._server_response = response

            # Parse the content of the response with the specified response_type
            parsed_response = getattr(
                self, 'parse_' + self.response_type.lower())(response.content)

            # We have no idea what the response looks like for the general case, so pass it up
            return parsed_response
        else:
            self.process_exception()
    def get_tablature(self, tablature_id):
        '''
        Return tablature.
        Return "None" if tablature was not found
        '''

        raise NotImplementedError("")
    def edit_user(self, user):
        '''
        Edit user information.
        Return "None" if user not found
        '''

        raise NotImplementedError("")
    def delete_user(self, user_nickname):
        '''
        Deletes user.
        Return "None" if user not found.
        '''

        raise NotImplementedError("")
    def append_answer(self, comment_id, body, user_nickname):
        '''
        Writes an answer to the comment with id=comment_id
        returns the id of the new comment
        '''

        raise NotImplementedError("")
    def get_user(self, user_nickname):
        '''
        returns user.
        Return "None" if user not found.
        '''

        raise NotImplementedError("")
    def delete_comment(self, comment_id):
        '''
        Deletes comment.
        If comment doesn't exist return "None".        
        '''

        raise NotImplementedError("")
    def modify_comment(self, comment):
        '''
        Changes the comment in database to modified version.
        If comment doesn't exist return "None".
        '''

        raise NotImplementedError("")
    def get_comment(self, comment_id):
        '''
        Returns the comment.
        If comment doesn't exist return "None".
        '''

        raise NotImplementedError("")
Example #12
0
 def list_entries(self):
     """Returns a list of entries. The entry data members in the list may be
     None even if actual content was previusly stored for each entry.
     
     For backends implemeting encryption, doing this helps delaying entry
     decryption until it's really needed."""
     raise NotImplementedError()
Example #13
0
 def first_run(cls):
     """Before creating an instance, this method can be called to check
     wether this would be the first time an instance of this class is
     initialized in the system. This helps initializers ask for a passphrase
     twice instead of one or perform other external initialization routines.
     """
     raise NotImplementedError()
Example #14
0
    def generate(self, databasefile, dependencies, args):
        """generate database result file, must return data extracted
        from database (like load).

        To be implemented in children classes.
        """
        raise NotImplementedError()
Example #15
0
    def table_primary_key(self, table_name):
        '''
        Returns the primary key attribute name for the given table.

            :param table_name: table name string
        '''
        raise NotImplementedError()
Example #16
0
def write_cl(filename, cl, dtype=npy.float32):
    """Writes Cl into an healpix file, as IDL cl2fits.

    Parameters
    ----------
    filename : str
      the fits file name
    cl : array
      the cl array to write to file, currently TT only
    """
    # check the dtype and convert it
    fitsformat = getformat(dtype)
    if isinstance(cl, list):
        raise NotImplementedError(
            'Currently it supports only temperature-only cls')
    else:  # we write only one TT
        cols = [
            pyf.Column(name='TEMPERATURE', format='%s' % fitsformat, array=cl)
        ]

    coldefs = pyf.ColDefs(cols)
    tbhdu = pyf.new_table(coldefs)
    # add needed keywords
    tbhdu.header.update('CREATOR', 'healpy')
    tbhdu.writeto(filename, clobber=True)
Example #17
0
 def table_columns(self, table_name):
     '''
         :param table_name: table name for which to retrieve column names
         :return: a list of columns for the given table.
         :rtype: list
     '''
     raise NotImplementedError()
Example #18
0
 def goToNoduleSlot(self):
   if self.axis == 'z':
     z = int((self.noduleZ - self.origin[2]) / self.spacing[2])
     self.params.param('Basic Operation', 
       'Frame').setValue(z)
   else:
     raise NotImplementedError('not finished...')
    def add_rating(self, tablature_id, rating):
        '''
        Calculate new rating.
        Returns "None" if tablature doesn't exist.
        '''

        raise NotImplementedError("")
Example #20
0
 def __init__(self, parent):
     """The parent should be a VirtualHelixItem."""
     if self.__class__ == AbstractStrandItem:
         raise NotImplementedError(
             "AbstractStrandItem should be subclassed.")
     super(AbstractStrandItem, self).__init__(parent)
     self._strand = None
     self._oligo = None
Example #21
0
 def add_child(self, node):
     if not isinstance(node, Node):
         raise NotImplementedError("Child should be of type " + type(self))
     node._parent = self
     self._children.append(node)
     node._update_hash()
     self._update_hash_queue.add(node._pk)
     self._update_hash()
    def get_songs(self, artist):
        '''
        Return list of songs by artist.
        If artist parameter is left empty return all songs.
        Return "None" if artist or songs not found.
        '''

        raise NotImplementedError("")
Example #23
0
    def pivotColumn(self):
        '''
        Every subclass of ``PivotPythonBase``, i.e. every pivot rule, must
        implement this method.

        Return the index of the entering variable, an integer.
        '''
        raise NotImplementedError('pivotColumn is not implemented')
Example #24
0
        def toString(self, obj):
            """Represents a given object as a string.

      Args:
        obj: The C{object} to convert as a C{string}.
      """

            raise NotImplementedError()
Example #25
0
    def column_values(self, table, col):
        '''
        Returns a list of distinct values for the given table and column.

            :param table: target table
            :param cols: list of columns to select
        '''
        raise NotImplementedError()
    def get_tablatures(self, artist, song):
        '''
        Return list of tablatures to specified song.
        If parameters are left empty return all tablatures.
        If song parameter is left empty return all tablatures by artist.
        Return None if song, artist or tablatures are not found.
        '''

        raise NotImplementedError("")
Example #27
0
    def parse_file(self, filepath):
        """
    Parses a corpus file and initialize the object.
    
    @param  filepath: The path of the corpus file to parse.
    @type   filepath: C{string}
    """

        raise NotImplementedError()
Example #28
0
    def fetch_types(self, table, cols):
        '''
        Returns a dictionary of field types for the given table and columns.

            :param table: target table
            :param cols: list of columns to select
            :return: a dictionary of types for each attribute
            :rtype: dict
        '''
        raise NotImplementedError()
Example #29
0
    def fetch(self, table, cols):
        '''
        Fetches rows for the given table and columns.

            :param table: target table
            :param cols: list of columns to select
            :return: rows from the given table and columns
            :rtype: list
        '''
        raise NotImplementedError()
Example #30
0
 def get_key(self, key):
     """
     Reads a key from the db.
     
     :Parameters:
         key : str      
     :rtype: list(tuple)
     :returns A list of (blob, datetime) tuples for the key
     """
     raise NotImplementedError('get_key must be implemented')