sys._getframe.f_code.co_name

Here are the examples of the python api sys._getframe.f_code.co_name taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

200 Examples 7

Example 1

Project: pyeq3
Source File: DataCacheFunctions.py
View license
def Pow2CosX(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name
    try:
        return numpy.power(numpy.cos(data[0]), 2.0)
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 2

Project: pyeq2
Source File: DataCacheFunctions.py
View license
def YSQMINUSXSQ(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name
    try:
        return (data[1] * data[1]) - (data[0] * data[0])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 3

Project: scikit-video
Source File: test_libav.py
View license
@unittest.skipIf(not skvideo._HAS_AVCONV, "LibAV required for this test.")
def test_LibAVWriter_aboveversion9():
    # skip if libav not installed or of the proper version
    if not skvideo._HAS_AVCONV:
        return 0
    if np.int(skvideo._LIBAV_MAJOR_VERSION) < 9:
        return 0

    # generate random data for 5 frames
    outputfile = sys._getframe().f_code.co_name + ".mp4"

    outputdata = np.random.random(size=(5, 480, 640, 3)) * 255
    outputdata = outputdata.astype(np.uint8)

    writer = skvideo.io.LibAVWriter(outputfile)
    for i in range(5):
        writer.writeFrame(outputdata[i])
    writer.close()
    os.remove(outputfile)

Example 4

Project: blue-ribbon-plus
Source File: nikeplus.py
View license
	def _AddGPSDataToTimeSeries(self):
		try:
			for m in self.data['gpsmetrics']:
				for i in range(len(m['waypoints'])):
					#add the waypoints to the time series (using setdefault to create the time entry)
					self.data['timeSeries'].setdefault(int(self.duration * (float(i) / (len(m['waypoints']) - 1))), {})['WAYPOINT'] = m['waypoints'][i]
		except:
			self.logger.error("[{i}] {f}({m})".format(i=self.id, f=str(sys._getframe().f_code.co_name), m="Error gps to time series for activity id {a}".format(a=self.activity_id)))
			raise
		self.logger.info("[{i}] {f}({m})".format(i=self.id, f=str(sys._getframe().f_code.co_name), m="Added gps to time series for activity id {a}".format(a=self.activity_id)))
		return self

Example 5

Project: blue-ribbon-plus
Source File: nikeplus.py
View license
	def GetActivitySummary(self,activity_id):
		if len(self.activities) == 0:
			self.RetrieveActivities()
			if len(self.activities) == 0:
				self.logger.error("[{i}] [{t}] [{f}] ({m})".format(i=self.id, t=thread.get_ident(), f=str(sys._getframe().f_code.co_name), m="No activities for this account"))
				raise NikePlusError("There are no activities for this account")
		if activity_id not in self.activities.keys():
			self.logger.error("[{i}] [{t}] [{f}] ({m})".format(i=self.id, t=thread.get_ident(), f=str(sys._getframe().f_code.co_name), m="Activity ID {a} not found on this account".format(a=activity_id)))
			raise NikePlusError("Activity ID {a} not found!".format(a=activity_id))
		return self.activities[activity_id]

Example 6

Project: pyeq3
Source File: DataCacheFunctions.py
View license
def PowX(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name + '_' + str(args[0])
    try:
        return numpy.power(data[0], args[0])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 7

Project: pyeq3
Source File: DataCacheFunctions.py
View license
def RecipY(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name
    try:
        return 1.0 / data[1]
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 8

Project: pyeq3
Source File: DataCacheFunctions.py
View license
def RecipX(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name
    try:
        return 1.0 / data[0]
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 9

Project: pyeq2
Source File: DataCacheFunctions.py
View license
def XSQPLUSYSQ_POW8_3D(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name
    try:
        return numpy.power((data[0] * data[0]) + (data[1] * data[1]), 8.0)
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 10

Project: pyeq2
Source File: DataCacheFunctions.py
View license
def PowExpY(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name + '_' + str(args[0])
    try:
        return numpy.power(numpy.exp(data[1]), args[0])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 11

Project: blue-ribbon-plus
Source File: nikeplus.py
View license
	def AddGPS(self,g={}):
		try:
			self.data['gpsmetrics'] = [g] #Keeping it in the same format as metrics
			self._AddGPSDataToTimeSeries()._Interpolate()
		except:
			self.logger.error("[{i}] {f}({m})".format(i=self.id, f=str(sys._getframe().f_code.co_name), m="Error adding gps to Activity ID {a}".format(a=self.activity_id)))
			self.logger.debug("[{i}] {f}({m})".format(i=self.id, f=str(sys._getframe().f_code.co_name), m="Error {e}, GPS Data: {data}".format(e=sys.exc_info()[0],data=g)))
			raise
		self.logger.info("[{i}] {f}({m})".format(i=self.id, f=str(sys._getframe().f_code.co_name), m="Added gps for activity id {a}".format(a=self.activity_id)))
		self.gps = True
		return self

Example 12

Project: blue-ribbon-plus
Source File: nikeplus.py
View license
	def __init__(self, a_id=None):
		self.logger = logging.getLogger('nikeplus.NikePlusActivity')
		self.id = id(self)
		self.logger.info('[{i}] {f}({m})'.format(i=self.id, f=str(sys._getframe().f_code.co_name), m="Creating Instance for activity id {a}".format(a=a_id)))
		self.activity_id = a_id
		self.data = {}
		self.data['timeSeries'] = {}
		self.detail = False
		self.gps = None
		self.duration = 0
		self.distance = 0
		self.calories = 0
		self.distance_smoothing_window = 1
		self.start_datetime = None
		return

Example 13

Project: cpthook
Source File: test_cpthookconfig.py
View license
def cfgfile(filename=None):
    """Return name of config file corresponding with calling function name"""
    if filename is None:
        filename = sys._getframe(1).f_code.co_name + '.cfg'
    return '/'.join((
        os.path.dirname(os.path.realpath(__name__)),
        'tests',
        'configs',
        filename))

Example 14

View license
    def update(self, m):
        if not m:
            return
        if type(m) is not str:
            raise TypeError, '%s() argument 1 must be string, not %s' % (sys._getframe().f_code.co_name, type(m).__name__)

        self._buffer += m
        self._counter += len(m)

        while len(self._buffer) >= 64:
            self._sha256_process(self._buffer[:64])
            self._buffer = self._buffer[64:]

Example 15

Project: pyeq3
Source File: DataCacheFunctions.py
View license
def Polyfunctional2D(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name + '_' + str(args)
    try:
        return eqInstance.polyfunctionalEquationList[args].value(data[0])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 16

Project: blue-ribbon-plus
Source File: nikeplus.py
View license
	def _GetGarminSport(self):
		if self.activity_type == "RUN":
			self.logger.info("[{i}] {f}({m})".format(i=self.id, f=str(sys._getframe().f_code.co_name), m="Detected 'garmin' sport for activity id {a} [{t}=Running]".format(a=self.activity_id,t=self.activity_type)))
			return "Running"

		#elif False: #May run other mappings later (Cycling?)
			#return self.activity_type
		else:
			self.logger.info ("[{i}] {f}({m})".format(i=self.id, f=str(sys._getframe().f_code.co_name), m="Failed to detect 'garmin' sport for activity id {a} ({t})".format(a=self.activity_id,t=self.activity_type)))
			return self.activity_type

Example 17

Project: pyeq3
Source File: DataCacheFunctions.py
View license
def SinX(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name
    try:
        return numpy.sin(data[0])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 18

View license
    def post(self, username, data, callback=None):
        if username not in self.clients:
            self.make_client(username)
        self.clients[username].message_callbacks.update(self.cmds)
        callback = callback or self.stc
        view_name = data['view'] if 'view' in data else sys._getframe(1).f_code.co_name
        self.clients[username].client_to_backend(data, callback, view_name)

Example 19

Project: pyeq3
Source File: DataCacheFunctions.py
View license
def CosX(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name
    try:
        return numpy.cos(data[0])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 20

Project: pyeq2
Source File: DataCacheFunctions.py
View license
def XSQPLUSYSQ_POW6_3D(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name
    try:
        return numpy.power((data[0] * data[0]) + (data[1] * data[1]), 6.0)
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 21

Project: pyeq2
Source File: DataCacheFunctions.py
View license
def PowLogX_PowLogY(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name + '_' + str(args[0]) + str(args[1])
    try:
        return numpy.power(numpy.log(data[0]), args[0]) * numpy.power(numpy.log(data[1]), args[1])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 22

Project: pyeq2
Source File: DataCacheFunctions.py
View license
def PowLogY(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name + '_' + str(args[0])
    try:
        return numpy.power(numpy.log(data[1]), args[0])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 23

Project: pyeq2
Source File: DataCacheFunctions.py
View license
def PowExpX_PowExpY(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name + '_' + str(args[0]) + str(args[1])
    try:
        return numpy.power(numpy.exp(data[0]), args[0]) * numpy.power(numpy.exp(data[1]), args[1])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 24

Project: blue-ribbon-plus
Source File: nikeplus.py
View license
	def GetActivityIds(self):
		if len(self.activities) == 0:
			self.RetrieveActivities()
			if len(self.activities) == 0:
				self.logger.error("[{i}] [{t}] [{f}] ({m})".format(i=self.id, t=thread.get_ident(), f=str(sys._getframe().f_code.co_name), m="No activities for this account"))
				raise NikePlusError("There are no activities for this account")
		self.logger.debug("[{i}] [{t}] [{f}] ({m})".format(i=self.id, t=thread.get_ident(), f=str(sys._getframe().f_code.co_name), m=str(self.activities.keys())))
		return self.activities.keys()

Example 25

Project: pyeq2
Source File: DataCacheFunctions.py
View license
def ExpY(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name
    try:
        return numpy.exp(data[1])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 26

Project: reactive-py
Source File: reactive.py
View license
  def __iadd__(self, x):
    temp = deepcopy(self.__data)
    self.__data += x
    self.__trigger(sys._getframe().f_code.co_name, trace={'before_type': type(temp),\
     'before_value': temp, 'after_type': type(self.__data), 'after_value':  self.__data})
    return self

Example 27

Project: PyParticles
Source File: force.py
View license
    def set_masses( self , m ):
        """
        Set the masses used for computing the forces.

        :param    m:         An array containig the masses
        """
        NotImplementedError(" %s : is virtual and must be overridden." % sys._getframe().f_code.co_name )

Example 28

Project: reactive-py
Source File: reactive.py
View license
  def __isub__(self, x):
    temp = deepcopy(self.__data)
    self.__data -= x
    self.__trigger(sys._getframe().f_code.co_name, trace={'before_type': type(temp),\
     'before_value': temp, 'after_type': type(self.__data), 'after_value':  self.__data})
    return self

Example 29

Project: blue-ribbon-plus
Source File: nikeplus.py
View license
	def __init__(self):
		self.logger = logging.getLogger('nikeplus.NikePlus')
		self.id = id(self)
		self.logger.info('[{i}] {f}({m})'.format(i=self.id, f=str(sys._getframe().f_code.co_name), m="Creating Instance"))
		self.cookie = None
		self.authentication_data = {}
		self.token = None
		self.session = requests.Session()
		self.session.headers.update(self.nikeplus_headers)
		self.aggregate_data = None
		self.activities = {}
		return

Example 30

Project: reactive-py
Source File: reactive.py
View license
  def __imul__(self, x):
    temp = deepcopy(self.__data)
    self.__data *= x
    self.__trigger(sys._getframe().f_code.co_name, trace={'before_type': type(temp),\
     'before_value': temp, 'after_type': type(self.__data), 'after_value':  self.__data})
    return self

Example 31

Project: pyeq3
Source File: DataCacheFunctions.py
View license
def PowLogX(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name + '_' + str(args[0])
    try:
        return numpy.power(numpy.log(data[0]), args[0])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 32

Project: pyeq3
Source File: DataCacheFunctions.py
View license
def PowExpX(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name + '_' + str(args[0])
    try:
        return  numpy.power(numpy.exp(data[0]), args[0])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 33

Project: pyeq3
Source File: DataCacheFunctions.py
View license
def TanX(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name
    try:
        return numpy.tan(data[0])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 34

Project: reactive-py
Source File: reactive.py
View license
  def __idiv__(self, x):
    temp = deepcopy(self.__data)
    self.__data /= x
    self.__trigger(sys._getframe().f_code.co_name, trace={'before_type': type(temp),\
     'before_value': temp, 'after_type': type(self.__data), 'after_value':  self.__data})
    return self

Example 35

Project: pyeq3
Source File: DataCacheFunctions.py
View license
def Pow2SinX(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name
    try:
        return numpy.power(numpy.sin(data[0]), 2.0)
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 36

Project: pyeq3
Source File: DataCacheFunctions.py
View license
def SinMultX(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name + '_' + str(args[0])
    try:
        return numpy.sin(data[0] * args[0])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 37

Project: pelisalacarta
Source File: sha256.py
View license
    def update(self, m):
        if not m:
            return
        if type(m) is not str:
            raise TypeError, '%s() argument 1 must be string, not %s' % (sys._getframe().f_code.co_name, type(m).__name__)

        self._buffer += m
        self._counter += len(m)

        while len(self._buffer) >= 64:
            self._sha256_process(self._buffer[:64])
            self._buffer = self._buffer[64:]

Example 38

Project: pyeq3
Source File: DataCacheFunctions.py
View license
def CosMultX(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name + '_' + str(args[0])
    try:
        return numpy.cos(data[0] * args[0])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 39

Project: scikit-video
Source File: test_ffmpeg.py
View license
@unittest.skipIf(not skvideo._HAS_FFMPEG, "FFmpeg required for this test.")
def test_FFmpegWriter():
    # generate random data for 5 frames
    outputfile = sys._getframe().f_code.co_name + ".mp4"

    outputdata = np.random.random(size=(5, 480, 640, 3)) * 255
    outputdata = outputdata.astype(np.uint8)

    writer = skvideo.io.FFmpegWriter(outputfile)
    for i in range(5):
        writer.writeFrame(outputdata[i])
    writer.close()
    os.remove(outputfile)

Example 40

Project: blue-ribbon-plus
Source File: nikeplus.py
View license
	def GetBulkActivityDetails(self):
		self.logger.debug("[{i}] [{t}] [{f}] ({m})".format(i=self.id, t=thread.get_ident(), f=str(sys._getframe().f_code.co_name), m="Retrieving list of activities"))
		npaList = []
		for a in self.GetActivityIds():
			npalist.append(self.RetrieveActivityDetails(a))
		return npaList

Example 41

Project: backintime
Source File: pluginmanager.py
View license
    def logError(self, plugin, e):
        logger.error('Plugin %s %s failed: %s'
                     %(plugin.__module__,               #plugin name
                       sys._getframe(1).f_code.co_name, #method name
                       str(e)),                         #exception
                     self, 1)

Example 42

Project: reactive-py
Source File: reactive.py
View license
  def __ipow__(self, x):
    temp = deepcopy(self.__data)
    self.__data **= x
    self.__trigger(sys._getframe().f_code.co_name, trace={'before_type': type(temp),\
     'before_value': temp, 'after_type': type(self.__data), 'after_value':  self.__data})
    return self

Example 43

Project: pyeq2
Source File: DataCacheFunctions.py
View license
def XSQPLUSYSQ(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name
    try:
        return (data[0] * data[0]) + (data[1] * data[1])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 44

Project: pyeq2
Source File: DataCacheFunctions.py
View license
def PowX_PowY(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name + '_' + str(args[0]) + str(args[1])
    try:
        return numpy.power(data[0], args[0]) * numpy.power(data[1], args[1])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 45

Project: reactive-py
Source File: reactive.py
View license
  def __ior__(self, x):
    temp = deepcopy(self.__data)
    self.__data |= x
    self.__trigger(sys._getframe().f_code.co_name, trace={'before_type': type(temp),\
     'before_value': temp, 'after_type': type(self.__data), 'after_value':  self.__data})
    return self

Example 46

Project: reactive-py
Source File: reactive.py
View license
  def __iand__(self, x):
    temp = deepcopy(self.__data)
    self.__data &= x
    self.__trigger(sys._getframe().f_code.co_name, trace={'before_type': type(temp),\
     'before_value': temp, 'after_type': type(self.__data), 'after_value':  self.__data})
    return self

Example 47

Project: pyeq2
Source File: DataCacheFunctions.py
View license
def PowX_PowLogY(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name + '_' + str(args[0]) + str(args[1])
    try:
        return numpy.power(data[0], args[0]) * numpy.power(numpy.log(data[1]), args[1])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 48

Project: pyeq2
Source File: DataCacheFunctions.py
View license
def Polyfunctional3D(data=None, args=None, eqInstance=None, NameOrValueFlag=0):
    if NameOrValueFlag: # name used by cache, must be distinct
        return sys._getframe().f_code.co_name + '_' + str(args)
    try:
        return eqInstance.polyfunctionalEquationList_X[args[0]].value(data[0]) * eqInstance.polyfunctionalEquationList_Y[args[1]].value(data[1])
    except:
        return 1.0E300 * numpy.ones_like(data[0])

Example 49

Project: blue-ribbon-plus
Source File: nikeplus.py
View license
	def AddDetail(self,d={}):
		try:
			for (k,v) in d.iteritems():
				self.data[k] = v
			self.activity_type = self.data['activityType']
			self.start_time = self.data['startTime']
			self.start_datetime = datetime.strptime(self.start_time, '%Y-%m-%dT%H:%M:%SZ')
			self.duration = timestring_to_milliseconds(self.data['metricSummary']['duration'])
			self.distance = self.data['metricSummary']['distance']
			self.calories = self.data['metricSummary']['calories']
			self.logger.info("[{i}] {f}({m})".format(i=self.id, f=str(sys._getframe().f_code.co_name), m="Activity ID {a} has deviceType {d}".format(a=self.activity_id,d=self.data['deviceType'])))
			self._SetSmoothingWindow()._AddSmoothedDistance()._AddDataToTimeSeries()._Interpolate()
		except:
			self.logger.error("[{i}] {f}({m})".format(i=self.id, f=str(sys._getframe().f_code.co_name), m="Error adding detail to Activity ID {a}".format(a=self.activity_id)))
			self.logger.debug("[{i}] {f}({m})".format(i=self.id, f=str(sys._getframe().f_code.co_name), m="Error {e}, Detail Data: {data}".format(e=sys.exc_info()[0],data=d)))
			raise
		self.detail = True
		self.logger.info("[{i}] {f}({m})".format(i=self.id, f=str(sys._getframe().f_code.co_name), m="Added detail for activity id {a}".format(a=self.activity_id)))
		return self

Example 50

Project: PyParticles
Source File: force.py
View license
    def update_force( self , p_set ):
        """
        Computes the forces of the current status ad return the accelerations of the particles
    
        :param    p_set:     Particles set obj.
        """
        NotImplementedError(" %s : is virtual and must be overridden." % sys._getframe().f_code.co_name )