index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
7,589 | MADRobotNO/Simple_NEAT_v0.2 | refs/heads/master | /Layer.py | from Node import Node
from Connection import Connection
import numpy as np
class Layer:
INPUT_LAYER = "input"
HIDDEN_LAYER = "hidden"
OUTPUT_LAYER = "output"
INPUT_LAYER_ID = 0
OUTPUT_LAYER_ID = 1
def __init__(self, layer_id, layer_type, number_of_nodes, list_of_all_nodes, list_of_all_conne... | {"/Layer.py": ["/Node.py", "/Connection.py"], "/Connection.py": ["/Node.py"], "/Model.py": ["/Connection.py", "/Layer.py", "/Node.py"], "/example.py": ["/NEAT.py", "/RandomData.py"], "/NEAT.py": ["/Model.py"]} |
7,590 | MADRobotNO/Simple_NEAT_v0.2 | refs/heads/master | /Connection.py | from Node import Node
import numpy as np
class Connection:
def __init__(self, connection_id, from_node, to_node, innovation_id):
self.connection_id = connection_id
self.innovation_id = innovation_id
self.from_node = from_node
self.to_node = to_node
self.enabled = True
... | {"/Layer.py": ["/Node.py", "/Connection.py"], "/Connection.py": ["/Node.py"], "/Model.py": ["/Connection.py", "/Layer.py", "/Node.py"], "/example.py": ["/NEAT.py", "/RandomData.py"], "/NEAT.py": ["/Model.py"]} |
7,591 | MADRobotNO/Simple_NEAT_v0.2 | refs/heads/master | /Model.py | from Connection import Connection
from Layer import Layer
import numpy as np
from Node import Node
class Model:
def __init__(self, model_id, number_of_inputs, number_of_outputs, mutation_rate, list_of_innovations):
self.model_id = model_id
self.outputs = []
self.score = 0.0
self.nu... | {"/Layer.py": ["/Node.py", "/Connection.py"], "/Connection.py": ["/Node.py"], "/Model.py": ["/Connection.py", "/Layer.py", "/Node.py"], "/example.py": ["/NEAT.py", "/RandomData.py"], "/NEAT.py": ["/Model.py"]} |
7,592 | MADRobotNO/Simple_NEAT_v0.2 | refs/heads/master | /example.py | from NEAT import Neat
from RandomData import Xor
xor = Xor()
neat = Neat(2, 1, 10, 0.4)
for model in neat.list_of_all_models:
model.mutate(neat.list_of_innovations)
# print(neat)
neat.fit(xor.data, xor.targets, 50)
print("done")
| {"/Layer.py": ["/Node.py", "/Connection.py"], "/Connection.py": ["/Node.py"], "/Model.py": ["/Connection.py", "/Layer.py", "/Node.py"], "/example.py": ["/NEAT.py", "/RandomData.py"], "/NEAT.py": ["/Model.py"]} |
7,593 | MADRobotNO/Simple_NEAT_v0.2 | refs/heads/master | /NEAT.py | from Model import Model
import numpy as np
import copy
class Neat:
def __init__(self, number_of_inputs=2, number_of_outputs=1, number_of_models=1, mutation_rate=0.1):
self.list_of_innovations = []
self.list_of_all_models = []
self.mutation_rate = mutation_rate
self.number_of_input... | {"/Layer.py": ["/Node.py", "/Connection.py"], "/Connection.py": ["/Node.py"], "/Model.py": ["/Connection.py", "/Layer.py", "/Node.py"], "/example.py": ["/NEAT.py", "/RandomData.py"], "/NEAT.py": ["/Model.py"]} |
7,594 | tchaly-bethmaure/ProjetGrid | refs/heads/master | /script/__init__.py | __author__ = 'tchaly'
| {"/Tools/ScriptBrowser.py": ["/Model/Script.py", "/Tools/Prompter.py", "/Tools/CmdLineExplorer.py", "/Tools/JobExecutor.py"], "/launcher.py": ["/View/IHM.py"]} |
7,595 | tchaly-bethmaure/ProjetGrid | refs/heads/master | /Tools/ScriptBrowser.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# imports
from Model.Script import Script
from Tools.Prompter import Prompter
from Tools.CmdLineExplorer import CmdLineExplorer
from Tools.JobExecutor import JobExecutor
##
#
class ScriptBrowser(Prompter, object):
## available choices for menu
choix_menu = {
... | {"/Tools/ScriptBrowser.py": ["/Model/Script.py", "/Tools/Prompter.py", "/Tools/CmdLineExplorer.py", "/Tools/JobExecutor.py"], "/launcher.py": ["/View/IHM.py"]} |
7,596 | tchaly-bethmaure/ProjetGrid | refs/heads/master | /Model/Nodes.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# imports
import sys
from ClusterShell.NodeSet import NodeSet
from ClusterShell.Task import task_self
from ClusterShell.NodeSet import NodeSetException
##
#
class Nodes:
## initialize the object
def __init__(self, nodeset):
# the node set
self.ns ... | {"/Tools/ScriptBrowser.py": ["/Model/Script.py", "/Tools/Prompter.py", "/Tools/CmdLineExplorer.py", "/Tools/JobExecutor.py"], "/launcher.py": ["/View/IHM.py"]} |
7,597 | tchaly-bethmaure/ProjetGrid | refs/heads/master | /View/IHM.py | #! /usr/bin/python
# imports
import os
import sys
from Model.Nodes import Nodes
from Model.ConfFileManager import ConfFileManager
from Tools.ScriptBrowser import ScriptBrowser
from Tools.NodeBrowser import NodeBrowser
from Tools.Prompter import Prompter
from Tools.JobExecutor import JobExecutor
##
#
class IHM(Prompte... | {"/Tools/ScriptBrowser.py": ["/Model/Script.py", "/Tools/Prompter.py", "/Tools/CmdLineExplorer.py", "/Tools/JobExecutor.py"], "/launcher.py": ["/View/IHM.py"]} |
7,598 | tchaly-bethmaure/ProjetGrid | refs/heads/master | /Model/ConfFileManager.py | #! /usr/bin/python
# imports
import sys
from Model.Nodes import Nodes
from Tools.JobExecutor import JobExecutor
from ClusterShell.NodeSet import NodeSet
from ClusterShell.Task import task_self
##
#
class ConfFileManager:
## constructor (noeuds, service et action)
def __init__(self, ns, service, action):
... | {"/Tools/ScriptBrowser.py": ["/Model/Script.py", "/Tools/Prompter.py", "/Tools/CmdLineExplorer.py", "/Tools/JobExecutor.py"], "/launcher.py": ["/View/IHM.py"]} |
7,599 | tchaly-bethmaure/ProjetGrid | refs/heads/master | /script/zip.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
# variables utilisées
name_of_file = "tail5authlog"
default_path = "/root/scpy"
storage_remote_name = "supervisor"
print("Installing 7zip if needed.")
os.system("apt-get install -yq p7zip")
print("Zipping this file.")
os.system("7z a "+ default_path +"/logfile.... | {"/Tools/ScriptBrowser.py": ["/Model/Script.py", "/Tools/Prompter.py", "/Tools/CmdLineExplorer.py", "/Tools/JobExecutor.py"], "/launcher.py": ["/View/IHM.py"]} |
7,600 | tchaly-bethmaure/ProjetGrid | refs/heads/master | /launcher.py | #! /usr/bin/python
import sys
from View.IHM import IHM
if __name__ == '__main__':
# instantiate the GUI
view = IHM()
# check params and launch the appropriate mode
if len(sys.argv) == 5 and (sys.argv[1] == '-s' or sys.argv[1] == '--static'):
# launch static mode
view.staticMode(sys.a... | {"/Tools/ScriptBrowser.py": ["/Model/Script.py", "/Tools/Prompter.py", "/Tools/CmdLineExplorer.py", "/Tools/JobExecutor.py"], "/launcher.py": ["/View/IHM.py"]} |
7,601 | tchaly-bethmaure/ProjetGrid | refs/heads/master | /Tools/NodeBrowser.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# imports
import sys
from ClusterShell.NodeSet import NodeSet
from ClusterShell.NodeSet import NodeSetException
from Model.Nodes import Nodes
from Tools.Prompter import Prompter
##
#
class NodeBrowser(Prompter):
## constructor
def __init__(self):
self.ns ... | {"/Tools/ScriptBrowser.py": ["/Model/Script.py", "/Tools/Prompter.py", "/Tools/CmdLineExplorer.py", "/Tools/JobExecutor.py"], "/launcher.py": ["/View/IHM.py"]} |
7,602 | tchaly-bethmaure/ProjetGrid | refs/heads/master | /Tools/Prompter.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# imports
import os
##
#
class Prompter:
## constructor
def __init__(self):
pass
## list available choices
def prompt_choice(self, question, iterable):
self.print_question(question)
self.print_choice(iterable)
return self.... | {"/Tools/ScriptBrowser.py": ["/Model/Script.py", "/Tools/Prompter.py", "/Tools/CmdLineExplorer.py", "/Tools/JobExecutor.py"], "/launcher.py": ["/View/IHM.py"]} |
7,603 | tchaly-bethmaure/ProjetGrid | refs/heads/master | /Tools/CmdLineExplorer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# imports
import os
from Prompter import Prompter
##
#
class CmdLineExplorer(Prompter, object):
## constructor
def __init__(self, root_folder):
super(CmdLineExplorer, self).__init__()
# set paths
self.initial_path = root_folder
self... | {"/Tools/ScriptBrowser.py": ["/Model/Script.py", "/Tools/Prompter.py", "/Tools/CmdLineExplorer.py", "/Tools/JobExecutor.py"], "/launcher.py": ["/View/IHM.py"]} |
7,604 | tchaly-bethmaure/ProjetGrid | refs/heads/master | /Tools/JobExecutor.py | #! /usr/bin/python
# imports
from ClusterShell.NodeSet import NodeSet
from ClusterShell.Task import task_self
from Tools.Prompter import Prompter
## class for executing commands
#
class JobExecutor(Prompter):
## constructor
def __init__(self):
# task launcher
self.task = task_self()
## e... | {"/Tools/ScriptBrowser.py": ["/Model/Script.py", "/Tools/Prompter.py", "/Tools/CmdLineExplorer.py", "/Tools/JobExecutor.py"], "/launcher.py": ["/View/IHM.py"]} |
7,605 | tchaly-bethmaure/ProjetGrid | refs/heads/master | /Model/Script.py |
## class for handling scripts
#
class Script(object):
## constructor
def __init__(self, nom_script, tool_script, chemin_fichier):
super(Script,self).__init__()
# script name
self.intitule = nom_script
# tool
self.tool = tool_script
# script path
self.pat... | {"/Tools/ScriptBrowser.py": ["/Model/Script.py", "/Tools/Prompter.py", "/Tools/CmdLineExplorer.py", "/Tools/JobExecutor.py"], "/launcher.py": ["/View/IHM.py"]} |
7,614 | eriknystrom/csc401-assign4 | refs/heads/master | /Circle.py | from math import pi
# ClassCircle
# Write class called circle, with an instance variable, for the radius
# and methods to calculate the area and circumference of the circle.
class Circle:
def __init__(self):
self.radius = 0
def area (self):
return (self.radius ** 2) * pi
def circumference... | {"/assign4.py": ["/Circle.py"]} |
7,615 | eriknystrom/csc401-assign4 | refs/heads/master | /assign4.py | # Assignment 4 for CSC401 Python
import functools
from Circle import Circle
# Function One(list of strings)
# Take a list of strings as a parameter and return all unique strings
def function_one(string_list):
unique_list = []
unique = True
for x in range(len(string_list)):
string_test = string_list... | {"/assign4.py": ["/Circle.py"]} |
7,616 | davidcerezal/django-oidc-provider | refs/heads/master | /oidc_provider/tests/test_token_endpoint.py | import json
from urllib import urlencode
import uuid
from django.test import RequestFactory
from django.test import TestCase
from oidc_provider.lib.utils.token import *
from oidc_provider.tests.utils import *
from oidc_provider.views import *
class TokenTestCase(TestCase):
"""
To obtain an Access Token and ... | {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,617 | davidcerezal/django-oidc-provider | refs/heads/master | /oidc_provider/models.py | import json
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
def scope_property():
def fget(self):
return self._scope.split()
def fset(self, value):
self._scope = ' '.join(value)
return locals()
class Client(models.Model):
... | {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,618 | davidcerezal/django-oidc-provider | refs/heads/master | /oidc_provider/lib/utils/common.py | from django.core.urlresolvers import reverse
from oidc_provider import settings
def get_issuer():
"""
Construct the issuer full url. Basically is the site url with some path
appended.
"""
site_url = settings.get('SITE_URL')
path = reverse('oidc_provider:provider_info') \
.split('/.well-known/openid-configura... | {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,619 | davidcerezal/django-oidc-provider | refs/heads/master | /oidc_provider/tests/utils.py | from django.contrib.auth.models import User
from oidc_provider.models import *
def create_fake_user():
"""
Create a test user.
Return a User object.
"""
user = User()
user.username = 'johndoe'
user.email = 'johndoe@example.com'
user.set_password('1234')
user.save()
return user
def create_fake_client(res... | {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,620 | davidcerezal/django-oidc-provider | refs/heads/master | /oidc_provider/admin.py | from django.contrib import admin
from .models import Client, Code, Token, UserInfo
admin.site.register(Client)
admin.site.register(Code)
admin.site.register(Token)
admin.site.register(UserInfo) | {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,621 | davidcerezal/django-oidc-provider | refs/heads/master | /example_app/provider_app/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^openid/', include('oidc_provider.urls', namespace='oidc_provider')),
url(r'^admin/', include(admin.site.urls)),
)
| {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,622 | davidcerezal/django-oidc-provider | refs/heads/master | /oidc_provider/lib/claims.py | from django.utils.translation import ugettext as _
from oidc_provider.models import UserInfo
class AbstractScopeClaims(object):
def __init__(self, user, scopes):
self.user = user
self.scopes = scopes
self.setup()
def setup(self):
pass
def create_response_dic(self):
... | {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,623 | davidcerezal/django-oidc-provider | refs/heads/master | /oidc_provider/lib/errors.py | import urllib
class RedirectUriError(Exception):
error = 'Redirect URI Error'
description = 'The request fails due to a missing, invalid, or mismatching redirection URI (redirect_uri).'
class ClientIdError(Exception):
error = 'Client ID Error'
description = 'The client identifier (client_id) is mi... | {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,624 | davidcerezal/django-oidc-provider | refs/heads/master | /oidc_provider/lib/endpoints/discovery.py | from django.core.urlresolvers import reverse
from oidc_provider import settings
from oidc_provider.lib.utils.common import get_issuer
class ProviderInfoEndpoint(object):
@classmethod
def create_response_dic(cls):
dic = {}
dic['issuer'] = get_issuer()
SITE_URL = settings.get('SITE_U... | {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,625 | davidcerezal/django-oidc-provider | refs/heads/master | /oidc_provider/lib/utils/token.py | from datetime import timedelta
import time
import uuid
from django.utils import timezone
import jwt
from oidc_provider.models import *
from oidc_provider import settings
def create_id_token(iss, sub, aud, auth_time):
"""
Receives a user object, iss (issuer) and aud (audience).
Then creates the id_token ... | {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,626 | davidcerezal/django-oidc-provider | refs/heads/master | /oidc_provider/views.py | from django.contrib.auth.views import redirect_to_login
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.shortcuts import render
from django.template.loader import render_to_string
from django.views.decorators.http import require_http_methods
from django.views.generic import View
fr... | {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,627 | davidcerezal/django-oidc-provider | refs/heads/master | /oidc_provider/lib/endpoints/authorize.py | from datetime import timedelta
import uuid
from django.utils import timezone
from oidc_provider.lib.errors import *
from oidc_provider.lib.utils.common import get_issuer
from oidc_provider.lib.utils.params import *
from oidc_provider.lib.utils.token import *
from oidc_provider.models import *
from oidc_provider impor... | {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,628 | davidcerezal/django-oidc-provider | refs/heads/master | /oidc_provider/settings.py | from django.conf import settings
class DefaultSettings(object):
@property
def LOGIN_URL(self):
"""
REQUIRED.
"""
return None
@property
def SITE_URL(self):
"""
REQUIRED.
"""
return None
@property
def OIDC_AFTER_USERLOGIN_HOOK(se... | {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,629 | davidcerezal/django-oidc-provider | refs/heads/master | /oidc_provider/tests/test_authorize_endpoint.py | import urllib
import uuid
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.models import AnonymousUser
from django.core.urlresolvers import reverse
from django.test import RequestFactory
from django.test import TestCase
from oidc_provider import settings
from oidc_provider.models import *
... | {"/oidc_provider/tests/test_token_endpoint.py": ["/oidc_provider/lib/utils/token.py", "/oidc_provider/tests/utils.py", "/oidc_provider/views.py"], "/oidc_provider/tests/utils.py": ["/oidc_provider/models.py"], "/oidc_provider/admin.py": ["/oidc_provider/models.py"], "/oidc_provider/lib/claims.py": ["/oidc_provider/mode... |
7,669 | jQwotos/anime_scrapers | refs/heads/master | /info_collectors/anidb.py | import requests
import os
from bs4 import BeautifulSoup
from difflib import SequenceMatcher
import sys
# Constants
BASE_URL = "http://api.anidb.net:9001/httpapi?request=anime"
BASE_PATH = os.path.dirname(os.path.realpath(__file__))
SEARCH_FILE = os.path.join(BASE_PATH, "anime-titles.xml")
IMAGE_URL = "http://img7.anid... | {"/download_handler.py": ["/templates/module_search.py"], "/info_handler.py": ["/templates/module_search.py"]} |
7,670 | jQwotos/anime_scrapers | refs/heads/master | /download_handler.py | import logging
from .templates.module_search import ModuleSearch
class DownloadHandler(ModuleSearch):
# Deals with resolving downloading of files
def __init__(self):
self._get_modules('downloaders')
def single_download(self, link, abs_path):
"""
Download a single episode.
... | {"/download_handler.py": ["/templates/module_search.py"], "/info_handler.py": ["/templates/module_search.py"]} |
7,671 | jQwotos/anime_scrapers | refs/heads/master | /info_collectors/_init_anidb.py | from datetime import date
import requests
import os
BASE_PATH = os.path.dirname(os.path.realpath(__file__))
INFO_FILE = os.path.join(BASE_PATH, "last_download.txt")
DOWNLOAD_URL = "http://anidb.net/api/anime-titles.xml.gz"
DOWNLOAD_FILE = os.path.join(BASE_PATH, "anime-titles.xml")
class DownloadList:
def __in... | {"/download_handler.py": ["/templates/module_search.py"], "/info_handler.py": ["/templates/module_search.py"]} |
7,672 | jQwotos/anime_scrapers | refs/heads/master | /scrapers/anime9.py | import logging
import requests
from bs4 import BeautifulSoup as bs
site_name = "9anime.is"
BASE_URL = 'https://9anime.is'
SEARCH_URL = '%s/search' % (BASE_URL,)
INFO_API_URL = "%s/ajax/episode/info" % (BASE_URL,)
def _parse_search_single(data):
img = data.find("img")
nameAnchor = data.find("a", {"class": ... | {"/download_handler.py": ["/templates/module_search.py"], "/info_handler.py": ["/templates/module_search.py"]} |
7,673 | jQwotos/anime_scrapers | refs/heads/master | /info_handler.py | import glob
from .templates.module_search import ModuleSearch
class InfoHandler(ModuleSearch):
def __init__(self):
self._get_modules('info_collectors')
def _search_module(self, query, strict, module):
return module.search(query, strict)
def search(self, query, strict=False):
re... | {"/download_handler.py": ["/templates/module_search.py"], "/info_handler.py": ["/templates/module_search.py"]} |
7,674 | jQwotos/anime_scrapers | refs/heads/master | /test.py | import os
fileLocation = os.path.realpath(__file__)
directory = os.path.dirname(fileLocation)
print(os.path.join(directory, ".."))
| {"/download_handler.py": ["/templates/module_search.py"], "/info_handler.py": ["/templates/module_search.py"]} |
7,675 | jQwotos/anime_scrapers | refs/heads/master | /templates/module_search.py | import glob
import imp
import logging
import os
import re
class ModuleSearch(object):
def _load_single_module(self, f):
return imp.load_source(f[:-3], f)
def _load_modules(self):
return [self._load_single_module(x) for x in self.modules]
def _try_match_url(self, link, matchingURL):
... | {"/download_handler.py": ["/templates/module_search.py"], "/info_handler.py": ["/templates/module_search.py"]} |
7,677 | dtmaciasca/abcBack | refs/heads/master | /abcBack_app/urls.py | from django.urls import path
from . import views
urlpatterns = [
path('create_evento/', views.postEvento, name='post_evento'),
path('categorias/', views.getAllCategorias, name='get_categorias'),
path('evento/<int:idEvento>', views.getDetailEvento, name='get_id_evento'),
path('eventos/<int:idUser>', vi... | {"/abcBack_app/views.py": ["/abcBack_app/serializers.py", "/abcBack_app/models.py"], "/abcBack_app/serializers.py": ["/abcBack_app/models.py"]} |
7,678 | dtmaciasca/abcBack | refs/heads/master | /abcBack_app/views.py | from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from rest_framework.status import (HTTP_400_BAD_REQUEST, HTTP_404_NOT_FOUND, HTTP_200_OK)
from django.http import HttpResponse, HttpResponseBadRequest, JsonResponse
from django.core.serializers import *
from .serializers import Eve... | {"/abcBack_app/views.py": ["/abcBack_app/serializers.py", "/abcBack_app/models.py"], "/abcBack_app/serializers.py": ["/abcBack_app/models.py"]} |
7,679 | dtmaciasca/abcBack | refs/heads/master | /abcBack_app/models.py | from django.db import models
from django.contrib.auth.models import User
import datetime
# Create your models here.
class Categoria(models.Model):
nombre = models.CharField(max_length=100)
def __str__(self):
return self.nombre + ' ' + str(self.id)
class Evento(models.Model):
nombre = models.Char... | {"/abcBack_app/views.py": ["/abcBack_app/serializers.py", "/abcBack_app/models.py"], "/abcBack_app/serializers.py": ["/abcBack_app/models.py"]} |
7,680 | dtmaciasca/abcBack | refs/heads/master | /abcBack_app/serializers.py | from .models import Evento, Categoria
from rest_framework import serializers
class CategoriaSerializer(serializers.ModelSerializer):
class Meta:
model=Categoria
fields=('id','nombre')
class EventoSerializer(serializers.ModelSerializer):
categoria = CategoriaSerializer()
class Meta:
... | {"/abcBack_app/views.py": ["/abcBack_app/serializers.py", "/abcBack_app/models.py"], "/abcBack_app/serializers.py": ["/abcBack_app/models.py"]} |
7,681 | patrickdeyoreo/rhino-repo | refs/heads/master | /rhinoscraper/scrapers/test_file_scraper.py | #!/usr/bin/env python3
"""Module for TestFileScraper"""
import sys
class TestFileScraper:
"""TestFileScraper class
Scrapes test files from any projects.
Args:
soup (obj): BeautifulSoup obj containing parsed link
"""
def __init__(self, soup):
"""Initialize a test file scraper
... | {"/rhinoscraper/__init__.py": ["/rhinoscraper/rhinoproject.py", "/rhinoscraper/rhinoread.py"], "/api/v1/views/project.py": ["/rhinoscraper/__init__.py", "/api/v1/views/__init__.py"], "/api/v1/app.py": ["/api/v1/views/__init__.py"], "/api/v1/views/__init__.py": ["/api/v1/views/project.py"], "/rhinoscraper/rhinoproject.p... |
7,682 | patrickdeyoreo/rhino-repo | refs/heads/master | /rhinoscraper/__init__.py | #!/usr/bin/env python3
"""
Provides the rhinoscraper module
"""
import requests
from bs4 import BeautifulSoup
from . rhinoproject import RhinoProject
from . rhinoread import RhinoRead
def rhinoscrape(soup, github_user, github_name):
"""
Run the rhinoproject and rhinoreadme scrapers
"""
rhino = RhinoPr... | {"/rhinoscraper/__init__.py": ["/rhinoscraper/rhinoproject.py", "/rhinoscraper/rhinoread.py"], "/api/v1/views/project.py": ["/rhinoscraper/__init__.py", "/api/v1/views/__init__.py"], "/api/v1/app.py": ["/api/v1/views/__init__.py"], "/api/v1/views/__init__.py": ["/api/v1/views/project.py"], "/rhinoscraper/rhinoproject.p... |
7,683 | patrickdeyoreo/rhino-repo | refs/heads/master | /api/v1/views/project.py | #!/usr/bin/env python3
"""
Provides RESTful API routes for Holberton
"""
import os
import shlex
import shutil
import subprocess
import tempfile
import flask
import requests
from rhinoscraper import create_session, get_soup, rhinoscrape
from . import app_views
AUTH_KEYS = {'hbtn_email', 'hbtn_password', 'hbtn_api_key',... | {"/rhinoscraper/__init__.py": ["/rhinoscraper/rhinoproject.py", "/rhinoscraper/rhinoread.py"], "/api/v1/views/project.py": ["/rhinoscraper/__init__.py", "/api/v1/views/__init__.py"], "/api/v1/app.py": ["/api/v1/views/__init__.py"], "/api/v1/views/__init__.py": ["/api/v1/views/project.py"], "/rhinoscraper/rhinoproject.p... |
7,684 | patrickdeyoreo/rhino-repo | refs/heads/master | /api/v1/app.py | #!/usr/bin/env python3
"""
Returns the status of the API
"""
from os import getenv
from flask import Flask, jsonify, make_response
from flask_cors import CORS
from api.v1.views import app_views
HOST = getenv('RHINO_API_HOST', '0.0.0.0')
PORT = getenv('RHINE_API_PORT', '5000')
cors = CORS(app_views, resources={r"/*": ... | {"/rhinoscraper/__init__.py": ["/rhinoscraper/rhinoproject.py", "/rhinoscraper/rhinoread.py"], "/api/v1/views/project.py": ["/rhinoscraper/__init__.py", "/api/v1/views/__init__.py"], "/api/v1/app.py": ["/api/v1/views/__init__.py"], "/api/v1/views/__init__.py": ["/api/v1/views/project.py"], "/rhinoscraper/rhinoproject.p... |
7,685 | patrickdeyoreo/rhino-repo | refs/heads/master | /rhinoscraper/scrapers/high_scraper.py | #!/usr/bin/env python3
"""Module for HighScraper"""
import os
import re
import sys
class HighScraper:
"""HighScraper class
High-Level_Programming project scraper.
Args:
soup (obj): BeautifulSoup obj containing parsed link
Attributes:
py_flag (int): For write_checker()
py_js ... | {"/rhinoscraper/__init__.py": ["/rhinoscraper/rhinoproject.py", "/rhinoscraper/rhinoread.py"], "/api/v1/views/project.py": ["/rhinoscraper/__init__.py", "/api/v1/views/__init__.py"], "/api/v1/app.py": ["/api/v1/views/__init__.py"], "/api/v1/views/__init__.py": ["/api/v1/views/project.py"], "/rhinoscraper/rhinoproject.p... |
7,686 | patrickdeyoreo/rhino-repo | refs/heads/master | /api/v1/views/__init__.py | #!/usr/bin/python3
"""
initializes the api views from a flask blueprint set up in api/v1/app.py
"""
from flask import Blueprint
app_views = Blueprint('app_views', __name__, url_prefix='/api/v1')
from api.v1.views.project import *
| {"/rhinoscraper/__init__.py": ["/rhinoscraper/rhinoproject.py", "/rhinoscraper/rhinoread.py"], "/api/v1/views/project.py": ["/rhinoscraper/__init__.py", "/api/v1/views/__init__.py"], "/api/v1/app.py": ["/api/v1/views/__init__.py"], "/api/v1/views/__init__.py": ["/api/v1/views/project.py"], "/rhinoscraper/rhinoproject.p... |
7,687 | patrickdeyoreo/rhino-repo | refs/heads/master | /rhinoscraper/rhinoproject.py | #!/usr/bin/env python3
"""
Provides a class to scrape project data and create project files
"""
import os
import re
import shutil
import stat
import sys
from bs4 import BeautifulSoup
from . scrapers.high_scraper import HighScraper
from . scrapers.low_scraper import LowScraper
from . scrapers.sys_scraper import SysScrap... | {"/rhinoscraper/__init__.py": ["/rhinoscraper/rhinoproject.py", "/rhinoscraper/rhinoread.py"], "/api/v1/views/project.py": ["/rhinoscraper/__init__.py", "/api/v1/views/__init__.py"], "/api/v1/app.py": ["/api/v1/views/__init__.py"], "/api/v1/views/__init__.py": ["/api/v1/views/project.py"], "/rhinoscraper/rhinoproject.p... |
7,688 | patrickdeyoreo/rhino-repo | refs/heads/master | /rhinoscraper/scrapers/sys_scraper.py | #!/usr/bin/env python3
"""Module for SysScraper"""
import re
import sys
class SysScraper:
"""SysScraper class
System-Engineering_Devops project scraper.
Args:
soup (obj): BeautifulSoup obj containing parsed link
Attributes:
ruby_check (str): if ruby exists, assign to 0. Else scrape ... | {"/rhinoscraper/__init__.py": ["/rhinoscraper/rhinoproject.py", "/rhinoscraper/rhinoread.py"], "/api/v1/views/project.py": ["/rhinoscraper/__init__.py", "/api/v1/views/__init__.py"], "/api/v1/app.py": ["/api/v1/views/__init__.py"], "/api/v1/views/__init__.py": ["/api/v1/views/project.py"], "/rhinoscraper/rhinoproject.p... |
7,689 | patrickdeyoreo/rhino-repo | refs/heads/master | /integrate.py | #!/usr/bin/python3
"""
Flask App that integrates with Rhino-Repo static HTML Template
"""
from flask import Flask, render_template, url_for
# flask setup
app = Flask(__name__)
app.url_map.strict_slashes = False
port = 5001
host = '0.0.0.0'
@app.route('/')
def index():
"""
handles request to custom template
... | {"/rhinoscraper/__init__.py": ["/rhinoscraper/rhinoproject.py", "/rhinoscraper/rhinoread.py"], "/api/v1/views/project.py": ["/rhinoscraper/__init__.py", "/api/v1/views/__init__.py"], "/api/v1/app.py": ["/api/v1/views/__init__.py"], "/api/v1/views/__init__.py": ["/api/v1/views/project.py"], "/rhinoscraper/rhinoproject.p... |
7,690 | patrickdeyoreo/rhino-repo | refs/heads/master | /rhinoscraper/rhinoread.py | #!/usr/bin/env python3
"""
Provides a class to scrape project data and produce a README
"""
from . scrapers.read_scraper import ReadScraper
class RhinoRead(ReadScraper):
"""
Definition of a class to scrape project data and create project files
"""
def __init__(self, soup, github_user, github_name):
... | {"/rhinoscraper/__init__.py": ["/rhinoscraper/rhinoproject.py", "/rhinoscraper/rhinoread.py"], "/api/v1/views/project.py": ["/rhinoscraper/__init__.py", "/api/v1/views/__init__.py"], "/api/v1/app.py": ["/api/v1/views/__init__.py"], "/api/v1/views/__init__.py": ["/api/v1/views/project.py"], "/rhinoscraper/rhinoproject.p... |
7,691 | patrickdeyoreo/rhino-repo | refs/heads/master | /rhinoscraper/scrapers/read_scraper.py | #!/usr/bin/env python3
"""Module for ReadScraper"""
import os
import re
import sys
import requests
from bs4 import BeautifulSoup, Comment
class ReadScraper:
"""ReadScraper class
README.md scraper
Args:
soup (obj): BeautifulSoup obj containing parsed link
Attributes:
title (str):
... | {"/rhinoscraper/__init__.py": ["/rhinoscraper/rhinoproject.py", "/rhinoscraper/rhinoread.py"], "/api/v1/views/project.py": ["/rhinoscraper/__init__.py", "/api/v1/views/__init__.py"], "/api/v1/app.py": ["/api/v1/views/__init__.py"], "/api/v1/views/__init__.py": ["/api/v1/views/project.py"], "/rhinoscraper/rhinoproject.p... |
7,692 | patrickdeyoreo/rhino-repo | refs/heads/master | /rhinoscraper/tests/test_base_parse.py | #!/usr/bin/env python3
"""Unittest for LowScraper"""
import unittest
from scrapers import *
class TestBaseParse(unittest.TestCase):
"""Test for LowScraper"""
def setUp(self):
self.parse = BaseParse("https://intranet.hbtn.io/projects/232")
self.parse.get_json()
def tearDown(self):
... | {"/rhinoscraper/__init__.py": ["/rhinoscraper/rhinoproject.py", "/rhinoscraper/rhinoread.py"], "/api/v1/views/project.py": ["/rhinoscraper/__init__.py", "/api/v1/views/__init__.py"], "/api/v1/app.py": ["/api/v1/views/__init__.py"], "/api/v1/views/__init__.py": ["/api/v1/views/project.py"], "/rhinoscraper/rhinoproject.p... |
7,693 | patrickdeyoreo/rhino-repo | refs/heads/master | /rhinoscraper/scrapers/low_scraper.py | #!/usr/bin/env python3
"""Module for LowScraper"""
import re
import sys
from bs4 import BeautifulSoup
PUTCHAR = """
#include <unistd.h>
/**
* _putchar - writes the character c to stdout
* @c: The character to print
*
* Return: On success 1.
* On error, -1 is returned, and errno is set appropriately.
*/
int _put... | {"/rhinoscraper/__init__.py": ["/rhinoscraper/rhinoproject.py", "/rhinoscraper/rhinoread.py"], "/api/v1/views/project.py": ["/rhinoscraper/__init__.py", "/api/v1/views/__init__.py"], "/api/v1/app.py": ["/api/v1/views/__init__.py"], "/api/v1/views/__init__.py": ["/api/v1/views/project.py"], "/rhinoscraper/rhinoproject.p... |
7,694 | fbarbu15/-number_generator | refs/heads/master | /main.py | '''
Created on Dec 21, 2019
@author: Florin
'''
from time import time
from libs.number_generator import NumberGenerator
from resources.variables import START_A, MULTIPLY_FACTOR_A, START_B, \
MULTIPLY_FACTOR_B
num_gen_a = NumberGenerator(START_A, MULTIPLY_FACTOR_A)
num_gen_b = NumberGenerator(START_B, MULTIPLY_FAC... | {"/main.py": ["/libs/number_generator.py", "/resources/variables.py"], "/tests/test_first_five_pairs.py": ["/libs/number_generator.py", "/resources/variables.py"], "/tests/test_binary.py": ["/libs/number_generator.py", "/resources/variables.py"], "/libs/number_generator.py": ["/resources/variables.py"]} |
7,695 | fbarbu15/-number_generator | refs/heads/master | /tests/test_first_five_pairs.py | '''
Created on Dec 21, 2019
@author: Florin
'''
import pytest
from libs.number_generator import NumberGenerator
from resources.variables import MULTIPLY_FACTOR_A, MULTIPLY_FACTOR_B
class TestsFirstFive():
@pytest.fixture(scope="function", autouse=True)
def _setup_teardown_test(self):
self.first_five... | {"/main.py": ["/libs/number_generator.py", "/resources/variables.py"], "/tests/test_first_five_pairs.py": ["/libs/number_generator.py", "/resources/variables.py"], "/tests/test_binary.py": ["/libs/number_generator.py", "/resources/variables.py"], "/libs/number_generator.py": ["/resources/variables.py"]} |
7,696 | fbarbu15/-number_generator | refs/heads/master | /resources/variables.py | '''
Created on Dec 21, 2019
@author: Florin
'''
import os
# Start A and B can be passed as environment variables (from CI build params for example)
START_A = os.getenv("START_A", 65)
START_B = os.getenv("START_B", 8921)
MULTIPLY_FACTOR_A = 16807
MULTIPLY_FACTOR_B = 48271
DIVIDE_FACTOR = 2147483647
| {"/main.py": ["/libs/number_generator.py", "/resources/variables.py"], "/tests/test_first_five_pairs.py": ["/libs/number_generator.py", "/resources/variables.py"], "/tests/test_binary.py": ["/libs/number_generator.py", "/resources/variables.py"], "/libs/number_generator.py": ["/resources/variables.py"]} |
7,697 | fbarbu15/-number_generator | refs/heads/master | /tests/test_binary.py | '''
Created on Dec 21, 2019
@author: Florin
'''
import pytest
from libs.number_generator import NumberGenerator
from resources.variables import MULTIPLY_FACTOR_A, MULTIPLY_FACTOR_B
class TestsBinary():
@pytest.fixture(scope="function", autouse=True)
def _setup_teardown_test(self):
self.num_gen_a = N... | {"/main.py": ["/libs/number_generator.py", "/resources/variables.py"], "/tests/test_first_five_pairs.py": ["/libs/number_generator.py", "/resources/variables.py"], "/tests/test_binary.py": ["/libs/number_generator.py", "/resources/variables.py"], "/libs/number_generator.py": ["/resources/variables.py"]} |
7,698 | fbarbu15/-number_generator | refs/heads/master | /libs/number_generator.py | '''
Created on Dec 21, 2019
@author: Florin
'''
from resources.variables import DIVIDE_FACTOR
class NumberGenerator():
def __init__(self, start_value, multiply_factor):
self.current_value = start_value
self._multiply_factor = multiply_factor
def __next__(self):
self.current_value = ... | {"/main.py": ["/libs/number_generator.py", "/resources/variables.py"], "/tests/test_first_five_pairs.py": ["/libs/number_generator.py", "/resources/variables.py"], "/tests/test_binary.py": ["/libs/number_generator.py", "/resources/variables.py"], "/libs/number_generator.py": ["/resources/variables.py"]} |
7,699 | michaelwolz/Mosel-Wein-Hack-2019 | refs/heads/master | /Labeler.py | #-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: Philipp
#
# Created: 17.02.2019
# Copyright: (c) Philipp 2019
# Licence: <your licence>
#-------------------------------------------------------------------------------
import o... | {"/main.py": ["/VideoAnalysis.py"]} |
7,700 | michaelwolz/Mosel-Wein-Hack-2019 | refs/heads/master | /GrapeDetection.py | #-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: Philipp
#
# Created: 16.02.2019
# Copyright: (c) Philipp 2019
# Licence: <your licence>
#-------------------------------------------------------------------------------
import c... | {"/main.py": ["/VideoAnalysis.py"]} |
7,701 | michaelwolz/Mosel-Wein-Hack-2019 | refs/heads/master | /Stack.py | #-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: Philipp
#
# Created: 16.02.2019
# Copyright: (c) Philipp 2019
# Licence: <your licence>
#-------------------------------------------------------------------------------
import c... | {"/main.py": ["/VideoAnalysis.py"]} |
7,702 | michaelwolz/Mosel-Wein-Hack-2019 | refs/heads/master | /VideoAnalysis.py | import cv2
from keras.models import load_model
import numpy as np
BLUE = (255, 0, 0)
RED = (0, 0, 255)
GREEN = (0, 255, 0)
FONTSCALE = 1
LINETYPE = 2
FONT = cv2.FONT_HERSHEY_SIMPLEX
# Loading pre-trained AI model
model = load_model("data/model_2c.h5")
# model = load_model("data/grapes_model_adam.h5")
class VideoAna... | {"/main.py": ["/VideoAnalysis.py"]} |
7,703 | michaelwolz/Mosel-Wein-Hack-2019 | refs/heads/master | /main.py | import VideoAnalysis
def main():
run_video_analysis()
def run_video_analysis():
va = VideoAnalysis.VideoAnalysis()
va.run_ai_version("data/RGB/video_rgb-13_09_2017-10_02.avi")
if __name__ == '__main__':
main()
| {"/main.py": ["/VideoAnalysis.py"]} |
7,704 | MUSTMIIZ11/chameleon | refs/heads/main | /signup/views.py | from django.shortcuts import render
# Create your views here.
from django.shortcuts import render
from django.contrib import auth
from django.contrib.auth import authenticate, login
from django.contrib.auth.backends import ModelBackend
from django.db.models import Q
from .models import User
from django.http import Htt... | {"/community/admin.py": ["/community/models.py"], "/community/views.py": ["/community/models.py"], "/tools/tests.py": ["/community/models.py"], "/tools/views.py": ["/community/models.py"]} |
7,705 | MUSTMIIZ11/chameleon | refs/heads/main | /signup/admin.py | from django.contrib import admin
from signup.models import User
# Register your models here.
admin.site.register([User]) | {"/community/admin.py": ["/community/models.py"], "/community/views.py": ["/community/models.py"], "/tools/tests.py": ["/community/models.py"], "/tools/views.py": ["/community/models.py"]} |
7,706 | MUSTMIIZ11/chameleon | refs/heads/main | /tools/urls.py | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('save', views.save_map, name='save'),
path('check', views.check, name='check'),
] | {"/community/admin.py": ["/community/models.py"], "/community/views.py": ["/community/models.py"], "/tools/tests.py": ["/community/models.py"], "/tools/views.py": ["/community/models.py"]} |
7,707 | MUSTMIIZ11/chameleon | refs/heads/main | /community/admin.py | from django.contrib import admin
from community.models import Map
# Register your models here.
admin.site.register([Map]) | {"/community/admin.py": ["/community/models.py"], "/community/views.py": ["/community/models.py"], "/tools/tests.py": ["/community/models.py"], "/tools/views.py": ["/community/models.py"]} |
7,708 | MUSTMIIZ11/chameleon | refs/heads/main | /signup/urls.py | from django.urls import path
# from .views import CustomBackend
from . import views
urlpatterns = [
path('', views.simple_login, name='login'),
path('register/', views.signup, name='signup'),
] | {"/community/admin.py": ["/community/models.py"], "/community/views.py": ["/community/models.py"], "/tools/tests.py": ["/community/models.py"], "/tools/views.py": ["/community/models.py"]} |
7,709 | MUSTMIIZ11/chameleon | refs/heads/main | /community/models.py | from django.db import models
# Create your models here.
class Map(models.Model):
map_name = models.CharField(max_length=50)
map_url = models.TextField(max_length=100)
user_id = models.IntegerField()
like = models.IntegerField(default=0)
create_time = models.DateField(auto_now=True)
def __str_... | {"/community/admin.py": ["/community/models.py"], "/community/views.py": ["/community/models.py"], "/tools/tests.py": ["/community/models.py"], "/tools/views.py": ["/community/models.py"]} |
7,710 | MUSTMIIZ11/chameleon | refs/heads/main | /community/views.py | import base64
import os
import sys
from io import BytesIO
import qrcode
from django.http import HttpResponse
from django.shortcuts import render
from chameleon.settings import MAP_DIR, BASE_DIR
from .models import Map
from signup.models import User
import qrcode
from chameleon import settings
def index(request):
... | {"/community/admin.py": ["/community/models.py"], "/community/views.py": ["/community/models.py"], "/tools/tests.py": ["/community/models.py"], "/tools/views.py": ["/community/models.py"]} |
7,711 | MUSTMIIZ11/chameleon | refs/heads/main | /tools/tests.py | import binascii
import unittest
from unittest.mock import patch, mock_open
from django.http import HttpResponse
from django.test import Client
# Create your tests here.
from django.test import TestCase
from community.models import Map
from signup.models import User
class MapTestCase(TestCase):
"""
Test Map ... | {"/community/admin.py": ["/community/models.py"], "/community/views.py": ["/community/models.py"], "/tools/tests.py": ["/community/models.py"], "/tools/views.py": ["/community/models.py"]} |
7,712 | MUSTMIIZ11/chameleon | refs/heads/main | /chameleon/settings_dev.py | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# URL = "159.75.82.228:9090"
URL = os.environ.get('DJANGO_HOST') or "127.0.0.1:8080"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'chameleon_db_dev',
'USER': 'root',
'PASSWOR... | {"/community/admin.py": ["/community/models.py"], "/community/views.py": ["/community/models.py"], "/tools/tests.py": ["/community/models.py"], "/tools/views.py": ["/community/models.py"]} |
7,713 | MUSTMIIZ11/chameleon | refs/heads/main | /tools/views.py | # Create your views here.
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
import base64
from django.views.decorators.csrf import csrf_exempt
from community.models import Map
from chameleon.settings import BASE_DIR
import os
def index(request):
return render(request, 'tool.... | {"/community/admin.py": ["/community/models.py"], "/community/views.py": ["/community/models.py"], "/tools/tests.py": ["/community/models.py"], "/tools/views.py": ["/community/models.py"]} |
7,714 | MUSTMIIZ11/chameleon | refs/heads/main | /welcome/views.py | from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
# def index(request):
# return HttpResponse("Hello world, you are at poll index")
# def index(request):
# context = dict()
# context['hello'] = 'Hello World! You are now in the welcome app!'
# return re... | {"/community/admin.py": ["/community/models.py"], "/community/views.py": ["/community/models.py"], "/tools/tests.py": ["/community/models.py"], "/tools/views.py": ["/community/models.py"]} |
7,718 | SolaligueJoel/Proyecto-Integrador | refs/heads/main | /src/clases/localidad.py | from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
import io
import base64
from flask_sqlalchemy import SQLAlchemy
import requests
import matplotlib.pyplot as plt
db = SQLAlchemy()
class Localidad(db.Model):
__tablename__ = "localidad"
id = db.Colu... | {"/app.py": ["/src/configuracion/config.py", "/src/clases/users.py"]} |
7,719 | SolaligueJoel/Proyecto-Integrador | refs/heads/main | /src/configuracion/config.py | from configparser import ConfigParser
def config(section, filename='config.ini'):
# Read config file
parser = ConfigParser()
parser.read(filename)
# Read section
config_param = {}
if parser.has_section(section):
params = parser.items(section)
for param in params:
c... | {"/app.py": ["/src/configuracion/config.py", "/src/clases/users.py"]} |
7,720 | SolaligueJoel/Proyecto-Integrador | refs/heads/main | /app.py | from flask.helpers import flash, url_for
from werkzeug.utils import redirect
import traceback
from datetime import datetime
from flask_sqlalchemy import SQLAlchemy
from flask import Flask, request, jsonify, render_template, Response
from flask_login import LoginManager,login_required,login_user,logout_user,current_user... | {"/app.py": ["/src/configuracion/config.py", "/src/clases/users.py"]} |
7,721 | SolaligueJoel/Proyecto-Integrador | refs/heads/main | /src/clases/users.py | from flask_sqlalchemy import SQLAlchemy
from flask_login import UserMixin
from werkzeug.security import generate_password_hash,check_password_hash
db = SQLAlchemy()
class User(UserMixin, db.Model):
id = db.Column(db.Integer, primary_key=True)
user_name = db.Column(db.String(20), unique=True)
email = db.Co... | {"/app.py": ["/src/configuracion/config.py", "/src/clases/users.py"]} |
7,728 | algorithmiaio/nautilus | refs/heads/master | /dataset.py | #!/usr/bin/env python3
# Author: A. Besir Kurtulmus
from Algorithmia import client
import pandas as pd
class Dataset(object):
'''
Dataset should be formatted as a pandas DataFrame.
'''
def __init__(self, data_world_api_key=None):
self.data_world_api_key = data_world_api_key
self.data_se... | {"/tests/test_sentiment_algorithmia.py": ["/algo.py", "/glue.py"], "/algo.py": ["/algo_type.py"], "/nau.py": ["/metrics.py"], "/tests/test_sentiment_dataset.py": ["/dataset.py"], "/glue.py": ["/algo_type.py"]} |
7,729 | algorithmiaio/nautilus | refs/heads/master | /tests/test_competition.py | #!/usr/bin/env python3
# Author: A. Besir Kurtulmus
# Comparing sentiment analysis algorithms unit-test
# Dataset from: http://ai.stanford.edu/~amaas/data/sentiment/
# To run this test, run the following in the project root directory:
# python -m pytest tests/test_sentiment_competition.py
| {"/tests/test_sentiment_algorithmia.py": ["/algo.py", "/glue.py"], "/algo.py": ["/algo_type.py"], "/nau.py": ["/metrics.py"], "/tests/test_sentiment_dataset.py": ["/dataset.py"], "/glue.py": ["/algo_type.py"]} |
7,730 | algorithmiaio/nautilus | refs/heads/master | /tests/test_sentiment_algorithmia.py | #!/usr/bin/env python3
# Author: A. Besir Kurtulmus
# Comparing sentiment analysis algorithms unit-test
# Dataset from: http://ai.stanford.edu/~amaas/data/sentiment/
# To run this test, run the following in the project root directory:
# python -m pytest tests/test_sentiment_algorithmia.py --algorithmia_api_key=simXXX... | {"/tests/test_sentiment_algorithmia.py": ["/algo.py", "/glue.py"], "/algo.py": ["/algo_type.py"], "/nau.py": ["/metrics.py"], "/tests/test_sentiment_dataset.py": ["/dataset.py"], "/glue.py": ["/algo_type.py"]} |
7,731 | algorithmiaio/nautilus | refs/heads/master | /conftest.py | import pytest
def pytest_addoption(parser):
parser.addoption("--algorithmia_api_key", action="store", default="",
help="algorithmia_api_key: simXXXXXXXXXX")
@pytest.fixture
def algorithmia_api_key(request):
return request.config.getoption("--algorithmia_api_key")
| {"/tests/test_sentiment_algorithmia.py": ["/algo.py", "/glue.py"], "/algo.py": ["/algo_type.py"], "/nau.py": ["/metrics.py"], "/tests/test_sentiment_dataset.py": ["/dataset.py"], "/glue.py": ["/algo_type.py"]} |
7,732 | algorithmiaio/nautilus | refs/heads/master | /metrics.py | #!/usr/bin/env python3
# Author: A. Besir Kurtulmus
import numpy as np
| {"/tests/test_sentiment_algorithmia.py": ["/algo.py", "/glue.py"], "/algo.py": ["/algo_type.py"], "/nau.py": ["/metrics.py"], "/tests/test_sentiment_dataset.py": ["/dataset.py"], "/glue.py": ["/algo_type.py"]} |
7,733 | algorithmiaio/nautilus | refs/heads/master | /algo_type.py | #!/usr/bin/env python3
# Author: A. Besir Kurtulmus
class AlgoTypes(object):
def __init__(self):
self.types = ["classification", "regression", "multilabel"]
def valid_type(self, algo_type):
if algo_type in self.types:
return True
else:
return False
def get_... | {"/tests/test_sentiment_algorithmia.py": ["/algo.py", "/glue.py"], "/algo.py": ["/algo_type.py"], "/nau.py": ["/metrics.py"], "/tests/test_sentiment_dataset.py": ["/dataset.py"], "/glue.py": ["/algo_type.py"]} |
7,734 | algorithmiaio/nautilus | refs/heads/master | /visualize.py | #!/usr/bin/env python3
# Author: A. Besir Kurtulmus
| {"/tests/test_sentiment_algorithmia.py": ["/algo.py", "/glue.py"], "/algo.py": ["/algo_type.py"], "/nau.py": ["/metrics.py"], "/tests/test_sentiment_dataset.py": ["/dataset.py"], "/glue.py": ["/algo_type.py"]} |
7,735 | algorithmiaio/nautilus | refs/heads/master | /algo.py | #!/usr/bin/env python3
# Author: A. Besir Kurtulmus
from Algorithmia import client
from algo_type import AlgoTypes
class Algorithm(object):
'''
Algorithm is defined as an API endpoint that has a certain function.
Does not only refer to an Algorithmia algorithm.
'''
def __init__(self, api_key, algo_... | {"/tests/test_sentiment_algorithmia.py": ["/algo.py", "/glue.py"], "/algo.py": ["/algo_type.py"], "/nau.py": ["/metrics.py"], "/tests/test_sentiment_dataset.py": ["/dataset.py"], "/glue.py": ["/algo_type.py"]} |
7,736 | algorithmiaio/nautilus | refs/heads/master | /nau.py | #!/usr/bin/env python3
# Author: A. Besir Kurtulmus
# Collects metrics data for getting algorithm performance
from metrics import *
class Competition(object):
def __init__(self):
continue
| {"/tests/test_sentiment_algorithmia.py": ["/algo.py", "/glue.py"], "/algo.py": ["/algo_type.py"], "/nau.py": ["/metrics.py"], "/tests/test_sentiment_dataset.py": ["/dataset.py"], "/glue.py": ["/algo_type.py"]} |
7,737 | algorithmiaio/nautilus | refs/heads/master | /tests/test_sentiment_dataset.py | #!/usr/bin/env python3
# Author: A. Besir Kurtulmus
# Comparing sentiment analysis algorithms unit-test
# Dataset from: http://ai.stanford.edu/~amaas/data/sentiment/
# To run this test, run the following in the project root directory:
# python -m pytest tests/test_sentiment_dataset.py
from dataset import AppleCompute... | {"/tests/test_sentiment_algorithmia.py": ["/algo.py", "/glue.py"], "/algo.py": ["/algo_type.py"], "/nau.py": ["/metrics.py"], "/tests/test_sentiment_dataset.py": ["/dataset.py"], "/glue.py": ["/algo_type.py"]} |
7,738 | algorithmiaio/nautilus | refs/heads/master | /glue.py | #!/usr/bin/env python3
# Author: A. Besir Kurtulmus
from algo_type import AlgoTypes
class Glue(object):
'''
Glue is an I/O adaptor for algorithms. It creates a common standard for
interacting with algorithms in metrics.
Currently 3 types of glues are supported: classification, regression and
... | {"/tests/test_sentiment_algorithmia.py": ["/algo.py", "/glue.py"], "/algo.py": ["/algo_type.py"], "/nau.py": ["/metrics.py"], "/tests/test_sentiment_dataset.py": ["/dataset.py"], "/glue.py": ["/algo_type.py"]} |
7,753 | phycomlab/Protein | refs/heads/main | /UGW_examples.py | import numpy as np
import math
import torch
import matplotlib.pyplot as plt
import ot
import ot.plot
from scipy.io import loadmat
from scipy.spatial import distance
from scipy.stats import wishart
from solver.unbalanced_sinkhorn import sinkhorn_log
from solver.tlb_kl_sinkhorn_solver import TLBSinkhornSolver
######... | {"/UGW_examples.py": ["/solver/unbalanced_sinkhorn.py"]} |
7,754 | phycomlab/Protein | refs/heads/main | /UGW_protein_paramsearch.py | import numpy as np
import pandas as pd
import math
import torch
import matplotlib.pyplot as plt
import ot
import ot.plot
import os.path
from os import path
from scipy.io import loadmat
from scipy.special import comb
import itertools
from multiprocessing import Pool, RawArray
from functools import partial
from s... | {"/UGW_examples.py": ["/solver/unbalanced_sinkhorn.py"]} |
7,755 | phycomlab/Protein | refs/heads/main | /UGW_pairs.py | import numpy as np
import pandas as pd
import math
import torch
import matplotlib.pyplot as plt
import ot
import ot.plot
import os.path
from os import path
from scipy.io import loadmat
from scipy.special import comb
from sklearn import metrics
import timeout_decorator
from solver.tlb_kl_sinkhorn_solver import TL... | {"/UGW_examples.py": ["/solver/unbalanced_sinkhorn.py"]} |
7,756 | phycomlab/Protein | refs/heads/main | /solver/unbalanced_sinkhorn.py | import numpy as np
import math
def sinkhorn_log(mu, nu, c, eps, niter=1000, tau=-0.5, rho=math.inf):
# sinkhorn_log - stabilized sinkhorn over log domain with acceleration
#
# gamma, u, v, Wprimal, Wdual, err = sinkhorn_log(mu, nu, c, eps, niter, tau, rho)
#
# mu and nu are marginals.
# c... | {"/UGW_examples.py": ["/solver/unbalanced_sinkhorn.py"]} |
7,757 | joanmadsen/newproject2 | refs/heads/master | /newproject2/urls.py | """newproject2 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/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-b... | {"/newproject2/urls.py": ["/hellow_world_app/views.py"], "/hellow_world_app/views.py": ["/hellow_world_app/forms.py"]} |
7,758 | joanmadsen/newproject2 | refs/heads/master | /hellow_world_app/apps.py | from django.apps import AppConfig
class HellowWorldAppConfig(AppConfig):
name = 'hellow_world_app'
| {"/newproject2/urls.py": ["/hellow_world_app/views.py"], "/hellow_world_app/views.py": ["/hellow_world_app/forms.py"]} |
7,759 | joanmadsen/newproject2 | refs/heads/master | /hellow_world_app/views.py | # Create your views here.
from __future__ import unicode_literals
from django.shortcuts import render
from django.views.generic import TemplateView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.http import HttpResponseRedirect
from hellow_world_app.models import Rock
from django.v... | {"/newproject2/urls.py": ["/hellow_world_app/views.py"], "/hellow_world_app/views.py": ["/hellow_world_app/forms.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.