index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
65,434 | kamils224/STXNext_training_program | refs/heads/main | /stx_training_program/celery.py | from __future__ import absolute_import
import os
from celery import Celery
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "stx_training_program.settings")
# Get the base REDIS URL, default to redis' default
BASE_REDIS_URL = os.environ.get("REDIS_URL", "redis://localhost:6379")
app = Celery("stx_training_program")
... | {"/api_projects/models.py": ["/stx_training_program/celery.py", "/api_projects/tasks.py"], "/api_projects/serializers.py": ["/api_projects/models.py"], "/api_projects/urls.py": ["/api_projects/views.py"], "/api_accounts/views.py": ["/api_accounts/serializers.py", "/api_accounts/utils.py"], "/api_projects/views.py": ["/... |
65,435 | kamils224/STXNext_training_program | refs/heads/main | /api_projects/tests.py | from typing import Dict
from datetime import datetime
from django.contrib.auth import get_user_model
from rest_framework.test import APITestCase
from rest_framework.reverse import reverse_lazy, reverse
from rest_framework import status
from api_projects.models import Project, Issue
User = get_user_model()
class P... | {"/api_projects/models.py": ["/stx_training_program/celery.py", "/api_projects/tasks.py"], "/api_projects/serializers.py": ["/api_projects/models.py"], "/api_projects/urls.py": ["/api_projects/views.py"], "/api_accounts/views.py": ["/api_accounts/serializers.py", "/api_accounts/utils.py"], "/api_projects/views.py": ["/... |
65,436 | kamils224/STXNext_training_program | refs/heads/main | /api_projects/permissions.py | from rest_framework.permissions import BasePermission, SAFE_METHODS
from api_projects.models import Project, Issue, IssueAttachment
class IsOwner(BasePermission):
"""
Object-level permission to only allow owners of an object to edit it.
"""
def has_object_permission(self, request, view, obj):
... | {"/api_projects/models.py": ["/stx_training_program/celery.py", "/api_projects/tasks.py"], "/api_projects/serializers.py": ["/api_projects/models.py"], "/api_projects/urls.py": ["/api_projects/views.py"], "/api_accounts/views.py": ["/api_accounts/serializers.py", "/api_accounts/utils.py"], "/api_projects/views.py": ["/... |
65,437 | kamils224/STXNext_training_program | refs/heads/main | /api_accounts/serializers.py | from django.core.validators import MinLengthValidator
from django.contrib.auth import get_user_model
from django.utils.http import urlsafe_base64_decode
from django.utils.encoding import force_bytes, force_text
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import serializers
from api_accoun... | {"/api_projects/models.py": ["/stx_training_program/celery.py", "/api_projects/tasks.py"], "/api_projects/serializers.py": ["/api_projects/models.py"], "/api_projects/urls.py": ["/api_projects/views.py"], "/api_accounts/views.py": ["/api_accounts/serializers.py", "/api_accounts/utils.py"], "/api_projects/views.py": ["/... |
65,438 | kamils224/STXNext_training_program | refs/heads/main | /api_projects/tasks.py | from celery import shared_task
from django.apps import apps
from django.core.mail import send_mail
@shared_task
def send_issue_notification(email: str, subject: str, message: str) -> None:
send_mail(subject, message, None, recipient_list=[
email], fail_silently=False)
@shared_task
def notify_issu... | {"/api_projects/models.py": ["/stx_training_program/celery.py", "/api_projects/tasks.py"], "/api_projects/serializers.py": ["/api_projects/models.py"], "/api_projects/urls.py": ["/api_projects/views.py"], "/api_accounts/views.py": ["/api_accounts/serializers.py", "/api_accounts/utils.py"], "/api_projects/views.py": ["/... |
65,439 | shubham860/React-django | refs/heads/master | /project/api/admin.py | from django.contrib import admin
from .models import employee
from django.db import models
class employee(admin.ModelAdmin):
fieldsets = [
("Content",{'fields':["firstname","lastname","emp_id"]}),
]
admin.site.register(employee)
| {"/project/api/admin.py": ["/project/api/models.py"], "/project/api/views.py": ["/project/api/models.py"]} |
65,440 | shubham860/React-django | refs/heads/master | /project/api/models.py | from django.db import models
class employee(models.Model):
firstname = models.CharField(max_length=200)
lastname = models.CharField(max_length=200)
emp_id = models.IntegerField()
def __str__(self):
return self.firstname
| {"/project/api/admin.py": ["/project/api/models.py"], "/project/api/views.py": ["/project/api/models.py"]} |
65,441 | shubham860/React-django | refs/heads/master | /project/api/views.py | from django.shortcuts import render
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from .models import employee
from .serializer import employeeSerializer
class ... | {"/project/api/admin.py": ["/project/api/models.py"], "/project/api/views.py": ["/project/api/models.py"]} |
65,442 | sannahan/ravintolasovellus | refs/heads/main | /routes.py | from app import app
from db import db
import users
import restaurants
import reviews
import tags
from flask import redirect, render_template, request, session
@app.route("/")
def index():
tag_list = tags.get_tags()
return render_template("index.html", tags=tag_list)
@app.route("/login", methods=["POST"])
def login(... | {"/routes.py": ["/users.py", "/restaurants.py", "/reviews.py", "/tags.py"]} |
65,443 | sannahan/ravintolasovellus | refs/heads/main | /restaurants.py | from db import db
from geopy.geocoders import Nominatim
geolocator = Nominatim(user_agent="my_test_app")
def add_restaurant(name, description, address, opening_times):
try:
# testing to see if address is valid
location = geolocator.geocode(address)
if location == None:
return False
sql = "INSERT INTO rest... | {"/routes.py": ["/users.py", "/restaurants.py", "/reviews.py", "/tags.py"]} |
65,444 | sannahan/ravintolasovellus | refs/heads/main | /reviews.py | from db import db
def add_review(restaurant_id, user_id, stars, comment):
sql = "INSERT INTO reviews (restaurant_id, user_id, stars, comment, visible, sent_at) VALUES (:restaurant_id, :user_id, :stars, :comment, 1, NOW())"
db.session.execute(sql, {"restaurant_id":restaurant_id, "user_id":user_id, "stars":stars, "com... | {"/routes.py": ["/users.py", "/restaurants.py", "/reviews.py", "/tags.py"]} |
65,445 | sannahan/ravintolasovellus | refs/heads/main | /users.py | from werkzeug.security import check_password_hash, generate_password_hash
from flask import session
from db import db
import secrets
def login(username, password):
sql = "SELECT username, password, role, id FROM users WHERE username=:username"
result = db.session.execute(sql, {"username":username})
user = result.fe... | {"/routes.py": ["/users.py", "/restaurants.py", "/reviews.py", "/tags.py"]} |
65,446 | sannahan/ravintolasovellus | refs/heads/main | /tags.py | from db import db
def get_tags():
sql = "SELECT tag FROM tags GROUP BY tag"
result = db.session.execute(sql)
return result.fetchall()
def add_tags(restaurants, tag):
for restaurant in restaurants:
sql = "INSERT INTO tags (restaurant_id, tag) VALUES (:restaurant_id, :tag)"
db.session.ex... | {"/routes.py": ["/users.py", "/restaurants.py", "/reviews.py", "/tags.py"]} |
65,448 | gtmeier/pyscript | refs/heads/master | /pyscript/circle.py | from . import Shape
class Circle(Shape):
def __init__(self, radius):
self._radius = radius
def _get_postscript(self, center):
return self._join_lines(
"newpath",
f"{center.x} {center.y} {self._radius} 0 360 arc",
"stroke"
)
def _get_width(self... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,449 | gtmeier/pyscript | refs/heads/master | /tests/test_triangle.py | import unittest
from pyscript import Triangle
# TODO: tests for _get_height, export_postscript
class TriangleTestCase(unittest.TestCase):
def test_side_length_0(self):
triangle = Triangle(0)
self.assertEqual(triangle._side_length, 0)
def test_side_length_1(self):
triangle = Triangl... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,450 | gtmeier/pyscript | refs/heads/master | /tests/test_scaled.py | from pyscript import ScaledShape, Rectangle
from shape_test_case import ShapeTestCase
# TODO: tests for export_postscript
class ScaledShapeTestCase(ShapeTestCase):
def test_get_width_0(self):
rectangle = ScaledShape(Rectangle(0, 5), 2, 3)
self.assertEqual(rectangle._get_width(), 0 * 2)
de... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,451 | gtmeier/pyscript | refs/heads/master | /tests/test_rotated.py | from pyscript import RotatedShape, Rectangle
from shape_test_case import ShapeTestCase
# TODO: tests for export_postscript
class RotatedShapeTestCase(ShapeTestCase):
def test_create_90(self):
RotatedShape(Rectangle(10, 20), 90)
def test_create_180(self):
RotatedShape(Rectangle(10, 20), 18... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,452 | gtmeier/pyscript | refs/heads/master | /pyscript/__init__.py | from .point import Point
from .shape import Shape
from .circle import Circle
from .rectangle import Rectangle
from .spacer import Spacer
from .polygon import Polygon
from .square import Square
from .triangle import Triangle
from .scaled import ScaledShape
from .rotated import RotatedS... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,453 | gtmeier/pyscript | refs/heads/master | /tests/test_horizontal.py | from pyscript import HorizontalShapes, Circle, Rectangle, Point
from shape_test_case import ShapeTestCase
class HorizontalShapesTestCase(ShapeTestCase):
def test_get_width_no_shapes(self):
horizontal_shapes = HorizontalShapes()
self.assertEqual(horizontal_shapes._get_width(), 0)
def test_ge... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,454 | gtmeier/pyscript | refs/heads/master | /tests/test_square.py | import unittest
from pyscript import Square
# TODO: tests for export_postscript
class SquareTestCase(unittest.TestCase):
def test_side_length_0(self):
square = Square(0)
self.assertEqual(square._side_length, 0)
def test_side_length_1(self):
square = Square(1)
self.assertEq... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,455 | gtmeier/pyscript | refs/heads/master | /weird-snowperson.py | #!/usr/bin/env python3
# Laura originally created this shape for use in an automated test, but it also
# serves as a nice demonstration of the pyscript module.
from pyscript import (
Point, Rectangle, Spacer, Square, Circle, HorizontalShapes, VerticalShapes,
LayeredShapes, ScaledShape, RotatedShape, Triangle,... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,456 | gtmeier/pyscript | refs/heads/master | /tests/test_spacer.py | import unittest
from pyscript import Spacer
# TODO: tests for export_postscript
class SpacerTestCase(unittest.TestCase):
def test_get_width_0(self):
spacer = Spacer(0, 5)
self.assertEqual(spacer._get_width(), 0)
def test_get_width_1(self):
spacer = Spacer(1, 5)
self.assert... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,457 | gtmeier/pyscript | refs/heads/master | /pyscript/spacer.py | from . import Shape
# TODO: maybe subclass from Rectangle
class Spacer(Shape):
def __init__(self, width, height):
self._width = width
self._height = height
def _get_postscript(self, center):
return self._join_lines(
f"% spacer centered at ({center.x}, {center.y})"
... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,458 | gtmeier/pyscript | refs/heads/master | /pyscript/triangle.py | from . import Polygon
class Triangle(Polygon):
def __init__(self, sideLength):
super().__init__(3, sideLength)
| {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,459 | gtmeier/pyscript | refs/heads/master | /pyscript/fractals.py | from . import Triangle, RotatedShape, Point
# TODO: replace the functions defined below with a SierpinskiTriangle class
# derived from Shape
# http://jwilson.coe.uga.edu/emat6680/parsons/mvp6690/essay1/sierpinski.html
def write_postscript(postscript_code, filename):
with open(filename, "w+") as output_file:
... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,460 | gtmeier/pyscript | refs/heads/master | /tests/test_all_shapes.py | from pyscript import (
Point, Rectangle, Spacer, Square, Circle, HorizontalShapes, VerticalShapes,
LayeredShapes, ScaledShape, RotatedShape, Triangle, Polygon
)
from shape_test_case import ShapeTestCase
class AllShapesTestCase(ShapeTestCase):
_base_circle = Circle(80)
_rectangle = Rectangle(100, 60)... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,461 | gtmeier/pyscript | refs/heads/master | /pyscript/rotated.py | from . import Shape, Point
class RotatedShape(Shape):
def __init__(self, shape, rotation_angle):
if rotation_angle not in (90, 180, 270):
raise ValueError()
self._shape = shape
self._rotation_angle = rotation_angle
if self._rotation_angle in (90, 270):
se... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,462 | gtmeier/pyscript | refs/heads/master | /tests/test_layered.py | from pyscript import LayeredShapes, Circle, Rectangle
from shape_test_case import ShapeTestCase
# TODO: tests for export_postscript
class LayeredShapesTestCase(ShapeTestCase):
def test_get_width_no_shapes(self):
shape = LayeredShapes()
self.assertEqual(shape._get_width(), 0)
def test_get_... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,463 | gtmeier/pyscript | refs/heads/master | /pyscript/point.py | from collections import namedtuple
Point = namedtuple("Point", ("x", "y"))
| {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,464 | gtmeier/pyscript | refs/heads/master | /tests/test_circle.py | import unittest
from pyscript import Circle, Point
class CircleTestCase(unittest.TestCase):
def test_get_width_0(self):
circle = Circle(0)
self.assertEqual(circle._get_width(), 0)
def test_get_width_1(self):
circle = Circle(1)
self.assertEqual(circle._get_width(), 2)
de... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,465 | gtmeier/pyscript | refs/heads/master | /pyscript/polygon.py | from math import sin, cos, pi
from . import Shape
# TODO: tests
class Polygon(Shape):
def __init__(self, num_sides, side_length):
self._num_sides = num_sides
self._side_length = side_length
self._set_width_height()
def _set_width_height(self):
if self._num_sides % 2 != 0:
... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,466 | gtmeier/pyscript | refs/heads/master | /pyscript/scaled.py | from . import Shape, Point
class ScaledShape(Shape):
def __init__(self, shape, scale_factor_x, scale_factor_y):
self._shape = shape
self._scale_factor_x = scale_factor_x
self._scale_factor_y = scale_factor_y
def _get_postscript(self, center):
shape_postscript = self._shape._g... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,467 | gtmeier/pyscript | refs/heads/master | /pyscript/layered.py | from . import Shape
class LayeredShapes(Shape):
def __init__(self, *shapes):
self._shapes = shapes
def _get_postscript(self, center):
return "\n".join(
shape._get_postscript(center) for shape in self._shapes
)
def _get_width(self):
return max((shape._get_widt... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,468 | gtmeier/pyscript | refs/heads/master | /tests/test_rectangle.py | import unittest
from pyscript import Rectangle, Point
class RectangleTestCase(unittest.TestCase):
def test_get_width_0(self):
rectangle = Rectangle(0, 5)
self.assertEqual(rectangle._get_width(), 0)
def test_get_width_1(self):
rectangle = Rectangle(1, 5)
self.assertEqual(rect... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,469 | gtmeier/pyscript | refs/heads/master | /tests/shape_test_case.py | import inspect
import os
import unittest
class ShapeTestCase(unittest.TestCase):
_postscript_code_path = os.path.join('tests', 'postscript-code')
_test_file_path = os.path.join(_postscript_code_path, 'test.ps')
def tearDown(self):
if os.path.exists(self._test_file_path):
assert os.pa... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,470 | gtmeier/pyscript | refs/heads/master | /pyscript/shape.py | from abc import ABC, abstractmethod
from . import Point
class Shape(ABC):
def export_postscript(
self, center=Point(0, 0), show_center=False, filename="shape.ps"):
postscript_code = self._get_toplevel_postscript(center, show_center)
with open(filename, "w+") as output_file:
... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,471 | gtmeier/pyscript | refs/heads/master | /tests/test_vertical.py | from pyscript import VerticalShapes, Circle, Rectangle
from shape_test_case import ShapeTestCase
# TODO: tests for export_postscript
class VerticalShapesTestCase(ShapeTestCase):
def test_get_width_no_shapes(self):
horizontal_shapes = VerticalShapes()
self.assertEqual(horizontal_shapes._get_wid... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,472 | gtmeier/pyscript | refs/heads/master | /pyscript/vertical.py | from . import Shape, Point
class VerticalShapes(Shape):
def __init__(self, *shapes):
self._shapes = shapes
def _get_postscript(self, center):
shape_exports = []
current_y = center.y - self._get_height() / 2
for shape in self._shapes:
half_shape_height = shape._get... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,473 | gtmeier/pyscript | refs/heads/master | /pyscript/rectangle.py | from . import Shape
class Rectangle(Shape):
def __init__(self, width, height):
self._width = width
self._height = height
def _get_postscript(self, center):
return self._join_lines(
"newpath",
f"{center.x - self._get_width() / 2} "
f"{center.y - se... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,474 | gtmeier/pyscript | refs/heads/master | /pyscript/square.py | from . import Polygon
class Square(Polygon):
def __init__(self, sideLength):
super().__init__(4, sideLength)
def _get_width(self):
assert round(super()._get_width()) == self._side_length
return self._side_length
def _get_height(self):
assert round(super()._get_height()) ... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,475 | gtmeier/pyscript | refs/heads/master | /setup.py | import setuptools
setuptools.setup(
name='pyscript',
packages=['pyscript'],
python_requires='>=3.6.8'
)
| {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,476 | gtmeier/pyscript | refs/heads/master | /pyscript/horizontal.py | from . import Shape, Point
class HorizontalShapes(Shape):
def __init__(self, *shapes):
self._shapes = shapes
def _get_postscript(self, center):
shape_exports = []
current_x = center.x - self._get_width() / 2
for shape in self._shapes:
half_shape_width = shape._get... | {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,477 | gtmeier/pyscript | refs/heads/master | /sierpinski.py | #!/usr/bin/env python3
from pyscript import sierpinski_triangle_pages, write_postscript, Point
if __name__ == "__main__":
write_postscript(
sierpinski_triangle_pages(400, Point(250, 350), 8), "sierpinski.ps"
)
| {"/pyscript/circle.py": ["/pyscript/__init__.py"], "/tests/test_triangle.py": ["/pyscript/__init__.py"], "/tests/test_scaled.py": ["/pyscript/__init__.py"], "/tests/test_rotated.py": ["/pyscript/__init__.py"], "/pyscript/__init__.py": ["/pyscript/point.py", "/pyscript/shape.py", "/pyscript/circle.py", "/pyscript/rectan... |
65,478 | GLIMS-RGI/rgitools | refs/heads/master | /notebooks/dem_statistics/create_dem_example_images.py | import papermill as pm
import os
import os.path as path
# these names and RGIids are taken from the "Examples" on this page: https://rgitools.readthedocs.io/en/latest/dems.html
name_mapping = {
'RGI60-11.00897': 'hef',
'RGI60-11.01827': 'oberaletsch',
'RGI60-01.10689': 'columbia',
'RGI60-06.00477': 'ice... | {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,479 | GLIMS-RGI/rgitools | refs/heads/master | /rgitools/cli/compute_hypsometries.py | import os
import sys
from glob import glob
import argparse
import multiprocessing as mp
from rgitools import funcs
def _set_oggm_params(cfg):
cfg.PARAMS['use_multiprocessing'] = False
def run(input_dir=None, output_dir=None, *, replace_str=None,
oggm_working_dir='', set_oggm_params=None,
n_proc... | {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,480 | GLIMS-RGI/rgitools | refs/heads/master | /rgitools/cli/zip_rgi_dir.py | import os
import sys
import shutil
import tempfile
import argparse
from rgitools import funcs
def run(input_dir, output_file):
"""Zips an RGI directory and makes it look like a real one.
Parameters
----------
input_dir : str
path to the RGI directory
output_file : str
path to the... | {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,481 | GLIMS-RGI/rgitools | refs/heads/master | /notebooks/dem_statistics/dem_post_quality_per_region.py | # This script has originally been created by Matthias Dusch(https://github.com/matthiasdusch) and got modified
# for the creation of dems_v2 statistics
import os
import pandas as pd
import geopandas as gpd
import numpy as np
import matplotlib.pyplot as plt
from oggm import utils, cfg
from my_dem_funcs import dem_bar... | {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,482 | GLIMS-RGI/rgitools | refs/heads/master | /notebooks/dem_statistics/post_all_dems.py | # This script has originally been created by Matthias Dusch(https://github.com/matthiasdusch) and got modified
# for the creation of dems_v2 statistics
import os
import pandas as pd
import geopandas as gpd
import numpy as np
import matplotlib.pyplot as plt
from oggm.cli.prepro_levels import run_prepro_levels
from oggm... | {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,483 | GLIMS-RGI/rgitools | refs/heads/master | /notebooks/dem_statistics/my_dem_funcs.py | # This script has been created by Matthias Dusch(https://github.com/matthiasdusch)
import os
import tarfile
import logging
import numpy as np
import pandas as pd
import rasterio
from oggm import utils, GlacierDirectory, entity_task
# Module logger
log = logging.getLogger(__name__)
def dem_quality(gdir, demfile):
... | {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,484 | GLIMS-RGI/rgitools | refs/heads/master | /rgitools/funcs.py | import os
import shutil
import logging
from functools import wraps
import time
import tempfile
import numpy as np
import pandas as pd
import geopandas as gpd
import shapely.geometry as shpg
from shapely.ops import linemerge
import networkx as nx
from salem import wgs84
from oggm.utils import haversine, compile_glacier_... | {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,485 | GLIMS-RGI/rgitools | refs/heads/master | /rgitools/cli/correct_geometries.py | import os
import sys
from glob import glob
import argparse
import multiprocessing as mp
from rgitools import funcs
def run(input_dir=None, output_dir=None, *, replace_str=None,
n_processes=None):
"""Corrects the geometries for an entire RGI directory.
Parameters
----------
input_dir : str
... | {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,486 | GLIMS-RGI/rgitools | refs/heads/master | /rgitools/tests/test_rgitools.py | """All rgitools tests.
We use the pytest package to run them.
"""
import os
import shutil
from distutils.version import LooseVersion
import pytest
import pandas as pd
import geopandas as gpd
import numpy as np
from numpy.testing import assert_equal, assert_allclose
import rgitools
from rgitools import funcs
from rgi... | {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,487 | GLIMS-RGI/rgitools | refs/heads/master | /rgitools/cli/compute_intersects.py | import os
import sys
from glob import glob
import argparse
import multiprocessing as mp
from rgitools import funcs
def run(input_dir=None, output_dir=None, *, n_processes=None):
"""Computes the intersects for an entire RGI directory.
Parameters
----------
input_dir : str
path to the RGI dire... | {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,488 | GLIMS-RGI/rgitools | refs/heads/master | /rgitools/tests/conftest.py | import pytest
from oggm.utils import _downloads
from oggm.tests.conftest import secure_url_retrieve
@pytest.fixture(autouse=True)
def patch_url_retrieve(monkeypatch):
monkeypatch.setattr(_downloads, 'oggm_urlretrieve', secure_url_retrieve)
| {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,489 | GLIMS-RGI/rgitools | refs/heads/master | /setup.py | """Setup file for the rgitools package.
Adapted from the Python Packaging Authority template.
"""
from setuptools import setup, find_packages # Always prefer setuptools
from codecs import open # To use a consistent encoding
from os import path, walk
import sys, warnings, importlib, re
MAJOR = 0
MINOR = 0
MICRO ... | {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,490 | GLIMS-RGI/rgitools | refs/heads/master | /notebooks/dem_statistics/statistics_paths.py | # these paths have to be set according to your local system in order to run the creation of the DEM statistics
# and shouldn't be changed inbetween the execution of the separate scripts
# path to your preprocessed RGI data
prepro_path = '/PATH/TO/PREPROCESSED/DATA/RGI62/b_010/L1'
# path to directory that should be us... | {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,491 | GLIMS-RGI/rgitools | refs/heads/master | /rgitools/__init__.py | # flake8: noqa
try:
from .version import version as __version__
from .version import isreleased as __isreleased__
except ImportError:
raise ImportError('rgitools is not properly installed. If you are running '
'from the source directory, please instead create a '
... | {"/rgitools/cli/compute_hypsometries.py": ["/rgitools/__init__.py"], "/rgitools/cli/zip_rgi_dir.py": ["/rgitools/__init__.py"], "/rgitools/cli/correct_geometries.py": ["/rgitools/__init__.py"], "/rgitools/tests/test_rgitools.py": ["/rgitools/__init__.py", "/rgitools/funcs.py"], "/rgitools/cli/compute_intersects.py": ["... |
65,495 | eodreports/OandaHT | refs/heads/master | /OandaHT_model.py | import math
import numpy as np
from scipy.optimize import minimize
class HFmodel:
def __init__(self, sigma):
self.sigma=sigma
self.gamma=0
self.k=1.5
self.mid_rev_price=None
def calc(self, s, q, t, T):
self.mid_rev_price=s-q*self.gamma*self.sigma**2*(T-t)
def ca... | {"/OandaHT_main.py": ["/OandaHT_function.py"]} |
65,496 | eodreports/OandaHT | refs/heads/master | /OandaHT_function.py | from pyoanda import Order, Client, PRACTICE
import time
import datetime
import threading
import csv
import numpy as np
from OandaHT_model import *
class HFtrading:
def __init__(self, underlying, set_obj):
run_time=time.strftime("%Y%m%d_%H%M%S")
self.underlying=underlying
self.set_obj=set_... | {"/OandaHT_main.py": ["/OandaHT_function.py"]} |
65,497 | eodreports/OandaHT | refs/heads/master | /OandaHT_main.py | from OandaHT_function import *
login_file='/Users/MengfeiZhang/Desktop/tmp/login_info.csv'
set_obj=set(60, 5000, 50000, login_file)
HFobj1=HFtrading("EUR_USD", set_obj)
HFobj2=HFtrading("USD_JPY", set_obj)
HFobj3=HFtrading("GBP_USD", set_obj)
HFobj4=HFtrading("AUD_USD", set_obj)
HFobj5=HFtrading("NZD_USD", set_obj)
... | {"/OandaHT_main.py": ["/OandaHT_function.py"]} |
65,498 | AlexeyKozlov/Flights | refs/heads/master | /test/test_buy_tickets.py | # -*- coding: utf-8 -*-
import pytest
from fixture.application import Application
from model.flight import Flight
@pytest.fixture
def app(request):
fixture = Application()
request.addfinalizer(fixture.destroy)
return fixture
def test_buy_tickets(app):
app.session.login(username="alexey", password=... | {"/test/test_buy_tickets.py": ["/fixture/application.py", "/model/flight.py"], "/fixture/application.py": ["/fixture/session.py"]} |
65,499 | AlexeyKozlov/Flights | refs/heads/master | /fixture/application.py | from selenium.webdriver.firefox.webdriver import WebDriver
from fixture.session import SessionHelper
class Application:
def __init__(self):
self.wd = WebDriver()
self.wd.implicitly_wait(60)
self.session = SessionHelper(self)
def fill_reservation(self, flight):
wd = self.wd
... | {"/test/test_buy_tickets.py": ["/fixture/application.py", "/model/flight.py"], "/fixture/application.py": ["/fixture/session.py"]} |
65,500 | AlexeyKozlov/Flights | refs/heads/master | /model/flight.py |
class Flight:
def __init__(self, name, lastname, name2, lastname2):
self.name = name
self.lastname = lastname
self.name2 = name2
self.lastname2 = lastname2
| {"/test/test_buy_tickets.py": ["/fixture/application.py", "/model/flight.py"], "/fixture/application.py": ["/fixture/session.py"]} |
65,501 | AlexeyKozlov/Flights | refs/heads/master | /fixture/session.py |
class SessionHelper:
def __init__(self, app):
self.app=app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("userName").click()
wd.find_element_by_name("userName").clear()
wd.find_element_by_name("userNam... | {"/test/test_buy_tickets.py": ["/fixture/application.py", "/model/flight.py"], "/fixture/application.py": ["/fixture/session.py"]} |
65,515 | jbauza/todolist | refs/heads/master | /todo/urls.py | from django.conf.urls import include, url, patterns
from rest_framework.authtoken import views
urlpatterns = patterns('',
url(r'^todo/', include('todolist.urls')),
url(r'^todo/get_token/', views.obtain_auth_token),
)
| {"/todolist/serializers.py": ["/todolist/models.py"], "/todolist/tests.py": ["/todolist/models.py"], "/todolist/views.py": ["/todolist/models.py", "/todolist/serializers.py"]} |
65,516 | jbauza/todolist | refs/heads/master | /todolist/serializers.py | from rest_framework import serializers
from rest_framework.authtoken.models import Token
from django.contrib.auth.models import User
from todolist.models import Task
class TaskSerializer(serializers.ModelSerializer):
class Meta:
model = Task
fields = ('name','status')
class UserSerializer(serializ... | {"/todolist/serializers.py": ["/todolist/models.py"], "/todolist/tests.py": ["/todolist/models.py"], "/todolist/views.py": ["/todolist/models.py", "/todolist/serializers.py"]} |
65,517 | jbauza/todolist | refs/heads/master | /todolist/tests.py | from django.core.urlresolvers import reverse
from rest_framework.test import APITestCase, force_authenticate
from rest_framework import status
from django.contrib.auth.models import User
from todolist.models import Task
class User_Registration(APITestCase):
def test_user_registration(self):
url = reverse... | {"/todolist/serializers.py": ["/todolist/models.py"], "/todolist/tests.py": ["/todolist/models.py"], "/todolist/views.py": ["/todolist/models.py", "/todolist/serializers.py"]} |
65,518 | jbauza/todolist | refs/heads/master | /todolist/models.py | from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
from django.conf import settings
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def create_auth_token(sen... | {"/todolist/serializers.py": ["/todolist/models.py"], "/todolist/tests.py": ["/todolist/models.py"], "/todolist/views.py": ["/todolist/models.py", "/todolist/serializers.py"]} |
65,519 | jbauza/todolist | refs/heads/master | /todolist/views.py | from rest_framework.permissions import IsAuthenticated
from rest_framework import status
from rest_framework.decorators import api_view, permission_classes
from rest_framework.response import Response
from todolist.models import Task
from todolist.serializers import TaskSerializer, UserSerializer
#registra usuario y ... | {"/todolist/serializers.py": ["/todolist/models.py"], "/todolist/tests.py": ["/todolist/models.py"], "/todolist/views.py": ["/todolist/models.py", "/todolist/serializers.py"]} |
65,520 | jbauza/todolist | refs/heads/master | /todolist/urls.py | from django.conf.urls import patterns, include, url
urlpatterns = patterns('todolist.views',
url(r'^todolist/$','todolist',name='todolist'),
url(r'^add_task/$','add_task',name='add_task'),
url(r'^register_user/$','register_user',name='register_user'),
url(r'^resolve_task/(?P<name>\w+)$','resolve_task',... | {"/todolist/serializers.py": ["/todolist/models.py"], "/todolist/tests.py": ["/todolist/models.py"], "/todolist/views.py": ["/todolist/models.py", "/todolist/serializers.py"]} |
65,522 | matthewpoyner/trainernats | refs/heads/main | /memberships/urls.py | from django.urls import path
from . import views
urlpatterns = [
path('', views.membership, name='membership'),
path('order_history/<order_number>', views.order_history, name='order_history')
]
| {"/tnsclasses/views.py": ["/tnsclasses/models.py", "/tnsclasses/forms.py"], "/tnsclasses/admin.py": ["/tnsclasses/models.py"], "/cart/contexts.py": ["/tnsclasses/models.py"], "/tnsclasses/forms.py": ["/tnsclasses/models.py"]} |
65,523 | matthewpoyner/trainernats | refs/heads/main | /tnsclasses/models.py | from django.db import models
class Day(models.Model):
day = models.CharField(max_length=254)
friendly_name = models.CharField(
max_length=254,
null=True,
blank=True
)... | {"/tnsclasses/views.py": ["/tnsclasses/models.py", "/tnsclasses/forms.py"], "/tnsclasses/admin.py": ["/tnsclasses/models.py"], "/cart/contexts.py": ["/tnsclasses/models.py"], "/tnsclasses/forms.py": ["/tnsclasses/models.py"]} |
65,524 | matthewpoyner/trainernats | refs/heads/main | /tnsclasses/views.py | from django.shortcuts import render, get_object_or_404, redirect, reverse
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .models import TNS_Class, Day
from .forms import TNS_ClassForm
# Create your views here.
def all_classes(request):
''' A view to show all av... | {"/tnsclasses/views.py": ["/tnsclasses/models.py", "/tnsclasses/forms.py"], "/tnsclasses/admin.py": ["/tnsclasses/models.py"], "/cart/contexts.py": ["/tnsclasses/models.py"], "/tnsclasses/forms.py": ["/tnsclasses/models.py"]} |
65,525 | matthewpoyner/trainernats | refs/heads/main | /tnsclasses/migrations/0002_auto_20210215_1457.py | # Generated by Django 3.1.2 on 2021-02-15 01:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tnsclasses', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='tns_class',
name='class_time',
... | {"/tnsclasses/views.py": ["/tnsclasses/models.py", "/tnsclasses/forms.py"], "/tnsclasses/admin.py": ["/tnsclasses/models.py"], "/cart/contexts.py": ["/tnsclasses/models.py"], "/tnsclasses/forms.py": ["/tnsclasses/models.py"]} |
65,526 | matthewpoyner/trainernats | refs/heads/main | /memberships/views.py | from django.shortcuts import render, get_object_or_404
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .models import UserMembership
from .forms import UserMembershipForm
from checkout.models import Order
@login_required
def membership(request):
''' Display the... | {"/tnsclasses/views.py": ["/tnsclasses/models.py", "/tnsclasses/forms.py"], "/tnsclasses/admin.py": ["/tnsclasses/models.py"], "/cart/contexts.py": ["/tnsclasses/models.py"], "/tnsclasses/forms.py": ["/tnsclasses/models.py"]} |
65,527 | matthewpoyner/trainernats | refs/heads/main | /tnsclasses/admin.py | from django.contrib import admin
from .models import Day, TNS_Class, Class_Type
# Register your models here.
class DayAdmin(admin.ModelAdmin):
list_display = (
'friendly_name',
'pk',
)
ordering = ('pk',)
class Class_TypeAdmin(admin.ModelAdmin):
list_display = (
'class_type'... | {"/tnsclasses/views.py": ["/tnsclasses/models.py", "/tnsclasses/forms.py"], "/tnsclasses/admin.py": ["/tnsclasses/models.py"], "/cart/contexts.py": ["/tnsclasses/models.py"], "/tnsclasses/forms.py": ["/tnsclasses/models.py"]} |
65,528 | matthewpoyner/trainernats | refs/heads/main | /cart/contexts.py | from decimal import Decimal
from django.conf import settings
from django.shortcuts import get_object_or_404
from tnsclasses.models import TNS_Class
def cart_contents(request):
cart_items = []
total = 0
product_count = 0
cart = request.session.get('cart', {})
for item_id, item_data in cart.items(... | {"/tnsclasses/views.py": ["/tnsclasses/models.py", "/tnsclasses/forms.py"], "/tnsclasses/admin.py": ["/tnsclasses/models.py"], "/cart/contexts.py": ["/tnsclasses/models.py"], "/tnsclasses/forms.py": ["/tnsclasses/models.py"]} |
65,529 | matthewpoyner/trainernats | refs/heads/main | /tnsclasses/forms.py | from django import forms
from .models import TNS_Class, Day
class TNS_ClassForm(forms.ModelForm):
class Meta:
model = TNS_Class
fields = '__all__'
image = forms.ImageField(label='Image', required=False)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
... | {"/tnsclasses/views.py": ["/tnsclasses/models.py", "/tnsclasses/forms.py"], "/tnsclasses/admin.py": ["/tnsclasses/models.py"], "/cart/contexts.py": ["/tnsclasses/models.py"], "/tnsclasses/forms.py": ["/tnsclasses/models.py"]} |
65,530 | mohsseha/simple-kfp | refs/heads/master | /comp_2/__init__.py | #WARNING: do not include any dependencies that would not work in a standard python3 installation
#(this is because the kfp pipeline builder does not have access to the packages defined in this docker image)
def run(input1: float, random_str:str) -> float:
# all imports should be here:
from typing import Nam... | {"/comp_2/__init__.py": ["/comp_2/example.py"], "/pipeline.py": ["/comp_1/__init__.py", "/comp_2/__init__.py"]} |
65,531 | mohsseha/simple-kfp | refs/heads/master | /pipeline.py | # if running on a notebook you may need to install a few things:
# !pip3 install gitpython kfp
import datetime
import kfp as kfp
import kfp.components as comp
import git
repo = git.Repo(search_parent_directories=True)
sha = repo.head.object.hexsha
# Modeled after https://github.com/kubeflow/pipelines/blob/master/sa... | {"/comp_2/__init__.py": ["/comp_2/example.py"], "/pipeline.py": ["/comp_1/__init__.py", "/comp_2/__init__.py"]} |
65,532 | mohsseha/simple-kfp | refs/heads/master | /comp_2/example.py | #this is a regular python file you can import from wherever you want
import bs4
def ex_func():
soup = bs4.BeautifulSoup("<p>Some<b>bad<i>HTML")
return soup.prettify()
| {"/comp_2/__init__.py": ["/comp_2/example.py"], "/pipeline.py": ["/comp_1/__init__.py", "/comp_2/__init__.py"]} |
65,533 | mohsseha/simple-kfp | refs/heads/master | /comp_1/__init__.py | #WARNING: do not include any dependencies that would not work in a standard python3 installation
#(this is because the kfp pipeline builder does not have access to the packages defined in this docker image)
from typing import NamedTuple
def run(input1: float,input2: float) -> NamedTuple('Cmp1Output', [('input1', float... | {"/comp_2/__init__.py": ["/comp_2/example.py"], "/pipeline.py": ["/comp_1/__init__.py", "/comp_2/__init__.py"]} |
65,535 | WangXin81/GC-MLFNet-Submitted-to-IEEE-JSTARS | refs/heads/main | /multilabelMetrics/examplebasedranking.py | import numpy as np
from multilabelMetrics.functions import rankingMatrix, relevantIndexes, irrelevantIndexes
def oneError(y_test, probabilities):
"""
One Error
Params
======
y_test : sparse or dense matrix (n_samples, n_labels)
Matrix of labels used in the test phase
probabilities: spa... | {"/multilabelMetrics/examplebasedranking.py": ["/multilabelMetrics/functions.py"], "/testUCM.py": ["/multilabelMetrics/examplebasedclassification.py", "/multilabelMetrics/examplebasedranking.py"], "/trainUCM.py": ["/MLFNet/MLFNet_GC.py"]} |
65,536 | WangXin81/GC-MLFNet-Submitted-to-IEEE-JSTARS | refs/heads/main | /multilabelMetrics/examplebasedclassification.py | def subsetAccuracy1(y_test, predictions):
"""
The subset accuracy evaluates the fraction of correctly classified examples
Params
======
y_test : sparse or dense matrix (n_samples, n_labels)
Matrix of labels used in the test phase
predictions: sparse or dense matrix (n_samples, n_labels)... | {"/multilabelMetrics/examplebasedranking.py": ["/multilabelMetrics/functions.py"], "/testUCM.py": ["/multilabelMetrics/examplebasedclassification.py", "/multilabelMetrics/examplebasedranking.py"], "/trainUCM.py": ["/MLFNet/MLFNet_GC.py"]} |
65,537 | WangXin81/GC-MLFNet-Submitted-to-IEEE-JSTARS | refs/heads/main | /testUCM.py | #!/usr/bin/env python
# coding: utf-8
from models.mobilenet_v2 import MobileNetV2
from efficientnet.efficientnet.model import EfficientNetB3, EfficientNetB2,get_dropout,get_swish
from keras.utils.generic_utils import get_custom_objects
from keras import backend as K
from keras.layers import Activation
def swis... | {"/multilabelMetrics/examplebasedranking.py": ["/multilabelMetrics/functions.py"], "/testUCM.py": ["/multilabelMetrics/examplebasedclassification.py", "/multilabelMetrics/examplebasedranking.py"], "/trainUCM.py": ["/MLFNet/MLFNet_GC.py"]} |
65,538 | WangXin81/GC-MLFNet-Submitted-to-IEEE-JSTARS | refs/heads/main | /models/othermodel.py |
import numpy as np
import scipy.io as scio
import scipy.ndimage as im
import imageio
import matplotlib.pyplot as plt
import keras
from keras import models
from keras import layers
from keras import optimizers
from keras import applications
from keras import backend as K
from keras.preprocessing.image imp... | {"/multilabelMetrics/examplebasedranking.py": ["/multilabelMetrics/functions.py"], "/testUCM.py": ["/multilabelMetrics/examplebasedclassification.py", "/multilabelMetrics/examplebasedranking.py"], "/trainUCM.py": ["/MLFNet/MLFNet_GC.py"]} |
65,539 | WangXin81/GC-MLFNet-Submitted-to-IEEE-JSTARS | refs/heads/main | /MLFNet/MLFNet_SE.py | import os
from keras import layers, optimizers, models
from keras.regularizers import l2
from models.resnet50 import ResNet50
# from keras.applications.resnet50 import ResNet50
from keras.layers import *
from keras.models import Model
import keras.backend as K
from keras.models import Model
from keras.layers... | {"/multilabelMetrics/examplebasedranking.py": ["/multilabelMetrics/functions.py"], "/testUCM.py": ["/multilabelMetrics/examplebasedclassification.py", "/multilabelMetrics/examplebasedranking.py"], "/trainUCM.py": ["/MLFNet/MLFNet_GC.py"]} |
65,540 | WangXin81/GC-MLFNet-Submitted-to-IEEE-JSTARS | refs/heads/main | /MLFNet/MLFNet.py | import os
from keras import layers, optimizers, models
from keras.regularizers import l2
from models.resnet50 import ResNet50
# from keras.applications.resnet50 import ResNet50
from keras.layers import *
from keras.models import Model
import keras.backend as K
from keras.models import Model
from keras.layers... | {"/multilabelMetrics/examplebasedranking.py": ["/multilabelMetrics/functions.py"], "/testUCM.py": ["/multilabelMetrics/examplebasedclassification.py", "/multilabelMetrics/examplebasedranking.py"], "/trainUCM.py": ["/MLFNet/MLFNet_GC.py"]} |
65,541 | WangXin81/GC-MLFNet-Submitted-to-IEEE-JSTARS | refs/heads/main | /MLFNet/MLFNet_GC.py | import os
from keras import layers, optimizers, models
from keras.regularizers import l2
from models.resnet50 import ResNet50
# from keras.applications.resnet50 import ResNet50
from keras.layers import *
from keras.models import Model
import keras.backend as K
from keras.models import Model
from keras.layers... | {"/multilabelMetrics/examplebasedranking.py": ["/multilabelMetrics/functions.py"], "/testUCM.py": ["/multilabelMetrics/examplebasedclassification.py", "/multilabelMetrics/examplebasedranking.py"], "/trainUCM.py": ["/MLFNet/MLFNet_GC.py"]} |
65,542 | WangXin81/GC-MLFNet-Submitted-to-IEEE-JSTARS | refs/heads/main | /MLFNet/MLFNet_NL.py | import os
from keras import layers, optimizers, models
from keras.regularizers import l2
from models.resnet50 import ResNet50
# from keras.applications.resnet50 import ResNet50
from keras.layers import *
from keras.models import Model
import keras.backend as K
from keras.models import Model
from keras.layers... | {"/multilabelMetrics/examplebasedranking.py": ["/multilabelMetrics/functions.py"], "/testUCM.py": ["/multilabelMetrics/examplebasedclassification.py", "/multilabelMetrics/examplebasedranking.py"], "/trainUCM.py": ["/MLFNet/MLFNet_GC.py"]} |
65,543 | WangXin81/GC-MLFNet-Submitted-to-IEEE-JSTARS | refs/heads/main | /multilabelMetrics/labelbasedranking.py | def accuracyMacro(y_test, predictions):
"""
AUC Macro of our model
Params
======
y_test : sparse or dense matrix (n_samples, n_labels)
Matrix of labels used in the test phase
predictions: sparse or dense matrix (n_samples, n_labels)
Matrix of predicted labels given by our model
... | {"/multilabelMetrics/examplebasedranking.py": ["/multilabelMetrics/functions.py"], "/testUCM.py": ["/multilabelMetrics/examplebasedclassification.py", "/multilabelMetrics/examplebasedranking.py"], "/trainUCM.py": ["/MLFNet/MLFNet_GC.py"]} |
65,544 | WangXin81/GC-MLFNet-Submitted-to-IEEE-JSTARS | refs/heads/main | /multilabelMetrics/functions.py | #Auxiliary functions
import numpy as np
def relevantIndexes(matrix, row):
"""
Gets the relevant indexes of a vector
"""
relevant = []
for j in range(matrix.shape[1]):
if matrix[row,j] == 1:
relevant.append(int(j))
return relevant
def irrelevantIndexes(matrix, row):
... | {"/multilabelMetrics/examplebasedranking.py": ["/multilabelMetrics/functions.py"], "/testUCM.py": ["/multilabelMetrics/examplebasedclassification.py", "/multilabelMetrics/examplebasedranking.py"], "/trainUCM.py": ["/MLFNet/MLFNet_GC.py"]} |
65,545 | WangXin81/GC-MLFNet-Submitted-to-IEEE-JSTARS | refs/heads/main | /trainUCM.py | #!/usr/bin/env python
# coding: utf-8
import keras
import numpy as np
import scipy.io as scio
import imageio
from keras import Model
from keras.layers import Dense
from keras.preprocessing.image import ImageDataGenerator
from keras.optimizers import SGD, Adam, Nadam, RMSprop, Adagrad
from sklearn.metrics im... | {"/multilabelMetrics/examplebasedranking.py": ["/multilabelMetrics/functions.py"], "/testUCM.py": ["/multilabelMetrics/examplebasedclassification.py", "/multilabelMetrics/examplebasedranking.py"], "/trainUCM.py": ["/MLFNet/MLFNet_GC.py"]} |
65,557 | wubozhi/itc-testing-tools | refs/heads/master | /python/splint.py | import sys
import os.path
import system
import dirutils
import tempfile
import shutil
from pathlib import Path
temp_path = os.path.abspath(sys.argv[1])
directory = os.path.abspath(sys.argv[2])
csv = os.path.abspath(sys.argv[3])
exe = sys.argv[4]
if (len(sys.argv) > 5):
opts = sys.argv[5]
else:
... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,558 | wubozhi/itc-testing-tools | refs/heads/master | /python/dirutils.py | import os
import sys
from os import listdir
from os.path import isfile, join
def list_files(directory, extension, absolute_path=False):
files = []
for f in listdir(directory):
fpath = join(directory, f)
if isfile(fpath) and fpath.endswith(extension):
files.append(fpath)
return ... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,559 | wubozhi/itc-testing-tools | refs/heads/master | /python/clanalyze.py | import sys
import os.path
from itertools import takewhile
import re
import python.system
# directory = os.path.abspath(sys.argv[1])
# csv = os.path.abspath(sys.argv[2])
# exe = sys.argv[3]
# opts = sys.argv[4]
def clanalyze(directory, temp_path, csv, exe, opts):
print("======Running cl /analyze==... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,560 | wubozhi/itc-testing-tools | refs/heads/master | /python/uno-parser.py | import sys
import os.path
from itertools import takewhile
report = sys.argv[1]
with open(report) as f:
for line in f.readlines():
a = line.strip().split(":")
if (len(a) >= 4) and (a[0] == 'uno'):
if len(a[2]) > 10: # hack to work around bug in printint wrong array indexing
... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,561 | wubozhi/itc-testing-tools | refs/heads/master | /python/latex.py | import os
import sys
from math import sqrt
def lines(file_path):
with open(file_path) as f:
return f.read().splitlines()
def nice(toolname):
if toolname == 'clangcore':
return "Clang (core)"
if toolname == 'clangalpha':
return "Clang (alpha)"
if toolname == 'clangcorealpha':
... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,562 | wubozhi/itc-testing-tools | refs/heads/master | /python/framac.py | import sys
import os
import os.path
import system
import dirutils
import tempfile
import shutil
from shutil import copyfile
from pathlib import Path
temp_path = os.path.abspath(sys.argv[1])
directory = os.path.abspath(sys.argv[2])
csv = os.path.abspath(sys.argv[3])
exe = sys.argv[4]
if (len(sys.argv) > 5):... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
65,563 | wubozhi/itc-testing-tools | refs/heads/master | /python/flint++.py | import json
import sys
import os.path
import system
import dirutils
import shutil
import tempfile
from pathlib import Path
json_path = os.path.abspath(sys.argv[1])
temp_path = os.path.abspath(sys.argv[2])
directory = os.path.abspath(sys.argv[3])
csv = os.path.abspath(sys.argv[4])
exe = sys.argv[5]
opts ... | {"/python/clanalyze.py": ["/python/system.py"], "/benchmark.py": ["/python/system.py", "/python/clanalyze.py", "/python/latex.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.