repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
be-cloud-be/horizon-addons | server/openerp/addons/base/tests/test_search.py | 40 | 9844 | import unittest
import openerp.tests.common as common
class test_search(common.TransactionCase):
def test_00_search_order(self):
registry, cr, uid = self.registry, self.cr, self.uid
# Create 6 partners with a given name, and a given creation order to
# ensure the order of their ID. Som... | agpl-3.0 |
daikeren/opbeat_python | opbeat/contrib/zerorpc/__init__.py | 6 | 2505 | """
opbeat.contrib.zerorpc
~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import inspect
from opbeat.base import Client
class OpbeatMiddleware(object):
"""Opbeat/opbeat middleware for ZeroRPC.
>>> opbeat = Opbea... | bsd-3-clause |
zhuwenping/python-for-android | python-modules/twisted/twisted/names/srvconnect.py | 52 | 6386 | # -*- test-case-name: twisted.names.test.test_srvconnect -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
import random
from zope.interface import implements
from twisted.internet import error, interfaces
from twisted.names import client, dns
from twisted.names.error import DNSN... | apache-2.0 |
iafan/zing | pootle/urls.py | 1 | 1401 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from django.conf.urls import include, url
fr... | gpl-3.0 |
rrati/origin | cmd/cluster-capacity/go/src/github.com/kubernetes-incubator/cluster-capacity/vendor/github.com/prometheus/client_model/python/prometheus/client/model/metrics_pb2.py | 250 | 20064 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: metrics.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _m... | apache-2.0 |
lubosz/cerbero | cerbero/bootstrap/linux.py | 1 | 6996 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | lgpl-2.1 |
moksha11/xen-hv | tools/python/xen/xm/setenforce.py | 43 | 2560 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
zakuro9715/lettuce | tests/integration/lib/Django-1.3/django/contrib/markup/tests.py | 245 | 3155 | # Quick tests for the markup templatetags (django.contrib.markup)
import re
from django.template import Template, Context, add_to_builtins
from django.utils import unittest
from django.utils.html import escape
add_to_builtins('django.contrib.markup.templatetags.markup')
try:
import textile
except ImportError:
... | gpl-3.0 |
wger-project/wger | wger/nutrition/tests/test_ingredient_overview.py | 2 | 4632 | # This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# wger W... | agpl-3.0 |
ingadhoc/odoo | addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py | 337 | 3434 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
qPCR4vir/orange | Orange/OrangeCanvas/canvas/tests/test_layout.py | 13 | 2566 | import time
from PyQt4.QtGui import QGraphicsView, QPainter, QPainterPath
from ...gui.test import QAppTestCase
from ..layout import AnchorLayout
from ..scene import CanvasScene
from ..items import NodeItem, LinkItem
class TestAnchorLayout(QAppTestCase):
def setUp(self):
QAppTestCase.setUp(self)
... | gpl-3.0 |
MCGallaspy/selenium | py/selenium/webdriver/remote/errorhandler.py | 50 | 8394 | # 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... | apache-2.0 |
fernandog/Medusa | ext/github/tests/GitBlob.py | 1 | 3470 | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
batxes/4Cin | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/SHH_WT_models17286.py | 2 | 17576 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
CoDEmanX/ArangoDB | 3rdParty/V8-4.3.61/third_party/python_26/Lib/distutils/command/bdist_rpm.py | 53 | 20189 | """distutils.command.bdist_rpm
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: bdist_rpm.py 61000 2008-02-23 17:40:11Z christian.heimes $"
import sys, os, string
from types import *
from distu... | apache-2.0 |
tqchen/tvm | tests/python/unittest/test_tir_constructor.py | 3 | 5446 | # 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 u... | apache-2.0 |
Alwnikrotikz/stoqs | stoqs/views/management.py | 4 | 11845 | #!/usr/bin/env python
__author__ = "Mike McCann"
__copyright__ = "Copyright 2012, MBARI"
__credits__ = ["Chander Ganesan, Open Technology Group"]
__license__ = "GPL"
__version__ = "$Revision: 12294 $".split()[1]
__maintainer__ = "Mike McCann"
__email__ = "mccann at mbari.org"
__status__ = "Development"
__doc__ = '''
... | gpl-3.0 |
GuessWhoSamFoo/pandas | pandas/io/json/normalize.py | 2 | 9406 | # ---------------------------------------------------------------------
# JSON normalization routines
from collections import defaultdict
import copy
import numpy as np
from pandas._libs.writers import convert_json_to_lines
from pandas import DataFrame, compat
def _convert_to_line_delimits(s):
"""
Helper ... | bsd-3-clause |
KrzysztofStachanczyk/Sensors-WWW-website | www/env/lib/python2.7/site-packages/django/contrib/auth/password_validation.py | 57 | 7538 | from __future__ import unicode_literals
import gzip
import os
import re
from difflib import SequenceMatcher
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.utils import lru_cache
from django.utils._os import upath
from django.utils.encoding import ... | gpl-3.0 |
zhaochao/fuel-web | fuelmenu/fuelmenu/fuelmenu.py | 1 | 17875 | #!/usr/bin/env python
# Copyright 2013 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 or a... | apache-2.0 |
adrienbrault/home-assistant | homeassistant/components/twentemilieu/config_flow.py | 3 | 2726 | """Config flow to configure the Twente Milieu integration."""
from __future__ import annotations
from typing import Any
from twentemilieu import (
TwenteMilieu,
TwenteMilieuAddressError,
TwenteMilieuConnectionError,
)
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.co... | mit |
bsanders/kazoo | kazoo/tests/util.py | 18 | 3657 | ##############################################################################
#
# Copyright Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS ... | apache-2.0 |
xiaoyang2022/V2EX | html5lib/tests/test_parser.py | 66 | 5037 | import os
import sys
import traceback
import StringIO
import warnings
import re
warnings.simplefilter("error")
from support import html5lib_test_files as data_files
from support import TestData, convert, convertExpected
import html5lib
from html5lib import html5parser, treebuilders, constants
treeTypes = {"simpletre... | bsd-3-clause |
Egregors/rsted | pwl/fastcgi.py | 10 | 6958 | # -*- coding: utf-8 -*-
"""
FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol.
Uses the flup python package: http://www.saddi.com/software/flup/
This is a adaptation of the flup package to add FastCGI server support
to run Django apps from pwl servers that support the FastCGI protocol.
This m... | mit |
ShassAro/ShassAro | Bl_project/blVirtualEnv/lib/python2.7/site-packages/django/contrib/formtools/preview.py | 103 | 5753 | """
Formtools Preview application.
"""
from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.utils.crypto import constant_time_compare
from django.contrib.formtools.utils import form_hmac
AUTO_ID = 'formtools_%s' # Each form her... | gpl-2.0 |
resba/gnuradio | gr-digital/examples/narrowband/uhd_interface.py | 21 | 8910 | #!/usr/bin/env python
#
# Copyright 2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your opt... | gpl-3.0 |
miguelparaiso/OdooAccessible | addons/google_account/__init__.py | 238 | 1076 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
jjmiranda/edx-platform | common/djangoapps/student/management/commands/manage_user.py | 6 | 6046 | """
Management command `manage_user` is used to idempotently create or remove
Django users, set/unset permission bits, and associate groups by name.
"""
from django.contrib.auth import get_user_model
from django.contrib.auth.hashers import is_password_usable
from django.contrib.auth.models import Group, BaseUserManage... | agpl-3.0 |
dyv/kafka-python | kafka/context.py | 38 | 5916 | """
Context manager to commit/rollback consumer offsets.
"""
from logging import getLogger
from kafka.common import check_error, OffsetCommitRequest, OffsetOutOfRangeError
class OffsetCommitContext(object):
"""
Provides commit/rollback semantics around a `SimpleConsumer`.
Usage assumes that `auto_commit... | apache-2.0 |
hynekcer/django | tests/template_tests/syntax_tests/test_load.py | 475 | 3378 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class LoadTagTests(SimpleTestCase):
libraries = {
'subpackage.echo': 'template_tests.templatetags.subpackage.echo',
'testtags': 'template_tests.templatetags.testtags',
}
@setu... | bsd-3-clause |
ppwwyyxx/tensorflow | tensorflow/python/feature_column/feature_column_test.py | 6 | 273052 | # 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... | apache-2.0 |
a5kin/hecate | setup.py | 1 | 2015 | """
A setuptools based setup module.
Adopted from:
https://github.com/pypa/sampleproject
"""
import codecs
from os import path
from setuptools import setup, find_packages
def get_long_description():
"""Load description from README file."""
here = path.abspath(path.dirname(__file__))
with codecs.open(p... | mit |
Eureka22/ASM_xf | PythonD/lib/python2.4/test/test_descrtut.py | 15 | 12016 | # This contains most of the executable examples from Guido's descr
# tutorial, once at
#
# http://www.python.org/2.2/descrintro.html
#
# A few examples left implicit in the writeup were fleshed out, a few were
# skipped due to lack of interest (e.g., faking super() by hand isn't
# of much interest anymore), and a f... | gpl-2.0 |
Frojd/Frojd-Fabric | fabrik/ext/postgres.py | 2 | 5919 | # -*- coding: utf-8 -*-
"""
fabrik.ext.postgres
-------------------
A PostgreSQL extension that handles backups and remote/local syncing
Params:
psql_user
psql_db
psql_password
local_psql_user
local_psql_db
local_psql_password
Commands:
backup_db
restore_db
sync_local_to_remote
... | mit |
r0e/servo | tests/wpt/css-tests/css-fonts-3_dev/html/support/fonts/makegsubfonts.py | 820 | 14309 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
normtown/SickRage | lib/sqlalchemy/orm/relationships.py | 75 | 110617 | # orm/relationships.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Heuristics related to join conditions as used in
:func:`.relationship`.
Provi... | gpl-3.0 |
sorenk/ansible | lib/ansible/module_utils/facts/network/linux.py | 62 | 16259 | # This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
Medigate/cutiuta-server | cutiuta-server/env/lib/python3.4/site-packages/django/db/__init__.py | 376 | 2322 | from django.core import signals
from django.db.utils import (
DEFAULT_DB_ALIAS, DJANGO_VERSION_PICKLE_KEY, ConnectionHandler,
ConnectionRouter, DatabaseError, DataError, Error, IntegrityError,
InterfaceError, InternalError, NotSupportedError, OperationalError,
ProgrammingError,
)
__all__ = [
'backe... | gpl-3.0 |
fireduck64/electrum | gui/qt/utxo_list.py | 1 | 3140 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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,
# including without... | mit |
Asd396/-tg-station | bot/Timeconverter.py | 67 | 7310 | #Sources:
# http://wwp.greenwichmeantime.com/time-zone/usa/eastern-time/convert/
# http://www.timeanddate.com/library/abbreviations/timezones/na/
# Times are GMT +- x
# For eq.
# EST = -5
# GMT = 0
# UTC = 0
#Times are in hours,
#2.5 = 2 and half hours
global times
times = {"ADT":-3,"HAA":-3, #Synonyms on the same line... | agpl-3.0 |
openhatch/oh-mainline | vendor/packages/gdata/src/gdata/contacts/__init__.py | 119 | 28208 | #!/usr/bin/env python
#
# Copyright 2009 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 requir... | agpl-3.0 |
gluster/distaf | distaf/client_rpyc.py | 2 | 19426 | # This file is part of DiSTAF
# Copyright (C) 2015-2016 Red Hat, Inc. <http://www.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 License, or
# any l... | gpl-2.0 |
Davidjohnwilson/sympy | sympy/physics/mechanics/tests/test_kane.py | 48 | 11115 | import warnings
from sympy import (cos, expand, Matrix, sin, symbols, tan, sqrt, S,
simplify, zeros)
from sympy.utilities.exceptions import SymPyDeprecationWarning
from sympy.physics.mechanics import (dynamicsymbols, ReferenceFrame, Point,
RigidBody, KanesMethod,... | bsd-3-clause |
FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/sqlite3/test/dump.py | 119 | 2840 | # Author: Paul Kippes <kippesp@gmail.com>
import unittest
import sqlite3 as sqlite
class DumpTests(unittest.TestCase):
def setUp(self):
self.cx = sqlite.connect(":memory:")
self.cu = self.cx.cursor()
def tearDown(self):
self.cx.close()
def CheckTableDump(self):
expected_s... | gpl-2.0 |
ppanczyk/ansible | lib/ansible/modules/cloud/centurylink/clc_modify_server.py | 48 | 34855 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
# 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': ['previe... | gpl-3.0 |
Samweli/inasafe | safe/common/signals.py | 2 | 4396 | """
InaSAFE Disaster risk assessment tool by AusAid - **Standard signal defs.**
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 vers... | gpl-3.0 |
TheNameIsNigel/android_kernel_carbon_msm8928 | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
javierag/openchange | python/openchange/tests/test_provision.py | 6 | 1855 | #!/usr/bin/python
# OpenChange provisioning
# Copyright (C) Jelmer Vernooij <jelmer@openchange.org> 2009
#
# 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
# ... | gpl-3.0 |
spinellic/Mission-Planner | Lib/site-packages/scipy/integrate/tests/test_quadrature.py | 57 | 3469 | import numpy
from numpy import cos, sin, pi
from numpy.testing import TestCase, run_module_suite, assert_equal, \
assert_almost_equal, assert_allclose
from scipy.integrate import quadrature, romberg, romb, newton_cotes
class TestQuadrature(TestCase):
def quad(self, x, a, b, args):
raise NotImplemented... | gpl-3.0 |
jmmease/pandas | pandas/tests/reshape/test_pivot.py | 1 | 73975 |
from datetime import datetime, date, timedelta
import pytest
import numpy as np
from collections import OrderedDict
import pandas as pd
from pandas import (DataFrame, Series, Index, MultiIndex,
Grouper, date_range, concat)
from pandas.core.reshape.pivot import pivot_table, crosstab
from pandas.... | bsd-3-clause |
persandstrom/home-assistant | tests/components/test_upnp.py | 1 | 5914 | """Test the UPNP component."""
from collections import OrderedDict
from unittest.mock import patch, MagicMock
import pytest
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.setup import async_setup_component
from homeassistant.components.upnp import IP_SERVICE, DATA_UPNP
class MockService... | apache-2.0 |
zhangpf/cloudroid | app/commonset.py | 3 | 2226 | # coding:utf-8
# Software License Agreement (BSD License)
#
# Copyright (c) 2016, micROS Team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the... | bsd-3-clause |
jaeh/runtime | deps/v8/tools/testrunner/local/pool.py | 9 | 5357 | #!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from Queue import Empty
from multiprocessing import Event, Process, Queue
class NormalResult():
def __init__(self, result):
se... | apache-2.0 |
komsas/OpenUpgrade | addons/point_of_sale/__openerp__.py | 36 | 3681 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
consulo/consulo-python | plugin/src/main/dist/helpers/coveragepy/coverage/xmlreport.py | 40 | 7933 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""XML reporting for coverage.py"""
import os
import os.path
import sys
import time
import xml.dom.minidom
from coverage import env
from coverage import __url__, ... | apache-2.0 |
guaix-ucm/django-megaraetc | etc/output_table_MOS_P_T.py | 2 | 4745 | def tablenewpsfMPT(lambdaeff_string, seeingx_string, exptimepframe_val_string, exptime_val_string, numframe_val_string,
seeing_centermean_string, seeing_cr1_string,
sncont_centerspaxel_voxel_string, sncont_cr1spaxels_voxel_string,
tsncont_centerspaxel_voxel_string, tsncont_cr1spaxels_voxel_string,
sncont_centerspaxel_a... | gpl-3.0 |
uni-peter-zheng/autotest | utils/build_externals.py | 4 | 5423 | #!/usr/bin/python
#
# Please keep this code python 2.4 compatible and stand alone.
"""
Fetch, build and install external Python library dependancies.
This fetches external python libraries, builds them using your host's
python and installs them under our own autotest/site-packages/ directory.
Usage? Just run it.
... | gpl-2.0 |
prologic/kdb | docs/source/conf.py | 1 | 8375 | # -*- coding: utf-8 -*-
#
# Knowledge Database BOt documentation build configuration file, created by
# sphinx-quickstart on Sat Apr 5 12:11:39 2014.
#
# 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
# autogenera... | mit |
corradomonti/fbvoting | fbvoting/recommendation/mixedchart.py | 1 | 2834 | import itertools, logging
from operator import itemgetter
from uuid import uuid4 as uuid
from fbvoting.db.chart import find_rank, get_chart_elements_higher_than, get_sorted_chart_elements_lower_than
from personalranks import get_personal_ranks
from fbvoting.conf import MIXING_FACTOR
from fbvoting.rediscache import red... | mit |
rzr/iotivity | test/test_manager/robottcxmlparser/testcase.py | 2 | 5235 | import os
from lxml import etree
from .utility import *
class TestCase:
def __init__(self, _tc_content, module_name, _tc_env):
self.tc_env = _tc_env
self.tc_content = _tc_content
self.platform = ""
self.module_name = module_name
self.version = ""
self.bit = ""
... | apache-2.0 |
saurabh6790/medsyn-app1 | setup/doctype/naming_series/naming_series.py | 28 | 5980 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr
from webnotes import msgprint
import webnotes.model.doctype
class DocType:
def __init__(self, d, ... | agpl-3.0 |
puchchi/stock_scraper_latest | MainDriver/OptionRelatedTesting.py | 1 | 2849 | import sys
from os import path
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
import MySQLdb
import pandas as pd
from scraper import utility
class kOptionRelatedTesting:
def __init__(self, csvFileName):
#parser = lambda date: pd.datetime.strptime(date, '%Y%m%d')
self.df ... | mit |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/nbconvert/exporters/exporter.py | 5 | 10951 | """This module defines a base Exporter class. For Jinja template-based export,
see templateexporter.py.
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function, absolute_import
import io
import os
import copy
import collections
im... | mit |
shuggiefisher/potato | django/contrib/flatpages/tests/csrf.py | 228 | 3780 | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase, Client
class FlatpageCSRFTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.tests.urls'
def setUp(self):
self.client = Client(enforce_csrf_checks=... | bsd-3-clause |
python-diamond/Diamond | src/collectors/ipvs/test/testipvs.py | 31 | 1811 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from ipvs import IPVSColle... | mit |
jordanemedlock/psychtruths | temboo/core/Library/Amazon/RDS/CreateDBSnapshot.py | 5 | 4268 | # -*- coding: utf-8 -*-
###############################################################################
#
# CreateDBSnapshot
# Creates a snapshot of an existing database instance.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you... | apache-2.0 |
thaumos/ansible-modules-extras | cloud/amazon/lambda_facts.py | 27 | 13282 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distributed... | gpl-3.0 |
holi87/PythonSzkolenie | fixture/db.py | 1 | 1415 | import pymysql.cursors
from model.group import Group
from model.contact import Contact
__author__ = "Grzegorz Holak"
class DbFixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.connection... | apache-2.0 |
bkirui/odoo | addons/account_asset/wizard/__init__.py | 445 | 1122 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
llange/pynag | examples/Model/parse-configmain.py | 3 | 2991 | #!/usr/bin/python
# This script parses the configmain.html file from the Nagios project and tries
# to extract information regarding options.
import re
from pprint import pprint
f = open('configmain.html')
k = None
p = False
doc = ""
format = ""
examples = []
options = []
title = ""
info = {}
for l in f.readlines(... | gpl-2.0 |
contactless/wirenboard | contrib/deb/mosquitto/mosquitto-1.4.2/test/lib/08-ssl-fake-cacert.py | 7 | 1542 | #!/usr/bin/env python
import inspect
import os
import subprocess
import socket
import ssl
import sys
import time
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[... | mit |
vinihjunior/firsttest | game_animals.py | 2 | 1181 | #!/usr/bin/env python
#
# Um simples jogo de adivinhação com dicas.
#
# Vinicius Júnior
# @VinihJunior
# vinicius.dphelippe@gmail.com
from random import randint
while True:
print("************************************************")
print("* *")
print("* ... | bsd-2-clause |
paulvstheworld/vs_collisions | website/website/settings.py | 1 | 2080 | """
Django settings for website project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
im... | mit |
adamkh/kivy | examples/widgets/effectwidget3_advanced.py | 43 | 1665 | '''
This example demonstrates creating and usind an AdvancedEffectBase. In
this case, we use it to efficiently pass the touch coordinates into the shader.
'''
from kivy.base import runTouchApp
from kivy.properties import ListProperty
from kivy.lang import Builder
from kivy.uix.effectwidget import EffectWidget, Advance... | mit |
quimaguirre/diana | diana/toolbox/sequence_utilities.py | 1 | 5224 | #!/usr/bin/env python
#
# Sequence related utilitiesa - written during development
# of the test project of GFang
#
# Emre Guney, 20/12/2012, distributed under GNU-GPL.
from bisect import bisect_left, bisect_right
def read_fasta_file(fasta_file):
f = open(fasta_file)
for i, line in enumerate(f):
line... | mit |
gdimitris/ChessPuzzler | Virtual_Environment/lib/python2.7/site-packages/sqlalchemy/ext/declarative/base.py | 51 | 25231 | # ext/declarative/base.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Internal implementation for declarative."""
from ...schema import Table, ... | mit |
indrajitr/ansible | test/support/integration/plugins/modules/consul_session.py | 40 | 9152 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Steve Gargan <steve.gargan@gmail.com>
# 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_versi... | gpl-3.0 |
teamfx/openjfx-9-dev-rt | modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/common/net/credentials_unittest.py | 1 | 10367 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | gpl-2.0 |
dmccloskey/sequencing_analysis | sequencing_analysis/mutations_endpoints.py | 1 | 14531 | from io_utilities.base_importData import base_importData
from io_utilities.base_exportData import base_exportData
from .genome_diff import genome_diff
from .genome_diff_mutations import mutations
class mutations_endpoints(mutations):
def __init__(self,endpoint_name_I = None, endpoint_sample_names_I=[], mutations_I... | mit |
nklever/pyfpdf | tests/cover/test_encodings.py | 1 | 20123 | # -*- coding: utf-8 -*-
"test to visualize encoding problems"
from __future__ import with_statement
#PyFPDF-cover-test:format=PDF
#PyFPDF-cover-test:fn=testoutput.pdf
#PyFPDF-cover-test:hash=e3c74fe7738fba7eed0cd489c597dc88
#
# Please note: with current PyFPDF state four codepoints:
# breve, dotaccent, hungarumlaut... | lgpl-3.0 |
hernandito/SickRage | lib/simplejson/__init__.py | 448 | 12463 | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | gpl-3.0 |
shownomercy/django | django/contrib/gis/geos/point.py | 338 | 4419 | from ctypes import c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.utils import six
from django.utils.six.moves import range
class Point(GEOSGeometry):
_minlength = 2
_m... | bsd-3-clause |
ilyaraz/falconn_polygon | external/googletest/googletest/scripts/upload.py | 2511 | 51024 | #!/usr/bin/env python
#
# Copyright 2007 Google 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... | mit |
Konubinix/pyfilesystem | fs/expose/fuse/fuse3.py | 12 | 22126 | # Copyright (c) 2008 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... | bsd-3-clause |
sugarguo/Flask_Blog | ext_lib/setuptools/depends.py | 410 | 6221 | from __future__ import generators
import sys, imp, marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion, LooseVersion
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building o... | gpl-3.0 |
rooshilp/CMPUT410Lab6 | virt_env/virt1/lib/python2.7/site-packages/django/contrib/gis/db/backends/base.py | 55 | 11582 | """
Base/mixin classes for the spatial backend database operations and the
`<Backend>SpatialRefSys` model.
"""
import re
from django.contrib.gis import gdal
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class BaseSpatialOperations(object):
"""
This module holds th... | apache-2.0 |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/lib/surface/functions/logs/read.py | 2 | 6282 | # Copyright 2015 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... | apache-2.0 |
homme/ansible | lib/ansible/utils/module_docs_fragments/aws.py | 232 | 3156 | # (c) 2014, Will Thames <will@thames.id.au>
#
# This file is part of Ansible
#
# Ansible 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... | gpl-3.0 |
flyfei/python-for-android | python3-alpha/python3-src/Lib/test/test_tokenize.py | 48 | 35383 | doctests = """
Tests for the tokenize module.
The tests can be really simple. Given a small fragment of source
code, print out a table with tokens. The ENDMARK is omitted for
brevity.
>>> dump_tokens("1 + 1")
ENCODING 'utf-8' (0, 0) (0, 0)
NUMBER '1' (1, 0) (1, 1)
OP '+' ... | apache-2.0 |
srcole/neurodsp | neurodsp/utils/outliers.py | 1 | 2204 | """Outlier & missing data related utility functions for NeuroDSP."""
import numpy as np
###################################################################################################
###################################################################################################
def remove_nans(sig):
"""... | mit |
product-owner/2015scrum | static/Brython3.1.1-20150328-091302/Lib/difflib.py | 737 | 82544 | #! /usr/bin/env python3
"""
Module difflib -- helpers for computing deltas between objects.
Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
Use SequenceMatcher to return list of the best "good enough" matches.
Function context_diff(a, b):
For two lists of strings, return a delta in context ... | gpl-3.0 |
wreckJ/intellij-community | python/lib/Lib/user.py | 102 | 1511 | """Hook to allow user-specified customization code to run.
As a policy, Python doesn't run user-specified code on startup of
Python programs (interactive sessions execute the script specified in
the PYTHONSTARTUP environment variable if it exists).
However, some programs or sites may find it convenient to allow users... | apache-2.0 |
robobrobro/ballin-octo-shame | lib/Python-3.4.3/Lib/test/test_struct.py | 84 | 27551 | from collections import abc
import array
import operator
import unittest
import struct
import sys
from test import support
ISBIGENDIAN = sys.byteorder == "big"
integer_codes = 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q', 'Q', 'n', 'N'
byteorders = '', '@', '=', '<', '>', '!'
def iter_integer_formats(byteorders=byte... | mit |
rossburton/yocto-autobuilder | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/test/mock_win32process.py | 82 | 1499 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This is a mock win32process module.
The purpose of this module is mock process creation for the PID test.
CreateProcess(...) will spawn a process, and always return a PID of 42.
"""
import win32process
GetExitCodeProcess = win32process.GetE... | gpl-2.0 |
Kingclove/info3180project2 | server/lib/werkzeug/contrib/iterio.py | 318 | 10718 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.iterio
~~~~~~~~~~~~~~~~~~~~~~~
This module implements a :class:`IterIO` that converts an iterator into
a stream object and the other way round. Converting streams into
iterators requires the `greenlet`_ module.
To convert an iterator into a stream... | apache-2.0 |
gchaimovitz/CouchPotatoServer | couchpotato/core/media/movie/providers/userscript/filmstarts.py | 4 | 1035 | from bs4 import BeautifulSoup
from couchpotato.core.media._base.providers.userscript.base import UserscriptBase
import re
autoload = 'Filmstarts'
class Filmstarts(UserscriptBase):
includes = ['*://www.filmstarts.de/kritiken/*']
def getMovie(self, url):
try:
data = self.getUrl(url)
except:
return
... | gpl-3.0 |
elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 2/instances/11_2_wikiflow_1sh_1s_annot/sessioncompute_0/SessionCompute_0.py | 9 | 2808 | #!/usr/bin/env python
from sciwonc.dataflow.DataStoreClient import DataStoreClient
import ConfigDB_SessionCompute_0
import pprint
# connector and config
client = DataStoreClient("mongodb", ConfigDB_SessionCompute_0)
config = ConfigDB_SessionCompute_0
# according to config
dataList = client.getData() # return an array... | gpl-3.0 |
wfxiang08/django185 | django/contrib/gis/db/models/query.py | 40 | 36400 | import warnings
from django.contrib.gis.db.models import aggregates
from django.contrib.gis.db.models.fields import (
GeometryField, LineStringField, PointField, get_srid_info,
)
from django.contrib.gis.db.models.lookups import GISLookup
from django.contrib.gis.db.models.sql import (
AreaField, DistanceField, ... | bsd-3-clause |
ychfan/tensorflow | tensorflow/python/debug/lib/session_debug_testlib.py | 8 | 62419 | # Copyright 2016 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... | apache-2.0 |
arunhotra/tensorflow | tensorflow/g3doc/how_tos/reading_data/fully_connected_preloaded.py | 5 | 4566 | """Trains the MNIST network using preloaded data in a constant.
Command to run this py_binary target:
bazel run -c opt \
<...>/tensorflow/g3doc/how_tos/reading_data:fully_connected_preloaded
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.