{"commit":"1805732cb81a5ebd3846514188205bae5677d3d8","old_file":"microscopes\/lda\/_model_h.pxd","new_file":"microscopes\/lda\/_model_h.pxd","old_contents":"from libcpp.vector cimport vector\nfrom libcpp.map cimport map\nfrom libc.stddef cimport size_t\n\nfrom microscopes._shared_ptr_h cimport shared_ptr\nfrom microscopes.common._random_fwd_h cimport rng_t\n\n\ncdef extern from \"microscopes\/lda\/model.hpp\" namespace \"microscopes::lda\":\n cdef cppclass model_definition:\n model_definition(size_t, size_t) except +\n\n cdef cppclass state:\n double perplexity()\n size_t nentities()\n size_t ntopics()\n size_t nwords()\n size_t nterms(size_t) except +\n\n vector[vector[size_t]] assignments()\n vector[vector[size_t]] dish_assignments()\n vector[vector[size_t]] table_assignments()\n vector[vector[float]] document_distribution()\n vector[map[size_t, float]] word_distribution()\n\n float score_assignment()\n float score_data(rng_t &)\n\n\ncdef extern from \"microscopes\/lda\/model.hpp\" namespace \"microscopes::lda::state\":\n shared_ptr[state] initialize(const model_definition &defn,\n float alpha, float beta, float gamma,\n size_t initial_dishes,\n vector[vector[size_t]] &docs,\n rng_t & rng) except +\n","new_contents":"from libcpp.vector cimport vector\nfrom libcpp.map cimport map\nfrom libc.stddef cimport size_t\n\nfrom microscopes._shared_ptr_h cimport shared_ptr\nfrom microscopes.common._random_fwd_h cimport rng_t\n\n\ncdef extern from \"microscopes\/lda\/model.hpp\" namespace \"microscopes::lda\":\n cdef cppclass model_definition:\n model_definition(size_t, size_t) except +\n\n cdef cppclass state:\n double perplexity()\n size_t nentities()\n size_t ntopics()\n size_t nwords()\n size_t nterms(size_t) except +\n\n vector[vector[size_t]] assignments()\n vector[vector[size_t]] dish_assignments()\n vector[vector[size_t]] table_assignments()\n vector[vector[float]] document_distribution()\n vector[map[size_t, float]] word_distribution()\n\n float score_assignment()\n float score_data(rng_t &)\n\n\ncdef extern from \"microscopes\/lda\/model.hpp\" namespace \"microscopes::lda::state\":\n shared_ptr[state] initialize(const model_definition &defn,\n float alpha, float beta, float gamma,\n size_t initial_dishes,\n vector[vector[size_t]] &docs,\n rng_t & rng) except +\n\n initialize_explicit \"microscopes::lda::state::initialize\" (\n const model_definition &defn,\n float alpa, float beta, float gamma,\n const vector[vector[size_t]] &dish_assignments,\n const vector[vector[size_t]] &table_assignments,\n vector[vector[size_t]] &docs,\n rng_t &rng) except +","subject":"Improve dish\/table assignment initialization function","message":"Improve dish\/table assignment initialization function\n","lang":"Cython","license":"bsd-3-clause","repos":"datamicroscopes\/lda,datamicroscopes\/lda,datamicroscopes\/lda"} {"commit":"6eeefb083cdc012779f17f71c0449754609d1339","old_file":"src\/MPI\/stdlibc.pxi","new_file":"src\/MPI\/stdlibc.pxi","old_contents":"#---------------------------------------------------------------------\n\ncdef extern from *:\n ctypedef unsigned long size_t\n\n#---------------------------------------------------------------------\n\ncdef extern from \"stdlib.h\":\n void* malloc(size_t)\n void* realloc(void*, size_t)\n void free(void*)\n\n#---------------------------------------------------------------------\n\ncdef extern from \"string.h\":\n int memcmp(void*, void*, size_t)\n void* memset(void*, int, size_t)\n void* memcpy(void*, void*, size_t)\n void* memmove(void*, void*, size_t)\n\n#---------------------------------------------------------------------\n","new_contents":"#---------------------------------------------------------------------\n\ncdef extern from *:\n ctypedef unsigned long int size_t\n\n#---------------------------------------------------------------------\n\ncdef extern from \"stdlib.h\":\n void* malloc(size_t)\n void* realloc(void*, size_t)\n void free(void*)\n\n#---------------------------------------------------------------------\n\ncdef extern from \"string.h\":\n int memcmp(void*, void*, size_t)\n void* memset(void*, int, size_t)\n void* memcpy(void*, void*, size_t)\n void* memmove(void*, void*, size_t)\n\n#---------------------------------------------------------------------\n","subject":"Fix ctypedef for size_t, should be removed when Cython-0.11 gets released","message":"Fix ctypedef for size_t, should be removed when Cython-0.11 gets released","lang":"Cython","license":"bsd-2-clause","repos":"pressel\/mpi4py,mpi4py\/mpi4py,pressel\/mpi4py,mpi4py\/mpi4py,pressel\/mpi4py,pressel\/mpi4py,mpi4py\/mpi4py"} {"commit":"1fc9f70bfeec18d62a4141a44f3bbd40151efd85","old_file":"sdks\/python\/apache_beam\/utils\/windowed_value.pxd","new_file":"sdks\/python\/apache_beam\/utils\/windowed_value.pxd","old_contents":"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\ncimport cython\nfrom libc.stdint cimport int64_t\n\n\ncdef type Timestamp\n\n@cython.final\ncdef class WindowedValue(object):\n cdef public object value\n cdef public object windows\n cdef public int64_t timestamp_micros\n cdef object timestamp_object\n\n cpdef WindowedValue with_value(self, new_value)\n\n @staticmethod\n cdef inline bint _typed_eq(WindowedValue left, WindowedValue right) except? -2\n\n@cython.locals(wv=WindowedValue)\ncdef inline WindowedValue create(\n object value, int64_t timestamp_micros, object windows)\n","new_contents":"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\ncimport cython\nfrom libc.stdint cimport int64_t\n\n\ncdef type Timestamp\n\n@cython.final\ncdef class WindowedValue(object):\n cdef public object value\n cdef public object windows\n cdef public int64_t timestamp_micros\n cdef object timestamp_object\n\n cpdef WindowedValue with_value(self, new_value)\n\n @staticmethod\n cdef inline bint _typed_eq(WindowedValue left, WindowedValue right) except? -2\n\n@cython.locals(wv=WindowedValue)\ncdef WindowedValue create(\n object value, int64_t timestamp_micros, object windows)\n","subject":"Remove the inline from WindowedValue.create()","message":"Remove the inline from WindowedValue.create()\n","lang":"Cython","license":"apache-2.0","repos":"RyanSkraba\/beam,robertwb\/incubator-beam,manuzhang\/incubator-beam,vikkyrk\/incubator-beam,robertwb\/incubator-beam,lukecwik\/incubator-beam,wtanaka\/beam,RyanSkraba\/beam,jbonofre\/beam,mxm\/incubator-beam,wangyum\/beam,apache\/beam,staslev\/incubator-beam,chamikaramj\/beam,amitsela\/incubator-beam,staslev\/beam,charlesccychen\/incubator-beam,charlesccychen\/beam,wangyum\/beam,rangadi\/beam,xsm110\/Apache-Beam,robertwb\/incubator-beam,jasonkuster\/beam,vikkyrk\/incubator-beam,eljefe6a\/incubator-beam,chamikaramj\/beam,rangadi\/incubator-beam,robertwb\/incubator-beam,apache\/beam,jasonkuster\/beam,manuzhang\/beam,amitsela\/beam,dhalperi\/beam,charlesccychen\/incubator-beam,lukecwik\/incubator-beam,robertwb\/incubator-beam,robertwb\/incubator-beam,robertwb\/incubator-beam,lukecwik\/incubator-beam,chamikaramj\/beam,rangadi\/beam,yk5\/beam,markflyhigh\/incubator-beam,apache\/beam,charlesccychen\/incubator-beam,ravwojdyla\/incubator-beam,markflyhigh\/incubator-beam,chamikaramj\/beam,markflyhigh\/incubator-beam,rangadi\/beam,sammcveety\/incubator-beam,tgroh\/beam,rangadi\/beam,amitsela\/beam,tgroh\/beam,apache\/beam,jbonofre\/incubator-beam,jbonofre\/beam,chamikaramj\/beam,iemejia\/incubator-beam,apache\/beam,robertwb\/incubator-beam,vikkyrk\/incubator-beam,xsm110\/Apache-Beam,charlesccychen\/beam,tgroh\/incubator-beam,charlesccychen\/beam,jbonofre\/beam,apache\/beam,dhalperi\/incubator-beam,sammcveety\/incubator-beam,chamikaramj\/beam,rangadi\/beam,staslev\/beam,lukecwik\/incubator-beam,wtanaka\/beam,jbonofre\/beam,charlesccychen\/beam,markflyhigh\/incubator-beam,ravwojdyla\/incubator-beam,apache\/beam,eljefe6a\/incubator-beam,jasonkuster\/beam,RyanSkraba\/beam,robertwb\/incubator-beam,charlesccychen\/beam,apache\/beam,chamikaramj\/incubator-beam,rangadi\/beam,lukecwik\/incubator-beam,chamikaramj\/beam,RyanSkraba\/beam,peihe\/incubator-beam,charlesccychen\/beam,robertwb\/incubator-beam,sammcveety\/incubator-beam,yk5\/beam,staslev\/beam,jasonkuster\/incubator-beam,RyanSkraba\/beam,RyanSkraba\/beam,jasonkuster\/incubator-beam,peihe\/incubator-beam,markflyhigh\/incubator-beam,yk5\/beam,rangadi\/beam,amitsela\/beam,xsm110\/Apache-Beam,dhalperi\/beam,charlesccychen\/beam,dhalperi\/incubator-beam,chamikaramj\/beam,mxm\/incubator-beam,rangadi\/incubator-beam,staslev\/incubator-beam,apache\/beam,lukecwik\/incubator-beam,tgroh\/incubator-beam,manuzhang\/beam,lukecwik\/incubator-beam,eljefe6a\/incubator-beam,rangadi\/incubator-beam,chamikaramj\/beam,lukecwik\/incubator-beam,amarouni\/incubator-beam,wangyum\/beam,iemejia\/incubator-beam,markflyhigh\/incubator-beam,manuzhang\/incubator-beam,amarouni\/incubator-beam,amitsela\/incubator-beam,markflyhigh\/incubator-beam,apache\/beam,peihe\/incubator-beam,chamikaramj\/beam,tgroh\/beam,lukecwik\/incubator-beam,apache\/beam,jbonofre\/incubator-beam,RyanSkraba\/beam,lukecwik\/incubator-beam,dhalperi\/beam,manuzhang\/beam,chamikaramj\/incubator-beam,wtanaka\/beam,wangyum\/beam,ravwojdyla\/incubator-beam,tgroh\/beam"} {"commit":"f9a7a302e627018395d77603f7743cbf2d9bb11d","old_file":"cygroonga.pyx","new_file":"cygroonga.pyx","old_contents":"cimport ccygroonga\n\ndef init():\n return ccygroonga.grn_init()\n\ncdef class Database:\n cdef ccygroonga.grn_ctx* _c_ctx\n cdef ccygroonga.grn_obj* _c_db\n\n def __cinit__(self, ccygroonga.grn_ctx* c_ctx, ccygroonga.grn_obj* c_db):\n self._c_ctx = c_ctx\n self._c_db = c_db\n\ncdef class Context:\n cdef ccygroonga.grn_ctx* _c_ctx\n\n def __cinit__(self):\n self._c_ctx = ccygroonga.grn_ctx_open(0)\n\n def db_create(self, path):\n c_path = path.encode('UTF-8')\n c_db = ccygroonga.grn_db_create(self._c_ctx, c_path, NULL)\n return Database(self._c_ctx, c_db)\n\n def fin(self):\n return ccygroonga.grn_ctx_fin(self._c_ctx)\n\ndef fin():\n return ccygroonga.grn_fin()\n","new_contents":"cimport ccygroonga\n\ndef init():\n return ccygroonga.grn_init()\n\ndef fin():\n return ccygroonga.grn_fin()\n\ncdef new_database(ccygroonga.grn_ctx* c_ctx, ccygroonga.grn_obj* c_db):\n db = Database()\n db._c_ctx = c_ctx\n db._c_db = c_db\n\ncdef class Database:\n cdef ccygroonga.grn_ctx* _c_ctx\n cdef ccygroonga.grn_obj* _c_db\n\ncdef class Context:\n cdef ccygroonga.grn_ctx* _c_ctx\n\n def __cinit__(self):\n self._c_ctx = ccygroonga.grn_ctx_open(0)\n\n def db_create(self, path):\n c_path = path.encode('UTF-8')\n c_db = ccygroonga.grn_db_create(self._c_ctx, c_path, NULL)\n return new_database(self._c_ctx, c_db)\n\n def fin(self):\n return ccygroonga.grn_ctx_fin(self._c_ctx)\n","subject":"Write a factory function to create a Database instance","message":"Write a factory function to create a Database instance\n","lang":"Cython","license":"apache-2.0","repos":"hnakamur\/cygroonga"} {"commit":"099d4228fa970fd4062b0121fe226066b6946358","old_file":"mtpy\/mtpy.pyx","new_file":"mtpy\/mtpy.pyx","old_contents":"from math import log\n\ncdef extern from \"mtwist-1.1\/mtwist.c\":\n double mt_drand()\n void mt_seed32new(unsigned int)\n\ndef uniform():\n return mt_drand()\n\ndef exp(p):\n u = 1.0 - uniform()\n return -log(u)\/p\n\ndef seed(s):\n mt_seed32new (s)\n","new_contents":"from math import log\n\n# cdef extern void c_eject_tomato \"eject_tomato\" (float speed)\ncdef extern from \"mtwist-1.1\/mtwist.c\":\n double c_mt_drand \"mt_drand\" ()\n void c_mt_seed32new \"mt_seed32new\" (unsigned int)\n\n#def uniform():\n# return mt_drand()\n#\n#def exp(p):\n# u = 1.0 - uniform()\n# return -log(u)\/p\n#\n#def seed(s):\n# mt_seed32new (s)\n\ndef mt_drand():\n return c_mt_drand()\n\ndef mt_seed32new(s):\n c_mt_seed32new (s)\n","subject":"Use identical names for C and python","message":"Use identical names for C and python\n","lang":"Cython","license":"apache-2.0","repos":"squisher\/stella,squisher\/stella,squisher\/stella,squisher\/stella"} {"commit":"c5d8303cc1e6594718f8bf0c6e882bde4c80233c","old_file":"tests\/run\/big_indices.pyx","new_file":"tests\/run\/big_indices.pyx","old_contents":"__doc__ = u\"\"\"\n >>> test()\n neg False\n pos True\n neg\n pos\n neg\n pos\n\"\"\"\n\ndef test():\n cdef long neg = -1\n cdef unsigned long pos = -2 # will be a large positive number\n\n print \"neg\", neg > 0\n print \"pos\", pos > -\n\n D = { neg: 'neg', pos: 'pos' }\n\n print D[neg]\n print D[pos]\n\n print D[neg]\n print D[pos]\n \n","new_contents":"__doc__ = u\"\"\"\n >>> test()\n neg False\n pos True\n neg\n pos\n neg\n pos\n\"\"\"\n\ndef test():\n cdef long neg = -1\n cdef unsigned long pos = -2 # will be a large positive number\n\n print \"neg\", neg > 0\n print \"pos\", pos > 0\n\n D = { neg: 'neg', pos: 'pos' }\n\n print D[neg]\n print D[pos]\n\n print D[neg]\n print D[pos]\n \n","subject":"Fix test case syntax error","message":"Fix test case syntax error\n","lang":"Cython","license":"apache-2.0","repos":"andreasvc\/cython,andreasvc\/cython,hickford\/cython,fabianrost84\/cython,slonik-az\/cython,ChristopherHogan\/cython,da-woods\/cython,fperez\/cython,ABcDexter\/cython,hpfem\/cython,hickford\/cython,achernet\/cython,marscher\/cython,madjar\/cython,hickford\/cython,acrispin\/cython,bzzzz\/cython,slonik-az\/cython,dahebolangkuan\/cython,marscher\/cython,mcanthony\/cython,mcanthony\/cython,ChristopherHogan\/cython,roxyboy\/cython,slonik-az\/cython,mrGeen\/cython,encukou\/cython,mcanthony\/cython,dahebolangkuan\/cython,achernet\/cython,fabianrost84\/cython,c-blake\/cython,hhsprings\/cython,madjar\/cython,c-blake\/cython,dahebolangkuan\/cython,hhsprings\/cython,bzzzz\/cython,slonik-az\/cython,hickford\/cython,fperez\/cython,roxyboy\/cython,larsmans\/cython,hickford\/cython,andreasvc\/cython,marscher\/cython,hhsprings\/cython,acrispin\/cython,rguillebert\/CythonCTypesBackend,acrispin\/cython,mrGeen\/cython,fperez\/cython,larsmans\/cython,bzzzz\/cython,mcanthony\/cython,rguillebert\/CythonCTypesBackend,rguillebert\/CythonCTypesBackend,da-woods\/cython,ChristopherHogan\/cython,JelleZijlstra\/cython,encukou\/cython,JelleZijlstra\/cython,JelleZijlstra\/cython,da-woods\/cython,fabianrost84\/cython,madjar\/cython,achernet\/cython,scoder\/cython,encukou\/cython,mrGeen\/cython,ABcDexter\/cython,achernet\/cython,hpfem\/cython,c-blake\/cython,roxyboy\/cython,hhsprings\/cython,c-blake\/cython,larsmans\/cython,acrispin\/cython,andreasvc\/cython,roxyboy\/cython,ABcDexter\/cython,madjar\/cython,marscher\/cython,hhsprings\/cython,cython\/cython,andreasvc\/cython,cython\/cython,JelleZijlstra\/cython,encukou\/cython,dahebolangkuan\/cython,scoder\/cython,bzzzz\/cython,da-woods\/cython,cython\/cython,dahebolangkuan\/cython,ABcDexter\/cython,mcanthony\/cython,mrGeen\/cython,fabianrost84\/cython,mrGeen\/cython,scoder\/cython,rguillebert\/CythonCTypesBackend,cython\/cython,JelleZijlstra\/cython,hpfem\/cython,fperez\/cython,larsmans\/cython,roxyboy\/cython,ABcDexter\/cython,fabianrost84\/cython,encukou\/cython,madjar\/cython,larsmans\/cython,marscher\/cython,fperez\/cython,c-blake\/cython,scoder\/cython,hpfem\/cython,slonik-az\/cython,achernet\/cython,acrispin\/cython,hpfem\/cython"} {"commit":"f1b4f5270ed0967ddb3b1eee7edf52390bc60535","old_file":"daapserver\/revision.pxd","new_file":"daapserver\/revision.pxd","old_contents":"from daapserver cimport constants\n\ncimport cython\n\ncdef class TreeRevisionStorage(object):\n cpdef public int revision\n cdef int last_operation\n cdef object storage\n\n @cython.locals(low=cython.int, middle=cython.int, high=cython.int)\n cdef get_index(self, object key, int revision)","new_contents":"from daapserver cimport constants\n\ncimport cython\n\ncdef class TreeRevisionStorage(object):\n cpdef public int revision\n cdef public int last_operation\n cdef object storage\n\n @cython.locals(low=cython.int, middle=cython.int, high=cython.int)\n cdef get_index(self, object key, int revision)","subject":"Fix tests for compiled code.","message":"Fix tests for compiled code.\n","lang":"Cython","license":"mit","repos":"ties\/flask-daapserver,basilfx\/flask-daapserver"} {"commit":"54d38cfc1d6ba1462b9a95f392e5252dff28ac8f","old_file":"tests\/compile\/libc_all.pyx","new_file":"tests\/compile\/libc_all.pyx","old_contents":"cimport libc\n\ncimport libc.stdio\ncimport libc.errno\ncimport libc.float\ncimport libc.limits\ncimport libc.locale\ncimport libc.signal\ncimport libc.stddef\ncimport libc.stdint\ncimport libc.stdio\ncimport libc.stdlib\ncimport libc.string\n\nfrom libc cimport errno\nfrom libc cimport float\nfrom libc cimport limits\nfrom libc cimport locale\nfrom libc cimport signal\nfrom libc cimport stddef\nfrom libc cimport stdint\nfrom libc cimport stdio\nfrom libc cimport stdlib\nfrom libc cimport string\n\nfrom libc.errno cimport *\nfrom libc.float cimport *\nfrom libc.limits cimport *\nfrom libc.locale cimport *\nfrom libc.signal cimport *\nfrom libc.stddef cimport *\nfrom libc.stdint cimport *\nfrom libc.stdio cimport *\nfrom libc.stdlib cimport *\nfrom libc.string cimport *\n\nlibc.stdio.printf(\"hello %s\\n\", b\"world\")\nstdio.printf(\"hello %s\\n\", b\"world\")\nprintf(\"hello %s\\n\", b\"world\")\n","new_contents":"cimport libc\n\ncimport libc.stdio\ncimport libc.errno\ncimport libc.float\ncimport libc.limits\ncimport libc.locale\ncimport libc.signal\ncimport libc.stddef\n#cimport libc.stdint # XXX MSVC\ncimport libc.stdio\ncimport libc.stdlib\ncimport libc.string\n\nfrom libc cimport errno\nfrom libc cimport float\nfrom libc cimport limits\nfrom libc cimport locale\nfrom libc cimport signal\nfrom libc cimport stddef\n#from libc cimport stdint # XXX MSVC\nfrom libc cimport stdio\nfrom libc cimport stdlib\nfrom libc cimport string\n\nfrom libc.errno cimport *\nfrom libc.float cimport *\nfrom libc.limits cimport *\nfrom libc.locale cimport *\nfrom libc.signal cimport *\nfrom libc.stddef cimport *\n#from libc.stdint cimport * # XXX MSVC\nfrom libc.stdio cimport *\nfrom libc.stdlib cimport *\nfrom libc.string cimport *\n\nlibc.stdio.printf(\"hello %s\\n\", b\"world\")\nstdio.printf(\"hello %s\\n\", b\"world\")\nprintf(\"hello %s\\n\", b\"world\")\n","subject":"Disable test for libc.stdint (missing stdint.h in MSVC)","message":"Disable test for libc.stdint (missing stdint.h in MSVC)\n","lang":"Cython","license":"apache-2.0","repos":"bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu"} {"commit":"41d65a727220ddc6d7877c4816900c6afc763d09","old_file":"Cython\/Includes\/libcpp\/utility.pxd","new_file":"Cython\/Includes\/libcpp\/utility.pxd","old_contents":"cdef extern from \"\" namespace \"std\" nogil:\n cdef cppclass pair[T, U]:\n ctypedef T first_type\n ctypedef U second_type\n T first\n U second\n pair() except +\n pair(pair&) except +\n pair(T&, U&) except +\n bint operator==(pair&, pair&)\n bint operator!=(pair&, pair&)\n bint operator<(pair&, pair&)\n bint operator>(pair&, pair&)\n bint operator<=(pair&, pair&)\n bint operator>=(pair&, pair&)\n\ncdef extern from * namespace \"cython_std\" nogil:\n \"\"\"\n #if __cplusplus > 199711L\n #include \n\n namespace cython_std {\n template typename std::remove_reference::type&& move(T& t) noexcept { return std::move(t); }\n template typename std::remove_reference::type&& move(T&& t) noexcept { return std::move(t); }\n }\n\n #endif\n \"\"\"\n cdef T move[T](T)\n","new_contents":"cdef extern from \"\" namespace \"std\" nogil:\n cdef cppclass pair[T, U]:\n ctypedef T first_type\n ctypedef U second_type\n T first\n U second\n pair() except +\n pair(pair&) except +\n pair(T&, U&) except +\n bint operator==(pair&, pair&)\n bint operator!=(pair&, pair&)\n bint operator<(pair&, pair&)\n bint operator>(pair&, pair&)\n bint operator<=(pair&, pair&)\n bint operator>=(pair&, pair&)\n\ncdef extern from * namespace \"cython_std\" nogil:\n \"\"\"\n #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)\n \/\/ move should be defined for these versions of MSVC, but __cplusplus isn't set usefully\n #include \n\n namespace cython_std {\n template typename std::remove_reference::type&& move(T& t) noexcept { return std::move(t); }\n template typename std::remove_reference::type&& move(T&& t) noexcept { return std::move(t); }\n }\n\n #endif\n \"\"\"\n cdef T move[T](T)\n","subject":"Enable usage of std::move() only in the supported versions of MSVC (GH-4191)","message":"Enable usage of std::move() only in the supported versions of MSVC (GH-4191)\n\n","lang":"Cython","license":"apache-2.0","repos":"da-woods\/cython,cython\/cython,cython\/cython,scoder\/cython,scoder\/cython,scoder\/cython,da-woods\/cython,scoder\/cython,cython\/cython,cython\/cython,da-woods\/cython,da-woods\/cython"} {"commit":"dc1e42ae57ce25420edc4dbab2d3e689c49b4938","old_file":"count.pyx","new_file":"count.pyx","old_contents":"#!\/usr\/bin\/python\n\nimport json\nfrom Bio import SeqIO\n\n\ndef compute(inputfile, format):\n cdef str line = ''\n cdef int i = 0\n cdef int j = 0\n cdef int line_len = 0\n cdef str token = ''\n cdef int token_cnt = 0\n for seq_record in SeqIO.parse(inputfile, format):\n cnt = {}\n line = str(seq_record.seq)\n line_len = len(line)\n for j in xrange(line_len \/ 3):\n i = j * 3\n token = line[i:i+3]\n try:\n token_cnt = cnt[token]\n except KeyError:\n cnt[token] = 1\n else:\n cnt[token] = token_cnt + 1\n print json.dumps(\n [{\n \"id\": seq_record.id,\n \"ratios\": cnt\n }])\n","new_contents":"#!\/usr\/bin\/python\n\nimport json\nfrom Bio import SeqIO\n\n\ndef compute(inputfile, format):\n cdef str line = ''\n cdef int i = 0\n cdef int j = 0\n cdef int line_len = 0\n cdef str token = ''\n cdef int token_cnt = 0\n for seq_record in SeqIO.parse(inputfile, format):\n cnt = {}\n line = str(seq_record.seq)\n line_len = len(line)\n for j in xrange(line_len \/ 3):\n i = j * 3\n token = line[i:i+3]\n try:\n token_cnt = cnt[token]\n except KeyError:\n cnt[token] = 1\n else:\n cnt[token] = token_cnt + 1\n print json.dumps(\n [{\n \"id\": seq_record.id,\n \"ratios\": cnt\n }])\n","subject":"Fix bug introduced by pep8 changes","message":"Fix bug introduced by pep8 changes\n","lang":"Cython","license":"apache-2.0","repos":"PDX-Flamingo\/codonpdx-python,PDX-Flamingo\/codonpdx-python"} {"commit":"4ee6b6ec7762a9c226f66dc445405b5927c8c705","old_file":"tests\/run\/import_star.pyx","new_file":"tests\/run\/import_star.pyx","old_contents":"# mode: run\n\ncdef object executable, version_info\ncdef long hexversion\n\nctypedef struct MyStruct:\n int x, y, z\n\n# conversion code for this struct will be generated but not used\n# (there used to be a problem getting Cython conversion code generated here)\ncdef MyStruct _no_such_name_ = MyStruct(1, 2, 3)\n\nfrom libc.math cimport NAN\n\n# Danger ahead!\nfrom sys import *\n\n\ndef test_cdefed_objects():\n \"\"\"\n >>> ex, vi = test_cdefed_objects()\n >>> assert ex is not None\n >>> assert vi is not None\n \"\"\"\n return executable, version_info\n\n\ndef test_cdefed_cvalues():\n \"\"\"\n >>> hexver = test_cdefed_cvalues()\n >>> assert hexver is not None\n >>> assert hexver > 0x02020000\n \"\"\"\n return hexversion\n\n\ndef test_non_cdefed_names():\n \"\"\"\n >>> mod, pth = test_non_cdefed_names()\n >>> assert mod is not None\n >>> assert pth is not None\n \"\"\"\n return modules, path\n\n\ndef test_cimported_NAN():\n \"\"\"\n >>> from math import isnan\n >>> nan = test_cimported_NAN()\n >>> isnan(nan)\n True\n \"\"\"\n return NAN\n","new_contents":"# mode: run\n\ncdef object executable, version_info\ncdef long hexversion\n\nctypedef struct MyStruct:\n int x, y, z\n\n# conversion code for this struct will be generated but not used\n# (there used to be a problem getting Cython conversion code generated here)\ncdef MyStruct _no_such_name_ = MyStruct(1, 2, 3)\n\nfrom libc.math cimport M_PI\n\n# Danger ahead!\nfrom sys import *\n\n\ndef test_cdefed_objects():\n \"\"\"\n >>> ex, vi = test_cdefed_objects()\n >>> assert ex is not None\n >>> assert vi is not None\n \"\"\"\n return executable, version_info\n\n\ndef test_cdefed_cvalues():\n \"\"\"\n >>> hexver = test_cdefed_cvalues()\n >>> assert hexver is not None\n >>> assert hexver > 0x02020000\n \"\"\"\n return hexversion\n\n\ndef test_non_cdefed_names():\n \"\"\"\n >>> mod, pth = test_non_cdefed_names()\n >>> assert mod is not None\n >>> assert pth is not None\n \"\"\"\n return modules, path\n\n\ndef test_cimported_pi():\n \"\"\"\n >>> pi = test_cimported_pi()\n >>> 3.14 < pi < 3.15\n True\n \"\"\"\n return M_PI\n","subject":"Use a different constant (PI instead of NAN) in the \"import *\" test since NAN does not seem to be defined by MSVC.","message":"Use a different constant (PI instead of NAN) in the \"import *\" test since NAN does not seem to be defined by MSVC.\n","lang":"Cython","license":"apache-2.0","repos":"da-woods\/cython,da-woods\/cython,cython\/cython,scoder\/cython,cython\/cython,cython\/cython,cython\/cython,scoder\/cython,da-woods\/cython,scoder\/cython,scoder\/cython,da-woods\/cython"} {"commit":"6d8a5daf503fc8f158269102886bff67c1f6b693","old_file":"microscopes\/lda\/_model.pxd","new_file":"microscopes\/lda\/_model.pxd","old_contents":"from cython.operator cimport dereference as deref\nfrom libcpp.vector cimport vector\nfrom libc.stddef cimport size_t\n\nfrom microscopes.common.variadic._dataview cimport (\n abstract_dataview,\n)\nfrom microscopes.common._rng cimport rng\nfrom microscopes.lda._model_h cimport (\n state as c_state,\n initialize as c_initialize,\n)\nfrom microscopes._shared_ptr_h cimport shared_ptr\nfrom microscopes.lda.definition cimport model_definition\n\n\ncdef class state:\n \"\"\"The underlying state of a Hierarchial Dirichlet Process LDA\n\n You should not explicitly construct a state object.\n Instead, use `initialize`.\n \"\"\"\n cdef shared_ptr[c_state] _thisptr\n # cdef model_definition _defn\n # cdef abstract_dataview _data","new_contents":"from cython.operator cimport dereference as deref\nfrom libcpp.vector cimport vector\nfrom libc.stddef cimport size_t\n\nfrom microscopes.common.variadic._dataview cimport (\n abstract_dataview,\n)\nfrom microscopes.common._rng cimport rng\nfrom microscopes.lda._model_h cimport (\n state as c_state,\n initialize as c_initialize,\n)\nfrom microscopes._shared_ptr_h cimport shared_ptr\nfrom microscopes.lda.definition cimport model_definition\n\n\ncdef class state:\n \"\"\"The underlying state of a Hierarchial Dirichlet Process LDA\n\n You should not explicitly construct a state object.\n Instead, use `initialize`.\n \"\"\"\n cdef shared_ptr[c_state] _thisptr\n cdef model_definition _defn\n # cdef abstract_dataview _data","subject":"Add _defn to state object","message":"Add _defn to state object\n","lang":"Cython","license":"bsd-3-clause","repos":"datamicroscopes\/lda,datamicroscopes\/lda,datamicroscopes\/lda"} {"commit":"6ac4a537bf9406391cac6d18dcb4e440cabdc015","old_file":"pyfof\/pyfof.pyx","new_file":"pyfof\/pyfof.pyx","old_contents":"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Mar 26 17:59:28 2015\n\n@author: sljg2\n\"\"\"\n\n__all__ = [\"friends_of_friends\"]\n__version__ = \"0.1\"\n__author__ = \"Simon Gibbons (sljg2@ast.cam.ac.uk)\"\n__copyright__ = \"Copyright 2015 Simon Gibbons\"\n\ncimport numpy as np\nfrom libcpp.list cimport list\n\ncdef extern from \"fof.hpp\":\n cdef list[list[size_t]] _friends_of_friends \"friends_of_friends\"(double*, size_t, size_t, double) except +\n\ndef friends_of_friends(np.ndarray[double, ndim=2] data, double linking_length):\n \"\"\" Computes friends-of-friends clustering of data. Distances are computed\n using a euclidian metric.\n\n :param data: A numpy array with dimensions (npoints x ndim)\n\n :param linking_length: The linking length between cluster members\n\n :rtype: A list of lists of indices in each cluster type\n \"\"\"\n\n cdef np.ndarray[double, ndim=2, mode='c'] data_corder\n\n data_corder = data if data.flags['C_CONTIGUOUS'] else data.copy(order='C')\n\n return _friends_of_friends(&data_corder[0,0],\\\n data.shape[0],\\\n data.shape[1],\\\n linking_length)\n\n\n","new_contents":"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Mar 26 17:59:28 2015\n\n@author: sljg2\n\"\"\"\n\n__all__ = [\"friends_of_friends\"]\n__version__ = \"0.1.3-dev\"\n__author__ = \"Simon Gibbons (sljg2@ast.cam.ac.uk)\"\n__copyright__ = \"Copyright 2015 Simon Gibbons\"\n\ncimport numpy as np\nfrom libcpp.list cimport list\n\ncdef extern from \"fof.hpp\":\n cdef list[list[size_t]] _friends_of_friends \"friends_of_friends\"(double*, size_t, size_t, double) except +\n\ndef friends_of_friends(np.ndarray[double, ndim=2] data, double linking_length):\n \"\"\" Computes friends-of-friends clustering of data. Distances are computed\n using a euclidian metric.\n\n :param data: A numpy array with dimensions (npoints x ndim)\n\n :param linking_length: The linking length between cluster members\n\n :rtype: A list of lists of indices in each cluster type\n \"\"\"\n\n cdef np.ndarray[double, ndim=2, mode='c'] data_corder\n\n data_corder = data if data.flags['C_CONTIGUOUS'] else data.copy(order='C')\n\n if np.any( np.isnan(data_corder) ):\n raise ValueError(\"NaN detected in pyfof\")\n\n return _friends_of_friends(&data_corder[0,0],\\\n data.shape[0],\\\n data.shape[1],\\\n linking_length)\n\n\n","subject":"Raise an exception if a NaN is passed to prevent a memory leak","message":"Raise an exception if a NaN is passed to prevent a memory leak\n","lang":"Cython","license":"mit","repos":"simongibbons\/pyfof,simongibbons\/pyfof,simongibbons\/pyfof"} {"commit":"59720e1a98732d3ae5f1239b08889404a23993b0","old_file":"opencog\/cython\/opencog\/ptrvalue.pyx","new_file":"opencog\/cython\/opencog\/ptrvalue.pyx","old_contents":"from cpython.ref cimport Py_INCREF, Py_DECREF\n\ncdef class PtrValue(Value):\n\n def __init__(self, obj = None, value_ptr = None):\n if obj is not None:\n Py_INCREF(obj)\n cvalue = createPtrValue(obj, decref)\n super(PtrValue, self).__init__(ValuePtr.create(cvalue))\n else:\n super(PtrValue, self).__init__(value_ptr)\n\n def value(self):\n return ((self.get_c_value_ptr().get()).value())\n\ncdef void decref(void* obj):\n Py_DECREF(obj)\n\ndef valueToPtrValue(value):\n return PtrValue(value_ptr =\n ValuePtr.create((value).get_c_value_ptr()))\n","new_contents":"from cpython.ref cimport Py_INCREF, Py_DECREF\n\ncdef class PtrValue(Value):\n\n def __init__(self, obj = None, value_ptr = None):\n if obj is not None:\n Py_INCREF(obj)\n cvalue = createPtrValue(obj, decref)\n super(PtrValue, self).__init__(PtrHolder.create(cvalue))\n else:\n super(PtrValue, self).__init__(value_ptr)\n\n def value(self):\n return ((self.get_c_value_ptr().get()).value())\n\ncdef void decref(void* obj):\n Py_DECREF(obj)\n\ndef valueToPtrValue(value):\n return PtrValue(value_ptr = (value).ptr_holder)\n","subject":"Fix build after latest API changes from opencog","message":"Fix build after latest API changes from opencog\n","lang":"Cython","license":"agpl-3.0","repos":"rTreutlein\/atomspace,rTreutlein\/atomspace,AmeBel\/atomspace,AmeBel\/atomspace,rTreutlein\/atomspace,AmeBel\/atomspace,rTreutlein\/atomspace,AmeBel\/atomspace,AmeBel\/atomspace,rTreutlein\/atomspace"} {"commit":"63305d7dd96a6f019303ded93937c96c0e92227f","old_file":"src\/MPI\/stdlib.pxi","new_file":"src\/MPI\/stdlib.pxi","old_contents":"#---------------------------------------------------------------------\n\ncdef extern from *:\n ctypedef unsigned long int size_t\n\n#---------------------------------------------------------------------\n\ncdef extern from * nogil: # \"stdio.h\"\n ctypedef struct FILE\n FILE *stdin, *stdout, *stderr\n int fprintf(FILE *, char *, ...)\n int fflush(FILE *)\n\n#---------------------------------------------------------------------\n","new_contents":"#---------------------------------------------------------------------\n\ncdef extern from * nogil: # \"stdio.h\"\n ctypedef struct FILE\n FILE *stdin, *stdout, *stderr\n int fprintf(FILE *, char *, ...)\n int fflush(FILE *)\n\n#---------------------------------------------------------------------\n","subject":"Remove ancient ctypedef for size_t","message":"Remove ancient ctypedef for size_t","lang":"Cython","license":"bsd-2-clause","repos":"pressel\/mpi4py,mpi4py\/mpi4py,pressel\/mpi4py,mpi4py\/mpi4py,mpi4py\/mpi4py,pressel\/mpi4py,pressel\/mpi4py"} {"commit":"c790774822d21868a82c3980109cae5c87e6b428","old_file":"thinc\/typedefs.pxd","new_file":"thinc\/typedefs.pxd","old_contents":"from libc.stdint cimport uint64_t\nfrom libc.stdint cimport uint32_t\nfrom libc.stdint cimport uint16_t\nfrom libc.stdint cimport int32_t\n\n\nctypedef float weight_t\nctypedef uint64_t atom_t\nctypedef uint64_t feat_t\nctypedef uint64_t hash_t\nctypedef int32_t class_t\nctypedef uint32_t count_t\nctypedef uint32_t time_t\nctypedef int32_t len_t\nctypedef int32_t idx_t\n\n\n","new_contents":"from libc.stdint cimport uint64_t\nfrom libc.stdint cimport uint32_t\nfrom libc.stdint cimport uint16_t\nfrom libc.stdint cimport int32_t\n\n\nctypedef double weight_t\nctypedef uint64_t atom_t\nctypedef uint64_t feat_t\nctypedef uint64_t hash_t\nctypedef int32_t class_t\nctypedef uint32_t count_t\nctypedef uint32_t time_t\nctypedef int32_t len_t\nctypedef int32_t idx_t\n\n\n","subject":"Fix compile weight_t back to double, not float","message":"Fix compile weight_t back to double, not float\n","lang":"Cython","license":"mit","repos":"explosion\/thinc,explosion\/thinc,spacy-io\/thinc,spacy-io\/thinc,explosion\/thinc,explosion\/thinc,spacy-io\/thinc"} {"commit":"4a7dc93e4e7e904eea9637814d0a162729e497a4","old_file":"tests\/compile\/extern_packed_struct.pyx","new_file":"tests\/compile\/extern_packed_struct.pyx","old_contents":"# ticket: 290\n# mode: error\n\ncdef extern:\n cdef packed struct MyStruct:\n char a\n\n_ERRORS = u\"\"\"\n5:9: Cannot declare extern struct as 'packed'\n\"\"\"\n","new_contents":"# mode: compile\n\ncdef extern from *:\n cdef packed struct MyStruct:\n char a\n","subject":"Fix extern packed struct test.","message":"Fix extern packed struct test.\n","lang":"Cython","license":"apache-2.0","repos":"mrGeen\/cython,ABcDexter\/cython,marscher\/cython,cython\/cython,fperez\/cython,cython\/cython,mcanthony\/cython,JelleZijlstra\/cython,fabianrost84\/cython,cython\/cython,andreasvc\/cython,JelleZijlstra\/cython,da-woods\/cython,achernet\/cython,scoder\/cython,marscher\/cython,andreasvc\/cython,madjar\/cython,dahebolangkuan\/cython,roxyboy\/cython,mcanthony\/cython,encukou\/cython,mcanthony\/cython,fperez\/cython,hhsprings\/cython,madjar\/cython,mrGeen\/cython,c-blake\/cython,scoder\/cython,roxyboy\/cython,hhsprings\/cython,marscher\/cython,JelleZijlstra\/cython,ABcDexter\/cython,dahebolangkuan\/cython,madjar\/cython,hickford\/cython,hhsprings\/cython,acrispin\/cython,c-blake\/cython,roxyboy\/cython,encukou\/cython,achernet\/cython,achernet\/cython,andreasvc\/cython,JelleZijlstra\/cython,andreasvc\/cython,marscher\/cython,c-blake\/cython,fabianrost84\/cython,encukou\/cython,hickford\/cython,scoder\/cython,JelleZijlstra\/cython,acrispin\/cython,fabianrost84\/cython,ChristopherHogan\/cython,fperez\/cython,mrGeen\/cython,achernet\/cython,mrGeen\/cython,ABcDexter\/cython,da-woods\/cython,c-blake\/cython,c-blake\/cython,mrGeen\/cython,achernet\/cython,slonik-az\/cython,fabianrost84\/cython,da-woods\/cython,roxyboy\/cython,dahebolangkuan\/cython,acrispin\/cython,andreasvc\/cython,slonik-az\/cython,acrispin\/cython,encukou\/cython,ABcDexter\/cython,acrispin\/cython,hickford\/cython,fabianrost84\/cython,marscher\/cython,hhsprings\/cython,mcanthony\/cython,roxyboy\/cython,ChristopherHogan\/cython,hhsprings\/cython,hickford\/cython,dahebolangkuan\/cython,ABcDexter\/cython,cython\/cython,slonik-az\/cython,madjar\/cython,slonik-az\/cython,dahebolangkuan\/cython,hickford\/cython,madjar\/cython,fperez\/cython,mcanthony\/cython,encukou\/cython,fperez\/cython,ChristopherHogan\/cython,scoder\/cython,da-woods\/cython,slonik-az\/cython"} {"commit":"c23c77d453c9f84b14925bf0bd21d20746fb3f6d","old_file":"pyogi\/grid.pyx","new_file":"pyogi\/grid.pyx","old_contents":"\nEMPTY_PLAYER = ' '\nEMPTY_CSA = None\n\n\ncdef class Grid:\n\n '''Grid class\n\n Args\n -------------------\n which_player : optional (default = None)\n csa_piece : optional (default = None)\n '''\n def __init__(self, which_player=EMPTY_PLAYER, csa_piece=EMPTY_CSA):\n if which_player in [EMPTY_PLAYER, '+', '-']:\n self.which_player = which_player\n else:\n raise RuntimeError('Invalid which_player:', which_player)\n\n if csa_piece != EMPTY_CSA:\n self.koma = Koma(csa_piece)\n else:\n self.koma = EMPTY_CSA\n\n def __str__(self):\n if self.which_player != EMPTY_PLAYER and self.koma != EMPTY_CSA:\n return self.which_player + self.koma.csa\n else:\n return EMPTY_PLAYER + EMPTY_CSA\n\n cpdef is_empty(self):\n return self.which_player == EMPTY_PLAYER\n\n cpdef is_of_sente(self):\n return self.which_player == '+'\n\n cpdef reset(self):\n self.which_player = EMPTY_PLAYER\n self.koma = EMPTY_CSA\n","new_contents":"\nEMPTY_PLAYER = ' '\nEMPTY_CSA = None\n\n\ncdef class Grid:\n\n '''Grid class\n\n Args\n -------------------\n which_player : optional (default = None)\n csa_piece : optional (default = None)\n '''\n def __init__(self, which_player=EMPTY_PLAYER, csa_piece=EMPTY_CSA):\n if which_player in [EMPTY_PLAYER, '+', '-']:\n self.which_player = which_player\n else:\n raise RuntimeError('Invalid which_player:', which_player)\n\n if csa_piece != EMPTY_CSA:\n self.koma = Koma(csa_piece)\n else:\n self.koma = EMPTY_CSA\n\n def __str__(self):\n if self.which_player != EMPTY_PLAYER and self.koma != EMPTY_CSA:\n return self.which_player + self.koma.csa\n else:\n return ' '\n\n cpdef is_empty(self):\n return self.which_player == EMPTY_PLAYER\n\n cpdef is_of_sente(self):\n return self.which_player == '+'\n\n cpdef reset(self):\n self.which_player = EMPTY_PLAYER\n self.koma = EMPTY_CSA\n","subject":"Fix return value of Grid.__str__()","message":"Fix return value of Grid.__str__()\n","lang":"Cython","license":"mit","repos":"tosh1ki\/pyogi,tosh1ki\/pyogi"} {"commit":"65041cae15391099f01b6739e4d1d55c05a9e82a","old_file":"tests\/run\/cpp_classes.pyx","new_file":"tests\/run\/cpp_classes.pyx","old_contents":"cdef extern from \"shapes.h\" namespace shapes:\n\n cdef cppclass Shape:\n area()\n \n cdef cppclass Rectangle(Shape):\n int width\n int height\n __init__(int, int)\n \n cdef cppclass Square(Shape):\n int side\n __init__(int)\n\ncdef Rectangle *rect = new Rectangle(10, 20)\ncdef Square *sqr = new Square(15)\n\ndel rect, sqr\n","new_contents":"__doc__ = u\"\"\"\n >>> test_new_del()\n >>> test_rect_area(3, 4)\n 12\n >>> test_square_area(15)\n 225\n\"\"\"\n\ncdef extern from \"shapes.cpp\" namespace shapes:\n\n cdef cppclass Shape:\n float area()\n \n cdef cppclass Rectangle(Shape):\n int width\n int height\n __init__(int, int)\n \n cdef cppclass Square(Shape):\n int side\n __init__(int)\n\ndef test_new_del():\n cdef Rectangle *rect = new Rectangle(10, 20)\n cdef Square *sqr = new Square(15)\n del rect, sqr\n\ndef test_rect_area(w, h):\n cdef Rectangle *rect = new Rectangle(w, h)\n try:\n return rect.area()\n finally:\n del rect\n\ndef test_square_area(w):\n cdef Square *sqr = new Square(w)\n cdef Rectangle *rect = sqr\n try:\n return rect.area(), sqr.area()\n finally:\n del sqr\n\n","subject":"Expand and fix cpp tests","message":"Expand and fix cpp tests\n","lang":"Cython","license":"apache-2.0","repos":"bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu"} {"commit":"a5b26d417527a85e39ba2c762a6e44b3ae37863d","old_file":"src\/clients\/lib\/python\/cython_include\/xmmsutils.pxd","new_file":"src\/clients\/lib\/python\/cython_include\/xmmsutils.pxd","old_contents":"from cpython.unicode cimport PyUnicode_DecodeUTF8, PyUnicode_AsUTF8String\n\ncdef inline to_unicode(char *s):\n\ttry:\n\t\tns = PyUnicode_DecodeUTF8(s, len(s), NULL)\n\texcept:\n\t\tns = s\n\treturn ns\n\ncdef inline from_unicode(object o):\n\tif isinstance(o, unicode):\n\t\treturn PyUnicode_AsUTF8String(o)\n\telse:\n\t\treturn o\n","new_contents":"from cpython.unicode cimport PyUnicode_DecodeUTF8, PyUnicode_AsUTF8String\nfrom libc.string cimport const_char, strlen\n\ncdef inline to_unicode(const_char *s):\n\treturn PyUnicode_DecodeUTF8(s, strlen(s), \"replace\")\n\ncdef inline from_unicode(object o):\n\tif isinstance(o, unicode):\n\t\treturn PyUnicode_AsUTF8String(o)\n\telse:\n\t\treturn o\n","subject":"Fix string constness in to_unicode","message":"OTHER: Fix string constness in to_unicode\n","lang":"Cython","license":"lgpl-2.1","repos":"six600110\/xmms2,chrippa\/xmms2,theeternalsw0rd\/xmms2,theeternalsw0rd\/xmms2,theeternalsw0rd\/xmms2,krad-radio\/xmms2-krad,six600110\/xmms2,krad-radio\/xmms2-krad,theeternalsw0rd\/xmms2,chrippa\/xmms2,six600110\/xmms2,chrippa\/xmms2,six600110\/xmms2,chrippa\/xmms2,krad-radio\/xmms2-krad,six600110\/xmms2,chrippa\/xmms2,chrippa\/xmms2,six600110\/xmms2,krad-radio\/xmms2-krad,theeternalsw0rd\/xmms2,krad-radio\/xmms2-krad,krad-radio\/xmms2-krad,theeternalsw0rd\/xmms2"} {"commit":"a565fc046dfaea95568606af1d1a913692a6a4d7","old_file":"opencog\/cython\/opencog\/agent.pyx","new_file":"opencog\/cython\/opencog\/agent.pyx","old_contents":"# it'd be nice to define the type of atomspace but I can't get this working\nfrom opencog.cogserver cimport cAgent, stim_t, string\n\ncdef class MindAgent:\n # TODO add a pointer to the Agent C++ object so that calls to stimulate atoms\n # can be made (among other things)\n\n def __cinit__(self):\n pass\n\n property frequency:\n def __get__(self):\n return self.c_obj.frequency()\n def __set__(self,int f):\n self.c_obj.setFrequency(f)\n\n# These methods are not available until we have support for MindAgents running\n# continuously in their own threads\n# def start(self, AtomSpace atomspace):\n# pass\n\n# def end(self):\n# pass\n\n def run(self, atomspace):\n print \"Implement me in your MindAgent subclass: \" + atomspace\n\n\n","new_contents":"# it'd be nice to define the type of atomspace but I can't get this working\nfrom opencog.cogserver cimport cAgent, stim_t, string\n\nfrom opencog.atomspace cimport cHandle, Atom\n\ncdef class MindAgent:\n\n def __cinit__(self):\n pass\n\n property frequency:\n def __get__(self):\n return self.c_obj.frequency()\n def __set__(self,int f):\n self.c_obj.setFrequency(f)\n\n def stimulate_atom(self, Atom atom, stim_t amount):\n cdef cHandle ch\n ch = cHandle(atom.h.value())\n \n return self.c_obj.stimulateAtom(ch, amount)\n\n\n# These methods are not available until we have support for MindAgents running\n# continuously in their own threads\n# def start(self, AtomSpace atomspace):\n# pass\n\n# def end(self):\n# pass\n\n def run(self, atomspace):\n print \"Implement me in your MindAgent subclass: \" + atomspace\n\n\n","subject":"Add MindAgent::stimulateAtom to the python bindings","message":"Add MindAgent::stimulateAtom to the python bindings\n","lang":"Cython","license":"agpl-3.0","repos":"jlegendary\/opencog,Allend575\/opencog,sumitsourabh\/opencog,misgeatgit\/opencog,Tiggels\/opencog,printedheart\/opencog,andre-senna\/opencog,AmeBel\/opencog,ArvinPan\/atomspace,printedheart\/opencog,printedheart\/opencog,yantrabuddhi\/opencog,AmeBel\/atomspace,ArvinPan\/opencog,tim777z\/opencog,misgeatgit\/atomspace,gaapt\/opencog,roselleebarle04\/opencog,misgeatgit\/atomspace,yantrabuddhi\/opencog,virneo\/opencog,ceefour\/opencog,anitzkin\/opencog,andre-senna\/opencog,williampma\/atomspace,andre-senna\/opencog,roselleebarle04\/opencog,rTreutlein\/atomspace,ArvinPan\/opencog,ceefour\/atomspace,rohit12\/opencog,Selameab\/opencog,cosmoharrigan\/atomspace,rohit12\/opencog,jlegendary\/opencog,inflector\/opencog,cosmoharrigan\/opencog,kim135797531\/opencog,ArvinPan\/opencog,MarcosPividori\/atomspace,MarcosPividori\/atomspace,gaapt\/opencog,gavrieltal\/opencog,gaapt\/opencog,AmeBel\/opencog,gavrieltal\/opencog,jswiergo\/atomspace,Allend575\/opencog,gavrieltal\/opencog,prateeksaxena2809\/opencog,jswiergo\/atomspace,rodsol\/atomspace,kinoc\/opencog,AmeBel\/atomspace,sumitsourabh\/opencog,virneo\/atomspace,kim135797531\/opencog,ruiting\/opencog,roselleebarle04\/opencog,prateeksaxena2809\/opencog,printedheart\/atomspace,eddiemonroe\/opencog,jswiergo\/atomspace,Selameab\/atomspace,cosmoharrigan\/atomspace,rodsol\/opencog,anitzkin\/opencog,kinoc\/opencog,anitzkin\/opencog,jlegendary\/opencog,virneo\/opencog,gaapt\/opencog,inflector\/atomspace,tim777z\/opencog,inflector\/opencog,kim135797531\/opencog,sumitsourabh\/opencog,UIKit0\/atomspace,prateeksaxena2809\/opencog,ArvinPan\/atomspace,anitzkin\/opencog,rohit12\/opencog,AmeBel\/atomspace,ruiting\/opencog,virneo\/opencog,williampma\/atomspace,ruiting\/opencog,kim135797531\/opencog,shujingke\/opencog,misgeatgit\/opencog,prateeksaxena2809\/opencog,Selameab\/opencog,rodsol\/opencog,jlegendary\/opencog,yantrabuddhi\/atomspace,zhaozengguang\/opencog,eddiemonroe\/opencog,rodsol\/atomspace,rohit12\/atomspace,AmeBel\/opencog,virneo\/atomspace,sanuj\/opencog,gavrieltal\/opencog,eddiemonroe\/opencog,yantrabuddhi\/atomspace,misgeatgit\/atomspace,rTreutlein\/atomspace,kim135797531\/opencog,printedheart\/opencog,jlegendary\/opencog,andre-senna\/opencog,printedheart\/atomspace,yantrabuddhi\/atomspace,Allend575\/opencog,andre-senna\/opencog,Allend575\/opencog,TheNameIsNigel\/opencog,iAMr00t\/opencog,ruiting\/opencog,prateeksaxena2809\/opencog,rodsol\/opencog,Selameab\/atomspace,misgeatgit\/opencog,ArvinPan\/atomspace,kim135797531\/opencog,AmeBel\/opencog,virneo\/atomspace,inflector\/opencog,rohit12\/opencog,gaapt\/opencog,Tiggels\/opencog,inflector\/opencog,andre-senna\/opencog,shujingke\/opencog,kinoc\/opencog,Tiggels\/opencog,ceefour\/opencog,williampma\/opencog,kinoc\/opencog,williampma\/opencog,ceefour\/atomspace,sumitsourabh\/opencog,eddiemonroe\/atomspace,rohit12\/opencog,cosmoharrigan\/atomspace,printedheart\/opencog,williampma\/opencog,kinoc\/opencog,ceefour\/atomspace,yantrabuddhi\/opencog,gaapt\/opencog,cosmoharrigan\/opencog,eddiemonroe\/opencog,inflector\/opencog,inflector\/atomspace,UIKit0\/atomspace,AmeBel\/atomspace,gavrieltal\/opencog,zhaozengguang\/opencog,kinoc\/opencog,iAMr00t\/opencog,roselleebarle04\/opencog,rodsol\/opencog,misgeatgit\/opencog,williampma\/atomspace,ceefour\/opencog,yantrabuddhi\/opencog,ceefour\/opencog,iAMr00t\/opencog,TheNameIsNigel\/opencog,yantrabuddhi\/opencog,Selameab\/opencog,sanuj\/opencog,Selameab\/atomspace,rodsol\/atomspace,Tiggels\/opencog,tim777z\/opencog,eddiemonroe\/atomspace,cosmoharrigan\/opencog,rTreutlein\/atomspace,tim777z\/opencog,rodsol\/opencog,misgeatgit\/atomspace,AmeBel\/atomspace,ruiting\/opencog,TheNameIsNigel\/opencog,zhaozengguang\/opencog,sanuj\/opencog,rodsol\/opencog,ArvinPan\/atomspace,eddiemonroe\/opencog,Allend575\/opencog,williampma\/atomspace,ceefour\/opencog,kinoc\/opencog,virneo\/atomspace,UIKit0\/atomspace,AmeBel\/opencog,shujingke\/opencog,jlegendary\/opencog,MarcosPividori\/atomspace,sumitsourabh\/opencog,williampma\/opencog,Allend575\/opencog,misgeatgit\/opencog,sanuj\/opencog,misgeatgit\/opencog,eddiemonroe\/opencog,sanuj\/opencog,zhaozengguang\/opencog,misgeatgit\/opencog,eddiemonroe\/atomspace,printedheart\/atomspace,rTreutlein\/atomspace,ArvinPan\/opencog,rohit12\/atomspace,ruiting\/opencog,shujingke\/opencog,cosmoharrigan\/atomspace,TheNameIsNigel\/opencog,sanuj\/opencog,UIKit0\/atomspace,AmeBel\/opencog,eddiemonroe\/atomspace,yantrabuddhi\/opencog,printedheart\/opencog,virneo\/opencog,Tiggels\/opencog,eddiemonroe\/opencog,anitzkin\/opencog,AmeBel\/opencog,Tiggels\/opencog,misgeatgit\/opencog,kim135797531\/opencog,iAMr00t\/opencog,inflector\/opencog,shujingke\/opencog,sumitsourabh\/opencog,roselleebarle04\/opencog,eddiemonroe\/atomspace,Selameab\/atomspace,rohit12\/atomspace,yantrabuddhi\/atomspace,cosmoharrigan\/opencog,gavrieltal\/opencog,prateeksaxena2809\/opencog,anitzkin\/opencog,zhaozengguang\/opencog,misgeatgit\/opencog,ArvinPan\/opencog,rohit12\/atomspace,ceefour\/opencog,yantrabuddhi\/opencog,prateeksaxena2809\/opencog,TheNameIsNigel\/opencog,inflector\/opencog,Selameab\/opencog,rTreutlein\/atomspace,misgeatgit\/atomspace,gaapt\/opencog,cosmoharrigan\/opencog,jlegendary\/opencog,inflector\/atomspace,jswiergo\/atomspace,ruiting\/opencog,printedheart\/atomspace,andre-senna\/opencog,virneo\/opencog,tim777z\/opencog,virneo\/opencog,anitzkin\/opencog,shujingke\/opencog,Selameab\/opencog,inflector\/atomspace,sumitsourabh\/opencog,inflector\/atomspace,TheNameIsNigel\/opencog,shujingke\/opencog,cosmoharrigan\/opencog,virneo\/opencog,Selameab\/opencog,Allend575\/opencog,inflector\/opencog,yantrabuddhi\/atomspace,MarcosPividori\/atomspace,rodsol\/atomspace,williampma\/opencog,roselleebarle04\/opencog,zhaozengguang\/opencog,ArvinPan\/opencog,williampma\/opencog,tim777z\/opencog,roselleebarle04\/opencog,ceefour\/atomspace,gavrieltal\/opencog,rohit12\/opencog,ceefour\/opencog,iAMr00t\/opencog,iAMr00t\/opencog"} {"commit":"30d4c6eb9b3778abe2b9ba568467ca16b7c084fd","old_file":"pyinform\/pyinform.pyx","new_file":"pyinform\/pyinform.pyx","old_contents":"cimport cython.array\ncimport numpy\nimport numpy\n\ncdef extern from \"stdint.h\":\n ctypedef unsigned long uint64_t\n\ncdef extern from \"inform\/time_series.h\":\n double inform_active_info(const uint64_t* series, size_t n, uint64_t base, uint64_t k)\n\ndef activeinfo(xs, uint64_t k, uint64_t b = 0):\n if not xs:\n raise ValueError(\"active information not defined on empty containers\")\n\n if b < 2:\n b = max(2,max(xs)+1)\n\n cdef uint64_t [:] ys = numpy.asarray(xs, dtype=numpy.uint64)\n return inform_active_info(&ys[0], len(xs), b, k)\n","new_contents":"cimport cython.array\ncimport numpy\nimport numpy\n\ncdef extern from \"stdint.h\":\n ctypedef unsigned long uint64_t\n\ncdef extern from \"inform\/time_series.h\":\n double inform_active_info(const uint64_t* series, size_t n, uint64_t base, uint64_t k)\n\ndef activeinfo(xs, uint64_t k, uint64_t b = 0):\n if len(xs) == 0:\n raise ValueError(\"active information not defined on empty containers\")\n\n if b < 2:\n b = max(2,max(xs)+1)\n\n cdef uint64_t [:] ys = numpy.asarray(xs, dtype=numpy.uint64)\n return inform_active_info(&ys[0], len(xs), b, k)\n","subject":"Check activeinfo inputs for empty arrays","message":"Check activeinfo inputs for empty arrays\n\nThe prior check, `not xs`, only works for sequence-like objects.\nUnfortunately numpy arrays are not sequences, so we have to\nactually check the length.\n","lang":"Cython","license":"mit","repos":"ELIFE-ASU\/PyInform"} {"commit":"4d676ccfe3287c4378dc8ba7b990c6178894bb10","old_file":"tests\/errors\/e_bufaccess.pyx","new_file":"tests\/errors\/e_bufaccess.pyx","old_contents":"cdef object[int] buf\ncdef class A:\n cdef object[int] buf\n\ndef f():\n cdef object[fakeoption=True] buf1\n cdef object[int, -1] buf1b \n cdef object[ndim=-1] buf2\n cdef object[int, 'a'] buf3\n cdef object[int,2,3,4,5,6] buf4\n cdef object[int, 2, 'foo'] buf5\n cdef object[int, 2, well] buf6\n\n_ERRORS = u\"\"\"\n1:17: Buffer types only allowed as function local variables\n3:21: Buffer types only allowed as function local variables\n6:31: \"fakeoption\" is not a buffer option\n\"\"\"\n#TODO:\n#7:22: \"ndim\" must be non-negative\n#8:15: \"dtype\" missing\n#9:21: \"ndim\" must be an integer\n#10:15: Too many buffer options\n#11:24: Only allowed buffer modes are \"full\" or \"strided\" (as a compile-time string)\n#12:28: Only allowed buffer modes are \"full\" or \"strided\" (as a compile-time string)\n#\"\"\"\n\n","new_contents":"cdef object[int] buf\ncdef class A:\n cdef object[int] buf\n\ndef f():\n cdef object[fakeoption=True] buf1\n cdef object[int, -1] buf1b \n cdef object[ndim=-1] buf2\n cdef object[int, 'a'] buf3\n cdef object[int,2,3,4,5,6] buf4\n cdef object[int, 2, 'foo'] buf5\n cdef object[int, 2, well] buf6\n cdef object[x, 1] buf0\n\n_ERRORS = u\"\"\"\n1:17: Buffer types only allowed as function local variables\n3:21: Buffer types only allowed as function local variables\n6:31: \"fakeoption\" is not a buffer option\n\"\"\"\n#TODO:\n#7:22: \"ndim\" must be non-negative\n#8:15: \"dtype\" missing\n#9:21: \"ndim\" must be an integer\n#10:15: Too many buffer options\n#11:24: Only allowed buffer modes are \"full\" or \"strided\" (as a compile-time string)\n#12:28: Only allowed buffer modes are \"full\" or \"strided\" (as a compile-time string)\n#13:17: Invalid type.\n#\"\"\"\n\n","subject":"Test for bad buffer types.","message":"Test for bad buffer types.\n","lang":"Cython","license":"apache-2.0","repos":"hickford\/cython,ABcDexter\/cython,andreasvc\/cython,JelleZijlstra\/cython,hickford\/cython,larsmans\/cython,dahebolangkuan\/cython,mrGeen\/cython,fperez\/cython,larsmans\/cython,andreasvc\/cython,marscher\/cython,ABcDexter\/cython,ABcDexter\/cython,slonik-az\/cython,cython\/cython,acrispin\/cython,scoder\/cython,achernet\/cython,hpfem\/cython,c-blake\/cython,fabianrost84\/cython,slonik-az\/cython,mcanthony\/cython,JelleZijlstra\/cython,larsmans\/cython,encukou\/cython,madjar\/cython,hickford\/cython,mrGeen\/cython,slonik-az\/cython,roxyboy\/cython,mcanthony\/cython,hhsprings\/cython,acrispin\/cython,ChristopherHogan\/cython,dahebolangkuan\/cython,acrispin\/cython,ABcDexter\/cython,larsmans\/cython,rguillebert\/CythonCTypesBackend,marscher\/cython,hickford\/cython,dahebolangkuan\/cython,bzzzz\/cython,rguillebert\/CythonCTypesBackend,encukou\/cython,dahebolangkuan\/cython,madjar\/cython,hickford\/cython,fabianrost84\/cython,cython\/cython,acrispin\/cython,achernet\/cython,marscher\/cython,c-blake\/cython,andreasvc\/cython,madjar\/cython,hhsprings\/cython,scoder\/cython,marscher\/cython,mcanthony\/cython,achernet\/cython,encukou\/cython,scoder\/cython,roxyboy\/cython,fperez\/cython,scoder\/cython,ABcDexter\/cython,rguillebert\/CythonCTypesBackend,larsmans\/cython,JelleZijlstra\/cython,JelleZijlstra\/cython,marscher\/cython,ChristopherHogan\/cython,hpfem\/cython,mrGeen\/cython,encukou\/cython,dahebolangkuan\/cython,rguillebert\/CythonCTypesBackend,fabianrost84\/cython,mrGeen\/cython,hhsprings\/cython,ChristopherHogan\/cython,fabianrost84\/cython,acrispin\/cython,mrGeen\/cython,fperez\/cython,cython\/cython,c-blake\/cython,achernet\/cython,roxyboy\/cython,hpfem\/cython,JelleZijlstra\/cython,da-woods\/cython,mcanthony\/cython,hhsprings\/cython,roxyboy\/cython,slonik-az\/cython,fabianrost84\/cython,da-woods\/cython,madjar\/cython,madjar\/cython,mcanthony\/cython,c-blake\/cython,achernet\/cython,andreasvc\/cython,bzzzz\/cython,encukou\/cython,bzzzz\/cython,roxyboy\/cython,hhsprings\/cython,da-woods\/cython,fperez\/cython,da-woods\/cython,c-blake\/cython,hpfem\/cython,cython\/cython,hpfem\/cython,fperez\/cython,andreasvc\/cython,bzzzz\/cython,slonik-az\/cython"} {"commit":"3c6ce44c7b0434d9000dae25a2af8326714b6bc4","old_file":"lineprofile\/ln_likes.pxd","new_file":"lineprofile\/ln_likes.pxd","old_contents":"\"A bunch of improper (not normalized) prior distributions\"\nfrom libc.math cimport log, fabs\n\ncdef inline double ln_normal(double value, double mean, double stddev):\n cdef double tmp = (value - mean) \/ stddev\n tmp *= tmp\n return -0.5 * tmp - log(stddev)\n\ncdef inline double ln_laplace(double value, double mean, double stddev):\n return -1.0 * fabs(value - mean) \/ stddev - log(stddev)\n\ncdef inline double ln_log(double value):\n return -1.0 * log(value)\n\ncdef inline double ln_gamma(double value, double k, double theta):\n return (k - 1.0) * log(value) - value \/ theta\n\ncdef inline double ln_beta(double value, double p, double q):\n return (p - 1.0) * log(value) + (q - 1.0) * log(1 - value)\n","new_contents":"\"A bunch of improper (not normalized) prior distributions\"\nfrom libc.math cimport log, fabs, sqrt, exp, M_PI\n\ncdef inline double ln_normal(double value, double mean, double stddev):\n cdef double tmp = (value - mean) \/ stddev\n tmp *= tmp\n return -0.5 * tmp - log(stddev)\n\ncdef inline double ln_laplace(double value, double mean, double stddev):\n return -1.0 * fabs(value - mean) \/ stddev - log(stddev)\n\ncdef inline double ln_log(double value):\n return -1.0 * log(value)\n\ncdef inline double ln_gamma(double value, double k, double theta):\n return (k - 1.0) * log(value) - value \/ theta\n\ncdef inline double ln_beta(double value, double p, double q):\n return (p - 1.0) * log(value) + (q - 1.0) * log(1 - value)\n\ncdef inline double normal(double value, double mean, double stddev):\n cdef double tmp = (value - mean) \/ stddev\n tmp *= tmp\n return exp(-0.5 * tmp) \/ sqrt(2. * M_PI) \/ stddev\n","subject":"Add non-logarithmic normal for mixture model","message":"Add non-logarithmic normal for mixture model\n","lang":"Cython","license":"mit","repos":"lfloeer\/hiprofile"} {"commit":"dfff744138e02f7bbc8a45cef28eef1a5a999c0d","old_file":"docs\/examples\/userguide\/external_C_code\/platform_adaptation.pyx","new_file":"docs\/examples\/userguide\/external_C_code\/platform_adaptation.pyx","old_contents":"cdef extern from *:\n \"\"\"\n #if defined(WIN32) || defined(MS_WINDOWS)\n #include \"windows.h\"\n #define myapp_sleep(m) Sleep(m)\n #else\n #include \n #define myapp_sleep(m) ((void) usleep((m) * 1000))\n #endif\n \"\"\"\n # using \"myapp_\" prefix in the C code to prevent C naming conflicts\n void msleep \"myapp_sleep\"(int milliseconds) nogil\n\nmsleep(milliseconds=1)\n","new_contents":"cdef extern from *:\n \"\"\"\n #if defined(WIN32) || defined(MS_WINDOWS)\n #include \"synchapi.h\"\n #define myapp_sleep(m) Sleep(m)\n #else\n #include \n #define myapp_sleep(m) ((void) usleep((m) * 1000))\n #endif\n \"\"\"\n # using \"myapp_\" prefix in the C code to prevent C naming conflicts\n void msleep \"myapp_sleep\"(int milliseconds) nogil\n\nmsleep(milliseconds=1)\n","subject":"Fix test compile failure in MSVC.","message":"Fix test compile failure in MSVC.\n","lang":"Cython","license":"apache-2.0","repos":"scoder\/cython,da-woods\/cython,da-woods\/cython,cython\/cython,scoder\/cython,cython\/cython,cython\/cython,scoder\/cython,da-woods\/cython,scoder\/cython,cython\/cython,da-woods\/cython"} {"commit":"30f72282479d024a97f8d91a5b7bf64450becd86","old_file":"Cython\/Includes\/libcpp\/utility.pxd","new_file":"Cython\/Includes\/libcpp\/utility.pxd","old_contents":"cdef extern from \"\" namespace \"std\" nogil:\n cdef cppclass pair[T, U]:\n ctypedef T first_type\n ctypedef U second_type\n T first\n U second\n pair() except +\n pair(pair&) except +\n pair(T&, U&) except +\n bint operator==(pair&, pair&)\n bint operator!=(pair&, pair&)\n bint operator<(pair&, pair&)\n bint operator>(pair&, pair&)\n bint operator<=(pair&, pair&)\n bint operator>=(pair&, pair&)\n\ncdef extern from * namespace \"cython_std\" nogil:\n \"\"\"\n #if __cplusplus > 199711L\n #include \n\n namespace cython_std {\n template typename std::remove_reference::type&& move(T& t) noexcept { return std::move(t); }\n template typename std::remove_reference::type&& move(T&& t) noexcept { return std::move(t); }\n }\n\n #endif\n \"\"\"\n cdef T move[T](T)\n","new_contents":"cdef extern from \"\" namespace \"std\" nogil:\n cdef cppclass pair[T, U]:\n ctypedef T first_type\n ctypedef U second_type\n T first\n U second\n pair() except +\n pair(pair&) except +\n pair(T&, U&) except +\n bint operator==(pair&, pair&)\n bint operator!=(pair&, pair&)\n bint operator<(pair&, pair&)\n bint operator>(pair&, pair&)\n bint operator<=(pair&, pair&)\n bint operator>=(pair&, pair&)\n\ncdef extern from * namespace \"cython_std\" nogil:\n \"\"\"\n #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)\n \/\/ move should be defined for these versions of MSVC, but __cplusplus isn't set usefully\n #include \n\n namespace cython_std {\n template typename std::remove_reference::type&& move(T& t) noexcept { return std::move(t); }\n template typename std::remove_reference::type&& move(T&& t) noexcept { return std::move(t); }\n }\n\n #endif\n \"\"\"\n cdef T move[T](T)\n","subject":"Enable usage of std::move() only in the supported versions of MSVC (GH-4191)","message":"Enable usage of std::move() only in the supported versions of MSVC (GH-4191)\n\n","lang":"Cython","license":"apache-2.0","repos":"scoder\/cython,da-woods\/cython,scoder\/cython,da-woods\/cython,scoder\/cython,cython\/cython,da-woods\/cython,cython\/cython,scoder\/cython,cython\/cython,da-woods\/cython,cython\/cython"} {"commit":"8a0bd3a24e249bb5e09792c4fd717dffb6467fd2","old_file":"rocksdb\/backup.pxd","new_file":"rocksdb\/backup.pxd","old_contents":"from libcpp cimport bool as cpp_bool\nfrom libcpp.string cimport string\nfrom libcpp.vector cimport vector\nfrom libc.stdint cimport uint32_t\nfrom libc.stdint cimport int64_t\nfrom libc.stdint cimport uint64_t\n\nfrom status cimport Status\nfrom db cimport DB\nfrom env cimport Env\n\ncdef extern from \"utilities\/backupable_db.h\" namespace \"rocksdb\":\n ctypedef uint32_t BackupID\n\n cdef cppclass BackupableDBOptions:\n BackupableDBOptions(const string& backup_dir)\n\n cdef struct BackupInfo:\n BackupID backup_id\n int64_t timestamp\n uint64_t size\n\n cdef cppclass BackupEngine:\n Status CreateNewBackup(DB*, cpp_bool) nogil except+\n Status PurgeOldBackups(uint32_t) nogil except+\n Status DeleteBackup(BackupID) nogil except+\n void StopBackup() nogil except+\n void GetBackupInfo(vector[BackupInfo]*) nogil except+\n Status RestoreDBFromBackup(BackupID, string&, string&) nogil except+\n Status RestoreDBFromLatestBackup(string&, string&) nogil except+\n\n cdef BackupEngine* NewBackupEngine \"rocksdb::BackupEngine::NewBackupEngine\"(\n Env*,\n BackupableDBOptions&)\n","new_contents":"from libcpp cimport bool as cpp_bool\nfrom libcpp.string cimport string\nfrom libcpp.vector cimport vector\nfrom libc.stdint cimport uint32_t\nfrom libc.stdint cimport int64_t\nfrom libc.stdint cimport uint64_t\n\nfrom status cimport Status\nfrom db cimport DB\nfrom env cimport Env\n\ncdef extern from \"rocksdb\/utilities\/backupable_db.h\" namespace \"rocksdb\":\n ctypedef uint32_t BackupID\n\n cdef cppclass BackupableDBOptions:\n BackupableDBOptions(const string& backup_dir)\n\n cdef struct BackupInfo:\n BackupID backup_id\n int64_t timestamp\n uint64_t size\n\n cdef cppclass BackupEngine:\n Status CreateNewBackup(DB*, cpp_bool) nogil except+\n Status PurgeOldBackups(uint32_t) nogil except+\n Status DeleteBackup(BackupID) nogil except+\n void StopBackup() nogil except+\n void GetBackupInfo(vector[BackupInfo]*) nogil except+\n Status RestoreDBFromBackup(BackupID, string&, string&) nogil except+\n Status RestoreDBFromLatestBackup(string&, string&) nogil except+\n\n cdef BackupEngine* NewBackupEngine \"rocksdb::BackupEngine::NewBackupEngine\"(\n Env*,\n BackupableDBOptions&)\n","subject":"Change include path and get rid of the warning.","message":"Change include path and get rid of the warning.\n","lang":"Cython","license":"bsd-3-clause","repos":"squidsrc\/python-rocksdb,squidsrc\/python-rocksdb,stephan-hof\/pyrocksdb,stephan-hof\/pyrocksdb"} {"commit":"28c35f432f73b0b710cc5f6a823e11bca53265b0","old_file":"Cython\/Includes\/cpython\/float.pxd","new_file":"Cython\/Includes\/cpython\/float.pxd","old_contents":"cdef extern from \"Python.h\":\n\n ############################################################################\n # 7.2.3\n ############################################################################\n # PyFloatObject\n #\n # This subtype of PyObject represents a Python floating point object.\n\n # PyTypeObject PyFloat_Type\n #\n # This instance of PyTypeObject represents the Python floating\n # point type. This is the same object as float and\n # types.FloatType.\n\n bint PyFloat_Check(object p)\n # Return true if its argument is a PyFloatObject or a subtype of\n # PyFloatObject.\n\n bint PyFloat_CheckExact(object p)\n # Return true if its argument is a PyFloatObject, but not a\n # subtype of PyFloatObject.\n\n object PyFloat_FromString(object str, char **pend)\n # Return value: New reference.\n # Create a PyFloatObject object based on the string value in str,\n # or NULL on failure. The pend argument is ignored. It remains\n # only for backward compatibility.\n\n object PyFloat_FromDouble(double v)\n # Return value: New reference.\n # Create a PyFloatObject object from v, or NULL on failure.\n\n double PyFloat_AsDouble(object pyfloat) except? -1\n # Return a C double representation of the contents of pyfloat.\n\n double PyFloat_AS_DOUBLE(object pyfloat)\n # Return a C double representation of the contents of pyfloat, but\n # without error checking.\n","new_contents":"cdef extern from \"Python.h\":\n \"\"\"\n #if PY_MAJOR_VERSION >= 3\n #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj)\n #else\n #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL)\n #endif\n \"\"\"\n\n ############################################################################\n # 7.2.3\n ############################################################################\n # PyFloatObject\n #\n # This subtype of PyObject represents a Python floating point object.\n\n # PyTypeObject PyFloat_Type\n #\n # This instance of PyTypeObject represents the Python floating\n # point type. This is the same object as float and\n # types.FloatType.\n\n bint PyFloat_Check(object p)\n # Return true if its argument is a PyFloatObject or a subtype of\n # PyFloatObject.\n\n bint PyFloat_CheckExact(object p)\n # Return true if its argument is a PyFloatObject, but not a\n # subtype of PyFloatObject.\n\n object PyFloat_FromString \"__Pyx_PyFloat_FromString\" (object str)\n # Return value: New reference.\n # Create a PyFloatObject object based on the string value in str,\n # or NULL on failure. The pend argument is ignored. It remains\n # only for backward compatibility.\n\n object PyFloat_FromDouble(double v)\n # Return value: New reference.\n # Create a PyFloatObject object from v, or NULL on failure.\n\n double PyFloat_AsDouble(object pyfloat) except? -1\n # Return a C double representation of the contents of pyfloat.\n\n double PyFloat_AS_DOUBLE(object pyfloat)\n # Return a C double representation of the contents of pyfloat, but\n # without error checking.\n","subject":"Change the declaration of PyFloat_FromString to the Py3 signature and provide a fallback for Py2.","message":"Change the declaration of PyFloat_FromString to the Py3 signature and provide a fallback for Py2.\n\nCloses https:\/\/github.com\/cython\/cython\/issues\/3909\n","lang":"Cython","license":"apache-2.0","repos":"scoder\/cython,cython\/cython,da-woods\/cython,scoder\/cython,cython\/cython,da-woods\/cython,cython\/cython,scoder\/cython,da-woods\/cython,da-woods\/cython,scoder\/cython,cython\/cython"} {"commit":"bda7316893be08045b3164cd3d0b9535c1319145","old_file":"python\/cython\/PyVersion.pyx","new_file":"python\/cython\/PyVersion.pyx","old_contents":"#\/*##########################################################################\n#\n# The fisx library for X-Ray Fluorescence\n#\n# Copyright (c) 2014-2016 European Synchrotron Radiation Facility\n#\n# This file is part of the fisx X-ray developed by V.A. Sole\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n#\n#############################################################################*\/\ncimport cython\n\n#from libcpp.string cimport string as std_string\n\nfrom Version cimport fisxVersion as _fisxVersion\n\ndef fisxVersion():\n return _fisxVersion()\n","new_contents":"#\/*##########################################################################\n#\n# The fisx library for X-Ray Fluorescence\n#\n# Copyright (c) 2014-2016 European Synchrotron Radiation Facility\n#\n# This file is part of the fisx X-ray developed by V.A. Sole\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n#\n#############################################################################*\/\ncimport cython\n\n#from libcpp.string cimport string as std_string\n\nfrom Version cimport fisxVersion as _fisxVersion\n\ndef fisxVersion():\n return toString(_fisxVersion())\n","subject":"Return as string and not as bytes.","message":"Return as string and not as bytes.\n","lang":"Cython","license":"mit","repos":"vasole\/fisx,vasole\/fisx,vasole\/fisx,vasole\/fisx,vasole\/fisx"} {"commit":"a0c693354c56b2defe125da1751f7b5fed79b8f1","old_file":"tests\/compile\/cpp_structs.pyx","new_file":"tests\/compile\/cpp_structs.pyx","old_contents":"# tag: cpp\n# mode: compile\n\ncdef extern from \"point.h\" namespace \"geometry\":\n\n cdef struct Point:\n double x\n double y\n int color\n\ncdef Point p = Point(0.0, 0.0, 0)\nthe_point = p\n","new_contents":"# tag: cpp\n# mode: compile\n\nfrom cython.view import array\n\ncdef extern from \"point.h\" namespace \"geometry\":\n\n cdef struct Point:\n double x\n double y\n int color\n\ncdef Point p = Point(0.0, 0.0, 0)\nthe_point = p\n\ncdef Point[::1] ps = array((10,), itemsize=sizeof(Point), format='ddi')\n","subject":"Add a test for namespaced struct with memoryview","message":"Add a test for namespaced struct with memoryview","lang":"Cython","license":"apache-2.0","repos":"fabianrost84\/cython,c-blake\/cython,da-woods\/cython,scoder\/cython,ChristopherHogan\/cython,fabianrost84\/cython,c-blake\/cython,ChristopherHogan\/cython,fabianrost84\/cython,cython\/cython,c-blake\/cython,da-woods\/cython,da-woods\/cython,cython\/cython,scoder\/cython,ChristopherHogan\/cython,da-woods\/cython,fabianrost84\/cython,scoder\/cython,fabianrost84\/cython,cython\/cython,c-blake\/cython,scoder\/cython,cython\/cython,c-blake\/cython"} {"commit":"621cd056fbf02efe91ffd029886476dc38bbb409","old_file":"tests\/compile\/cpp_structs.pyx","new_file":"tests\/compile\/cpp_structs.pyx","old_contents":"# tag: cpp\n# mode: compile\n\ncdef extern from \"point.h\" namespace \"geometry\":\n\n cdef struct Point:\n double x\n double y\n int color\n\ncdef Point p = Point(0.0, 0.0, 0)\nthe_point = p\n","new_contents":"# tag: cpp\n# mode: compile\n\nfrom cython.view import array\n\ncdef extern from \"point.h\" namespace \"geometry\":\n\n cdef struct Point:\n double x\n double y\n int color\n\ncdef Point p = Point(0.0, 0.0, 0)\nthe_point = p\n\ncdef Point[::1] ps = array((10,), itemsize=sizeof(Point), format='ddi')\n","subject":"Add a test for namespaced struct with memoryview","message":"Add a test for namespaced struct with memoryview\n","lang":"Cython","license":"apache-2.0","repos":"fabianrost84\/cython,scoder\/cython,fabianrost84\/cython,fabianrost84\/cython,ChristopherHogan\/cython,da-woods\/cython,scoder\/cython,ChristopherHogan\/cython,c-blake\/cython,da-woods\/cython,c-blake\/cython,c-blake\/cython,da-woods\/cython,cython\/cython,ChristopherHogan\/cython,cython\/cython,cython\/cython,c-blake\/cython,scoder\/cython,scoder\/cython,cython\/cython,fabianrost84\/cython,c-blake\/cython,fabianrost84\/cython,da-woods\/cython"} {"commit":"7cccaa06ad69a1394458837f60a6bb5e89e86597","old_file":"tests\/errors\/w_uninitialized_del.pyx","new_file":"tests\/errors\/w_uninitialized_del.pyx","old_contents":"# cython: warn.maybe_uninitialized=True\n# mode: error\n# tag: werror\n\ndef foo(x):\n a = 1\n del a, b\n b = 2\n return a, b\n\n_ERRORS = \"\"\"\n7:9: Deletion of non-Python, non-C++ object\n7:12: local variable 'b' referenced before assignment\n7:12: Deletion of non-Python, non-C++ object\n9:12: local variable 'a' referenced before assignment\n\"\"\"\n","new_contents":"# cython: warn.maybe_uninitialized=True\n# mode: error\n# tag: werror\n\ndef foo(x):\n a = 1\n del a, b\n b = 2\n return a, b\n\n_ERRORS = \"\"\"\n7:12: local variable 'b' referenced before assignment\n9:12: local variable 'a' referenced before assignment\n\"\"\"\n","subject":"Fix w_uninitilized_del testcase, now inferred as python object","message":"Fix w_uninitilized_del testcase, now inferred as python object\n","lang":"Cython","license":"apache-2.0","repos":"encukou\/cython,madjar\/cython,slonik-az\/cython,achernet\/cython,fabianrost84\/cython,ABcDexter\/cython,roxyboy\/cython,mcanthony\/cython,scoder\/cython,slonik-az\/cython,hhsprings\/cython,dahebolangkuan\/cython,larsmans\/cython,marscher\/cython,ChristopherHogan\/cython,dahebolangkuan\/cython,hhsprings\/cython,acrispin\/cython,acrispin\/cython,andreasvc\/cython,da-woods\/cython,hickford\/cython,hhsprings\/cython,ABcDexter\/cython,marscher\/cython,hickford\/cython,da-woods\/cython,fperez\/cython,andreasvc\/cython,JelleZijlstra\/cython,c-blake\/cython,cython\/cython,mrGeen\/cython,JelleZijlstra\/cython,achernet\/cython,roxyboy\/cython,larsmans\/cython,roxyboy\/cython,c-blake\/cython,marscher\/cython,JelleZijlstra\/cython,andreasvc\/cython,slonik-az\/cython,dahebolangkuan\/cython,acrispin\/cython,acrispin\/cython,larsmans\/cython,roxyboy\/cython,madjar\/cython,dahebolangkuan\/cython,da-woods\/cython,fperez\/cython,slonik-az\/cython,mcanthony\/cython,larsmans\/cython,andreasvc\/cython,fabianrost84\/cython,madjar\/cython,madjar\/cython,scoder\/cython,scoder\/cython,c-blake\/cython,hhsprings\/cython,slonik-az\/cython,ABcDexter\/cython,cython\/cython,achernet\/cython,mcanthony\/cython,c-blake\/cython,encukou\/cython,fabianrost84\/cython,mcanthony\/cython,hickford\/cython,encukou\/cython,fabianrost84\/cython,fperez\/cython,encukou\/cython,cython\/cython,scoder\/cython,ABcDexter\/cython,achernet\/cython,achernet\/cython,da-woods\/cython,fperez\/cython,mrGeen\/cython,madjar\/cython,andreasvc\/cython,hhsprings\/cython,ChristopherHogan\/cython,mrGeen\/cython,hickford\/cython,JelleZijlstra\/cython,marscher\/cython,marscher\/cython,ChristopherHogan\/cython,encukou\/cython,c-blake\/cython,hickford\/cython,mrGeen\/cython,fabianrost84\/cython,roxyboy\/cython,fperez\/cython,JelleZijlstra\/cython,dahebolangkuan\/cython,cython\/cython,larsmans\/cython,ABcDexter\/cython,acrispin\/cython,mrGeen\/cython,mcanthony\/cython"} {"commit":"5750946c3e86771d9291560414864fd41fc7e674","old_file":"docs\/examples\/userguide\/language_basics\/open_file.pyx","new_file":"docs\/examples\/userguide\/language_basics\/open_file.pyx","old_contents":"from libc.stdio cimport FILE, fopen\r\nfrom libc.stdlib cimport malloc, free\r\nfrom cpython.exc cimport PyErr_SetFromErrnoWithFilenameObject\r\n\r\ndef open_file():\r\n cdef FILE* p\r\n p = fopen(\"spam.txt\", \"r\")\r\n if p is NULL:\r\n PyErr_SetFromErrnoWithFilenameObject(OSError, \"spam.txt\")\r\n ...\r\n\r\n\r\ndef allocating_memory(number=10):\r\n cdef double *my_array = malloc(number * sizeof(double))\r\n if not my_array:\r\n raise MemoryError()\r\n ...\r\n free(my_array)\r\n","new_contents":"from libc.stdio cimport FILE, fopen\r\nfrom libc.stdlib cimport malloc, free\r\nfrom cpython.exc cimport PyErr_SetFromErrnoWithFilenameObject\r\n\r\ndef open_file():\r\n cdef FILE* p\r\n p = fopen(\"spam.txt\", \"r\")\r\n if p is NULL:\r\n PyErr_SetFromErrnoWithFilenameObject(OSError, \"spam.txt\")\r\n ...\r\n\r\n\r\ndef allocating_memory(number=10):\r\n cdef double *my_array = malloc(number * sizeof(double))\r\n if not my_array: # same as 'is NULL' above\r\n raise MemoryError()\r\n ...\r\n free(my_array)\r\n","subject":"Add comment in doc example to explain that two ways to compare pointers are equivalent","message":"Add comment in doc example to explain that two ways to compare pointers are equivalent\n","lang":"Cython","license":"apache-2.0","repos":"da-woods\/cython,cython\/cython,scoder\/cython,da-woods\/cython,cython\/cython,da-woods\/cython,scoder\/cython,cython\/cython,scoder\/cython,cython\/cython,da-woods\/cython,scoder\/cython"} {"commit":"d63c7b28b01871d094fd0827e86b5d1e736b5172","old_file":"microscopes\/lda\/_model_h.pxd","new_file":"microscopes\/lda\/_model_h.pxd","old_contents":"from libcpp.vector cimport vector\nfrom libcpp.map cimport map\nfrom libc.stddef cimport size_t\n\nfrom microscopes._shared_ptr_h cimport shared_ptr\nfrom microscopes.common._random_fwd_h cimport rng_t\n\n\ncdef extern from \"microscopes\/lda\/model.hpp\" namespace \"microscopes::lda\":\n cdef cppclass model_definition:\n model_definition(size_t, size_t) except +\n\n cdef cppclass state:\n double perplexity()\n size_t nentities()\n size_t ntopics()\n size_t nwords()\n size_t nterms(size_t) except +\n\n vector[vector[size_t]] assignments()\n vector[vector[size_t]] dish_assignments()\n vector[vector[size_t]] table_assignments()\n vector[vector[float]] document_distribution()\n vector[map[size_t, float]] word_distribution()\n\n float score_assignment()\n float score_data(rng_t &)\n\n\ncdef extern from \"microscopes\/lda\/model.hpp\" namespace \"microscopes::lda::state\":\n shared_ptr[state] initialize(const model_definition &defn,\n float alpa, float beta, float gamma,\n size_t initial_dishes,\n vector[vector[size_t]] &docs,\n rng_t & rng) except +\n","new_contents":"from libcpp.vector cimport vector\nfrom libcpp.map cimport map\nfrom libc.stddef cimport size_t\n\nfrom microscopes._shared_ptr_h cimport shared_ptr\nfrom microscopes.common._random_fwd_h cimport rng_t\n\n\ncdef extern from \"microscopes\/lda\/model.hpp\" namespace \"microscopes::lda\":\n cdef cppclass model_definition:\n model_definition(size_t, size_t) except +\n\n cdef cppclass state:\n double perplexity()\n size_t nentities()\n size_t ntopics()\n size_t nwords()\n size_t nterms(size_t) except +\n\n vector[vector[size_t]] assignments()\n vector[vector[size_t]] dish_assignments()\n vector[vector[size_t]] table_assignments()\n vector[vector[float]] document_distribution()\n vector[map[size_t, float]] word_distribution()\n\n float score_assignment()\n float score_data(rng_t &)\n\n\ncdef extern from \"microscopes\/lda\/model.hpp\" namespace \"microscopes::lda::state\":\n shared_ptr[state] initialize(const model_definition &defn,\n float alpha, float beta, float gamma,\n size_t initial_dishes,\n vector[vector[size_t]] &docs,\n rng_t & rng) except +\n","subject":"Fix spelling error in variable name","message":"Fix spelling error in variable name\n","lang":"Cython","license":"bsd-3-clause","repos":"datamicroscopes\/lda,datamicroscopes\/lda,datamicroscopes\/lda"} {"commit":"d56b3b50edb745e0b0bd32172d2d601c7748288c","old_file":"tests\/errors\/e_bufaccess.pyx","new_file":"tests\/errors\/e_bufaccess.pyx","old_contents":"cdef object[int] buf\ncdef class A:\n cdef object[int] buf\n\ndef f():\n cdef object[fakeoption=True] buf1\n cdef object[int, -1] buf1b \n cdef object[ndim=-1] buf2\n cdef object[int, 'a'] buf3\n cdef object[int,2,3,4,5,6] buf4\n cdef object[int, 2, 'foo'] buf5\n cdef object[int, 2, well] buf6\n\n_ERRORS = u\"\"\"\n1:17: Buffer types only allowed as function local variables\n3:21: Buffer types only allowed as function local variables\n6:31: \"fakeoption\" is not a buffer option\n\"\"\"\n#TODO:\n#7:22: \"ndim\" must be non-negative\n#8:15: \"dtype\" missing\n#9:21: \"ndim\" must be an integer\n#10:15: Too many buffer options\n#11:24: Only allowed buffer modes are \"full\" or \"strided\" (as a compile-time string)\n#12:28: Only allowed buffer modes are \"full\" or \"strided\" (as a compile-time string)\n#\"\"\"\n\n","new_contents":"cdef object[int] buf\ncdef class A:\n cdef object[int] buf\n\ndef f():\n cdef object[fakeoption=True] buf1\n cdef object[int, -1] buf1b \n cdef object[ndim=-1] buf2\n cdef object[int, 'a'] buf3\n cdef object[int,2,3,4,5,6] buf4\n cdef object[int, 2, 'foo'] buf5\n cdef object[int, 2, well] buf6\n cdef object[x, 1] buf0\n\n_ERRORS = u\"\"\"\n1:17: Buffer types only allowed as function local variables\n3:21: Buffer types only allowed as function local variables\n6:31: \"fakeoption\" is not a buffer option\n\"\"\"\n#TODO:\n#7:22: \"ndim\" must be non-negative\n#8:15: \"dtype\" missing\n#9:21: \"ndim\" must be an integer\n#10:15: Too many buffer options\n#11:24: Only allowed buffer modes are \"full\" or \"strided\" (as a compile-time string)\n#12:28: Only allowed buffer modes are \"full\" or \"strided\" (as a compile-time string)\n#13:17: Invalid type.\n#\"\"\"\n\n","subject":"Test for bad buffer types.","message":"Test for bad buffer types.\n","lang":"Cython","license":"apache-2.0","repos":"bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu"} {"commit":"c2be61fb3f74e7a02359c71307621484552de795","old_file":"tests\/run\/big_indices.pyx","new_file":"tests\/run\/big_indices.pyx","old_contents":"__doc__ = u\"\"\"\n >>> test()\n neg False\n pos True\n neg\n pos\n neg\n pos\n\"\"\"\n\ndef test():\n cdef long neg = -1\n cdef unsigned long pos = -2 # will be a large positive number\n\n print \"neg\", neg > 0\n print \"pos\", pos > -\n\n D = { neg: 'neg', pos: 'pos' }\n\n print D[neg]\n print D[pos]\n\n print D[neg]\n print D[pos]\n \n","new_contents":"__doc__ = u\"\"\"\n >>> test()\n neg False\n pos True\n neg\n pos\n neg\n pos\n\"\"\"\n\ndef test():\n cdef long neg = -1\n cdef unsigned long pos = -2 # will be a large positive number\n\n print \"neg\", neg > 0\n print \"pos\", pos > 0\n\n D = { neg: 'neg', pos: 'pos' }\n\n print D[neg]\n print D[pos]\n\n print D[neg]\n print D[pos]\n \n","subject":"Fix test case syntax error","message":"Fix test case syntax error\n","lang":"Cython","license":"apache-2.0","repos":"bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu"} {"commit":"93109ccab50210de2ae9cc8ea98aeda84e411fc0","old_file":"jnius\/jnius_jvm_desktop.pxi","new_file":"jnius\/jnius_jvm_desktop.pxi","old_contents":"# on desktop, we need to create an env :)\n# example taken from http:\/\/www.inonit.com\/cygwin\/jni\/invocationApi\/c.html\n\ncdef extern jint JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args)\ncdef extern from \"jni.h\":\n int JNI_VERSION_1_4\n jboolean JNI_FALSE\n ctypedef struct JavaVMInitArgs:\n jint version\n jint nOptions\n jboolean ignoreUnrecognized\n JavaVMOption *options\n ctypedef struct JavaVMOption:\n char *optionString\n void *extraInfo\n\ncdef JNIEnv *default_env = NULL\n\ncdef void create_jnienv():\n cdef JavaVM* jvm\n cdef JavaVMInitArgs args\n cdef JavaVMOption options[1]\n cdef bytes py_bytes\n\n from os.path import realpath\n py_bytes = ('-Djava.class.path={0}'.format(realpath('.')))\n options[0].optionString = py_bytes\n options[0].extraInfo = NULL\n\n args.version = JNI_VERSION_1_4\n args.options = options\n args.nOptions = 1\n args.ignoreUnrecognized = JNI_FALSE\n\n JNI_CreateJavaVM(&jvm, &default_env, &args)\n\ncdef JNIEnv *get_jnienv():\n if default_env == NULL:\n create_jnienv()\n return default_env\n","new_contents":"# on desktop, we need to create an env :)\n# example taken from http:\/\/www.inonit.com\/cygwin\/jni\/invocationApi\/c.html\n\ncdef extern jint JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args)\ncdef extern from \"jni.h\":\n int JNI_VERSION_1_4\n jboolean JNI_FALSE\n ctypedef struct JavaVMInitArgs:\n jint version\n jint nOptions\n jboolean ignoreUnrecognized\n JavaVMOption *options\n ctypedef struct JavaVMOption:\n char *optionString\n void *extraInfo\n\ncdef JNIEnv *default_env = NULL\n\ncdef void create_jnienv():\n cdef JavaVM* jvm\n cdef JavaVMInitArgs args\n cdef JavaVMOption options[1]\n cdef bytes py_bytes\n\n from os import environ\n from os.path import realpath\n cp = environ.get('CLASSPATH') or realpath('.')\n py_bytes = ('-Djava.class.path={0}'.format(cp))\n options[0].optionString = py_bytes\n options[0].extraInfo = NULL\n\n args.version = JNI_VERSION_1_4\n args.options = options\n args.nOptions = 1\n args.ignoreUnrecognized = JNI_FALSE\n\n JNI_CreateJavaVM(&jvm, &default_env, &args)\n\ncdef JNIEnv *get_jnienv():\n if default_env == NULL:\n create_jnienv()\n return default_env\n","subject":"Make the desktop use CLASSPATH if defined.","message":"Make the desktop use CLASSPATH if defined.\n","lang":"Cython","license":"mit","repos":"physion\/pyjnius,aolihu\/pyjnius,jaykwon\/pyjnius,jk1ng\/pyjnius,jelford\/pyjnius,aolihu\/pyjnius,ibobalo\/pyjnius,kived\/pyjnius,benson-basis\/pyjnius,Konubinix\/pyjnius,kivy\/pyjnius,kived\/pyjnius,physion\/pyjnius,kivy\/pyjnius,kivy\/pyjnius,ibobalo\/pyjnius,physion\/pyjnius,jk1ng\/pyjnius,pombredanne\/pyjnius,pombredanne\/pyjnius,jaykwon\/pyjnius,benson-basis\/pyjnius,niavlys\/pyjnius,jelford\/pyjnius,Konubinix\/pyjnius,niavlys\/pyjnius"} {"commit":"8829984efb4570d6be0984bc54711dd164cddfc3","old_file":"spacy\/tokens\/span.pxd","new_file":"spacy\/tokens\/span.pxd","old_contents":"cimport numpy as np\n\nfrom .doc cimport Doc\n\n\ncdef class Span:\n cdef readonly Doc doc\n cdef readonly int start\n cdef readonly int end\n cdef readonly int start_char\n cdef readonly int end_char\n cdef readonly int label\n\n cdef public np.ndarray tensor\n\n cdef public _vector\n cdef public _vector_norm\n\n\n cpdef int _recalculate_indices(self) except -1\n","new_contents":"cimport numpy as np\n\nfrom .doc cimport Doc\n\n\ncdef class Span:\n cdef readonly Doc doc\n cdef readonly int start\n cdef readonly int end\n cdef readonly int start_char\n cdef readonly int end_char\n cdef readonly int label\n\n cdef public _vector\n cdef public _vector_norm\n\n\n cpdef int _recalculate_indices(self) except -1\n","subject":"Remove tensor attribute from Span and Token.","message":"Remove tensor attribute from Span and Token.\n","lang":"Cython","license":"mit","repos":"Gregory-Howard\/spaCy,raphael0202\/spaCy,recognai\/spaCy,aikramer2\/spaCy,oroszgy\/spaCy.hu,aikramer2\/spaCy,banglakit\/spaCy,oroszgy\/spaCy.hu,banglakit\/spaCy,spacy-io\/spaCy,aikramer2\/spaCy,explosion\/spaCy,explosion\/spaCy,honnibal\/spaCy,banglakit\/spaCy,explosion\/spaCy,recognai\/spaCy,aikramer2\/spaCy,recognai\/spaCy,honnibal\/spaCy,oroszgy\/spaCy.hu,recognai\/spaCy,oroszgy\/spaCy.hu,raphael0202\/spaCy,Gregory-Howard\/spaCy,spacy-io\/spaCy,raphael0202\/spaCy,banglakit\/spaCy,spacy-io\/spaCy,oroszgy\/spaCy.hu,Gregory-Howard\/spaCy,spacy-io\/spaCy,spacy-io\/spaCy,banglakit\/spaCy,explosion\/spaCy,raphael0202\/spaCy,raphael0202\/spaCy,Gregory-Howard\/spaCy,Gregory-Howard\/spaCy,banglakit\/spaCy,spacy-io\/spaCy,recognai\/spaCy,oroszgy\/spaCy.hu,aikramer2\/spaCy,raphael0202\/spaCy,honnibal\/spaCy,recognai\/spaCy,explosion\/spaCy,explosion\/spaCy,aikramer2\/spaCy,honnibal\/spaCy,Gregory-Howard\/spaCy"} {"commit":"5bc101006ea1238304f39b79f2df3bfb38126b00","old_file":"spacy\/tagger.pxd","new_file":"spacy\/tagger.pxd","old_contents":"from thinc.linear.avgtron cimport AveragedPerceptron\nfrom thinc.extra.eg cimport Example\nfrom thinc.structs cimport ExampleC\n\nfrom .structs cimport TokenC\nfrom .vocab cimport Vocab\n\n\ncdef class TaggerModel(AveragedPerceptron):\n cdef void set_featuresC(self, ExampleC* eg, const TokenC* tokens, int i) except *\n \n\ncdef class Tagger:\n cdef readonly Vocab vocab\n cdef readonly TaggerModel model\n cdef public dict freqs\n","new_contents":"from thinc.linear.avgtron cimport AveragedPerceptron\nfrom thinc.extra.eg cimport Example\nfrom thinc.structs cimport ExampleC\n\nfrom .structs cimport TokenC\nfrom .vocab cimport Vocab\n\n\ncdef class TaggerModel(AveragedPerceptron):\n cdef void set_featuresC(self, ExampleC* eg, const TokenC* tokens, int i) except *\n \n\ncdef class Tagger:\n cdef readonly Vocab vocab\n cdef readonly TaggerModel model\n cdef public dict freqs\n cdef public object cfg\n","subject":"Add cfg field to Tagger","message":"Add cfg field to Tagger\n","lang":"Cython","license":"mit","repos":"explosion\/spaCy,aikramer2\/spaCy,spacy-io\/spaCy,oroszgy\/spaCy.hu,aikramer2\/spaCy,spacy-io\/spaCy,oroszgy\/spaCy.hu,raphael0202\/spaCy,explosion\/spaCy,banglakit\/spaCy,raphael0202\/spaCy,banglakit\/spaCy,explosion\/spaCy,oroszgy\/spaCy.hu,Gregory-Howard\/spaCy,banglakit\/spaCy,spacy-io\/spaCy,raphael0202\/spaCy,Gregory-Howard\/spaCy,aikramer2\/spaCy,Gregory-Howard\/spaCy,explosion\/spaCy,raphael0202\/spaCy,oroszgy\/spaCy.hu,banglakit\/spaCy,aikramer2\/spaCy,recognai\/spaCy,banglakit\/spaCy,banglakit\/spaCy,raphael0202\/spaCy,spacy-io\/spaCy,honnibal\/spaCy,honnibal\/spaCy,explosion\/spaCy,oroszgy\/spaCy.hu,recognai\/spaCy,oroszgy\/spaCy.hu,explosion\/spaCy,Gregory-Howard\/spaCy,honnibal\/spaCy,aikramer2\/spaCy,Gregory-Howard\/spaCy,raphael0202\/spaCy,recognai\/spaCy,aikramer2\/spaCy,spacy-io\/spaCy,recognai\/spaCy,spacy-io\/spaCy,Gregory-Howard\/spaCy,honnibal\/spaCy,recognai\/spaCy,recognai\/spaCy"} {"commit":"66b6655810db6d5f450e6a3dd3ad9eebfe40795e","old_file":"scikits\/audiolab\/soundio\/macosx\/macosx_backend.pyx","new_file":"scikits\/audiolab\/soundio\/macosx\/macosx_backend.pyx","old_contents":"cimport AudioHardware\nfrom AudioHardware cimport *\ncimport stdlib\n\ndef yo():\n\tcdef UInt32 sz, ndevices\n\tcdef AudioDeviceID *devices\n\tcdef char *name\n\n\tAudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &sz, NULL)\n\tndevices = sz \/ sizeof(AudioDeviceID)\n\n\tprint \"Number of detected devices:\", ndevices\n","new_contents":"cimport AudioHardware\nfrom AudioHardware cimport *\ncimport stdlib\n\ncdef extern from \"Python.h\":\n\tobject PyString_FromStringAndSize(char *v, int len)\n\ndef yo():\n\tcdef UInt32 sz, ndevices, i\n\tcdef AudioDeviceID *devices\n\tcdef char *name\n\n\tAudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &sz, NULL)\n\tndevices = sz \/ sizeof(AudioDeviceID)\n\n\tprint \"Number of detected devices:\", ndevices\n\tdevices = stdlib.malloc(sizeof(*devices) * ndevices)\n\tres = []\n\ttry:\n\t\tAudioHardwareGetProperty(kAudioHardwarePropertyDevices, &sz,\n\t\t\t\tdevices)\n\n\t\tfor i in range(ndevices):\n\t\t\tAudioDeviceGetPropertyInfo(devices[i], 0, false,\n\t\t\t\t\t\t kAudioDevicePropertyDeviceName, &sz,\n\t\t\t\t\t\t NULL)\n\t\t\tname = malloc(sz + 1)\n\t\t\tAudioDeviceGetProperty(devices[i], 0, false,\n\t\t\t\t\tkAudioDevicePropertyDeviceName, &sz,\n\t\t\t\t\tname)\n\t\t\tdevicename = PyString_FromStringAndSize(name, sz+1)\n\t\t\tfree(name)\n\t\t\tres.append(devicename)\n\n\tfinally:\n\t\tstdlib.free(devices)\n\n\treturn devicename\n","subject":"Enumerate core audio devices in cython.","message":"Enumerate core audio devices in cython.\n\n\n","lang":"Cython","license":"lgpl-2.1","repos":"cournape\/audiolab,cournape\/audiolab,cournape\/audiolab"} {"commit":"6bd135a31c25ee029258ffec48dc27c297c2e858","old_file":"cupy\/cuda\/common.pxd","new_file":"cupy\/cuda\/common.pxd","old_contents":"# distutils: language = c++\n\ncdef extern from '..\/cuda\/cupy_common.h': # thru parent to import in core\n ctypedef char cpy_byte\n ctypedef unsigned char cpy_ubyte\n ctypedef short cpy_short\n ctypedef unsigned short cpy_ushort\n ctypedef int cpy_int\n ctypedef unsigned int cpy_uint\n ctypedef long cpy_long\n ctypedef unsigned long cpy_ulong\n ctypedef float cpy_float\n ctypedef double cpy_double\n","new_contents":"# distutils: language = c++\n\ncdef extern from '..\/cuda\/cupy_common.h': # thru parent to import in core\n ctypedef char cpy_byte\n ctypedef unsigned char cpy_ubyte\n ctypedef short cpy_short\n ctypedef unsigned short cpy_ushort\n ctypedef int cpy_int\n ctypedef unsigned int cpy_uint\n ctypedef long long cpy_long\n ctypedef unsigned long long cpy_ulong\n ctypedef float cpy_float\n ctypedef double cpy_double\n","subject":"Fix long to long long.","message":"Fix long to long long.\n","lang":"Cython","license":"mit","repos":"cupy\/cupy,cupy\/cupy,cupy\/cupy,cupy\/cupy"} {"commit":"081aa975c80187bdb0abaaa1e6ed2445b1e31b84","old_file":"sdks\/python\/apache_beam\/utils\/windowed_value.pxd","new_file":"sdks\/python\/apache_beam\/utils\/windowed_value.pxd","old_contents":"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\ncimport cython\nfrom libc.stdint cimport int64_t\n\n\ncdef type Timestamp\n\n@cython.final\ncdef class WindowedValue(object):\n cdef public object value\n cdef public object windows\n cdef public int64_t timestamp_micros\n cdef object timestamp_object\n\n cpdef WindowedValue with_value(self, new_value)\n\n @staticmethod\n cdef inline bint _typed_eq(WindowedValue left, WindowedValue right) except? -2\n\n@cython.locals(wv=WindowedValue)\ncdef WindowedValue create(\n object value, int64_t timestamp_micros, object windows)\n","new_contents":"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\ncimport cython\nfrom libc.stdint cimport int64_t\n\n\ncdef type Timestamp\n\n@cython.final\ncdef class WindowedValue(object):\n cdef public object value\n cdef public object windows\n cdef public int64_t timestamp_micros\n cdef object timestamp_object\n\n cpdef WindowedValue with_value(self, new_value)\n\n @staticmethod\n cdef inline bint _typed_eq(WindowedValue left, WindowedValue right) except? -2\n\n@cython.locals(wv=WindowedValue)\ncpdef WindowedValue create(\n object value, int64_t timestamp_micros, object windows)\n","subject":"Make create() avaialable to pure python callers","message":"Make create() avaialable to pure python callers\n","lang":"Cython","license":"apache-2.0","repos":"rangadi\/beam,rangadi\/incubator-beam,dhalperi\/incubator-beam,lukecwik\/incubator-beam,jasonkuster\/incubator-beam,ravwojdyla\/incubator-beam,wangyum\/beam,lukecwik\/incubator-beam,tgroh\/incubator-beam,robertwb\/incubator-beam,robertwb\/incubator-beam,RyanSkraba\/beam,ravwojdyla\/incubator-beam,robertwb\/incubator-beam,charlesccychen\/beam,amitsela\/incubator-beam,tgroh\/beam,chamikaramj\/beam,sammcveety\/incubator-beam,robertwb\/incubator-beam,mxm\/incubator-beam,chamikaramj\/beam,eljefe6a\/incubator-beam,iemejia\/incubator-beam,apache\/beam,apache\/beam,ravwojdyla\/incubator-beam,jbonofre\/beam,markflyhigh\/incubator-beam,robertwb\/incubator-beam,manuzhang\/beam,jasonkuster\/beam,peihe\/incubator-beam,chamikaramj\/beam,apache\/beam,tgroh\/beam,robertwb\/incubator-beam,apache\/beam,markflyhigh\/incubator-beam,robertwb\/incubator-beam,jbonofre\/beam,lukecwik\/incubator-beam,chamikaramj\/beam,rangadi\/beam,sammcveety\/incubator-beam,lukecwik\/incubator-beam,eljefe6a\/incubator-beam,apache\/beam,rangadi\/beam,wtanaka\/beam,rangadi\/incubator-beam,xsm110\/Apache-Beam,jasonkuster\/beam,chamikaramj\/beam,apache\/beam,markflyhigh\/incubator-beam,lukecwik\/incubator-beam,wtanaka\/beam,rangadi\/incubator-beam,charlesccychen\/beam,RyanSkraba\/beam,rangadi\/beam,charlesccychen\/beam,xsm110\/Apache-Beam,RyanSkraba\/beam,peihe\/incubator-beam,charlesccychen\/incubator-beam,staslev\/incubator-beam,staslev\/beam,charlesccychen\/incubator-beam,jbonofre\/beam,rangadi\/beam,lukecwik\/incubator-beam,RyanSkraba\/beam,chamikaramj\/beam,markflyhigh\/incubator-beam,lukecwik\/incubator-beam,dhalperi\/beam,markflyhigh\/incubator-beam,peihe\/incubator-beam,charlesccychen\/beam,apache\/beam,rangadi\/beam,jbonofre\/beam,chamikaramj\/beam,robertwb\/incubator-beam,lukecwik\/incubator-beam,chamikaramj\/incubator-beam,robertwb\/incubator-beam,RyanSkraba\/beam,tgroh\/beam,amarouni\/incubator-beam,mxm\/incubator-beam,apache\/beam,chamikaramj\/beam,RyanSkraba\/beam,apache\/beam,amitsela\/beam,RyanSkraba\/beam,yk5\/beam,dhalperi\/incubator-beam,manuzhang\/incubator-beam,charlesccychen\/beam,jbonofre\/incubator-beam,amarouni\/incubator-beam,tgroh\/incubator-beam,markflyhigh\/incubator-beam,jasonkuster\/beam,jbonofre\/incubator-beam,chamikaramj\/beam,manuzhang\/incubator-beam,staslev\/incubator-beam,iemejia\/incubator-beam,vikkyrk\/incubator-beam,charlesccychen\/incubator-beam,sammcveety\/incubator-beam,rangadi\/beam,apache\/beam,dhalperi\/beam,yk5\/beam,manuzhang\/beam,chamikaramj\/incubator-beam,staslev\/beam,robertwb\/incubator-beam,staslev\/beam,dhalperi\/beam,charlesccychen\/beam,yk5\/beam,markflyhigh\/incubator-beam,wangyum\/beam,wangyum\/beam,lukecwik\/incubator-beam,charlesccychen\/beam,wangyum\/beam,eljefe6a\/incubator-beam,amitsela\/beam,manuzhang\/beam,jasonkuster\/incubator-beam,apache\/beam,tgroh\/beam,xsm110\/Apache-Beam,amitsela\/beam,chamikaramj\/beam,vikkyrk\/incubator-beam,wtanaka\/beam,vikkyrk\/incubator-beam,lukecwik\/incubator-beam,amitsela\/incubator-beam"} {"commit":"8327194c6b48204045769a66f772c1e528d2ba7e","old_file":"lib\/blister\/xmp.pyx","new_file":"lib\/blister\/xmp.pyx","old_contents":"# Copyright (c) 2017 The Regents of the University of Michigan.\n# All Rights Reserved. Licensed according to the terms of the Revised\n# BSD License. See LICENSE.txt for details.\n\ncdef class XMP:\n\n cdef set namespaces\n\n def __init__ (self):\n self.namespaces = {\n \"stRef\",\n \"dc\",\n \"xmp\",\n \"xmpRights\",\n \"xmpMM\",\n \"xmpidq\",\n }\n\n def __len__ (self):\n return 0\n\n def __iter__ (self):\n return iter(())\n\n def __getattr__ (self, name):\n if name in self.namespaces:\n return ()\n\n else:\n self.__raise_no_attr(name)\n\n def __repr__ (self):\n return \"<{}>\".format(self.__class__.__name__)\n\n def __raise_no_attr (self, name):\n obj = \"{}.{}\".format(self.__class__.__module__,\n self.__class__.__name__)\n\n message = \"{} object has no attribute {}\".format(repr(obj),\n repr(name))\n\n raise AttributeError(message)\n","new_contents":"# Copyright (c) 2017 The Regents of the University of Michigan.\n# All Rights Reserved. Licensed according to the terms of the Revised\n# BSD License. See LICENSE.txt for details.\n\ncdef set DEFAULT_XMP_NAMESPACES = {\n \"stRef\",\n \"dc\",\n \"xmp\",\n \"xmpRights\",\n \"xmpMM\",\n \"xmpidq\",\n}\n\ncdef class XMP:\n\n def __len__ (self):\n return 0\n\n def __iter__ (self):\n return iter(())\n\n def __getattr__ (self, name):\n if name in DEFAULT_XMP_NAMESPACES:\n return ()\n\n else:\n self.raise_error_no_attr(name)\n\n def __repr__ (self):\n return \"<{}>\".format(self.__class__.__name__)\n\n cdef raise_error_no_attr (self, name):\n obj = \"{}.{}\".format(self.__class__.__module__,\n self.__class__.__name__)\n\n message = \"{} object has no attribute {}\".format(repr(obj),\n repr(name))\n\n raise AttributeError(message)\n","subject":"Replace __ prefixes with cdefs for better encapsulation","message":"Replace __ prefixes with cdefs for better encapsulation\n","lang":"Cython","license":"bsd-3-clause","repos":"daaang\/blister"} {"commit":"a92308975bb6822bd13333aaf4983eda93c8f503","old_file":"jnius\/jnius_localref.pxi","new_file":"jnius\/jnius_localref.pxi","old_contents":"\ncdef class LocalRef:\n cdef jobject obj\n\n def __cinit__(self):\n self.obj = NULL\n\n def __dealloc__(self):\n cdef JNIEnv *j_env\n if self.obj != NULL:\n j_env = get_jnienv()\n j_env[0].DeleteGlobalRef(j_env, self.obj)\n self.obj = NULL\n\n cdef void create(self, JNIEnv *env, jobject obj):\n self.obj = env[0].NewGlobalRef(env, obj)\n\n def __repr__(self):\n return ''.format(\n self.obj, id(self))\n\n\ncdef LocalRef create_local_ref(JNIEnv *env, jobject obj):\n cdef LocalRef ret = LocalRef()\n ret.create(env, obj)\n return ret\n\n","new_contents":"cdef class LocalRef:\n cdef jobject obj\n\n def __cinit__(self):\n self.obj = NULL\n\n def __dealloc__(self):\n cdef JNIEnv *j_env\n if self.obj != NULL:\n j_env = get_jnienv()\n j_env[0].DeleteGlobalRef(j_env, self.obj)\n self.obj = NULL\n\n cdef void create(self, JNIEnv *env, jobject obj):\n self.obj = env[0].NewGlobalRef(env, obj)\n\n def __repr__(self):\n return ''.format(\n self.obj, id(self))\n\n\ncdef LocalRef create_local_ref(JNIEnv *env, jobject obj):\n cdef LocalRef ret = LocalRef()\n ret.create(env, obj)\n return ret\n\n","subject":"Fix string format error in 2.6","message":"Fix string format error in 2.6\n\nIn 2.6, you should give index value to format.","lang":"Cython","license":"mit","repos":"physion\/pyjnius,benson-basis\/pyjnius,jelford\/pyjnius,physion\/pyjnius,kived\/pyjnius,aolihu\/pyjnius,ibobalo\/pyjnius,pombredanne\/pyjnius,jelford\/pyjnius,physion\/pyjnius,benson-basis\/pyjnius,jk1ng\/pyjnius,niavlys\/pyjnius,jk1ng\/pyjnius,kivy\/pyjnius,aolihu\/pyjnius,ibobalo\/pyjnius,Konubinix\/pyjnius,pombredanne\/pyjnius,kivy\/pyjnius,Konubinix\/pyjnius,jaykwon\/pyjnius,niavlys\/pyjnius,kivy\/pyjnius,kived\/pyjnius,jaykwon\/pyjnius"} {"commit":"c10d651201984e3451d5d0a3e24e84aaec515297","old_file":"tests\/compile\/fused_redeclare_T3111.pyx","new_file":"tests\/compile\/fused_redeclare_T3111.pyx","old_contents":"# ticket: 3111\n# mode: compile\n# tag: warnings\n\nctypedef unsigned char npy_uint8\nctypedef unsigned short npy_uint16\n\n\nctypedef fused dtype_t:\n npy_uint8\n\nctypedef fused dtype_t_out:\n npy_uint8\n npy_uint16\n\n\ndef foo(dtype_t[:] a, dtype_t_out[:, :] b):\n pass\n\n\n# The primary thing we're trying to test here is the _absence_ of the warning\n# \"__pyxutil:16:4: '___pyx_npy_uint8' redeclared\". The remaining warnings are\n# unrelated to this test.\n_WARNINGS = \"\"\"\n22:10: 'cpdef_method' redeclared\n33:10: 'cpdef_cname_method' redeclared\n447:72: Argument evaluation order in C function call is undefined and may not be as expected\n750:34: Argument evaluation order in C function call is undefined and may not be as expected\n944:27: Ambiguous exception value, same as default return value: 0\n944:27: Ambiguous exception value, same as default return value: 0\n975:29: Ambiguous exception value, same as default return value: 0\n975:29: Ambiguous exception value, same as default return value: 0\n1003:46: Ambiguous exception value, same as default return value: 0\n1003:46: Ambiguous exception value, same as default return value: 0\n1093:29: Ambiguous exception value, same as default return value: 0\n1093:29: Ambiguous exception value, same as default return value: 0\n\"\"\"\n","new_contents":"# ticket: 3111\n# mode: compile\n# tag: warnings\n\nctypedef unsigned char npy_uint8\nctypedef unsigned short npy_uint16\n\n\nctypedef fused dtype_t:\n npy_uint8\n\nctypedef fused dtype_t_out:\n npy_uint8\n npy_uint16\n\n\ndef foo(dtype_t[:] a, dtype_t_out[:, :] b):\n pass\n\n\n# The primary thing we're trying to test here is the _absence_ of the warning\n# \"__pyxutil:16:4: '___pyx_npy_uint8' redeclared\". The remaining warnings are\n# unrelated to this test.\n_WARNINGS = \"\"\"\n# cpdef redeclaration bug\n22:10: 'cpdef_method' redeclared\n33:10: 'cpdef_cname_method' redeclared\n# from MemoryView.pyx\n974:29: Ambiguous exception value, same as default return value: 0\n974:29: Ambiguous exception value, same as default return value: 0\n1001:46: Ambiguous exception value, same as default return value: 0\n1001:46: Ambiguous exception value, same as default return value: 0\n1091:29: Ambiguous exception value, same as default return value: 0\n1091:29: Ambiguous exception value, same as default return value: 0\n\"\"\"\n","subject":"Update (unrelated) test warnings after changing utility code in MemoryView.pyx.","message":"Update (unrelated) test warnings after changing utility code in MemoryView.pyx.\n","lang":"Cython","license":"apache-2.0","repos":"cython\/cython,scoder\/cython,scoder\/cython,da-woods\/cython,cython\/cython,da-woods\/cython,scoder\/cython,cython\/cython,scoder\/cython,da-woods\/cython,cython\/cython,da-woods\/cython"} {"commit":"d0a9377d151288b3cc08a63da2e153bf3f7c4a2d","old_file":"cygroonga.pyx","new_file":"cygroonga.pyx","old_contents":"cimport ccygroonga\n\ndef init():\n return ccygroonga.grn_init()\n\n#cdef class Database:\n# cdef ccygroonga.grn_ctx* _c_ctx\n# cdef ccygroonga.grn_obj* _c_cb\n#\n# def __cinit__(self, ccygroonga.grn_ctx* c_ctx, ccygroonga.grn_obj* c_db):\n# self._c_ctx = c_ctx\n# self._c_db = c_db\n\ncdef class Context:\n cdef ccygroonga.grn_ctx* _c_ctx\n cdef ccygroonga.grn_obj* _c_cb\n\n def __cinit__(self):\n self._c_ctx = ccygroonga.grn_ctx_open(0)\n\n def db_create(self, path):\n c_path = path.encode('UTF-8')\n c_db = ccygroonga.grn_db_create(self._c_ctx, c_path, NULL)\n self._c_db = c_db\n #return Database(self._c_ctx, c_db)\n\n def fin(self):\n return ccygroonga.grn_ctx_fin(self._c_ctx)\n\ndef fin():\n return ccygroonga.grn_fin()\n","new_contents":"cimport ccygroonga\n\ndef init():\n return ccygroonga.grn_init()\n\n#cdef class Database:\n# cdef ccygroonga.grn_ctx* _c_ctx\n# cdef ccygroonga.grn_obj* _c_cb\n#\n# def __cinit__(self, ccygroonga.grn_ctx* c_ctx, ccygroonga.grn_obj* c_db):\n# self._c_ctx = c_ctx\n# self._c_db = c_db\n\ncdef class Context:\n cdef ccygroonga.grn_ctx* _c_ctx\n cdef ccygroonga.grn_obj* _c_db\n\n def __cinit__(self):\n self._c_ctx = ccygroonga.grn_ctx_open(0)\n\n def db_create(self, path):\n c_path = path.encode('UTF-8')\n c_db = ccygroonga.grn_db_create(self._c_ctx, c_path, NULL)\n self._c_db = c_db\n #return Database(self._c_ctx, c_db)\n\n def fin(self):\n return ccygroonga.grn_ctx_fin(self._c_ctx)\n\ndef fin():\n return ccygroonga.grn_fin()\n","subject":"Fix typo and now it compiles successfully","message":"Fix typo and now it compiles successfully\n","lang":"Cython","license":"apache-2.0","repos":"hnakamur\/cygroonga"} {"commit":"9a2eeb0b80b2b7b44f94576ad7ef76167ac36131","old_file":"src\/petsc4py.PETSc.pyx","new_file":"src\/petsc4py.PETSc.pyx","old_contents":"#cython: embedsignature=True\ninclude \"PETSc\/PETSc.pyx\"\n","new_contents":"#cython: embedsignature=True\n#cython: cdivision=True\n#cython: always_allow_keywords=True\ninclude \"PETSc\/PETSc.pyx\"\n","subject":"Add Cython compiler directives waiting release 0.11.2","message":"Add Cython compiler directives waiting release 0.11.2\n","lang":"Cython","license":"bsd-2-clause","repos":"zonca\/petsc4py,zonca\/petsc4py,zonca\/petsc4py,zonca\/petsc4py"} {"commit":"19c9f53851ee476aef49328f58c1afae927ad92c","old_file":"tests\/run\/datetime_cimport.pyx","new_file":"tests\/run\/datetime_cimport.pyx","old_contents":"# coding: utf-8\n\n#import datetime\nfrom cpython.datetime cimport date, time, datetime, timedelta, PyDateTime_IMPORT\n\nPyDateTime_IMPORT\n \ndef test_date(int year, int month, int day):\n '''\n >>> val = test_date(2012, 12, 31)\n >>> print(val)\n 2012-12-31\n '''\n val = date(year, month, day)\n return val\n\ndef test_time(int hour, int minute, int second, int microsecond):\n '''\n >>> val = test_time(12, 20, 55, 0)\n >>> print(val)\n 12:20:55\n '''\n val = time(hour, minute, second, microsecond)\n return val\n\ndef test_datetime(int year, int month, int day, int hour, int minute, int second, int microsecond):\n '''\n >>> val = test_datetime(2012, 12, 31, 12, 20, 55, 0)\n >>> print(val)\n 2012-12-31 12:20:55\n '''\n val = datetime(year, month, day, hour, minute, second, microsecond)\n return val\n\ndef test_timedelta(int days, int seconds, int useconds):\n '''\n >>> val = test_timedelta(30, 0, 0)\n >>> print(val)\n 30 days, 0:00:00\n '''\n val = timedelta(days, seconds, useconds)\n return val\n","new_contents":"# coding: utf-8\n\nfrom cpython.datetime cimport import_datetime\nfrom cpython.datetime cimport date, time, datetime, timedelta, PyDateTime_IMPORT\n\nimport_datetime()\n \ndef test_date(int year, int month, int day):\n '''\n >>> val = test_date(2012, 12, 31)\n >>> print(val)\n 2012-12-31\n '''\n val = date(year, month, day)\n return val\n\ndef test_time(int hour, int minute, int second, int microsecond):\n '''\n >>> val = test_time(12, 20, 55, 0)\n >>> print(val)\n 12:20:55\n '''\n val = time(hour, minute, second, microsecond)\n return val\n\ndef test_datetime(int year, int month, int day, int hour, int minute, int second, int microsecond):\n '''\n >>> val = test_datetime(2012, 12, 31, 12, 20, 55, 0)\n >>> print(val)\n 2012-12-31 12:20:55\n '''\n val = datetime(year, month, day, hour, minute, second, microsecond)\n return val\n\ndef test_timedelta(int days, int seconds, int useconds):\n '''\n >>> val = test_timedelta(30, 0, 0)\n >>> print(val)\n 30 days, 0:00:00\n '''\n val = timedelta(days, seconds, useconds)\n return val\n","subject":"Change test to initialize by `import_datetime`","message":"Change test to initialize by `import_datetime`","lang":"Cython","license":"apache-2.0","repos":"fperez\/cython,ABcDexter\/cython,encukou\/cython,roxyboy\/cython,roxyboy\/cython,madjar\/cython,acrispin\/cython,dahebolangkuan\/cython,encukou\/cython,roxyboy\/cython,da-woods\/cython,mcanthony\/cython,madjar\/cython,ABcDexter\/cython,slonik-az\/cython,madjar\/cython,slonik-az\/cython,hickford\/cython,ChristopherHogan\/cython,cython\/cython,achernet\/cython,ChristopherHogan\/cython,da-woods\/cython,slonik-az\/cython,dahebolangkuan\/cython,ABcDexter\/cython,marscher\/cython,achernet\/cython,mrGeen\/cython,mcanthony\/cython,ChristopherHogan\/cython,achernet\/cython,andreasvc\/cython,cython\/cython,JelleZijlstra\/cython,dahebolangkuan\/cython,acrispin\/cython,fabianrost84\/cython,mrGeen\/cython,fperez\/cython,mrGeen\/cython,andreasvc\/cython,andreasvc\/cython,da-woods\/cython,JelleZijlstra\/cython,mcanthony\/cython,mrGeen\/cython,ABcDexter\/cython,da-woods\/cython,ABcDexter\/cython,acrispin\/cython,acrispin\/cython,hickford\/cython,c-blake\/cython,mcanthony\/cython,mcanthony\/cython,fabianrost84\/cython,marscher\/cython,scoder\/cython,hhsprings\/cython,fabianrost84\/cython,hhsprings\/cython,scoder\/cython,cython\/cython,roxyboy\/cython,hhsprings\/cython,hickford\/cython,JelleZijlstra\/cython,encukou\/cython,hhsprings\/cython,roxyboy\/cython,marscher\/cython,c-blake\/cython,madjar\/cython,hhsprings\/cython,mrGeen\/cython,cython\/cython,encukou\/cython,dahebolangkuan\/cython,madjar\/cython,achernet\/cython,c-blake\/cython,slonik-az\/cython,andreasvc\/cython,JelleZijlstra\/cython,acrispin\/cython,slonik-az\/cython,marscher\/cython,marscher\/cython,hickford\/cython,JelleZijlstra\/cython,c-blake\/cython,encukou\/cython,achernet\/cython,dahebolangkuan\/cython,fperez\/cython,scoder\/cython,fperez\/cython,fabianrost84\/cython,fabianrost84\/cython,scoder\/cython,c-blake\/cython,hickford\/cython,andreasvc\/cython,fperez\/cython"} {"commit":"1d8ab221ce63fc157799ffee09f63ed6e06a8858","old_file":"src\/MPI\/mpierrhdl.pxi","new_file":"src\/MPI\/mpierrhdl.pxi","old_contents":"# -----------------------------------------------------------------------------\n\ncdef inline int comm_set_eh(MPI_Comm ob) nogil except -1:\n if ob == MPI_COMM_NULL: return 0\n cdef int opt = options.errors\n if opt == 0: pass\n elif opt == 1: CHKERR( MPI_Comm_set_errhandler(ob, MPI_ERRORS_RETURN) )\n elif opt == 2: CHKERR( MPI_Comm_set_errhandler(ob, MPI_ERRORS_ARE_FATAL) )\n return 0\n\ncdef inline int win_set_eh(MPI_Win ob) nogil except -1:\n if ob == MPI_WIN_NULL: return 0\n cdef int opt = options.errors\n if opt == 0: pass\n elif opt == 1: CHKERR( MPI_Win_set_errhandler(ob, MPI_ERRORS_RETURN) )\n elif opt == 2: CHKERR( MPI_Win_set_errhandler(ob, MPI_ERRORS_ARE_FATAL) )\n return 0\n\ncdef inline int file_set_eh(MPI_File ob) nogil except -1:\n if ob != MPI_FILE_NULL: return 0\n cdef int opt = options.errors\n if opt == 0: pass\n elif opt == 1: CHKERR( MPI_File_set_errhandler(ob, MPI_ERRORS_RETURN) )\n elif opt == 2: CHKERR( MPI_File_set_errhandler(ob, MPI_ERRORS_ARE_FATAL) )\n return 0\n\n# -----------------------------------------------------------------------------\n","new_contents":"# -----------------------------------------------------------------------------\n\ncdef inline int comm_set_eh(MPI_Comm ob) nogil except -1:\n if ob == MPI_COMM_NULL: return 0\n cdef int opt = options.errors\n if opt == 0: pass\n elif opt == 1: CHKERR( MPI_Comm_set_errhandler(ob, MPI_ERRORS_RETURN) )\n elif opt == 2: CHKERR( MPI_Comm_set_errhandler(ob, MPI_ERRORS_ARE_FATAL) )\n return 0\n\ncdef inline int win_set_eh(MPI_Win ob) nogil except -1:\n if ob == MPI_WIN_NULL: return 0\n cdef int opt = options.errors\n if opt == 0: pass\n elif opt == 1: CHKERR( MPI_Win_set_errhandler(ob, MPI_ERRORS_RETURN) )\n elif opt == 2: CHKERR( MPI_Win_set_errhandler(ob, MPI_ERRORS_ARE_FATAL) )\n return 0\n\ncdef inline int file_set_eh(MPI_File ob) nogil except -1:\n if ob == MPI_FILE_NULL: return 0\n cdef int opt = options.errors\n if opt == 0: pass\n elif opt == 1: CHKERR( MPI_File_set_errhandler(ob, MPI_ERRORS_RETURN) )\n elif opt == 2: CHKERR( MPI_File_set_errhandler(ob, MPI_ERRORS_ARE_FATAL) )\n return 0\n\n# -----------------------------------------------------------------------------\n","subject":"Fix File error handling rules","message":"Fix File error handling rules\n","lang":"Cython","license":"bsd-2-clause","repos":"mpi4py\/mpi4py,mpi4py\/mpi4py,mpi4py\/mpi4py"} {"commit":"11cce7294a71f9d0ee4e489f5d210db31c6c1e2d","old_file":"cupy\/core\/_backend.pyx","new_file":"cupy\/core\/_backend.pyx","old_contents":"cdef list _reduction_backends = []\ncdef list _routine_backends = []\n\n\ndef _get_backend(str s):\n if s == 'cub':\n return BACKEND_CUB\n # if s == 'cutensor':\n # return BACKEND_CUTENSOR\n raise ValueError('Unknown backend: {}'.format(s))\n\n\ndef set_reduction_backends(str s):\n global _reduction_backends\n _reduction_backends = [_get_backend(t) for t in s.split(',')]\n\n\ndef set_routine_backends(str s):\n global _routine_backends\n _routine_backends = [_get_backend(t) for t in s.split(',')]\n","new_contents":"import os\n\ncdef list _reduction_backends = []\ncdef list _routine_backends = []\n\n\ndef _get_backend(str s):\n if s == 'cub':\n return BACKEND_CUB\n # if s == 'cutensor':\n # return BACKEND_CUTENSOR\n raise ValueError('Unknown backend: {}'.format(s))\n\n\ndef set_reduction_backends(str s):\n global _reduction_backends\n _reduction_backends = [_get_backend(t) for t in s.split(',') if t]\n\n\ndef set_routine_backends(str s):\n global _routine_backends\n _routine_backends = [_get_backend(t) for t in s.split(',') if t]\n\n\ncdef _set_default_backends():\n cdef str default_backends = os.getenv('CUPY_BACKENDS', '')\n set_reduction_backends(default_backends)\n set_routine_backends(default_backends)\n\n\n_set_default_backends()\n","subject":"Set default backends from environment variables","message":"Set default backends from environment variables\n","lang":"Cython","license":"mit","repos":"cupy\/cupy,cupy\/cupy,cupy\/cupy,cupy\/cupy"} {"commit":"54c403717e20052945524d074e773362911bdb7f","old_file":"lineprofile\/fitter.pxd","new_file":"lineprofile\/fitter.pxd","old_contents":"from model cimport LineModel\n\ncdef class FitGaussian(LineModel):\n\n cdef:\n double[:] data\n double[:] weights\n\n # Prior parameters\n\n # Mean and center of the prior radial velocity\n # of each profile and gaussian.\n double[:] v_center_mean\n double[:] v_center_std\n\n # Rotation\n public double v_rot_k\n public double v_rot_theta\n\n # Solid body rotation\n public double fsolid_p\n public double fsolid_q\n\n # Asymmetry\n public double asym_p\n public double asym_q\n\n # Turbulent motions\n public double turbulence_min\n public double turbulence_k\n public double turbulence_theta\n\n # Baseline\n public double baseline_std\n\n cdef int model_params_offset(self)\n cdef double ln_bounds_model(self, double[:] p)\n cdef double ln_prior_model(self, double[:] p)\n cdef double ln_bounds_components(self, double[:] p)\n cdef double ln_prior_components(self, double[:] p)\n cdef double ln_likelihood(self, double[:] p)\n\ncdef class FitLaplacian(FitGaussian):\n pass\n","new_contents":"from model cimport LineModel\n\ncdef class FitGaussian(LineModel):\n\n cdef:\n double[:] data\n double[:] weights\n\n # Prior parameters\n\n # Mean and center of the prior radial velocity\n # of each profile and gaussian.\n double[:] v_center_mean\n double[:] v_center_std\n\n # Rotation\n public double v_rot_k\n public double v_rot_theta\n\n # Solid body rotation\n public double fsolid_p\n public double fsolid_q\n\n # Asymmetry\n public double asym_p\n public double asym_q\n\n # Turbulent motions\n public double turbulence_min\n public double turbulence_k\n public double turbulence_theta\n\n # Baseline\n public double baseline_std\n\n cdef int model_params_offset(self)\n cdef double ln_bounds_model(self, double[:] p)\n cdef double ln_prior_model(self, double[:] p)\n cdef double ln_bounds_components(self, double[:] p)\n cdef double ln_prior_components(self, double[:] p)\n cdef double ln_likelihood(self, double[:] p)\n\ncdef class FitLaplacian(FitGaussian):\n pass\n\ncdef class FitMixture(FitGaussian):\n pass\n","subject":"Add definition of Mixture Model","message":"Add definition of Mixture Model","lang":"Cython","license":"mit","repos":"lfloeer\/hiprofile"} {"commit":"1e113ce7d3d9f6ee64ec9bc0b569f9eb52dd2329","old_file":"thrift\/lib\/py3\/thrift_server.pyx","new_file":"thrift\/lib\/py3\/thrift_server.pyx","old_contents":"cimport cython\nfrom libcpp.memory cimport unique_ptr, make_unique, shared_ptr\n\nfrom thrift_server cimport (\n cThriftServer,\n cServerInterface,\n ServiceInterface\n)\nfrom folly_futures cimport cFollyPromise, cFollyUnit, c_unit\n\nimport asyncio\n\n\ncdef class ThriftServer:\n cdef unique_ptr[cThriftServer] server\n cdef ServiceInterface handler\n cdef object loop\n\n def __cinit__(self):\n self.server = make_unique[cThriftServer]()\n\n\n def __init__(self, ServiceInterface handler, port, loop=None):\n self.loop = loop or asyncio.get_event_loop()\n self.handler = handler\n self.server.get().setInterface(handler.interface_wrapper)\n self.server.get().setPort(port)\n\n async def serve(self):\n def _serve():\n with nogil:\n self.server.get().serve()\n try:\n await self.loop.run_in_executor(None, _serve)\n except asyncio.CancelledError:\n self.server.get().stop()\n raise\n","new_contents":"cimport cython\nfrom libcpp.memory cimport unique_ptr, make_unique, shared_ptr\n\nfrom thrift_server cimport (\n cThriftServer,\n cServerInterface,\n ServiceInterface\n)\nfrom folly_futures cimport cFollyPromise, cFollyUnit, c_unit\n\nimport asyncio\n\n\ncdef class ThriftServer:\n cdef unique_ptr[cThriftServer] server\n cdef ServiceInterface handler\n cdef object loop\n\n def __cinit__(self):\n self.server = make_unique[cThriftServer]()\n\n\n def __init__(self, ServiceInterface handler, port, loop=None):\n self.loop = loop or asyncio.get_event_loop()\n self.handler = handler\n self.server.get().setInterface(handler.interface_wrapper)\n self.server.get().setPort(port)\n\n async def serve(self):\n def _serve():\n with nogil:\n self.server.get().serve()\n try:\n await self.loop.run_in_executor(None, _serve)\n except Exception:\n self.server.get().stop()\n raise\n","subject":"Correct cleanup when server fails","message":"Correct cleanup when server fails\n\nSummary:\nServer has been crashing hard when it should be crashing soft (for\nexample, when binding to the same port. This diff fixes it.\n\nReviewed By: yfeldblum\n\nDifferential Revision: D4242841\n\nfbshipit-source-id: 242ee09ea244ce662c3122f25a96b8b4e8d60fcf\n","lang":"Cython","license":"apache-2.0","repos":"getyourguide\/fbthrift,getyourguide\/fbthrift,facebook\/fbthrift,facebook\/fbthrift,SergeyMakarenko\/fbthrift,getyourguide\/fbthrift,facebook\/fbthrift,SergeyMakarenko\/fbthrift,SergeyMakarenko\/fbthrift,getyourguide\/fbthrift,getyourguide\/fbthrift,facebook\/fbthrift,SergeyMakarenko\/fbthrift,facebook\/fbthrift,getyourguide\/fbthrift,SergeyMakarenko\/fbthrift,facebook\/fbthrift,SergeyMakarenko\/fbthrift,facebook\/fbthrift,SergeyMakarenko\/fbthrift,getyourguide\/fbthrift,SergeyMakarenko\/fbthrift,facebook\/fbthrift,SergeyMakarenko\/fbthrift,SergeyMakarenko\/fbthrift,getyourguide\/fbthrift,getyourguide\/fbthrift,facebook\/fbthrift,getyourguide\/fbthrift,SergeyMakarenko\/fbthrift,SergeyMakarenko\/fbthrift,getyourguide\/fbthrift,getyourguide\/fbthrift"} {"commit":"800deb7102e55c57a951d0b8d43f3631eb0e44c8","old_file":"tests\/run\/cpp_smart_ptr.pyx","new_file":"tests\/run\/cpp_smart_ptr.pyx","old_contents":"# distutils: extra_compile_args=-std=c++11\n# mode: run\n# tag: cpp\n\nfrom libcpp.memory cimport unique_ptr, shared_ptr\n\ncdef extern from \"cpp_smart_ptr_helper.h\":\n cdef cppclass CountAllocDealloc:\n CountAllocDealloc(int*, int*)\n\ndef test_unique_ptr():\n \"\"\"\n >>> test_unique_ptr()\n \"\"\"\n cdef int alloc_count = 0, dealloc_count = 0\n cdef unique_ptr[CountAllocDealloc] x_ptr\n x_ptr.reset(new CountAllocDealloc(&alloc_count, &dealloc_count))\n assert alloc_count == 1\n x_ptr.reset()\n assert alloc_count == 1\n assert dealloc_count == 1\n","new_contents":"# distutils: extra_compile_args=-std=c++0x\n# mode: run\n# tag: cpp, werror\n\nfrom libcpp.memory cimport unique_ptr, shared_ptr\n\ncdef extern from \"cpp_smart_ptr_helper.h\":\n cdef cppclass CountAllocDealloc:\n CountAllocDealloc(int*, int*)\n\ndef test_unique_ptr():\n \"\"\"\n >>> test_unique_ptr()\n \"\"\"\n cdef int alloc_count = 0, dealloc_count = 0\n cdef unique_ptr[CountAllocDealloc] x_ptr\n x_ptr.reset(new CountAllocDealloc(&alloc_count, &dealloc_count))\n assert alloc_count == 1\n x_ptr.reset()\n assert alloc_count == 1\n assert dealloc_count == 1\n","subject":"Use c++0x rather than c++11 when building tests to allow for versions of gcc older than 4.7. This fixes a recurring Travis build failure.","message":"Use c++0x rather than c++11 when building tests to allow for versions of\ngcc older than 4.7. This fixes a recurring Travis build failure.\n","lang":"Cython","license":"apache-2.0","repos":"roxyboy\/cython,JelleZijlstra\/cython,acrispin\/cython,scoder\/cython,hickford\/cython,cython\/cython,JelleZijlstra\/cython,hickford\/cython,JelleZijlstra\/cython,hickford\/cython,c-blake\/cython,dahebolangkuan\/cython,hhsprings\/cython,fperez\/cython,mrGeen\/cython,fperez\/cython,hhsprings\/cython,ChristopherHogan\/cython,hickford\/cython,dahebolangkuan\/cython,da-woods\/cython,fabianrost84\/cython,c-blake\/cython,dahebolangkuan\/cython,da-woods\/cython,fabianrost84\/cython,roxyboy\/cython,scoder\/cython,acrispin\/cython,cython\/cython,dahebolangkuan\/cython,acrispin\/cython,roxyboy\/cython,mcanthony\/cython,JelleZijlstra\/cython,cython\/cython,acrispin\/cython,hhsprings\/cython,mcanthony\/cython,c-blake\/cython,mrGeen\/cython,fabianrost84\/cython,mcanthony\/cython,scoder\/cython,mrGeen\/cython,fperez\/cython,roxyboy\/cython,ChristopherHogan\/cython,fabianrost84\/cython,ChristopherHogan\/cython,roxyboy\/cython,hhsprings\/cython,da-woods\/cython,scoder\/cython,mrGeen\/cython,c-blake\/cython,c-blake\/cython,acrispin\/cython,JelleZijlstra\/cython,dahebolangkuan\/cython,mrGeen\/cython,hhsprings\/cython,fperez\/cython,fabianrost84\/cython,mcanthony\/cython,hickford\/cython,cython\/cython,fperez\/cython,mcanthony\/cython,da-woods\/cython"} {"commit":"d01a897719a1aa7969ff72ac99a55f0429e08327","old_file":"microscopes\/common\/_entity_state_h.pxd","new_file":"microscopes\/common\/_entity_state_h.pxd","old_contents":"from libcpp.vector cimport vector\nfrom libcpp.utility cimport pair\nfrom libc.stddef cimport size_t\n\nfrom microscopes.common._random_fwd_h cimport rng_t\n\ncdef extern from \"microscopes\/common\/entity_state.hpp\" namespace \"microscopes::common\":\n # expose enough of the API here\n cdef cppclass entity_based_state_object:\n vector[ssize_t] assignments() except +\n size_t nentities()\n size_t ngroups()\n\n void add_value(size_t, size_t, rng_t &) except +\n size_t remove_value(size_t, rng_t &) except +\n pair[vector[size_t], vector[float]] score_value(size_t, rng_t &) except +\n\n vector[size_t] empty_groups() except +\n size_t create_group(rng_t &) except +\n void delete_group(size_t) except +","new_contents":"from libcpp.vector cimport vector\nfrom libcpp.utility cimport pair\nfrom libc.stddef cimport size_t\n\nfrom microscopes.common._random_fwd_h cimport rng_t\n\ncdef extern from \"microscopes\/common\/entity_state.hpp\" namespace \"microscopes::common\":\n # expose enough of the API here\n cdef cppclass entity_based_state_object:\n vector[ssize_t] assignments() except +\n size_t nentities()\n size_t ngroups()\n\n void add_value(size_t, size_t, rng_t &) except +\n size_t remove_value(size_t, rng_t &) except +\n pair[vector[size_t], vector[float]] score_value(size_t, rng_t &) except +\n\n vector[size_t] empty_groups() except +\n size_t create_group(rng_t &) except +\n void delete_group(size_t) except +\n","subject":"Add line break to end of file","message":"Add line break to end of file\n","lang":"Cython","license":"bsd-3-clause","repos":"datamicroscopes\/common,datamicroscopes\/common,datamicroscopes\/common,datamicroscopes\/common"} {"commit":"b9fd7c839457815b31e549afabf37f0020ddcbe0","old_file":"zeeko\/zmq_check.pyx","new_file":"zeeko\/zmq_check.pyx","old_contents":"#cython: embedsignature=True\n\nimport zmq\ncimport zmq.backend.cython.libzmq as libzmq\nfrom zmq.backend.cython.socket cimport Socket\nfrom libc.stdint cimport uint64_t\n\nclass ZMQLinkingError(Exception):\n pass\n\ndef check_zeromq():\n \"\"\"Check that zeromq is correctly installed.\"\"\"\n cdef void * handle\n cdef uint64_t affinity\n cdef size_t sz = sizeof(uint64_t)\n cdef int rc, errno\n with zmq.Context.instance() as ctx:\n with ctx.socket(zmq.REQ) as socket:\n handle = (socket).handle\n rc = libzmq.zmq_getsockopt(handle, libzmq.ZMQ_AFFINITY, &affinity, &sz)\n if rc != 0:\n errno = libzmq.zmq_errno()\n if errno == libzmq.EINVAL:\n raise ZMQLinkingError(\"Something has gone wrong with ZMQ Linking\")\n raise zmq.ZMQError()\n\n ","new_contents":"#cython: embedsignature=True\n\nimport zmq\ncimport zmq.backend.cython.libzmq as libzmq\nfrom zmq.backend.cython.socket cimport Socket\nfrom libc.stdint cimport uint64_t\n\nclass ZMQLinkingError(Exception):\n pass\n\ndef check_zeromq():\n \"\"\"Check that zeromq is correctly installed.\"\"\"\n cdef void * handle\n cdef uint64_t affinity\n cdef size_t sz = sizeof(uint64_t)\n cdef int rc, errno\n with zmq.Context() as ctx:\n with ctx.socket(zmq.REQ) as socket:\n handle = (socket).handle\n rc = libzmq.zmq_getsockopt(handle, libzmq.ZMQ_AFFINITY, &affinity, &sz)\n if rc != 0:\n errno = libzmq.zmq_errno()\n if errno == libzmq.EINVAL:\n raise ZMQLinkingError(\"Something has gone wrong with ZMQ Linking\")\n raise zmq.ZMQError()\n\n ","subject":"Fix a bug in zmq.check","message":"Fix a bug in zmq.check\n","lang":"Cython","license":"bsd-3-clause","repos":"alexrudy\/Zeeko,alexrudy\/Zeeko"} {"commit":"719a42a3d50208cfcc053f7a57cc7c00522d7a77","old_file":"tests\/run\/cython_includes.pyx","new_file":"tests\/run\/cython_includes.pyx","old_contents":"\nfrom libc.stdio cimport sprintf\nfrom cpython cimport PyType_Check\nfrom cpython cimport PyType_Check as PyType_Check2\nfrom cpython.type cimport PyType_Check as PyType_Check3\n\ndef libc_cimports():\n \"\"\"\n >>> libc_cimports()\n hello\n \"\"\"\n cdef char[10] buf\n sprintf(buf, \"%s\", b'hello')\n print (buf).decode('ASCII')\n\ndef cpython_cimports():\n \"\"\"\n >>> cpython_cimports()\n True\n False\n True\n False\n True\n False\n \"\"\"\n print PyType_Check(list)\n print PyType_Check([])\n print PyType_Check2(list)\n print PyType_Check2([])\n print PyType_Check3(list)\n print PyType_Check3([])\n\n","new_contents":"\nfrom libc.stdio cimport sprintf\nfrom cpython cimport PyType_Check\nfrom cpython cimport PyType_Check as PyType_Check2\nfrom cpython.type cimport PyType_Check as PyType_Check3\n\n# Make sure we can cimport all .pxd files.\ncimport cpython.array\ncimport cpython.bool\ncimport cpython.buffer\ncimport cpython.bytearray\ncimport cpython.bytes\ncimport cpython.ceval\ncimport cpython.cobject\ncimport cpython.complex\ncimport cpython.datetime\ncimport cpython.dict\ncimport cpython.exc\ncimport cpython.float\ncimport cpython.function\ncimport cpython.getargs\ncimport cpython.instance\ncimport cpython.int\ncimport cpython.iterator\ncimport cpython.list\ncimport cpython.long\ncimport cpython.longintrepr\ncimport cpython.mapping\ncimport cpython.mem\ncimport cpython.method\ncimport cpython.module\ncimport cpython.number\ncimport cpython.object\ncimport cpython.oldbuffer\ncimport cpython.pycapsule\ncimport cpython.pylifecycle\ncimport cpython.pystate\ncimport cpython.pythread\ncimport cpython.ref\ncimport cpython.sequence\ncimport cpython.set\ncimport cpython.slice\ncimport cpython.string\ncimport cpython.tuple\ncimport cpython.type\ncimport cpython.unicode\ncimport cpython.version\ncimport cpython.weakref\n\n\ndef libc_cimports():\n \"\"\"\n >>> libc_cimports()\n hello\n \"\"\"\n cdef char[10] buf\n sprintf(buf, \"%s\", b'hello')\n print (buf).decode('ASCII')\n\n\ndef cpython_cimports():\n \"\"\"\n >>> cpython_cimports()\n True\n False\n True\n False\n True\n False\n \"\"\"\n print PyType_Check(list)\n print PyType_Check([])\n print PyType_Check2(list)\n print PyType_Check2([])\n print PyType_Check3(list)\n print PyType_Check3([])\n\n","subject":"Extend CPython C-API test to at least include (and thus parser) all .pxd files.","message":"Extend CPython C-API test to at least include (and thus parser) all .pxd files.\n","lang":"Cython","license":"apache-2.0","repos":"scoder\/cython,da-woods\/cython,cython\/cython,cython\/cython,cython\/cython,scoder\/cython,da-woods\/cython,da-woods\/cython,da-woods\/cython,scoder\/cython,cython\/cython,scoder\/cython"} {"commit":"a0ee4f239d53ea2833cfabde189ad01c7fa27f68","old_file":"tests\/run\/float_floor_division_T260.pyx","new_file":"tests\/run\/float_floor_division_T260.pyx","old_contents":"def floor_div_float(double a, double b):\n \"\"\"\n >>> floor_div_float(2, 1.5)\n 1.0\n >>> floor_div_float(2, -1.5)\n -2.0\n >>> floor_div_float(-2.3, 1.5)\n -2.0\n >>> floor_div_float(1e10, 1e-10)\n 1e+20\n \"\"\"\n return a \/\/ b\n","new_contents":"def floor_div_float(double a, double b):\n \"\"\"\n >>> floor_div_float(2, 1.5)\n 1.0\n >>> floor_div_float(2, -1.5)\n -2.0\n >>> floor_div_float(-2.3, 1.5)\n -2.0\n >>> floor_div_float(1e10, 1e-10) == 1e20\n True\n \"\"\"\n return a \/\/ b\n","subject":"Fix for different Windows float repr","message":"Fix for different Windows float repr\n","lang":"Cython","license":"apache-2.0","repos":"bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu"} {"commit":"80c1f49586cfd038fbec21bf283bf055f6358495","old_file":"thinc\/linear\/features.pxd","new_file":"thinc\/linear\/features.pxd","old_contents":"from cymem.cymem cimport Pool\n\nfrom ..structs cimport TemplateC, FeatureC\nfrom ..typedefs cimport atom_t\n\n\ncdef class ConjunctionExtracter:\n cdef Pool mem\n cdef readonly int nr_templ\n cdef readonly int nr_embed\n cdef readonly int nr_atom\n cdef public int linear_mode\n\n cdef int set_features(self, FeatureC* feats, const atom_t* atoms) nogil\n \n cdef TemplateC* templates\n cdef object _py_templates\n","new_contents":"from cymem.cymem cimport Pool\n\nfrom ..structs cimport TemplateC, FeatureC\nfrom ..typedefs cimport atom_t\n\n\ncdef class ConjunctionExtracter:\n cdef Pool mem\n cdef readonly int nr_templ\n cdef readonly int nr_embed\n cdef readonly int nr_atom\n cdef public int linear_mode\n\n cdef int set_features(self, FeatureC* feats, const atom_t* atoms) nogil\n \n cdef TemplateC* templates\n cdef object _py_templates\n\n\n\ncdef class BagOfWords(ConjunctionExtracter):\n pass\n","subject":"Add bag of words to header","message":"Add bag of words to header\n","lang":"Cython","license":"mit","repos":"explosion\/thinc,explosion\/thinc,explosion\/thinc,spacy-io\/thinc,spacy-io\/thinc,spacy-io\/thinc,explosion\/thinc"} {"commit":"52ad7227f19a661e72fb6332cd60b0dda0b2f1c0","old_file":"microscopes\/lda\/_model_h.pxd","new_file":"microscopes\/lda\/_model_h.pxd","old_contents":"from libcpp.vector cimport vector\nfrom libcpp.map cimport map\nfrom libc.stddef cimport size_t\n\nfrom microscopes._shared_ptr_h cimport shared_ptr\nfrom microscopes.common._random_fwd_h cimport rng_t\nfrom microscopes.common.variadic._dataview_h cimport dataview\n\n\ncdef extern from \"microscopes\/lda\/model.hpp\" namespace \"microscopes::lda\":\n cdef cppclass model_definition:\n model_definition(size_t, size_t) except +\n\n cdef cppclass state:\n void inference()\n double perplexity()\n\n\n\ncdef extern from \"microscopes\/lda\/model.hpp\" namespace \"microscopes::lda::state\":\n shared_ptr[state] initialize(const model_definition &,\n float,\n float,\n float,\n vector[vector[size_t]],\n rng_t &) except +\n","new_contents":"from libcpp.vector cimport vector\nfrom libcpp.map cimport map\nfrom libc.stddef cimport size_t\n\nfrom microscopes._shared_ptr_h cimport shared_ptr\nfrom microscopes.common._random_fwd_h cimport rng_t\nfrom microscopes.common.variadic._dataview_h cimport dataview\n\n\ncdef extern from \"microscopes\/lda\/model.hpp\" namespace \"microscopes::lda\":\n cdef cppclass model_definition:\n model_definition(size_t, size_t) except +\n\n cdef cppclass state:\n void inference()\n double perplexity()\n\n\n\ncdef extern from \"microscopes\/lda\/model.hpp\" namespace \"microscopes::lda::state\":\n shared_ptr[state] initialize(const model_definition &,\n float,\n float,\n float,\n vector[vector[size_t]] &,\n rng_t &) except +\n","subject":"Make parameter a reference parameter","message":"Make parameter a reference parameter\n","lang":"Cython","license":"bsd-3-clause","repos":"datamicroscopes\/lda,datamicroscopes\/lda,datamicroscopes\/lda"} {"commit":"b5e391e4ac169005d5c2f5b749f2b20ba7cb4c56","old_file":"src\/rank_filter.pxd","new_file":"src\/rank_filter.pxd","old_contents":"cimport cython\nfrom cython cimport floating\n\n\ncdef extern from \"rank_filter_base.hxx\" namespace \"rank_filter\":\n void lineRankOrderFilter1D[I1, I2](const I1& src_begin,\n const I1& src_end,\n I2& dest_begin,\n I2& dest_end,\n size_t half_length,\n double rank) nogil\n\n\n@cython.boundscheck(False)\n@cython.initializedcheck(False)\n@cython.nonecheck(False)\ncdef inline void lineRankOrderFilter1D_floating(floating[::1] src,\n floating[::1] dest,\n size_t half_length,\n double rank) nogil:\n cdef floating* src_begin = &src[0]\n cdef floating* src_end = &src[-1] + 1\n cdef floating* dest_begin = &dest[0]\n cdef floating* dest_end = &dest[-1] + 1\n\n lineRankOrderFilter1D(\n src_begin, src_end, dest_begin, dest_end, half_length, rank\n )\n","new_contents":"cimport cython\nfrom cython cimport floating\n\n\ncdef extern from \"rank_filter.hxx\" namespace \"rank_filter\":\n void lineRankOrderFilter1D[I1, I2](const I1& src_begin,\n const I1& src_end,\n I2& dest_begin,\n I2& dest_end,\n size_t half_length,\n double rank) nogil\n\n\n@cython.boundscheck(False)\n@cython.initializedcheck(False)\n@cython.nonecheck(False)\ncdef inline void lineRankOrderFilter1D_floating(floating[::1] src,\n floating[::1] dest,\n size_t half_length,\n double rank) nogil:\n cdef floating* src_begin = &src[0]\n cdef floating* src_end = &src[-1] + 1\n cdef floating* dest_begin = &dest[0]\n cdef floating* dest_end = &dest[-1] + 1\n\n lineRankOrderFilter1D(\n src_begin, src_end, dest_begin, dest_end, half_length, rank\n )\n","subject":"Fix C++ header name in Cython header","message":"Fix C++ header name in Cython header\n\nAs the `_base` suffix has been dropped, update the Cython header\naccordingly.\n","lang":"Cython","license":"bsd-3-clause","repos":"nanshe-org\/rank_filter,nanshe-org\/rank_filter,jakirkham\/rank_filter,DudLab\/rank_filter,DudLab\/rank_filter,nanshe-org\/rank_filter,jakirkham\/rank_filter,DudLab\/rank_filter,jakirkham\/rank_filter"} {"commit":"88316765082c12639fe1bb3afe456e3c838cca99","old_file":"gssapi\/raw\/chan_bindings.pxd","new_file":"gssapi\/raw\/chan_bindings.pxd","old_contents":"from libc.stdlib cimport malloc, free\n\nfrom gssapi.raw.cython_types cimport *\n\ncdef class ChannelBindings:\n cdef public object initiator_address_type\n cdef public bytes initiator_address\n\n cdef public object acceptor_address_type\n cdef public bytes acceptor_address\n\n cdef public bytes application_data\n\n cdef gss_channel_bindings_t __cvalue__(ChannelBindings self)\n","new_contents":"from libc.stdlib cimport malloc, free\n\nfrom gssapi.raw.cython_types cimport *\n\ncdef class ChannelBindings:\n cdef public object initiator_address_type\n cdef public bytes initiator_address\n\n cdef public object acceptor_address_type\n cdef public bytes acceptor_address\n\n cdef public bytes application_data\n\n cdef gss_channel_bindings_t __cvalue__(ChannelBindings self) except NULL\n","subject":"Fix channel bindings type signature","message":"Fix channel bindings type signature\n\nCython 0.22 didn't like that we didn't have the `except NULL`\nclause on the `__cvalue__` method in `ChannelBindings` in the\n.pxd file. This adds the clause to the .pxd file.\n","lang":"Cython","license":"isc","repos":"frozencemetery\/python-gssapi,pythongssapi\/python-gssapi,frozencemetery\/python-gssapi,pythongssapi\/python-gssapi,frozencemetery\/python-gssapi,pythongssapi\/python-gssapi"} {"commit":"c2c2d390e0eb4b6a8f627449bf9106b601b7834b","old_file":"src\/rank_filter.pxd","new_file":"src\/rank_filter.pxd","old_contents":"cimport cython\nfrom cython cimport floating\n\n\ncdef extern from \"rank_filter.hxx\" namespace \"rank_filter\":\n void lineRankOrderFilter1D[I1, I2](const I1& src_begin,\n const I1& src_end,\n I2& dest_begin,\n I2& dest_end,\n size_t half_length,\n double rank) nogil\n\n\n@cython.boundscheck(False)\n@cython.initializedcheck(False)\n@cython.nonecheck(False)\ncdef inline void lineRankOrderFilter1D_floating_inplace(floating[::1] a,\n size_t half_length,\n double rank) nogil:\n cdef floating* a_begin = &a[0]\n cdef floating* a_end = &a[-1] + 1\n\n lineRankOrderFilter1D(\n a_begin, a_end, a_begin, a_end, half_length, rank\n )\n","new_contents":"cimport cython\nfrom cython cimport floating\n\ncimport numpy\n\n\ncdef extern from \"rank_filter.hxx\" namespace \"rank_filter\":\n void lineRankOrderFilter1D[I1, I2](const I1& src_begin,\n const I1& src_end,\n I2& dest_begin,\n I2& dest_end,\n size_t half_length,\n double rank) nogil\n\n\n@cython.boundscheck(False)\n@cython.initializedcheck(False)\n@cython.nonecheck(False)\ncdef inline void lineRankOrderFilter1D_floating_inplace(floating[::1] a,\n size_t half_length,\n double rank) nogil:\n cdef floating* a_begin = &a[0]\n cdef floating* a_end = &a[-1] + 1\n\n lineRankOrderFilter1D(\n a_begin, a_end, a_begin, a_end, half_length, rank\n )\n\n\n@cython.boundscheck(False)\n@cython.initializedcheck(False)\n@cython.nonecheck(False)\ncdef inline bint ndindex(const numpy.npy_intp[:] shape,\n numpy.npy_intp[:] pos) nogil:\n cdef Py_ssize_t i = shape.shape[0]\n while i > 0:\n i -= 1\n pos[i] += 1\n\n if pos[i] < shape[i]:\n return False\n elif i > 0:\n pos[i] = 0\n\n return True\n","subject":"Implement an `ndindex`-like Cython function","message":"Implement an `ndindex`-like Cython function\n\nProvides a Cython function that acts similarly to `ndindex`. However it\nis written in C-style. So it does not yield, does not use classes, etc.\nIt also doesn't keep state. However it can be used like a generator\nexcept in a `while`-loop where state external to the function is update\non each run.\n","lang":"Cython","license":"bsd-3-clause","repos":"jakirkham\/rank_filter,nanshe-org\/rank_filter,DudLab\/rank_filter,DudLab\/rank_filter,DudLab\/rank_filter,jakirkham\/rank_filter,jakirkham\/rank_filter,nanshe-org\/rank_filter,nanshe-org\/rank_filter"} {"commit":"e5557b2bee103aa33100b3e85795b4b2cf9c880d","old_file":"simhash\/simhash.pyx","new_file":"simhash\/simhash.pyx","old_contents":"import hashlib\nimport struct\n\nfrom simhash cimport compute as c_compute\nfrom simhash cimport find_all as c_find_all\n\n\ndef unsigned_hash(bytes obj):\n '''Returns a hash suitable for use as a hash_t.'''\n return struct.unpack('>Q', hashlib.md5(obj).digest()[0:8])[0] & 0xFFFFFFFFFFFFFFFF\n\ndef compute(hashes):\n '''Compute the simhash of a vector of hashes.'''\n return c_compute(hashes)\n\ndef find_all(hashes, number_of_blocks, different_bits):\n '''\n Find the set of all matches within the provided vector of hashes.\n\n The provided hashes are manipulated in place, but upon completion are\n restored to their original state.\n '''\n cdef matches_t results_set = c_find_all(hashes, number_of_blocks, different_bits)\n cdef vector[match_t] results_vector\n results_vector.assign(results_set.begin(), results_set.end())\n return results_vector\n","new_contents":"import hashlib\nimport struct\n\nfrom simhash cimport compute as c_compute\nfrom simhash cimport find_all as c_find_all\n\n\ndef unsigned_hash(bytes obj):\n '''Returns a hash suitable for use as a hash_t.'''\n # Takes first 8 bytes of MD5 digest\n digest = hashlib.md5(obj).digest()[0:8]\n # Unpacks the binary bytes in digest into a Python integer\n return struct.unpack('>Q', digest)[0] & 0xFFFFFFFFFFFFFFFF\n\ndef compute(hashes):\n '''Compute the simhash of a vector of hashes.'''\n return c_compute(hashes)\n\ndef find_all(hashes, number_of_blocks, different_bits):\n '''\n Find the set of all matches within the provided vector of hashes.\n\n The provided hashes are manipulated in place, but upon completion are\n restored to their original state.\n '''\n cdef matches_t results_set = c_find_all(hashes, number_of_blocks, different_bits)\n cdef vector[match_t] results_vector\n results_vector.assign(results_set.begin(), results_set.end())\n return results_vector\n","subject":"Add comments around cryptic stuct.unpack invocation.","message":"Add comments around cryptic stuct.unpack invocation.\n","lang":"Cython","license":"mit","repos":"seomoz\/simhash-py,seomoz\/simhash-py,pombredanne\/simhash-py,pombredanne\/simhash-py"} {"commit":"b06bf2a9c39da407188a69f38f5a611888431acc","old_file":"gala\/sparselol_cy.pyx","new_file":"gala\/sparselol_cy.pyx","old_contents":"cimport numpy as np\nfrom scipy import sparse\n\ndef extents_count(Py_ssize_t[::1] labels,\n Py_ssize_t[::1] curr_loc, Py_ssize_t[::1] indices):\n cdef Py_ssize_t i\n for i, label in enumerate(labels):\n indices[curr_loc[label]] = i\n curr_loc[label] += 1\n","new_contents":"cimport numpy as np\nfrom scipy import sparse\nimport cython\n\n@cython.boundscheck(False)\n@cython.wraparound(False)\ndef extents_count(Py_ssize_t[::1] labels,\n Py_ssize_t[::1] curr_loc, Py_ssize_t[::1] indices):\n cdef Py_ssize_t i = 0\n cdef Py_ssize_t label\n cdef Py_ssize_t size = len(labels)\n for i in range(size):\n label = labels[i]\n indices[curr_loc[label]] = i\n curr_loc[label] += 1\n i += 1\n","subject":"Optimize construction of label indices","message":"Optimize construction of label indices\n","lang":"Cython","license":"bsd-3-clause","repos":"janelia-flyem\/gala,jni\/gala"} {"commit":"38047e51f6911a3106abb576ba36421197917f81","old_file":"pycvodes\/include\/cvodes_anyode_nogil.pxd","new_file":"pycvodes\/include\/cvodes_anyode_nogil.pxd","old_contents":"# -*- mode: cython -*-\n# -*- coding: utf-8 -*-\n\nfrom libcpp cimport bool\nfrom libcpp.vector cimport vector\nfrom libcpp.utility cimport pair\nfrom cvodes_cxx cimport LMM, IterType\nfrom cvodes_cxx cimport realtype\n\ncdef extern from \"cvodes_anyode.hpp\" namespace \"cvodes_anyode\":\n cdef pair[vector[realtype], vector[realtype]] simple_adaptive[U](\n realtype **,\n int *,\n U * const,\n vector[realtype],\n realtype,\n LMM,\n const realtype,\n vector[int]&,\n long int,\n realtype,\n const realtype,\n const realtype,\n bool,\n IterType,\n LinSol,\n int,\n const realtype,\n unsigned,\n bool,\n int,\n bool,\n bool,\n int,\n realtype **\n ) nogil except +\n\n cdef int simple_predefined[U](\n U * const,\n vector[realtype],\n realtype,\n LMM,\n const realtype * const,\n size_t,\n const realtype * const,\n realtype * const,\n vector[int]&,\n vector[realtype]&,\n long int,\n realtype,\n const realtype,\n const realtype,\n bool,\n IterType,\n LinSol,\n int,\n const realtype,\n unsigned,\n int,\n bool,\n bool,\n realtype *\n ) nogil except +\n","new_contents":"# -*- mode: cython -*-\n# -*- coding: utf-8 -*-\n\nfrom libcpp cimport bool\nfrom libcpp.vector cimport vector\nfrom libcpp.utility cimport pair\nfrom cvodes_cxx cimport LMM, IterType\n\ncdef extern from \"cvodes_anyode.hpp\" namespace \"cvodes_anyode\":\n cdef pair[vector[double], vector[double]] simple_adaptive[U](\n U * const,\n vector[double],\n double,\n LMM,\n const double * const,\n double,\n const double,\n vector[int]&,\n long int,\n double,\n double,\n double,\n bool,\n IterType,\n LinSol,\n int,\n double,\n unsigned,\n bool,\n int,\n bool,\n bool\n ) nogil except +\n\n cdef int simple_predefined[U](\n U * const,\n vector[double],\n double,\n LMM,\n const double * const,\n size_t,\n const double * const,\n double * const,\n vector[int]&,\n vector[double]&,\n long int,\n double,\n double,\n double,\n bool,\n IterType,\n LinSol,\n int,\n double,\n unsigned,\n int,\n bool,\n bool\n ) nogil except +\n","subject":"Revert nogil .pxd to master (appears unused?)","message":"Revert nogil .pxd to master (appears unused?)\n","lang":"Cython","license":"bsd-2-clause","repos":"bjodah\/pycvodes,bjodah\/pycvodes,bjodah\/pycvodes,bjodah\/pycvodes"} {"commit":"63f6c5d97bef132fe0bacd713ede2c3511f68061","old_file":"opencog\/cython\/opencog\/bindlink.pyx","new_file":"opencog\/cython\/opencog\/bindlink.pyx","old_contents":"from opencog.atomspace cimport Atom, AtomSpace, TruthValue, PtrHolder\nfrom opencog.atomspace cimport cAtomSpace, cTruthValue\nfrom opencog.atomspace cimport tv_ptr, strength_t, count_t, shared_ptr\nfrom opencog.atomspace cimport handle_cast\nfrom cython.operator cimport dereference as deref\n\nfrom opencog.atomspace import is_a, types, create_value_by_type\n\ndef execute_atom(AtomSpace atomspace, Atom atom):\n if atom == None: raise ValueError(\"execute_atom atom is: None\")\n cdef cValuePtr c_value_ptr = c_execute_atom(atomspace.atomspace,\n deref(atom.handle))\n type = deref(c_value_ptr).get_type()\n if is_a(type, types.Atom):\n return Atom.createAtom(handle_cast(c_value_ptr), atomspace)\n cdef PtrHolder ptr_holder = PtrHolder.create(c_value_ptr)\n return create_value_by_type(type, ptr_holder, atomspace)\n\n\n\ndef evaluate_atom(AtomSpace atomspace, Atom atom):\n if atom == None: raise ValueError(\"evaluate_atom atom is: None\")\n cdef tv_ptr result_tv_ptr = c_evaluate_atom(atomspace.atomspace,\n deref(atom.handle))\n cdef cTruthValue* result_tv = result_tv_ptr.get()\n cdef strength_t strength = deref(result_tv).get_mean()\n cdef strength_t confidence = deref(result_tv).get_confidence()\n return TruthValue(strength, confidence)\n","new_contents":"from opencog.atomspace cimport Atom, AtomSpace, TruthValue, PtrHolder\nfrom opencog.atomspace cimport cAtomSpace, cTruthValue\nfrom opencog.atomspace cimport tv_ptr, strength_t, count_t, shared_ptr\nfrom opencog.atomspace cimport handle_cast\nfrom cython.operator cimport dereference as deref\n\nfrom opencog.atomspace import is_a, types, create_value_by_type\n\ndef execute_atom(AtomSpace atomspace, Atom atom):\n if atom == None: raise ValueError(\"execute_atom atom is: None\")\n cdef cValuePtr c_value_ptr = c_execute_atom(atomspace.atomspace,\n deref(atom.handle))\n type = deref(c_value_ptr).get_type()\n cdef PtrHolder ptr_holder = PtrHolder.create(c_value_ptr)\n return create_value_by_type(type, ptr_holder, atomspace)\n\n\n\ndef evaluate_atom(AtomSpace atomspace, Atom atom):\n if atom == None: raise ValueError(\"evaluate_atom atom is: None\")\n cdef tv_ptr result_tv_ptr = c_evaluate_atom(atomspace.atomspace,\n deref(atom.handle))\n cdef cTruthValue* result_tv = result_tv_ptr.get()\n cdef strength_t strength = deref(result_tv).get_mean()\n cdef strength_t confidence = deref(result_tv).get_confidence()\n return TruthValue(strength, confidence)\n","subject":"Use only create_value_by_type to create Value or Atom in execute_atom() method","message":"Use only create_value_by_type to create Value or Atom in execute_atom() method\n","lang":"Cython","license":"agpl-3.0","repos":"AmeBel\/atomspace,rTreutlein\/atomspace,rTreutlein\/atomspace,rTreutlein\/atomspace,AmeBel\/atomspace,AmeBel\/atomspace,AmeBel\/atomspace,rTreutlein\/atomspace,rTreutlein\/atomspace,AmeBel\/atomspace"} {"commit":"20afa7edae4dc0726424140625529e94e881e658","old_file":"skimage\/_shared\/geometry.pyx","new_file":"skimage\/_shared\/geometry.pyx","old_contents":"#cython: cdivison=True\n#cython: boundscheck=False\n#cython: nonecheck=False\n#cython: wraparound=False\n\n\ncdef inline unsigned char point_in_polygon(int nr_verts, double *xp, double *yp,\n double x, double y):\n cdef int i\n cdef unsigned char c = 0\n cdef int j = nr_verts - 1\n for i in range(nr_verts):\n if (\n (((yp[i] <= y) and (y < yp[j])) or\n ((yp[j] <= y) and (y < yp[i])))\n and (x < (xp[j] - xp[i]) * (y - yp[i]) \/ (yp[j] - yp[i]) + xp[i])\n ):\n c = not c\n j = i\n return c\n\ncdef void points_in_polygon(int nr_verts, double *xp, double *yp,\n int nr_points, double *x, double *y,\n unsigned char *result):\n cdef int n\n for n in range(nr_points):\n result[n] = point_in_polygon(nr_verts, xp, yp, x[n], y[n])\n","new_contents":"#cython: cdivison=True\n#cython: boundscheck=False\n#cython: nonecheck=False\n#cython: wraparound=False\n\n\ncdef inline unsigned char point_in_polygon(int nr_verts, double *xp, double *yp,\n double x, double y):\n \"\"\"Test whether point lies inside a polygon.\n\n Parameters\n ----------\n nr_verts : int\n Number of vertices of polygon.\n xp, yp : double array\n Coordinates of polygon with length nr_verts.\n x, y : double\n Coordinates of point.\n \"\"\"\n cdef int i\n cdef unsigned char c = 0\n cdef int j = nr_verts - 1\n for i in range(nr_verts):\n if (\n (((yp[i] <= y) and (y < yp[j])) or\n ((yp[j] <= y) and (y < yp[i])))\n and (x < (xp[j] - xp[i]) * (y - yp[i]) \/ (yp[j] - yp[i]) + xp[i])\n ):\n c = not c\n j = i\n return c\n\ncdef void points_in_polygon(int nr_verts, double *xp, double *yp,\n int nr_points, double *x, double *y,\n unsigned char *result):\n \"\"\"Test whether points lie inside a polygon.\n\n Parameters\n ----------\n nr_verts : int\n Number of vertices of polygon.\n xp, yp : double array\n Coordinates of polygon with length nr_verts.\n nr_points : int\n Number of points to test.\n x, y : double array\n Coordinates of points.\n result : unsigned char array\n Test results for each point.\n \"\"\"\n cdef int n\n for n in range(nr_points):\n result[n] = point_in_polygon(nr_verts, xp, yp, x[n], y[n])\n","subject":"Add doc string to point in polygon functions","message":"Add doc string to point in polygon functions\n","lang":"Cython","license":"bsd-3-clause","repos":"Hiyorimi\/scikit-image,pratapvardhan\/scikit-image,ajaybhat\/scikit-image,robintw\/scikit-image,GaZ3ll3\/scikit-image,vighneshbirodkar\/scikit-image,michaelpacer\/scikit-image,paalge\/scikit-image,oew1v07\/scikit-image,jwiggins\/scikit-image,vighneshbirodkar\/scikit-image,almarklein\/scikit-image,ofgulban\/scikit-image,chintak\/scikit-image,vighneshbirodkar\/scikit-image,ajaybhat\/scikit-image,robintw\/scikit-image,WarrenWeckesser\/scikits-image,juliusbierk\/scikit-image,SamHames\/scikit-image,Midafi\/scikit-image,pratapvardhan\/scikit-image,blink1073\/scikit-image,newville\/scikit-image,emon10005\/scikit-image,almarklein\/scikit-image,newville\/scikit-image,youprofit\/scikit-image,SamHames\/scikit-image,bsipocz\/scikit-image,ClinicalGraphics\/scikit-image,chintak\/scikit-image,chriscrosscutler\/scikit-image,keflavich\/scikit-image,michaelaye\/scikit-image,juliusbierk\/scikit-image,paalge\/scikit-image,keflavich\/scikit-image,michaelpacer\/scikit-image,chintak\/scikit-image,Hiyorimi\/scikit-image,SamHames\/scikit-image,warmspringwinds\/scikit-image,ClinicalGraphics\/scikit-image,almarklein\/scikit-image,WarrenWeckesser\/scikits-image,youprofit\/scikit-image,SamHames\/scikit-image,rjeli\/scikit-image,emon10005\/scikit-image,Britefury\/scikit-image,ofgulban\/scikit-image,dpshelio\/scikit-image,dpshelio\/scikit-image,rjeli\/scikit-image,oew1v07\/scikit-image,Midafi\/scikit-image,bennlich\/scikit-image,blink1073\/scikit-image,michaelaye\/scikit-image,Britefury\/scikit-image,GaZ3ll3\/scikit-image,ofgulban\/scikit-image,bsipocz\/scikit-image,bennlich\/scikit-image,jwiggins\/scikit-image,rjeli\/scikit-image,warmspringwinds\/scikit-image,chintak\/scikit-image,almarklein\/scikit-image,paalge\/scikit-image,chriscrosscutler\/scikit-image"} {"commit":"15dd0f0c7a01799827b7b6c739a4ed9a3a0d80c9","old_file":"folly\/python\/range.pxd","new_file":"folly\/python\/range.pxd","old_contents":"cdef extern from \"folly\/Range.h\" namespace \"folly\":\n cdef cppclass Range[T]:\n Range()\n Range(T, int)\n T data()\n T begin()\n T end()\n int size()\n\nctypedef Range[const char*] StringPiece\nctypedef Range[const unsigned char*] ByteRange\n\nctypedef fused R:\n StringPiece\n ByteRange\n\n# Conversion Helpers\ncdef inline bytes to_bytes(R range):\n return range.data()[:range.size()]\n","new_contents":"cdef extern from \"folly\/Range.h\" namespace \"folly\":\n cdef cppclass Range[T]:\n Range()\n Range(T, int)\n T data()\n int size()\n\nctypedef Range[const char*] StringPiece\nctypedef Range[const unsigned char*] ByteRange\n\nctypedef fused R:\n StringPiece\n ByteRange\n\n# Conversion Helpers\ncdef inline bytes to_bytes(R range):\n return range.data()[:range.size()]\n","subject":"Revert D22499183: refactor Enum code generation","message":"Revert D22499183: refactor Enum code generation\n\nDifferential Revision:\nD22499183 (https:\/\/github.com\/facebook\/folly\/commit\/24364356023d04f966a0ef6fc7536363932bdc82)\n\nOriginal commit changeset: b2af8d94024c\n\nfbshipit-source-id: a6bd56cdb4d4b73618a9374528371c5b18a0df10\n","lang":"Cython","license":"apache-2.0","repos":"facebook\/folly,facebook\/folly,facebook\/folly,facebook\/folly,facebook\/folly"} {"commit":"db4078b3db30ab7634de87b228ec81cd42e5d372","old_file":"thinc\/linear\/avgtron.pxd","new_file":"thinc\/linear\/avgtron.pxd","old_contents":"from cymem.cymem cimport Pool\nfrom preshed.maps cimport PreshMap\n\nfrom .features cimport ConjunctionExtracter\nfrom ..typedefs cimport weight_t, feat_t, class_t\nfrom ..structs cimport FeatureC\nfrom ..structs cimport ExampleC\n\n\ncdef class AveragedPerceptron:\n cdef readonly Pool mem\n cdef readonly PreshMap weights\n cdef readonly PreshMap averages\n cdef readonly PreshMap lasso_ledger\n cdef ConjunctionExtracter extracter\n cdef public int time\n cdef public weight_t learn_rate\n cdef public weight_t l1_penalty\n cdef public weight_t momentum\n \n cdef void set_scoresC(self, weight_t* scores, const FeatureC* feats, int nr_feat) nogil\n cdef int updateC(self, const ExampleC* eg) except -1\n cpdef int update_weight(self, feat_t feat_id, class_t clas, weight_t upd) except -1\n","new_contents":"from cymem.cymem cimport Pool\nfrom preshed.maps cimport PreshMap\n\nfrom .features cimport ConjunctionExtracter\nfrom ..typedefs cimport weight_t, feat_t, class_t\nfrom ..structs cimport FeatureC\nfrom ..structs cimport ExampleC\n\n\ncdef class AveragedPerceptron:\n cdef readonly Pool mem\n cdef readonly PreshMap weights\n cdef readonly PreshMap averages\n cdef readonly PreshMap lasso_ledger\n cdef ConjunctionExtracter extracter\n cdef public int time\n cdef readonly int nr_out\n cdef public weight_t learn_rate\n cdef public weight_t l1_penalty\n cdef public weight_t momentum\n \n cdef void set_scoresC(self, weight_t* scores, const FeatureC* feats, int nr_feat) nogil\n cdef int updateC(self, const ExampleC* eg) except -1\n cpdef int update_weight(self, feat_t feat_id, class_t clas, weight_t upd) except -1\n","subject":"Add nr_out attribute to AveragedPerceptron","message":"Add nr_out attribute to AveragedPerceptron\n","lang":"Cython","license":"mit","repos":"explosion\/thinc,spacy-io\/thinc,explosion\/thinc,spacy-io\/thinc,explosion\/thinc,spacy-io\/thinc,explosion\/thinc"} {"commit":"ac525f35adce3f1d49b159bd52f5b60606b56c6a","old_file":"pycvodes\/include\/cvodes_anyode_parallel.pxd","new_file":"pycvodes\/include\/cvodes_anyode_parallel.pxd","old_contents":"# -*- mode: cython -*-\n# -*- coding: utf-8 -*-\n\nfrom libcpp cimport bool\nfrom libcpp.vector cimport vector\nfrom libcpp.utility cimport pair\nfrom cvodes_cxx cimport LMM, IterType, LinSol, realtype, indextype\n\ncdef extern from \"cvodes_anyode_parallel.hpp\" namespace \"cvodes_anyode_parallel\":\n cdef vector[pair[int, vector[int]]] multi_adaptive[U](\n realtype **,\n int *,\n vector[U*],\n vector[realtype],\n const realtype,\n const LMM,\n const realtype *,\n const long int,\n const realtype *,\n const realtype *,\n const realtype *,\n const bool,\n IterType,\n LinSol,\n const int,\n const realtype,\n const unsigned,\n const bool,\n const int,\n const bool,\n const bool\n ) except +\n\n cdef vector[pair[int, pair[vector[int], vector[realtype]]]] multi_predefined[U](\n vector[U*],\n vector[realtype],\n const realtype,\n const LMM,\n realtype *,\n const size_t,\n realtype *,\n realtype *,\n const long int,\n const realtype *,\n const realtype *,\n const realtype *,\n const bool,\n IterType,\n LinSol,\n const int,\n const realtype,\n const unsigned,\n const int,\n const bool,\n const bool\n ) except +\n","new_contents":"# -*- mode: cython -*-\n# -*- coding: utf-8 -*-\n\nfrom libcpp cimport bool\nfrom libcpp.vector cimport vector\nfrom libcpp.utility cimport pair\nfrom cvodes_cxx cimport LMM, IterType, LinSol, realtype\n\ncdef extern from \"cvodes_anyode_parallel.hpp\" namespace \"cvodes_anyode_parallel\":\n cdef vector[pair[int, vector[int]]] multi_adaptive[U](\n realtype **,\n int *,\n vector[U*],\n vector[realtype],\n const realtype,\n const LMM,\n const realtype *,\n const long int,\n const realtype *,\n const realtype *,\n const realtype *,\n const bool,\n IterType,\n LinSol,\n const int,\n const realtype,\n const unsigned,\n const bool,\n const int,\n const bool,\n const bool\n ) except +\n\n cdef vector[pair[int, pair[vector[int], vector[realtype]]]] multi_predefined[U](\n vector[U*],\n vector[realtype],\n const realtype,\n const LMM,\n realtype *,\n const size_t,\n realtype *,\n realtype *,\n const long int,\n const realtype *,\n const realtype *,\n const realtype *,\n const bool,\n IterType,\n LinSol,\n const int,\n const realtype,\n const unsigned,\n const int,\n const bool,\n const bool\n ) except +\n","subject":"Remove unused cimport of indextype","message":"Remove unused cimport of indextype\n","lang":"Cython","license":"bsd-2-clause","repos":"bjodah\/pycvodes,bjodah\/pycvodes,bjodah\/pycvodes,bjodah\/pycvodes"} {"commit":"12e02297df17d5680cbb8f9def6de056e10a744a","old_file":"docs\/examples\/userguide\/external_C_code\/platform_adaptation.pyx","new_file":"docs\/examples\/userguide\/external_C_code\/platform_adaptation.pyx","old_contents":"cdef extern from *:\n \"\"\"\n #if defined(WIN32) || defined(MS_WINDOWS)\n #include \"synchapi.h\"\n #define myapp_sleep(m) Sleep(m)\n #else\n #include \n #define myapp_sleep(m) ((void) usleep((m) * 1000))\n #endif\n \"\"\"\n # using \"myapp_\" prefix in the C code to prevent C naming conflicts\n void msleep \"myapp_sleep\"(int milliseconds) nogil\n\nmsleep(milliseconds=1)\n","new_contents":"cdef extern from *:\n \"\"\"\n #if defined(WIN32) || defined(MS_WINDOWS)\n #include \n #define myapp_sleep(m) Sleep(m)\n #else\n #include \n #define myapp_sleep(m) ((void) usleep((m) * 1000))\n #endif\n \"\"\"\n # using \"myapp_\" prefix in the C code to prevent C naming conflicts\n void msleep \"myapp_sleep\"(int milliseconds) nogil\n\nmsleep(milliseconds=1)\n","subject":"Fix test compile failure in MSVC.","message":"Fix test compile failure in MSVC.\n","lang":"Cython","license":"apache-2.0","repos":"cython\/cython,scoder\/cython,scoder\/cython,da-woods\/cython,cython\/cython,da-woods\/cython,scoder\/cython,cython\/cython,scoder\/cython,da-woods\/cython,da-woods\/cython,cython\/cython"} {"commit":"ade34772023742a30be3a4c331fe6026768b5221","old_file":"opencog\/cython\/opencog\/atomspace.pyx","new_file":"opencog\/cython\/opencog\/atomspace.pyx","old_contents":"# Cython\/distutils can only handle a single file as the source for\n# a python module. Since it is helpful to be able to split the binding\n# code into separate files, we just include them here.\n#\n# Note that the ordering of include statements may influence whether\n# things work or not\n\ninclude \"nameserver.pyx\"\ninclude \"truth_value.pyx\"\ninclude \"atomspace_details.pyx\"\ninclude \"atom.pyx\"\ninclude \"protoatom.pyx\"","new_contents":"# Cython\/distutils can only handle a single file as the source for\n# a python module. Since it is helpful to be able to split the binding\n# code into separate files, we just include them here.\n#\n# Note that the ordering of include statements may influence whether\n# things work or not\n\ninclude \"nameserver.pyx\"\ninclude \"truth_value.pyx\"\ninclude \"atomspace_details.pyx\"\ninclude \"atom.pyx\"\ninclude \"protoatom.pyx\"\n","subject":"Add newline at the end of file","message":"Add newline at the end of file","lang":"Cython","license":"agpl-3.0","repos":"AmeBel\/atomspace,rTreutlein\/atomspace,AmeBel\/atomspace,AmeBel\/atomspace,AmeBel\/atomspace,rTreutlein\/atomspace,rTreutlein\/atomspace,AmeBel\/atomspace,rTreutlein\/atomspace,rTreutlein\/atomspace"} {"commit":"9821a4481949bf6ec010635d005c3bba166acbc1","old_file":"tests\/compile\/libc_all.pyx","new_file":"tests\/compile\/libc_all.pyx","old_contents":"cimport libc\n\ncimport libc.stdio\ncimport libc.errno\ncimport libc.float\ncimport libc.limits\ncimport libc.locale\ncimport libc.signal\ncimport libc.stddef\ncimport libc.stdint\ncimport libc.stdio\ncimport libc.stdlib\ncimport libc.string\n\nfrom libc cimport errno\nfrom libc cimport float\nfrom libc cimport limits\nfrom libc cimport locale\nfrom libc cimport signal\nfrom libc cimport stddef\nfrom libc cimport stdint\nfrom libc cimport stdio\nfrom libc cimport stdlib\nfrom libc cimport string\n\nfrom libc.errno cimport *\nfrom libc.float cimport *\nfrom libc.limits cimport *\nfrom libc.locale cimport *\nfrom libc.signal cimport *\nfrom libc.stddef cimport *\nfrom libc.stdint cimport *\nfrom libc.stdio cimport *\nfrom libc.stdlib cimport *\nfrom libc.string cimport *\n\nlibc.stdio.printf(\"hello %s\\n\", b\"world\")\nstdio.printf(\"hello %s\\n\", b\"world\")\nprintf(\"hello %s\\n\", b\"world\")\n","new_contents":"cimport libc\n\ncimport libc.stdio\ncimport libc.errno\ncimport libc.float\ncimport libc.limits\ncimport libc.locale\ncimport libc.signal\ncimport libc.stddef\n#cimport libc.stdint # XXX MSVC\ncimport libc.stdio\ncimport libc.stdlib\ncimport libc.string\n\nfrom libc cimport errno\nfrom libc cimport float\nfrom libc cimport limits\nfrom libc cimport locale\nfrom libc cimport signal\nfrom libc cimport stddef\n#from libc cimport stdint # XXX MSVC\nfrom libc cimport stdio\nfrom libc cimport stdlib\nfrom libc cimport string\n\nfrom libc.errno cimport *\nfrom libc.float cimport *\nfrom libc.limits cimport *\nfrom libc.locale cimport *\nfrom libc.signal cimport *\nfrom libc.stddef cimport *\n#from libc.stdint cimport * # XXX MSVC\nfrom libc.stdio cimport *\nfrom libc.stdlib cimport *\nfrom libc.string cimport *\n\nlibc.stdio.printf(\"hello %s\\n\", b\"world\")\nstdio.printf(\"hello %s\\n\", b\"world\")\nprintf(\"hello %s\\n\", b\"world\")\n","subject":"Disable test for libc.stdint (missing stdint.h in MSVC)","message":"Disable test for libc.stdint (missing stdint.h in MSVC)\n","lang":"Cython","license":"apache-2.0","repos":"slonik-az\/cython,hhsprings\/cython,ABcDexter\/cython,rguillebert\/CythonCTypesBackend,acrispin\/cython,bzzzz\/cython,c-blake\/cython,marscher\/cython,da-woods\/cython,dahebolangkuan\/cython,bzzzz\/cython,fabianrost84\/cython,hpfem\/cython,andreasvc\/cython,slonik-az\/cython,bzzzz\/cython,larsmans\/cython,achernet\/cython,hpfem\/cython,fperez\/cython,cython\/cython,fabianrost84\/cython,JelleZijlstra\/cython,c-blake\/cython,madjar\/cython,mcanthony\/cython,JelleZijlstra\/cython,mrGeen\/cython,larsmans\/cython,mrGeen\/cython,ABcDexter\/cython,hickford\/cython,dahebolangkuan\/cython,da-woods\/cython,achernet\/cython,slonik-az\/cython,c-blake\/cython,hickford\/cython,encukou\/cython,encukou\/cython,scoder\/cython,madjar\/cython,cython\/cython,achernet\/cython,scoder\/cython,fabianrost84\/cython,encukou\/cython,dahebolangkuan\/cython,acrispin\/cython,marscher\/cython,roxyboy\/cython,acrispin\/cython,hhsprings\/cython,roxyboy\/cython,scoder\/cython,slonik-az\/cython,andreasvc\/cython,hpfem\/cython,larsmans\/cython,roxyboy\/cython,andreasvc\/cython,hickford\/cython,andreasvc\/cython,hhsprings\/cython,bzzzz\/cython,andreasvc\/cython,c-blake\/cython,marscher\/cython,madjar\/cython,marscher\/cython,marscher\/cython,acrispin\/cython,JelleZijlstra\/cython,madjar\/cython,cython\/cython,hpfem\/cython,scoder\/cython,hickford\/cython,slonik-az\/cython,ChristopherHogan\/cython,madjar\/cython,mrGeen\/cython,fabianrost84\/cython,roxyboy\/cython,roxyboy\/cython,larsmans\/cython,dahebolangkuan\/cython,JelleZijlstra\/cython,hickford\/cython,JelleZijlstra\/cython,mcanthony\/cython,hpfem\/cython,da-woods\/cython,hhsprings\/cython,fperez\/cython,da-woods\/cython,c-blake\/cython,dahebolangkuan\/cython,achernet\/cython,ChristopherHogan\/cython,encukou\/cython,ABcDexter\/cython,rguillebert\/CythonCTypesBackend,mcanthony\/cython,mcanthony\/cython,ABcDexter\/cython,acrispin\/cython,larsmans\/cython,mrGeen\/cython,ChristopherHogan\/cython,hhsprings\/cython,mrGeen\/cython,rguillebert\/CythonCTypesBackend,rguillebert\/CythonCTypesBackend,mcanthony\/cython,fabianrost84\/cython,fperez\/cython,cython\/cython,fperez\/cython,ABcDexter\/cython,achernet\/cython,encukou\/cython,fperez\/cython"} {"commit":"10b13b65173207d274ffa9570ec77a1aed6bc7e8","old_file":"src\/pygame_sdl2\/error.pyx","new_file":"src\/pygame_sdl2\/error.pyx","old_contents":"# Copyright 2014 Tom Rothamel \n#\n# This software is provided 'as-is', without any express or implied\n# warranty. In no event will the authors be held liable for any damages\n# arising from the use of this software.\n#\n# Permission is granted to anyone to use this software for any purpose,\n# including commercial applications, and to alter it and redistribute it\n# freely, subject to the following restrictions:\n#\n# 1. The origin of this software must not be misrepresented; you must not\n# claim that you wrote the original software. If you use this software\n# in a product, an acknowledgment in the product documentation would be\n# appreciated but is not required.\n# 2. Altered source versions must be plainly marked as such, and must not be\n# misrepresented as being the original software.\n# 3. This notice may not be removed or altered from any source distribution.\n\nfrom sdl2 cimport *\n\nclass error(RuntimeError):\n\n def __init__(self, message=None):\n if message is None:\n message = str(SDL_GetError())\n\n RuntimeError.__init__(self, message)\n\ndef get_error():\n cdef const char *message = SDL_GetError()\n\n if message:\n return str(message)\n else:\n return ''\n\ndef set_error(message):\n message = bytes(message)\n SDL_SetError(message)\n","new_contents":"# Copyright 2014 Tom Rothamel \n#\n# This software is provided 'as-is', without any express or implied\n# warranty. In no event will the authors be held liable for any damages\n# arising from the use of this software.\n#\n# Permission is granted to anyone to use this software for any purpose,\n# including commercial applications, and to alter it and redistribute it\n# freely, subject to the following restrictions:\n#\n# 1. The origin of this software must not be misrepresented; you must not\n# claim that you wrote the original software. If you use this software\n# in a product, an acknowledgment in the product documentation would be\n# appreciated but is not required.\n# 2. Altered source versions must be plainly marked as such, and must not be\n# misrepresented as being the original software.\n# 3. This notice may not be removed or altered from any source distribution.\n\nfrom sdl2 cimport *\n\nclass error(RuntimeError):\n\n def __init__(self, message=None):\n if message is None:\n message = str(SDL_GetError())\n\n RuntimeError.__init__(self, message)\n\ndef get_error():\n cdef const char *message = SDL_GetError()\n\n if message:\n return str(message)\n else:\n return ''\n\ndef set_error(message):\n message = bytes(message)\n SDL_SetError(\"%s\", message)\n","subject":"Use format string with SDL_SetError.","message":"Use format string with SDL_SetError.\n\nFixes #26, although the fix wasn't tested.\n","lang":"Cython","license":"lgpl-2.1","repos":"renpy\/pygame_sdl2,renpy\/pygame_sdl2,renpy\/pygame_sdl2,renpy\/pygame_sdl2"} {"commit":"22b5dfb488cf3ce81ed2a6c6ff608746b1963510","old_file":"docs\/examples\/tutorial\/fib1\/fib.pyx","new_file":"docs\/examples\/tutorial\/fib1\/fib.pyx","old_contents":"def fib(n):\n \"\"\"Print the Fibonacci series up to n.\"\"\"\n a, b = 0, 1\n while b < n:\n print(b)\n a, b = b, a + b\n","new_contents":"from __future__ import print_function\n\ndef fib(n):\n \"\"\"Print the Fibonacci series up to n.\"\"\"\n a, b = 0, 1\n while b < n:\n print(b, end=' ')\n a, b = b, a + b\n\n print()\n","subject":"Change demo file back to original output style.","message":"Change demo file back to original output style.\n","lang":"Cython","license":"apache-2.0","repos":"scoder\/cython,da-woods\/cython,da-woods\/cython,da-woods\/cython,cython\/cython,da-woods\/cython,scoder\/cython,scoder\/cython,cython\/cython,cython\/cython,scoder\/cython,cython\/cython"} {"commit":"a23b3c1a5b7481b3c33861fda1a40ca67e61f45e","old_file":"tests\/run\/uninitialized.pyx","new_file":"tests\/run\/uninitialized.pyx","old_contents":"# mode: run\n# tag: control-flow, uninitialized\n\ndef conditional(cond):\n \"\"\"\n >>> conditional(True)\n []\n >>> conditional(False)\n Traceback (most recent call last):\n ...\n UnboundLocalError: a\n \"\"\"\n if cond:\n a = []\n return a\n\ndef inside_loop(iter):\n \"\"\"\n >>> inside_loop([1,2,3])\n 3\n >>> inside_loop([])\n Traceback (most recent call last):\n ...\n UnboundLocalError: i\n \"\"\"\n for i in iter:\n pass\n return i\n\ndef try_except(cond):\n \"\"\"\n >>> try_except(True)\n []\n >>> try_except(False)\n Traceback (most recent call last):\n ...\n UnboundLocalError: a\n \"\"\"\n try:\n if cond:\n a = []\n raise ValueError\n except ValueError:\n return a\n\ndef try_finally(cond):\n \"\"\"\n >>> try_finally(True)\n []\n >>> try_finally(False)\n Traceback (most recent call last):\n ...\n UnboundLocalError: a\n \"\"\"\n try:\n if cond:\n a = []\n raise ValueError\n finally:\n return a\n","new_contents":"# mode: run\n# tag: control-flow, uninitialized\n\ndef conditional(cond):\n \"\"\"\n >>> conditional(True)\n []\n >>> conditional(False)\n Traceback (most recent call last):\n ...\n UnboundLocalError: a\n \"\"\"\n if cond:\n a = []\n return a\n\ndef inside_loop(iter):\n \"\"\"\n >>> inside_loop([1,2,3])\n 3\n >>> inside_loop([])\n Traceback (most recent call last):\n ...\n UnboundLocalError: i\n \"\"\"\n for i in iter:\n pass\n return i\n\ndef try_except(cond):\n \"\"\"\n >>> try_except(True)\n []\n >>> try_except(False)\n Traceback (most recent call last):\n ...\n UnboundLocalError: a\n \"\"\"\n try:\n if cond:\n a = []\n raise ValueError\n except ValueError:\n return a\n\ndef try_finally(cond):\n \"\"\"\n >>> try_finally(True)\n []\n >>> try_finally(False)\n Traceback (most recent call last):\n ...\n UnboundLocalError: a\n \"\"\"\n try:\n if cond:\n a = []\n raise ValueError\n finally:\n return a\n\ndef deleted(cond):\n \"\"\"\n >>> deleted(False)\n {}\n >>> deleted(True)\n Traceback (most recent call last):\n ...\n UnboundLocalError: a\n \"\"\"\n a = {}\n if cond:\n del a\n return a\n","subject":"Add testcase for local variable deletion","message":"Add testcase for local variable deletion\n","lang":"Cython","license":"apache-2.0","repos":"ABcDexter\/cython,slonik-az\/cython,rguillebert\/CythonCTypesBackend,andreasvc\/cython,dahebolangkuan\/cython,mcanthony\/cython,ABcDexter\/cython,hpfem\/cython,mrGeen\/cython,hhsprings\/cython,fperez\/cython,fabianrost84\/cython,andreasvc\/cython,andreasvc\/cython,encukou\/cython,ChristopherHogan\/cython,andreasvc\/cython,fabianrost84\/cython,achernet\/cython,c-blake\/cython,mrGeen\/cython,cython\/cython,marscher\/cython,c-blake\/cython,marscher\/cython,hickford\/cython,fperez\/cython,larsmans\/cython,da-woods\/cython,JelleZijlstra\/cython,mcanthony\/cython,JelleZijlstra\/cython,hhsprings\/cython,achernet\/cython,mcanthony\/cython,JelleZijlstra\/cython,mrGeen\/cython,madjar\/cython,rguillebert\/CythonCTypesBackend,larsmans\/cython,cython\/cython,encukou\/cython,ChristopherHogan\/cython,encukou\/cython,c-blake\/cython,acrispin\/cython,hpfem\/cython,roxyboy\/cython,dahebolangkuan\/cython,roxyboy\/cython,encukou\/cython,da-woods\/cython,c-blake\/cython,roxyboy\/cython,ABcDexter\/cython,rguillebert\/CythonCTypesBackend,scoder\/cython,slonik-az\/cython,hpfem\/cython,achernet\/cython,marscher\/cython,madjar\/cython,achernet\/cython,madjar\/cython,fperez\/cython,larsmans\/cython,cython\/cython,roxyboy\/cython,hickford\/cython,ChristopherHogan\/cython,marscher\/cython,scoder\/cython,slonik-az\/cython,dahebolangkuan\/cython,fabianrost84\/cython,hpfem\/cython,madjar\/cython,achernet\/cython,andreasvc\/cython,mrGeen\/cython,madjar\/cython,rguillebert\/CythonCTypesBackend,scoder\/cython,dahebolangkuan\/cython,mcanthony\/cython,fperez\/cython,hhsprings\/cython,mcanthony\/cython,hickford\/cython,ABcDexter\/cython,slonik-az\/cython,hhsprings\/cython,slonik-az\/cython,mrGeen\/cython,cython\/cython,ABcDexter\/cython,acrispin\/cython,acrispin\/cython,JelleZijlstra\/cython,hpfem\/cython,fabianrost84\/cython,larsmans\/cython,da-woods\/cython,hickford\/cython,c-blake\/cython,marscher\/cython,JelleZijlstra\/cython,acrispin\/cython,encukou\/cython,hhsprings\/cython,dahebolangkuan\/cython,fperez\/cython,da-woods\/cython,hickford\/cython,acrispin\/cython,fabianrost84\/cython,scoder\/cython,roxyboy\/cython,larsmans\/cython"} {"commit":"d17d4e96f7633a7b7848f2136102c5c58b91414e","old_file":"docs\/examples\/tutorial\/string\/return_memview.pyx","new_file":"docs\/examples\/tutorial\/string\/return_memview.pyx","old_contents":"def process_byte_data(unsigned char[:] data, bint return_all):\r\n # ... process the data\r\n if return_all:\r\n return bytes(data)\r\n else:\r\n # example for returning a slice\r\n return bytes(data[5:35])\r\n","new_contents":"def process_byte_data(unsigned char[:] data):\r\n # ... process the data, here, dummy processing.\r\n cdef bint return_all = (data[0] == 108)\r\n\r\n if return_all:\r\n return bytes(data)\r\n else:\r\n # example for returning a slice\r\n return bytes(data[5:7])\r\n","subject":"Put a dummy processing in the function rather than asking the user for decision.","message":"Put a dummy processing in the function rather than asking the user for decision.\n","lang":"Cython","license":"apache-2.0","repos":"da-woods\/cython,scoder\/cython,scoder\/cython,scoder\/cython,scoder\/cython,da-woods\/cython,cython\/cython,cython\/cython,da-woods\/cython,da-woods\/cython,cython\/cython,cython\/cython"} {"commit":"9939253fed657c3a48be2188d97c11d72a011777","old_file":"tests\/compile\/fused_redeclare_T3111.pyx","new_file":"tests\/compile\/fused_redeclare_T3111.pyx","old_contents":"# ticket: 3111\n# mode: compile\n# tag: warnings\n\nctypedef unsigned char npy_uint8\nctypedef unsigned short npy_uint16\n\n\nctypedef fused dtype_t:\n npy_uint8\n\nctypedef fused dtype_t_out:\n npy_uint8\n npy_uint16\n\n\ndef foo(dtype_t[:] a, dtype_t_out[:, :] b):\n pass\n\n\n# The primary thing we're trying to test here is the _absence_ of the warning\n# \"__pyxutil:16:4: '___pyx_npy_uint8' redeclared\". The remaining warnings are\n# unrelated to this test.\n_WARNINGS = \"\"\"\n# cpdef redeclaration bug, from TestCythonScope.pyx\n25:10: 'cpdef_method' redeclared\n36:10: 'cpdef_cname_method' redeclared\n# from MemoryView.pyx\n984:29: Ambiguous exception value, same as default return value: 0\n984:29: Ambiguous exception value, same as default return value: 0\n1011:46: Ambiguous exception value, same as default return value: 0\n1011:46: Ambiguous exception value, same as default return value: 0\n1101:29: Ambiguous exception value, same as default return value: 0\n1101:29: Ambiguous exception value, same as default return value: 0\n\"\"\"\n","new_contents":"# ticket: 3111\n# mode: compile\n# tag: warnings\n\nctypedef unsigned char npy_uint8\nctypedef unsigned short npy_uint16\n\n\nctypedef fused dtype_t:\n npy_uint8\n\nctypedef fused dtype_t_out:\n npy_uint8\n npy_uint16\n\n\ndef foo(dtype_t[:] a, dtype_t_out[:, :] b):\n pass\n\n\n# The primary thing we're trying to test here is the _absence_ of the warning\n# \"__pyxutil:16:4: '___pyx_npy_uint8' redeclared\". The remaining warnings are\n# unrelated to this test.\n_WARNINGS = \"\"\"\n# cpdef redeclaration bug, from TestCythonScope.pyx\n25:10: 'cpdef_method' redeclared\n36:10: 'cpdef_cname_method' redeclared\n# from MemoryView.pyx\n987:29: Ambiguous exception value, same as default return value: 0\n987:29: Ambiguous exception value, same as default return value: 0\n1014:46: Ambiguous exception value, same as default return value: 0\n1014:46: Ambiguous exception value, same as default return value: 0\n1104:29: Ambiguous exception value, same as default return value: 0\n1104:29: Ambiguous exception value, same as default return value: 0\n\"\"\"\n","subject":"Fix unrelated test after changing MemoryView.pyx.","message":"Fix unrelated test after changing MemoryView.pyx.\n","lang":"Cython","license":"apache-2.0","repos":"scoder\/cython,da-woods\/cython,cython\/cython,da-woods\/cython,cython\/cython,da-woods\/cython,scoder\/cython,cython\/cython,scoder\/cython,da-woods\/cython,scoder\/cython,cython\/cython"} {"commit":"a9444675a968fec4abc72d27c9c74c733ea8f195","old_file":"dit\/math\/_close.pyx","new_file":"dit\/math\/_close.pyx","old_contents":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nLow level implementation of scalar `allclose`.\n\n\"\"\"\n\ncdef extern from \"math.h\":\n double fabs(double)\n int isinf(double)\n int isnan(double)\n\ndef close(double x, double y, double rtol, double atol):\n \"\"\"Returns True if the scalars x and y are close.\n\n The relative error rtol must be positive and << 1.0\n The absolute error atol usually comes into play when y is very small or\n zero; it says how small x must be also.\n\n \"\"\"\n # Test for nan\n if isnan(x) or isnan(y):\n return False\n\n # Make sure they are both inf or non-inf\n cdef int xinf, yinf\n xinf = isinf(x)\n yinf = isinf(y)\n\n if not xinf == yinf:\n return False\n\n cdef bint xgz, ygz\n if xinf:\n # If they are inf, make sure the signs are the same.\n xgz = x>0\n ygz = y>0\n if (xgz and not ygz) or (not xgz and ygz):\n return False\n else:\n return True\n else:\n # Otherwise, make sure they are close.\n return fabs(x-y) <= atol + rtol * fabs(y)\n\n","new_contents":"#!\/usr\/bin\/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nLow level implementation of scalar `allclose`.\n\n\"\"\"\n\ncdef extern from \"math.h\":\n double fabs(double)\n int isinf(double)\n int isnan(double)\n\ndef close(double x, double y, double rtol, double atol):\n \"\"\"Returns True if the scalars x and y are close.\n\n The relative error rtol must be positive and << 1.0\n The absolute error atol usually comes into play when y is very small or\n zero; it says how small x must be also.\n\n \"\"\"\n # Test for nan\n if isnan(x) or isnan(y):\n return False\n\n # Make sure they are both inf or non-inf\n cdef int xinf, yinf\n xinf = isinf(x)\n yinf = isinf(y)\n\n if not xinf == yinf:\n return False\n\n if xinf:\n # If they are both inf, make sure the signs are the same.\n return (x > 0) == (y > 0)\n else:\n # Otherwise, make sure they are close.\n return fabs(x-y) <= atol + rtol * fabs(y)\n\n","subject":"Simplify and speed up dit.math.close","message":"Simplify and speed up dit.math.close\n","lang":"Cython","license":"bsd-3-clause","repos":"Autoplectic\/dit,Autoplectic\/dit,chebee7i\/dit,chebee7i\/dit,Autoplectic\/dit,Autoplectic\/dit,dit\/dit,dit\/dit,dit\/dit,chebee7i\/dit,Autoplectic\/dit,chebee7i\/dit,dit\/dit,dit\/dit"} {"commit":"81af0016b9ef16cfdc29574a63df4428af0f354c","old_file":"src\/mpi4py\/MPI\/asfspath.pxi","new_file":"src\/mpi4py\/MPI\/asfspath.pxi","old_contents":"#------------------------------------------------------------------------------\n\ncdef extern from \"Python.h\":\n object PyOS_FSPath(object)\n\ncdef os_fsencode\nfrom os import fsencode as os_fsencode\n\ncdef object asmpifspath(object path, char *p[]):\n path = PyOS_FSPath(path)\n path = os_fsencode(path)\n PyBytes_AsStringAndSize(path, p, NULL)\n return path\n\n#------------------------------------------------------------------------------\n","new_contents":"#------------------------------------------------------------------------------\n\ncdef extern from \"Python.h\":\n object PyOS_FSPath(object)\n object PyUnicode_EncodeFSDefault(object)\n\n\ncdef object asmpifspath(object path, char *p[]):\n path = PyOS_FSPath(path)\n if PyUnicode_Check(path):\n path = PyUnicode_EncodeFSDefault(path)\n PyBytes_AsStringAndSize(path, p, NULL)\n return path\n\n#------------------------------------------------------------------------------\n","subject":"Use PyUnicode_EncodeFSDefault() to encode unicode paths","message":"File: Use PyUnicode_EncodeFSDefault() to encode unicode paths\n","lang":"Cython","license":"bsd-2-clause","repos":"mpi4py\/mpi4py,mpi4py\/mpi4py,mpi4py\/mpi4py"} {"commit":"c652a153a2bf10a58d40e22831d73715fcfd3e3f","old_file":"c\/fnv1a.pyx","new_file":"c\/fnv1a.pyx","old_contents":"cdef extern from \"\" nogil:\n ctypedef unsigned long long uint64_t\n\ncdef extern from \"fnv1a.h\":\n void fnv1a(const char *foo, const int length, uint64_t *hash);\n\ncdef class fnv1a64:\n cdef readonly uint64_t h\n\n def __cinit__(self, s=None):\n self.h = 0\n if s is not None:\n fnv1a(s, len(s), &self.h)\n\n cpdef void update(self, const char *s):\n fnv1a(s, len(s), &self.h)\n\n cpdef unsigned long long digest(self):\n return self.h\n\n cpdef char * hexdigest(self):\n return b'%x' % self.h\n","new_contents":"cdef extern from \"\" nogil:\n ctypedef unsigned long long uint64_t\n\ncdef extern from \"fnv1a.h\":\n void fnv1a(const char *foo, const int length, uint64_t *hash)\n\ncdef class fnv1a64:\n\n cdef readonly uint64_t h\n name = \"fnv1a64\"\n digestsize = 8\n digest_size = 8\n\n def __cinit__(self, s=None):\n self.h = 0\n if s is not None:\n fnv1a(s, len(s), &self.h)\n\n cpdef void update(self, const char *s):\n fnv1a(s, len(s), &self.h)\n\n cpdef unsigned long long digest(self):\n return self.h\n\n cpdef char * hexdigest(self):\n return b'%x' % self.h\n\n cpdef void reset(self):\n self.h = 0\n","subject":"Make fnv object more like hashlib hashes","message":"Make fnv object more like hashlib hashes\n","lang":"Cython","license":"cc0-1.0","repos":"sureshsundriyal\/libfnv,sureshsundriyal\/libfnv"} {"commit":"2eaecc4d4d3890bb90d47a80c8c2a3b7fbabc799","old_file":"h5py\/_objects.pxd","new_file":"h5py\/_objects.pxd","old_contents":"# This file is part of h5py, a Python interface to the HDF5 library.\n#\n# http:\/\/www.h5py.org\n#\n# Copyright 2008-2013 Andrew Collette and contributors\n#\n# License: Standard 3-clause BSD; see \"license.txt\" for full license terms\n# and contributor agreement.\n\nfrom defs cimport *\n\ncdef class ObjectID:\n\n cdef object __weakref__\n cdef readonly hid_t id\n cdef public int locked # Cannot be closed, explicitly or auto\n cdef object _hash\n cdef unsigned long _pyid\n\n# Convenience functions\ncdef hid_t pdefault(ObjectID pid)\ncdef int is_h5py_obj_valid(ObjectID obj)\n\n# Inheritance scheme (for top-level cimport and import statements):\n#\n# _objects, _proxy, h5fd, h5z\n# h5i, h5r, utils\n# _conv, h5t, h5s\n# h5p\n# h5d, h5a, h5f, h5g\n# h5l\n\n","new_contents":"# This file is part of h5py, a Python interface to the HDF5 library.\n#\n# http:\/\/www.h5py.org\n#\n# Copyright 2008-2013 Andrew Collette and contributors\n#\n# License: Standard 3-clause BSD; see \"license.txt\" for full license terms\n# and contributor agreement.\n\nfrom defs cimport *\n\ncdef class ObjectID:\n\n cdef object __weakref__\n cdef readonly hid_t id\n cdef public int locked # Cannot be closed, explicitly or auto\n cdef object _hash\n cdef size_t _pyid\n\n# Convenience functions\ncdef hid_t pdefault(ObjectID pid)\ncdef int is_h5py_obj_valid(ObjectID obj)\n\n# Inheritance scheme (for top-level cimport and import statements):\n#\n# _objects, _proxy, h5fd, h5z\n# h5i, h5r, utils\n# _conv, h5t, h5s\n# h5p\n# h5d, h5a, h5f, h5g\n# h5l\n\n","subject":"Use size_t to store Python object id","message":"Use size_t to store Python object id","lang":"Cython","license":"bsd-3-clause","repos":"h5py\/h5py,h5py\/h5py,h5py\/h5py"} {"commit":"4abd62fe543b170cf3cf4b0039077ef752e77d0c","old_file":"av\/video\/plane.pyx","new_file":"av\/video\/plane.pyx","old_contents":"from av.video.frame cimport VideoFrame\n\n\ncdef class VideoPlane(Plane):\n \n def __cinit__(self, VideoFrame frame, int index):\n \n for i in range(frame.format.ptr.nb_components):\n if frame.format.ptr.comp[i].plane == index:\n self.component = frame.format.components[i]\n break\n else:\n raise RuntimeError('could not find plane %d of %r' % (index, frame.format))\n\n self.buffer_size = (abs(self.frame.ptr.linesize[self.index]) \n * self.component.height)\n\n property width:\n \"\"\"Pixel width of this plane.\"\"\"\n def __get__(self):\n return self.component.width\n\n property height:\n \"\"\"Pixel height of this plane.\"\"\"\n def __get__(self):\n return self.component.height\n","new_contents":"from av.video.frame cimport VideoFrame\n\n\ncdef class VideoPlane(Plane):\n \n def __cinit__(self, VideoFrame frame, int index):\n \n for i in range(frame.format.ptr.nb_components):\n if frame.format.ptr.comp[i].plane == index:\n self.component = frame.format.components[i]\n break\n else:\n raise RuntimeError('could not find plane %d of %r' % (index, frame.format))\n\n # Sometimes, linesize is negative (and that is meaningful). We are only\n # insisting that the buffer size be based on the extent of linesize, and\n # ignore it's direction.\n self.buffer_size = abs(self.frame.ptr.linesize[self.index]) * self.component.height\n\n property width:\n \"\"\"Pixel width of this plane.\"\"\"\n def __get__(self):\n return self.component.width\n\n property height:\n \"\"\"Pixel height of this plane.\"\"\"\n def __get__(self):\n return self.component.height\n","subject":"Document the motivation for the fix","message":"Document the motivation for the fix\n","lang":"Cython","license":"bsd-3-clause","repos":"xxr3376\/PyAV,mikeboers\/PyAV,mcpv\/PyAV,PyAV-Org\/PyAV,pupil-labs\/PyAV,markreidvfx\/PyAV,danielballan\/PyAV,xxr3376\/PyAV,pupil-labs\/PyAV,danielballan\/PyAV,pupil-labs\/PyAV,PyAV-Org\/PyAV,mcpv\/PyAV,mikeboers\/PyAV,mcpv\/PyAV,xxr3376\/PyAV,pupil-labs\/PyAV,danielballan\/PyAV,markreidvfx\/PyAV,markreidvfx\/PyAV"} {"commit":"d6bb5f89a46802a8d82eeec04faa1c53addbf8ab","old_file":"tests\/run\/datetime_cimport.pyx","new_file":"tests\/run\/datetime_cimport.pyx","old_contents":"# coding: utf-8\n\n#import datetime\nfrom cpython.datetime cimport date, time, datetime, timedelta, PyDateTime_IMPORT\n\nPyDateTime_IMPORT\n \ndef test_date(int year, int month, int day):\n '''\n >>> val = test_date(2012, 12, 31)\n >>> print(val)\n 2012-12-31\n '''\n val = date(year, month, day)\n return val\n\ndef test_time(int hour, int minute, int second, int microsecond):\n '''\n >>> val = test_time(12, 20, 55, 0)\n >>> print(val)\n 12:20:55\n '''\n val = time(hour, minute, second, microsecond)\n return val\n\ndef test_datetime(int year, int month, int day, int hour, int minute, int second, int microsecond):\n '''\n >>> val = test_datetime(2012, 12, 31, 12, 20, 55, 0)\n >>> print(val)\n 2012-12-31 12:20:55\n '''\n val = datetime(year, month, day, hour, minute, second, microsecond)\n return val\n\ndef test_timedelta(int days, int seconds, int useconds):\n '''\n >>> val = test_timedelta(30, 0, 0)\n >>> print(val)\n 30 days, 0:00:00\n '''\n val = timedelta(days, seconds, useconds)\n return val\n ","new_contents":"# coding: utf-8\n\n#import datetime\nfrom cpython.datetime cimport date, time, datetime, timedelta, PyDateTime_IMPORT\n\nPyDateTime_IMPORT\n \ndef test_date(int year, int month, int day):\n '''\n >>> val = test_date(2012, 12, 31)\n >>> print(val)\n 2012-12-31\n '''\n val = date(year, month, day)\n return val\n\ndef test_time(int hour, int minute, int second, int microsecond):\n '''\n >>> val = test_time(12, 20, 55, 0)\n >>> print(val)\n 12:20:55\n '''\n val = time(hour, minute, second, microsecond)\n return val\n\ndef test_datetime(int year, int month, int day, int hour, int minute, int second, int microsecond):\n '''\n >>> val = test_datetime(2012, 12, 31, 12, 20, 55, 0)\n >>> print(val)\n 2012-12-31 12:20:55\n '''\n val = datetime(year, month, day, hour, minute, second, microsecond)\n return val\n\ndef test_timedelta(int days, int seconds, int useconds):\n '''\n >>> val = test_timedelta(30, 0, 0)\n >>> print(val)\n 30 days, 0:00:00\n '''\n val = timedelta(days, seconds, useconds)\n return val\n","subject":"Add new line at the end of file","message":"Add new line at the end of file\n","lang":"Cython","license":"apache-2.0","repos":"hickford\/cython,ChristopherHogan\/cython,roxyboy\/cython,fabianrost84\/cython,encukou\/cython,JelleZijlstra\/cython,da-woods\/cython,encukou\/cython,andreasvc\/cython,dahebolangkuan\/cython,andreasvc\/cython,achernet\/cython,ABcDexter\/cython,dahebolangkuan\/cython,mrGeen\/cython,slonik-az\/cython,mcanthony\/cython,hhsprings\/cython,hhsprings\/cython,mrGeen\/cython,da-woods\/cython,marscher\/cython,ChristopherHogan\/cython,mcanthony\/cython,cython\/cython,dahebolangkuan\/cython,marscher\/cython,andreasvc\/cython,roxyboy\/cython,c-blake\/cython,roxyboy\/cython,mrGeen\/cython,madjar\/cython,c-blake\/cython,marscher\/cython,slonik-az\/cython,roxyboy\/cython,achernet\/cython,roxyboy\/cython,hickford\/cython,ABcDexter\/cython,scoder\/cython,encukou\/cython,scoder\/cython,madjar\/cython,dahebolangkuan\/cython,JelleZijlstra\/cython,acrispin\/cython,c-blake\/cython,andreasvc\/cython,mrGeen\/cython,madjar\/cython,ABcDexter\/cython,mrGeen\/cython,dahebolangkuan\/cython,acrispin\/cython,da-woods\/cython,fperez\/cython,fabianrost84\/cython,madjar\/cython,JelleZijlstra\/cython,slonik-az\/cython,mcanthony\/cython,hhsprings\/cython,andreasvc\/cython,fabianrost84\/cython,acrispin\/cython,marscher\/cython,cython\/cython,scoder\/cython,da-woods\/cython,acrispin\/cython,fabianrost84\/cython,mcanthony\/cython,acrispin\/cython,scoder\/cython,ABcDexter\/cython,hickford\/cython,marscher\/cython,c-blake\/cython,hhsprings\/cython,c-blake\/cython,fabianrost84\/cython,slonik-az\/cython,slonik-az\/cython,encukou\/cython,JelleZijlstra\/cython,fperez\/cython,hickford\/cython,fperez\/cython,achernet\/cython,ABcDexter\/cython,fperez\/cython,cython\/cython,cython\/cython,achernet\/cython,JelleZijlstra\/cython,mcanthony\/cython,achernet\/cython,encukou\/cython,hickford\/cython,hhsprings\/cython,fperez\/cython,ChristopherHogan\/cython,madjar\/cython"} {"commit":"6666867bfba0bbf6cdb3667a57807e434f1e7f3e","old_file":"tests\/run\/cyfunction.pyx","new_file":"tests\/run\/cyfunction.pyx","old_contents":"# cython: binding=True\n# mode: run\n# tag: cyfunction\n\ndef test_dict():\n \"\"\"\n >>> test_dict.foo = 123\n >>> test_dict.__dict__\n {'foo': 123}\n \"\"\"\n\ndef test_name():\n \"\"\"\n >>> test_name.__name__\n 'test_name'\n \"\"\"\n\ndef test_reduce():\n \"\"\"\n >>> import pickle\n >>> pickle.loads(pickle.dumps(test_reduce))()\n 'Hello, world!'\n \"\"\"\n return 'Hello, world!'\n\ndef test_method(self):\n return self\n\nclass BindingTest:\n \"\"\"\n >>> BindingTest.test_method = test_method\n >>> BindingTest.test_method() #doctest:+ELLIPSIS\n Traceback (most recent call last):\n TypeError: ...\n >>> BindingTest().test_method()\n \n \"\"\"\n def __repr__(self):\n return ''\n","new_contents":"# cython: binding=True\n# mode: run\n# tag: cyfunction\n\ndef test_dict():\n \"\"\"\n >>> test_dict.foo = 123\n >>> test_dict.__dict__\n {'foo': 123}\n >>> test_dict.__dict__ = {'bar': 321}\n >>> test_dict.__dict__\n {'bar': 321}\n >>> test_dict.func_dict\n {'bar': 321}\n \"\"\"\n\ndef test_name():\n \"\"\"\n >>> test_name.__name__\n 'test_name'\n >>> test_name.func_name\n 'test_name'\n >>> test_name.__name__ = 123 #doctest:+ELLIPSIS\n Traceback (most recent call last):\n TypeError: __name__ must be set to a ... object\n >>> test_name.__name__ = 'foo'\n >>> test_name.__name__\n 'foo'\n \"\"\"\n\ndef test_doc():\n \"\"\"\n >>> del test_doc.__doc__\n >>> test_doc.__doc__\n >>> test_doc.__doc__ = 'docstring'\n >>> test_doc.__doc__\n 'docstring'\n >>> test_doc.func_doc\n 'docstring'\n \"\"\"\n\ndef test_reduce():\n \"\"\"\n >>> import pickle\n >>> pickle.loads(pickle.dumps(test_reduce))()\n 'Hello, world!'\n \"\"\"\n return 'Hello, world!'\n\ndef test_method(self):\n return self\n\nclass BindingTest:\n \"\"\"\n >>> BindingTest.test_method = test_method\n >>> BindingTest.test_method() #doctest:+ELLIPSIS\n Traceback (most recent call last):\n TypeError: ...\n >>> BindingTest().test_method()\n \n \"\"\"\n def __repr__(self):\n return ''\n","subject":"Add some more test cases","message":"Add some more test cases\n","lang":"Cython","license":"apache-2.0","repos":"slonik-az\/cython,larsmans\/cython,mrGeen\/cython,c-blake\/cython,JelleZijlstra\/cython,fperez\/cython,slonik-az\/cython,ABcDexter\/cython,rguillebert\/CythonCTypesBackend,hhsprings\/cython,larsmans\/cython,c-blake\/cython,dahebolangkuan\/cython,dahebolangkuan\/cython,hickford\/cython,ABcDexter\/cython,encukou\/cython,acrispin\/cython,larsmans\/cython,ABcDexter\/cython,hickford\/cython,roxyboy\/cython,hickford\/cython,hhsprings\/cython,roxyboy\/cython,JelleZijlstra\/cython,cython\/cython,fperez\/cython,acrispin\/cython,larsmans\/cython,scoder\/cython,madjar\/cython,JelleZijlstra\/cython,mrGeen\/cython,roxyboy\/cython,mcanthony\/cython,achernet\/cython,hhsprings\/cython,andreasvc\/cython,dahebolangkuan\/cython,larsmans\/cython,acrispin\/cython,madjar\/cython,fperez\/cython,fperez\/cython,achernet\/cython,JelleZijlstra\/cython,dahebolangkuan\/cython,mcanthony\/cython,da-woods\/cython,ABcDexter\/cython,encukou\/cython,scoder\/cython,c-blake\/cython,hpfem\/cython,rguillebert\/CythonCTypesBackend,hickford\/cython,hickford\/cython,hpfem\/cython,slonik-az\/cython,ChristopherHogan\/cython,scoder\/cython,acrispin\/cython,encukou\/cython,dahebolangkuan\/cython,madjar\/cython,mrGeen\/cython,mcanthony\/cython,cython\/cython,andreasvc\/cython,rguillebert\/CythonCTypesBackend,hpfem\/cython,fperez\/cython,fabianrost84\/cython,andreasvc\/cython,slonik-az\/cython,ABcDexter\/cython,marscher\/cython,fabianrost84\/cython,mcanthony\/cython,achernet\/cython,encukou\/cython,marscher\/cython,JelleZijlstra\/cython,marscher\/cython,andreasvc\/cython,c-blake\/cython,hpfem\/cython,acrispin\/cython,fabianrost84\/cython,c-blake\/cython,slonik-az\/cython,marscher\/cython,roxyboy\/cython,ChristopherHogan\/cython,mrGeen\/cython,marscher\/cython,da-woods\/cython,achernet\/cython,hhsprings\/cython,encukou\/cython,da-woods\/cython,andreasvc\/cython,da-woods\/cython,mcanthony\/cython,ChristopherHogan\/cython,scoder\/cython,fabianrost84\/cython,hpfem\/cython,fabianrost84\/cython,rguillebert\/CythonCTypesBackend,roxyboy\/cython,madjar\/cython,mrGeen\/cython,madjar\/cython,cython\/cython,hhsprings\/cython,achernet\/cython,cython\/cython"} {"commit":"37014a98700167001b14f1aa83f7e24b8ca1b6c9","old_file":"astropy\/table\/_column_mixins.pyx","new_file":"astropy\/table\/_column_mixins.pyx","old_contents":"import sys\nimport numpy as np\ncimport numpy as cnp\n\n\nif sys.version_info[0] == 3:\n INTEGER_TYPES = (int, np.integer)\nelse:\n INTEGER_TYPES = (int, long, np.integer)\n\n\n# Annoying boilerplate that we shouldn't have to write; Cython should\n# have this built in (some versions do, but the ctypedefs are still lacking,\n# or what is available is Cython version dependent)\nctypedef object (*binaryfunc)(object, object)\n\n\ncdef extern from \"Python.h\":\n ctypedef struct PyMappingMethods:\n binaryfunc mp_subscript\n\n ctypedef struct PyTypeObject:\n PyMappingMethods* tp_as_mapping\n\n\nndarray = np.ndarray\nctypedef cnp.ndarray ndarray_t\n\n\ncdef class _ColumnGetitemShim:\n def __getitem__(self, item):\n if (self).ndim > 1 and isinstance(item, INTEGER_TYPES):\n return self.data[item]\n else:\n return (ndarray).tp_as_mapping.mp_subscript(self, item)\n\n\nMaskedArray = np.ma.MaskedArray\n\n\ncdef class _MaskedColumnGetitemShim(_ColumnGetitemShim):\n def __getitem__(self, item):\n if (self).ndim > 1 and isinstance(item, INTEGER_TYPES):\n return self.data[item]\n else:\n return MaskedArray.__getitem__(self, item)\n","new_contents":"import sys\nimport numpy as np\n\n\nif sys.version_info[0] == 3:\n INTEGER_TYPES = (int, np.integer)\nelse:\n INTEGER_TYPES = (int, long, np.integer)\n\n\n# Annoying boilerplate that we shouldn't have to write; Cython should\n# have this built in (some versions do, but the ctypedefs are still lacking,\n# or what is available is Cython version dependent)\nctypedef object (*binaryfunc)(object, object)\n\n\ncdef extern from \"Python.h\":\n ctypedef struct PyMappingMethods:\n binaryfunc mp_subscript\n\n ctypedef struct PyTypeObject:\n PyMappingMethods* tp_as_mapping\n\n\ncdef extern from \"numpy\/arrayobject.h\":\n ctypedef class numpy.ndarray [object PyArrayObject]:\n cdef int ndim \"nd\"\n\n\ncdef class _ColumnGetitemShim:\n def __getitem__(self, item):\n if (self).ndim > 1 and isinstance(item, INTEGER_TYPES):\n return self.data[item]\n else:\n return (ndarray).tp_as_mapping.mp_subscript(self, item)\n\n\nMaskedArray = np.ma.MaskedArray\n\n\ncdef class _MaskedColumnGetitemShim(_ColumnGetitemShim):\n def __getitem__(self, item):\n if (self).ndim > 1 and isinstance(item, INTEGER_TYPES):\n return self.data[item]\n else:\n return MaskedArray.__getitem__(self, item)\n","subject":"Use a very minimal typedef of the ndarray class (the only struct member we need access to in this code is 'nd')--this allows us to avoid a global variable lookup of 'ndarray' when calling 'ndarray.tp_as_mapping.mp_subscript'. Now, in the common case of ndim==1, Column (but not MaskedColumn) adds virtually no overhead compared to the built-in __getitem__.","message":"Use a very minimal typedef of the ndarray class (the only struct member we need access to in this code is 'nd')--this allows us to avoid a global variable lookup of 'ndarray' when calling 'ndarray.tp_as_mapping.mp_subscript'. Now, in the common case of ndim==1, Column (but not MaskedColumn) adds virtually no overhead compared to the built-in __getitem__.\n","lang":"Cython","license":"bsd-3-clause","repos":"aleksandr-bakanov\/astropy,kelle\/astropy,funbaker\/astropy,aleksandr-bakanov\/astropy,joergdietrich\/astropy,kelle\/astropy,tbabej\/astropy,StuartLittlefair\/astropy,pllim\/astropy,dhomeier\/astropy,stargaser\/astropy,dhomeier\/astropy,saimn\/astropy,MSeifert04\/astropy,lpsinger\/astropy,larrybradley\/astropy,larrybradley\/astropy,aleksandr-bakanov\/astropy,DougBurke\/astropy,saimn\/astropy,lpsinger\/astropy,larrybradley\/astropy,stargaser\/astropy,mhvk\/astropy,pllim\/astropy,MSeifert04\/astropy,saimn\/astropy,mhvk\/astropy,dhomeier\/astropy,StuartLittlefair\/astropy,mhvk\/astropy,MSeifert04\/astropy,kelle\/astropy,bsipocz\/astropy,bsipocz\/astropy,lpsinger\/astropy,tbabej\/astropy,MSeifert04\/astropy,funbaker\/astropy,kelle\/astropy,bsipocz\/astropy,mhvk\/astropy,AustereCuriosity\/astropy,astropy\/astropy,funbaker\/astropy,bsipocz\/astropy,pllim\/astropy,AustereCuriosity\/astropy,joergdietrich\/astropy,astropy\/astropy,stargaser\/astropy,pllim\/astropy,mhvk\/astropy,DougBurke\/astropy,lpsinger\/astropy,stargaser\/astropy,tbabej\/astropy,astropy\/astropy,DougBurke\/astropy,dhomeier\/astropy,dhomeier\/astropy,funbaker\/astropy,DougBurke\/astropy,lpsinger\/astropy,tbabej\/astropy,saimn\/astropy,saimn\/astropy,StuartLittlefair\/astropy,tbabej\/astropy,pllim\/astropy,larrybradley\/astropy,StuartLittlefair\/astropy,astropy\/astropy,astropy\/astropy,AustereCuriosity\/astropy,joergdietrich\/astropy,AustereCuriosity\/astropy,joergdietrich\/astropy,joergdietrich\/astropy,aleksandr-bakanov\/astropy,StuartLittlefair\/astropy,kelle\/astropy,AustereCuriosity\/astropy,larrybradley\/astropy"} {"commit":"e59e51e330b756b42d781a9f2d4d816cf40d46cf","old_file":"tests\/compile\/fused_redeclare_T3111.pyx","new_file":"tests\/compile\/fused_redeclare_T3111.pyx","old_contents":"# ticket: 3111\n# mode: compile\n# tag: warnings\n\nctypedef unsigned char npy_uint8\nctypedef unsigned short npy_uint16\n\n\nctypedef fused dtype_t:\n npy_uint8\n\nctypedef fused dtype_t_out:\n npy_uint8\n npy_uint16\n\n\ndef foo(dtype_t[:] a, dtype_t_out[:, :] b):\n pass\n\n\n# The primary thing we're trying to test here is the _absence_ of the warning\n# \"__pyxutil:16:4: '___pyx_npy_uint8' redeclared\". The remaining warnings are\n# unrelated to this test.\n_WARNINGS = \"\"\"\n20:10: 'cpdef_method' redeclared\n31:10: 'cpdef_cname_method' redeclared\n446:72: Argument evaluation order in C function call is undefined and may not be as expected\n446:72: Argument evaluation order in C function call is undefined and may not be as expected\n749:34: Argument evaluation order in C function call is undefined and may not be as expected\n749:34: Argument evaluation order in C function call is undefined and may not be as expected\n\"\"\"\n","new_contents":"# ticket: 3111\n# mode: compile\n# tag: warnings\n\nctypedef unsigned char npy_uint8\nctypedef unsigned short npy_uint16\n\n\nctypedef fused dtype_t:\n npy_uint8\n\nctypedef fused dtype_t_out:\n npy_uint8\n npy_uint16\n\n\ndef foo(dtype_t[:] a, dtype_t_out[:, :] b):\n pass\n\n\n# The primary thing we're trying to test here is the _absence_ of the warning\n# \"__pyxutil:16:4: '___pyx_npy_uint8' redeclared\". The remaining warnings are\n# unrelated to this test.\n_WARNINGS = \"\"\"\n22:10: 'cpdef_method' redeclared\n33:10: 'cpdef_cname_method' redeclared\n446:72: Argument evaluation order in C function call is undefined and may not be as expected\n446:72: Argument evaluation order in C function call is undefined and may not be as expected\n749:34: Argument evaluation order in C function call is undefined and may not be as expected\n749:34: Argument evaluation order in C function call is undefined and may not be as expected\n943:27: Ambiguous exception value, same as default return value: 0\n943:27: Ambiguous exception value, same as default return value: 0\n974:29: Ambiguous exception value, same as default return value: 0\n974:29: Ambiguous exception value, same as default return value: 0\n1002:46: Ambiguous exception value, same as default return value: 0\n1002:46: Ambiguous exception value, same as default return value: 0\n1092:29: Ambiguous exception value, same as default return value: 0\n1092:29: Ambiguous exception value, same as default return value: 0\n\"\"\"\n","subject":"Revert \"Fix test.\" (which only applied to the 0.29.x branch).","message":"Revert \"Fix test.\" (which only applied to the 0.29.x branch).\n\nThis reverts commit bfcaf163e3dcf472ef2af5dec6ac3fffd0d34e66.\n","lang":"Cython","license":"apache-2.0","repos":"cython\/cython,da-woods\/cython,scoder\/cython,cython\/cython,scoder\/cython,da-woods\/cython,scoder\/cython,scoder\/cython,da-woods\/cython,da-woods\/cython,cython\/cython,cython\/cython"} {"commit":"1a3916bc4580f10e0b634a83fa6b81d6d37f12b4","old_file":"src\/python\/grpcio\/grpc\/_cython\/_cygrpc\/aio\/grpc_aio.pyx.pxi","new_file":"src\/python\/grpcio\/grpc\/_cython\/_cygrpc\/aio\/grpc_aio.pyx.pxi","old_contents":"# Copyright 2019 gRPC authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\ncdef bint _grpc_aio_initialized = 0\n\n\ndef init_grpc_aio():\n global _grpc_aio_initialized\n\n if _grpc_aio_initialized:\n return\n\n install_asyncio_iomgr()\n grpc_init()\n\n # Timers are triggered by the Asyncio loop. We disable\n # the background thread that is being used by the native\n # gRPC iomgr.\n grpc_timer_manager_set_threading(0)\n\n # gRPC callbaks are executed within the same thread used by the Asyncio\n # event loop, as it is being done by the other Asyncio callbacks.\n Executor.SetThreadingAll(0)\n\n _grpc_aio_initialized = 1\n","new_contents":"# Copyright 2019 gRPC authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\ncdef bint _grpc_aio_initialized = 0\n\n\ndef init_grpc_aio():\n global _grpc_aio_initialized\n\n if _grpc_aio_initialized:\n return\n\n install_asyncio_iomgr()\n grpc_init()\n\n # Timers are triggered by the Asyncio loop. We disable\n # the background thread that is being used by the native\n # gRPC iomgr.\n grpc_timer_manager_set_threading(False)\n\n # gRPC callbaks are executed within the same thread used by the Asyncio\n # event loop, as it is being done by the other Asyncio callbacks.\n Executor.SetThreadingAll(False)\n\n _grpc_aio_initialized = 1\n","subject":"Use False instead 0 for bint","message":"Use False instead 0 for bint\n","lang":"Cython","license":"apache-2.0","repos":"jtattermusch\/grpc,jboeuf\/grpc,ctiller\/grpc,muxi\/grpc,nicolasnoble\/grpc,firebase\/grpc,donnadionne\/grpc,donnadionne\/grpc,nicolasnoble\/grpc,donnadionne\/grpc,firebase\/grpc,firebase\/grpc,grpc\/grpc,jtattermusch\/grpc,ejona86\/grpc,firebase\/grpc,stanley-cheung\/grpc,nicolasnoble\/grpc,ejona86\/grpc,ejona86\/grpc,ejona86\/grpc,grpc\/grpc,donnadionne\/grpc,jtattermusch\/grpc,nicolasnoble\/grpc,stanley-cheung\/grpc,ejona86\/grpc,donnadionne\/grpc,grpc\/grpc,grpc\/grpc,ejona86\/grpc,jtattermusch\/grpc,stanley-cheung\/grpc,firebase\/grpc,donnadionne\/grpc,jtattermusch\/grpc,jboeuf\/grpc,stanley-cheung\/grpc,donnadionne\/grpc,firebase\/grpc,jtattermusch\/grpc,donnadionne\/grpc,donnadionne\/grpc,firebase\/grpc,ejona86\/grpc,jboeuf\/grpc,grpc\/grpc,nicolasnoble\/grpc,donnadionne\/grpc,jboeuf\/grpc,grpc\/grpc,stanley-cheung\/grpc,vjpai\/grpc,jtattermusch\/grpc,grpc\/grpc,vjpai\/grpc,vjpai\/grpc,ejona86\/grpc,vjpai\/grpc,muxi\/grpc,jboeuf\/grpc,ctiller\/grpc,muxi\/grpc,ctiller\/grpc,ejona86\/grpc,firebase\/grpc,ctiller\/grpc,vjpai\/grpc,muxi\/grpc,jboeuf\/grpc,ejona86\/grpc,grpc\/grpc,nicolasnoble\/grpc,stanley-cheung\/grpc,ctiller\/grpc,donnadionne\/grpc,stanley-cheung\/grpc,ctiller\/grpc,ctiller\/grpc,stanley-cheung\/grpc,jboeuf\/grpc,jboeuf\/grpc,ctiller\/grpc,firebase\/grpc,vjpai\/grpc,muxi\/grpc,ctiller\/grpc,muxi\/grpc,vjpai\/grpc,nicolasnoble\/grpc,muxi\/grpc,jboeuf\/grpc,grpc\/grpc,vjpai\/grpc,donnadionne\/grpc,vjpai\/grpc,muxi\/grpc,nicolasnoble\/grpc,ctiller\/grpc,nicolasnoble\/grpc,grpc\/grpc,stanley-cheung\/grpc,muxi\/grpc,grpc\/grpc,ejona86\/grpc,jtattermusch\/grpc,muxi\/grpc,nicolasnoble\/grpc,nicolasnoble\/grpc,jboeuf\/grpc,nicolasnoble\/grpc,firebase\/grpc,jboeuf\/grpc,ctiller\/grpc,firebase\/grpc,jtattermusch\/grpc,jtattermusch\/grpc,firebase\/grpc,grpc\/grpc,vjpai\/grpc,vjpai\/grpc,stanley-cheung\/grpc,stanley-cheung\/grpc,vjpai\/grpc,stanley-cheung\/grpc,muxi\/grpc,jboeuf\/grpc,ejona86\/grpc,jtattermusch\/grpc,ctiller\/grpc,muxi\/grpc,jtattermusch\/grpc"} {"commit":"867c0598565ed6b9fdae43d6c9431974d692cd44","old_file":"cytoolz\/__init__.pxd","new_file":"cytoolz\/__init__.pxd","old_contents":"from .itertoolz cimport (groupby, frequencies, reduceby,\n first, second, nth, take, drop, rest, last,\n get, concat, concatv, isdistinct, interleave,\n interpose, unique, isiterable, remove, iterate,\n accumulate, partition, count, cons, take_nth)\n\nfrom .functoolz cimport (memoize, c_memoize, curry, c_compose, c_thread_first,\n c_thread_last, identity, c_pipe, complement, c_juxt,\n do)\n\nfrom .dicttoolz cimport (c_merge, c_merge_with, keymap, valmap, assoc,\n keyfilter, valfilter)\n","new_contents":"from cytoolz.itertoolz cimport (\n accumulate, cons, count, drop, get, groupby, first, frequencies,\n interleave, interpose, isdistinct, isiterable, iterate, last, nth,\n partition, reduceby, remove, rest, second, take, take_nth, unique)\n\n\nfrom cytoolz.functoolz cimport (\n c_compose, c_juxt, c_memoize, c_pipe, c_thread_first, c_thread_last,\n complement, curry, do, identity, memoize)\n\n\nfrom cytoolz.dicttoolz cimport (\n assoc, c_merge, c_merge_with, keyfilter, keymap, valfilter, valmap)\n","subject":"Use absolute `cimport` in *.pxd files. Relative cimporting doesn't appear to work.","message":"Use absolute `cimport` in *.pxd files. Relative cimporting doesn't appear to work.\n\nAlso, alphabetize import in \"cytoolz\/__init__.pxd\" (just because). The main\nreason we don't do `from cytoolz.itertoolz cimport *` is so there is a quick\nand easy reference for what is cimport-able.\n","lang":"Cython","license":"bsd-3-clause","repos":"cpcloud\/cytoolz,ljwolf\/cytoolz,llllllllll\/cytoolz,simudream\/cytoolz,simudream\/cytoolz,llllllllll\/cytoolz,cpcloud\/cytoolz"} {"commit":"69890b58d5b192f7718583f32e6973041e1d08c0","old_file":"tests\/errors\/e_del.pyx","new_file":"tests\/errors\/e_del.pyx","old_contents":"# mode: error\n\ncdef struct S:\n int m\n\ndef f(a):\n cdef int i, x[2]\n cdef S s\n global j\n del f() # error\n del i # error: deletion of non-Python object\n del j # error: deletion of non-Python object\n del x[i] # error: deletion of non-Python object\n del s.m # error: deletion of non-Python object\n_ERRORS = u\"\"\"\n10:9: Cannot assign to or delete this\n11:48: Deletion of non-Python, non-C++ object\n13:9: Deletion of non-Python, non-C++ object\n14:9: Deletion of non-Python, non-C++ object\n\"\"\"\n","new_contents":"# mode: error\n\ncdef struct S:\n int m\n\ndef f(a):\n cdef int i, x[2]\n cdef S s\n global j\n del f() # error\n del i # error: deletion of non-Python object\n del j # error: deletion of non-Python object\n del x[i] # error: deletion of non-Python object\n del s.m # error: deletion of non-Python object\n\ndef outer(a):\n def inner():\n print a\n del a\n return inner()\n\n\n_ERRORS = u\"\"\"\n10:9: Cannot assign to or delete this\n11:48: Deletion of non-Python, non-C++ object\n13:9: Deletion of non-Python, non-C++ object\n14:9: Deletion of non-Python, non-C++ object\n19:9: can not delete variable 'a' referenced in nested scope\n\"\"\"\n","subject":"Add testcase for closure variable deletion","message":"Add testcase for closure variable deletion\n","lang":"Cython","license":"apache-2.0","repos":"cython\/cython,c-blake\/cython,ABcDexter\/cython,hickford\/cython,larsmans\/cython,hhsprings\/cython,acrispin\/cython,larsmans\/cython,fabianrost84\/cython,mcanthony\/cython,hpfem\/cython,slonik-az\/cython,andreasvc\/cython,slonik-az\/cython,hhsprings\/cython,fabianrost84\/cython,fabianrost84\/cython,da-woods\/cython,encukou\/cython,c-blake\/cython,hpfem\/cython,achernet\/cython,achernet\/cython,achernet\/cython,encukou\/cython,fperez\/cython,fabianrost84\/cython,acrispin\/cython,fperez\/cython,madjar\/cython,cython\/cython,slonik-az\/cython,encukou\/cython,andreasvc\/cython,cython\/cython,mrGeen\/cython,c-blake\/cython,marscher\/cython,achernet\/cython,madjar\/cython,roxyboy\/cython,da-woods\/cython,madjar\/cython,dahebolangkuan\/cython,scoder\/cython,hpfem\/cython,dahebolangkuan\/cython,hhsprings\/cython,fperez\/cython,ChristopherHogan\/cython,roxyboy\/cython,larsmans\/cython,rguillebert\/CythonCTypesBackend,roxyboy\/cython,ABcDexter\/cython,hickford\/cython,c-blake\/cython,scoder\/cython,slonik-az\/cython,rguillebert\/CythonCTypesBackend,scoder\/cython,dahebolangkuan\/cython,larsmans\/cython,acrispin\/cython,roxyboy\/cython,JelleZijlstra\/cython,scoder\/cython,ChristopherHogan\/cython,madjar\/cython,acrispin\/cython,encukou\/cython,dahebolangkuan\/cython,roxyboy\/cython,ABcDexter\/cython,marscher\/cython,achernet\/cython,ABcDexter\/cython,hhsprings\/cython,mcanthony\/cython,hpfem\/cython,mrGeen\/cython,acrispin\/cython,andreasvc\/cython,mcanthony\/cython,larsmans\/cython,fperez\/cython,andreasvc\/cython,da-woods\/cython,hpfem\/cython,mrGeen\/cython,rguillebert\/CythonCTypesBackend,JelleZijlstra\/cython,ABcDexter\/cython,mcanthony\/cython,dahebolangkuan\/cython,encukou\/cython,ChristopherHogan\/cython,c-blake\/cython,marscher\/cython,mrGeen\/cython,fabianrost84\/cython,slonik-az\/cython,da-woods\/cython,rguillebert\/CythonCTypesBackend,madjar\/cython,cython\/cython,andreasvc\/cython,hickford\/cython,marscher\/cython,mrGeen\/cython,mcanthony\/cython,fperez\/cython,JelleZijlstra\/cython,JelleZijlstra\/cython,hickford\/cython,hickford\/cython,hhsprings\/cython,marscher\/cython,JelleZijlstra\/cython"} {"commit":"9ae2f5ff84117c3eea317387436364dcfd328bc6","old_file":"tests\/compile\/min_async.pyx","new_file":"tests\/compile\/min_async.pyx","old_contents":"# Need to include all utility code !\n\nasync def sleep(x):\n pass\n\n\nasync def call():\n await sleep(1)\n yield\n","new_contents":"# mode: compile\n# tag: pep492, await\n\n# Need to include all utility code !\n\nasync def sleep(x):\n pass\n\n\nasync def call():\n await sleep(1)\n yield\n","subject":"Fix test setup for compile-only test file.","message":"Fix test setup for compile-only test file.\n","lang":"Cython","license":"apache-2.0","repos":"da-woods\/cython,scoder\/cython,da-woods\/cython,scoder\/cython,cython\/cython,cython\/cython,cython\/cython,da-woods\/cython,scoder\/cython,scoder\/cython,da-woods\/cython,cython\/cython"} {"commit":"79125fae06273b42a3993b9635be43fff3d1d146","old_file":"pyinform\/pyinform.pyx","new_file":"pyinform\/pyinform.pyx","old_contents":"cimport cython.array\ncimport numpy\nimport numpy\n\ncdef extern from \"stdint.h\":\n ctypedef unsigned long uint64_t\n\ncdef extern from \"inform\/time_series.h\":\n double inform_active_info(const uint64_t* series, size_t n, uint64_t base, uint64_t k)\n\ndef activeinfo(xs, uint64_t k, uint64_t b = 0):\n if len(xs) == 0:\n raise ValueError(\"active information not defined on empty containers\")\n\n if b < 2:\n b = max(2,max(xs)+1)\n\n cdef uint64_t [:] ys = numpy.asarray(xs, dtype=numpy.uint64)\n return inform_active_info(&ys[0], len(xs), b, k)\n","new_contents":"cimport cython.array\ncimport numpy\nimport numpy\n\ncdef extern from \"stdint.h\":\n ctypedef unsigned long uint64_t\n\ncdef extern from \"inform\/time_series.h\":\n double inform_active_info(const uint64_t* series, size_t n, uint64_t base, uint64_t k)\n\ndef activeinfo(xs, uint64_t k, uint64_t b = 0):\n from math import isnan\n\n if len(xs) < k+1 or len(xs) == 0:\n raise ValueError(\"container is too short ({0}) for history length ({1})\".format(len(xs),k))\n\n if k == 0:\n raise ValueError(\"history length is too short\")\n\n if b < 2:\n b = max(2,max(xs)+1)\n\n cdef uint64_t [:] ys = numpy.asarray(xs, dtype=numpy.uint64)\n ai = inform_active_info(&ys[0], len(xs), b, k)\n\n if isnan(ai):\n raise ValueError(\"invalid active information computed (NaN)\")\n return ai\n","subject":"Update code to pass tests","message":"Update code to pass tests\n","lang":"Cython","license":"mit","repos":"ELIFE-ASU\/PyInform"} {"commit":"39c44884a47b730d0a9b832cbe299a67a65c23f7","old_file":"thinc\/typedefs.pxd","new_file":"thinc\/typedefs.pxd","old_contents":"from libc.stdint cimport uint64_t\nfrom libc.stdint cimport uint32_t\nfrom libc.stdint cimport uint16_t\nfrom libc.stdint cimport int32_t\n\n\nctypedef double weight_t\nctypedef uint64_t atom_t\nctypedef uint64_t feat_t\nctypedef uint64_t hash_t\nctypedef int32_t class_t\nctypedef uint32_t count_t\nctypedef uint32_t time_t\nctypedef int32_t len_t\nctypedef int32_t idx_t\n\n\n","new_contents":"from libc.stdint cimport uint64_t\nfrom libc.stdint cimport uint32_t\nfrom libc.stdint cimport uint16_t\nfrom libc.stdint cimport int32_t\n\n\nctypedef float weight_t\nctypedef uint64_t atom_t\nctypedef uint64_t feat_t\nctypedef uint64_t hash_t\nctypedef int32_t class_t\nctypedef uint32_t count_t\nctypedef uint32_t time_t\nctypedef int32_t len_t\nctypedef int32_t idx_t\n\n\n","subject":"Use 32 bit floats, not 64 bit.","message":"Use 32 bit floats, not 64 bit.\n","lang":"Cython","license":"mit","repos":"spacy-io\/thinc,explosion\/thinc,spacy-io\/thinc,explosion\/thinc,spacy-io\/thinc,explosion\/thinc,explosion\/thinc"} {"commit":"bb94c0e50f3825957194280babe7280863b00cde","old_file":"tests\/errors\/cpdef_vars.pyx","new_file":"tests\/errors\/cpdef_vars.pyx","old_contents":"# tag: warnings\n\ncpdef str a = \"123\"\ncpdef b = 2\n\ncdef class C:\n cpdef float c\n\ndef func():\n cpdef d=C()\n return d\n\n_WARNINGS = \"\"\"\n3:6: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables\n4:6: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables\n7:10: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables\n10:10: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables\n\"\"\"\n","new_contents":"# tag: warnings\n\ncpdef str a = \"123\"\ncpdef b = 2\n\ncdef class C:\n cpdef float c\n\ndef func():\n \"\"\"\n >>> c = func()\n >>> isinstance(c, C) or c\n True\n \"\"\"\n cpdef d = C()\n return d\n\n\n_WARNINGS = \"\"\"\n3:6: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables\n4:6: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables\n7:10: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables\n15:10: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables\n\"\"\"\n","subject":"Make a working test actually test something.","message":"Make a working test actually test something.\n","lang":"Cython","license":"apache-2.0","repos":"da-woods\/cython,scoder\/cython,cython\/cython,da-woods\/cython,cython\/cython,scoder\/cython,scoder\/cython,da-woods\/cython,cython\/cython,cython\/cython,scoder\/cython,da-woods\/cython"} {"commit":"274a4d4272c63ec8b38e2bf168ac6725cb1ae3a9","old_file":"spacy\/syntax\/stateclass.pyx","new_file":"spacy\/syntax\/stateclass.pyx","old_contents":"from libc.string cimport memcpy, memset\nfrom libc.stdint cimport uint32_t\nfrom ..vocab cimport EMPTY_LEXEME\nfrom ..structs cimport Entity\nfrom ..lexeme cimport Lexeme\nfrom ..symbols cimport punct\nfrom ..attrs cimport IS_SPACE\n\n\ncdef class StateClass:\n def __init__(self, int length):\n cdef Pool mem = Pool()\n self.mem = mem\n\n def __dealloc__(self):\n del self.c\n\n @property\n def stack(self):\n return {self.S(i) for i in range(self.c._s_i)}\n\n @property\n def queue(self):\n return {self.B(i) for i in range(self.c._b_i)}\n\n def print_state(self, words):\n words = list(words) + ['_']\n top = words[self.S(0)] + '_%d' % self.S_(0).head\n second = words[self.S(1)] + '_%d' % self.S_(1).head\n third = words[self.S(2)] + '_%d' % self.S_(2).head\n n0 = words[self.B(0)] \n n1 = words[self.B(1)] \n return ' '.join((third, second, top, '|', n0, n1))\n","new_contents":"from libc.string cimport memcpy, memset\nfrom libc.stdint cimport uint32_t\nfrom ..vocab cimport EMPTY_LEXEME\nfrom ..structs cimport Entity\nfrom ..lexeme cimport Lexeme\nfrom ..symbols cimport punct\nfrom ..attrs cimport IS_SPACE\n\n\ncdef class StateClass:\n def __init__(self, int length):\n cdef Pool mem = Pool()\n self.mem = mem\n\n def __dealloc__(self):\n del self.c\n\n @property\n def stack(self):\n return {self.S(i) for i in range(self.c._s_i)}\n\n @property\n def queue(self):\n return {self.B(i) for i in range(self.c.buffer_length())}\n\n def print_state(self, words):\n words = list(words) + ['_']\n top = words[self.S(0)] + '_%d' % self.S_(0).head\n second = words[self.S(1)] + '_%d' % self.S_(1).head\n third = words[self.S(2)] + '_%d' % self.S_(2).head\n n0 = words[self.B(0)] \n n1 = words[self.B(1)] \n return ' '.join((third, second, top, '|', n0, n1))\n","subject":"Fix queue Python property in StateClass","message":"Fix queue Python property in StateClass\n","lang":"Cython","license":"mit","repos":"Gregory-Howard\/spaCy,recognai\/spaCy,oroszgy\/spaCy.hu,recognai\/spaCy,recognai\/spaCy,explosion\/spaCy,spacy-io\/spaCy,raphael0202\/spaCy,Gregory-Howard\/spaCy,spacy-io\/spaCy,raphael0202\/spaCy,aikramer2\/spaCy,banglakit\/spaCy,spacy-io\/spaCy,oroszgy\/spaCy.hu,aikramer2\/spaCy,Gregory-Howard\/spaCy,honnibal\/spaCy,honnibal\/spaCy,recognai\/spaCy,banglakit\/spaCy,raphael0202\/spaCy,explosion\/spaCy,spacy-io\/spaCy,banglakit\/spaCy,spacy-io\/spaCy,oroszgy\/spaCy.hu,recognai\/spaCy,oroszgy\/spaCy.hu,recognai\/spaCy,raphael0202\/spaCy,Gregory-Howard\/spaCy,Gregory-Howard\/spaCy,spacy-io\/spaCy,banglakit\/spaCy,Gregory-Howard\/spaCy,raphael0202\/spaCy,raphael0202\/spaCy,aikramer2\/spaCy,aikramer2\/spaCy,explosion\/spaCy,aikramer2\/spaCy,oroszgy\/spaCy.hu,aikramer2\/spaCy,oroszgy\/spaCy.hu,banglakit\/spaCy,explosion\/spaCy,explosion\/spaCy,explosion\/spaCy,honnibal\/spaCy,banglakit\/spaCy,honnibal\/spaCy"} {"commit":"257bf381065274a9498673708915ce034d54a38a","old_file":"tests\/compile\/fused_redeclare_T3111.pyx","new_file":"tests\/compile\/fused_redeclare_T3111.pyx","old_contents":"# ticket: 3111\n# mode: compile\n# tag: warnings\n\nctypedef unsigned char npy_uint8\nctypedef unsigned short npy_uint16\n\n\nctypedef fused dtype_t:\n npy_uint8\n\nctypedef fused dtype_t_out:\n npy_uint8\n npy_uint16\n\n\ndef foo(dtype_t[:] a, dtype_t_out[:, :] b):\n pass\n\n\n# The primary thing we're trying to test here is the _absence_ of the warning\n# \"__pyxutil:16:4: '___pyx_npy_uint8' redeclared\". The remaining warnings are\n# unrelated to this test.\n_WARNINGS = \"\"\"\n# cpdef redeclaration bug\n22:10: 'cpdef_method' redeclared\n33:10: 'cpdef_cname_method' redeclared\n# from MemoryView.pyx\n974:29: Ambiguous exception value, same as default return value: 0\n974:29: Ambiguous exception value, same as default return value: 0\n1001:46: Ambiguous exception value, same as default return value: 0\n1001:46: Ambiguous exception value, same as default return value: 0\n1091:29: Ambiguous exception value, same as default return value: 0\n1091:29: Ambiguous exception value, same as default return value: 0\n\"\"\"\n","new_contents":"# ticket: 3111\n# mode: compile\n# tag: warnings\n\nctypedef unsigned char npy_uint8\nctypedef unsigned short npy_uint16\n\n\nctypedef fused dtype_t:\n npy_uint8\n\nctypedef fused dtype_t_out:\n npy_uint8\n npy_uint16\n\n\ndef foo(dtype_t[:] a, dtype_t_out[:, :] b):\n pass\n\n\n# The primary thing we're trying to test here is the _absence_ of the warning\n# \"__pyxutil:16:4: '___pyx_npy_uint8' redeclared\". The remaining warnings are\n# unrelated to this test.\n_WARNINGS = \"\"\"\n# cpdef redeclaration bug\n22:10: 'cpdef_method' redeclared\n33:10: 'cpdef_cname_method' redeclared\n# from MemoryView.pyx\n981:29: Ambiguous exception value, same as default return value: 0\n981:29: Ambiguous exception value, same as default return value: 0\n1008:46: Ambiguous exception value, same as default return value: 0\n1008:46: Ambiguous exception value, same as default return value: 0\n1098:29: Ambiguous exception value, same as default return value: 0\n1098:29: Ambiguous exception value, same as default return value: 0\n\"\"\"\n","subject":"Fix unrelated test after changing MemoryView.pyx.","message":"Fix unrelated test after changing MemoryView.pyx.\n","lang":"Cython","license":"apache-2.0","repos":"scoder\/cython,da-woods\/cython,da-woods\/cython,cython\/cython,cython\/cython,scoder\/cython,scoder\/cython,da-woods\/cython,cython\/cython,cython\/cython,da-woods\/cython,scoder\/cython"} {"commit":"a498d5231adb20b8677aee18ea2cd643b1c41bcd","old_file":"tests\/memoryview\/extension_type_memoryview.pyx","new_file":"tests\/memoryview\/extension_type_memoryview.pyx","old_contents":"","new_contents":"# mode: run\n# tag: numpy\n\nimport numpy as np\n\n\ncdef class ExtensionType(object):\n cdef public int dummy\n\n def __init__(self, n):\n self.dummy = n\n\nitems = [ExtensionType(1), ExtensionType(2)]\ncdef ExtensionType[:] view = np.array(items, dtype=ExtensionType)\n\ndef test_getitem():\n \"\"\"\n >>> test_getitem()\n 1\n 2\n \"\"\"\n for i in range(view.shape[0]):\n item = view[i]\n print item.dummy\n\ndef test_getitem_typed():\n \"\"\"\n >>> test_getitem_typed()\n 1\n 2\n \"\"\"\n cdef ExtensionType item\n for i in range(view.shape[0]):\n item = view[i]\n print item.dummy\n","subject":"Add test for memoryview of extension type","message":"Add test for memoryview of extension type\n\nA test for a bug fixed in commit 478b939a4c99a77c0863cfd.\n\nv2: add commit link above\nv3: # tag: instead of # tags:, drop cpp tag as it means something different\n that I originally thought\n\nThere was a bug that produced C code where gcc emitted warnings:\nextension_type_memoryview.c: In function ‘__pyx_pf_25extension_type_memoryview_test_getitem’:\nextension_type_memoryview.c:1468:15: warning: assignment from incompatible pointer type\nextension_type_memoryview.c: In function ‘__pyx_pf_25extension_type_memoryview_2test_getitem_typed’:\nextension_type_memoryview.c:1565:15: warning: assignment from incompatible pointer type\nextension_type_memoryview.c:1568:18: warning: assignment from incompatible pointer type\n\nAnd g++ failed with errors:\nextension_type_memoryview.c: In function ‘PyObject* __pyx_pf_25extension_type_memoryview_test_getitem(PyObject*)’:\nextension_type_memoryview.c:1468:213: error: cannot convert ‘__pyx_obj_25extension_type_memoryview_ExtensionType*’ to ‘PyObject*’ in assignment\nextension_type_memoryview.c: In function ‘PyObject* __pyx_pf_25extension_type_memoryview_2test_getitem_typed(PyObject*)’:\nextension_type_memoryview.c:1565:213: error: cannot convert ‘__pyx_obj_25extension_type_memoryview_ExtensionType*’ to ‘PyObject*’ in assignment\nextension_type_memoryview.c:1568:20: error: cannot convert ‘PyObject*’ to ‘__pyx_obj_25extension_type_memoryview_ExtensionType*’ in assignment\n\n--HG--\nextra : transplant_source : %02N%D4%B99N%D6%FBv%7C%F0%94%E5%BE%CE%C9t%D6%04%11\n","lang":"Cython","license":"apache-2.0","repos":"encukou\/cython,scoder\/cython,ChristopherHogan\/cython,achernet\/cython,fperez\/cython,c-blake\/cython,da-woods\/cython,fabianrost84\/cython,andreasvc\/cython,achernet\/cython,JelleZijlstra\/cython,madjar\/cython,achernet\/cython,c-blake\/cython,c-blake\/cython,ABcDexter\/cython,madjar\/cython,ABcDexter\/cython,mrGeen\/cython,andreasvc\/cython,ABcDexter\/cython,fabianrost84\/cython,encukou\/cython,hhsprings\/cython,marscher\/cython,fperez\/cython,roxyboy\/cython,marscher\/cython,scoder\/cython,JelleZijlstra\/cython,ABcDexter\/cython,dahebolangkuan\/cython,dahebolangkuan\/cython,hickford\/cython,cython\/cython,acrispin\/cython,encukou\/cython,encukou\/cython,acrispin\/cython,slonik-az\/cython,dahebolangkuan\/cython,ChristopherHogan\/cython,fabianrost84\/cython,marscher\/cython,mcanthony\/cython,c-blake\/cython,cython\/cython,slonik-az\/cython,fperez\/cython,mrGeen\/cython,acrispin\/cython,hickford\/cython,JelleZijlstra\/cython,acrispin\/cython,roxyboy\/cython,marscher\/cython,slonik-az\/cython,da-woods\/cython,mcanthony\/cython,dahebolangkuan\/cython,mcanthony\/cython,acrispin\/cython,mcanthony\/cython,achernet\/cython,encukou\/cython,hickford\/cython,JelleZijlstra\/cython,cython\/cython,mcanthony\/cython,ChristopherHogan\/cython,cython\/cython,da-woods\/cython,fabianrost84\/cython,marscher\/cython,roxyboy\/cython,madjar\/cython,fabianrost84\/cython,ABcDexter\/cython,da-woods\/cython,JelleZijlstra\/cython,andreasvc\/cython,scoder\/cython,madjar\/cython,hhsprings\/cython,roxyboy\/cython,scoder\/cython,mrGeen\/cython,hickford\/cython,mrGeen\/cython,hhsprings\/cython,c-blake\/cython,slonik-az\/cython,fperez\/cython,dahebolangkuan\/cython,hhsprings\/cython,achernet\/cython,andreasvc\/cython,slonik-az\/cython,mrGeen\/cython,fperez\/cython,roxyboy\/cython,hhsprings\/cython,madjar\/cython,andreasvc\/cython,hickford\/cython"} {"commit":"92f424fc9919ddd8a37a2f1286ed05af28f068b1","old_file":"tests\/run\/uninitialized.pyx","new_file":"tests\/run\/uninitialized.pyx","old_contents":"","new_contents":"# mode: run\n# tag: control-flow, uninitialized\n\ndef conditional(cond):\n \"\"\"\n >>> conditional(True)\n []\n >>> conditional(False)\n Traceback (most recent call last):\n ...\n UnboundLocalError: a\n \"\"\"\n if cond:\n a = []\n return a\n\ndef inside_loop(iter):\n \"\"\"\n >>> inside_loop([1,2,3])\n 3\n >>> inside_loop([])\n Traceback (most recent call last):\n ...\n UnboundLocalError: i\n \"\"\"\n for i in iter:\n pass\n return i\n\ndef try_except(cond):\n \"\"\"\n >>> try_except(True)\n []\n >>> try_except(False)\n Traceback (most recent call last):\n ...\n UnboundLocalError: a\n \"\"\"\n try:\n if cond:\n a = []\n raise ValueError\n except ValueError:\n return a\n\ndef try_finally(cond):\n \"\"\"\n >>> try_finally(True)\n []\n >>> try_finally(False)\n Traceback (most recent call last):\n ...\n UnboundLocalError: a\n \"\"\"\n try:\n if cond:\n a = []\n raise ValueError\n finally:\n return a\n","subject":"Add some simple run tests for control-flow","message":"Add some simple run tests for control-flow\n","lang":"Cython","license":"apache-2.0","repos":"fperez\/cython,ABcDexter\/cython,cython\/cython,roxyboy\/cython,madjar\/cython,hpfem\/cython,scoder\/cython,dahebolangkuan\/cython,hpfem\/cython,andreasvc\/cython,andreasvc\/cython,fperez\/cython,fabianrost84\/cython,hhsprings\/cython,encukou\/cython,ChristopherHogan\/cython,JelleZijlstra\/cython,dahebolangkuan\/cython,scoder\/cython,mrGeen\/cython,mcanthony\/cython,cython\/cython,mrGeen\/cython,slonik-az\/cython,ABcDexter\/cython,da-woods\/cython,hpfem\/cython,dahebolangkuan\/cython,fabianrost84\/cython,slonik-az\/cython,ChristopherHogan\/cython,fperez\/cython,hpfem\/cython,JelleZijlstra\/cython,hickford\/cython,rguillebert\/CythonCTypesBackend,hickford\/cython,dahebolangkuan\/cython,hhsprings\/cython,roxyboy\/cython,slonik-az\/cython,ABcDexter\/cython,scoder\/cython,ABcDexter\/cython,hickford\/cython,andreasvc\/cython,marscher\/cython,madjar\/cython,marscher\/cython,achernet\/cython,roxyboy\/cython,madjar\/cython,acrispin\/cython,hickford\/cython,marscher\/cython,c-blake\/cython,marscher\/cython,fperez\/cython,acrispin\/cython,JelleZijlstra\/cython,larsmans\/cython,mrGeen\/cython,ChristopherHogan\/cython,roxyboy\/cython,larsmans\/cython,c-blake\/cython,encukou\/cython,fabianrost84\/cython,c-blake\/cython,achernet\/cython,fabianrost84\/cython,hhsprings\/cython,mcanthony\/cython,achernet\/cython,rguillebert\/CythonCTypesBackend,acrispin\/cython,mcanthony\/cython,da-woods\/cython,larsmans\/cython,cython\/cython,cython\/cython,c-blake\/cython,hpfem\/cython,JelleZijlstra\/cython,encukou\/cython,larsmans\/cython,roxyboy\/cython,slonik-az\/cython,c-blake\/cython,marscher\/cython,fperez\/cython,achernet\/cython,mcanthony\/cython,fabianrost84\/cython,larsmans\/cython,achernet\/cython,hhsprings\/cython,mcanthony\/cython,rguillebert\/CythonCTypesBackend,JelleZijlstra\/cython,acrispin\/cython,encukou\/cython,slonik-az\/cython,madjar\/cython,ABcDexter\/cython,hhsprings\/cython,rguillebert\/CythonCTypesBackend,mrGeen\/cython,acrispin\/cython,da-woods\/cython,scoder\/cython,hickford\/cython,mrGeen\/cython,madjar\/cython,encukou\/cython,andreasvc\/cython,andreasvc\/cython,dahebolangkuan\/cython,da-woods\/cython"} {"commit":"b9793d157364b5d3102fcebd90ef8e86b8a0f5c9","old_file":"pyglsl_parser\/pyglsl_parser.pyx","new_file":"pyglsl_parser\/pyglsl_parser.pyx","old_contents":"","new_contents":"# distutils: language = c++\n# distutils: extra_compile_args = -fno-rtti -fno-exceptions\n\nfrom enum import IntEnum\n\nfrom libcpp cimport bool\nfrom libcpp.vector cimport vector\nfrom cython.operator import dereference\n\nclass ShaderType(IntEnum):\n Compute = 0\n Vertex = 1\n TessControl = 2\n TessEvaluation = 3\n Geometry = 4\n Fragment = 5\n\n\ncdef extern from '..\/glsl-parser\/ast.h' namespace 'glsl':\n cdef cppclass astType:\n bool builtin\n\n cdef cppclass astBuiltin:\n int type\n\n cdef cppclass astFunction:\n char* name\n astType* returnType\n bool isPrototype\n\n cdef cppclass astTU:\n astTU(int type)\n vector[astFunction*] functions\n\n\ncdef extern from '..\/glsl-parser\/parser.h' namespace 'glsl':\n cdef cppclass parser:\n parser(const char* source, const char* fileName)\n astTU* parse(int type)\n const char* error() const\n\n\ncdef class Parser:\n cdef parser* c_parser\n\n def __cinit__(self, source, filename=''):\n self.c_parser = new parser(source.encode(), filename.encode())\n\n def __dealloc__(self):\n del self.c_parser\n\n def parse(self, shader_type):\n c_ast = self.c_parser.parse(int(shader_type))\n if c_ast:\n ast = Ast()\n ast.c_ast = c_ast\n return ast\n else:\n return None\n\n def error(self):\n return self.c_parser.error().decode()\n\n\ncdef class Ast:\n cdef astTU* c_ast\n\n def functions(self):\n for c_function in self.c_ast.functions:\n func = Function()\n func.c_function = c_function\n yield func\n\n\ncdef class Type:\n # TODO, not sure how this is supposed to be done\n cdef astType* c_type\n\n def builtin(self):\n return self.c_type.builtin\n\n def __repr__(self):\n if self.builtin():\n c_builtin = (self.c_type)\n return 'TODO, typen={}'.format(c_builtin.type)\n else:\n raise NotImplementedError()\n\n\ncdef class Function:\n cdef astFunction* c_function\n\n def name(self):\n return self.c_function.name.decode()\n\n def is_prototype(self):\n return self.c_function.isPrototype\n\n def return_type(self):\n typ = Type()\n typ.c_type = self.c_function.returnType\n return typ\n\n def __repr__(self):\n body = ';' if self.is_prototype() else '{...}'\n return '{ret} {name}(){body}'.format(ret=self.return_type(),\n name=self.name(),\n body=body)\n","subject":"Add initial Cython pyx file for glsl-parser","message":"Add initial Cython pyx file for glsl-parser\n","lang":"Cython","license":"mit","repos":"nicholasbishop\/pyglsl_parser,nicholasbishop\/pyglsl_parser"} {"commit":"587d7b15e321e9b445251fdd54b36eef224578be","old_file":"include\/miniutils.pyx","new_file":"include\/miniutils.pyx","old_contents":"","new_contents":"cdef public int broadcast_arrays(list arrays, tuple broadcast_shape, int ndim,\n cnp.npy_intp **shape_out,\n cnp.npy_intp **strides_out) except -1:\n \"\"\"\n Broadcast the given arrays. Returns the total broadcast shape of size\n ndim in shape_out. Returns the strides for each array in strides_out\n in an array of size len(arrays) * ndim.\n\n Note: Leading broadcasting dimensions should not have strides if the\n minivect function was compiled using an array type with less\n dimensions than `ndim`. Instead, the actual strides should be given\n without leading zero strides.\n \"\"\"\n cdef cnp.ndarray array\n cdef int i, j, start, stop\n\n cdef cnp.npy_intp *shape = stdlib.malloc(\n ndim * sizeof(cnp.npy_intp))\n cdef cnp.npy_intp *strides_list = stdlib.malloc(\n len(arrays) * ndim * sizeof(cnp.npy_intp))\n\n if shape == NULL or strides_list == NULL:\n raise MemoryError\n\n # Build a shape list of size ndim\n for i in range(ndim):\n shape[i] = broadcast_shape[i]\n\n # Build a strides list for all arrays of size ndim\n for i, array in enumerate(arrays):\n start = i * ndim\n\n if array.ndim < ndim:\n # broadcast leading dimensions\n for j in range(start, start + ndim - array.ndim):\n strides_list[j] = 0\n start = j\n\n for j in range(ndim):\n if array.shape[j] == 1:\n strides_list[start + j] = 0\n else:\n strides_list[start + j] = cnp.PyArray_STRIDE(array, j)\n\n # for j in range(ndim):\n # print 'shape%d:' % j, shape[j]\n\n # for i in range(len(arrays)):\n # for j in range(ndim):\n # print 'stride%d:' % j, strides_list[i * ndim + j]\n # print\n\n shape_out[0] = shape\n strides_out[0] = strides_list\n return 0\n\ncdef public bint is_broadcasting(list arrays, broadcast) except -1:\n for array in arrays:\n if broadcast.nd != array.ndim or array.shape != broadcast.shape:\n return True\n\n return False\n\n","subject":"Add some broadcasting Cython utilities","message":"Add some broadcasting Cython utilities\n","lang":"Cython","license":"bsd-2-clause","repos":"markflorisson\/minivect,markflorisson\/minivect"} {"commit":"9ca8c125c2e575a7d7cf1c22b5f909f322228468","old_file":"tests\/run\/temps_corner1.pyx","new_file":"tests\/run\/temps_corner1.pyx","old_contents":"","new_contents":"__doc__ = \"\"\"\n >>> B().coeffs_bitsize()\n [2]\n\"\"\"\n\ncdef class A:\n def numerator(self):\n return self\n\ncdef int bitsize(A a):\n return 1\n \ncoeffs = [A()]\n\nclass B:\n def coeffs_bitsize(self):\n r = [bitsize(c.numerator())+1 for c in coeffs]\n return r\n","subject":"Add corner case temp (de)allocation test.","message":"Add corner case temp (de)allocation test.\n\nThis is as simple as I could get it.\n","lang":"Cython","license":"apache-2.0","repos":"hickford\/cython,acrispin\/cython,madjar\/cython,mrGeen\/cython,hhsprings\/cython,mcanthony\/cython,ABcDexter\/cython,scoder\/cython,encukou\/cython,roxyboy\/cython,encukou\/cython,andreasvc\/cython,dahebolangkuan\/cython,da-woods\/cython,scoder\/cython,bzzzz\/cython,ABcDexter\/cython,mrGeen\/cython,c-blake\/cython,rguillebert\/CythonCTypesBackend,hpfem\/cython,slonik-az\/cython,c-blake\/cython,marscher\/cython,fabianrost84\/cython,larsmans\/cython,da-woods\/cython,fabianrost84\/cython,dahebolangkuan\/cython,marscher\/cython,c-blake\/cython,hhsprings\/cython,mrGeen\/cython,achernet\/cython,acrispin\/cython,marscher\/cython,hickford\/cython,cython\/cython,achernet\/cython,fabianrost84\/cython,encukou\/cython,c-blake\/cython,slonik-az\/cython,cython\/cython,dahebolangkuan\/cython,da-woods\/cython,madjar\/cython,hpfem\/cython,andreasvc\/cython,ABcDexter\/cython,ChristopherHogan\/cython,bzzzz\/cython,hickford\/cython,ABcDexter\/cython,hhsprings\/cython,rguillebert\/CythonCTypesBackend,JelleZijlstra\/cython,ChristopherHogan\/cython,fperez\/cython,dahebolangkuan\/cython,da-woods\/cython,mcanthony\/cython,scoder\/cython,marscher\/cython,slonik-az\/cython,dahebolangkuan\/cython,hhsprings\/cython,fperez\/cython,achernet\/cython,cython\/cython,slonik-az\/cython,bzzzz\/cython,JelleZijlstra\/cython,fperez\/cython,encukou\/cython,roxyboy\/cython,roxyboy\/cython,fabianrost84\/cython,cython\/cython,marscher\/cython,madjar\/cython,roxyboy\/cython,ChristopherHogan\/cython,hickford\/cython,bzzzz\/cython,JelleZijlstra\/cython,hpfem\/cython,andreasvc\/cython,larsmans\/cython,acrispin\/cython,fperez\/cython,encukou\/cython,mrGeen\/cython,andreasvc\/cython,c-blake\/cython,mrGeen\/cython,hickford\/cython,larsmans\/cython,achernet\/cython,fabianrost84\/cython,hpfem\/cython,JelleZijlstra\/cython,madjar\/cython,acrispin\/cython,roxyboy\/cython,JelleZijlstra\/cython,mcanthony\/cython,scoder\/cython,hpfem\/cython,fperez\/cython,andreasvc\/cython,larsmans\/cython,slonik-az\/cython,achernet\/cython,acrispin\/cython,hhsprings\/cython,ABcDexter\/cython,rguillebert\/CythonCTypesBackend,rguillebert\/CythonCTypesBackend,larsmans\/cython,madjar\/cython,mcanthony\/cython,mcanthony\/cython"} {"commit":"e997bb99ddc0d26e9a95ad53c2fa52f4932b93ef","old_file":"tests\/run\/cpp_move.pyx","new_file":"tests\/run\/cpp_move.pyx","old_contents":"","new_contents":"# mode: run\n# tag: cpp, werror, cpp11\n\nfrom libcpp cimport nullptr\nfrom libcpp.memory cimport shared_ptr, make_shared\nfrom libcpp.utility cimport move\nfrom cython.operator cimport dereference\n\ncdef extern from *:\n \"\"\"\n #include \n\n template const char* move_helper(T&) { return \"lvalue-ref\"; }\n template const char* move_helper(T&&) { return \"rvalue-ref\"; }\n \"\"\"\n const char* move_helper[T](T)\n\ndef test_move_assignment():\n \"\"\"\n >>> test_move_assignment()\n \"\"\"\n cdef shared_ptr[int] p1, p2\n p1 = make_shared[int](1337)\n p2 = move(p1)\n assert p1 == nullptr\n assert dereference(p2) == 1337\n\ndef test_move_func_call():\n \"\"\"\n >>> test_move_func_call()\n \"\"\"\n cdef shared_ptr[int] p\n assert move_helper(p) == b'lvalue-ref'\n assert move_helper(move(p)) == b'rvalue-ref'\n","subject":"Add tests for std::move wrapper","message":"Add tests for std::move wrapper\n","lang":"Cython","license":"apache-2.0","repos":"da-woods\/cython,cython\/cython,cython\/cython,scoder\/cython,da-woods\/cython,cython\/cython,da-woods\/cython,scoder\/cython,scoder\/cython,da-woods\/cython,cython\/cython,scoder\/cython"} {"commit":"457f38f98c6a67c6ee87cab9e2e3094f7655da35","old_file":"tests\/errors\/w_cdef_override.pyx","new_file":"tests\/errors\/w_cdef_override.pyx","old_contents":"","new_contents":"# mode: error\n# tags: werror\n\ncdef foo():\n pass\n\ndef foo():\n pass\n\n_ERRORS = u\"\"\"\n7:0: 'foo' redeclared\n7:0: Overriding cdef method with def method.\n\"\"\"\n","subject":"Add simple test for cdef override warning","message":"Add simple test for cdef override warning\n","lang":"Cython","license":"apache-2.0","repos":"da-woods\/cython,mcanthony\/cython,dahebolangkuan\/cython,slonik-az\/cython,mcanthony\/cython,c-blake\/cython,hickford\/cython,scoder\/cython,acrispin\/cython,ABcDexter\/cython,roxyboy\/cython,JelleZijlstra\/cython,hhsprings\/cython,slonik-az\/cython,fperez\/cython,andreasvc\/cython,hpfem\/cython,achernet\/cython,mrGeen\/cython,madjar\/cython,dahebolangkuan\/cython,JelleZijlstra\/cython,acrispin\/cython,fperez\/cython,slonik-az\/cython,ABcDexter\/cython,hpfem\/cython,mrGeen\/cython,hickford\/cython,mcanthony\/cython,hpfem\/cython,cython\/cython,scoder\/cython,hickford\/cython,fabianrost84\/cython,c-blake\/cython,encukou\/cython,marscher\/cython,mcanthony\/cython,dahebolangkuan\/cython,acrispin\/cython,larsmans\/cython,JelleZijlstra\/cython,achernet\/cython,hhsprings\/cython,rguillebert\/CythonCTypesBackend,cython\/cython,achernet\/cython,c-blake\/cython,andreasvc\/cython,madjar\/cython,ChristopherHogan\/cython,andreasvc\/cython,andreasvc\/cython,fperez\/cython,dahebolangkuan\/cython,c-blake\/cython,ABcDexter\/cython,hickford\/cython,marscher\/cython,cython\/cython,fperez\/cython,ChristopherHogan\/cython,acrispin\/cython,marscher\/cython,encukou\/cython,slonik-az\/cython,hhsprings\/cython,fabianrost84\/cython,c-blake\/cython,mrGeen\/cython,fabianrost84\/cython,roxyboy\/cython,encukou\/cython,roxyboy\/cython,acrispin\/cython,larsmans\/cython,cython\/cython,rguillebert\/CythonCTypesBackend,achernet\/cython,marscher\/cython,madjar\/cython,hickford\/cython,madjar\/cython,encukou\/cython,rguillebert\/CythonCTypesBackend,mcanthony\/cython,mrGeen\/cython,da-woods\/cython,JelleZijlstra\/cython,JelleZijlstra\/cython,rguillebert\/CythonCTypesBackend,ABcDexter\/cython,fabianrost84\/cython,larsmans\/cython,madjar\/cython,fperez\/cython,scoder\/cython,achernet\/cython,mrGeen\/cython,hpfem\/cython,encukou\/cython,larsmans\/cython,da-woods\/cython,dahebolangkuan\/cython,slonik-az\/cython,fabianrost84\/cython,ABcDexter\/cython,hhsprings\/cython,scoder\/cython,da-woods\/cython,roxyboy\/cython,roxyboy\/cython,andreasvc\/cython,larsmans\/cython,hpfem\/cython,hhsprings\/cython,ChristopherHogan\/cython,marscher\/cython"} {"commit":"2d75b4bfcc0b34bc43dea8dc22bcad37e6d25143","old_file":"tests\/run\/unicode_slicing.pyx","new_file":"tests\/run\/unicode_slicing.pyx","old_contents":"","new_contents":"# coding=utf-8\n__doc__ = u\"\"\"\n >>> do_slice(u'abcdef', 2, 3)\n (u'c', u'cdef', u'ab', u'abcdef')\n >>> do_slice(u'abcdef', 0, 5)\n (u'abcde', u'abcdef', u'', u'abcdef')\n\"\"\"\n\nimport sys\n\nif sys.version_info[0] >= 3:\n __doc__ = __doc__.replace(u\"(u'\", u\"('\").replace(u\" u'\", u\" '\")\n\ndef do_slice(unicode s, int i, int j):\n return s[i:j], s[i:], s[:i], s[:]\n\n","subject":"Add support for unicode slicing","message":"Add support for unicode slicing\n","lang":"Cython","license":"apache-2.0","repos":"acrispin\/cython,scoder\/cython,roxyboy\/cython,cython\/cython,encukou\/cython,marscher\/cython,fperez\/cython,hhsprings\/cython,c-blake\/cython,slonik-az\/cython,hhsprings\/cython,fabianrost84\/cython,fabianrost84\/cython,cython\/cython,ChristopherHogan\/cython,acrispin\/cython,c-blake\/cython,dahebolangkuan\/cython,JelleZijlstra\/cython,da-woods\/cython,cython\/cython,ABcDexter\/cython,achernet\/cython,fperez\/cython,roxyboy\/cython,fabianrost84\/cython,hickford\/cython,scoder\/cython,marscher\/cython,slonik-az\/cython,mcanthony\/cython,slonik-az\/cython,hickford\/cython,acrispin\/cython,ABcDexter\/cython,slonik-az\/cython,mrGeen\/cython,mcanthony\/cython,madjar\/cython,mcanthony\/cython,madjar\/cython,marscher\/cython,madjar\/cython,fperez\/cython,JelleZijlstra\/cython,acrispin\/cython,c-blake\/cython,c-blake\/cython,acrispin\/cython,dahebolangkuan\/cython,fabianrost84\/cython,scoder\/cython,fperez\/cython,marscher\/cython,JelleZijlstra\/cython,dahebolangkuan\/cython,madjar\/cython,scoder\/cython,marscher\/cython,cython\/cython,andreasvc\/cython,c-blake\/cython,hickford\/cython,dahebolangkuan\/cython,encukou\/cython,achernet\/cython,mcanthony\/cython,encukou\/cython,hickford\/cython,ABcDexter\/cython,achernet\/cython,hhsprings\/cython,encukou\/cython,encukou\/cython,JelleZijlstra\/cython,roxyboy\/cython,andreasvc\/cython,ABcDexter\/cython,mcanthony\/cython,ChristopherHogan\/cython,roxyboy\/cython,mrGeen\/cython,mrGeen\/cython,roxyboy\/cython,madjar\/cython,andreasvc\/cython,da-woods\/cython,fperez\/cython,ChristopherHogan\/cython,andreasvc\/cython,da-woods\/cython,mrGeen\/cython,achernet\/cython,dahebolangkuan\/cython,da-woods\/cython,andreasvc\/cython,ABcDexter\/cython,JelleZijlstra\/cython,hhsprings\/cython,mrGeen\/cython,achernet\/cython,slonik-az\/cython,hickford\/cython,fabianrost84\/cython,hhsprings\/cython"} {"commit":"6c4108c0732494186b7e19d63173809d9859fdb8","old_file":"spacy\/syntax\/beam_parser.pxd","new_file":"spacy\/syntax\/beam_parser.pxd","old_contents":"","new_contents":"from .parser cimport Parser\nfrom ..structs cimport TokenC\nfrom thinc.typedefs cimport weight_t\n\n\ncdef class BeamParser(Parser):\n cdef public int beam_width\n cdef public weight_t beam_density\n\n cdef int _parseC(self, TokenC* tokens, int length, int nr_feat, int nr_class) except -1\n","subject":"Add header for beam parser","message":"Add header for beam parser\n","lang":"Cython","license":"mit","repos":"explosion\/spaCy,honnibal\/spaCy,oroszgy\/spaCy.hu,honnibal\/spaCy,spacy-io\/spaCy,oroszgy\/spaCy.hu,explosion\/spaCy,raphael0202\/spaCy,spacy-io\/spaCy,Gregory-Howard\/spaCy,explosion\/spaCy,Gregory-Howard\/spaCy,explosion\/spaCy,raphael0202\/spaCy,raphael0202\/spaCy,raphael0202\/spaCy,spacy-io\/spaCy,honnibal\/spaCy,raphael0202\/spaCy,aikramer2\/spaCy,recognai\/spaCy,Gregory-Howard\/spaCy,spacy-io\/spaCy,Gregory-Howard\/spaCy,recognai\/spaCy,recognai\/spaCy,recognai\/spaCy,Gregory-Howard\/spaCy,aikramer2\/spaCy,aikramer2\/spaCy,spacy-io\/spaCy,Gregory-Howard\/spaCy,oroszgy\/spaCy.hu,honnibal\/spaCy,recognai\/spaCy,aikramer2\/spaCy,oroszgy\/spaCy.hu,explosion\/spaCy,aikramer2\/spaCy,raphael0202\/spaCy,oroszgy\/spaCy.hu,oroszgy\/spaCy.hu,aikramer2\/spaCy,recognai\/spaCy,spacy-io\/spaCy,explosion\/spaCy"} {"commit":"6a1f92925df1d5de702aae1072ab02d212d7db26","old_file":"tests\/run\/pytype.pyx","new_file":"tests\/run\/pytype.pyx","old_contents":"","new_contents":"from cpython.type cimport PyType_IsSubtype\n\nclass mylist(list): pass\n\ndef test_issubtype(a, b):\n \"\"\"\n >>> test_issubtype(mylist, list)\n True\n >>> test_issubtype(mylist, dict)\n False\n\n >>> o = object()\n >>> test_issubtype(o, list)\n Traceback (most recent call last):\n ...\n TypeError: Cannot convert object to type\n \"\"\"\n return PyType_IsSubtype(a, b)\n","subject":"Add run test for type ctypedef and PyType_IsSubtype.","message":"Add run test for type ctypedef and PyType_IsSubtype.\n","lang":"Cython","license":"apache-2.0","repos":"roxyboy\/cython,fabianrost84\/cython,larsmans\/cython,hhsprings\/cython,ABcDexter\/cython,mrGeen\/cython,slonik-az\/cython,roxyboy\/cython,slonik-az\/cython,hickford\/cython,cython\/cython,encukou\/cython,JelleZijlstra\/cython,c-blake\/cython,mcanthony\/cython,cython\/cython,ChristopherHogan\/cython,roxyboy\/cython,achernet\/cython,hickford\/cython,hhsprings\/cython,c-blake\/cython,ChristopherHogan\/cython,andreasvc\/cython,achernet\/cython,da-woods\/cython,fperez\/cython,fabianrost84\/cython,acrispin\/cython,madjar\/cython,roxyboy\/cython,mcanthony\/cython,andreasvc\/cython,da-woods\/cython,JelleZijlstra\/cython,marscher\/cython,dahebolangkuan\/cython,fperez\/cython,marscher\/cython,hickford\/cython,acrispin\/cython,fabianrost84\/cython,madjar\/cython,JelleZijlstra\/cython,encukou\/cython,acrispin\/cython,fabianrost84\/cython,mrGeen\/cython,marscher\/cython,hickford\/cython,cython\/cython,scoder\/cython,roxyboy\/cython,ABcDexter\/cython,madjar\/cython,JelleZijlstra\/cython,encukou\/cython,dahebolangkuan\/cython,hhsprings\/cython,andreasvc\/cython,slonik-az\/cython,ABcDexter\/cython,mcanthony\/cython,dahebolangkuan\/cython,acrispin\/cython,c-blake\/cython,scoder\/cython,cython\/cython,slonik-az\/cython,andreasvc\/cython,hickford\/cython,mrGeen\/cython,da-woods\/cython,larsmans\/cython,fabianrost84\/cython,andreasvc\/cython,madjar\/cython,fperez\/cython,marscher\/cython,c-blake\/cython,acrispin\/cython,larsmans\/cython,achernet\/cython,slonik-az\/cython,larsmans\/cython,mrGeen\/cython,ABcDexter\/cython,achernet\/cython,da-woods\/cython,mcanthony\/cython,achernet\/cython,encukou\/cython,hhsprings\/cython,fperez\/cython,madjar\/cython,JelleZijlstra\/cython,mrGeen\/cython,c-blake\/cython,ChristopherHogan\/cython,marscher\/cython,dahebolangkuan\/cython,ABcDexter\/cython,dahebolangkuan\/cython,hhsprings\/cython,scoder\/cython,mcanthony\/cython,scoder\/cython,encukou\/cython,larsmans\/cython,fperez\/cython"} {"commit":"cf9ba53a0e3635074b2117f471d6741f3a2396ba","old_file":"folly\/python\/range.pxd","new_file":"folly\/python\/range.pxd","old_contents":"","new_contents":"cdef extern from \"folly\/Range.h\" namespace \"folly\":\n cdef cppclass Range[T]:\n Range()\n Range(T, int)\n T data()\n int size()\n\nctypedef Range[const char*] StringPiece\nctypedef Range[const unsigned char*] ByteRange\n\nctypedef fused R:\n StringPiece\n ByteRange\n\n# Conversion Helpers\ncdef inline bytes to_bytes(R range):\n return range.data()[:range.size()]\n","subject":"Add ByteRange\/StringPiece Conversion for Cython","message":"Add ByteRange\/StringPiece Conversion for Cython\n\nSummary:\nMoving the cython definition to folly\/python.\nAdding simple conversion helper to_bytes\n\nThis is to cut down on duplicate folly::range cython definitions\n\nReviewed By: yfeldblum\n\nDifferential Revision: D6291125\n\nfbshipit-source-id: 314b732a1516a03fb5c9a57939552bbabd81970b\n","lang":"Cython","license":"apache-2.0","repos":"Orvid\/folly,facebook\/folly,Orvid\/folly,rklabs\/folly,rklabs\/folly,Orvid\/folly,facebook\/folly,Orvid\/folly,rklabs\/folly,facebook\/folly,rklabs\/folly,Orvid\/folly,facebook\/folly,facebook\/folly,rklabs\/folly"} {"commit":"25e9a252fb59c273c9a9578a3520270b9688fe67","old_file":"numba\/exttypes\/inheritance_prototype.pyx","new_file":"numba\/exttypes\/inheritance_prototype.pyx","old_contents":"","new_contents":"\"\"\"\nThis demo depicts how we can support overriding of numba methods in python.\nIn Cython, cpdef methods check to see if the object has a dict, and if so\nlook up the method at runtime and dispatch if found:\n\n cpdef mymethod(self):\n if hasattr(self, '__dict__'):\n return self.mymethod()\n\n \n\nThis is needed for calls that go through the vtable, and hence hit the\ninherited Cython version, but not the Python one (see the 'obj.mymethod' call\nof a typed object below in 'func').\n\nWe can use a metaclass to detect overridden methods and patch the vtable (\ncreate a new one for each class). We can further detect monkey-patching on\nthe class and instances through descriptors:\n\n * monkey patches on the class mutate the vtable\n * monkey patches on the object create a new object-specific vtable\n - or perhaps are simply disallowed\n\"\"\"\n\nimport ctypes\n\nfrom cpython cimport PyObject\n\ncdef extern from *:\n ctypedef unsigned int Py_uintptr_t\n\n struct __pyx_obj_4test_Base:\n void *__pyx_vtab\n\n ctypedef struct PyTypeObject:\n PyObject *ob_type\n\ncdef mymethod_wrapper(self, int arg):\n self.mymethod( arg)\n\nclass VTable(ctypes.Structure):\n _fields_ = [('mymethod', ctypes.c_void_p)]\n\ncdef class MetaClass(type):\n\n cdef public object vtable\n\n def __init__(self, name, bases, dict):\n if \"mymethod\" in dict:\n mymethod_p = &mymethod_wrapper\n self.vtable = VTable(ctypes.c_void_p(mymethod_p))\n else:\n self.vtable = None\n\n# --- Test classes ---\n\ncdef class Base(object):\n cdef mymethod(self, int arg):\n print \"mymethod in Base\", arg\n\n( Base).ob_type = MetaClass\n\nclass Derived(Base):\n def __init__(self):\n cdef Py_uintptr_t vtable_p\n\n vtable = type(self).vtable\n\n if vtable is not None:\n vtable_p = ctypes.addressof(vtable)\n (<__pyx_obj_4test_Base *> self).__pyx_vtab = vtable_p\n\n\n def mymethod(self, int arg):\n print \"mymethod in Derived\", arg\n\n\ncdef func(Base obj):\n obj.mymethod(10)\n\n\nfunc(Base()) # prints: mymethod in Base 10\nfunc(Derived()) # prints: mymethod in Derived 10","subject":"Add prototype for method overriding from Python","message":"Add prototype for method overriding from Python\n","lang":"Cython","license":"bsd-2-clause","repos":"sklam\/numba,stuartarchibald\/numba,numba\/numba,seibert\/numba,sklam\/numba,stonebig\/numba,IntelLabs\/numba,pombredanne\/numba,IntelLabs\/numba,jriehl\/numba,shiquanwang\/numba,seibert\/numba,cpcloud\/numba,pombredanne\/numba,gmarkall\/numba,sklam\/numba,jriehl\/numba,ssarangi\/numba,stonebig\/numba,pitrou\/numba,stonebig\/numba,pitrou\/numba,ssarangi\/numba,gdementen\/numba,stefanseefeld\/numba,stuartarchibald\/numba,stefanseefeld\/numba,gdementen\/numba,GaZ3ll3\/numba,stefanseefeld\/numba,jriehl\/numba,shiquanwang\/numba,stefanseefeld\/numba,stonebig\/numba,pitrou\/numba,seibert\/numba,IntelLabs\/numba,jriehl\/numba,numba\/numba,cpcloud\/numba,stefanseefeld\/numba,stuartarchibald\/numba,IntelLabs\/numba,sklam\/numba,gmarkall\/numba,pombredanne\/numba,cpcloud\/numba,cpcloud\/numba,jriehl\/numba,gmarkall\/numba,IntelLabs\/numba,pitrou\/numba,numba\/numba,stonebig\/numba,stuartarchibald\/numba,stuartarchibald\/numba,gdementen\/numba,cpcloud\/numba,pitrou\/numba,sklam\/numba,gmarkall\/numba,GaZ3ll3\/numba,seibert\/numba,shiquanwang\/numba,ssarangi\/numba,GaZ3ll3\/numba,pombredanne\/numba,ssarangi\/numba,seibert\/numba,gdementen\/numba,ssarangi\/numba,GaZ3ll3\/numba,gmarkall\/numba,numba\/numba,gdementen\/numba,numba\/numba,pombredanne\/numba,GaZ3ll3\/numba"} {"commit":"e326813900a9b62a25cc8d36de74c906d0439d66","old_file":"dynd\/cpp\/functional.pxd","new_file":"dynd\/cpp\/functional.pxd","old_contents":"","new_contents":"from ..config cimport translate_exception\nfrom .callable cimport callable\n\ncdef extern from \"dynd\/functional.hpp\" namespace \"dynd::nd::functional\" nogil:\n callable apply(...) except +translate_exception\n","subject":"Add a minimal wrapper for apply.","message":"Add a minimal wrapper for apply.\n","lang":"Cython","license":"bsd-2-clause","repos":"insertinterestingnamehere\/dynd-python,insertinterestingnamehere\/dynd-python,izaid\/dynd-python,mwiebe\/dynd-python,insertinterestingnamehere\/dynd-python,ContinuumIO\/dynd-python,izaid\/dynd-python,izaid\/dynd-python,ContinuumIO\/dynd-python,mwiebe\/dynd-python,mwiebe\/dynd-python,izaid\/dynd-python,mwiebe\/dynd-python,ContinuumIO\/dynd-python,insertinterestingnamehere\/dynd-python,ContinuumIO\/dynd-python"} {"commit":"cb53591ccbb9b53ba730e64e761f14bfb89975a4","old_file":"tests\/run\/reload_ext_module.pyx","new_file":"tests\/run\/reload_ext_module.pyx","old_contents":"","new_contents":"# mode: run\n# tag: pep489\n\n\nimport reload_ext_module\n\n\ndef test_reload(module):\n \"\"\"\n >>> module = test_reload(reload_ext_module)\n >>> module is reload_ext_module # Py_mod_create enforces a singleton.\n True\n \"\"\"\n return reload(module)\n","subject":"Add reload(module) test that checks the current module singleton property.","message":"Add reload(module) test that checks the current module singleton property.\n","lang":"Cython","license":"apache-2.0","repos":"cython\/cython,da-woods\/cython,scoder\/cython,cython\/cython,da-woods\/cython,scoder\/cython,da-woods\/cython,cython\/cython,cython\/cython,da-woods\/cython,scoder\/cython,scoder\/cython"} {"commit":"953c4ad31b5ca675d1e0aaa7de73d907db77417c","old_file":"tests\/run\/cpp_move.pyx","new_file":"tests\/run\/cpp_move.pyx","old_contents":"","new_contents":"# mode: run\n# tag: cpp, werror, cpp11\n\nfrom libcpp cimport nullptr\nfrom libcpp.memory cimport shared_ptr, make_shared\nfrom libcpp.utility cimport move\nfrom cython.operator cimport dereference\n\ncdef extern from *:\n \"\"\"\n #include \n\n template const char* move_helper(T&) { return \"lvalue-ref\"; }\n template const char* move_helper(T&&) { return \"rvalue-ref\"; }\n \"\"\"\n const char* move_helper[T](T)\n\ndef test_move_assignment():\n \"\"\"\n >>> test_move_assignment()\n \"\"\"\n cdef shared_ptr[int] p1, p2\n p1 = make_shared[int](1337)\n p2 = move(p1)\n assert p1 == nullptr\n assert dereference(p2) == 1337\n\ndef test_move_func_call():\n \"\"\"\n >>> test_move_func_call()\n \"\"\"\n cdef shared_ptr[int] p\n assert move_helper(p) == b'lvalue-ref'\n assert move_helper(move(p)) == b'rvalue-ref'\n","subject":"Add tests for std::move wrapper","message":"Add tests for std::move wrapper\n","lang":"Cython","license":"apache-2.0","repos":"da-woods\/cython,scoder\/cython,da-woods\/cython,cython\/cython,scoder\/cython,cython\/cython,cython\/cython,cython\/cython,scoder\/cython,scoder\/cython,da-woods\/cython,da-woods\/cython"} {"commit":"49257123602bea7327aad532e6c21276deed3ed6","old_file":"tests\/run\/if_and_or.pyx","new_file":"tests\/run\/if_and_or.pyx","old_contents":"","new_contents":"# mode: run\n# tag: if, and, or\n\ndef if_x(x):\n \"\"\"\n >>> if_x(0)\n 2\n >>> if_x(1)\n 1\n \"\"\"\n if x:\n return 1\n else:\n return 2\n\ndef if_not(x):\n \"\"\"\n >>> if_not(0)\n 1\n >>> if_not(1)\n 2\n \"\"\"\n if not x:\n return 1\n else:\n return 2\n\n\ndef if_and(a, b):\n \"\"\"\n >>> if_and(3, 0)\n 2\n >>> if_and(0, 3)\n 2\n >>> if_and(0, 0)\n 2\n >>> if_and(3, 3)\n 1\n \"\"\"\n if a and b:\n return 1\n else:\n return 2\n\n\ndef if_not_and(a, b):\n \"\"\"\n >>> if_not_and(3, 0)\n 1\n >>> if_not_and(0, 3)\n 1\n >>> if_not_and(0, 0)\n 1\n >>> if_not_and(3, 3)\n 2\n \"\"\"\n if not (a and b):\n return 1\n else:\n return 2\n\n\ndef if_or(a, b):\n \"\"\"\n >>> if_or(3, 0)\n 1\n >>> if_or(0, 3)\n 1\n >>> if_or(0, 0)\n 2\n >>> if_or(3, 3)\n 1\n \"\"\"\n if a or b:\n return 1\n else:\n return 2\n\n\ndef if_not_or(a, b):\n \"\"\"\n >>> if_not_or(3, 0)\n 2\n >>> if_not_or(0, 3)\n 2\n >>> if_not_or(0, 0)\n 1\n >>> if_not_or(3, 3)\n 2\n \"\"\"\n if not (a or b):\n return 1\n else:\n return 2\n\n\ndef if_and_or(a, b, c, d):\n \"\"\"\n >>> if_and_or(3, 0, 0, 3)\n 1\n >>> if_and_or(0, 3, 0, 3)\n 1\n >>> if_and_or(0, 3, 3, 0)\n 1\n >>> if_and_or(0, 3, 3, 0)\n 1\n >>> if_and_or(0, 0, 0, 0)\n 2\n >>> if_and_or(0, 3, 0, 0)\n 2\n >>> if_and_or(0, 0, 3, 0)\n 2\n >>> if_and_or(0, 0, 0, 3)\n 2\n \"\"\"\n if (a or b) and (c or d):\n return 1\n else:\n return 2\n","subject":"Add a dedicated test for and\/or operators in a boolean context.","message":"Add a dedicated test for and\/or operators in a boolean context.\n","lang":"Cython","license":"apache-2.0","repos":"scoder\/cython,scoder\/cython,cython\/cython,da-woods\/cython,scoder\/cython,cython\/cython,da-woods\/cython,scoder\/cython,cython\/cython,da-woods\/cython,cython\/cython,da-woods\/cython"} {"commit":"a2671fa2256c7d4e479e58d4cad2d27bed9bb68c","old_file":"tests\/run\/cpython_capi.pyx","new_file":"tests\/run\/cpython_capi.pyx","old_contents":"","new_contents":"# mode: run\n# tag: c-api\n\nfrom cpython cimport mem\n\n\ndef test_pymalloc():\n \"\"\"\n >>> test_pymalloc()\n 3\n \"\"\"\n cdef char* m2\n cdef char* m = mem.PyMem_Malloc(20)\n assert m\n try:\n m[0] = 1\n m[1] = 2\n m[2] = 3\n m2 = mem.PyMem_Realloc(m, 10)\n assert m2\n m = m2\n return m[2]\n finally:\n mem.PyMem_Free(m)\n\n\ndef test_pymalloc_raw():\n \"\"\"\n >>> test_pymalloc_raw()\n 3\n \"\"\"\n cdef char* m\n cdef char* m2 = NULL\n with nogil:\n m = mem.PyMem_RawMalloc(20)\n if not m:\n raise MemoryError()\n try:\n m[0] = 1\n m[1] = 2\n m[2] = 3\n m2 = mem.PyMem_RawRealloc(m, 10)\n if m2:\n m = m2\n retval = m[2]\n finally:\n mem.PyMem_RawFree(m)\n assert m2\n return retval\n","subject":"Implement test for new PyMem_RawMalloc() functions.","message":"Implement test for new PyMem_RawMalloc() functions.\n","lang":"Cython","license":"apache-2.0","repos":"cython\/cython,scoder\/cython,cython\/cython,scoder\/cython,scoder\/cython,da-woods\/cython,da-woods\/cython,cython\/cython,da-woods\/cython,scoder\/cython,da-woods\/cython,cython\/cython"} {"commit":"2232c1e010a14ccf7217bc3e0d7fee1c7b037013","old_file":"tests\/compile\/cpp_class_redefinition.pyx","new_file":"tests\/compile\/cpp_class_redefinition.pyx","old_contents":"","new_contents":"# tag: cpp\n# mode: compile\n\ncdef extern from \"templates.h\":\n cdef cppclass TemplateTest1[T]:\n TemplateTest1()\n T value\n int t\n T getValue()\n\n cdef cppclass TemplateTest1[T]\n\n","subject":"Add unit test for commit 2de8934","message":"Add unit test for commit 2de8934\n","lang":"Cython","license":"apache-2.0","repos":"dahebolangkuan\/cython,madjar\/cython,marscher\/cython,mcanthony\/cython,acrispin\/cython,cython\/cython,fabianrost84\/cython,marscher\/cython,marscher\/cython,marscher\/cython,hhsprings\/cython,slonik-az\/cython,ABcDexter\/cython,mrGeen\/cython,c-blake\/cython,encukou\/cython,marscher\/cython,madjar\/cython,fabianrost84\/cython,cython\/cython,ABcDexter\/cython,andreasvc\/cython,ABcDexter\/cython,roxyboy\/cython,da-woods\/cython,hickford\/cython,andreasvc\/cython,dahebolangkuan\/cython,madjar\/cython,encukou\/cython,madjar\/cython,hhsprings\/cython,roxyboy\/cython,slonik-az\/cython,fperez\/cython,da-woods\/cython,achernet\/cython,hickford\/cython,encukou\/cython,achernet\/cython,hickford\/cython,fabianrost84\/cython,scoder\/cython,scoder\/cython,JelleZijlstra\/cython,JelleZijlstra\/cython,acrispin\/cython,hhsprings\/cython,ABcDexter\/cython,acrispin\/cython,JelleZijlstra\/cython,acrispin\/cython,fperez\/cython,cython\/cython,mcanthony\/cython,mrGeen\/cython,mcanthony\/cython,hhsprings\/cython,roxyboy\/cython,achernet\/cython,c-blake\/cython,slonik-az\/cython,c-blake\/cython,scoder\/cython,slonik-az\/cython,c-blake\/cython,mcanthony\/cython,encukou\/cython,madjar\/cython,fabianrost84\/cython,mrGeen\/cython,JelleZijlstra\/cython,hickford\/cython,andreasvc\/cython,roxyboy\/cython,fperez\/cython,encukou\/cython,dahebolangkuan\/cython,ChristopherHogan\/cython,roxyboy\/cython,dahebolangkuan\/cython,achernet\/cython,fabianrost84\/cython,hickford\/cython,da-woods\/cython,fperez\/cython,slonik-az\/cython,da-woods\/cython,scoder\/cython,ChristopherHogan\/cython,andreasvc\/cython,ChristopherHogan\/cython,andreasvc\/cython,c-blake\/cython,JelleZijlstra\/cython,hhsprings\/cython,cython\/cython,acrispin\/cython,mcanthony\/cython,mrGeen\/cython,fperez\/cython,mrGeen\/cython,ABcDexter\/cython,dahebolangkuan\/cython,achernet\/cython"} {"commit":"77518b016e65871659be109583f52a88274c4a58","old_file":"tests\/run\/temps_corner1.pyx","new_file":"tests\/run\/temps_corner1.pyx","old_contents":"","new_contents":"__doc__ = \"\"\"\n >>> B().coeffs_bitsize()\n [2]\n\"\"\"\n\ncdef class A:\n def numerator(self):\n return self\n\ncdef int bitsize(A a):\n return 1\n \ncoeffs = [A()]\n\nclass B:\n def coeffs_bitsize(self):\n r = [bitsize(c.numerator())+1 for c in coeffs]\n return r\n","subject":"Add corner case temp (de)allocation test.","message":"Add corner case temp (de)allocation test.\n\nThis is as simple as I could get it.\n","lang":"Cython","license":"apache-2.0","repos":"bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu"} {"commit":"7d9fa9272dd4ad2dcd7fb7409a4ce47291458017","old_file":"tests\/memoryview\/numpy_memoryview_readonly.pyx","new_file":"tests\/memoryview\/numpy_memoryview_readonly.pyx","old_contents":"","new_contents":"# mode: run\n# tag: readonly, const, numpy\n\nimport numpy as np\n\ndef new_array():\n return np.arange(10).astype('float')\n\nARRAY = new_array()\n\n\ncdef getmax(double[:] x):\n \"\"\"Example code, should work with both\n ro and rw memoryviews\"\"\"\n cdef double max_val = -float('inf')\n for val in x:\n if val > max_val:\n max_val = val\n return max_val\n\n\ncdef update_array(double [:] x):\n \"\"\"Modifying a ro memoryview should raise an error\"\"\"\n x[0] = 23.\n\n\ncdef getconst(const double [:] x):\n \"\"\"Should only accept ro memoryviews\"\"\"\n return x[0]\n\n\ndef test_mmview_rw(x):\n \"\"\"\n >>> test_mmview_rw(ARRAY)\n 9.0\n \"\"\"\n return getmax(x)\n\n\ndef test_mmview_ro(x):\n \"\"\"\n >>> test_mmview_ro(new_array())\n 9.0\n \"\"\"\n x.setflags(write=False)\n assert x.flags.writeable is False\n return getmax(x)\n\n\ndef test_update_mmview_rw(x):\n \"\"\"\n >>> test_update_mmview_rw(new_array())\n 23.0\n \"\"\"\n update_array(x)\n return x[0]\n\n\ndef test_update_mmview_ro(x):\n \"\"\"\n >>> test_update_mmview_ro(new_array())\n 0.0\n \"\"\"\n x.setflags(write=False)\n assert x.flags.writeable is False\n try:\n update_array(x)\n except ValueError: pass\n else:\n assert False, \"RO error not raised!\"\n return getconst(x)\n\n\ndef test_rw_call_getmax(double[:] x):\n \"\"\"\n >>> test_rw_call_getmax(new_array())\n 23.0\n \"\"\"\n update_array(x)\n assert getconst(x) == 23\n return getmax(x)\n\n\ndef test_const_mmview_ro(x):\n \"\"\"\n >>> test_const_mmview_ro(new_array())\n 0.0\n \"\"\"\n x.setflags(write=False)\n assert x.flags.writeable is False\n return getconst(x)\n","subject":"Add dedicated test file for read-only memory views.","message":"Add dedicated test file for read-only memory views.\n","lang":"Cython","license":"apache-2.0","repos":"scoder\/cython,scoder\/cython,da-woods\/cython,cython\/cython,da-woods\/cython,da-woods\/cython,da-woods\/cython,scoder\/cython,cython\/cython,cython\/cython,scoder\/cython,cython\/cython"} {"commit":"969915634fdea4cebf9063bae3573ff2799acea7","old_file":"pydaspk.pxd","new_file":"pydaspk.pxd","old_contents":"","new_contents":"# -*- coding: utf-8 -*-\n\n################################################################################\n#\n# PyDAS - A Python wrapper for several differential algebraic system solvers\n#\n# Copyright (c) 2010-2014 by Joshua W. Allen (jwallen@mit.edu) \n# and Connie W. Gao (connieg@mit.edu)\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the 'Software'),\n# to deal in the Software without restriction, including without limitation\n# the rights to use, copy, modify, merge, publish, distribute, sublicense,\n# and\/or sell copies of the Software, and to permit persons to whom the\n# Software is furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n# DEALINGS IN THE SOFTWARE.\n#\n################################################################################\n\n\nimport numpy as np\ncimport numpy as np\n\ncdef class DASPK:\n\n cdef public int maxOrder\n cdef public object tstop\n cdef public double initialStep\n cdef public double maximumStep\n cdef public object bandwidths\n cdef public bint nonnegative\n cdef public bint sensitivity\n cdef public int sensmethod\n \n cdef public double t\n cdef public np.ndarray y\n cdef public np.ndarray dydt\n cdef public np.ndarray senpar\n \n cdef np.ndarray info\n cdef np.ndarray atol\n cdef np.ndarray rtol\n cdef np.ndarray rwork\n cdef np.ndarray iwork\n cdef np.ndarray rpar\n cdef np.ndarray ipar\n cdef int idid\n \n cpdef initialize(self, double t0, np.ndarray y0, np.ndarray dydt0=?, np.ndarray senpar=?, atol=?, rtol=?)\n \n cpdef advance(self, double tout)\n \n cpdef step(self, double tout)\n \n cdef solve(self, double tout)","subject":"Add PyDASPK wrapper file for DASPK solver required for sensitivity analysis.","message":"Add PyDASPK wrapper file for DASPK solver required for sensitivity analysis.\n","lang":"Cython","license":"mit","repos":"pierrelb\/RMG-Py,nyee\/RMG-Py,chatelak\/RMG-Py,enochd\/RMG-Py,enochd\/RMG-Py,pierrelb\/RMG-Py,nyee\/RMG-Py,nickvandewiele\/RMG-Py,comocheng\/RMG-Py,nickvandewiele\/RMG-Py,chatelak\/RMG-Py,comocheng\/RMG-Py"} {"commit":"b645c385a8fc6bb55fdee1c99745ef46b3181dfa","old_file":"tests\/run\/knuth_man_or_boy_test.pyx","new_file":"tests\/run\/knuth_man_or_boy_test.pyx","old_contents":"","new_contents":"#\n# Cython version of Knuth's \"man or boy\" test -- \"It separates the man\n# Algol 60 compilers from the boy Algol 60 compilers.\" Here's the\n# original (from wikipedia):\n#\n# begin\n# real procedure A (k, x1, x2, x3, x4, x5);\n# value k; integer k;\n# begin\n# real procedure B;\n# begin k:= k - 1;\n# B:= A := A (k, B, x1, x2, x3, x4);\n# end;\n# if k <= 0 then A:= x4 + x5 else B;\n# end;\n# outreal (A (10, 1, -1, -1, 1, 0));\n# end;\n#\n# and a table of values:\n#\n# k A\n# 0 1\n# 1 0\n# 2 \t-2\n# 3 \t0\n# 4 \t1\n# 5 \t0\n# 6 \t1\n# 7 \t-1\n# 8 \t-10\n# 9 \t-30\n# 10 \t-67\n#\n# Past 10 or so, we blow the C stack -- can't just set a higher recursion limit\n# to get around that one.\n#\n\ndef compute(val):\n if isinstance(val, int):\n return val\n else:\n return val()\n\ndef a(in_k, x1, x2, x3, x4, x5):\n \"\"\"\n >>> import sys\n >>> sys.setrecursionlimit(1350)\n >>> a(10, 1, -1, -1, 1, 0)\n -67\n \"\"\"\n k = [in_k]\n def b():\n k[0] -= 1\n return a(k[0], b, x1, x2, x3, x4)\n return compute(x4) + compute(x5) if k[0] <= 0 else b()\n \n","subject":"Add Knuth's \"man or boy\" test.","message":"Add Knuth's \"man or boy\" test.\n","lang":"Cython","license":"apache-2.0","repos":"encukou\/cython,hpfem\/cython,bzzzz\/cython,roxyboy\/cython,achernet\/cython,ChristopherHogan\/cython,dahebolangkuan\/cython,achernet\/cython,cython\/cython,achernet\/cython,dahebolangkuan\/cython,encukou\/cython,acrispin\/cython,fperez\/cython,mcanthony\/cython,andreasvc\/cython,slonik-az\/cython,JelleZijlstra\/cython,roxyboy\/cython,mcanthony\/cython,marscher\/cython,hhsprings\/cython,da-woods\/cython,andreasvc\/cython,hpfem\/cython,rguillebert\/CythonCTypesBackend,ChristopherHogan\/cython,fabianrost84\/cython,fabianrost84\/cython,madjar\/cython,c-blake\/cython,mrGeen\/cython,marscher\/cython,c-blake\/cython,acrispin\/cython,mrGeen\/cython,fabianrost84\/cython,hpfem\/cython,ABcDexter\/cython,acrispin\/cython,fabianrost84\/cython,acrispin\/cython,marscher\/cython,madjar\/cython,fperez\/cython,dahebolangkuan\/cython,larsmans\/cython,cython\/cython,fperez\/cython,marscher\/cython,bzzzz\/cython,scoder\/cython,slonik-az\/cython,larsmans\/cython,ChristopherHogan\/cython,hickford\/cython,JelleZijlstra\/cython,hhsprings\/cython,roxyboy\/cython,JelleZijlstra\/cython,c-blake\/cython,hickford\/cython,mrGeen\/cython,bzzzz\/cython,ABcDexter\/cython,rguillebert\/CythonCTypesBackend,acrispin\/cython,fperez\/cython,fperez\/cython,mrGeen\/cython,slonik-az\/cython,encukou\/cython,hhsprings\/cython,cython\/cython,roxyboy\/cython,andreasvc\/cython,encukou\/cython,slonik-az\/cython,ABcDexter\/cython,dahebolangkuan\/cython,madjar\/cython,rguillebert\/CythonCTypesBackend,madjar\/cython,hpfem\/cython,bzzzz\/cython,scoder\/cython,mcanthony\/cython,slonik-az\/cython,encukou\/cython,marscher\/cython,cython\/cython,ABcDexter\/cython,andreasvc\/cython,da-woods\/cython,achernet\/cython,mcanthony\/cython,andreasvc\/cython,ABcDexter\/cython,larsmans\/cython,hickford\/cython,roxyboy\/cython,c-blake\/cython,mrGeen\/cython,JelleZijlstra\/cython,scoder\/cython,larsmans\/cython,fabianrost84\/cython,madjar\/cython,scoder\/cython,JelleZijlstra\/cython,da-woods\/cython,achernet\/cython,larsmans\/cython,hhsprings\/cython,c-blake\/cython,mcanthony\/cython,hickford\/cython,hickford\/cython,rguillebert\/CythonCTypesBackend,hpfem\/cython,dahebolangkuan\/cython,hhsprings\/cython,da-woods\/cython"} {"commit":"611d41ba37c909b540a5835873f9706aa37be9ed","old_file":"statsmodels\/nonparametric\/fast_linbin.pyx","new_file":"statsmodels\/nonparametric\/fast_linbin.pyx","old_contents":"","new_contents":"#cython profile=True\n\"\"\"\ncython -a fast_linbin.pyx\ngcc -shared -pthread -fPIC -fwrapv -O2 -Wall -fno-strict-aliasing -I\/usr\/include\/python2.7 -I\/usr\/local\/lib\/python2.7\/dist-packages\/numpy\/core\/include\/ -o fast_linbin.so fast_linbin.c\n\"\"\"\n\ncimport cython\ncimport numpy as np\nimport numpy as np\n\nctypedef np.float64_t DOUBLE\nctypedef np.int_t INT\n\n@cython.boundscheck(False)\n@cython.wraparound(False)\n@cython.cdivision(True)\ndef linbin(np.ndarray[DOUBLE, ndim=1] X, double a, double b, int M,\n int trunc=1):\n \"\"\"\n Linear Binning as described in Fan and Marron (1994)\n \"\"\"\n cdef int i, li_i\n cdef int nobs = X.shape[0]\n cdef double delta = (b - a)\/(M - 1)\n\n cdef np.ndarray[DOUBLE, ndim=1] gcnts = np.zeros(M, np.float)\n cdef np.ndarray[DOUBLE, ndim=1] lxi = (X - a)\/delta\n cdef np.ndarray[INT, ndim=1] li = lxi.astype(int)\n cdef np.ndarray[DOUBLE, ndim=1] rem = lxi - li\n\n\n for i in range(nobs):\n li_i = li[i]\n if li_i > 1 and li_i < M:\n gcnts[li_i] = gcnts[li_i] + 1 - rem[i]\n gcnts[li_i+1] = gcnts[li_i+1] + rem[i]\n if li_i > M and trunc == 0:\n gcnts[M] = gcnts[M] + 1\n return gcnts\n","subject":"Add Cython source for fast linbin","message":"ENH: Add Cython source for fast linbin\n","lang":"Cython","license":"bsd-3-clause","repos":"Averroes\/statsmodels,phobson\/statsmodels,gef756\/statsmodels,wdurhamh\/statsmodels,huongttlan\/statsmodels,alekz112\/statsmodels,detrout\/debian-statsmodels,cbmoore\/statsmodels,YihaoLu\/statsmodels,rgommers\/statsmodels,nguyentu1602\/statsmodels,alekz112\/statsmodels,alekz112\/statsmodels,phobson\/statsmodels,bashtage\/statsmodels,ChadFulton\/statsmodels,edhuckle\/statsmodels,hainm\/statsmodels,bashtage\/statsmodels,saketkc\/statsmodels,nvoron23\/statsmodels,josef-pkt\/statsmodels,ChadFulton\/statsmodels,josef-pkt\/statsmodels,rgommers\/statsmodels,bzero\/statsmodels,ChadFulton\/statsmodels,saketkc\/statsmodels,jstoxrocky\/statsmodels,pprett\/statsmodels,YihaoLu\/statsmodels,bert9bert\/statsmodels,jseabold\/statsmodels,hainm\/statsmodels,yl565\/statsmodels,yarikoptic\/pystatsmodels,YihaoLu\/statsmodels,wwf5067\/statsmodels,statsmodels\/statsmodels,detrout\/debian-statsmodels,josef-pkt\/statsmodels,bavardage\/statsmodels,wkfwkf\/statsmodels,bzero\/statsmodels,cbmoore\/statsmodels,wkfwkf\/statsmodels,kiyoto\/statsmodels,yl565\/statsmodels,wzbozon\/statsmodels,waynenilsen\/statsmodels,bsipocz\/statsmodels,pprett\/statsmodels,rgommers\/statsmodels,YihaoLu\/statsmodels,adammenges\/statsmodels,hainm\/statsmodels,statsmodels\/statsmodels,detrout\/debian-statsmodels,edhuckle\/statsmodels,phobson\/statsmodels,musically-ut\/statsmodels,hlin117\/statsmodels,josef-pkt\/statsmodels,astocko\/statsmodels,nvoron23\/statsmodels,yarikoptic\/pystatsmodels,Averroes\/statsmodels,statsmodels\/statsmodels,statsmodels\/statsmodels,jseabold\/statsmodels,hlin117\/statsmodels,bzero\/statsmodels,gef756\/statsmodels,wdurhamh\/statsmodels,kiyoto\/statsmodels,phobson\/statsmodels,bert9bert\/statsmodels,bavardage\/statsmodels,edhuckle\/statsmodels,gef756\/statsmodels,waynenilsen\/statsmodels,jseabold\/statsmodels,wdurhamh\/statsmodels,yl565\/statsmodels,YihaoLu\/statsmodels,phobson\/statsmodels,edhuckle\/statsmodels,nvoron23\/statsmodels,waynenilsen\/statsmodels,musically-ut\/statsmodels,wwf5067\/statsmodels,rgommers\/statsmodels,nguyentu1602\/statsmodels,wkfwkf\/statsmodels,bzero\/statsmodels,jstoxrocky\/statsmodels,wwf5067\/statsmodels,bavardage\/statsmodels,huongttlan\/statsmodels,jseabold\/statsmodels,DonBeo\/statsmodels,wzbozon\/statsmodels,gef756\/statsmodels,ChadFulton\/statsmodels,huongttlan\/statsmodels,nvoron23\/statsmodels,wkfwkf\/statsmodels,cbmoore\/statsmodels,nvoron23\/statsmodels,astocko\/statsmodels,hlin117\/statsmodels,rgommers\/statsmodels,DonBeo\/statsmodels,waynenilsen\/statsmodels,bashtage\/statsmodels,bashtage\/statsmodels,yl565\/statsmodels,statsmodels\/statsmodels,wdurhamh\/statsmodels,jseabold\/statsmodels,musically-ut\/statsmodels,wzbozon\/statsmodels,ChadFulton\/statsmodels,josef-pkt\/statsmodels,pprett\/statsmodels,hlin117\/statsmodels,musically-ut\/statsmodels,wdurhamh\/statsmodels,josef-pkt\/statsmodels,cbmoore\/statsmodels,bert9bert\/statsmodels,saketkc\/statsmodels,kiyoto\/statsmodels,pprett\/statsmodels,kiyoto\/statsmodels,adammenges\/statsmodels,bert9bert\/statsmodels,saketkc\/statsmodels,nguyentu1602\/statsmodels,hainm\/statsmodels,yarikoptic\/pystatsmodels,DonBeo\/statsmodels,statsmodels\/statsmodels,adammenges\/statsmodels,wwf5067\/statsmodels,bashtage\/statsmodels,bavardage\/statsmodels,Averroes\/statsmodels,huongttlan\/statsmodels,astocko\/statsmodels,cbmoore\/statsmodels,DonBeo\/statsmodels,bsipocz\/statsmodels,kiyoto\/statsmodels,jstoxrocky\/statsmodels,detrout\/debian-statsmodels,nguyentu1602\/statsmodels,wzbozon\/statsmodels,gef756\/statsmodels,adammenges\/statsmodels,Averroes\/statsmodels,saketkc\/statsmodels,bert9bert\/statsmodels,jstoxrocky\/statsmodels,edhuckle\/statsmodels,ChadFulton\/statsmodels,wzbozon\/statsmodels,DonBeo\/statsmodels,bashtage\/statsmodels,bzero\/statsmodels,wkfwkf\/statsmodels,bsipocz\/statsmodels,alekz112\/statsmodels,yl565\/statsmodels,bavardage\/statsmodels,bsipocz\/statsmodels,astocko\/statsmodels"} {"commit":"83323b2d5196389e7b50add47c9d395443c86a0d","old_file":"tests\/compile\/cpp_exceptions_T265.pyx","new_file":"tests\/compile\/cpp_exceptions_T265.pyx","old_contents":"","new_contents":"cdef void raise_py_error():\n pass\n\ncdef extern from \"foo.h\":\n cdef int generic_error() except +\n cdef int specified_error() except +MemoryError\n cdef int dynamic_error() except +raise_py_error\n\ndef test_it():\n generic_error()\n specified_error()\n dynamic_error()\n","subject":"Test for cpp exception handling","message":"Test for cpp exception handling\n","lang":"Cython","license":"apache-2.0","repos":"ChristopherHogan\/cython,da-woods\/cython,rguillebert\/CythonCTypesBackend,marscher\/cython,JelleZijlstra\/cython,encukou\/cython,ChristopherHogan\/cython,achernet\/cython,slonik-az\/cython,hhsprings\/cython,encukou\/cython,bzzzz\/cython,fabianrost84\/cython,mcanthony\/cython,larsmans\/cython,hhsprings\/cython,da-woods\/cython,ABcDexter\/cython,roxyboy\/cython,fabianrost84\/cython,scoder\/cython,slonik-az\/cython,mrGeen\/cython,ABcDexter\/cython,achernet\/cython,mrGeen\/cython,achernet\/cython,roxyboy\/cython,mcanthony\/cython,scoder\/cython,larsmans\/cython,roxyboy\/cython,achernet\/cython,dahebolangkuan\/cython,roxyboy\/cython,larsmans\/cython,dahebolangkuan\/cython,bzzzz\/cython,bzzzz\/cython,acrispin\/cython,madjar\/cython,madjar\/cython,cython\/cython,achernet\/cython,fperez\/cython,hhsprings\/cython,larsmans\/cython,cython\/cython,andreasvc\/cython,hhsprings\/cython,fabianrost84\/cython,cython\/cython,ChristopherHogan\/cython,mrGeen\/cython,JelleZijlstra\/cython,ABcDexter\/cython,encukou\/cython,JelleZijlstra\/cython,slonik-az\/cython,fperez\/cython,madjar\/cython,larsmans\/cython,fperez\/cython,acrispin\/cython,hpfem\/cython,JelleZijlstra\/cython,c-blake\/cython,dahebolangkuan\/cython,madjar\/cython,acrispin\/cython,c-blake\/cython,hpfem\/cython,JelleZijlstra\/cython,dahebolangkuan\/cython,madjar\/cython,acrispin\/cython,ABcDexter\/cython,rguillebert\/CythonCTypesBackend,scoder\/cython,roxyboy\/cython,hickford\/cython,dahebolangkuan\/cython,marscher\/cython,marscher\/cython,hpfem\/cython,fabianrost84\/cython,bzzzz\/cython,c-blake\/cython,c-blake\/cython,rguillebert\/CythonCTypesBackend,slonik-az\/cython,marscher\/cython,rguillebert\/CythonCTypesBackend,hpfem\/cython,mcanthony\/cython,andreasvc\/cython,slonik-az\/cython,acrispin\/cython,mcanthony\/cython,fperez\/cython,da-woods\/cython,encukou\/cython,andreasvc\/cython,hickford\/cython,encukou\/cython,c-blake\/cython,fabianrost84\/cython,scoder\/cython,hhsprings\/cython,ABcDexter\/cython,hickford\/cython,mrGeen\/cython,hpfem\/cython,marscher\/cython,mrGeen\/cython,hickford\/cython,cython\/cython,mcanthony\/cython,hickford\/cython,da-woods\/cython,fperez\/cython,andreasvc\/cython,andreasvc\/cython"} {"commit":"db250dece215db6b257e3a7b6184a5497063ea0a","old_file":"tests\/compile\/cpp_exceptions_T265.pyx","new_file":"tests\/compile\/cpp_exceptions_T265.pyx","old_contents":"","new_contents":"cdef void raise_py_error():\n pass\n\ncdef extern from \"foo.h\":\n cdef int generic_error() except +\n cdef int specified_error() except +MemoryError\n cdef int dynamic_error() except +raise_py_error\n\ndef test_it():\n generic_error()\n specified_error()\n dynamic_error()\n","subject":"Test for cpp exception handling","message":"Test for cpp exception handling\n","lang":"Cython","license":"apache-2.0","repos":"bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu"} {"commit":"de9050401929751af0af2d792ecf5390f4381fc1","old_file":"tests\/memoryview\/extension_type_memoryview.pyx","new_file":"tests\/memoryview\/extension_type_memoryview.pyx","old_contents":"","new_contents":"# mode: run\n# tag: numpy\n\nimport numpy as np\n\n\ncdef class ExtensionType(object):\n cdef public int dummy\n\n def __init__(self, n):\n self.dummy = n\n\nitems = [ExtensionType(1), ExtensionType(2)]\ncdef ExtensionType[:] view = np.array(items, dtype=ExtensionType)\n\ndef test_getitem():\n \"\"\"\n >>> test_getitem()\n 1\n 2\n \"\"\"\n for i in range(view.shape[0]):\n item = view[i]\n print item.dummy\n\ndef test_getitem_typed():\n \"\"\"\n >>> test_getitem_typed()\n 1\n 2\n \"\"\"\n cdef ExtensionType item\n for i in range(view.shape[0]):\n item = view[i]\n print item.dummy\n","subject":"Add test for memoryview of extension type","message":"Add test for memoryview of extension type\n\nA test for a bug fixed in commit 478b939a4c99a77c0863cfd.\n\nv2: add commit link above\nv3: # tag: instead of # tags:, drop cpp tag as it means something different\n that I originally thought\n\nThere was a bug that produced C code where gcc emitted warnings:\nextension_type_memoryview.c: In function ‘__pyx_pf_25extension_type_memoryview_test_getitem’:\nextension_type_memoryview.c:1468:15: warning: assignment from incompatible pointer type\nextension_type_memoryview.c: In function ‘__pyx_pf_25extension_type_memoryview_2test_getitem_typed’:\nextension_type_memoryview.c:1565:15: warning: assignment from incompatible pointer type\nextension_type_memoryview.c:1568:18: warning: assignment from incompatible pointer type\n\nAnd g++ failed with errors:\nextension_type_memoryview.c: In function ‘PyObject* __pyx_pf_25extension_type_memoryview_test_getitem(PyObject*)’:\nextension_type_memoryview.c:1468:213: error: cannot convert ‘__pyx_obj_25extension_type_memoryview_ExtensionType*’ to ‘PyObject*’ in assignment\nextension_type_memoryview.c: In function ‘PyObject* __pyx_pf_25extension_type_memoryview_2test_getitem_typed(PyObject*)’:\nextension_type_memoryview.c:1565:213: error: cannot convert ‘__pyx_obj_25extension_type_memoryview_ExtensionType*’ to ‘PyObject*’ in assignment\nextension_type_memoryview.c:1568:20: error: cannot convert ‘PyObject*’ to ‘__pyx_obj_25extension_type_memoryview_ExtensionType*’ in assignment\n","lang":"Cython","license":"apache-2.0","repos":"ABcDexter\/cython,fperez\/cython,hhsprings\/cython,achernet\/cython,madjar\/cython,dahebolangkuan\/cython,ABcDexter\/cython,slonik-az\/cython,marscher\/cython,mcanthony\/cython,fperez\/cython,madjar\/cython,madjar\/cython,da-woods\/cython,acrispin\/cython,slonik-az\/cython,hhsprings\/cython,fperez\/cython,dahebolangkuan\/cython,fabianrost84\/cython,madjar\/cython,acrispin\/cython,encukou\/cython,fperez\/cython,JelleZijlstra\/cython,c-blake\/cython,JelleZijlstra\/cython,dahebolangkuan\/cython,JelleZijlstra\/cython,andreasvc\/cython,scoder\/cython,fabianrost84\/cython,mrGeen\/cython,dahebolangkuan\/cython,marscher\/cython,marscher\/cython,encukou\/cython,achernet\/cython,encukou\/cython,c-blake\/cython,ChristopherHogan\/cython,fabianrost84\/cython,da-woods\/cython,andreasvc\/cython,roxyboy\/cython,andreasvc\/cython,slonik-az\/cython,cython\/cython,mcanthony\/cython,slonik-az\/cython,scoder\/cython,dahebolangkuan\/cython,achernet\/cython,achernet\/cython,marscher\/cython,JelleZijlstra\/cython,mcanthony\/cython,mrGeen\/cython,fperez\/cython,mcanthony\/cython,c-blake\/cython,da-woods\/cython,c-blake\/cython,ABcDexter\/cython,JelleZijlstra\/cython,da-woods\/cython,marscher\/cython,ABcDexter\/cython,ChristopherHogan\/cython,acrispin\/cython,andreasvc\/cython,cython\/cython,encukou\/cython,c-blake\/cython,roxyboy\/cython,acrispin\/cython,achernet\/cython,madjar\/cython,fabianrost84\/cython,hickford\/cython,fabianrost84\/cython,mrGeen\/cython,mcanthony\/cython,andreasvc\/cython,ABcDexter\/cython,slonik-az\/cython,hhsprings\/cython,mrGeen\/cython,scoder\/cython,mrGeen\/cython,ChristopherHogan\/cython,hhsprings\/cython,roxyboy\/cython,roxyboy\/cython,acrispin\/cython,hickford\/cython,hickford\/cython,cython\/cython,roxyboy\/cython,scoder\/cython,encukou\/cython,cython\/cython,hhsprings\/cython,hickford\/cython,hickford\/cython"} {"commit":"8bfca4bbb9a8460be5a01bb96e605c0d7245ba66","old_file":"tests\/run\/knuth_man_or_boy_test.pyx","new_file":"tests\/run\/knuth_man_or_boy_test.pyx","old_contents":"","new_contents":"#\n# Cython version of Knuth's \"man or boy\" test -- \"It separates the man\n# Algol 60 compilers from the boy Algol 60 compilers.\" Here's the\n# original (from wikipedia):\n#\n# begin\n# real procedure A (k, x1, x2, x3, x4, x5);\n# value k; integer k;\n# begin\n# real procedure B;\n# begin k:= k - 1;\n# B:= A := A (k, B, x1, x2, x3, x4);\n# end;\n# if k <= 0 then A:= x4 + x5 else B;\n# end;\n# outreal (A (10, 1, -1, -1, 1, 0));\n# end;\n#\n# and a table of values:\n#\n# k A\n# 0 1\n# 1 0\n# 2 \t-2\n# 3 \t0\n# 4 \t1\n# 5 \t0\n# 6 \t1\n# 7 \t-1\n# 8 \t-10\n# 9 \t-30\n# 10 \t-67\n#\n# Past 10 or so, we blow the C stack -- can't just set a higher recursion limit\n# to get around that one.\n#\n\ndef compute(val):\n if isinstance(val, int):\n return val\n else:\n return val()\n\ndef a(in_k, x1, x2, x3, x4, x5):\n \"\"\"\n >>> import sys\n >>> sys.setrecursionlimit(1350)\n >>> a(10, 1, -1, -1, 1, 0)\n -67\n \"\"\"\n k = [in_k]\n def b():\n k[0] -= 1\n return a(k[0], b, x1, x2, x3, x4)\n return compute(x4) + compute(x5) if k[0] <= 0 else b()\n \n","subject":"Add Knuth's \"man or boy\" test.","message":"Add Knuth's \"man or boy\" test.\n","lang":"Cython","license":"apache-2.0","repos":"bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu,bhy\/cython-haoyu"}