repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
loveyoupeng/rt | modules/web/src/main/native/Tools/gtk/common.py | 2 | 6127 | #!/usr/bin/env python
# Copyright (C) 2011 Igalia S.L.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This... | gpl-2.0 |
kustodian/ansible-modules-core | cloud/digital_ocean/digital_ocean_sshkey.py | 37 | 4948 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
munyirik/python | cpython/Lib/test/test_compile.py | 2 | 21808 | import math
import os
import unittest
import sys
import _ast
import tempfile
import types
from test import support
from test.support import script_helper
class TestSpecifics(unittest.TestCase):
def compile_single(self, source):
compile(source, "<single>", "single")
def assertInvalidSingle(self, sourc... | bsd-3-clause |
aioue/ansible | lib/ansible/playbook/role/requirement.py | 81 | 8216 | # (c) 2014 Michael DeHaan, <michael@ansible.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) any later ve... | gpl-3.0 |
willingc/oh-mainline | vendor/packages/Django/tests/regressiontests/sites_framework/tests.py | 150 | 1800 | from __future__ import absolute_import
from django.conf import settings
from django.contrib.sites.models import Site
from django.test import TestCase
from .models import (SyndicatedArticle, ExclusiveArticle, CustomArticle,
InvalidArticle, ConfusedArticle)
class SitesFrameworkTestCase(TestCase):
def setUp(se... | agpl-3.0 |
sanghinitin/golismero | tools/sqlmap/lib/core/subprocessng.py | 7 | 5632 | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import errno
import os
import subprocess
import sys
import time
from lib.core.settings import IS_WIN
if IS_WIN:
try:
from win32file import ReadFile, WriteFile
... | gpl-2.0 |
alistairlow/tensorflow | tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_op_test.py | 61 | 15941 | # 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 |
trishnaguha/ansible | lib/ansible/modules/web_infrastructure/sophos_utm/utm_network_interface_address.py | 3 | 3835 | #!/usr/bin/python
# Copyright: (c) 2018, Juergen Wiebe <wiebe@e-spirit.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'statu... | gpl-3.0 |
jasonkying/pip | pip/_vendor/requests/packages/chardet/sbcharsetprober.py | 2927 | 4793 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
Kitryn/PTCAccount2 | ptcaccount2/console.py | 1 | 4476 | import argparse
import sys
import ptcaccount2
from ptcaccount2.ptcexceptions import *
def parse_arguments(args):
"""Parse the command line arguments for the console commands.
Args:
args (List[str]): List of string arguments to be parsed.
Returns:
Namespace: Namespace with the parsed arguments... | mit |
jacobakkerboom/CodeCombat2 | scripts/devSetup/ruby.py | 77 | 1873 | from __future__ import print_function
__author__ = u'root'
import dependency
import configuration
import shutil
import errors
import subprocess
from which import which
class Ruby(dependency.Dependency):
def __init__(self,config):
self.config = config
assert isinstance(config,configuration.Configura... | mit |
haripradhan/MissionPlanner | Lib/distutils/sysconfig.py | 42 | 21927 | """Provide access to Python's configuration information. The specific
configuration variables available depend heavily on the platform and
configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys(). Additional convenience functions a... | gpl-3.0 |
VRToxin-AOSP/android_external_skia | tools/test_pdfs.py | 231 | 1801 | '''
Compares the rendererings of serialized SkPictures to expected images.
Launch with --help to see more information.
Copyright 2012 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
# common Python modules
import os
import optparse
import sys
import ... | bsd-3-clause |
joone/chromium-crosswalk | components/test/data/password_manager/automated_tests/websitetest.py | 33 | 12521 | # 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.
"""WebsiteTest testing class."""
import logging
import time
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common... | bsd-3-clause |
repotvsupertuga/tvsupertuga.repository | instal/plugin.video.SportsDevil/service/oscrypto/errors.py | 7 | 1657 | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import sys
import socket
__all__ = [
'AsymmetricKeyError',
'CACertsError',
'LibraryNotFoundError',
'SignatureError',
'TLSError',
'TLSVerificationError',
]
class LibraryNotFoundError(Exception)... | gpl-2.0 |
cryptominingpool204/cryptominingpool204.github.io | stratum-mining-litecoin-stratum-lite/stratum-mining-litecoin-stratum-lite/lib/config_default.py | 1 | 6894 | '''
This is example configuration for Stratum server.
Please rename it to config.py and fill correct values.
'''
# ******************** GENERAL SETTINGS ***************
# Enable some verbose debug (logging requests and responses).
DEBUG = False
# Destination for application logs, files rotated once per day.
LOGDIR =... | mit |
h3biomed/ansible | lib/ansible/modules/remote_management/intersight/intersight_facts.py | 13 | 3129 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
msebire/intellij-community | python/helpers/py2only/docutils/transforms/peps.py | 122 | 11065 | # $Id: peps.py 6433 2010-09-28 08:21:25Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Transforms for PEP processing.
- `Headers`: Used to transform a PEP's initial RFC-2822 header. It remains a
field list, but some entries get processed.
- ... | apache-2.0 |
bottompawn/kbengine | kbe/res/scripts/common/Lib/idlelib/dynOptionMenuWidget.py | 61 | 1987 | """
OptionMenu widget modified to allow dynamic menu reconfiguration
and setting of highlightthickness
"""
from tkinter import OptionMenu, _setit, Tk, StringVar, Button
import copy
import re
class DynOptionMenu(OptionMenu):
"""
unlike OptionMenu, our kwargs can include highlightthickness
"""
def __ini... | lgpl-3.0 |
mancoast/CPythonPyc_test | fail/312_test_multibytecodec_support.py | 1 | 12675 | #!/usr/bin/env python
#
# test_multibytecodec_support.py
# Common Unittest Routines for CJK codecs
#
import sys, codecs
import unittest, re
from test import support
from io import BytesIO
class TestBase:
encoding = '' # codec name
codec = None # codec tuple (with 4 elements)
tstring ... | gpl-3.0 |
martijnthe/qemu_stm32 | tests/qemu-iotests/qed.py | 248 | 7194 | #!/usr/bin/env python
#
# Tool to manipulate QED image files
#
# Copyright (C) 2010 IBM, Corp.
#
# Authors:
# Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
#
# This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the COPYING file in the top-level directory.
import sys
import struct
import r... | gpl-2.0 |
cloudbau/nova | nova/tests/objects/test_instance_group.py | 4 | 9950 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 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/LICE... | apache-2.0 |
yanheven/console | openstack_dashboard/urls.py | 7 | 1862 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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
# no... | apache-2.0 |
martinling/imusim | imusim/io/bvh.py | 1 | 14100 | """
Reading and writing BVH body model movement files.
"""
# Copyright (C) 2009-2011 University of Edinburgh
#
# This file is part of IMUSim.
#
# IMUSim 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 v... | gpl-3.0 |
MadeiraCloud/salt | sources/salt/pillar/reclass_adapter.py | 1 | 4015 | # -*- coding: utf-8 -*-
'''
Use the "reclass" database as a Pillar source
.. |reclass| replace:: **reclass**
This ``ext_pillar`` plugin provides access to the |reclass| database, such
that Pillar data for a specific minion are fetched using |reclass|.
You can find more information about |reclass| at
http://reclass.p... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/232_test_mimetypes.py | 4 | 2327 | import mimetypes
import StringIO
import unittest
from test import test_support
# Tell it we don't know about external files:
mimetypes.knownfiles = []
mimetypes.inited = False
class MimeTypesTestCase(unittest.TestCase):
def setUp(self):
self.db = mimetypes.MimeTypes()
def test_default_data(self):
... | gpl-3.0 |
ppwwyyxx/tensorflow | tensorflow/python/kernel_tests/proto/encode_proto_op_test_base.py | 26 | 8489 | # =============================================================================
# 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
#... | apache-2.0 |
flatangle/flatlib | contrib/topical_almuten.py | 1 | 5509 | from flatlib import const
from flatlib.tools import planetarytime
from flatlib.dignities import essential
from flatlib.tools import arabicparts
# List of dignities
DIGNITY_LIST = [
'ruler',
'exalt',
'dayTrip',
'nightTrip',
'partTrip',
'term',
'face'
]
# List of objects
OBJECT_LIST = const.... | mit |
phalax4/CarnotKE | jyhton/lib-python/2.7/unittest/test/test_suite.py | 111 | 12069 | import unittest
import sys
from .support import LoggingResult, TestEquality
### Support code for Test_TestSuite
################################################################
class Test(object):
class Foo(unittest.TestCase):
def test_1(self): pass
def test_2(self): pass
def test_3(self... | apache-2.0 |
kvar/ansible | lib/ansible/plugins/shell/csh.py | 118 | 1217 | # Copyright (c) 2014, Chris Church <chris@ninemoreminutes.com>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.shell import Shel... | gpl-3.0 |
kvar/ansible | lib/ansible/parsing/utils/yaml.py | 96 | 2809 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2017, Ansible Project
# Copyright: (c) 2018, 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_f... | gpl-3.0 |
husigeza/pycom-micropython-sigfox | tests/basics/string_partition.py | 16 | 1026 | try:
str.partition
except AttributeError:
print("SKIP")
import sys
sys.exit()
print("asdf".partition('g'))
print("asdf".partition('a'))
print("asdf".partition('s'))
print("asdf".partition('f'))
print("asdf".partition('d'))
print("asdf".partition('asd'))
print("asdf".partition('sdf'))
print("asdf".parti... | mit |
Hasimir/brython | www/src/Lib/test/test_macpath.py | 101 | 4932 | import macpath
from test import support, test_genericpath
import unittest
class MacPathTestCase(unittest.TestCase):
def test_abspath(self):
self.assertEqual(macpath.abspath("xx:yy"), "xx:yy")
def test_isabs(self):
isabs = macpath.isabs
self.assertTrue(isabs("xx:yy"))
self.ass... | bsd-3-clause |
40223102/w110519 | static/Brython3.1.1-20150328-091302/Lib/jqueryui/__init__.py | 603 | 3671 | """Wrapper around the jQuery UI library
Exposes a single object, jq, to manipulate the widgets designed in the library
This object supports :
- subscription : js[elt_id] returns an object matching the element with the
specified id
- a method get(**kw). The only keyword currently supported is "selector". The
metho... | agpl-3.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_11_01/aio/operations/_vpn_gateways_operations.py | 1 | 48948 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
bogdandrutu/grpc | src/python/grpcio_health_checking/grpc/health/v1/__init__.py | 1496 | 1530 | # Copyright 2015, 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 |
trustcircleglobal/tcg-gae | docs/conf.py | 1 | 8403 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tcg-gae documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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
# aut... | isc |
guilhem/LGE975_G_Kitkat_Android_V20a_Kernel | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
tux-00/ansible | lib/ansible/modules/network/cloudengine/ce_link_status.py | 42 | 22114 | #!/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 |
N-Parsons/exercism-python | exercises/dnd-character/dnd_character_test.py | 3 | 2411 | import unittest
from dnd_character import Character, modifier
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
class DnDCharacterTest(unittest.TestCase):
def test_modifier_for_score_3_is_n4(self):
self.assertEqual(modifier(3), -4)
def test_modifier_for_score_4_is_n3(self)... | mit |
Spredzy/dotfiles | vim/bundle/ultisnips/plugin/UltiSnips/__init__.py | 2 | 37546 | #!/usr/bin/env python
# encoding: utf-8
from functools import wraps
from collections import deque, defaultdict
import glob
import hashlib
import os
import re
import traceback
from UltiSnips.compatibility import as_unicode, byte2col
from UltiSnips._diff import diff, guess_edit
from UltiSnips.geometry import Position
f... | apache-2.0 |
JioCloud/nova | nova/virt/hyperv/constants.py | 31 | 2347 | # Copyright 2012 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | apache-2.0 |
FireCARES/data | sources/nfirs/scripts/jupyter_notebook_config.py | 1 | 25267 | # Configuration file for jupyter-notebook.
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## This is an application.
## The date format used by logging f... | mit |
annegentle/magnum | magnum/api/controllers/v1/replicationcontroller.py | 7 | 14010 | # Copyright 2015 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 |
Krossom/python-for-android | python3-alpha/python3-src/Lib/urllib/error.py | 48 | 2264 | """Exception classes raised by urllib.
The base exception class is URLError, which inherits from IOError. It
doesn't define any behavior of its own, but is the base class for all
exceptions defined in this package.
HTTPError is an exception class that is also a valid HTTP response
instance. It behaves this way beca... | apache-2.0 |
laiqiqi886/kbengine | kbe/src/lib/python/Lib/test/test_sched.py | 92 | 6588 | import queue
import sched
import time
import unittest
from test import support
try:
import threading
except ImportError:
threading = None
TIMEOUT = 10
class Timer:
def __init__(self):
self._cond = threading.Condition()
self._time = 0
self._stop = 0
def time(self):
wit... | lgpl-3.0 |
mit-ll/python-keylime | keylime/ca_impl_cfssl.py | 1 | 6870 | '''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import base64
import os
import subprocess
import socket
import time
import requests
import shutil
import sys
import simplejson as json
from keylime import config
from keylime import keylime_logging
from keylime import s... | bsd-2-clause |
Aegeaner/spark | python/pyspark/sql/functions.py | 1 | 134163 | #
# 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 |
martin-hunt/foobar | docs/conf.py | 1 | 8160 | # -*- coding: utf-8 -*-
#
# 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 configuration values have a default; values that are commented out
# serve to show the default.
import sys
imp... | mit |
claudep/pootle | tests/models/virtualfolder.py | 7 | 7012 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from __future__ import absolute_import
from... | gpl-3.0 |
zestrada/nova-cs498cc | nova/tests/servicegroup/test_mc_servicegroup.py | 10 | 8818 | # Copyright (c) 2013 Akira Yoshiyama <akirayoshiyama at gmail dot com>
#
# This is derived from test_db_servicegroup.py.
# Copyright 2012 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 t... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/263_test_doctest2.py | 77 | 2269 | # -*- coding: utf-8 -*-
u"""A module to test whether doctest recognizes some 2.2 features,
like static and class methods.
>>> print 'yup' # 1
yup
We include some (random) encoded (utf-8) text in the text surrounding
the example. It should be ignored:
ЉЊЈЁЂ
"""
from test import test_support
class C(object):
... | gpl-3.0 |
romain-dartigues/ansible | lib/ansible/modules/network/asa/asa_config.py | 20 | 11223 | #!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],... | gpl-3.0 |
shoopio/shoop | shuup/core/excs.py | 1 | 1158 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from shuup.utils.excs import Problem
class ImmutabilityError(Val... | agpl-3.0 |
asingla87/python-astm | astm/codec.py | 16 | 10528 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from collections import Iterable
from .compat import unicode
from .constants import (
STX, ETX, ETB... | bsd-3-clause |
PaddlePaddle/models | PaddleCV/tracking/ltr/data/transforms.py | 1 | 6374 | import random
import numpy as np
import math
import cv2 as cv
from paddle.fluid import layers
from pytracking.libs.paddle_utils import PTensor
class Transform:
""" Class for applying various image transformations."""
def __call__(self, *args):
rand_params = self.roll()
if rand_pa... | apache-2.0 |
silentfuzzle/calibre | src/calibre/gui2/catalog/catalog_bibtex.py | 14 | 3807 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.gui2 import gprefs
from calibre.gui2.catalog.catalog_bibtex_ui import ... | gpl-3.0 |
0Chencc/CTFCrackTools | Lib/site-packages/pip/__init__.py | 328 | 11348 | #!/usr/bin/env python
from __future__ import absolute_import
import locale
import logging
import os
import optparse
import warnings
import sys
import re
# 2016-06-17 barry@debian.org: urllib3 1.14 added optional support for socks,
# but if invoked (i.e. imported), it will issue a warning to stderr if socks
# isn't a... | gpl-3.0 |
ulope/geopy | geopy/geocoders/virtual_earth.py | 1 | 2555 | import re
from urllib2 import urlopen
from urllib import urlencode
import simplejson
from geopy.geocoders.base import Geocoder
from geopy.point import Point
from geopy.location import Location
from geopy import util
import logging
log = logging.getLogger(__name__)
class VirtualEarth(Geocoder):
"""Geocoder using M... | mit |
slayerjain/servo | tests/wpt/harness/wptrunner/testrunner.py | 43 | 25272 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals
import multiprocessing
import sys
import threading
import traceback
from Queue ... | mpl-2.0 |
Lekanich/intellij-community | python/lib/Lib/site-packages/django/core/serializers/__init__.py | 74 | 3535 | """
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_query_set)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... | apache-2.0 |
simoninireland/epydemic | epydemic/__init__.py | 1 | 3722 | # Initialisation for epydemic
#
# Copyright (C) 2017--2020 Simon Dobson
#
# This file is part of epydemic, epidemic network simulations in Python.
#
# epydemic 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, e... | gpl-3.0 |
dfunckt/django | tests/template_tests/syntax_tests/test_named_endblock.py | 521 | 2312 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class NamedEndblockTests(SimpleTestCase):
@setup({'namedendblocks01': '1{% block first %}_{% block second %}'
'2{% endblock second %}_{% endblock first %}3'})
def ... | bsd-3-clause |
HeinleinSupport/check_mk | python-cryptography/lib/python/cryptography/hazmat/primitives/asymmetric/x25519.py | 8 | 1652 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import six
from cryptography.exceptions import UnsupportedAl... | gpl-2.0 |
jsburg/xdsme | XOconv/ThreeAxisRotation.py | 8 | 10447 | # This module defines a class that represent coordinate rotation by
# a three axis rotation system. Handy for goniosta systems, Euler angles or Kappa
# angles manipulation.
#
# Need the ScientificPython module by Konrad Hinsen
# http://starship.python.net/crew/hinsen/scientific.html
# NOTE: The getAngles method has bee... | bsd-3-clause |
adamwwt/chvac | venv/lib/python2.7/site-packages/coverage/templite.py | 160 | 6868 | """A simple Python template renderer, for a nano-subset of Django syntax."""
# Coincidentally named the same as http://code.activestate.com/recipes/496702/
import re
from coverage.backward import set # pylint: disable=W0622
class CodeBuilder(object):
"""Build source code conveniently."""
... | mit |
awagnon/maraschino | lib/flask/testsuite/ext.py | 57 | 4720 | # -*- coding: utf-8 -*-
"""
flask.testsuite.ext
~~~~~~~~~~~~~~~~~~~
Tests the extension import thing.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
import unittest
from flask.testsuite import FlaskTestCase... | mit |
kubum/elasticsearch | dev-tools/download-s3.py | 236 | 2295 | # Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | apache-2.0 |
ad-m/python-anticaptcha | python_anticaptcha/fields.py | 1 | 5444 | import six
from python_anticaptcha.exceptions import InvalidWidthException, MissingNameException
class BaseField(object):
label = None
labelHint = None
def serialize(self, name=None):
data = {}
if self.label:
data["label"] = self.label or False
if self.labelHint:
... | mit |
CentreForCorpusResearch/clic | clic/normalizer.py | 2 | 1240 | # -*- coding: utf-8 -*-
'''
Defines normalizers that can be used in the cheshire3 indexing workflow.
'''
from cheshire3.normalizer import SimpleNormalizer
class NovelNormalizer(SimpleNormalizer):
def __init__(self, session, config, parent):
SimpleNormalizer.__init__(self, session, config, parent)
... | mit |
TDAbboud/micropython | tests/micropython/viper_error.py | 27 | 1989 | # test syntax and type errors specific to viper code generation
def test(code):
try:
exec(code)
except (SyntaxError, ViperTypeError, NotImplementedError) as e:
print(repr(e))
# viper: annotations must be identifiers
test("@micropython.viper\ndef f(a:1): pass")
test("@micropython.viper\ndef f()... | mit |
Matt-Deacalion/Mentalist | mentalist/settings/local.py | 1 | 2932 | """Development settings and globals."""
from .base import *
# ──┤ DEBUG CONFIGURATION ├───────────────────────────────────────────────────┐
# See: http://serk.io/ref/settings/#debug
DEBUG = True
# See: http://serk.io/ref/settings/#template-debug
TEMPLATE_DEBUG = DEBUG
# ──────────────────────────────────────────────... | mit |
woltage/ansible | lib/ansible/plugins/action/copy.py | 9 | 15017 | # (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 |
xiaoyaozi5566/GEM5_DRAMSim2 | src/arch/x86/isa/insts/simd128/floating_point/logical/andp.py | 91 | 4275 | # 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 |
porduna/weblabdeusto | server/src/weblab/admin/script/httpd_config_generate.py | 3 | 8900 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... | bsd-2-clause |
evanma92/routeh | flask/lib/python2.7/site-packages/requests/auth.py | 413 | 6794 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
from base64 import b64encode
from .compat import urlparse, str
from .cookies import extract_cookies_to_jar
from .utils import parse_dict_header, ... | bsd-3-clause |
botswana-harvard/edc-registration | edc_registration/model_mixins/registered_subject_model_mixin.py | 1 | 8797 | import re
from django.apps import apps as django_apps
from django.core.validators import RegexValidator
from django.db import models, transaction
from django.utils.translation import ugettext as _
from django_crypto_fields.fields import FirstnameField, LastnameField
from django_crypto_fields.fields import IdentityFiel... | gpl-2.0 |
agx/git-buildpackage | gbp/pkg/compressor.py | 1 | 2348 | # vim: set fileencoding=utf-8 :
#
# (C) 2017 Guido Günther <agx@sigxcpu.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) an... | gpl-2.0 |
hugeinc/behave-parallel | test/test_runner.py | 1 | 31768 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from collections import defaultdict
import os.path
import StringIO
import sys
import warnings
import tempfile
from mock import Mock, patch
from nose.tools import *
import unittest
from behave import model, parser, runner, step_registry
from behave.configu... | bsd-2-clause |
bobthekingofegypt/servo | tests/wpt/web-platform-tests/tools/pytest/_pytest/python.py | 167 | 89406 | """ Python test discovery, setup and run of test functions. """
import fnmatch
import functools
import inspect
import re
import types
import sys
import py
import pytest
from _pytest._code.code import TerminalRepr
from _pytest.mark import MarkDecorator, MarkerError
try:
import enum
except ImportError: # pragma: n... | mpl-2.0 |
lucas794/TP3-Algo-I- | interfaz_jugador.py | 1 | 5482 | import dados
import tablero
from entrada_usuario import *
class InterfazJugador(object):
"""Abstae la interfaz hacia el usuario, para solicitarle ingresos respecto a un determinado
jugador, manejado por dicho usuario."""
def __init__(self):
self.armas = []
self.lugares = []
self.pe... | agpl-3.0 |
titilambert/alignak | alignak/dependencynode.py | 1 | 30114 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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, eit... | agpl-3.0 |
openweave/openweave-core | src/test-apps/happy/tests/service/wdmNext/test_weave_wdm_next_service_update_07_cond_OneLeaf_multi_traits.py | 1 | 2979 | #!/usr/bin/env python3
#
# Copyright (c) 2016-2017 Nest Labs, 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/lic... | apache-2.0 |
nealtodd/wagtail | wagtail/contrib/settings/tests/test_templates.py | 13 | 10270 | from django.template import Context, RequestContext, Template, engines
from django.test import TestCase
from wagtail.core.models import Page, Site
from wagtail.tests.testapp.models import TestSetting
from wagtail.tests.utils import WagtailTestUtils
class TemplateTestCase(TestCase, WagtailTestUtils):
def setUp(se... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/asn1crypto/_elliptic_curve.py | 16 | 9411 | # coding: utf-8
"""
Classes and objects to represent prime-field elliptic curves and points on them.
Exports the following items:
- PrimeCurve()
- PrimePoint()
- SECP192R1_CURVE
- SECP192R1_BASE_POINT
- SECP224R1_CURVE
- SECP224R1_BASE_POINT
- SECP256R1_CURVE
- SECP256R1_BASE_POINT
- SECP384R1_CURVE
- SECP3... | gpl-3.0 |
laborautonomo/poedit | deps/boost/tools/build/v2/test/project_test4.py | 64 | 1792 | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003, 2004 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester(translate_suffixes=0)
t.set_tree("projec... | mit |
yongshengwang/hue | desktop/core/ext-py/pycrypto-2.6.1/build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG/test_nt.py | 131 | 1764 | # -*- coding: utf-8 -*-
#
# SelfTest/Util/test_generic.py: Self-test for the OSRNG.nt.new() function
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent t... | apache-2.0 |
osma/annif | create_corpus_yso_finna.py | 1 | 4644 | #!/usr/bin/env python3
from SPARQLWrapper import SPARQLWrapper, JSON
import requests
import re
import os
import os.path
import time
import sys
FINTO_ENDPOINT='http://api.dev.finto.fi/sparql'
FINNA_API_SEARCH='https://api.finna.fi/v1/search'
lang = sys.argv[1]
# map ISO 639-1 language codes into the ISO 639-2 codes ... | cc0-1.0 |
danielneis/osf.io | api_tests/nodes/views/test_node_links_detail.py | 2 | 9590 | # -*- coding: utf-8 -*-
from nose.tools import * # flake8: noqa
from urlparse import urlparse
from framework.auth.core import Auth
from website.models import NodeLog
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from tests.factories import (
ProjectFactory,
RegistrationF... | apache-2.0 |
DazWorrall/ansible | lib/ansible/modules/cloud/google/gce_tag.py | 26 | 7635 | #!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],... | gpl-3.0 |
melqkiades/yelp | source/python/recommenders/context/neighbourhood/simple_neighbourhood_calculator.py | 1 | 2089 | from recommenders.context.neighbourhood.abstract_neighbourhood_calculator import \
AbstractNeighbourhoodCalculator
from utils import dictionary_utils
__author__ = 'fpena'
class SimpleNeighbourhoodCalculator(AbstractNeighbourhoodCalculator):
def __init__(self, user_similarity_calculator):
super(Simpl... | lgpl-2.1 |
open-synergy/account-invoicing | account_invoice_shipping_address/__openerp__.py | 15 | 1563 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>).
# Copyright (C) 2013 Andrea Cometa Perito Informatico (www.andreacometa.it)
#
# This program... | agpl-3.0 |
trialreach/django-better-chunks | chunks/templatetags/chunks.py | 3 | 2103 | from django import template
from django.db import models
from django.core.cache import cache
from django.contrib.sites.models import Site
register = template.Library()
Chunk = models.get_model('chunks', 'Chunk')
CACHE_PREFIX = "chunk_"
def do_get_chunk(parser, token):
# split_contents() knows not to split quoted... | bsd-3-clause |
lucidbard/mendeley-python-sdk | test/resources/documents/test_list_group_documents.py | 2 | 1175 | from test import get_user_session, cassette
from test.resources.documents import delete_all_group_documents, create_group_document
def test_should_page_through_group_documents():
session = get_user_session()
delete_all_group_documents()
with cassette('fixtures/resources/documents/list_group_documents/pag... | apache-2.0 |
ihipi/Sick-Beard | lib/hachoir_metadata/audio.py | 90 | 15495 | from lib.hachoir_metadata.metadata import (registerExtractor,
Metadata, RootMetadata, MultipleMetadata)
from lib.hachoir_parser.audio import AuFile, MpegAudioFile, RealAudioFile, AiffFile, FlacParser
from lib.hachoir_parser.container import OggFile, RealMediaFile
from lib.hachoir_core.i18n import _
from lib.hachoir... | gpl-3.0 |
CognitiveScale/ansible-modules-extras | notification/mqtt.py | 101 | 4848 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, 2014, Jan-Piet Mens <jpmens () 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... | gpl-3.0 |
pbrod/numpy | numpy/core/fromnumeric.py | 2 | 122368 | """Module containing non-deprecated functions borrowed from Numeric.
"""
import functools
import types
import warnings
import numpy as np
from . import multiarray as mu
from . import overrides
from . import umath as um
from . import numerictypes as nt
from .multiarray import asarray, array, asanyarray, concatenate
fr... | bsd-3-clause |
fhedberg/ardupilot | libraries/AP_HAL/examples/DSP_test/gyro_isb_reader.py | 21 | 4048 | #!/usr/bin/env python
'''
extract ISBH and ISBD messages from AP_Logging files and produce C++ arrays for consumption by the DSP subsystem
'''
from __future__ import print_function
import os
import sys
import time
import copy
import numpy
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc... | gpl-3.0 |
TedaLIEz/sentry | tests/sentry/api/bases/test_project.py | 23 | 2981 | from __future__ import absolute_import
from mock import Mock
from sentry.api.bases.project import ProjectPermission
from sentry.models import ApiKey, OrganizationMemberType, ProjectKey
from sentry.testutils import TestCase
class ProjectPermissionBase(TestCase):
def setUp(self):
self.org = self.create_or... | bsd-3-clause |
ashvina/heron | heron/tools/tracker/src/python/main.py | 4 | 10515 | #!/usr/bin/env python2.7
# -*- encoding: 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 Apa... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.