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 |
|---|---|---|---|---|---|
hub-cap/lady-rainicorn | rainicorn/openstack/common/exception.py | 1 | 3454 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# 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.apac... | apache-2.0 |
mizzao/ggplot | ggplot/stats/stat_function.py | 12 | 4439 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
import pandas as pd
from ggplot.utils import make_iterable_ntimes
from ggplot.utils.exceptions import GgplotError
from .stat import stat
class stat_function(stat):
"""
Superimpose a... | bsd-2-clause |
BhavySinghal/qassam-le2 | tools/perf/scripts/python/net_dropmonitor.py | 2669 | 1738 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
CiscoSystems/jujucharm-n1k | charms/precise/swift-storage/hooks/misc_utils.py | 1 | 2174 | from charmhelpers.contrib.storage.linux.utils import (
is_block_device,
zap_disk,
)
from charmhelpers.contrib.storage.linux.loopback import (
ensure_loopback_device,
)
from charmhelpers.contrib.storage.linux.lvm import (
deactivate_lvm_volume_group,
is_lvm_physical_volume,
remove_lvm_physical_... | apache-2.0 |
timgraham/django-cms | cms/management/commands/subcommands/tree.py | 4 | 5434 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from collections import OrderedDict
from cms.models import Page, CMSPlugin
from .base import SubcommandsCommand
def get_descendant_ids(root_id):
"""
Returns the a generator of primary keys which represent
d... | bsd-3-clause |
tammoippen/nest-simulator | pynest/nest/tests/test_split_simulation.py | 13 | 2259 | # -*- coding: utf-8 -*-
#
# test_split_simulation.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 the L... | gpl-2.0 |
Kryz/sentry | src/sentry/migrations/0129_auto__chg_field_release_id__chg_field_pendingteammember_id__chg_field_.py | 36 | 26026 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
"""
This migration skips all bigint upgrades as they're not generally useful
for organizations, and ... | bsd-3-clause |
JohnOrlando/gnuradio-bitshark | gr-radar-mono/src/python/usrp_radar_mono.py | 11 | 3905 | #!/usr/bin/env python
#
# Copyright 2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
... | gpl-3.0 |
martydill/url_shortener | code/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 |
charanpald/APGL | apgl/graph/test/GeneralVertexListTest.py | 1 | 1641 |
from apgl.graph.GeneralVertexList import GeneralVertexList
from apgl.graph.test.AbstractVertexListTest import AbstractVertexListTest
from apgl.util.PathDefaults import PathDefaults
import unittest
import logging
class GeneralVertexListTest(unittest.TestCase, AbstractVertexListTest):
def setUp(self):
self... | bsd-3-clause |
cdjones32/vertx-web | src/test/sockjs-protocol/venv/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.py | 168 | 26964 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Access to Python's configuration information."""
import codecs
import os
import re
import sys
from os.path import pardir, realpath
try:
import configparser
except ImportError:
import Conf... | apache-2.0 |
lungetech/luigi | luigi/contrib/sge.py | 11 | 11055 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
gauravbose/digital-menu | digimenu2/tests/initial_sql_regress/tests.py | 13 | 1556 | from django.core.management.color import no_style
from django.core.management.sql import custom_sql_for_model
from django.db import DEFAULT_DB_ALIAS, connections
from django.test import TestCase, override_settings
from .models import Simple
class InitialSQLTests(TestCase):
"""
The format of the included SQL ... | bsd-3-clause |
blaxter/hamster-applet | hamster/storage.py | 1 | 4165 | # - coding: utf-8 -
# Copyright (C) 2007 Patryk Zawadzki <patrys at pld-linux.org>
# Copyright (C) 2007-2009 Toms Baugis <toms.baugis@gmail.com>
# This file is part of Project Hamster.
# Project Hamster is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | gpl-3.0 |
Mazecreator/tensorflow | tensorflow/contrib/metrics/python/ops/metric_ops_test.py | 7 | 205973 | # 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 |
KeyWeeUsr/kivy | kivy/tests/test_doc_gallery.py | 17 | 1278 | from doc.gallery import *
def test_parse_docstring_info():
assert 'error' in parse_docstring_info("No Docstring")
assert 'error' in parse_docstring_info("'''No Docstring Title'''")
assert 'error' in parse_docstring_info(
"'''No Sentence\n======\nPeriods'''"
... | mit |
jtyr/ansible-modules-core | cloud/openstack/_quantum_floating_ip_associate.py | 6 | 8225 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.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 option) any later ... | gpl-3.0 |
boada/photometrypipeline | pp_combine.py | 2 | 13483 | #!/usr/bin/env python3
""" PP_COMBINE - combine frames based on wcs
v1.0: 2017-10-03, mommermiscience@gmail.com
"""
from __future__ import print_function, division
# Photometry Pipeline
# Copyright (C) 2016-2018 Michael Mommert, mommermiscience@gmail.com
# This program is free software: you can redistribute it ... | gpl-3.0 |
aarsan/azure-sdk-for-python | azure-servicemanagement-legacy/azure/servicemanagement/_common_error.py | 13 | 1505 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apa... | apache-2.0 |
Nitaco/ansible | lib/ansible/modules/network/f5/bigip_device_group_member.py | 8 | 7464 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
sencha/chromium-spacewalk | tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py | 6 | 8619 | # 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.
import logging
import os
import re
import signal
import subprocess
import sys
import tempfile
from telemetry.core import platform
from telemetry.core import... | bsd-3-clause |
yyjiang/scikit-learn | sklearn/covariance/tests/test_covariance.py | 142 | 11068 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | bsd-3-clause |
rickerc/nova_audit | nova/api/openstack/compute/views/limits.py | 14 | 3505 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack Foundation
# 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-2.0 |
tommyip/zulip | zerver/lib/bugdown/api_code_examples.py | 1 | 10016 | import re
import json
import inspect
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor
from typing import Any, Dict, Optional, List, Tuple
import markdown
import zerver.openapi.python_examples
from zerver.lib.openapi import get_openapi_fixture, openapi_spec, \
get_openapi_p... | apache-2.0 |
binhex/moviegrabber | lib/site-packages/cherrypy/_cpchecker.py | 87 | 14739 | import os
import warnings
import cherrypy
from cherrypy._cpcompat import iteritems, copykeys, builtins
class Checker(object):
"""A checker for CherryPy sites and their mounted applications.
When this object is called at engine startup, it executes each
of its own methods whose names start with ``che... | gpl-3.0 |
nitishaggarwal/wed | wed/users/views.py | 55 | 1681 | # -*- coding: utf-8 -*-
# Import the reverse lookup function
from django.core.urlresolvers import reverse
# view imports
from django.views.generic import DetailView
from django.views.generic import RedirectView
from django.views.generic import UpdateView
from django.views.generic import ListView
# Only authenticated ... | bsd-3-clause |
mcking49/apache-flask | Python/Lib/htmllib.py | 312 | 12869 | """HTML 2.0 parser.
See the HTML 2.0 specification:
http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html
"""
from warnings import warnpy3k
warnpy3k("the htmllib module has been removed in Python 3.0",
stacklevel=2)
del warnpy3k
import sgmllib
from formatter import AS_IS
__all__ = ["HTMLPars... | mit |
rbalda/neural_ocr | env/lib/python2.7/site-packages/scipy/optimize/tests/test_nonlin.py | 67 | 15160 | """ Unit tests for nonlinear solvers
Author: Ondrej Certik
May 2007
"""
from __future__ import division, print_function, absolute_import
from numpy.testing import assert_, dec, TestCase, run_module_suite
from scipy._lib.six import xrange
from scipy.optimize import nonlin, root
from numpy import matrix, diag, dot
from... | mit |
hydrospanner/DForurm | DForurm/env/Lib/site-packages/django/contrib/auth/base_user.py | 59 | 4973 | """
This module allows importing AbstractBaseUser even when django.contrib.auth is
not in INSTALLED_APPS.
"""
from __future__ import unicode_literals
import unicodedata
from django.contrib.auth import password_validation
from django.contrib.auth.hashers import (
check_password, is_password_usable, make_password,
... | mit |
Chandlercjy/OnePy | OnePy/environment.py | 1 | 5171 | import logging
from collections import defaultdict
import arrow
import OnePy as op
from OnePy.event_engine import EventEngine
from OnePy.utils.easy_func import get_day_ratio
class Environment(object):
"""作为全局共享变量为各模块提供支持"""
# general context
sys_date: str = None
sys_frequency: str = None
instru... | mit |
marco-lancini/Showcase | django/utils/dates.py | 488 | 2237 | "Commonly-used date structures"
from django.utils.translation import ugettext_lazy as _, pgettext_lazy
WEEKDAYS = {
0:_('Monday'), 1:_('Tuesday'), 2:_('Wednesday'), 3:_('Thursday'), 4:_('Friday'),
5:_('Saturday'), 6:_('Sunday')
}
WEEKDAYS_ABBR = {
0:_('Mon'), 1:_('Tue'), 2:_('Wed'), 3:_('Thu'), 4:_('Fri')... | mit |
rzhxeo/youtube-dl | youtube_dl/extractor/radiode.py | 22 | 1776 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
class RadioDeIE(InfoExtractor):
IE_NAME = 'radio.de'
_VALID_URL = r'https?://(?P<id>.+?)\.(?:radio\.(?:de|at|fr|pt|es|pl|it)|rad\.io)'
_TEST = {
'url': 'http://ndr2.radio.de/',
'md5': '3b4cdd011bc591745... | unlicense |
andykimpe/chromium-test-npapi | tools/resources/list_resources_removed_by_repack.py | 95 | 3297 | #!/usr/bin/env python
# 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.
import os
import re
import sys
usage = """%s BUILDTYPE BUILDDIR
BUILDTYPE: either chromium or chrome.
BUILDDIR: The path to the outp... | bsd-3-clause |
gitaarik/monkful | tests/tests/basic_resource/put_identifier_field.py | 2 | 5212 | import unittest
import json
from datetime import datetime
from pymongo import MongoClient
from apps.basic_resource import server
from apps.basic_resource.documents import Article, Comment
class ResourcePutIdentifierField(unittest.TestCase):
"""
Test if a HTTP PUT that updates a resource that has an embedded
... | lgpl-3.0 |
nvie/python-mode | pymode/environment.py | 11 | 6338 | """ Define interfaces. """
from __future__ import print_function
import vim
import json
import time
import os.path
from ._compat import PY2
class VimPymodeEnviroment(object):
""" Vim User interface. """
prefix = '[Pymode]'
def __init__(self):
""" Init VIM environment. """
self.curren... | lgpl-3.0 |
ZLLab-Mooc/edx-platform | cms/djangoapps/contentstore/views/program.py | 15 | 2058 | """Programs views for use with Studio."""
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import Http404, JsonResponse
from django.utils.decorators import method_decorator
from django.views.generic import View
from edxmako.shortcuts import render_... | agpl-3.0 |
pombredanne/acora | acora/__init__.py | 2 | 10484 | """\
Acora - a multi-keyword search engine based on Aho-Corasick trees.
Usage::
>>> from acora import AcoraBuilder
Collect some keywords::
>>> builder = AcoraBuilder('ab', 'bc', 'de')
>>> builder.add('a', 'b')
Generate the Acora search engine::
>>> ac = builder.build()
Search a string for all occ... | bsd-3-clause |
skerit/shotfactory | shotfactory04/gui/windows/flock.py | 1 | 3182 | # browsershots.org - Test your web design in different browsers
# Copyright (C) 2007 Johann C. Rocholl <johann@browsershots.org>
#
# Browsershots 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 ... | gpl-3.0 |
uroybd/parsexl | parsexl.py | 1 | 1228 | """This Module Parse xls/xslx files and return data in json."""
import xlrd, datetime
from collections import OrderedDict
import simplejson as json
""" This function take 5 arguments:
inp = Input file
outp = Output file
sheet = Worksheet to work with in input file.
start = Starting row
end = Endin... | gpl-3.0 |
matthiascy/panda3d | direct/src/directscripts/doxygen_filter.py | 9 | 2333 | """ This script converts a file into a format that
doxygen can understand and process. It can be used
as an INPUT_FILTER in doxygen. """
import sys, os
# Explicitly include these files. Besides these, all
# files ending in _src will be explicitly included too.
INCLUDE_FILES = ["fltnames.h", "dblnames.h",
... | bsd-3-clause |
xen0l/ansible | lib/ansible/module_utils/network/f5/common.py | 2 | 18920 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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 os
import re
from ansible.module_utils._text import to_text
from ans... | gpl-3.0 |
yanheven/glance | glance/api/v2/model/metadef_property_type.py | 20 | 2354 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
buguelos/odoo | addons/lunch/wizard/lunch_order.py | 440 | 1299 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
smileboywtu/python-enhance | static/demo/tic-tac-toe.py | 1 | 5575 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Tic-Tac-Toe
# Plays the game of tic-tac-toe against a human opponent
# global constants
X = "X"
O = "O"
EMPTY = " "
TIE = "TIE"
NUM_SQUARES = 9
def display_instruct():
"""Display game instructions."""
print(
"""
Welcome to the greatest intellectual cha... | mit |
OCA/vertical-medical | medical_prescription_sale/models/sale_order_line.py | 2 | 4340 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | gpl-3.0 |
zstackio/zstack-woodpecker | integrationtest/vm/installation/upgrade/test_zs_degd_latest_1.5_on_cos7.py | 2 | 1889 | '''
@author: MengLai
'''
import os
import tempfile
import uuid
import time
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
test_stub = test_lib.lib_get_test_stub()
test_obj_dict = test_state.TestStateDict()
tm... | apache-2.0 |
MoonshineSG/OctoPrint | src/octoprint/util/avr_isp/stk500v2.py | 8 | 4705 | from __future__ import absolute_import, division, print_function
import os, struct, sys, time
from serial import Serial
from serial import SerialException
from builtins import range
from . import ispBase, intelHex
class Stk500v2(ispBase.IspBase):
def __init__(self):
self.serial = None
self.seq = 1
self.lastAd... | agpl-3.0 |
pleaseproject/python-for-android | python3-alpha/python3-src/Lib/encodings/raw_unicode_escape.py | 852 | 1208 | """ Python 'raw-unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is ... | apache-2.0 |
abhijeet9920/python_project | develop/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/request.py | 780 | 2128 | from __future__ import absolute_import
from base64 import b64encode
from ..packages.six import b
ACCEPT_ENCODING = 'gzip,deflate'
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
basic_auth=None, proxy_basic_auth=None, disable_cache=None):
"""
Shortcuts for generatin... | mit |
ad-uistyleguide/ad-uistyleguide.github.io | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/flock_tool.py | 604 | 1533 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""These functions are executed via gyp-flock-tool when using the Makefile
generator. Used on systems that don't have a built-in flock."""
... | mit |
naturali/tensorflow | tensorflow/contrib/distributions/python/ops/mvn.py | 1 | 28414 | # 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 |
pyoceans/pocean-core | pocean/dsg/trajectory/cr.py | 1 | 10376 | #!python
# coding=utf-8
from copy import copy
from collections import OrderedDict
import numpy as np
import pandas as pd
from pocean.utils import (
create_ncvar_from_series,
dict_update,
downcast_dataframe,
generic_masked,
get_default_axes,
get_dtype,
get_mapped_axes_variables,
get_mas... | mit |
scenarios/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/gamma_test.py | 7 | 14250 | # 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 |
xionzz/earthquake | venv/lib/python2.7/site-packages/numpy/core/setup.py | 8 | 42574 | from __future__ import division, print_function
import imp
import os
import sys
import shutil
import pickle
import copy
import warnings
import re
from os.path import join
from numpy.distutils import log
from distutils.dep_util import newer
from distutils.sysconfig import get_config_var
from setup_common import *
# S... | mit |
MalloyDelacroix/DownloaderForReddit | Tests/unittests/utils/importers/test_text_importer.py | 1 | 1164 | from unittest import TestCase
from DownloaderForReddit.utils.importers import text_importer
class TestTextImporter(TestCase):
def test_remove_forbidden_chars(self):
text = ' this \n is a\nname-for-import '
clean = text_importer.remove_forbidden_chars(text)
self.assertEqual('thisisaname-... | gpl-3.0 |
RavilN/freeopcua | tests/gtest/scripts/gen_gtest_pred_impl.py | 2538 | 21986 | #!/usr/bin/env python
#
# Copyright 2006, 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... | lgpl-3.0 |
primiano/blink-gitcs | Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py | 59 | 13691 | # Copyright (C) 2011 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 |
denisff/python-for-android | python-build/python-libs/gdata/src/gdata/spreadsheet/__init__.py | 147 | 17942 | #!/usr/bin/python
#
# Copyright (C) 2007 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 ... | apache-2.0 |
overcome/elasticsearch | dev-tools/upload-s3.py | 255 | 2375 | # Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | apache-2.0 |
wilvk/ansible | lib/ansible/modules/cloud/profitbricks/profitbricks_volume_attachments.py | 27 | 7796 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
bright-sparks/chromium-spacewalk | tools/perf/measurements/record_per_area_unittest.py | 33 | 1163 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from measurements import record_per_area
from telemetry.core import wpr_modes
from telemetry.unittest import options_for_unittests
from telemetry.unittest im... | bsd-3-clause |
bolkedebruin/airflow | airflow/_vendor/nvd3/cumulativeLineChart.py | 6 | 4048 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Python-nvd3 is a Python wrapper for NVD3 graph library.
NVD3 is an attempt to build re-usable charts and chart components
for d3.js without taking away the power that d3.js gives you.
Project location : https://github.com/areski/python-nvd3
"""
from .NVD3Chart import NVD... | apache-2.0 |
leeamen/eva | 2017/cutwords.py | 1 | 2739 | #!/usr/bin/python
#coding:utf-8
import mybaselib
import logging
import jieba
import jieba.analyse
import numpy as np
import csv
import sys
import stat
import os
import re
reload(sys)
sys.setdefaultencoding('utf-8')
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
class Row(object):
def __init__(s... | apache-2.0 |
40223232/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/display.py | 603 | 25179 | #!/usr/bin/env python
'''Pygame module to control the display window and screen.
This module offers control over the pygame display. Pygame has a single display
Surface that is either contained in a window or runs full screen. Once you
create the display you treat it as a regular Surface. Changes are not
immediately ... | gpl-3.0 |
asrar7787/Test-Frontools | node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py | 1789 | 10585 | # 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.
"""Xcode-ninja wrapper project file generator.
This updates the data structures passed to the Xcode gyp generator to build
with ninja instead. The Xcode project i... | mit |
abhinavmoudgil95/root | tutorials/tmva/keras/MulticlassKeras.py | 15 | 2346 | #!/usr/bin/env python
from ROOT import TMVA, TFile, TTree, TCut, gROOT
from os.path import isfile
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.regularizers import l2
from keras import initializations
from keras.optimizers import SGD
# Setup TMVA
TMVA.Tools.Instance()... | lgpl-2.1 |
mvaled/OpenUpgrade | addons/survey/controllers/main.py | 75 | 21298 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
ksmaheshkumar/weevely3 | utils/code.py | 15 | 1763 | from core.loggers import log
from distutils import spawn
from core import messages
import subprocess
# Minify PHP code removing white spaces and comments.
# Returns None in case of errors.
def minify_php(original_code):
php_binary = spawn.find_executable('php')
if not php_binary:
log.debug(messages.u... | gpl-3.0 |
fxfitz/ansible | lib/ansible/modules/network/avi/avi_cloudconnectoruser.py | 41 | 4186 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
2013Commons/hue | desktop/core/ext-py/requests-2.0.0/requests/packages/urllib3/_collections.py | 76 | 2898 | # urllib3/_collections.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
from collections import MutableMapping
from threading import RLock
try: # Python 2.7+
... | apache-2.0 |
zengluyang/ns3-d2d | src/core/bindings/modulegen_customizations.py | 121 | 7665 | import re
import os
import sys
from pybindgen.typehandlers import base as typehandlers
from pybindgen import ReturnValue, Parameter
from pybindgen.cppmethod import CustomCppMethodWrapper, CustomCppConstructorWrapper
from pybindgen.typehandlers.codesink import MemoryCodeSink
from pybindgen.typehandlers import ctypepars... | gpl-2.0 |
evansd/django | django/conf/locale/sk/formats.py | 65 | 1106 | # This file is distributed under the same license as the Django package.
#
# 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 = 'G:i'
DATETIME_FORMAT = 'j. F Y G:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMA... | bsd-3-clause |
watonyweng/horizon | openstack_dashboard/api/rest/network.py | 50 | 1431 |
# Copyright 2015, Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | apache-2.0 |
fener06/pyload | module/lib/Getch.py | 43 | 2048 | class Getch:
"""
Gets a single character from standard input. Does not echo to
the screen.
"""
def __init__(self):
try:
self.impl = _GetchWindows()
except ImportError:
try:
self.impl = _GetchMacCarbon()
except(AttributeError, Impo... | gpl-3.0 |
VMatrixTeam/open-matrix | src/webservice/model/snippet/snippet.py | 1 | 2067 | import model.base
import tornado.gen
import json
from MySQLdb import escape_string
class Snippet(object):
@staticmethod
@tornado.gen.coroutine
def get_snippets(id_from, count):
result = yield model.MatrixDB.query("select * from snippet_snippet order by createAt desc limit {0}, {1}".format(id_from,... | mit |
tudorian/eden | controllers/setup.py | 23 | 9689 | # -*- coding: utf-8 -*-
"""
Setup Tool
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
def index():
""" Show the index """
return dict()
# ----------------------------------------------------------... | mit |
sdague/home-assistant | homeassistant/components/flexit/climate.py | 16 | 5180 | """Platform for Flexit AC units with CI66 Modbus adapter."""
import logging
from typing import List
from pyflexit.pyflexit import pyflexit
import voluptuous as vol
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
from homeassistant.components.climate.const import (
HVAC_MODE_COOL,
S... | apache-2.0 |
chemelnucfin/tensorflow | tensorflow/python/keras/distribute/multi_worker_callback_test.py | 2 | 23430 | # 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 |
VWApplications/VWCourses | accounts/migrations/0004_auto_20170207_0350.py | 1 | 2273 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-07 03:50
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accounts', '0003_auto_20170203_0220'),
]
operation... | mpl-2.0 |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/tornado/template.py | 18 | 31175 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | gpl-3.0 |
beezee/GAE-Django-base-app | django/core/management/commands/flush.py | 249 | 3437 | from optparse import make_option
from django.conf import settings
from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
from django.core.management import call_command
from django.core.management.base import NoArgsCommand, CommandError
from django.core.management.color import no_style
from d... | bsd-3-clause |
edulramirez/nova | nova/api/openstack/compute/server_diagnostics.py | 33 | 2605 | # Copyright 2011 OpenStack Foundation
# 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 requ... | apache-2.0 |
bgxavier/neutron | neutron/cmd/eventlet/plugins/hyperv_neutron_agent.py | 46 | 1411 | # Copyright 2013 Cloudbase Solutions SRL
# 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 r... | apache-2.0 |
arista-eosplus/ansible | lib/ansible/modules/network/aos/aos_blueprint.py | 78 | 9017 | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.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 opt... | gpl-3.0 |
PokeHunterProject/pogom-updated | pogom/pgoapi/protos/POGOProtos/Networking/Responses/SetBuddyPokemonResponse_pb2.py | 6 | 4585 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Responses/SetBuddyPokemonResponse.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
... | mit |
mrshelly/openerp71313 | openerp/tools/float_utils.py | 151 | 9267 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
ric2b/Vivaldi-browser | chromium/third_party/blink/web_tests/external/wpt/tools/third_party/pytest/src/pytest.py | 34 | 1712 | # PYTHON_ARGCOMPLETE_OK
"""
pytest: unit and functional testing with Python.
"""
# else we are imported
from _pytest.config import main, UsageError, cmdline, hookspec, hookimpl
from _pytest.fixtures import fixture, yield_fixture
from _pytest.assertion import register_assert_rewrite
from _pytest.freeze_support import... | bsd-3-clause |
BT-ojossen/odoo | addons/share/__init__.py | 448 | 1093 | # -*- 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 |
variac/bazel | src/test/py/bazel/test_base.py | 1 | 10391 | # pylint: disable=g-bad-file-header
# Copyright 2017 The Bazel 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 |
tetherless-world/graphene | whyis/task_utils.py | 1 | 1444 | from celery.task.control import inspect
# def setup_task(service):
# service.app = app
# print(service)
# result = None
# if service.query_predicate == self.NS.whyis.globalChangeQuery:
# result = process_resource
# else:
# result = process_nanopub
# result.service = lambda : se... | apache-2.0 |
DecisionSystemsGroup/DSGos | airootfs/usr/share/DSGos-Installer/DSGos_Installer/installation/automatic.py | 2 | 14419 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# automatic.py
#
# Copyright © 2013-2015 DSGos
#
# This file is part of DSGos_Installer.
#
# DSGos_Installer 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... | mit |
hrashk/sympy | sympy/mpmath/tests/test_special.py | 37 | 2854 | from sympy.mpmath import *
def test_special():
assert inf == inf
assert inf != -inf
assert -inf == -inf
assert inf != nan
assert nan != nan
assert isnan(nan)
assert --inf == inf
assert abs(inf) == inf
assert abs(-inf) == inf
assert abs(nan) != abs(nan)
assert isnan(inf - in... | bsd-3-clause |
nicobustillos/odoo | addons/hr_attendance/hr_attendance.py | 56 | 9198 | # -*- 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 |
theonlydude/RandomMetroidSolver | solver/commonSolver.py | 1 | 37327 | import logging, time
from logic.smboolmanager import SMBoolManagerPlando as SMBoolManager
from logic.smbool import SMBool, smboolFalse
from logic.helpers import Bosses
from rom.romloader import RomLoader
from rom.rom_patches import RomPatches
from graph.graph import AccessGraphSolver as AccessGraph
from utils.utils im... | gpl-3.0 |
mitocw/edx-platform | openedx/core/lib/blockstore_api/tests/test_blockstore_api.py | 4 | 8710 | # -*- coding: utf-8 -*-
"""
Tests for xblock_utils.py
"""
import unittest
from uuid import UUID
from django.conf import settings
from openedx.core.lib import blockstore_api as api
# A fake UUID that won't represent any real bundle/draft/collection:
BAD_UUID = UUID('12345678-0000-0000-0000-000000000000')
@unittest.... | agpl-3.0 |
OSURoboticsClub/underwater | manual-control/test.py | 1 | 1354 | #!/usr/bin/env python2
import ctypes
from ctypes import byref
from time import sleep
class SensorData(ctypes.Structure):
_fields_ = (
('a', ctypes.c_uint16),
('b', ctypes.c_uint16),
('c', ctypes.c_uint8),
('d', ctypes.c_double),
('e', ctypes.c_uint32),
)
class Thrus... | mit |
partofthething/home-assistant | homeassistant/components/soma/config_flow.py | 22 | 2346 | """Config flow for Soma."""
import logging
from api.soma_api import SomaApi
from requests import RequestException
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_HOST, CONF_PORT
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
DEFAULT_PORT = 300... | mit |
gcode-mirror/audacity | lib-src/lv2/lv2/plugins/eg03-metro.lv2/waflib/Scripting.py | 85 | 10612 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,shlex,shutil,traceback,errno,sys,stat
from waflib import Utils,Configure,Logs,Options,ConfigSet,Context,Errors,Build,Node
build_dir_override=None
no_climb_commands=[... | gpl-2.0 |
Gchorba/Ask | lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py | 3132 | 36011 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | mit |
thatguystone/vault | vault/util.py | 1 | 1230 | import logging
import os
import sys
import subprocess
import time
_suffixes = [
[("k", "kb"), 0],
[("m", "mb"), 0],
[("g", "gb"), 0],
[("t", "tb"), 0],
]
log = logging.getLogger(__name__)
for i, s in enumerate(_suffixes):
if i == 0:
s[1] = 1024
else:
s[1] = _suffixes[i-1][1] * 1024
def human_size(size):
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.