repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
tardyp/buildbot | worker/buildbot_worker/runprocess.py | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
immenz/pyload | module/plugins/hoster/SafesharingEu.py | # -*- coding: utf-8 -*-
from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo
class SafesharingEu(XFSHoster):
__name__ = "SafesharingEu"
__type__ = "hoster"
__version__ = "0.05"
__pattern__ = r'https?://(?:www\.)?safesharing\.eu/\w{12}'
__description__ = """Safesharing.e... |
amazinger2013/OpenSesame | plugins/external_script/external_script.py | """
This file is part of OpenSesame.
OpenSesame 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.
OpenSesame is distributed in the hope that ... |
iAmMrinal0/plexpy | plexpy/common.py | # This file is part of PlexPy.
#
# PlexPy 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.
#
# PlexPy is distributed in the hope t... |
mhbu50/erpnext | erpnext/buying/report/purchase_order_trends/purchase_order_trends.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from frappe import _
from erpnext.controllers.trends import get_columns, get_data
def execute(filters=None):
if not filters: filters ={}
data = []
conditions = get_columns(filters, "Pur... |
maniac103/weewx | bin/weewx/cheetahgenerator.py | #
# Copyright (c) 2009-2015 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""Generate files from templates using the Cheetah template engine.
For more information about Cheetah, see http://www.cheetahtemplate.org
Configuration Options
search_list = a, b, c #... |
ncloudioj/splice | migrations/versions/25c409de54cc_.py | """empty message
Revision ID: 25c409de54cc
Revises: 556e52d3d14b
Create Date: 2017-04-25 16:38:52.748971
"""
# revision identifiers, used by Alembic.
revision = '25c409de54cc'
down_revision = '556e52d3d14b'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(engine_na... |
sigma-random/FuzzManager | server/ec2spotmanager/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import django.core.files.storage
import ec2spotmanager.models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
... |
uclouvain/osis_louvain | base/migrations/0272_auto_20180524_0918.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-05-24 07:18
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('base', '0271_auto_20180518_1316'),
]
operations = [
migrations.AlterModelOptions(
... |
Aravinthu/odoo | odoo/tools/graph.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import operator
import math
class graph(object):
def __init__(self, nodes, transitions, no_ancester=None):
"""Initialize graph's object
@param nodes list of ids of nodes in th... |
Zaneh-/bearded-tribble-back | taiga/users/validators.py | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014 Anler Hernández <hello@anler.me>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
udayinfy/openerp-7.0 | base_intercompany/backend.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
# Eric Caudal <eric.caudal@elico-cor... |
Baumelbi/IntroPython2016 | students/spencer_mcghin/session2/series.py | def fibonacci(n):
"""Establish non 0 bases and then find value at n"""
if n == 1 or n == 2:
return 1
else:
return fibonacci(n-2)+fibonacci(n-1)
# Test to print 5th value of Fib sequence #
#print(fibonacci(5))
def lucas(n):
"""Establish non 0 bases and then find value at n"""
if n... |
robertwb/incubator-beam | sdks/python/apache_beam/io/source_test_utils_test.py | #
# 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"); you may not us... |
sonntagsgesicht/regtest | .aux/venv/lib/python3.9/site-packages/pip/_internal/commands/freeze.py | import sys
from optparse import Values
from typing import List
from pip._internal.cli import cmdoptions
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import SUCCESS
from pip._internal.operations.freeze import freeze
from pip._internal.utils.compat import stdlib_pkgs
DEV_PKGS =... |
subramani95/neutron | neutron/plugins/mlnx/db/mlnx_db_v2.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Mellanox Technologies, Ltd
#
# 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
#
#... |
goldmedal/spark | python/pyspark/taskcontext.py | #
# 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"); you may not us... |
rdo-management/heat | heat/tests/test_nova_keypair.py | #
# 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 in writing, software
# ... |
geoadmin/mapproxy | doc/conf.py | # -*- coding: utf-8 -*-
#
# MapProxy documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 25 15:36:04 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
amanharitsh123/zulip | zerver/migrations/0076_userprofile_emojiset.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-04-23 19:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0075_attachment_path_id_unique'),
]
operations = [
migrations.AddField(
model_name='userprofi... |
alisonbnt/home-shell | src/dao/groupdao.py | __author__ = 'alisonbento'
import basedao
import src.entities.hsgroup as hsgroup
class GroupDAO(basedao.BaseDAO):
def __init__(self, connection):
basedao.BaseDAO.__init__(self, connection, 'hs_groups', 'group_id')
def convert_row_to_object(self, entity_row):
group = hsgroup.HomeShellGroup()... |
DreamLab/contrail-controller | src/opserver/test/analytics_statstest.py | #!/usr/bin/env python
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
#
# analytics_stattest.py
#
# System tests for analytics
#
import sys
builddir = sys.path[0] + '/../..'
import threading
threading._DummyThread._Thread__stop = lambda x: 42
import signal
import gevent
from gevent import monkey... |
satish-avninetworks/murano | doc/source/conf.py | # Copyright (C) 2014 Mirantis Inc
#
# 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 o... |
ThiagoGarciaAlves/intellij-community | python/helpers/pydev/_pydevd_bundle/pydevd_additional_thread_info_regular.py | import sys
from _pydevd_bundle.pydevd_constants import STATE_RUN, PYTHON_SUSPEND, IS_JYTHON, IS_IRONPYTHON
from _pydev_bundle import pydev_log
# IFDEF CYTHON
# pydev_log.debug("Using Cython speedups")
# ELSE
from _pydevd_bundle.pydevd_frame import PyDBFrame
# ENDIF
version = 10
if not hasattr(sys, '_current_frames'):... |
luci/luci-py | client/utils/fs.py | # Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Wraps os, os.path and shutil functions to work around MAX_PATH on Windows."""
import builtins
import inspect
import os
import re
import shutil... |
pattisdr/osf.io | api_tests/base/test_middleware.py | # -*- coding: utf-8 -*-
from django.http import HttpResponse
from urlparse import urlparse
import mock
from nose.tools import * # noqa:
from rest_framework.test import APIRequestFactory
from django.test.utils import override_settings
from website.util import api_v2_url
from api.base import settings
from api.base.mid... |
brianrodri/oppia | core/jobs/transforms/validation/question_validation.py | # coding: utf-8
#
# Copyright 2021 The Oppia Authors. 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
#
# Unless requi... |
diogo149/treeano | treeano/sandbox/nodes/monitor_update_ratio.py | import theano
import theano.tensor as T
import treeano
@treeano.register_node("monitor_update_ratio")
class MonitorUpdateRatioNode(treeano.Wrapper1NodeImpl):
"""
monitor's the ratio between the a statistic (eg. norm, max, min) between an
update of a parameter and the parameter itself
monitor's param... |
gojira/tensorflow | tensorflow/contrib/distribute/python/tpu_strategy.py | # Copyright 2018 The TensorFlow Authors. 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
#
# Unless required by applica... |
leppa/home-assistant | homeassistant/components/ifttt/__init__.py | """Support to trigger Maker IFTTT recipes."""
import json
import logging
import pyfttt
import requests
import voluptuous as vol
from homeassistant.const import CONF_WEBHOOK_ID
from homeassistant.helpers import config_entry_flow
import homeassistant.helpers.config_validation as cv
from .const import DOMAIN
_LOGGER =... |
devananda/ironic | ironic/tests/unit/common/test_fsm.py | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! Inc. 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... |
sharifelgamal/runtimes-common | ftl/php/layer_builder.py | # Copyright 2017 Google Inc. 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
#
# Unless required by applicable law or ag... |
pybuilder/pybuilder | src/unittest/python/plugins/python/distutils_plugin_tests.py | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2020 PyBuilder Team
#
# 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/l... |
twitter/twemproxy | tests/test_redis/test_protocol.py | #!/usr/bin/env python3
from .common import *
from pprint import pprint
def get_conn():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((nc.host(), nc.port()))
s.settimeout(.3)
return s
def _test(req, resp, sleep=0):
s = get_conn()
# Send a single byte at a time
for i in re... |
jerryjobs/thirdpartPushSystem | push/getui/google/protobuf/internal/descriptor_test.py | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met... |
jaeilepp/eggie | mne/connectivity/spectral.py | # Authors: Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
from ..externals.six import string_types
from warnings import warn
from inspect import getargspec, getmembers
import numpy as np
from scipy.fftpack import fftfreq
from .utils import check_indices
from ..fixes import tril_indices, part... |
qPCR4vir/orange3 | Orange/widgets/data/owdiscretize.py | from collections import namedtuple
from PyQt4 import QtGui
from PyQt4.QtGui import (
QListView, QHBoxLayout, QStyledItemDelegate, QDialogButtonBox
)
from PyQt4.QtCore import Qt
import Orange.data
import Orange.preprocess.discretize as disc
from Orange.widgets import widget, gui, settings
from Orange.widgets.util... |
drj11/pdftables | test/test_contains_tables.py | #!/usr/bin/env python
# ScraperWiki Limited
# Ian Hopkinson, 2013-06-17
# -*- coding: utf-8 -*-
"""
ContainsTables tests
"""
import sys
import pdftables
from fixtures import fixture
from nose.tools import assert_equals
def contains_tables(pdf):
"""
contains_tables takes a pdf document and returns a boole... |
wujuguang/scrapyd | scrapyd/launcher.py | import sys
from datetime import datetime
from multiprocessing import cpu_count
from twisted.internet import reactor, defer, protocol, error
from twisted.application.service import Service
from twisted.python import log
from scrapyd.utils import get_crawl_args, native_stringify_dict
from scrapyd import __version__
fro... |
esc/Bento | bento/private/_yaku/examples/file_hook.py | import yaku.task_manager
from yaku.task_manager import get_extension_hook, set_file_hook
from yaku.context import get_cfg, get_bld
from yaku.scheduler import run_tasks
def file_hook(self, node):
print("Yo mama", node.name)
return get_extension_hook(".c")(self, node)
def configure(ctx):
ctx.use_tools(["ct... |
douban/code | vilya/models/activity.py | # -*- coding: utf-8 -*-
from vilya.config import DOMAIN as CODE_URL
class Activity(object):
def __init__(self, data):
self.data = data
def to_line(self):
return format_activity(self.data)
def format_activity(data):
type = data.get('type')
if type in ('team_created', 'team_joined')... |
albertoferna/compmech | theory/plates/plate_clpt_donnell_bc4/print_linear_sparse.py | import os
import glob
import numpy as np
import sympy
from sympy import pi, sin, cos, var
from compmech.conecyl.sympytools import mprint_as_sparse
var('i1, j1, k1, l1', integer=True)
var('x, y, xa, xb, ya, yb, a, b')
var('A11, A12, A16, A22, A26, A66, A44, A45, A55')
var('B11, B12, B16, B22, B26, B66')
var('D11, D12... |
nebstrebor/django-authority | docs/conf.py | # -*- coding: utf-8 -*-
#
# django-authority documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 9 10:52:07 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file... |
mvaled/sentry | tests/sentry/plugins/useragents/tests.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from sentry.testutils import TestCase
from sentry.plugins.sentry_useragents.models import BrowserPlugin, DevicePlugin, OsPlugin
from ua_parser.user_agent_parser import Parse
class UserAgentPlugins(TestCase):
data = [
{
"user_agen... |
darkryder/django | django/db/backends/mysql/features.py | from django.db.backends.base.features import BaseDatabaseFeatures
from django.utils.functional import cached_property
from .base import Database
try:
import pytz
except ImportError:
pytz = None
class DatabaseFeatures(BaseDatabaseFeatures):
empty_fetchmany_value = ()
update_can_self_select = False
... |
sunze/py_flask | venv/lib/python3.4/site-packages/kombu/utils/eventio.py | """
kombu.utils.eventio
===================
Evented IO support for multiple platforms.
"""
from __future__ import absolute_import
import errno
import select as __select__
import socket
from numbers import Integral
_selectf = __select__.select
_selecterr = __select__.error
epoll = getattr(__select__, 'epoll', None)... |
fperez/talk-strata-sc2014 | ipythonproject.py | from IPython.display import HTML, display
devs = [
('Fernando Perez', 'fperez.jpg'),
('Brian Granger', 'ellisonbg.jpg'),
('Min Ragan-Kelley', 'minrk.jpg'),
('Thomas Kluyver', 'takluyver.jpg'),
('Matthias Bussonnier', 'matthias.jpg'),
('Jonathan Frederic', 'jdfreder.jpg'),
('Paul Ivanov', 'i... |
CraigDawson/yapygrep | gui/yapgrep_common_gui.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'common.ui'
#
# Created by: PyQt5 UI code generator 5.7
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Common(object):
def setupUi(self, Common):
Common.setObjectName... |
noirbizarre/mongoengine | tests/test_signals.py | # -*- coding: utf-8 -*-
import sys
sys.path[0:0] = [""]
import unittest
from mongoengine import *
from mongoengine import signals
signal_output = []
class SignalTests(unittest.TestCase):
"""
Testing signals before/after saving and deleting.
"""
def get_signal_output(self, fn, *args, **kwargs):
... |
xifle/home-assistant | homeassistant/components/device_tracker/swisscom.py | """
Support for Swisscom routers (Internet-Box).
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.swisscom/
"""
import logging
import threading
from datetime import timedelta
import requests
import voluptuous as vol
import homeassistant.he... |
Chasego/cod | leetcode/155-Min-Stack/MinStack_001.py | class MinStack:
# @param x, an integer
def __init__(self):
self.stack = []
self.min_stack = []
# @return an integer
def push(self, x):
self.stack.append(x)
if len(self.min_stack) == 0 or self.min_stack[-1] >= x:
self.min_stack.append(x)
... |
CompPhysics/MachineLearning | doc/src/How2ReadData/src/ecoli_inverse.py | import numpy as np
data = np.loadtxt('ecoli.csv', delimiter=',')
t_experiment = data[:,0]
N_experiment = data[:,1]
def error(p):
r = p[0]
T = 1200 # cell can divide after T sec
t_max = 5*T # 5 generations in experiment
t = np.linspace(0, t_max, len(t_experiment))
dt = (t[1] - t[0])
N = np... |
m-kuhn/QGIS | python/plugins/processing/algs/gdal/GdalAlgorithmProvider.py | # -*- coding: utf-8 -*-
"""
***************************************************************************
GdalAlgorithmProvider.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************... |
atmark-techno/atmark-dist | user/python/Lib/distutils/command/sdist.py | """distutils.command.sdist
Implements the Distutils 'sdist' command (create a source distribution)."""
# created 1999/09/22, Greg Ward
__revision__ = "$Id: sdist.py,v 1.51 2000/10/14 04:06:40 gward Exp $"
import sys, os, string
from types import *
from glob import glob
from distutils.core import Command
from distut... |
CaptFrank/firewalld | src/firewall/core/prog.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2012 Red Hat, Inc.
#
# Authors:
# Thomas Woerner <twoerner@redhat.com>
#
# 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 2 of the Li... |
SDX2000/hotwire | hotwire_ui/adaptors/view.py | # This file is part of the Hotwire Shell project API.
# Copyright (C) 2007 Colin Walters <walters@verbum.org>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includin... |
ChinaMassClouds/copenstack-server | openstack/src/ceilometer-2014.2.2/ceilometer/api/hooks.py | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
# Angus Salkeld <asalkeld@redhat.com>
#
# 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 th... |
dwiel/rope | rope/refactor/patchedast.py | import collections
import re
import warnings
from rope.base import ast, codeanalyze, exceptions
try:
basestring
except NameError:
basestring = (str, bytes)
def get_patched_ast(source, sorted_children=False):
"""Adds ``region`` and ``sorted_children`` fields to nodes
Adds ``sorted_children`` field on... |
hogarthj/ansible | lib/ansible/plugins/inventory/constructed.py | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: constructed
plugin_type: inventory
version_added: "2.4"
sh... |
dpendl00/headphones | lib/musicbrainzngs/musicbrainz.py | # This file is part of the musicbrainzngs library
# Copyright (C) Alastair Porter, Adrian Sampson, and others
# This file is distributed under a BSD-2-Clause type license.
# See the COPYING file for more information.
import re
import threading
import time
import logging
import socket
import hashlib
import locale
impor... |
soumyasanyal/PyUserInput | tests/basic.py | #Copyright 2013 Paul Barton
#
#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.
#
#This program is distributed in the hope tha... |
dnanexus/rseqc | rseqc/lib/bx/wiggle.py | """
Support for scores in the `wiggle`_ file format used by the UCSC Genome
Browser.
The positions in the wiggle format are 1-relative, however,
the positions returned match the BED/interval format which is zero-based, half-open.
.. _wiggle: http://genome.ucsc.edu/goldenPath/help/wiggle.html
"""
def parse_header( l... |
systers/mailman | copybump.py | #! /usr/bin/env python3
import os
import re
import sys
import stat
import datetime
FSF = 'by the Free Software Foundation, Inc.'
this_year = datetime.date.today().year
pyre_c = re.compile(r'# Copyright \(C\) ((?P<start>\d{4})-)?(?P<end>\d{4})')
pyre_n = re.compile(r'# Copyright ((?P<start>\d{4})-)?(?P<end>\d{4})')
n... |
rjferrier/fluidity | examples/tides_in_the_Mediterranean_Sea/reproject-to-loglat.py | #!/usr/bin/env python
import vtktools
import math
from scipy import sqrt
import vtk
import sys
ugrid = u=vtktools.vtu("med_10.pvtu")
# e.g. x="math.sin(x)"
x="math.atan2(y,x)*57.2957795"
y="math.asin(z/math.sqrt(x*x+y*y+z*z))*57.2957795"
z="math.sqrt(x*x+y*y+z*z)-6.37101e+06"
ugrid.ApplyProjection(x, y, z)
ugrid.Wri... |
maui-packages/qt-creator | tests/system/suite_debugger/tst_build_new_project/test.py | #############################################################################
##
## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this f... |
rg3/youtube-dl | youtube_dl/extractor/mtv.py | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_xpath,
)
from ..utils import (
ExtractorError,
find_xpath_attr,
fix_xml_ampersands,
float_or_none,
HEADRequest,
RegexNotFoundError,
sanitize... |
spektom/incubator-airflow | tests/providers/ftp/hooks/test_ftp.py | #
# 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"); you may not... |
SeleniumHQ/selenium | py/test/selenium/webdriver/common/window_switching_tests.py | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
hehongliang/tensorflow | tensorflow/lite/python/lite.py | # Copyright 2017 The TensorFlow Authors. 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
#
# Unless required by applica... |
spektom/incubator-airflow | tests/providers/google/cloud/operators/test_pubsub.py | #
# 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"); you may not... |
afaheem88/tempest_neutron | tempest/api/volume/test_qos.py | # 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
#
# Unless required by applicable law or agreed to in... |
pattisdr/osf.io | osf/exceptions.py | import contextlib
from django.core.exceptions import ValidationError as DjangoValidationError
# Remants from MODM days
# TODO: Remove usages of aliased Exceptions
ValidationError = DjangoValidationError
ValidationValueError = DjangoValidationError
ValidationTypeError = DjangoValidationError
class TokenError(Excepti... |
spandanb/horizon | openstack_dashboard/dashboards/admin/hypervisors/views.py | # Copyright 2013 B1 Systems GmbH
#
# 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 ag... |
isandlaTech/cohorte-demos | led/dump/led-demo-yun/cohorte/dist/cohorte-1.0.0-20141216.234517-57-python-distribution/repo/pelix/remote/transport/mqtt_rpc.py | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Pelix remote services: MQTT pseudo RPC
An remote service protocol based on MQTT.
This implementation tries to mimic the MQTT-RPC Javascript project:
https://github.com/wolfeidau/mqtt-rpc
This module depends on the paho-mqtt package (ex-mosquitto), provided by ... |
wechat-python-sdk/wechat-python-sdk | wechat_sdk/lib/parser.py | # -*- coding: utf-8 -*-
from xml.dom import minidom, Node
class XMLStore(object):
"""
XML 存储类,可方便转换为 Dict
"""
def __init__(self, xmlstring):
self._raw = xmlstring
self._doc = minidom.parseString(xmlstring)
@property
def xml2dict(self):
"""
将 XML 转换为 dict
... |
samuelgarcia/python-neo | neo/test/coretest/test_container.py | """
Tests of the neo.core.container.Container class
"""
import unittest
import numpy as np
try:
from IPython.lib.pretty import pretty
except ImportError as err:
HAVE_IPYTHON = False
else:
HAVE_IPYTHON = True
from neo.core.container import Container, unique_objs
class Test_unique_objs(unittest.TestCase... |
teonlamont/mne-python | mne/realtime/mockclient.py | # Authors: Mainak Jas <mainak@neuro.hut.fi>
# Denis Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import copy
import numpy as np
from ..event import find_events
class MockRtClient(object):
"""Mock Realtime Client.
... |
grace-/opencv-3.0.0-cvpr | opencv/modules/java/generator/rst_parser.py | #!/usr/bin/env python
import os, sys, re, string, fnmatch
allmodules = ["core", "flann", "imgproc", "ml", "highgui", "video", "features2d", "calib3d", "objdetect", "legacy", "contrib", "gpu", "androidcamera", "java", "python", "stitching", "ts", "photo", "nonfree", "videostab", "ocl", "superres"]
verbose = False
show_... |
aferr/LatticeMemCtl | src/mem/DRAMSim2Wrapper.py | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... |
kikocorreoso/brython | www/src/Lib/locale.py | """Locale support module.
The module provides low-level access to the C lib's locale APIs and adds high
level number formatting APIs as well as a locale aliasing engine to complement
these.
The aliasing engine includes support for many commonly used locale names and
maps them to values suitable for passing to the C l... |
neopoly/rubyfox-server | lib/rubyfox/server/data/lib/Lib/test/zxjdbc/sptest.py |
# Jython Database Specification API 2.0
#
# $Id: sptest.py 2101 2002-05-10 16:11:41Z bzimmer $
#
# Copyright (c) 2001 brian zimmer <bzimmer@ziclix.com>
from zxtest import zxCoreTestCase
class OracleSPTest(zxCoreTestCase):
def setUp(self):
zxCoreTestCase.setUp(self)
c = self.cursor()
try:
try:
c.exec... |
klatoza/Oncoscape | analysisPackages/PLSR/inst/ws/testWrapper.py | import sys
from websocket import create_connection
from json import *
ws = create_connection("ws://localhost:9003")
#------------------------------------------------------------------------------------------------------------------------
def runTests():
testEcho()
testCreateWithDataSet()
testSummarizePLSRPatient... |
synologix/enigma2 | RecordTimer.py | from boxbranding import getMachineBrand, getMachineName
import xml.etree.cElementTree
from datetime import datetime
from time import localtime, strftime, ctime, time
from bisect import insort
from sys import maxint
import os
from enigma import eEPGCache, getBestPlayableServiceReference, eServiceReference, eServiceCent... |
MikeLing/shogun | examples/undocumented/python/distance_canberra.py | #!/usr/bin/env python
traindat = '../data/fm_train_real.dat'
testdat = '../data/fm_test_real.dat'
parameter_list = [[traindat,testdat],[traindat,testdat]]
def distance_canberra (train_fname=traindat,test_fname=testdat):
from shogun import RealFeatures, CanberraMetric, CSVFile
feats_train=RealFeatures(CSVFile(train... |
direvus/ansible | lib/ansible/modules/storage/netapp/na_ontap_aggregate.py | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
npmccallum/sssd | src/tests/intg/test_netgroup.py | #
# Netgroup integration test
#
# Copyright (c) 2016 Red Hat, Inc.
# Author: Petr Cech <pcech@redhat.com>
#
# 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
# ... |
tcwicklund/wut4lunch_demos | pyramid_wut4lunch/pyramid_wut4lunch/models.py | from sqlalchemy import (
Column,
Integer,
Text,
)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import (
scoped_session,
sessionmaker,
)
from zope.sqlalchemy import ZopeTransactionExtension
DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExt... |
yglazko/socorro | socorro/external/fs/crashstorage.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
import json
import os
import gzip
import shutil
import stat
from contextlib import contextmanager, clos... |
freyes/juju | acceptancetests/repository/trusty/haproxy/hooks/tests/test_config_changed_hooks.py | import sys
import base64
import os
from testtools import TestCase
from mock import patch, call
import hooks
from utils_for_tests import patch_open
class ConfigChangedTest(TestCase):
def setUp(self):
super(ConfigChangedTest, self).setUp()
self.config_get = self.patch_hook("config_get")
s... |
gangadhar-kadam/mtn-erpnext | website/page/unsubscribe/unsubscribe.py | # ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# 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 yo... |
adfernandes/pcp | qa/statsd/src/cases/13.py | #!/usr/bin/env pmpython
# -*- coding: utf-8 -*-
# Exercises debug_output_filename option
import sys
import socket
import glob
import os
import time
utils_path = os.path.abspath(os.path.join("utils"))
sys.path.append(utils_path)
import pmdastatsd_test_utils as utils
utils.print_test_file_separator()
print(os.path.b... |
krafczyk/spack | var/spack/repos/builtin/packages/mkfontdir/package.py | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
jainavi/qds-sdk-py | qds_sdk/qubole.py | import requests
from qds_sdk.connection import Connection
from qds_sdk.exception import ConfigError
class QuboleAuth(requests.auth.AuthBase):
def __init__(self, token):
self.api_token = token
def __call__(self, r):
r.headers['X-AUTH-TOKEN'] = self.api_token
return r
class Qubole:
... |
aselle/tensorflow | tensorflow/python/estimator/canned/head.py | # Copyright 2017 The TensorFlow Authors. 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
#
# Unless required by applica... |
w1ll1am23/home-assistant | tests/components/mikrotik/test_config_flow.py | """Test Mikrotik setup process."""
from datetime import timedelta
from unittest.mock import patch
import librouteros
import pytest
from homeassistant import data_entry_flow
from homeassistant.components import mikrotik
from homeassistant.const import (
CONF_HOST,
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,
... |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/notebook/jstest.py | # -*- coding: utf-8 -*-
"""Notebook Javascript Test Controller
This module runs one or more subprocesses which will actually run the Javascript
test suite.
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import, print_function
... |
mick-d/nipype_source | nipype/interfaces/freesurfer/tests/test_auto_MRITessellate.py | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.freesurfer.utils import MRITessellate
def test_MRITessellate_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=d... |
paulondc/gaffer | python/GafferUITest/EventLoopTest.py | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provi... |
caktus/rapidsms | rapidsms/contrib/messaging/tests/views.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import mock
from django.core.urlresolvers import reverse
from rapidsms.tests.harness import RapidTest
__all__ = ['TestMessagingView', 'TestSendView']
class TestMessagingView(RapidTest):
url_name = 'messaging'
def setUp(self):
self.url = reverse(... |
bluebore/galaxy | platform/src/lumia/sdk.py | # -*- coding:utf-8 -*-
# Copyright (c) 2015, Galaxy Authors. All Rights Reserved
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Author: wangtaize@baidu.com
# Date: 2015-04-06
import datetime
import logging
from sofa.pbrpc import client
from lumia import lumia_p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.