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 |
|---|---|---|---|---|---|
petrus-v/odoo | addons/mail/static/scripts/openerp_mailgate.py | 316 | 7640 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-TODAY OpenERP S.A. (http://www.openerp.com)
#
# This program ... | agpl-3.0 |
rsampaio/twisted_tech_talk | twittytwister/streaming.py | 2 | 10071 | # -*- test-case-name: twittytwister.test.test_streaming -*-
#
# Copyright (c) 2010-2012 Ralph Meijer <ralphm@ik.nu>
# See LICENSE.txt for details
"""
Twitter Streaming API.
@see: U{http://dev.twitter.com/pages/streaming_api}.
"""
import simplejson as json
from twisted.internet import defer
from twisted.protocols.ba... | gpl-2.0 |
rafaeltomesouza/frontend-class1 | aula2/a11/linkedin/client/.gradle/yarn/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py | 1382 | 30567 | # Copyright (c) 2014 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.
"""
This script is intended for use as a GYP_GENERATOR. It takes as input (by way of
the generator flag config_path) the path of a json file that dictates the file... | mit |
Distrotech/intellij-community | python/helpers/pydev/_pydev_completer.py | 53 | 6928 | import pydevconsole
try:
import __builtin__
except ImportError:
import builtins as __builtin__
try:
False
True
except NameError: # version < 2.3 -- didn't have the True/False builtins
setattr(__builtin__, 'True', 1)
setattr(__builtin__, 'False', 0)
try:
import java.lang #@UnusedImport... | apache-2.0 |
tersmitten/ansible | lib/ansible/modules/windows/win_webpicmd.py | 52 | 1398 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Peter Mounce <public@neverrunwithscissors.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA ... | gpl-3.0 |
CMDann/oppia | core/domain/value_generators_domain_test.py | 34 | 1211 | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
daveferrara1/linkchecker | linkcheck/trace.py | 9 | 2961 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2000-2014 Bastian Kleineidam
#
# 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
# (at your option) any later versi... | gpl-2.0 |
rdo-management/heat | heat/api/openstack/v1/build_info.py | 7 | 1705 | #
# 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
# ... | apache-2.0 |
dgarros/ansible | contrib/inventory/ovirt.py | 117 | 9909 | #!/usr/bin/env python
# Copyright 2015 IIX 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 ver... | gpl-3.0 |
wujichang/linux | tools/perf/scripts/python/sctop.py | 1996 | 2102 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
callidus/PyKMIP | kmip/core/repo/mem_repo.py | 2 | 1646 | # Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | apache-2.0 |
logcabin/gtest | test/gtest_uninitialized_test.py | 2901 | 2480 | #!/usr/bin/env python
#
# Copyright 2008, 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... | bsd-3-clause |
programmernoob1/MeeT | authentication/views.py | 1 | 1857 | from django.shortcuts import render
from .forms import UserForm
from .nodes import UserNode
from django.http import HttpResponse,HttpResponseRedirect
from django.contrib.auth import authenticate,login,logout
from .models import UserProfile
# Create your views here.
def index(request):
context={}
if request.user... | apache-2.0 |
vicnet/weboob | weboob/core/requests.py | 2 | 1196 | # -*- coding: utf-8 -*-
# Copyright(C) 2016 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | lgpl-3.0 |
CapOM/ChromiumGStreamerBackend | tools/telemetry/third_party/modulegraph/modulegraph_tests/test_explicit_packages.py | 26 | 1643 | from __future__ import absolute_import
import unittest
import os, shutil, sys
from modulegraph import find_modules
from modulegraph import modulegraph
class PackagesTestCase (unittest.TestCase):
if not hasattr(unittest.TestCase, 'assertIsInstance'):
def assertIsInstance(self, object, types, message=None... | bsd-3-clause |
timothydmorton/bokeh | bokeh/server/configure.py | 29 | 5652 | from __future__ import absolute_import
import logging
from os.path import dirname
import imp
import sys
from six.moves.queue import Queue
from tornado.web import Application, FallbackHandler
from tornado.wsgi import WSGIContainer
from .settings import settings as server_settings
from . import websocket
##bokeh_app i... | bsd-3-clause |
underyx/ansible-modules-core | system/selinux.py | 33 | 6800 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Derek Carter<goozbach@friocorte.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 ... | gpl-3.0 |
cespare/pastedown | vendor/pygments/pygments/lexers/text.py | 3 | 65515 | # -*- coding: utf-8 -*-
"""
pygments.lexers.text
~~~~~~~~~~~~~~~~~~~~
Lexers for non-source code file types.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from bisect import bisect
from pygments.lexer import Lexer, LexerC... | mit |
jeffmacinnes/pyneal | src/pynealAnalysis.py | 1 | 6539 | """ Analysis Module for Pyneal Real-time Scan
These tools will set up and apply the specified analysis steps to incoming
volume data during a real-time scan
"""
import os
import sys
import logging
import importlib
import numpy as np
import nibabel as nib
class Analyzer:
""" Analysis Class
This is the mai... | mit |
michaelgallacher/intellij-community | python/helpers/profiler/thriftpy/transport/sslsocket.py | 32 | 4905 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import socket
import ssl
import struct
from ._ssl import (
create_thriftpy_context,
RESTRICTED_SERVER_CIPHERS,
DEFAULT_CIPHERS
)
from .socket import TSocket, TServerSocket
class TSSLSocket(TSocket):
"""SSL socket implementatio... | apache-2.0 |
Fluent-networks/floranet | floranet/models/config.py | 1 | 4494 | from twisted.internet.defer import inlineCallbacks, returnValue
from model import Model
from floranet.appserver.reflector import Reflector
from floranet.lora.bands import LoraBand
from floranet.util import validIPv4Address, validIPv6Address
class Config(Model):
"""NetServer Configuration model
Model repr... | mit |
moserand/crosswater | crosswater/routing_model/convert_hdf_tributaries.py | 1 | 3005 | """Convert the HDF5 from one group with one table per timestep into a table
with one group with one table per catchment.
This converter is for the aggregation per tribuary.
"""
import numpy as np
import tables
import fnmatch
from crosswater.read_config import read_config
from crosswater.tools.time_helper... | gpl-3.0 |
camradal/ansible | lib/ansible/utils/module_docs_fragments/dellos9.py | 42 | 3407 | #
# (c) 2015, Peter Sprygada <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell 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 Licens... | gpl-3.0 |
vasyarv/edx-platform | common/lib/xmodule/xmodule/partitions/tests/test_partitions.py | 9 | 15179 | """
Test the partitions and partitions service
"""
from unittest import TestCase
from mock import Mock
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from stevedore.extension import Extension, ExtensionManager
from xmodule.partitions.partitions import (
Group, UserPartition, UserPartitionError, No... | agpl-3.0 |
SDK/metadatachecker | sacm/utils.py | 1 | 14423 | __author__ = 'sdk'
from time import strftime, gmtime, mktime
import datetime
from xml.dom import minidom
import numpy as np
import cx_Oracle
from password import databaseSCO as database
import pandas as pd
pd.options.mode.chained_assignment = None
tables = {"ASDM": "XML_ASDM_ENTITIES", "Main": "XML_MAINTABLE_ENTITIES"... | mit |
captiosus/treadmill | treadmill/cli/identity_group.py | 2 | 2619 | """Treadmill Identity Group CLI
Create, delete and manage identity groups.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import logging
import click
from treadmill import cli
from treadmill import context
fro... | apache-2.0 |
pchickey/purple-ardupilot-mega | Tools/autotest/pysim/aircraft.py | 16 | 1723 | import math, util, rotmat
from rotmat import Vector3, Matrix3
class Aircraft(object):
'''a basic aircraft class'''
def __init__(self):
self.home_latitude = 0
self.home_longitude = 0
self.home_altitude = 0
self.ground_level = 0
self.frame_height = 0.0
self.latitu... | gpl-3.0 |
ric2b/Vivaldi-browser | chromium/tools/json_schema_compiler/feature_compiler.py | 1 | 29849 | # Copyright 2016 The Chromium 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 __future__ import print_function
import argparse
import copy
from datetime import datetime
from functools import partial
import os
import re
import sys... | bsd-3-clause |
acsone/sale-workflow | sale_order_line_description/models/sale.py | 22 | 2148 | # -*- coding: utf-8 -*-
#
#
# Copyright (C) 2013-15 Agile Business Group sagl
# (<http://www.agilebg.com>)
#
# 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 ... | agpl-3.0 |
joshbohde/scikit-learn | sklearn/utils/setup.py | 2 | 1398 | from os.path import join
from numpy.distutils.system_info import get_info, get_standard_file, \
BlasNotFoundError
def configuration(parent_package='', top_path=None):
import numpy
from numpy.distutils.misc_util import Configuration
config = Configuration('utils', parent_package, top_path)
confi... | bsd-3-clause |
asedunov/intellij-community | python/lib/Lib/distutils/command/install_scripts.py | 80 | 2183 | """distutils.command.install_scripts
Implements the Distutils 'install_scripts' command, for installing
Python scripts."""
# contributed by Bastian Kleineidam
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: install_scripts.py 37828 2004-11-10 22:23:15Z loewis $"
import os
from distuti... | apache-2.0 |
jjkoletar/panda3d | direct/src/http/linuxSystemInfo.py | 11 | 3369 | import sys
"""
Class to extract system information from a Linux Box via /proc
The following variables are accessable:
os
cpu
totalRAM
availableRAM
totalVM
availableVM
loadAvg
Example:
s = SystemInformation()
print s.os
s.refresh() # If you need to refresh the dynamic data
"""
class SystemInformation:
def __ini... | bsd-3-clause |
snpabilonia/rgims | modules/pygsm/prober.py | 62 | 1874 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
def probe(verbose=False):
"""Searches for probable ports on the system"""
import platform
from gsmmodem import GsmModem
import serial
# Common baudrates in approximate popularity order
baudrates = [115200, 9600, 19200]
ports ... | mit |
ThierryM/bCNC | bCNC/lib/midiparser.py | 4 | 8423 |
# Placed into Public Domain in June 2006 by Sean D. Spencer
# Sean D. Spencer
# sean_don4@lycos.com
# 2/19/2006
# Last Revision: 4/19/2007
# MIDI Parsing Library for Python.
TRUE = -1
FALSE = 0
class format:
SingleTrack = 0
MultipleTracksSync = 1
MultipleTracksAsync = 2
class voice:
NoteOff = 0x... | gpl-2.0 |
kuyagic/zhuaxia | zhuaxia/obj.py | 5 | 1716 | # -*- coding:utf-8 -*-
import time
import log, config, util
from os import path
LOG = log.get_logger("zxLogger")
Song_Type={0:'unknown',1:u"虾米", 2:"网易"}
class Handler(object):
"""
handler class encapsulate xiami or netease object
"""
def __init__(self, proxies = None):
self.proxies = proxie... | mit |
steebchen/youtube-dl | youtube_dl/extractor/tvland.py | 58 | 1411 | # coding: utf-8
from __future__ import unicode_literals
from .mtv import MTVServicesInfoExtractor
class TVLandIE(MTVServicesInfoExtractor):
IE_NAME = 'tvland.com'
_VALID_URL = r'https?://(?:www\.)?tvland\.com/(?:video-clips|(?:full-)?episodes)/(?P<id>[^/?#.]+)'
_FEED_URL = 'http://www.tvland.com/feeds/mr... | unlicense |
eadgarchen/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/bijectors/sigmoid_test.py | 72 | 2402 | # 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 |
wreckJ/intellij-community | plugins/hg4idea/testData/bin/hgext/convert/monotone.py | 94 | 12947 | # monotone.py - monotone support for the convert extension
#
# Copyright 2008, 2009 Mikkel Fahnoe Jorgensen <mikkel@dvide.com> and
# others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os, re
from mercurial import util... | apache-2.0 |
bmya/odoo-argentina | l10n_ar_afipws_fe/models/product_uom.py | 1 | 1487 | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, api, _
from odoo.exceptions import UserError
imp... | agpl-3.0 |
rwillmer/django | tests/shortcuts/tests.py | 199 | 5776 | from django.test import SimpleTestCase, ignore_warnings, override_settings
from django.test.utils import require_jinja2
from django.utils.deprecation import RemovedInDjango110Warning
@override_settings(
ROOT_URLCONF='shortcuts.urls',
)
class ShortcutTests(SimpleTestCase):
def test_render_to_response(self):
... | bsd-3-clause |
Immortalin/python-for-android | python3-alpha/python3-src/Tools/scripts/combinerefs.py | 97 | 4414 | #! /usr/bin/env python3
"""
combinerefs path
A helper for analyzing PYTHONDUMPREFS output.
When the PYTHONDUMPREFS envar is set in a debug build, at Python shutdown
time Py_Finalize() prints the list of all live objects twice: first it
prints the repr() of each object while the interpreter is still fully intact.
Af... | apache-2.0 |
listen-lavender/pholcus | gdc/model/data.py | 1 | 6120 | #!/usr/bin/env python
# coding=utf-8
import datetime
from setting import baseorm, dataorm
class MarkModel(dataorm.Model):
create_time = dataorm.DatetimeField(ddl='datetime', updatable=False)
update_time = dataorm.DatetimeField(ddl='timestamp')
tid = baseorm.IdField(unique='data', updatable=False)
def ... | mit |
HolgerPeters/scikit-learn | sklearn/decomposition/__init__.py | 66 | 1433 | """
The :mod:`sklearn.decomposition` module includes matrix decomposition
algorithms, including among others PCA, NMF or ICA. Most of the algorithms of
this module can be regarded as dimensionality reduction techniques.
"""
from .nmf import NMF, non_negative_factorization
from .pca import PCA, RandomizedPCA
from .incr... | bsd-3-clause |
tdtrask/ansible | contrib/inventory/zone.py | 196 | 1490 | #!/usr/bin/env python
# (c) 2015, Dagobert Michelsen <dam@baltic-online.de>
#
# 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 |
garwedgess/android_kernel_lge_g4 | Documentation/target/tcm_mod_builder.py | 2358 | 40707 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
sniperyen/MyDjango | Lib/djcelery/tests/test_snapshot.py | 3 | 7006 | from __future__ import absolute_import, unicode_literals
from datetime import datetime
from itertools import count
from time import time
from celery import states
from celery.events import Event as _Event
from celery.events.state import State, Worker, Task
from celery.utils import gen_unique_id
from djcelery import ... | apache-2.0 |
CydarLtd/ansible | lib/ansible/modules/cloud/amazon/cloudformation_facts.py | 39 | 11284 | #!/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 |
CydarLtd/ansible | lib/ansible/modules/network/nxos/nxos_command.py | 58 | 8491 | #!/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 distribut... | gpl-3.0 |
collective/eden | modules/tests/web2unittest.py | 20 | 42947 | # -*- coding: utf-8 -*-
""" Sahana Eden Test Framework
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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 with... | mit |
musicrighter/CIS422-P2 | env/lib/python3.4/site-packages/pip/req/req_file.py | 27 | 11764 | """
Requirements file parsing
"""
from __future__ import absolute_import
import os
import re
import shlex
import optparse
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves import filterfalse
import pip
from pip.download import get_file_content
from pip.req.req... | artistic-2.0 |
jayvdb/pywikibot-core | scripts/misspelling.py | 1 | 6985 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script fixes links that contain common spelling mistakes.
This is only possible on wikis that have a template for these misspellings.
Command line options:
-always:XY instead of asking the user what to do, always perform the same
action. For examp... | mit |
pabloborrego93/edx-platform | lms/djangoapps/course_structure_api/v0/views.py | 29 | 9535 | """ API implementation for course-oriented interactions. """
import logging
from django.conf import settings
from django.http import Http404
from rest_framework.authentication import SessionAuthentication
from rest_framework_oauth.authentication import OAuth2Authentication
from rest_framework.exceptions import Authen... | agpl-3.0 |
BizzCloud/PosBox | addons/hr_recruitment/report/__init__.py | 442 | 1107 | # -*- encoding: 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 |
fastinetserver/portage-idfetch | pym/portage/proxy/objectproxy.py | 2 | 2512 | # Copyright 2008-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import sys
__all__ = ['ObjectProxy']
class ObjectProxy(object):
"""
Object that acts as a proxy to another object, forwarding
attribute accesses and method calls. This can be useful
for implementing lazy i... | gpl-2.0 |
sounay/flaminggo-test | onadata/libs/utils/csv_import.py | 3 | 8924 | import cStringIO
import json
import unicodecsv as ucsv
import uuid
from celery import task
from celery import current_task
from celery.result import AsyncResult
from collections import defaultdict
from copy import deepcopy
from datetime import datetime
from django.contrib.auth.models import User
from onadata.libs.uti... | bsd-2-clause |
winglink/rectangle | Tools/scripts/add_git_hashes.py | 216 | 1614 | #!/usr/bin/env python
'''
Add git hashes to .px4 file for PX4/Pixhawk build
Written by Jon Challinger January 2015
'''
import json
import sys
import os
import subprocess
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('input_file')
parser.add_argument('output_file')
parser.add_argument('--ard... | gpl-3.0 |
ayumilong/rethinkdb | external/v8_3.30.33.16/build/gyp/test/actions/gyptest-generated-header.py | 187 | 1124 | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""
Verifies that dependencies on generated headers work, even if the header has
a mixed-case file name.
"""
import TestGyp
test = TestGyp... | agpl-3.0 |
sigmunau/nav | python/nav/metrics/graphs.py | 1 | 10406 | #
# Copyright (C) 2013 UNINETT
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope th... | gpl-2.0 |
takdavid/nltk-classifier-helpers | nltk_classifier_helpers/mixin.py | 1 | 2753 | import nltk
class DecisionTreeClassifierHelper :
""" Decorator object for DecisionTreeClassifier instances """
def __init__(self, classifier) :
self.classifier = classifier
classifier.pythoncode = self.pythoncode
classifier.pythonclasscode = self.pythonclasscode
def pythoncode(sel... | apache-2.0 |
switchboardOp/ansible | lib/ansible/modules/cloud/ovirt/ovirt_disks.py | 22 | 24794 | #!/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 |
AlCutter/certificate-transparency | python/ct/crypto/cert_test.py | 21 | 31087 | #!/usr/bin/env python
# coding=utf-8
import unittest
import time
from ct.crypto import cert
from ct.crypto import error
from ct.crypto.asn1 import oid
from ct.crypto.asn1 import x509_extension as x509_ext
from ct.crypto.asn1 import x509_name
from ct.test import test_config
class CertificateTest(unittest.TestCase):
... | apache-2.0 |
ljnutal6/media-recommend | app/virtualenvs/recommedia/lib/python2.7/site-packages/bson/__init__.py | 11 | 23058 | # Copyright 2009-2014 MongoDB, 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... | gpl-2.0 |
ibm-messaging/iot-python | test/test_gateway_messages.py | 2 | 4129 | # *****************************************************************************
# Copyright (c) 2019 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution,... | epl-1.0 |
mmottahedi/neuralnilm_prototype | scripts/e191.py | 2 | 6647 | from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import crossentropy, mse... | mit |
ragb/django-categories | categories/forms.py | 1 | 3741 | from django import forms
from django.db import transaction
from django.db.models import Q
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext as _
from categories.models import Category
class CategoryChoiceField(forms.ModelChoiceField):
"""
Field to select from a list... | lgpl-3.0 |
elastic-coders/aiohttp | examples/web_srv.py | 4 | 1706 | #!/usr/bin/env python3
"""Example for aiohttp.web basic server
"""
import asyncio
import textwrap
from aiohttp.web import Application, Response, StreamResponse
def intro(request):
txt = textwrap.dedent("""\
Type {url}/hello/John {url}/simple or {url}/change_body
in browser url bar
""").forma... | apache-2.0 |
NewpTone/stacklab-nova | debian/python-nova/usr/share/pyshared/nova/virt/libvirt/utils.py | 5 | 15402 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyrig... | apache-2.0 |
andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/matplotlib/backends/backend_gtk.py | 10 | 37753 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os, sys, warnings
def fn_name(): return sys._getframe(1).f_code.co_name
if six.PY3:
warnings.warn(
"The gtk* backends have not been tested with Python 3.x",
ImportWarning... | apache-2.0 |
Xion/callee | callee/types.py | 1 | 2697 | """
Type-related matchers.
"""
import inspect
from callee.base import BaseMatcher
__all__ = [
'InstanceOf', 'IsA', 'SubclassOf', 'Inherits', 'Type', 'Class',
]
class TypeMatcher(BaseMatcher):
"""Matches an object to a type.
This class shouldn't be used directly.
"""
def __init__(self, type_):
... | bsd-3-clause |
GaZ3ll3/scikit-image | skimage/color/adapt_rgb.py | 38 | 2431 | import functools
import numpy as np
from .. import color
from ..util.dtype import convert
__all__ = ['adapt_rgb', 'hsv_value', 'each_channel']
def is_rgb_like(image):
"""Return True if the image *looks* like it's RGB.
This function should not be public because it is only intended to be used
for funct... | bsd-3-clause |
ksachs/invenio | modules/websubmit/lib/wsm_pdftk_plugin.py | 35 | 7328 | ## This file is part of Invenio.
## Copyright (C) 2010, 2011 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) any later version.
##
... | gpl-2.0 |
juanchodepisa/sbtk | SBTK_League_Helper/src/tools/seeders.py | 1 | 1841 | from random import shuffle, sample
###########################
# ZIG-ZAG
# SEEDERS
###########################
# Fair at the top
def snake_generator(players, groups):
step = 1
limits = {-1: 0 , 1: groups-1}
n = 0
while players > 0:
players -= 1
yield n
if n == limits[step]:
... | mit |
ojengwa/grr | lib/flows/general/audit.py | 1 | 1610 | #!/usr/bin/env python
"""This implements the auditing system.
How does it work?
Noteworthy events within the GRR system (such as approval granting, flow
execution etc) generate events to notify listeners about the event.
The audit system consists of a group of event listeners which receive these
events and act upon ... | apache-2.0 |
Appdynamics/python-webappman | webappman/drupal.py | 1 | 22220 | #coding: utf-8
"""For Drupal site deployment and management"""
from __future__ import print_function
from bs4 import BeautifulSoup as Soup
try:
from http.cookiejar import CookieJar
except ImportError:
from cookielib import CookieJar
from os import remove as rm
from os.path import isdir, join as path_join, real... | mit |
mattaw/SoCFoundationFlow | admin/waf/waf-1.8.19/waflib/extras/dcc.py | 5 | 1913 | #!/usr/bin/env python
# encoding: utf-8
# Jérôme Carretero, 2011 (zougloub)
from waflib import Options
from waflib.Tools import ccroot
from waflib.Configure import conf
@conf
def find_dcc(conf):
conf.find_program(['dcc'], var='CC', path_list=getattr(Options.options, 'diabbindir', ""))
conf.env.CC_NAME = 'dcc'
@con... | apache-2.0 |
sumpfgottheit/pdu1800_data_provider | pygame32/pygame/tests/compat_test.py | 15 | 3405 | import sys
if __name__ == '__main__':
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.split(parent_dir)[1] == 'pygame')
if not is_pygame_pkg:
sys.path.insert(0,... | mit |
derekjchow/models | research/deeplab/core/resnet_v1_beta_test.py | 3 | 11454 | # 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 applicab... | apache-2.0 |
ryan-talley/f5-cccl | f5_cccl/resource/ltm/monitor/test/test_tcp_monitor.py | 1 | 2643 | #!/usr/bin/env python
# Copyright (c) 2017,2018, F5 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 app... | apache-2.0 |
dgzurita/odoo | addons/event/event.py | 224 | 18601 | # -*- 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 |
DaniilLeksin/gc | wx/tools/Editra/src/syntax/_s.py | 3 | 12071 | ###############################################################################
# Name: s.py #
# Purpose: Define S and R syntax for highlighting and other features #
# Author: Cody Precord <cprecord@editra.org> #
... | apache-2.0 |
AthinaB/synnefo | snf-webproject/docs/conf.py | 9 | 2019 | import sys, os
sys.path.insert(0, os.path.abspath('../'))
from synnefo.versions.webproject import __version__
project = u'snf-webproject'
copyright = u'2012-2013, GRNET'
version = __version__
release = __version__
html_title = 'synnefo ' + version
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = '... | gpl-3.0 |
hellfish2/treeio | core/sanitizer.py | 3 | 18217 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
import re
from xml.sax.saxutils import escape, unescape
import html5lib
from html5lib import treebuilders, treewalkers, serializer
from html5lib.tokenizer import HTMLTokenizer
from html5lib.constants import ... | mit |
larsmans/scikit-learn | examples/decomposition/plot_ica_vs_pca.py | 43 | 3343 | """
==========================
FastICA on 2D point clouds
==========================
This example illustrates visually in the feature space a comparison by
results using two different component analysis techniques.
:ref:`ICA` vs :ref:`PCA`.
Representing ICA in the feature space gives the view of 'geometric ICA':
ICA... | bsd-3-clause |
monetate/sqlalchemy | test/orm/test_bundle.py | 3 | 16644 | from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import Integer
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy import tuple_
from sqlalchemy.orm import aliased
from sqlalchemy.orm import Bundle
from sqlal... | mit |
morphis/home-assistant | tests/components/automation/test_time.py | 7 | 13049 | """The tests for the time automation."""
from datetime import timedelta
import unittest
from unittest.mock import patch
from homeassistant.core import callback
from homeassistant.setup import setup_component
import homeassistant.util.dt as dt_util
import homeassistant.components.automation as automation
from tests.co... | apache-2.0 |
WASPACDC/hmdsm.repository | plugin.video.mrpiracy/resources/lib/js2py/__init__.py | 21 | 2838 | # The MIT License
#
# Copyright 2014, 2015 Piotr Dabkowski
#
# 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, modif... | gpl-2.0 |
stan-dev/math | lib/benchmark_1.5.1/googletest/googletest/test/googletest-uninitialized-test.py | 95 | 2474 | #!/usr/bin/env python
#
# Copyright 2008, 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... | bsd-3-clause |
Edwardro22/cgrates | cmd/cgr-tester/cdr_repl/post_server.py | 10 | 1523 | """
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH
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 y... | gpl-3.0 |
willthames/ansible | lib/ansible/modules/utilities/logic/set_fact.py | 13 | 2883 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Dag Wieers <dag@wieers.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 Lice... | gpl-3.0 |
brammittendorff/PF_RING | linux-3.16.7-ckt9/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | lgpl-2.1 |
beblount/Steer-Clear-Backend-Web | env/Lib/site-packages/pip/utils/appdirs.py | 311 | 9173 | """
This code was taken from https://github.com/ActiveState/appdirs and modified
to suite our purposes.
"""
from __future__ import absolute_import
import os
import sys
from pip.compat import WINDOWS
def user_cache_dir(appname):
r"""
Return full path to the user-specific cache dir for this application.
... | mit |
nirmeshk/oh-mainline | vendor/packages/Django/django/contrib/admin/actions.py | 101 | 3193 | """
Built-in, globally-available admin actions.
"""
from django.core.exceptions import PermissionDenied
from django.contrib.admin import helpers
from django.contrib.admin.util import get_deleted_objects, model_ngettext
from django.db import router
from django.template.response import TemplateResponse
from django.utils... | agpl-3.0 |
mikesname/sqlalchemy-qubit | sqlaqubit/test.py | 1 | 5655 | """
SQLAlchemy-Qubit test suite.
"""
import unittest
import tempfile
# turn of warnings we don't care about
import warnings
from sqlalchemy import func, exc as sa_exc
from sqlaqubit import models, keys, load_test_sql, create_engine, init_models
class InformationObjectTest(unittest.TestCase):
def setUp(self):
... | gpl-2.0 |
igors10099/ilona | p2pool/bitcoin/data.py | 35 | 9709 | from __future__ import division
import hashlib
import random
import p2pool
from p2pool.util import math, pack
def hash256(data):
return pack.IntType(256).unpack(hashlib.sha256(hashlib.sha256(data).digest()).digest())
def hash160(data):
if data == '04ffd03de44a6e11b9917f3a29f9443283d9871c9d743ef30d5eddcd3709... | gpl-3.0 |
SauloAislan/ironic | ironic/tests/unit/drivers/modules/ilo/test_inspect.py | 2 | 22118 | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 applicabl... | apache-2.0 |
ramanajee/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/newstringio.py | 132 | 1757 | # Copyright (C) 2010 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 ... | bsd-3-clause |
Weicong-Lin/pymo-global | android/pgs4a-0.9.6/python-install/lib/python2.7/idlelib/keybindingDialog.py | 89 | 12407 | """
Dialog for building Tkinter accelerator key bindings
"""
from Tkinter import *
import tkMessageBox
import string
class GetKeysDialog(Toplevel):
def __init__(self,parent,title,action,currentKeySequences):
"""
action - string, the name of the virtual event these keys will be
mapp... | mit |
BT-rmartin/odoo | addons/point_of_sale/account_bank_statement.py | 313 | 2159 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free... | agpl-3.0 |
ddipp/Euler_solutions | p011.py | 1 | 1522 | #!/usr/bin/env python3
# ==============================================================================
# In the 20×20 grid below, four numbers along a diagonal line have been marked
# in red.
#
# ... in p011.txt ...
#
# The product of these numbers is 26 × 63 × 78 × 14 = 1788696.
#
# What is the greatest product of f... | gpl-2.0 |
caidongyun/pylearn2 | pylearn2/scripts/dbm/show_negative_chains.py | 37 | 2849 | #!/usr/bin/env python
"""
Usage: python show_negative_chains.py <path_to_a_saved_DBM.pkl>
Show negative chains of a saved DBM model.
"""
from __future__ import print_function
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-claus... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.