commit
stringlengths
40
40
old_file
stringlengths
4
264
new_file
stringlengths
4
264
old_contents
stringlengths
0
4.24k
new_contents
stringlengths
1
5.44k
subject
stringlengths
14
778
message
stringlengths
15
9.92k
lang
stringclasses
277 values
license
stringclasses
13 values
repos
stringlengths
5
127k
dc1e42ae57ce25420edc4dbab2d3e689c49b4938
count.pyx
count.pyx
#!/usr/bin/python import json from Bio import SeqIO def compute(inputfile, format): cdef str line = '' cdef int i = 0 cdef int j = 0 cdef int line_len = 0 cdef str token = '' cdef int token_cnt = 0 for seq_record in SeqIO.parse(inputfile, format): cnt = {} line = str(seq_r...
#!/usr/bin/python import json from Bio import SeqIO def compute(inputfile, format): cdef str line = '' cdef int i = 0 cdef int j = 0 cdef int line_len = 0 cdef str token = '' cdef int token_cnt = 0 for seq_record in SeqIO.parse(inputfile, format): cnt = {} line = str(seq_r...
Fix bug introduced by pep8 changes
Fix bug introduced by pep8 changes
Cython
apache-2.0
PDX-Flamingo/codonpdx-python,PDX-Flamingo/codonpdx-python
4ee6b6ec7762a9c226f66dc445405b5927c8c705
tests/run/import_star.pyx
tests/run/import_star.pyx
# mode: run cdef object executable, version_info cdef long hexversion ctypedef struct MyStruct: int x, y, z # conversion code for this struct will be generated but not used # (there used to be a problem getting Cython conversion code generated here) cdef MyStruct _no_such_name_ = MyStruct(1, 2, 3) from libc.mat...
# mode: run cdef object executable, version_info cdef long hexversion ctypedef struct MyStruct: int x, y, z # conversion code for this struct will be generated but not used # (there used to be a problem getting Cython conversion code generated here) cdef MyStruct _no_such_name_ = MyStruct(1, 2, 3) from libc.mat...
Use a different constant (PI instead of NAN) in the "import *" test since NAN does not seem to be defined by MSVC.
Use a different constant (PI instead of NAN) in the "import *" test since NAN does not seem to be defined by MSVC.
Cython
apache-2.0
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
6d8a5daf503fc8f158269102886bff67c1f6b693
microscopes/lda/_model.pxd
microscopes/lda/_model.pxd
from cython.operator cimport dereference as deref from libcpp.vector cimport vector from libc.stddef cimport size_t from microscopes.common.variadic._dataview cimport ( abstract_dataview, ) from microscopes.common._rng cimport rng from microscopes.lda._model_h cimport ( state as c_state, initialize as c_in...
from cython.operator cimport dereference as deref from libcpp.vector cimport vector from libc.stddef cimport size_t from microscopes.common.variadic._dataview cimport ( abstract_dataview, ) from microscopes.common._rng cimport rng from microscopes.lda._model_h cimport ( state as c_state, initialize as c_in...
Add _defn to state object
Add _defn to state object
Cython
bsd-3-clause
datamicroscopes/lda,datamicroscopes/lda,datamicroscopes/lda
6ac4a537bf9406391cac6d18dcb4e440cabdc015
pyfof/pyfof.pyx
pyfof/pyfof.pyx
# -*- coding: utf-8 -*- """ Created on Thu Mar 26 17:59:28 2015 @author: sljg2 """ __all__ = ["friends_of_friends"] __version__ = "0.1" __author__ = "Simon Gibbons (sljg2@ast.cam.ac.uk)" __copyright__ = "Copyright 2015 Simon Gibbons" cimport numpy as np from libcpp.list cimport list cdef extern from "fof.hpp": ...
# -*- coding: utf-8 -*- """ Created on Thu Mar 26 17:59:28 2015 @author: sljg2 """ __all__ = ["friends_of_friends"] __version__ = "0.1.3-dev" __author__ = "Simon Gibbons (sljg2@ast.cam.ac.uk)" __copyright__ = "Copyright 2015 Simon Gibbons" cimport numpy as np from libcpp.list cimport list cdef extern from "fof.hpp"...
Raise an exception if a NaN is passed to prevent a memory leak
Raise an exception if a NaN is passed to prevent a memory leak
Cython
mit
simongibbons/pyfof,simongibbons/pyfof,simongibbons/pyfof
59720e1a98732d3ae5f1239b08889404a23993b0
opencog/cython/opencog/ptrvalue.pyx
opencog/cython/opencog/ptrvalue.pyx
from cpython.ref cimport Py_INCREF, Py_DECREF cdef class PtrValue(Value): def __init__(self, obj = None, value_ptr = None): if obj is not None: Py_INCREF(obj) cvalue = createPtrValue(<void*>obj, decref) super(PtrValue, self).__init__(ValuePtr.create(cvalue)) els...
from cpython.ref cimport Py_INCREF, Py_DECREF cdef class PtrValue(Value): def __init__(self, obj = None, value_ptr = None): if obj is not None: Py_INCREF(obj) cvalue = createPtrValue(<void*>obj, decref) super(PtrValue, self).__init__(PtrHolder.create(<shared_ptr[void]&>...
Fix build after latest API changes from opencog
Fix build after latest API changes from opencog
Cython
agpl-3.0
rTreutlein/atomspace,rTreutlein/atomspace,AmeBel/atomspace,AmeBel/atomspace,rTreutlein/atomspace,AmeBel/atomspace,rTreutlein/atomspace,AmeBel/atomspace,AmeBel/atomspace,rTreutlein/atomspace
63305d7dd96a6f019303ded93937c96c0e92227f
src/MPI/stdlib.pxi
src/MPI/stdlib.pxi
#--------------------------------------------------------------------- cdef extern from *: ctypedef unsigned long int size_t #--------------------------------------------------------------------- cdef extern from * nogil: # "stdio.h" ctypedef struct FILE FILE *stdin, *stdout, *stderr int fprintf(FILE...
#--------------------------------------------------------------------- cdef extern from * nogil: # "stdio.h" ctypedef struct FILE FILE *stdin, *stdout, *stderr int fprintf(FILE *, char *, ...) int fflush(FILE *) #---------------------------------------------------------------------
Remove ancient ctypedef for size_t
Remove ancient ctypedef for size_t
Cython
bsd-2-clause
pressel/mpi4py,mpi4py/mpi4py,pressel/mpi4py,mpi4py/mpi4py,mpi4py/mpi4py,pressel/mpi4py,pressel/mpi4py
c790774822d21868a82c3980109cae5c87e6b428
thinc/typedefs.pxd
thinc/typedefs.pxd
from libc.stdint cimport uint64_t from libc.stdint cimport uint32_t from libc.stdint cimport uint16_t from libc.stdint cimport int32_t ctypedef float weight_t ctypedef uint64_t atom_t ctypedef uint64_t feat_t ctypedef uint64_t hash_t ctypedef int32_t class_t ctypedef uint32_t count_t ctypedef uint32_t time_t ctypedef...
from libc.stdint cimport uint64_t from libc.stdint cimport uint32_t from libc.stdint cimport uint16_t from libc.stdint cimport int32_t ctypedef double weight_t ctypedef uint64_t atom_t ctypedef uint64_t feat_t ctypedef uint64_t hash_t ctypedef int32_t class_t ctypedef uint32_t count_t ctypedef uint32_t time_t ctypede...
Fix compile weight_t back to double, not float
Fix compile weight_t back to double, not float
Cython
mit
explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc
4a7dc93e4e7e904eea9637814d0a162729e497a4
tests/compile/extern_packed_struct.pyx
tests/compile/extern_packed_struct.pyx
# ticket: 290 # mode: error cdef extern: cdef packed struct MyStruct: char a _ERRORS = u""" 5:9: Cannot declare extern struct as 'packed' """
# mode: compile cdef extern from *: cdef packed struct MyStruct: char a
Fix extern packed struct test.
Fix extern packed struct test.
Cython
apache-2.0
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,roxybo...
c23c77d453c9f84b14925bf0bd21d20746fb3f6d
pyogi/grid.pyx
pyogi/grid.pyx
EMPTY_PLAYER = ' ' EMPTY_CSA = <Koma>None cdef class Grid: '''Grid class Args ------------------- which_player : optional (default = None) csa_piece : optional (default = None) ''' def __init__(self, which_player=EMPTY_PLAYER, csa_piece=EMPTY_CSA): if which_player in [EMPTY_PLAY...
EMPTY_PLAYER = ' ' EMPTY_CSA = <Koma>None cdef class Grid: '''Grid class Args ------------------- which_player : optional (default = None) csa_piece : optional (default = None) ''' def __init__(self, which_player=EMPTY_PLAYER, csa_piece=EMPTY_CSA): if which_player in [EMPTY_PLAY...
Fix return value of Grid.__str__()
Fix return value of Grid.__str__()
Cython
mit
tosh1ki/pyogi,tosh1ki/pyogi
65041cae15391099f01b6739e4d1d55c05a9e82a
tests/run/cpp_classes.pyx
tests/run/cpp_classes.pyx
cdef extern from "shapes.h" namespace shapes: cdef cppclass Shape: area() cdef cppclass Rectangle(Shape): int width int height __init__(int, int) cdef cppclass Square(Shape): int side __init__(int) cdef Rectangle *rect = new Rectangle(10, 20) cdef ...
__doc__ = u""" >>> test_new_del() >>> test_rect_area(3, 4) 12 >>> test_square_area(15) 225 """ cdef extern from "shapes.cpp" namespace shapes: cdef cppclass Shape: float area() cdef cppclass Rectangle(Shape): int width int height __init__(int, int) ...
Expand and fix cpp tests
Expand and fix cpp tests
Cython
apache-2.0
bhy/cython-haoyu,bhy/cython-haoyu,bhy/cython-haoyu,bhy/cython-haoyu
a5b26d417527a85e39ba2c762a6e44b3ae37863d
src/clients/lib/python/cython_include/xmmsutils.pxd
src/clients/lib/python/cython_include/xmmsutils.pxd
from cpython.unicode cimport PyUnicode_DecodeUTF8, PyUnicode_AsUTF8String cdef inline to_unicode(char *s): try: ns = PyUnicode_DecodeUTF8(s, len(s), NULL) except: ns = s return ns cdef inline from_unicode(object o): if isinstance(o, unicode): return PyUnicode_AsUTF8String(o) else: return o
from cpython.unicode cimport PyUnicode_DecodeUTF8, PyUnicode_AsUTF8String from libc.string cimport const_char, strlen cdef inline to_unicode(const_char *s): return PyUnicode_DecodeUTF8(s, strlen(s), "replace") cdef inline from_unicode(object o): if isinstance(o, unicode): return PyUnicode_AsUTF8String(o) else: ...
Fix string constness in to_unicode
OTHER: Fix string constness in to_unicode
Cython
lgpl-2.1
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,si...
a565fc046dfaea95568606af1d1a913692a6a4d7
opencog/cython/opencog/agent.pyx
opencog/cython/opencog/agent.pyx
# it'd be nice to define the type of atomspace but I can't get this working from opencog.cogserver cimport cAgent, stim_t, string cdef class MindAgent: # TODO add a pointer to the Agent C++ object so that calls to stimulate atoms # can be made (among other things) def __cinit__(self): pass pr...
# it'd be nice to define the type of atomspace but I can't get this working from opencog.cogserver cimport cAgent, stim_t, string from opencog.atomspace cimport cHandle, Atom cdef class MindAgent: def __cinit__(self): pass property frequency: def __get__(self): return self.c_obj....
Add MindAgent::stimulateAtom to the python bindings
Add MindAgent::stimulateAtom to the python bindings
Cython
agpl-3.0
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,rose...
30d4c6eb9b3778abe2b9ba568467ca16b7c084fd
pyinform/pyinform.pyx
pyinform/pyinform.pyx
cimport cython.array cimport numpy import numpy cdef extern from "stdint.h": ctypedef unsigned long uint64_t cdef extern from "inform/time_series.h": double inform_active_info(const uint64_t* series, size_t n, uint64_t base, uint64_t k) def activeinfo(xs, uint64_t k, uint64_t b = 0): if not xs: r...
cimport cython.array cimport numpy import numpy cdef extern from "stdint.h": ctypedef unsigned long uint64_t cdef extern from "inform/time_series.h": double inform_active_info(const uint64_t* series, size_t n, uint64_t base, uint64_t k) def activeinfo(xs, uint64_t k, uint64_t b = 0): if len(xs) == 0: ...
Check activeinfo inputs for empty arrays
Check activeinfo inputs for empty arrays The prior check, `not xs`, only works for sequence-like objects. Unfortunately numpy arrays are not sequences, so we have to actually check the length.
Cython
mit
ELIFE-ASU/PyInform
4d676ccfe3287c4378dc8ba7b990c6178894bb10
tests/errors/e_bufaccess.pyx
tests/errors/e_bufaccess.pyx
cdef object[int] buf cdef class A: cdef object[int] buf def f(): cdef object[fakeoption=True] buf1 cdef object[int, -1] buf1b cdef object[ndim=-1] buf2 cdef object[int, 'a'] buf3 cdef object[int,2,3,4,5,6] buf4 cdef object[int, 2, 'foo'] buf5 cdef object[int, 2, well] buf6 _ERRORS = u...
cdef object[int] buf cdef class A: cdef object[int] buf def f(): cdef object[fakeoption=True] buf1 cdef object[int, -1] buf1b cdef object[ndim=-1] buf2 cdef object[int, 'a'] buf3 cdef object[int,2,3,4,5,6] buf4 cdef object[int, 2, 'foo'] buf5 cdef object[int, 2, well] buf6 cdef obj...
Test for bad buffer types.
Test for bad buffer types.
Cython
apache-2.0
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/c...
3c6ce44c7b0434d9000dae25a2af8326714b6bc4
lineprofile/ln_likes.pxd
lineprofile/ln_likes.pxd
"A bunch of improper (not normalized) prior distributions" from libc.math cimport log, fabs cdef inline double ln_normal(double value, double mean, double stddev): cdef double tmp = (value - mean) / stddev tmp *= tmp return -0.5 * tmp - log(stddev) cdef inline double ln_laplace(double value, double mean, ...
"A bunch of improper (not normalized) prior distributions" from libc.math cimport log, fabs, sqrt, exp, M_PI cdef inline double ln_normal(double value, double mean, double stddev): cdef double tmp = (value - mean) / stddev tmp *= tmp return -0.5 * tmp - log(stddev) cdef inline double ln_laplace(double val...
Add non-logarithmic normal for mixture model
Add non-logarithmic normal for mixture model
Cython
mit
lfloeer/hiprofile
dfff744138e02f7bbc8a45cef28eef1a5a999c0d
docs/examples/userguide/external_C_code/platform_adaptation.pyx
docs/examples/userguide/external_C_code/platform_adaptation.pyx
cdef extern from *: """ #if defined(WIN32) || defined(MS_WINDOWS) #include "windows.h" #define myapp_sleep(m) Sleep(m) #else #include <unistd.h> #define myapp_sleep(m) ((void) usleep((m) * 1000)) #endif """ # using "myapp_" prefix in the C code to prevent C naming confl...
cdef extern from *: """ #if defined(WIN32) || defined(MS_WINDOWS) #include "synchapi.h" #define myapp_sleep(m) Sleep(m) #else #include <unistd.h> #define myapp_sleep(m) ((void) usleep((m) * 1000)) #endif """ # using "myapp_" prefix in the C code to prevent C naming conf...
Fix test compile failure in MSVC.
Fix test compile failure in MSVC.
Cython
apache-2.0
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
30f72282479d024a97f8d91a5b7bf64450becd86
Cython/Includes/libcpp/utility.pxd
Cython/Includes/libcpp/utility.pxd
cdef extern from "<utility>" namespace "std" nogil: cdef cppclass pair[T, U]: ctypedef T first_type ctypedef U second_type T first U second pair() except + pair(pair&) except + pair(T&, U&) except + bint operator==(pair&, pair&) bint operator!=...
cdef extern from "<utility>" namespace "std" nogil: cdef cppclass pair[T, U]: ctypedef T first_type ctypedef U second_type T first U second pair() except + pair(pair&) except + pair(T&, U&) except + bint operator==(pair&, pair&) bint operator!=...
Enable usage of std::move() only in the supported versions of MSVC (GH-4191)
Enable usage of std::move() only in the supported versions of MSVC (GH-4191)
Cython
apache-2.0
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
8a0bd3a24e249bb5e09792c4fd717dffb6467fd2
rocksdb/backup.pxd
rocksdb/backup.pxd
from libcpp cimport bool as cpp_bool from libcpp.string cimport string from libcpp.vector cimport vector from libc.stdint cimport uint32_t from libc.stdint cimport int64_t from libc.stdint cimport uint64_t from status cimport Status from db cimport DB from env cimport Env cdef extern from "utilities/backupable_db.h" ...
from libcpp cimport bool as cpp_bool from libcpp.string cimport string from libcpp.vector cimport vector from libc.stdint cimport uint32_t from libc.stdint cimport int64_t from libc.stdint cimport uint64_t from status cimport Status from db cimport DB from env cimport Env cdef extern from "rocksdb/utilities/backupabl...
Change include path and get rid of the warning.
Change include path and get rid of the warning.
Cython
bsd-3-clause
squidsrc/python-rocksdb,squidsrc/python-rocksdb,stephan-hof/pyrocksdb,stephan-hof/pyrocksdb
28c35f432f73b0b710cc5f6a823e11bca53265b0
Cython/Includes/cpython/float.pxd
Cython/Includes/cpython/float.pxd
cdef extern from "Python.h": ############################################################################ # 7.2.3 ############################################################################ # PyFloatObject # # This subtype of PyObject represents a Python floating point object. # PyTypeObj...
cdef extern from "Python.h": """ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) #else #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) #endif """ ###########################################################################...
Change the declaration of PyFloat_FromString to the Py3 signature and provide a fallback for Py2.
Change the declaration of PyFloat_FromString to the Py3 signature and provide a fallback for Py2. Closes https://github.com/cython/cython/issues/3909
Cython
apache-2.0
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
bda7316893be08045b3164cd3d0b9535c1319145
python/cython/PyVersion.pyx
python/cython/PyVersion.pyx
#/*########################################################################## # # The fisx library for X-Ray Fluorescence # # Copyright (c) 2014-2016 European Synchrotron Radiation Facility # # This file is part of the fisx X-ray developed by V.A. Sole # # Permission is hereby granted, free of charge, to any person obt...
#/*########################################################################## # # The fisx library for X-Ray Fluorescence # # Copyright (c) 2014-2016 European Synchrotron Radiation Facility # # This file is part of the fisx X-ray developed by V.A. Sole # # Permission is hereby granted, free of charge, to any person obt...
Return as string and not as bytes.
Return as string and not as bytes.
Cython
mit
vasole/fisx,vasole/fisx,vasole/fisx,vasole/fisx,vasole/fisx
a0c693354c56b2defe125da1751f7b5fed79b8f1
tests/compile/cpp_structs.pyx
tests/compile/cpp_structs.pyx
# tag: cpp # mode: compile cdef extern from "point.h" namespace "geometry": cdef struct Point: double x double y int color cdef Point p = Point(0.0, 0.0, 0) the_point = p
# tag: cpp # mode: compile from cython.view import array cdef extern from "point.h" namespace "geometry": cdef struct Point: double x double y int color cdef Point p = Point(0.0, 0.0, 0) the_point = p cdef Point[::1] ps = array((10,), itemsize=sizeof(Point), format='ddi')
Add a test for namespaced struct with memoryview
Add a test for namespaced struct with memoryview
Cython
apache-2.0
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,sco...
621cd056fbf02efe91ffd029886476dc38bbb409
tests/compile/cpp_structs.pyx
tests/compile/cpp_structs.pyx
# tag: cpp # mode: compile cdef extern from "point.h" namespace "geometry": cdef struct Point: double x double y int color cdef Point p = Point(0.0, 0.0, 0) the_point = p
# tag: cpp # mode: compile from cython.view import array cdef extern from "point.h" namespace "geometry": cdef struct Point: double x double y int color cdef Point p = Point(0.0, 0.0, 0) the_point = p cdef Point[::1] ps = array((10,), itemsize=sizeof(Point), format='ddi')
Add a test for namespaced struct with memoryview
Add a test for namespaced struct with memoryview
Cython
apache-2.0
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/cyt...
7cccaa06ad69a1394458837f60a6bb5e89e86597
tests/errors/w_uninitialized_del.pyx
tests/errors/w_uninitialized_del.pyx
# cython: warn.maybe_uninitialized=True # mode: error # tag: werror def foo(x): a = 1 del a, b b = 2 return a, b _ERRORS = """ 7:9: Deletion of non-Python, non-C++ object 7:12: local variable 'b' referenced before assignment 7:12: Deletion of non-Python, non-C++ object 9:12: local variable 'a' referen...
# cython: warn.maybe_uninitialized=True # mode: error # tag: werror def foo(x): a = 1 del a, b b = 2 return a, b _ERRORS = """ 7:12: local variable 'b' referenced before assignment 9:12: local variable 'a' referenced before assignment """
Fix w_uninitilized_del testcase, now inferred as python object
Fix w_uninitilized_del testcase, now inferred as python object
Cython
apache-2.0
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...
5750946c3e86771d9291560414864fd41fc7e674
docs/examples/userguide/language_basics/open_file.pyx
docs/examples/userguide/language_basics/open_file.pyx
from libc.stdio cimport FILE, fopen from libc.stdlib cimport malloc, free from cpython.exc cimport PyErr_SetFromErrnoWithFilenameObject def open_file(): cdef FILE* p p = fopen("spam.txt", "r") if p is NULL: PyErr_SetFromErrnoWithFilenameObject(OSError, "spam.txt") ... def allocati...
from libc.stdio cimport FILE, fopen from libc.stdlib cimport malloc, free from cpython.exc cimport PyErr_SetFromErrnoWithFilenameObject def open_file(): cdef FILE* p p = fopen("spam.txt", "r") if p is NULL: PyErr_SetFromErrnoWithFilenameObject(OSError, "spam.txt") ... def allocati...
Add comment in doc example to explain that two ways to compare pointers are equivalent
Add comment in doc example to explain that two ways to compare pointers are equivalent
Cython
apache-2.0
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
d63c7b28b01871d094fd0827e86b5d1e736b5172
microscopes/lda/_model_h.pxd
microscopes/lda/_model_h.pxd
from libcpp.vector cimport vector from libcpp.map cimport map from libc.stddef cimport size_t from microscopes._shared_ptr_h cimport shared_ptr from microscopes.common._random_fwd_h cimport rng_t cdef extern from "microscopes/lda/model.hpp" namespace "microscopes::lda": cdef cppclass model_definition: mo...
from libcpp.vector cimport vector from libcpp.map cimport map from libc.stddef cimport size_t from microscopes._shared_ptr_h cimport shared_ptr from microscopes.common._random_fwd_h cimport rng_t cdef extern from "microscopes/lda/model.hpp" namespace "microscopes::lda": cdef cppclass model_definition: mo...
Fix spelling error in variable name
Fix spelling error in variable name
Cython
bsd-3-clause
datamicroscopes/lda,datamicroscopes/lda,datamicroscopes/lda
d56b3b50edb745e0b0bd32172d2d601c7748288c
tests/errors/e_bufaccess.pyx
tests/errors/e_bufaccess.pyx
cdef object[int] buf cdef class A: cdef object[int] buf def f(): cdef object[fakeoption=True] buf1 cdef object[int, -1] buf1b cdef object[ndim=-1] buf2 cdef object[int, 'a'] buf3 cdef object[int,2,3,4,5,6] buf4 cdef object[int, 2, 'foo'] buf5 cdef object[int, 2, well] buf6 _ERRORS = u...
cdef object[int] buf cdef class A: cdef object[int] buf def f(): cdef object[fakeoption=True] buf1 cdef object[int, -1] buf1b cdef object[ndim=-1] buf2 cdef object[int, 'a'] buf3 cdef object[int,2,3,4,5,6] buf4 cdef object[int, 2, 'foo'] buf5 cdef object[int, 2, well] buf6 cdef obj...
Test for bad buffer types.
Test for bad buffer types.
Cython
apache-2.0
bhy/cython-haoyu,bhy/cython-haoyu,bhy/cython-haoyu,bhy/cython-haoyu
c2be61fb3f74e7a02359c71307621484552de795
tests/run/big_indices.pyx
tests/run/big_indices.pyx
__doc__ = u""" >>> test() neg False pos True neg pos neg pos """ def test(): cdef long neg = -1 cdef unsigned long pos = -2 # will be a large positive number print "neg", neg > 0 print "pos", pos > - D = { neg: 'neg', pos: 'pos' } print D[<object>neg] print D[...
__doc__ = u""" >>> test() neg False pos True neg pos neg pos """ def test(): cdef long neg = -1 cdef unsigned long pos = -2 # will be a large positive number print "neg", neg > 0 print "pos", pos > 0 D = { neg: 'neg', pos: 'pos' } print D[<object>neg] print D[...
Fix test case syntax error
Fix test case syntax error
Cython
apache-2.0
bhy/cython-haoyu,bhy/cython-haoyu,bhy/cython-haoyu,bhy/cython-haoyu
93109ccab50210de2ae9cc8ea98aeda84e411fc0
jnius/jnius_jvm_desktop.pxi
jnius/jnius_jvm_desktop.pxi
# on desktop, we need to create an env :) # example taken from http://www.inonit.com/cygwin/jni/invocationApi/c.html cdef extern jint JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args) cdef extern from "jni.h": int JNI_VERSION_1_4 jboolean JNI_FALSE ctypedef struct JavaVMInitArgs: jint version...
# on desktop, we need to create an env :) # example taken from http://www.inonit.com/cygwin/jni/invocationApi/c.html cdef extern jint JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args) cdef extern from "jni.h": int JNI_VERSION_1_4 jboolean JNI_FALSE ctypedef struct JavaVMInitArgs: jint version...
Make the desktop use CLASSPATH if defined.
Make the desktop use CLASSPATH if defined.
Cython
mit
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,jayk...
8829984efb4570d6be0984bc54711dd164cddfc3
spacy/tokens/span.pxd
spacy/tokens/span.pxd
cimport numpy as np from .doc cimport Doc cdef class Span: cdef readonly Doc doc cdef readonly int start cdef readonly int end cdef readonly int start_char cdef readonly int end_char cdef readonly int label cdef public np.ndarray tensor cdef public _vector cdef public _vector_no...
cimport numpy as np from .doc cimport Doc cdef class Span: cdef readonly Doc doc cdef readonly int start cdef readonly int end cdef readonly int start_char cdef readonly int end_char cdef readonly int label cdef public _vector cdef public _vector_norm cpdef int _recalculate_ind...
Remove tensor attribute from Span and Token.
Remove tensor attribute from Span and Token.
Cython
mit
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/spa...
5bc101006ea1238304f39b79f2df3bfb38126b00
spacy/tagger.pxd
spacy/tagger.pxd
from thinc.linear.avgtron cimport AveragedPerceptron from thinc.extra.eg cimport Example from thinc.structs cimport ExampleC from .structs cimport TokenC from .vocab cimport Vocab cdef class TaggerModel(AveragedPerceptron): cdef void set_featuresC(self, ExampleC* eg, const TokenC* tokens, int i) except * cdef...
from thinc.linear.avgtron cimport AveragedPerceptron from thinc.extra.eg cimport Example from thinc.structs cimport ExampleC from .structs cimport TokenC from .vocab cimport Vocab cdef class TaggerModel(AveragedPerceptron): cdef void set_featuresC(self, ExampleC* eg, const TokenC* tokens, int i) except * cdef...
Add cfg field to Tagger
Add cfg field to Tagger
Cython
mit
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,...
66b6655810db6d5f450e6a3dd3ad9eebfe40795e
scikits/audiolab/soundio/macosx/macosx_backend.pyx
scikits/audiolab/soundio/macosx/macosx_backend.pyx
cimport AudioHardware from AudioHardware cimport * cimport stdlib def yo(): cdef UInt32 sz, ndevices cdef AudioDeviceID *devices cdef char *name AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &sz, NULL) ndevices = sz / sizeof(AudioDeviceID) print "Number of detected devices:", ndevices
cimport AudioHardware from AudioHardware cimport * cimport stdlib cdef extern from "Python.h": object PyString_FromStringAndSize(char *v, int len) def yo(): cdef UInt32 sz, ndevices, i cdef AudioDeviceID *devices cdef char *name AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &sz, NULL) ndevices = ...
Enumerate core audio devices in cython.
Enumerate core audio devices in cython.
Cython
lgpl-2.1
cournape/audiolab,cournape/audiolab,cournape/audiolab
6bd135a31c25ee029258ffec48dc27c297c2e858
cupy/cuda/common.pxd
cupy/cuda/common.pxd
# distutils: language = c++ cdef extern from '../cuda/cupy_common.h': # thru parent to import in core ctypedef char cpy_byte ctypedef unsigned char cpy_ubyte ctypedef short cpy_short ctypedef unsigned short cpy_ushort ctypedef int cpy_int ctypedef unsigned int cpy_uint ctypedef long cpy_lo...
# distutils: language = c++ cdef extern from '../cuda/cupy_common.h': # thru parent to import in core ctypedef char cpy_byte ctypedef unsigned char cpy_ubyte ctypedef short cpy_short ctypedef unsigned short cpy_ushort ctypedef int cpy_int ctypedef unsigned int cpy_uint ctypedef long long c...
Fix long to long long.
Fix long to long long.
Cython
mit
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
081aa975c80187bdb0abaaa1e6ed2445b1e31b84
sdks/python/apache_beam/utils/windowed_value.pxd
sdks/python/apache_beam/utils/windowed_value.pxd
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
Make create() avaialable to pure python callers
Make create() avaialable to pure python callers
Cython
apache-2.0
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,charlesccyc...
8327194c6b48204045769a66f772c1e528d2ba7e
lib/blister/xmp.pyx
lib/blister/xmp.pyx
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. cdef class XMP: cdef set namespaces def __init__ (self): self.namespaces = { "stRef", "dc", ...
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. cdef set DEFAULT_XMP_NAMESPACES = { "stRef", "dc", "xmp", "xmpRights", "xmpMM", "xmpidq", } cdef class XMP: def...
Replace __ prefixes with cdefs for better encapsulation
Replace __ prefixes with cdefs for better encapsulation
Cython
bsd-3-clause
daaang/blister
a92308975bb6822bd13333aaf4983eda93c8f503
jnius/jnius_localref.pxi
jnius/jnius_localref.pxi
cdef class LocalRef: cdef jobject obj def __cinit__(self): self.obj = NULL def __dealloc__(self): cdef JNIEnv *j_env if self.obj != NULL: j_env = get_jnienv() j_env[0].DeleteGlobalRef(j_env, self.obj) self.obj = NULL cdef void create(self, JNIE...
cdef class LocalRef: cdef jobject obj def __cinit__(self): self.obj = NULL def __dealloc__(self): cdef JNIEnv *j_env if self.obj != NULL: j_env = get_jnienv() j_env[0].DeleteGlobalRef(j_env, self.obj) self.obj = NULL cdef void create(self, JNIEn...
Fix string format error in 2.6
Fix string format error in 2.6 In 2.6, you should give index value to format.
Cython
mit
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/py...
c10d651201984e3451d5d0a3e24e84aaec515297
tests/compile/fused_redeclare_T3111.pyx
tests/compile/fused_redeclare_T3111.pyx
# ticket: 3111 # mode: compile # tag: warnings ctypedef unsigned char npy_uint8 ctypedef unsigned short npy_uint16 ctypedef fused dtype_t: npy_uint8 ctypedef fused dtype_t_out: npy_uint8 npy_uint16 def foo(dtype_t[:] a, dtype_t_out[:, :] b): pass # The primary thing we're trying to test here is ...
# ticket: 3111 # mode: compile # tag: warnings ctypedef unsigned char npy_uint8 ctypedef unsigned short npy_uint16 ctypedef fused dtype_t: npy_uint8 ctypedef fused dtype_t_out: npy_uint8 npy_uint16 def foo(dtype_t[:] a, dtype_t_out[:, :] b): pass # The primary thing we're trying to test here is ...
Update (unrelated) test warnings after changing utility code in MemoryView.pyx.
Update (unrelated) test warnings after changing utility code in MemoryView.pyx.
Cython
apache-2.0
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
d0a9377d151288b3cc08a63da2e153bf3f7c4a2d
cygroonga.pyx
cygroonga.pyx
cimport ccygroonga def init(): return ccygroonga.grn_init() #cdef class Database: # cdef ccygroonga.grn_ctx* _c_ctx # cdef ccygroonga.grn_obj* _c_cb # # def __cinit__(self, ccygroonga.grn_ctx* c_ctx, ccygroonga.grn_obj* c_db): # self._c_ctx = c_ctx # self._c_db = c_db cdef class Context: ...
cimport ccygroonga def init(): return ccygroonga.grn_init() #cdef class Database: # cdef ccygroonga.grn_ctx* _c_ctx # cdef ccygroonga.grn_obj* _c_cb # # def __cinit__(self, ccygroonga.grn_ctx* c_ctx, ccygroonga.grn_obj* c_db): # self._c_ctx = c_ctx # self._c_db = c_db cdef class Context: ...
Fix typo and now it compiles successfully
Fix typo and now it compiles successfully
Cython
apache-2.0
hnakamur/cygroonga
9a2eeb0b80b2b7b44f94576ad7ef76167ac36131
src/petsc4py.PETSc.pyx
src/petsc4py.PETSc.pyx
#cython: embedsignature=True include "PETSc/PETSc.pyx"
#cython: embedsignature=True #cython: cdivision=True #cython: always_allow_keywords=True include "PETSc/PETSc.pyx"
Add Cython compiler directives waiting release 0.11.2
Add Cython compiler directives waiting release 0.11.2
Cython
bsd-2-clause
zonca/petsc4py,zonca/petsc4py,zonca/petsc4py,zonca/petsc4py
19c9f53851ee476aef49328f58c1afae927ad92c
tests/run/datetime_cimport.pyx
tests/run/datetime_cimport.pyx
# coding: utf-8 #import datetime from cpython.datetime cimport date, time, datetime, timedelta, PyDateTime_IMPORT PyDateTime_IMPORT def test_date(int year, int month, int day): ''' >>> val = test_date(2012, 12, 31) >>> print(val) 2012-12-31 ''' val = date(year, month, day) return ...
# coding: utf-8 from cpython.datetime cimport import_datetime from cpython.datetime cimport date, time, datetime, timedelta, PyDateTime_IMPORT import_datetime() def test_date(int year, int month, int day): ''' >>> val = test_date(2012, 12, 31) >>> print(val) 2012-12-31 ''' val = date(...
Change test to initialize by `import_datetime`
Change test to initialize by `import_datetime`
Cython
apache-2.0
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/cyt...
1d8ab221ce63fc157799ffee09f63ed6e06a8858
src/MPI/mpierrhdl.pxi
src/MPI/mpierrhdl.pxi
# ----------------------------------------------------------------------------- cdef inline int comm_set_eh(MPI_Comm ob) nogil except -1: if ob == MPI_COMM_NULL: return 0 cdef int opt = options.errors if opt == 0: pass elif opt == 1: CHKERR( MPI_Comm_set_errhandler(ob, MPI_ERRORS_RETURN) ) elif o...
# ----------------------------------------------------------------------------- cdef inline int comm_set_eh(MPI_Comm ob) nogil except -1: if ob == MPI_COMM_NULL: return 0 cdef int opt = options.errors if opt == 0: pass elif opt == 1: CHKERR( MPI_Comm_set_errhandler(ob, MPI_ERRORS_RETURN) ) elif o...
Fix File error handling rules
Fix File error handling rules
Cython
bsd-2-clause
mpi4py/mpi4py,mpi4py/mpi4py,mpi4py/mpi4py
11cce7294a71f9d0ee4e489f5d210db31c6c1e2d
cupy/core/_backend.pyx
cupy/core/_backend.pyx
cdef list _reduction_backends = [] cdef list _routine_backends = [] def _get_backend(str s): if s == 'cub': return BACKEND_CUB # if s == 'cutensor': # return BACKEND_CUTENSOR raise ValueError('Unknown backend: {}'.format(s)) def set_reduction_backends(str s): global _reduction_backen...
import os cdef list _reduction_backends = [] cdef list _routine_backends = [] def _get_backend(str s): if s == 'cub': return BACKEND_CUB # if s == 'cutensor': # return BACKEND_CUTENSOR raise ValueError('Unknown backend: {}'.format(s)) def set_reduction_backends(str s): global _reduc...
Set default backends from environment variables
Set default backends from environment variables
Cython
mit
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
54c403717e20052945524d074e773362911bdb7f
lineprofile/fitter.pxd
lineprofile/fitter.pxd
from model cimport LineModel cdef class FitGaussian(LineModel): cdef: double[:] data double[:] weights # Prior parameters # Mean and center of the prior radial velocity # of each profile and gaussian. double[:] v_center_mean double[:] v_center_std ...
from model cimport LineModel cdef class FitGaussian(LineModel): cdef: double[:] data double[:] weights # Prior parameters # Mean and center of the prior radial velocity # of each profile and gaussian. double[:] v_center_mean double[:] v_center_std ...
Add definition of Mixture Model
Add definition of Mixture Model
Cython
mit
lfloeer/hiprofile
1e113ce7d3d9f6ee64ec9bc0b569f9eb52dd2329
thrift/lib/py3/thrift_server.pyx
thrift/lib/py3/thrift_server.pyx
cimport cython from libcpp.memory cimport unique_ptr, make_unique, shared_ptr from thrift_server cimport ( cThriftServer, cServerInterface, ServiceInterface ) from folly_futures cimport cFollyPromise, cFollyUnit, c_unit import asyncio cdef class ThriftServer: cdef unique_ptr[cThriftServer] server cd...
cimport cython from libcpp.memory cimport unique_ptr, make_unique, shared_ptr from thrift_server cimport ( cThriftServer, cServerInterface, ServiceInterface ) from folly_futures cimport cFollyPromise, cFollyUnit, c_unit import asyncio cdef class ThriftServer: cdef unique_ptr[cThriftServer] server cd...
Correct cleanup when server fails
Correct cleanup when server fails Summary: Server has been crashing hard when it should be crashing soft (for example, when binding to the same port. This diff fixes it. Reviewed By: yfeldblum Differential Revision: D4242841 fbshipit-source-id: 242ee09ea244ce662c3122f25a96b8b4e8d60fcf
Cython
apache-2.0
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/fbthrif...
800deb7102e55c57a951d0b8d43f3631eb0e44c8
tests/run/cpp_smart_ptr.pyx
tests/run/cpp_smart_ptr.pyx
# distutils: extra_compile_args=-std=c++11 # mode: run # tag: cpp from libcpp.memory cimport unique_ptr, shared_ptr cdef extern from "cpp_smart_ptr_helper.h": cdef cppclass CountAllocDealloc: CountAllocDealloc(int*, int*) def test_unique_ptr(): """ >>> test_unique_ptr() """ cdef int alloc...
# distutils: extra_compile_args=-std=c++0x # mode: run # tag: cpp, werror from libcpp.memory cimport unique_ptr, shared_ptr cdef extern from "cpp_smart_ptr_helper.h": cdef cppclass CountAllocDealloc: CountAllocDealloc(int*, int*) def test_unique_ptr(): """ >>> test_unique_ptr() """ cdef i...
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.
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.
Cython
apache-2.0
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/cyth...
d01a897719a1aa7969ff72ac99a55f0429e08327
microscopes/common/_entity_state_h.pxd
microscopes/common/_entity_state_h.pxd
from libcpp.vector cimport vector from libcpp.utility cimport pair from libc.stddef cimport size_t from microscopes.common._random_fwd_h cimport rng_t cdef extern from "microscopes/common/entity_state.hpp" namespace "microscopes::common": # expose enough of the API here cdef cppclass entity_based_state_object...
from libcpp.vector cimport vector from libcpp.utility cimport pair from libc.stddef cimport size_t from microscopes.common._random_fwd_h cimport rng_t cdef extern from "microscopes/common/entity_state.hpp" namespace "microscopes::common": # expose enough of the API here cdef cppclass entity_based_state_object...
Add line break to end of file
Add line break to end of file
Cython
bsd-3-clause
datamicroscopes/common,datamicroscopes/common,datamicroscopes/common,datamicroscopes/common
b9fd7c839457815b31e549afabf37f0020ddcbe0
zeeko/zmq_check.pyx
zeeko/zmq_check.pyx
#cython: embedsignature=True import zmq cimport zmq.backend.cython.libzmq as libzmq from zmq.backend.cython.socket cimport Socket from libc.stdint cimport uint64_t class ZMQLinkingError(Exception): pass def check_zeromq(): """Check that zeromq is correctly installed.""" cdef void * handle cdef uint64...
#cython: embedsignature=True import zmq cimport zmq.backend.cython.libzmq as libzmq from zmq.backend.cython.socket cimport Socket from libc.stdint cimport uint64_t class ZMQLinkingError(Exception): pass def check_zeromq(): """Check that zeromq is correctly installed.""" cdef void * handle cdef uint64...
Fix a bug in zmq.check
Fix a bug in zmq.check
Cython
bsd-3-clause
alexrudy/Zeeko,alexrudy/Zeeko
719a42a3d50208cfcc053f7a57cc7c00522d7a77
tests/run/cython_includes.pyx
tests/run/cython_includes.pyx
from libc.stdio cimport sprintf from cpython cimport PyType_Check from cpython cimport PyType_Check as PyType_Check2 from cpython.type cimport PyType_Check as PyType_Check3 def libc_cimports(): """ >>> libc_cimports() hello """ cdef char[10] buf sprintf(buf, "%s", b'hello') print (<object>...
from libc.stdio cimport sprintf from cpython cimport PyType_Check from cpython cimport PyType_Check as PyType_Check2 from cpython.type cimport PyType_Check as PyType_Check3 # Make sure we can cimport all .pxd files. cimport cpython.array cimport cpython.bool cimport cpython.buffer cimport cpython.bytearray cimport cp...
Extend CPython C-API test to at least include (and thus parser) all .pxd files.
Extend CPython C-API test to at least include (and thus parser) all .pxd files.
Cython
apache-2.0
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
a0ee4f239d53ea2833cfabde189ad01c7fa27f68
tests/run/float_floor_division_T260.pyx
tests/run/float_floor_division_T260.pyx
def floor_div_float(double a, double b): """ >>> floor_div_float(2, 1.5) 1.0 >>> floor_div_float(2, -1.5) -2.0 >>> floor_div_float(-2.3, 1.5) -2.0 >>> floor_div_float(1e10, 1e-10) 1e+20 """ return a // b
def floor_div_float(double a, double b): """ >>> floor_div_float(2, 1.5) 1.0 >>> floor_div_float(2, -1.5) -2.0 >>> floor_div_float(-2.3, 1.5) -2.0 >>> floor_div_float(1e10, 1e-10) == 1e20 True """ return a // b
Fix for different Windows float repr
Fix for different Windows float repr
Cython
apache-2.0
bhy/cython-haoyu,bhy/cython-haoyu,bhy/cython-haoyu,bhy/cython-haoyu
80c1f49586cfd038fbec21bf283bf055f6358495
thinc/linear/features.pxd
thinc/linear/features.pxd
from cymem.cymem cimport Pool from ..structs cimport TemplateC, FeatureC from ..typedefs cimport atom_t cdef class ConjunctionExtracter: cdef Pool mem cdef readonly int nr_templ cdef readonly int nr_embed cdef readonly int nr_atom cdef public int linear_mode cdef int set_features(self, Featu...
from cymem.cymem cimport Pool from ..structs cimport TemplateC, FeatureC from ..typedefs cimport atom_t cdef class ConjunctionExtracter: cdef Pool mem cdef readonly int nr_templ cdef readonly int nr_embed cdef readonly int nr_atom cdef public int linear_mode cdef int set_features(self, Featu...
Add bag of words to header
Add bag of words to header
Cython
mit
explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc
52ad7227f19a661e72fb6332cd60b0dda0b2f1c0
microscopes/lda/_model_h.pxd
microscopes/lda/_model_h.pxd
from libcpp.vector cimport vector from libcpp.map cimport map from libc.stddef cimport size_t from microscopes._shared_ptr_h cimport shared_ptr from microscopes.common._random_fwd_h cimport rng_t from microscopes.common.variadic._dataview_h cimport dataview cdef extern from "microscopes/lda/model.hpp" namespace "mic...
from libcpp.vector cimport vector from libcpp.map cimport map from libc.stddef cimport size_t from microscopes._shared_ptr_h cimport shared_ptr from microscopes.common._random_fwd_h cimport rng_t from microscopes.common.variadic._dataview_h cimport dataview cdef extern from "microscopes/lda/model.hpp" namespace "mic...
Make parameter a reference parameter
Make parameter a reference parameter
Cython
bsd-3-clause
datamicroscopes/lda,datamicroscopes/lda,datamicroscopes/lda
b5e391e4ac169005d5c2f5b749f2b20ba7cb4c56
src/rank_filter.pxd
src/rank_filter.pxd
cimport cython from cython cimport floating cdef extern from "rank_filter_base.hxx" namespace "rank_filter": void lineRankOrderFilter1D[I1, I2](const I1& src_begin, const I1& src_end, I2& dest_begin, ...
cimport cython from cython cimport floating cdef extern from "rank_filter.hxx" namespace "rank_filter": void lineRankOrderFilter1D[I1, I2](const I1& src_begin, const I1& src_end, I2& dest_begin, I2...
Fix C++ header name in Cython header
Fix C++ header name in Cython header As the `_base` suffix has been dropped, update the Cython header accordingly.
Cython
bsd-3-clause
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
88316765082c12639fe1bb3afe456e3c838cca99
gssapi/raw/chan_bindings.pxd
gssapi/raw/chan_bindings.pxd
from libc.stdlib cimport malloc, free from gssapi.raw.cython_types cimport * cdef class ChannelBindings: cdef public object initiator_address_type cdef public bytes initiator_address cdef public object acceptor_address_type cdef public bytes acceptor_address cdef public bytes application_data ...
from libc.stdlib cimport malloc, free from gssapi.raw.cython_types cimport * cdef class ChannelBindings: cdef public object initiator_address_type cdef public bytes initiator_address cdef public object acceptor_address_type cdef public bytes acceptor_address cdef public bytes application_data ...
Fix channel bindings type signature
Fix channel bindings type signature Cython 0.22 didn't like that we didn't have the `except NULL` clause on the `__cvalue__` method in `ChannelBindings` in the .pxd file. This adds the clause to the .pxd file.
Cython
isc
frozencemetery/python-gssapi,pythongssapi/python-gssapi,frozencemetery/python-gssapi,pythongssapi/python-gssapi,frozencemetery/python-gssapi,pythongssapi/python-gssapi
c2c2d390e0eb4b6a8f627449bf9106b601b7834b
src/rank_filter.pxd
src/rank_filter.pxd
cimport cython from cython cimport floating cdef extern from "rank_filter.hxx" namespace "rank_filter": void lineRankOrderFilter1D[I1, I2](const I1& src_begin, const I1& src_end, I2& dest_begin, I2...
cimport cython from cython cimport floating cimport numpy cdef extern from "rank_filter.hxx" namespace "rank_filter": void lineRankOrderFilter1D[I1, I2](const I1& src_begin, const I1& src_end, I2& dest_begin, ...
Implement an `ndindex`-like Cython function
Implement an `ndindex`-like Cython function Provides a Cython function that acts similarly to `ndindex`. However it is written in C-style. So it does not yield, does not use classes, etc. It also doesn't keep state. However it can be used like a generator except in a `while`-loop where state external to the function i...
Cython
bsd-3-clause
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
e5557b2bee103aa33100b3e85795b4b2cf9c880d
simhash/simhash.pyx
simhash/simhash.pyx
import hashlib import struct from simhash cimport compute as c_compute from simhash cimport find_all as c_find_all def unsigned_hash(bytes obj): '''Returns a hash suitable for use as a hash_t.''' return struct.unpack('>Q', hashlib.md5(obj).digest()[0:8])[0] & 0xFFFFFFFFFFFFFFFF def compute(hashes): '''C...
import hashlib import struct from simhash cimport compute as c_compute from simhash cimport find_all as c_find_all def unsigned_hash(bytes obj): '''Returns a hash suitable for use as a hash_t.''' # Takes first 8 bytes of MD5 digest digest = hashlib.md5(obj).digest()[0:8] # Unpacks the binary bytes in...
Add comments around cryptic stuct.unpack invocation.
Add comments around cryptic stuct.unpack invocation.
Cython
mit
seomoz/simhash-py,seomoz/simhash-py,pombredanne/simhash-py,pombredanne/simhash-py
b06bf2a9c39da407188a69f38f5a611888431acc
gala/sparselol_cy.pyx
gala/sparselol_cy.pyx
cimport numpy as np from scipy import sparse def extents_count(Py_ssize_t[::1] labels, Py_ssize_t[::1] curr_loc, Py_ssize_t[::1] indices): cdef Py_ssize_t i for i, label in enumerate(labels): indices[curr_loc[label]] = i curr_loc[label] += 1
cimport numpy as np from scipy import sparse import cython @cython.boundscheck(False) @cython.wraparound(False) def extents_count(Py_ssize_t[::1] labels, Py_ssize_t[::1] curr_loc, Py_ssize_t[::1] indices): cdef Py_ssize_t i = 0 cdef Py_ssize_t label cdef Py_ssize_t size = len(labels) ...
Optimize construction of label indices
Optimize construction of label indices
Cython
bsd-3-clause
janelia-flyem/gala,jni/gala
38047e51f6911a3106abb576ba36421197917f81
pycvodes/include/cvodes_anyode_nogil.pxd
pycvodes/include/cvodes_anyode_nogil.pxd
# -*- mode: cython -*- # -*- coding: utf-8 -*- from libcpp cimport bool from libcpp.vector cimport vector from libcpp.utility cimport pair from cvodes_cxx cimport LMM, IterType from cvodes_cxx cimport realtype cdef extern from "cvodes_anyode.hpp" namespace "cvodes_anyode": cdef pair[vector[realtype], vector[realt...
# -*- mode: cython -*- # -*- coding: utf-8 -*- from libcpp cimport bool from libcpp.vector cimport vector from libcpp.utility cimport pair from cvodes_cxx cimport LMM, IterType cdef extern from "cvodes_anyode.hpp" namespace "cvodes_anyode": cdef pair[vector[double], vector[double]] simple_adaptive[U]( U *...
Revert nogil .pxd to master (appears unused?)
Revert nogil .pxd to master (appears unused?)
Cython
bsd-2-clause
bjodah/pycvodes,bjodah/pycvodes,bjodah/pycvodes,bjodah/pycvodes
63f6c5d97bef132fe0bacd713ede2c3511f68061
opencog/cython/opencog/bindlink.pyx
opencog/cython/opencog/bindlink.pyx
from opencog.atomspace cimport Atom, AtomSpace, TruthValue, PtrHolder from opencog.atomspace cimport cAtomSpace, cTruthValue from opencog.atomspace cimport tv_ptr, strength_t, count_t, shared_ptr from opencog.atomspace cimport handle_cast from cython.operator cimport dereference as deref from opencog.atomspace import ...
from opencog.atomspace cimport Atom, AtomSpace, TruthValue, PtrHolder from opencog.atomspace cimport cAtomSpace, cTruthValue from opencog.atomspace cimport tv_ptr, strength_t, count_t, shared_ptr from opencog.atomspace cimport handle_cast from cython.operator cimport dereference as deref from opencog.atomspace import ...
Use only create_value_by_type to create Value or Atom in execute_atom() method
Use only create_value_by_type to create Value or Atom in execute_atom() method
Cython
agpl-3.0
AmeBel/atomspace,rTreutlein/atomspace,rTreutlein/atomspace,rTreutlein/atomspace,AmeBel/atomspace,AmeBel/atomspace,AmeBel/atomspace,rTreutlein/atomspace,rTreutlein/atomspace,AmeBel/atomspace
20afa7edae4dc0726424140625529e94e881e658
skimage/_shared/geometry.pyx
skimage/_shared/geometry.pyx
#cython: cdivison=True #cython: boundscheck=False #cython: nonecheck=False #cython: wraparound=False cdef inline unsigned char point_in_polygon(int nr_verts, double *xp, double *yp, double x, double y): cdef int i cdef unsigned char c = 0 cdef int j = nr_verts - ...
#cython: cdivison=True #cython: boundscheck=False #cython: nonecheck=False #cython: wraparound=False cdef inline unsigned char point_in_polygon(int nr_verts, double *xp, double *yp, double x, double y): """Test whether point lies inside a polygon. Parameters ---...
Add doc string to point in polygon functions
Add doc string to point in polygon functions
Cython
bsd-3-clause
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/scik...
15dd0f0c7a01799827b7b6c739a4ed9a3a0d80c9
folly/python/range.pxd
folly/python/range.pxd
cdef extern from "folly/Range.h" namespace "folly": cdef cppclass Range[T]: Range() Range(T, int) T data() T begin() T end() int size() ctypedef Range[const char*] StringPiece ctypedef Range[const unsigned char*] ByteRange ctypedef fused R: StringPiece ByteR...
cdef extern from "folly/Range.h" namespace "folly": cdef cppclass Range[T]: Range() Range(T, int) T data() int size() ctypedef Range[const char*] StringPiece ctypedef Range[const unsigned char*] ByteRange ctypedef fused R: StringPiece ByteRange # Conversion Helpers cdef in...
Revert D22499183: refactor Enum code generation
Revert D22499183: refactor Enum code generation Differential Revision: D22499183 (https://github.com/facebook/folly/commit/24364356023d04f966a0ef6fc7536363932bdc82) Original commit changeset: b2af8d94024c fbshipit-source-id: a6bd56cdb4d4b73618a9374528371c5b18a0df10
Cython
apache-2.0
facebook/folly,facebook/folly,facebook/folly,facebook/folly,facebook/folly
db4078b3db30ab7634de87b228ec81cd42e5d372
thinc/linear/avgtron.pxd
thinc/linear/avgtron.pxd
from cymem.cymem cimport Pool from preshed.maps cimport PreshMap from .features cimport ConjunctionExtracter from ..typedefs cimport weight_t, feat_t, class_t from ..structs cimport FeatureC from ..structs cimport ExampleC cdef class AveragedPerceptron: cdef readonly Pool mem cdef readonly PreshMap weights ...
from cymem.cymem cimport Pool from preshed.maps cimport PreshMap from .features cimport ConjunctionExtracter from ..typedefs cimport weight_t, feat_t, class_t from ..structs cimport FeatureC from ..structs cimport ExampleC cdef class AveragedPerceptron: cdef readonly Pool mem cdef readonly PreshMap weights ...
Add nr_out attribute to AveragedPerceptron
Add nr_out attribute to AveragedPerceptron
Cython
mit
explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc
ac525f35adce3f1d49b159bd52f5b60606b56c6a
pycvodes/include/cvodes_anyode_parallel.pxd
pycvodes/include/cvodes_anyode_parallel.pxd
# -*- mode: cython -*- # -*- coding: utf-8 -*- from libcpp cimport bool from libcpp.vector cimport vector from libcpp.utility cimport pair from cvodes_cxx cimport LMM, IterType, LinSol, realtype, indextype cdef extern from "cvodes_anyode_parallel.hpp" namespace "cvodes_anyode_parallel": cdef vector[pair[int, vect...
# -*- mode: cython -*- # -*- coding: utf-8 -*- from libcpp cimport bool from libcpp.vector cimport vector from libcpp.utility cimport pair from cvodes_cxx cimport LMM, IterType, LinSol, realtype cdef extern from "cvodes_anyode_parallel.hpp" namespace "cvodes_anyode_parallel": cdef vector[pair[int, vector[int]]] m...
Remove unused cimport of indextype
Remove unused cimport of indextype
Cython
bsd-2-clause
bjodah/pycvodes,bjodah/pycvodes,bjodah/pycvodes,bjodah/pycvodes
12e02297df17d5680cbb8f9def6de056e10a744a
docs/examples/userguide/external_C_code/platform_adaptation.pyx
docs/examples/userguide/external_C_code/platform_adaptation.pyx
cdef extern from *: """ #if defined(WIN32) || defined(MS_WINDOWS) #include "synchapi.h" #define myapp_sleep(m) Sleep(m) #else #include <unistd.h> #define myapp_sleep(m) ((void) usleep((m) * 1000)) #endif """ # using "myapp_" prefix in the C code to prevent C naming conf...
cdef extern from *: """ #if defined(WIN32) || defined(MS_WINDOWS) #include <synchapi.h> #define myapp_sleep(m) Sleep(m) #else #include <unistd.h> #define myapp_sleep(m) ((void) usleep((m) * 1000)) #endif """ # using "myapp_" prefix in the C code to prevent C naming conf...
Fix test compile failure in MSVC.
Fix test compile failure in MSVC.
Cython
apache-2.0
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
ade34772023742a30be3a4c331fe6026768b5221
opencog/cython/opencog/atomspace.pyx
opencog/cython/opencog/atomspace.pyx
# Cython/distutils can only handle a single file as the source for # a python module. Since it is helpful to be able to split the binding # code into separate files, we just include them here. # # Note that the ordering of include statements may influence whether # things work or not include "nameserver.pyx" include ...
# Cython/distutils can only handle a single file as the source for # a python module. Since it is helpful to be able to split the binding # code into separate files, we just include them here. # # Note that the ordering of include statements may influence whether # things work or not include "nameserver.pyx" include ...
Add newline at the end of file
Add newline at the end of file
Cython
agpl-3.0
AmeBel/atomspace,rTreutlein/atomspace,AmeBel/atomspace,AmeBel/atomspace,AmeBel/atomspace,rTreutlein/atomspace,rTreutlein/atomspace,AmeBel/atomspace,rTreutlein/atomspace,rTreutlein/atomspace
9821a4481949bf6ec010635d005c3bba166acbc1
tests/compile/libc_all.pyx
tests/compile/libc_all.pyx
cimport libc cimport libc.stdio cimport libc.errno cimport libc.float cimport libc.limits cimport libc.locale cimport libc.signal cimport libc.stddef cimport libc.stdint cimport libc.stdio cimport libc.stdlib cimport libc.string from libc cimport errno from libc cimport float from libc cimport limits from libc cimpor...
cimport libc cimport libc.stdio cimport libc.errno cimport libc.float cimport libc.limits cimport libc.locale cimport libc.signal cimport libc.stddef #cimport libc.stdint # XXX MSVC cimport libc.stdio cimport libc.stdlib cimport libc.string from libc cimport errno from libc cimport float from libc cimport limits from...
Disable test for libc.stdint (missing stdint.h in MSVC)
Disable test for libc.stdint (missing stdint.h in MSVC)
Cython
apache-2.0
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,f...
10b13b65173207d274ffa9570ec77a1aed6bc7e8
src/pygame_sdl2/error.pyx
src/pygame_sdl2/error.pyx
# Copyright 2014 Tom Rothamel <tom@rothamel.us> # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including co...
# Copyright 2014 Tom Rothamel <tom@rothamel.us> # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including co...
Use format string with SDL_SetError.
Use format string with SDL_SetError. Fixes #26, although the fix wasn't tested.
Cython
lgpl-2.1
renpy/pygame_sdl2,renpy/pygame_sdl2,renpy/pygame_sdl2,renpy/pygame_sdl2
22b5dfb488cf3ce81ed2a6c6ff608746b1963510
docs/examples/tutorial/fib1/fib.pyx
docs/examples/tutorial/fib1/fib.pyx
def fib(n): """Print the Fibonacci series up to n.""" a, b = 0, 1 while b < n: print(b) a, b = b, a + b
from __future__ import print_function def fib(n): """Print the Fibonacci series up to n.""" a, b = 0, 1 while b < n: print(b, end=' ') a, b = b, a + b print()
Change demo file back to original output style.
Change demo file back to original output style.
Cython
apache-2.0
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
a23b3c1a5b7481b3c33861fda1a40ca67e61f45e
tests/run/uninitialized.pyx
tests/run/uninitialized.pyx
# mode: run # tag: control-flow, uninitialized def conditional(cond): """ >>> conditional(True) [] >>> conditional(False) Traceback (most recent call last): ... UnboundLocalError: a """ if cond: a = [] return a def inside_loop(iter): """ >>> inside_loop([1,2,3])...
# mode: run # tag: control-flow, uninitialized def conditional(cond): """ >>> conditional(True) [] >>> conditional(False) Traceback (most recent call last): ... UnboundLocalError: a """ if cond: a = [] return a def inside_loop(iter): """ >>> inside_loop([1,2,3])...
Add testcase for local variable deletion
Add testcase for local variable deletion
Cython
apache-2.0
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/...
d17d4e96f7633a7b7848f2136102c5c58b91414e
docs/examples/tutorial/string/return_memview.pyx
docs/examples/tutorial/string/return_memview.pyx
def process_byte_data(unsigned char[:] data, bint return_all): # ... process the data if return_all: return bytes(data) else: # example for returning a slice return bytes(data[5:35])
def process_byte_data(unsigned char[:] data): # ... process the data, here, dummy processing. cdef bint return_all = (data[0] == 108) if return_all: return bytes(data) else: # example for returning a slice return bytes(data[5:7])
Put a dummy processing in the function rather than asking the user for decision.
Put a dummy processing in the function rather than asking the user for decision.
Cython
apache-2.0
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
9939253fed657c3a48be2188d97c11d72a011777
tests/compile/fused_redeclare_T3111.pyx
tests/compile/fused_redeclare_T3111.pyx
# ticket: 3111 # mode: compile # tag: warnings ctypedef unsigned char npy_uint8 ctypedef unsigned short npy_uint16 ctypedef fused dtype_t: npy_uint8 ctypedef fused dtype_t_out: npy_uint8 npy_uint16 def foo(dtype_t[:] a, dtype_t_out[:, :] b): pass # The primary thing we're trying to test here is ...
# ticket: 3111 # mode: compile # tag: warnings ctypedef unsigned char npy_uint8 ctypedef unsigned short npy_uint16 ctypedef fused dtype_t: npy_uint8 ctypedef fused dtype_t_out: npy_uint8 npy_uint16 def foo(dtype_t[:] a, dtype_t_out[:, :] b): pass # The primary thing we're trying to test here is ...
Fix unrelated test after changing MemoryView.pyx.
Fix unrelated test after changing MemoryView.pyx.
Cython
apache-2.0
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
a9444675a968fec4abc72d27c9c74c733ea8f195
dit/math/_close.pyx
dit/math/_close.pyx
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Low level implementation of scalar `allclose`. """ cdef extern from "math.h": double fabs(double) int isinf(double) int isnan(double) def close(double x, double y, double rtol, double atol): """Returns True if the scalars x and y are close. The ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Low level implementation of scalar `allclose`. """ cdef extern from "math.h": double fabs(double) int isinf(double) int isnan(double) def close(double x, double y, double rtol, double atol): """Returns True if the scalars x and y are close. The ...
Simplify and speed up dit.math.close
Simplify and speed up dit.math.close
Cython
bsd-3-clause
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
81af0016b9ef16cfdc29574a63df4428af0f354c
src/mpi4py/MPI/asfspath.pxi
src/mpi4py/MPI/asfspath.pxi
#------------------------------------------------------------------------------ cdef extern from "Python.h": object PyOS_FSPath(object) cdef os_fsencode from os import fsencode as os_fsencode cdef object asmpifspath(object path, char *p[]): path = PyOS_FSPath(path) path = os_fsencode(path) PyBytes_As...
#------------------------------------------------------------------------------ cdef extern from "Python.h": object PyOS_FSPath(object) object PyUnicode_EncodeFSDefault(object) cdef object asmpifspath(object path, char *p[]): path = PyOS_FSPath(path) if PyUnicode_Check(path): path = PyUnicode...
Use PyUnicode_EncodeFSDefault() to encode unicode paths
File: Use PyUnicode_EncodeFSDefault() to encode unicode paths
Cython
bsd-2-clause
mpi4py/mpi4py,mpi4py/mpi4py,mpi4py/mpi4py
c652a153a2bf10a58d40e22831d73715fcfd3e3f
c/fnv1a.pyx
c/fnv1a.pyx
cdef extern from "<stdint.h>" nogil: ctypedef unsigned long long uint64_t cdef extern from "fnv1a.h": void fnv1a(const char *foo, const int length, uint64_t *hash); cdef class fnv1a64: cdef readonly uint64_t h def __cinit__(self, s=None): self.h = <uint64_t>0 if s is not None: ...
cdef extern from "<stdint.h>" nogil: ctypedef unsigned long long uint64_t cdef extern from "fnv1a.h": void fnv1a(const char *foo, const int length, uint64_t *hash) cdef class fnv1a64: cdef readonly uint64_t h name = "fnv1a64" digestsize = 8 digest_size = 8 def __cinit__(self, s=N...
Make fnv object more like hashlib hashes
Make fnv object more like hashlib hashes
Cython
cc0-1.0
sureshsundriyal/libfnv,sureshsundriyal/libfnv
2eaecc4d4d3890bb90d47a80c8c2a3b7fbabc799
h5py/_objects.pxd
h5py/_objects.pxd
# This file is part of h5py, a Python interface to the HDF5 library. # # http://www.h5py.org # # Copyright 2008-2013 Andrew Collette and contributors # # License: Standard 3-clause BSD; see "license.txt" for full license terms # and contributor agreement. from defs cimport * cdef class ObjectID: cdef ...
# This file is part of h5py, a Python interface to the HDF5 library. # # http://www.h5py.org # # Copyright 2008-2013 Andrew Collette and contributors # # License: Standard 3-clause BSD; see "license.txt" for full license terms # and contributor agreement. from defs cimport * cdef class ObjectID: cdef ...
Use size_t to store Python object id
Use size_t to store Python object id
Cython
bsd-3-clause
h5py/h5py,h5py/h5py,h5py/h5py
4abd62fe543b170cf3cf4b0039077ef752e77d0c
av/video/plane.pyx
av/video/plane.pyx
from av.video.frame cimport VideoFrame cdef class VideoPlane(Plane): def __cinit__(self, VideoFrame frame, int index): for i in range(frame.format.ptr.nb_components): if frame.format.ptr.comp[i].plane == index: self.component = frame.format.components[i] ...
from av.video.frame cimport VideoFrame cdef class VideoPlane(Plane): def __cinit__(self, VideoFrame frame, int index): for i in range(frame.format.ptr.nb_components): if frame.format.ptr.comp[i].plane == index: self.component = frame.format.components[i] ...
Document the motivation for the fix
Document the motivation for the fix
Cython
bsd-3-clause
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
d6bb5f89a46802a8d82eeec04faa1c53addbf8ab
tests/run/datetime_cimport.pyx
tests/run/datetime_cimport.pyx
# coding: utf-8 #import datetime from cpython.datetime cimport date, time, datetime, timedelta, PyDateTime_IMPORT PyDateTime_IMPORT def test_date(int year, int month, int day): ''' >>> val = test_date(2012, 12, 31) >>> print(val) 2012-12-31 ''' val = date(year, month, day) return ...
# coding: utf-8 #import datetime from cpython.datetime cimport date, time, datetime, timedelta, PyDateTime_IMPORT PyDateTime_IMPORT def test_date(int year, int month, int day): ''' >>> val = test_date(2012, 12, 31) >>> print(val) 2012-12-31 ''' val = date(year, month, day) return ...
Add new line at the end of file
Add new line at the end of file
Cython
apache-2.0
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,hh...
6666867bfba0bbf6cdb3667a57807e434f1e7f3e
tests/run/cyfunction.pyx
tests/run/cyfunction.pyx
# cython: binding=True # mode: run # tag: cyfunction def test_dict(): """ >>> test_dict.foo = 123 >>> test_dict.__dict__ {'foo': 123} """ def test_name(): """ >>> test_name.__name__ 'test_name' """ def test_reduce(): """ >>> import pickle >>> pickle.loads(pickle.dumps(...
# cython: binding=True # mode: run # tag: cyfunction def test_dict(): """ >>> test_dict.foo = 123 >>> test_dict.__dict__ {'foo': 123} >>> test_dict.__dict__ = {'bar': 321} >>> test_dict.__dict__ {'bar': 321} >>> test_dict.func_dict {'bar': 321} """ def test_name(): """ ...
Add some more test cases
Add some more test cases
Cython
apache-2.0
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,l...
37014a98700167001b14f1aa83f7e24b8ca1b6c9
astropy/table/_column_mixins.pyx
astropy/table/_column_mixins.pyx
import sys import numpy as np cimport numpy as cnp if sys.version_info[0] == 3: INTEGER_TYPES = (int, np.integer) else: INTEGER_TYPES = (int, long, np.integer) # Annoying boilerplate that we shouldn't have to write; Cython should # have this built in (some versions do, but the ctypedefs are still lacking, #...
import sys import numpy as np if sys.version_info[0] == 3: INTEGER_TYPES = (int, np.integer) else: INTEGER_TYPES = (int, long, np.integer) # Annoying boilerplate that we shouldn't have to write; Cython should # have this built in (some versions do, but the ctypedefs are still lacking, # or what is available...
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 c...
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 ...
Cython
bsd-3-clause
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,ale...
e59e51e330b756b42d781a9f2d4d816cf40d46cf
tests/compile/fused_redeclare_T3111.pyx
tests/compile/fused_redeclare_T3111.pyx
# ticket: 3111 # mode: compile # tag: warnings ctypedef unsigned char npy_uint8 ctypedef unsigned short npy_uint16 ctypedef fused dtype_t: npy_uint8 ctypedef fused dtype_t_out: npy_uint8 npy_uint16 def foo(dtype_t[:] a, dtype_t_out[:, :] b): pass # The primary thing we're trying to test here is ...
# ticket: 3111 # mode: compile # tag: warnings ctypedef unsigned char npy_uint8 ctypedef unsigned short npy_uint16 ctypedef fused dtype_t: npy_uint8 ctypedef fused dtype_t_out: npy_uint8 npy_uint16 def foo(dtype_t[:] a, dtype_t_out[:, :] b): pass # The primary thing we're trying to test here is ...
Revert "Fix test." (which only applied to the 0.29.x branch).
Revert "Fix test." (which only applied to the 0.29.x branch). This reverts commit bfcaf163e3dcf472ef2af5dec6ac3fffd0d34e66.
Cython
apache-2.0
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
1a3916bc4580f10e0b634a83fa6b81d6d37f12b4
src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi
src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi
# Copyright 2019 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
# Copyright 2019 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
Use False instead 0 for bint
Use False instead 0 for bint
Cython
apache-2.0
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/g...
867c0598565ed6b9fdae43d6c9431974d692cd44
cytoolz/__init__.pxd
cytoolz/__init__.pxd
from .itertoolz cimport (groupby, frequencies, reduceby, first, second, nth, take, drop, rest, last, get, concat, concatv, isdistinct, interleave, interpose, unique, isiterable, remove, iterate, accumulate, partition, co...
from cytoolz.itertoolz cimport ( accumulate, cons, count, drop, get, groupby, first, frequencies, interleave, interpose, isdistinct, isiterable, iterate, last, nth, partition, reduceby, remove, rest, second, take, take_nth, unique) from cytoolz.functoolz cimport ( c_compose, c_juxt, c_memoize, c_pipe,...
Use absolute `cimport` in *.pxd files. Relative cimporting doesn't appear to work.
Use absolute `cimport` in *.pxd files. Relative cimporting doesn't appear to work. Also, alphabetize import in "cytoolz/__init__.pxd" (just because). The main reason we don't do `from cytoolz.itertoolz cimport *` is so there is a quick and easy reference for what is cimport-able.
Cython
bsd-3-clause
cpcloud/cytoolz,ljwolf/cytoolz,llllllllll/cytoolz,simudream/cytoolz,simudream/cytoolz,llllllllll/cytoolz,cpcloud/cytoolz
69890b58d5b192f7718583f32e6973041e1d08c0
tests/errors/e_del.pyx
tests/errors/e_del.pyx
# mode: error cdef struct S: int m def f(a): cdef int i, x[2] cdef S s global j del f() # error del i # error: deletion of non-Python object del j # error: deletion of non-Python object del x[i] # error: deletion of non-Python object del s.m # error: deletion of non-Python object _...
# mode: error cdef struct S: int m def f(a): cdef int i, x[2] cdef S s global j del f() # error del i # error: deletion of non-Python object del j # error: deletion of non-Python object del x[i] # error: deletion of non-Python object del s.m # error: deletion of non-Python object ...
Add testcase for closure variable deletion
Add testcase for closure variable deletion
Cython
apache-2.0
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-bl...
9ae2f5ff84117c3eea317387436364dcfd328bc6
tests/compile/min_async.pyx
tests/compile/min_async.pyx
# Need to include all utility code ! async def sleep(x): pass async def call(): await sleep(1) yield
# mode: compile # tag: pep492, await # Need to include all utility code ! async def sleep(x): pass async def call(): await sleep(1) yield
Fix test setup for compile-only test file.
Fix test setup for compile-only test file.
Cython
apache-2.0
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
79125fae06273b42a3993b9635be43fff3d1d146
pyinform/pyinform.pyx
pyinform/pyinform.pyx
cimport cython.array cimport numpy import numpy cdef extern from "stdint.h": ctypedef unsigned long uint64_t cdef extern from "inform/time_series.h": double inform_active_info(const uint64_t* series, size_t n, uint64_t base, uint64_t k) def activeinfo(xs, uint64_t k, uint64_t b = 0): if len(xs) == 0: ...
cimport cython.array cimport numpy import numpy cdef extern from "stdint.h": ctypedef unsigned long uint64_t cdef extern from "inform/time_series.h": double inform_active_info(const uint64_t* series, size_t n, uint64_t base, uint64_t k) def activeinfo(xs, uint64_t k, uint64_t b = 0): from math import isn...
Update code to pass tests
Update code to pass tests
Cython
mit
ELIFE-ASU/PyInform
39c44884a47b730d0a9b832cbe299a67a65c23f7
thinc/typedefs.pxd
thinc/typedefs.pxd
from libc.stdint cimport uint64_t from libc.stdint cimport uint32_t from libc.stdint cimport uint16_t from libc.stdint cimport int32_t ctypedef double weight_t ctypedef uint64_t atom_t ctypedef uint64_t feat_t ctypedef uint64_t hash_t ctypedef int32_t class_t ctypedef uint32_t count_t ctypedef uint32_t time_t ctypede...
from libc.stdint cimport uint64_t from libc.stdint cimport uint32_t from libc.stdint cimport uint16_t from libc.stdint cimport int32_t ctypedef float weight_t ctypedef uint64_t atom_t ctypedef uint64_t feat_t ctypedef uint64_t hash_t ctypedef int32_t class_t ctypedef uint32_t count_t ctypedef uint32_t time_t ctypedef...
Use 32 bit floats, not 64 bit.
Use 32 bit floats, not 64 bit.
Cython
mit
spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc
bb94c0e50f3825957194280babe7280863b00cde
tests/errors/cpdef_vars.pyx
tests/errors/cpdef_vars.pyx
# tag: warnings cpdef str a = "123" cpdef b = 2 cdef class C: cpdef float c def func(): cpdef d=C() return d _WARNINGS = """ 3:6: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables 4:6: cpdef variables will not be supported in Cython 3; currently they ...
# tag: warnings cpdef str a = "123" cpdef b = 2 cdef class C: cpdef float c def func(): """ >>> c = func() >>> isinstance(c, C) or c True """ cpdef d = C() return d _WARNINGS = """ 3:6: cpdef variables will not be supported in Cython 3; currently they are no different from cdef vari...
Make a working test actually test something.
Make a working test actually test something.
Cython
apache-2.0
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
274a4d4272c63ec8b38e2bf168ac6725cb1ae3a9
spacy/syntax/stateclass.pyx
spacy/syntax/stateclass.pyx
from libc.string cimport memcpy, memset from libc.stdint cimport uint32_t from ..vocab cimport EMPTY_LEXEME from ..structs cimport Entity from ..lexeme cimport Lexeme from ..symbols cimport punct from ..attrs cimport IS_SPACE cdef class StateClass: def __init__(self, int length): cdef Pool mem = Pool() ...
from libc.string cimport memcpy, memset from libc.stdint cimport uint32_t from ..vocab cimport EMPTY_LEXEME from ..structs cimport Entity from ..lexeme cimport Lexeme from ..symbols cimport punct from ..attrs cimport IS_SPACE cdef class StateClass: def __init__(self, int length): cdef Pool mem = Pool() ...
Fix queue Python property in StateClass
Fix queue Python property in StateClass
Cython
mit
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,rec...
257bf381065274a9498673708915ce034d54a38a
tests/compile/fused_redeclare_T3111.pyx
tests/compile/fused_redeclare_T3111.pyx
# ticket: 3111 # mode: compile # tag: warnings ctypedef unsigned char npy_uint8 ctypedef unsigned short npy_uint16 ctypedef fused dtype_t: npy_uint8 ctypedef fused dtype_t_out: npy_uint8 npy_uint16 def foo(dtype_t[:] a, dtype_t_out[:, :] b): pass # The primary thing we're trying to test here is ...
# ticket: 3111 # mode: compile # tag: warnings ctypedef unsigned char npy_uint8 ctypedef unsigned short npy_uint16 ctypedef fused dtype_t: npy_uint8 ctypedef fused dtype_t_out: npy_uint8 npy_uint16 def foo(dtype_t[:] a, dtype_t_out[:, :] b): pass # The primary thing we're trying to test here is ...
Fix unrelated test after changing MemoryView.pyx.
Fix unrelated test after changing MemoryView.pyx.
Cython
apache-2.0
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
a498d5231adb20b8677aee18ea2cd643b1c41bcd
tests/memoryview/extension_type_memoryview.pyx
tests/memoryview/extension_type_memoryview.pyx
# mode: run # tag: numpy import numpy as np cdef class ExtensionType(object): cdef public int dummy def __init__(self, n): self.dummy = n items = [ExtensionType(1), ExtensionType(2)] cdef ExtensionType[:] view = np.array(items, dtype=ExtensionType) def test_getitem(): """ >>> test_getitem(...
Add test for memoryview of extension type
Add test for memoryview of extension type A test for a bug fixed in commit 478b939a4c99a77c0863cfd. v2: add commit link above v3: # tag: instead of # tags:, drop cpp tag as it means something different that I originally thought There was a bug that produced C code where gcc emitted warnings: extension_type_memor...
Cython
apache-2.0
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/...
92f424fc9919ddd8a37a2f1286ed05af28f068b1
tests/run/uninitialized.pyx
tests/run/uninitialized.pyx
# mode: run # tag: control-flow, uninitialized def conditional(cond): """ >>> conditional(True) [] >>> conditional(False) Traceback (most recent call last): ... UnboundLocalError: a """ if cond: a = [] return a def inside_loop(iter): """ >>> inside_loop([1,2,3])...
Add some simple run tests for control-flow
Add some simple run tests for control-flow
Cython
apache-2.0
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,mrG...
b9793d157364b5d3102fcebd90ef8e86b8a0f5c9
pyglsl_parser/pyglsl_parser.pyx
pyglsl_parser/pyglsl_parser.pyx
# distutils: language = c++ # distutils: extra_compile_args = -fno-rtti -fno-exceptions from enum import IntEnum from libcpp cimport bool from libcpp.vector cimport vector from cython.operator import dereference class ShaderType(IntEnum): Compute = 0 Vertex = 1 TessControl = 2 TessEvaluation = 3 ...
Add initial Cython pyx file for glsl-parser
Add initial Cython pyx file for glsl-parser
Cython
mit
nicholasbishop/pyglsl_parser,nicholasbishop/pyglsl_parser
587d7b15e321e9b445251fdd54b36eef224578be
include/miniutils.pyx
include/miniutils.pyx
cdef public int broadcast_arrays(list arrays, tuple broadcast_shape, int ndim, cnp.npy_intp **shape_out, cnp.npy_intp **strides_out) except -1: """ Broadcast the given arrays. Returns the total broadcast shape of size ndim in shape_out. Retur...
Add some broadcasting Cython utilities
Add some broadcasting Cython utilities
Cython
bsd-2-clause
markflorisson/minivect,markflorisson/minivect
9ca8c125c2e575a7d7cf1c22b5f909f322228468
tests/run/temps_corner1.pyx
tests/run/temps_corner1.pyx
__doc__ = """ >>> B().coeffs_bitsize() [2] """ cdef class A: def numerator(self): return self cdef int bitsize(A a): return 1 coeffs = [A()] class B: def coeffs_bitsize(self): r = [bitsize(c.numerator())+1 for c in coeffs] return r
Add corner case temp (de)allocation test.
Add corner case temp (de)allocation test. This is as simple as I could get it.
Cython
apache-2.0
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/CythonCTyp...
e997bb99ddc0d26e9a95ad53c2fa52f4932b93ef
tests/run/cpp_move.pyx
tests/run/cpp_move.pyx
# mode: run # tag: cpp, werror, cpp11 from libcpp cimport nullptr from libcpp.memory cimport shared_ptr, make_shared from libcpp.utility cimport move from cython.operator cimport dereference cdef extern from *: """ #include <string> template<typename T> const char* move_helper(T&) { return "lvalue-ref"; ...
Add tests for std::move wrapper
Add tests for std::move wrapper
Cython
apache-2.0
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
457f38f98c6a67c6ee87cab9e2e3094f7655da35
tests/errors/w_cdef_override.pyx
tests/errors/w_cdef_override.pyx
# mode: error # tags: werror cdef foo(): pass def foo(): pass _ERRORS = u""" 7:0: 'foo' redeclared 7:0: Overriding cdef method with def method. """
Add simple test for cdef override warning
Add simple test for cdef override warning
Cython
apache-2.0
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/cy...
2d75b4bfcc0b34bc43dea8dc22bcad37e6d25143
tests/run/unicode_slicing.pyx
tests/run/unicode_slicing.pyx
# coding=utf-8 __doc__ = u""" >>> do_slice(u'abcdef', 2, 3) (u'c', u'cdef', u'ab', u'abcdef') >>> do_slice(u'abcdef', 0, 5) (u'abcde', u'abcdef', u'', u'abcdef') """ import sys if sys.version_info[0] >= 3: __doc__ = __doc__.replace(u"(u'", u"('").replace(u" u'", u" '") def do_slice(unicode s, int...
Add support for unicode slicing
Add support for unicode slicing
Cython
apache-2.0
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/cytho...
6c4108c0732494186b7e19d63173809d9859fdb8
spacy/syntax/beam_parser.pxd
spacy/syntax/beam_parser.pxd
from .parser cimport Parser from ..structs cimport TokenC from thinc.typedefs cimport weight_t cdef class BeamParser(Parser): cdef public int beam_width cdef public weight_t beam_density cdef int _parseC(self, TokenC* tokens, int length, int nr_feat, int nr_class) except -1
Add header for beam parser
Add header for beam parser
Cython
mit
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,...
6a1f92925df1d5de702aae1072ab02d212d7db26
tests/run/pytype.pyx
tests/run/pytype.pyx
from cpython.type cimport PyType_IsSubtype class mylist(list): pass def test_issubtype(a, b): """ >>> test_issubtype(mylist, list) True >>> test_issubtype(mylist, dict) False >>> o = object() >>> test_issubtype(o, list) Traceback (most recent call last): ... TypeError: Cannot ...
Add run test for type ctypedef and PyType_IsSubtype.
Add run test for type ctypedef and PyType_IsSubtype.
Cython
apache-2.0
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,hickf...
cf9ba53a0e3635074b2117f471d6741f3a2396ba
folly/python/range.pxd
folly/python/range.pxd
cdef extern from "folly/Range.h" namespace "folly": cdef cppclass Range[T]: Range() Range(T, int) T data() int size() ctypedef Range[const char*] StringPiece ctypedef Range[const unsigned char*] ByteRange ctypedef fused R: StringPiece ByteRange # Conversion Helpers cdef in...
Add ByteRange/StringPiece Conversion for Cython
Add ByteRange/StringPiece Conversion for Cython Summary: Moving the cython definition to folly/python. Adding simple conversion helper to_bytes This is to cut down on duplicate folly::range cython definitions Reviewed By: yfeldblum Differential Revision: D6291125 fbshipit-source-id: 314b732a1516a03fb5c9a57939552bb...
Cython
apache-2.0
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
25e9a252fb59c273c9a9578a3520270b9688fe67
numba/exttypes/inheritance_prototype.pyx
numba/exttypes/inheritance_prototype.pyx
""" This demo depicts how we can support overriding of numba methods in python. In Cython, cpdef methods check to see if the object has a dict, and if so look up the method at runtime and dispatch if found: cpdef mymethod(self): if hasattr(self, '__dict__'): return self.mymethod() <met...
Add prototype for method overriding from Python
Add prototype for method overriding from Python
Cython
bsd-2-clause
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/n...
e326813900a9b62a25cc8d36de74c906d0439d66
dynd/cpp/functional.pxd
dynd/cpp/functional.pxd
from ..config cimport translate_exception from .callable cimport callable cdef extern from "dynd/functional.hpp" namespace "dynd::nd::functional" nogil: callable apply(...) except +translate_exception
Add a minimal wrapper for apply.
Add a minimal wrapper for apply.
Cython
bsd-2-clause
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,ContinuumI...