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
odooindia/odoo
addons/base_action_rule/base_action_rule.py
12
15745
# -*- 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
Yannig/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_inventory.py
15
5168
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1...
gpl-3.0
nicebug/SuckerTest
web/wsgiserver/ssl_pyopenssl.py
177
9605
"""A library for integrating pyOpenSSL with CherryPy. The OpenSSL module must be importable for SSL functionality. You can obtain it from http://pyopenssl.sourceforge.net/ To use this module, set CherryPyWSGIServer.ssl_adapter to an instance of SSLAdapter. There are two ways to use SSL: Method One ---------- * ``s...
mit
scorphus/passpie
passpie/database.py
2
4638
from datetime import datetime import logging import os import shutil from tinydb import TinyDB, Storage, where, Query import yaml from .utils import mkdir_open from .history import Repository from .credential import split_fullname, make_fullname class PasspieStorage(Storage): extension = ".pass" def __init...
mit
bharatsingh430/py-R-FCN-multiGPU
lib/datasets/voc_eval.py
12
6938
# -------------------------------------------------------- # Fast/er R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Bharath Hariharan # -------------------------------------------------------- import xml.etree.ElementTree as ET import os import cPickle import numpy as np def parse_rec(f...
mit
SnappleCap/oh-mainline
vendor/packages/gdata/src/gdata/alt/appengine.py
77
11666
#!/usr/bin/python # # Copyright (C) 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
agpl-3.0
JKatzwinkel/mps-youtube
mps_youtube/c.py
1
1141
""" Module for holding colour code values. """ import os import re import sys try: # pylint: disable=F0401 from colorama import Fore, Style has_colorama = True except ImportError: has_colorama = False mswin = os.name == "nt" if mswin and has_colorama: white = Style.RESET_ALL ul = Style.DIM...
gpl-3.0
b0ttl3z/SickRage
lib/twilio/rest/resources/recordings.py
23
1755
from .util import normalize_dates from .transcriptions import Transcriptions from .base import InstanceResource, ListResource class Recording(InstanceResource): subresources = [Transcriptions] def __init__(self, *args, **kwargs): super(Recording, self).__init__(*args, **kwargs) self.formats...
gpl-3.0
mhbu50/erpnext
erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py
3
1463
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from erpnext.crm.report.campaign_efficiency.campaign_efficiency import get_lead_data def execute(filters=None): columns, da...
gpl-3.0
craynot/django
tests/custom_pk/models.py
282
1272
# -*- coding: utf-8 -*- """ Using a custom primary key By default, Django adds an ``"id"`` field to each model. But you can override this behavior by explicitly adding ``primary_key=True`` to a field. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_...
bsd-3-clause
boshnivolo/TIY-Assignments
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/input_test.py
1841
3207
#!/usr/bin/env python # Copyright 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. """Unit tests for the input.py file.""" import gyp.input import unittest import sys class TestFindCycles(unittest.TestCase): def setUp(self...
cc0-1.0
nirmeshk/oh-mainline
vendor/packages/gdata/src/gdata/tlslite/TLSConnection.py
278
70347
""" MAIN CLASS FOR TLS LITE (START HERE!). """ from __future__ import generators import socket from utils.compat import formatExceptionTrace from TLSRecordLayer import TLSRecordLayer from Session import Session from constants import * from utils.cryptomath import getRandomBytes from errors import * from messages impor...
agpl-3.0
dgellis90/nipype
nipype/interfaces/semtools/registration/tests/test_auto_BRAINSDemonWarp.py
24
3971
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from .....testing import assert_equal from ..specialized import BRAINSDemonWarp def test_BRAINSDemonWarp_inputs(): input_map = dict(args=dict(argstr='%s', ), arrayOfPyramidLevelIterations=dict(argstr='--arrayOfPyramidLevelIterations %s', sep=',', ...
bsd-3-clause
azumimuo/family-xbmc-addon
plugin.video.exodus/resources/lib/sources/tunemovie.py
7
6553
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 l...
gpl-2.0
rwatson/chromium-capsicum
third_party/scons/scons-local/SCons/Tool/lex.py
3
3285
"""SCons.Tool.lex Tool-specific initialization for lex. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permiss...
bsd-3-clause
czchen/debian-pgcli
pgcli/packages/expanded.py
2
1174
from .tabulate import _text_type def pad(field, total, char=u" "): return field + (char * (total - len(field))) def get_separator(num, header_len, data_len): total_len = header_len + data_len + 1 sep = u"-[ RECORD {0} ]".format(num) if len(sep) < header_len: sep = pad(sep, header_len - 1, u"-...
bsd-3-clause
spadae22/odoo
addons/procurement/__openerp__.py
267
2661
# -*- 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
LuqueDaniel/ninja-ide
ninja_ide/gui/editor/checkers/__init__.py
7
1735
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE 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 # any later version. # # NIN...
gpl-3.0
primoz-k/cookiecutter-django
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/contrib/sites/migrations/0001_initial.py
348
1025
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.sites.models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Site', fields=[ ...
bsd-3-clause
slightlymadphoenix/activityPointsApp
activitypoints/lib/python3.5/site-packages/django/db/backends/mysql/base.py
44
16091
""" MySQL database backend for Django. Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/ MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python """ from __future__ import unicode_literals import datetime import re import sys import warnings from django.conf import settings...
mit
resmo/ansible
test/units/modules/network/onyx/test_onyx_ospf.py
68
4494
# # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.onyx impor...
gpl-3.0
moreati/django-allauth
allauth/socialaccount/providers/twitch/views.py
62
1037
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from .provider import TwitchProvider class TwitchOAuth2Adapter(OAuth2Adapt...
mit
papaloizouc/battlehack2014
website/spameggs/spameggs/settings.py
1
2945
""" Django settings for spameggs project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) i...
gpl-2.0
sugarlabs/sugar
src/jarabe/model/notifications.py
4
4491
# Copyright (C) 2008 One Laptop Per Child # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distribu...
gpl-3.0
giorgiop/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py
73
2264
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
sarakha63/persomov
libs/git/ref.py
110
2981
# Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com> # 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 li...
gpl-3.0
RevolutionMC/Revolution
plugin.video.PsychoTV/resources/lib/libraries/f4mproxy/f4mDownloader.py
55
38147
import xml.etree.ElementTree as etree import base64 from struct import unpack, pack import sys import io import os import time import itertools import xbmcaddon import xbmc import urllib2,urllib import traceback import urlparse import posixpath import re import hmac import hashlib import binascii import zlib from hash...
gpl-2.0
bzennn/blog_flask
python/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py
354
5544
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
gpl-3.0
chys87/pyCxxLookup
cxxlookup/expr.py
1
28952
#!/usr/bin/env python3 # vim: set ts=4 sts=4 sw=4 expandtab cc=80: # Copyright (c) 2014, 2016, chys <admin@CHYS.INFO> # 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 sour...
bsd-3-clause
crosswalk-project/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_ro_style-src_cross-origin.py
23
3064
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "style-src " + url1 ...
bsd-3-clause
liuwenf/moose
framework/contrib/nsiqcppstyle/rules/RULE_4_1_A_A_use_tab_for_indentation.py
43
1770
""" Use tabs for indentation. This rule check if the each line starts with a space. In addition, it suppresses the violation when the line contains only spaces and tabs. == Violation == void Hello() { [SPACE][SPACE]Hello(); <== Violation. Spaces are used for indentation. } == Good == void Hello()...
lgpl-2.1
Omegaphora/external_deqp
android/scripts/common.py
6
5274
# -*- coding: utf-8 -*- import os import re import sys import shlex import subprocess import multiprocessing class NativeLib: def __init__ (self, apiVersion, abiVersion): self.apiVersion = apiVersion self.abiVersion = abiVersion def getPlatform (): if sys.platform.startswith('linux'): return 'linux' else: ...
apache-2.0
Nikoala/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/vidme.py
36
2580
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, str_to_int, ) class VidmeIE(InfoExtractor): _VALID_URL = r'https?://vid\.me/(?:e/)?(?P<id>[\da-zA-Z]+)' _TEST = { 'url': 'https://vid.me/QNB', 'md...
gpl-3.0
lseyesl/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/comments.py
148
2030
# Copyright (c) 2009 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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...
bsd-3-clause
Daksh/sugar-toolkit-gtk3
src/sugar3/graphics/palettemenu.py
2
7416
# Copyright 2012 One Laptop Per Child # # 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 version. # # This program is distributed ...
lgpl-2.1
Vixionar/django
tests/forms_tests/widget_tests/test_selectmultiple.py
145
4951
from django.forms import SelectMultiple from .base import WidgetTest class SelectMultipleTest(WidgetTest): widget = SelectMultiple() numeric_choices = (('0', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('0', 'extra')) def test_render_selected(self): self.check_html(self.widget, 'beatles', ['J'], c...
bsd-3-clause
wzbozon/statsmodels
statsmodels/sandbox/km_class.py
31
11748
#a class for the Kaplan-Meier estimator from statsmodels.compat.python import range import numpy as np from math import sqrt import matplotlib.pyplot as plt class KAPLAN_MEIER(object): def __init__(self, data, timesIn, groupIn, censoringIn): raise RuntimeError('Newer version of Kaplan-Meier class available...
bsd-3-clause
pdellaert/ansible
contrib/vault/azure_vault.py
37
23745
#!/usr/bin/env python # # This script borrows a great deal of code from the azure_rm.py dynamic inventory script # that is packaged with Ansible. This can be found in the Ansible GitHub project at: # https://github.com/ansible/ansible/blob/devel/contrib/inventory/azure_rm.py # # The Azure Dynamic Inventory script was ...
gpl-3.0
ypu/tp-qemu
qemu/tests/timerdevice_tscwrite.py
3
1850
import logging from autotest.client.shared import error from autotest.client import utils @error.context_aware def run(test, params, env): """ Timer device tscwrite test: 1) Check for an appropriate clocksource on host. 2) Boot the guest. 3) Download and compile the newest msr-tools. 4) Execu...
gpl-2.0
timcera/hspfbintoolbox
tests/test_catalog.py
1
115314
# -*- coding: utf-8 -*- """ catalog ---------------------------------- Tests for `hspfbintoolbox` module. """ import csv import shlex import subprocess import sys from unittest import TestCase from pandas.testing import assert_frame_equal try: from cStringIO import StringIO except: from io import StringIO ...
bsd-3-clause
rossburton/yocto-autobuilder
lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/process/users/manual.py
4
9675
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
jaap-karssenberg/zim-desktop-wiki
zim/gui/templateeditordialog.py
1
6069
# Copyright 2012 Jaap Karssenberg <jaap.karssenberg@gmail.com> from gi.repository import Gtk from zim.newfs import LocalFile from zim.newfs.helpers import TrashHelper, TrashNotSupportedError from zim.config import XDG_DATA_HOME, data_file from zim.templates import list_template_categories, list_templates from zim.g...
gpl-2.0
joeythesaint/yocto-autobuilder
lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/test/test_dirdbm.py
41
5859
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for dirdbm module. """ import os, shutil, glob from twisted.trial import unittest from twisted.persisted import dirdbm class DirDbmTestCase(unittest.TestCase): def setUp(self): self.path = self.mktemp() sel...
gpl-2.0
colinnewell/odoo
addons/website/tests/test_crawl.py
251
3415
# -*- coding: utf-8 -*- import logging import urlparse import time import lxml.html import openerp import re _logger = logging.getLogger(__name__) class Crawler(openerp.tests.HttpCase): """ Test suite crawling an openerp CMS instance and checking that all internal links lead to a 200 response. If a use...
agpl-3.0
drduh/config
lighttpd/upload.py
1
1501
#!/usr/bin/env python3 # https://github.com/drduh/config/blob/master/lighttpd/upload.py # Simple file uploader # Put into /var/www/cgi-bin/, make executable and enable CGI import cgi import os CHUNK_SIZE = 100000 UPLOAD = "/var/www/upload/" HEADER = """ <html><head><title>%s</title> <style type="text/css"> body { ...
mit
switowski/invenio
invenio/legacy/ckeditor/connector.py
13
5954
# -*- coding: utf-8 -*- # Comments and reviews for records. # This file is part of Invenio. # Copyright (C) 2008, 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 ...
gpl-2.0
Lcaracol/ideasbox.lan
ideasbox/library/models.py
1
3341
from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.utils.translation import ugettext_lazy as _ from taggit.managers import TaggableManager from ideasbox.models import TimeStampedModel from ideasbox.search.models import SearchableQuerySet, SearchMixin...
mit
nvoron23/socialite
test/test_attrs.py
3
1423
""" Testing attribute/function access in a query. """ import unittest class TesetAttrs(unittest.TestCase): def __init__(self, methodName='runTest'): unittest.TestCase.__init__(self, methodName) `Foo(int i, Avg avg) groupby(1). Bar(int i).` def setUp(self): `clear Foo. ...
apache-2.0
joshwalawender/POCS
pocs/scheduler/field.py
2
1797
from astroplan import FixedTarget from astropy.coordinates import SkyCoord from pocs import PanBase class Field(FixedTarget, PanBase): def __init__(self, name, position, equinox='J2000', **kwargs): """ An object representing an area to be observed A `Field` corresponds to an `~astroplan.Observi...
mit
rdblue/Impala
testdata/bin/wait-for-hiveserver2.py
14
3445
#!/usr/bin/env impala-python # Copyright (c) 2012 Cloudera, 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...
apache-2.0
emfcamp/micropython
tests/basics/int1.py
44
1559
print(int(False)) print(int(True)) print(int(0)) print(int(1)) print(int(+1)) print(int(-1)) print(int('0')) print(int('+0')) print(int('-0')) print(int('1')) print(int('+1')) print(int('-1')) print(int('01')) print(int('9')) print(int('10')) print(int('+10')) print(int('-10')) print(int('12')) print(int('-12')) prin...
mit
skuda/client-python
kubernetes/client/models/apps_v1beta1_deployment_strategy.py
1
4125
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
kennedyshead/home-assistant
homeassistant/components/vultr/sensor.py
5
3249
"""Support for monitoring the state of Vultr Subscriptions.""" import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import CONF_MONITORED_CONDITIONS, CONF_NAME, DATA_GIGABYTES import homeassistant.helpers.config_validation as cv fr...
apache-2.0
sf-wind/caffe2
caffe2/python/caffe_translator.py
3
35395
# Copyright (c) 2016-present, Facebook, 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...
apache-2.0
linked67/p2pool-kryptonite
p2pool/bitcoin/sha256.py
285
3084
from __future__ import division import struct k = [ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0...
gpl-3.0
Ormod/Diamond
src/collectors/interrupt/soft.py
54
2024
# coding=utf-8 """ The SoftInterruptCollector collects metrics on software interrupts from /proc/stat #### Dependencies * /proc/stat """ import platform import os import diamond.collector # Detect the architecture of the system # and set the counters for MAX_VALUES # appropriately. Otherwise, rolling over # coun...
mit
louietsai/python-for-android
python3-alpha/python3-src/Lib/idlelib/configHandler.py
48
28730
"""Provides access to stored IDLE configuration information. Refer to the comments at the beginning of config-main.def for a description of the available configuration files and the design implemented to update user configuration information. In particular, user configuration choices which duplicate the defaults will...
apache-2.0
ASlave2Audio/Restaurant-App
mingw/bin/lib/lib2to3/pytree.py
325
29039
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """ Python parse tree definitions. This is a very concrete parse tree; we need to keep every token and even the comments and whitespace between tokens. There's also a pattern matching implementation here. """ __autho...
mit
ryfeus/lambda-packs
Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/opt/python/training/nadam_optimizer.py
57
4017
# Copyright 2015 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...
mit
partofthething/home-assistant
homeassistant/components/hlk_sw16/switch.py
16
1200
"""Support for HLK-SW16 switches.""" from homeassistant.components.switch import ToggleEntity from . import DATA_DEVICE_REGISTER, SW16Device from .const import DOMAIN PARALLEL_UPDATES = 0 def devices_from_entities(hass, entry): """Parse configuration and add HLK-SW16 switch devices.""" device_client = hass....
mit
srom/chessbot
estimator/train/parse_logs/__main__.py
1
1947
from __future__ import unicode_literals import argparse import logging import re logger = logging.getLogger(__name__) def main(log_path): for log_line in yield_train_log_line(log_path): print log_line break class TrainLogLine(object): __slots__ = ('iteration', 'elapsed', 'test_loss', 'tra...
mit
feigames/Odoo
openerp/models.py
3
277182
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
pahans/nototools
third_party/spiro/curves/polymat-bad.py
15
1664
from Numeric import * import LinearAlgebra as la import sys n = 15 m = zeros(((n + 1) * 4, (n + 1) * 4), Float) for i in range(n): m[4 * i + 2][4 * i + 0] = .5 m[4 * i + 2][4 * i + 1] = -1./12 m[4 * i + 2][4 * i + 2] = 1./48 m[4 * i + 2][4 * i + 3] = -1./480 m[4 * i + 2][4 * i + 4] = .5 m[4 * i...
apache-2.0
janusnic/dj-21v
unit_10/mysite/userprofiles/utils.py
6
2613
from django.core.exceptions import ImproperlyConfigured # -*- coding: utf-8 -*- import functools try: import urlparse except ImportError: from urllib import parse as urlparse # python3 support from django.core.exceptions import SuspiciousOperation def default_redirect(request, fallback_url, **kwargs): """ E...
mit
varunarya10/python-glanceclient
glanceclient/common/https.py
3
11205
# Copyright 2014 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
amenonsen/ansible
lib/ansible/modules/network/fortios/fortios_vpn_certificate_ocsp_server.py
14
11082
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
remh/dd-agent
checks.d/vsphere.py
27
33304
# stdlib from copy import deepcopy from datetime import datetime, timedelta from hashlib import md5 from Queue import Empty, Queue import re import time import traceback # 3p from pyVim import connect from pyVmomi import vim # project from checks import AgentCheck from checks.libs.thread_pool import Pool from checks....
bsd-3-clause
openstack/ironic
ironic/objects/port.py
1
23131
# coding=utf-8 # # # 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 writi...
apache-2.0
pforret/python-for-android
python-build/python-libs/gdata/build/lib/gdata/apps/service.py
136
16595
#!/usr/bin/python # # Copyright (C) 2007 SIOS Technology, 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 appli...
apache-2.0
talbarda/kaggle_predict_house_prices
Build Model.py
1
2629
import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np import pandas as pd import sklearn.linear_model as lm from sklearn.model_selection import learning_curve from sklearn.metrics import accuracy_score from sklearn.metrics import make_scorer from sklearn.model_selection import Grid...
mit
XueqingLin/tensorflow
tensorflow/python/training/proximal_gradient_descent.py
33
3580
# Copyright 2015 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
tanium/pytan
lib/libs_external/any/urllib3/filepost.py
292
2321
from __future__ import absolute_import import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarrassingly-simple replacement for mimetools.choose_...
mit
Danielhiversen/home-assistant
homeassistant/components/switch/anel_pwrctrl.py
8
3373
""" Support for ANEL PwrCtrl switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.pwrctrl/ """ import logging import socket from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from hom...
mit
oopy/micropython
docs/sphinx_selective_exclude/search_auto_exclude.py
40
1397
# # This is a Sphinx documentation tool extension which allows to # automatically exclude from full-text search index document # which are not referenced via toctree::. It's intended to be # used with toctrees conditional on only:: directive, with the # idea being that if you didn't include it in the ToC, you don't # w...
mit
Workday/OpenFrame
tools/json_schema_compiler/highlighters/pygments_highlighter.py
179
1273
# Copyright (c) 2012 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. import sys try: import pygments from pygments.lexers import CppLexer from pygments.formatters import HtmlFormatter PYGMENTS_IMPORTED = True excep...
bsd-3-clause
Poles/Poles
platforms/windows/JsonCpp/scons-local-2.3.0/SCons/Tool/BitKeeper.py
11
2498
"""SCons.Tool.BitKeeper.py Tool-specific initialization for the BitKeeper source code control system. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 200...
gpl-3.0
SaschaMester/delicium
tools/perf/page_sets/mse_cases.py
1
2010
# Copyright 2014 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 telemetry.page import page as page_module from telemetry import story class MseCasesPage(page_module.Page): def __init__(self, url, page_set): s...
bsd-3-clause
RPGOne/scikit-learn
sklearn/externals/funcsigs.py
118
29982
# Copyright 2001-2013 Python Software Foundation; All Rights Reserved """Function signature objects for callables Back port of Python 3.3's function signature tools from the inspect module, modified to be compatible with Python 2.6, 2.7 and 3.2+. """ from __future__ import absolute_import, division, print_function imp...
bsd-3-clause
RNAcentral/rnacentral-import-pipeline
rnacentral_pipeline/cli/rfam.py
1
2267
# -*- coding: utf-8 -*- """ Copyright [2009-2018] EMBL-European Bioinformatics Institute 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
Maikflow/django_test
lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/utils/dates.py
115
2296
"Commonly-used date structures" from django.utils.translation import ugettext_lazy as _, pgettext_lazy WEEKDAYS = { 0: _('Monday'), 1: _('Tuesday'), 2: _('Wednesday'), 3: _('Thursday'), 4: _('Friday'), 5: _('Saturday'), 6: _('Sunday') } WEEKDAYS_ABBR = { 0: _('Mon'), 1: _('Tue'), 2: _('Wed'), 3: _('Thu'),...
gpl-2.0
Mistobaan/tensorflow
tensorflow/contrib/py2tf/pyct/parser.py
4
1152
# 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
andreaso/ansible
lib/ansible/plugins/connection/lxd.py
133
4283
# (c) 2016 Matt Clay <matt@mystile.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 option) any later version. # ...
gpl-3.0
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/registry/browser/personproduct.py
1
2189
# Copyright 2009 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Views, menus and traversal related to PersonProducts.""" __metaclass__ = type __all__ = [ 'PersonProductBreadcrumb', 'PersonProductFacets', 'PersonProductNavigation...
agpl-3.0
Vogeltak/pauselan
lib/python3.4/site-packages/flask/testsuite/basic.py
406
43777
# -*- coding: utf-8 -*- """ flask.testsuite.basic ~~~~~~~~~~~~~~~~~~~~~ The basic functionality. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re import uuid import flask import pickle import unittest from datetime import datetime from threading i...
gpl-2.0
victronenergy/dbus-fronius
test/src/fronius_sim/fronius_sim.py
1
1241
import random import time class PowerInfo: def __init__(self): self._lastEnergy = 0 self._prevPower = 0 # Use time.perf_counter() instead of time.clock() when using python 3 self._lastTimeStamp = time.perf_counter() @property def current(self): return random.gauss(14, 0.5) @property def voltage(self)...
mit
tsdmgz/ansible
lib/ansible/modules/system/pamd.py
3
23321
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Kenneth D. Evensen <kevensen@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': ...
gpl-3.0
ntruchsess/Arduino-1
arduino-core/src/processing/app/i18n/python/requests/models.py
151
21105
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import logging import datetime from io import BytesIO from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth from .c...
lgpl-2.1
Dandandan/wikiprogramming
jsrepl/extern/python/reloop-closured/lib/python2.7/ntpath.py
81
18082
# Module 'ntpath' -- common operations on WinNT/Win95 pathnames """Common pathname manipulations, WindowsNT/95 version. Instead of importing this module directly, import os and refer to this module as os.path. """ import os import sys import stat import genericpath import warnings from genericpath import * __all__ ...
mit
gustavo-guimaraes/siga
backend/appengine/lib/pip/_vendor/six.py
322
22857
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2014 Benjamin Peterson # # 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 with...
mit
tareqalayan/ansible
test/units/modules/network/onyx/test_onyx_lldp_interface.py
50
3151
# # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch from ansible.modules.network.on...
gpl-3.0
sgraf812/Celero
test/gtest-1.7.0/test/gtest_help_test.py
2968
5856
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
apache-2.0
openstack/keystone
keystone/common/sql/migrate_repo/versions/108_add_failed_auth_columns.py
5
1065
# 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
platinhom/ManualHom
Coding/Python/scipy-html-0.16.1/generated/scipy-stats-probplot-1.py
1
1101
from scipy import stats import matplotlib.pyplot as plt nsample = 100 np.random.seed(7654321) # A t distribution with small degrees of freedom: ax1 = plt.subplot(221) x = stats.t.rvs(3, size=nsample) res = stats.probplot(x, plot=plt) # A t distribution with larger degrees of freedom: ax2 = plt.subplot(222) x = stat...
gpl-2.0
joebowen/movement_validation_cloud
djangodev/lib/python2.7/site-packages/boto/beanstalk/__init__.py
145
1680
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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...
mit
danieluct/ntv2generator
ntv2generator/ntv2writer.py
1
15705
""" This file is part of ntv2generator. ntv2generator 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. ntv2generato...
gpl-2.0
sunlightlabs/django-meetup
meetup/models.py
1
3123
from django.conf import settings from django.db import models from meetup.api import MeetupClient import datetime STATUSES = [(s, s) for s in ('past','pending','upcoming')] API_KEY = getattr(settings, 'MEETUP_KEY', None) class Account(models.Model): key = models.CharField(max_length=128) description = models....
bsd-3-clause
Creworker/FreeCAD
src/Mod/Path/PathScripts/PathSelection.py
15
8856
# -*- coding: utf-8 -*- #*************************************************************************** #* * #* Copyright (c) 2015 Dan Falck <ddfalck@gmail.com> * #* ...
lgpl-2.1
Huskerboy/startbootstrap-freelancer
freelancer_env/Lib/site-packages/pip/utils/__init__.py
323
27187
from __future__ import absolute_import from collections import deque import contextlib import errno import io import locale # we have a submodule named 'logging' which would shadow this if we used the # regular name: import logging as std_logging import re import os import posixpath import shutil import stat import su...
mit
djhenderson/ctypesgen
test/testsuite.py
12
9617
#!/usr/bin/env python # -*- coding: ascii -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # """Simple test suite using unittest. By clach04 (Chris Clark). Calling: python test/testsuite.py or cd test ./testsuite.py Could use any unitest compatible test runner (nose, etc.) Aims to test for regres...
bsd-3-clause
lnielsen/zenodo
zenodo/factory.py
2
4550
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2015 CERN. # # Zenodo 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 v...
gpl-2.0