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 |
|---|---|---|---|---|---|
eomwandho/treemapping | tree_mapping.py | 1 | 6612 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
TreeMapping
A QGIS plugin
A plugin to generate trees from satellite images
-------------------
begin : 2014-11-27
git s... | gpl-2.0 |
thenenadx/forseti-security | tests/inventory/pipelines/load_projects_buckets_pipeline_test.py | 2 | 4848 | # Copyright 2017 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 or agreed to in writing, s... | apache-2.0 |
peter-jang/ansible-modules-core | network/openswitch/ops_command.py | 15 | 4811 | #!/usr/bin/python
#
# 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.
#
# Ansible is distribut... | gpl-3.0 |
jor-/scipy | scipy/optimize/tests/test_tnc.py | 5 | 11199 | """
Unit tests for TNC optimization routine from tnc.py
"""
from numpy.testing import assert_allclose, assert_equal
import numpy as np
from math import pow
from scipy import optimize
from scipy.sparse.sputils import matrix
class TestTnc(object):
"""TNC non-linear optimization.
These tests are taken from P... | bsd-3-clause |
sde1000/quicktill | quicktill/recordwaste.py | 1 | 8726 | """Record waste against a stock item or stock line."""
from . import ui, td, keyboard, stock, stocklines, user
from .models import StockItem, StockType, RemoveCode, StockOut, StockLine
from .models import max_quantity
from decimal import Decimal
# There are two types of thing against which waste can be recorded:
#
#... | gpl-3.0 |
xiang12835/python_web | py2_web2py/web2py/applications/admin/languages/it.py | 1 | 36691 | # -*- coding: utf-8 -*-
{
'!langcode!': 'it',
'!langname!': 'Italiano',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati di un JOIN '... | apache-2.0 |
F483/bikesurf.org | apps/team/models.py | 3 | 4085 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Fabian Barkhau <fabian.barkhau@gmail.com>
# License: MIT (see LICENSE.TXT file)
from django.db.models import Model
from django.db.models import SlugField
from django.db.models import CharField
from django.db.models import BooleanField
from django.db.mode... | mit |
theJenix/mailplan | actions/download_qmags.py | 1 | 1778 | #
# A complicated mail action that downloads a Qmags PDF, moves it to ~/Dropbox/Qmags,
# moves the message to the "Downloaded Qmags" IMAP folder and marks it as read.
#
# TODO: split this action up into reusable atomic actions, that can accept arguments
# to avoid hardcoding paths and values
#
import urllib2
import r... | mit |
bsmrstu-warriors/Moytri---The-Drone-Aider | Lib/ctypes/__init__.py | 78 | 17383 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""create and manipulate C data types in Python"""
import os as _os, sys as _sys
__version__ = "1.1.0"
f... | gpl-3.0 |
xiandiancloud/ji | common/lib/xmodule/xmodule/modulestore/tests/test_cross_modulestore_import_export.py | 9 | 11585 | """
This suite of tests verifies that courses exported from one modulestore can be imported into
another modulestore and the result will be identical (ignoring changes to identifiers that are
the result of being imported into a course with a different course id).
It does this by providing facilities for creating and c... | agpl-3.0 |
joopert/home-assistant | homeassistant/helpers/restore_state.py | 2 | 9358 | """Support for restoring entity states on startup."""
import asyncio
import logging
from datetime import timedelta, datetime
from typing import Any, Dict, List, Set, Optional
from homeassistant.core import (
HomeAssistant,
callback,
State,
CoreState,
valid_entity_id,
)
from homeassistant.const impo... | apache-2.0 |
imuse2012/grit-i18n | grit/format/js_map_format_unittest.py | 61 | 2786 | #!/usr/bin/env python
# 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.
"""Unittest for js_map_format.py.
"""
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirna... | bsd-2-clause |
jgao54/airflow | airflow/contrib/sensors/imap_attachment_sensor.py | 7 | 3024 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
linjunzhe/p2pool | setup.py | 197 | 2181 | import os
import shutil
import sys
import zipfile
import platform
from distutils.core import setup
from distutils.sysconfig import get_python_lib
import py2exe
version = __import__('p2pool').__version__
im64 = '64' in platform.architecture()[0]
if os.path.exists('INITBAK'):
os.remove('INITBAK')
os.rename(os.path... | gpl-3.0 |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/numpy/lib/tests/test_function_base.py | 19 | 122857 | from __future__ import division, absolute_import, print_function
import operator
import warnings
import sys
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_array_equal,
assert_almost_equal, assert_array_almost_equal, assert_raises,
assert_allclose, ... | gpl-3.0 |
gabrielfalcao/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/views/urls.py | 47 | 6939 | # coding: utf-8
from os import path
from django.conf.urls.defaults import *
from models import *
import views
base_dir = path.dirname(path.abspath(__file__))
media_dir = path.join(base_dir, 'media')
locale_dir = path.join(base_dir, 'locale')
js_info_dict = {
'domain': 'djangojs',
'packages': ('regressionte... | gpl-3.0 |
drawks/ansible | lib/ansible/modules/cloud/google/gcp_sourcerepo_repository.py | 7 | 6662 | #!/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 |
diagramsoftware/odoo | addons/l10n_uy/__openerp__.py | 260 | 1807 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Openerp.uy <openerp.uy@lists.launchpad.net>
# Proyecto de Localización de OperERP para Uruguay
# $Id$
#
# This program i... | agpl-3.0 |
tunneln/CarnotKE | jyhton/lib-python/2.7/ihooks.py | 259 | 18986 | """Import hook support.
Consistent use of this module will make it possible to change the
different mechanisms involved in loading modules independently.
While the built-in module imp exports interfaces to the built-in
module searching and loading algorithm, and it is possible to replace
the built-in function __impor... | apache-2.0 |
labcodes/django | django/contrib/auth/checks.py | 103 | 6355 | from itertools import chain
from types import MethodType
from django.apps import apps
from django.conf import settings
from django.core import checks
from .management import _get_builtin_permissions
def check_user_model(app_configs=None, **kwargs):
if app_configs is None:
cls = apps.get_model(settings.A... | bsd-3-clause |
abhijo89/sphinxit | sphinxit/core/processor.py | 3 | 9719 | """
sphinxit.core.processor
~~~~~~~~~~~~~~~~~~~~~~~
Implements SphinxQL expression processing.
:copyright: (c) 2013 by Roman Semirook.
:license: BSD, see LICENSE for more details.
"""
from __future__ import unicode_literals
try:
from collections import OrderedDict
except ImportError:
fro... | bsd-3-clause |
xxxrac/git-repo | subcmds/rebase.py | 48 | 4130 | #
# Copyright (C) 2010 The Android Open Source Project
#
# 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 la... | apache-2.0 |
tipsi/aiozk | aiozk/recipes/election.py | 1 | 1242 | import asyncio
from .sequential import SequentialRecipe
class LeaderElection(SequentialRecipe):
def __init__(self, base_path):
super().__init__(base_path)
self.has_leadership = False
self.leadership_future = self.client.loop.create_future()
async def join(self):
await self.... | mit |
vinhqdang/wikipedia_analysis | lang_model/ruwiki/load.py | 3 | 2847 | import gensim
import os
import re
# from nltk.tokenize import RegexpTokenizer
# from stop_words import get_stop_words
# from nltk.stem.porter import PorterStemmer
from gensim.models.doc2vec import TaggedDocument
def get_doc_list(folder_name):
doc_list = []
# file_list = [folder_name+'/'+name for name in os.li... | gpl-2.0 |
eklinkhammer/gym-rover | gym_rover/state/world.py | 1 | 9223 | import math
import sys
import random
import numpy as np
from gym_rover.state.agent import Agent
from gym_rover.state.poi import POI
class World(object):
""" World is the container for rovers and POIs. It supports differing
observations, including an image, a series of local images,
and a... | mit |
kislyuk/aegea | aegea/ecs.py | 1 | 14519 | """
Manage AWS Elastic Container Service (ECS) resources, including Fargate tasks.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys, argparse, time, json, hashlib
from itertools import product
from functools import partial
from typing import Dict, List
from botoco... | apache-2.0 |
GbalsaC/bitnamiP | common/djangoapps/student/tests/test_events.py | 138 | 5942 | # -*- coding: utf-8 -*-
"""
Test that various events are fired for models in the student app.
"""
from django.test import TestCase
from django_countries.fields import Country
from student.models import PasswordHistory
from student.tests.factories import UserFactory
from student.tests.tests import UserSettingsEventTes... | agpl-3.0 |
Chuban/moose | python/peacock/utils/WidgetUtils.py | 6 | 7448 | import os
from mooseutils import message
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtCore import Qt
def addLineEdit(layout, parent, callback, readonly=False):
line = QtWidgets.QLineEdit(parent)
if callback:
line.editingFinished.connect(callback)
if layout is not None:
layout.addWidget(l... | lgpl-2.1 |
PythonCharmers/python-future | tests/test_future/test_standard_library.py | 2 | 20974 | """
Tests for the future.standard_library module
"""
from __future__ import absolute_import, print_function
from future import standard_library
from future import utils
from future.tests.base import unittest, CodeHandler, expectedFailurePY2
import sys
import tempfile
import os
import copy
import textwrap
from subproc... | mit |
maheshakya/scikit-learn | sklearn/datasets/california_housing.py | 43 | 3825 | """California housing dataset.
The original database is available from StatLib
http://lib.stat.cmu.edu/
The data contains 20,640 observations on 9 variables.
This dataset contains the average house value as target variable
and the following input variables (features): average income,
housing average age, averag... | bsd-3-clause |
odejesush/tensorflow | tensorflow/python/summary/event_multiplexer_test.py | 12 | 10490 | # 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 |
citrix-openstack/build-ryu | ryu/controller/mac_to_port.py | 63 | 1898 | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | apache-2.0 |
kartikdhar/djangotest | virt1/lib/python2.7/site-packages/django/core/cache/backends/base.py | 65 | 8793 | "Base Cache class."
from __future__ import unicode_literals
import time
import warnings
from django.core.exceptions import DjangoRuntimeWarning, ImproperlyConfigured
from django.utils.module_loading import import_string
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(DjangoRun... | mit |
wetneb/dissemin | papers/api.py | 2 | 7978 | # -*- encoding: utf-8 -*-
# Dissemin: open access policy enforcement tool
# Copyright (C) 2014 Antonin Delpeuch
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation; either version 2
# of th... | agpl-3.0 |
frohoff/Empire | lib/modules/powershell/management/restart.py | 2 | 1586 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Restart-Computer',
'Author': ['@harmj0y'],
'Description': ("Restarts the specified machine."),
'Background' : False,
'OutputExtensio... | bsd-3-clause |
mrucci/moto | moto/apigateway/models.py | 4 | 12492 | from __future__ import unicode_literals
import datetime
import httpretty
import requests
from moto.core import BaseBackend
from moto.core.utils import iso_8601_datetime_with_milliseconds
from .utils import create_id
STAGE_URL = "https://{api_id}.execute-api.{region_name}.amazonaws.com/{stage_name}"
class Deploymen... | apache-2.0 |
badock/nova | nova/tests/integrated/v3/test_admin_password.py | 8 | 1159 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | apache-2.0 |
Bulochkin/tensorflow_pack | tensorflow/python/kernel_tests/base64_ops_test.py | 154 | 5658 | # 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 |
synergeticsedx/deployment-wipro | openedx/core/djangoapps/theming/models.py | 15 | 1814 | """
Django models supporting the Comprehensive Theming subsystem
"""
from django.db import models
from django.conf import settings
from django.contrib.sites.models import Site
class SiteTheme(models.Model):
"""
This is where the information about the site's theme gets stored to the db.
`site` field is fo... | agpl-3.0 |
Curso-OpenShift/Formulario | OverFlow/ProjectFormulario/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## 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... | gpl-3.0 |
J-east/John-Bio | johnBio/settings/prod.py | 1 | 3098 | """
Django settings for johnBio project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
im... | mit |
ermaxw/sv | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/MSVSUtil.py | 566 | 9386 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
_TARGET_TYPE_EXT = {
'executable': '.exe',
'loadable_module': '.dll',
... | mit |
Donkey-Coding-Group/YAAAL | python/yaaal/views/api.py | 1 | 1537 | # coding: utf-8
# author: Niklas Rosenstein <rosensteinniklas@googlemail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | gpl-3.0 |
benpatterson/edx-platform | common/djangoapps/student/migrations/0018_auto.py | 188 | 10521 | # -*- 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):
# Adding index on 'CourseEnrollment', fields ['created']
db.create_index('student_courseenrollment', ['creat... | agpl-3.0 |
DistrictDataLabs/02-OKJK | source/Ingest/i_age.py | 2 | 1101 |
###############################################################################
# Imports
###############################################################################
import requests
###############################################################################
# Global Configs
##############################... | apache-2.0 |
elvestar/sunliang | fabfile.py | 3 | 16422 | from __future__ import print_function, unicode_literals
from future.builtins import input, open
import os
import re
import sys
from functools import wraps
from getpass import getpass, getuser
from glob import glob
from contextlib import contextmanager
from posixpath import join
from fabric.api import env, cd, prefix,... | mit |
scipy/scipy | benchmarks/benchmarks/optimize_qap.py | 13 | 2854 | import numpy as np
from .common import Benchmark, safe_import
import os
with safe_import():
from scipy.optimize import quadratic_assignment
# XXX this should probably have an is_xslow with selected tests.
# Even with this, it takes ~30 seconds to collect the ones to run
# (even if they will all be skipped in the... | bsd-3-clause |
back-to/streamlink | examples/gst-player.py | 8 | 3876 | #!/usr/bin/env python
from __future__ import print_function
import sys
import gi
from gi.repository import GObject as gobject, Gst as gst
from streamlink import Streamlink, StreamError, PluginError, NoPluginError
def exit(msg):
print(msg, file=sys.stderr)
sys.exit()
class StreamlinkPlayer(object):
d... | bsd-2-clause |
coolbombom/CouchPotatoServer | libs/tornado/platform/interface.py | 387 | 2244 | #!/usr/bin/env python
#
# Copyright 2011 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 |
chineyting/project4-Info3180 | server/lib/flask/helpers.py | 776 | 33793 | # -*- coding: utf-8 -*-
"""
flask.helpers
~~~~~~~~~~~~~
Implements various helpers.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import pkgutil
import posixpath
import mimetypes
from time import time
from zlib import adler32
from th... | apache-2.0 |
Alwnikrotikz/pysal | pysal/spatial_dynamics/tests/test_util.py | 20 | 1117 | import unittest
import pysal
from pysal.spatial_dynamics import util
import numpy as np
class ShuffleMatrix_Tester(unittest.TestCase):
def setUp(self):
self.X = np.arange(16)
self.X.shape = (4, 4)
def test_shuffle_matrix(self):
np.random.seed(10)
obs = util.shuffle_matrix(self... | bsd-3-clause |
dyoung418/tensorflow | tensorflow/contrib/data/python/kernel_tests/zip_dataset_op_test.py | 39 | 4394 | # 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 |
jimczi/elasticsearch | dev-tools/create_bwc_repo_with_ancient_indices.py | 160 | 2738 | import create_bwc_index
import logging
import os
import shutil
import subprocess
import sys
import tempfile
def fetch_version(version):
logging.info('fetching ES version %s' % version)
if subprocess.call([sys.executable, os.path.join(os.path.split(sys.argv[0])[0], 'get-bwc-version.py'), version]) != 0:
raise R... | apache-2.0 |
mantidproject/mantid | scripts/Interface/ui/drill/model/DrillAlgorithmObserver.py | 3 | 1758 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from qtpy.QtCore import QObject, Signal
fro... | gpl-3.0 |
Titan-C/sympy | doc/ext/sympylive.py | 104 | 1289 | """
sympylive
~~~~~~~~~
Allow `SymPy Live <http://live.sympy.org/>`_ to be used for interactive
evaluation of SymPy's code examples.
:copyright: Copyright 2014 by the SymPy Development Team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
def builder_inited(app):
if not app.conf... | bsd-3-clause |
liu602348184/django | django/template/exceptions.py | 483 | 1392 | """
This module contains generic exceptions used by template backends. Although,
due to historical reasons, the Django template language also internally uses
these exceptions, other exceptions specific to the DTL should not be added
here.
"""
class TemplateDoesNotExist(Exception):
"""
The exception used when ... | bsd-3-clause |
telerik/cloudbase-init | cloudbaseinit/tests/metadata/test_factory.py | 1 | 1543 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudbase Solutions Srl
#
# 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/LICEN... | apache-2.0 |
testbed/testbed | bin/tbd.py | 1 | 1274 | #!/usr/bin/python
"""
Single entry point for test bed CLI.
"""
import os
import sys
import logging
def parse():
""" main entry point. """
from testbed.core import commands
arg_parser = commands.main()
args = arg_parser.parse_args()
return commands.args_process(args)
def env_setup():
""" Mai... | gpl-3.0 |
cthecheese/Playground | Quarto/node_modules/node-gyp/gyp/pylib/gyp/common.py | 366 | 19638 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | mit |
mugurrus/ally-py-common | content/content/base/impl/guid_generator.py | 1 | 1294 | '''
Created on Apr 13, 2014
@package: content
@copyright: 2014 Sourcefabric o.p.s.
@license: http://www.gnu.org/licenses/gpl-3.0.txt
@author: Mugur Rus
Implementation for GUID generator.
'''
from datetime import datetime
from ally.container.support import setup
from content.base.api.guid_generator import IGUIDGenera... | gpl-3.0 |
noroutine/ansible | lib/ansible/modules/windows/win_robocopy.py | 43 | 4629 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Corwin Brown <blakfeld@gmail.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 Lic... | gpl-3.0 |
kubikusrubikus/mkdocs | mkdocs/tests/integration.py | 22 | 1589 | """
# MkDocs Integration tests
This is a simple integration test that builds the MkDocs
documentation against all of the builtin themes.
From the root of the MkDocs git repo, use:
python -m mkdocs.tests.integration --help
TODOs
- Build with different configuration options.
- Build documentation other t... | bsd-2-clause |
cstan11/Sick-Beard | lib/hachoir_parser/network/common.py | 90 | 3459 | from lib.hachoir_core.field import FieldSet, Field, Bits
from lib.hachoir_core.bits import str2hex
from lib.hachoir_parser.network.ouid import REGISTERED_OUID
from lib.hachoir_core.endian import BIG_ENDIAN
from socket import gethostbyaddr, herror as socket_host_error
def ip2name(addr):
if not ip2name.resolve:
... | gpl-3.0 |
natgeo/django-oauth-toolkit | example/example/middleware.py | 6 | 1913 | """
All responses will have Access-Control-Allow-Origin, and Access-Control-Allow-Methods
header items.
If a request has Access-Control-Request-Methods in the header, then an
HttpResponse object is returned with header containing Access-Control-Allow-Origin,
Access-Control-Allow-Methods, and Access-Control-Allow-Heade... | bsd-2-clause |
abhiQmar/servo | tests/wpt/css-tests/tools/manifest/tests/test_sourcefile.py | 59 | 12879 | import os
import pytest
from six import BytesIO
from ..sourcefile import SourceFile, read_script_metadata
def create(filename, contents=b""):
assert isinstance(contents, bytes)
return SourceFile("/", filename, "/", contents=contents)
def items(s):
item_type, items = s.manifest_items()
if item_type ... | mpl-2.0 |
funtoo/portage-funtoo | pym/portage/util/movefile.py | 1 | 13144 | # Copyright 2010-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import unicode_literals
__all__ = ['movefile']
import errno
import fnmatch
import os as _os
import shutil as _shutil
import stat
import sys
import subprocess
import textwrap
import portage
from... | gpl-2.0 |
jgruselius/misc | Python/index_color_balance.py | 1 | 10346 | #!/usr/bin/env python3
# Author: Joel Gruselius 2019
# Color balance checker for index sequences in Illumina sequencing
# Given a list of strings of nucleotide sequences, check if both color
# channels (red, green) are represented.
import argparse
import re
# MAYBE: Ensure equal length
# MAYBE: Make sure no index st... | apache-2.0 |
agriggio/pysmt | pysmt/walkers/tree.py | 2 | 2846 | #
# This file is part of pySMT.
#
# Copyright 2014 Andrea Micheli and Marco Gario
#
# 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 |
TeamTwisted/external_chromium_org | tools/telemetry/third_party/pyserial/serial/serialposix.py | 141 | 26585 | #!/usr/bin/env python
#
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# module for serial IO for POSIX compatible systems, like Linux
# see __init__.py
#
# (C) 2001-2010 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
#
# parts based on code from Gran... | bsd-3-clause |
hasteur/pywikibot_minimal | families/wikitravel_family.py | 4 | 18148 | # -*- coding: utf-8 -*-
import family, config
__version__ = '$Id: fca5eb801326bcaa23de6337ee771c7a2a079f42 $'
# The wikitravel family
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'wikitravel'
self.languages_by_size = [
'en', 'de',... | gpl-3.0 |
40123151ChengYu/finalexam | static/Brython3.1.1-20150328-091302/Lib/unittest/test/_test_warnings.py | 858 | 2304 | # helper module for test_runner.Test_TextTestRunner.test_warnings
"""
This module has a number of tests that raise different kinds of warnings.
When the tests are run, the warnings are caught and their messages are printed
to stdout. This module also accepts an arg that is then passed to
unittest.main to affect the b... | gpl-3.0 |
stansonhealth/ansible-modules-core | cloud/rackspace/rax_clb_nodes.py | 51 | 8626 | #!/usr/bin/python
# 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.
#
# Ansible is distributed... | gpl-3.0 |
fstagni/DIRAC | tests/Integration/Framework/FIXME_Test_LoggerClient.py | 4 | 1952 | # FIXME: to bring back to life
from __future__ import print_function
from DIRAC.Core.Base.Script import parseCommandLine
from DIRAC.FrameworkSystem.Client.LoggerClient import LoggerClient
parseCommandLine()
LClient = LoggerClient()
retval = LClient.getSites()
if not retval['OK']:
print(retval['Message'])
else:
... | gpl-3.0 |
Go-In/go-coup | web/storemanage/views/ticketRegister.py | 1 | 1823 | import requests
from django.shortcuts import render, redirect, reverse
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.models import User
from storemanage.models import Currency, Ticket
from usermanage.models import Store
from django.utils.dateparse import parse_d... | mit |
shrutisingala/ns-3-dev-git-limited-slow-start | src/wifi/doc/source/conf.py | 92 | 7432 | # -*- coding: utf-8 -*-
#
# ns-3 documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 14 09:00:39 2010.
#
# 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.
#
# All co... | gpl-2.0 |
affo/nova | nova/virt/xenapi/vif.py | 8 | 6531 | # Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
# Copyright (C) 2011 Nicira, 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 a... | apache-2.0 |
cloudera/hue | desktop/core/ext-py/py4j-0.9/src/py4j/tests/java_gateway_test.py | 15 | 28622 | # -*- coding: UTF-8 -*-
"""
Created on Dec 10, 2009
@author: barthelemy
"""
from __future__ import unicode_literals, absolute_import
from collections import deque
from decimal import Decimal
import gc
import math
from multiprocessing import Process
import os
from socket import AF_INET, SOCK_STREAM, socket
import subp... | apache-2.0 |
acshan/odoo | addons/mrp/wizard/change_production_qty.py | 245 | 4852 | # -*- 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 |
UrbanRiskSlumRedevelopment/Maya | node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py | 1361 | 45045 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
r"""Code to validate and convert settings of the Microsoft build tools.
This file contains code to validate and convert settings of the Microsoft
build tools. Th... | mit |
alsrgv/tensorflow | tensorflow/python/distribute/custom_training_loop_test.py | 1 | 8689 | # 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 |
feigames/Odoo | addons/fetchmail/__init__.py | 437 | 1120 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# mga@openerp.com
#
# This program is free software: you can redistribute it and/or mo... | agpl-3.0 |
rizar/attention-lvcsr | libs/Theano/theano/tests/test_2nd_order_grads.py | 4 | 5499 | """
Test for jacobian/hessian functions in Theano
"""
import unittest
from six.moves import xrange
from theano.tests import unittest_tools as utt
from theano import function
import theano
from theano import tensor
import numpy
utt.seed_rng()
def test001_jacobian_vector():
x = tensor.vector()
y = x * 2
r... | mit |
maoy/zknova | nova/test.py | 2 | 9491 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
ademmers/ansible | lib/ansible/parsing/dataloader.py | 29 | 19862 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import c... | gpl-3.0 |
NorfolkDataSci/presentations | 2018-01_chatbot/serverless-chatbots-workshop-master/LambdaFunctions/nlp/nltk/util.py | 7 | 48487 | # Natural Language Toolkit: Utility functions
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function
import locale
import re
import types
import textwrap
import pydoc
import bisect... | mit |
evancich/apm_motor | modules/waf/build_system_kit/nostate/ebdlib.py | 5 | 3483 | #! /usr/bin/env python
import os, sys, imp, time
from waflib import Context, Options, Configure, Utils, Logs, TaskGen, Task, Build, ConfigSet
import waflib.Tools.c
"""
Create a modified waf file in which tasks use timestamps only
see README.txt
"""
# we hard-code a configuration for c but it could be left in the scr... | gpl-3.0 |
gustavofonseca/packtools | tests/test_utils.py | 2 | 45352 | #coding: utf-8
from __future__ import unicode_literals
import unittest
import zipfile
import tempfile
import os
import io
import shutil
try:
from unittest import mock
except:
import mock
from PIL import Image, ImageFile
from lxml import etree
from packtools import utils, exceptions
BASE_XML = """<?xml vers... | bsd-2-clause |
flyingfish007/tempest | tempest/test_discover/test_discover.py | 17 | 2009 | # Copyright 2013 IBM Corp.
#
# 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 t... | apache-2.0 |
egenerat/flight-manager | django/contrib/localflavor/us/us_states.py | 10 | 5192 | """
A mapping of state misspellings/abbreviations to normalized abbreviations, and
an alphabetical list of states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
STATE_CHOICES = (
('AL', 'Alabama'),
('AK', 'A... | mit |
jagguli/intellij-community | plugins/hg4idea/testData/bin/mercurial/filemerge.py | 90 | 12851 | # filemerge.py - file-level merge handling for Mercurial
#
# Copyright 2006, 2007, 2008 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from node import short
from i18n import _
import util, simpleme... | apache-2.0 |
blademainer/intellij-community | python/lib/Lib/re.py | 115 | 12726 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... | apache-2.0 |
redcurrant/metacd-http | client/metacd.py | 1 | 9159 |
import json, httplib, urlparse, logging
def validate_rec(path,obj,schema):
"""Check the mandatory fields are present and with the same type than
in the schema, but does not check for exceeding fields."""
print path, "obj", repr(obj), "schema", repr(schema)
def succ(k):
return '/'.join((path,k))
if isinstance(s... | agpl-3.0 |
GSI/uzbl | uzbl/plugins/on_event.py | 4 | 3196 | '''Plugin provides arbitrary binding of uzbl events to uzbl commands.
Formatting options:
%s = space separated string of the arguments
%r = escaped and quoted version of %s
%1 = argument 1
%2 = argument 2
%n = argument n
Usage:
event ON_EVENT LINK_HOVER set selected_uri $1
--> LINK_HOVER http://uzbl.o... | gpl-3.0 |
OCA/account-invoicing | account_invoice_force_number/tests/test_account_force_number.py | 1 | 2626 | # Copyright 2016 Davide Corio - davidecorio.com
# Copyright 2017 Alex Comba - Agile Business Group
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
from odoo.exceptions import UserError
from odoo.tests.common import TransactionCase
class TestAccountForceNumber(TransactionCase):
def test_force_num... | agpl-3.0 |
chshu/openthread | tools/harness-automation/cases_R140/sed_6_3_1.py | 18 | 1871 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# notic... | bsd-3-clause |
sursum/buckanjaren | buckanjaren/lib/python3.5/site-packages/django/contrib/postgres/lookups.py | 106 | 1648 | from django.db.models import Lookup, Transform
from django.utils.encoding import force_text
from .search import SearchVector, SearchVectorExact, SearchVectorField
class PostgresSimpleLookup(Lookup):
def as_sql(self, qn, connection):
lhs, lhs_params = self.process_lhs(qn, connection)
rhs, rhs_para... | mit |
joshimio/blog | node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/other.py | 197 | 170951 | # -*- coding: utf-8 -*-
"""
pygments.lexers.other
~~~~~~~~~~~~~~~~~~~~~
Lexers for other languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, \
thi... | mit |
imsparsh/python-for-android | python3-alpha/python3-src/android-scripts/test.py | 45 | 5732 | import sys
import time
import types
import android
try:
import gdata.docs.service
except ImportError:
gdata = None
droid = android.Android()
def event_loop():
for i in range(10):
time.sleep(1)
droid.eventClearBuffer()
time.sleep(1)
e = droid.eventPoll(1)
if e.result is not None:
ret... | apache-2.0 |
TeamEOS/external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/__init__.py | 552 | 8263 | # Copyright 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 f... | bsd-3-clause |
v-zhongz/azure-linux-extensions | VMBackup/main/MachineIdentity.py | 5 | 1664 | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2014 Microsoft Corporation
#
# 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
#
# U... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.