コード例 #1
0
ファイル: historical.py プロジェクト: ratouney/forex_bot
import importlib
from Session import Session
from testing import *
import time
from datetime import datetime, timedelta

# Main Acc  === 3d2c1e7fccc4e7dbe5cee89c58f6b34a2ba9743a
# Bot Run   === 43038ce05fe884fbc730cfc2835abc8e68d799fe
#

s = Session("1aabfdfa4043e045114c5f5dcfdc622427657630")

current_time = np.array([datetime(2020, 11, 4), datetime(2020, 11, 3, 16, 20)])

print("Starting the simulation at : ", current_time[1])

print("Starting the simulation at : ", current_time[0])

interval = {'minutes': 1}

instrument_list = None
if s.isConnected():
    instrument_list = s.getConnection().get_instruments()
    print("Instrument_List : ", instrument_list)

con = s.getConnection()

print("All setup, running simulation !")
currencies = [
    "GBP/JPY", "GBP/USD", "USD/CNH", "EUR/JPY", "USD/JPY", "CHF/JPY",
    "USD/CHF", "EUR/GBP", "NZD/USD", "USD/CAD", "AUD/JPY", "AUD/USD",
コード例 #2
0
ファイル: ten_m.py プロジェクト: rjswjs123/iotdb
sys.path.append("./utils")
from utils.IoTDBConstants import *
from Session import Session
from time import sleep
import time
from datetime import datetime
from datetime import timedelta
import random
import numpy as np

# creating session connection.
ip = "127.0.0.1"
port_ = "6667"
username_ = 'root'
password_ = 'root'
session = Session(ip, port_, username_, password_)
session.open(False)

# set and delete storage groups
session.set_storage_group("root.one_m")
session.create_time_series("root.one_m.s1", TSDataType.DOUBLE, TSEncoding.PLAIN, Compressor.SNAPPY)

measurements_ = ["s1"]
values_ = [10]
data_types_ = [TSDataType.DOUBLE]





# returns the elapsed milliseconds since the start of the program
コード例 #3
0
ファイル: Connection.py プロジェクト: 309972460/software
 def get_session(self):
     sess = m2.ssl_get_session(self.ssl)
     return Session(sess)
コード例 #4
0
ファイル: main.py プロジェクト: nothingholy/AliceSkill
from flask import Flask, request

import config.local as config
from Alice import AliceRequest, AliceResponse
from Session import Session
from WordGame import WordGame

app = Flask(__name__)
session = Session()


@app.route('/word-game/', methods=['POST'])
def word_game():
    alice_request = AliceRequest(request.json)

    temp_session = session.load_session()
    if alice_request.user_id not in temp_session:
        temp_session[alice_request.user_id] = dict()

    game = WordGame(temp_session[alice_request.user_id])
    game.act(alice_request.command)

    alice_response = AliceResponse(alice_request)
    alice_response.set_answer(game.answer)
    alice_response.set_end(game.end)

    session.save_session()
    return str(alice_response)


if __name__ == '__main__':
コード例 #5
0
            #Add the department 4-letter code to the current class.
            current_dept = results1.group('dept')
            #Add the course number to the current class.
            current_course_number = results1.group('course_number')
            #Add the section number to the current class.
            current_section = results1.group('section')
            #Build the current class
            current_class = Class(current_crn, current_dept,
                                  current_course_number, current_section)
        #IF results1 was empty but results2 was not, build a new session.
        elif results2 != None:
            #Construct the session using the days, start time, end time, start
            # date, and end date.
            new_session = Session(results2.group('days'),
                                  results2.group('start_time'),
                                  results2.group('end_time'),
                                  results2.group('start_date'),
                                  results2.group('end_date'))
            #Build current class.
            current_class.add_session(new_session)

# Don't forget to add the last class
class_list.add_class(current_class)
class_list.remove_no_sessions()
class_list.remove_specialized()
class_list.remove_a_session()
'''
To see more details about the class list that was collected, use the commands.

class_list.classes