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 |
|---|---|---|---|---|---|
jokey2k/sentry | src/sentry/migrations/0134_auto__chg_field_team_organization.py | 36 | 27736 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Team.organization'
db.alter_column('sentry_team', 'organization_id', self.gf('sentry.db.mo... | bsd-3-clause |
v-iam/azure-sdk-for-python | azure-servicefabric/azure/servicefabric/models/paged_application_info_list.py | 2 | 1311 | # 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 ... | mit |
julianwang/cinder | cinder/tests/unit/test_san.py | 5 | 2273 | # Copyright 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
gaapt/deepdive | util/ddext.py | 2 | 5281 | #! /usr/bin/env python
import sys, re
_libraries = [] # (X,Y,Z): from Y import X as Z
_input_names = []
_input_types = []
_return_names = []
_return_types = []
_run_func_content = ''
_init_func_content = ''
_ext_name = ''
# Add a library (should be installed on machines within GP)
# Sample Usage:
# import_lib(X,... | apache-2.0 |
BrianSwift/JunoCam | Juno3D/P00_102.obj.py | 1 | 11421 | # Setup Blender for Juno3D rendering
# Requires JunocamLibrary.blend to be loaded before running this
import bpy
from mathutils import Quaternion
# import Juno3D geometry and textures Wavefront OBJ
bpy.ops.import_scene.obj(filepath="/Users/bswift/Downloads/PJ0EFB/P00_102.obj",axis_forward='Y', axis_up='Z')
# Replace m... | mit |
shane-c/openstack-ansible | playbooks/plugins/callbacks/profile_tasks.py | 17 | 2918 | # The MIT License (MIT)
#
# Copyright (c) 2015, Red Hat, Inc. and others
# Copyright (c) 2015, Rackspace US, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includ... | apache-2.0 |
wfxiang08/Nuitka | tests/benchmarks/constructs/CallUncompiledFunctionPosArgs.py | 1 | 1446 | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Softwar where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# Li... | apache-2.0 |
vasyarv/edx-platform | lms/djangoapps/shoppingcart/tests/test_pdf.py | 165 | 11086 | """
Tests for Pdf file
"""
from datetime import datetime
from django.test.utils import override_settings
from django.conf import settings
import unittest
from io import BytesIO
from shoppingcart.pdf import PDFInvoice
from shoppingcart.utils import parse_pages
PDF_RECEIPT_DISCLAIMER_TEXT = "THE SITE AND ANY INFORMATION... | agpl-3.0 |
masayukig/tempest | tempest/tests/lib/test_decorators.py | 1 | 10738 | # Copyright 2013 IBM Corp
# Copyright 2015 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/LICENS... | apache-2.0 |
gpoesia/autocomplete | scripts/process_logs.py | 1 | 1261 | #!/usr/bin/python3
import sys
import collections
sums = collections.defaultdict(lambda: 0)
lens = collections.defaultdict(lambda: 0)
def mva(n_a, s_lb, s_a, avg_len, clients, z):
n_centers = n_a + 2
V = [2] + [1 / n_a] * n_a + [1]
S = [s_lb] + [s_a] * n_a + [z]
is_delay = [False] * (n_centers - 1) + ... | mit |
thebestgirl123/CloudBot | plugins/steam_user.py | 33 | 2667 | import requests
from lxml import etree
from cloudbot import hook
from cloudbot.util import formatting
# security
parser = etree.XMLParser(resolve_entities=False, no_network=True)
API_URL = "http://steamcommunity.com/id/{}/"
ID_BASE = 76561197960265728
headers = {}
class SteamError(Exception):
pass
def conve... | gpl-3.0 |
shishaokun/RTCforScrollTo | node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py | 806 | 5092 | #!/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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... | mit |
nazo/ansible | lib/ansible/modules/network/nxos/nxos_static_route.py | 21 | 10263 | #!/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 |
MarvinBertin/Theano-Lights | models/ffn_ace.py | 11 | 3046 | import theano
import theano.tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams
from theano.tensor.nnet.conv import conv2d
from theano.tensor.signal.downsample import max_pool_2d
from theano.tensor.shared_randomstreams import RandomStreams
import numpy as np
from toolbox import *
from modelbase import *
... | mit |
havard024/prego | crm/lib/python2.7/site-packages/pip/_vendor/html5lib/ihatexml.py | 1727 | 16581 | from __future__ import absolute_import, division, unicode_literals
import re
import warnings
from .constants import DataLossWarning
baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-... | mit |
andfoy/margffoy-tuay-server | env/lib/python2.7/site-packages/Mezzanine-3.1.10-py2.7.egg/mezzanine/conf/forms.py | 2 | 5085 | from __future__ import unicode_literals
from future.builtins import int
from collections import defaultdict
from django import forms
from django.utils.safestring import mark_safe
from django.utils.translation import activate, get_language, ugettext_lazy as _
from django.template.defaultfilters import urlize
from mez... | gpl-2.0 |
yesbox/ansible | lib/ansible/plugins/shell/csh.py | 118 | 1477 | # (c) 2014, Chris Church <chris@ninemoreminutes.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 lat... | gpl-3.0 |
sergeyfarin/pyqt-fit | pyqt_fit/pyqt_fit1d.py | 1 | 18563 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from . import functions, residuals, plot_fit, bootstrap
from .compat import user_text, CSV_READ_FLAGS
from .compat import unicode_csv_reader as csv_reader
from PyQt4 import QtGui, QtCore, uic
from PyQt4.QtCore import pyqtSignature, ... | gpl-3.0 |
gauribhoite/personfinder | env/google_appengine/lib/django-1.5/django/middleware/transaction.py | 143 | 2311 | from django.db import transaction
class TransactionMiddleware(object):
"""
Transaction middleware. If this is enabled, each view function will be run
with commit_on_response activated - that way a save() doesn't do a direct
commit, the commit is done when a successful response is created. If an
exc... | apache-2.0 |
kartikluke/cron | lib/werkzeug/test.py | 32 | 34230 | # -*- coding: utf-8 -*-
"""
werkzeug.test
~~~~~~~~~~~~~
This module implements a client to WSGI applications for testing.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import sys
import mimetypes
from time import time
from... | apache-2.0 |
fernandezcuesta/ansible | lib/ansible/cli/playbook.py | 65 | 8922 | # (c) 2012, 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) any lat... | gpl-3.0 |
foreni-packages/golismero | thirdparty_libs/nltk/tag/brill.py | 12 | 57626 | # Natural Language Toolkit: Brill Tagger
#
# Copyright (C) 2001-2012 NLTK Project
# Authors: Christopher Maloof <cjmaloof@gradient.cis.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.... | gpl-2.0 |
mvaled/OpenUpgrade | addons/fetchmail/__init__.py | 437 | 1120 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# mga@openerp.com
#
# This program is free software: you can redistribute it and/or mo... | agpl-3.0 |
Giftingnation/GN-Oscar-Custom | tests/unit/payment/form_tests.py | 6 | 4109 | import datetime
from django.test import TestCase
from django.forms import ValidationError
from oscar.apps.payment import forms, models
class TestBankcardNumberField(TestCase):
def setUp(self):
self.field = forms.BankcardNumberField()
def test_strips_non_digits(self):
self.assertEquals(
... | bsd-3-clause |
missionpinball/mpf | mpf/tests/test_GottliebTrough.py | 1 | 22333 | """Test gottlieb trough setup with system11 trough + drain device."""
from mpf.tests.MpfTestCase import MpfTestCase, test_config
from unittest.mock import MagicMock
class TestGottliebTrough(MpfTestCase):
"""Test Gottlieb style troughs with outhole and only one one or two switches."""
def get_config_file(sel... | mit |
mdanielwork/intellij-community | python/lib/Lib/MimeWriter.py | 114 | 6341 | """Generic MIME writer.
This module defines the class MimeWriter. The MimeWriter class implements
a basic formatter for creating MIME multi-part files. It doesn't seek around
the output file nor does it use large amounts of buffer space. You must write
the parts out in the order that they should occur in the final f... | apache-2.0 |
alexef/pygobject | codegen/codegen.py | 8 | 69752 | #! /usr/bin/env python
import getopt
import keyword
import os
import string
import sys
import argtypes
import definitions
import defsparser
import override
import reversewrapper
import warnings
class Coverage(object):
def __init__(self, name):
self.name = name
self.wrapped = 0
self.not_wr... | lgpl-2.1 |
j-griffith/cinder | cinder/tests/unit/volume/drivers/disco/test_extend_volume.py | 5 | 1824 | # (c) Copyright 2015 Industrial Technology Research Institute.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | apache-2.0 |
YangChihWei/w16b_test | static/Brython3.1.1-20150328-091302/Lib/_testcapi.py | 742 | 4231 |
CHAR_MAX = 127
CHAR_MIN = -128
DBL_MAX = 1.7976931348623157e+308
DBL_MIN = 2.2250738585072014e-308
FLT_MAX = 3.4028234663852886e+38
FLT_MIN = 1.1754943508222875e-38
INT_MAX = 2147483647
INT_MIN = -2147483648
LLONG_MAX = 9223372036854775807
LLONG_MIN = -9223372036854775808
LONG_MAX = 2147483647
LONG_MIN = -2... | agpl-3.0 |
swenger/glitter | glitter/arrays/elementarray.py | 1 | 1551 | """Element array buffer class.
@author: Stephan Wenger
@date: 2012-02-29
"""
import numpy as _np
import glitter.raw as _gl
from glitter.utils import buffer_dimensions_to_primitive, Datatype, coerce_array
from glitter.arrays.basebuffer import BaseBuffer
class ElementArrayBuffer(BaseBuffer):
_binding = "element_a... | mit |
frishberg/django | tests/foreign_object/test_empty_join.py | 22 | 1488 | from django.test import TestCase
from .models import SlugPage
class RestrictedConditionsTests(TestCase):
def setUp(self):
slugs = [
'a',
'a/a',
'a/b',
'a/b/a',
'x',
'x/y/z',
]
SlugPage.objects.bulk_create([SlugPage(sl... | bsd-3-clause |
ncteisen/grpc | src/python/grpcio_tests/tests/unit/_auth_context_test.py | 6 | 6731 | # Copyright 2017 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 |
ashutrix03/inteygrate_flaskapp-master | build/lib/yowsup/layers/auth/protocolentities/stream_error.py | 15 | 1782 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
class StreamErrorProtocolEntity(ProtocolEntity):
TYPE_CONFLICT = "conflict"
'''
<stream:error>
<conflict></conflict>
<text>Replaced by new connection</text>
</stream:error>
'''
TYPE_ACK = "ack"
'''
<stream:er... | gpl-3.0 |
sunlianqiang/kbengine | kbe/src/lib/python/Lib/test/test_selectors.py | 60 | 13865 | import errno
import os
import random
import selectors
import signal
import socket
from test import support
from time import sleep
import unittest
import unittest.mock
try:
from time import monotonic as time
except ImportError:
from time import time as time
try:
import resource
except ImportError:
resour... | lgpl-3.0 |
jirivrany/riskflow123d-post | helpers/concentrations.py | 1 | 1829 | '''
Created on 16.2.2012
@author: albert
'''
import bisect
def sum_conc(conc_suma, el_list):
'''
wrapper for universal call
'''
if not el_list:
result = sum_conc_all(conc_suma)
else:
result = sum_conc_for_selected(el_list, conc_suma)
return result
def sum_conc_... | gpl-2.0 |
visualputty/Landing-Lights | django/contrib/admin/media/js/compress.py | 784 | 1896 | #!/usr/bin/env python
import os
import optparse
import subprocess
import sys
here = os.path.dirname(__file__)
def main():
usage = "usage: %prog [file1..fileN]"
description = """With no file paths given this script will automatically
compress all jQuery-based files of the admin app. Requires the Google Closure... | bsd-3-clause |
tszym/ansible | lib/ansible/modules/network/cumulus/_cl_license.py | 8 | 4409 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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_versio... | gpl-3.0 |
titasakgm/brc-stock | openerp/addons/report_geraldo/lib/geraldo/site/newsite/django_1_0/django/contrib/localflavor/is_/is_postalcodes.py | 438 | 4913 | # -*- coding: utf-8 -*-
IS_POSTALCODES = (
('101', u'101 Reykjavík'),
('103', u'103 Reykjavík'),
('104', u'104 Reykjavík'),
('105', u'105 Reykjavík'),
('107', u'107 Reykjavík'),
('108', u'108 Reykjavík'),
('109', u'109 Reykjavík'),
('110', u'110 Reykjavík'),
('111', u'111 Reykjavík'... | agpl-3.0 |
RomainBrault/scikit-learn | sklearn/calibration.py | 37 | 20332 | """Calibration of predicted probabilities."""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Balazs Kegl <balazs.kegl@gmail.com>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# Mathieu Blondel <mathieu@mblondel.org>
#
# License: BSD 3 clause
from __future__ impo... | bsd-3-clause |
saurabh6790/medapp | accounts/general_ledger.py | 7 | 4588 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt, cstr
from webnotes import _
from accounts.utils import validate_expense_against_budget
class StockA... | agpl-3.0 |
sserrot/champion_relationships | venv/Lib/site-packages/win32com/test/GenTestScripts.py | 6 | 2533 | #
# Generate scripts needed for serious testing!
#
import win32com, win32com.client.makepy
import win32com.test
import pythoncom
import sys, os
genList = [
("msword8", "{00020905-0000-0000-C000-000000000046}",1033,8,0),
]
genDir = "Generated4Test"
def GetGenPath():
import win32api
return os.path.join(win32api... | mit |
wangxiangyu/horizon | openstack_dashboard/dashboards/project/data_processing/data_image_registry/tables.py | 26 | 2507 | # 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 |
python-spain/symposion | symposion/boxes/templatetags/boxes_tags.py | 13 | 1170 | from django import template
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.utils.safestring import mark_safe
from django.utils.encoding import smart_str
from django.utils.translation import ugettext_lazy as _
from django.template.defaulttags import kwarg... | bsd-3-clause |
leopoul/ncclient | setup.py | 2 | 2600 | # Copyright 2009 Shikhar Bhushan
# Copyright 201[2-5] Leonidas Poulopoulos (@leopoul)
# Copyright 2013 Ebben Aries
#
# 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... | apache-2.0 |
silenceli/nova | nova/objects/security_group_rule.py | 10 | 4080 | # Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
BackupGGCode/python-for-android | python3-alpha/python3-src/Lib/idlelib/WindowList.py | 153 | 2472 | from tkinter import *
class WindowList:
def __init__(self):
self.dict = {}
self.callbacks = []
def add(self, window):
window.after_idle(self.call_callbacks)
self.dict[str(window)] = window
def delete(self, window):
try:
del self.dict[str(window)]
... | apache-2.0 |
falcon1kr/python-social-auth | social/backends/meetup.py | 49 | 1194 | """
Meetup OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/meetup.html
"""
from social.backends.oauth import BaseOAuth2
class MeetupOAuth2(BaseOAuth2):
"""Meetup OAuth2 authentication backend"""
name = 'meetup'
AUTHORIZATION_URL = 'https://secure.meetup.com/oauth2/authorize'
AC... | bsd-3-clause |
Therp/odoo | addons/hr_payroll/report/report_payslip.py | 377 | 1982 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
adusia/pox | pox/help.py | 47 | 4040 | # Copyright 2013 James McCauley
#
# 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 writi... | apache-2.0 |
Curso-OpenShift/Formulario | OverFlow/ProjectFormulario/env/lib/python2.7/site-packages/django/core/mail/backends/smtp.py | 49 | 5259 | """SMTP email backend class."""
import smtplib
import ssl
import threading
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import sanitize_address
from django.core.mail.utils import DNS_NAME
class EmailBackend(BaseEmailBackend):
"""
A... | gpl-3.0 |
indashnet/InDashNet.Open.UN2000 | android/external/v8/tools/ll_prof.py | 17 | 31389 | #!/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... | apache-2.0 |
Tocknicsu/nctuoj_contest | backend/service/submission.py | 1 | 6907 | from req import Service
from service.base import BaseService
import config
import time
import hashlib
import os
import zipfile
import re
class Submission(BaseService):
def get_submission_list_admin(self, data={}):
required_args = [{
'name': '+count',
'type': int,
}, {
... | apache-2.0 |
yuvipanda/zulip | analytics/views.py | 113 | 25440 | from django.db import connection
from django.template import RequestContext, loader
from django.utils.html import mark_safe
from django.shortcuts import render_to_response
from django.core import urlresolvers
from django.http import HttpResponseNotFound
from zerver.decorator import has_request_variables, REQ, zulip_in... | apache-2.0 |
realopenit/bubble | bubble/commands/cmd_init.py | 1 | 3921 | # -*- coding: utf-8 -*-
# Part of bubble. See LICENSE file for full copyright and licensing details.
import os
import click
import arrow
from .. import metadata
from ..cli import pass_bubble
from ..util.cli_misc import create_dir
from ..util.examples import (get_example_rules_bubble,
... | gpl-3.0 |
sachinpro/sachinpro.github.io | tensorflow/python/training/ftrl_test.py | 9 | 11114 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
yd0str/infernal-twin | build/pip/pip/_vendor/requests/packages/chardet/mbcharsetprober.py | 2924 | 3268 | ######################## 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... | gpl-3.0 |
istio/tools | isotope/runner/kubectl.py | 1 | 3966 | # Copyright Istio 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, soft... | apache-2.0 |
philsch/ansible | lib/ansible/modules/system/make.py | 69 | 4784 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Linus Unnebäck <linus@folkdatorn.se>
#
# This file is part of Ansible
#
# This module 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 |
tndatacommons/tndata_backend | tndata_backend/officehours/tests/test_models.py | 2 | 4503 | from datetime import time
from django.contrib.auth import get_user_model
from django.test import TestCase
from model_mommy import mommy
from .. models import Course, OfficeHours, generate_course_code
class TestOfficeHours(TestCase):
"""Tests for the `OfficeHours` model."""
@classmethod
def setUpTestDa... | mit |
shadowmint/nwidget | lib/cocos2d-0.5.5/utest/test_collision_model_aarect.py | 1 | 13993 | # collision_model tests
# aarects1 test
import cocos.collision_model as cm
import cocos.euclid as eu
from math import sin, cos, radians
class Obj_with_shape(object):
def __init__(self, name, cshape):
self.name = name
self.cshape = cshape
def create_obj_with_aarect(name, center, rx, ry... | apache-2.0 |
craftytrickster/servo | tests/wpt/update/updatecommandline.py | 210 | 1736 | # 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/.
def create_parser():
from wptrunner import wptcommandline
parser = wptcommandline.create_parser_update()
pa... | mpl-2.0 |
nlebedenco/mini2440 | recipes/python/python-2.6.1/sitecustomize.py | 228 | 1125 | # OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
# GPLv2 or later
# Version: 20081123
# Features:
# * set proper default encoding
# * enable readline completion in the interactive interpreter
# * load command line history on startup
# * save command line history on exit
i... | mit |
yongtang/tensorflow | tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py | 9 | 5071 | # Copyright 2020 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 |
ewdurbin/sentry | src/sentry/search/django/constants.py | 29 | 2018 | """
sentry.search.django.constants
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
SORT_CLAUSES = {
'priority': 'sentry_groupedmessage.score',
'date': 'EXTRACT(E... | bsd-3-clause |
xbezdick/tempest | tempest/api/data_processing/test_jobs.py | 9 | 3178 | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
SKIRT/PTS | do/magic/animate.py | 1 | 2246 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | agpl-3.0 |
shizhai/wprobe | staging_dir/host/lib/scons-2.1.0/SCons/Tool/MSCommon/common.py | 21 | 8399 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
#
# 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
# with... | gpl-2.0 |
fnordahl/nova | nova/tests/unit/api/openstack/compute/test_admin_actions.py | 35 | 3992 | # Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
nielsvanoch/django | django/db/migrations/writer.py | 12 | 17973 | from __future__ import unicode_literals
import collections
import datetime
import decimal
from importlib import import_module
import inspect
import math
import os
import re
import sys
import types
from django.apps import apps
from django.db import models, migrations
from django.db.migrations.loader import MigrationLo... | bsd-3-clause |
fluxer/spm | nuitka/nuitka/nodes/AssignNodes.py | 1 | 22925 | # Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | gpl-2.0 |
libscie/liberator | liberator/lib/python3.6/site-packages/gunicorn/six.py | 320 | 27344 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2014 Benjamin Peterson
#
# 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 with... | cc0-1.0 |
campbe13/openhatch | vendor/packages/twisted/doc/core/examples/pbbenchserver.py | 19 | 1449 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""Server for PB benchmark."""
from zope.interface import implements
from twisted.spread import pb
from twisted.internet import reactor
from twisted.cred.portal import IRealm
class PBBenchPerspective(pb.Avatar):
callsPerSec = 0
def __i... | agpl-3.0 |
srware/upm | examples/python/oled_ssd1308.py | 16 | 5520 | #!/usr/bin/python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 limi... | mit |
mfellner/maximilianfellner.eu | app/assets/rjs.py | 1 | 2174 | # -*- coding: utf-8 -*-
from ntpath import basename, dirname
from webassets.filter import ExternalTool
__all__ = ('RJS',)
class RJS(ExternalTool):
"""Uses r.js from `RequireJS <http://requirejs.org/>`_ to optimize JavaScript files.
This filter depends on the NodeJS modules require.js and r.js, installable ... | bsd-3-clause |
KevinFasusi/supplychainpy | docs/conf.py | 1 | 9362 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# supplychainpy documentation build configuration file, created by
# sphinx-quickstart on Fri Feb 5 19:12:15 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in thi... | bsd-3-clause |
DailyActie/Surrogate-Model | 01-codes/numpy-master/numpy/core/tests/test_extint128.py | 1 | 5742 | from __future__ import division, absolute_import, print_function
import contextlib
import itertools
import operator
import numpy as np
import numpy.core.multiarray_tests as mt
from numpy.testing import assert_raises, assert_equal
INT64_MAX = np.iinfo(np.int64).max
INT64_MIN = np.iinfo(np.int64).min
INT64_MID = 2 ** ... | mit |
hrishioa/Navo | Raspi-Code/Lib/venv/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_structures.py | 906 | 1809 | # 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... | gpl-2.0 |
HiroIshikawa/21playground | payblog/blog/lib/python3.5/site-packages/pip/_vendor/distlib/util.py | 224 | 51518 | #
# Copyright (C) 2012-2014 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
import... | mit |
t0mm0/youtube-dl | youtube_dl/extractor/miomio.py | 95 | 3521 | # coding: utf-8
from __future__ import unicode_literals
import random
from .common import InfoExtractor
from ..utils import (
xpath_text,
int_or_none,
ExtractorError,
)
class MioMioIE(InfoExtractor):
IE_NAME = 'miomio.tv'
_VALID_URL = r'https?://(?:www\.)?miomio\.tv/watch/cc(?P<id>[0-9]+)'
_... | unlicense |
Caleb-Ellis/CS50 | .c9/metadata/workspace/pset6/caesar.py | 1 | 11608 | {"filter":false,"title":"caesar.py","tooltip":"/pset6/caesar.py","undoManager":{"mark":100,"position":100,"stack":[[{"start":{"row":3,"column":21},"end":{"row":3,"column":22},"action":"insert","lines":[" "],"id":986}],[{"start":{"row":3,"column":22},"end":{"row":3,"column":23},"action":"insert","lines":["u"],"id":987}]... | mit |
NickelMedia/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/python.py | 120 | 5538 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# 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 list of conditions and... | bsd-3-clause |
nikhil/RAS | env/lib/python3.5/site-packages/pip/index.py | 50 | 37191 | """Routines related to PyPI, indexes"""
from __future__ import absolute_import
import logging
import cgi
from collections import namedtuple
import itertools
import sys
import os
import re
import mimetypes
import posixpath
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.... | mit |
deeplearning4j/libnd4j | include/graph/generated/nd4j/graph/FlatVariable.py | 1 | 3273 | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: graph
import flatbuffers
class FlatVariable(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsFlatVariable(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Fl... | apache-2.0 |
andela-earinde/bellatrix-py | app/js/lib/lib/modules/numbers.py | 141 | 10319 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for numbers, according to PEP 3141.
TODO: Fill out more detailed documentation on the operators."""
from __future__ import division
from abc import ABCMeta, abstractmethod, abstractprop... | mit |
jwren/intellij-community | python/helpers/pydev/_pydev_bundle/_pydev_jy_imports_tipper.py | 22 | 17167 | import StringIO
import traceback
from java.lang import StringBuffer #@UnresolvedImport
from java.lang import String #@UnresolvedImport
import java.lang #@UnresolvedImport
import sys
from _pydev_bundle._pydev_tipper_common import do_find
from org.python.core import PyReflectedFunction #@UnresolvedImport
from org.pyth... | apache-2.0 |
Semi-global/edx-platform | lms/djangoapps/mobile_api/social_facebook/groups/views.py | 86 | 4938 | """
Views for groups info API
"""
from rest_framework import generics, status, mixins
from rest_framework.response import Response
from django.conf import settings
import facebook
from ...utils import mobile_view
from . import serializers
@mobile_view()
class Groups(generics.CreateAPIView, mixins.DestroyModelMixin)... | agpl-3.0 |
hwjworld/xiaodun-platform | lms/djangoapps/wechat/features/annotatable.py | 22 | 6523 | import textwrap
from lettuce import world, steps
from nose.tools import assert_in, assert_equals, assert_true
from common import i_am_registered_for_the_course, visit_scenario_item
DATA_TEMPLATE = textwrap.dedent("""\
<annotatable>
<instructions>Instruction text</instructions>
<p>{}</p>
</ann... | agpl-3.0 |
40223246/0622W17test2 | static/Brython3.1.1-20150328-091302/Lib/unittest/loader.py | 739 | 13883 | """Loading unittests."""
import os
import re
import sys
import traceback
import types
import functools
from fnmatch import fnmatch
from . import case, suite, util
__unittest = True
# what about .pyc or .pyo (etc)
# we would need to avoid loading the same tests multiple times
# from '.py', '.pyc' *and* '.pyo'
VALID... | gpl-3.0 |
wangjun/cl-auto-reply | gae/vendor.py | 142 | 2812 | #
# Copyright 2014 Jon Wayne Parrott, [proppy], Michael R. Bernstein
#
# 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 ... | mit |
Bashar/django | django/contrib/auth/tests/test_hashers.py | 38 | 14783 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import skipUnless
from django.conf.global_settings import PASSWORD_HASHERS as default_hashers
from django.contrib.auth.hashers import (is_password_usable, BasePasswordHasher,
check_password, make_password, PBKDF2PasswordHasher, load_has... | bsd-3-clause |
leiferikb/bitpop | src/third_party/webpagereplay/third_party/dns/rdtypes/IN/NAPTR.py | 248 | 4889 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | gpl-3.0 |
40223134/40223134w17 | static/Brython3.1.1-20150328-091302/Lib/binascii.py | 620 | 24585 | """A pure Python implementation of binascii.
Rather slow and buggy in corner cases.
PyPy provides an RPython version too.
"""
# borrowed from https://bitbucket.org/pypy/pypy/src/f2bf94943a41/lib_pypy/binascii.py
class Error(Exception):
pass
class Done(Exception):
pass
class Incomplete(Exception):
pass
... | gpl-3.0 |
dlazz/ansible | lib/ansible/module_utils/facts/network/linux.py | 4 | 16239 | # 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 |
benbaker/genetic-algorithm-bitcoin-trader | wc_server.py | 17 | 5062 |
"""
wc_server v0.01
web client server
Copyright 2011 Brian Monkaba
This file is part of ga-bitbot.
ga-bitbot 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
... | gpl-3.0 |
golismero/golismero | plugins/testing/attack/xsser.py | 7 | 8821 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__license__ = """
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Authors:
Jekkay Hu | jekkay<@>gmail.com
Daniel Garcia Garcia a.k.a cr0hn | cr0hn<@>cr0hn.com
Mario Vilas | mvilas<@>gmail.com
Golismero project site: http://golismero-project.com
Golismero pr... | gpl-2.0 |
VitalPet/odoo | addons/crm_claim/__openerp__.py | 53 | 2032 | # -*- 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 |
michaelld/gnuradio | gr-trellis/docs/test_viterbi_equalization1.py | 10 | 4310 | #!/usr/bin/env python
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from gnuradio import gr
from gnuradio import audio
from gnuradio import trellis, digital, filter, blocks
from gnuradio import eng_notation
import math
import sys
import random
import fsm_... | gpl-3.0 |
DarkFenX/Pyfa | eos/saveddata/implant.py | 2 | 4039 | # ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos 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, ... | gpl-3.0 |
bearicc/004 | venv/lib/python3.4/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... | gpl-3.0 |
veryberry/addons-yelizariev | res_users_signature/res_users_signature_models.py | 16 | 7872 | from openerp.osv import fields as old_fields
from openerp import api,models,fields,tools
try:
from openerp.addons.email_template.email_template import mako_template_env
except ImportError:
try:
from openerp.addons.mail.mail_template import mako_template_env
except ImportError:
pass
from ope... | lgpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.