Пример #1
0
 def _roperation(self, func, other):
     return _operation.operation(func,
                                 other,
                                 self,
                                 broadcast=get_option('op.broadcast'),
                                 reindex=get_option('op.reindex'),
                                 constructor=self._constructor)
Пример #2
0
 def analize():
     import operation
     temp = operation.operation(txt["text"])
     tempArr = {
         "wordCount": temp.calculateWordCount(),
         "letters": temp.letterCount(),
         "longest": temp.longest(),
         "avgLength": temp.avgLength(),
         "duration": temp.duration(),
         "medianWordLength": temp.med_word_count(),
         "medianWord": temp.med_word(),
         "language": temp.detect_Language()
     }
     return json.dumps(tempArr)
Пример #3
0
 def _roperation(self, func, other):
     return _operation.operation(func, other, self, broadcast=get_option('op.broadcast'), reindex=get_option('op.reindex'), constructor=self._constructor)
Пример #4
0
    def _operation(self, func, other):
        """ make an operation: this include axis and dimensions alignment

        Just for testing:
        >>> b = DimArray([[0.,1],[1,2]])
        >>> b
        ... # doctest: +SKIP
        array([[ 0.,  1.],
               [ 1.,  2.]])
        >>> np.all(b == b)
        True
        >>> np.all(b+2 == b + np.ones(b.shape)*2)
        True
        >>> np.all(b+b == b*2)
        True
        >>> np.all(b*b == b**2)
        True
        >>> np.all((b - b.values) == b - b)
        True
        >>> -b
        dimarray: 4 non-null elements (0 null)
        dimensions: 'x0', 'x1'
        0 / x0 (2): 0 to 1
        1 / x1 (2): 0 to 1
        array([[-0., -1.],
               [-1., -2.]])
        >>> np.all(-b == 0. - b)
        True

        True divide by default
        >>> a = DimArray([1,2,3])
        >>> a/2
        dimarray: 3 non-null elements (0 null)
        dimensions: 'x0'
        0 / x0 (3): 0 to 2
        array([ 0.5,  1. ,  1.5])
        >>> a//2
        dimarray: 3 non-null elements (0 null)
        dimensions: 'x0'
        0 / x0 (3): 0 to 2
        array([0, 1, 1])

        Test group/corps structure (result of operation remains DimArray)
        >>> a = DimArray([[1.,2,3],[4,5,6]])
        >>> isinstance(a + 2., DimArray)
        True
        >>> isinstance(2. + a, DimArray)
        True
        >>> isinstance(2 * a, DimArray)
        True
        >>> isinstance(a * 2, DimArray)
        True
        >>> isinstance(2 / a, DimArray)
        True
        >>> isinstance(a / 2, DimArray)
        True
        >>> isinstance(2 - a, DimArray)
        True
        >>> isinstance(a - 2, DimArray)
        True
        >>> s = 0.
        >>> for i in range(5):
        ...        s = s + a
        >>> isinstance(a, DimArray)
        True
        >>> np.all(s == 5*a)
        True
        """
        result = _operation.operation(func, self, other, broadcast=get_option('op.broadcast'), reindex=get_option('op.reindex'), constructor=self._constructor)
        return result
Пример #5
0
from sys import argv, path
from os import getcwd
path.insert(0, '{0}/clases'.format(getcwd()))
from operation import operation

if len(argv) > 1:
    if len(argv) > 2:
        if argv[1] == '-i' and argv[2] != None:
            import install
            install.installPackage(argv[2])
            operation()
        elif argv[1] == '-u' and argv[2] != None:
            import unistall
            unistall.uninstallPackage(argv[2])
            operation()
    else:
        print("""
            (Linux Package Manager)
            ==============================
            (-i) for installing a package 
            (-u) for unistalling a package
            ------------------------------
            then write the package name
            """)

else:
    print("""
    (Linux Package Manager)
    (1) for installing a package
    (2) for unistalling a package
    """)
Пример #6
0
    def _operation(self, func, other):
        """ make an operation: this include axis and dimensions alignment

        Just for testing:
        >>> b = DimArray([[0.,1],[1,2]])
        >>> b
        ... # doctest: +SKIP
        array([[ 0.,  1.],
               [ 1.,  2.]])
        >>> np.all(b == b)
        True
        >>> np.all(b+2 == b + np.ones(b.shape)*2)
        True
        >>> np.all(b+b == b*2)
        True
        >>> np.all(b*b == b**2)
        True
        >>> np.all((b - b.values) == b - b)
        True
        >>> -b
        dimarray: 4 non-null elements (0 null)
        dimensions: 'x0', 'x1'
        0 / x0 (2): 0 to 1
        1 / x1 (2): 0 to 1
        array([[-0., -1.],
               [-1., -2.]])
        >>> np.all(-b == 0. - b)
        True

        True divide by default
        >>> a = DimArray([1,2,3])
        >>> a/2
        dimarray: 3 non-null elements (0 null)
        dimensions: 'x0'
        0 / x0 (3): 0 to 2
        array([ 0.5,  1. ,  1.5])
        >>> a//2
        dimarray: 3 non-null elements (0 null)
        dimensions: 'x0'
        0 / x0 (3): 0 to 2
        array([0, 1, 1])

        Test group/corps structure (result of operation remains DimArray)
        >>> a = DimArray([[1.,2,3],[4,5,6]])
        >>> isinstance(a + 2., DimArray)
        True
        >>> isinstance(2. + a, DimArray)
        True
        >>> isinstance(2 * a, DimArray)
        True
        >>> isinstance(a * 2, DimArray)
        True
        >>> isinstance(2 / a, DimArray)
        True
        >>> isinstance(a / 2, DimArray)
        True
        >>> isinstance(2 - a, DimArray)
        True
        >>> isinstance(a - 2, DimArray)
        True
        >>> s = 0.
        >>> for i in range(5):
        ...        s = s + a
        >>> isinstance(a, DimArray)
        True
        >>> np.all(s == 5*a)
        True
        """
        result = _operation.operation(func,
                                      self,
                                      other,
                                      broadcast=get_option('op.broadcast'),
                                      reindex=get_option('op.reindex'),
                                      constructor=self._constructor)
        return result