index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
48,678
EHounslow/Metagenomics
refs/heads/main
/modelling/disease_selector.py
from typing import Tuple from pandas.core.frame import DataFrame def get_disease_data( disease_to_select: str, disease_target: DataFrame ) -> Tuple[DataFrame, DataFrame, DataFrame]: """ Creates a single disease subset dataframe from the full metagenomic dataframe. Args: disease_to_select: (str...
{"/tests/test_data_loader.py": ["/modelling/data_loader.py"], "/tests/test_disease_selector.py": ["/modelling/dataset_selector.py", "/modelling/data_loader.py", "/modelling/disease_selector.py"], "/tests/test_dataset_selector.py": ["/modelling/dataset_selector.py"]}
48,679
EHounslow/Metagenomics
refs/heads/main
/modelling/variable_definer.py
from typing import List, Tuple from pandas.core.frame import DataFrame def get_variables(data_subset: DataFrame) -> Tuple[List, List, List]: """ Seperates the variables into 3 lists containing metadata, species, and all other taxonomic variables. Args: data_subset: (DataFrame): A dataframe con...
{"/tests/test_data_loader.py": ["/modelling/data_loader.py"], "/tests/test_disease_selector.py": ["/modelling/dataset_selector.py", "/modelling/data_loader.py", "/modelling/disease_selector.py"], "/tests/test_dataset_selector.py": ["/modelling/dataset_selector.py"]}
48,680
EHounslow/Metagenomics
refs/heads/main
/modelling/dataset_selector.py
from pandas.core.frame import DataFrame def get_dataset(dataset_to_select: str, abundance_data: DataFrame) -> DataFrame: """ Creates a single data subset dataframe from the full metagenomic dataframe. Args: dataset_to_select: (str): Name of the target dataset abundance_data: (DataFrame): D...
{"/tests/test_data_loader.py": ["/modelling/data_loader.py"], "/tests/test_disease_selector.py": ["/modelling/dataset_selector.py", "/modelling/data_loader.py", "/modelling/disease_selector.py"], "/tests/test_dataset_selector.py": ["/modelling/dataset_selector.py"]}
48,681
EHounslow/Metagenomics
refs/heads/main
/modelling/modellers/random_forest_modeller.py
from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_absolute_error from pandas.core.frame import DataFrame def run_random_forest( train_x: DataFrame, train_y: DataFrame, val_x: DataFrame, val_y: DataFrame ) -> None: """ Runs a random forest model. Args: train_x:...
{"/tests/test_data_loader.py": ["/modelling/data_loader.py"], "/tests/test_disease_selector.py": ["/modelling/dataset_selector.py", "/modelling/data_loader.py", "/modelling/disease_selector.py"], "/tests/test_dataset_selector.py": ["/modelling/dataset_selector.py"]}
48,682
EHounslow/Metagenomics
refs/heads/main
/modelling/data_loader.py
import pandas as pd from pandas.core.frame import DataFrame def extract_abundance_data(abundance: str) -> DataFrame: """ Creates a transposed dataframe from a .txt or .csv file and sets the first row as the header. Args: abundance: (str): The path to the source file Returns: DataFrame...
{"/tests/test_data_loader.py": ["/modelling/data_loader.py"], "/tests/test_disease_selector.py": ["/modelling/dataset_selector.py", "/modelling/data_loader.py", "/modelling/disease_selector.py"], "/tests/test_dataset_selector.py": ["/modelling/dataset_selector.py"]}
48,683
EHounslow/Metagenomics
refs/heads/main
/tests/test_dataset_selector.py
from pandas.core.frame import DataFrame from modelling.dataset_selector import get_dataset def test_get_dataset(): # Arrange # Act # Assert assert True
{"/tests/test_data_loader.py": ["/modelling/data_loader.py"], "/tests/test_disease_selector.py": ["/modelling/dataset_selector.py", "/modelling/data_loader.py", "/modelling/disease_selector.py"], "/tests/test_dataset_selector.py": ["/modelling/dataset_selector.py"]}
48,692
coffee247/PA5b
refs/heads/master
/sentiment.py
import math import operator import pathlib import re import sys import xml.etree.ElementTree as ET import logging import fileLoaderClass # set up logging dirpath = pathlib.Path(__file__).parent.absolute() logging.basicConfig(filename=f'{dirpath}/my-model.txt', filemode='w', format='%(message)s') class sentimenter...
{"/sentiment.py": ["/fileLoaderClass.py"]}
48,693
coffee247/PA5b
refs/heads/master
/fileLoaderClass.py
import pathlib import sys class fileLoader(): def __init__(self): pass def loadFiles(self): files = [] outfiles = [] argLength: int = len(sys.argv) for index in range(1, argLength, 1): files.append(self.readfile(index)) # load text from files on disk ...
{"/sentiment.py": ["/fileLoaderClass.py"]}
48,725
cyins/YOLOv5-SGBM
refs/heads/master
/recevier.py
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code...
{"/recevier.py": ["/utils/general.py"], "/latency_test.py": ["/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/utils/dataset.py": ["/utils/general.py"], "/raw_record.py": ["/utils/img_preprocess.py", "/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/detect.py": ["/u...
48,726
cyins/YOLOv5-SGBM
refs/heads/master
/utils/image_merge.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @Description: : 将左右相机拍摄的两张照片合成一张 @Date :2021/05/28 19:38:05 @Author :Yyc @version :1.0 ''' import os,time,sys,cv2 import numpy as np #%% #TODO:打开两张照片,合成一张 def merge_images(root='',folder=''): # print(folder) dir = os.path.join(root,folde...
{"/recevier.py": ["/utils/general.py"], "/latency_test.py": ["/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/utils/dataset.py": ["/utils/general.py"], "/raw_record.py": ["/utils/img_preprocess.py", "/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/detect.py": ["/u...
48,727
cyins/YOLOv5-SGBM
refs/heads/master
/latency_test.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @Description: main function for YOLOv5 + SGBM model running on RK3399pro platform @Date :2021/04/23 19:56:56 @Author :Noah @version :version : 21042603 ''' import os,logging,sys,argparse,time,socket,math,queue import cv2 from utils.Stereo_Application ...
{"/recevier.py": ["/utils/general.py"], "/latency_test.py": ["/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/utils/dataset.py": ["/utils/general.py"], "/raw_record.py": ["/utils/img_preprocess.py", "/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/detect.py": ["/u...
48,728
cyins/YOLOv5-SGBM
refs/heads/master
/utils/Img2Video.py
''' Author : Noah Date : 20210408 function: Load data to input to the model ''' import os,sys,logging,glob,time,rospy from pathlib import Path from itertools import repeat from multiprocessing.pool import ThreadPool from threading import Thread # from utils.general import confirm_dir,timethis,calib_type import cv2...
{"/recevier.py": ["/utils/general.py"], "/latency_test.py": ["/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/utils/dataset.py": ["/utils/general.py"], "/raw_record.py": ["/utils/img_preprocess.py", "/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/detect.py": ["/u...
48,729
cyins/YOLOv5-SGBM
refs/heads/master
/utils/rknn_dataset_gen.py
''' Author : Noah Date : 20210412 function: generate dataset for rknn quantization ''' import os,sys,glob,time,random,argparse from pathlib import Path image_format = ['.jpg','.png'] if __name__ == '__main__': # %% # parameter input with model start up parser = argparse.ArgumentParser() parser.add...
{"/recevier.py": ["/utils/general.py"], "/latency_test.py": ["/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/utils/dataset.py": ["/utils/general.py"], "/raw_record.py": ["/utils/img_preprocess.py", "/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/detect.py": ["/u...
48,730
cyins/YOLOv5-SGBM
refs/heads/master
/utils/dataset.py
''' Author : Noah Date : 20210408 function: Load data to input to the model ''' import os,sys,logging,glob,time,queue from pathlib import Path from itertools import repeat from multiprocessing.pool import ThreadPool from threading import Thread import threading import numpy as np from utils.general import confirm_d...
{"/recevier.py": ["/utils/general.py"], "/latency_test.py": ["/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/utils/dataset.py": ["/utils/general.py"], "/raw_record.py": ["/utils/img_preprocess.py", "/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/detect.py": ["/u...
48,731
cyins/YOLOv5-SGBM
refs/heads/master
/raw_record.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @Description: : 录数据 @Date :2021/05/31 15:05:22 @Author :Yyc @version :1.0 ''' import os,logging,sys,argparse,time,math,queue from datetime import datetime import cv2 import numpy as np import matplotlib.pyplot as plt from threading import Thread ...
{"/recevier.py": ["/utils/general.py"], "/latency_test.py": ["/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/utils/dataset.py": ["/utils/general.py"], "/raw_record.py": ["/utils/img_preprocess.py", "/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/detect.py": ["/u...
48,732
cyins/YOLOv5-SGBM
refs/heads/master
/detect.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @Description: main function for YOLOv5 + SGBM model running on RK3399pro platform @Date :2021/04/23 19:56:56 @Author :Noah @version :version : 21052005 ''' import os,logging,sys,argparse,time,math,queue from datetime import date,datetime import cv2 im...
{"/recevier.py": ["/utils/general.py"], "/latency_test.py": ["/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/utils/dataset.py": ["/utils/general.py"], "/raw_record.py": ["/utils/img_preprocess.py", "/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/detect.py": ["/u...
48,733
cyins/YOLOv5-SGBM
refs/heads/master
/listener.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @Description: : @Date :2021/04/23 21:50:37 @Author :xia @version :1.0 ''' import rospy,cv2,socket,numpy,time from cv_bridge import CvBridge from sensor_msgs.msg import Image from geometry_msgs.msg import PolygonStamped from multiprocessing import P...
{"/recevier.py": ["/utils/general.py"], "/latency_test.py": ["/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/utils/dataset.py": ["/utils/general.py"], "/raw_record.py": ["/utils/img_preprocess.py", "/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/detect.py": ["/u...
48,734
cyins/YOLOv5-SGBM
refs/heads/master
/sm_test.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @Description: : Stereo Matching test @Date :2021/05/28 09:47:18 @Author :Yyc @version :1.0 ''' import os,logging,sys,argparse,time,math,queue from datetime import date today = date.today() import cv2 import numpy as np import matplotlib.pyplot a...
{"/recevier.py": ["/utils/general.py"], "/latency_test.py": ["/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/utils/dataset.py": ["/utils/general.py"], "/raw_record.py": ["/utils/img_preprocess.py", "/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/detect.py": ["/u...
48,735
cyins/YOLOv5-SGBM
refs/heads/master
/utils/general.py
''' Author : Noah Date : 20210408 function: common-basic function database ''' import os,sys,logging,cv2,time,functools,socket from pathlib import Path import numpy as np from contextlib import contextmanager from enum import Enum def timethis(func): """ @description : a timecounter wrapper for a function...
{"/recevier.py": ["/utils/general.py"], "/latency_test.py": ["/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/utils/dataset.py": ["/utils/general.py"], "/raw_record.py": ["/utils/img_preprocess.py", "/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/detect.py": ["/u...
48,736
cyins/YOLOv5-SGBM
refs/heads/master
/utils/Stereo_Application.py
import numpy as np import argparse,logging,time,math,os import cv2 from matplotlib import pyplot as plt from utils.general import calib_type, timethis class Cursor: def __init__(self, ax): self.ax = ax self.lx = ax.axhline(color='k') # the horiz line self.ly = ax.axvline(color='k') # the ...
{"/recevier.py": ["/utils/general.py"], "/latency_test.py": ["/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/utils/dataset.py": ["/utils/general.py"], "/raw_record.py": ["/utils/img_preprocess.py", "/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/detect.py": ["/u...
48,737
cyins/YOLOv5-SGBM
refs/heads/master
/utils/img_preprocess.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Mar 27 11:06:14 2021 @author: bynav """ # -*- coding: utf-8 -*- import cv2,time,logging import numpy as np from utils.stereoconfig import stereoCamera import os from pathlib import Path from utils.general import timethis,timeblock,calib_type,letterbox ...
{"/recevier.py": ["/utils/general.py"], "/latency_test.py": ["/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/utils/dataset.py": ["/utils/general.py"], "/raw_record.py": ["/utils/img_preprocess.py", "/utils/Stereo_Application.py", "/utils/dataset.py", "/utils/general.py"], "/detect.py": ["/u...
48,738
jkornblum/airflow-cyberark-secrets-backend
refs/heads/main
/airflow_cyberark_secrets_backend/cyberark_backend.py
import os from typing import Dict, Optional, Union from airflow.models.connection import Connection from airflow.secrets import BaseSecretsBackend from airflow.utils.log.logging_mixin import LoggingMixin import requests __version__ = "0.1.0" class CyberArkSecretsBackend(BaseSecretsBackend, LoggingMixin): """ ...
{"/airflow_cyberark_secrets_backend/__init__.py": ["/airflow_cyberark_secrets_backend/cyberark_backend.py"]}
48,739
jkornblum/airflow-cyberark-secrets-backend
refs/heads/main
/airflow_cyberark_secrets_backend/__init__.py
__version__ = "0.1.0" from .cyberark_backend import CyberArkSecretsBackend
{"/airflow_cyberark_secrets_backend/__init__.py": ["/airflow_cyberark_secrets_backend/cyberark_backend.py"]}
48,740
jkornblum/airflow-cyberark-secrets-backend
refs/heads/main
/setup.py
# https://setuptools.readthedocs.io/en/latest/userguide/quickstart.html#development-mode import setuptools setuptools.setup()
{"/airflow_cyberark_secrets_backend/__init__.py": ["/airflow_cyberark_secrets_backend/cyberark_backend.py"]}
48,743
Rubentxu/RubentxuDjangoPy
refs/heads/master
/blog/forms.py
from django import forms from django.forms.models import inlineformset_factory from blog.models import * import logging logger = logging.getLogger(__name__) class PostForm(forms.ModelForm): class Meta: model = Post exclude = ['autor'] class TagForm(forms.ModelForm): ...
{"/blog/forms.py": ["/blog/models.py"], "/blog/Sitemap.py": ["/blog/models.py"], "/blog/feeds.py": ["/blog/models.py"], "/urls.py": ["/blog/feeds.py", "/blog/Sitemap.py"], "/blog/views.py": ["/blog/forms.py", "/blog/models.py"], "/blog/urls.py": ["/blog/models.py", "/blog/views.py"], "/blog/tests.py": ["/blog/models.py...
48,744
Rubentxu/RubentxuDjangoPy
refs/heads/master
/settings.py
from djangoappengine.settings_base import * import os ADMIN_MEDIA_PREFIX = '/static/admin/' TIME_ZONE = 'Europe/Madrid' SECRET_KEY = '=r-$b*8hglm+858&9t043hlm6-&6-3d3vfc4((7yd0dbrakhvi' LANGUAGE_CODE= 'es' SITE_ID=1 GAE_SETTINGS_MODULES = ( 'gae_comments_settings', ) INSTALLED_APPS = ( 'd...
{"/blog/forms.py": ["/blog/models.py"], "/blog/Sitemap.py": ["/blog/models.py"], "/blog/feeds.py": ["/blog/models.py"], "/urls.py": ["/blog/feeds.py", "/blog/Sitemap.py"], "/blog/views.py": ["/blog/forms.py", "/blog/models.py"], "/blog/urls.py": ["/blog/models.py", "/blog/views.py"], "/blog/tests.py": ["/blog/models.py...
48,745
Rubentxu/RubentxuDjangoPy
refs/heads/master
/blog/Sitemap.py
### sitemaps.py from django.contrib.sitemaps import GenericSitemap from blog.models import Post, Categoria all_sitemaps = {} for categoria in Categoria.objects.all(): info_dict = { 'queryset': categoria.post_set.filter(estado=1), } sitemap = GenericSitemap(info_dict,priority=0.6) # dict key ...
{"/blog/forms.py": ["/blog/models.py"], "/blog/Sitemap.py": ["/blog/models.py"], "/blog/feeds.py": ["/blog/models.py"], "/urls.py": ["/blog/feeds.py", "/blog/Sitemap.py"], "/blog/views.py": ["/blog/forms.py", "/blog/models.py"], "/blog/urls.py": ["/blog/models.py", "/blog/views.py"], "/blog/tests.py": ["/blog/models.py...
48,746
Rubentxu/RubentxuDjangoPy
refs/heads/master
/blog/feeds.py
from django.core.exceptions import ObjectDoesNotExist from django.utils.feedgenerator import Atom1Feed from django.contrib.syndication.feeds import Feed from blog.models import Categoria, Post class LatestEntriesFeed(Feed): author_name = "Ruben Dario" copyright = "AGPL" description = "Ultimos Posts publ...
{"/blog/forms.py": ["/blog/models.py"], "/blog/Sitemap.py": ["/blog/models.py"], "/blog/feeds.py": ["/blog/models.py"], "/urls.py": ["/blog/feeds.py", "/blog/Sitemap.py"], "/blog/views.py": ["/blog/forms.py", "/blog/models.py"], "/blog/urls.py": ["/blog/models.py", "/blog/views.py"], "/blog/tests.py": ["/blog/models.py...
48,747
Rubentxu/RubentxuDjangoPy
refs/heads/master
/blog/models.py
from django.db import models from django.contrib.auth.models import User from markdown import markdown from django.template.defaultfilters import slugify import datetime class PostsActivosManager(models.Manager): def get_query_set(self): return super(PostsActivosManager, self).get_query_set().filter(estad...
{"/blog/forms.py": ["/blog/models.py"], "/blog/Sitemap.py": ["/blog/models.py"], "/blog/feeds.py": ["/blog/models.py"], "/urls.py": ["/blog/feeds.py", "/blog/Sitemap.py"], "/blog/views.py": ["/blog/forms.py", "/blog/models.py"], "/blog/urls.py": ["/blog/models.py", "/blog/views.py"], "/blog/tests.py": ["/blog/models.py...
48,748
Rubentxu/RubentxuDjangoPy
refs/heads/master
/urls.py
from django.conf.urls.defaults import patterns, include, url from django.contrib.auth.forms import AuthenticationForm from django.contrib import admin from blog.feeds import LatestEntriesFeed,CategoryFeed from blog.Sitemap import all_sitemaps as sitemaps admin.autodiscover() handler500 = 'djangotoolbox.error...
{"/blog/forms.py": ["/blog/models.py"], "/blog/Sitemap.py": ["/blog/models.py"], "/blog/feeds.py": ["/blog/models.py"], "/urls.py": ["/blog/feeds.py", "/blog/Sitemap.py"], "/blog/views.py": ["/blog/forms.py", "/blog/models.py"], "/blog/urls.py": ["/blog/models.py", "/blog/views.py"], "/blog/tests.py": ["/blog/models.py...
48,749
Rubentxu/RubentxuDjangoPy
refs/heads/master
/blog/views.py
from django.contrib.auth.forms import UserCreationForm from django.views.generic.simple import direct_to_template from django.http import HttpResponseRedirect,HttpResponse from blog.forms import * from blog.models import * from django.shortcuts import get_object_or_404 from django.views.generic.list_detail import...
{"/blog/forms.py": ["/blog/models.py"], "/blog/Sitemap.py": ["/blog/models.py"], "/blog/feeds.py": ["/blog/models.py"], "/urls.py": ["/blog/feeds.py", "/blog/Sitemap.py"], "/blog/views.py": ["/blog/forms.py", "/blog/models.py"], "/blog/urls.py": ["/blog/models.py", "/blog/views.py"], "/blog/tests.py": ["/blog/models.py...
48,750
Rubentxu/RubentxuDjangoPy
refs/heads/master
/blog/urls.py
from django.conf.urls.defaults import * from blog.models import * from blog.views import * urlpatterns = patterns('blog.views', (r'^(?P<slug>[-\w]+)/$', categoria_detalle, {}, 'categoria_detalle'), (r'^$', index_Posts, { 'pagina':1}), (r'^post/pagina/(?P<pagina>\d{0,3})$', index_Posts), (r'^pos...
{"/blog/forms.py": ["/blog/models.py"], "/blog/Sitemap.py": ["/blog/models.py"], "/blog/feeds.py": ["/blog/models.py"], "/urls.py": ["/blog/feeds.py", "/blog/Sitemap.py"], "/blog/views.py": ["/blog/forms.py", "/blog/models.py"], "/blog/urls.py": ["/blog/models.py", "/blog/views.py"], "/blog/tests.py": ["/blog/models.py...
48,751
Rubentxu/RubentxuDjangoPy
refs/heads/master
/blog/tests.py
from django.test import TestCase from blog.models import Post class SimpleTest(TestCase): def setUp(self): Post(contenido='This is a test greeting').save() def test_setup(self): self.assertEqual(1, len(Post.objects.all())) self.assertEqual('This is a test greeting', Post.objects.all()[...
{"/blog/forms.py": ["/blog/models.py"], "/blog/Sitemap.py": ["/blog/models.py"], "/blog/feeds.py": ["/blog/models.py"], "/urls.py": ["/blog/feeds.py", "/blog/Sitemap.py"], "/blog/views.py": ["/blog/forms.py", "/blog/models.py"], "/blog/urls.py": ["/blog/models.py", "/blog/views.py"], "/blog/tests.py": ["/blog/models.py...
48,756
monocongo/openimages
refs/heads/master
/src/openimages/download_segmentations.py
import os import zipfile from typing import Dict from helpers import download_file def download_segmentation_zipfiles(base_url: str, section: str, meta_dir: str): """ Downloads segmentation mask archive files from OpenImages dataset. :param base_url: OpenImages URL location :param section: split sec...
{"/src/openimages/download.py": ["/src/openimages/download_segmentations.py"]}
48,757
monocongo/openimages
refs/heads/master
/tests/test_download.py
import logging import os import pytest from openimages import download # ------------------------------------------------------------------------------ # disable logging messages logging.disable(logging.CRITICAL) # ------------------------------------------------------------------------------ @pytest.mark.usefixtu...
{"/src/openimages/download.py": ["/src/openimages/download_segmentations.py"]}
48,758
monocongo/openimages
refs/heads/master
/tests/conftest.py
import os from distutils import dir_util import pytest @pytest.fixture def data_dir(tmpdir, request): """ Fixture responsible for searching a folder with the same name of test module and, if available, moving all contents to a temporary directory so tests can use them freely. """ filename = r...
{"/src/openimages/download.py": ["/src/openimages/download_segmentations.py"]}
48,759
monocongo/openimages
refs/heads/master
/setup.py
import os from setuptools import setup, find_packages parent_dir = os.path.dirname(os.path.realpath(__file__)) with open(f"{parent_dir}/README.md", "r") as readme_file: long_description = readme_file.read() setup( name="openimages", version="0.0.1", author="James Adams", author_email="monocongo@g...
{"/src/openimages/download.py": ["/src/openimages/download_segmentations.py"]}
48,760
monocongo/openimages
refs/heads/master
/src/helpers.py
import os import requests from tqdm import tqdm # Modified from https://stackoverflow.com/a/37573701. def download_file(url: str, dest_path: str = None): """ Downloads file at the given URL and stores it in dest_path if given, or returns the contents if dest_path is None (default). :param url URL to...
{"/src/openimages/download.py": ["/src/openimages/download_segmentations.py"]}
48,761
monocongo/openimages
refs/heads/master
/src/openimages/download.py
import argparse import concurrent.futures import io import logging import os from typing import Dict, List, Set import urllib3 import warnings import boto3 import botocore import lxml.etree as etree import pandas as pd import requests from tqdm import tqdm from cvdata.utils import image_dimensions from helpers impor...
{"/src/openimages/download.py": ["/src/openimages/download_segmentations.py"]}
48,763
yusiningxin/sniper-pytorch
refs/heads/master
/lib/data_utils/load_data.py
# --------------------------------------------------------------- # SNIPER: Efficient Multi-scale Training # Licensed under The Apache-2.0 License [see LICENSE for details] # Modified from https://github.com/msracver/Deformable-ConvNets # Modified by Mahyar Najibi # -----------------------------------------------------...
{"/main_dataset.py": ["/init.py"], "/main_test.py": ["/init.py", "/inference.py"]}
48,764
yusiningxin/sniper-pytorch
refs/heads/master
/lib/iterators/PytorchTest.py
import torch.utils.data as data import numpy as np from multiprocessing import Pool from data_utils.data_workers import im_worker from multiprocessing.pool import ThreadPool import math import matplotlib.pyplot as plt class PytorchTest(data.Dataset): def __init__(self, roidb, config, test_scale, batch_size=4, thre...
{"/main_dataset.py": ["/init.py"], "/main_test.py": ["/init.py", "/inference.py"]}
48,765
yusiningxin/sniper-pytorch
refs/heads/master
/lib/iterators/PytorchIterator.py
import torch.utils.data as data import numpy as np from multiprocessing import Pool from data_utils.data_workers import anchor_worker, im_worker, chip_worker from multiprocessing.pool import ThreadPool import math import matplotlib.pyplot as plt class PytorchIterator(data.Dataset): def __init__(self, roidb, config...
{"/main_dataset.py": ["/init.py"], "/main_test.py": ["/init.py", "/inference.py"]}
48,766
yusiningxin/sniper-pytorch
refs/heads/master
/lib/chips/chip_generator.py
# -------------------------------------------------------------- # SNIPER: Efficient Multi-Scale Training # Licensed under The Apache-2.0 License [see LICENSE for details] # by Mahyar Najibi and Bharat Singh # -------------------------------------------------------------- import chips from bbox.bbox_transform import cl...
{"/main_dataset.py": ["/init.py"], "/main_test.py": ["/init.py", "/inference.py"]}
48,767
yusiningxin/sniper-pytorch
refs/heads/master
/lib/train_utils/train_one_batch.py
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data as data import time import numpy class AverageMeter(object): """Computes and stores the average and current value""" def __init__(self): self.reset() def reset(self): self.val = 0 self.avg = ...
{"/main_dataset.py": ["/init.py"], "/main_test.py": ["/init.py", "/inference.py"]}
48,768
yusiningxin/sniper-pytorch
refs/heads/master
/main_dataset.py
import init import os import sys import torch os.environ["CUDA_VISIBLE_DEVICES"] = '1,2,3' nGPUs = 3 import matplotlib matplotlib.use('Agg') import torch.nn as nn from configs.faster.default_configs import config, update_config, update_config_from_list from iterators.PytorchIterator import PytorchIterator from data_ut...
{"/main_dataset.py": ["/init.py"], "/main_test.py": ["/init.py", "/inference.py"]}
48,769
yusiningxin/sniper-pytorch
refs/heads/master
/main_test.py
import init import os import sys import torch os.environ["CUDA_VISIBLE_DEVICES"] = '0' #os.environ['CUDA_LAUNCH_BLOCKING'] = '1' import matplotlib matplotlib.use('Agg') import torch.nn as nn #sys.path.insert(0, 'lib') from configs.faster.default_configs import config, update_config, update_config_from_list from iterato...
{"/main_dataset.py": ["/init.py"], "/main_test.py": ["/init.py", "/inference.py"]}
48,770
yusiningxin/sniper-pytorch
refs/heads/master
/init.py
import sys sys.path.insert(0,'lib')
{"/main_dataset.py": ["/init.py"], "/main_test.py": ["/init.py", "/inference.py"]}
48,771
yusiningxin/sniper-pytorch
refs/heads/master
/inference.py
# ------------------------------------------------------------------ # Licensed under The Apache-2.0 License [see LICENSE for details] # Inference module for performing detection and proposal extraction # Written by Mahyar Najibi # ----------------------------------------------------------------- import numpy as np #fr...
{"/main_dataset.py": ["/init.py"], "/main_test.py": ["/init.py", "/inference.py"]}
48,773
marcosguilhermef/oddsing-python
refs/heads/main
/scrapingOdds.py
import traceback from warnings import catch_warnings, simplefilter import connect from bs4 import BeautifulSoup import re import json import datetime import database from OddParametrizacao import bolinhaParaSa from OddParametrizacao import kbetsParaSa from difflib import SequenceMatcher class RaparOddsSa(): def...
{"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]}
48,774
marcosguilhermef/oddsing-python
refs/heads/main
/datasets.py
class Oddssa(): def __init__(self,list,body): self.banca = list['banca'] self.campeonato = list['campeonato'] self.tCasa = list['tCasa'] self.tFora = list['tFora'] self.casa = list['casa'] self.empate = list['empate'] self.fora = list['fora'] self.bo...
{"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]}
48,775
marcosguilhermef/oddsing-python
refs/heads/main
/scrapingLinks.py
from os import link, stat from warnings import catch_warnings import connect from bs4 import BeautifulSoup import re import datetime import json class RaparLinksOddsSa(): def __init__(self,link): self.link = link self.body = self.getLinksMaisOdds() self.pais = None, self.campeonato ...
{"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]}
48,776
marcosguilhermef/oddsing-python
refs/heads/main
/images.py
import requests from bs4 import BeautifulSoup import traceback import pymongo from pymongo import aggregation from database import Database import os from PIL import Image import io import re from bson.objectid import ObjectId import traceback; class conectar: def __init__(self,link): self.link = link ...
{"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]}
48,777
marcosguilhermef/oddsing-python
refs/heads/main
/database.py
import sqlite3 import pymongo from pymongo import aggregation import urllib import json class Database(): mongo = pymongo.MongoClient("mongodb://localhost:27017/") #mongo = pymongo.MongoClient("mongodb://oddsing:"+urllib.parse.quote("!@%17aBc1212")+"@localhost:27017/") databaseM = mongo["oddsing"] col...
{"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]}
48,778
marcosguilhermef/oddsing-python
refs/heads/main
/main.py
#!/usr/bin/python3 from pymongo import database from scrapingLinks import RaparLinksOddsSa as scrap from scrapingLinks import RaparLinksOddsKbets as scrapK from scrapingLinks import RaparLinksOddsBolinha as scrapBol from datasets import Link from lerArquivoDeLinks import ArquivoSA as lerSa from lerArquivoDeLinks import...
{"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]}
48,779
marcosguilhermef/oddsing-python
refs/heads/main
/connect.py
import requests #essa class faz a primeira requisição ao site class ConectSA(): def __init__(self,SALink): self.link = SALink self.response = self.setResponse() def setResponse(self): try: r = requests.get('https://'+self.link) return r except request...
{"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]}
48,780
marcosguilhermef/oddsing-python
refs/heads/main
/SalvarEmTexto.py
import pandas as pd import json import csv import xml.etree.cElementTree as e class SalvarArquivoTexto(): def __init__(self, arquivo): self.arquivo = arquivo #self.setHeads() def save(self): arq = open('teste.json','a+') arq.write(json.dumps(self.arquivo)) def g...
{"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]}
48,781
marcosguilhermef/oddsing-python
refs/heads/main
/lerArquivoDeLinks.py
import re class ArquivoSA(): def ler(self): op = open('SAlist') links = op.readlines() return list(map(lambda link : re.sub('\n','',link), links)) class ArquivoKBETS(): def ler(self): op = open('KBETSlist') links = op.readlines() return list(map(lambda link : re...
{"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]}
48,782
marcosguilhermef/oddsing-python
refs/heads/main
/este.py
def teste(**arr): print(arr) teste(tCasa="casa",tFora="fora")
{"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]}
48,783
marcosguilhermef/oddsing-python
refs/heads/main
/OddParametrizacao.py
class bolinhaParaSa(): def __init__(self,codigo = '',nome = ''): self.grupoCodigo = int(codigo) self.grupoOdd = codigo self.tipoOdd = '' self.nome = nome def getGrupoOdd(self): grupo = { 1: "Vencedor do Encontro" , 2: "Dupla Chance" , ...
{"/scrapingOdds.py": ["/connect.py", "/database.py", "/OddParametrizacao.py"], "/scrapingLinks.py": ["/connect.py"], "/images.py": ["/database.py"], "/main.py": ["/scrapingLinks.py", "/datasets.py", "/lerArquivoDeLinks.py", "/connect.py", "/scrapingOdds.py", "/SalvarEmTexto.py", "/database.py"]}
48,795
algakbk/book-store
refs/heads/main
/main/views.py
from django.shortcuts import render, HttpResponse, redirect from .models import Book # Create your views here. def homepage(request): return render(request, "index.html") def book(request): book_list = Book.objects.all() return render(request, "books.html", {"book_list": book_list}) def add_book(request)...
{"/main/views.py": ["/main/models.py"], "/book/urls.py": ["/main/views.py"]}
48,796
algakbk/book-store
refs/heads/main
/book/urls.py
"""book URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based vi...
{"/main/views.py": ["/main/models.py"], "/book/urls.py": ["/main/views.py"]}
48,797
algakbk/book-store
refs/heads/main
/main/models.py
from django.db import models class Book(models.Model): title = models.CharField(max_length=100) subtitle = models.CharField(max_length=100) description = models.CharField(max_length=1000) price = models.DecimalField(max_digits=5, decimal_places=2) genre = models.CharField(max_length=100) author...
{"/main/views.py": ["/main/models.py"], "/book/urls.py": ["/main/views.py"]}
48,798
rlhjansen/Point2PointRoutability
refs/heads/master
/make_plots.py
import sys import argparse from subprocess import run from common import read_config sys.path.append("..") if __name__ == '__main__': config_dict = read_config() parser = argparse.ArgumentParser() parser.add_argument("-r", "--routings_per_pathlist", help="the number of different orders each pathlist shou...
{"/make_plots.py": ["/common.py"], "/classes/simpleRouter.py": ["/classes/mesh.py", "/classes/gatherer.py"], "/fit_routability_parameters.py": ["/common.py"], "/fit_meshwise.py": ["/common.py"], "/calculate_routability.py": ["/common.py"], "/setup_experiment.py": ["/classes/mesh.py"], "/classes/mesh.py": ["/classes/nod...
48,799
rlhjansen/Point2PointRoutability
refs/heads/master
/classes/simpleRouter.py
from .mesh import file_to_mesh from .gatherer import Gatherer import matplotlib.pyplot as plt class Router(Gatherer): def __init__(self, c, n, nX, x, y, routings_per_pathlist): Gatherer.__init__(self, c, n, nX, x, y, routings_per_pathlist) self.set_saveloc() self.mesh = file_to_mesh(sel...
{"/make_plots.py": ["/common.py"], "/classes/simpleRouter.py": ["/classes/mesh.py", "/classes/gatherer.py"], "/fit_routability_parameters.py": ["/common.py"], "/fit_meshwise.py": ["/common.py"], "/calculate_routability.py": ["/common.py"], "/setup_experiment.py": ["/classes/mesh.py"], "/classes/mesh.py": ["/classes/nod...
48,800
rlhjansen/Point2PointRoutability
refs/heads/master
/fit_routability_parameters.py
import os import argparse import os import pandas as pd import matplotlib import matplotlib.pyplot as plt from scipy.optimize import least_squares from math import exp, floor import numpy as np from common import read_config matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 SMALL_SIZE...
{"/make_plots.py": ["/common.py"], "/classes/simpleRouter.py": ["/classes/mesh.py", "/classes/gatherer.py"], "/fit_routability_parameters.py": ["/common.py"], "/fit_meshwise.py": ["/common.py"], "/calculate_routability.py": ["/common.py"], "/setup_experiment.py": ["/classes/mesh.py"], "/classes/mesh.py": ["/classes/nod...
48,801
rlhjansen/Point2PointRoutability
refs/heads/master
/fit_meshwise.py
import argparse import os import pandas as pd import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from scipy.optimize import least_squares from math import exp import numpy as np from common import read_config matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fontt...
{"/make_plots.py": ["/common.py"], "/classes/simpleRouter.py": ["/classes/mesh.py", "/classes/gatherer.py"], "/fit_routability_parameters.py": ["/common.py"], "/fit_meshwise.py": ["/common.py"], "/calculate_routability.py": ["/common.py"], "/setup_experiment.py": ["/classes/mesh.py"], "/classes/mesh.py": ["/classes/nod...
48,802
rlhjansen/Point2PointRoutability
refs/heads/master
/calculate_routability.py
import argparse from statistics import mean import os from common import read_config def reorder_by_netlength(files, lengths, iters, chipsize): """ Groups files by length and gathers individual filenames """ netlendict = {k:{"filenames":[], 'count':0} for k in lengths} for f in files: filed...
{"/make_plots.py": ["/common.py"], "/classes/simpleRouter.py": ["/classes/mesh.py", "/classes/gatherer.py"], "/fit_routability_parameters.py": ["/common.py"], "/fit_meshwise.py": ["/common.py"], "/calculate_routability.py": ["/common.py"], "/setup_experiment.py": ["/classes/mesh.py"], "/classes/mesh.py": ["/classes/nod...
48,803
rlhjansen/Point2PointRoutability
refs/heads/master
/setup_experiment.py
import argparse import os from classes.mesh import Mesh, file_to_mesh def create_net_datapath(c, n, x, y): abspath = create_circuit_datapath(c, x, y) abspath = os.path.join(abspath, "N"+str(n)) if not os.path.exists(abspath): os.makedirs(abspath) abspath = os.path.join(abspath, "N"+str(n)+"_"...
{"/make_plots.py": ["/common.py"], "/classes/simpleRouter.py": ["/classes/mesh.py", "/classes/gatherer.py"], "/fit_routability_parameters.py": ["/common.py"], "/fit_meshwise.py": ["/common.py"], "/calculate_routability.py": ["/common.py"], "/setup_experiment.py": ["/classes/mesh.py"], "/classes/mesh.py": ["/classes/nod...
48,804
rlhjansen/Point2PointRoutability
refs/heads/master
/common.py
def lprint(iterable, header=None): if header: print("\t".join([str(elem) for elem in header])) for elem in iterable: if type(elem) == list: print("\t".join([str(e) for e in elem])) else: print(str(elem)) def read_config(): with open("config.txt", "r") as f:...
{"/make_plots.py": ["/common.py"], "/classes/simpleRouter.py": ["/classes/mesh.py", "/classes/gatherer.py"], "/fit_routability_parameters.py": ["/common.py"], "/fit_meshwise.py": ["/common.py"], "/calculate_routability.py": ["/common.py"], "/setup_experiment.py": ["/classes/mesh.py"], "/classes/mesh.py": ["/classes/nod...
48,805
rlhjansen/Point2PointRoutability
refs/heads/master
/classes/node.py
def manhattan(vertex1, vertex2): """ :param vertex1: tuple, coordinate :param vertex2: tuple, coordinate :return: manhattan distance between the two coordinates """ manh_d = sum([abs(vertex1[i] - vertex2[i]) for i in range(len(vertex1))]) return manh_d class Node: def __init__(self,...
{"/make_plots.py": ["/common.py"], "/classes/simpleRouter.py": ["/classes/mesh.py", "/classes/gatherer.py"], "/fit_routability_parameters.py": ["/common.py"], "/fit_meshwise.py": ["/common.py"], "/calculate_routability.py": ["/common.py"], "/setup_experiment.py": ["/classes/mesh.py"], "/classes/mesh.py": ["/classes/nod...
48,806
rlhjansen/Point2PointRoutability
refs/heads/master
/classes/mesh.py
from random import randint, shuffle import queue as Q import functools import operator from .node import Node class Mesh: def __init__(self, size_params, solver="A_star", height=8, terminals=None): # initialize the mesh basics self.params = size_params + [height] # parameters of the mesh ...
{"/make_plots.py": ["/common.py"], "/classes/simpleRouter.py": ["/classes/mesh.py", "/classes/gatherer.py"], "/fit_routability_parameters.py": ["/common.py"], "/fit_meshwise.py": ["/common.py"], "/calculate_routability.py": ["/common.py"], "/setup_experiment.py": ["/classes/mesh.py"], "/classes/mesh.py": ["/classes/nod...
48,807
rlhjansen/Point2PointRoutability
refs/heads/master
/run_experiment.py
import multiprocessing as mp import sys import argparse import datetime from common import read_config import classes.simpleRouter as r def router_generator(meshsize, netlist_length, pathlist_count, routings_per_pathlist, num_terminals=100): print("creating router objects for meshsize", meshsize, "netlist leng...
{"/make_plots.py": ["/common.py"], "/classes/simpleRouter.py": ["/classes/mesh.py", "/classes/gatherer.py"], "/fit_routability_parameters.py": ["/common.py"], "/fit_meshwise.py": ["/common.py"], "/calculate_routability.py": ["/common.py"], "/setup_experiment.py": ["/classes/mesh.py"], "/classes/mesh.py": ["/classes/nod...
48,808
rlhjansen/Point2PointRoutability
refs/heads/master
/classes/gatherer.py
import os from .mesh import file_to_mesh class Gatherer: def __init__(self, c, n, nX, x, y, routings_per_pathlist): self.c = c # mesh with c terminals self.n = n # netlist with n nets self.nX = nX # Xth netlist with n nets self.x = x self.y = y self.ro...
{"/make_plots.py": ["/common.py"], "/classes/simpleRouter.py": ["/classes/mesh.py", "/classes/gatherer.py"], "/fit_routability_parameters.py": ["/common.py"], "/fit_meshwise.py": ["/common.py"], "/calculate_routability.py": ["/common.py"], "/setup_experiment.py": ["/classes/mesh.py"], "/classes/mesh.py": ["/classes/nod...
48,817
avandriets/MultiUserBlog
refs/heads/master
/PostPage.py
""" Post managing module """ from google.appengine.ext import db from BaseHandler import BaseHandler from Comment import Comment, comment_key from NewPost import blog_key class PostPage(BaseHandler): """class handler for PostPage""" def get(self, post_id): """GET method to show post page """ ...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,818
avandriets/MultiUserBlog
refs/heads/master
/PostLike.py
""" Post liking module """ from google.appengine.ext import db from BaseHandler import BaseHandler from Like import Like, like_key from Post import blog_key class PostLike(BaseHandler): """Post liking handler class""" def post(self): """handle POST like request""" # redirect user to login pa...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,819
avandriets/MultiUserBlog
refs/heads/master
/DeleteComment.py
""" Module provide tools to delete comment from database """ from google.appengine.ext import db from BaseHandler import BaseHandler from Comment import comment_key from Post import blog_key class DeleteComment(BaseHandler): """ Delete comment render class provide methods to show interface for del...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,820
avandriets/MultiUserBlog
refs/heads/master
/Login.py
""" Login handler request module """ from User import User from BaseHandler import BaseHandler class Login(BaseHandler): """Login handler class to manage user login""" def get(self): """to show login method form""" self.render('login-form.html') def post(self): """handle POST log...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,821
avandriets/MultiUserBlog
refs/heads/master
/EditComment.py
"""Comment edit tols module""" from google.appengine.ext import db from BaseHandler import BaseHandler from Comment import comment_key from Post import blog_key class EditComment(BaseHandler): """Edit comment handler class""" def post(self): """POST edit comment""" # check if user have logi...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,822
avandriets/MultiUserBlog
refs/heads/master
/Comment.py
""" Comments model module describe Comment model """ from google.appengine.ext import db from BaseHandler import render_str from Post import Post from User import User def comment_key(name='default'): """Provide comment key method""" return db.Key.from_path('comments', name) class Comment(db.Model): """...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,823
avandriets/MultiUserBlog
refs/heads/master
/DeletePost.py
""" Module provide tools to delete post from database """ from google.appengine.ext import db from BaseHandler import BaseHandler from Post import blog_key class DeletePost(BaseHandler): """ Delete post render class provide methods to show interface for deleting post from db """ def post(self): ...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,824
avandriets/MultiUserBlog
refs/heads/master
/BlogFrontPage.py
""" Front Page module """ from BaseHandler import BaseHandler from Post import Post from User import User class BlogFrontPage(BaseHandler): """Front page class""" def get(self): """ GET method to render front page with posts list""" user_id = self.request.get('user_id', None) if user_...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,825
avandriets/MultiUserBlog
refs/heads/master
/NewPost.py
""" New post handler module """ from BaseHandler import BaseHandler from Post import Post, blog_key class NewPost(BaseHandler): """NewPost manage class""" def get(self): """GET method to show newpost form""" # check if user is in system or redirect to login page if self.user: ...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,826
avandriets/MultiUserBlog
refs/heads/master
/security.py
""" secure methods for cookies """ import hmac SECRET_KEY = 'ijxz135d#8b2+t1&5#_g_zu&5juj_(828-7cr6a&!0m' def make_secure_val(val): """make secure cookie""" return '%s|%s' % (val, hmac.new(SECRET_KEY, val).hexdigest()) def check_secure_val(secure_val): """check cookie""" val = secure_val.split('|')...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,827
avandriets/MultiUserBlog
refs/heads/master
/Like.py
""" Like handler module """ from google.appengine.ext import db from Post import Post from User import User def like_key(name='default'): """like key function""" return db.Key.from_path('likes', name) class Like(db.Model): """Like model class""" post = db.ReferenceProperty(Post, collection_name='lik...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,828
avandriets/MultiUserBlog
refs/heads/master
/Logout.py
""" Module manages logout process """ from BaseHandler import BaseHandler class Logout(BaseHandler): """Logout handler class""" def get(self): """logout and redirect to main page""" self.logout() self.redirect('/')
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,829
avandriets/MultiUserBlog
refs/heads/master
/Post.py
""" Post model describing module """ from google.appengine.ext import db from BaseHandler import render_str from User import User def blog_key(name='default'): """post key function""" return db.Key.from_path('blogs', name) class Post(db.Model): """Post model definition""" subject = db.StringProperty...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,830
avandriets/MultiUserBlog
refs/heads/master
/EditPost.py
""" Module provide tools to change post in DB """ from google.appengine.ext import db from BaseHandler import BaseHandler from Post import blog_key class EditPost(BaseHandler): """ Class provide tools to interact user with DB by html page """ def post(self): """method to handle edit post acti...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,831
avandriets/MultiUserBlog
refs/heads/master
/Registration.py
""" This module are used to register new user in the site """ from BaseHandler import BaseHandler from User import User import re # Regular expressions to check user input EMAIL_RE = re.compile(r'^[\S]+@[\S]+\.[\S]+$') USER_RE = re.compile(r"^[a-zA-Z0-9_-]{3,20}$") PASS_RE = re.compile(r"^.{3,20}$") def valid_userna...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,832
avandriets/MultiUserBlog
refs/heads/master
/Welcome.py
""" Welcome page handler module """ from BaseHandler import BaseHandler class Welcome(BaseHandler): """page handler""" def get(self): if self.user: self.render('welcome.html') else: self.redirect('/signup')
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,833
avandriets/MultiUserBlog
refs/heads/master
/main.py
""" Main dispatcher module """ import webapp2 from BaseHandler import BaseHandler from BlogFrontPage import BlogFrontPage from DeleteComment import DeleteComment from DeletePost import DeletePost from EditComment import EditComment from EditPost import EditPost from Login import Login from Logout import Logout from Ne...
{"/PostPage.py": ["/Comment.py", "/NewPost.py"], "/PostLike.py": ["/Like.py", "/Post.py"], "/DeleteComment.py": ["/Comment.py", "/Post.py"], "/EditComment.py": ["/Comment.py", "/Post.py"], "/Comment.py": ["/Post.py"], "/DeletePost.py": ["/Post.py"], "/BlogFrontPage.py": ["/Post.py"], "/NewPost.py": ["/Post.py"], "/Like...
48,836
D0cWhats0n/Foodrition_app
refs/heads/master
/foodrition_backend/foodrition_backend/views.py
from django.contrib.auth.models import User from rest_framework import viewsets from foodrition_api.models import Food, FoodImage from foodrition_api.serializers import UserSerializer, FoodSerializer from django.views.decorators.http import require_http_methods from rest_framework.parsers import FileUploadParser from r...
{"/foodrition_backend/foodrition_api/tests.py": ["/foodrition_backend/foodrition_api/services/ml_model.py"], "/foodrition_backend/foodrition_api/serializers.py": ["/foodrition_backend/foodrition_api/models.py"]}
48,837
D0cWhats0n/Foodrition_app
refs/heads/master
/foodrition_backend/foodrition_api/migrations/0003_foodimage.py
# Generated by Django 2.1.5 on 2019-02-11 13:22 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('foodrition_api', '0002_auto_20190206_1142'), ] operations = [ migrations.CreateModel( name='FoodImage', fields=[ ...
{"/foodrition_backend/foodrition_api/tests.py": ["/foodrition_backend/foodrition_api/services/ml_model.py"], "/foodrition_backend/foodrition_api/serializers.py": ["/foodrition_backend/foodrition_api/models.py"]}
48,838
D0cWhats0n/Foodrition_app
refs/heads/master
/foodrition_backend/foodrition_api/management/commands/init_food_table.py
from django.core.management.base import BaseCommand, CommandError from foodrition_api.models import Food from os.path import isfile import csv import pandas as pd import numpy as np class Command(BaseCommand): help = 'Initialises the food database using a .csv file.' def add_arguments(self, parser): ...
{"/foodrition_backend/foodrition_api/tests.py": ["/foodrition_backend/foodrition_api/services/ml_model.py"], "/foodrition_backend/foodrition_api/serializers.py": ["/foodrition_backend/foodrition_api/models.py"]}
48,839
D0cWhats0n/Foodrition_app
refs/heads/master
/foodrition_backend/foodrition_api/tests.py
from django.test import TestCase from .services.ml_model import ModelFactory from django.core.cache import cache class MLModelTest(TestCase): def test_loading_model_to_cache(self): model_map, model = ModelFactory.load_model_in_cache() assert(hasattr(model, 'predict')) assert(isinstance(mo...
{"/foodrition_backend/foodrition_api/tests.py": ["/foodrition_backend/foodrition_api/services/ml_model.py"], "/foodrition_backend/foodrition_api/serializers.py": ["/foodrition_backend/foodrition_api/models.py"]}
48,840
D0cWhats0n/Foodrition_app
refs/heads/master
/foodrition_backend/foodrition_api/services/ml_model.py
from keras.models import model_from_json from keras.applications.resnet50 import preprocess_input import json import cv2 from os.path import join, dirname import tensorflow as tf import numpy as np class food_prediction(): def __init__(self, pred_id: int, food_class: str, nutr_class: str, nutr_ndb_no: int): ...
{"/foodrition_backend/foodrition_api/tests.py": ["/foodrition_backend/foodrition_api/services/ml_model.py"], "/foodrition_backend/foodrition_api/serializers.py": ["/foodrition_backend/foodrition_api/models.py"]}
48,841
D0cWhats0n/Foodrition_app
refs/heads/master
/foodrition_backend/foodrition_api/serializers.py
from django.contrib.auth.models import User from .models import Food from rest_framework import serializers class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ('url', 'username', 'email') class FoodSerializer(serializers.HyperlinkedModelSerializer): ...
{"/foodrition_backend/foodrition_api/tests.py": ["/foodrition_backend/foodrition_api/services/ml_model.py"], "/foodrition_backend/foodrition_api/serializers.py": ["/foodrition_backend/foodrition_api/models.py"]}
48,842
D0cWhats0n/Foodrition_app
refs/heads/master
/foodrition_backend/foodrition_api/startup.py
from foodrition_api.services.ml_model import ModelFactory from django.contrib.auth.models import User from rest_framework.authtoken.models import Token from django.db import IntegrityError def foodrition_api_startup_func(): username = 'guest' password = 'bacon' try: guest_user = User.objects.creat...
{"/foodrition_backend/foodrition_api/tests.py": ["/foodrition_backend/foodrition_api/services/ml_model.py"], "/foodrition_backend/foodrition_api/serializers.py": ["/foodrition_backend/foodrition_api/models.py"]}
48,843
D0cWhats0n/Foodrition_app
refs/heads/master
/foodrition_backend/foodrition_api/migrations/0001_initial.py
# Generated by Django 2.1.5 on 2019-02-06 10:09 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Food', fields=[ ('id', models.AutoField(aut...
{"/foodrition_backend/foodrition_api/tests.py": ["/foodrition_backend/foodrition_api/services/ml_model.py"], "/foodrition_backend/foodrition_api/serializers.py": ["/foodrition_backend/foodrition_api/models.py"]}
48,844
D0cWhats0n/Foodrition_app
refs/heads/master
/foodrition_backend/foodrition_api/apps.py
from django.apps import AppConfig class FoodritionApiConfig(AppConfig): name = 'foodrition_api'
{"/foodrition_backend/foodrition_api/tests.py": ["/foodrition_backend/foodrition_api/services/ml_model.py"], "/foodrition_backend/foodrition_api/serializers.py": ["/foodrition_backend/foodrition_api/models.py"]}
48,845
D0cWhats0n/Foodrition_app
refs/heads/master
/foodrition_backend/foodrition_api/models.py
from django.db import models class Food(models.Model): ndb_no = models.IntegerField(null=False, unique=True) name = models.CharField(null=False, max_length=100) water_g = models.FloatField(null=True, blank=True) energy_kcal = models.IntegerField(null=True, blank=True) protein_g = models.FloatField...
{"/foodrition_backend/foodrition_api/tests.py": ["/foodrition_backend/foodrition_api/services/ml_model.py"], "/foodrition_backend/foodrition_api/serializers.py": ["/foodrition_backend/foodrition_api/models.py"]}