content stringlengths 4 20k |
|---|
from django.conf.urls import url
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required
from views import *
from sermepa.views import sermepa_ipn
urlpatterns = [
#url(r"^confirmar/(?P<reference>[-\.\w]+)/$", confirm_payment, name="pago_confirmar"),
url(r"^lista$... |
'''
MAP Client, a program to generate detailed musculoskeletal models for OpenSim.
Copyright (C) 2012 University of Auckland
This file is part of MAP Client. (http://launchpad.net/mapclient)
MAP Client is free software: you can redistribute it and/or modify
it under the terms of the GNU General Publi... |
import argparse
import sys
from .__init__ import __version__
from .check_recipe import add_check_recipe
from .install import add_install
from .list_files import add_list_files
from .list_installed_pkgs import add_list_installed_packages
from .list_pkg_info import add_pkg_info
from .make_bash import add_make_bash
from ... |
from gnuradio_swig_python import gr_block_sptr
import types
import hier_block
def remove_duplicates (seq):
new = []
for x in seq:
if not x in new:
new.append (x)
return new
class endpoint (object):
__slots__ = ['block', 'port']
def __init__ (self, block, port):
self.bl... |
"""
This module contains a sqoop 1.x hook
"""
import subprocess
from copy import deepcopy
from airflow.exceptions import AirflowException
from airflow.hooks.base_hook import BaseHook
class SqoopHook(BaseHook):
"""
This hook is a wrapper around the sqoop 1 binary. To be able to use the hook
it is required... |
import unittest
import asyncio
import aioredis
import itertools
from unittest import mock
from tanner.api.api import Api
from tanner import redis_client
from tanner.utils.asyncmock import AsyncMock
class TestApi(unittest.TestCase):
def setUp(self):
self.loop = asyncio.new_event_loop()
self.redis_... |
#!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... |
"""Tracking for bluetooth devices."""
import logging
from datetime import timedelta
from blumate.helpers.event import track_point_in_utc_time
from blumate.components.device_tracker import (
YAML_DEVICES,
CONF_TRACK_NEW,
CONF_SCAN_INTERVAL,
DEFAULT_SCAN_INTERVAL,
load_config,
)
import blumate.util a... |
from oslo_log import log as logging
from osprofiler import profiler
import traceback as tb
from mistral.db.v2.sqlalchemy import models
from mistral.engine import actions
from mistral.engine import task_handler
from mistral import exceptions as exc
from mistral.lang import parser as spec_parser
LOG = logging.getLogge... |
from __future__ import absolute_import
from django import template
from django.conf import settings
from django.contrib.auth.decorators import login_required, permission_required
from django.shortcuts import get_object_or_404, render_to_response
from django.views.decorators.csrf import csrf_protect
import annotation
... |
from collections import OrderedDict
from pgp import utils
def keys_equivalent(key1, key2):
return (
key1.version == key2.version
and key1.public_key_algorithm == key2.public_key_algorithm
and key1.modulus_n == key2.modulus_n
and key1.exponent_e == key2.exponent_e
and key1.... |
#!/usr/bin/python
import os, sys
path = os.path.dirname(os.path.abspath(__file__))
if __name__ == "__main__":
sys.path.insert(0,path)
# Instead of
# from blur.build import *
# we use this, because the former will re-import the module
# based on the local path, causing All_Targets to be
# a different list
locals()... |
import json
import logging
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render
from core import xml2kvp
from core.mongo import mc_handle
from core.models import PublishedRecords, FieldMapper
from .view_helpers import breadcrumb_parser
from .stateio import _stateio_... |
"""Module for a simple query language
A query filter is always a list. The first item in the list is the operator
(e.g. C{[OP_AND, ...]}), while the other items depend on the operator. For
logic operators (e.g. L{OP_AND}, L{OP_OR}), they are subfilters whose results
are combined. Unary operators take exactly one other... |
"""
Test client and request factory for creating request mock objects.
Classes in this module relies heavily on Werkzeug's test utilities to
do the heavy lifting. For further details please see
http://werkzeug.pocoo.org/docs/test/.
Which method to use?
* TestClient: Loads the Invenio WSGI application, and passes r... |
"""
Django settings for risr_proj project.
Generated by 'django-admin startproject' using Django 3.0.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
... |
# -*- coding: utf-8 -*-
from event import Event
class MouseEvent(Event):
DOUBLE_CLICK = "doubleClick"
CLICK = "click"
MIDDLE_CLICK = "middleClick"
MIDDLE_MOUSE_DOWN = "middleMouseDown"
MIDDLE_MOUSE_UP = "middleMouseUp"
MOUSE_DOWN = "mouseDown"
MOUSE_MOVE ... |
import public_markets
import observers
import config
import time
import logging
from concurrent.futures import ThreadPoolExecutor, wait
class Arbitrer(object):
def __init__(self):
self.markets = {}
self.observers = []
self.depths = {}
self.market_names = []
self.observer_na... |
"""
Django settings for hero project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# Bu... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'SearchTest.live'
db.add_column(u'wagtailsearch_searchtest... |
# coding: utf-8
import os
import sys
import shutil
SRC_DIR = os.path.dirname(__file__)
DIST_DIR = os.path.join(SRC_DIR, 'dist')
BUILD_DIR = os.path.join(SRC_DIR, '_build')
TEXT_DIR = os.path.join(BUILD_DIR, 'gettext')
HTML_DIR = os.path.join(BUILD_DIR, 'html')
DEFAULT_LANGUAGE = 'zh_CN'
SUPPORTED_LANGUAGES = [DEFAUL... |
import numpy as np
import bpy
from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty, StringProperty
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import throttle_and_update_node
from sverchok.utils.logging import info, exception
from sverchok.utils.math impor... |
from django import template
from django.conf import settings
from djangopress.forum.models import Thread, Post
from djangopress.core.util import has_permission
from django.urls import reverse
from djangopress.core.format.library import Library
import djangopress.core.format.nodes as nodes
register = template.Library()... |
""" Configuration file for miscutil module.
- Contains standard error messages for errorlib
e.g. No error message given, etc.
"""
__revision__ = "$Id$"
# pylint: disable-msg=C0301
CFG_MISCUTIL_ERROR_MESSAGES = \
{ 'ERR_MISCUTIL_BAD_FILE_ARGUMENT_PASSED': '_("Invalid argument %s was passed")',
'ERR_MISCUTIL_W... |
import dbus
from .constants import ACTION_INTERFACE, ACTION_OBJECT_PATH_BASE
from .object import DBusObject
class DBusAction(DBusObject):
def __init__(self, action, manager):
self._action = action
super(DBusAction, self).__init__(manager)
@property
def id(self):
return self._acti... |
#!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors, ticker, cm
from cmdtools import cmd_plot
class RGB():
'''
Attributes
----------
window_func (function): Window kernel functional form.
sobel_filt (function): Edge detection kernel.
bins... |
# encoding: utf-8
"""
address.py
Created by Thomas Mangin on 2010-01-19.
Copyright (c) 2009-2013 Exa Networks. All rights reserved.
"""
from struct import pack
from struct import unpack
# =================================================================== AFI
# http://www.iana.org/assignments/address-family-number... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from openassessment.assessment.models import Rubric
class Migration(DataMigration):
def forwards(self, orm):
"""Calculate the structure hash fo... |
import pytest ; pytest
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Bokeh imports
from bokeh.colors import RGB
# Module under test
import bokeh.colors.hsl as bch # isort:skip
#---------------... |
#!/usr/bin/python
#
# This sample script is a username crawler: it will obtain all known usernames
# from block chain and then try to download avatar and profiles for all of
# them. The report is shown as an html file.
#
# Downloaded data is cached in a python pickle file, so it may be executed
# again and it won't nee... |
"""Command for removing public keys to users."""
from googlecloudsdk.api_lib.compute import base_classes
from googlecloudsdk.api_lib.compute import utils
from googlecloudsdk.api_lib.compute.users import client as users_client
from googlecloudsdk.calliope import arg_parsers
from googlecloudsdk.command_lib.compute.users... |
"""Import multiple dsc files into Git in one go"""
import glob
import os
import sys
import tempfile
import gbp.command_wrappers as gbpc
from gbp.deb import DpkgCompareVersions
from gbp.deb.dscfile import DscFile
from gbp.errors import GbpError
from gbp.git import GitRepository, GitRepositoryError
from gbp.scripts impo... |
"""Tests for baremetal volume driver."""
from oslo.config import cfg
from nova import exception
from nova import test
from nova.virt.baremetal import volume_driver
from nova.virt import fake
from nova.virt.libvirt import volume as libvirt_volume
CONF = cfg.CONF
SHOW_OUTPUT = """Target 1: iqn.2010-10.org.openstack:v... |
import re
from nova import context
from nova import db
from nova import exception
from nova import flags
from nova import log as logging
from nova.network import model as network_model
from nova import utils
FLAGS = flags.FLAGS
LOG = logging.getLogger(__name__)
def image_type(image_type):
"""Converts to a thre... |
from django.urls import reverse
# wger
from wger.core.tests import api_base_test
from wger.core.tests.base_testcase import (
WgerAddTestCase,
WgerEditTestCase,
)
from wger.nutrition.models import MealItem
class EditMealItemUnitTestCase(WgerEditTestCase):
"""
Tests editing a meal, set the amount using... |
"""
===================================
Transform from Subject to MNI Space
===================================
Pycortex has built-in functionality for linearly transforming data to and from
standard atlas spaces (e.g. MNI-152). This functionality is built on top of FSL.
This example shows how to create a transform f... |
"""Randomize the minitaur_gym_env when reset() is called."""
import random
import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.dirname(currentdir))
parentdir = os.path.dirname(os.path.dirname(parentdir))
os.sys.path.insert(0, par... |
from __future__ import division
import csv
import numpy as np
import scipy as sp
import scipy.optimize as opt
import time as time
from matplotlib import pyplot as plt
#DEMOGRAPHICS FUNCTIONS
def getkeyages(S, PrintAges):
"""
Description:
-Gets the key ages for calculating demographics based on S
... |
"""
Developer views
(c) 2015 - Mark Scrimshire - @ekivemark
"""
__author__ = 'Mark Scrimshire:@ekivemark'
# DONE Activate Account
# DONE: accounts/profile Landing Page.
import ast
import json
from collections import OrderedDict
from django.core import serializers
from django.core.urlresolvers import reverse_lazy
fr... |
#!/usr/bin/python3
import gi, signal, logging, sys
# import GStreamer and GLib-Helper classes
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject, GstNet
# check min-version
minGst = (1, 0)
minPy = (3, 0)
Gst.init([])
if Gst.version() < minGst:
raise Exception("GStreamer version", Gst.version... |
from django.shortcuts import render
from django.http import HttpResponse
import json
from django.db.models import Q
import helpers, blockchain_func
from bitcoin.rpc import Proxy as rpcProcessedProxy
from bitcoinrpc.authproxy import JSONRPCException, AuthServiceProxy as rpcRawProxy
import external_db
def submit_transa... |
"""
For detailed information please see
http://shotgunsoftware.github.com/shotgunEvents/api.html
Global variable shared state
----------------------------
This plugin demoes how three callbacks can share state through a global variable.
The shared state stores two counters one (sequential) will be incremented
sequ... |
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms as horizon_forms
from horizon import tabs as horizon_tabs
from horizon.utils import memoized
from horizon impor... |
__author__ = 'ad'
from fields import BaseField, String, List
class ValidationError(StandardError):
def __init__(self, validation_errors):
self.errors = validation_errors
def __repr__(self):
return u"ValidationError: " + repr(self.errors)
class BaseModel(object):
pass
class Schema(typ... |
import base64
import imghdr
from tests.support.asserts import assert_error, assert_success
from tests.support.inline import inline
def take_element_screenshot(session, element_id):
return session.transport.send(
"GET",
"session/{session_id}/element/{element_id}/screenshot".format(
ses... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Faraday Penetration Test IDE - Community Version
Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
See the file 'doc/LICENSE' for the license information
'''
from __future__ import with_statement
from plugins import core
from model import api
import re
im... |
#!/usr/bin/python
import os, time
from lib.config import Config
from lib.configs.mesos_config import MesosConfig
from lib.utils import Utils
LOG = MesosConfig.setup(__file__)
def ensure_deb_packaging():
path = MesosConfig.deb_packaging_repository_dir()
if os.path.isdir("{}/.git".format(path)):
LOG.inf... |
# coding: utf-8
from __future__ import unicode_literals
import xlwt
from django.db.models import Q
from django.http import HttpResponse
from rest_framework import viewsets
from rest_framework.decorators import list_route, detail_route
from rest_framework.filters import SearchFilter
from rest_framework.response import R... |
import abc
import json
from collections import defaultdict, namedtuple
from cms.utils.compat.dj import force_unicode
from cms.constants import RIGHT, LEFT, REFRESH_PAGE, URL_CHANGE
from django.template.loader import render_to_string
from django.utils.functional import Promise
class ItemSearchResult(object):
def ... |
import functools
from concurrent.futures import ThreadPoolExecutor
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
cb = None
threads = ThreadPoolExecutor(2)
def init_chatterbot(ev):
global cb
if ev.db.chatterbot.statements.count():
train = False
else:
... |
from collections import OrderedDict
from copy import copy
from inspect import getfullargspec, ismethod
from coala_utils.decorators import enforce_signature
from coalib.settings.DocstringMetadata import DocstringMetadata
class FunctionMetadata:
str_nodesc = "No description given."
str_optional = "Optional, de... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Event.created_by'
db.alter_column(u'sked_event', 'created_by_id', self.gf('django.db.mode... |
__author__ = 'bromix'
from resources.lib.kodion.utils import FunctionCache
from resources.lib import kodion
from resources.lib.kodion.items import DirectoryItem, VideoItem, UriItem
from resources.lib.kodion.utils import datetime_parser
from .client import Client, UnsupportedStreamException
class Provider(kodion.Abst... |
"""alloccli subcommand for viewing a list of comment subscriptions."""
import sys
from .alloc import alloc
class subscriptions(alloc):
"""Modify interested party subscriptions for an email address."""
# Setup the options that this cli can accept
ops = []
ops.append(('', 'help ', 'Show th... |
import munch
try:
from unittest import mock
except ImportError:
import mock
import basecrm
from basecrm.test.testutils import BaseTestCase
from munch import munchify
class SyncTests(BaseTestCase):
@property
def device_uuid(self):
return '6dadcec8-6e61-4691-b318-1aab27b8fecf'
def session... |
import pytest
from etcdb import OperationalError
from etcdb.lock import WriteLock
def test_insert(cursor):
cursor.execute('CREATE TABLE t1(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255))')
cursor.execute("INSERT INTO t1(id, name) VALUES (1, 'aaa')")
cursor.execute("INSERT INTO t1(id, name)... |
'''This script should be called every six hours or so'''
import os
import json
import datetime
import base64
import hashlib
import logging
import requests
import subprocess
from divvy import inspect, root
logger = logging.getLogger(__name__)
github_root = 'https://api.github.com'
def get_file(file_path, repo, heade... |
"""Benchmark scipy.stats.betaprime.cdf."""
from __future__ import print_function
import timeit
NAME = "betaprime:cdf"
REPEATS = 3
ITERATIONS = 1000
def print_version():
"""Print the TAP version."""
print("TAP version 13")
def print_summary(total, passing):
"""Print the benchmark summary.
# Argume... |
#!/usr/bin/python
#
# HD44780 LCD Test Script for
# Raspberry Pi
#
# Site : http://www.raspberrypi-spy.co.uk
#
#
# The wiring for the LCD is as follows:
# 1 : GND
# 2 : 5V
# 3 : Contrast (0-5V)*
# 4 : RS (Register Select)
# 5 : R/W (Read Write) - GROUND THIS PIN
# 6 : Enable or Strobe
# 7 : Data Bit 0 ... |
import unittest
import urllib
import os
import datetime
from dateutil.relativedelta import relativedelta
import netCDF4
import numpy as np
from ocw.dataset import Dataset
import ocw.utils as utils
class TestDecodeTimes(unittest.TestCase):
test_model = '../ocw-ui/backend/tests/example_data/lat_lon_time.nc'
d... |
import os, os.path
import cherrypy
import pygatt
import requests
import json
def bluetooth_action(domain, path, parameters):
rcode = "{\"action\":false}"
try:
adapter = pygatt.GATTToolBackend()
adapter.start()
device = adapter.connect(domain, address_type=pygatt.BLEAddressType.random)
... |
from __future__ import unicode_literals
from indico.core.db.sqlalchemy import db
from indico.core.db.sqlalchemy.review_questions import ReviewQuestionMixin
from indico.modules.events.reviewing_questions_fields import get_reviewing_field_types
from indico.util.locators import locator_property
class AbstractReviewQues... |
import numpy as np
from annotations.test_models import BaseTestCase
from annotations.models import Alignment, Annotation, Label, LabelKey, Sentence, Fragment, Word, Tense, TenseCategory
from .models import Scenario, ScenarioLanguage
from .utils import run_mds
np.seterr(invalid='ignore') # Silences the RuntimeWarning... |
"Test cases for the :module:`arango_orm.database`"
import logging
from datetime import date
from . import TestBase
from .data import Person, Car, cars
from arango import ArangoClient
from arango.exceptions import CollectionStatisticsError
from arango_orm.database import Database
from arango_orm.collections import Col... |
from coalib.bearlib.abstractions.Linter import linter
from coalib.bears.requirements.GoRequirement import GoRequirement
@linter(executable='go',
use_stdout=False,
use_stderr=True,
output_format='regex',
output_regex=r'.+:(?P<line>\d+): (?P<message>.*)')
class GoVetBear:
"""
Ana... |
from src.platform.jboss.authenticate import checkAuth
from src.platform.jboss.interfaces import JINTERFACES
from auxiliary import Auxiliary
from re import findall
from log import LOG
import utility
class Auxiliary:
"""Obtain deployed WARs through jmx-console
"""
def __init__(self):
self.name = "L... |
import functools
import typing as T
import os
import re
from .base import (DependencyMethods, PkgConfigDependency, factory_methods,
ConfigToolDependency, detect_compiler, ExternalDependency)
from ..environment import detect_cpu_family
if T.TYPE_CHECKING:
from .base import DependencyType
fro... |
"""
Signal Handlers for External User Ids to be created and maintainer
"""
from logging import getLogger
from django.db.models.signals import post_save
from django.dispatch import receiver
from openedx.core.djangoapps.catalog.utils import get_programs
from .models import ExternalId, ExternalIdType
LOGGER = getLogg... |
"""Contains the logic for `aq search network`."""
from sqlalchemy.sql import exists
from sqlalchemy.orm import undefer
from aquilon.worker.broker import BrokerCommand # pylint: disable=W0611
from aquilon.exceptions_ import ArgumentError
from aquilon.aqdb.model import (Network, Machine, VlanInfo, ObservedVlan,
... |
#!/usr/bin/python
"""
Program to analyize the contents of a given directory (and subdirectories).
Initial design: give counts of each extension type, and a break down by size
of the files into various buckets. Follows the pattern of:
"""
import operator
import os
import os.path
import sys
# NOTE: To change what si... |
"""General utilities used by the Rust package."""
import sublime
import textwrap
import os
PACKAGE_NAME = __package__.split('.')[0]
def index_with(l, cb):
"""Find the index of a value in a sequence using a callback.
:param l: The sequence to search.
:param cb: Function to call, should return true if t... |
import os
from oslo.config import cfg
from heat.common import exception
from heat.common import template_format
from heat.engine import stack_resource
from heat.engine.resources import nova_utils
from heat.openstack.common import log as logging
logger = logging.getLogger(__name__)
lb_template_default = r'''
{
"A... |
import boto
import datetime
class CertChecker():
def __init__(self, profile):
self.profile = profile
self.cert_list = list()
self.cert_elb_dict = self.get_cert_elb_dict()
self.cert_exp_dict = self.get_cert_exp_dict()
self.result = self.create_result()
def get_cert_elb_d... |
'''
SASMOl: Copyright (C) 2011 Joseph E. Curtis, Ph.D.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... |
import os, tempfile, logging
from autotest.client.shared import log, utils, test as common_test
class test(common_test.base_test):
disable_sysinfo_install_cache = False
host_parameter = None
_sysinfo_before_test_script = """\
import pickle
from autotest.client import test
mytest = test.test(job, '', %r)
jo... |
# -*- coding: utf-8 -*-
import pygame
from sys import exit
from os import environ, listdir
from Tkinter import Tk, Label
from ttk import Combobox, Button
from tkMessageBox import showwarning
from src import *
pygame.init()
pygame.mixer.init(channels=8)
class Menu(object):
KONAMI_CODE = [273, 273, 274, 274, 27... |
import os.path
import shutil
import sys
import tarfile
import tempfile
import urllib
# CLANG_REVISION and CLANG_SUB_REVISION determine the build of clang
# to use. These should be synced with tools/clang/scripts/update.py in
# Chromium.
CLANG_REVISION = "261368"
CLANG_SUB_REVISION = "1"
PACKAGE_VERSION = "%s-%s" % (C... |
import datetime
from itertools import cycle
import logging
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QAction, QApplication, QCheckBox, QComboBox, QGridLayout, QHBoxLayout,
QLabel, QLineEdit, QMenu, QMessageBox, QPlainTextEdit, QPushButton,
QSpacer... |
import asyncio
import logging
import botocore.exceptions
from .bases import BaseSQSClient
from loafer.exceptions import ProviderError
from loafer.providers import AbstractProvider
logger = logging.getLogger(__name__)
class SQSProvider(AbstractProvider, BaseSQSClient):
def __init__(self, queue_name, options=No... |
from cinderclient import client
from cinderclient.v1 import availability_zones
from cinderclient.v1 import limits
from cinderclient.v1 import quota_classes
from cinderclient.v1 import quotas
from cinderclient.v1 import services
from cinderclient.v1 import volumes
from cinderclient.v1 import volume_snapshots
from cinder... |
from __future__ import division
import sys
def main():
size_of_corpus=int(sys.argv[1])
scores_file = sys.argv[2]
rank_statistics_file = sys.argv[3]
get_scores(scores_file)
# Load corpus, query profile sizes and similarity scores
corpus_profile_sizes, query_profile_sizes, scores = load_profiles()
sizes = [corp... |
# Monkey-patch all synchronous functions
from gevent import monkey
monkey.patch_all()
import re
import urllib3
from gevent.pywsgi import WSGIServer
import redis
import django
from urllib.parse import urlunparse
import logging
logger = logging.getLogger(__name__)
from django_rt.event import ResourceEvent
from django_... |
import re,util
__name__ = 'rutube'
def supports(url):
return not _regex(url) == None
# returns the steam url
def url(url):
m = _regex(url)
if m:
data = util.request('http://rutube.ru/trackinfo/'+m.group('id')+'.xml')
n = re.search('<m3u8>([^<]+)',data,re.IGNORECASE | re.DOTALL)
if not n == None:
return [n.... |
'''
This module is to create model of Course
'''
from openerp import api, fields, models, _
class Course(models.Model):
'''
This class create model of course
'''
_name = 'openacademy.course' # Model odoo name
name = fields.Char(string="Title", required=True)
# Field reserved to identified na... |
# Import python libs
import new
import sys
# Import Salt Testing libs
from salttesting import skipIf, TestCase
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# wmi and pythoncom modules are platform specific...
wmi = new.module('wmi')
sys.modules['wmi'] = wmi
pythoncom = new.module('py... |
# -*- coding: UTF-8 -*-
"""
Utility module.
"""
import logging
import os
from logging import getLogger
from xml.dom import minidom
_LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
_DEFAULT_LOG_PATH = None # don't write to a file in default
_DEFAULT_LOG_LEVEL = logging.INFO
__author__ = 'kensk8er'... |
# -*- coding: utf-8 -*-
from odoo.tests import common
from odoo.exceptions import ValidationError
from odoo import Command
class test_inherits(common.TransactionCase):
def test_create_3_levels_inherits(self):
""" Check that we can create an inherits on 3 levels """
pallet = self.env['test.pallet'... |
import glob
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib
import os
os.chdir('/Users/evanbiederstedt/Downloads/RRBS_data_files')
import glob
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib
... |
#!/usr/bin/env python3
from argparse import ArgumentParser, RawDescriptionHelpFormatter
from pathlib import Path
from util import algorithms, posint
import json
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import sys
argparser = ArgumentParser(description='''\
Generates plots from the log s... |
import pwd
import os
import copy
import unittest2
from st2common.models.system.action import ShellCommandAction
from st2common.models.system.action import ShellScriptAction
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
FIXTURES_DIR = os.path.abspath(os.path.join(CURRENT_DIR, '../fixtures'))
LOGGED_USER_U... |
from __future__ import print_function, division
import numpy as np
import math
import scipy
from .signal import mean_power
from .signal import SignalFrames
def spectrogram(filename, frame_size=2048, hop_size=512, magnitudes='power_db'):
"""
Computes an STFT magnitude power spectrogram from an audio file.
... |
"""
The Extractor module takes phase, result (red, red/amber, amber, green), record date/time to prepare for
data analysis.
"""
from __future__ import absolute_import
from tools.Utils import output_fields
import pandas as pd
def create_analysis_dataset(data, phase_list, analysis_folder):
"""
Prepare... |
import json
import six
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponse # noqa
from django.utils.translation import ugettext_lazy as _
from django.views.generic import View # noqa
from horizon import ... |
import argparse
import fileinput
#
# Import local packages
#
if __name__ == '__main__' and __package__ is None:
from os import sys, path
# print(path.dirname(path.dirname(path.abspath(__file__))))
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
import ptab.core
# dockets = ['2016-011... |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2015 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... |
import smartbot.plugin
from smartbot.utils.web import requests_session
from smartbot.exceptions import StopCommand
from smartbot.formatting import Style
class Plugin(smartbot.plugin.Plugin):
"""Get news stories."""
names = ["news"]
def on_command(self, msg, stdin, stdout):
topic = " ".join(msg["a... |
from datetime import datetime
from django.db import models
from app.models import SiteUser, CronJob, CronJobType, CronJobType_Choices
from app.mixins import HelperMixins
from cronjob.forms import CronJobForm_Create, CronJobForm_Edit
class Layout_View(object):
def __init__(self, site_user, title):
sel... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test of the Tables facility independent of Ice.
Copyright 2009-2014 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import pytest
import Ice
import omero
import omero.tables
import uuid
import logging
... |
import cbor
import libnacl
import libnacl.utils
import logging
class Message:
def __init__(self, session_key=None):
self.command = None
self.uuid = None
self.params = None
self.bulk = None
self.session_key = session_key # here so we can reply to a message without knowledge... |
from builtins import zip
from builtins import range
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
def insert_missing():
# Connect to a pre-existing cluster
data = [[1, 2, 3, 1, 'a', 1, 9],
[1, 6, 4, 2, 'a', 1, 9],
[2, 3, 8, 6, 'b', 1, 9],
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.