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 |
|---|---|---|---|---|---|
ojengwa/odoo | addons/web/doc/conf.py | 494 | 8552 | # -*- coding: utf-8 -*-
#
# OpenERP Technical Documentation configuration file, created by
# sphinx-quickstart on Fri Feb 17 16:14:06 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.
#
#... | agpl-3.0 |
kstrauser/ansible | plugins/callbacks/hipchat.py | 69 | 6961 | # (C) 2014, Matt Martz <matt@sivel.net>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#... | gpl-3.0 |
ACS-Community/ACS | LGPL/CommonSoftware/acspycommon/test/acspyTestUnitTimeHelper.py | 4 | 5258 | #! /usr/bin/env python
#*******************************************************************************
# ALMA - Atacama Large Millimiter Array
# (c) National Research Council of Canada, 2008
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public... | lgpl-2.1 |
permamodel/permamodel | permamodel/components/bmi_Ku_component.py | 1 | 18122 | # -*- coding: utf-8 -*-
""" Kudryavtsev model by Anisimov et al. (1997).
Anisimov, O. A., Shiklomanov, N. I., & Nelson, F. E. (1997).
Global warming and active-layer thickness: results from transient general circulation models.
Global and Planetary Change, 15(3-4), 61-77. DOI:10.1016/S0921-8181(97)00009-X
*The MIT... | mit |
zahodi/ansible | lib/ansible/modules/network/wakeonlan.py | 7 | 4046 | #!/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 |
Codefans-fan/odoo | addons/google_spreadsheet/__openerp__.py | 312 | 1710 | # -*- 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 |
bnavarma/netsnmp | examples/download-and-compile-smistar-mibs-into-pysnmp-files.py | 2 | 1713 | #
# Look up specific ASN.1 MIBs at configured Web and FTP sites,
# compile them into pysnmp form and save Python modules as plain-text
# files in a local directory.
#
# Try to support both SMIv1 and SMIv2 flavors of SMI as well as
# popular deviations from official syntax found in the wild.
#
# In this example we disa... | bsd-2-clause |
Scarygami/gae-gcs-push2deploy-secrets | lib/flask/templating.py | 783 | 4707 | # -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... | apache-2.0 |
vybstat/scikit-learn | sklearn/decomposition/tests/test_kernel_pca.py | 57 | 8062 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import (assert_array_almost_equal, assert_less,
assert_equal, assert_not_equal,
assert_raises)
from sklearn.decomposition import PCA, KernelPCA
from sklearn.datasets import mak... | bsd-3-clause |
ROMFactory/android_external_chromium_org | android_webview/tools/known_issues.py | 24 | 2509 | # 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.
"""List of directories which are known issues for Android WebView.
There are a number of directories in the Chromium tree which should be removed
when m... | bsd-3-clause |
ktosiek/spacewalk | client/debian/packages-already-in-debian/rhnlib/rhn/nonblocking.py | 22 | 2421 | #
#
#
import select
import fcntl
import os
class NonBlockingFile:
def __init__(self, fd):
# Keep a copy of the file descriptor
self.fd = fd
fcntl.fcntl(self.fd.fileno(), fcntl.F_SETFL, os.O_NDELAY)
# Set the callback-related stuff
self.read_fd_set = []
self.write_fd... | gpl-2.0 |
Teamxrtc/webrtc-streaming-node | third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/apitools/ez_setup.py | 38 | 8357 | #!/usr/bin/env python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version ... | mit |
ProfessorX/CIS508 | Codes/xen-4.3.1/tools/python/xen/xm/cpupool-new.py | 41 | 1702 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
Ravenm/2143-OOP-NASH | python3env/Lib/site-packages/pip/wheel.py | 4 | 32049 | """
Support for installing and building the "wheel" binary package format.
"""
from __future__ import absolute_import
import compileall
import csv
import errno
import functools
import hashlib
import logging
import os
import os.path
import re
import shutil
import stat
import sys
import tempfile
import warnings
from ba... | cc0-1.0 |
HonzaKral/django | django/contrib/admin/migrations/0001_initial.py | 142 | 1657 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.admin.models
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('conten... | bsd-3-clause |
achang97/YouTunes | lib/python2.7/site-packages/youtube_dl/extractor/veehd.py | 177 | 4129 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_unquote,
compat_urlparse,
)
from ..utils import (
ExtractorError,
clean_html,
get_element_by_id,
)
class VeeHDIE(InfoExtractor):
_VALID_URL = r'https?://... | mit |
mitchfriedman/flask | flask/signals.py | 191 | 2209 | # -*- coding: utf-8 -*-
"""
flask.signals
~~~~~~~~~~~~~
Implements signals based on blinker if available, otherwise
falls silently back to a noop.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
signals_available = False
try:
from blinker import Nam... | bsd-3-clause |
lidiamcfreitas/FenixScheduleMaker | ScheduleMaker/brython/www/src/Lib/test/test_timeit.py | 107 | 11085 | import timeit
import unittest
import sys
import io
import time
from textwrap import dedent
from test.support import run_unittest
from test.support import captured_stdout
from test.support import captured_stderr
# timeit's default number of iterations.
DEFAULT_NUMBER = 1000000
# timeit's default number of repetitions... | bsd-2-clause |
lobermann/xbmc | lib/libUPnP/Neptune/Extras/Scripts/GenErrorMap.py | 265 | 4805 | #! /usr/bin/python
import os
import os.path
import re
import sys
ErrorPattern = re.compile('([A-Z]{3}_ERROR_[A-Z_0-9]+)\s+=?\s*\(?([A-Z_0-9-][A-Z_0-9-+ ]+[A-Z_0-9])')
FilePatternH = re.compile('^.*\.h$')
FilePatternC = re.compile('^.*\.(c|cpp)$')
Errors = {}
Codes = {}
ERROR_MAP_HEADER = """/***********************... | gpl-2.0 |
pypa/virtualenv | src/virtualenv/seed/embed/base_embed.py | 4 | 4182 | from __future__ import absolute_import, unicode_literals
from abc import ABCMeta
from six import add_metaclass
from virtualenv.util.path import Path
from virtualenv.util.six import ensure_str, ensure_text
from ..seeder import Seeder
from ..wheels import Version
PERIODIC_UPDATE_ON_BY_DEFAULT = True
@add_metaclass... | mit |
Razharas/-tg-station | tools/mapmerge2/dmm.py | 27 | 17052 | # Tools for working with DreamMaker maps
import io
import bidict
import random
from collections import namedtuple
TGM_HEADER = "//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE"
ENCODING = 'utf-8'
Coordinate = namedtuple('Coordinate', ['x', 'y', 'z'])
class DMM:
__slots__ =... | agpl-3.0 |
galaxy-iuc/parsec | parsec/commands/config/get_config.py | 1 | 1047 | import click
from parsec.cli import pass_context, json_loads
from parsec.decorators import custom_exception, list_output
@click.command('get_config')
@pass_context
@custom_exception
@list_output
def cli(ctx):
"""Get a list of attributes about the Galaxy instance. More attributes will be present if the user is an ... | apache-2.0 |
foobarbazblarg/stayclean | stayclean-2020-december/venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/requirements.py | 2 | 5020 | from pip._vendor.packaging.utils import canonicalize_name
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
from .base import Requirement, format_name
if MYPY_CHECK_RUNNING:
from pip._vendor.packaging.specifiers import SpecifierSet
from pip._internal.req.req_install import InstallRequirement
fr... | mit |
jainanisha90/WeVoteServer | apis_v1/tests/test_views_organization_retrieve.py | 2 | 12168 | # apis_v1/test_views_organization_retrieve.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.core.urlresolvers import reverse
from django.test import TestCase
import json
from organization.models import Organization
class WeVoteAPIsV1TestsOrganizationRetrieve(TestCase):
def setUp(self... | mit |
Abi1ity/uniclust2.0 | SQLAlchemy-0.9.9/test/orm/test_lazy_relations.py | 2 | 28838 | """basic tests of lazy loaded attributes"""
from sqlalchemy.testing import assert_raises, assert_raises_message
import datetime
from sqlalchemy import exc as sa_exc
from sqlalchemy.orm import attributes, exc as orm_exc
import sqlalchemy as sa
from sqlalchemy import testing, and_
from sqlalchemy import Integer, String,... | bsd-3-clause |
ronanki/merlin | src/keras_lib/data_utils.py | 1 | 14709 | ################################################################################
# The Neural Network (NN) based Speech Synthesis System
# https://github.com/CSTR-Edinburgh/merlin
#
# Centre for Speech Technology Research
# University of Edinburgh, UK
# ... | apache-2.0 |
gtrensch/nest-simulator | pynest/nest/tests/test_sp/test_disconnect_multiple.py | 17 | 11105 | # -*- coding: utf-8 -*-
#
# test_disconnect_multiple.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 th... | gpl-2.0 |
sosguns2002/interactive-mining | interactive-mining-3rdparty-madis/madis/src/functions/row/htmlops.py | 5 | 10684 | # coding: utf-8
import urllib
import re
from htmlentitydefs import name2codepoint
import urlparse
import os
import mimetypes
import xml.sax.saxutils
import operator
import json
def urlsplit(*args):
"""
.. function:: urlsplit(text1, [text2,...]) -> multiset
Breaks a given URL into multiple fields. The ret... | gpl-3.0 |
figshare/Total-Impact | plugins/metrics/PubMed/Plugin.py | 1 | 7113 | #!/usr/bin/env python
import simplejson
import json
import urllib
import urllib2
import BeautifulSoup
from BeautifulSoup import BeautifulStoneSoup
import time
import re
import nose
from nose.tools import assert_equals
import sys
import os
import ConfigParser
# This hack is to add current path when running script from c... | mit |
ghchinoy/tensorflow | tensorflow/python/keras/mixed_precision/experimental/keras_test.py | 1 | 25861 | # Copyright 2019 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 |
govarguz/espressopp | src/interaction/OPLS.py | 7 | 3363 | # Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of t... | gpl-3.0 |
franky88/emperioanimesta | env/Lib/site-packages/django/db/models/options.py | 28 | 34250 | from __future__ import unicode_literals
import copy
import warnings
from bisect import bisect
from collections import OrderedDict, defaultdict
from itertools import chain
from django.apps import apps
from django.conf import settings
from django.core.exceptions import FieldDoesNotExist
from django.db import connection... | gpl-3.0 |
rdeheele/odoo | 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 |
fxtentacle/phantomjs | src/qt/qtwebkit/Source/WebKit2/Scripts/generate-messages-header.py | 145 | 1809 | #!/usr/bin/env python
#
# Copyright (C) 2010 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
jskrzypek/flask-video-streaming | camera_cv2.py | 1 | 1340 | # camera.py
import numpy as np
import cv2
import collections
import time
class VideoCamera(object):
def __init__(self):
# Using OpenCV to capture from device 0. If you have trouble capturing
# from a webcam, comment the line below out and use a video file
# instead.
self.__is_runni... | mit |
imsut/commons | src/python/twitter/pants/targets/sources.py | 2 | 3613 | # ==================================================================================================
# Copyright 2012 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
CyrilPeponnet/Archipel | ArchipelAgent/archipel-agent/archipel/archipelLibvirtEntity.py | 5 | 7124 | # -*- coding: utf-8 -*-
#
# archipelLibvirtEntity.py
#
# Copyright (C) 2010 Antoine Mercadal <antoine.mercadal@inframonde.eu>
# Copyright, 2011 - Franck Villaume <franck.villaume@trivialdev.com>
# This file is part of ArchipelProject
# http://archipelproject.org
#
# This program is free software: you can redistribute i... | agpl-3.0 |
luhanhan/horizon | openstack_dashboard/dashboards/admin/aggregates/constants.py | 54 | 1379 | # 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
# d... | apache-2.0 |
gerryhd/diabot-assistant | lib/python2.7/site-packages/jinja2/defaults.py | 130 | 1323 | # -*- coding: utf-8 -*-
"""
jinja2.defaults
~~~~~~~~~~~~~~~
Jinja default filters and tags.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import range_type
from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
# defaults for ... | gpl-3.0 |
amishb/youtube-dl | youtube_dl/extractor/elpais.py | 128 | 2110 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import unified_strdate
class ElPaisIE(InfoExtractor):
_VALID_URL = r'https?://(?:[^.]+\.)?elpais\.com/.*/(?P<id>[^/#?]+)\.html(?:$|[?#])'
IE_DESC = 'El País'
_TEST = {
'url': 'http://blogs.elpa... | unlicense |
stclair/wes-cms | django/contrib/gis/gdal/prototypes/geom.py | 315 | 4821 | import re
from datetime import date
from ctypes import c_char, c_char_p, c_double, c_int, c_ubyte, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal, GEOJSON
from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope
from... | bsd-3-clause |
akarol/cfme_tests | sprout/sprout/log.py | 14 | 3185 | # -*- coding: utf-8 -*-
import atexit
import logging
import logging.handlers
from threading import Lock
import inspect
import sys
from django.db.models import Model
from types import ModuleType
logger_cache = {}
logger_cache_lock = Lock()
logging.getLogger("requests").setLevel(logging.WARNING)
logging.getLogger("url... | gpl-2.0 |
apache/incubator-eagle | eagle-external/eagle-ambari/lib/EAGLE/package/scripts/eagle_client.py | 21 | 1057 | #!/usr/bin/python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Licen... | apache-2.0 |
jatindhankhar/aslo-v3 | aslo/web/views.py | 1 | 2132 | from . import web
from flask import (render_template,
abort, request, redirect,
url_for, flash, session)
from aslo.persistence.activity import Activity
from aslo.service import activity as activity_service
from flask_babel import gettext
@web.route('/', defaults={'page': 1})
@web... | mit |
Thraxis/pymedusa | lib/sqlalchemy/dialects/sqlite/pysqlite.py | 55 | 14980 | # sqlite/pysqlite.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sqlite+pysqlite
:name: pysqlite
:dbapi: sqlite3
:con... | gpl-3.0 |
Jobava/zamboni | mkt/purchase/models.py | 9 | 6122 | import datetime
from django.conf import settings
from django.db import models
from django.utils import translation
import tower
from babel import Locale, numbers
from jingo import env
from jingo.helpers import urlparams
from jinja2.filters import do_dictsort
import mkt
from mkt.site.helpers import absolutify
from mk... | bsd-3-clause |
mcanthony/node-gyp | gyp/pylib/gyp/generator/analyzer.py | 294 | 21436 | # 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 |
RafaelRMachado/qtwebkit | Tools/Scripts/webkitpy/tool/steps/addsvnmimetypeforpng.py | 129 | 4095 | # Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this lis... | gpl-2.0 |
diogocs1/comps | web/addons/crm_profiling/wizard/__init__.py | 438 | 1080 | # -*- 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... | apache-2.0 |
jaimeMF/youtube-dl | youtube_dl/downloader/f4m.py | 11 | 13501 | from __future__ import division, unicode_literals
import base64
import io
import itertools
import os
import time
from .fragment import FragmentFD
from ..compat import (
compat_etree_fromstring,
compat_urlparse,
compat_urllib_error,
compat_urllib_parse_urlparse,
)
from ..utils import (
encodeFilena... | unlicense |
getzze/python-ivi | ivi/tektronix/tektronixAWG2000.py | 6 | 23133 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
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... | mit |
tempbottle/kbengine | kbe/src/lib/python/Lib/test/test_compile.py | 68 | 21140 | import math
import unittest
import sys
import _ast
import types
from test import support
class TestSpecifics(unittest.TestCase):
def compile_single(self, source):
compile(source, "<single>", "single")
def assertInvalidSingle(self, source):
self.assertRaises(SyntaxError, self.compile_single, s... | lgpl-3.0 |
dannyperry571/theapprentice | script.module.urlresolver-master/lib/urlresolver/plugins/videomega.py | 2 | 2191 | """
OVERALL CREDIT TO:
t0mm0, Eldorado, VOINAGE, BSTRDMKR, tknorris, smokdpi, TheHighway
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
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 So... | gpl-2.0 |
jmacmahon/invenio | modules/bibcatalog/lib/ticket_templates/metadata_curation.py | 3 | 6592 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 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... | gpl-2.0 |
DonaldTrumpHasTinyHands/tiny_hands_pac | photo_gallery/models.py | 1 | 3989 | from django.db import models
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailcore.models import Page
from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel
from wagtail.wagtailimages.models import Imag... | mit |
Theragon/kupfer | kupfer/ui/listen.py | 4 | 5311 | """
This module has a singleton Service for dbus callbacks,
and ensures there is only one unique service in the Session
"""
import gobject
try:
import dbus
import dbus.glib
import dbus.service
from kupfer.dbuscompat import ExportedGObject
dbus.glib.threads_init()
# if dbus unavailable print the exception here
... | gpl-3.0 |
dsqmoore/0install | tests/testunpack.py | 4 | 6617 | #!/usr/bin/env python
from __future__ import print_function
from basetest import BaseTest
import sys, tempfile, os
import unittest, logging
sys.path.insert(0, '..')
from zeroinstall.zerostore import unpack, manifest, Store, BadDigest
from zeroinstall import SafeException, support
from zeroinstall.support import find... | lgpl-2.1 |
fidomason/kbengine | kbe/src/lib/python/Lib/lib2to3/fixes/fix_dict.py | 140 | 3816 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for dict methods.
d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())
d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())
d.itervalues() -> iter(d.values())
d.v... | lgpl-3.0 |
rosenvladimirov/odoo-fixes | sale_mrp/tests/test_move_explode.py | 225 | 5190 | # -*- 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 |
crr0004/taiga-back | tests/integration/test_attachments.py | 21 | 1381 | import pytest
from django.core.urlresolvers import reverse
from django.core.files.uploadedfile import SimpleUploadedFile
from .. import factories as f
pytestmark = pytest.mark.django_db
def test_create_user_story_attachment_without_file(client):
"""
Bug test "Don't create attachments without attached_file"... | agpl-3.0 |
MechanisM/djangodash2011 | test_project/settings/defaults.py | 1 | 1151 | import os
here = lambda * x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x)
PROJECT_ROOT = here('..')
root = lambda * x: os.path.join(os.path.abspath(PROJECT_ROOT), *x)
PROJECT_MODULE = '.'.join(__name__.split('.')[:-2]) # cut .settings.base
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'... | bsd-3-clause |
boxed/CMi | web_frontend/gdata/webmastertools/data.py | 126 | 5504 | #!/usr/bin/python
#
# Copyright (C) 2009 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 ... | mit |
zhengger/seafile | scripts/build/build-msi.py | 2 | 29828 | #!/usr/bin/env python
# coding: UTF-8
'''This scirpt builds the seafile windows msi installer.
Some notes:
1. The working directory is always the 'builddir'. 'os.chdir' is only called
to change to the 'builddir'. We make use of the 'cwd' argument in
'subprocess.Popen' to run a command in a specific directory.
2. Wh... | gpl-2.0 |
bigswitch/nova | nova/conf/ironic.py | 1 | 2594 | # Copyright 2015 Intel Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
hep-gc/glint-horizon | openstack_dashboard/dashboards/project/routers/extensions/routerrules/rulemanager.py | 10 | 3778 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013, Big Switch Networks
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | apache-2.0 |
doismellburning/edx-platform | lms/djangoapps/debug/management/commands/dump_xml_courses.py | 102 | 2402 | """
Export all xml courses in a diffable format.
This command loads all of the xml courses in the configured DATA_DIR.
For each of the courses, it loops through all of the modules, and dumps
each as a separate output file containing the json representation
of each of its fields (including those fields that are set as ... | agpl-3.0 |
archesproject/arches | arches/settings.py | 1 | 27501 | """
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund
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 Founda... | agpl-3.0 |
OpenSeizureDetector/OpenSeizureDetector | fitbit_version/galileo/galileo/dump.py | 5 | 3269 | import base64
import logging
logger = logging.getLogger(__name__)
from .utils import a2x, a2lsbi, a2s
class CRC16(object):
""" A rather generic CRC16 class """
def __init__(self, poly=0x1021, Invert=True, IV=0x0000, FV=0x0000):
self.poly = poly
self.value = IV
self.FV = FV
if... | gpl-3.0 |
ikonst/cerbero | cerbero/main.py | 13 | 4454 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | lgpl-2.1 |
hfp/tensorflow-xsmm | tensorflow/contrib/distributions/python/kernel_tests/bijectors/gumbel_test.py | 25 | 2707 | # 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 |
blxd/livestreamer | src/livestreamer_cli/utils/stream.py | 25 | 1050 | def stream_to_url(stream):
stream_type = type(stream).shortname()
if stream_type in ("hls", "http"):
url = stream.url
elif stream_type == "rtmp":
params = [stream.params.pop("rtmp", "")]
stream_params = dict(stream.params)
if "swfVfy" in stream.params:
stream_p... | bsd-2-clause |
mspublic/openair4G-mirror | targets/TEST/OAI/case04.py | 1 | 7789 | #******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by ... | gpl-3.0 |
fivejjs/inasafe | extras/system_tools.py | 17 | 12896 | """Implementation of tools to do with system administration made
as platform independent as possible.
"""
import sys
import os
import string
import urllib
import urllib2
import getpass
import tarfile
import warnings
try:
import hashlib
except ImportError:
import md5 as hashlib
def get_user_name():
"""Get... | gpl-3.0 |
wzbozon/statsmodels | statsmodels/nonparametric/kernels.py | 21 | 6397 | """
Module of kernels that are able to handle continuous as well as categorical
variables (both ordered and unordered).
This is a slight deviation from the current approach in
statsmodels.nonparametric.kernels where each kernel is a class object.
Having kernel functions rather than classes makes extension to a multiv... | bsd-3-clause |
hfeeki/transifex | transifex/addons/locks/models.py | 1 | 6537 | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models impor... | gpl-2.0 |
wfxiang08/django190 | tests/utils_tests/test_timesince.py | 293 | 6089 | from __future__ import unicode_literals
import datetime
import unittest
from django.test.utils import requires_tz_support
from django.utils import timezone
from django.utils.timesince import timesince, timeuntil
class TimesinceTests(unittest.TestCase):
def setUp(self):
self.t = datetime.datetime(2007, ... | bsd-3-clause |
encukou/cython | Cython/StringIOTree.py | 4 | 3096 | from cStringIO import StringIO
class StringIOTree(object):
"""
See module docs.
"""
def __init__(self, stream=None):
self.prepended_children = []
if stream is None:
stream = StringIO()
self.stream = stream
self.write = stream.write
self.markers = []... | apache-2.0 |
Timurdov/bionic | bionic/Lib/site-packages/django/core/management/color.py | 86 | 1730 | """
Sets up the terminal color scheme.
"""
import os
import sys
from django.utils import termcolors
def supports_color():
"""
Returns True if the running system's terminal supports color, and False
otherwise.
"""
plat = sys.platform
supported_platform = plat != 'Pocket PC' and (plat != 'win3... | apache-2.0 |
dronefly/dronefly.github.io | flask/lib/python2.7/site-packages/setuptools/command/build_py.py | 110 | 8495 | import os
import sys
import fnmatch
import textwrap
import distutils.command.build_py as orig
from distutils.util import convert_path
from glob import glob
try:
from setuptools.lib2to3_ex import Mixin2to3
except ImportError:
class Mixin2to3:
def run_2to3(self, files, doctests=True):
"do not... | apache-2.0 |
Open-Party/python-beaver | beaver/transports/kinesis_transport.py | 7 | 3958 | # -*- coding: utf-8 -*-
import boto.kinesis
import boto.kinesis.layer1
import uuid
from beaver.transports.base_transport import BaseTransport
from beaver.transports.exception import TransportException
class KinesisTransport(BaseTransport):
def __init__(self, beaver_config, logger=None):
super(KinesisTra... | mit |
daveperkins-github/bitcoin-dev | qa/rpc-tests/txn_doublespend.py | 101 | 6478 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test proper accounting with a double-spend conflict
#
from test_framework.test_framework import BitcoinTe... | mit |
aidanlister/django | tests/gis_tests/geos_tests/test_mutable_list.py | 173 | 14846 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com
# All rights reserved.
#
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
import unittest
from django.contrib.gis.geos.mutable_list import ListMixin
from django.utils import six
class Use... | bsd-3-clause |
archerja/ilxr.py | imdb/utils.py | 1 | 59846 | # Copyright 2004-2018 Davide Alberani <da@erlug.linux.it>
# 2009 H. Turgut Uyar <uyar@tekir.org>
#
# 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,... | mit |
manics/snoopycrimecop | test/unit/test_pullrequest.py | 1 | 12138 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 University of Dundee & Open Microscopy Environment
# All Rights Reserved.
#
# 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; ... | gpl-2.0 |
abhishekr700/Z00L_cmkernel | scripts/build-all.py | 704 | 14699 | #! /usr/bin/env python
# Copyright (c) 2009-2014, The Linux Foundation. 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
# ... | gpl-2.0 |
joeshaw/luigi | luigi/contrib/sqla.py | 54 | 15631 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Gouthaman Balaraman
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | apache-2.0 |
bebby520/essay_devel | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/ihatexml.py | 1727 | 16581 | from __future__ import absolute_import, division, unicode_literals
import re
import warnings
from .constants import DataLossWarning
baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-... | apache-2.0 |
cfossace/crits | crits/services/connector.py | 28 | 3410 | class UnknownConnector(Exception):
"""
Exception for dealing with an unknown connector type.
"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class MissingDependency(Exception):
"""
Exception for dealing with a missing dependency... | mit |
anggorodewanto/oppia | extensions/value_generators/models/generators.py | 24 | 1821 | # 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 |
armandorl/googletest | scripts/pump.py | 2471 | 23673 | #!/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 |
CoutinhoElias/danibraz | danibraz/bookings/migrations/0001_initial.py | 1 | 1897 | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-12-20 21:01
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swa... | mit |
tumi8/INSALATA | src/insalata/helper/SSHWrapper.py | 1 | 4989 | import paramiko
import json
from lxml import etree
import time
class SSHClient_noAuth(paramiko.SSHClient):
def _auth(self, username, *args):
self._transport.auth_none(username)
return
class SSHWrapper:
def __init__(self):
self.user = "root"
self.name = None
self.key = p... | apache-2.0 |
shangwuhencc/scikit-learn | examples/applications/plot_out_of_core_classification.py | 255 | 13919 | """
======================================================
Out-of-core classification of text documents
======================================================
This is an example showing how scikit-learn can be used for classification
using an out-of-core approach: learning from data that doesn't fit into main
memory. ... | bsd-3-clause |
indiereign/shaka-player | third_party/gjslint/closure_linter-2.3.13/closure_linter/requireprovidesorter_test.py | 127 | 5048 | #!/usr/bin/env python
#
# Copyright 2012 The Closure Linter Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | apache-2.0 |
seaotterman/tensorflow | tensorflow/python/estimator/inputs/queues/feeding_queue_runner.py | 123 | 6899 | # 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 |
dahlstrom-g/intellij-community | python/helpers/profiler/vmprof_profiler.py | 22 | 2691 | import os
import shutil
import tempfile
import vmprof
import prof_six as six
from _prof_imports import TreeStats, CallTreeStat
class VmProfProfile(object):
""" Wrapper class that represents VmProf Python profiling backend with API matching
the cProfile.
"""
def __init__(self):
self.stats... | apache-2.0 |
zhukaixy/kbengine | kbe/src/lib/python/Lib/encodings/cp1252.py | 272 | 13511 | """ Python Character Mapping Codec cp1252 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | lgpl-3.0 |
Alwnikrotikz/labyrinth | src/labyrinth.py | 3 | 3271 | #! /usr/bin/env python
# labyrith.py
# This file is part of Labyrith
#
# Copyright (C) 2006 - Don Scorgie <Don@Scorgie.org>
# Copyright (C) 2008 - Labyrinth-Dev-Team
#
# Labyrith 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 Sof... | gpl-2.0 |
erp12/pyshgp | pyshgp/push/state.py | 1 | 5338 | """The state module is define the PushState class.
A PushState object holds the PushStacks, stdout string, and collection of input
values. The PushState is what controls the setup of all stacks before program
manipulation, and the producing of outputs after program execution.
"""
from typing import Sequence, Union
fro... | mit |
romain-dartigues/ansible | lib/ansible/modules/cloud/google/gcp_compute_global_address.py | 7 | 11360 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.