index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
22,438 | opendata-stuttgart/meinsack | refs/heads/master | /sack/main/management/commands/schaalundmueller_datafile_parsing.py | # coding=utf-8
from django.core.management import BaseCommand
from main.models import Street, Area, PickUpDate
from main.utils import parse_schaal_und_mueller_csv_data
class Command(BaseCommand):
help = "schaal+mueller datafile parsing"
def add_arguments(self, parser):
parser.add_argument('--filena... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,439 | opendata-stuttgart/meinsack | refs/heads/master | /sack/main/urls.py | # coding=utf-8
from django.conf.urls import include, url
from rest_framework.routers import Route, SimpleRouter, DynamicDetailRoute
from .views import ZipCodeViewSet, StreetViewSet
class ZipCodeRouter(SimpleRouter):
routes = [
Route(
url=r'^$',
mapping={'get': 'list'},
... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,440 | opendata-stuttgart/meinsack | refs/heads/master | /sack/tests/conftest.py | import os
import pytest
@pytest.fixture
def stuttgart_districts():
return os.path.join(os.path.dirname(os.path.abspath(__file__)),
'fixtures/',
'stuttgart_districts.html')
@pytest.fixture
def mocked_district(stuttgart_districts):
import responses
from main.... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,441 | opendata-stuttgart/meinsack | refs/heads/master | /sack/main/serializers.py | import datetime
from rest_framework import serializers, relations
from rest_framework.reverse import reverse
from .models import Street, ZipCode, Area
class StreetDetailSerializer(serializers.HyperlinkedModelSerializer):
dates = serializers.SerializerMethodField()
def get_dates(self, obj):
try:
... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,442 | opendata-stuttgart/meinsack | refs/heads/master | /sack/main/management/commands/get_streets.py | # coding=utf-8
from django.core.management import BaseCommand
class Command(BaseCommand):
help = "Import streets and districts"
def handle(self, *args, **options):
from main.utils import (
add_district_to_database,
add_street_to_database,
extract_district_from_tr,... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,443 | opendata-stuttgart/meinsack | refs/heads/master | /sack/tests/test_streetnames.py | import pytest
from main.utils import get_possible_street_variants
class TestStreetNameVariants:
@pytest.mark.parametrize(('street_name', 'results'), (
('Ulmer Straße', (
'Ulmer Straße', 'Ulmer Strasse', 'Ulmer Str.', 'Ulmerstraße',
'Ulmerstrasse', 'Ulmerstr.')),
('Daimler... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,444 | opendata-stuttgart/meinsack | refs/heads/master | /sack/main/utils.py | import datetime
import re
from bs4 import BeautifulSoup
import requests
def get_districts_stuttgart():
url = 'http://onlinestreet.de/strassen/in-Stuttgart.html'
data = requests.get(url).content
soup = BeautifulSoup(data, 'html.parser')
for table in soup.findAll('table'):
if 'blz' in table.get... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,445 | opendata-stuttgart/meinsack | refs/heads/master | /sack/main/views.py | import datetime
from rest_framework import viewsets, mixins, response
from rest_framework.response import Response
from rest_framework import renderers
from rest_framework import decorators
from rest_framework.exceptions import NotFound
from django.views.generic.edit import FormView
from django.shortcuts import render
... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,446 | opendata-stuttgart/meinsack | refs/heads/master | /sack/main/management/commands/schaalundmueller_districts.py | # coding=utf-8
from django.core.management import BaseCommand
from main.models import Street, Area, PickUpDate
from main.utils import call_schaal_und_mueller_district
import datetime
class Command(BaseCommand):
help = "schaal+mueller districts"
def handle(self, *args, **options):
l = Street.objects.... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,447 | opendata-stuttgart/meinsack | refs/heads/master | /sack/main/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='District',
fields=[
... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,448 | opendata-stuttgart/meinsack | refs/heads/master | /sack/main/models.py | from django.db import models
from django_extensions.db.models import TimeStampedModel
class District(TimeStampedModel):
name = models.CharField(max_length=255)
city = models.CharField(max_length=255)
number_of_streets = models.IntegerField()
url_onlinestreet = models.URLField()
class Meta:
... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,449 | opendata-stuttgart/meinsack | refs/heads/master | /sack/main/management/commands/schaalundmueller.py | # coding=utf-8
from django.core.management import BaseCommand
from main.models import Street
from main.utils import call_schaal_und_mueller_for_district_id
class Command(BaseCommand):
help = "schaal+mueller id crawling"
def handle(self, *args, **options):
for street in Street.objects\
... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,450 | opendata-stuttgart/meinsack | refs/heads/master | /sack/main/admin.py | from django.contrib import admin
from .models import District, Street, ZipCode, Area, PickUpDate
@admin.register(District)
class DistrictAdmin(admin.ModelAdmin):
list_display = ['name', 'city']
@admin.register(Street)
class StreetAdmin(admin.ModelAdmin):
list_display = ['name', 'district', 'zipcode', 'city'... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,451 | opendata-stuttgart/meinsack | refs/heads/master | /sack/tests/test_schaalundmueller.py | import datetime
import os
import pytest
from main.utils import call_schaal_und_mueller_for_district_id, call_schaal_und_mueller_district
@pytest.fixture
def schaalundmueller_ulmerstrasse():
return os.path.join(os.path.dirname(os.path.abspath(__file__)),
'fixtures/',
... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,452 | opendata-stuttgart/meinsack | refs/heads/master | /sack/sack/urls.py | from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from django.views.generic import TemplateView
from rest_framework.authtoken.views import obtain_auth_token
from main.views import GetIcalView
urlpatterns = [
url(r'^admin/', admin.site.ur... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,453 | opendata-stuttgart/meinsack | refs/heads/master | /sack/tests/test_district.py | import os.path
import pytest
import responses
from main.utils import (
add_street_to_database,
extract_district_from_tr,
extract_street_from_tr,
get_streets_from_district,
normalize_street,
)
@pytest.fixture
def stuttgart_streets_hausen():
return os.path.join(os.path.dirname(os.path.abspath(_... | {"/sack/main/urls.py": ["/sack/main/views.py"], "/sack/main/serializers.py": ["/sack/main/models.py"], "/sack/main/views.py": ["/sack/main/models.py", "/sack/main/serializers.py"], "/sack/main/admin.py": ["/sack/main/models.py"]} |
22,454 | kevingasik/BasileRoboticsRPI | refs/heads/master | /deep_learning_object_detection.py | # import the necessary packages
import numpy as np
import argparse
import cv2
#construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i","--image", required=True,help="path to input image")
ap.add_argument("-p","--prototxt",required=True,help="path to Caffe 'deploy' proto... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,455 | kevingasik/BasileRoboticsRPI | refs/heads/master | /MorningGlory/MGbuttons.py | import time
import os
import RPi.GPIO as GPIO
import cv2
class MGButtons():
GPIO.setmode(GPIO.BCM)
#BCM17,11 Motor_INB
#BCM22 15 Motor_EnB
#BCM5,29 Motor_CS
#Motor_EnA, BCM13 33
#BCM26,37 Motor_INA
#MotorPWM BCM18_PCM_C 12 but in verision one it was where?
def __init__(self):
self.button_dict = {}
... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,456 | kevingasik/BasileRoboticsRPI | refs/heads/master | /unifyingcameras.py | from imutils.video import VideoStream
import datetime
import argparse
import imutils
import time
import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-p","--picamera", type=int, default=-1,help="weather or not the pi cam should be used")
args = vars(ap.parse_args())
#init the video stream and allow the camera s... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,457 | kevingasik/BasileRoboticsRPI | refs/heads/master | /CV_test_scripting.py | import numpy as np
import cv2
faceCascade = cv2.CascadeClassifier('/usr/local/lib/python3.7/dist-packages/cv2/data/haarcascade_frontalface_default.xml')
#faceCascade = cv2.CascadeClassifier('lbp_cascade_frontalface.xml')
#eyeCascade= cv2.CascadeClassifier('/usr/local/lib/python3.7/dist-packages/cv2/data/haarcascade_eye... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,458 | kevingasik/BasileRoboticsRPI | refs/heads/master | /MorningGlory/rotary_switch.py | import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
# switch pinout
switch1 = 18
switch2 = 17
switch3 = 27
switch4 = 22
switch5 = 23
switch6 = 24
switch7 = 25
switch8 = 8
GPIO.setup(switch1,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(switch2,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(switch3,GPIO.IN, pu... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,459 | kevingasik/BasileRoboticsRPI | refs/heads/master | /MorningGlory/serialtesting.py | #!/usr/bin/env python
import serial
import time
import os
import termios
port='/dev/ttyAMA0'
with open(port) as f:
attrs = termios.tcgetattr(f)
attrs[2] = attrs[2] & ~termios.HUPCL
termios.tcsetattr(f, termios.TCSAFLUSH,attrs)
ser = serial.Serial(
port='/dev/ttyACM0',
baudrate = 115200,
... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,460 | kevingasik/BasileRoboticsRPI | refs/heads/master | /TendServos/realtimehelper.py | from imutils.video import VideoStream
import datetime
import argparse
import imutils
import time
import cv2
class RealTimeHelper():
def __init__(self):
self.hello = "hello World"
self.width = 0
self.height = 0
self.classes = ["background", "aeroplane", "bicycle", "bird", "boat",
"bottle", "bus", "ca... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,461 | kevingasik/BasileRoboticsRPI | refs/heads/master | /MorningGlory/MG_serial.py | #!/usr/bin/env python
import serial
import time
import os
import termios
class Animation():
def __init__(self):
self.mystr = "hello"
self.row1 = []
self.row2 = []
def open_serial(self):
port='/dev/ttyAMA0'
#port='/dev/ttyACM0'
with open(port) as f:
attrs = termios.tcgetattr(f)
attrs[2] = ... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,462 | kevingasik/BasileRoboticsRPI | refs/heads/master | /basicmotiondetector.py | #import the ncessary packages
import imutils
import cv2
class BasicMotionDetector:
def __init__(self, accumWeight=0.5,deltaThresh=5,minArea=5000):
#determine the openCv version, followed by storing the
# frame accumlation weight, the fixed threshold for te delta
# image, and finally the minimum area eqruied
... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,463 | kevingasik/BasileRoboticsRPI | refs/heads/master | /webapp/leds.py | import board
import neopixel
pixels = neopixel.NeoPixel(board.D18, 5)
pixels[3] = (255, 0, 0)
#pixels.fill((0, 255, 0))
# import neopixel
# from board import *
# RED = 0x100000 # (0x10, 0, 0) also works
# pixels = neopixel.NeoPixel(NEOPIXEL, 10)
# for i in range(len(pixels)):
# pixels[i] = RED
| {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,464 | kevingasik/BasileRoboticsRPI | refs/heads/master | /real_time_object_detection1.py |
from imutils.video import VideoStream
from imutils.video import FPS
import numpy as np
import argparse
import imutils
import time
import cv2
#construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i","--image", required=True,help="path to input image")
ap.add_argument("... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,465 | kevingasik/BasileRoboticsRPI | refs/heads/master | /real_time_object_detection.py | # USAGE
# python3 real_time_object_detection.py --prototxt MobileNetSSD_deploy.prototxt.txt --model MobileNetSSD_deploy.caffemodel
# import the necessary packages
from imutils.video import VideoStream
from imutils.video import FPS
import numpy as np
import argparse
import imutils
import time
import cv2
# construct t... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,466 | kevingasik/BasileRoboticsRPI | refs/heads/master | /videostream.py | # import the ncessary packages
from webcamvideostream import WebcamVideoStream
class VideoStream:
def __init__(self, src=0,usePiCamera=False, resolution=(320,240),framerate=32):
#check to see if the picamera module should be used
if usePiCamera:
from pivideostream import PiVideoStream
self.stream = PiVide... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,467 | kevingasik/BasileRoboticsRPI | refs/heads/master | /TendServos/tendserial.py | #!/usr/bin/env python
import serial
import time
import os
import termios
import cv2
import datetime
import threading
class TendSerial():
def __init__(self):
self.mystr = "hello"
self.row1 = []
self.row2 = []
self.openPort = False
self.freq = 3
self.right = 0
self.left = 0
def open_serial(self)... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,468 | kevingasik/BasileRoboticsRPI | refs/heads/master | /usb_camera.py | #import the necessary packages
from __future__ import print_function
from basicmotiondetector import BasicMotionDetector
from imutils.video import VideoStream
import numpy as np
import datetime
import datetime
import imutils
import time
import cv2
import argparse
#init the video streams and all them to warump
print("... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,469 | kevingasik/BasileRoboticsRPI | refs/heads/master | /MorningGlory/main_MG_animation.py | #!/usr/bin/env python
import serial
import time
import os
import termios
import MG_serial
def main():
comms = MG_serial.Animation()
comms.open_serial()
print(comms.ser.readline())
count = 0
while True:
data = input("Enter something : ")
data = data +'\r\n'
if(data == "animate\r\n"):
comms.genera... | {"/usb_camera.py": ["/basicmotiondetector.py"]} |
22,475 | msokolik55/MessengerBots-python | refs/heads/main | /autobot.py | from fbchat import Client # , log
from fbchat.models import Message
from datetime import datetime
class AutoBot(Client):
def listen(self, markAlive=None):
if markAlive is not None:
self.setActiveStatus(markAlive)
self.startListening()
self.onListening()
recipient_i... | {"/main.py": ["/echobot.py", "/config.py"], "/addresses.py": ["/config.py"]} |
22,476 | msokolik55/MessengerBots-python | refs/heads/main | /main.py | from echobot import EchoBot
from config import EMAIL, PASSWORD
client = EchoBot(EMAIL, PASSWORD)
client.listen()
| {"/main.py": ["/echobot.py", "/config.py"], "/addresses.py": ["/config.py"]} |
22,477 | msokolik55/MessengerBots-python | refs/heads/main | /echobot.py | from fbchat import Client # , log
class Reply:
def __init__(self, keys, output):
self.keys = keys
self.output = output
class EchoBot(Client):
goodNight = Reply(["dobru noc"], "dobru noc ;*")
goodMorning = Reply(["dobre rano", "dobre ranko"], "dobre rano prajem :)")
goodAfternoon = R... | {"/main.py": ["/echobot.py", "/config.py"], "/addresses.py": ["/config.py"]} |
22,478 | msokolik55/MessengerBots-python | refs/heads/main | /config.py | from getpass import getpass
EMAIL = input("Email: ")
PASSWORD = getpass()
| {"/main.py": ["/echobot.py", "/config.py"], "/addresses.py": ["/config.py"]} |
22,479 | msokolik55/MessengerBots-python | refs/heads/main | /addresses.py | from fbchat import Client
from unidecode import unidecode
from config import EMAIL, PASSWORD
client = Client(EMAIL, PASSWORD)
# Fetches a list of all users you're currently chatting with, as `User` objects
users = client.fetchAllUsers()
"""
for user in users:
name = unidecode(user.name).lower()
if "michal" i... | {"/main.py": ["/echobot.py", "/config.py"], "/addresses.py": ["/config.py"]} |
22,487 | lukh/microparcel-python | refs/heads/master | /tests/test_up_message.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `microparcel` package."""
import unittest
from microparcel import microparcel as up
class TestMicroparcelMessage(unittest.TestCase):
"""Tests for `microparcel` package."""
def setUp(self):
"""Set up test fixtures, if any."""
def tear... | {"/tests/test_up_message.py": ["/microparcel/__init__.py"], "/microparcel/__init__.py": ["/microparcel/microparcel.py"], "/tests/test_up_parser.py": ["/microparcel/__init__.py"]} |
22,488 | lukh/microparcel-python | refs/heads/master | /tests/__init__.py | # -*- coding: utf-8 -*-
"""Unit test package for microparcel."""
| {"/tests/test_up_message.py": ["/microparcel/__init__.py"], "/microparcel/__init__.py": ["/microparcel/microparcel.py"], "/tests/test_up_parser.py": ["/microparcel/__init__.py"]} |
22,489 | lukh/microparcel-python | refs/heads/master | /microparcel/microparcel.py | # -*- coding: utf-8 -*-
from enum import Enum
class Message(object):
"""
Encapsulates data byte
Provide bit access to the data via get/set.
"""
def __init__(self, size=0, data=None):
assert (data is None or isinstance(data, list))
self.data = [0 for i in range(size)] if da... | {"/tests/test_up_message.py": ["/microparcel/__init__.py"], "/microparcel/__init__.py": ["/microparcel/microparcel.py"], "/tests/test_up_parser.py": ["/microparcel/__init__.py"]} |
22,490 | lukh/microparcel-python | refs/heads/master | /microparcel/__init__.py | # -*- coding: utf-8 -*-
"""Top-level package for microparcel."""
__author__ = """Vivien Henry"""
__email__ = 'vivien.henry@outlook.fr'
__version__ = '0.1.1'
from .microparcel import Message, Frame, make_parser_cls
| {"/tests/test_up_message.py": ["/microparcel/__init__.py"], "/microparcel/__init__.py": ["/microparcel/microparcel.py"], "/tests/test_up_parser.py": ["/microparcel/__init__.py"]} |
22,491 | lukh/microparcel-python | refs/heads/master | /tests/test_up_parser.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `microparcel` package."""
import unittest
from microparcel import microparcel as up
class TestMicroparcelParser(unittest.TestCase):
"""Tests for `microparcel` package."""
def setUp(self):
"""Set up test fixtures, if any."""
def tearD... | {"/tests/test_up_message.py": ["/microparcel/__init__.py"], "/microparcel/__init__.py": ["/microparcel/microparcel.py"], "/tests/test_up_parser.py": ["/microparcel/__init__.py"]} |
22,497 | nareynolds/pyRPDR | refs/heads/master | /examples.py | # examples.py
# import pyRPDR
import rpdr
# instantiate RPDR dataset
rpdrDir = "/path/to/directory/containing/RPDR/text/files"
ds = rpdr.Dataset( rpdrDir )
# instantiate a patient
empi = '1234567'
p = rpdr.Patient( ds, empi )
# print patient's timeline
p.timeline()
# print patient's timeline for limited table... | {"/examples.py": ["/rpdr.py"]} |
22,498 | nareynolds/pyRPDR | refs/heads/master | /rpdr.py | # rpdr.py
# add working directory to search path
import os
import sys
sys.path.insert(0, os.path.realpath(__file__))
# get RPDR Table info
import rpdrdefs
# get file management tools
import shutil
import fnmatch
import re
# get SQLite tools
import sqlite3
# get csv tools
import csv
# get time tools
import time
... | {"/examples.py": ["/rpdr.py"]} |
22,499 | nareynolds/pyRPDR | refs/heads/master | /rpdrdefs.py | # rpdrtables.py
# get csv tools
from csv import QUOTE_NONE
# get namedtuple
from collections import namedtuple
#--------------------------------------------------------------------------------------------
# define RPDR table column foreign key reference
ForeignKeyRef = namedtuple('ForeignKeyRef','table column')
... | {"/examples.py": ["/rpdr.py"]} |
22,513 | chuzarski/superpong | refs/heads/master | /entities.py | from controllers import *
from rotating_rectangle import RotatingRect
from colors import *
class Player():
def __init__(self, name, pos, surf_size):
self.__paddle = None
self.__name = name
self.__controller = Controller() # default controller. Does nothing when polled
self.__posit... | {"/game.py": ["/entities.py"]} |
22,514 | chuzarski/superpong | refs/heads/master | /game.py | # Program: Superpong !
# Date: 12-10-2015
# Edited by: Cody Huzarski
import pygame, sys, math, time, random
from colors import *
from pygame.locals import *
from entities import *
from controllers import *
from util import LifeCycle
class Game(LifeCycle):
def __init__(self, surface):
LifeCycle.__init__(se... | {"/game.py": ["/entities.py"]} |
22,549 | sarv19/ass4 | refs/heads/master | /upload/src/main/mp/codegen/CodeGenerator.py | '''
* @author Nguyen Hua Phung
* @version 1.0
* 23/10/2015
* This file provides a simple version of code generator
*
'''
from Utils import *
from StaticCheck import *
from StaticError import *
from Emitter import Emitter
from Frame import Frame
from abc import ABC, abstractmethod
class CodeGenerator(Utils... | {"/upload/src/main/mp/parser/MPVisitor.py": ["/upload/src/main/mp/parser/MPParser.py"]} |
22,550 | sarv19/ass4 | refs/heads/master | /upload/src/main/mp/parser/MPParser.py | # Generated from main/mp/parser/MP.g4 by ANTLR 4.7.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3?")
buf.write("\u018d\4\2\t\2\4\3\t... | {"/upload/src/main/mp/parser/MPVisitor.py": ["/upload/src/main/mp/parser/MPParser.py"]} |
22,551 | sarv19/ass4 | refs/heads/master | /upload/src/main/mp/astgen/ASTGeneration.py | from MPVisitor import MPVisitor
from MPParser import MPParser
from AST import *
from functools import reduce
class ASTGeneration(MPVisitor):
def visitProgram(self, ctx: MPParser.ProgramContext):
return Program(reduce(lambda a, x: a + x, [self.visit(x) for x in ctx.decl()], []))
def visitDecl(self, ctx... | {"/upload/src/main/mp/parser/MPVisitor.py": ["/upload/src/main/mp/parser/MPParser.py"]} |
22,552 | sarv19/ass4 | refs/heads/master | /upload/src/main/mp/parser/MPLexer.py | # Generated from main/mp/parser/MP.g4 by ANTLR 4.7.1
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
from lexererr import *
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2?")
buf.write("\u026e\b\1\4... | {"/upload/src/main/mp/parser/MPVisitor.py": ["/upload/src/main/mp/parser/MPParser.py"]} |
22,553 | sarv19/ass4 | refs/heads/master | /upload/src/main/mp/parser/MPVisitor.py | # Generated from main/mp/parser/MP.g4 by ANTLR 4.7.1
from antlr4 import *
if __name__ is not None and "." in __name__:
from .MPParser import MPParser
else:
from MPParser import MPParser
# This class defines a complete generic visitor for a parse tree produced by MPParser.
class MPVisitor(ParseTreeVisitor):
... | {"/upload/src/main/mp/parser/MPVisitor.py": ["/upload/src/main/mp/parser/MPParser.py"]} |
22,554 | sarv19/ass4 | refs/heads/master | /upload/src/test/CodeGenSuite.py | import unittest
from TestUtils import TestCodeGen
from AST import *
class CheckCodeGenSuite(unittest.TestCase):
# def test_int(self):
# """Simple program: int main() {} """
# input = """procedure main(); begin putInt(100); end"""
# expect = "100"
# self.assertTrue(TestCodeGen.test(... | {"/upload/src/main/mp/parser/MPVisitor.py": ["/upload/src/main/mp/parser/MPParser.py"]} |
22,570 | Pestisy/WCS | refs/heads/master | /addons/source-python/plugins/wcs/core/helpers/esc/commands.py | # ../wcs/core/helpers/esc/commands.py
# ============================================================================
# >> IMPORTS
# ============================================================================
# Python Imports
# Random
from random import choice
# Shlex
from shlex import split
# String
from string... | {"/addons/source-python/plugins/wcs/core/helpers/esc/commands.py": ["/addons/source-python/plugins/wcs/core/players/__init__.py"]} |
22,571 | Pestisy/WCS | refs/heads/master | /addons/source-python/plugins/wcs/core/players/__init__.py | # ../wcs/core/players/__init__.py
# ============================================================================
# >> IMPORTS
# ============================================================================
# Source.Python Imports
# Entities
from entities.entity import Entity
# Listeners
from listeners import OnEnti... | {"/addons/source-python/plugins/wcs/core/helpers/esc/commands.py": ["/addons/source-python/plugins/wcs/core/players/__init__.py"]} |
22,572 | Pestisy/WCS | refs/heads/master | /addons/source-python/plugins/wcs/core/menus/close.py | # ../wcs/core/menus/close.py
# ============================================================================
# >> IMPORTS
# ============================================================================
# WCS Imports
# Menus
from . import raceinfo_detail_menu
from . import raceinfo_skills_menu
from . import raceinfo_sk... | {"/addons/source-python/plugins/wcs/core/helpers/esc/commands.py": ["/addons/source-python/plugins/wcs/core/players/__init__.py"]} |
22,573 | Pestisy/WCS | refs/heads/master | /addons/source-python/plugins/wcs/core/helpers/esc/vars.py | # ../wcs/core/helpers/esc/vars.py
# ============================================================================
# >> IMPORTS
# ============================================================================
# Source.Python Imports
# Core
from core import GAME_NAME
# CVars
from cvars import ConVar
# WCS Imports
# ... | {"/addons/source-python/plugins/wcs/core/helpers/esc/commands.py": ["/addons/source-python/plugins/wcs/core/players/__init__.py"]} |
22,596 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/beta modules/Mask_Cleanup.py | """
===========================
@Author : aguajardo<aguajardo.me>
@Version: 1.0 24/03/2017
This is a color detection method that allows to focus onto the
color being detected with color variance.
===========================
"""
import cv2
import numpy as np
import matplotlib.pyplot as plt
import Color_Detection as... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,597 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/other/Drahterfassung_PIL.py | from PIL import Image
from PIL import ImageChops
import numpy as np
from matplotlib import pyplot as plt
image1=Image.open('Bilder\im1.jpg')
image2=Image.open('Bilder\im2.jpg')
image=ImageChops.subtract(image2, image1)
mask1=Image.eval(image, lambda a: 0 if a<=10 else 255)
mask2=mask1.convert('1')
blank=Image.eval(... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,598 | aguajardo/CENSE_Demonstrator | refs/heads/master | /RTDE_Interface/TestB.py | import RTDE_Controller_CENSE as rtde
print(rtde.current_position())
rtde.go_start_via_path()
rtde.go_camera()
#rtde.go_start_via_path()
rtde.disconnect_rtde()
| {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,599 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/other/Drahterfassung_Thresholding.py | import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('Bilder\Buddah3.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img = cv2.resize(img, None, fx=0.125, fy=0.125)
gray = cv2.resize(gray, None, fx=0.125, fy=0.125)
retval, thresh = cv2.threshold(gray, 80, 255, cv2.THRESH_BINARY)
retva... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,600 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/beta modules/Edge_Detection.py | """
===========================
@Author : aguajardo<aguajardo.me>
@Version: 1.0 28/03/2017
This is a color detection method that allows to focus onto the
color being detected with color variance.
===========================
"""
import cv2
import numpy as np
import matplotlib.pyplot as plt
def edge_vision(name, mi... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,601 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/Color_Detection.py | """
===========================
@Author : aguajardo<aguajardo.me>
@Version: 1.0 24/03/2017
This is a color detection method that allows to focus onto the
color being detected with color variance.
===========================
"""
import cv2
import numpy as np
# an image or saved image will be color processed and t... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,602 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/other/Drahterfassung_MultiFilterComparison.py | import numpy as np
import cv2
import Thinning as skelet
import matplotlib.pyplot as plt
SCALE = 0.1
img = cv2.imread('Bilder\Draht1.jpg')
img = cv2.resize(img, None, fx=SCALE, fy=SCALE)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
hsv = cv2.cvtColor(img, cv2.COLOR_RGB2HSV)
LOWER_GREEN = np.array([15,45,50])
UPPER_GREEN... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,603 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/other/Drahterfassung_Farbenerkennung.py | import numpy as np
import cv2
import Thinning as skelet
import matplotlib.pyplot as plt
SCALE = 0.25
img = cv2.imread('Bilder\Draht1.jpg')
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
LOWER_GREEN = np.array([10,30,50])
UPPER_GREEN = np.array([40,100,255])
mask = cv2.inRange(hsv, LOWER_GREEN, UPPER_GREEN)
mask = cv2.di... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,604 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/Main_Vision.py | """
===========================
@Author : aguajardo<aguajardo.me>
@Version: 1.0 24/03/2017
This is a module for detecting a cable
with use of color detection and then
skeletonizing it with the Zhan-Suen
thinning algorithm.
===========================
"""
import cv2
import numpy as np
import matplotlib.pyplot as pl... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,605 | aguajardo/CENSE_Demonstrator | refs/heads/master | /realWorld.py | #from World.world import World
from RTDE_Interface import RTDE_Controller_CENSE as rtde
import math
from multiprocessing import Process
import numpy as np
class RealWorld():
pi = math.pi
scaling_constant = .03
turn_constant = 45
def move_left(self):
current_pos = rtde.current_position()
... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,606 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/beta modules/Testing_Colors.py | """
===========================
@Author : aguajardo<aguajardo.me>
@Version: 1.0 24/03/2017
This is a module for taking images from a
webcam and saving them as a png.
===========================
"""
import cv2
import numpy as np
import matplotlib.pyplot as plt
import Color_Detection as colors
def preview_colors(co... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,607 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/Kalibrierung.py | """
===========================
@Author : aguajardo<aguajardo.me>
@Version: 1.0 24/03/2017
This is a camera calibration method.
===========================
"""
import cv2
import numpy as np
import matplotlib.pyplot as plt
from Drahterfassung_OpenCV import Kamera as cam
import time
from Drahterfassung_OpenCV.calibr... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,608 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/other/Drahterfassung_Hough.py | import numpy as np
import cv2
from PIL import Image
img = cv2.imread('Bilder\Draht1.jpg')
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
edges = cv2.Canny(gray,50,150,apertureSize = 3)
minLineLength = 1
maxLineGap = 20
lines = cv2.HoughLinesP(edges,1,np.pi/180,100,minLineLength,maxLineGap)
print('Lines found: {}'.forma... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,609 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/Kamera.py | """
===========================
@Author : aguajardo<aguajardo.me>
@Version: 1.0 24/03/2017
This is a module for taking images from a
webcam and saving them as a png.
===========================
"""
import cv2
import numpy as np
import matplotlib.pyplot as plt
import Drahterfassung_OpenCV.Kalibrierung as cal
# cam... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,610 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/other/Drahterfassung_BackgroundSubstractorMOG.py | import numpy as np
import cv2
import sys
bgSub=cv2.createBackgroundSubtractorMOG2()
for i in range(1,15):
bgImageFile = "bg{0}.jpg".format(i)
bg = cv2.imread(bgImageFile)
bg=cv2.resize(bg,None,fx=0.125,fy=0.125)
bgSub.apply(bg, learningRate=0.5)
stillFrame=cv2.imread('Still1.jpg')
stillFrame=cv2.resiz... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,611 | aguajardo/CENSE_Demonstrator | refs/heads/master | /RTDE_Interface/RTDE_Controller_CENSE_2.py | """
===========================
@Author : aguajardo<aguajardo.me>
@Version: 1.0 24/03/2017
This is a module for RTDE Control
of a UR5 from Universal Robots.
===========================
"""
import sys
import logging
import RTDE_Interface.rtde_client.rtde.rtde as rtde
import RTDE_Interface.rtde_client.rtde.rtde_conf... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,612 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/other/Drahterfassung_GrabCut.py | import numpy as np
import cv2
from matplotlib import pyplot as plt
from PIL import Image
# Import image with PIL
img = Image.open('Bilder\Draht1.jpg')
# Rotate image 180 degrees
img_r = img.rotate(180, expand=True)
# Transform image into Numpy Array
img_r = np.array(img_r)
# RGB to BGR
# img_r = img_r[:, :, ::-1].c... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,613 | aguajardo/CENSE_Demonstrator | refs/heads/master | /RTDE_Interface/TestA.py | import RTDE_Controller_CENSE as rtde
while True:
print(rtde.Positions.all_positions)
rtde.go_start_via_path()
print ('Start Position')
rtde.move_to_position([-0.10782, 0.3822, 0.5866, 0.0, -0.136, 1.593])
print ('Position 1')
rtde.move_to_position([-0.10782, 0.4822, 0.5866, 0.0, -0.136, 1.593]... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,614 | aguajardo/CENSE_Demonstrator | refs/heads/master | /Drahterfassung_OpenCV/beta modules/Mask_Cleanup_2.py | """
===========================
@Author : aguajardo<aguajardo.me>
@Version: 1.0 24/03/2017
This is a color detection method that allows to focus onto the
color being detected with color variance.
===========================
"""
import cv2
import numpy as np
import matplotlib.pyplot as plt
import Color_Detection as... | {"/Drahterfassung_OpenCV/Main_Vision.py": ["/Drahterfassung_OpenCV/Color_Detection.py", "/Drahterfassung_OpenCV/Kamera.py"], "/Drahterfassung_OpenCV/Kalibrierung.py": ["/Drahterfassung_OpenCV/Color_Detection.py"], "/Drahterfassung_OpenCV/Kamera.py": ["/Drahterfassung_OpenCV/Kalibrierung.py"]} |
22,620 | jung-bak/Arqui2_Proyecto_1 | refs/heads/main | /BloqueCache.py | class BloqueCache:
def __init__(self, identifier):
self.identifier = identifier
self.estado = 'I'
self.direccion = '0'
self.dato = '0'
#Setter and Getters for Estado
def b_estadoSet(self,nuevoEstado):
self.estado = nuevoEstado
return
def b_estadoGet(self)... | {"/Processor.py": ["/Cache.py"], "/GUI.py": ["/Processor.py", "/Memory.py", "/Snoop.py"], "/Cache.py": ["/SetCache.py"], "/SetCache.py": ["/BloqueCache.py"]} |
22,621 | jung-bak/Arqui2_Proyecto_1 | refs/heads/main | /Processor.py | import time
from numpy import array2string
from Cache import Cache
class Processor:
def __init__(self, identifier, memory, timer):
self.identifier = identifier
self.timer = timer
self.memory = memory
self.Cache = Cache(self.memory)
self.Publisher = None
self.lastInst... | {"/Processor.py": ["/Cache.py"], "/GUI.py": ["/Processor.py", "/Memory.py", "/Snoop.py"], "/Cache.py": ["/SetCache.py"], "/SetCache.py": ["/BloqueCache.py"]} |
22,622 | jung-bak/Arqui2_Proyecto_1 | refs/heads/main | /Snoop.py | class Subscriber:
def __init__(self, processor):
self.processor = processor
self.processorList = []
self.memory = processor.memory
self.identifier = processor.identifier
def update(self,senderId,message, direccionMemoria):
self.moesi(self.processorList[senderId], self.pr... | {"/Processor.py": ["/Cache.py"], "/GUI.py": ["/Processor.py", "/Memory.py", "/Snoop.py"], "/Cache.py": ["/SetCache.py"], "/SetCache.py": ["/BloqueCache.py"]} |
22,623 | jung-bak/Arqui2_Proyecto_1 | refs/heads/main | /GUI.py | from tkinter import Tk, Label, Button, Entry, OptionMenu, StringVar
from Processor import Processor
from Memory import Memory
from Snoop import Subscriber, Publisher
from numpy import random
from threading import Thread
import time
class GUI:
def __init__(self,master):
self.master = master
master.t... | {"/Processor.py": ["/Cache.py"], "/GUI.py": ["/Processor.py", "/Memory.py", "/Snoop.py"], "/Cache.py": ["/SetCache.py"], "/SetCache.py": ["/BloqueCache.py"]} |
22,624 | jung-bak/Arqui2_Proyecto_1 | refs/heads/main | /Memory.py | import time
from threading import Lock
class Memory:
def __init__(self, timer):
self.mem = ['0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0']
self.timer = timer
self.mutex = Lock()
def memGet(self,position):
self.mutex.acquire()
self.sleep()
self.... | {"/Processor.py": ["/Cache.py"], "/GUI.py": ["/Processor.py", "/Memory.py", "/Snoop.py"], "/Cache.py": ["/SetCache.py"], "/SetCache.py": ["/BloqueCache.py"]} |
22,625 | jung-bak/Arqui2_Proyecto_1 | refs/heads/main | /Cache.py | from SetCache import SetCache
class Cache:
def __init__(self, memory):
self.memory = memory
self.set0 = SetCache(self.memory)
self.set1 = SetCache(self.memory)
def write(self, direccionMemoria, valor):
if (direccionMemoria[-1] == '0'):
return self.set0.s_write(direc... | {"/Processor.py": ["/Cache.py"], "/GUI.py": ["/Processor.py", "/Memory.py", "/Snoop.py"], "/Cache.py": ["/SetCache.py"], "/SetCache.py": ["/BloqueCache.py"]} |
22,626 | jung-bak/Arqui2_Proyecto_1 | refs/heads/main | /SetCache.py | from BloqueCache import BloqueCache
class SetCache:
def __init__(self, memory):
self.lastUsed = 0
self.memory = memory
self.bloque0 = BloqueCache(0)
self.bloque1 = BloqueCache(1)
def s_write(self,direccionMemoria, valor):
if (self.lastUsed == 0):
if (self.bl... | {"/Processor.py": ["/Cache.py"], "/GUI.py": ["/Processor.py", "/Memory.py", "/Snoop.py"], "/Cache.py": ["/SetCache.py"], "/SetCache.py": ["/BloqueCache.py"]} |
22,629 | MillQK/Nsu_Schedule_Telegram_Bot | refs/heads/master | /schedule_crawler.py | import requests
import json
import bs4
import time
from bs4 import BeautifulSoup
def get_gk_links():
url = 'http://www.nsu.ru/education/schedule/Html_GK/schedule.htm'
source_code = requests.get(url)
text = source_code.text
soup = BeautifulSoup(text, "html.parser")
links = []
for link in soup.fi... | {"/flask_pythonanywhere.py": ["/nsubot.py"]} |
22,630 | MillQK/Nsu_Schedule_Telegram_Bot | refs/heads/master | /flask_pythonanywhere.py | # -*- coding: utf-8 -*-
import config
import telebot
from flask import Flask, request, abort
import logging
import nsubot
bot = nsubot.bot
logger = telebot.logger.setLevel(logging.WARN)
WEBHOOK_URL = "https://MilQ.pythonanywhere.com/{}".format(config.webhook_guid)
app = Flask(__name__)
@app.route('/{}'.format(con... | {"/flask_pythonanywhere.py": ["/nsubot.py"]} |
22,631 | MillQK/Nsu_Schedule_Telegram_Bot | refs/heads/master | /nsubot.py | # -*- coding: utf-8 -*-
import config
import telebot
from telebot import types
from random import randint
import json
import pickledb
import datetime
bot = telebot.TeleBot(config.token, threaded=config.bot_threaded)
groups_storage = pickledb.load('groups_storage.db', False)
with open('sch.txt', 'r') as inp:
sch =... | {"/flask_pythonanywhere.py": ["/nsubot.py"]} |
22,637 | JNPRAutomate/junos-babel2 | refs/heads/master | /babel2/device.py | import logging
import pprint
logger = logging.getLogger( 'babel2' )
pp = pprint.PrettyPrinter(indent=4)
class Device:
## o unknown, 1 agg, 2 access \
def __init__( self, name ):
self.__name = name
self.__links = {}
self.__peer = ''
self.__personnality = 0
self.__l... | {"/babel2.py": ["/babel2/lib.py"]} |
22,638 | JNPRAutomate/junos-babel2 | refs/heads/master | /babel2.py | #! /usr/bin/env python
import ansible.inventory
import ansible.inventory.ini
import argparse
from jinja2 import Template
from babel2 import device
from babel2 import parsingerror
import babel2.lib
import pprint
import yaml
import logging
from subprocess import call
from os import path
import os
'''
Usage:
python bab... | {"/babel2.py": ["/babel2/lib.py"]} |
22,639 | JNPRAutomate/junos-babel2 | refs/heads/master | /babel2/lib.py | import logging
import sys
import yaml
from os import path
import defconf
here = path.abspath(path.dirname(__file__))
logger = logging.getLogger( 'babel2' )
# Check if topology file is correct
# All entry have 2 sides with "device interface" for each
def check_topology_file( topology, hosts, parsingError ):
logge... | {"/babel2.py": ["/babel2/lib.py"]} |
22,640 | JNPRAutomate/junos-babel2 | refs/heads/master | /babel2/parsingerror.py | import logging
class ParsingError:
__nbr_error = 0
def __init__( self ):
self.errors = []
def add( self, msg ):
self.errors.append(msg)
self.__nbr_error += 1
def has_error( self ):
if self.__nbr_error == 0 :
return 0
else:
return 1
... | {"/babel2.py": ["/babel2/lib.py"]} |
22,642 | Freebien/ropgenerator | refs/heads/master | /ropgenerator/exploit/Utils.py | # -*- coding:utf-8 -*-
# Utils module: useful functions to build exploits
from ropgenerator.semantic.Engine import search, LMAX
from ropgenerator.Constraints import Constraint, RegsNotModified, Assertion, Chainable, StackPointerIncrement
from ropgenerator.semantic.ROPChains import ROPChain
from ropgenerator.Database i... | {"/ropgenerator/exploit/HighLevelUtils.py": ["/ropgenerator/exploit/Call.py"], "/ropgenerator/exploit/syscalls/Linux32.py": ["/ropgenerator/exploit/syscalls/SyscallDef.py", "/ropgenerator/exploit/Utils.py"], "/ropgenerator/exploit/Syscall.py": ["/ropgenerator/exploit/syscalls/Linux32.py", "/ropgenerator/exploit/syscall... |
22,643 | Freebien/ropgenerator | refs/heads/master | /ropgenerator/exploit/HighLevelUtils.py | # -*- coding:utf-8 -*-
# Utils module: useful functions to build exploits (more advanced features
# than Utils.py)
from ropgenerator.semantic.Engine import search, LMAX
from ropgenerator.Constraints import Constraint, RegsNotModified, Assertion, Chainable, StackPointerIncrement
from ropgenerator.semantic.ROPChains im... | {"/ropgenerator/exploit/HighLevelUtils.py": ["/ropgenerator/exploit/Call.py"], "/ropgenerator/exploit/syscalls/Linux32.py": ["/ropgenerator/exploit/syscalls/SyscallDef.py", "/ropgenerator/exploit/Utils.py"], "/ropgenerator/exploit/Syscall.py": ["/ropgenerator/exploit/syscalls/Linux32.py", "/ropgenerator/exploit/syscall... |
22,644 | Freebien/ropgenerator | refs/heads/master | /ropgenerator/Semantics.py | # -*- coding: utf-8 -*-
# Semantics module: structure to store gadget semantics
from ropgenerator.Conditions import Cond, CT, CTrue, CFalse
from ropgenerator.Expressions import SSAReg
from ropgenerator.Architecture import r2n
class SPair:
"""
SPair = Semantics pair = (Expression, Condition)
"""
def __... | {"/ropgenerator/exploit/HighLevelUtils.py": ["/ropgenerator/exploit/Call.py"], "/ropgenerator/exploit/syscalls/Linux32.py": ["/ropgenerator/exploit/syscalls/SyscallDef.py", "/ropgenerator/exploit/Utils.py"], "/ropgenerator/exploit/Syscall.py": ["/ropgenerator/exploit/syscalls/Linux32.py", "/ropgenerator/exploit/syscall... |
22,645 | Freebien/ropgenerator | refs/heads/master | /ropgenerator/exploit/syscalls/Linux32.py | # -*- coding:utf-8 -*-
# Linux32 module: build syscalls for linux 32 bits
from ropgenerator.exploit.syscalls.SyscallDef import Syscall
from ropgenerator.exploit.Utils import popMultiple
from ropgenerator.IO import verbose, string_bold, string_ropg, string_payload, error
from ropgenerator.semantic.Engine import searc... | {"/ropgenerator/exploit/HighLevelUtils.py": ["/ropgenerator/exploit/Call.py"], "/ropgenerator/exploit/syscalls/Linux32.py": ["/ropgenerator/exploit/syscalls/SyscallDef.py", "/ropgenerator/exploit/Utils.py"], "/ropgenerator/exploit/Syscall.py": ["/ropgenerator/exploit/syscalls/Linux32.py", "/ropgenerator/exploit/syscall... |
22,646 | Freebien/ropgenerator | refs/heads/master | /ropgenerator/exploit/Syscall.py | # -*- coding:utf-8 -*-
# Syscall module: building ropchains performing syscalls
from ropgenerator.IO import string_special, banner, string_bold, error
from enum import Enum
import ropgenerator.exploit.syscalls.Linux32 as Linux32
import ropgenerator.exploit.syscalls.Linux64 as Linux64
import ropgenerator.Architecture a... | {"/ropgenerator/exploit/HighLevelUtils.py": ["/ropgenerator/exploit/Call.py"], "/ropgenerator/exploit/syscalls/Linux32.py": ["/ropgenerator/exploit/syscalls/SyscallDef.py", "/ropgenerator/exploit/Utils.py"], "/ropgenerator/exploit/Syscall.py": ["/ropgenerator/exploit/syscalls/Linux32.py", "/ropgenerator/exploit/syscall... |
22,647 | Freebien/ropgenerator | refs/heads/master | /ropgenerator/exploit/Call.py | # -*- coding:utf-8 -*-
# Call module: call functions with ropchains
from ropgenerator.IO import string_special, string_bold, banner, error, string_ropg
from ropgenerator.Constraints import Constraint, Assertion, BadBytes, RegsNotModified
from ropgenerator.Load import loadedBinary
from ropgenerator.exploit.Scanner im... | {"/ropgenerator/exploit/HighLevelUtils.py": ["/ropgenerator/exploit/Call.py"], "/ropgenerator/exploit/syscalls/Linux32.py": ["/ropgenerator/exploit/syscalls/SyscallDef.py", "/ropgenerator/exploit/Utils.py"], "/ropgenerator/exploit/Syscall.py": ["/ropgenerator/exploit/syscalls/Linux32.py", "/ropgenerator/exploit/syscall... |
22,648 | Freebien/ropgenerator | refs/heads/master | /ropgenerator/exploit/syscalls/SyscallDef.py | # -*- coding:utf-8 -*-
# SyscallDef module: small data structure for syscalls
from ropgenerator.IO import string_special, string_bold
class Syscall:
def __init__(self, retType, name, args, buildFunc):
self.ret = retType
self.name = name
self.args = args
self.buildFunc = buildFunc... | {"/ropgenerator/exploit/HighLevelUtils.py": ["/ropgenerator/exploit/Call.py"], "/ropgenerator/exploit/syscalls/Linux32.py": ["/ropgenerator/exploit/syscalls/SyscallDef.py", "/ropgenerator/exploit/Utils.py"], "/ropgenerator/exploit/Syscall.py": ["/ropgenerator/exploit/syscalls/Linux32.py", "/ropgenerator/exploit/syscall... |
22,649 | Freebien/ropgenerator | refs/heads/master | /ropgenerator/exploit/syscalls/Linux64.py | # -*- coding:utf-8 -*-
# Linux32 module: build syscalls for linux 32 bits
from ropgenerator.exploit.syscalls.SyscallDef import Syscall
from ropgenerator.exploit.Utils import popMultiple
from ropgenerator.exploit.Call import build_call
from ropgenerator.IO import verbose, string_bold, string_ropg, string_payload, err... | {"/ropgenerator/exploit/HighLevelUtils.py": ["/ropgenerator/exploit/Call.py"], "/ropgenerator/exploit/syscalls/Linux32.py": ["/ropgenerator/exploit/syscalls/SyscallDef.py", "/ropgenerator/exploit/Utils.py"], "/ropgenerator/exploit/Syscall.py": ["/ropgenerator/exploit/syscalls/Linux32.py", "/ropgenerator/exploit/syscall... |
22,672 | HadrienRenaud/simple-calculator-kata | refs/heads/master | /test_calculator.py | from unittest import TestCase
from unittest.mock import patch, MagicMock
from calculator import Calculator
class TestCalculator(TestCase):
def test_add_null(self):
self.assertEqual(Calculator.add(""), 0)
def test_add_one(self):
self.assertEqual(Calculator.add("1"), 1)
self.assertEqua... | {"/test_calculator.py": ["/calculator.py"], "/calculator.py": ["/logger.py"]} |
22,673 | HadrienRenaud/simple-calculator-kata | refs/heads/master | /logger.py | class ILogger:
@staticmethod
def write(*args, **kwargs):
print("ILogger:", *args, **kwargs)
class IWebserver:
@staticmethod
def notify(*args, **kwargs):
print("IWebserver:", *args, **kwargs)
| {"/test_calculator.py": ["/calculator.py"], "/calculator.py": ["/logger.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.