index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
85,239
jerrybox/baidumindmap-xblock
refs/heads/master
/baidumindmap/__init__.py
from .baidumindmap import BaiduMindmapXBlock
{"/baidumindmap/__init__.py": ["/baidumindmap/baidumindmap.py"]}
85,240
jerrybox/baidumindmap-xblock
refs/heads/master
/baidumindmap/baidumindmap.py
# -*- coding:utf-8 -*- from django.shortcuts import reverse from django.template import Context, Template import logging import json import pkg_resources from mako.template import Template as MakoTemplate from xblock.core import XBlock from xblock.fields import Integer, Scope, String from xblock.fragment import Fragm...
{"/baidumindmap/__init__.py": ["/baidumindmap/baidumindmap.py"]}
85,241
coleac/cry2-andromeda
refs/heads/master
/userdatabase.py
#!/usr/bin/env/ python3 from pymongo import MongoClient class CreateUser(object): def AddNewUser(self): #Connect to MongoDB - Note: Change connection string as needed #client = MongoClient("mongodb://colea:PW@userwallet-shard-00-00-2tbmf.mongodb.net:27017,userwallet-shard-00-01-2tbmf.mongodb.net:...
{"/andromeda_user.py": ["/userdata.py", "/cryptopiauserget.py", "/userdatabase.py"]}
85,242
coleac/cry2-andromeda
refs/heads/master
/cryptopiauserget.py
import json from urllib.request import urlopen from pymongo import MongoClient class CryptopiaUserGet(object): """Get Current TradePair Price""" def FetchURL(self, url): retries = 50 while True: try: response = urlopen(url).read().decode('utf') resu...
{"/andromeda_user.py": ["/userdata.py", "/cryptopiauserget.py", "/userdatabase.py"]}
85,243
coleac/cry2-andromeda
refs/heads/master
/userdata.py
#!/usr/bin/env/ python3 import json from pymongo import MongoClient import datetime class UserData(object): """Back end for user wallet""" #Pull user info from the database def Connect(self, userData): self.mongoClient = MongoClient("mongodb://colea:PW@cluster01-shard-00-00-oheid.mongodb.net...
{"/andromeda_user.py": ["/userdata.py", "/cryptopiauserget.py", "/userdatabase.py"]}
85,244
coleac/cry2-andromeda
refs/heads/master
/andromeda_user.py
#!/usr/bin/env/ python3 import json from pymongo import MongoClient from userdata import UserData from cryptopiauserget import CryptopiaUserGet from userdatabase import CreateUser #mongoClient = MongoClient("mongodb://colea:PW@userwallet-shard-00-00-2tbmf.mongodb.net:27017,userwallet-shard-00-01-2tbmf.mongodb.net:27...
{"/andromeda_user.py": ["/userdata.py", "/cryptopiauserget.py", "/userdatabase.py"]}
85,245
coleac/cry2-andromeda
refs/heads/master
/tradepairdatabase.py
#!/usr/bin/env/ python3 from pymongo import MongoClient import json from urllib.request import urlopen #Get data from Cryptopia API def FetchURL(url): retries = 5 while True: response = urlopen(url).read().decode('utf') result = json.loads(response) if result is None: retri...
{"/andromeda_user.py": ["/userdata.py", "/cryptopiauserget.py", "/userdatabase.py"]}
85,250
preciousidam/kbl-microservice
refs/heads/main
/notifications/backend/celery.py
from celery.schedules import crontab import os from requests import get from .util.instances import initializeCelery from . import create_app from flask_mail import Message from .util.instances import mail from .models.notification import Notification celery = initializeCelery(create_app('development')) celery.conf.e...
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,251
preciousidam/kbl-microservice
refs/heads/main
/app/backend/view.py
from operator import le from flask import jsonify, request from flask.views import View, MethodView from flask_sqlalchemy import orm from dataclasses import asdict from .models.leave import Leave from .util.instances import db from .models.leave import Leave, Date from .producer import publish class RosterView(Method...
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,252
preciousidam/kbl-microservice
refs/heads/main
/app/backend/__init__.py
import os from flask import Flask, render_template, redirect, url_for, jsonify, request from flask_cors import CORS from flask_admin import Admin from werkzeug.utils import secure_filename from dataclasses import asdict from pathlib import Path # python3 only from .view import RosterView from .models.leave import Le...
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,253
preciousidam/kbl-microservice
refs/heads/main
/notifications/backend/__init__.py
import os from flask import Flask, render_template, redirect, url_for, jsonify, request from flask_cors import CORS from flask_admin import Admin from json import loads from .models.notification import Notification from .view import NotificationView ##############UTILITIES############ from .util.instances import ini...
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,254
preciousidam/kbl-microservice
refs/heads/main
/notifications/backend/admin_form.py
from wtforms import TextField from wtforms.widgets import TextInput class NameWidget(TextInput): def __call__(self, field, **kwargs): if kwargs.get('class'): kwargs['class'] += ' col-md-12' else: kwargs.setdefault('class', 'col-md-12') return super(NameWidget, self)....
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,255
preciousidam/kbl-microservice
refs/heads/main
/app/backend/util/jsonEncoder.py
from json import JSONEncoder from datetime import date, datetime as dt import numpy as np class CustomJSONEncoder(JSONEncoder): def default(self, obj): if isinstance(obj, dt): return obj.strftime("%d-%m-%Y") if isinstance(obj, date): return obj.strftime("%Y-%...
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,256
preciousidam/kbl-microservice
refs/heads/main
/app/backend/celery.py
from celery.schedules import crontab from .util.instances import initializeCelery from . import create_app from flask_mail import Message from .util.instances import mail celery = initializeCelery(create_app('development')) celery.conf.enable_utc = False @celery.task def send_reminder(): try: print('sen...
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,257
preciousidam/kbl-microservice
refs/heads/main
/app/backend/models/leave.py
from backend.util.instances import db from dataclasses import dataclass @dataclass class Leave(db.Model): id: int name: str email: str ro: str roe: str dates: list id = db.Column(db.Integer, primary_key=True, nullable=False) name = db.Column(db.String(255), nullable=False) email = ...
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,258
preciousidam/kbl-microservice
refs/heads/main
/notifications/backend/admin.py
from flask import url_for, redirect, request, render_template, flash from flask_admin import AdminIndexView, expose from flask_admin.contrib.sqla import ModelView from flask_login import current_user, LoginManager, logout_user, login_user from werkzeug.security import generate_password_hash, check_password_hash from .m...
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,259
preciousidam/kbl-microservice
refs/heads/main
/notifications/backend/models/notification.py
from backend.util.instances import db from dataclasses import dataclass from datetime import date @dataclass class Notification(db.Model): id: int leave_id: int when: str is_due: bool id = db.Column(db.Integer, primary_key=True, nullable=False) leave_id = db.Column(db.Integer, nullable=False) ...
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,260
preciousidam/kbl-microservice
refs/heads/main
/notifications/backend/view.py
from operator import le from flask import jsonify, request from flask.views import View, MethodView from flask_sqlalchemy import orm from dataclasses import asdict from .models.notification import Notification from .util.instances import db from .models.notification import Notification class NotificationView(MethodVi...
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,261
preciousidam/kbl-microservice
refs/heads/main
/notifications/backend/util/instances.py
from flask_jwt_extended import JWTManager from flask_sqlalchemy import SQLAlchemy from flask_mail import Mail from celery import Celery from flask_migrate import Migrate mail = Mail() db = SQLAlchemy() jwt = JWTManager() def initializeDB(app): db.init_app(app) Migrate(app, db) def initializeJWT(app): ...
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,262
preciousidam/kbl-microservice
refs/heads/main
/notifications/consumer.py
import pika, json, os from datetime import datetime from backend.models.notification import Notification from backend.util.instances import db from backend import create_app app = create_app("development") params = pika.URLParameters(os.environ.get('CELERY_BROKER_URL')) connection = pika.BlockingConnection(params)...
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,263
preciousidam/kbl-microservice
refs/heads/main
/app/instance/config.py
import os from dotenv import load_dotenv from pathlib import Path # python3 only env_path = Path('.') / '.env' print(env_path) load_dotenv(dotenv_path=env_path) class Config: DEBUG=True TESTING = True APP= os.getenv('APP') SERVER_PORT= int(os.getenv('SERVER_PORT')) SECRET_KEY= os.getenv('SECRET_...
{"/notifications/backend/celery.py": ["/notifications/backend/util/instances.py", "/notifications/backend/__init__.py", "/notifications/backend/models/notification.py"], "/app/backend/view.py": ["/app/backend/models/leave.py"], "/app/backend/__init__.py": ["/app/backend/view.py", "/app/backend/models/leave.py"], "/noti...
85,308
simplextech/udi-poly-linktap
refs/heads/main
/linktap/__init__.py
from .linktap import LinkTap
{"/linktap/__init__.py": ["/linktap/linktap.py"], "/LinkTap.py": ["/linktap/__init__.py"]}
85,309
simplextech/udi-poly-linktap
refs/heads/main
/LinkTap.py
#!/usr/bin/env python import sys import linktap import time import logging try: import polyinterface CLOUD = False except ImportError: import pgc_interface as polyinterface CLOUD = True LOGGER = polyinterface.LOGGER logging.getLogger('urllib3').setLevel(logging.INFO) class Controller(polyinterface...
{"/linktap/__init__.py": ["/linktap/linktap.py"], "/LinkTap.py": ["/linktap/__init__.py"]}
85,310
simplextech/udi-poly-linktap
refs/heads/main
/linktap/linktap.py
#!/usr/bin/env python3 try: import polyinterface except ImportError: import pgc_interface as polyinterface import sys import requests LOGGER = polyinterface.LOGGER class LinkTap: def __init__(self, username, apiKey): self.base_url = 'https://www.link-tap.com/api/' self.username = username...
{"/linktap/__init__.py": ["/linktap/linktap.py"], "/LinkTap.py": ["/linktap/__init__.py"]}
85,318
micmic123/dacon-landmark
refs/heads/master
/redundant/main.py
import pandas as pd import os from datetime import datetime from tqdm import tqdm os.environ["CUDA_VISIBLE_DEVICES"] = "0" import argparse import torch from torch import nn from dataset import get_dataloader from model import ResNet18, MobileNetV2 base = "/content/drive/My Drive/datasets/landmark_kr" parser = argpar...
{"/redundant/main.py": ["/dataset.py", "/model.py"]}
85,319
micmic123/dacon-landmark
refs/heads/master
/redundant/model.py
import os import torch from torch import nn, optim from torch.nn import Conv2d, AdaptiveAvgPool2d, Linear import torch.nn.functional as F from torch.optim import lr_scheduler from torchvision import models class SimpleNet(nn.Module): def __init__(self): super(SimpleNet, self).__init__() self.conv1...
{"/redundant/main.py": ["/dataset.py", "/model.py"]}
85,320
micmic123/dacon-landmark
refs/heads/master
/redundant/dataset.py
import pandas as pd import os import unicodedata from glob import glob from PIL import Image from tqdm import tqdm from torch.utils.data import Dataset, DataLoader from torchvision import transforms class TrainDataset(Dataset): def __init__(self, args, transfrom): self.train_dir = args.train_dir s...
{"/redundant/main.py": ["/dataset.py", "/model.py"]}
85,321
micmic123/dacon-landmark
refs/heads/master
/model.py
import os import torch from torch import nn, optim from torch.nn import Conv2d, AdaptiveAvgPool2d, Linear import torch.nn.functional as F from torch.optim import lr_scheduler from torchvision import models from efficientnet_pytorch import EfficientNet from utility import NTXentLoss class BaseNet: def __init__(self...
{"/redundant/main.py": ["/dataset.py", "/model.py"]}
85,322
micmic123/dacon-landmark
refs/heads/master
/dataset.py
import numpy as np import os import random import h5py from PIL import Image from tqdm import tqdm import torch from torch.utils.data import Dataset, DataLoader from torchvision import transforms # # https://docs.python.org/ko/3/howto/unicode.html#comparing-strings # https://python.flowdas.com/library/unicodedata.htm...
{"/redundant/main.py": ["/dataset.py", "/model.py"]}
85,327
nvineeth/cleanup_html
refs/heads/master
/FootnoteParser.py
import sys, traceback import os import re import logging from html.parser import HTMLParser from ParsingRules import * IGNORE_TAGS = [ 'title', 'style'] ALLOWED_TAGS = ['i', 'img', 'br'] class FootnoteHTMLParser(HTMLParser): """ ignores the tags, and puts the text content, so that it can be aggregated as ...
{"/FootnoteParser.py": ["/ParsingRules.py"], "/cleanup_html.py": ["/FootnoteParser.py", "/ParsingRules.py"]}
85,328
nvineeth/cleanup_html
refs/heads/master
/normalize.py
import os import sys import re TEST = 0 DOUBLE_SPACE_TAGS_START=[] SINGLE_SPACE_TAGS_START=['html', 'head', 'body','br','div' ] DOUBLE_SPACE_TAGS_END=['h1','h2','h3','h4','h5','p','div','html', 'head', 'body'] SINGLE_SPACE_TAGS_END=['style','link','br','table','td','tr','title'] def do_op(html): html_replaced =...
{"/FootnoteParser.py": ["/ParsingRules.py"], "/cleanup_html.py": ["/FootnoteParser.py", "/ParsingRules.py"]}
85,329
nvineeth/cleanup_html
refs/heads/master
/ParsingRules.py
CSS_REPLACEMENTS = [ ('vivekananda_biography.css', '../main.css'), ('gospel.css', '../main.css'), ("reminiscences_of_sv.css", '../main.css'), ('vol_1.css', '../../main.css'),('vol_2.css', '../../main.css'), ('vol_3.css', '../../main.css'),('vol_4.css', '../../main.css'), ...
{"/FootnoteParser.py": ["/ParsingRules.py"], "/cleanup_html.py": ["/FootnoteParser.py", "/ParsingRules.py"]}
85,330
nvineeth/cleanup_html
refs/heads/master
/do_op.py
import os import sys import re TEST = 0 def do_op(html): html_replaced = html if html.find("jquery") == -1: html_replaced = html.replace( "</head>", '<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>\n<script src="/search.js"></script>\n</head>') #html_replac...
{"/FootnoteParser.py": ["/ParsingRules.py"], "/cleanup_html.py": ["/FootnoteParser.py", "/ParsingRules.py"]}
85,331
nvineeth/cleanup_html
refs/heads/master
/test.py
# coding=utf-8 import os import sys import re roman_re = re.compile('^[IVXLCDM]{2,}$') caps_re = re.compile(u'[a-zA-Z\u00C0-\u00DD]{2,}') def do_op(html): html_replaced = html matches = caps_re.findall( html_replaced ) print( matches ) for match in matches: # avoid roman if roman_re.m...
{"/FootnoteParser.py": ["/ParsingRules.py"], "/cleanup_html.py": ["/FootnoteParser.py", "/ParsingRules.py"]}
85,332
nvineeth/cleanup_html
refs/heads/master
/cleanup_html.py
#Script to clean up html files..experimental from html.parser import HTMLParser import sys, traceback import os import re import logging import shutil import glob import urllib import urllib.parse from FootnoteParser import * from ParsingRules import * HREF_CORRECTIONS = [ ('066_dr_nanjunda_rao.htm','066_nanj...
{"/FootnoteParser.py": ["/ParsingRules.py"], "/cleanup_html.py": ["/FootnoteParser.py", "/ParsingRules.py"]}
85,333
janelia-flyem/clio-py
refs/heads/main
/main.py
import clio def main(): # neuron annotations query query = '{"bodyid":[154109,24053]}' status_code, content = clio.post('prod', 'json-annotations/VNC/neurons/query', str_payload = query) if status_code != 200: print(f"Error in query request: {status_code}: {content}") else: print(f"...
{"/main.py": ["/clio.py"]}
85,334
janelia-flyem/clio-py
refs/heads/main
/clio.py
import os import os.path import sys import time import datetime import requests import jwt CLIO_STORE_URL = { 'prod': 'https://clio-store-vwzoicitea-uk.a.run.app', 'test': 'https://clio-test-7fdj77ed7q-uk.a.run.app' } CLIO_TOKEN_URL = 'https://clio-store-vwzoicitea-uk.a.run.app/v2/server/token' TOKEN_CACHE_F...
{"/main.py": ["/clio.py"]}
85,335
lgsvl/superflore
refs/heads/master
/superflore/generators/bitbake/gen_packages.py
# Copyright 2017 Open Source Robotics Foundation, Inc. # # 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...
{"/superflore/generators/bitbake/gen_packages.py": ["/superflore/generators/bitbake/yocto_recipe.py"]}
85,336
lgsvl/superflore
refs/heads/master
/superflore/generators/bitbake/ros_meta.py
# Copyright 2017 Open Source Robotics Foundation, Inc. # # 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...
{"/superflore/generators/bitbake/gen_packages.py": ["/superflore/generators/bitbake/yocto_recipe.py"]}
85,337
lgsvl/superflore
refs/heads/master
/superflore/generators/bitbake/yocto_recipe.py
# -*- coding: utf-8 -*- # # Copyright (c) 2016 David Bensoussan, Synapticon GmbH # Copyright (c) 2017 Open Source Robotics Foundation, Inc. # # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Softwar...
{"/superflore/generators/bitbake/gen_packages.py": ["/superflore/generators/bitbake/yocto_recipe.py"]}
85,342
jessijzhao/multichain-benchmark
refs/heads/master
/plotDiskUsage.py
""" Iff executed as main file, will ask for a directory within data/ and plot the measurements therein Plots total multichain disk usage for all nodes against time, plus the total tx and chain size, for time periods specified within the params.py file in the directory If detailed disk space data exists, will al...
{"/plotDiskUsage.py": ["/helpers.py"], "/predictDiskUsage.py": ["/helpers.py"], "/helpers.py": ["/params.py"], "/runTest.py": ["/helpers.py", "/params.py", "/plotDiskUsage.py"]}
85,343
jessijzhao/multichain-benchmark
refs/heads/master
/predictDiskUsage.py
""" Analyzes all test measurements in data/ to try and learn how disk space grows in relation to tx size and # tx The goal is to predict the growth of disk space for any node given a matrix of transactions and their size (constant for all tx), i.e. a function of disk space (KB)/time (s) We use the following as...
{"/plotDiskUsage.py": ["/helpers.py"], "/predictDiskUsage.py": ["/helpers.py"], "/helpers.py": ["/params.py"], "/runTest.py": ["/helpers.py", "/params.py", "/plotDiskUsage.py"]}
85,344
jessijzhao/multichain-benchmark
refs/heads/master
/params.py
""" Parameters for benchmark.py """ from base64 import b64encode import random import numpy as np numNodes = 5 # number of nodes including masternode, currently up to 6 randomTxpm = False # whether txpm should be randomized (untested) if randomTxpm: labels = list(map(s...
{"/plotDiskUsage.py": ["/helpers.py"], "/predictDiskUsage.py": ["/helpers.py"], "/helpers.py": ["/params.py"], "/runTest.py": ["/helpers.py", "/params.py", "/plotDiskUsage.py"]}
85,345
jessijzhao/multichain-benchmark
refs/heads/master
/helpers.py
import numpy as np import requests import os import importlib.util import params def post(node, data): """ Streamlines http post requests for local networks """ return requests.post(params.host + ":" + str(params.rpcPorts[node]), headers=params.header, json=data) def getSize(maxSize): ...
{"/plotDiskUsage.py": ["/helpers.py"], "/predictDiskUsage.py": ["/helpers.py"], "/helpers.py": ["/params.py"], "/runTest.py": ["/helpers.py", "/params.py", "/plotDiskUsage.py"]}
85,346
jessijzhao/multichain-benchmark
refs/heads/master
/runTest.py
""" Takes parameters defined in params and uses templates to set up a multichain network in docker containers according to specs, and to create and run a Jmeter testplan. Writes chain size, size of all items, and disk space for each node by time to a csv plots results + their approximate continuation (linear regr...
{"/plotDiskUsage.py": ["/helpers.py"], "/predictDiskUsage.py": ["/helpers.py"], "/helpers.py": ["/params.py"], "/runTest.py": ["/helpers.py", "/params.py", "/plotDiskUsage.py"]}
85,509
MohammedAljahdali/ray_pl_mnist
refs/heads/main
/run.py
from argparse import ArgumentParser from pprint import pprint import pytorch_lightning as pl from model import LitMNIST from data import MNISTDataModule from ray_lightning import RayPlugin import ray def cli_main(): pl.seed_everything(1234) # ------------ # args # ------------ parser = ArgumentPa...
{"/run.py": ["/model.py"]}
85,510
MohammedAljahdali/ray_pl_mnist
refs/heads/main
/model.py
import torch from torch.nn import functional as F from torch import nn from pytorch_lightning.core.lightning import LightningModule from pytorch_lightning.metrics.classification import Accuracy class LitMNIST(LightningModule): def __init__(self, hidden_dim=128, learning_rate=1e-3): super().__init__() ...
{"/run.py": ["/model.py"]}
85,518
Seler09/neo4j_vs_Sql
refs/heads/master
/graph.py
from neo4j import GraphDatabase def get_db(uri, username, password): return GraphDatabase.driver(uri, auth=(username, password)) def create_movie(db, movie): query = """ MERGE (m:Movie {id: $id, year: $year, title: $title}) """ db.run(query, **movie) def create_user_rating(db, movie, ratin...
{"/main.py": ["/graph.py", "/temp_parser.py", "/rel.py"]}
85,519
Seler09/neo4j_vs_Sql
refs/heads/master
/rel.py
import psycopg2 def try_conn(): commands = ( """ CREATE TABLE IF NOT EXISTS Movie ( id int PRIMARY KEY, title VARCHAR(255) NOT NULL, date VARCHAR(255) ) """ , """ CREATE TABLE IF NOT EXISTS Person ( id int PRIMARY K...
{"/main.py": ["/graph.py", "/temp_parser.py", "/rel.py"]}
85,520
Seler09/neo4j_vs_Sql
refs/heads/master
/main.py
import argparse from datetime import datetime import graph import temp_parser import rel from datetime import datetime def parse_args(): p = argparse.ArgumentParser(description='Process some integers.') p.add_argument( '--db-uri', default='bolt://localhost:7687', help='Database uri' ) ...
{"/main.py": ["/graph.py", "/temp_parser.py", "/rel.py"]}
85,521
Seler09/neo4j_vs_Sql
refs/heads/master
/temp_parser.py
import os def parse_rating(line): line = line.rstrip('\n') user_id, value, date = line.split(',') try: date = date except ValueError: date = None return { 'user_id': int(user_id), 'value': int(value), 'date': date } def get_ratings(movie_id, path): ...
{"/main.py": ["/graph.py", "/temp_parser.py", "/rel.py"]}
85,523
bradmontgomery/django-querycount
refs/heads/main
/querycount/tests/views.py
from django.db import connection from django.http import HttpResponse def empty(request): # An view with no DB queries. return HttpResponse("", content_type="text/plain") def count_migrations(request): # A view that counts our existing migrations results = 0 with connection.cursor() as cursor: ...
{"/querycount/tests/test.py": ["/querycount/middleware.py"], "/setup.py": ["/querycount/__init__.py"], "/querycount/middleware.py": ["/querycount/qc_settings.py"]}
85,524
bradmontgomery/django-querycount
refs/heads/main
/querycount/tests/urls.py
from django.conf.urls import url from . import views urlpatterns = [ url(r'^empty/$', views.empty, name='empty'), url(r'^count/$', views.count_migrations, name='count'), ]
{"/querycount/tests/test.py": ["/querycount/middleware.py"], "/setup.py": ["/querycount/__init__.py"], "/querycount/middleware.py": ["/querycount/qc_settings.py"]}
85,525
bradmontgomery/django-querycount
refs/heads/main
/querycount/tests/test.py
from django.test import TestCase, modify_settings, override_settings from querycount.middleware import QueryCountMiddleware DEFAULT_QC_SETTINGS = { 'THRESHOLDS': { 'MEDIUM': 50, 'HIGH': 200, 'MIN_TIME_TO_LOG': 0, 'MIN_QUERY_COUNT_TO_LOG': 0 }, 'IGNORE_REQUEST_PATTERNS': [],...
{"/querycount/tests/test.py": ["/querycount/middleware.py"], "/setup.py": ["/querycount/__init__.py"], "/querycount/middleware.py": ["/querycount/qc_settings.py"]}
85,526
bradmontgomery/django-querycount
refs/heads/main
/querycount/__init__.py
__version__ = "0.8.3"
{"/querycount/tests/test.py": ["/querycount/middleware.py"], "/setup.py": ["/querycount/__init__.py"], "/querycount/middleware.py": ["/querycount/qc_settings.py"]}
85,527
bradmontgomery/django-querycount
refs/heads/main
/setup.py
from setuptools import setup from querycount import __version__ url = "https://github.com/bradmontgomery/django-querycount/tarball/{0}".format(__version__) setup( name="django-querycount", version=__version__, author="Brad Montgomery", author_email="brad@bradmontgomery.net", description=("Middlewa...
{"/querycount/tests/test.py": ["/querycount/middleware.py"], "/setup.py": ["/querycount/__init__.py"], "/querycount/middleware.py": ["/querycount/qc_settings.py"]}
85,528
bradmontgomery/django-querycount
refs/heads/main
/querycount/qc_settings.py
""" Default querycount settings. """ from django.conf import settings from django.test.signals import setting_changed QC_SETTINGS = { 'IGNORE_REQUEST_PATTERNS': [], 'IGNORE_SQL_PATTERNS': [], 'THRESHOLDS': { 'MEDIUM': 50, 'HIGH': 200, 'MIN_TIME_TO_LOG': 0, 'MIN_QUERY_COUN...
{"/querycount/tests/test.py": ["/querycount/middleware.py"], "/setup.py": ["/querycount/__init__.py"], "/querycount/middleware.py": ["/querycount/qc_settings.py"]}
85,529
bradmontgomery/django-querycount
refs/heads/main
/querycount/middleware.py
import re import sys import timeit from collections import Counter from textwrap import wrap from django.conf import settings from django.db import connections from django.utils import termcolors from . qc_settings import QC_SETTINGS try: from django.utils.deprecation import MiddlewareMixin except ImportError: ...
{"/querycount/tests/test.py": ["/querycount/middleware.py"], "/setup.py": ["/querycount/__init__.py"], "/querycount/middleware.py": ["/querycount/qc_settings.py"]}
85,530
eduardo-monita/django-rest-api
refs/heads/master
/huai/shoes/urls.py
from django.conf.urls import url from . import views urlpatterns = [ url(r'^webhook/$', views.SimpleWebhook.as_view(), name='simple-webhook'), url(r'^lote/$', views.LoteListCreate.as_view(), name='lote-list-create'), url(r'^lote/(?P<pk>[0-9]+)/$', views.LoteDetail.as_view(), name='lote-detail'), ...
{"/huai/shoes/admin.py": ["/huai/shoes/models.py"], "/huai/shoes/views.py": ["/huai/shoes/models.py", "/huai/shoes/serializers.py"], "/huai/shoes/serializers.py": ["/huai/shoes/models.py"]}
85,531
eduardo-monita/django-rest-api
refs/heads/master
/huai/shoes/apps.py
from django.apps import AppConfig class ShoesConfig(AppConfig): name = 'shoes'
{"/huai/shoes/admin.py": ["/huai/shoes/models.py"], "/huai/shoes/views.py": ["/huai/shoes/models.py", "/huai/shoes/serializers.py"], "/huai/shoes/serializers.py": ["/huai/shoes/models.py"]}
85,532
eduardo-monita/django-rest-api
refs/heads/master
/huai/shoes/admin.py
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import Vendedor @admin.register(Vendedor) class CustomUserAdmin(UserAdmin): model = Vendedor # Register your models here.
{"/huai/shoes/admin.py": ["/huai/shoes/models.py"], "/huai/shoes/views.py": ["/huai/shoes/models.py", "/huai/shoes/serializers.py"], "/huai/shoes/serializers.py": ["/huai/shoes/models.py"]}
85,533
eduardo-monita/django-rest-api
refs/heads/master
/huai/shoes/views.py
# from django_filters import rest_framework as filters from rest_framework import filters from rest_framework import generics from rest_framework import status from rest_framework.views import APIView from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_fr...
{"/huai/shoes/admin.py": ["/huai/shoes/models.py"], "/huai/shoes/views.py": ["/huai/shoes/models.py", "/huai/shoes/serializers.py"], "/huai/shoes/serializers.py": ["/huai/shoes/models.py"]}
85,534
eduardo-monita/django-rest-api
refs/heads/master
/huai/shoes/models.py
from django.db import models from django.contrib.auth.models import AbstractUser # Create your models here. class Lote(models.Model): class Meta: db_table = 'lote' nome = models.CharField(max_length=80) dt_fabric = models.DateField(auto_now=True) quantidade = models.IntegerF...
{"/huai/shoes/admin.py": ["/huai/shoes/models.py"], "/huai/shoes/views.py": ["/huai/shoes/models.py", "/huai/shoes/serializers.py"], "/huai/shoes/serializers.py": ["/huai/shoes/models.py"]}
85,535
eduardo-monita/django-rest-api
refs/heads/master
/huai/shoes/serializers.py
from rest_framework import serializers from rest_auth.registration.serializers import RegisterSerializer from .models import * class LoteSerializer(serializers.ModelSerializer): class Meta: model = Lote fields = fields = ['id','nome','dt_fabric','quantidade'] class ItemSerializer(serial...
{"/huai/shoes/admin.py": ["/huai/shoes/models.py"], "/huai/shoes/views.py": ["/huai/shoes/models.py", "/huai/shoes/serializers.py"], "/huai/shoes/serializers.py": ["/huai/shoes/models.py"]}
85,553
matrxs/MATRXS
refs/heads/dev
/matrx/actions/action.py
class Action: """ The Action class. This class is empty and should be overridden if you want to make a new action that is not yet supported. You may also extend other actions, but all MATRX' actions inherit from this class. When creating a new Action, you should always override the Action.mutate(......
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,554
matrxs/MATRXS
refs/heads/dev
/matrx/API/api.py
import threading import time import copy import logging from flask import Flask, jsonify, abort, request from flask_cors import CORS from matrx.utils.message import Message ''' This file holds the code for the MATRX RESTful API. External scripts can send POST and/or GET requests to retrieve state, tick and other inf...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,555
matrxs/MATRXS
refs/heads/dev
/matrx/utils/agent_utils/navigator.py
import heapq from collections import OrderedDict import numpy as np from matrx.utils.agent_utils.state_tracker import StateTracker from matrx.actions.move_actions import * class Navigator: A_STAR_ALGORITHM = "a_star" def __init__(self, agent_id, action_set, algorithm=A_STAR_ALGORITHM, is_circular=False): ...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,556
matrxs/MATRXS
refs/heads/dev
/matrx/agents/capabilities/capability.py
import numpy as np class Capability: def __init__(self): """ Base class for agent capabilities. Currently only used for the SenseCapability. """ pass class SenseCapability(Capability): def __init__(self, detectable_objects): """This class stores what object types ...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,557
matrxs/MATRXS
refs/heads/dev
/matrx/logger/logger.py
import csv import datetime import os class GridWorldLogger: LOG_ON_LAST_TICK = "log_last_tick" LOG_ON_FIRST_TICK = "log_first_tick" LOG_ON_GOAL_REACHED = "log_on_reached_goal" def __init__(self, log_strategy=1, save_path="/logs", file_name="", file_extension=".csv", delimiter=";"): self.__log...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,558
matrxs/MATRXS
refs/heads/dev
/matrx/grid_world.py
import datetime import os.path import warnings from collections import OrderedDict import time import copy import requests import gevent from matrx.actions.object_actions import * from matrx.logger.logger import GridWorldLogger from matrx.objects.env_object import EnvObject from matrx.objects.simple_objects import A...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,559
matrxs/MATRXS
refs/heads/dev
/matrx/scenarios/new_vis_test.py
from matrx.agents.patrolling_agent import PatrollingAgentBrain from matrx.world_builder import WorldBuilder from matrx.agents.human_agent_brain import HumanAgentBrain from matrx.actions.move_actions import * def create_factory(): factory = WorldBuilder(random_seed=1, shape=[14, 20], tick_duration=0.1, verbose=Fal...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,560
matrxs/MATRXS
refs/heads/dev
/main.py
from matrx.API import api from matrx.scenarios import simple_scenario, test_scenario, new_vis_test if __name__ == "__main__": # By creating scripts that return a factory, we can define infinite number of use cases and select them (in the # future) through a UI. factory = new_vis_test.create_factory() ...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,561
matrxs/MATRXS
refs/heads/dev
/matrx/agents/human_agent_brain.py
from matrx.agents.agent_brain import AgentBrain from matrx.actions.object_actions import GrabObject from matrx.actions.door_actions import * class HumanAgentBrain(AgentBrain): def __init__(self): """ Creates an Human Agent which is an agent that can be controlled by a human. """ ...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,562
matrxs/MATRXS
refs/heads/dev
/matrx/API/logMatrx.py
import logging import jsonpickle #Definitions DataFormats={ "dateTimeMessage" : logging.Formatter('%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p'), "message": logging.Formatter('%(message)s') } LogFiles={ "generalStructureLog" : "generalStructure.log", "runtimeDataLog" : "logData.log" } Lo...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,563
matrxs/MATRXS
refs/heads/dev
/matrx/objects/advanced_objects.py
from matrx.objects.env_object import EnvObject class Battery(EnvObject): def __init__(self, location, name="Battery", start_energy_level=1.0, energy_decay=0.01): """ A simple exanple of an object with an update_properties method that is called each simulation step. It also has two default...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,564
matrxs/MATRXS
refs/heads/dev
/matrx/logger/log_agent_actions.py
from matrx.logger.logger import GridWorldLogger from matrx.grid_world import GridWorld class LogActions(GridWorldLogger): def __init__(self, save_path="", file_name_prefix="", file_extension=".csv", delimeter=";"): super().__init__(save_path=save_path, file_name=file_name_prefix, file_extension=file_exte...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,565
matrxs/MATRXS
refs/heads/dev
/matrx/logger/log_idle_agents.py
from matrx.logger.logger import GridWorldLogger from matrx.grid_world import GridWorld class LogIdleAgents(GridWorldLogger): def __init__(self, log_strategy=1, save_path="", file_name_prefix="", file_extension=".csv", delimeter=";"): super().__init__(log_strategy=log_strategy, save_path=save_path, file_n...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,566
matrxs/MATRXS
refs/heads/dev
/matrx/sim_goals/sim_goal.py
import numpy as np class SimulationGoal: """ A class that tracks whether the simulation has reached its global goal. """ def __init__(self): """ We set the self.is_done to False as a start. """ self.is_done = False def goal_reached(self, grid_world): """ ...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,567
matrxs/MATRXS
refs/heads/dev
/matrx/objects/simple_objects.py
from matrx.objects.env_object import EnvObject class SquareBlock(EnvObject): def __init__(self, location, name="Block"): """ An example of a simple object with a set of attributes that are always the same. In this case that it is not traversable, and is visualized as a square. Otherwise i...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,568
matrxs/MATRXS
refs/heads/dev
/matrx/world_builder.py
import inspect import os import sys import warnings from collections import OrderedDict from typing import Callable, Union, Iterable import requests import numpy as np from numpy.random.mtrand import RandomState from matrx.agents.agent_brain import AgentBrain from matrx.agents.capabilities.capability import SenseCapa...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,569
matrxs/MATRXS
refs/heads/dev
/matrx/utils/agent_utils/state_tracker.py
import numpy as np from matrx.utils.utils import get_distance class StateTracker: def __init__(self, agent_id, knowledge_decay=10): # The amount with which we forget known knowledge (we do so linearly) if knowledge_decay > 1.0: self.__decay = 1 / knowledge_decay elif knowled...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,570
matrxs/MATRXS
refs/heads/dev
/matrx/scenarios/simple_scenario.py
from matrx.agents.human_agent_brain import HumanAgentBrain from matrx.agents.patrolling_agent import PatrollingAgentBrain from matrx.logger.log_agent_actions import LogActions from matrx.world_builder import WorldBuilder from matrx.actions.move_actions import * def create_factory(): factory = WorldBuilder(random_...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,571
matrxs/MATRXS
refs/heads/dev
/matrx/actions/move_actions.py
from matrx.actions.action import Action, ActionResult from matrx.objects.agent_body import AgentBody def _act_move(grid_world, agent_id, dx, dy): """ Private MATRX method. The method that actually mutates the location of an AgentBody based on a delta-x and delta-y. Parameters ---------- grid_wor...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,572
matrxs/MATRXS
refs/heads/dev
/matrx/actions/object_actions.py
import collections import numpy as np from matrx.actions.action import Action, ActionResult from matrx.utils.utils import get_distance from matrx.objects.agent_body import AgentBody from matrx.objects.simple_objects import AreaTile class RemoveObject(Action): def __init__(self, duration_in_ticks=1): ""...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,573
matrxs/MATRXS
refs/heads/dev
/matrx/agents/patrolling_agent.py
from matrx.agents.agent_brain import AgentBrain from matrx.utils.agent_utils.navigator import Navigator from matrx.utils.agent_utils.state_tracker import StateTracker class PatrollingAgentBrain(AgentBrain): def __init__(self, waypoints, move_speed=1): super().__init__() self.state_tracker = None ...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,574
matrxs/MATRXS
refs/heads/dev
/matrx/utils/utils.py
import json import math import random import numpy as np from matrx.agents.capabilities.capability import SenseCapability object_counter = 0 def next_obj_id(): global object_counter res = object_counter object_counter += 1 return res def get_inheritence_path(callable_class): parents = callable...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,575
matrxs/MATRXS
refs/heads/dev
/matrx/agents/agent_brain.py
import copy from typing import Union import random from matrx.actions.door_actions import * from matrx.actions.object_actions import * from matrx.utils.message import Message class AgentBrain: def __init__(self): """ Defines the brain of an Agent. The AgentBrain is the place where all the decisi...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,576
matrxs/MATRXS
refs/heads/dev
/matrx/utils/message.py
import json from matrx.utils.utils import gen_random_string class Message: """ A simple object representing a communication message. An agent can create such a Message object by stating the content, its own id as the sender and (optional) a receiver. If a receiver is not given it is a message to all ag...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,577
matrxs/MATRXS
refs/heads/dev
/matrx/logger/log_tick.py
from matrx.logger.logger import GridWorldLogger from matrx.grid_world import GridWorld class LogDuration(GridWorldLogger): def __init__(self, save_path="", file_name_prefix="", file_extension=".csv", delimeter=";"): super().__init__(save_path=save_path, file_name=file_name_prefix, file_extension=file_ext...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,578
matrxs/MATRXS
refs/heads/dev
/matrx/utils/message_manager.py
from matrx.agents.agent_brain import Message class MessageManager(): """ A manager inside the GirdWorld that tracks the received and send messages between agents and their teams. This gives provides several advantages; - an easier connection between Core, API and Front-end for messages (e.g. to d...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,579
matrxs/MATRXS
refs/heads/dev
/matrx/actions/door_actions.py
import numpy as np from matrx.actions.action import Action, ActionResult from matrx.objects.simple_objects import Door class OpenDoorAction(Action): def __init__(self, duration_in_ticks=1): """ Action that opens doors. The action that opens a specific door within a given range from the agent. ...
{"/matrx/API/api.py": ["/matrx/utils/message.py"], "/matrx/utils/agent_utils/navigator.py": ["/matrx/utils/agent_utils/state_tracker.py", "/matrx/actions/move_actions.py"], "/matrx/grid_world.py": ["/matrx/actions/object_actions.py", "/matrx/logger/logger.py", "/matrx/objects/simple_objects.py", "/matrx/utils/utils.py"...
85,588
sirmmo/interrogator
refs/heads/master
/questionnaire/migrations/0002_auto_20140910_1219.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('questionnaire', '0001_initial'), ] operations = [ migrations.AddField( model_name='questionnaire', n...
{"/questionnaire/views.py": ["/questionnaire/models.py"], "/questionnaire/admin.py": ["/questionnaire/models.py"]}
85,589
sirmmo/interrogator
refs/heads/master
/interrogator/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', url(r'^$', 'questionnaire.views.index', name='index'), url(r'^q/new$', 'questionnaire.views.questionnaire', name='index'), url(r'^q/(?P<id>\d+)$', 'questionnaire.views.questionnaire', name='index...
{"/questionnaire/views.py": ["/questionnaire/models.py"], "/questionnaire/admin.py": ["/questionnaire/models.py"]}
85,590
sirmmo/interrogator
refs/heads/master
/questionnaire/views.py
import sys reload(sys) sys.setdefaultencoding("utf-8") from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth.decorators import login_required from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse from django.template...
{"/questionnaire/views.py": ["/questionnaire/models.py"], "/questionnaire/admin.py": ["/questionnaire/models.py"]}
85,591
sirmmo/interrogator
refs/heads/master
/questionnaire/admin.py
from django.contrib import admin from .models import * admin.site.register(Questionnaire) admin.site.register(Question) admin.site.register(Option) admin.site.register(Response) admin.site.register(Done) admin.site.register(DoneAnswer)
{"/questionnaire/views.py": ["/questionnaire/models.py"], "/questionnaire/admin.py": ["/questionnaire/models.py"]}
85,592
sirmmo/interrogator
refs/heads/master
/questionnaire/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Done', fields=[ ('id', models.AutoField(verbose...
{"/questionnaire/views.py": ["/questionnaire/models.py"], "/questionnaire/admin.py": ["/questionnaire/models.py"]}
85,593
sirmmo/interrogator
refs/heads/master
/questionnaire/models.py
from django.db import models from django.db.models import Count class Questionnaire(models.Model): name = models.CharField(max_length=1000) description = models.TextField(default="") header_template = models.TextField(default="") image = models.ImageField(blank=True, null=True) closed = models.BooleanField(defau...
{"/questionnaire/views.py": ["/questionnaire/models.py"], "/questionnaire/admin.py": ["/questionnaire/models.py"]}
85,594
aazabal1/TDAB
refs/heads/main
/model_train.py
import argparse import logging import os import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.keras import Sequential, Model, Input from tensorflow.keras.layers import Dense, LSTM, Bidirectional, Dropout from tensorflow.keras.optimizers import Adam from tensorflow.keras.callbacks...
{"/data_input_model.py": ["/src/scalers.py"]}
85,595
aazabal1/TDAB
refs/heads/main
/Data_Exploration.py
#!/usr/bin/env python # coding: utf-8 # # Explore Raw Input Data # In[2]: import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns get_ipython().run_line_magic('matplotlib', 'inline') # In[26]: # Load data data = pd.read_csv("../test_data.csv") data # In[27]: # Describe...
{"/data_input_model.py": ["/src/scalers.py"]}
85,596
aazabal1/TDAB
refs/heads/main
/data_input_model.py
import argparse import logging import os import pandas as pd import numpy as np import datetime from src.scalers import RNN_Transform_Wrap from sklearn.model_selection import train_test_split from sklearn.preprocessing import MinMaxScaler LOG = logging.getLogger(__name__) def data_loading(input_args): """ Loa...
{"/data_input_model.py": ["/src/scalers.py"]}