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 |
|---|---|---|---|---|---|
3liz/qgis-wps4server | filters/PyWPS/tests/schema_validation.py | 1 | 17114 | import os
import sys
pywpsPath = os.path.abspath(os.path.join(
os.path.split(os.path.abspath(__file__))[0], ".."))
# sys.path.append(pywpsPath)
sys.path.insert(0, pywpsPath)
import pywps
import pywps.Process
import unittest
import time
from lxml import etree
import urllib
import StringIO
from pywps import Soap
... | gpl-3.0 |
kdungs/lhcb-hltflow | hltflow/latex.py | 1 | 1423 | """ Adds functionality to make LaTeX figures from the raw TikZ code produced by
core.StreamerFlowchart.
"""
FIGURE = r'''\begin{{figure}}
\centering
\begin{{tikzpicture}}[{tikzoptions}]
{tikz}
\end{{tikzpicture}}
\caption{{Flowchart of {name}}}
\end{{figure}}'''
DOCUMENT = r'''\documentclass{{scrartcl}}
... | mit |
cigroup-ol/metaopt | docs/_extensions/gen_rst.py | 1 | 2094 | import os
from example_builder import ExampleBuilder
RST_TEMPLATE = """
.. _%(sphinx_tag)s:
%(docstring)s
%(image_list)s
.. raw:: html
<div class="toggle_trigger"><a href="#">
**Code output:**
.. raw:: html
</a></div>
<div class="toggle_container">
.. literalinclude:: %(stdout)s
.. raw:: html
... | bsd-3-clause |
amitt001/Analytics-App | API/rate/reviews_sentiment_read.py | 1 | 5952 | """
READ FILE: THIS FILE READS FROM THE ALREADY PICKLED FILES.
FIRST RUN 'reviews_sentiment_write.py' RUN THIS
ONLY TO CHECK ACCURACY FROM THE ALREADY PICKLED FILES.
ALL THE CHNAGES MUST BE MADE TO THE 'reviews_sentiment_write.py'.
Play Store apps reviews sentiment analysis using... | mit |
flotre/Sick-Beard | sickbeard/providers/binnewz/binsearch.py | 29 | 3163 | # Author: Guillaume Serre <guillaume.serre@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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, eithe... | gpl-3.0 |
bzbarsky/servo | tests/wpt/web-platform-tests/tools/html5lib/parse.py | 420 | 8783 | #!/usr/bin/env python
"""usage: %prog [options] filename
Parse a document to a tree, with optional profiling
"""
import sys
import os
import traceback
from optparse import OptionParser
from html5lib import html5parser, sanitizer
from html5lib.tokenizer import HTMLTokenizer
from html5lib import treebuilders, serializ... | mpl-2.0 |
fnouama/intellij-community | python/lib/Lib/site-packages/django/contrib/sessions/backends/file.py | 91 | 5318 | import errno
import os
import tempfile
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
class SessionStore(SessionBase):
"""
Implements a file based session store.
"""
... | apache-2.0 |
Artemkaaas/indy-sdk | vcx/wrappers/python3/tests/test_issuer_credential.py | 1 | 13555 | import pytest
import json
from vcx.error import ErrorCode, VcxError
from vcx.state import State
from vcx.api.issuer_credential import IssuerCredential
from vcx.api.connection import Connection
from vcx.api.credential_def import CredentialDef
from vcx.api.credential import Credential
source_id = '1'
schema_no = 1234
cr... | apache-2.0 |
omnirom/android_external_chromium-org | tools/telemetry/telemetry/page/actions/loop.py | 47 | 1727 | # Copyright 2013 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.
"""A Telemetry page_action that loops media playback.
Action parameters are:
- loop_count: The number of times to loop media.
- selector: If no selector is ... | bsd-3-clause |
mirror/vbox | src/VBox/ValidationKit/testmanager/core/testresults.py | 3 | 66539 | # -*- coding: utf-8 -*-
# $Id$
# pylint: disable=C0302
## @todo Rename this file to testresult.py!
"""
Test Manager - Fetch test results.
"""
__copyright__ = \
"""
Copyright (C) 2012-2014 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This ... | gpl-2.0 |
imbasimba/astroquery | astroquery/dace/tests/test_dace.py | 2 | 1203 | import os
import unittest
import json
from astroquery.dace import Dace
DATA_FILES = {
'parameter_list': 'parameter_list.json',
}
class TestDaceClass(unittest.TestCase):
def test_transform_data_as_dict(self):
expected_parameter_dict = {'ccf_noise': [0.005320016177906, 0.00393390440796704, 0.0032324617... | bsd-3-clause |
danielpalomino/gem5 | src/dev/mips/Malta.py | 18 | 2863 | # Copyright (c) 2007 The Regents of The University of Michigan
# 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 |
rwboyer/marilyn-project | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/img.py | 268 | 18059 | # -*- coding: utf-8 -*-
"""
pygments.formatters.img
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for Pixmap output.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
from pygments.formatter import Formatter
from pygments.util import ge... | mit |
nishad-jobsglobal/odoo-marriot | addons/mrp/product.py | 180 | 4590 | # -*- 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 |
canaltinova/servo | components/script/dom/bindings/codegen/parser/tests/test_replaceable.py | 138 | 1833 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
def should_throw(parser, harness, message, code):
parser = parser.reset();
threw = False
try:
parser... | mpl-2.0 |
jesusesc/Informatica13-14 | in_out.py | 1 | 2096 | # -*- coding: utf-8 -*-
'''
Ejemplos de Entrada / Salida
'''
from math import pi
def circle_length(radius):
return 2*pi*radius
def half(valor):
return valor/2
def main():
'''
Lectura de datos desde el teclado: raw_input
Debemos especificar qué tipo de datos queremos leer
'''
#Leemos el ra... | mit |
AsimmHirani/ISpyPi | tensorflow/contrib/tensorflow-master/tensorflow/python/kernel_tests/identity_op_py_test.py | 115 | 2643 | # 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 |
Chemcy/vnpy | vn.trader/gateway/femasGateway/femasGateway.py | 6 | 37219 | # encoding: UTF-8
'''
vn.femas的gateway接入
考虑到飞马只对接期货(目前只有中金所), vtSymbol直接使用symbol
'''
import os
import json
from vnfemasmd import MdApi
from vnfemastd import TdApi
from femasDataType import *
from vtGateway import *
# 以下为一些VT类型和CTP类型的映射字典
# 价格类型映射
priceTypeMap = {}
priceTypeMap[PRICETYPE_LIMITPRICE] = defineDict["... | mit |
MrKulu/webdam | motsclefs.py | 1 | 5307 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import math
separateurs = ".,;:/?!&\n\\\"\'()[]{}#-|"
mots_a_retirer = ['http','www','youtube','com']
mots_filtres = ['le','la','les','un','une','des','de','du','d','l','m','t','s','mais','ou','et','douc','or','ni','car','qui','que','quoi','dont','où',... | gpl-2.0 |
spcui/virt-test | qemu/tests/usb_storage.py | 3 | 8667 | import logging
import re
import uuid
from autotest.client.shared import error
from virttest import utils_test, aexpect, utils_misc
@error.context_aware
def run_usb_storage(test, params, env):
"""
Test usb storage devices in the guest.
1) Create a image file by qemu-img
2) Boot up a guest add this ima... | gpl-2.0 |
square/pants | tests/python/pants_test/base/test_payload_field.py | 2 | 9060 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from pants.backend.j... | apache-2.0 |
warreee/aim-3 | Assignment2/Tableau/src/data_cleaner.py | 1 | 4904 | import graphlab as gl
import graphlab.aggregate as agg
data_in_path = "/home/warreee/projects/2016-SS-Assignments/Assignment2/Tableau/raw_data/"
data_out_path = "/home/warreee/projects/2016-SS-Assignments/Assignment2/Tableau/clean_data/"
agora = gl.SFrame.read_csv(data_in_path + "agora1.txt", delimiter=' ', header=F... | apache-2.0 |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py3/chardet/mbcssm.py | 289 | 25481 | ######################## 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... | isc |
xydinesh/youtube-dl | youtube_dl/extractor/traileraddict.py | 146 | 2690 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class TrailerAddictIE(InfoExtractor):
_WORKING = False
_VALID_URL = r'(?:http://)?(?:www\.)?traileraddict\.com/(?:trailer|clip)/(?P<movie>.+?)/(?P<trailer_name>.+)'
_TEST = {
'url': 'http://www.traileraddict.com/... | unlicense |
ZhangXinNan/tensorflow | tensorflow/contrib/slim/__init__.py | 101 | 2359 | # 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 |
kaxel/tdsftp | vendor/ruby/1.9.1/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.0.0/ports/libxml2/2.8.0/libxml2-2.8.0/python/tests/compareNodes.py | 87 | 1507 | #!/usr/bin/python -u
import sys
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
#
# Testing XML Node comparison and Node hash-value
#
doc = libxml2.parseDoc("""<root><foo/></root>""")
root = doc.getRootElement()
# Create two different objects which point to foo
foonode1 = root.children
foonode2 = root.... | apache-2.0 |
andreatulimiero/js_closure_compiler_in_python | closure_compiler.py | 2 | 3294 | import os, requests, json
from functools import reduce
from termcolor import colored
import colorama
# Default settings
config = {
'url' : 'http://closure-compiler.appspot.com/compile',
'compilation_level' : 'WHITESPACE_ONLY',
'output_format' : 'text',
'output_info' : 'compiled_code',
'output_file' : 'app.mi... | mit |
lnybrave/zzbook | subject/migrations/0001_initial.py | 1 | 10442 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-09-07 11:29
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
import utils.storage
class Migration(migrations.Migration):
initial = True
dependencies = [
(... | apache-2.0 |
EvenStrangest/tensorflow | tensorflow/python/platform/default/flags_test.py | 20 | 3131 | # Copyright 2015 Google 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 applicable law or a... | apache-2.0 |
jhsenjaliya/incubator-airflow | airflow/www/forms.py | 9 | 1469 | # -*- 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 writing, software
... | apache-2.0 |
miyataken999/weblate | weblate/trans/views/widgets.py | 2 | 4560 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.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, eith... | gpl-3.0 |
coxley/ansible | lib/ansible/module_utils/rax.py | 280 | 11974 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by
# Ansible still belong to the author of the module, and may assign their own
# license to the complete wo... | gpl-3.0 |
youprofit/zato | code/zato-web-admin/src/zato/admin/web/views/cluster.py | 6 | 11873 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2010 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
import logging
from string import whitespace
from traceback import forma... | gpl-3.0 |
berezovskyi/nikola | nikola/data/themes/base/messages/messages_pt.py | 8 | 1751 | # -*- encoding:utf-8 -*-
from __future__ import unicode_literals
MESSAGES = {
"%d min remaining to read": "%d minutos restante para leitura",
"(active)": "(ativo)",
"Also available in:": "Também disponível em:",
"Archive": "Arquivo",
"Authors": "",
"Categories": "Categorias",
"Comments": "C... | mit |
simonwydooghe/ansible | lib/ansible/plugins/doc_fragments/dimensiondata.py | 44 | 1562 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2016, Dimension Data
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Authors:
# - Adam Friedman <tintoy@tintoy.io>
class ModuleDocFragment(object):
# Dimension Data doc fragment
DOCUMENTATION = r'''
options:
regi... | gpl-3.0 |
paran0ids0ul/infernal-twin | build/pip/build/lib.linux-i686-2.7/pip/utils/deprecation.py | 271 | 2152 | """
A module that implments tooling to enable easy warnings about deprecations.
"""
from __future__ import absolute_import
import logging
import warnings
class PipDeprecationWarning(Warning):
pass
class RemovedInPip8Warning(PipDeprecationWarning, PendingDeprecationWarning):
pass
class RemovedInPip9Warnin... | gpl-3.0 |
Parisson/django-paypal | paypal/standard/widgets.py | 30 | 1124 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
try:
from django.forms.utils import flatatt # Django 1.7 and later
except ImportError:
from django.forms.util import flatatt # earlier
from django.utils.safestring import mark_safe
from django.utils.encoding import force_text
class ValueH... | mit |
phlax/translate | translate/storage/placeables/base.py | 4 | 2877 | # -*- coding: utf-8 -*-
#
# Copyright 2008-2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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... | gpl-2.0 |
75651/kbengine_cloud | kbe/res/scripts/common/Lib/multiprocessing/popen_forkserver.py | 94 | 1967 | import io
import os
from . import reduction
if not reduction.HAVE_SEND_HANDLE:
raise ImportError('No support for sending fds between processes')
from . import context
from . import forkserver
from . import popen_fork
from . import spawn
from . import util
__all__ = ['Popen']
#
# Wrapper for an fd used while lau... | lgpl-3.0 |
matllubos/django-sms-operator | sms_operator/models.py | 1 | 4032 | from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.datastructures import SortedDict
from easymode.i18n.decorators import I18n
from chamber.utils.datastructures import ChoicesNumEnum
from chamber.models.fields import SouthMixi... | lgpl-3.0 |
ganeshnalawade/ansible | lib/ansible/module_utils/common/sys_info.py | 47 | 5641 | # Copyright (c), Michael DeHaan <michael.dehaan@gmail.com>, 2012-2013
# Copyright (c), Toshio Kuratomi <tkuratomi@ansible.com> 2016
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ =... | gpl-3.0 |
cjordog/NRLWebsite | demo/auto_generate_plots.py | 1 | 5007 | '''
auto_generate_plots/py
This script generates plots for experimental result data that has not yet
been plotted.
This script uses the matplotlib plotting library, and the mplot3d toolkit,
for generating data plots:
http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html
TODO: Turn this script to face the web mor... | mit |
Aloomaio/googleads-python-lib | examples/ad_manager/v201811/proposal_service/create_proposals.py | 1 | 2591 | #!/usr/bin/env python
#
# Copyright 2015 Google 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 requir... | apache-2.0 |
opendroid-Team/enigma2-4.1 | lib/python/Plugins/Extensions/PluginHider/PluginHiderSetup.py | 11 | 6978 | from . import _
# GUI (Screens)
from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
# GUI (Summary)
from Screens.HelpMenu import HelpableScreen
from Screens.MessageBox import MessageBox
from Screens.Setup import SetupSummary
# GUI (Components)
from Components.ActionMap import Helpabl... | gpl-2.0 |
ruiaylin/percona-xtrabackup | storage/innobase/xtrabackup/test/python/testtools/tests/test_helpers.py | 42 | 3583 | # Copyright (c) 2010 testtools developers. See LICENSE for details.
from testtools import TestCase
from testtools.helpers import (
try_import,
try_imports,
)
from testtools.matchers import (
Equals,
Is,
)
class TestTryImport(TestCase):
def test_doesnt_exist(self):
# try_import('t... | gpl-2.0 |
dneural/python-nullnude | nullnude/client.py | 1 | 2209 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2015, dNeural.com
#
# 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 rig... | mit |
fuzeman/Catalytic | deluge/ui/gtkui/systemtray.py | 2 | 19639 | #
# systemtray.py
#
# Copyright (C) 2007, 2008 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may 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 la... | gpl-3.0 |
ovnicraft/odoo | addons/marketing_campaign/report/__init__.py | 441 | 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 |
crlang/sublime-text---front-end-config | Data/Packages/mdpopups/st3/mdpopups/colorbox.py | 5 | 7341 | """
Sublime tooltip color box.
Licensed under MIT
Copyright (c) 2015 - 2016 Isaac Muse <isaacmuse@gmail.com>
"""
from .png import Writer
from .rgba import RGBA
import base64
import io
CHECK_LIGHT = "#FFFFFF"
CHECK_DARK = "#CCCCCC"
LIGHT = 0
DARK = 1
TOP = 1
RIGHT = 2
BOTTOM = 4
LEFT = 8
X = 0
Y = 1
__all__ = ('co... | mit |
tedder/ansible | lib/ansible/modules/network/cnos/cnos_linkagg.py | 27 | 12973 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
#
# Copyright (C) 2017 Lenovo, Inc.
# (c) 2017, Ansible by Red Hat, inc
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the term... | gpl-3.0 |
Tom3141/Marlin | create_speed_lookuptable.py | 333 | 1382 | #!/usr/bin/env python
""" Generate the stepper delay lookup table for Marlin firmware. """
import argparse
__author__ = "Ben Gamari <bgamari@gmail.com>"
__copyright__ = "Copyright 2012, Ben Gamari"
__license__ = "GPL"
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('-f', '--cpu-freq', type... | gpl-3.0 |
pniedzielski/fb-hackathon-2013-11-21 | src/repl.it/jsrepl/extern/python/closured/lib/python2.7/lib2to3/fixes/fix_types.py | 304 | 1806 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for removing uses of the types module.
These work for only the known names in the types module. The forms above
can include types. or not. ie, It is assumed the module is imported either as:
import type... | agpl-3.0 |
crocs-muni/RTTWebInterface | SubmitExperiment/views.py | 1 | 7105 | from django.shortcuts import render, redirect
from django.conf import settings
from django.core.files.storage import FileSystemStorage
from django.contrib import messages
from .forms import ExperimentForm
from .models import PredefinedConfiguration
from .models import AccessCode
import subprocess
import shlex
import ... | mit |
o3project/odenos | src/main/python/org/o3project/odenos/remoteobject/transport/__init__.py | 233 | 1026 | # -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License... | apache-2.0 |
ltn22/SCHC | python/examples/coap_client/CoAP.py | 1 | 3377 | '''
SCHC compressor, Copyright (c) <2017><IMT Atlantique and Philippe Clavier>
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 ... | gpl-3.0 |
frishberg/django | django/contrib/admin/widgets.py | 14 | 14518 | """
Form Widget classes specific to the Django admin site.
"""
from __future__ import unicode_literals
import copy
from django import forms
from django.db.models.deletion import CASCADE
from django.forms.utils import flatatt
from django.forms.widgets import RadioFieldRenderer
from django.template.loader import render... | bsd-3-clause |
pamfilos/invenio | modules/weblinkback/lib/weblinkback_config.py | 28 | 2599 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
cindyyu/kuma | vendor/packages/translate/storage/oo.py | 25 | 15103 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2008 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | mpl-2.0 |
sekikn/incubator-airflow | tests/providers/http/operators/test_http.py | 7 | 3204 | #
# 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... | apache-2.0 |
opps/opps | opps/archives/migrations/0002_auto__add_field_file_archive_link__chg_field_file_archive.py | 5 | 6181 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'File.archive_link'
d... | mit |
ngannguyen/immunoseq | src/tests/vjusageTest.py | 1 | 1986 | #!/usr/bin/env python
import immunoseq.src.vjusage as vju
import unittest
class TestVjusage( unittest.TestCase ):
def test_vjusage(self):
indir = "/hive/users/nknguyen/reconGit/immunoseq/data/vjusageTest/seqs"
samples = vju.readFiles(indir)
for s in samples:
s.getVJusage(... | mit |
fxfitz/ansible | lib/ansible/modules/network/cnos/cnos_interface.py | 9 | 27599 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
#
# Copyright (C) 2017 Lenovo, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... | gpl-3.0 |
byterom/android_external_chromium_org | tools/binary_size/PRESUBMIT.py | 52 | 1112 | # 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.
"""binary_size presubmit script
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built i... | bsd-3-clause |
SEC-i/ecoControl | server/hooks.py | 1 | 4591 | import sys
import logging
from time import time
import json
from django.contrib.auth import authenticate, login, logout
from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import PermissionDenied
from django.db import connection
from django.db.models import Count, Min, Sum, Avg
from djang... | mit |
gdementen/PyTables | tables/conditions.py | 5 | 16123 | # -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: 2006-09-19
# Author: Ivan Vilata i Balaguer -- ivan@selidor.net
# :Notes: Heavily modified by Francesc Alted for multi-index support.
# 2008-04-09
# Combined common & pro ver... | bsd-3-clause |
pbaesse/Sissens | lib/python2.7/site-packages/eventlet/debug.py | 14 | 6326 | """The debug module contains utilities and functions for better
debugging Eventlet-powered applications."""
from __future__ import print_function
import os
import sys
import linecache
import re
import inspect
__all__ = ['spew', 'unspew', 'format_hub_listeners', 'format_hub_timers',
'hub_listener_stacks', '... | gpl-3.0 |
lanmomo/gameserver-notifier | src/notifier.py | 1 | 2023 | #!/usr/bin/env python3
import sys
import subprocess
import time
import json
import getopt
import requests
def query_server(token, game_id):
data = {}
command_ip = 'ip addr | grep "inet " | grep -v "127." | head -n 1 | tr -s " " | cut -d " " -f3 | cut -d "/" -f1'
data['hostname'] = subprocess.check_output(... | gpl-2.0 |
tinkhaven-organization/odoo | openerp/cli/start.py | 240 | 2748 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import glob
import os
import sys
from . import Command
from .server import main
from openerp.modules.module import get_module_root, MANIFEST
from openerp.service.db import _create_empty_database, DatabaseExists
class Start(Command):
"""Quick start the... | agpl-3.0 |
charukiewicz/beer-manager | venv/lib/python3.4/site-packages/sqlalchemy/testing/schema.py | 10 | 3433 | # testing/schema.py
# Copyright (C) 2005-2014 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
from . import exclusions
from .. import schema, event
from . import config
__all_... | mit |
doismellburning/edx-platform | common/djangoapps/external_auth/views.py | 51 | 36636 | import functools
import json
import logging
import random
import re
import string # pylint: disable=deprecated-module
import fnmatch
import unicodedata
import urllib
from textwrap import dedent
from external_auth.models import ExternalAuthMap
from external_auth.djangostore import DjangoOpenIDStore
from django.c... | agpl-3.0 |
mgardne8/discord.py | examples/basic_voice.py | 1 | 3846 | import asyncio
import discord
import youtube_dl
from discord.ext import commands
# Suppress noise about console usage from errors
youtube_dl.utils.bug_reports_message = lambda: ''
ytdl_format_options = {
'format': 'bestaudio/best',
'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s',
'restrictfilenames... | mit |
tgsd96/gargnotes | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py | 1786 | 2504 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from... | mit |
mwilliamson/locket.py | locket/__init__.py | 1 | 4604 | import time
import errno
import threading
import weakref
__all__ = ["lock_file"]
try:
import fcntl
except ImportError:
try:
import msvcrt
except ImportError:
raise ImportError("Platform not supported (failed to import fcntl, msvcrt)")
else:
_lock_file_blocking_available = Fals... | bsd-2-clause |
IceCubeDev/SpaceOrNot | psycopg2/tests/test_connection.py | 39 | 39512 | #!/usr/bin/env python
# test_connection.py - unit test for connection attributes
#
# Copyright (C) 2008-2011 James Henstridge <james@jamesh.id.au>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foun... | apache-2.0 |
naziris/HomeSecPi | venv/lib/python2.7/site-packages/werkzeug/contrib/lint.py | 295 | 12282 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.lint
~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module provides a middleware that performs sanity checks of the WSGI
application. It checks that :pep:`333` is properly implemented and warns
on some common HTTP errors such as non-empty respons... | apache-2.0 |
dpiekacz/cumulus-linux-ansible-modules | tests/test_cl_prefix_check.py | 6 | 6062 | import mock
from nose.tools import set_trace
from library.cl_prefix_check import main, loop_route_check
from asserts import assert_equals
global_values = {
'prefix': '1.1.1.1/24',
'poll_interval': '1',
'timeout': '2',
'state': 'present',
'nexthop': '1.2.3.4',
'nonexthop': '1.2.3.4'
}
def mod... | gpl-3.0 |
deweller/PHPCodeIntel | phpdaemon.py | 1 | 3844 | import sublime
import os
import json
import subprocess
import threading
import socket
import time
# sends a remote command to the php daemon
# and returns the result
def runRemoteCommandInPHPDaemon(prefs, command, args, aSync=False):
payload = {}
payload['cmd'] = command
payload['args'] = args
json_st... | mit |
40123103/2015cd_40123103 | static/Brython3.1.1-20150328-091302/Lib/warnings.py | 752 | 13825 | """Python part of the warnings subsystem."""
# Note: function level imports should *not* be used
# in this module as it may cause import lock deadlock.
# See bug 683658.
import linecache
import sys
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
"resetwarnings", "catch_warnings"]
def... | gpl-3.0 |
Mozta/pagina-diagnostijuego | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/escprober.py | 2936 | 3187 | ######################## 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... | gpl-3.0 |
ryfeus/lambda-packs | Opencv_pil/source/numpy/distutils/__config__.py | 6 | 1287 | # This file is generated by /tmp/pip-alns09-build/-c
# It contains system_info results at the time of building this package.
__all__ = ["get_info","show"]
lapack_opt_info={'libraries': ['openblas', 'openblas'], 'library_dirs': ['/usr/local/lib'], 'language': 'c', 'define_macros': [('HAVE_CBLAS', None)]}
openblas_lapac... | mit |
hdinsight/hue | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Random/OSRNG/test_generic.py | 131 | 1746 | # -*- coding: utf-8 -*-
#
# SelfTest/Util/test_generic.py: Self-test for the OSRNG.new() function
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that... | apache-2.0 |
skosukhin/spack | var/spack/repos/builtin/packages/font-winitzki-cyrillic/package.py | 1 | 2138 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
johan--/Geotrek | geotrek/maintenance/filters.py | 3 | 1944 | from django.utils.translation import ugettext_lazy as _
from mapentity.filters import PolygonFilter, PythonPolygonFilter
from geotrek.core.models import Topology
from geotrek.common.filters import (
StructureRelatedFilterSet, YearFilter, YearBetweenFilter)
from geotrek.common.widgets import YearSelect
from .mode... | bsd-2-clause |
YUNZHONGTAN/MY_Python_script | soft_ware/pymongo-3.2/ez_setup.py | 164 | 12155 | #!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 of setuptools... | gpl-3.0 |
rupran/ansible | lib/ansible/modules/network/cumulus/_cl_img_install.py | 60 | 10997 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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... | gpl-3.0 |
myles-archive/asgard-calendar | events/feeds.py | 2 | 1617 | from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.contrib.sites.models import Site
from django.contrib.syndication.views import Feed, FeedDoesNotExist
from events.models import Event
current_site = Site.objects.get_current()
class BaseFeed(Feed):
subtitle = u"More ... | bsd-3-clause |
gangadhar-kadam/smrterpfrappe | frappe/patches/v4_0/rename_sitemap_to_route.py | 4 | 1443 | import frappe
from frappe.model import rename_field
def execute():
tables = frappe.db.sql_list("show tables")
if "tabWebsite Route" not in tables:
frappe.rename_doc("DocType", "Website Sitemap", "Website Route", force=True)
if "tabWebsite Template" not in tables:
frappe.rename_doc("DocType", "Website Sitemap ... | mit |
YangSongzhou/django | django/conf/locale/sr_Latn/formats.py | 1008 | 2011 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATE... | bsd-3-clause |
alanchavez88/theHarvester | discovery/dnssearch.py | 1 | 7399 | import IPy
import dns
import string
import sys
class DNSReverse():
def __init__(self, range, verbose=True):
self.range = range
self.iplist = ''
self.results = []
self.verbose = verbose
try:
DNS.ParseResolvConf("/etc/resolv.conf")
except:
prin... | gpl-2.0 |
fperez/sympy | sympy/functions/elementary/integers.py | 1 | 5025 | from sympy.core.basic import Basic, S, C, sympify
from sympy.core.function import Lambda, Function
from sympy.core.evalf import get_integer_part, PrecisionExhausted
from sympy.utilities.decorator import deprecated
###############################################################################
########################... | bsd-3-clause |
antaril/AGK | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
itbabu/django-oscar | src/oscar/apps/dashboard/nav.py | 23 | 3617 | import re
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import NoReverseMatch, resolve, reverse
from django.http import Http404
from oscar.core.loading import AppNotFoundError, get_class
from oscar.views.decorators import check_permissions
class Node(object):
"""
A no... | bsd-3-clause |
bodi000/odoo | addons/l10n_at/account_wizard.py | 379 | 1234 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) conexus.at
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public ... | agpl-3.0 |
penuel-leo/justniffer | python/webserver.py | 2 | 5432 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2009 Plecno s.r.l. All Rights Reserved
# info@plecno.com
# via Giovio 8, 20144 Milano, Italy
# Released under the terms of the GPLv3 or later
# Author: Oreste Notelli <oreste.notelli@plecno.com>
import SimpleHTTPServer
import BaseHTTPServer
import urlparse
im... | gpl-3.0 |
chen2aaron/SnirteneCodes | PythonCookbookPractise/chapter8/create_managed_attributes.py | 1 | 1177 | # 8.6. Creating Managed Attributes
class Person:
def __init__(self, first_name):
self.first_name = first_name
# Getter function
@property
def first_name(self):
return self._first_name
# Setter function
@first_name.setter
def first_name(self, value):
if not isinstanc... | gpl-2.0 |
caot/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/gdal/srs.py | 291 | 11717 | """
The Spatial Reference class, represensents OGR Spatial Reference objects.
Example:
>>> from django.contrib.gis.gdal import SpatialReference
>>> srs = SpatialReference('WGS84')
>>> print srs
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORI... | apache-2.0 |
chaffra/sympy | sympy/functions/special/tests/test_bessel.py | 36 | 22192 | from itertools import product
from sympy import (jn, yn, symbols, Symbol, sin, cos, pi, S, jn_zeros, besselj,
bessely, besseli, besselk, hankel1, hankel2, hn1, hn2,
expand_func, sqrt, sinh, cosh, diff, series, gamma, hyper,
Abs, I, O, oo, conjugate)
from sympy.f... | bsd-3-clause |
plusseed/ViewCamCloud-API-Tool | VccReqRes/VccToken.py | 1 | 2102 | # -*- coding: utf-8 -*-
import requests
from requests_toolbelt.utils import dump
from PySide import QtCore, QtGui, QtWebKit
from utils import *
from VccReqResBase import *
class VccToken(VccReqResBase):
"""
共通 > APIトークンの取得
"""
def __init__(self, parent, grid):
"""
UIを設... | lgpl-2.1 |
Vimos/scikit-learn | sklearn/mixture/bayesian_mixture.py | 17 | 32965 | """Bayesian Gaussian Mixture Model."""
# Author: Wei Xue <xuewei4d@gmail.com>
# Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
import math
import numpy as np
from scipy.special import betaln, digamma, gammaln
from .base import BaseMixture, _check_shape
from .gaussian_mixture impo... | bsd-3-clause |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/rest_framework/serializers.py | 5 | 41575 | """
Serializers and ModelSerializers are similar to Forms and ModelForms.
Unlike forms, they are not constrained to dealing with HTML output, and
form encoded input.
Serialization in REST framework is a two-phase process:
1. Serializers marshal between complex types like model instances, and
python primitives.
2. The... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.