repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
JimCircadian/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/na_ontap_cluster.py | 8 | #!/usr/bin/python
# (c) 2017, 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'],
... |
leorochael/odoo | refs/heads/8.0 | setup/package.py | 180 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
#... |
SohKai/ChronoLogger | refs/heads/master | web/flask/lib/python2.7/site-packages/sqlalchemy/connectors/zxJDBC.py | 18 | # connectors/zxJDBC.py
# Copyright (C) 2005-2012 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
import sys
from sqlalchemy.connectors import Connector
class ZxJDBCConnector(Con... |
indictranstech/internal-erpnext | refs/heads/develop | erpnext/manufacturing/doctype/production_planning_tool/__init__.py | 37694 | from __future__ import unicode_literals
|
SmileyChris/django-countries | refs/heads/master | django_countries/tests/forms.py | 1 | from django import forms
from django_countries.tests import models
class PersonForm(forms.ModelForm):
class Meta:
model = models.Person
fields = ["country", "favourite_country"]
class AllowNullForm(forms.ModelForm):
class Meta:
model = models.AllowNull
fields = ["country"]
... |
kumarshivam675/Mobile10X-Hack | refs/heads/master | build/lib.linux-x86_64-2.7/yowsup/layers/protocol_groups/protocolentities/test_iq_result_groups.py | 63 | from yowsup.layers.protocol_iq.protocolentities.test_iq_result import ResultIqProtocolEntityTest
class GroupsResultIqProtocolEntityTest(ResultIqProtocolEntityTest):
pass |
kfox1111/horizon | refs/heads/master | openstack_dashboard/api/fwaas.py | 36 | # Copyright 2013, Big Switch Networks, 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 applic... |
skidzo/sympy | refs/heads/master | sympy/core/evaluate.py | 96 | from .cache import clear_cache
from contextlib import contextmanager
class _global_evaluate(list):
""" The cache must be cleared whenever global_evaluate is changed. """
def __setitem__(self, key, value):
clear_cache()
super(_global_evaluate, self).__setitem__(key, value)
global_evaluate = _... |
FRidh/python-acoustics | refs/heads/master | tests/test_bands.py | 3 | from __future__ import division
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
import pytest
from acoustics.bands import (octave, octave_high, octave_low, third,
third_low, third_high, third2oct,
_check_ba... |
ShakedY/ai-project | refs/heads/master | lama/translate/pddl/predicates.py | 6 | #######################################################################
#
# Author: Malte Helmert (helmert@informatik.uni-freiburg.de)
# (C) Copyright 2003-2004 Malte Helmert
#
# This file is part of LAMA.
#
# LAMA is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Li... |
Maccimo/intellij-community | refs/heads/master | python/testData/keywordCompletion/elif.py | 83 | if True:
a = 1
eli<caret> |
edersohe/restor | refs/heads/master | restor.py | 1 | import tornado.ioloop
import tornado.web
import traceback
import tornado.httputil
import tornado.escape
def action_routes(prefix, id_regex='[0-9a-f]+'):
_id = "(?P<_id>%s)" % id_regex
_arg1 = "(?:/(?P<_arg1>edit|delete))?"
_arg2 = "(?P<_arg2>new)"
route = "(?:/(?:(?:%s%s)|%s))?" % (_id, _arg1, _arg2)
... |
glaubitz/fs-uae-debian | refs/heads/master | arcade/OpenGL/GL/MESA/__init__.py | 1729 | """OpenGL Extensions""" |
metapolator/mutatormathtools | refs/heads/master | python_modules/lib/python/robofab/test/test_dialogs.py | 10 | import robofab.interface.all.dialogs
reload(robofab.interface.all.dialogs)
from robofab.interface.all.dialogs import *
import unittest
__all__ = [
"AskString", #x
"AskYesNoCancel", #x
"FindGlyph",
"GetFile", #x
"GetFolder", #x
"GetFileOrFolder", #... |
egoldchain/egoldchain-master | refs/heads/master | test/functional/segwit.py | 17 | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the SegWit changeover logic."""
from test_framework.test_framework import BitcoinTestFramework
from te... |
rodgomes/django-waffle | refs/heads/master | waffle/tests/test_testutils.py | 4 | from decimal import Decimal
from django.contrib.auth.models import AnonymousUser
from django.test import TestCase, RequestFactory
import waffle
from waffle.models import Switch, Flag, Sample
from waffle.testutils import override_switch, override_flag, override_sample
class OverrideSwitchTests(TestCase):
def tes... |
ezequielpereira/Time-Line | refs/heads/master | libs/wx/lib/ogl/_diagram.py | 6 | # -*- coding: iso-8859-1 -*-
#----------------------------------------------------------------------------
# Name: diagram.py
# Purpose: Diagram class
#
# Author: Pierre Hjälm (from C++ original by Julian Smart)
#
# Created: 2004-05-08
# RCS-ID: $Id: _diagram.py 37267 2006-02-03 06:51:34Z ... |
ToontownUprising/src | refs/heads/master | toontown/parties/DistributedPartyFireworksActivity.py | 4 | from pandac.PandaModules import Vec3
from pandac.PandaModules import OmniBoundingVolume
from pandac.PandaModules import AlphaTestAttrib
from pandac.PandaModules import RenderAttrib
from direct.actor.Actor import Actor
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import globalClockDelt... |
vrenkens/Nabu-asr | refs/heads/master | nabu/neuralnetworks/components/ops.py | 2 | '''@file ops.py
some operations'''
import tensorflow as tf
def pyramid_stack(inputs, sequence_lengths, numsteps, axis=2, scope=None):
'''
concatenate each two consecutive elements
Args:
inputs: A time minor tensor [batch_size, time, input_size]
sequence_lengths: the length of the input se... |
ChromiumWebApps/chromium | refs/heads/master | third_party/closure_linter/closure_linter/checker.py | 135 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... |
DevOps4Networks/ansible | refs/heads/devel | contrib/inventory/openvz.py | 79 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# openvz.py
#
# Copyright 2014 jordonr <jordon@beamsyn.net>
#
# 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 ... |
shepdelacreme/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/pkgin.py | 43 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Shaun Zinck <shaun.zinck at gmail.com>
# Copyright (c) 2015 Lawrence Leonard Gilbert <larry@L2G.to>
# Copyright (c) 2016 Jasper Lievisse Adriaanse <j at jasper.la>
#
# Written by Shaun Zinck
# Based on pacman module written by Afterburn <http://github.com/... |
schettino72/nikola | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# Don't use __future__ in this script, it breaks buildout
# from __future__ import print_function
import os
import subprocess
import sys
import shutil
from setuptools import setup, find_packages
from setuptools.command.install import install
from setuptools.command.test import test as TestCommand... |
ic-hep/DIRAC | refs/heads/rel-v6r15 | FrameworkSystem/private/monitoring/MonitoringCatalog.py | 1 | """ interacts with sqlite3 db
"""
import sqlite3
import os
import types
import hashlib
import time
import DIRAC
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.FrameworkSystem.private.monitoring.Activity import Activity
from DIRAC.Core.Utilities import Time
class MonitoringCatalog( object ):
def __init__( sel... |
infobloxopen/infoblox-netmri | refs/heads/master | infoblox_netmri/api/broker/v3_2_0/device_object_object_broker.py | 14 | from ..broker import Broker
class DeviceObjectObjectBroker(Broker):
controller = "device_object_objects"
def show(self, **kwargs):
"""Shows the details for the specified device object object.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
... |
wackywendell/numpy | refs/heads/master | benchmarks/benchmarks/bench_indexing.py | 55 | from __future__ import absolute_import, division, print_function
from .common import Benchmark, get_squares_, get_indexes_, get_indexes_rand_
from os.path import join as pjoin
import shutil
import sys
import six
from numpy import memmap, float32, array
import numpy as np
from tempfile import mkdtemp
class Indexing(... |
upliftaero/MissionPlanner | refs/heads/master | Lib/site-packages/scipy/linalg/decomp_svd.py | 53 | """SVD decomposition functions."""
import numpy
from numpy import asarray_chkfinite, zeros, r_, diag
from scipy.linalg import calc_lwork
# Local imports.
from misc import LinAlgError, _datacopied
from lapack import get_lapack_funcs
from funcinfo import get_func_info
def svd(a, full_matrices=True, compute_uv=True, o... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/lib2to3/fixes/fix_xreadlines.py | 327 | """Fix "for x in f.xreadlines()" -> "for x in f".
This fixer will also convert g(f.xreadlines) into g(f.__iter__)."""
# Author: Collin Winter
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixXreadlines(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
power< call=an... |
caioserra/apiAdwords | refs/heads/master | examples/adspygoogle/dfp/v201308/get_all_content.py | 2 | #!/usr/bin/python
#
# Copyright 2013 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 b... |
klonage/nlt-gcs | refs/heads/master | Lib/code.py | 62 | """Utilities needed to emulate Python's interactive interpreter.
"""
# Inspired by similar code by Jeff Epler and Fredrik Lundh.
import sys
import traceback
from codeop import CommandCompiler, compile_command
__all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact",
"compile_com... |
andfoy/margffoy-tuay-server | refs/heads/master | env/lib/python2.7/site-packages/tests/test_base_model_publisher_router_deleted.py | 13 | from swampdragon.route_handler import BaseModelPublisherRouter
from swampdragon.serializers.model_serializer import ModelSerializer
from swampdragon.testing.dragon_testcase import DragonTestCase
from .models import TwoFieldModel
class Serializer(ModelSerializer):
class Meta:
publish_fields = ('id')
... |
richardtran415/pymatgen | refs/heads/master | pymatgen/symmetry/__init__.py | 25 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
The symmetry package implements symmetry tools, e.g., spacegroup determination,
etc.
"""
|
andrewsmedina/django | refs/heads/master | django/contrib/staticfiles/finders.py | 8 | import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import default_storage, Storage, FileSystemStorage
from django.utils.datastructures import SortedDict
from django.utils.functional import empty, memoize, LazyObject
from django.utils.module_... |
SasView/sasmodels | refs/heads/master | sasmodels/conversion_table.py | 1 | """
Parameter conversion table
*CONVERSION_TABLE* gives the old model name and a dictionary of old parameter
names for each parameter in sasmodels. This is used by :mod:`.convert` to
determine the equivalent parameter set when comparing a sasmodels model to
the models defined in previous versions of SasView and sasmo... |
glennlive/gnuradio-wg-grc | refs/heads/master | docs/sphinx/hieroglyph/test/test_hierglyph.py | 47 | import unittest
from hieroglyph.hieroglyph import first_paragraph_indent, gather_lines, unindent
__author__ = 'Robert Smallshire'
class UnindentTests(unittest.TestCase):
def test_zero_lines(self):
source = []
expected = []
actual = unindent(source)
self.assertEqual(actual, expec... |
appliedx/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_capa_module.py | 34 | # -*- coding: utf-8 -*-
"""
Tests of the Capa XModule
"""
# pylint: disable=missing-docstring
# pylint: disable=invalid-name
import datetime
import json
import random
import os
import textwrap
import unittest
import ddt
from mock import Mock, patch, DEFAULT
import webob
from webob.multidict import MultiDict
import x... |
vivekmishra1991/scikit-learn | refs/heads/master | sklearn/cluster/dbscan_.py | 92 | # -*- coding: utf-8 -*-
"""
DBSCAN: Density-Based Spatial Clustering of Applications with Noise
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Joel Nothman <joel.nothman@gmail.com>
# Lars Buitinck
#
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse
from ..ba... |
pilou-/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/macports.py | 59 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jimmy Tang <jcftang@gmail.com>
# Based on okpg (Patrick Pelletier <pp.pelletier@gmail.com>), pacman
# (Afterburn) and pkgin (Shaun Zinck) modules
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import ... |
allenp/odoo | refs/heads/9.0 | openerp/addons/test_uninstall/__init__.py | 2355 | # -*- coding: utf-8 -*-
import models
|
mbauskar/alec_frappe5_erpnext | refs/heads/develop | erpnext/selling/doctype/customer/test_customer.py | 5 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.test_runner import make_test_records
from erpnext.exceptions import CustomerFrozen
test_ignore = ["Price Li... |
izgzhen/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/WebIDL.py | 5 | # 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/.
""" A WebIDL parser. """
from ply import lex, yacc
import re
import os
import traceback
import math
from collections im... |
AlexTISYoung/hlmm | refs/heads/master | hlmm/__init__.py | 1 | import hetlm
import hetlmm |
40223244/cdb-2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/sre_constants.py | 692 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... |
ukncsc/viper | refs/heads/master | viper/core/database.py | 2 | # This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
from __future__ import unicode_literals # make all strings unicode in python2
import os
import json
from datetime import datetime
from sqlalchemy import Column, Integer, String, DateTime, Foreign... |
paxchristos/Semc-ICS-kernel | refs/heads/master | arch/ia64/scripts/unwcheck.py | 916 | #!/usr/bin/env 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 Matthe... |
cilekagaci/engerek | refs/heads/master | src/engerek/zemberek.py | 1 | # coding=utf-8
import jnius
from base import Stemmer
from common import infinitive_form
TurkiyeTurkcesi = jnius.autoclass('net.zemberek.tr.yapi.TurkiyeTurkcesi')
Zemberek = jnius.autoclass('net.zemberek.erisim.Zemberek')
class ZemberekStemmer(Stemmer):
"""Turkish stemmer based on Zemberek library."""
LANGU... |
GoodgameStudios/crossbar | refs/heads/master | crossbar/controller/process.py | 1 | #####################################################################################
#
# Copyright (C) Tavendo GmbH
#
# Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you
# have purchased a commercial license), the license terms below apply.
#
# Should you enter into a separate licen... |
alexallah/django | refs/heads/master | django/contrib/staticfiles/utils.py | 41 | import fnmatch
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def matches_patterns(path, patterns=None):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
if patt... |
andreabedini/PyTables | refs/heads/develop | tables/tests/test_carray.py | 5 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import os
import sys
import numpy
import tables
from tables import (
Atom, StringAtom, IntAtom, Int8Atom, Int16Atom, Int32Atom, Int64Atom,
FloatAtom, Float32Atom,
)
from tables.tests import common
from tables... |
2013Commons/HUE-SHARK | refs/heads/master | desktop/core/ext-py/Django-1.2.3/tests/modeltests/model_package/tests.py | 11 | from django.db import models
class Advertisment(models.Model):
customer = models.CharField(max_length=100)
publications = models.ManyToManyField("model_package.Publication", null=True, blank=True)
class Meta:
app_label = 'model_package'
__test__ = {'API_TESTS': """
>>> from models.publication imp... |
TRESCLOUD/odoopub | refs/heads/master | openerp/addons/test_impex/tests/test_export.py | 158 | # -*- coding: utf-8 -*-
import itertools
import openerp.modules.registry
import openerp
from openerp.tests import common
class CreatorCase(common.TransactionCase):
model_name = False
def __init__(self, *args, **kwargs):
super(CreatorCase, self).__init__(*args, **kwargs)
self.model = None
... |
suncycheng/intellij-community | refs/heads/master | python/testData/codeInsight/controlflow/tryexceptelsefinally.py | 83 | d = dict()
try:
v = d['key']
except KeyError:
print 'element not found'
else:
print 'element value {0}'.format(v)
finally:
print 'excuting finally clause' |
mozilla/stoneridge | refs/heads/master | python/src/Lib/encodings/raw_unicode_escape.py | 852 | """ Python 'raw-unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is ... |
lantip/aws-filemanager | refs/heads/master | cloud_browser/tests/__init__.py | 1 | # The code of class AWSMockServiceTestCase is from the boto projet:
# https://github.com/boto/boto/blob/develop/tests/unit/__init__.py
# The code of loding unittest from multiple files refers the code in:
# http://stackoverflow.com/questions/6248510
#
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/
#
# Perm... |
endlessm/chromium-browser | refs/heads/master | third_party/webgl/src/sdk/tests/deqp/functional/gles3/transformfeedback/transformfeedback_test_generator.py | 6 | #!/usr/bin/env python
# Copyright (c) 2019 The Khronos Group Inc.
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE.txt file.
"""
Generator for textureformat* tests.
This file needs to be run in its folder.
"""
import sys
_DO_NOT_EDIT_WARNING = """<!--
This file i... |
hiway/micropython | refs/heads/master | tests/basics/string1.py | 92 | # basic strings
# literals
print('abc')
print(r'abc')
print(u'abc')
print(repr('\a\b\t\n\v\f\r'))
print('\z') # unrecognised escape char
# construction
print(str())
print(str('abc'))
# inplace addition
x = 'abc'
print(x)
x += 'def'
print(x)
# binary ops
print('123' + "456")
print('123' * 5)
try:
'123' * '1'
exc... |
feilongfl/micropython | refs/heads/master | tests/basics/list_copy.py | 119 | # list copy tests
a = [1, 2, []]
b = a.copy()
a[-1].append(1)
a.append(4)
print(a)
print(b)
|
hanv89/api-client-python | refs/heads/master | lib/oauth2client/service_account.py | 9 | # Copyright 2014 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 ... |
dchaplinsky/declarations.com.ua | refs/heads/master | declarations_site/cms_pages/migrations/0024_auto_20191105_0145.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-11-04 23:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cms_pages', '0023_auto_20180419_2357'),
]
operations = [
migrations.AddFie... |
kntem/webdeposit | refs/heads/webdeposit-final | modules/miscutil/lib/inveniocfg_upgrader_model.py | 3 | # -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio 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 (at your option) an... |
2014cdbg4/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/gc.py | 743 | """This module provides access to the garbage collector for reference cycles.
enable() -- Enable automatic garbage collection.
disable() -- Disable automatic garbage collection.
isenabled() -- Returns true if automatic collection is enabled.
collect() -- Do a full collection right now.
get_count() -- Return the curren... |
ShashaQin/erpnext | refs/heads/develop | erpnext/setup/doctype/target_detail/target_detail.py | 121 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class TargetDetail(Document):
pass |
clchiou/garage | refs/heads/master | py/garage/garage/formatters/json.py | 1 | """Helpers for standard library's json package."""
__all__ = [
'encode_datetime',
'encode_mapping',
'join_encoders',
]
import datetime
from collections import Mapping
from collections import OrderedDict
from garage import datetimes
def _type_error(obj):
return TypeError(repr(obj) + ' is not JSON se... |
Snifer/BurpSuite-Plugins | refs/heads/master | faraday/model/controller.py | 2 | '''
Faraday Penetration Test IDE - Community Version
Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
See the file 'doc/LICENSE' for the license information
'''
import time
import threading
import Queue
import traceback
import datetime
import model.common # this is to make sure the factory is created
imp... |
dan-mi-sun/bitcoin | refs/heads/master | qa/rpc-tests/rawtransactions.py | 87 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly) coin... |
pyrotron/heekscnc | refs/heads/master | pycnc/wxProgramWindow.py | 25 | import wx
class ProgramWindow(wx.ScrolledWindow):
def __init__(self, parent):
wx.ScrolledWindow.__init__(self, parent, name = 'Program', style = wx.HSCROLL + wx.VSCROLL + wx.NO_FULL_REPAINT_ON_RESIZE)
self.textCtrl = wx.TextCtrl(self, 100, "", style = wx.TE_MULTILINE + wx.TE_DONTWRAP)
self.... |
pombredanne/pylearn2 | refs/heads/master | pylearn2/model_extensions/tests/test_norm_constraint.py | 21 | """
Tests of functionality in norm_constraint.py
"""
import numpy as np
from theano.compat import OrderedDict
from theano import function
from pylearn2.models.model import Model
from pylearn2.model_extensions.norm_constraint import ConstrainFilterMaxNorm
from pylearn2.model_extensions.norm_constraint import MaxL2Fil... |
xiaokeng/robotframework | refs/heads/master | src/robot/running/arguments/__init__.py | 23 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... |
GuillaumeGomez/servo | refs/heads/master | tests/wpt/css-tests/tools/pytest/testing/test_terminal.py | 169 | """
terminal reporting of the full testing process.
"""
import collections
import sys
import _pytest._pluggy as pluggy
import _pytest._code
import py
import pytest
from _pytest import runner
from _pytest.main import EXIT_NOTESTSCOLLECTED
from _pytest.terminal import TerminalReporter, repr_pythonversion, getreportopt
f... |
plotly/python-api | refs/heads/master | packages/python/plotly/plotly/validators/scattergeo/_hoverlabel.py | 2 | import _plotly_utils.basevalidators
class HoverlabelValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="hoverlabel", parent_name="scattergeo", **kwargs):
super(HoverlabelValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... |
kevinsawicki/node-gyp | refs/heads/master | gyp/test/external-cross-compile/src/fake_cross.py | 344 | #!/usr/bin/python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
fh = open(sys.argv[1], 'w')
filenames = sys.argv[2:]
for filename in filenames:
subfile = open(filename)
data = subfile.read()
... |
marcwebbie/youtube-dl | refs/heads/master | youtube_dl/extractor/abcnews.py | 11 | # coding: utf-8
from __future__ import unicode_literals
import calendar
import re
import time
from .amp import AMPIE
from .common import InfoExtractor
from ..compat import compat_urlparse
class AbcNewsVideoIE(AMPIE):
IE_NAME = 'abcnews:video'
_VALID_URL = r'https?://abcnews\.go\.com/[^/]+/video/(?P<display_... |
tangmi360/googletest | refs/heads/master | test/gtest_xml_output_unittest.py | 1815 | #!/usr/bin/env python
#
# Copyright 2006, 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... |
xujb/odoo | refs/heads/8.0 | addons/l10n_hu/__openerp__.py | 320 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 InnOpen Group Kft (<http://www.innopen.eu>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
... |
sahlinet/swampdragon | refs/heads/master | tests/test_base_model_router_get_list.py | 13 | from swampdragon.serializers.model_serializer import ModelSerializer
from swampdragon.route_handler import BaseModelRouter
from swampdragon.testing.dragon_testcase import DragonTestCase
from .models import TextModel
class FooModelSerializer(ModelSerializer):
class Meta:
model = TextModel
publish_f... |
axinging/chromium-crosswalk | refs/heads/master | third_party/bintrees/bintrees/__init__.py | 156 | #!/usr/bin/env python
#coding:utf-8
# Author: mozman
# Purpose: binary trees package
# Created: 03.05.2010
# Copyright (c) 2010-2013 by Manfred Moitzi
# License: MIT License
from __future__ import absolute_import
__doc__ = """
Binary Tree Package
===================
Python Trees
------------
Balanced and unbalance... |
yichenfeng/AAFApplicationAngular | refs/heads/master | api/database.py | 3 | from pymongo import MongoClient
from gridfs import GridFS
from bson.objectid import ObjectId
from datetime import datetime
from os import environ
from const import RequestType
def GetAdminUsers(db=None):
if not db:
client = MongoClient('data', 27017)
db = client.aaf_db
admins = []
for admin... |
nicobustillos/odoo | refs/heads/8.0 | addons/crm/wizard/crm_partner_binding.py | 177 | # -*- 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... |
ChristineLaMuse/mozillians | refs/heads/master | vendor-local/lib/python/kombu/transport/pyamqp.py | 12 | """
kombu.transport.pyamqp
======================
pure python amqp transport.
"""
from __future__ import absolute_import
import amqp
from kombu.exceptions import (
StdConnectionError,
StdChannelError,
VersionMismatch,
)
from kombu.utils.amq_manager import get_manager
from . import base
DEFAULT_PORT = ... |
muffinresearch/olympia | refs/heads/master | apps/addons/buttons.py | 12 | from django.db.models import Q
from django.shortcuts import render
from django.views.decorators.cache import cache_page
import jingo
import jinja2
from tower import ugettext as _, ugettext_lazy as _lazy
import amo
from amo.helpers import urlparams
from amo.urlresolvers import reverse
from addons.models import Addon
f... |
B3AU/waveTree | refs/heads/waveTree | examples/covariance/plot_lw_vs_oas.py | 8 | """
=============================
Ledoit-Wolf vs OAS estimation
=============================
The usual covariance maximum likelihood estimate can be regularized
using shrinkage. Ledoit and Wolf proposed a close formula to compute
the asymptotically optimal shrinkage parameter (minimizing a MSE
criterion), yielding th... |
dslomov/intellij-community | refs/heads/master | python/testData/completion/propertyType.py | 83 | class C(object):
def __init__(self):
self._x = []
@property
def x(self):
return self._x
c = C()
c.x.app<caret>
|
hassoon3/odoo | refs/heads/8.0 | addons/payment_sips/controllers/__init__.py | 4497 | # -*- coding: utf-8 -*-
import main
|
Noviat/odoo | refs/heads/8.0 | addons/payment_ogone/controllers/__init__.py | 4497 | # -*- coding: utf-8 -*-
import main
|
garthylou/Libreosteo | refs/heads/master | winserver.py | 1 | # This file is part of LibreOsteo.
#
# LibreOsteo 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.
#
# LibreOsteo is distributed in the ... |
donny/mako-mori | refs/heads/master | external/boto/emr/instance_group.py | 179 | #
# 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 limitation the rights to use, copy, modify, merge, publish, dis-
# tribute, sublicense, and/or sell ... |
pacificIT/mopidy | refs/heads/develop | tests/mpd/protocol/test_music_db.py | 14 | from __future__ import absolute_import, unicode_literals
import unittest
import mock
from mopidy.models import Album, Artist, Playlist, Ref, SearchResult, Track
from mopidy.mpd.protocol import music_db, stored_playlists
from tests.mpd import protocol
# TODO: split into more modules for faster parallel tests?
cla... |
repotvsupertuga/tvsupertuga.repository | refs/heads/master | instal/script.module.requests/lib/requests/packages/urllib3/contrib/appengine.py | 53 | """
This module provides a pool manager that uses Google App Engine's
`URLFetch Service <https://cloud.google.com/appengine/docs/python/urlfetch>`_.
Example usage::
from urllib3 import PoolManager
from urllib3.contrib.appengine import AppEngineManager, is_appengine_sandbox
if is_appengine_sandbox():
... |
shmir/IxNetwork | refs/heads/master | docs/conf.py | 2 | # -*- coding: utf-8 -*-
#
# ixnetwork documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 23 15:59:52 2016.
#
# 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.
#
#... |
akash1808/nova | refs/heads/master | nova/api/openstack/compute/contrib/flavor_swap.py | 79 | # Copyright 2012 Nebula, 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 agreed to... |
vitan/django | refs/heads/master | tests/field_defaults/tests.py | 405 | from datetime import datetime
from django.test import TestCase
from django.utils import six
from .models import Article
class DefaultTests(TestCase):
def test_field_defaults(self):
a = Article()
now = datetime.now()
a.save()
self.assertIsInstance(a.id, six.integer_types)
... |
Vogtinator/micropython | refs/heads/nspire | tests/bytecode/mp-tests/class1.py | 22 | class C:
pass
C()
|
ging/horizon | refs/heads/master | openstack_dashboard/dashboards/project/volumes/backups/tests.py | 33 | # 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
# distributed under t... |
Nicop06/ansible | refs/heads/devel | lib/ansible/modules/network/aos/aos_blueprint.py | 19 | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.com>
#
# 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 opt... |
mariianna/kodi | refs/heads/master | pelisalacarta/channels/sesionvip.py | 3 | # -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para sesionvip
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
import sys
im... |
relicode/auth-chat | refs/heads/master | django/auth_chat/models.py | 10644 | from django.db import models
# Create your models here.
|
hendawy/drchrono-patient-education | refs/heads/master | pshare/sharebackend/urls.py | 1 | from django.conf.urls import patterns, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$', 'sharebackend.views.home', name='home'),
url(r'^patients/$', 'sharebackend.views.list_patients',
name='lis... |
monapayjp/monapay | refs/heads/master | monapay/rpc.py | 1 | # -*- coding: utf-8 -*-
from decimal import Decimal
from django.conf import settings
import bitcoinrpc
def make_rpc_connection():
return bitcoinrpc.connect_to_remote(
settings.MONACOIND_ADMIN_USER,
settings.MONACOIND_ADMIN_PASSWORD,
settings.MONACOIND_HOST,
settings.MONACOIND_PORT)... |
mrquim/mrquimrepo | refs/heads/master | script.module.exodus/lib/resources/lib/sources/en/releasebb.py | 5 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
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 progra... |
theostoican/robocheck | refs/heads/master | coreutils/modulehandler.py | 3 | """modulehandler.py
General description:
This is the module that dynamically loads the classes for the tools
used to get the errors. The "getCompatibleModules" function loads
all the classes for the language specified and instanciates only
those which tool can search for the errors specified and w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.