index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
10,894
callidus/playbot
refs/heads/master
/playbot/bot.py
from __future__ import absolute_import from __future__ import print_function import irc.bot import logging import re import ssl import time logger = logging.getLogger(__name__) class PlayBot(irc.bot.SingleServerIRCBot): def __init__(self, channels, nickname, password, server, port=6667, force...
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,895
callidus/playbot
refs/heads/master
/playbot/plugins/link_peek.py
from __future__ import absolute_import import re from six.moves.urllib import request def peek(bot, c, e): msg = e.arguments[0].strip() msg = re.search("(http[^ ]*)", msg) if msg is None: return url = msg.group(1) req = request.Request(url) response = request.urlopen(req) the_pag...
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,905
a1600012888/AdversarialTraining
refs/heads/master
/experiments/CIFAR10/trades.train/network.py
import config from base_model.cifar_resnet18 import cifar_resnet18 def create_network(): net = cifar_resnet18(num_class = 10, expansion = 1) return net if __name__ == '__main__': net = create_network() print(net)
{"/lib/attack/__init__.py": ["/lib/attack/attack_base.py"]}
10,906
a1600012888/AdversarialTraining
refs/heads/master
/experiments/CIFAR10/cosine.adv.train/config.py
from easydict import EasyDict import sys import os import argparse import numpy as np import torch import torch.nn.functional as F def add_path(path): if path not in sys.path: print('Adding {}'.format(path)) sys.path.append(path) abs_current_path = os.path.realpath('./') root_path = os.path.join('...
{"/lib/attack/__init__.py": ["/lib/attack/attack_base.py"]}
10,907
a1600012888/AdversarialTraining
refs/heads/master
/lib/attack/__init__.py
from .attack_base import clip_eta
{"/lib/attack/__init__.py": ["/lib/attack/attack_base.py"]}
10,908
a1600012888/AdversarialTraining
refs/heads/master
/experiments/CIFAR10/natural.train/eval.py
from config import config from dataset import create_test_dataset from network import create_network from training.train import eval_one_epoch from utils.misc import load_checkpoint import argparse import torch import numpy as np import os parser = argparse.ArgumentParser() parser.add_argument('--resume', '--resume'...
{"/lib/attack/__init__.py": ["/lib/attack/attack_base.py"]}
10,909
a1600012888/AdversarialTraining
refs/heads/master
/lib/training/config.py
from abc import ABCMeta, abstractproperty, abstractmethod from typing import Tuple, List, Dict import os import sys import torch class TrainingConfigBase(metaclass=ABCMeta): ''' Base class for training ''' # directory handling @property def abs_current_dir(self): return os.path.realpa...
{"/lib/attack/__init__.py": ["/lib/attack/attack_base.py"]}
10,910
a1600012888/AdversarialTraining
refs/heads/master
/lib/attack/attack_base.py
import torch import numpy as np from abc import ABCMeta, abstractmethod, abstractproperty class AttackBase(metaclass=ABCMeta): @abstractmethod def attack(self, net, inp, label, target = None): ''' :param inp: batched images :param target: specify the indexes of target class, None repre...
{"/lib/attack/__init__.py": ["/lib/attack/attack_base.py"]}
10,911
a1600012888/AdversarialTraining
refs/heads/master
/lib/training/train.py
import os import sys father_dir = os.path.join('/', *os.path.realpath(__file__).split(os.path.sep)[:-2]) #print(father_dir) if not father_dir in sys.path: sys.path.append(father_dir) from utils.misc import torch_accuracy, AvgMeter from collections import OrderedDict import torch from tqdm import tqdm def train_on...
{"/lib/attack/__init__.py": ["/lib/attack/attack_base.py"]}
10,912
a1600012888/AdversarialTraining
refs/heads/master
/experiments/CIFAR10/adversarial.train/network.py
import config from base_model.cifar_resnet18 import cifar_resnet18 def create_network(): net = cifar_resnet18() return net if __name__ == '__main__': net = create_network() print(net)
{"/lib/attack/__init__.py": ["/lib/attack/attack_base.py"]}
10,913
a1600012888/AdversarialTraining
refs/heads/master
/experiments/CIFAR10/trades.train/config.py
from easydict import EasyDict import sys import os import argparse import numpy as np import torch def add_path(path): if path not in sys.path: print('Adding {}'.format(path)) sys.path.append(path) abs_current_path = os.path.realpath('./') root_path = os.path.join('/', *abs_current_path.split(os.p...
{"/lib/attack/__init__.py": ["/lib/attack/attack_base.py"]}
10,914
a1600012888/AdversarialTraining
refs/heads/master
/lib/attack/pgd.py
''' Reference: [1] Towards Deep Learning Models Resistant to Adversarial Attacks Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, Adrian Vladu arXiv:1706.06083v3 ''' import torch import numpy as np import os import sys father_dir = os.path.join('/', *os.path.realpath(__file__).split(os.path.sep)[...
{"/lib/attack/__init__.py": ["/lib/attack/attack_base.py"]}
10,915
a1600012888/AdversarialTraining
refs/heads/master
/experiments/CIFAR10/trades.train/training_function.py
import os import sys import config from utils.misc import torch_accuracy, AvgMeter from collections import OrderedDict import torch from tqdm import tqdm import torch.nn.functional as F def train_one_epoch(net, batch_generator, optimizer, criterion, DEVICE=torch.device('cuda:0'), ...
{"/lib/attack/__init__.py": ["/lib/attack/attack_base.py"]}
10,916
anshuman73/facematch
refs/heads/master
/app.py
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_admin import Admin import face_match app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://postgres:No1cancrackthis@localhost:5432/facematch' app.config['UPLOAD_FOLDER'] = '/uploads' app.config['SQLALCHEMY_TRACK_MODIFICATIO...
{"/app.py": ["/face_match.py", "/views.py", "/models.py", "/admin.py"], "/views.py": ["/app.py", "/models.py", "/face_match.py"], "/admin.py": ["/app.py", "/models.py"], "/models.py": ["/app.py"]}
10,917
anshuman73/facematch
refs/heads/master
/views.py
from app import app, db from flask import session, redirect, url_for, render_template, abort, request, flash from forms import LoginForm from models import Student, Teacher, Course, Class, Attendance import os from werkzeug.utils import secure_filename from face_match import give_match ALLOWED_EXTENSIONS = ['png', 'j...
{"/app.py": ["/face_match.py", "/views.py", "/models.py", "/admin.py"], "/views.py": ["/app.py", "/models.py", "/face_match.py"], "/admin.py": ["/app.py", "/models.py"], "/models.py": ["/app.py"]}
10,918
anshuman73/facematch
refs/heads/master
/admin.py
from app import admin, db from flask_admin.contrib.sqla import ModelView from models import Student, Teacher, Course, Class, Attendance admin.add_view(ModelView(Student, db.session)) admin.add_view(ModelView(Teacher, db.session)) admin.add_view(ModelView(Course, db.session)) admin.add_view(ModelView(Class, db.session)...
{"/app.py": ["/face_match.py", "/views.py", "/models.py", "/admin.py"], "/views.py": ["/app.py", "/models.py", "/face_match.py"], "/admin.py": ["/app.py", "/models.py"], "/models.py": ["/app.py"]}
10,919
anshuman73/facematch
refs/heads/master
/face_match.py
import face_recognition from PIL import Image import numpy as np import os known_faces = [] known_faces_names = [] working_dir = os.getcwd() + '/' + 'Faces' for file in os.listdir(working_dir): known_faces.append((face_recognition.face_encodings(face_recognition.load_image_file(working_dir + '/' + file))[0])) ...
{"/app.py": ["/face_match.py", "/views.py", "/models.py", "/admin.py"], "/views.py": ["/app.py", "/models.py", "/face_match.py"], "/admin.py": ["/app.py", "/models.py"], "/models.py": ["/app.py"]}
10,920
anshuman73/facematch
refs/heads/master
/models.py
from app import db class User(object): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.UnicodeText, unique=True) full_name = db.Column(db.UnicodeText) class Teacher(db.Model, User): courses_taught = db.relationship('Course', backref='teacher', lazy=True) courses = db.Table('co...
{"/app.py": ["/face_match.py", "/views.py", "/models.py", "/admin.py"], "/views.py": ["/app.py", "/models.py", "/face_match.py"], "/admin.py": ["/app.py", "/models.py"], "/models.py": ["/app.py"]}
10,947
rigas-IC/2D_LANGEVIN_RL_CONTROL
refs/heads/master
/EVAL_ENV.py
from LANGEVIN2D_ENV import Langevin2D_Env import numpy as np import matplotlib.pyplot as plt from scipy import signal # Environment Parameters env_params = { "dt": 0.0005, "T" : 100.0, "a" : 1.0 +1.0j, "b" : -5.0e2, "D" : 0.0e-4, ...
{"/EVAL_ENV.py": ["/LANGEVIN2D_ENV.py"], "/TRAIN_AGENT.py": ["/LANGEVIN2D_ENV.py"]}
10,948
rigas-IC/2D_LANGEVIN_RL_CONTROL
refs/heads/master
/TRAIN_AGENT.py
import os import sys import numpy as np import json from tensorforce.agents import Agent from tensorforce.environments import Environment from tensorforce.execution import Runner from LANGEVIN2D_ENV import Langevin2D_Env ############################################################################### # PARAMETE...
{"/EVAL_ENV.py": ["/LANGEVIN2D_ENV.py"], "/TRAIN_AGENT.py": ["/LANGEVIN2D_ENV.py"]}
10,949
rigas-IC/2D_LANGEVIN_RL_CONTROL
refs/heads/master
/LANGEVIN2D_ENV.py
import numpy as np from tensorforce.environments import Environment class Langevin2D_Env(Environment): ''' Defines the parameters for the 2D Langevin Stuart Landau equation dt (float) - time step for dynamics evolution - default: 0.0005 T (float) - total simulation time - default: 1...
{"/EVAL_ENV.py": ["/LANGEVIN2D_ENV.py"], "/TRAIN_AGENT.py": ["/LANGEVIN2D_ENV.py"]}
10,951
F4R4N/film-review
refs/heads/main
/contactus/urls.py
from django.urls import path from .views import CreateForm, AdminContactReader, AdminSendMassEmail app_name = "contact" urlpatterns = [ path("contact/", CreateForm.as_view()), path("admin/contact/", AdminContactReader.as_view()), path("admin/contact/<int:year>/<int:month>/", AdminContactReader.as_view()), path("a...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,952
F4R4N/film-review
refs/heads/main
/config/urls.py
from django.contrib import admin from django.urls import path, include from . import settings from django.conf.urls.static import static from rest_framework import permissions from drf_yasg import openapi from drf_yasg.views import get_schema_view schema_view = get_schema_view( openapi.Info( title="Film Review Api...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,953
F4R4N/film-review
refs/heads/main
/blog/views.py
from rest_framework.response import Response from rest_framework import status, permissions, generics from rest_framework.views import APIView from django.shortcuts import get_object_or_404 from .models import Post, Tag, Comment from api.models import Group from .serializers import PostSerializer, DemoPostSerializer, C...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,954
F4R4N/film-review
refs/heads/main
/api/views_utils.py
from django.shortcuts import get_object_or_404 from .models import Group from itertools import chain def all_movies_in_group(key): group = get_object_or_404(Group, key=key) all_profiles = group.profile_set.all() all_group_movies = [] for profile in all_profiles: user_movies = profile.user.movie.filter(watched=F...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,955
F4R4N/film-review
refs/heads/main
/contactus/utils.py
import string import random def get_client_ip(request): x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR') if x_forwarded_for: ip = x_forwarded_for.split(',')[0] else: ip = request.META.get('REMOTE_ADDR') return ip def random_key(): all_digits = list(string.digits) random_key = "" return random_k...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,956
F4R4N/film-review
refs/heads/main
/customauth/models.py
from django.db import models from django.contrib.auth.models import User from api.models import Group from api.utils import profile_image, random_key class Profile(models.Model): key = models.CharField( max_length=16, default=random_key, unique=True, blank=False, null=False) user = models.OneToOneField( User, ...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,957
F4R4N/film-review
refs/heads/main
/blog/serializers.py
from rest_framework import serializers from .models import Post, Tag, Comment from django.contrib.auth.models import User class TagSerializer(serializers.ModelSerializer): class Meta: model = Tag fields = ("name", "slug") class AuthorSerializer(serializers.ModelSerializer): """ needed data from ahtor to sen...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,958
F4R4N/film-review
refs/heads/main
/contactus/serializers.py
from rest_framework import serializers from .models import Contact class ContactSerializer(serializers.ModelSerializer): class Meta: model = Contact fields = ( "key", "name", "email", "subject", "text", "phone_number", "address", "datetime", "ip", "is_readed")
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,959
F4R4N/film-review
refs/heads/main
/api/utils.py
import random import string from datetime import datetime def profile_image(instance, filename): username = instance.user.username date_time = datetime.now().strftime("%Y_%m_%d,%H:%M:%S") saved_file_name = username + "-" + date_time + ".jpg" return 'profile/{0}/{1}'.format(instance.user.username, saved_file_name)...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,960
F4R4N/film-review
refs/heads/main
/contactus/views.py
from rest_framework import permissions, status from rest_framework.response import Response from rest_framework.views import APIView from django.core.mail import EmailMessage from django.shortcuts import get_object_or_404 from django.contrib.auth.models import User from .models import Contact, MassEmail from .utils imp...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,961
F4R4N/film-review
refs/heads/main
/api/serializers.py
from rest_framework import serializers from .models import Group, Movie from django.contrib.auth.models import User from customauth.models import Profile class AdminSerializer(serializers.ModelSerializer): """ used as base of admin field in MovieSerializer and GroupSerializer serializers only retrive admin usern...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,962
F4R4N/film-review
refs/heads/main
/customauth/serializers.py
from rest_framework import serializers from rest_framework.validators import UniqueValidator from django.contrib.auth.models import User from django.contrib.auth.password_validation import validate_password from .models import Profile from rest_framework_simplejwt.tokens import RefreshToken from rest_framework_simple...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,963
F4R4N/film-review
refs/heads/main
/customauth/urls.py
from django.urls import path from .views import ( RegisterView, ChangePasswordView, UpdateProfileView, LogoutView, UpdateUserImageView, DeleteProfileView, ForgotPasswordView, ValidateConfirmationCodeView, ResetPasswordView, UserLoginView, GetUserProfile) from rest_framework_simplejwt.views import TokenR...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,964
F4R4N/film-review
refs/heads/main
/blog/utils.py
import datetime from rest_framework import pagination def post_images(instance, filename): """ specify proper path to store posts images in the following format profile/{post_author_username}/post/{date_and_time in following format (%y-%m-%d.%H-%M-%S)} """ date_and_time = datetime.datetime.now().strftime("...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,965
F4R4N/film-review
refs/heads/main
/api/views.py
from rest_framework import permissions, status from rest_framework.views import APIView from rest_framework.response import Response from django.shortcuts import get_object_or_404 from .serializers import ( GroupSerializer, MovieSerializer, GroupMemberSerializer ) from .models import Group, Movie from .views_utils im...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,966
F4R4N/film-review
refs/heads/main
/contactus/settings_loader.py
from rest_framework.exceptions import ValidationError DEFAULT_CONTACT_US_SETTINGS = { 'APP_NAME': None, 'SEND_MAIL': False, 'MAIL_SUBJECT': " Contact Us ", 'MESSAGE': "\nwe got your email. we will respond as soon as possible.\n\nBest Regards, " } try: from django.conf import settings except ImportError: print("a...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,967
F4R4N/film-review
refs/heads/main
/blog/admin.py
from django.contrib import admin from .models import Post, Tag, Comment @admin.register(Post) class PostAdmin(admin.ModelAdmin): list_display = ("title", "author", "key", "visibility", "created", "visits") list_editable = ("visibility", "visits") @admin.register(Tag) class TagAdmin(admin.ModelAdmin): list_displa...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,968
F4R4N/film-review
refs/heads/main
/api/urls.py
from .views import ( CreateGroupView, EditAndDeleteGroupView, EditAndDeleteMovieView, CreateAndGetMovieView, GetRandomMovieView, SubmitMovieView, AllUserGroups, AllGroupMembersProfile, GenerateInviteCode, JoinGroup, LeaveGroup ) from django.urls import path app_name = "api" urlpatterns = [ path("group/add/", Crea...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,969
F4R4N/film-review
refs/heads/main
/contactus/models.py
from django.db import models from .utils import random_key class ReadedManager(models.Manager): def get_queryset(self): return super(ReadedManager, self).get_queryset().filter(is_readed=True) class Contact(models.Model): key = models.CharField(default=random_key, unique=True, max_length=13) name = models.CharF...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,970
F4R4N/film-review
refs/heads/main
/api/models.py
from django.db import models from .utils import random_key, invite_code, group_image from django.contrib.auth.models import User from django.core.validators import MinValueValidator, MaxValueValidator import datetime class Movie(models.Model): key = models.CharField(max_length=15, default=random_key, unique=True) ...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,971
F4R4N/film-review
refs/heads/main
/api/admin.py
from django.contrib import admin from .models import Group, Movie @admin.register(Group) class GroupAdmin(admin.ModelAdmin): list_display = ( "name", "key", "meeting_detail", "movie_of_the_week", "admin", "invite_code") list_editable = ("meeting_detail", ) search_fields = ("name", "meeting_detail") @admin.reg...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,972
F4R4N/film-review
refs/heads/main
/blog/models.py
from django.db import models from api.utils import random_key from django.contrib.auth.models import User from .utils import post_images from django.utils.text import slugify class Tag(models.Model): name = models.CharField(max_length=50, unique=True) slug = models.SlugField(unique=True) def __str__(self): retu...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,973
F4R4N/film-review
refs/heads/main
/config/settings.py
from pathlib import Path from datetime import timedelta import os from .config import CONFIG_SECRET_KEY, CONFIG_DEBUG, EMAIL, SMTP, PASSWORD BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = CONFIG_SECRET_KEY DEBUG = CONFIG_DEBUG ALLOWED_HOSTS = ["*"] # Application definition INSTALLED_APPS = [ '...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,974
F4R4N/film-review
refs/heads/main
/customauth/views.py
from django.contrib.auth.models import User from django.shortcuts import get_object_or_404 from django.contrib.auth.password_validation import validate_password from django.core.exceptions import ValidationError from django.core.mail import EmailMessage from django.core.validators import validate_email from .models im...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,975
F4R4N/film-review
refs/heads/main
/blog/urls.py
from django.urls import path from .views import ( CreateAndGetUserPost, EditAndDeletePost, AllPublicPostsPaginated, DesiredPost, GroupPublicPostsPaginated, CreateComment, EditAndDeleteComment) app_name = "blog" urlpatterns = [ path("post/", CreateAndGetUserPost.as_view()), path("post/<str:post_key>/", EditAndDele...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
10,976
F4R4N/film-review
refs/heads/main
/customauth/admin.py
from django.contrib import admin from .models import Profile from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User @admin.register(Profile) class ProfileAdmin(admin.ModelAdmin): list_display = ("user", "image", "key", ) # changed list_display and list_editable but keep default...
{"/contactus/urls.py": ["/contactus/views.py"], "/blog/views.py": ["/blog/models.py", "/api/models.py", "/blog/serializers.py", "/blog/utils.py"], "/api/views_utils.py": ["/api/models.py"], "/customauth/models.py": ["/api/models.py", "/api/utils.py"], "/blog/serializers.py": ["/blog/models.py"], "/contactus/serializers...
11,023
haw230/dynamic-fibonacci
refs/heads/master
/tests/test_main.py
# -*- coding: utf-8 -*- import sys sys.path.insert(0, '/home/ubuntu/workspace/dynamic_fibonacci') #change this to correct folder name sys.path.insert(0, '/home/ubuntu/workspace/solution') from main import fib #change to proper function name from solution import solved_fib #change to proper function name from time imp...
{"/tests/test_main.py": ["/solution/__init__.py"]}
11,024
haw230/dynamic-fibonacci
refs/heads/master
/solution/solution.py
memo = {} def solved_fib(n): if(n < 2): return 1 if(n in memo): return memo[n] memo[n] = solved_fib(n - 1) + solved_fib(n - 2) return memo[n]
{"/tests/test_main.py": ["/solution/__init__.py"]}
11,025
haw230/dynamic-fibonacci
refs/heads/master
/solution/__init__.py
#obligatory __init__.py so Python knows to look here
{"/tests/test_main.py": ["/solution/__init__.py"]}
11,026
GustavoAT/back-end-challenge-2021
refs/heads/master
/tests/test_endpoints.py
from typing import List from fastapi.testclient import TestClient from app.main import app client = TestClient(app) def test_main(): '''Test root of API''' response = client.get('/') assert response.status_code == 200 assert response.json()['message'] == 'REST Back-end Challenge 20201209 Running' ...
{"/tests/test_endpoints.py": ["/app/main.py"], "/app/persistence/userDAO.py": ["/app/persistence/security/hash.py"], "/app/apiclient/randomuser.py": ["/app/persistence/models.py", "/app/persistence/pdmodels.py", "/app/persistence/database.py", "/app/persistence/userDAO.py", "/app/persistence/pagDAO.py"], "/app/persiste...
11,027
GustavoAT/back-end-challenge-2021
refs/heads/master
/app/persistence/userDAO.py
from sqlalchemy.orm import Session from sqlalchemy import update from . import models, pdmodels from .security.hash import create_salt, get_hashed_password def get_user(db: Session, user_id: int): return db.query(models.User).filter(models.User.id == user_id).first() def get_user_by_unique_data(db: Session, use...
{"/tests/test_endpoints.py": ["/app/main.py"], "/app/persistence/userDAO.py": ["/app/persistence/security/hash.py"], "/app/apiclient/randomuser.py": ["/app/persistence/models.py", "/app/persistence/pdmodels.py", "/app/persistence/database.py", "/app/persistence/userDAO.py", "/app/persistence/pagDAO.py"], "/app/persiste...
11,028
GustavoAT/back-end-challenge-2021
refs/heads/master
/app/persistence/database.py
from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from ..settings import SQLALCHEMY_DATABASE_URL if 'sqlite://' in SQLALCHEMY_DATABASE_URL: engine = create_engine( SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread":...
{"/tests/test_endpoints.py": ["/app/main.py"], "/app/persistence/userDAO.py": ["/app/persistence/security/hash.py"], "/app/apiclient/randomuser.py": ["/app/persistence/models.py", "/app/persistence/pdmodels.py", "/app/persistence/database.py", "/app/persistence/userDAO.py", "/app/persistence/pagDAO.py"], "/app/persiste...
11,029
GustavoAT/back-end-challenge-2021
refs/heads/master
/app/apiclient/randomuser.py
import sys import requests from pydantic import parse_obj_as from ..persistence.models import Pag from ..persistence.pdmodels import UserCreate from ..persistence.database import SessionLocal from ..persistence.userDAO import upsert_user from ..persistence.pagDAO import get_first_pag, create_pag from datetime import da...
{"/tests/test_endpoints.py": ["/app/main.py"], "/app/persistence/userDAO.py": ["/app/persistence/security/hash.py"], "/app/apiclient/randomuser.py": ["/app/persistence/models.py", "/app/persistence/pdmodels.py", "/app/persistence/database.py", "/app/persistence/userDAO.py", "/app/persistence/pagDAO.py"], "/app/persiste...
11,030
GustavoAT/back-end-challenge-2021
refs/heads/master
/app/persistence/models.py
import sys from sqlalchemy import Column, Integer, String, Enum, Float from sqlalchemy import DateTime, SmallInteger from .database import Base, engine from .enumerators import GendersEnum, StatusEnum class User(Base): __tablename__ = "users" id = Column(Integer, primary_key=True, index=True) gender = Co...
{"/tests/test_endpoints.py": ["/app/main.py"], "/app/persistence/userDAO.py": ["/app/persistence/security/hash.py"], "/app/apiclient/randomuser.py": ["/app/persistence/models.py", "/app/persistence/pdmodels.py", "/app/persistence/database.py", "/app/persistence/userDAO.py", "/app/persistence/pagDAO.py"], "/app/persiste...
11,031
GustavoAT/back-end-challenge-2021
refs/heads/master
/app/settingsexample.py
""" Environment settings Edit database credentials user, password, host and database on the url, the APIkey and so on, then rename the file to 'settings.py'. The url is for MySQL, to use other database engines, search documentation on SQLAlchemy: https://docs.sqlalchemy.org/en/14/dialects/index.html """ #Use format:...
{"/tests/test_endpoints.py": ["/app/main.py"], "/app/persistence/userDAO.py": ["/app/persistence/security/hash.py"], "/app/apiclient/randomuser.py": ["/app/persistence/models.py", "/app/persistence/pdmodels.py", "/app/persistence/database.py", "/app/persistence/userDAO.py", "/app/persistence/pagDAO.py"], "/app/persiste...
11,032
GustavoAT/back-end-challenge-2021
refs/heads/master
/app/routes/users.py
from typing import List from fastapi import APIRouter from fastapi import Depends, HTTPException from fastapi.param_functions import Header from sqlalchemy.orm import Session from ..persistence.database import SessionLocal from ..persistence import pdmodels, userDAO from ..settings import API_KEY router = APIRouter()...
{"/tests/test_endpoints.py": ["/app/main.py"], "/app/persistence/userDAO.py": ["/app/persistence/security/hash.py"], "/app/apiclient/randomuser.py": ["/app/persistence/models.py", "/app/persistence/pdmodels.py", "/app/persistence/database.py", "/app/persistence/userDAO.py", "/app/persistence/pagDAO.py"], "/app/persiste...
11,033
GustavoAT/back-end-challenge-2021
refs/heads/master
/app/persistence/pagDAO.py
from sqlalchemy.orm import Session from .models import Pag def get_pag(db: Session, pag_id: int): return db.query(Pag).filter(Pag.id == pag_id).first() def get_first_pag(db: Session): return db.query(Pag).first() def create_pag(db: Session, pagination: Pag): db.add(pagination) db.commit() db.r...
{"/tests/test_endpoints.py": ["/app/main.py"], "/app/persistence/userDAO.py": ["/app/persistence/security/hash.py"], "/app/apiclient/randomuser.py": ["/app/persistence/models.py", "/app/persistence/pdmodels.py", "/app/persistence/database.py", "/app/persistence/userDAO.py", "/app/persistence/pagDAO.py"], "/app/persiste...
11,034
GustavoAT/back-end-challenge-2021
refs/heads/master
/app/main.py
from fastapi import FastAPI from .routes import users app = FastAPI() app.include_router(users.router) @app.get('/') async def root(): return {'message': 'REST Back-end Challenge 20201209 Running'}
{"/tests/test_endpoints.py": ["/app/main.py"], "/app/persistence/userDAO.py": ["/app/persistence/security/hash.py"], "/app/apiclient/randomuser.py": ["/app/persistence/models.py", "/app/persistence/pdmodels.py", "/app/persistence/database.py", "/app/persistence/userDAO.py", "/app/persistence/pagDAO.py"], "/app/persiste...
11,035
GustavoAT/back-end-challenge-2021
refs/heads/master
/app/persistence/enumerators.py
from enum import Enum class GendersEnum(str, Enum): male = 'male' female = 'female' class StatusEnum(str, Enum): draft = 'draft' trash = 'trash' published = 'published'
{"/tests/test_endpoints.py": ["/app/main.py"], "/app/persistence/userDAO.py": ["/app/persistence/security/hash.py"], "/app/apiclient/randomuser.py": ["/app/persistence/models.py", "/app/persistence/pdmodels.py", "/app/persistence/database.py", "/app/persistence/userDAO.py", "/app/persistence/pagDAO.py"], "/app/persiste...
11,036
GustavoAT/back-end-challenge-2021
refs/heads/master
/app/persistence/pdmodels.py
from datetime import datetime from typing import Optional from pydantic import BaseModel from .enumerators import GendersEnum, StatusEnum class UserBase(BaseModel): gender: GendersEnum name_title: Optional[str] = None name_first: Optional[str] = None name_last: Optional[str] = None location_street...
{"/tests/test_endpoints.py": ["/app/main.py"], "/app/persistence/userDAO.py": ["/app/persistence/security/hash.py"], "/app/apiclient/randomuser.py": ["/app/persistence/models.py", "/app/persistence/pdmodels.py", "/app/persistence/database.py", "/app/persistence/userDAO.py", "/app/persistence/pagDAO.py"], "/app/persiste...
11,037
GustavoAT/back-end-challenge-2021
refs/heads/master
/app/persistence/security/hash.py
"""Hash and cryptografy functions. Helper on password and secrets security; """ import string from hashlib import sha256 import secrets ALPHABET = string.ascii_letters + string.digits def get_hashed_password(password: str, salt: str): salted_password = password + salt return sha256(salted_password.enco...
{"/tests/test_endpoints.py": ["/app/main.py"], "/app/persistence/userDAO.py": ["/app/persistence/security/hash.py"], "/app/apiclient/randomuser.py": ["/app/persistence/models.py", "/app/persistence/pdmodels.py", "/app/persistence/database.py", "/app/persistence/userDAO.py", "/app/persistence/pagDAO.py"], "/app/persiste...
11,038
messente/verigator-python
refs/heads/master
/messente/verigator/routes.py
URL = "https://api.verigator.com" CREATE_SERVICE = "v1/service/service" GET_SERVICE = "v1/service/service/{}" DELETE_SERVICE = "v1/service/service/{}" GET_USERS = "v1/service/service/{}/users" GET_USER = "v1/service/service/{}/users/{}" CREATE_USER = "v1/service/service/{}/users" DELETE_USER = "v1/service/service/{}/u...
{"/examples/example.py": ["/messente/verigator/api.py"]}
11,039
messente/verigator-python
refs/heads/master
/messente/verigator/test/test_users.py
from unittest import TestCase from mock import MagicMock from messente.verigator import routes, client, controllers, exceptions class TestUsers(TestCase): def setUp(self): self.rest_client = client.RestClient("http://test", "test", "test") self.users = controllers.Users(self.rest_client) ...
{"/examples/example.py": ["/messente/verigator/api.py"]}
11,040
messente/verigator-python
refs/heads/master
/messente/verigator/client.py
import requests from messente.verigator import exceptions class RestClient(object): """Simple http client that handles authentication and content-type by default for post and put calls. Default headers are content-type: application/json and accept: application/json, however they can be override ...
{"/examples/example.py": ["/messente/verigator/api.py"]}
11,041
messente/verigator-python
refs/heads/master
/messente/verigator/test/test_api.py
from unittest import TestCase from messente.verigator import api class ApiTest(TestCase): def setUp(self): self.api = api.Api("", "") def test_contains_required_libs(self): self.assertTrue(self.api.auth) self.assertTrue(self.api.services) self.assertTrue(self.api.users)
{"/examples/example.py": ["/messente/verigator/api.py"]}
11,042
messente/verigator-python
refs/heads/master
/examples/example.py
from messente.verigator.api import Api # initialize api api = Api("username", "password") # create example service service = api.services.create("http://example.com", "service_name") # add user to the created service user = api.users.create(service.id, "+xxxxxxxxxxx", "username") # initiate sms authentication, you ...
{"/examples/example.py": ["/messente/verigator/api.py"]}
11,043
messente/verigator-python
refs/heads/master
/messente/verigator/test/test_services.py
from unittest import TestCase from mock import MagicMock from messente.verigator import routes, client, controllers, exceptions class TestServices(TestCase): def setUp(self): self.rest_client = client.RestClient("https://test", "test", "test") self.services = controllers.Services(self.rest_clien...
{"/examples/example.py": ["/messente/verigator/api.py"]}
11,044
messente/verigator-python
refs/heads/master
/messente/verigator/test/test_auth.py
from unittest import TestCase from mock import MagicMock from messente.verigator import client, controllers, routes class TestAuth(TestCase): def setUp(self): self.rest_client = client.RestClient("http://test", "test", "test") self.auth = controllers.Auth(self.rest_client) self.sms_init_...
{"/examples/example.py": ["/messente/verigator/api.py"]}
11,045
messente/verigator-python
refs/heads/master
/messente/verigator/controllers.py
""" Controllers module of the api """ import sys from functools import wraps from messente.verigator import routes, models, client PY2 = sys.version_info.major == 2 def _validate_input(func): # decorator for validating that passed arguments are all string @wraps(func) def wrapper(*args): for ar...
{"/examples/example.py": ["/messente/verigator/api.py"]}
11,046
messente/verigator-python
refs/heads/master
/messente/verigator/models.py
class Service(object): """ Attributes: id (str): unique id creation_time (str): creation time name (str): name of the service """ def __init__(self, id, creation_time, name): self.id = id self.creation_time = creation_time self.name = name class User(o...
{"/examples/example.py": ["/messente/verigator/api.py"]}
11,047
messente/verigator-python
refs/heads/master
/messente/verigator/api.py
""" Api description """ from messente.verigator import routes, client, controllers class Api(object): """Main class for verigator api, contains references to other controllers Attributes: services (controllers.Services): controller for service resource users (controllers.Users): control...
{"/examples/example.py": ["/messente/verigator/api.py"]}
11,048
messente/verigator-python
refs/heads/master
/setup.py
# -*- coding: utf-8 -*- from setuptools import setup setup( name="verigator", version="1.0.4", packages=["messente.verigator"], setup_requires=["requests==2.18.4"], install_requires=["requests==2.18.4"], tests_require=["requests-mock==1.3.0", "mock==2.0.0"], author="Verigator.com", aut...
{"/examples/example.py": ["/messente/verigator/api.py"]}
11,049
messente/verigator-python
refs/heads/master
/messente/verigator/test/test_restClient.py
from unittest import TestCase import requests_mock from messente.verigator import exceptions, client @requests_mock.mock() class TestRestClient(TestCase): def setUp(self): self.rest_client = client.RestClient("http://test", "test", "test") self.valid_headers = { "X-Service-Auth": "te...
{"/examples/example.py": ["/messente/verigator/api.py"]}
11,050
messente/verigator-python
refs/heads/master
/messente/verigator/exceptions.py
""" Exceptions module of the api """ class VerigatorError(Exception): """ Base error class for all verigator related errors. """ def __init__(self, code, message): super(VerigatorError, self).__init__(message) self.code = code self.message = message class InvalidDataError(Ve...
{"/examples/example.py": ["/messente/verigator/api.py"]}
11,110
Oliver0047/Campus-Chatbot
refs/heads/master
/preprocessing.py
# -*- coding: UTF-8 -*- #autor:Oliver import jieba class preprocessing(): __PAD__ = 0#填充符 __EOS__ = 1#结束符 __GO__ = 2#开始符 __UNK__ = 3#未知符 vocab = ['__PAD__', '__EOS__', '__GO__','__UNK__'] def __init__(self): self.encoderFile = "./data/question.txt"#问题 self.decoderFile = "./data/...
{"/html2py.py": ["/seq2seq.py"]}
11,111
Oliver0047/Campus-Chatbot
refs/heads/master
/html2py.py
# -*- coding: UTF-8 -*- #autor:Oliver from flask import jsonify import json from seq2seq import seq2seq from flask import Flask, render_template, request import warnings warnings.filterwarnings("ignore") import sys sys.path.append('.') chat=seq2seq() app = Flask('chatbot') @app.route('/') def gethtml(): chat.pr...
{"/html2py.py": ["/seq2seq.py"]}
11,112
Oliver0047/Campus-Chatbot
refs/heads/master
/seq2seq.py
# -*- coding: UTF-8 -*- #autor:Oliver import os import random import sys import time import jieba import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F from torch import optim from torch.autograd import Variable import sys sys.path.append('.') USE_CUDA = torch.cuda.is...
{"/html2py.py": ["/seq2seq.py"]}
11,113
nicktimko/technicolor-clippy
refs/heads/master
/technicolor/format.py
import sys import time from pygments import highlight from pygments.lexers import PythonLexer from pygments.formatters import HtmlFormatter import win32clipboard from .html_clipboard import HtmlClipboard, put_html def highlight_python(snippet): return highlight(snippet, PythonLexer(), HtmlFormatter(noclasses=Tr...
{"/technicolor/format.py": ["/technicolor/html_clipboard.py"]}
11,114
nicktimko/technicolor-clippy
refs/heads/master
/technicolor/html_clipboard.py
from __future__ import absolute_import, print_function import re import win32clipboard def has_html(): """ Return True if there is a Html fragment in the clipboard.. """ cb = HtmlClipboard() return cb.has_html_format() def get_html(): """ Return the Html fragment from the clipboard or N...
{"/technicolor/format.py": ["/technicolor/html_clipboard.py"]}
11,126
hkorzeniewski/Flask-activity-registration
refs/heads/main
/website/views.py
from flask import Blueprint, render_template, request, flash, jsonify,redirect from flask_login import login_user, login_required, logout_user, current_user from .models import Activity, Cardio from . import db import json views = Blueprint('views', __name__) @views.route('/', methods = ['GET']) @login_required def ...
{"/website/views.py": ["/website/models.py"]}
11,127
hkorzeniewski/Flask-activity-registration
refs/heads/main
/migrations/versions/a6889e26a94c_.py
"""empty message Revision ID: a6889e26a94c Revises: 4aad4f7b688b Create Date: 2021-03-05 19:41:24.581276 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'a6889e26a94c' down_revision = '4aad4f7b688b' branch_labels = None depends_on = None def upgrade(): # ...
{"/website/views.py": ["/website/models.py"]}
11,128
hkorzeniewski/Flask-activity-registration
refs/heads/main
/migrations/versions/4aad4f7b688b_.py
"""empty message Revision ID: 4aad4f7b688b Revises: c8b93fe68601 Create Date: 2021-03-05 19:29:37.355979 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '4aad4f7b688b' down_revision = 'c8b93fe68601' branch_labels = None depends_on = None def upgrade(): # ...
{"/website/views.py": ["/website/models.py"]}
11,129
hkorzeniewski/Flask-activity-registration
refs/heads/main
/secrets.py
SECRET_KEY = "SouthernIcyOcean"
{"/website/views.py": ["/website/models.py"]}
11,130
hkorzeniewski/Flask-activity-registration
refs/heads/main
/website/models.py
from . import db from flask_login import UserMixin from sqlalchemy.sql import func class User(db.Model, UserMixin): id = db.Column(db.Integer, primary_key = True) name = db.Column(db.String(150), unique=True) password = db.Column(db.String(150)) activities = db.relationship('Activity') cardios = d...
{"/website/views.py": ["/website/models.py"]}
11,133
petrblaho/cfme_tests
refs/heads/master
/cfme/tests/cloud/test_tag_cloud.py
import pytest from cfme.web_ui import Quadicon, mixins from cfme.configure.configuration import Category, Tag from utils.providers import setup_a_provider from utils.randomness import generate_lowercase_random_string, generate_random_string @pytest.fixture(scope="module") def setup_first_cloud_provider(): setup_...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,134
petrblaho/cfme_tests
refs/heads/master
/cfme/tests/control/test_compliance.py
# -*- coding: utf-8 -*- import re import diaper import pytest from cfme.configure.configuration import VMAnalysisProfile from cfme.control.explorer import ( Action, VMCompliancePolicy, VMControlPolicy, VMCondition, PolicyProfile) from cfme.exceptions import VmNotFoundViaIP from cfme.infrastructure.virtual_machine...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,135
petrblaho/cfme_tests
refs/heads/master
/conftest.py
""" Top-level conftest.py does a couple of things: 1) Add cfme_pages repo to the sys.path automatically 2) Load a number of plugins and fixtures automatically """ from pkgutil import iter_modules import pytest import requests import cfme.fixtures import fixtures import markers import metaplugins from cfme.fixtures.r...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,136
petrblaho/cfme_tests
refs/heads/master
/scripts/template_tester.py
#!/usr/bin/env python """Template tester script, used to test and mark template as usable. get: Export bash vars to be eval'd for template testing with the jenkins runner latest: Export bash vars to be eval'd for getting the latest usable template mark: Mark a template as tested and, if it passes, usable...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,137
petrblaho/cfme_tests
refs/heads/master
/cfme/tests/cloud/test_tenant.py
import pytest from cfme.cloud.tenant import Tenant from utils import testgen from utils.randomness import generate_random_string pytest_generate_tests = testgen.generate(testgen.provider_by_type, ['openstack'], scope='module') @pytest.fixture def tenant(provider_key): re...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,138
petrblaho/cfme_tests
refs/heads/master
/sprout/sprout/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from contextlib import contextmanager try: import cPickle as pickle except ImportError: import pickle from .celery import app as celery_app assert celery_app from django.core.cache import cache from sprout import settings from redis import StrictRe...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,139
petrblaho/cfme_tests
refs/heads/master
/cfme/tests/automate/test_service_dialog.py
import pytest import utils.randomness as rand from utils.update import update from utils import error, version from cfme.automate.service_dialogs import ServiceDialog pytestmark = [pytest.mark.usefixtures("logged_in")] def test_create_service_dialog(): element_data = { 'ele_label': "ele_" + rand.generat...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,140
petrblaho/cfme_tests
refs/heads/master
/cfme/services/catalogs/myservice.py
from functools import partial from cfme import web_ui as ui from cfme.fixtures import pytest_selenium as sel from cfme.web_ui import accordion, menu, flash, Quadicon, Region, Form, fill, form_buttons from cfme.web_ui import toolbar as tb from utils.update import Updateable from utils.wait import wait_for lifecycle_btn...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,141
petrblaho/cfme_tests
refs/heads/master
/cfme/tests/infrastructure/test_customization_template.py
import pytest from cfme.infrastructure import pxe from utils import error from utils.blockers import BZ from utils.randomness import generate_random_string from utils.update import update pytestmark = [pytest.mark.usefixtures("logged_in")] def test_customization_template_crud(): """Basic CRUD test for customiza...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,142
petrblaho/cfme_tests
refs/heads/master
/cfme/tests/automate/test_namespace.py
# -*- coding: utf-8 -*- # pylint: disable=E1101 # pylint: disable=W0621 import pytest from cfme.automate.explorer import Namespace from utils.providers import setup_a_provider from utils.randomness import generate_random_string from utils.update import update from utils import version import utils.error as error impo...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,143
petrblaho/cfme_tests
refs/heads/master
/cfme/tests/automate/test_instance.py
import pytest from utils.randomness import generate_random_string from utils.update import update import utils.error as error import cfme.tests.automate as ta pytestmark = [pytest.mark.usefixtures("logged_in")] @pytest.fixture(scope='module') def make_class(request): return ta.make_class(request=request) @pyte...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,144
petrblaho/cfme_tests
refs/heads/master
/cfme/tests/configure/test_zones.py
# -*- coding: utf-8 -*- import pytest import cfme.web_ui.flash as flash import cfme.configure.configuration as conf from utils.randomness import generate_random_string from utils.update import update @pytest.mark.smoke def test_zone_crud(soft_assert): zone = conf.Zone( name=generate_random_string(size=5)...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,145
petrblaho/cfme_tests
refs/heads/master
/scripts/harden_security.py
#!/usr/bin/env python2 """SSH into a running appliance and configure security. Configures security on appliance(s) according to this document: https://access.redhat.com/articles/1124753 Works for single appliance and distributed appliance configurations. In distributed configurations, provide the hostname of the rep...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,146
petrblaho/cfme_tests
refs/heads/master
/cfme/fixtures/smtp.py
# -*- coding: utf-8 -*- """This module provides a fixture useful for checking the e-mails arrived. Main use is of fixture :py:meth:`smtp_test`, which is function scoped. There is also a :py:meth:`smtp_test_module` fixture for which the smtp_test is just a function-scoped wrapper to speed things up. The base of all thi...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...
11,147
petrblaho/cfme_tests
refs/heads/master
/cfme/tests/automate/test_method.py
import pytest from cfme.automate.explorer import Namespace, Class, Method from utils.randomness import generate_random_string from utils.update import update import utils.error as error pytestmark = [pytest.mark.usefixtures("logged_in")] def _make_namespace(): name = generate_random_string(8) description = ...
{"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test...