index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
94,470 | davidko/LinkbotPythonDemo | refs/heads/master | /buzzer_demo.template.py | import linkbot
import time
my_linkbot = linkbot.Linkbot('$SERIAL_ID')
my_linkbot.set_buzzer_frequency($frequency)
time.sleep(1)
my_linkbot.set_buzzer_frequency(0)
| {"/led_demo.py": ["/util.py", "/led_dialog.py"], "/buzzer_demo.py": ["/util.py", "/buzzer_dialog.py"], "/main.py": ["/util.py", "/mainwindow.py", "/led_demo.py", "/buzzer_demo.py"]} |
94,471 | davidko/LinkbotPythonDemo | refs/heads/master | /buzzer_demo.py | #!/usr/bin/env python3
import sys
import util
from PyQt4 import QtCore, QtGui
from buzzer_dialog import Ui_Dialog
class BuzzerDemo(QtGui.QDialog):
demo_finished_signal = QtCore.pyqtSignal()
def __init__(self, robot_id):
super().__init__()
self.ui = Ui_Dialog()
self.ui.setupUi(self)
... | {"/led_demo.py": ["/util.py", "/led_dialog.py"], "/buzzer_demo.py": ["/util.py", "/buzzer_dialog.py"], "/main.py": ["/util.py", "/mainwindow.py", "/led_demo.py", "/buzzer_demo.py"]} |
94,472 | davidko/LinkbotPythonDemo | refs/heads/master | /main.py | #!/usr/bin/env python3
import sys
import util
from PyQt4 import QtCore, QtGui
from mainwindow import Ui_MainWindow
import led_demo
import buzzer_demo
import move_demo
class MyMainWindow(QtGui.QMainWindow):
def __init__(self):
super().__init__()
self.ui = Ui_MainWindow()
self.ui.setupUi(se... | {"/led_demo.py": ["/util.py", "/led_dialog.py"], "/buzzer_demo.py": ["/util.py", "/buzzer_dialog.py"], "/main.py": ["/util.py", "/mainwindow.py", "/led_demo.py", "/buzzer_demo.py"]} |
94,550 | FoxAndre96/python-lab6 | refs/heads/master | /api.py | from flask import Flask, jsonify, request
import dbfunctions
app = Flask(__name__)
app.secret_key = "veryverysecret"
@app.route('/')
def hello_world():
return 'Hello World!'
@app.route('/listtasks')
def ListTasks():
tasks = dbfunctions.show_tasks()
for task in tasks:
print(task[0])
# need t... | {"/api.py": ["/dbfunctions.py"]} |
94,551 | FoxAndre96/python-lab6 | refs/heads/master | /dbfunctions.py | import pymysql
def add_new_task(task):
sql = "INSERT INTO to_do_list (todo) VALUES (%s)"
conn = pymysql.connect(user='root', password='passwordserver', host='localhost', database='tasks')
cursor = conn.cursor()
result = -1
try:
cursor.execute(sql, (task,))
conn.commit()
... | {"/api.py": ["/dbfunctions.py"]} |
94,564 | ashchristopher/django-sharding-utils | refs/heads/master | /sharding_utils/tests/test_cases/app_router_tests.py | from mock import Mock
from django.test import TestCase
from sharding_utils.routers import BaseAppRouter
class AppRouterTestCase(TestCase):
def test_can_not_instantiate_base_router(self):
# should not be able to create an instance of BaseAppRouter
self.assertRaises(AttributeError, BaseAppRouter)... | {"/sharding_utils/tests/test_cases/app_router_tests.py": ["/sharding_utils/routers.py"], "/setup.py": ["/sharding_utils/__init__.py"], "/sharding_utils/tests/test_cases/field_tests.py": ["/sharding_utils/tests/test_project/id_generation/models.py"], "/sharding_utils/tests/test_project/id_generation/models.py": ["/shard... |
94,565 | ashchristopher/django-sharding-utils | refs/heads/master | /setup.py | import os
from setuptools import setup, find_packages
from sharding_utils import __version__
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='django-sharding-utils',
version=__version__,
packages = find_packages(),
author='Ash Christopher',
aut... | {"/sharding_utils/tests/test_cases/app_router_tests.py": ["/sharding_utils/routers.py"], "/setup.py": ["/sharding_utils/__init__.py"], "/sharding_utils/tests/test_cases/field_tests.py": ["/sharding_utils/tests/test_project/id_generation/models.py"], "/sharding_utils/tests/test_project/id_generation/models.py": ["/shard... |
94,566 | ashchristopher/django-sharding-utils | refs/heads/master | /sharding_utils/fields.py | from django.db import models
class ExternalIdField(models.BigIntegerField):
"""
An id field which uses some external mechanism to populate the id.
"""
def __init__(self, generate_id_callable=None, *args, **kwargs):
super(ExternalIdField, self).__init__(*args, **kwargs)
self.get_id = ge... | {"/sharding_utils/tests/test_cases/app_router_tests.py": ["/sharding_utils/routers.py"], "/setup.py": ["/sharding_utils/__init__.py"], "/sharding_utils/tests/test_cases/field_tests.py": ["/sharding_utils/tests/test_project/id_generation/models.py"], "/sharding_utils/tests/test_project/id_generation/models.py": ["/shard... |
94,567 | ashchristopher/django-sharding-utils | refs/heads/master | /sharding_utils/__init__.py | __version__ = "0.0.1"
__authors__ = (
"Ash Christopher <ash.christopher@gmail.com>",
)
| {"/sharding_utils/tests/test_cases/app_router_tests.py": ["/sharding_utils/routers.py"], "/setup.py": ["/sharding_utils/__init__.py"], "/sharding_utils/tests/test_cases/field_tests.py": ["/sharding_utils/tests/test_project/id_generation/models.py"], "/sharding_utils/tests/test_project/id_generation/models.py": ["/shard... |
94,568 | ashchristopher/django-sharding-utils | refs/heads/master | /sharding_utils/routers.py | class BaseAppRouter(object):
"""
The AppBasedRouter class can be used to create a database router that partitions all data in
a django application into it's own database.
When subclassing the AppBasedRouter, you must provide `app_name` and `db_name` as class
variables.
eg:
class FooBa... | {"/sharding_utils/tests/test_cases/app_router_tests.py": ["/sharding_utils/routers.py"], "/setup.py": ["/sharding_utils/__init__.py"], "/sharding_utils/tests/test_cases/field_tests.py": ["/sharding_utils/tests/test_project/id_generation/models.py"], "/sharding_utils/tests/test_project/id_generation/models.py": ["/shard... |
94,569 | ashchristopher/django-sharding-utils | refs/heads/master | /sharding_utils/tests/test_cases/field_tests.py | from mock import patch
from django.test import TestCase
from sharding_utils.tests.test_project.id_generation.models import SimpleExternalIdFieldModel
class ExternalIdFieldTestCase(TestCase):
def test_auto_id_field_pulls_from_get_id_method(self):
with patch('sharding_utils.tests.test_project.id_generat... | {"/sharding_utils/tests/test_cases/app_router_tests.py": ["/sharding_utils/routers.py"], "/setup.py": ["/sharding_utils/__init__.py"], "/sharding_utils/tests/test_cases/field_tests.py": ["/sharding_utils/tests/test_project/id_generation/models.py"], "/sharding_utils/tests/test_project/id_generation/models.py": ["/shard... |
94,570 | ashchristopher/django-sharding-utils | refs/heads/master | /sharding_utils/tests/test_project/id_generation/__init__.py | def generate_id():
import ipdb; ipdb.set_trace()
return 1
| {"/sharding_utils/tests/test_cases/app_router_tests.py": ["/sharding_utils/routers.py"], "/setup.py": ["/sharding_utils/__init__.py"], "/sharding_utils/tests/test_cases/field_tests.py": ["/sharding_utils/tests/test_project/id_generation/models.py"], "/sharding_utils/tests/test_project/id_generation/models.py": ["/shard... |
94,571 | ashchristopher/django-sharding-utils | refs/heads/master | /sharding_utils/tests/test_project/id_generation/models.py | from django.db import models
from . import generate_id
from sharding_utils.fields import ExternalIdField
class SimpleExternalIdFieldModel(models.Model):
id = ExternalIdField(primary_key=True, generate_id_callable=generate_id)
| {"/sharding_utils/tests/test_cases/app_router_tests.py": ["/sharding_utils/routers.py"], "/setup.py": ["/sharding_utils/__init__.py"], "/sharding_utils/tests/test_cases/field_tests.py": ["/sharding_utils/tests/test_project/id_generation/models.py"], "/sharding_utils/tests/test_project/id_generation/models.py": ["/shard... |
94,572 | ashchristopher/django-sharding-utils | refs/heads/master | /run_tests.py | #!/usr/bin/env python
import sys
from django.conf import settings
_INSTALLED_APPS = (
'sharding_utils',
'sharding_utils.tests.test_project.blog',
'sharding_utils.tests.test_project.id_generation',
)
_DATABASES = {
'default': {
'NAME': ':memory:',
'ENGINE': 'django.db.backends.sqlite... | {"/sharding_utils/tests/test_cases/app_router_tests.py": ["/sharding_utils/routers.py"], "/setup.py": ["/sharding_utils/__init__.py"], "/sharding_utils/tests/test_cases/field_tests.py": ["/sharding_utils/tests/test_project/id_generation/models.py"], "/sharding_utils/tests/test_project/id_generation/models.py": ["/shard... |
94,573 | ashchristopher/django-sharding-utils | refs/heads/master | /sharding_utils/tests/test_project/blog/models.py | from django.db import models
class Post(models.Model):
pass
class Comment(models.Model):
pass
| {"/sharding_utils/tests/test_cases/app_router_tests.py": ["/sharding_utils/routers.py"], "/setup.py": ["/sharding_utils/__init__.py"], "/sharding_utils/tests/test_cases/field_tests.py": ["/sharding_utils/tests/test_project/id_generation/models.py"], "/sharding_utils/tests/test_project/id_generation/models.py": ["/shard... |
94,574 | ashchristopher/django-sharding-utils | refs/heads/master | /sharding_utils/tests/test_cases/__init__.py | from .app_router_tests import *
from .field_tests import *
| {"/sharding_utils/tests/test_cases/app_router_tests.py": ["/sharding_utils/routers.py"], "/setup.py": ["/sharding_utils/__init__.py"], "/sharding_utils/tests/test_cases/field_tests.py": ["/sharding_utils/tests/test_project/id_generation/models.py"], "/sharding_utils/tests/test_project/id_generation/models.py": ["/shard... |
94,606 | langloisjp/pysvclog | refs/heads/master | /setup.py | from setuptools import setup
setup(name='pysvclog',
version='0.1',
description='Module to send service logs to JSON UDP collector',
url='https://github.com/langloisjp/pysvclog',
author='Jean-Philippe Langlois',
author_email='jpl@jplanglois.com',
license='MIT',
py_modules=['ser... | {"/tests/test_doctest.py": ["/servicelog.py"]} |
94,607 | langloisjp/pysvclog | refs/heads/master | /tests/test_doctest.py | import unittest
import doctest
import servicelog
def load_tests(loader, tests, ignore):
tests.addTests(doctest.DocTestSuite(servicelog))
return tests
| {"/tests/test_doctest.py": ["/servicelog.py"]} |
94,608 | langloisjp/pysvclog | refs/heads/master | /servicelog.py | """
Module for sending service logs to a UDP JSON collector.
Defines helper functions configure and log for global
use of the module within an application. A default
logger is always defined at module load time so in most
cases there is no configuring required, just import
the module and 'log'.
Also exposes the UDPLo... | {"/tests/test_doctest.py": ["/servicelog.py"]} |
94,609 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/views/hardware.py | import settings
from flask_jigger.views import api_view, status
from flask import request, abort
import subprocess, os
recorder = None
@api_view
def getState():
def getSensorTemperature(name):
sensor = settings.SENSORS[name]
if sensor:
return sensor.getCurrentTemp()
mashheater... | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,610 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/regulators/heatersimulation.py |
class HeaterSimulation():
'''
classdocs
'''
def __init__(self, pin, watt=None):
self.watt = watt
self.pin = pin
self.frequency = 0.5 #frequency of 2 seconds
self.duty_cycle = 10.0 #duty cycle of 10%
self.state = 'OFF'
def start(self):
prin... | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,611 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/regulators/heater.py | import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
class Heater():
'''
classdocs
'''
def __init__(self, pin, watt=None):
self.watt = watt
self.pin = pin
self.frequency = 0.5 #frequency of 2 seconds
self.duty_cycle = 10.0 #duty cycle of 10%
GPIO.setup(self.pin, G... | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,612 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/application.py | from flask import Flask, url_for, redirect
import settings, background_worker
from mashcontrol.views import hardware, recording
from recorder import Recorder
application = Flask(__name__)
@application.route('/')
def index():
return redirect(url_for('static',filename='index.html'))
recorder = Recorder()
worker =... | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,613 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/regulators/PIController.py | import time
class PIController:
'''
Discrete implementation of the PI controller with a feedforward input
Windup is avoided as the feedback is limited over both the Process and feedforward change
'''
def __init__(self, K=0.7, Tr=20.0, max_output=100, min_output= 0, maxTempChange=6.5):
"... | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,614 | robvanmieghem/brewzone | refs/heads/master | /setup.py | from setuptools import setup, find_packages
if __name__ == '__main__':
pass | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,615 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/recorder.py | import datetime, time
import os
import settings
class Recorder(object):
def __init__(self):
self.recording = False
def start(self, start_time):
now = time.time()
self.start_time = start_time
self.recording_dir = os.path.join(settings.RECORDINGS_DIR,start_time)... | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,616 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/sensors/__init__.py | from ds1820 import DS1820
from simulator import Simulator | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,617 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/sensors/simulator.py | from base_sensor import BaseSensor
import random
class Simulator(BaseSensor):
'''
Simulates a temperature sensor with a random value between 60.0 and 61.0
'''
def __init__(self):
BaseSensor.__init__(self)
def getReading(self):
return 60.0 + random.random() | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,618 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/views/recording.py | import settings
from flask_jigger.views import api_view, status
from flask import request, abort
import os, shutil
#TODO: check with the abspath and commonprefix if no directory traversal is going on
@api_view
def get_recording_list():
recordings_list = []
directories = os.listdir(settings.RECORDINGS_DIR... | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,619 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/background_worker.py | from threading import Thread
import time, sys
import settings
class BackgroundWorker(Thread):
'''
In order to prevent multiple worker threads, only one background thread is started
It instructs the recorder and sensors to update and times the PIControllers
'''
def __init__(self, recorder):
... | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,620 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/regulators/pumpsimulation.py |
class PumpSimulation(object):
def __init__(self, pin):
'''
Constructor
'''
self.pin = pin
self.state = 'OFF'
def start(self):
self.state = 'ON'
def stop(self):
self.state = 'OFF'
| {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,621 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/regulators/pump.py | import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
class Pump(object):
def __init__(self, pin):
'''
Constructor
'''
self.pin = pin
self.state = 'OFF'
GPIO.setup(self.pin, GPIO.OUT, initial=GPIO.LOW)
def start(self):
GPIO.output(self.pin, GPIO... | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,622 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/test/views/recordingtest.py | import unittest
import tempfile, shutil, os
import mashcontrol.settings as settings
import mashcontrol.views.recording as recordingview
class RecordingTest(unittest.TestCase):
def setUp(self):
self.recordings_dir = tempfile.mkdtemp()
settings.RECORDINGS_DIR = self.recordings_dir
def tearDo... | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,623 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/settings.py |
#Run Flask application in Debug mode (reload the process on filechanges)
#This enables the Flask debugger but disables to ability to control the process externally (supervisor or PyDev debugger)
DEBUG = False
PORT = 5000
RECORDINGS_DIR = "/opt/data/brewzone/recordings"
#One wire ids of the DS1820 sensors, put 'None... | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,624 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/sensors/ds1820.py | from base_sensor import BaseSensor
class DS1820(BaseSensor):
"""
A class for getting the current temp of a DS18B20 (on Linux)
"""
def __init__(self, sensorId):
BaseSensor.__init__(self)
self.tempDir = '/sys/bus/w1/devices/'
self.sensorId = sensorId
def getReading(self):
... | {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,625 | robvanmieghem/brewzone | refs/heads/master | /mashcontrol/sensors/base_sensor.py |
class BaseSensor(object):
'''
classdocs
'''
def __init__(self):
self.currentTemp = None
def getReading(self):
return None
def update(self):
self.currentTemp = self.getReading()
def getCurrentTemp(self):
return self.currentTemp
| {"/mashcontrol/test/views/recordingtest.py": ["/mashcontrol/settings.py", "/mashcontrol/views/recording.py"], "/mashcontrol/settings.py": ["/mashcontrol/sensors/__init__.py"]} |
94,644 | gacaydem/simple-flask | refs/heads/master | /demo/app/views.py | from flask_appbuilder import AppBuilder, BaseView, expose, has_access
from app import appbuilder
from flask import render_template
from flask_appbuilder import ModelView
from flask_appbuilder.models.sqla.interface import SQLAInterface
from .models import ContactGroup, Contact
from . import appbuilder, db
class Contac... | {"/demo/app/views.py": ["/demo/app/models.py"]} |
94,645 | gacaydem/simple-flask | refs/heads/master | /demo/app/models.py | from flask_appbuilder import Model
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship
"""
You can use the extra Flask-AppBuilder fields and Mixin's
AuditMixin will add automatic timestamp of created and modified by who
"""
# from wtforms import Form, StringField
# fr... | {"/demo/app/views.py": ["/demo/app/models.py"]} |
94,673 | bwallace722/bw_reading | refs/heads/master | /speed_reading/tests.py | from django.contrib.auth.models import User
from django.test import TestCase
from models import Attempt, Passage
class PassageModelTests(TestCase):
def setUp(self):
Passage.objects.create(passage_title="hi", passage_text="hi")
Passage.objects.create(
passage_title="hi hello", passage_... | {"/speed_reading/views.py": ["/speed_reading/models.py"], "/speed_reading/admin.py": ["/speed_reading/models.py"]} |
94,674 | bwallace722/bw_reading | refs/heads/master | /speed_reading/models.py | from django.contrib.auth.models import User
from django.db import models
class Passage(models.Model):
"""
This corresponds to a reading passage that the user may attempt.
"""
passage_title = models.CharField(default="", max_length=200)
passage_text = models.TextField()
words_in_passage = models... | {"/speed_reading/views.py": ["/speed_reading/models.py"], "/speed_reading/admin.py": ["/speed_reading/models.py"]} |
94,675 | bwallace722/bw_reading | refs/heads/master | /speed_reading/views.py | import json
from django.contrib.auth import (
authenticate, login as auth_login, logout as auth_logout)
from django.contrib.auth.decorators import login_required
from django.core import serializers
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.s... | {"/speed_reading/views.py": ["/speed_reading/models.py"], "/speed_reading/admin.py": ["/speed_reading/models.py"]} |
94,676 | bwallace722/bw_reading | refs/heads/master | /speed_reading/admin.py | from django.contrib import admin
from .models import Passage, Attempt
admin.site.register(Passage)
admin.site.register(Attempt)
| {"/speed_reading/views.py": ["/speed_reading/models.py"], "/speed_reading/admin.py": ["/speed_reading/models.py"]} |
94,677 | bwallace722/bw_reading | refs/heads/master | /speed_reading/urls.py | from django.conf.urls import include, url
from . import views
urlpatterns = [
# Examples:
# url(r'^$', 'bw_reading.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^index/$', views.index, name="index"),
url(r'^login/$', views.login, name="login"),
url(r'^logout/$', vie... | {"/speed_reading/views.py": ["/speed_reading/models.py"], "/speed_reading/admin.py": ["/speed_reading/models.py"]} |
94,679 | gina-alaska/ckan-importer | refs/heads/master | /import_functions.py | # Functions for CKAN importer for Glynx JSON data
import datetime
import re
import json
import geojson
import shapely.wkt, shapely.geometry
import fnmatch
# ckanext-spatial does not support GeometryCollections.
# This function converts GeometryCollections into their corresponding
# single-part (Point, LineString, Poly... | {"/import.py": ["/import_functions.py"]} |
94,680 | gina-alaska/ckan-importer | refs/heads/master | /import.py | #!/usr/bin/env python
#
# This script expects to have an "export" directory from which to load the Glynx data from.
# This directory should have a .json file of the GLynx data and a "files" directory with the
# exported Glynx files. All of these should be automatically created by the Glynx export
# rake task.
#
impo... | {"/import.py": ["/import_functions.py"]} |
94,687 | py-zero/cryptozero | refs/heads/master | /cryptozero/secrecy/asymmetric.py | from typing import IO
class Encrypt:
def __init__(self, key: bytes) -> None:
self.public_key = key
@classmethod
def from_public_key(cls, key: bytes) -> "Encrypt":
return cls(key)
@classmethod
def from_public_key_file(cls, key_file: IO) -> "Encrypt":
return cls.from_public... | {"/test/secrecy/asymmetric/encrypt/test_load.py": ["/cryptozero/secrecy/asymmetric.py"], "/test/test_key_stretch.py": ["/cryptozero/key.py"], "/test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py": ["/cryptozero/secrecy/symmetric.py"], "/test/fixtures/__init__.py": ["/cryptozero/key.py"], "/cryptozero/secrecy/sy... |
94,688 | py-zero/cryptozero | refs/heads/master | /test/secrecy/asymmetric/encrypt/test_load.py | from typing import IO
from cryptozero.secrecy.asymmetric import Encrypt
def test_init_sets_public_key(public_key: bytes):
encrypter = Encrypt(public_key)
assert encrypter.public_key == public_key
def test_loading_from_public_key(public_key: bytes):
expected_encrypter = Encrypt(public_key)
encrypte... | {"/test/secrecy/asymmetric/encrypt/test_load.py": ["/cryptozero/secrecy/asymmetric.py"], "/test/test_key_stretch.py": ["/cryptozero/key.py"], "/test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py": ["/cryptozero/secrecy/symmetric.py"], "/test/fixtures/__init__.py": ["/cryptozero/key.py"], "/cryptozero/secrecy/sy... |
94,689 | py-zero/cryptozero | refs/heads/master | /test/test_key_stretch.py | import hashlib
import inspect
import pytest
from cryptozero.key import pbkdf2_hmac_stretcher, stretch
def test_input_str_output_bytes():
password = "some password"
output = stretch(password)
assert type(output) is bytes
def test_output_longer_than_input():
password = "some password"
output = st... | {"/test/secrecy/asymmetric/encrypt/test_load.py": ["/cryptozero/secrecy/asymmetric.py"], "/test/test_key_stretch.py": ["/cryptozero/key.py"], "/test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py": ["/cryptozero/secrecy/symmetric.py"], "/test/fixtures/__init__.py": ["/cryptozero/key.py"], "/cryptozero/secrecy/sy... |
94,690 | py-zero/cryptozero | refs/heads/master | /test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py | import types
from cryptozero.secrecy.symmetric import (
BackendName,
BackendPayload,
aes_cbc_pkcs7_decrypt_backend,
fernet_decrypt_backend,
get_decrypt_backend,
)
def test_takes_backend_name():
backend_name = BackendName.AES_CBC
get_decrypt_backend(backend_name=backend_name)
def test_re... | {"/test/secrecy/asymmetric/encrypt/test_load.py": ["/cryptozero/secrecy/asymmetric.py"], "/test/test_key_stretch.py": ["/cryptozero/key.py"], "/test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py": ["/cryptozero/secrecy/symmetric.py"], "/test/fixtures/__init__.py": ["/cryptozero/key.py"], "/cryptozero/secrecy/sy... |
94,691 | py-zero/cryptozero | refs/heads/master | /cryptozero/key.py | import hashlib
from typing import Callable, Optional
from mypy_extensions import Arg, DefaultNamedArg
_UNSET = object()
DEFAULT_HASH_NAME = "sha256"
DEFAULT_SALT = b"this is not a great salt"
DEFAULT_ITERATIONS = 100000
StretcherBackend = Callable[
[Arg(str, "input_key"), DefaultNamedArg(bytes, "salt")], bytes
... | {"/test/secrecy/asymmetric/encrypt/test_load.py": ["/cryptozero/secrecy/asymmetric.py"], "/test/test_key_stretch.py": ["/cryptozero/key.py"], "/test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py": ["/cryptozero/secrecy/symmetric.py"], "/test/fixtures/__init__.py": ["/cryptozero/key.py"], "/cryptozero/secrecy/sy... |
94,692 | py-zero/cryptozero | refs/heads/master | /test/fixtures/__init__.py | import io
import os
import random
import string
from tempfile import NamedTemporaryFile
from typing import IO
import pytest
from cryptozero.key import stretch
@pytest.fixture
def random_key() -> bytes:
# we don't intend this to be secure, so we'll use `randbits`
return bytes(bytearray(random.getrandbits(8) ... | {"/test/secrecy/asymmetric/encrypt/test_load.py": ["/cryptozero/secrecy/asymmetric.py"], "/test/test_key_stretch.py": ["/cryptozero/key.py"], "/test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py": ["/cryptozero/secrecy/symmetric.py"], "/test/fixtures/__init__.py": ["/cryptozero/key.py"], "/cryptozero/secrecy/sy... |
94,693 | py-zero/cryptozero | refs/heads/master | /cryptozero/secrecy/symmetric.py | import base64
import enum
import os
from typing import Callable, Dict, NamedTuple, Optional
from cryptography.fernet import Fernet
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.primitives.padding import PKC... | {"/test/secrecy/asymmetric/encrypt/test_load.py": ["/cryptozero/secrecy/asymmetric.py"], "/test/test_key_stretch.py": ["/cryptozero/key.py"], "/test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py": ["/cryptozero/secrecy/symmetric.py"], "/test/fixtures/__init__.py": ["/cryptozero/key.py"], "/cryptozero/secrecy/sy... |
94,694 | py-zero/cryptozero | refs/heads/master | /test/secrecy/symmetric/decrypt/test_decryption.py | from cryptozero.secrecy.symmetric import (
BackendName,
BackendPayload,
Decrypt,
Encrypt,
aes_cbc_pkcs7_backend,
aes_cbc_pkcs7_decrypt_backend,
decrypt,
encrypt,
fernet_backend,
fernet_decrypt_backend,
)
def test_aes_decrypt():
password = "some password"
expected_messag... | {"/test/secrecy/asymmetric/encrypt/test_load.py": ["/cryptozero/secrecy/asymmetric.py"], "/test/test_key_stretch.py": ["/cryptozero/key.py"], "/test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py": ["/cryptozero/secrecy/symmetric.py"], "/test/fixtures/__init__.py": ["/cryptozero/key.py"], "/cryptozero/secrecy/sy... |
94,695 | py-zero/cryptozero | refs/heads/master | /test/secrecy/symmetric/test_backend_serialisation.py | import pytest
from cryptozero.secrecy.symmetric import (
BackendName,
BackendPayload,
deserialise_payload,
serialise_payload,
)
def test_serialise_backend_name():
backend_name = BackendName.AES_CBC
payload = BackendPayload(backend_name=backend_name, salt=b"", payload=b"")
assert b"aes_cbc$... | {"/test/secrecy/asymmetric/encrypt/test_load.py": ["/cryptozero/secrecy/asymmetric.py"], "/test/test_key_stretch.py": ["/cryptozero/key.py"], "/test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py": ["/cryptozero/secrecy/symmetric.py"], "/test/fixtures/__init__.py": ["/cryptozero/key.py"], "/cryptozero/secrecy/sy... |
94,696 | py-zero/cryptozero | refs/heads/master | /test/secrecy/symmetric/encrypt/test_load.py | from cryptozero.secrecy.symmetric import Encrypt
def test_init(random_password):
encrypter = Encrypt(random_password)
assert random_password == encrypter.password
def test_from_password(random_password: str):
expected_encrypter = Encrypt(random_password)
encrypter = Encrypt.from_password(random_pas... | {"/test/secrecy/asymmetric/encrypt/test_load.py": ["/cryptozero/secrecy/asymmetric.py"], "/test/test_key_stretch.py": ["/cryptozero/key.py"], "/test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py": ["/cryptozero/secrecy/symmetric.py"], "/test/fixtures/__init__.py": ["/cryptozero/key.py"], "/cryptozero/secrecy/sy... |
94,697 | py-zero/cryptozero | refs/heads/master | /test/secrecy/symmetric/encrypt/test_encryption.py | import inspect
from cryptozero.secrecy.symmetric import (
BackendName,
BackendPayload,
Encrypt,
aes_cbc_pkcs7_backend,
)
def test_default_encrypt_backend_is_aes():
sig = inspect.signature(Encrypt.encrypt)
param = sig.parameters["backend"]
assert aes_cbc_pkcs7_backend is param.default
d... | {"/test/secrecy/asymmetric/encrypt/test_load.py": ["/cryptozero/secrecy/asymmetric.py"], "/test/test_key_stretch.py": ["/cryptozero/key.py"], "/test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py": ["/cryptozero/secrecy/symmetric.py"], "/test/fixtures/__init__.py": ["/cryptozero/key.py"], "/cryptozero/secrecy/sy... |
94,698 | py-zero/cryptozero | refs/heads/master | /test/secrecy/asymmetric/decrypt/test_load.py | from typing import IO
from cryptozero.secrecy.asymmetric import Decrypt
def test_init_sets_private_key(private_key: bytes):
decrypter = Decrypt(private_key)
assert decrypter.private_key == private_key
def test_loading_from_private_key(private_key: bytes):
expected_decrypter = Decrypt(private_key)
... | {"/test/secrecy/asymmetric/encrypt/test_load.py": ["/cryptozero/secrecy/asymmetric.py"], "/test/test_key_stretch.py": ["/cryptozero/key.py"], "/test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py": ["/cryptozero/secrecy/symmetric.py"], "/test/fixtures/__init__.py": ["/cryptozero/key.py"], "/cryptozero/secrecy/sy... |
94,699 | py-zero/cryptozero | refs/heads/master | /test/secrecy/symmetric/decrypt/test_load.py | from cryptozero.secrecy.symmetric import Decrypt
def test_init(random_password: str):
decrypter = Decrypt(random_password)
assert random_password == decrypter.password
def test_from_password(random_password: str):
expected_encrypter = Decrypt(random_password)
encrypter = Decrypt.from_password(rando... | {"/test/secrecy/asymmetric/encrypt/test_load.py": ["/cryptozero/secrecy/asymmetric.py"], "/test/test_key_stretch.py": ["/cryptozero/key.py"], "/test/secrecy/symmetric/decrypt/test_get_decrypt_backend.py": ["/cryptozero/secrecy/symmetric.py"], "/test/fixtures/__init__.py": ["/cryptozero/key.py"], "/cryptozero/secrecy/sy... |
94,701 | kukin-konstantin/cue-tool | refs/heads/master | /reorg_files.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import argparse
import subprocess
import os
import shutil
from split import get_file_name_play
def preprocessing_cue_files(root, cue_files):
cue_files = map(lambda x: os.path.join(root, x), cue_files)
name_files = map(get_file_name_play, cue_... | {"/test.py": ["/split.py"]} |
94,702 | kukin-konstantin/cue-tool | refs/heads/master | /split.py | import argparse
from subprocess import Popen, PIPE, STDOUT
import os
import shutil
import traceback
import sys
import subprocess
def get_file_name_template_and_play(file_name):
f = open(file_name)
for line in f.readlines():
if line.find('FILE')!=-1:
beg = line.find('"')
end = li... | {"/test.py": ["/split.py"]} |
94,703 | kukin-konstantin/cue-tool | refs/heads/master | /test.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from split import split_flac, merge_flac, call_process
from split import wav_to_flac, flac_to_wav, wav_to_ape, ape_to_wav, wav_to_wv, wv_to_wav
from subprocess import Popen, PIPE, STDOUT
import traceback
import subprocess
import argparse
import os
import... | {"/test.py": ["/split.py"]} |
94,706 | soldiers1989/bqs | refs/heads/master | /CnkiSpider1_0/CnkiSpider1_0/spiders/financing_spider.py | import time
import scrapy
from selenium import webdriver
from CnkiSpider1_0.items import FinancingSpiderItem
class CnkiSpider(scrapy.Spider):
# 定义爬虫名字
name = "financing"
# 定义开始爬取的URL
start_urls = ['https://shenzhen.rongzi.com/product/']
# 获取index页面内容
def parse(self, response):
pri... | {"/CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"], "/CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"]} |
94,707 | soldiers1989/bqs | refs/heads/master | /CnkiSpider1_0/Demo/test.py | #coding=utf-8
import math
import re
import requests
from Cython.Compiler.PyrexTypes import ErrorType
from bs4 import BeautifulSoup
from twisted.python.compat import raw_input
#
# a= 10
# b= 40
# c= 15
#
# temp = b*b-4*a*c
# if temp < 0:
# raise ErrorType("invalid input")
# a,b,c=float(a),float(b),float(c)
#
#
#
# ... | {"/CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"], "/CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"]} |
94,708 | soldiers1989/bqs | refs/heads/master | /CnkiSpider1_0/CnkiSpider1_0/spiders/fanlimofang_spider.py |
import scrapy
class CnkiSpider(scrapy.Spider):
# 定义爬虫名字
name = "fanlimofang"
# 定义开始爬取的URL
start_urls = ['http://www.fanlimofang.com/activity/firstover/']
# 获取index页面内容
def parse(self, response):
# 定义字典存储数据
print(response)
print(response.xpath('/html/body/div[6]/ul/l... | {"/CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"], "/CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"]} |
94,709 | soldiers1989/bqs | refs/heads/master | /CnkiSpider1_0/CnkiSpider1_0/spiders/daikuan_spider.py | import scrapy
from CnkiSpider1_0.items import LoadSpiderItem
class CnkiSpider(scrapy.Spider):
# 定义爬虫名字
name = "daikuan"
# 定义开始爬取的URL
start_urls = ['http://daikuan.51kanong.com/daikuan/lists/p/1']
# 获取index页面内容
def parse(self, response):
print(response)
for info in response.x... | {"/CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"], "/CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"]} |
94,710 | soldiers1989/bqs | refs/heads/master | /CnkiSpider1_0/Demo/unviSpider.py | #coding=utf-8
import math
import re
import bs4
import requests
from Cython.Compiler.PyrexTypes import ErrorType
from bs4 import BeautifulSoup
def getHTMLText(url):
try:
r = requests.get(url, timeout=30)
r.raise_for_status()
r.encoding = r.apparent_encoding
return r.text
except... | {"/CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"], "/CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"]} |
94,711 | soldiers1989/bqs | refs/heads/master | /CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py | import scrapy
from ..items import YeTuSpiderItem, wdzjSpiderItem
class CnkiSpider(scrapy.Spider):
# 定义爬虫名字
name = "wdzj"
# 定义开始爬取的URL
start_urls = ['https://www.wdzj.com/dangan/search?filter=e1¤tPage=1']
# 获取index页面内容
def parse(self, response):
print(response)
for info... | {"/CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"], "/CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"]} |
94,712 | soldiers1989/bqs | refs/heads/master | /CnkiSpider1_0/CnkiSpider1_0/spiders/kouzi_spider.py | import scrapy
class CnkiSpider(scrapy.Spider):
# 定义爬虫名字
name = "kouzi"
# 定义开始爬取的URL
i = 322
start_urls = ['https://www.csai.cn/kouzi/'+str(i)+'.html']
# 定义下一页的列表
v_nextPageUrl_list = []
# 获取index页面内容
def parse(self, response):
# 定义字典存储数据
dic = {}
# 存储名称... | {"/CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"], "/CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"]} |
94,713 | soldiers1989/bqs | refs/heads/master | /CnkiSpider1_0/CnkiSpider1_0/begin.py | # -*- coding: utf-8 -*-
from scrapy import cmdline
#cmd执行命令
cmd = 'scrapy crawl wdzj '
cmdline.execute(cmd.split()) | {"/CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"], "/CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"]} |
94,714 | soldiers1989/bqs | refs/heads/master | /CnkiSpider1_0/Demo/skillsDemo.py | from collections import Counter, OrderedDict
# 1.交换变量的值
from copy import deepcopy
from operator import itemgetter
a, b = 5, 10
print(a, b)
a, b = b, a
print(a, b)
# 2.将列表中的所有元素组合成字符串
a = ["python", "is" ,"awesome"]
print(" ".join(a))
# 3.查找列表中频率最高的值
a = [1, 2, 3, 4, 5, 6, 1, 2, 1, 2, 3, 4, 5, 8, 1]
print(max(set(a)... | {"/CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"], "/CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"]} |
94,715 | soldiers1989/bqs | refs/heads/master | /CnkiSpider1_0/CnkiSpider1_0/spiders/test_spider.py |
if __name__ == '__main__':
print("aa")
file = open("sample.txt")
for line in file:
pass # do something
file.close() | {"/CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"], "/CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"]} |
94,716 | soldiers1989/bqs | refs/heads/master | /CnkiSpider1_0/CnkiSpider1_0/items.py | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class Cnkispider10Item(scrapy.Item):
# define the fields for your item here like:
appName = scrapy.Field()
# time = scrapy.Field()
# sou... | {"/CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"], "/CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"]} |
94,717 | soldiers1989/bqs | refs/heads/master | /CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py | import scrapy
from ..items import YeTuSpiderItem
class CnkiSpider(scrapy.Spider):
# 定义爬虫名字
name = "yetu"
# 定义开始爬取的URL
start_urls = ['https://www.yetu.net/product/list-0-0-0---1.html']
# 定义下一页的列表
v_nextPageUrl_list = []
# 获取index页面内容
def parse(self, response):
print(respo... | {"/CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"], "/CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"]} |
94,718 | soldiers1989/bqs | refs/heads/master | /CnkiSpider1_0/CnkiSpider1_0/spiders/csaimall_spider.py | import scrapy
class CnkiSpider(scrapy.Spider):
# 定义爬虫名字
name = "csaimall"
# 定义开始爬取的URL
start_urls = ['https://daikuan.csaimall.com/product-13001.html']
# 获取index页面内容
def parse(self, response):
# 定义字典存储数据
print(response)
dic = {}
# 名称
贷款名称=response.xpath(... | {"/CnkiSpider1_0/CnkiSpider1_0/spiders/wdzj_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"], "/CnkiSpider1_0/CnkiSpider1_0/spiders/yetu_spider.py": ["/CnkiSpider1_0/CnkiSpider1_0/items.py"]} |
94,743 | mapes911/suite101_qa_automation | refs/heads/master | /modules/pages/Suite101BasePage.py | from saunter.po.remotecontrol.page import Page
class Suite101BasePage(Page):
"""
Suite101 Base Page, inherits from the Saunter Base Page
For now, we leave it with one un-used method. But this might be useful
later down the road if we need to add our own custom 'Page' methods
"""
def some_cust... | {"/scripts/Experiences.py": ["/scripts/Suite101BaseTestCase.py"], "/scripts/LoginExample.py": ["/scripts/Suite101BaseTestCase.py"]} |
94,744 | mapes911/suite101_qa_automation | refs/heads/master | /scripts/Experiences.py | """
Experiences Test Suite
Creation
Editing
Adding Chapters
Related Experiences
Commenting
Following
"""
from scripts.Suite101BaseTestCase import Suite101BaseTestCase
from pages.HomePage import HomePage
# import pytest
class ExperienceTestSuite(Suite101BaseTestCase):
"""
Experience Test Suite
"""
... | {"/scripts/Experiences.py": ["/scripts/Suite101BaseTestCase.py"], "/scripts/LoginExample.py": ["/scripts/Suite101BaseTestCase.py"]} |
94,745 | mapes911/suite101_qa_automation | refs/heads/master | /scripts/Suite101BaseTestCase.py | from saunter.testcase.remotecontrol import SaunterTestCase
class Suite101BaseTestCase(SaunterTestCase):
"""
Suite101 Base TestCase, inherits from the Saunter Test TestCase
This will allow us to create our own custom asserts or base test case methods
without modifying the Saunter Base TestCase
"""... | {"/scripts/Experiences.py": ["/scripts/Suite101BaseTestCase.py"], "/scripts/LoginExample.py": ["/scripts/Suite101BaseTestCase.py"]} |
94,746 | mapes911/suite101_qa_automation | refs/heads/master | /scripts/LoginExample.py | # Login Example based on https://github.com/Element-34/Py.Saunter-Examples
from scripts.Suite101BaseTestCase import Suite101BaseTestCase
from pages.HomePage import HomePage
import pytest
class CheckLoginExample(Suite101BaseTestCase):
bad_password = "Error message Sorry, unrecognized username or password. Have you... | {"/scripts/Experiences.py": ["/scripts/Suite101BaseTestCase.py"], "/scripts/LoginExample.py": ["/scripts/Suite101BaseTestCase.py"]} |
94,747 | mapes911/suite101_qa_automation | refs/heads/master | /modules/pages/ExperiencePage.py | """
Experience Page Object
"""
from saunter.po.remotecontrol.text import Text
from saunter.SeleniumWrapper import SeleniumWrapper as wrapper
from pages.Suite101BasePage import Suite101BasePage
# locators are a mapping from page sections/items to selectors (xpath/css/etc)
# define here ONLY, so we only ever have to ch... | {"/scripts/Experiences.py": ["/scripts/Suite101BaseTestCase.py"], "/scripts/LoginExample.py": ["/scripts/Suite101BaseTestCase.py"]} |
94,748 | mapes911/suite101_qa_automation | refs/heads/master | /modules/pages/LoginPage.py | """
Login Page Object
"""
from saunter.po.remotecontrol.text import Text
from saunter.po import string_timeout
from saunter.SeleniumWrapper import SeleniumWrapper as wrapper
from pages.Suite101BasePage import Suite101BasePage
locators = {
"username": "edit-name",
"password": "edit-pass",
"submit_button": ... | {"/scripts/Experiences.py": ["/scripts/Suite101BaseTestCase.py"], "/scripts/LoginExample.py": ["/scripts/Suite101BaseTestCase.py"]} |
94,749 | mapes911/suite101_qa_automation | refs/heads/master | /modules/pages/HomePage.py | """
Home Page Object
"""
from saunter.po import string_timeout
from saunter.SeleniumWrapper import SeleniumWrapper as wrapper
from pages.LoginPage import LoginPage
from pages.Suite101BasePage import Suite101BasePage
locators = {
"login": 'xpath=(//a[text()="Login"])[1]',
"signup": 'xpath=(//a[text()="Signup"]... | {"/scripts/Experiences.py": ["/scripts/Suite101BaseTestCase.py"], "/scripts/LoginExample.py": ["/scripts/Suite101BaseTestCase.py"]} |
94,761 | zhehaowang/issue-tracker | refs/heads/master | /src/client/items_reader.py | #!/usr/bin/env python3
# TODO: fix this path issue
from .gsheet_client import GSheetClient
import datetime
SPREADSHEET_ID = '1hloMXB_eL1f_OWpZR3qDSwc51AJQjLslr_yNR0u7n8c'
DAILY_SHEET_RANGE = 'daily!A1:ZZ'
REVIEW_SHEET_RANGE = 'review_backlog!A1:ZZ'
ITEMS_SHEET_RANGE = 'items_backlog!A1:ZZ'
CONF_SHEET_RANGE = ... | {"/src/client/items_reader.py": ["/src/client/gsheet_client.py"]} |
94,762 | zhehaowang/issue-tracker | refs/heads/master | /src/main.py | #!/usr/bin/env python3
from client.quotes_reader import QuotesReader
from client.items_reader import ItemsReader
from client.gsheet_client import GSheetClient
from notify.emailer import Emailer
from conf_reader import ConfReader
from review import Review
import random
from datetime im... | {"/src/client/items_reader.py": ["/src/client/gsheet_client.py"]} |
94,763 | zhehaowang/issue-tracker | refs/heads/master | /src/review.py | #!/usr/bin/env python3
import random
from datetime import datetime, timedelta
"""
Main business logic class
"""
class Review():
def __init__(self):
self.MAX_REVIEW_ITEM_CNT = 3
return
"""
Given a configuration dictionary, generate a list of review schedules.
@param dict <configurat... | {"/src/client/items_reader.py": ["/src/client/gsheet_client.py"]} |
94,764 | zhehaowang/issue-tracker | refs/heads/master | /src/review.t.py | #!/usr/bin/env python3
import unittest
from review import Review
from datetime import datetime
class TestReview(unittest.TestCase):
def setUp(self):
return
def test_review_simple(self):
r = Review()
daily = {
'08/31/18': {
'date': datetime(year = 2018, mont... | {"/src/client/items_reader.py": ["/src/client/gsheet_client.py"]} |
94,765 | zhehaowang/issue-tracker | refs/heads/master | /src/client/gsheet_client.py | #!/usr/bin/env python3
from __future__ import print_function
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
class GSheetClient():
def __init__(self, token_file_name = 'token.json', cred_file_name = 'credentials.json'):
self.service = sel... | {"/src/client/items_reader.py": ["/src/client/gsheet_client.py"]} |
94,766 | zhehaowang/issue-tracker | refs/heads/master | /src/conf_reader.py | #!/usr/bin/env python3
import json
class ConfReader():
def __init__(self, filename):
self.conf = {}
with open(filename, 'r') as conf_file:
content = conf_file.read()
self.conf = json.loads(content)
def get(self, key):
return self.conf[key] if key in self.conf e... | {"/src/client/items_reader.py": ["/src/client/gsheet_client.py"]} |
94,767 | zhehaowang/issue-tracker | refs/heads/master | /src/client/quotes_reader.py | #!/usr/bin/env python3
import urllib.request
import re
class QuotesReader():
def __init__(self, url):
self.url = url
return
def read_quotes(self):
resp = urllib.request.urlopen(self.url)
content = str(resp.read().strip())
result = content.split(r'\n\n')
quotes ... | {"/src/client/items_reader.py": ["/src/client/gsheet_client.py"]} |
94,768 | zhehaowang/issue-tracker | refs/heads/master | /src/notify/emailer.py | #!/usr/bin/env python3
import smtplib
class Emailer():
def __init__(self, user, pwd):
self.server = smtplib.SMTP("smtp.gmail.com", 587)
self.server.ehlo()
self.server.starttls()
self.server.login(user, pwd)
def send(self, sender, recipient, message):
try:
s... | {"/src/client/items_reader.py": ["/src/client/gsheet_client.py"]} |
94,770 | Acbogu/LeMiserablesGraph | refs/heads/master | /main.py | import networkx as nx
import Measures
import Robustness
import Contagion
def main():
"""""
# read the graph (gml format)
G = nx.read_gml('lesmiserables.gml')
# Labo1
Measures.metrics(G)
Measures.PlotBar(dict(G.degree()),"Les Miserables ")
# labo2
Robustness.NetworkAttacks(G)
# labo... | {"/venv/lab2.py": ["/main.py"]} |
94,771 | Acbogu/LeMiserablesGraph | refs/heads/master | /venv/lab2.py | import operator
import networkx as nx
from networkx import Graph, betweenness, closeness, clustering, connected_components, number_connected_components,average_clustering, betweenness_centrality, connected_component_subgraphs, degree
from pylab import show, hist, figure
from math import sqrt
from numpy.random import ra... | {"/venv/lab2.py": ["/main.py"]} |
94,781 | hayleemillar/gradGyde | refs/heads/master | /gradGyde/parse_csv.py | import os
import csv
from .db_helper import create_aoc, create_class
from .models import SemesterType
def parse_aocs(file_path):
with open(file_path, 'r') as file:
aocs = csv.reader(file, delimiter="\t")
aoc_info = []
tags = []
amounts = []
for line in aocs:
if l... | {"/gradGyde/parse_csv.py": ["/gradGyde/db_helper.py", "/gradGyde/models.py"], "/gradGyde/models.py": ["/gradGyde/__init__.py", "/gradGyde/parse_csv.py", "/gradGyde/db_helper.py"], "/gradGyde/main.py": ["/gradGyde/__init__.py", "/gradGyde/db_helper.py", "/gradGyde/models.py"], "/gradGyde/__init__.py": ["/gradGyde/models... |
94,782 | hayleemillar/gradGyde | refs/heads/master | /gradGyde/models.py | # pylint: disable=too-few-public-methods, invalid-name, wrong-import-position
import enum
import sqlalchemy
from gradGyde import db
class SemesterType(enum.Enum):
SPRING = "Spring"
SUMMER = "Summer"
FALL = "Fall"
ISP = "Isp"
EXTERNAL = "External"
class UserType(enum.Enum):
STUDENT = "Studen... | {"/gradGyde/parse_csv.py": ["/gradGyde/db_helper.py", "/gradGyde/models.py"], "/gradGyde/models.py": ["/gradGyde/__init__.py", "/gradGyde/parse_csv.py", "/gradGyde/db_helper.py"], "/gradGyde/main.py": ["/gradGyde/__init__.py", "/gradGyde/db_helper.py", "/gradGyde/models.py"], "/gradGyde/__init__.py": ["/gradGyde/models... |
94,783 | hayleemillar/gradGyde | refs/heads/master | /gradGyde/main.py | # pylint: disable=R1714,C0121
import os
import json
from flask import render_template, request, session, url_for
from flask_oauthlib.client import OAuth, redirect
from gradGyde import app
from .db_helper import (add_aoc,
assign_aoc,
create_class,
d... | {"/gradGyde/parse_csv.py": ["/gradGyde/db_helper.py", "/gradGyde/models.py"], "/gradGyde/models.py": ["/gradGyde/__init__.py", "/gradGyde/parse_csv.py", "/gradGyde/db_helper.py"], "/gradGyde/main.py": ["/gradGyde/__init__.py", "/gradGyde/db_helper.py", "/gradGyde/models.py"], "/gradGyde/__init__.py": ["/gradGyde/models... |
94,784 | hayleemillar/gradGyde | refs/heads/master | /gradGyde/__init__.py | # pylint: disable=invalid-name, wrong-import-position
import os
from sqlite3 import Connection as SQLite3Connection
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import create_engine, event, func
from sqlalchemy.orm import sessionmaker
from sqlalchemy.engine import Engine
app = Flask... | {"/gradGyde/parse_csv.py": ["/gradGyde/db_helper.py", "/gradGyde/models.py"], "/gradGyde/models.py": ["/gradGyde/__init__.py", "/gradGyde/parse_csv.py", "/gradGyde/db_helper.py"], "/gradGyde/main.py": ["/gradGyde/__init__.py", "/gradGyde/db_helper.py", "/gradGyde/models.py"], "/gradGyde/__init__.py": ["/gradGyde/models... |
94,785 | hayleemillar/gradGyde | refs/heads/master | /gradGyde/db_helper.py | # pylint: disable=E1101,W0104
import datetime
import json
from . import SESSION
from .models import (Aocs,
Users,
PrefferedAocs,
Classes,
ClassTaken,
Tags,
ClassTags,
Prereq... | {"/gradGyde/parse_csv.py": ["/gradGyde/db_helper.py", "/gradGyde/models.py"], "/gradGyde/models.py": ["/gradGyde/__init__.py", "/gradGyde/parse_csv.py", "/gradGyde/db_helper.py"], "/gradGyde/main.py": ["/gradGyde/__init__.py", "/gradGyde/db_helper.py", "/gradGyde/models.py"], "/gradGyde/__init__.py": ["/gradGyde/models... |
94,791 | nejdetkadir/fakest | refs/heads/master | /ui.py | import sys
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import *
from PyQt5 import QtCore, QtGui
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from datetime import datetime
from Fakest import Fakest
import sched
import time
class UI(QtWidgets.QWidget):
def __init__(self, fakest):
super().__ini... | {"/ui.py": ["/Fakest.py"], "/main.py": ["/ui.py"]} |
94,792 | nejdetkadir/fakest | refs/heads/master | /Fakest.py | from selenium import webdriver
import time
from bs4 import BeautifulSoup
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
class Fakest:
def __init__(self, alertLabel):
self.baseUrl = "https://lms... | {"/ui.py": ["/Fakest.py"], "/main.py": ["/ui.py"]} |
94,793 | nejdetkadir/fakest | refs/heads/master | /main.py | import sys
from PyQt5 import QtWidgets
from ui import UI
app = QtWidgets.QApplication(sys.argv)
ui = UI(app)
sys.exit(app.exec_()) | {"/ui.py": ["/Fakest.py"], "/main.py": ["/ui.py"]} |
94,799 | shabd/business-time-api | refs/heads/main | /app/api/views.py | from django.shortcuts import render
import datetime
from datetime import timedelta
import holidays
# Given two dates work out the time difference in secs
ZA_HOLIDAYS = holidays.SouthAfrica(years=2021)
def is_public_holiday(given_datetime):
if(given_datetime in ZA_HOLIDAYS):
return True
return False... | {"/app/api/tests.py": ["/app/api/views.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.