repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
marc-sensenich/ansible | lib/ansible/module_utils/network/ftd/common.py | 22 | 6027 | # Copyright (c) 2018 Cisco and/or its affiliates.
#
# 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 v... | gpl-3.0 |
wisechengyi/pants | src/python/pants/util/collections.py | 1 | 3201 | # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import collections
import collections.abc
from typing import Any, Callable, DefaultDict, Iterable, List, MutableMapping, Type, TypeVar, Union
_K = TypeVar("_K")
_V = TypeVar("_V")
def f... | apache-2.0 |
imsut/commons | src/python/twitter/common/http/mirror_file.py | 2 | 2677 | import errno
import httplib
import os
import socket
import time
class MirrorFile(object):
def __init__(self, http_host, http_path, local_file, https=False):
"""
Given a file pointed to by 'url', mirror it to 'local_file', providing operations
to check that it's up to date.
"""
self._http_pat... | apache-2.0 |
uclouvain/osis | base/tests/views/learning_units/external/test_update.py | 1 | 4921 | ############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core bu... | agpl-3.0 |
bastik/youtube-dl | youtube_dl/extractor/eagleplatform.py | 65 | 3468 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
)
class EaglePlatformIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
eagleplatform:(?P<custom_host>[^/]+):|
... | unlicense |
abaldwin1/thumbor | tests/loaders/test_https_loader.py | 2 | 7454 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from os.path import abspath, join, dirname
from preggy import expect... | mit |
payeldillip/django | django/contrib/gis/sitemaps/views.py | 341 | 2421 | from __future__ import unicode_literals
from django.apps import apps
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.functions import AsKML, Transform
from django.contrib.gis.shortcuts import render_to_kml, render_to_kmz
from django.core.exceptions import FieldDoesNotExi... | bsd-3-clause |
trezor/micropython | ports/nrf/examples/ssd1306_mod.py | 3 | 1591 | # NOTE: Modified version to align with implemented I2C API in nrf port.
#
# Examples usage of SSD1306_SPI on pca10040
#
# from machine import Pin, SPI
# from ssd1306 import SSD1306_SPI
# spi = SPI(0, baudrate=40000000)
# dc = Pin.board.PA11
# res = Pin.board.PA12
# cs = Pin.board.PA13
# disp = SSD1306_SPI(128, 64, spi,... | mit |
mamachanko/lymph | lymph/core/connection.py | 8 | 4696 | # -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import gevent
import math
import os
import time
import logging
from lymph.utils import SampleWindow
from lymph.exceptions import RpcError
logger = logging.getLogger(__name__)
UNKNOWN = 'unknown'
RESPONSIVE = 'responsive'
UNRESPONSIVE = 'unres... | apache-2.0 |
GoogleCloudPlatform/training-data-analyst | courses/data-engineering/kubeflow-examples/mnist/testing/conftest.py | 2 | 3215 | import os
import pytest
def pytest_addoption(parser):
parser.addoption(
"--tfjob_name", help="Name for the TFjob.",
type=str, default="mnist-test-" + os.getenv('BUILD_ID'))
parser.addoption(
"--namespace", help=("The namespace to run in. This should correspond to"
"a namespac... | apache-2.0 |
devdelay/home-assistant | homeassistant/util/__init__.py | 1 | 13534 | """Helper methods for various modules."""
from collections.abc import MutableSet
from itertools import chain
import threading
import queue
from datetime import datetime
import re
import enum
import socket
import random
import string
from functools import wraps
from types import MappingProxyType
from typing import Any,... | mit |
bxlab/bx-python | lib/bx/align/epo.py | 1 | 11523 | """Classes and utilities for mutliple alignments from the EPO pipeline"""
import logging
import os
import pickle as cPickle
import re
from collections import namedtuple
from ._epo import ( # noqa: F401
bed_union,
cummulative_intervals,
fastLoadChain,
rem_dash
)
log = logging.getLogger(__name__)
... | mit |
xutian/virt-test | virttest/qemu_monitor_unittest.py | 14 | 11219 | import unittest
import common
from qemu_monitor import Monitor
import qemu_monitor
class MockMonitor(qemu_monitor.Monitor):
""" Dummy class inherited from qemu_monitor.HumanMonitor """
def __init__(self): # pylint: disable=W0231
pass
def __del__(self):
pass
class InfoNumaTests(un... | gpl-2.0 |
perkinslr/pypyjs | website/js/pypy.js-0.2.0/lib/modules/profile.py | 166 | 22782 | #! /usr/bin/env python
#
# Class for profiling python code. rev 1.0 6/2/94
#
# Written by James Roskind
# Based on prior profile module by Sjoerd Mullender...
# which was hacked somewhat by: Guido van Rossum
"""Class for profiling Python code."""
# Copyright Disney Enterprises, Inc. All Rights Reserved.
# License... | mit |
Arcensoth/cogbot | cogbot/cogs/join_leave/join_leave_server_state.py | 1 | 2346 | from discord import Member, Role
from discord.ext.commands import Context
from cogbot.cogs.abc.base_cog import BaseCogServerState
from cogbot.cogs.join_leave.join_leave_options import JoinLeaveOptions
class JoinLeaveServerState(BaseCogServerState[JoinLeaveOptions]):
async def create_options(self) -> JoinLeaveOpt... | mit |
MSOpenTech/edx-platform | openedx/core/djangoapps/course_groups/management/commands/tests/test_remove_users_from_multiple_cohorts.py | 91 | 3951 | """
Tests for cleanup of users which are added in multiple cohorts of a course
"""
from django.core.exceptions import MultipleObjectsReturned
from django.core.management import call_command
from django.test.client import RequestFactory
from openedx.core.djangoapps.course_groups.views import cohort_handler
from openedx... | agpl-3.0 |
Rahulsharma0810/Scrapy-Python-TheHinduDailyNews | TheHinduDailyNews/settings.py | 1 | 3227 | # -*- coding: utf-8 -*-
# Scrapy settings for TheHinduDailyNews project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org... | mit |
glennrub/micropython | tests/extmod/vfs_lfs.py | 10 | 3777 | # Test for VfsLittle using a RAM device
try:
import uos
uos.VfsLfs1
uos.VfsLfs2
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
class RAMBlockDevice:
ERASE_BLOCK_SIZE = 1024
def __init__(self, blocks):
self.data = bytearray(blocks * self.ERASE_BLOCK_SIZE)
... | mit |
Protoneer/Arduino | arduino-core/src/processing/app/i18n/python/requests/packages/charade/big5prober.py | 2931 | 1684 | ######################## 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... | lgpl-2.1 |
mypinballs/whirlwind | effects.py | 1 | 8263 | # Top Rollover Lanes
__author__="jim"
__date__ ="$Jan 18, 2011 1:36:37 PM$"
import procgame
import locale
from procgame import *
base_path = config.value_for_key_path('base_path')
game_path = base_path+"games/whirlwind/"
class Effects(game.Mode):
def __init__(self, game, priority):
super(Effects, sel... | gpl-3.0 |
aayush2911/Fibonaccio | web2py/gluon/contrib/memcache/__init__.py | 40 | 3734 | from gluon.contrib.memcache.memcache import Client
from gluon.cache import CacheAbstract
import time
"""
examle of usage:
cache.memcache = MemcacheClient(request,[127.0.0.1:11211],debug=true)
"""
import cPickle as pickle
import thread
from gluon import current
DEFAULT_TIME_EXPIRE = 300 # seconds (must be the same a... | gpl-2.0 |
TheTypoMaster/my-vim-set-mac | .vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/test/test_importhook.py | 50 | 1358 | # -*- coding: utf-8 -*-
import unittest
import sys, os
import imp
class TestImportHooks(unittest.TestCase):
def make_module(self, name, **args):
mod = sys.modules.setdefault(name, imp.new_module(name))
mod.__file__ = '<virtual %s>' % name
mod.__dict__.update(**args)
return mod
... | gpl-2.0 |
Cisco-Talos/pyrebox | volatility/setup.py | 12 | 3606 | #!/usr/bin/env python
# Volatility
#
# Authors:
# AAron Walters <awalters@4tphi.net>
# Mike Auty <mike.auty@gmail.com>
#
# This file is part of Volatility.
#
# Volatility 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 ... | gpl-2.0 |
lilmuck/lilmuck | plugin.video.szenestreams/default.py | 1 | 6874 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib,urllib2,re,xbmcaddon,xbmcplugin,xbmcgui,xbmc,HTMLParser
from stream import *
htmlparser = HTMLParser.HTMLParser()
pluginhandle = int(sys.argv[1])
itemcnt = 0
baseurl = 'http://www.szene-streams.com'
settings = xbmcaddon.Addon(id='plugin.video.szene-streams')
maxi... | gpl-2.0 |
tseaver/gcloud-python | videointelligence/nox.py | 1 | 2462 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
andrewcmyers/tensorflow | tensorflow/python/kernel_tests/metrics_test.py | 28 | 139808 | # 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 |
jupierce/openshift-tools | ansible/roles/oso_zagg_deploy/filter_plugins/filters.py | 25 | 2619 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
'''
Custom filters for use in openshift_sso_app
'''
class FilterModule(object):
''' Custom ansible filters '''
@staticmethod
def get_running_pods(podlist_results, pod_names_to_match):
''' This is a filter to see whi... | apache-2.0 |
deepcell/xhtml2pdf | xhtml2pdf/document.py | 37 | 6381 | # -*- coding: utf-8 -*-
from xhtml2pdf.context import pisaContext
from xhtml2pdf.default import DEFAULT_CSS
from xhtml2pdf.parser import pisaParser
from reportlab.platypus.flowables import Spacer
from reportlab.platypus.frames import Frame
from xhtml2pdf.xhtml2pdf_reportlab import PmlBaseDoc, PmlPageTemplate
from xhtml... | apache-2.0 |
Skyeouyang/Text-Analytics-Project | lexicon analysis.py | 1 | 2398 | #######################################
##Author Skye Ouyang
##Date 19th Apr.
#######################################
import glob
import os
def IsNotNull(value):
return value is not None and len(value) > 0
#create weapon list
dict_weapon = []
weapons = open('D:/1. msba/Trimester II Jan.2017-May.2017... | apache-2.0 |
ueshin/apache-spark | python/pyspark/sql/context.py | 15 | 23877 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
onceuponatimeforever/oh-mainline | vendor/packages/gdata/samples/contentforshopping/add_product.py | 32 | 1571 | #!/usr/bin/python
#
# Copyright 2009 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 b... | agpl-3.0 |
NeovaHealth/odoo | addons/marketing_campaign/marketing_campaign.py | 51 | 41800 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
gandalfcode/gandalf | examples/example09.py | 1 | 1749 | #==============================================================================
# example09.py
# Create initial conditions for pure N-body simulation inside the python
# script, and then run the simulation to completion while plotting results.
#===========================================================================... | gpl-2.0 |
swdream/neutron | neutron/tests/unit/api/v2/test_resource.py | 28 | 14954 | # Copyright (c) 2012 Intel Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | apache-2.0 |
gunzy83/ansible-modules-extras | monitoring/datadog_event.py | 33 | 5325 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Author: Artūras 'arturaz' Šlajus <x11@arturaz.net>
# Author: Naoya Nakazawa <naoya.n@gmail.com>
#
# This module is proudly sponsored by iGeolise (www.igeolise.com) and
# Tiny Lab Productions (www.tinylabproductions.com).
#
# This file is part of Ansible
#
# Ansible is free ... | gpl-3.0 |
ciudadanointeligente/votainteligente-portal-electoral | popular_proposal/rest_api.py | 2 | 1890 | from rest_framework.serializers import (HyperlinkedModelSerializer,
JSONField,
StringRelatedField)
from rest_framework.viewsets import ReadOnlyModelViewSet
from popular_proposal.models import PopularProposal, Commitment
from elections.model... | gpl-3.0 |
ycl2045/nova-master | nova/scheduler/filters/isolated_hosts_filter.py | 13 | 3321 | # Copyright (c) 2011-2012 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
#
# Un... | apache-2.0 |
EricSB/nupic | tests/unit/nupic/research/spatial_pooler_boost_test.py | 15 | 11879 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
mrtnrdl/.macdots | scripts/bin/platform-tools/systrace/catapult/common/py_utils/py_utils/refactor/annotated_symbol/function_definition.py | 9 | 1301 | # Copyright 2015 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 symbol
from py_utils.refactor.annotated_symbol import base_symbol
__all__ = [
'Function',
]
class Function(base_symbol.AnnotatedSymbol):
# ... | unlicense |
rgerkin/neuroConstruct | lib/jython/Lib/modjy/modjy_log.py | 109 | 2133 | ###
#
# Copyright Alan Kennedy.
#
# You may contact the copyright holder at this uri:
#
# http://www.xhaus.com/contact/modjy
#
# The licence under which this code is released is the Apache License v2.0.
#
# The terms and conditions of this license are listed in a file contained
# in the distribution that also cont... | gpl-2.0 |
BizzCloud/PosBox | addons/mrp_repair/__openerp__.py | 65 | 2540 | # -*- 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 |
raphaelmerx/django-rest-framework | rest_framework/utils/field_mapping.py | 39 | 9402 | """
Helper functions for mapping model fields to a dictionary of default
keyword arguments that should be used for their equivelent serializer fields.
"""
import inspect
from django.core import validators
from django.db import models
from django.utils.text import capfirst
from rest_framework.compat import clean_manyt... | bsd-2-clause |
sodafree/backend | build/ipython/build/lib.linux-i686-2.7/IPython/core/macro.py | 3 | 1942 | """Support for interactive macros in IPython"""
#*****************************************************************************
# Copyright (C) 2001-2005 Fernando Perez <fperez@colorado.edu>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of th... | bsd-3-clause |
Sjc1000/PyRC | UI/Disabled/FriendsList.py | 1 | 2227 | #!/usr/bin/env python3
from gi.repository import Gtk, Gdk
import json
class FriendsList():
servers = {}
active_server = None
def __init__(self, MainWindow):
self.MainWindow = MainWindow
self.position = [8, 5, 1, 4]
def prebuild(self):
self.MainWindow.ui_plugins['UserList']... | gpl-2.0 |
JonatanAntoni/CMSIS_5 | CMSIS/DSP/PythonWrapper/testdsp2.py | 2 | 9453 | import cmsisdsp as dsp
import numpy as np
from scipy import signal
from scipy.fftpack import dct
import fixedpoint as f
from pyquaternion import Quaternion
import colorama
from colorama import init,Fore, Back, Style
import statsmodels.tsa.stattools
import scipy.spatial
init()
def printTitle(s):
print("\n" + F... | apache-2.0 |
tsgit/invenio | modules/miscutil/lib/upgrades/invenio_2013_03_18_aidPERSONIDDATA_last_updated.py | 18 | 1694 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
Kongsea/tensorflow | tensorflow/contrib/tensorboard/plugins/trace/trace_test.py | 124 | 2749 | # 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 |
xychu/product-definition-center | pdc/apps/compose/lib.py | 3 | 12345 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import os
import json
import kobo
from django.db import transaction, connection
from django.db.models import Q
from rest_framework import serializers
from pdc.apps.package.models impo... | mit |
stricaud/dionaea | modules/python/scripts/logsql.py | 8 | 33468 | #********************************************************************************
#* Dionaea
#* - catches bugs -
#*
#*
#*
#* Copyright (C) 2009 Paul Baecher & Markus Koetter
#*
#* This program is free software; you can redistribute it and/or
#* modify it under t... | gpl-2.0 |
lisael/pg-django | tests/regressiontests/conditional_processing/models.py | 34 | 6931 | # -*- coding:utf-8 -*-
from datetime import datetime
from django.test import TestCase
from django.utils import unittest
from django.utils.http import parse_etags, quote_etag, parse_http_date
FULL_RESPONSE = 'Test conditional get response'
LAST_MODIFIED = datetime(2007, 10, 21, 23, 21, 47)
LAST_MODIFIED_STR = 'Sun, 2... | bsd-3-clause |
AlexHatesUnicorns/FDTD_Solver | world_surface/helpers/generate_surface.py | 2 | 1056 | import numpy as np
def generate_surface(y_size, delta_x, grain_size):
wing_size = 12 * grain_size
noise = np.random.random(y_size + wing_size) * 2 * delta_x - delta_x
noise = noise / np.max(noise) * delta_x
gauss = np.fromfunction(lambda i: np.exp(
(i - 3 * grain_size) / (2 * grain_size ^ 2)),... | mit |
shahbaz17/zamboni | sites/dev/settings_base.py | 6 | 5379 | """private_base will be populated from puppet and placed in this directory"""
import logging
import os
import dj_database_url
from mkt.settings import (CACHE_PREFIX, ES_INDEXES,
KNOWN_PROXIES, LOGGING, HOSTNAME)
from .. import splitstrip
import private_base as private
ALLOWED_HOSTS = ['.a... | bsd-3-clause |
hgl888/chromium-crosswalk | tools/telemetry/telemetry/value/trace.py | 4 | 4900 | # 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 datetime
import logging
import os
import random
import shutil
import StringIO
import sys
import tempfile
from catapult_base import cloud_storage
from... | bsd-3-clause |
UniversalMasterEgg8679/ansible | lib/ansible/plugins/action/win_copy.py | 185 | 1153 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or
# (at your option) an... | gpl-3.0 |
antoyo/qutebrowser | qutebrowser/utils/jinja.py | 4 | 2886 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/boto-2.38.0/boto/plugin.py | 150 | 2711 | # Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | mit |
skomski/duktape | src/genstrings.py | 9 | 36208 | #!/usr/bin/python
#
# Generate a list of built-in strings required by Duktape code, output
# duk_strings.h (defines) and duk_strings.c (string data). Raw string
# data is also written to duk_strings.bin.
#
# These strings may be required by execution and/or compilation, or
# built-in code. Strings are included h... | mit |
joelddiaz/openshift-tools | openshift/installer/vendored/openshift-ansible-3.7.42-1/roles/lib_utils/src/ansible/yedit.py | 25 | 2195 | # flake8: noqa
# pylint: skip-file
# pylint: disable=too-many-branches
def main():
''' ansible oc module for secrets '''
module = AnsibleModule(
argument_spec=dict(
state=dict(default='present', type='str',
choices=['present', 'absent', 'list']),
debug=d... | apache-2.0 |
ericvandenbergfb/spark | examples/src/main/python/sql/hive.py | 50 | 3318 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
colloquium/spacewalk | client/tools/rhnpush/rhnpush.py | 1 | 27859 | #
# Copyright (c) 2008--2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
avoinsystems/odoo | addons/project_issue_sheet/__openerp__.py | 260 | 1814 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/IPython/kernel/inprocess/client.py | 4 | 5681 | """A client for in-process kernels."""
#-----------------------------------------------------------------------------
# Copyright (C) 2012 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#------------... | mit |
837468220/python-for-android | python3-alpha/python3-src/Lib/encodings/__init__.py | 46 | 5146 | """ Standard "encodings" Package
Standard Python encoding modules are stored in this package
directory.
Codec modules must have names corresponding to normalized encoding
names as defined in the normalize_encoding() function below, e.g.
'utf-8' must be implemented by the module 'utf_8.py'.
Ea... | apache-2.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/comtypes-1.1.3-py2.7.egg/comtypes/test/test_BSTR.py | 3 | 1503 | import unittest, os
from ctypes import *
from comtypes import BSTR
from comtypes.test import requires
##requires("memleaks")
from comtypes.test.find_memleak import find_memleak
class Test(unittest.TestCase):
def check_leaks(self, func, limit=0):
bytes = find_memleak(func)
self.failIf(bytes > limi... | gpl-3.0 |
wujuguang/sqlalchemy | lib/sqlalchemy/dialects/postgresql/pygresql.py | 1 | 8129 | # postgresql/pygresql.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: postgresql+pygresql
:name: pygresql
:dbapi: pgdb
... | mit |
bugbound/webnuke | libs/angular/angularCustomJavascript.py | 1 | 1178 | class AngularCustomJavascript:
def __init__(self, jsinjector):
self.version = 0.1
self.jsinjector = jsinjector
self.jsinjector.add_help_topic('wn_showAngularAppName()', 'Show AngularJS Main Application Name')
self.jsinjector.add_js_file('libs/angular/js/app-name.js')
self.jsinjector.add_help_topic('wn_sho... | mit |
django-fluent/django-fluent-contents | fluent_contents/plugins/sharedcontent/templatetags/sharedcontent_tags.py | 2 | 5909 | from django.contrib.sites.models import Site
from django.core.cache import cache
from django.template import Library, TemplateSyntaxError
from django.utils.translation import get_language
from tag_parser.basetags import BaseAssignmentOrOutputNode
from fluent_contents import appsettings, rendering
from fluent_contents.... | apache-2.0 |
gabrielrumiranda/coigosUteis | todosfib.py | 2 | 1616 | #Código que mostra a implementação do cálculo de Fibonacci de várias maneiras e compara suas velocidades
# -*- coding: utf-8 -*-
# Versao trivial
def fib_trivial(n):
if n == 1 or n == 2:
return 1
return fib_trivial(n-1) + fib_trivial(n-2)
# Versão com cache
cache = {}
def fib_cache(n):
if n == 1 or ... | gpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.6/Lib/plat-irix5/torgb.py | 132 | 2869 | # Convert "arbitrary" image files to rgb files (SGI's image format).
# Input may be compressed.
# The uncompressed file type may be PBM, PGM, PPM, GIF, TIFF, or Sun raster.
# An exception is raised if the file is not of a recognized type.
# Returned filename is either the input filename or a temporary filename;
# in th... | mit |
kennethgillen/ansible | contrib/inventory/docker.py | 36 | 33532 | #!/usr/bin/env python
#
# (c) 2016 Paul Durivage <paul.durivage@gmail.com>
# Chris Houseknecht <house@redhat.com>
# James Tanner <jtanner@redhat.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 Lic... | gpl-3.0 |
bebbi/closure-library | closure/bin/labs/code/generate_jsdoc_test.py | 212 | 3494 | #!/usr/bin/env python
#
# Copyright 2013 The Closure Library 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 |
jayceyxc/hue | desktop/core/ext-py/boto-2.42.0/tests/integration/cloudsearch/test_layers.py | 130 | 2742 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the right... | apache-2.0 |
chengduoZH/Paddle | python/paddle/fluid/tests/unittests/test_expand_op.py | 2 | 6481 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
faridani/pyDoc | Unidecode/build/lib/unidecode/x064.py | 252 | 4655 | data = (
'Chan ', # 0x00
'Ge ', # 0x01
'Lou ', # 0x02
'Zong ', # 0x03
'Geng ', # 0x04
'Jiao ', # 0x05
'Gou ', # 0x06
'Qin ', # 0x07
'Yong ', # 0x08
'Que ', # 0x09
'Chou ', # 0x0a
'Chi ', # 0x0b
'Zhan ', # 0x0c
'Sun ', # 0x0d
'Sun ', # 0x0e
'Bo ', # 0x0f
'Chu ', # 0x10
... | mit |
Ensembles/ert | python/python/ert/util/stat.py | 2 | 2312 | # Copyright (C) 2011 Statoil ASA, Norway.
#
# The file 'stat.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 ... | gpl-3.0 |
samabhi/pstHealth | venv/lib/python2.7/site-packages/django/contrib/redirects/migrations/0001_initial.py | 308 | 1561 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Redirect',
fields=[
... | mit |
LockScreen/Backend | venv/lib/python2.7/site-packages/botocore/docs/sharedexample.py | 1 | 9129 | # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | mit |
ElDeveloper/qiime | tests/test_parallel/test_identify_chimeric_seqs.py | 15 | 72170 | #!/usr/bin/env python
from __future__ import division
__author__ = "Jai Ram Rideout"
__copyright__ = "Copyright 2012, The QIIME project"
__credits__ = ["Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Jai Ram Rideout"
__email__ = "jai.rideout@gmail.com"
from shutil import rmtree
from... | gpl-2.0 |
ShassAro/ShassAro | DockerAdmin/dockerVirtualEnv/lib/python2.7/site-packages/django/test/html.py | 116 | 7962 | """
Comparing two html documents.
"""
from __future__ import unicode_literals
import re
from django.utils.encoding import force_text
from django.utils.html_parser import HTMLParser, HTMLParseError
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
WHITESPACE = re.compile('\s+... | gpl-2.0 |
TNT-Samuel/Coding-Projects | DNS Server/Source/Lib/site-packages/urllib3/util/retry.py | 24 | 15104 | from __future__ import absolute_import
import time
import logging
from collections import namedtuple
from itertools import takewhile
import email
import re
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
InvalidHeader,
)
from ..pack... | gpl-3.0 |
olgabrani/synnefo | snf-cyclades-app/synnefo/logic/management/commands/subnet-create.py | 10 | 5234 | # Copyright (C) 2010-2014 GRNET S.A.
#
# 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 version.
#
# This program is distributed i... | gpl-3.0 |
allthroughthenight/aces | web2py/gluon/contrib/qdb.py | 43 | 32143 | #!/usr/bin/env python
# coding:utf-8
"Queues(Pipe)-based independent remote client-server Python Debugger"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2011 Mariano Reingart"
__license__ = "LGPL 3.0"
__version__ = "1.01b"
# remote debugger queue-based (jsonrpc-like interface):
... | gpl-3.0 |
evanma92/routeh | flask/lib/python2.7/site-packages/pip/_vendor/html5lib/sanitizer.py | 805 | 16428 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from .tokenizer import HTMLTokenizer
from .constants import tokenTypes
class HTMLSanitizerMixin(object):
""" sanitization of XHTML+MathML+SVG and of inline style attributes."""
accepta... | bsd-3-clause |
vault/Sonata | sonata/tray.py | 6 | 5063 |
import gtk, gobject
class TrayIconTips(gtk.Window):
"""Custom tooltips derived from gtk.Window() that allow for markup text and multiple widgets, e.g. a progress bar. ;)"""
MARGIN = 4
def __init__(self):
gtk.Window.__init__(self, gtk.WINDOW_POPUP)
# from gtktooltips.c:gtk_tooltips_force_w... | gpl-3.0 |
IPVL/swift-kilo | swift/account/backend.py | 11 | 23433 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | apache-2.0 |
MattsFleaMarket/python-for-android | python-build/python-libs/gdata/tests/gdata_tests/calendar_test.py | 87 | 38211 | #!/usr/bin/python
#
# Copyright (C) 2006 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 |
goulu/Goulib | tests/test_Goulib_itertools2.py | 1 | 16319 | #!/usr/bin/env python
# coding: utf8
from nose.tools import assert_equal, assert_not_equals
from nose import SkipTest
#lines above are inserted automatically by pythoscope. Line below overrides them
from Goulib.tests import *
from Goulib.itertools2 import *
class TestTake:
def test_take(self):
... | lgpl-3.0 |
joyider/op_mon | tests/test_functional.py | 1 | 3998 | # -*- coding: utf-8 -*-
"""Functional tests using WebTest.
See: http://webtest.readthedocs.org/
"""
from flask import url_for
from op_mon.user.models import User
from .factories import UserFactory
class TestLoggingIn:
"""Login."""
def test_can_log_in_returns_200(self, user, testapp):
"""Login succ... | bsd-3-clause |
disqus/zumanji | src/zumanji/views.py | 1 | 6969 | from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import transaction
from django.http import HttpResponseRedirect, HttpResponseForbidden
from django.shortcuts import render, get_object_or_404
from django.utils import simplejson
from django.views.decorators.csrf import csrf_pro... | apache-2.0 |
fernandog/Medusa | ext/boto/logs/layer1.py | 146 | 22588 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | gpl-3.0 |
ZwEin27/phone-number-matcher | dig_phone_extractor.py | 1 | 23737 | # -*- coding: utf-8 -*-
# @Author: ZwEin
# @Date: 2016-06-21 12:36:47
# @Last Modified by: ZwEin
# @Last Modified time: 2016-09-29 21:54:12
import os
import re
import sys
import json
import copy
import types
import string
import collections
import phonenumbers
from datetime import datetime
from crf_tokenizer imp... | apache-2.0 |
ampax/edx-platform | common/test/acceptance/tests/lms/test_lms_cohorted_courseware_search.py | 13 | 14570 | """
Test courseware search
"""
import json
import uuid
from ..helpers import remove_file
from ...pages.common.logout import LogoutPage
from ...pages.studio.overview import CourseOutlinePage
from ...pages.lms.courseware_search import CoursewareSearchPage
from ...pages.lms.staff_view import StaffPage
from ...fixtures.c... | agpl-3.0 |
eric-stanley/robotframework | src/robot/libraries/DateTime.py | 2 | 28623 | # Copyright 2008-2014 Nokia Solutions and Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
kobejean/tensorflow | tensorflow/contrib/distribute/python/tpu_strategy.py | 1 | 20404 | # Copyright 2018 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 |
grlee77/nipype | nipype/interfaces/ants/utils.py | 9 | 7912 | """ANTS Apply Transforms interface
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
>>> os.chdir(datadir)
"""
import os
from .base import ANTS... | bsd-3-clause |
martinbede/second-sight | tensorflow/python/kernel_tests/trace_op_test.py | 13 | 2192 | # 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 |
ChristophKuhfuss/supertuxNEAT | tools/font-add-border.py | 7 | 2242 | #!/usr/bin/env python3
# SuperTux
# Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.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) an... | gpl-3.0 |
isyippee/nova | nova/api/openstack/compute/suspend_server.py | 6 | 2923 | # 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 to in w... | apache-2.0 |
ladybug-tools/honeybee | honeybee_plus/utilcol.py | 1 | 1078 | """A collection of useful utilities for Honeybee"""
import uuid
import re
def random_name(shorten=True):
"""Generate a random name as a string using uuid.
Args:
shorten: If True the name will be the first to segment of uuid.
"""
if shorten:
return '-'.join(str(uuid.uuid4()).split('-')... | gpl-3.0 |
zjj/trac_hack | sample-plugins/HelloWorld.py | 1 | 2140 | """Example macro."""
revision = "$Rev: 6326 $"
url = "$URL: https://svn.edgewall.org/repos/trac/tags/trac-0.12.2/sample-plugins/HelloWorld.py $"
#
# The following shows the code for macro, old-style.
#
# The `execute` function serves no purpose other than to illustrate
# the example, it will not be used anymore.
#
# ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.