repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
ecosoft-odoo/odoo | addons/website_gengo/__init__.py | 316 | 1024 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... | agpl-3.0 |
maxlikely/scikit-learn | sklearn/datasets/svmlight_format.py | 1 | 13250 | """This module implements a loader and dumper for the svmlight format
This format is a text-based format, with one sample per line. It does
not store zero valued features hence is suitable for sparse dataset.
The first element of each line can be used to store a target variable to
predict.
This format is used as the... | bsd-3-clause |
mhotwagner/abackend | abackend-env/lib/python3.5/site-packages/pip/_vendor/lockfile/mkdirlockfile.py | 478 | 3098 | from __future__ import absolute_import, division
import time
import os
import sys
import errno
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class MkdirLockFile(LockBase):
"""Lock file by creating a directory."""
def __init__(self, path, threaded=True, ... | mit |
jlspyaozhongkai/Uter | third_party_backup/Python-2.7.9/Demo/turtle/tdemo_tree.py | 4 | 1410 | #!/usr/bin/env python
""" turtle-example-suite:
tdemo_tree.py
Displays a 'breadth-first-tree' - in contrast
to the classical Logo tree drawing programs,
which use a depth-first-algorithm.
Uses:
(1) a tree-generator, where the drawing is
quasi the side-effect, whereas the generator
always yields Non... | gpl-3.0 |
pixelated/pixelated-user-agent | service/pixelated/resources/users.py | 2 | 1200 | #
# Copyright (c) 2016 ThoughtWorks, Inc.
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pixelated is distrib... | agpl-3.0 |
danielballan/scikit-xray | skbeam/core/fitting/background.py | 12 | 8569 | # ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# @author: Li Li (lili@bnl.g... | bsd-3-clause |
LokiCoder/Sick-Beard | lib/hachoir_parser/audio/itunesdb.py | 90 | 17106 | """
iPod iTunesDB parser.
Documentation:
- http://ipodlinux.org/ITunesDB
Author: Romain HERAULT
Creation date: 19 august 2006
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet,
UInt8, UInt16, UInt32, UInt64, TimestampMac32,
String, Float32, NullBytes, Enum)
from lib.hacho... | gpl-3.0 |
JoaoVasques/aws-devtool | eb/linux/python3/lib/aws/requests/packages/chardet2/escprober.py | 25 | 3175 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
... | apache-2.0 |
pjg101/SickRage | lib/unidecode/x0b7.py | 253 | 4833 | data = (
'ddwim', # 0x00
'ddwib', # 0x01
'ddwibs', # 0x02
'ddwis', # 0x03
'ddwiss', # 0x04
'ddwing', # 0x05
'ddwij', # 0x06
'ddwic', # 0x07
'ddwik', # 0x08
'ddwit', # 0x09
'ddwip', # 0x0a
'ddwih', # 0x0b
'ddyu', # 0x0c
'ddyug', # 0x0d
'ddyugg', # 0x0e
'ddyugs', # 0x0f
'dd... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/260_test_support.py | 3 | 29308 | """Supporting definitions for the Python regression tests."""
if __name__ != 'test.test_support':
raise ImportError('test_support must be imported from the test package')
import contextlib
import errno
import socket
import sys
import os
import shutil
import warnings
import unittest
__all__ = ["Error", "TestFaile... | gpl-3.0 |
ininex/geofire-python | resource/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py | 355 | 25609 | # -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from collections import Mapping
from datetime import datetime
from .auth import _basic_auth_str
from .compat import cookielib, Ord... | mit |
gangadharkadam/johnerp | erpnext/hr/doctype/leave_allocation/leave_allocation.py | 38 | 4247 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, flt
from frappe import _
from frappe.model.document import Document
from erpnext.hr.utils import set_emp... | agpl-3.0 |
jmehnle/ansible | lib/ansible/compat/tests/mock.py | 117 | 4320 | # (c) 2014, Toshio Kuratomi <tkuratomi@ansible.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... | gpl-3.0 |
jorgenkg/python-neural-network | nimblenet/cost_functions.py | 1 | 1632 | import numpy as np
import math
def sum_squared_error( outputs, targets, derivative=False ):
if derivative:
return outputs - targets
else:
return 0.5 * np.mean(np.sum( np.power(outputs - targets,2), axis = 1 ))
#end cost function
def hellinger_distance( outputs, targets, derivative=False ):
... | bsd-2-clause |
stammen/xbmc | addons/metadata.demo.albums/demo.py | 26 | 5381 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import xbmcplugin,xbmcgui,xbmc,xbmcaddon
import os,sys,urllib
def get_params():
param=[]
paramstring=sys.argv[2]
if len(paramstring)>=2:
params=sys.argv[2]
cleanedparams=params.replace('?','')
if (par... | gpl-2.0 |
TwilioDevEd/marketing-notifications-flask | tests/helper_tests.py | 3 | 1094 | import unittest
from marketing_notifications_python.view_helpers import redirect_to, view
from base import BaseTestCase
from flask import redirect, url_for, render_template
class ViewHelperTests(BaseTestCase):
# Ensures 'redirect_to' redirect you to the same place as 'redirect'
def test_redirect_to_redirects_... | mit |
IRSO/irsosav | nodejs-v6.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | 713 | 115880 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... | gpl-3.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/python-openid-2.2.5/openid/yadis/accept.py | 184 | 3742 | """Functions for generating and parsing HTTP Accept: headers for
supporting server-directed content negotiation.
"""
def generateAcceptHeader(*elements):
"""Generate an accept header value
[str or (str, float)] -> str
"""
parts = []
for element in elements:
if type(element) is str:
... | apache-2.0 |
googleapis/googleapis-gen | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/enums/types/negative_geo_target_type.py | 1 | 1192 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 |
darren-rogan/CouchPotatoServer | libs/werkzeug/wsgi.py | 13 | 30419 | # -*- coding: utf-8 -*-
"""
werkzeug.wsgi
~~~~~~~~~~~~~
This module implements WSGI related helpers.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import os
import urllib
import urlparse
import posixpath
import m... | gpl-3.0 |
Korkki/django | django/contrib/messages/storage/base.py | 526 | 6285 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.messages import constants, utils
from django.utils.encoding import force_text, python_2_unicode_compatible
LEVEL_TAGS = utils.get_level_tags()
@python_2_unicode_compatible
class Message(object):
"""
Represents an ac... | bsd-3-clause |
stonekyx/binary | vendor/scons-local-2.3.4/SCons/Tool/dvi.py | 9 | 2335 | """SCons.Tool.dvi
Common DVI Builder definition for various other Tool modules that use it.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# 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 ... | gpl-3.0 |
mvaled/sentry | src/sentry/south_migrations/0326_auto__add_field_groupsnooze_count__add_field_groupsnooze_window__add_f.py | 1 | 116733 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'GroupSnooze.count'
db.add_column(
'sentry_grou... | bsd-3-clause |
mancoast/CPythonPyc_test | fail/331_test_codecencodings_kr.py | 28 | 3125 | #!/usr/bin/env python3
#
# test_codecencodings_kr.py
# Codec encoding tests for ROK encodings.
#
from test import support
from test import multibytecodec_support
import unittest
class Test_CP949(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'cp949'
tstring = multibytecodec_support.load_tes... | gpl-3.0 |
aperigault/ansible | test/units/modules/cloud/xenserver/test_xenserver_guest_powerstate.py | 39 | 10606 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, Bojan Vitnik <bvitnik@mainstream.rs>
# 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
import json
import pytest
from .common import fake_... | gpl-3.0 |
tazo90/lux | setup.py | 1 | 1994 | import os
import json
from setuptools import setup, find_packages
package_name = 'lux'
def read(name):
root_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(root_dir, name), 'r') as f:
return f.read()
def run():
install_requires = []
dependency_links = []
pkg = ... | bsd-3-clause |
pierluigiferrari/fcn8s_tensorflow | cityscapesscripts/annotation/cityscapesLabelTool.py | 1 | 109346 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#################
## Import modules
#################
# pyqt for everything graphical
from PyQt4 import QtGui, QtCore
# get command line parameters
import sys
# walk directories
import glob
# access to OS functionality
import os
# (de)serialize config file
import json
# ... | gpl-3.0 |
Robbie1977/TGscripts | plJHwarpToTemplate.py | 1 | 8574 | import os, re, shutil, subprocess, datetime, socket
ba = '/groups/sciserv/flyolympiad/vnc_align/toolkit/JBA/brainaligner'
cmtkdir = '/usr/local/cmtk/bin/'
fiji = '/usr/local/Fiji/ImageJ-linux64'
Rawconv = '~/script/raw2nrrdCrop.ijm'
Nrrdconv = '~/script/nrrd2rawUncrop.ijm'
Tfile = '~/template/flyVNCtemp... | mit |
tartopum/Lactum | setup.py | 1 | 1422 | import os
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
import lactum
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
... | mit |
funkring/fdoo | addons-funkring/at_sale_layout_ext/sale.py | 1 | 1573 | # -*- coding: utf-8 -*-
#############################################################################
#
# Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | agpl-3.0 |
arrabito/DIRAC | Core/Utilities/Time.py | 2 | 8945 | """
DIRAC Times module
Support for basic Date and Time operations
based on system datetime module.
It provides common interface to UTC timestamps,
converter to string types and back.
The following datetime classes are used in the returned objects:
- dateTime = datetime.datetime
- date = datetime.date
- t... | gpl-3.0 |
ovnicraft/edx-platform | openedx/core/djangoapps/user_api/preferences/tests/test_views.py | 49 | 22793 | # -*- coding: utf-8 -*-
"""
Unit tests for preference APIs.
"""
import unittest
import ddt
import json
from mock import patch
from django.core.urlresolvers import reverse
from django.conf import settings
from django.test.testcases import TransactionTestCase
from rest_framework.test import APIClient
from student.tests... | agpl-3.0 |
ArtsiomCh/tensorflow | tensorflow/python/saved_model/saved_model.py | 102 | 1626 | # 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 |
martinwicke/tensorflow | tensorflow/contrib/metrics/python/kernel_tests/set_ops_test.py | 22 | 34996 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
geky/mbed | tools/host_tests/tcpecho_server_loop.py | 73 | 1349 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 |
golismero/golismero | golismero/api/text/text_utils.py | 8 | 7440 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Text manipulation utilities.
"""
__license__ = """
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Golismero project site: https://github.com/golismero
Golismero project mail: contact@golismero-project.com
This program is free software; you can redistribute ... | gpl-2.0 |
kmpf/uap | tools/segemehl_2017_reformatCigar.py | 1 | 4801 | #!/bin/bash
"exec" "`dirname $0`/../python_env/bin/python" "$0" "$@"
#"exec" "python" "$0" "$@"
# ^^^
# the cmd above ensures that the correct python environment is
# selected to execute this script.
# The correct environment is the one belonging to uap, since all
# neccessary python modules are installed there.
# f... | gpl-3.0 |
xadahiya/django-chartjs | docs/conf.py | 5 | 8415 | # -*- coding: utf-8 -*-
#
# django-chartjs documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 27 11:37:23 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.
... | bsd-3-clause |
SNoiraud/gramps | gramps/gen/config.py | 4 | 14825 | # -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2005-2007 Donald N. Allingham
# Copyright (C) 2008-2009 Gary Burton
# Copyright (C) 2009-2012 Doug Blank <doug.blank@gmail.com>
# Copyright (C) 2011 Tim G L Lyons
# Copyright (C) 2015- Serge Noiraud
#
# This progra... | gpl-2.0 |
nathangeffen/tbonline-old | tbonlineproject/external/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... | mit |
hansey/youtube-dl | youtube_dl/extractor/howstuffworks.py | 106 | 4404 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
find_xpath_attr,
int_or_none,
js_to_json,
unescapeHTML,
)
class HowStuffWorksIE(InfoExtractor):
_VALID_URL = r'https?://[\da-z-]+\.howstuffworks\.com/(?:[^/]+/)*(?:\d+-)?(?P<id>.+?)-video\.htm'
_TE... | unlicense |
MrNuggles/HeyBoet-Telegram-Bot | temboo/Library/Amazon/SQS/__init__.py | 4 | 1878 | from temboo.Library.Amazon.SQS.AddPermission import AddPermission, AddPermissionInputSet, AddPermissionResultSet, AddPermissionChoreographyExecution
from temboo.Library.Amazon.SQS.ChangeMessageVisibility import ChangeMessageVisibility, ChangeMessageVisibilityInputSet, ChangeMessageVisibilityResultSet, ChangeMessageVisi... | gpl-3.0 |
REVLWorld/elasticsearch-dsl-py | test_elasticsearch_dsl/test_integration/test_search.py | 1 | 2708 | from elasticsearch import TransportError
from elasticsearch_dsl import Search, DocType, Date, String, MultiSearch, \
MetaField, Index, Q
from .test_data import DATA
from pytest import raises
class Repository(DocType):
created_at = Date()
description = String(analyzer='snowball')
tags = String(index=... | apache-2.0 |
timothsp/where2ate | venv/lib/python3.3/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py | 2919 | 3678 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | cc0-1.0 |
cynngah/uofthacksIV | generate-jobs/lib/python2.7/site-packages/wheel/signatures/__init__.py | 565 | 3779 | """
Create and verify jws-js format Ed25519 signatures.
"""
__all__ = [ 'sign', 'verify' ]
import json
from ..util import urlsafe_b64decode, urlsafe_b64encode, native, binary
ed25519ll = None
ALG = "Ed25519"
def get_ed25519ll():
"""Lazy import-and-test of ed25519 module"""
global ed25519ll
if not ... | mit |
ilastikdev/ilastik | ilastik/applets/splitBodySupervoxelExport/splitBodySupervoxelExportApplet.py | 4 | 1673 | ###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... | gpl-3.0 |
kc4271/batch_downloader | requests/api.py | 361 | 4344 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
Retur... | mit |
kaksmet/servo | components/script/dom/bindings/codegen/parser/tests/test_const.py | 134 | 3000 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestConsts {
const byte zero = 0;
const byte b = -1;
const octet o = 2;
const short s = -3;
const unsigned short us = 0x4;
const long l = -0X5;
const unsigned long... | mpl-2.0 |
GbalsaC/bitnamiP | lms/djangoapps/ccx/tests/test_models.py | 33 | 12589 | """
tests for the models
"""
from datetime import datetime, timedelta
from django.utils.timezone import UTC
from mock import patch
from nose.plugins.attrib import attr
from student.models import CourseEnrollment # pylint: disable=import-error
from student.roles import CourseCcxCoachRole # pylint: disable=import-error... | agpl-3.0 |
Lektorium-LLC/edx-platform | common/djangoapps/edxmako/shortcuts.py | 5 | 7383 | # Copyright (c) 2008 Mikeal Rogers
#
# 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 agre... | agpl-3.0 |
LouTheBrew/troposphere | examples/Redshift.py | 28 | 3265 | # Converted from Redshift.template located at:
# http://aws.amazon.com/cloudformation/aws-cloudformation-templates/
from troposphere import Template, Parameter, Ref, Equals
from troposphere import If, Output, Join, GetAtt
from troposphere.redshift import Cluster, ClusterParameterGroup
from troposphere.redshift import ... | bsd-2-clause |
coxley/ansible | lib/ansible/plugins/connections/chroot.py | 35 | 6882 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 ... | gpl-3.0 |
minrk/nbgrader | nbgrader/preprocessors/lockcells.py | 3 | 1069 | from traitlets import Bool
from .. import utils
from . import NbGraderPreprocessor
class LockCells(NbGraderPreprocessor):
"""A preprocessor for making cells undeletable."""
lock_solution_cells = Bool(True, config=True, help="Whether solution cells are undeletable")
lock_grade_cells = Bool(True, config=Tr... | bsd-3-clause |
rangadi/incubator-beam | sdks/python/apache_beam/transforms/ptransform_test.py | 4 | 81197 | #
# 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 |
ddy88958620/lib | Python/scrapy/swedishtruckparts/parts4scania.py | 2 | 1983 | import re
import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
import csv
from product_spiders.items import Product, ProductLoader
class Part... | apache-2.0 |
15Dkatz/pants | tests/python/pants_test/backend/graph_info/tasks/test_filter.py | 10 | 8657 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from textwrap import... | apache-2.0 |
antin/Open-Knesset | presence/BeautifulSoup.py | 51 | 79254 | """Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup parses a (possibly invalid) XML or HTML document into a
tree representation. It provides methods and Pythonic idioms that make
it easy to navigate, search, and modify the tree.
A well-formed X... | bsd-3-clause |
elewis33/doorstop | doorstop/server/utilities.py | 1 | 1176 | """Shared functions for the `doorstop.server` package."""
from doorstop import common
from doorstop import settings
log = common.logger(__name__)
class StripPathMiddleware(object): # pylint: disable=R0903
"""WSGI middleware that strips trailing slashes from all URLs."""
def __init__(self, app):
s... | lgpl-3.0 |
leorochael/odoo | addons/account/wizard/account_report_partner_ledger.py | 378 | 3538 | # -*- 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 |
qnib/qcollect | resources/diamond/collectors/filestat/filestat.py | 23 | 9658 | # coding=utf-8
"""
Uses lsof to collect data on number of open files per user per type
#### Config Options
* user_include - This is list of users to collect data for. If this is left
empty, its a wildcard to collector for all users (default = None)
* user_exclude - This is a list of users to exclude from colle... | apache-2.0 |
sudheesh001/oh-mainline | mysite/search/migrations/0047_project_icons_mark_as_wrong.py | 17 | 10858 | # This file is part of OpenHatch.
# Copyright (C) 2010 Parker Phinney
# Copyright (C) 2010 OpenHatch, Inc.
#
# 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 |
bealdav/OpenUpgrade | addons/base_action_rule/tests/__init__.py | 178 | 1129 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
nagyistoce/odoo-dev-odoo | openerp/addons/test_converter/tests/test_html.py | 66 | 13431 | # -*- encoding: utf-8 -*-
import json
import os
import datetime
from lxml import etree
from openerp.tests import common
from openerp.tools import html_escape as e
from openerp.addons.base.ir import ir_qweb
directory = os.path.dirname(__file__)
class TestExport(common.TransactionCase):
_model = None
def set... | agpl-3.0 |
nagyistoce/odoo-dev-odoo | addons/hr_expense/report/__init__.py | 380 | 1071 | # -*- 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 |
raychorn/knowu | django/djangononrelsample2/django/contrib/localflavor/us/models.py | 196 | 1261 | from django.utils.translation import ugettext_lazy as _
from django.db.models.fields import CharField
from django.contrib.localflavor.us.us_states import STATE_CHOICES
from django.contrib.localflavor.us.us_states import USPS_CHOICES
class USStateField(CharField):
description = _("U.S. state (two uppercase letters... | lgpl-3.0 |
TGThorax/python-ka2ring | src/leeftijd.py | 1 | 1962 | # Oefening: Vraag de geboortedatum van de gebruiker en zeg de leeftijd.
huidig_jaar = 2017
huidige_maand = 10
huidige_dag = 24
jaar = int(input("In welk jaar ben je geboren? "))
maand = int(input("En in welke maand? (getal) "))
# De dag moeten we pas weten als de geboortemaand deze maand is!
# Je kan het hier nat... | mit |
matthiasdiener/spack | lib/spack/external/jinja2/parser.py | 89 | 35875 | # -*- coding: utf-8 -*-
"""
jinja2.parser
~~~~~~~~~~~~~
Implements the template parser.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import nodes
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
from jinja2.lexer impo... | lgpl-2.1 |
clarkfitzg/xray | setup.py | 2 | 4581 | #!/usr/bin/env python
import os
import re
import sys
import warnings
from setuptools import setup, find_packages
MAJOR = 0
MINOR = 5
MICRO = 1
ISRELEASED = False
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
QUALIFIER = ''
DISTNAME = 'xray'
LICENSE = 'Apache'
AUTHOR = 'xray Developers'
AUTHOR_EMAIL = 'xray-dev@goog... | apache-2.0 |
pygeek/django | django/contrib/auth/decorators.py | 112 | 3097 | try:
from urllib.parse import urlparse
except ImportError: # Python 2
from urlparse import urlparse
from functools import wraps
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import PermissionDenied
from django.utils.decorators import availab... | bsd-3-clause |
synconics/odoo | addons/account_anglo_saxon/__init__.py | 436 | 1090 | ##############################################################################
#
# 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 Affero General Publ... | agpl-3.0 |
a-parhom/edx-platform | openedx/core/djangoapps/content/course_overviews/migrations/0007_courseoverviewimageconfig.py | 70 | 1394 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('course_o... | agpl-3.0 |
shurihell/testasia | openedx/core/djangoapps/credit/verification_access.py | 105 | 6749 | """
Create in-course reverification access groups in a course.
We model the rules as a set of user partitions, one for each
verification checkpoint in a course.
For example, suppose that a course has two verification checkpoints,
one at midterm A and one at the midterm B.
Then the user partitions would look like thi... | agpl-3.0 |
EricSB/nupic | tests/unit/nupic/utils_test.py | 15 | 5895 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This p... | agpl-3.0 |
amoikevin/gyp | test/variables/filelist/gyptest-filelist-golden.py | 228 | 1584 | #!/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.
"""
Test variable expansion of '<|(list.txt ...)' syntax commands.
"""
import os
import sys
import TestGyp
test = TestGyp.TestGyp(format=... | bsd-3-clause |
andmos/ansible | lib/ansible/modules/network/ios/ios_user.py | 8 | 17360 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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 Li... | gpl-3.0 |
mandeepdhami/horizon | openstack_dashboard/dashboards/identity/domains/urls.py | 64 | 1036 | # Copyright 2013 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 requir... | apache-2.0 |
AladdinSonni/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py | 118 | 23190 | # 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 f... | bsd-3-clause |
DTOcean/dtocean-core | dtocean_core/strategies/__init__.py | 1 | 3195 | # -*- coding: utf-8 -*-
# Copyright (C) 2016-2018 Mathew Topper
#
# 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... | gpl-3.0 |
mtholder/taxalotl | taxalotl/parsing/col.py | 1 | 5000 | from __future__ import print_function
import io
import logging
from peyutil import shorter_fp_form
from taxalotl.resource_wrapper import TaxonomyWrapper
from taxalotl.parsing.darwin_core import normalize_darwin_core_taxonomy
_LOG = logging.getLogger(__name__)
COL_PARTMAP = {
'Archaea': frozenset([52435722]),
... | bsd-2-clause |
shangwuhencc/scikit-learn | examples/svm/plot_svm_anova.py | 250 | 2000 | """
=================================================
SVM-Anova: SVM with univariate feature selection
=================================================
This example shows how to perform univariate feature before running a SVC
(support vector classifier) to improve the classification scores.
"""
print(__doc__)
import... | bsd-3-clause |
shyamalschandra/picochess | libs/requests/packages/urllib3/connection.py | 309 | 6533 | # urllib3/connection.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import sys
import socket
from socket import timeout as SocketTimeout
try: # Python 3
fr... | gpl-3.0 |
jmehnle/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_list.py | 36 | 4523 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
#
# This module 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 opti... | gpl-3.0 |
e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/messaging/rabbitmq_user.py | 49 | 9782 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chatham Financial <oss@chathamfinancial.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'... | bsd-3-clause |
shaufi/odoo | addons/l10n_fr/report/__init__.py | 424 | 1475 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
TheoRettisch/p2pool-giarcoin | p2pool/__init__.py | 278 | 1595 | import os
import re
import sys
import traceback
import subprocess
def check_output(*popenargs, **kwargs):
process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
output, unused_err = process.communicate()
retcode = process.poll()
if retcode:
raise ValueError((retcode, output))
... | gpl-3.0 |
rhelmer/socorro-lib | scripts/cmp_hbase_s3.py | 12 | 7214 | #!/usr/bin/env python
import os, sys
import happybase
import logging
from boto.sqs import connect_to_region as sqs_connect
from boto.sqs.jsonmessage import JSONMessage
from boto.s3 import connect_to_region as s3_connect
from boto.s3.key import Key
from boto.exception import BotoServerError
from multiprocessing impor... | mpl-2.0 |
mgedmin/ansible | lib/ansible/modules/network/wakeonlan.py | 8 | 4047 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, 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 License, ... | gpl-3.0 |
roglew/pappy-proxy | pappyproxy/interface/decode.py | 1 | 10668 | import html
import base64
import datetime
import gzip
import shlex
import string
import urllib
from ..util import hexdump, printable_data, copy_to_clipboard, clipboard_contents, encode_basic_auth, parse_basic_auth
from ..console import CommandError
from io import StringIO
def print_maybe_bin(s):
binary = False
... | mit |
nwchandler/ansible | lib/ansible/modules/remote_management/ipmi/ipmi_boot.py | 69 | 6041 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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 |
nirmeshk/oh-mainline | vendor/packages/distribute/pkg_resources.py | 75 | 89800 | """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 operations to manipula... | agpl-3.0 |
li-xiao-nan/gyp_tools | test/mac/gyptest-infoplist-process.py | 303 | 1677 | #!/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.
"""
Verifies the Info.plist preprocessor functionality.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
test = TestGyp.TestG... | bsd-3-clause |
zhjunlang/kbengine | kbe/src/lib/python/Tools/scripts/gprof2html.py | 36 | 2203 | #! /usr/bin/env python3
"""Transform gprof(1) output into useful HTML."""
import re, os, sys, cgi, webbrowser
header = """\
<html>
<head>
<title>gprof output (%s)</title>
</head>
<body>
<pre>
"""
trailer = """\
</pre>
</body>
</html>
"""
def add_escapes(filename):
with open(filename) as fp:
for line ... | lgpl-3.0 |
pycontw/pycontw2016 | src/proposals/migrations/0038_add_new_conference.py | 1 | 1404 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2019-07-10 07:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('proposals', '0037_auto_20180305_1339'),
]
operations = [
migrations.AlterFi... | mit |
zzh8829/RevOctane | bstream.py | 1 | 3007 | import io
import struct
little_endian_types = {
'int8': 'b',
'uint8': 'B',
'int16': 'h',
'uint16': 'H',
'int32': 'i',
'uint32': 'I',
'int64': 'q',
'uint64': 'Q',
'float': 'f',
'float32': 'f',
'double': 'd',
'char': 'c',
'bool': '?',
'pad': 'x',
'void*': 'P',
}
big_endian_types = { k:">"+v for k,v in li... | mit |
viewdy/phantomjs2 | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/createbug.py | 125 | 2563 | # 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 |
Fokko/incubator-airflow | airflow/migrations/versions/2e541a1dcfed_task_duration.py | 2 | 1530 | # -*- 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 |
frederica07/Dragon_Programming_Process | PyOpenGL-3.0.2/OpenGL/raw/GL/EXT/multisample.py | 1 | 1356 | '''Autogenerated by get_gl_extensions script, do not edit!'''
from OpenGL import platform as _p, constants as _cs, arrays
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_EXT_multisample'
def _f( function ):
return _p.createFunction( function,_p.GL,'GL_EXT_multisample',False)
_p.unpack_constants( """G... | bsd-2-clause |
cjerdonek/open-rcv | openrcv/models.py | 1 | 6692 | #
# Copyright (c) 2014 Chris Jerdonek. 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 to use, copy, modi... | mit |
zhangjunlei26/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_extensions.py | 413 | 16128 | #!/usr/bin/env python
#
# Copyright 2012, 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... | mpl-2.0 |
python-acoustics/Sea | gui/analysis/actions.py | 2 | 2362 | """
The following are some actions.
"""
from PyQt4 import QtCore, QtGui
import FreeCADGui as Gui
import FreeCAD as App
import logging
class RunAnalysis(object):
"""
Perform the SEA analysis. Solve the modal energies.
"""
def Activated(self):
import Sea
objects = Gui.S... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.