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 |
|---|---|---|---|---|---|
joharei/plasma-netctl | contents/code/netctl.py | 1 | 2541 | # -*- coding: utf-8 -*-
#
# Author: Johan Reitan <johan.reitan@gmail.com>
# Date: Sat Jan 18 2014, 17:03:40
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as
# published by the Free Software Foundation; either version 2, or
# (at y... | gpl-3.0 |
Anonymouslemming/ansible | lib/ansible/modules/network/nxos/nxos_ip_interface.py | 41 | 19437 | #!/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 |
dgouldin/realtime-restful | djapi/api/url_registry.py | 2 | 2925 | import types
from collections import defaultdict
from functools import wraps
from urlparse import urljoin
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse, NoReverseMatch
LIST_METHODS = ('POST',)
DETAIL_METHODS = ('PUT', 'PATCH', 'DELETE',)
ALL_METHODS = LIST_ME... | mit |
duoduo369/python-social-auth | social/backends/oauth.py | 6 | 15561 | import six
from requests import HTTPError
from requests_oauthlib import OAuth1
from oauthlib.oauth1 import SIGNATURE_TYPE_AUTH_HEADER
from social.p3 import urlencode, unquote
from social.utils import url_add_parameters, parse_qs
from social.exceptions import AuthFailed, AuthCanceled, AuthUnknownError, \
... | bsd-3-clause |
florentx/OpenUpgrade | openerp/modules/loading.py | 2 | 21900 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
mshirley/dionaea | tests/sip/functional-test-sip.py | 15 | 9957 | ################################################################################
#
# Stand-alone VoIP honeypot client (preparation for Dionaea integration)
# Copyright (c) 2010 Tobias Wulff (twu200 at gmail)
#
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Gener... | gpl-2.0 |
embecosm/avr-binutils-gdb | gdb/testsuite/gdb.python/py-finish-breakpoint2.py | 41 | 1221 | # Copyright (C) 2011-2014 Free Software Foundation, Inc.
# 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 progr... | gpl-2.0 |
h4ck3rm1k3/pip | pip/vcs/__init__.py | 280 | 11760 | """Handles all VCS (version control) support"""
from __future__ import absolute_import
import errno
import logging
import os
import shutil
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.exceptions import BadCommand
from pip.utils import (display_path, backup_dir, call_subprocess,
... | mit |
rudhir-upretee/Sumo17_With_Netsim | tools/net/batch0103to0110.py | 1 | 1060 | #!/usr/bin/python
"""
@file batch0103to0110.py
@author Daniel Krajzewicz
@author Michael Behrisch
@date 2007
@version $Id: batch0103to0110.py 13811 2013-05-01 20:31:43Z behrisch $
Applies the transformation on all nets in the given folder or
- if no folder is given - in the base folder (../..).
SUMO, Simula... | gpl-3.0 |
southpawtech/TACTIC-DEV | src/pyasm/search/widget_db_config.py | 6 | 27014 | ##########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permis... | epl-1.0 |
John-Boik/Principled-Societies-Project | leddaApp/static/brython/src/Lib/test/test_socket.py | 23 | 184077 | #!/usr/bin/env python3
import unittest
from test import support
from unittest.case import _ExpectedFailure
import errno
import io
import socket
import select
import tempfile
import _testcapi
import time
import traceback
import queue
import sys
import os
import array
import platform
import contextlib
from weakref impo... | gpl-3.0 |
adrienpacifico/openfisca-france | openfisca_france/tests/test_cotsoc_sal_cap.py | 2 | 14282 | # -*- coding: utf-8 -*-
import datetime
from openfisca_core import periods
from openfisca_france.tests.base import tax_benefit_system
tests = [
dict(
# test sur un revenu des actions soumises à un prélèvement libératoire de
# 21 % (2DA)
name = "f2da_2012",
period = "2012",
... | agpl-3.0 |
ejspina/Gene_expression_tools | Python/fasta_transcript2gene.py | 1 | 1865 | #-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: Eli
#
# Created: 18/12/2013
# Copyright: (c) Eli 2013
# Licence: <your licence>
#-------------------------------------------------------------------------------
def m... | gpl-2.0 |
rajashreer7/autotest-client-tests | linux-tools/libusb/libusb.py | 3 | 1655 | #!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error, software_manager
sm = software_manager.SoftwareManager()
class libusb(test.test):
"""
Autotest module for testing basic functionality
of libusb
@author Xu Zheng ,zhengxu@cn.i... | gpl-2.0 |
WoodMath/three.js | utils/converters/msgpack/msgpack/fallback.py | 641 | 26403 | """Fallback pure Python implementation of msgpack"""
import sys
import array
import struct
if sys.version_info[0] == 3:
PY3 = True
int_types = int
Unicode = str
xrange = range
def dict_iteritems(d):
return d.items()
else:
PY3 = False
int_types = (int, long)
Unicode = unicode
... | mit |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/google/appengine/ext/mapreduce/status.py | 7 | 11882 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | bsd-3-clause |
bebatut/bioconda-recipes | recipes/biopet-bamstats/1.0/biopet-bamstats.py | 40 | 3367 | #!/usr/bin/env python
#
# Wrapper script for starting the biopet-bamstats JAR package
#
# This script is written for use with the Conda package manager and is copied
# from the peptide-shaker wrapper. Only the parameters are changed.
# (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shaker/pep... | mit |
RavilN/freeopcua | tests/gmock/scripts/generator/gmock_gen.py | 1159 | 1091 | #!/usr/bin/env python
#
# Copyright 2008 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 requir... | lgpl-3.0 |
hefen1/chromium | chrome/common/extensions/docs/server2/new_github_file_system_test.py | 97 | 10128 | #!/usr/bin/env python
# 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 json
from copy import deepcopy
from cStringIO import StringIO
from functools import partial
from hashlib import sha1
from random... | bsd-3-clause |
jyotsna1820/django | tests/admin_validation/models.py | 192 | 1332 | """
Tests of ModelAdmin validation logic.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Album(models.Model):
title = models.CharField(max_length=150)
@python_2_unicode_compatible
class Song(models.Model):
title = models.CharField(max_length=150)
al... | bsd-3-clause |
OpenDaisy/daisy-api | daisy/api/v1/config_sets.py | 1 | 17500 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
slevenhagen/odoomrp-wip-npg | machine_manager/models/res_users.py | 16 | 1153 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Daniel Campos (danielcampos@avanzosc.es) Date: 08/09/2014
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publi... | agpl-3.0 |
Neozaru/depot_tools | third_party/simplejson/encoder.py | 296 | 18214 | """Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_basestring_ascii, c_make_encoder = _im... | bsd-3-clause |
fmonjalet/miasm | miasm2/ir/ir.py | 1 | 11474 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
#
# Copyright (C) 2013 Fabrice Desclaux
#
# 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) any ... | gpl-2.0 |
msegado/edx-platform | common/djangoapps/third_party_auth/tests/specs/test_google.py | 43 | 6455 | """Integration tests for Google providers."""
import base64
import hashlib
import hmac
from django.conf import settings
from django.core.urlresolvers import reverse
import json
from mock import patch
from social.exceptions import AuthException
from student.tests.factories import UserFactory
from third_party_auth import... | agpl-3.0 |
joopert/home-assistant | homeassistant/components/pi_hole/const.py | 2 | 1370 | """Constants for the pi_hole intergration."""
from datetime import timedelta
DOMAIN = "pi_hole"
CONF_LOCATION = "location"
DEFAULT_HOST = "pi.hole"
DEFAULT_LOCATION = "admin"
DEFAULT_METHOD = "GET"
DEFAULT_NAME = "Pi-Hole"
DEFAULT_SSL = False
DEFAULT_VERIFY_SSL = True
SERVICE_DISABLE = "disable"
SERVICE_ENABLE = "e... | apache-2.0 |
profblock/adaptive-litmus | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
agiliq/nginx-python-buildpack | vendor/pip-1.5.4/pip/_vendor/requests/packages/charade/langgreekmodel.py | 2763 | 12628 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
GlobalBoost/GlobalBoost-Y | test/functional/wallet_labels.py | 9 | 10891 | #!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test label RPCs.
RPCs tested are:
- getaccountaddress
- getaddressesbyaccount/getaddressesbyla... | mit |
jbassen/edx-platform | common/djangoapps/third_party_auth/tests/utils.py | 112 | 3037 | """Common utility for testing third party oauth2 features."""
import json
import httpretty
from provider.constants import PUBLIC
from provider.oauth2.models import Client
from social.apps.django_app.default.models import UserSocialAuth
from student.tests.factories import UserFactory
from .testutil import ThirdParty... | agpl-3.0 |
AnishShah/tensorflow | tensorflow/contrib/learn/python/learn/utils/export.py | 28 | 13975 | # 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 |
IvanGavran/scrapy | scrapy/utils/reactor.py | 178 | 1360 | from twisted.internet import reactor, error
def listen_tcp(portrange, host, factory):
"""Like reactor.listenTCP but tries different ports in a range."""
assert len(portrange) <= 2, "invalid portrange: %s" % portrange
if not hasattr(portrange, '__iter__'):
return reactor.listenTCP(portrange, factory... | bsd-3-clause |
23andMe/ansible-modules-core | cloud/rackspace/rax_cdb_database.py | 157 | 4848 | #!/usr/bin/python -tt
# 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 distrib... | gpl-3.0 |
larrybradley/astropy-helpers | astropy_helpers/sphinx/ext/doctest.py | 12 | 1310 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This is a set of three directives that allow us to insert metadata
about doctests into the .rst files so the testing framework knows
which tests to skip.
This is quite different from the doctest extension in Sphinx itself,
which actually does somethin... | bsd-3-clause |
dd00/commandergenius | project/jni/python/src/Lib/hmac.py | 253 | 4531 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
"""
import warnings as _warnings
trans_5C = "".join ([chr (x ^ 0x5C) for x in xrange(256)])
trans_36 = "".join ([chr (x ^ 0x36) for x in xrange(256)])
# The size of the digests returned by HMAC ... | lgpl-2.1 |
pigeonflight/strider-plone | docker/appengine/lib/django-1.4/django/contrib/admin/util.py | 81 | 14304 | from django.db import models
from django.db.models.sql.constants import LOOKUP_SEP
from django.db.models.deletion import Collector
from django.db.models.related import RelatedObject
from django.forms.forms import pretty_name
from django.utils import formats
from django.utils.html import escape
from django.utils.safestr... | mit |
OliverWalter/amdtk | amdtk/models/normal_gamma.py | 1 | 2962 |
""" Normal-Gamma density."""
import numpy as np
from scipy.special import gammaln, psi
class NormalGamma(object):
"""Normal-Gamma density.
Attributes
----------
mu : numpy.ndarray
Mean of the Gaussian density.
kappa : float
Factor of the precision matrix.
alpha : float
... | bsd-2-clause |
zhimin711/nova | nova/tests/unit/monkey_patch_example/__init__.py | 120 | 1111 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
seraphlnWu/django-mongoengine | django_mongoengine/admin/util.py | 3 | 3183 | from django.utils.encoding import force_unicode, smart_unicode, smart_str
from django.forms.forms import pretty_name
from django.db.models.fields import FieldDoesNotExist
from django.utils import formats
from mongoengine import fields
from django_mongoengine.forms.document_options import DocumentMetaWrapper
from djan... | bsd-3-clause |
2014c2g19/2014c2g19 | exts/w2/static/Brython2.0.0-20140209-164925/Lib/logging/config.py | 739 | 35619 | # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | gpl-2.0 |
ecmas/cocos2d | tools/particle/convert_YCoordFlipped.py | 89 | 2224 | #!/usr/bin/python
#ConvertYCoordFlipped.py
import plistlib
import os.path
import argparse
import glob
import shutil
#keys in dictionary
metaDataKey = 'metaData'
yCoordFlippedConvertedKey = 'yCoordFlippedConverted'
yCoordFlippedKey = 'yCoordFlipped'
#check if the particle file has been converted
def checkFlippedConve... | mit |
alexdebrie/moto | moto/kms/models.py | 9 | 2035 | from __future__ import unicode_literals
import boto.kms
from moto.core import BaseBackend
from .utils import generate_key_id
from collections import defaultdict
class Key(object):
def __init__(self, policy, key_usage, description, region):
self.id = generate_key_id()
self.policy = policy
... | apache-2.0 |
schwarz/youtube-dl | youtube_dl/extractor/dhm.py | 110 | 2089 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import parse_duration
class DHMIE(InfoExtractor):
IE_DESC = 'Filmarchiv - Deutsches Historisches Museum'
_VALID_URL = r'https?://(?:www\.)?dhm\.de/filmarchiv/(?:[^/]+/)+(?P<id>[^/]+)'
_TESTS = [{
'url': 'http:... | unlicense |
dwightgunning/django | setup.py | 195 | 3257 | import os
import sys
from distutils.sysconfig import get_python_lib
from setuptools import find_packages, setup
# Warn if we are installing over top of an existing installation. This can
# cause issues where files that were deleted from a more recent Django are
# still present in site-packages. See #18115.
overlay_wa... | bsd-3-clause |
StanleyInnovation/vector_v1 | vector_common/vector_third_party/dynamixel_motor/dynamixel_driver/scripts/set_servo_config.py | 7 | 7190 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Software License Agreement (BSD License)
#
# Copyright (c) 2010-2011, Antons Rebguns.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Red... | bsd-3-clause |
zhupengGitHub/io2015-codelabs | search-samples/recipe-app-website/main.py | 16 | 3762 | # 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 law or ... | apache-2.0 |
priyaganti/rockstor-core | src/rockstor/storageadmin/urls/commands.py | 1 | 1347 | """
Copyright (c) 2012-2017 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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) any la... | gpl-3.0 |
cmuphyscomp/16-223-f15 | exercises/Raspberry-Pi/rpi-pdpython/pd_helper.py | 4 | 1304 | # pd_helper.py : simple demonstration of invoking a Python object from within Pd.
import socket
import wiringpi2 as wp
import time
################################################################
# Python class to instantiate
class Helper:
def __init__(self):
pass
def lookup_host( self, name ):
... | bsd-3-clause |
levilucio/SyVOLT | UMLRT2Kiltera_MM/merge_inter_layer_rules/models/move_one_input_indirect_match_diff_rules_MDL.py | 6 | 28555 | """
__move_one_input_indirect_match_diff_rules_MDL.py_____________________________________________________
Automatically generated AToM3 Model File (Do not modify directly)
Author: levi
Modified: Wed Aug 21 16:38:26 2013
__________________________________________________________________________________________________... | mit |
jpwilliams/appenlight-client-python | appenlight_client/timing/__init__.py | 1 | 7630 | from __future__ import absolute_import
import logging
import time
import threading
from appenlight_client.utils import import_from_module
from datetime import datetime, timedelta
from functools import wraps
from operator import itemgetter
default_timer = time.time
class AppenlightLocalStorage(object):
def __in... | bsd-3-clause |
marchon/flask-virtualenv | setup.py | 1 | 1029 | #!/usr/bin/env python
"""
https://github.com/imlucas/flask-virtualenv
"""
from setuptools import setup
setup(
name='Flask-Virtualenv',
version='0.2.0',
url='http://imlucas.com',
license='BSD',
author='Lucas Hrabovsky',
author_email='hrabovsky.lucas@gmail.com',
description='Manage a virtual... | bsd-3-clause |
mancoast/CPythonPyc_test | fail/324_test_property.py | 6 | 6923 | # Test case for property
# more tests are in test_descr
import sys
import unittest
from test.support import run_unittest
class PropertyBase(Exception):
pass
class PropertyGet(PropertyBase):
pass
class PropertySet(PropertyBase):
pass
class PropertyDel(PropertyBase):
pass
class BaseClass(object):
... | gpl-3.0 |
OfficialMan/Sark | plugins/quick_copy.py | 4 | 1590 | import idaapi
import clipboard
import sark
def message(*messages):
for msg in messages:
for line in msg.splitlines():
idaapi.msg("[QuickCopy] {}\n".format(line))
def copy_current_address():
start, end = sark.get_selection()
clipboard.copy("0x{:08X}".format(start))
def copy_current_... | mit |
artursmet/climbing-contest | contest/views.py | 1 | 2281 | #coding: utf-8
from __future__ import unicode_literals
import csv
from django.template.response import TemplateResponse
from django.shortcuts import redirect, get_object_or_404
from django.contrib import messages
from django.http import HttpResponse
from django.contrib.auth.decorators import user_passes_test
from con... | apache-2.0 |
tedmeeds/tcga_encoder | tcga_encoder/utils/helpers.py | 1 | 3776 | import tensorflow
import tcga_encoder
import sys, os, yaml
import numpy as np
import scipy as sp
import pylab as pp
import pandas as pd
from sklearn.metrics import roc_auc_score, roc_curve
from sklearn.model_selection import KFold
from collections import *
import itertools
import pdb
def xval_folds( n, K, randomize = F... | mit |
kbrebanov/ansible | lib/ansible/modules/network/aci/aci_tenant_ep_retention_policy.py | 2 | 7828 | #!/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 |
CubicERP/geraldo | site/newsite/django_1_0/django/contrib/sitemaps/views.py | 55 | 1891 | from django.http import HttpResponse, Http404
from django.template import loader
from django.contrib.sites.models import Site
from django.core import urlresolvers
from django.utils.encoding import smart_str
from django.core.paginator import EmptyPage, PageNotAnInteger
def index(request, sitemaps):
current_site = S... | lgpl-3.0 |
agry/NGECore2 | scripts/mobiles/endor/roba_runt.py | 2 | 1429 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | lgpl-3.0 |
sonoble/fboss | fboss/agent/tools/fboss_route.py | 1 | 6527 | #!/usr/bin/env python
# Copyright (C) 2004-present Facebook. All Rights Reserved
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
"""Add, change, or delete a route on FBOSS controller
"""
import contextlib
import ipad... | bsd-3-clause |
TanguyPatte/phantomjs-packaging | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/views/printing_unittest.py | 121 | 8467 | # Copyright (C) 2010, 2012 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 an... | bsd-3-clause |
kisna72/django | django/conf/locale/en/formats.py | 1007 | 1815 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIM... | bsd-3-clause |
PowerDNS/pdns | regression-tests.dnsdist/test_Dnstap.py | 4 | 18814 | #!/usr/bin/env python
import threading
import os
import socket
import struct
import sys
import time
from dnsdisttests import DNSDistTest, Queue
import dns
import dnstap_pb2
FSTRM_CONTROL_ACCEPT = 0x01
FSTRM_CONTROL_START = 0x02
FSTRM_CONTROL_STOP = 0x03
FSTRM_CONTROL_READY = 0x04
FSTRM_CONTROL_FINISH = 0x05
def che... | gpl-2.0 |
akshatharaj/django | django/conf/locale/it/formats.py | 504 | 2079 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y' # 25 Ottobre 2006
TIME_FO... | bsd-3-clause |
shubham0d/smc | salvus/scripts/update_git.py | 6 | 1435 | #!/usr/bin/env python
###############################################################################
#
# SageMathCloud: A collaborative web-based interface to Sage, IPython, LaTeX and the Terminal.
#
# Copyright (C) 2014, William Stein
#
# This program is free software: you can redistribute it and/or modify
# ... | gpl-3.0 |
hoangminhitvn/flask | flask/lib/python2.7/site-packages/pip/_vendor/packaging/version.py | 451 | 11884 | # Copyright 2014 Donald Stufft
#
# 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, so... | bsd-3-clause |
rohitwaghchaure/erpnext_develop | erpnext/stock/report/stock_ledger/stock_ledger.py | 10 | 5187 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns = get_columns()
sl_entries = get_stock_ledger_entries(filters)
item_details = ... | gpl-3.0 |
whitepyro/debian_server_setup | lib/hachoir_core/dict.py | 90 | 5384 | """
Dictionnary classes which store values order.
"""
from lib.hachoir_core.error import HachoirError
from lib.hachoir_core.i18n import _
class UniqKeyError(HachoirError):
"""
Error raised when a value is set whereas the key already exist in a
dictionnary.
"""
pass
class Dict(object):
"""
... | gpl-3.0 |
anbangleo/NlsdeWeb | Python-3.6.0/Tools/scripts/analyze_dxp.py | 122 | 4183 | """
Some helper functions to analyze the output of sys.getdxp() (which is
only available if Python was built with -DDYNAMIC_EXECUTION_PROFILE).
These will tell you which opcodes have been executed most frequently
in the current process, and, if Python was also built with -DDXPAIRS,
will tell you which instruction _pair... | mit |
Gui13/CouchPotatoServer | libs/pyasn1/codec/cer/encoder.py | 226 | 3161 | # CER encoder
from pyasn1.type import univ
from pyasn1.codec.ber import encoder
from pyasn1.compat.octets import int2oct, null
class BooleanEncoder(encoder.IntegerEncoder):
def encodeValue(self, encodeFun, client, defMode, maxChunkSize):
if client == 0:
substrate = int2oct(0)
else:
... | gpl-3.0 |
apyrgio/synnefo | snf-astakos-app/astakos/im/views/target/shibboleth.py | 6 | 6954 | # 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 |
bertucho/moviestalk2 | venv/Lib/site-packages/gunicorn/debug.py | 155 | 2303 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
"""The debug module contains utilities and functions for better
debugging Gunicorn."""
import sys
import linecache
import re
import inspect
__all__ = ['spew', 'unspew']
_token_spliter = re.... | mit |
QInfer/python-qinfer | src/qinfer/distributions.py | 3 | 51767 | #!/usr/bin/python
# -*- coding: utf-8 -*-
##
# distributions.py: module for probability distributions.
##
# © 2017, Chris Ferrie (csferrie@gmail.com) and
# Christopher Granade (cgranade@cgranade.com).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided t... | bsd-3-clause |
LAL/openstack-lease-it | openstack_lease_it/lease_it/datastore/ModelAccess.py | 2 | 4817 | # -*- coding: utf-8 -*-
"""
ModelAccess module is a interface between Django model and view
"""
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from django.core.exceptions import ObjectDoesNotExist
from lease_it.models import Instances
from lease_it.datastore.Exceptions import Sti... | apache-2.0 |
gdimitris/FleetManagerBackend | virtual_env/lib/python2.7/site-packages/sqlalchemy/sql/expression.py | 49 | 5833 | # sql/expression.py
# Copyright (C) 2005-2015 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
"""Defines the public namespace for SQL expression constructs.
Prior to version 0... | mit |
sh4wn/vispy | vispy/visuals/filters/material.py | 21 | 3248 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Material components are modular shader components used for modifying fragment
colors to change the visual's appearance.
These generally create a function in the fragment ... | bsd-3-clause |
custom22/google-python-exercises | basic/string1.py | 1 | 3771 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... | apache-2.0 |
aequitas/home-assistant | homeassistant/components/tesla/lock.py | 6 | 1612 | """Support for Tesla door locks."""
import logging
from homeassistant.components.lock import ENTITY_ID_FORMAT, LockDevice
from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED
from . import DOMAIN as TESLA_DOMAIN, TeslaDevice
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entitie... | apache-2.0 |
Northrend/mxnet | example/kaggle-ndsb1/train_dsb.py | 41 | 4039 | # 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 u... | apache-2.0 |
olivierkes/manuskript | manuskript/ui/editors/completer_ui.py | 2 | 1166 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'manuskript/ui/editors/completer_ui.ui'
#
# Created by: PyQt5 UI code generator 5.4.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtWidgets
class Ui_completer(object):
def setupUi(self, completer):... | gpl-3.0 |
Bloodyaugust/pongsugarlabcpp | lib/boost/tools/build/test/searched_lib.py | 6 | 5114 | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2003, 2004, 2005, 2006 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)
# Test usage of searched-libs: one which are found via -l
# switch to... | gpl-2.0 |
aurelijusb/arangodb | 3rdParty/V8-4.3.61/build/gyp/test/win/linker-flags/update_pgd.py | 133 | 1213 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from optparse import OptionParser
import glob
import os
import subprocess
parser = OptionParser()
parser.add_option('--exe', dest='exe')
pa... | apache-2.0 |
fengbaicanhe/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 |
mlperf/inference_results_v0.7 | open/Inspur/code/3d-unet/tensorrt/preprocess_data.py | 18 | 13825 | #!/usr/bin/python3
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | apache-2.0 |
weidel-p/nest-simulator | pynest/nest/tests/test_spatial/test_plotting.py | 12 | 5748 | # -*- coding: utf-8 -*-
#
# test_plotting.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, ... | gpl-2.0 |
bspink/django | tests/gis_tests/test_spatialrefsys.py | 319 | 4891 | import unittest
from django.contrib.gis.gdal import HAS_GDAL
from django.db import connection
from django.test import skipUnlessDBFeature
from django.utils import six
from .utils import SpatialRefSys, oracle, postgis, spatialite
test_srs = ({
'srid': 4326,
'auth_name': ('EPSG', True),
'auth_srid': 4326,
... | bsd-3-clause |
otherness-space/myProject002 | my_project_002/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langhungarianmodel.py | 2763 | 12536 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
adit-chandra/tensorflow | tensorflow/python/layers/core_test.py | 8 | 23979 | # 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 |
fly19890211/edx-platform | lms/djangoapps/certificates/views/xqueue.py | 51 | 9592 | """
Views used by XQueue certificate generation.
"""
import json
import logging
from django.contrib.auth.models import User
from django.http import HttpResponse, Http404, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
import dogstats_wra... | agpl-3.0 |
Integral-Technology-Solutions/ConfigNOW-4.3 | Lib/xml/dom/html/HTMLHtmlElement.py | 3 | 1385 | ########################################################################
#
# File Name: HTMLHtmlElement
#
# Documentation: http://docs.4suite.com/4DOM/HTMLHtmlElement.html
#
### This file is automatically generated by GenerateHtml.py.
### DO NOT EDIT!
"""
WWW: http://4suite.com/4DOM e-mail: ... | mit |
drpaneas/linuxed.gr | plugins/simple_footnotes.py | 1 | 4382 | from pelican import signals
import re
import html5lib
RAW_FOOTNOTE_CONTAINERS = ["code"]
def getText(node, recursive = False):
"""Get all the text associated with this node.
With recursive == True, all text from child nodes is retrieved."""
L = ['']
for n in node.childNodes:
if n.nodeType i... | mit |
piratos/ctfbulletin | ctfbulletin/settings.py | 1 | 2533 | """
Django settings for ctfbulletin project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...... | mit |
lthurlow/Boolean-Constrained-Routing | networkx-1.8.1/build/lib.linux-i686-2.7/networkx/algorithms/mis.py | 66 | 2481 | # -*- coding: utf-8 -*-
# $Id: maximalIndependentSet.py 576 2011-03-01 05:50:34Z lleeoo $
"""
Algorithm to find a maximal (not maximum) independent set.
"""
# Leo Lopes <leo.lopes@monash.edu>
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All right... | mit |
caseyrollins/osf.io | scripts/analytics/download_count_summary.py | 13 | 1345 | import pytz
import logging
import requests
from dateutil.parser import parse
from datetime import datetime, timedelta
from django.db.models import Q
from website.app import init_app
from scripts.analytics.base import SummaryAnalytics
from osf.models import PageCounter
class DownloadCountSummary(SummaryAnalytics):
... | apache-2.0 |
tadebayo/myedge | myvenv/Lib/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py | 3121 | 45978 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
Mageswaran1989/aja | src/test/python/examples/naive_bayes/naive_bayes.py | 1 | 4954 | from numpy import *
def loadDataSet():
postingList=[['my', 'dog', 'has', 'flea', 'problems', 'help', 'please'],
['maybe', 'not', 'take', 'him', 'to', 'dog', 'park', 'stupid'],
['my', 'dalmation', 'is', 'so', 'cute', 'I', 'love', 'him'],
['stop', 'posting', 'stupid... | apache-2.0 |
nexusz99/boto | boto/swf/layer1.py | 115 | 63928 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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... | mit |
kaplun/invenio | modules/bibsched/lib/bibsched_webapi.py | 16 | 3601 | ## This file is part of Invenio.
## Copyright (C) 2011, 2012 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) any later version.
##
... | gpl-2.0 |
barriquello/iotstack | openwsn-fw-work/firmware/openos/bootloader/telosb/lib/serial/serialwin32.py | 2 | 11414 | #! python
#serial driver for win32
#see __init__.py
#
#(C) 2001-2002 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
import win32file # The base COM port and file IO functions.
import win32event # We use events and the WaitFor[Single|Multiple]Objects functions.
im... | mit |
apark263/tensorflow | tensorflow/python/ops/parallel_for/array_test.py | 8 | 8471 | # 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 |
pong3489/TEST_Mission | Lib/site-packages/numpy/distutils/unixccompiler.py | 75 | 3651 | """
unixccompiler - can handle very long argument lists for ar.
"""
import os
from distutils.errors import DistutilsExecError, CompileError
from distutils.unixccompiler import *
from numpy.distutils.ccompiler import replace_method
from numpy.distutils.compat import get_exception
if sys.version_info[0] < 3:
impor... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.