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 |
|---|---|---|---|---|---|
realsaiko/odoo | addons/base_import_module/controllers/main.py | 354 | 1518 | # -*- coding: utf-8 -*-
import functools
import openerp
from openerp.http import Controller, route, request, Response
def webservice(f):
@functools.wraps(f)
def wrap(*args, **kw):
try:
return f(*args, **kw)
except Exception, e:
return Response(response=str(e), status=500... | agpl-3.0 |
t0mk/ansible | lib/ansible/modules/network/lenovo/cnos_backup.py | 3 | 11204 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, Inc.
#
# 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
# ... | gpl-3.0 |
iemejia/beam | sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset.py | 5 | 4390 | #
# 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... | apache-2.0 |
jinlmsft/kubernetes | hack/verify-flags-underscore.py | 169 | 9059 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
jazkarta/edx-platform-for-isc | common/lib/xmodule/xmodule/modulestore/tests/test_contentstore.py | 87 | 8284 | """
Test contentstore.mongo functionality
"""
import logging
from uuid import uuid4
import unittest
import mimetypes
from tempfile import mkdtemp
import path
import shutil
from opaque_keys.edx.locator import CourseLocator, AssetLocator
from opaque_keys.edx.keys import AssetKey
from xmodule.tests import DATA_DIR
from ... | agpl-3.0 |
markhamstra/spark | python/pyspark/sql/column.py | 28 | 25024 | #
# 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... | apache-2.0 |
ivoire/DataTag | DataTag/config.py | 1 | 5663 | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2015 Rémi Duraffort
# This file is part of DataTag.
#
# DataTag 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
#... | agpl-3.0 |
dmarteau/QGIS | python/plugins/processing/algs/gdal/sieve.py | 15 | 5672 | # -*- coding: utf-8 -*-
"""
***************************************************************************
sieve.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************************... | gpl-2.0 |
stefanhenneking/mxnet | python/mxnet/executor_manager.py | 38 | 17449 | # 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 |
jayceyxc/hue | desktop/core/ext-py/Django-1.6.10/tests/datetimes/tests.py | 49 | 3213 | from __future__ import absolute_import
import datetime
try:
import pytz
except ImportError:
pytz = None
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import timezone
from django.utils.unittest import skipIf
from .models import Article, Comment, Category
... | apache-2.0 |
2ndQuadrant/ansible | lib/ansible/modules/cloud/google/gcp_container_cluster_facts.py | 5 | 17700 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
0x726d77/storm | storm-client/src/py/storm/DistributedRPC.py | 22 | 9644 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | apache-2.0 |
hfp/tensorflow-xsmm | tensorflow/contrib/eager/python/examples/l2hmc/l2hmc.py | 29 | 12269 | # 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... | apache-2.0 |
ymero/tornado | tornado/__init__.py | 75 | 1130 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 |
sureshsundriyal/pysqlitebkup | pysqlitebkup.py | 1 | 4083 | #! /usr/bin/env python
import ctypes
from ctypes.util import find_library
__author__ = 'Suresh Sundriyal'
__license__ = 'CC0 - No rights reserved.'
__version__ = '0.0.1'
__credits__ = [ 'Joongi Kim: https://gist.github.com/achimnol/3021995',
'sqlite3.org: http://www.sqlite.org/backup.html' ]
SQLITE_O... | cc0-1.0 |
PeterFaiman/ruby-grpc-minimal | src/python/grpcio_tests/tests/testing/_server_application.py | 12 | 2824 | # Copyright 2017 gRPC authors.
#
# 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... | apache-2.0 |
PantherHackers/PantherBot | scripts/rage.py | 1 | 1230 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import upsidedown
import sys
from response import Response
from pb_logging import PBLogger
logger = PBLogger("Rage")
# flips text using upsidedown module and has a donger for emohasis
def run(response, args=[]):
response_obj = Response(sys.modules[__name__])
toFli... | mpl-2.0 |
andreabedini/PyTables | tables/exceptions.py | 5 | 11309 | # -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: December 17, 2004
# Author: Francesc Alted - faltet@pytables.com
#
# $Id$
#
########################################################################
"""Declare exceptions and warnings that are... | bsd-3-clause |
petrus-v/odoo | openerp/addons/base/ir/ir_qweb.py | 38 | 64677 | # -*- coding: utf-8 -*-
import collections
import cStringIO
import datetime
import hashlib
import json
import itertools
import logging
import math
import os
import re
import sys
import textwrap
import uuid
from subprocess import Popen, PIPE
from urlparse import urlparse
import babel
import babel.dates
import werkzeug
... | agpl-3.0 |
hlin117/statsmodels | examples/python/regression_plots.py | 33 | 9585 |
## Regression Plots
from __future__ import print_function
from statsmodels.compat import lzip
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.formula.api import ols
### Duncan's Prestige Dataset
#### Load the Data
# We can use a utility function... | bsd-3-clause |
Jmainguy/ansible-modules-core | utilities/logic/include_vars.py | 28 | 1982 | # -*- mode: python -*-
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Publ... | gpl-3.0 |
alekz112/statsmodels | statsmodels/tsa/statespace/model.py | 6 | 3282 | """
State Space Model
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from .representation import Representation
from .kalman_filter import KalmanFilter
import statsmodels.tsa.base.tsa_model as tsbase
class Model(KalmanFilter, Repr... | bsd-3-clause |
mindw/numpy | numpy/distutils/command/build_scripts.py | 264 | 1731 | """ Modified version of build_scripts that handles building scripts from functions.
"""
from __future__ import division, absolute_import, print_function
from distutils.command.build_scripts import build_scripts as old_build_scripts
from numpy.distutils import log
from numpy.distutils.misc_util import is_string
class... | bsd-3-clause |
benhc123/p2pool | p2pool/test/test_p2p.py | 269 | 2724 | import random
from twisted.internet import defer, endpoints, protocol, reactor
from twisted.trial import unittest
from p2pool import networks, p2p
from p2pool.bitcoin import data as bitcoin_data
from p2pool.util import deferral
class Test(unittest.TestCase):
@defer.inlineCallbacks
def test_sharereq(self):
... | gpl-3.0 |
sengupta/spritzbot | spritzbot/processor.py | 1 | 2789 | import os
import re
import imp
import json
class TweetProcessor:
plugins = {}
commands = {}
base_path = os.path.dirname(os.path.realpath(__file__))
plugin_path = os.path.join(base_path, "plugins")
def __init__(self):
self.load_plugins()
def load_plugins(self):
"""Loads plu... | bsd-2-clause |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations/_peer_express_route_circuit_connections_operations.py | 1 | 9352 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
aringh/odl | odl/discr/partition.py | 1 | 51284 | # Copyright 2014-2017 The ODL contributors
#
# This file is part of ODL.
#
# 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 https://mozilla.org/MPL/2.0/.
"""Partitons of interval products based on ... | mpl-2.0 |
ahmed-mahran/hue | desktop/core/ext-py/markdown/markdown/odict.py | 143 | 5157 | class OrderedDict(dict):
"""
A dictionary that keeps its keys in the order in which they're inserted.
Copied from Django's SortedDict with some modifications.
"""
def __new__(cls, *args, **kwargs):
instance = super(OrderedDict, cls).__new__(cls, *args, **kwargs)
instance.keyOrd... | apache-2.0 |
techhat/libcloud | libcloud/test/common/test_openstack_identity.py | 8 | 33173 | # 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 use ... | apache-2.0 |
mozilla/relman-auto-nag | auto_nag/round_robin.py | 2 | 6925 | # 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 json
from random import randint
from dateutil.relativedelta import relativedelta
from libmozdata import utils as... | bsd-3-clause |
mszewczy/odoo | addons/event/wizard/__init__.py | 435 | 1067 | # -*- 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 |
overtherain/scriptfile | software/googleAppEngine/lib/jinja2/jinja2/nodes.py | 122 | 28750 | # -*- coding: utf-8 -*-
"""
jinja2.nodes
~~~~~~~~~~~~
This module implements additional nodes derived from the ast base node.
It also provides some node tree helper functions like `in_lineno` and
`get_nodes` used by the parser and translator in order to normalize
python and jinja nodes.
:... | mit |
xianggong/m2c_unit_test | test/operator/remainder_char8char8/compile.py | 1861 | 4430 | #!/usr/bin/python
import os
import subprocess
import re
def runCommand(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
p.wait()
return iter(p.stdout.readline, b'')
def dumpRunCommand(command,... | gpl-2.0 |
chenss/ChatRoom | 14.5 已经能运行(虽然有很多Warning)的Django-nonrel框架/django/core/files/uploadhandler.py | 136 | 7193 | """
Base file upload handler classes, and the built-in concrete subclasses
"""
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.uploadedfile import TemporaryUplo... | gpl-2.0 |
SUNY-Albany-CCI/INF_202_Survey | languages/fr.py | 13 | 7668 | # coding: utf8
{
'!langcode!': 'fr',
'!langname!': 'Français',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression optionnelle comme "champ1=\'nouvellevaleur\'". Vous ne pouvez mettre à jour ou supprimer les résultats d\'un JOI... | apache-2.0 |
etkirsch/scikit-learn | examples/model_selection/grid_search_text_feature_extraction.py | 253 | 4158 | """
==========================================================
Sample pipeline for text feature extraction and evaluation
==========================================================
The dataset used in this example is the 20 newsgroups dataset which will be
automatically downloaded and then cached and reused for the do... | bsd-3-clause |
maxamillion/anaconda | pyanaconda/ui/gui/spokes/advstorage/iscsi.py | 3 | 19069 | # iSCSI configuration dialog
#
# Copyright (C) 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distribute... | gpl-2.0 |
gaperez64/acacia4aiger | source/acacia_plus/library_linker.py | 1 | 16085 | # This file is part of Acacia+, a tool for synthesis of reactive systems using antichain-based techniques
# Copyright (C) 2011-2013 UMONS-ULB
#
# 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; ei... | gpl-3.0 |
mbucas/python-route53 | doc_src/conf.py | 4 | 8017 | # -*- coding: utf-8 -*-
#
# python-route53 documentation build configuration file, created by
# sphinx-quickstart on Sun Nov 4 21:03:55 2012.
#
# 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.
... | mit |
karthiks1995/dejavu | dejavu/fingerprint.py | 15 | 5828 | import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from scipy.ndimage.filters import maximum_filter
from scipy.ndimage.morphology import (generate_binary_structure,
iterate_structure, binary_erosion)
import hashlib
from operator import itemgetter
IDX... | mit |
mdkent/percona-xtrabackup | test/kewpie/percona_tests/xtrabackup_disabled/ib_slave_test.py | 42 | 7074 | #! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2011 Patrick Crews
#
#
# 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 Softwar... | gpl-2.0 |
Callek/build-relengapi | relengapi/blueprints/slaveloan/tasks.py | 1 | 12195 | # 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 random
import socket
from furl import furl
import bzrest
import requests
from requests import RequestException... | mpl-2.0 |
VishvajitP/Django-facebook | docs/docs_env/Lib/encodings/mac_greek.py | 593 | 13977 | """ Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,err... | bsd-3-clause |
kaiweifan/neutron | neutron/plugins/nec/drivers/__init__.py | 9 | 1528 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NEC Corporation. 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.or... | apache-2.0 |
zhjunlang/kbengine | kbe/src/lib/python/Lib/tkinter/test/runtktests.py | 71 | 2271 | """
Use this module to get and run all tk tests.
tkinter tests should live in a package inside the directory where this file
lives, like test_tkinter.
Extensions also should live in packages following the same rule as above.
"""
import os
import sys
import unittest
import importlib
import test.support
this_dir_path ... | lgpl-3.0 |
lepisma/gaze | src/helper.py | 1 | 3299 | """
Helper functions
"""
import numpy as np
def xgrad(gray_image):
"""
Returns the X gradient of grayscale image,
imitating MatLab's gradient function
Parameters
----------
gray_image : numpy.ndarray
Grayscale image
Returns
-------
numpy.ndarray
X gradient of imag... | mit |
vinhlh/bite-project | deps/gdata-python-client/src/gdata/exif/__init__.py | 253 | 6981 | # -*-*- encoding: utf-8 -*-*-
#
# This is gdata.photos.exif, implementing the exif namespace in gdata
#
# $Id: __init__.py 81 2007-10-03 14:41:42Z havard.gulldahl $
#
# Copyright 2007 Håvard Gulldahl
# Portions copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not... | apache-2.0 |
SteveXiSong/UW-Madison-ECE757-S15-MulticastSnooping | src/cpu/kvm/X86KvmCPU.py | 54 | 2012 | # Copyright (c) 2013 Andreas Sandberg
# 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 fol... | bsd-3-clause |
liberorbis/libernext | apps/frappe/frappe/widgets/form/meta.py | 25 | 5903 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# metadata
from __future__ import unicode_literals
import frappe, os
from frappe.model.meta import Meta
from frappe.modules import scrub, get_module_path, load_doctype_module
from frappe.model.workflow import get_wo... | gpl-2.0 |
ashemedai/ansible | lib/ansible/modules/packaging/os/pkg5.py | 42 | 5050 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014 Peter Oliver <ansible@mavit.org.uk>
#
# 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 o... | gpl-3.0 |
douglaswei/stock | fxcm/prepare/parse.py | 1 | 2352 | # coding=utf-8
import struct
import time
import os, sys
def parse_hst_csv(src_path, des_path, time_from=None, time_to=None):
content = open(src_path, 'rb').read()
# 读取头文件结构信息
# 基础版本
print "basic verison: %i" % struct.unpack("i", content[0:4])[0]
# 版本信息
print "versoin: %s" % "".join(struct.unpack("64c"... | gpl-2.0 |
elit3ge/SickRage | lib/github/AuthenticatedUser.py | 70 | 46818 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Steve English <steve.english@navetas.com> #
# Copyright 2012 Vincent Jacques <vincent@vincent-ja... | gpl-3.0 |
fritsvanveen/QGIS | python/plugins/processing/algs/gdal/contour.py | 5 | 3823 | # -*- coding: utf-8 -*-
"""
***************************************************************************
contour.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander bruy at gmail dot com
*******************... | gpl-2.0 |
jofomah/rules | testpy/waltzdb.py | 1 | 50347 | from durable.lang import *
import math
import datetime
import json
_fact_count = 0
def create_and_post(host, fact):
global _fact_count
fact['id'] = _fact_count
fact['sid'] = 1
host.post('waltzdb', fact)
_fact_count += 1
def create_and_assert(host, fact):
global _fact_count
fact['id'] = _fa... | mit |
Leila20/django | tests/check_framework/test_security.py | 17 | 19560 | from django.conf import settings
from django.core.checks.security import base, csrf, sessions
from django.core.checks.utils import patch_middleware_message
from django.test import SimpleTestCase
from django.test.utils import override_settings
class CheckSessionCookieSecureTest(SimpleTestCase):
@property
def f... | bsd-3-clause |
kittiu/sale-workflow | sale_payment_term_interest/model/account_payment_term.py | 31 | 4714 | # -*- coding: utf-8 -*-
#
#
# Authors: Guewen Baconnier
# Copyright 2015 Camptocamp SA
#
# This program 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
# Licens... | agpl-3.0 |
jmehnle/ansible | lib/ansible/modules/cloud/ovirt/ovirt_networks.py | 15 | 9604 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# 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
#... | gpl-3.0 |
rjpower/spark | python/pyspark/files.py | 5 | 1885 | #
# 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... | apache-2.0 |
srsman/odoo | addons/account_payment/account_move_line.py | 241 | 4455 | # -*- 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 |
Andrei-Stepanov/avocado-vt | virttest/libvirt_xml/devices/interface.py | 12 | 9271 | """
interface device support class(es)
http://libvirt.org/formatdomain.html#elementsNICS
http://libvirt.org/formatnwfilter.html#nwfconceptsvars
"""
from virttest.libvirt_xml import accessors, xcepts
from virttest.libvirt_xml.devices import base, librarian
class Interface(base.TypedDeviceBase):
__slots__ = ('so... | gpl-2.0 |
Natim/sentry | src/sentry/migrations/0051_auto__del_pendingprojectmember__del_unique_pendingprojectmember_projec.py | 36 | 21164 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'PendingProjectMember', fields ['project', 'email']
db.delete_unique('sentry_pendi... | bsd-3-clause |
haarcuba/testix | test/test_argumentexpectations.py | 1 | 3090 | import hypothesis
import hypothesis.strategies as strategies
import pytest
from testix import fake
from testix import scenario
from testix import testixexception
from testix import argumentexpectations
class TestArgumentExpectations:
@hypothesis.given(A=strategies.integers(),B=strategies.integers())
def test_a... | mit |
kirti3192/spoken-website | cms/admin.py | 2 | 2857 | from django.template.defaultfilters import slugify
from django.contrib import admin
from cms.models import *
from django.conf import settings
from PIL import Image
import glob, os
from cms.forms import *
class SubNavInline(admin.TabularInline):
model = SubNav
extra = 0
class NavAdmin(admin.ModelAdmin):
li... | gpl-3.0 |
izelnakri/moses | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/buildbot/buildbot_run.py | 270 | 8338 | #!/usr/bin/env 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.
"""Argument-less script to select what to run on the buildbots."""
import filecmp
import os
import shutil
import subprocess
import sys
i... | mit |
somic/paasta | tests/cli/test_cmds_get_latest_deployment.py | 1 | 1863 | # Copyright 2015-2016 Yelp 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 in writin... | apache-2.0 |
sunyihuan326/DeltaLab | shuwei_fengge/practice_one/model/tt.py | 1 | 3958 | # coding:utf-8
'''
Created on 2017/12/8.
@author: chk01
'''
import scipy.io as scio
# data = scio.loadmat(file)
# from sklearn.model_selection import train_test_split
#
# print(data['X'].shape)
# print(data['Y'].shape)
# X_train, X_test, Y_train, Y_test = train_test_split(data['X'], data['Y'], test_size=0.2)
# print(... | mit |
huanchenz/STX-h-store | third_party/python/boto/ec2/autoscale/policy.py | 24 | 5549 | # Copyright (c) 2009-2010 Reza Lotun http://reza.lotun.name/
# Copyright (c) 2011 Jann Kleen
#
# 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 limitat... | gpl-3.0 |
ebar0n/django | django/contrib/postgres/validators.py | 87 | 2675 | from django.core.exceptions import ValidationError
from django.core.validators import (
MaxLengthValidator, MaxValueValidator, MinLengthValidator,
MinValueValidator,
)
from django.utils.deconstruct import deconstructible
from django.utils.translation import gettext_lazy as _, ngettext_lazy
class ArrayMaxLengt... | bsd-3-clause |
Hasimir/brython | www/src/Lib/test/test_sched.py | 23 | 6660 | #!/usr/bin/env python
import queue
import sched
import time
import unittest
from test import support
try:
import threading
except ImportError:
threading = None
TIMEOUT = 10
class Timer:
def __init__(self):
self._cond = threading.Condition()
self._time = 0
self._stop = 0
def ... | bsd-3-clause |
t794104/ansible | test/units/modules/network/junos/test_junos_command.py | 68 | 6199 | # (c) 2017 Red Hat Inc.
#
# 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 dis... | gpl-3.0 |
laayis/yowsup | yowsup/demos/echoclient/layer.py | 60 | 1646 | from yowsup.layers.interface import YowInterfaceLayer, ProtocolEntityCallback
class EchoLayer(YowInterfaceLayer):
@ProtocolEntityCallback("message")
def onMessage(self, messageProtocolEntity):
if messageProtocolEntity.getType() == 'text':
self.onTextMessage(messa... | gpl-3.0 |
dgarros/ansible | lib/ansible/modules/cloud/cloudstack/cs_portforward.py | 51 | 14301 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.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 version 3 of the Lice... | gpl-3.0 |
Sarah-Alsinan/muypicky | lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py | 320 | 103230 | # coding: utf-8
"""
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path opera... | mit |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/Django-1.6.10/tests/one_to_one_regress/tests.py | 107 | 8452 | from __future__ import absolute_import
from django.test import TestCase
from .models import Place, Restaurant, Bar, Favorites, Target, UndergroundBar
class OneToOneRegressionTests(TestCase):
def setUp(self):
self.p1 = Place(name='Demon Dogs', address='944 W. Fullerton')
self.p1.save()
s... | apache-2.0 |
fedral/ITK | Wrapping/Generators/Python/Tests/BinaryErodeImageFilter.py | 19 | 1673 | #!/usr/bin/env python
#==========================================================================
#
# Copyright Insight Software Consortium
#
# 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 Licen... | apache-2.0 |
2014c2g12/c2g12 | wsgi/exts/w2/static/Brython2.0.0-20140209-164925/Lib/reprlib.py | 923 | 5110 | """Redo the builtin repr() (representation) but with limits on most sizes."""
__all__ = ["Repr", "repr", "recursive_repr"]
import builtins
from itertools import islice
try:
from _thread import get_ident
except ImportError:
from _dummy_thread import get_ident
def recursive_repr(fillvalue='...'):
'Decorato... | gpl-2.0 |
timcera/mettoolbox | mettoolbox/pet.py | 1 | 10467 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import warnings
from typing import Optional, Union
import numpy as np
import pandas as pd
import typic
from solarpy import declination
from tstoolbox import tsutils
from . import meteolib, utils
warnings.filterwarnings("ignore... | bsd-3-clause |
Teamxrtc/webrtc-streaming-node | third_party/depot_tools/third_party/logilab/common/optparser.py | 92 | 3386 | # -*- coding: utf-8 -*-
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser Genera... | mit |
bob-the-hamster/commandergenius | project/jni/python/src/Lib/bsddb/dbrecio.py | 203 | 5308 |
"""
File-like objects that read from or write to a bsddb record.
This implements (nearly) all stdio methods.
f = DBRecIO(db, key, txn=None)
f.close() # explicitly release resources held
flag = f.isatty() # always false
pos = f.tell() # get current position
f.seek(pos) # set current position
... | lgpl-2.1 |
eckucukoglu/arm-linux-gnueabihf | arm-linux-gnueabihf/libc/usr/lib/python2.7/unittest/test/test_break.py | 105 | 9641 | import gc
import os
import sys
import signal
import weakref
from cStringIO import StringIO
import unittest
@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on f... | gpl-2.0 |
GaryBrittain/DB2S3 | process.py | 1 | 3210 | import dropbox
import sys
from sqlsync import *
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import os
from pushover import message
import json
if check_lock() == 1:
print 'Database is locked or unreachable, quitting...'
sys.exit()
conn = S3Connection('', '')
pb = conn.get_bucket('')
a... | mit |
yongtang/tensorflow | tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py | 14 | 6847 | # 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 applicable ... | apache-2.0 |
saydulk/horizon | openstack_dashboard/usage/views.py | 32 | 4722 | # 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... | apache-2.0 |
krahman/BuildingMachineLearningSystemsWithPython | ch04/build_lda.py | 1 | 2472 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
from __future__ import print_function
try:
import nltk.corpus
except ImportError:
print("nltk n... | mit |
point97/hapifis | server/apps/survey/migrations/0069_auto__add_field_response_answer_number.py | 1 | 15989 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Response.answer_number'
db.add_column(u'survey_response', 'answer_number',
... | gpl-3.0 |
nuagenetworks/vspk-python | vspk/v6/nuzfbrequest.py | 1 | 35457 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | bsd-3-clause |
os2webscanner/os2webscanner | scrapy-webscanner/scanners/rules/regexrule.py | 1 | 6057 | # The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"basis,
#... | mpl-2.0 |
magcius/dolphin | Tools/find-includes-cycles.py | 157 | 2630 | #! /usr/bin/env python
'''
Run this script from Source/Core/ to find all the #include cycles.
'''
import subprocess
def get_local_includes_for(path):
lines = open(path).read().split('\n')
includes = [l.strip() for l in lines if l.strip().startswith('#include')]
return [i.split()[1][1:-1] for i in include... | gpl-2.0 |
stevelle/glance | glance/registry/api/v2/__init__.py | 20 | 1125 | # Copyright 2013 Red Hat, 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... | apache-2.0 |
bolkedebruin/airflow | airflow/providers/docker/example_dags/example_docker_swarm_operator.py | 1 | 1606 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
mezz64/home-assistant | homeassistant/components/rpi_pfio/binary_sensor.py | 14 | 2527 | """Support for binary sensor using the PiFace Digital I/O module on a RPi."""
import voluptuous as vol
from homeassistant.components import rpi_pfio
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import CONF_NAME, DEVICE_DEFAULT_NAME
import homeassistant... | apache-2.0 |
geishatokyo-lightning/lightning | lightning_core/test/testvg.py | 1 | 5533 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011 Geisha Tokyo Entertainment, Inc.
#
# 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 witho... | mit |
glorizen/nupic | tests/integration/nupic/opf/opf_description_template_test/opf_description_template_test.py | 12 | 10082 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
fdzh/shadowsocks | shadowsocks/crypto/openssl.py | 1038 | 5414 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 ... | apache-2.0 |
MattDevo/edk2 | AppPkg/Applications/Python/Python-2.7.2/Lib/colorsys.py | 75 | 3847 | """Conversion functions between RGB and other color systems.
This modules provides two functions for each color system ABC:
rgb_to_abc(r, g, b) --> a, b, c
abc_to_rgb(a, b, c) --> r, g, b
All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a ... | bsd-2-clause |
srault95/netcall | examples/threading/server_threading_prefork.py | 1 | 3725 | #!/usr/bin/env python
# vim: fileencoding=utf-8 et ts=4 sts=4 sw=4 tw=0 fdm=indent
"""
A simple RPC server that shows how to:
* start several worker processes
* use zmq proxy device to load balance requests to the workers
* make each worker to serve multiple RPC services asynchronously
using the Python Threading mu... | bsd-3-clause |
flavoi/diventi | diventi/adventures/migrations/0017_auto_20200504_2229.py | 1 | 1287 | # Generated by Django 2.2.12 on 2020-05-04 20:29
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('adventures', '0016_auto_20200503_1924'),
]
operations = [
migrations.RemoveField(
model_name='... | apache-2.0 |
n3storm/django-dynamic-preferences | dynamic_preferences/models.py | 1 | 4395 | """
Preference models, queryset and managers that handle the logic for persisting preferences.
"""
from django.db import models
from django.db.models.query import QuerySet
from django.conf import settings
from django.utils.functional import cached_property
from dynamic_preferences import user_preferences_registry, gl... | bsd-3-clause |
nekulin/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/Demos/cerapi.py | 17 | 7436 | # A demo of the Windows CE Remote API
#
# This connects to a CE device, and interacts with it.
import wincerapi
import win32event
import win32api
import win32con
import os
import sys
import getopt
from repr import repr
def DumpPythonRegistry():
try:
h = wincerapi.CeRegOpenKeyEx(win32con.HKEY_LOCAL_MACHIN... | apache-2.0 |
AnishShah/tensorflow | tensorflow/contrib/boosted_trees/lib/learner/batch/categorical_split_handler_test.py | 2 | 22613 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.