index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
11,148 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/intelligence/reports/test_crud.py | # -*- coding: utf-8 -*-
import pytest
import yaml
from cfme.fixtures import pytest_selenium as sel
from cfme.intelligence.reports.dashboards import Dashboard
from cfme.intelligence.reports.reports import CustomReport
from cfme.intelligence.reports.schedules import Schedule
from cfme.intelligence.reports.widgets import... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,149 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/configure/test_about_links.py | # -*- coding: utf-8 -*-
from cfme.fixtures import pytest_selenium as sel
from cfme.configure import about
import pytest
import requests
def test_about_links():
sel.force_navigate('about')
for link_key, link_loc in about.product_assistance.locators.items():
href = sel.get_attribute(link_loc, 'href')
... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,150 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/automate/test_provisioning_dialogs.py | # -*- coding: utf-8 -*-
import pytest
from cfme.automate import provisioning_dialogs
from utils.randomness import generate_random_string
from utils.update import update
@pytest.yield_fixture(scope="function")
def dialog():
dlg = provisioning_dialogs.ProvisioningDialog(
provisioning_dialogs.ProvisioningDi... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,151 | petrblaho/cfme_tests | refs/heads/master | /utils/randomness.py | # -*- coding: utf-8 -*-
import fauxfactory
import random
import sys
def generate_random_int(max=sys.maxint):
max = int(max)
return fauxfactory.gen_integer(0, max)
def generate_random_local_ip():
return "10.{}.{}.{}".format(
generate_random_int(255), generate_random_int(255), generate_random_int(... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,152 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/cloud/test_provisioning.py | # These tests don't work at the moment, due to the security_groups multi select not working
# in selenium (the group is selected then immediately reset)
import pytest
from textwrap import dedent
from cfme.automate import explorer as automate
from cfme.cloud.instance import instance_factory
from cfme.cloud.provider im... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,153 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/infrastructure/test_vm_discovery.py | import pytest
import time
from cfme.exceptions import CFMEException
from cfme.infrastructure import virtual_machines
from cfme.infrastructure.provider import SCVMMProvider
from utils import testgen
from utils.randomness import generate_random_string
from utils.wait import TimedOutError
def pytest_generate_tests(metaf... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,154 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/services/test_dynamicdd_dialogelement.py | import pytest
from cfme.services.catalogs.catalog_item import CatalogItem
from cfme.automate.service_dialogs import ServiceDialog
from cfme.services.catalogs.catalog import Catalog
from cfme.services.catalogs.service_catalogs import ServiceCatalogs
from cfme.automate.explorer import Domain, Namespace, Class, Method, I... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,155 | petrblaho/cfme_tests | refs/heads/master | /cfme/web_ui/menu.py | import ui_navigate as nav
from cfme.fixtures import pytest_selenium as sel
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.action_chains import ActionChains
from utils import version, classproperty
from utils.wait import wait_for
class Loc(object):
@classproperty
... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,156 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/services/test_catalog_item.py | import pytest
from cfme.web_ui import flash
from cfme.services.catalogs.catalog_item import CatalogItem
from cfme.automate.service_dialogs import ServiceDialog
from cfme.services.catalogs.catalog import Catalog
from utils.randomness import generate_random_string
from utils import error
from utils.update import update
i... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,157 | petrblaho/cfme_tests | refs/heads/master | /utils/tests/test_randomness.py | # -*-coding: utf-8
import pytest
from utils import randomness
pytestmark = [
pytest.mark.nondestructive,
pytest.mark.skip_selenium,
]
def test_generate_random_string_noargs():
random_string = randomness.generate_random_string()
# 8 is the default length
assert len(random_string) == 8
def test_g... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,158 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/integration/test_ipa_external.py | # -*- coding: utf-8 -*-
import pytest
from cfme.configure.access_control import Group, User
from cfme import login
from utils.conf import cfme_data
from utils.providers import setup_a_provider
@pytest.fixture(scope="module")
def setup_first_provider():
setup_a_provider(validate=True, check_existing=True)
@pyte... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,159 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/configure/test_register_appliance.py | # -*- coding: utf-8 -*-
import pytest
import re
from cfme.configure import red_hat_updates
from cfme.web_ui import InfoBlock, flash
from utils import conf, error, version
from utils.blockers import BZ
from utils.ssh import SSHClient
from utils.testgen import parametrize
from utils.wait import wait_for
REG_METHODS =... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,160 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/intelligence/reports/test_report_chargeback.py | # -*- coding: utf-8 -*-
import pytest
import cfme.web_ui.flash as flash
from cfme.intelligence.reports.reports import CustomReport
from utils.providers import setup_a_provider
from utils.randomness import generate_random_string
from utils.log import logger
@pytest.fixture(scope="module")
def setup_first_provider():
... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,161 | petrblaho/cfme_tests | refs/heads/master | /cfme/intelligence/reports/menus.py | # -*- coding: utf-8 -*-
"""Module handling report menus contents"""
from contextlib import contextmanager
from cfme.fixtures import pytest_selenium as sel
from cfme.intelligence.reports.ui_elements import FolderManager
from cfme.web_ui import Region, Tree, accordion, form_buttons, menu
from cfme.web_ui.multibox import... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,162 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/infrastructure/test_tag_infrastructure.py | import pytest
from cfme.web_ui import Quadicon, mixins
from cfme.configure.configuration import Category, Tag
from utils import providers
from utils.randomness import generate_lowercase_random_string, generate_random_string
@pytest.fixture(scope="module")
def setup_first_provider():
providers.setup_a_provider(pr... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,163 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/infrastructure/test_system_image_type.py | import pytest
from cfme.infrastructure import pxe
import utils.error as error
from utils.randomness import generate_random_string
from utils.update import update
pytestmark = [pytest.mark.usefixtures("logged_in")]
def test_system_image_type_crud():
"""
Tests a System Image Type using CRUD operations.
""... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,164 | petrblaho/cfme_tests | refs/heads/master | /cfme/cloud/stack.py | import ui_navigate as nav
import cfme.fixtures.pytest_selenium as sel
from cfme.web_ui import Quadicon, Region, SplitTable
from utils.pretty import Pretty
details_page = Region(infoblock_type='detail')
output_table = SplitTable(
('//*[@id="list_grid"]//table[contains(@class, "hdr")]/tbody', 1),
('//*[@id="list... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,165 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/intelligence/reports/test_report_corresponds.py | # -*- coding: utf-8 -*-
import pytest
import utils
from cfme.intelligence.reports.reports import CustomReport
from utils import version
from utils.providers import provider_factory_by_name, setup_a_provider
from utils.randomness import generate_random_string, pick
@pytest.fixture(scope="module")
def setup_first_prov... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,166 | petrblaho/cfme_tests | refs/heads/master | /cfme/web_ui/expression_editor.py | # -*- coding: utf-8 -*-
""" The expression editor present in some locations of CFME.
"""
from functools import partial
from selenium.common.exceptions import NoSuchElementException
from multimethods import singledispatch
from utils.wait import wait_for, TimedOutError
import cfme.fixtures.pytest_selenium as sel
from cf... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,167 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/storage/test_storage_crud.py | # -*- coding: utf-8 -*-
import pytest
from cfme.storage.managers import StorageManager
from utils.randomness import generate_random_string
from utils.update import update
from utils.version import current_version
pytestmark = [pytest.mark.usefixtures("use_storage")]
@pytest.mark.uncollectif(lambda: not current_vers... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,168 | petrblaho/cfme_tests | refs/heads/master | /fixtures/widgets.py | # -*- coding: utf-8 -*-
import pytest
from cfme.dashboard import Widget
from cfme.intelligence.reports import widgets
@pytest.fixture(scope="session")
def widgets_generated(any_provider_session):
pytest.sel.force_navigate("dashboard")
widget_list = []
for widget in Widget.all():
widget_list.appen... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,169 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/automate/test_class.py | import pytest
from cfme.automate.explorer import Class
from utils.randomness import generate_random_string
from utils.update import update
import utils.error as error
import cfme.tests.automate as ta
pytestmark = [pytest.mark.usefixtures("logged_in")]
@pytest.fixture(scope="module")
def make_namespace(request):
... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,170 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/configure/test_docs.py | # -*- coding: utf-8 -*-
import pytest
import re
import requests
try:
# Faster, C-ext
from cStringIO import StringIO
except ImportError:
# Slower, pure python
from StringIO import StringIO
from PyPDF2 import PdfFileReader
from cfme.configure.about import product_assistance as about
from utils import ver... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,171 | petrblaho/cfme_tests | refs/heads/master | /cfme/web_ui/mixins.py | from cfme.fixtures import pytest_selenium as sel
from cfme.web_ui import fill, Form, Select, Table, toolbar, form_buttons, flash
tag_form = Form(
fields=[
('category', Select('//select[@id="tag_cat"]')),
('tag', Select('//select[@id="tag_add"]'))
])
tag_table = Table("//div[@id='assignments_di... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,172 | petrblaho/cfme_tests | refs/heads/master | /cfme/configure/about.py | # -*- coding: utf-8 -*-
from cfme.web_ui import Region
from utils import version
product_assistance = Region(
locators={
'quick_start_guide': "//a[normalize-space(.)='Quick Start Guide']",
'insight_guide': "//a[normalize-space(.)='Insight Guide']",
'control_guide': "//a[normalize-space(.)='... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,173 | petrblaho/cfme_tests | refs/heads/master | /fixtures/parallelizer/parallelizer_tester.py | """parallelizer tester
Useful to make sure tests are being parallelized properly, and then reported correctly.
This file is named specially to prevent being picked up by py.test's default collector, and should
not be run during a normal test run.
"""
import random
from time import sleep
import pytest
pytestmark = ... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,174 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/services/test_operations.py | # -*- coding: utf-8 -*-
"""Tests checking for link access from outside."""
import pytest
import cfme.provisioning
from cfme.fixtures import pytest_selenium as sel
from cfme.login import login_admin
from cfme.provisioning import provisioning_form
from cfme.services import requests
from cfme.web_ui import flash
from uti... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,175 | petrblaho/cfme_tests | refs/heads/master | /cfme/services/catalogs/service_catalogs.py | # -*- coding: utf-8 -*-
from functools import partial
import cfme.fixtures.pytest_selenium as sel
from cfme.web_ui import accordion, flash, menu, form_buttons
from utils.update import Updateable
from utils.pretty import Pretty
from utils import version
order_button = {
version.LOWEST: "//img[@title='Order this Se... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,176 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/configure/test_timeprofile.py | # -*- coding: utf-8 -*-
import cfme.configure.settings as st
import utils.error as error
import utils.randomness as random
from utils.update import update
def new_timeprofile():
return st.Timeprofile(description='time_profile' + random.generate_random_string(),
scope='Current User',
... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,177 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/configure/test_session_timeout.py | # -*- coding: utf-8 -*-
import pytest
import time
from cfme.configure.configuration import AuthSetting
from utils.browser import ensure_browser_open, quit
from utils.wait import wait_for
def test_session_timeout(request):
"""Sets the timeout to shortest possible time and waits if it really times out."""
@re... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,178 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/test_utilization.py | import pytest
from utils import db
from utils import providers
from utils import testgen
from utils import conf
import time
from cfme.configure.configuration import candu
pytestmark = [
pytest.mark.meta(
server_roles="+ems_metrics_coordinator +ems_metrics_collector +ems_metrics_processor")
]
pytest_genera... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,179 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/configure/test_tag.py | import pytest
from cfme.configure.configuration import Category, Tag
from utils.update import update
from utils.randomness import generate_lowercase_random_string, generate_random_string
@pytest.yield_fixture
def category():
cg = Category(name=generate_lowercase_random_string(size=8),
descripti... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,180 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/automate/__init__.py | from utils.randomness import generate_random_string
from cfme.automate.explorer import Namespace, Class, Instance, Domain
from utils import version
@version.dependent
def a_domain():
return None
@a_domain.method('5.3')
def a_domain_53():
return Domain(name=generate_random_string(8),
descri... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,181 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/intelligence/reports/test_widgets.py | # -*- coding: utf-8 -*-
""""""
import pytest
from cfme.fixtures import pytest_selenium as sel
from cfme.dashboard import Widget
from cfme.intelligence.reports.widgets import MenuWidget, ReportWidget, RSSFeedWidget, ChartWidget
from cfme.intelligence.reports.dashboards import DefaultDashboard
from cfme.web_ui import to... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,182 | petrblaho/cfme_tests | refs/heads/master | /cfme/infrastructure/repositories.py | """Infrastructure / Repositories"""
from functools import partial
import cfme.fixtures.pytest_selenium as sel
import cfme.web_ui.flash as flash
from cfme.web_ui import menu
import cfme.web_ui.toolbar as tb
from cfme.web_ui import Region, Form, Input, SplitCheckboxTable, fill, form_buttons
from cfme.web_ui.form_butt... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,183 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/configure/test_tag_category.py | from cfme.configure.configuration import Category
from utils.update import update
from utils.randomness import generate_lowercase_random_string, generate_random_string
def test_category_crud():
cg = Category(name=generate_lowercase_random_string(size=8),
description=generate_random_string(size=3... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,184 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/infrastructure/test_pxe.py | import pytest
from cfme.infrastructure import pxe
from utils.update import update
from utils.testgen import generate, pxe_servers
pytest_generate_tests = generate(pxe_servers)
@pytest.fixture(scope='function')
def has_no_pxe_servers():
pxe.remove_all_pxe_servers()
@pytest.mark.usefixtures('has_no_pxe_servers... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,185 | petrblaho/cfme_tests | refs/heads/master | /cfme/tests/cloud/test_instance_power_control.py | import cfme.web_ui.flash as flash
import pytest
from cfme.cloud.instance import instance_factory, get_all_instances, EC2Instance, OpenStackInstance
from cfme.fixtures import pytest_selenium as sel
from utils import error, testgen
from utils.randomness import generate_random_string
from utils.wait import wait_for, Timed... | {"/cfme/tests/cloud/test_tag_cloud.py": ["/utils/randomness.py"], "/cfme/tests/control/test_compliance.py": ["/utils/randomness.py"], "/cfme/tests/automate/test_service_dialog.py": ["/utils/randomness.py"], "/cfme/tests/infrastructure/test_customization_template.py": ["/utils/randomness.py"], "/cfme/tests/automate/test... |
11,205 | michaeltriska/ctr_amaro | refs/heads/master | /service.py | from tornado.ioloop import IOLoop
import tornado.web
from api.api import BusinessAnalysisHandler
"""
Overview
The applications use Tornado as a HTTP server,
and Schematics for dealing with representations.
Project structure
The typical application is structured in submodules:
app
api - api handler
... | {"/service.py": ["/api/api.py"], "/api/api.py": ["/models/models.py", "/core/ctr.py"], "/connectors/s3.py": ["/helper/helper.py"], "/core/ctr.py": ["/connectors/db.py", "/connectors/s3.py", "/helper/helper.py"], "/test_db.py": ["/connectors/db.py"]} |
11,206 | michaeltriska/ctr_amaro | refs/heads/master | /models/models.py | from schematics.models import Model
from schematics.types import StringType
class AggregationRequest(Model):
startTimestamp = StringType(required=True)
endTimestamp = StringType(required=True)
aggregation = StringType(required=True)
product = StringType()
platform = StringType()
| {"/service.py": ["/api/api.py"], "/api/api.py": ["/models/models.py", "/core/ctr.py"], "/connectors/s3.py": ["/helper/helper.py"], "/core/ctr.py": ["/connectors/db.py", "/connectors/s3.py", "/helper/helper.py"], "/test_db.py": ["/connectors/db.py"]} |
11,207 | michaeltriska/ctr_amaro | refs/heads/master | /helper/helper.py | from datetime import datetime
import pytz
import time
def datetime_range(start, end, delta):
current = start
while current < end:
yield current
current += delta
def convert_tz(originalTimeStamp, originalTimeZone, targetTimeZone):
"""
Function converts unix-timestamp in s from
origi... | {"/service.py": ["/api/api.py"], "/api/api.py": ["/models/models.py", "/core/ctr.py"], "/connectors/s3.py": ["/helper/helper.py"], "/core/ctr.py": ["/connectors/db.py", "/connectors/s3.py", "/helper/helper.py"], "/test_db.py": ["/connectors/db.py"]} |
11,208 | michaeltriska/ctr_amaro | refs/heads/master | /api/api.py | import tornado.web
import json
from models.models import AggregationRequest
from core.ctr import CTR_Calculater
class BusinessAnalysisHandler(tornado.web.RequestHandler):
def post(self, model=None):
'''
This function takes a request and calculates
the click through rate base on that data, ... | {"/service.py": ["/api/api.py"], "/api/api.py": ["/models/models.py", "/core/ctr.py"], "/connectors/s3.py": ["/helper/helper.py"], "/core/ctr.py": ["/connectors/db.py", "/connectors/s3.py", "/helper/helper.py"], "/test_db.py": ["/connectors/db.py"]} |
11,209 | michaeltriska/ctr_amaro | refs/heads/master | /connectors/s3.py | from data.productevent import productevents
from helper.helper import *
import pandas as pd
class S3Handler:
def __init__(self):
pass
def get_event_df(self, product, unix_start_timestamp, unix_end_timestamp):
events = [i for i in productevents
if self.get_event_condition(
... | {"/service.py": ["/api/api.py"], "/api/api.py": ["/models/models.py", "/core/ctr.py"], "/connectors/s3.py": ["/helper/helper.py"], "/core/ctr.py": ["/connectors/db.py", "/connectors/s3.py", "/helper/helper.py"], "/test_db.py": ["/connectors/db.py"]} |
11,210 | michaeltriska/ctr_amaro | refs/heads/master | /connectors/db_creator.py | import sqlite3 as sqlite
import pandas as pd
class DataBaseCreator:
def __init__(self, database_name):
self.connection = sqlite.connect(database_name)
self.cur = self.connection.cursor()
def create_database(self, table_names):
for table in table_names:
self.create_table(t... | {"/service.py": ["/api/api.py"], "/api/api.py": ["/models/models.py", "/core/ctr.py"], "/connectors/s3.py": ["/helper/helper.py"], "/core/ctr.py": ["/connectors/db.py", "/connectors/s3.py", "/helper/helper.py"], "/test_db.py": ["/connectors/db.py"]} |
11,211 | michaeltriska/ctr_amaro | refs/heads/master | /core/ctr.py | from datetime import datetime
from datetime import timedelta
import pandas as pd
from connectors.db import DataBaseHandler
from connectors.s3 import S3Handler
from helper.helper import *
class CTR_Calculater:
def __init__(self, model):
print("model init", model)
# initialize and transform request... | {"/service.py": ["/api/api.py"], "/api/api.py": ["/models/models.py", "/core/ctr.py"], "/connectors/s3.py": ["/helper/helper.py"], "/core/ctr.py": ["/connectors/db.py", "/connectors/s3.py", "/helper/helper.py"], "/test_db.py": ["/connectors/db.py"]} |
11,212 | michaeltriska/ctr_amaro | refs/heads/master | /connectors/db.py | import sqlite3 as sqlite
from datetime import datetime
import pandas as pd
from datetime import timedelta
class DataBaseHandler:
def __init__(self, database_name):
self.database = database_name
self.connection = self._get_connection()
self.cur = self.connection.cursor()
def _get_connec... | {"/service.py": ["/api/api.py"], "/api/api.py": ["/models/models.py", "/core/ctr.py"], "/connectors/s3.py": ["/helper/helper.py"], "/core/ctr.py": ["/connectors/db.py", "/connectors/s3.py", "/helper/helper.py"], "/test_db.py": ["/connectors/db.py"]} |
11,213 | michaeltriska/ctr_amaro | refs/heads/master | /test_db.py | import unittest
from connectors.db import DataBaseHandler
class DataBaseTests(unittest.TestCase):
def test_database(self):
db = DataBaseHandler('connectors/orders.db')
rows = db.cur.execute("SELECT * FROM orders")
assert rows.fetchall()[0] == (0, 144296, 16423318,
... | {"/service.py": ["/api/api.py"], "/api/api.py": ["/models/models.py", "/core/ctr.py"], "/connectors/s3.py": ["/helper/helper.py"], "/core/ctr.py": ["/connectors/db.py", "/connectors/s3.py", "/helper/helper.py"], "/test_db.py": ["/connectors/db.py"]} |
11,233 | vkvam/webvtt-py | refs/heads/master | /webvtt/segmenter.py | from math import ceil, floor
from .generic import Caption
from webvtt.main import WebVTT
from concurrent import futures
MPEGTS = 0
SECONDS = 200 # default number of seconds per segment
class WebVTTSegmenter(object):
"""
Provides segmentation of WebVTT captions for HTTP Live Streaming (HLS).
"""
def _... | {"/webvtt/segmenter.py": ["/webvtt/main.py"], "/tests/webvtt.py": ["/webvtt/__init__.py", "/webvtt/main.py"], "/webvtt/__init__.py": ["/webvtt/main.py", "/webvtt/segmenter.py"], "/webvtt/main.py": ["/webvtt/parsers.py"]} |
11,234 | vkvam/webvtt-py | refs/heads/master | /webvtt/sub_io.py | import boto3
from webvtt.generic import GenericReader, GenericWriter
import os
from io import StringIO
class FileReader(GenericReader):
def __init__(self, filename):
self.filename = filename
def readlines(self):
with open(self.filename) as f:
return [line.rstrip() for line in f.r... | {"/webvtt/segmenter.py": ["/webvtt/main.py"], "/tests/webvtt.py": ["/webvtt/__init__.py", "/webvtt/main.py"], "/webvtt/__init__.py": ["/webvtt/main.py", "/webvtt/segmenter.py"], "/webvtt/main.py": ["/webvtt/parsers.py"]} |
11,235 | vkvam/webvtt-py | refs/heads/master | /tests/webvtt.py | import os
import unittest
from shutil import rmtree, copy
from webvtt import WebVTT
from webvtt.exceptions import MissingFilenameError, MalformedCaptionError
from webvtt.main import SUPPORTED_FORMATS
from webvtt.generic import Caption
BASE_DIR = os.path.dirname(__file__)
SUBTITLES_DIR = os.path.join(BASE_DIR, 'subtit... | {"/webvtt/segmenter.py": ["/webvtt/main.py"], "/tests/webvtt.py": ["/webvtt/__init__.py", "/webvtt/main.py"], "/webvtt/__init__.py": ["/webvtt/main.py", "/webvtt/segmenter.py"], "/webvtt/main.py": ["/webvtt/parsers.py"]} |
11,236 | vkvam/webvtt-py | refs/heads/master | /webvtt/__init__.py | from .main import WebVTT
from .segmenter import WebVTTSegmenter
from .generic import Caption
__version__ = '0.4.0' | {"/webvtt/segmenter.py": ["/webvtt/main.py"], "/tests/webvtt.py": ["/webvtt/__init__.py", "/webvtt/main.py"], "/webvtt/__init__.py": ["/webvtt/main.py", "/webvtt/segmenter.py"], "/webvtt/main.py": ["/webvtt/parsers.py"]} |
11,237 | vkvam/webvtt-py | refs/heads/master | /webvtt/main.py | import os
import re
from .parsers import WebVTTParser, SRTParser, SBVParser
from webvtt.exceptions import MissingFilenameError
SUPPORTED_FORMATS = (
('WebVTT (.vtt)', WebVTTParser), # default parser for WebVTT format
('SubRip (.srt)', SRTParser), # parser for SRT format
('YouTube SBV (.sbv)', SBV... | {"/webvtt/segmenter.py": ["/webvtt/main.py"], "/tests/webvtt.py": ["/webvtt/__init__.py", "/webvtt/main.py"], "/webvtt/__init__.py": ["/webvtt/main.py", "/webvtt/segmenter.py"], "/webvtt/main.py": ["/webvtt/parsers.py"]} |
11,238 | vkvam/webvtt-py | refs/heads/master | /webvtt/parsers.py | import re
from webvtt.exceptions import MalformedFileError, MalformedCaptionError
from webvtt.generic import GenericParser, Caption
class TextBasedParser(GenericParser):
"""
Parser for plain text caption files.
This is a generic class, do not use directly.
"""
TIMEFRAME_LINE_PATTERN = ''
de... | {"/webvtt/segmenter.py": ["/webvtt/main.py"], "/tests/webvtt.py": ["/webvtt/__init__.py", "/webvtt/main.py"], "/webvtt/__init__.py": ["/webvtt/main.py", "/webvtt/segmenter.py"], "/webvtt/main.py": ["/webvtt/parsers.py"]} |
11,240 | dimitri98713/Mytest | refs/heads/master | /point.py | def point(x,y):
return [x,y]
def getx(p):
return p[0]
def gety(p):
return p[1]
| {"/test_point_creation.py": ["/point.py"]} |
11,241 | dimitri98713/Mytest | refs/heads/master | /test_point_creation.py | from point import *
def test_point_creation():
p = point(22,7)
def test_access_x_and_y():
assert 22 == getx(p)
assert 7 == gety(p)
| {"/test_point_creation.py": ["/point.py"]} |
11,288 | AaronChiu2017/ohmydata_spider | refs/heads/master | /ohmydata_spider/commands/__init__.py | __author__ = 'mee'
| {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,289 | AaronChiu2017/ohmydata_spider | refs/heads/master | /ohmydata_spider/pipelines.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/topics/item-pipeline.html
from scrapy.exceptions import DropItem
from scrapy.conf import settings
import logging
import pymongo
import functools
... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,290 | AaronChiu2017/ohmydata_spider | refs/heads/master | /ohmydata_spider/commands/clear_redis_stats.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
__author__ = 'mee'
import redis
REDIS_HOST = 'localhost'
REDIS_PORT = 6379
FILTER_KEY = 'myspider:dupefilter'
REQUEST_KEY = 'myspider:requests'
STATS_KEY = 'scrapy:stats'
def clear_stats():
server = redis.Redis(REDIS_HOST,REDIS_PORT)
server.delete(FILTER_KEY)
se... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,291 | AaronChiu2017/ohmydata_spider | refs/heads/master | /ohmydata_spider/spiders/myspider.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
from scrapy_redis.spiders import RedisSpider
from scrapy.selector import Selector
from ohmydata_spider.util.select_result import list_first_item,clean_url
from scrapy.http import Request
from ohmydata_spider.items import TutorialItem
import ohmydata_spider.pipelines
class MyS... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,292 | AaronChiu2017/ohmydata_spider | refs/heads/master | /start_cluster.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
import multiprocessing
import argparse
import pexpect
import sys
class sshProcess(multiprocessing.Process):
def __init__(self, workerid, hostname, password, crawlername):
multiprocessing.Process.__init__(self)
self.workerid = workerid
self.hostname =... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,293 | AaronChiu2017/ohmydata_spider | refs/heads/master | /readunicode.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
import codecs
f = open('TmallComment.json', 'r')
f2 = open('allTmallComment.json', 'w')
for text in f:
try:
f2.write(text.decode('unicode-escape').encode('utf-8'))
print text.decode('unicode-escape').encode('utf-8')
except Exception, e:
print 'er... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,294 | AaronChiu2017/ohmydata_spider | refs/heads/master | /ohmydata_spider/settings.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
# Scrapy settings for ohmydata_spider project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/topics/settings.html
#
SPIDER_MODULES = ['ohmydata_spider.spiders']
NEW... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,295 | AaronChiu2017/ohmydata_spider | refs/heads/master | /ohmydata_spider/spiders/dataspider.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
__author__ = 'mee'
from scrapy_redis.spiders import RedisSpider
from scrapy.selector import Selector
from ohmydata_spider.util.select_result import list_first_item,clean_url
from scrapy.http import Request
from ohmydata_spider.items import DataTreasureItem
import ohmydata_spide... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,296 | AaronChiu2017/ohmydata_spider | refs/heads/master | /ohmydata_spider/contrib/downloadermiddleware/selector_proxy.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
__author__ = 'mee'
import base64
import random
from scrapy.downloadermiddlewares.httpproxy import HttpProxyMiddleware
import pymongo
import logging
class SelectorProxyMiddlerware(HttpProxyMiddleware): # 中间件继承时一定要有__init__方法,否则不会被执行
# 实例化类时进行数据库连接
def __init__(self)... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,297 | AaronChiu2017/ohmydata_spider | refs/heads/master | /ohmydata_spider/util/select_result.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
import urllib
import urlparse
from urlparse import urljoin
from w3lib.html import replace_entities
def clean_link(link_text):
return link_text.strip("\t\r\n '\"")
# 返回第一个url地址
list_first_item = lambda x:x[0] if x else None
# 将url地址组装返回,并移除空格标点 entites
clean_url = lamb... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,298 | AaronChiu2017/ohmydata_spider | refs/heads/master | /ohmydata_spider/spiders/TmallCommentspider.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
from scrapy_redis.spiders import RedisSpider
from ohmydata_spider.items import TmallCommentItem
from scrapy.selector import Selector
from scrapy.http import Request
from ohmydata_spider.util.select_result import get_query, set_query, clean_link
import ohmydata_spider.pipelines... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,299 | AaronChiu2017/ohmydata_spider | refs/heads/master | /ohmydata_spider/contrib/downloadermiddleware/Cookie.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
import random
import logging
from ohmydata_spider.util.sinaCookie import cookies
__author__ = 'mee'
class CookiesMiddleware(object):
def process_request(self, request, spider):
cookie = random.choice(cookies)
# logger = logging.getLogger(spider.name)
... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,300 | AaronChiu2017/ohmydata_spider | refs/heads/master | /ohmydata_spider/spiders/spidertest.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
__author__ = 'mee'
from scrapy_redis.spiders import RedisSpider
from scrapy.selector import Selector
from scrapy.http import Request
from ohmydata_spider.items import TmallCommentItem
import re
import ohmydata_spider.pipelines
class TestSpider(RedisSpider):
name = "Spider... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,301 | AaronChiu2017/ohmydata_spider | refs/heads/master | /ohmydata_spider/util/sinaCookie.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
import json
import base64
import requests
import logging
__author__ = 'mee'
'''
Crawl Weibo Account
'''
WeiBoAccount = [
{'user': 'luzuidv13893@163.com', 'psw': 'a123456'},
]
def getCookies(weibo):
"""
function: get cookies
:param weibo: weibo Account In... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,302 | AaronChiu2017/ohmydata_spider | refs/heads/master | /ohmydata_spider/items.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/topics/items.html
from scrapy.item import Item, Field
class TutorialItem(Item):
# define the fields for your item here like:
# name = Field()
proxy_url = Field()
... | {"/ohmydata_spider/spiders/TmallCommentspider.py": ["/ohmydata_spider/items.py", "/ohmydata_spider/util/select_result.py", "/ohmydata_spider/pipelines.py"], "/ohmydata_spider/contrib/downloadermiddleware/Cookie.py": ["/ohmydata_spider/util/sinaCookie.py"]} |
11,303 | Stefany-Olivera/Python_Project | refs/heads/master | /apps/friend2_app/views.py | from __future__ import unicode_literals
from django.contrib import messages
from django.shortcuts import render, redirect, HttpResponse
from .models import User, Friend
def index(request):
# print(User.objects.all())
return render(request, 'friend2_app/index.html')
def register(request):
# print request.P... | {"/apps/friend2_app/views.py": ["/apps/friend2_app/models.py"]} |
11,304 | Stefany-Olivera/Python_Project | refs/heads/master | /apps/friend2_app/models.py | from __future__ import unicode_literals
from django.db import models
import re
import bcrypt
from datetime import datetime
EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$')
class UserManager(models.Manager):
def login(self, email, password):
response={
"errors... | {"/apps/friend2_app/views.py": ["/apps/friend2_app/models.py"]} |
11,305 | Stefany-Olivera/Python_Project | refs/heads/master | /apps/friend2_app/apps.py | from __future__ import unicode_literals
from django.apps import AppConfig
class Friend2AppConfig(AppConfig):
name = 'friend2_app'
| {"/apps/friend2_app/views.py": ["/apps/friend2_app/models.py"]} |
11,306 | Stefany-Olivera/Python_Project | refs/heads/master | /apps/friend2_app/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-02-04 17:57
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operatio... | {"/apps/friend2_app/views.py": ["/apps/friend2_app/models.py"]} |
11,344 | facosta8/MNO-Black-Scholes | refs/heads/master | /app.py | # -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_daq as daq
from dash.dependencies import Input, Output, State
from plotly import tools
import plotly.graph_objs as go
import pandas as pd
import dask as dask
from dask.distributed import Client, progre... | {"/app.py": ["/regresion.py"]} |
11,345 | facosta8/MNO-Black-Scholes | refs/heads/master | /scripts/carga_datos.py |
#%% carga
import numpy as np
import pandas as pd
from yahoofinancials import YahooFinancials as YF
from ctypes import cdll
from pathlib import Path
import os
def descargar_datos(stocks,
inicio = '2008-01-01',
fin = '2019-01-01',
intervalo = 'daily'):
... | {"/app.py": ["/regresion.py"]} |
11,346 | facosta8/MNO-Black-Scholes | refs/heads/master | /regresion.py | import pandas as pd
import datetime
import numpy as np
from sklearn.metrics import r2_score
import sys
import os
# Paralelización
# DASK
import dask as dask
#from dask.distributed import Client, progress
import dask.dataframe as dd
#client = Client()
#client.cluster
from dask import delayed
#os.chdir('git/MNO-Bl... | {"/app.py": ["/regresion.py"]} |
11,370 | apatyk/Daily-Pattern-Classifier | refs/heads/main | /common/testing.py | import numpy as np
import pandas as pd
import tensorflow as tf
def get_raw_data(samples, labels, data):
axdata = []
aydata = []
for i in range(len(labels)):
f = samples[i][0]
t1 = samples[i][1]
t2 = samples[i][2]
sample = data[f][t1:t2]
label = labels[i]
axd... | {"/DailyPatternClassifier/TrainDailyPatternRNN.py": ["/common/testing.py"], "/DailyPatternClassifier/TestDailyPatternRNN.py": ["/common/testing.py"], "/GenerateSamples/GenerateSamples.py": ["/common/loadfile.py", "/common/training.py", "/common/testing.py"]} |
11,371 | apatyk/Daily-Pattern-Classifier | refs/heads/main | /GenerateSamples/SubmitGenSamplesJob.py | import os
#PBS -l select=1:ncpus=28:mem=120gb:ngpus=2:gpu_model=p100:interconnect=fdr,walltime=4:00:00
#PBS -l select=1:ncpus=24:mem=120gb:ngpus=2:gpu_model=k40:interconnect=fdr,walltime=4:00:00
#PBS -l select=1:ncpus=40:mem=370gb:ngpus=2:gpu_model=v100:interconnect=hdr,walltime=72:00:00
#PBS -l select=1:ncpus=56:mem=... | {"/DailyPatternClassifier/TrainDailyPatternRNN.py": ["/common/testing.py"], "/DailyPatternClassifier/TestDailyPatternRNN.py": ["/common/testing.py"], "/GenerateSamples/GenerateSamples.py": ["/common/loadfile.py", "/common/training.py", "/common/testing.py"]} |
11,372 | apatyk/Daily-Pattern-Classifier | refs/heads/main | /common/loadfile.py | import numpy as np
import pandas as pd
import sys
from tqdm import tqdm
import math
ACC_THRESH = 0.008 # sum(acc) (G) max value for stddev rest
GYRO_THRESH = 0.04 * 180.0/ math.pi
def loadshmfile(File_Name):
RawData = np.fromfile(File_Name, dtype=np.dtype("6f4"))
# Swap gyroscope axis. Remember python... | {"/DailyPatternClassifier/TrainDailyPatternRNN.py": ["/common/testing.py"], "/DailyPatternClassifier/TestDailyPatternRNN.py": ["/common/testing.py"], "/GenerateSamples/GenerateSamples.py": ["/common/loadfile.py", "/common/training.py", "/common/testing.py"]} |
11,373 | apatyk/Daily-Pattern-Classifier | refs/heads/main | /DailyPatternClassifier/TrainDailyPatternRNN.py | # Adam Patyk
# Clemson University
# MS Thesis: Daily Pattern Classifier
# Summer 2021
# TrainDailyPatternRNN.py
# Purpose: Trains daily pattern classifiers for k-fold cross validation
# Used with TestDailyPatternRNN for evaluation
# Usage: python TrainDailyPatternRNN.py <batch_size> <num_recurrent_units> <num... | {"/DailyPatternClassifier/TrainDailyPatternRNN.py": ["/common/testing.py"], "/DailyPatternClassifier/TestDailyPatternRNN.py": ["/common/testing.py"], "/GenerateSamples/GenerateSamples.py": ["/common/loadfile.py", "/common/training.py", "/common/testing.py"]} |
11,374 | apatyk/Daily-Pattern-Classifier | refs/heads/main | /common/training.py | import random
import numpy as np
import tensorflow as tf
import keras
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Conv1D, GlobalAveragePooling1D
import tensorflow.keras.backend as kb
### undersamples and trains model from samples and labels provided
def trainModel(trai... | {"/DailyPatternClassifier/TrainDailyPatternRNN.py": ["/common/testing.py"], "/DailyPatternClassifier/TestDailyPatternRNN.py": ["/common/testing.py"], "/GenerateSamples/GenerateSamples.py": ["/common/loadfile.py", "/common/training.py", "/common/testing.py"]} |
11,375 | apatyk/Daily-Pattern-Classifier | refs/heads/main | /DailyPatternClassifier/TestDailyPatternRNN.py | # Adam Patyk
# Clemson University
# MS Thesis: Daily Pattern Classifier
# Summer 2021
# TestDailyPatternRNN.py
# Purpose: Evaluate time and episode metrics of daily pattern classifier for k-fold cross validation
# Usage: python TestDailyPatternRNN.py <threshold_val_start> <threshold_val_end> <threshold_val_step> <num_... | {"/DailyPatternClassifier/TrainDailyPatternRNN.py": ["/common/testing.py"], "/DailyPatternClassifier/TestDailyPatternRNN.py": ["/common/testing.py"], "/GenerateSamples/GenerateSamples.py": ["/common/loadfile.py", "/common/training.py", "/common/testing.py"]} |
11,376 | apatyk/Daily-Pattern-Classifier | refs/heads/main | /GenerateSamples/GenerateSamples.py | # Adam Patyk
# Clemson University
# MS Thesis: Daily Pattern Classifier
# Summer 2021
# GenerateSamples.py
# Purpose: Generates daily samples for data augmentation
# Usage: python GenerateSamples.py <window_length_minutes>
import sys
import os
import tensorflow as tf # updated for TensorFlow 2.2.0
import numpy as np
... | {"/DailyPatternClassifier/TrainDailyPatternRNN.py": ["/common/testing.py"], "/DailyPatternClassifier/TestDailyPatternRNN.py": ["/common/testing.py"], "/GenerateSamples/GenerateSamples.py": ["/common/loadfile.py", "/common/training.py", "/common/testing.py"]} |
11,377 | apatyk/Daily-Pattern-Classifier | refs/heads/main | /DailyPatternClassifier/SubmitTrainRNNJob.py | import os
import numpy as np
#PBS -l select=1:ncpus=28:mem=120gb:ngpus=2:gpu_model=p100:interconnect=fdr,walltime=4:00:00
#PBS -l select=1:ncpus=40:mem=370gb:ngpus=2:gpu_model=v100:interconnect=hdr,walltime=4:00:00
batch_size = 64
num_units = 16
epochs = 50
pbsfile = open("job.pbs", "w")
pbsfile.write("""#PBS -u ap... | {"/DailyPatternClassifier/TrainDailyPatternRNN.py": ["/common/testing.py"], "/DailyPatternClassifier/TestDailyPatternRNN.py": ["/common/testing.py"], "/GenerateSamples/GenerateSamples.py": ["/common/loadfile.py", "/common/training.py", "/common/testing.py"]} |
11,384 | vitoo22/showmylikes | refs/heads/master | /app.py | from flask import Flask, render_template, request, redirect, url_for
from get_instagrams_token import *
import urllib.request
import json
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('home.html')
@app.route('/authorization-completed/', defaults={'code': ''})
@app.route('/autho... | {"/app.py": ["/get_instagrams_token.py"]} |
11,385 | vitoo22/showmylikes | refs/heads/master | /get_instagrams_token.py | from instagram.client import InstagramAPI
client_id = 'acb84376812747f0b6086b14e905332b'
client_secret = 'b638f8a09d28480d8e20541a2c51bafc'
redirect_uri = 'http://127.0.0.1:5000/authorization-completed/'
scope = 'public_content'
api = InstagramAPI(client_id=client_id, client_secret=client_secret, redirect_uri=redi... | {"/app.py": ["/get_instagrams_token.py"]} |
11,386 | springle/elevator | refs/heads/master | /elevator_control_system_tests.py | import unittest
from elevator_control_system import ElevatorControlSystem
class TestElevatorControlSystem(unittest.TestCase):
def test_init(self):
"""
Make sure ElevatorControlSystem correctly initializes with 16 elevators and 16 floors.
"""
ecs = ElevatorControlSystem(16, 16)
self.assertEqual(ecs.status(),... | {"/elevator_control_system_tests.py": ["/elevator_control_system.py"]} |
11,387 | springle/elevator | refs/heads/master | /elevator_control_system.py | import heapq, random, time
class ElevatorControlSystem():
def __init__(self, number_of_floors, number_of_elevators):
if number_of_elevators <= 0:
raise AssertionError("Your building must have at least one elevator.")
if number_of_floors <= 0:
raise AssertionError("Your building must have at least one floor.... | {"/elevator_control_system_tests.py": ["/elevator_control_system.py"]} |
11,412 | jjwindow/PyFields | refs/heads/main | /high_res_all_moons.py | from all_funcs import save_moon_trace
from multiprocessing import Pool
from timeit import default_timer as timer
# print("Start Unparallel")
# start = timer()
# all_moons = ['Miranda', 'Ariel', 'Umbriel', 'Titania', 'Oberon', 'Triton']
# num_fieldlines = 0
# num_orbit_points = 2
# for moon in all_moons:
# if moon... | {"/high_res_all_moons.py": ["/all_funcs.py"], "/footpoint_analysis.py": ["/all_funcs.py"], "/planet_testing.py": ["/all_funcs.py"], "/unit_speed_tests.py": ["/all_funcs.py"], "/convergence_tests.py": ["/all_funcs.py"], "/dipole_testing.py": ["/all_funcs.py"], "/satellite_footpoints.py": ["/all_funcs.py"], "/quadrupole_... |
11,413 | jjwindow/PyFields | refs/heads/main | /footpoint_analysis.py | from all_funcs import *
from matplotlib import animation
all_moons = ['Miranda', 'Ariel', 'Umbriel', 'Titania', 'Oberon', 'Triton']
def plot_ang_dev_timeseries(moon, trueFoot_f, trueFoot_b, footpoints_f, footpoints_b, time):
angs_array = angular_deviation(footpoints_f, trueFoot_f, footpoints_b, trueFoot_b)
f... | {"/high_res_all_moons.py": ["/all_funcs.py"], "/footpoint_analysis.py": ["/all_funcs.py"], "/planet_testing.py": ["/all_funcs.py"], "/unit_speed_tests.py": ["/all_funcs.py"], "/convergence_tests.py": ["/all_funcs.py"], "/dipole_testing.py": ["/all_funcs.py"], "/satellite_footpoints.py": ["/all_funcs.py"], "/quadrupole_... |
11,414 | jjwindow/PyFields | refs/heads/main | /planet_testing.py | from all_funcs import *
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib as mat
import numpy as np
from numpy.linalg import norm
from tqdm import tqdm
import os.path
from palettable.wesanderson import Aquatic2_5, Cavalcanti_5
fig = plt.figure()
ax = plt.axes(projection = '3d')... | {"/high_res_all_moons.py": ["/all_funcs.py"], "/footpoint_analysis.py": ["/all_funcs.py"], "/planet_testing.py": ["/all_funcs.py"], "/unit_speed_tests.py": ["/all_funcs.py"], "/convergence_tests.py": ["/all_funcs.py"], "/dipole_testing.py": ["/all_funcs.py"], "/satellite_footpoints.py": ["/all_funcs.py"], "/quadrupole_... |
11,415 | jjwindow/PyFields | refs/heads/main | /unit_speed_tests.py | # import field_calculator
# import field_calculator_numba
# import test_wrapper
# import stepper
from all_funcs import *
# from dipole_testing import multilines
import numpy as np
import time
g_D = np.array([[0., 0., 0., 0.], [1., 0., 0., 0.], [0., 0., 0., 0.], [0., 0., 0., 0.]])
h_D = np.array([[0., 0., 0., 0.], [1.,... | {"/high_res_all_moons.py": ["/all_funcs.py"], "/footpoint_analysis.py": ["/all_funcs.py"], "/planet_testing.py": ["/all_funcs.py"], "/unit_speed_tests.py": ["/all_funcs.py"], "/convergence_tests.py": ["/all_funcs.py"], "/dipole_testing.py": ["/all_funcs.py"], "/satellite_footpoints.py": ["/all_funcs.py"], "/quadrupole_... |
11,416 | jjwindow/PyFields | refs/heads/main | /convergence_tests.py | from all_funcs import *
def convergence_test(moon, pos, n_min, n_max, step):
n_array = np.arange(n_min, n_max+1, step)
ang_dev_arr_f = []
ang_dev_arr_b = []
lat_dev_arr_f = []
lat_dev_arr_b = []
long_dev_arr_f = []
long_dev_arr_b = []
for n in n_array:
footpoints_f, footpoints... | {"/high_res_all_moons.py": ["/all_funcs.py"], "/footpoint_analysis.py": ["/all_funcs.py"], "/planet_testing.py": ["/all_funcs.py"], "/unit_speed_tests.py": ["/all_funcs.py"], "/convergence_tests.py": ["/all_funcs.py"], "/dipole_testing.py": ["/all_funcs.py"], "/satellite_footpoints.py": ["/all_funcs.py"], "/quadrupole_... |
11,417 | jjwindow/PyFields | refs/heads/main | /all_funcs.py | """
PyFields all_funcs.py
01.11.2020
All modules in PyFields combined into one file to improve execution time.
"""
import numpy as np
import numba
from tqdm import tqdm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import pandas as pd
import warnings
import os.path
from palettable.wesanders... | {"/high_res_all_moons.py": ["/all_funcs.py"], "/footpoint_analysis.py": ["/all_funcs.py"], "/planet_testing.py": ["/all_funcs.py"], "/unit_speed_tests.py": ["/all_funcs.py"], "/convergence_tests.py": ["/all_funcs.py"], "/dipole_testing.py": ["/all_funcs.py"], "/satellite_footpoints.py": ["/all_funcs.py"], "/quadrupole_... |
11,418 | jjwindow/PyFields | refs/heads/main | /dipole_testing.py | """
PyFields dipole_testing.py
28.10.2020
Testing model using a dipole
"""
from all_funcs import *
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib as mat
import numpy as np
from tqdm import tqdm
import os.path
########################## DIPOLE TEST #########################... | {"/high_res_all_moons.py": ["/all_funcs.py"], "/footpoint_analysis.py": ["/all_funcs.py"], "/planet_testing.py": ["/all_funcs.py"], "/unit_speed_tests.py": ["/all_funcs.py"], "/convergence_tests.py": ["/all_funcs.py"], "/dipole_testing.py": ["/all_funcs.py"], "/satellite_footpoints.py": ["/all_funcs.py"], "/quadrupole_... |
11,419 | jjwindow/PyFields | refs/heads/main | /satellite_footpoints.py | from all_funcs import *
from all_funcs import _B_rad_
def trace_partial_orbit(moon, orbit_points, num_fieldlines):
l = len(orbit_points)
footpoints_f_arr = [0 for i in range(l)]
footpoints_b_arr = [0 for i in range(l)]
trueFoot_f_arr = [0 for i in range(l)]
trueFoot_b_arr = [0 for i in r... | {"/high_res_all_moons.py": ["/all_funcs.py"], "/footpoint_analysis.py": ["/all_funcs.py"], "/planet_testing.py": ["/all_funcs.py"], "/unit_speed_tests.py": ["/all_funcs.py"], "/convergence_tests.py": ["/all_funcs.py"], "/dipole_testing.py": ["/all_funcs.py"], "/satellite_footpoints.py": ["/all_funcs.py"], "/quadrupole_... |
11,420 | jjwindow/PyFields | refs/heads/main | /quadrupole_testing.py | from all_funcs import *
import matplotlib.pyplot as plt
import matplotlib as mat
import numpy as np
from collections import Counter
########################## QUADRUPOLE TEST ###############################
params = {
'axes.labelsize': 14,
'font.size': 14,
'legend.fontsize': 14,
'xtick.labelsize': 12,
'... | {"/high_res_all_moons.py": ["/all_funcs.py"], "/footpoint_analysis.py": ["/all_funcs.py"], "/planet_testing.py": ["/all_funcs.py"], "/unit_speed_tests.py": ["/all_funcs.py"], "/convergence_tests.py": ["/all_funcs.py"], "/dipole_testing.py": ["/all_funcs.py"], "/satellite_footpoints.py": ["/all_funcs.py"], "/quadrupole_... |
11,501 | inzaghian/anzhu | refs/heads/master | /ui/comset.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'comset.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_comsetform(object):
def setupUi(self, comsetform):
comsetfor... | {"/testform.py": ["/uartform.py"], "/main.py": ["/uartform.py"], "/comsetform.py": ["/ui/comset.py", "/uartform.py"], "/pinsetform.py": ["/uartform.py"], "/uartform.py": ["/ui/uart.py", "/comsetform.py", "/pinsetform.py", "/testform.py", "/com.py", "/xmlreadandwrite.py"]} |
11,502 | inzaghian/anzhu | refs/heads/master | /xmlreadandwrite.py | #coding:utf-8
import xml.etree.ElementTree as ET
#{'com': 'COM1', 'bsp': '115200', 'd': '8', 'p': 'NONE', 's': '1'}
def WriteXml(sl):
root=ET.Element("com")
for e in sl.keys():
l=ET.SubElement(root,"set")
l.attrib={'name':e,'value':sl[e]}
tree = ET.ElementTree(root)
tree.write("setmsg.xm... | {"/testform.py": ["/uartform.py"], "/main.py": ["/uartform.py"], "/comsetform.py": ["/ui/comset.py", "/uartform.py"], "/pinsetform.py": ["/uartform.py"], "/uartform.py": ["/ui/uart.py", "/comsetform.py", "/pinsetform.py", "/testform.py", "/com.py", "/xmlreadandwrite.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.