コード例 #1
0
ファイル: __init__.py プロジェクト: gmcintire/blueprint
    def __init__(self, name=None, commit=None, create=False):
        """
        Construct a blueprint in the new format in a backwards-compatible
        manner.
        """
        self.name = name
        self._commit = commit

        # Create a new blueprint object and populate it based on this server.
        if create:
            super(Blueprint, self).__init__()
            import backend
            for funcname in backend.__all__:
                getattr(backend, funcname)(self)
            import services
            services.services(self)

        # Create a blueprint from a Git repository.
        elif name is not None:
            git.init()
            if self._commit is None:
                self._commit = git.rev_parse('refs/heads/{0}'.format(name))
                if self._commit is None:
                    raise NotFoundError(name)
            tree = git.tree(self._commit)
            blob = git.blob(tree, 'blueprint.json')
            content = git.content(blob)
            super(Blueprint, self).__init__(**json.loads(content))

        # Create an empty blueprint object to be filled in later.
        else:
            super(Blueprint, self).__init__()
コード例 #2
0
 def rules(cls, r, name=None):
     b = cls(name)
     import backend
     for funcname in backend.__all__:
         getattr(backend, funcname)(b, r)
     import services
     services.services(b)
     return b
コード例 #3
0
ファイル: __init__.py プロジェクト: GameGamer43/blueprint
 def create(cls, name):
     b = cls(name)
     import backend
     for funcname in backend.__all__:
         getattr(backend, funcname)(b)
     import services
     services.services(b)
     return b
コード例 #4
0
def tweets(username):
    startTime = time.time()
    try:
        user = str(username)  #make su
        myservice = services(username=user)
        myservice.getTweets()
    except (noUser):
        raise InvalidUsage('This user doesnt exist or has no tweets',
                           status_code=403)
    except Exception as e:
        raise InvalidUsage(
            'Something Went wrong, Check your internet Connection')
    else:
        myservice.predict()
        endTime = time.time()
        length = len(myservice.response())
        username = myservice.username
        return {
            "meta": {
                "duration": '{} secs'.format(endTime - startTime),
                "length": length,
                "username": username
            },
            "data": myservice.response()
        }
コード例 #5
0
ファイル: ETLNAUTIA.py プロジェクト: guillermosanchezg/NAUTIA
def ETLNAUTIA(communityType):
    data = DataNAUTIA(communityType)
    com.community(communityType)
    camp.camp(data.getBibliography(), data.getEntities())
    ctr.country(data.getBibliography())
    cd.campData(data.getBibliography(), data.getEntities(),
                data.getLocalLeaders())
    gd.generalData(data.getBibliography())
    se.socioEconomic(data)
    g.government(data.getBibliography())
    fa.fisicoAmbiental(data.getBibliography(), data.getEntities())
    u.urbanism(data.getEntities(), data.getGeneralForm(),
               data.getPublicSpace())
    inf.infrastructure(data)
    s.services(data)
    sh.shelter(data.getEntities(), data.getShelter(), data.getHouseHold())
    fs.foodSecurity(data)
コード例 #6
0
def get_ip(service_list: Iterable[Service] = None,
           loop: asyncio.BaseEventLoop = None) -> str:
    if service_list is None:
        service_list = services()

    if loop is None:
        loop = asyncio.get_event_loop()

    ip_task = _get_ip(service_list)
    ip = loop.run_until_complete(ip_task)
    return ip
コード例 #7
0
def main():
    conn = dbcon()
    serv = services(conn)
    print(conn.verTablas())
    print(conn.getGrupos())
    print(conn.getUsersGrupo('Admin'))
    idd = conn.login(('admin', 'admin'))
    if idd:
        token = serv.createToken(idd)
        print(token)
        print(serv.isAuth(token))
コード例 #8
0
ファイル: test_services.py プロジェクト: rsmith-nl/misc
def test_services():
    service = services()
    assert service is not None
    assert service[22] == 'ssh'
    assert service[70] == 'gopher'
    assert service[80] == 'http'
    assert service[53] == 'domain'
    assert service[389] == 'ldap'
    assert service[443] == 'https'
    assert service[873] == 'rsync'
    assert service[9418] == 'git'
コード例 #9
0
def main():
    try:
        opt, arg = getopt.getopt(
            sys.argv[1:], "",
            ["processes", "modules", "startup", "services", "schedule-tasks"])
    except getopt.GetoptError as err:
        print(err)
        sys.exit(-1)

    if not opt or arg:
        print("Invalid option")
        sys.exit(-1)

    for o, a in opt:
        if o == "--processes":
            processes.processes()
        if o == "--modules":
            modules.modules()
        if o == "--startup":
            startup.startup()
        if o == "--services":
            services.services()
        if o == "--schedule-tasks":
            scheduletasks.sched()
コード例 #10
0
ファイル: bot.py プロジェクト: rjeka/ldMayakBot
def services_message(message):
    services.services(message)
コード例 #11
0
import csvgate as cs
import explor as ex
import services as ser
import tfidfmodel as tf
import models as mod
import knn as kk
cc = cs.csvclass()
ser = ser.services()
stop_wrods = ser.get_stop_wrods()
cc.load_csv_file('file.csv')
ans = cc.train_build()
pp = ex.explor(ans, stop_wrods)
pp.print_total()
pp.print_gender("male")
pp.print_gender("female")
pp.print_language_length("male")
pp.print_language_length("female")
tf_buid = tf.tfidfmodel(ans, stop_wrods)
top = tf_buid.extractTf()
run_mod = mod.models(top[0], top[1], top[2], top[3], top[4])
run_mod.start()
kkk = kk.knn(ans)
kkk.runKNN()
ff = cc.twitt_build("football_tweets.csv")
twit_diction = tf_buid.twit_build(ff)
tup = tf_buid.extracttwitttf(twit_diction)
cccc = run_mod.run_twiit_file(tup[1], "football_tweets.csv")
kkk.runKnnOnTwiit(ff, "football_tweets.csv")
ff = cc.twitt_build("baking_tweets.csv")
twit_diction = tf_buid.twit_build(ff)
tup = tf_buid.extracttwitttf(twit_diction)
コード例 #12
0
ファイル: loader.py プロジェクト: stoogeman4444/genoxs
def loader():
    cloud()
    services()
    commands()
    pass
コード例 #13
0
def tweet(text):
    service = services(text=text)
    service.predict()
    return service.response()
コード例 #14
0
# distsys.async
# A helper module for setting up asyncronous connections between clients and a server.
import services

def poop():
    return "poop"

s = services.services(localhost=True)
print s.hostIP
print s.clients