original_docstring: 
      Args:
          some_time - if datetime, converted to UTC and used
                      if int or float - assumed to be ctime, no change
                      if string - trys to parse into datetime object
                                - assumed to be in UTC
          str_format - allows user to define a string format if they don't
                      want to use a default option
      Returns:
          ctime of some_time
      
docstring: if datetime, converted to UTC and used
  if int or float - assumed to be ctime, no change
  if string - trys to parse into datetime object
  assumed to be in UTC
  str_format - allows user to define a string format if they don't
  want to use a default option
  Returns:
  ctime of some_time
docstring_tokens: if datetime converted to UTC and used if int or float - assumed to be ctime no change if string - trys to parse into datetime object assumed to be in UTC str_format - allows user to define a string format if they don ' t want to use a default option Returns : ctime of some_time
code: def to_timestamp(some_time, str_format=None): 
      '''
      Args:
          some_time - if datetime, converted to UTC and used
                      if int or float - assumed to be ctime, no change
                      if string - trys to parse into datetime object
                                - assumed to be in UTC
          str_format - allows user to define a string format if they don't
                      want to use a default option
      Returns:
          ctime of some_time
      '''
      
      if type(some_time) == dt.datetime:
          return some_time.astimezone(dt.timezone.utc).timestamp()
      if type(some_time) == int or type(some_time) == float:
          return some_time
      if type(some_time) == str:
          if str_format is not None:
              return to_timestamp(pytz.utc.localize( dt.datetime.strptime(some_time, str_format )))
          str_options = ['%Y-%m-%d', '%Y-%m-%d %H:%M', '%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f']
          for option in str_options:
              try:
                  return to_timestamp(pytz.utc.localize( dt.datetime.strptime(some_time, option )))
              except:
                  continue
          raise ValueError('Could not process string into date object, options are: {}'.format(str_options))
          
      raise ValueError('Type of date / time indication is invalid, accepts datetime, int, float, and string')
code_tokens: def to_timestamp ( some_time , str_format = None ) : if type ( some_time ) == dt . datetime : return some_time . astimezone ( dt . timezone . utc ) . timestamp ( ) if type ( some_time ) == int or type ( some_time ) == float : return some_time if type ( some_time ) == str : if str_format is not None : return to_timestamp ( pytz . utc . localize ( dt . datetime . strptime ( some_time , str_format ) ) ) str_options = [ '%Y-%m-%d' , '%Y-%m-%d %H:%M' , '%Y-%m-%d %H:%M:%S' , '%Y-%m-%d %H:%M:%S.%f' ] for option in str_options : try : return to_timestamp ( pytz . utc . localize ( dt . datetime . strptime ( some_time , option ) ) ) except : continue raise ValueError ( 'Could not process string into date object, options are: {}' . format ( str_options ) ) raise ValueError ( 'Type of date / time indication is invalid, accepts datetime, int, float, and string' )
short_docstring: Args:
  some_time - if datetime, converted to UTC and used
  if int or float - assumed to be ctime, no change
  if string - trys to parse into datetime object
   assumed to be in UTC
  str_format - allows user to define a string format if they don't
  want to use a default option
  Returns:
  ctime of some_time
short_docstring_tokens: Args : some_time - if datetime converted to UTC and used if int or float - assumed to be ctime no change if string - trys to parse into datetime object assumed to be in UTC str_format - allows user to define a string format if they don ' t want to use a default option Returns : ctime of some_time
comment: '''
      Args:
          some_time - if datetime, converted to UTC and used
                      if int or float - assumed to be ctime, no change
                      if string - trys to parse into datetime object
                                - assumed to be in UTC
          str_format - allows user to define a string format if they don't
                      want to use a default option
      Returns:
          ctime of some_time
      '''