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 |
|---|---|---|---|---|---|
Jorge-Rodriguez/ansible | test/units/modules/cloud/amazon/test_aws_direct_connect_link_aggregation_group.py | 89 | 7309 | # (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/persisted/journal/rowjournal.py | 78 | 3077 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Journal using twisted.enterprise.row RDBMS support.
You're going to need the following table in your database::
| CREATE TABLE journalinfo
| (
| commandIndex int
| );
| INSERT INTO journalinfo VALUES (0);
... | bsd-3-clause |
comsaint/legco-watch | app/legcowatch/urls.py | 1 | 3346 | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic import TemplateView
import raw.views
import common.views
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', common.views.LandingView.as_view(), name='home'),
# url(r'^blog/'... | mit |
messense/wechatpy | wechatpy/work/client/api/message.py | 1 | 9426 | # -*- coding: utf-8 -*-
from optionaldict import optionaldict
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatMessage(BaseWeChatAPI):
"""
发送应用消息
https://work.weixin.qq.com/api/doc#90000/90135/90236
支持:
* 文本消息
* 图片消息
* 语音消息
* 视频消息
* 文件消息
* 文本卡片消息
* 图文消息
... | mit |
MashSoftware/petitions | mash_petitions/models.py | 1 | 4698 | import requests
import json
import geojson
from geojson import Polygon, Feature, FeatureCollection
from operator import itemgetter
from datetime import datetime, timedelta
from mash_petitions import cache
class Petitions(object):
"""Encapsulating class for for e-petitions API access."""
def __init__(self, url... | mit |
ezietsman/msc-thesis | spectroscopy/extracted/measureHeII.py | 1 | 2306 | # pyraf script to do spectrum extractions
import os
import pylab as pl
import string
import pyfits as pf
# start IRAF
cd = os.getcwd()
try:
print 'Trying /home/lemoen/'
os.chdir('/home/lemoen/')
except:
print 'We must be on corvus then... trying /home/ezietsman/'
os.chdir('/home/ezietsman/')
from... | mit |
exploreodoo/datStruct | odoo/addons/crm/report/__init__.py | 313 | 1127 | # -*- 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... | gpl-2.0 |
vaginessa/MITMf | core/beefapi.py | 6 | 8907 | #! /usr/bin/env python2.7
# BeEF-API - A Python API for BeEF (The Browser Exploitation Framework) http://beefproject.com/
# Copyright (c) 2015-2016 Marcello Salvati - byt3bl33d3r@gmail.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License ... | gpl-3.0 |
pratikmallya/hue | desktop/core/ext-py/boto-2.38.0/boto/rds/dbsubnetgroup.py | 170 | 2825 | # Copyright (c) 2013 Franc Carter - franc.carter@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modif... | apache-2.0 |
0xMF/pelican | pelican/tools/pelican_quickstart.py | 6 | 12113 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import six
import os
import string
import argparse
import sys
import codecs
from pelican import __version__
_TEMPLATES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"t... | agpl-3.0 |
firerszd/kbengine | kbe/res/scripts/common/Lib/test/test_iterlen.py | 91 | 7291 | """ Test Iterator Length Transparency
Some functions or methods which accept general iterable arguments have
optional, more efficient code paths if they know how many items to expect.
For instance, map(func, iterable), will pre-allocate the exact amount of
space required whenever the iterable can report its length.
T... | lgpl-3.0 |
FusionSP/android_external_chromium_org | ppapi/generators/idl_lint.py | 180 | 4046 | # 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.
""" Lint for IDL """
import os
import sys
from idl_log import ErrOut, InfoOut, WarnOut
from idl_node import IDLAttribute, IDLNode
from idl_ast import I... | bsd-3-clause |
muxi/grpc | examples/python/multiplex/multiplex_server.py | 13 | 4580 | # Copyright 2016 gRPC authors.
#
# 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... | apache-2.0 |
ossdemura/django-miniblog | Lib/site-packages/django/core/serializers/__init__.py | 115 | 8253 | """
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_queryset)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... | mit |
PeterWangIntel/chromium-crosswalk | tools/deep_memory_profiler/lib/sorter.py | 100 | 14314 | # 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 cStringIO
import json
import logging
import os
import re
from lib.ordered_dict import OrderedDict
LOGGER = logging.getLogger('dmprof')
BASE_PATH =... | bsd-3-clause |
BeyondTheClouds/nova | nova/virt/libvirt/driver.py | 1 | 350867 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 University Of Minho
# (c) Copyright 2013 Hewlett-Pa... | apache-2.0 |
ms7s/tornado | tornado/test/iostream_test.py | 14 | 41539 | from __future__ import absolute_import, division, print_function, with_statement
from tornado.concurrent import Future
from tornado import gen
from tornado import netutil
from tornado.iostream import IOStream, SSLIOStream, PipeIOStream, StreamClosedError
from tornado.httputil import HTTPHeaders
from tornado.log import ... | apache-2.0 |
edxnercel/edx-platform | common/lib/capa/capa/xqueue_interface.py | 179 | 4373 | #
# LMS Interface to external queueing system (xqueue)
#
import hashlib
import json
import logging
import requests
import dogstats_wrapper as dog_stats_api
log = logging.getLogger(__name__)
dateformat = '%Y%m%d%H%M%S'
XQUEUE_METRIC_NAME = 'edxapp.xqueue'
# Wait time for response from Xqueue.
XQUEUE_TIMEOUT = 35 #... | agpl-3.0 |
rdjdejong/Leren2016 | kNN1.py | 1 | 2525 | from __future__ import division
import numpy as np
import pandas as pd
# Finds the most common item
# taken from http://stackoverflow.com/questions/1518522/python-most-common-element-in-a-list
def most_common(lst):
return max(set(lst), key=lst.count)
# simply determines the accuracy of our predicted outputs
def a... | apache-2.0 |
theyaa/Impala | tests/verifiers/metric_verifier.py | 16 | 2364 | # Copyright (c) 2012 Cloudera, 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 o... | apache-2.0 |
mosajjal/mitmproxy | test/mitmproxy/tools/test_dump.py | 2 | 1780 | import os
import pytest
from unittest import mock
from mitmproxy import proxy
from mitmproxy import log
from mitmproxy import controller
from mitmproxy.tools import dump
from mitmproxy.test import tutils
from .. import tservers
class TestDumpMaster(tservers.MasterTest):
def mkmaster(self, flt, **options):
... | mit |
safchain/contrail-controller | src/config/utils/contrail_veth_port.py | 16 | 15847 | #! /usr/bin/env python
"""
NAME
contrail_veth_port - create a veth interface to a Contrail virtual
network
DESCRIPTION
Usually VMs are connected to virtual network ports. This creates a
veth interface on the local host that's connected to a Contrail
virtual network. Local programs (like ssh) c... | apache-2.0 |
hkoof/urwid | docs/manual/safe_combinations.py | 15 | 1193 | #!/usr/bin/env python
import urwid
BLACK_FGS = ('light gray', 'dark cyan', 'dark red', 'dark green',
'dark magenta', 'white', 'light blue', 'light cyan', 'light red',
'light green', 'yellow', 'light magenta')
GRAY_FGS = ('black', 'dark blue', 'dark cyan', 'dark red', 'dark green',
'dark magenta', 'white',... | lgpl-2.1 |
saydulk/horizon | openstack_dashboard/contrib/sahara/content/data_processing/clusters/urls.py | 13 | 1784 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 |
benjamin9999/python-stix | stix/threat_actor/__init__.py | 1 | 16851 | # Copyright (c) 2014, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import stix
import stix.bindings.threat_actor as threat_actor_binding
from stix.common import (Confidence, Identity, InformationSource, Statement,
StructuredText, VocabString)
from stix.common.related import... | bsd-3-clause |
bradwoo8621/Swift-Study | Instagram/Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/test/mac/gyptest-sdkroot.py | 193 | 1436 | #!/usr/bin/env python
# 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.
"""
Verifies that setting SDKROOT works.
"""
import TestGyp
import os
import subprocess
import sys
if sys.platform == 'darwin':
test = ... | mit |
yajiedesign/mxnet | ci/test_safe_docker_run.py | 6 | 16597 | #!/usr/bin/env python3
# -*- 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 Licen... | apache-2.0 |
srvg/ansible-modules-extras | cloud/amazon/ecs_service.py | 16 | 16540 | #!/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 |
dannyperry571/theapprentice | script.module.youtube.dl/lib/youtube_dl/extractor/syfy.py | 73 | 2046 | from __future__ import unicode_literals
from .adobepass import AdobePassIE
from ..utils import (
update_url_query,
smuggle_url,
)
class SyfyIE(AdobePassIE):
_VALID_URL = r'https?://(?:www\.)?syfy\.com/(?:[^/]+/)?videos/(?P<id>[^/?#]+)'
_TESTS = [{
'url': 'http://www.syfy.com/theinternetruined... | gpl-2.0 |
utamaro/StorjNet | tests/test_e3x.py | 2 | 5111 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Shinya Yagyu
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this ... | bsd-3-clause |
cdrttn/samba-regedit | lib/testtools/testtools/deferredruntest.py | 14 | 12508 | # Copyright (c) 2010 testtools developers. See LICENSE for details.
"""Individual test case execution for tests that return Deferreds.
This module is highly experimental and is liable to change in ways that cause
subtle failures in tests. Use at your own peril.
"""
__all__ = [
'assert_fails_with',
'Asynchro... | gpl-3.0 |
zachriggle/idapython | pywraps/py_kernwin.py | 15 | 3311 | # -----------------------------------------------------------------------
# Standalone and testing code
import sys
try:
import pywraps
pywraps_there = True
print "Using pywraps"
except:
pywraps_there = False
print "Not using pywraps"
try:
import _idaapi
except:
print "Please t... | bsd-3-clause |
GarySparrow/mFlaskWeb | venv/Lib/site-packages/markdown/extensions/fenced_code.py | 25 | 4104 | """
Fenced Code Extension for Python Markdown
=========================================
This extension adds Fenced Code Blocks to Python-Markdown.
See <https://pythonhosted.org/Markdown/extensions/fenced_code_blocks.html>
for documentation.
Original code Copyright 2007-2008 [Waylan Limberg](http://achinghead.com/).
... | mit |
cuboxi/android_external_skia | tools/copyright/main.py | 220 | 3489 | '''
Copyright 2011 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
'''
Updates all copyright headers within our code:
- For files that already have a copyright header, the header is modified
while keeping the year and holder intact.
- For files that ... | bsd-3-clause |
foss-transportationmodeling/rettina-server | .env/local/lib/python2.7/site-packages/pbr/tests/util.py | 44 | 2556 | # Copyright (c) 2013 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 |
anurag313/scikit-learn | sklearn/utils/sparsetools/tests/test_traversal.py | 315 | 2001 | from __future__ import division, print_function, absolute_import
from nose import SkipTest
import numpy as np
from numpy.testing import assert_array_almost_equal
try:
from scipy.sparse.csgraph import breadth_first_tree, depth_first_tree,\
csgraph_to_dense, csgraph_from_dense
except ImportError:
# Oldi... | bsd-3-clause |
StellarCN/py-stellar-base | tests/call_builder/test_accounts_call_builder.py | 1 | 1579 | from stellar_sdk import Asset
from stellar_sdk.call_builder import AccountsCallBuilder
from tests.call_builder import horizon_url, client
class TestAccountsCallBuilder:
def test_init(self):
builder = AccountsCallBuilder(horizon_url, client)
assert builder.endpoint == "accounts"
assert bui... | apache-2.0 |
jchevin/MissionPlanner-master | Lib/site-packages/numpy/f2py/common_rules.py | 51 | 4709 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
"""
Build common block mechanism for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the Num... | gpl-3.0 |
wtsi-hgi/python-sequencescape-db | sequencescape/tests/_mocks.py | 3 | 1778 | from typing import Union, Any, List, Tuple
from unittest.mock import MagicMock
from sequencescape.enums import Property
from sequencescape.mappers import Mapper, NamedMapper, InternalIdMapper, AccessionNumberMapper, SampleMapper,\
WellMapper, MultiplexedLibraryMapper, LibraryMapper, StudyMapper
from sequencescape.... | mit |
atosorigin/ansible | lib/ansible/module_utils/facts/network/sunos.py | 170 | 4805 | # 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 in the hope that ... | gpl-3.0 |
rajul/mne-python | tutorials/plot_info.py | 13 | 3272 | """
.. _tut_info_objects:
The :class:`Info <mne.io.meas_info.Info>` data structure
========================================================
"""
from __future__ import print_function
import mne
import os.path as op
###############################################################################
# The :class:`Info <mn... | bsd-3-clause |
amitay/samba | source4/dsdb/tests/python/deletetest.py | 11 | 14139 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import optparse
import sys
import os
sys.path.insert(0, "bin/python")
import samba
samba.ensure_external_module("testtools", "testtools")
samba.ensure_external_module("subunit", "subunit/python")
import samba.getopt as options
from samba.auth import system_session
from ... | gpl-3.0 |
tersmitten/ansible | lib/ansible/plugins/callback/json.py | 68 | 4454 | # (c) 2016, Matt Martz <matt@sivel.net>
# (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
DOCUMENTATION = '''
callback: json
... | gpl-3.0 |
minesense/VisTrails | vistrails/db/versions/v0_9_3/domain/id_scope.py | 19 | 3232 | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | bsd-3-clause |
deot95/Tesis | Proyecto de Grado Ingeniería Electrónica/Workspace/Comparison/Full SWMM/sim_env.py | 3 | 2885 | import swmm
import numpy as np
class sim_env:
def __init__(self,route,vref):
self.route = route
self.vmax = np.asarray([0.0105, 0.011904, 0.022576, 0.023514, 0.0187, 0.059595 , 0.12507, 0.094411, 0.059189, 1.441824])
## Weights for reward function
self.delta1 = 0
self.delta2 ... | mit |
tal-nino/ansible | test/units/module_utils/test_database.py | 325 | 5737 | import collections
import mock
import os
import re
from nose.tools import eq_
try:
from nose.tools import assert_raises_regexp
except ImportError:
# Python < 2.7
def assert_raises_regexp(expected, regexp, callable, *a, **kw):
try:
callable(*a, **kw)
except expected as e:
... | gpl-3.0 |
samvarankashyap/linch-pin | linchpin/provision/action_plugins/stat.py | 3 | 1755 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.action import ActionBase
import linchpin.MockUtils.MockUtils as mock_utils
class ActionModule(ActionBase):
def run(self, tmp=None, task_vars=None):
"""
Simple action plugin that returns th... | gpl-3.0 |
Bismarrck/tensorflow | tensorflow/contrib/data/python/ops/enumerate_ops.py | 22 | 1903 | # 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 |
mycodeday/crm-platform | report_intrastat/report_intrastat.py | 201 | 5606 | # -*- 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... | gpl-3.0 |
jmschrei/scikit-learn | examples/semi_supervised/plot_label_propagation_digits.py | 268 | 2723 | """
===================================================
Label Propagation digits: Demonstrating performance
===================================================
This example demonstrates the power of semisupervised learning by
training a Label Spreading model to classify handwritten digits
with sets of very few labels.... | bsd-3-clause |
ryuunosukeyoshi/PartnerPoi-Bot | lib/youtube_dl/extractor/tutv.py | 83 | 1111 | from __future__ import unicode_literals
import base64
from .common import InfoExtractor
from ..compat import compat_parse_qs
class TutvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tu\.tv/videos/(?P<id>[^/?]+)'
_TEST = {
'url': 'http://tu.tv/videos/robots-futbolistas',
'md5': '0cd9e28... | gpl-3.0 |
wstoettinger/devsummit | template.py | 8 | 1881 | # Copyright 2014 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 l... | apache-2.0 |
glwu/python-for-android | python-modules/twisted/twisted/conch/test/test_manhole.py | 59 | 10507 | # -*- test-case-name: twisted.conch.test.test_manhole -*-
# Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.manhole}.
"""
import traceback
from twisted.trial import unittest
from twisted.internet import error, defer
from twisted.test.proto_helpers import ... | apache-2.0 |
oliverhr/odoo | addons/hr_timesheet/wizard/__init__.py | 381 | 1079 | # -*- 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 |
xinwu/horizon | openstack_dashboard/dashboards/project/access_and_security/api_access/urls.py | 54 | 1185 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
Dexhub/MTX | src/arch/x86/isa/insts/simd64/integer/data_transfer/__init__.py | 91 | 2358 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
Dino0631/RedRain-Bot | lib/pip/vcs/subversion.py | 343 | 9350 | from __future__ import absolute_import
import logging
import os
import re
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.index import Link
from pip.utils import rmtree, display_path
from pip.utils.logging import indent_log
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile... | gpl-3.0 |
renyi533/tensorflow | tensorflow/python/data/experimental/kernel_tests/rejection_resample_test.py | 12 | 5299 | # 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 |
novapost/workalendar | workalendar/europe/portugal.py | 3 | 1259 | from datetime import date
from ..core import WesternCalendar
from ..registry_tools import iso_register
@iso_register('PT')
class Portugal(WesternCalendar):
'Portugal'
# Christian holidays
include_good_friday = True
include_easter_sunday = True
include_christmas = True
include_immaculate_conce... | mit |
sburnett/seattle | multiplexer/tests/test_5_conn_buffering.py | 1 | 3988 | # This test tries to test for proper connection buffering
# It does this by hooking into the multiplexers internal functions and by counting the number
# of CONN_BUF_SIZE messages sent. The buffer is also decreased substantially to speed this up.
# Get the Multiplexer
include Multiplexer.py
MAX_NUM = 50
BUF_SIZE = 1
... | mit |
JimCircadian/ansible | lib/ansible/modules/cloud/opennebula/one_image.py | 49 | 11669 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
"""
(c) 2018, Milan Ilic <milani@nordeus.com>
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the ter... | gpl-3.0 |
nicobustillos/odoo | addons/website_forum/__openerp__.py | 321 | 1905 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-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 |
mrquim/mrquimrepo | plugin.program.super.favourites/timer.py | 18 | 1042 | #
# Copyright (C) 2014
# Sean Poyser (seanpoyser@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 2, or (at your option)
# any later version.
#
# This... | gpl-2.0 |
dnguyen0304/clare | clare/clare/application/room_list_watcher/interfaces.py | 1 | 1051 | # -*- coding: utf-8 -*-
import abc
class IFlushStrategy(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def should_flush(self, collection):
"""
Parameters
----------
collection : typing.Any
Returns
-------
bool
True if the c... | mit |
guettli/django | django/contrib/gis/db/backends/postgis/models.py | 59 | 2055 | """
The GeometryColumns and SpatialRefSys models for the PostGIS backend.
"""
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class PostGISGeometryColumns(models.Model):
... | bsd-3-clause |
buqing2009/MissionPlanner | Lib/site-packages/numpy/core/tests/test_numerictypes.py | 53 | 14896 | import sys
from numpy.testing import *
from numpy.compat import asbytes, asunicode
import numpy as np
# This is the structure of the table used for plain objects:
#
# +-+-+-+
# |x|y|z|
# +-+-+-+
# Structure of a plain array description:
Pdescr = [
('x', 'i4', (2,)),
('y', 'f8', (2, 2)),
('z', 'u1')]
# A ... | gpl-3.0 |
latuannetnam/django-socialauth | myproject/socialauth/pipeline.py | 1 | 1356 | from socialauth.models import UserProfile
import logging
logger = logging.getLogger(__name__)
def get_profile(
backend,
user,
response,
details,
is_new=False,
*args,
**kwargs
):
img_url = None
#Get photo
if backend.name == 'facebook':
img_url = 'http:... | apache-2.0 |
nojhan/weboob-devel | modules/citelis/pages.py | 7 | 4510 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Laurent Bachelier
#
# This file is part of weboob.
#
# weboob 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 3 of the License, or
# (at ... | agpl-3.0 |
bentilly/heroes | lib/werkzeug/contrib/fixers.py | 148 | 10197 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.fixers
~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module includes various helpers that fix bugs in web servers. They may
be necessary for some versions of a buggy web server but not others. We try
to stay updated with the status of the bug... | apache-2.0 |
PanDAWMS/panda-server | pandaserver/taskbuffer/CloudTaskSpec.py | 1 | 2494 | """
cloud/task specification
"""
class CloudTaskSpec(object):
# attributes
_attributes = ('id','taskname','taskid','cloud','status','tmod','tenter')
# slots
__slots__ = _attributes
# constructor
def __init__(self):
# install attributes
for attr in self._attributes:
... | apache-2.0 |
Glasgow2015/team-10 | env/lib/python2.7/site-packages/djangocms_installer/utils.py | 3 | 3347 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import sys
from . import compat
from .config.data import CMS_VERSION_MATRIX, DJANGO_VERSION_MATRIX, VERSION_MATRIX
def query_yes_no(question, default=None): # pragma: no cover
"""
Ask a yes/no questio... | apache-2.0 |
ckan/ckanext-deadoralive | setup.py | 1 | 3286 | from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'README.markdown'), encoding='utf-8... | agpl-3.0 |
mxOBS/deb-pkg_trusty_chromium-browser | tools/telemetry/telemetry/core/backends/chrome/chrome_browser_backend_unittest.py | 9 | 5173 | # 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 unittest
from telemetry.core import wpr_modes
from telemetry.core.backends.chrome import chrome_browser_backend
class FakePlatformBackend(object):
... | bsd-3-clause |
orionrobots/micropython | drivers/onewire/onewire.py | 66 | 11789 | """
OneWire library ported to MicroPython by Jason Hildebrand.
TODO:
* implement and test parasite-power mode (as an init option)
* port the crc checks
The original upstream copyright and terms follow.
------------------------------------------------------------------------------
Copyright (c) 2007, Jim Studt ... | mit |
gannetson/django | django/contrib/gis/shortcuts.py | 388 | 1209 | import zipfile
from io import BytesIO
from django.conf import settings
from django.http import HttpResponse
from django.template import loader
# NumPy supported?
try:
import numpy
except ImportError:
numpy = False
def compress_kml(kml):
"Returns compressed KMZ from the given KML string."
kmz = Bytes... | bsd-3-clause |
enzochiau/tablib | tablib/packages/dbfpy/record.py | 17 | 8447 | """DBF record definition.
"""
"""History (most recent first):
11-feb-2007 [als] __repr__: added special case for invalid field values
10-feb-2007 [als] added .rawFromStream()
30-oct-2006 [als] fix record length in .fromStream()
04-jul-2006 [als] added export declaration
20-dec-2005 [yc] DbfRecord.write() ->... | mit |
chenhengjie123/crosswalk-web-driver | xwalkdriver/client/webelement.py | 3 | 1505 | # 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.
from command_executor import Command
class WebElement(object):
"""Represents an HTML element."""
def __init__(self, xwalkdriver, id_):
self._xwalkd... | bsd-3-clause |
Eureka22/ASM_xf | PythonD/lib/python2.4/bsddb/test/test_dbtables.py | 4 | 13466 | #!/usr/bin/env python
#
#-----------------------------------------------------------------------
# A test suite for the table interface built on bsddb.db
#-----------------------------------------------------------------------
#
# Copyright (C) 2000, 2001 by Autonomous Zone Industries
# Copyright (C) 2002 Gregory P. Sm... | gpl-2.0 |
t794104/ansible | test/units/modules/network/f5/test_bigip_ssl_key.py | 16 | 3345 | # -*- 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 json
import pytest
import sys
if sys.version_info < (2, ... | gpl-3.0 |
imvu/bluesteel | app/logic/benchmark/migrations/0014_benchmarkdefinitionworkerpassentry.py | 1 | 1182 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-11-04 05:35
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bluesteelworker', '0005_workerfileshashentry'),
('be... | mit |
shaufi/odoo | addons/crm/base_partner_merge.py | 182 | 30903 | #!/usr/bin/env python
from __future__ import absolute_import
from email.utils import parseaddr
import functools
import htmlentitydefs
import itertools
import logging
import operator
import psycopg2
import re
from ast import literal_eval
from openerp.tools import mute_logger
# Validation Library https://pypi.python.org... | agpl-3.0 |
qsorix/django-rest-framework | rest_framework/pagination.py | 5 | 27177 | # coding: utf-8
"""
Pagination serializers determine the structure of the output that should
be used for paginated responses.
"""
from __future__ import unicode_literals
import warnings
from base64 import b64decode, b64encode
from collections import namedtuple
from django.core.paginator import Paginator as DjangoPagi... | bsd-2-clause |
umitproject/site-status | django/contrib/staticfiles/finders.py | 156 | 9183 | import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import default_storage, Storage, FileSystemStorage
from django.utils.datastructures import SortedDict
from django.utils.functional import memoize, LazyObject
from django.utils.importlib impo... | agpl-3.0 |
FlaPer87/qpid-proton | proton-j/src/main/resources/csasl.py | 2 | 1902 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
w4ngyi/flocker | flocker/ca/test/test_script.py | 15 | 1391 | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
import os
from twisted.python.filepath import FilePath
from twisted.trial.unittest import TestCase, SynchronousTestCase
from ...testtools import FlockerScriptTestsMixin, StandardOptionsTestsMixin
from .._script import CAScript, CAOptions
class FlockerCATe... | apache-2.0 |
sometallgit/AutoUploader | Python27/Tools/webchecker/wcgui.py | 42 | 15090 | #! /usr/bin/env python
"""GUI interface to webchecker.
This works as a Grail applet too! E.g.
<APPLET CODE=wcgui.py NAME=CheckerWindow></APPLET>
Checkpoints are not (yet??? ever???) supported.
User interface:
Enter a root to check in the text entry box. To enter more than one root,
enter them one at a time a... | mit |
greg-ashby/deep-learning-nanodegree | embeddings/utils.py | 150 | 2194 | import re
from collections import Counter
def preprocess(text):
# Replace punctuation with tokens so we can use them in our model
text = text.lower()
text = text.replace('.', ' <PERIOD> ')
text = text.replace(',', ' <COMMA> ')
text = text.replace('"', ' <QUOTATION_MARK> ')
text = text.replace(... | mit |
ccauet/scikit-optimize | skopt/learning/gaussian_process/kernels.py | 1 | 14710 | from math import sqrt
import numpy as np
from sklearn.gaussian_process.kernels import Kernel as sk_Kernel
from sklearn.gaussian_process.kernels import ConstantKernel as sk_ConstantKernel
from sklearn.gaussian_process.kernels import DotProduct as sk_DotProduct
from sklearn.gaussian_process.kernels import Exponentiation... | bsd-3-clause |
MTASZTAKI/ApertusVR | plugins/languageAPI/jsAPI/3rdParty/nodejs/10.1.0/source/deps/v8/tools/grokdump.py | 1 | 136343 | #!/usr/bin/env python
#
# Copyright 2012 the V8 project 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:
#
# * Redistributions of source code must retain the above copyright
# noti... | mit |
uranusjr/django | tests/template_tests/syntax_tests/test_with.py | 102 | 2621 | from django.template import TemplateSyntaxError
from django.template.defaulttags import WithNode
from django.test import SimpleTestCase
from ..utils import setup
class WithTagTests(SimpleTestCase):
at_least_with_one_msg = "'with' expected at least one variable assignment"
@setup({'with01': '{% with key=dict... | bsd-3-clause |
Glasgow2015/team-10 | env/lib/python2.7/site-packages/setuptools/command/install_egg_info.py | 423 | 4001 | from distutils import log, dir_util
import os
from setuptools import Command
from setuptools.archive_util import unpack_archive
import pkg_resources
class install_egg_info(Command):
"""Install an .egg-info directory for the package"""
description = "Install an .egg-info directory for the package"
user_... | apache-2.0 |
mzdaniel/oh-mainline | vendor/packages/celery/celery/apps/beat.py | 18 | 4932 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import atexit
import socket
import sys
import traceback
from .. import __version__, platforms
from .. import beat
from ..app import app_or_default
from ..utils import get_full_cls_name, LOG_LEVELS
from ..utils.timeutils import humanize_seconds
STARTUP_IN... | agpl-3.0 |
khyrous/kiwibeats | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/ninja_syntax.py | 2485 | 5536 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | mit |
oxc/Flexget | flexget/plugins/sites/cpasbien.py | 3 | 5167 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.parse import quote_plus
import logging
import re
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexge... | mit |
JI007/flasky | migrations/versions/38c4e85512a9_initial_migration.py | 182 | 1163 | """initial migration
Revision ID: 38c4e85512a9
Revises: None
Create Date: 2013-12-27 01:23:59.392801
"""
# revision identifiers, used by Alembic.
revision = '38c4e85512a9'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust!... | mit |
brokenjacobs/ansible | lib/ansible/module_utils/ismount.py | 298 | 4030 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is based on
# Lib/posixpath.py of cpython
# It is licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
#
# 1. This LICENSE AGREEMENT is between the Python Software Foundation
# ("PSF")... | gpl-3.0 |
lauringlab/variant_pipeline | scripts/seq_classes.py | 1 | 12511 | from __future__ import division
import pysam
from Bio.Seq import Seq
from Bio import SeqIO
from Bio.Alphabet import generic_dna
from Bio.SeqRecord import SeqRecord
from trim_to_coding import trim_to_regions
def checkORF(seq):
"""
This function varifies the input is an ORF by checking it has
i) a start cod... | apache-2.0 |
gannetson/django | tests/get_object_or_404/tests.py | 296 | 3681 | from __future__ import unicode_literals
from django.http import Http404
from django.shortcuts import get_list_or_404, get_object_or_404
from django.test import TestCase
from .models import Article, Author
class GetObjectOr404Tests(TestCase):
def test_get_object_or_404(self):
a1 = Author.objects.create(n... | bsd-3-clause |
Danfocus/Flexget | flexget/tests/api_tests/test_user_api.py | 9 | 1624 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from flexget.api.app import base_message
from flexget.api.core.user import ObjectsContainer as OC
from flexget.utils import json
class TestUserAPI(object):
config = '... | mit |
jddixon/upax_py | src/upax/consistency.py | 1 | 4229 | #!/usr/bin/python
# ~/dev/py/upax/upax/consistency.py
""" Funcions for verifying the internal consistency of a upax server. """
from upax import UpaxError
from upax.ftlog import BoundLog, FileReader # , LogEntry
from upax.server import BlockingServer
from upax.walker import UWalker
__all__ = ['check', ]
def se... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.