code
stringlengths
1
199k
"""Tests for tfx.components.example_gen.utils.""" import os import re import tensorflow as tf from tfx.components.example_gen import utils from tfx.dsl.io import fileio from tfx.orchestration import data_types from tfx.proto import example_gen_pb2 from tfx.proto import range_config_pb2 from tfx.utils import io_utils fr...
"""OLECF plugin related functions and classes for testing.""" from __future__ import unicode_literals import pyolecf from plaso.containers import sessions from plaso.storage.fake import writer as fake_writer from tests.parsers import test_lib class OLECFPluginTestCase(test_lib.ParserTestCase): """OLE CF-based plugin ...
import datetime import mock from subunit2sql import read_subunit as subunit from subunit2sql.tests import base class TestReadSubunit(base.TestCase): def test_get_duration(self): dur = subunit.get_duration(datetime.datetime(1914, 6, 28, 10, 45, 0), datetime.datetime(1914, 6...
import copy import mock from webob import exc from neutron.openstack.common import uuidutils from neutron.tests.unit import test_api_v2 from neutron.tests.unit import test_api_v2_extension from midonet.neutron.extensions import bgp _uuid = uuidutils.generate_uuid _get_path = test_api_v2._get_path class BgpExtensionTest...
from google.analytics import admin_v1alpha def sample_delete_display_video360_advertiser_link(): # Create a client client = admin_v1alpha.AnalyticsAdminServiceClient() # Initialize request argument(s) request = admin_v1alpha.DeleteDisplayVideo360AdvertiserLinkRequest( name="name_value", ) ...
import re from collections import Counter from datetime import date, datetime import pytz import regex from . import enumerations flags = re.IGNORECASE | re.MULTILINE | re.UNICODE global tzinfo tzinfo = pytz.UTC month_to_number = enumerations.month_to_number def num(text): if text: if text.isdigit(): ...
import setuptools setuptools.setup( setup_requires=['d2to1', 'pbr'], d2to1=True, )
"""Support for Radio Thermostat wifi-enabled home thermostats.""" import datetime import logging import voluptuous as vol import radiotherm from homeassistant.components.climate import ClimateDevice, PLATFORM_SCHEMA from homeassistant.components.climate.const import ( HVAC_MODE_AUTO, HVAC_MODE_COOL, HVAC_MODE_HEAT,...
""" Copyright 2015 SmartBear Software 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 law or agreed to...
"""A model for classifying light curves using a convolutional neural network. See the base class (in astro_model.py) for a description of the general framework of AstroModel and its subclasses. The architecture of this model is: predictions ...
''' watchsnmp.py set snmp device(s) to monitor set snmp oid list to monitor get snmp info from devices using oid list save snmp data read saved snmp data diff from prev smp data graph snmp data send alert email ''' from snmp_helper import snmp_get_oid_v3,snmp_extract from watchdata import WatchData import time ip='184....
"""Executes benchmark testing for bert pretraining.""" from __future__ import print_function import time from typing import Optional from absl import flags import tensorflow as tf from official.benchmark import benchmark_wrappers from official.benchmark import owner_utils from official.benchmark import perfzero_benchma...
from typing import TypeVar, Generic, Union, Dict, Tuple TermT = TypeVar('TermT') class TupleExpansion(Generic[TermT]): def __init__(self, expr: Union[str, TermT]): self.expr = expr class UnificationStrategy(Generic[TermT]): Expr = Union[str, TermT, TupleExpansion[TermT]] # Checks if term1 is equal t...
import logging from datetime import datetime from rx.disposables import Disposable, SingleAssignmentDisposable, \ CompositeDisposable from rx.concurrency.scheduler import Scheduler log = logging.getLogger("Rx") class IOLoopScheduler(Scheduler): """A scheduler that schedules work via the Tornado I/O main event l...
""" Copyright 2006-2008 SpringSource (http://springsource.com), All Rights Reserved 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 Un...
import scrabble longest = "" for word in scrabble.wordlist: if list(word) == list(reversed(word)) and len(word) > len(longest): longest = word print(longest)
from geo2d.geometry import * Users.initial = "Ne" class LookingBrain(CritterBrain): code = "l" def __init__(self): CritterBrain.__init__(self) self.hit_food = 0 self.eating = 0 def on_collision(self,dir,other,senses): if isinstance(other,Food): self.hit_food += 2 ...
""" This is a subfile for IsyClass.py These funtions are accessable via the Isy class opj """ from ISY.IsyExceptionClass import IsyInvalidCmdError, IsyResponseError, IsyRuntimeWarning, IsyValueError from ISY.IsyProgramClass import IsyProgram import xml.etree.ElementTree as ET def load_prog(self, progid=None): """ L...
"""Create GO-Dag plots.""" __copyright__ = "Copyright (C) 2016-2018, DV Klopfenstein, H Tang. All rights reserved." __author__ = "DV Klopfenstein" from goatools.cli.gosubdag_plot import PlotCli def run(): """Create GO-Dag plots.""" PlotCli().cli() if __name__ == '__main__': run()
""" Rich compare mixin. Copied from http://www.voidspace.org.uk/python/articles/comparison.shtml """ from __future__ import print_function, division, absolute_import from flypy import jit @jit class RichComparisonMixin(object): layout = [] @jit def __eq__(self, other): raise NotImplementedError("Equ...
import nacc.uds3 def header_fields(): fields = {} fields["PACKET"] = nacc.uds3.Field(name="PACKET", typename="Char", position=(1, 2), length=2, inclusive_range=None, allowable_values=[], blanks=[]) fields["FORMID"] = nacc.uds3.Field(name="FORMID", typename="Char", position=(4, 6), length=3, inclusive_range=...
""" pygments.lexers.chapel ~~~~~~~~~~~~~~~~~~~~~~ Lexer for the Chapel language. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, bygroups, words from pygments.token import Text, Comment, Operator, K...
from sippy.SipHeader import SipHeader from sippy.UasStateIdle import UasStateIdle from sippy.UacStateIdle import UacStateIdle from sippy.SipRequest import SipRequest from sippy.SipContentType import SipContentType from sippy.SipMaxForwards import SipMaxForwards from sippy.CCEvents import CCEventTry, CCEventFail, CCEven...
from sqlalchemy import engine_from_config from sqlalchemy.orm import sessionmaker from sqlalchemy.orm import configure_mappers import zope.sqlalchemy from .objectModels import Course, Person, Role, CoursesPeople, Instrument, Objective from .objectModels import Response, Item, InstrumentItems, Blob, Answer, AnswerBlobs ...
import csv import datetime import json import os import io import unittest from time import sleep from django.conf import settings from django.core.files.storage import get_storage_class, FileSystemStorage from django.urls import reverse from django.utils.dateparse import parse_datetime from xlrd import open_workbook f...
""" Invoke various functionality for imageio docs. """ from pathlib import Path import imageio def setup(app): init() app.connect("source-read", rstjinja) def init(): print("Special preparations for imageio docs:") for func in [ prepare_reader_and_witer, ]: print(" " + func.__doc__....
import os from nose.tools import assert_raises from flask import Flask from flask_assets import Environment, Bundle class TestEnv: def setup(self): self.app = Flask(__name__) self.env = Environment(self.app) self.env.debug = True self.env.register('test', 'file1', 'file2') def te...
from __future__ import division import random import heapq def rand_weight_link(graph, node1, node2): """ Create a link between node1 and node2 """ if node1 not in graph: graph[node1] = {} graph[node1][node2] = random.randint(1, 10) if node2 not in graph: graph[node2] = {} gr...
""" Utility routines """ from __future__ import (print_function, absolute_import, division, unicode_literals) import numpy as np import os import glob import pdb from matplotlib import pyplot as plt from astropy.table import Table from astropy.io import fits from xastropy.xutils import xdebug as xdb from cosredux impor...
from testml.runners import * run('test_load.tml')
from __future__ import absolute_import from setuptools import setup, find_packages setup( name = 'virtualenv-commands', version = '0.2.3', description = 'Additional commands for virtualenv.', author = 'Medium', author_email = 'labs@thisismedium.com', url = 'http://thisismedium.com/labs/virtualen...
import argparse def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("-C", "--config", action="append", default=[], help="Extra configuration directories") parser.add_argument("-I", "--ipython", action="store_true", default=False, help="Sta...
from __future__ import print_function, unicode_literals, absolute_import Bitmap_Size__init__ = """ The metrics of a bitmap strike in a bitmap `Face`. It is used for `Face.available_sizes`. """ Bitmap_Size_height = """ The vertical distance, in pixels, between two consecutive baselines. It is always positive. """ Bitmap...
import time import os import unittest from django.contrib.auth.models import User, Permission from django.core import mail from django.core.urlresolvers import reverse from django.test import TransactionTestCase from django.test.client import Client try: from lxml import html except ImportError: raise Exception...
import os import sys import unittest from tap import TAPTestRunner if __name__ == "__main__": tests_dir = os.path.dirname(os.path.abspath(__file__)) loader = unittest.TestLoader() tests = loader.discover(tests_dir) runner = TAPTestRunner() runner.set_outdir("testout") runner.set_format("Hi: {met...
"""Test praw.models.redditor.""" import mock import pytest from prawcore import BadRequest, Forbidden from praw.models import Comment, Submission from ... import IntegrationTest class TestRedditor(IntegrationTest): FRIEND = "PyAPITestUser3" FRIEND_FULLNAME = "t2_6c1xj" @mock.patch("time.sleep", return_value...
#!/usr/bin/python ''' A simple network back-up script. It was originally based on the http://habrahabr.ru/post/236483/ thread and comments Usage: I use it with with crond to run daily. There are no command-line parameters to provide. Before using, configure the variables in the initial section. Then test if it e...
from collections import deque import gametime class ActionScheduler(object): def __init__(self): self._actors = deque() @property def entities(self): # All monsters have health return [actor for actor in self._actors if actor.has("health")] @property def actors(self): return...
from ctypes import ( CDLL, c_bool, c_buffer, c_byte, c_char, c_char_p, c_double, c_float, c_int, c_int8, c_int16, c_int32, c_int64, c_long, c_longdouble, c_longlong, c_short, c_size_t, c_ubyte, c_uint, c_uint8, c_uint16, c_uint32, c_uint64, c_ulong, c_ulonglong, c_ushort, c_void_p, c_wchar, c_wchar_...
from ..excel_comparison_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """ Test file created by XlsxWriter against a file created by Excel. """ def setUp(self): self.set_filename('chart_data_labels09.xlsx') def test_create_fi...
import sys from cachetools import LRUCache import pyvex import claripy from archinfo import ArchARM from ... import sim_options as o from ...state_plugins.inspect import BP_AFTER, BP_BEFORE from ...state_plugins.sim_action import SimActionExit, SimActionObject from ...errors import (SimError, SimIRSBError, SimSolverErr...
from django.conf.urls import url from analytics import api_views urlpatterns = [ url(r'^api/heartbeat/', api_views.heartbeat), url(r'^api/species/$', api_views.get_species_list), url(r'^api/magnifications/$', api_views.get_magnification_list), url(r'^api/development-stages/$', api_views.get_development_...
from ....io.geotable.file import read_files as rf from .. import _accessors as to_test from ...shapes import Point, Chain, Polygon, Rectangle, LineSegment from ....common import pandas, RTOL, ATOL from ....examples import get_path import numpy as np import unittest as ut PANDAS_EXTINCT = pandas is None @ut.skipIf(PANDA...
import os import sys import time import traceback import copy import logging import funcsigs import numpy as np import colorama import atexit import threading import string import weakref import config import pickling import serialization import internal.graph_pb2 import graph import services import libnumbuf import li...
import decimal from sympy import (Rational, Symbol, Float, I, sqrt, oo, nan, pi, E, Integer, S, factorial, Catalan, EulerGamma, GoldenRatio, cos, exp, Number, zoo, log, Mul, Pow, Tuple, latex, Gt, Lt, Ge, Le, AlgebraicNumber, simplify) from sympy.core.compatibili...
from .request import Request class TradeGetRequest(Request): def __init__(self): self.fields = None # Trade 的相关字段包括Order self.tid = None # 交易单号 self.method = 'taobao.trade.get' self.p = {} def set_fields(self, fields): self.fields = fields self.p['fields'] = field...
from __future__ import absolute_import from datetime import datetime, timedelta from django.utils import timezone from celery import shared_task import urllib, urllib2, pycurl, json from base.models import * from base.utils import * from django.conf import settings from os import listdir, remove from os.path import isf...
""" Tests for the pandas.io.common functionalities """ import mmap import pytest import os from os.path import isabs import pandas as pd import pandas.util.testing as tm import pandas.util._test_decorators as td from pandas.io import common from pandas.compat import is_platform_windows, StringIO, FileNotFoundError ...
from time import time from diesel import fork, fork_child, sleep, quickstart, quickstop, ParentDiedException from diesel.hub import Timer def test_basic_sleep(): delt = [None] STIME = 0.3 def l(): t = time() sleep(STIME) delt[0] = time() - t l_ = fork(l) sleep() while l_....
import csv import os import io from django.contrib import admin from django.conf import settings from hellomama_registration import utils from .models import Record, State, Facility, Community, PersonnelUpload from .tasks import send_personnel_code class RecordAdmin(admin.ModelAdmin): list_display = [ "id",...
import pyfftw import struct import numpy as np import glob import sys import os import math from scipy import stats import scipy.io.wavfile as wavfile from dpss import dpss def nextpow2(i): n = 2 while n < i: n = n * 2 return n def ftest(data, tapers, p, fft_in, fft_out, fft_plan): tmp = data.shape N = ...
import numpy as np from scipy import sqrt, pi, arctan2, cos, sin from scipy.ndimage import uniform_filter def hog(image, orientations=9, pixels_per_cell=(8, 8), cells_per_block=(3, 3), visualise=False, normalise=False): """Extract Histogram of Oriented Gradients (HOG) for a given image. Compute a Histog...
"""Configuration Option Checker. Script to ensure that all configuration options for the Chrome EC are defined in config.h. """ from __future__ import print_function import os import re import subprocess class Line(object): """Class for each changed line in diff output. Attributes: line_num: The integer line nu...
from jsl.resolutionscope import ResolutionScope def test_scope(): scope = ResolutionScope() id, scope = scope.alter('q') assert id == 'q' id, scope = scope.alter('w') assert id == 'w' assert scope.base == '' assert scope.current == 'w' assert scope.output == 'w' scope = ResolutionSco...
import pytz import datetime from flask import current_app from purchasing.database import Column, Model, db, ReferenceCol from purchasing.utils import localize_today, localize_now from sqlalchemy.schema import Table from sqlalchemy.orm import backref from sqlalchemy.dialects.postgres import ARRAY from sqlalchemy.dialec...
from django.utils.safestring import mark_safe from django.utils.http import urlquote from djpcms.utils.func import data2url from base import htmlbase __all__ = ['Paginator'] class Paginator(object): ''' List pagination It contains Information about the items displayed and a list of links to navigate thr...
from holoviews.element import RGB, Tiles, Points, Bounds from holoviews.element.tiles import StamenTerrain, _ATTRIBUTIONS from .test_plot import TestPlotlyPlot, plotly_renderer import numpy as np class TestMapboxTilesPlot(TestPlotlyPlot): def setUp(self): super().setUp() # Precompute coordinates ...
from config import * TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS LANGUAGE_CODE = 'en-us' SITE_ID = 1 USE_I18N = True USE_L10N = True USE_TZ = True STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.f...
from django import forms class UserForm(forms.Form): val = forms.CharField(label='User.{id,username,email}') def get_lookup(self): val = self.cleaned_data['val'] if '@' in val: return {'email': val} try: return {'pk': int(val)} except: return {...
from itertools import chain from sql.core import Flavor, FromItem, Expression from sql._compat import string_types, text_type, map, zip from sql.utils import csv_map __all__ = ('Abs', 'Cbrt', 'Ceil', 'Degrees', 'Div', 'Exp', 'Floor', 'Ln', 'Log', 'Mod', 'Pi', 'Power', 'Radians', 'Random', 'Round', ...
import datetime import itertools import unittest from copy import copy from unittest import mock from django.db import ( DatabaseError, IntegrityError, OperationalError, connection, ) from django.db.models import Model from django.db.models.deletion import CASCADE, PROTECT from django.db.models.fields import ( ...
from django.core.urlresolvers import RegexURLResolver class CMSURLResolver(RegexURLResolver): def __init__(self, regex, url_patterns, default_kwargs=None, app_name=None, namespace=None): # regex is a string representing a regular expression. # urlconf_name is a string representing the module contain...
from wtforms import form, __version__ as wtforms_version from wtforms.fields.core import UnboundField class BaseForm(form.Form): def __init__(self, formdata=None, obj=None, prefix=u'', **kwargs): self._obj = obj super(BaseForm, self).__init__(formdata=formdata, obj=obj, prefix=prefix, **kwargs) clas...
"""Tests for the pages models.""" from django.core.urlresolvers import reverse from arpegio.pages.models import Page def test_page_url(): """Get the url of the page.""" page = Page(title='A title', slug='a-title') assert page.get_absolute_url() == reverse('pages:page', ...
import os import sys import subprocess from distutils.core import setup, Command with open(os.path.join(os.path.dirname(__file__), 'README.md')) as f: readme = f.read() class Test(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(...
import logging import flask from google.appengine.ext import ndb from werkzeug.wrappers import Response as WerkzeugResponse from . import signals from .base import KibbleView from .edit import FieldsetIterator from .util.forms import BaseCSRFForm from .util.ndb import instance_and_ancestors_async logger = logging.getLo...
import sys, os import dragon import apps_tools.android as android import apps_tools.ios as ios android_pdraw_dir = os.path.join(dragon.WORKSPACE_DIR, "packages", "pdraw") android_jni_dir = os.path.join(android_pdraw_dir, "libpdraw", "android", "jni") android_app_dir = os.path.join(android_pdraw_dir, "apps",...
import re from trac.config import get_configinfo from trac.core import * from trac.loader import get_plugin_info from trac.perm import IPermissionRequestor from trac.util.html import tag from trac.util.translation import _ from trac.web.api import IRequestHandler from trac.web.chrome import Chrome, INavigationContribut...
from django.utils.encoding import smart_str from markdown2 import markdown as _markdown def markdown(text, **kwargs): return smart_str(_markdown(text, **kwargs).strip())
import os from nose.tools import * import unittest import pandas as pd import py_entitymatching.catalog.catalog_manager as cm from py_entitymatching.evaluation.evaluation import eval_matches from py_entitymatching.io.parsers import read_csv_metadata from py_entitymatching.utils.generic_helper import get_install_path da...
from pysnmp.smi.error import SmiError, NoSuchInstanceError from pysnmp.smi.exval import noSuchInstance from pysnmp.entity import config def getTargetAddr(snmpEngine, snmpTargetAddrName): mibBuilder = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder snmpTargetAddrEntry, = mibBuilder.importSymbols( ...
from .engine_class import ( FFTEngine, FractionFFTEngine, CosineEngine, ) from .option_class import BasicOption from .pricing_class import FourierPricer from .process_class import ( BlackScholes, Heston, MertonJump, KouJump, VarianceGamma, NIG, Poisson, CGMY, ) from .version ...
from __future__ import division from sympy import (Add, Basic, S, Symbol, Wild, Float, Integer, Rational, I, sin, cos, tan, exp, log, nan, oo, sqrt, symbols, Integral, sympify, WildFunction, Poly, Function, Derivative, Number, pi, NumberSymbol, zoo, Piecewise, Mul, Pow, nsimplify, ratsimp, trigsimp, radsimp...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 0, transform = "Fisher", sigma = 0.0, exog_count = 0, ar_order = 12);
from __future__ import absolute_import import datetime import os import re try: from flask import _app_ctx_stack as stack except ImportError: from flask import _request_ctx_stack as stack try: from flaskext.sqlalchemy import SQLAlchemy except: from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy ...
import doseresponse as dr import numpy as np import scipy.stats as st import numpy.random as npr import argparse import itertools as it import pandas as pd import os seed = 1 npr.seed(seed) parser = argparse.ArgumentParser() parser.add_argument("-s", "--samples", type=int, help="number of Hill and pIC50 samples for use...
""" MEDIA APP This module lists the default settings for the media app. Created on 23 Oct 2013 @author: michael """ EVENT_REPEAT_CHOICE_DOES_NOT_REPEAT = 0 EVENT_REPEAT_CHOICE_DAILY = 1 EVENT_REPEAT_CHOICE_WEEKDAYS = 2 EVENT_REPEAT_CHOICE_WEEKENDS = 3 EVENT_REPEAT_CHOICE_WEEKLY = 4 EVENT_REPEAT_CHOICE_MONTHLY_BY_DAY_OF...
from datetime import time from http.client import OK, FORBIDDEN from io import BytesIO import json from django.contrib.auth import get_user_model from django.test import TestCase, override_settings from rest_framework.authtoken.models import Token from rest_framework.test import APIClient from xlrd import open_workbook...
""" Process docstrings with Sphinx. AUTHORS: - Tim Joseph Dumol (2009-09-29): initial version - The Spyder Development Team: Maintenance Copyright (c) 2009 Tim Dumol <tim@timdumol.com> Copyright (c) 2013- The Spyder Development Team Distributed under the terms of the BSD 3-Clause License. Adapted from the Sage project ...
""" Overview ======== Yapsy's main purpose is to offer a way to easily design a plugin system in Python, and motivated by the fact that many other Python plugin system are either too complicated for a basic use or depend on a lot of libraries. Yapsy only depends on Python's standard library. |yapsy| basically defines t...
import os import urllib.request from abc import ABCMeta from luigi import Task, Parameter, WrapperTask, LocalTarget from collections import OrderedDict from lib.logger import get_logger from lib.timespan import get_timespan from tasks.base_tasks import RepoFileUnzipTask, TableTask, TempTableTask, MetaWrapper from tasks...
from sys import argv script, fileName = argv print ("Erasing %r" % fileName) print("ctl-c to cancel, or enter to continue") input(">") target = open(fileName, "w") print("cleaning / truncating file. Goodbye") target.truncate() target.write("line1") target.write("""line2 line3""") print("close.") target.close()
from django.conf.urls import url from corehq.apps.domain.utils import grandfathered_domain_re from .views import ( DefaultProjectUserSettingsView, DomainRequestView, EditWebUserView, ListWebUsersView, InviteWebUserView, change_password, domain_accounts, delete_phone_number, make_phone_number_default, verify...
""" A family of function objects for transforming one set of coordinates into another. Coordinate mapper functions are useful for defining magnifications and other kinds of transformations on sheet coordinates, e.g. for defining retinal magnification using a CFProjection. A CoordinateMapperFn (e.g. MagnifyingMapper), ...
""" Fetches information about YARN applications from the YARN HTTP API. Uses that base information to fetch additional details if the application is a Spark application or MapReduce application. Requires the following environment variables to configure itself. YARN_ENDPOINT HTTP host and port for one or more comma-...
import locale import os import re import tempfile import subprocess STREAM_STDOUT = 1 STREAM_STDERR = 2 STREAM_BOTH = STREAM_STDOUT + STREAM_STDERR XML_TAG_REGEX = re.compile('<[^>]+>') JSON_TAG_REGEX = re.compile('[{}\[\]]') def decode(bytes): """ Decode and return a byte string using utf8, falling back to sys...
from orangery.ops.geodetic import * import click @click.command() @click.argument('lat', nargs=1, type=click.FLOAT, metavar='LATITUDE') @click.argument('lon', nargs=1, type=click.FLOAT, metavar='LONGITUDE') @click.argument('h', nargs=1, type=click.FLOAT, metavar='HAE') def geodetic(lat, lon, h): print("INPUT VALUES...
import sys import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.viewcode', ] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'Vumi Go CLI' copyright = u'2016, Praekelt Foundation' version = '0.2' release = '0.2.0' exclude_patterns = ['_build'] ...
""" feather-format compat """ from typing import AnyStr from pandas._typing import ( FilePathOrBuffer, StorageOptions, ) from pandas.compat._optional import import_optional_dependency from pandas.util._decorators import doc from pandas import ( DataFrame, Int64Index, RangeIndex, ) from pandas.core i...
""" sentry.utils.csp ~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2015 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from sentry.utils.http import is_valid_origin DISALLOWED_SOURCES = ( 'chrome://*', 'chrome-extension://*', 'chrome...
from django.contrib import admin from .models import Musician, Album Admin.site.register(Musician,Album)
def extractReMonsterFandomCom(item): ''' DISABLED Parser for 're-monster.fandom.com' ''' return None
def drop_table(table_name): return "drop table {0}".format(table_name) def create_table(table_name, fields): return "create table {0} ({1})".format( table_name, ", ".join(fields)) def insert(table_name, fields): return "insert into {0} ({1}) values ({2})".format( table_name, ", ".join(fields...
import hashlib from datetime import datetime from werkzeug import generate_password_hash, check_password_hash, \ cached_property from flask.ext.sqlalchemy import BaseQuery from flask.ext.principal import RoleNeed, UserNeed, Permission from newsmeme.extensions import db from newsmeme.permissions import null from new...
from __future__ import absolute_import, unicode_literals import logging import json from dash.orgs.views import OrgPermsMixin from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.db import transaction from django.db.models...
from __future__ import unicode_literals import unittest from django.utils.lorem_ipsum import paragraphs, words class WebdesignTest(unittest.TestCase): def test_words(self): self.assertEqual(words(7), 'lorem ipsum dolor sit amet consectetur adipisicing') def test_paragraphs(self): self.assertEqua...
from distutils.core import setup from static_installer import get_version setup( name='django-static-installer', version=get_version(), description="A static file dependency downloader/manager", #long_description=open('README.rst').read(), author='Marco Louro', author_email='marco@lincolnloop.co...
from django.conf import settings from django.core.cache import cache from django.contrib.auth.models import User from cms.conf import global_settings PERMISSION_KEYS = [ 'can_change', 'can_add', 'can_delete', 'can_change_advanced_settings', 'can_publish', 'can_set_navigation', 'can_change_permissions', 'can...
import unittest from test.primaires.connex.static.commande import TestCommande from test.primaires.joueur.static.joueur import ManipulationJoueur from test.primaires.scripting.static.scripting import ManipulationScripting class TestLongueur(TestCommande, ManipulationJoueur, ManipulationScripting, unittest.TestC...
from __future__ import absolute_import from uuid import uuid4 from sentry.api.serializers import serialize from sentry.integrations.github.repository import GitHubRepositoryProvider from sentry.models import PullRequest, CommitAuthor, Release, Repository from sentry.plugins import bindings from sentry.testutils import ...