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 |
|---|---|---|---|---|---|
damonkohler/sl4a | python/src/Lib/test/crashers/gc_inspection.py | 168 | 1090 | """
gc.get_referrers() can be used to see objects before they are fully built.
Note that this is only an example. There are many ways to crash Python
by using gc.get_referrers(), as well as many extension modules (even
when they are using perfectly documented patterns to build objects).
Identifying and removing all ... | apache-2.0 |
kakcare/xbmc | lib/libUPnP/Platinum/Build/Tools/SCons/gcc-generic.py | 283 | 1317 | import os
def generate(env, gcc_cross_prefix=None, gcc_strict=True, gcc_stop_on_warning=None, gcc_extra_options=''):
if gcc_stop_on_warning == None: gcc_stop_on_warning = env['stop_on_warning']
### compiler flags
if gcc_strict:
env.AppendUnique(CCFLAGS = ['-pedantic', '-Wall', '-W', '-Wundef', ... | gpl-2.0 |
marcosmodesto/django-testapp | django/django/forms/models.py | 81 | 43532 | """
Helper functions for creating Form classes from Django models
and database field objects.
"""
from __future__ import absolute_import
from django.core.exceptions import ValidationError, NON_FIELD_ERRORS, FieldError
from django.core.validators import EMPTY_VALUES
from django.forms.fields import Field, ChoiceField
f... | bsd-3-clause |
xNovax/SickRage | lib/unidecode/x08e.py | 252 | 4659 | data = (
'Chu ', # 0x00
'Jing ', # 0x01
'Nie ', # 0x02
'Xiao ', # 0x03
'Bo ', # 0x04
'Chi ', # 0x05
'Qun ', # 0x06
'Mou ', # 0x07
'Shu ', # 0x08
'Lang ', # 0x09
'Yong ', # 0x0a
'Jiao ', # 0x0b
'Chou ', # 0x0c
'Qiao ', # 0x0d
'[?] ', # 0x0e
'Ta ', # 0x0f
'Jian ', # 0x10... | gpl-3.0 |
fusion809/fusion809.github.io-old | vendor/bundle/ruby/2.2.0/gems/pygments.rb-0.6.3/vendor/simplejson/simplejson/tests/test_dump.py | 65 | 2544 | from unittest import TestCase
from cStringIO import StringIO
import simplejson as json
class TestDump(TestCase):
def test_dump(self):
sio = StringIO()
json.dump({}, sio)
self.assertEquals(sio.getvalue(), '{}')
def test_dumps(self):
self.assertEquals(json.dumps({}), '{}')
... | gpl-3.0 |
mulkieran/pydevDAG | src/pydevDAG/_structure/_pyudev/_utils.py | 1 | 4483 | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in th... | gpl-2.0 |
hlamer/enki | tests/test_core/test_detect_language.py | 3 | 1404 | #!/usr/bin/env python3
import unittest
import os.path
import sys
sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(__file__)), ".."))
import base
class Test(base.TestCase):
CREATE_NOT_SAVED_DOCUMENT = False
def test_1(self):
# By name
doc = self.createFile('file1.rb', 'asdf')... | gpl-2.0 |
arrdalan/ubuntu_dfv | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
nhejazi/scikit-learn | sklearn/manifold/tests/test_locally_linear.py | 85 | 5600 | from itertools import product
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from scipy import linalg
from sklearn import neighbors, manifold
from sklearn.manifold.locally_linear import barycenter_kneighbors_graph
from sklearn.utils.testing import assert_less
from sklearn.... | bsd-3-clause |
SnappleCap/oh-mainline | vendor/packages/sessionprofile/sessionprofile/tests.py | 23 | 2891 | # Copyright (c) 2008 Resolver Systems Ltd
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge,... | agpl-3.0 |
Tempel/bcam | tests/test_calc_utils.py | 2 | 2996 | from math import pi, sqrt
import pytest
from bcam import calc_utils
# Test AABB.
@pytest.mark.parametrize('box, point, expected', [
([1, 2, 3, 4], [0, 0], False),
([1, 2, 3, 4], [1, 2], True),
([1, 2, 3, 4], [1.5, 2.5], True),
([1, 2, 3, 4], [1, 3], True),
([1, 2, 3, 4], [1, 4], True),
([1, 2,... | gpl-3.0 |
6H057WH1P3/Asit | lib/requests/packages/urllib3/fields.py | 1007 | 5833 | import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename, default='application/octet-stream'):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
:param default:
If no "Cont... | mit |
CactusBot/CactusBot | cactusbot/sepal.py | 2 | 2277 | """Interact with Sepal."""
import json
import logging
from .packets import MessagePacket, Packet
from .services.websocket import WebSocket
class Sepal(WebSocket):
"""Interact with Sepal."""
def __init__(self, channel, service=None):
super().__init__("wss://cactus.exoz.one/sepal")
self.logg... | gpl-3.0 |
UnrememberMe/pants | src/python/pants/backend/jvm/zinc/zinc_analysis_element.py | 10 | 5845 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from colle... | apache-2.0 |
JVillella/tensorflow | tensorflow/python/kernel_tests/sparse_concat_op_test.py | 138 | 13011 | # 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 |
alanljj/oca_server-tools | cron_run_manually/ir_cron.py | 10 | 2621 | # -*- coding: utf-8 -*-
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>)
# Code snippets from openobject-server copyright (C) 2004-2013 OpenERP S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Ge... | agpl-3.0 |
hnakamur/ansible | test/units/plugins/strategies/test_strategy_base.py | 81 | 14839 | # (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 |
dkubiak789/odoo | addons/procurement_jit_stock/procurement_jit_stock.py | 44 | 1585 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2013 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 |
debugger22/sympy | sympy/geometry/tests/test_geometrysets.py | 33 | 3050 | from __future__ import division
import warnings
from sympy import (Abs, I, Dummy, Rational, Float, S, Symbol, cos, oo, pi,
simplify, sin, sqrt, symbols, Derivative, asin, acos)
from sympy.core.compatibility import range
from sympy.functions.elementary.trigonometric import tan
from sympy.geometry imp... | bsd-3-clause |
zjj/trac_hack | trac/config.py | 1 | 27389 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009 Edgewall Software
# Copyright (C) 2005-2007 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://... | bsd-3-clause |
yaseppochi/mailman | src/mailman/model/tests/test_bounce.py | 7 | 3783 | # Copyright (C) 2011-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | gpl-3.0 |
mnlipp/mbed | workspace_tools/project.py | 50 | 7207 | import sys
from os.path import join, abspath, dirname, exists
ROOT = abspath(join(dirname(__file__), ".."))
sys.path.insert(0, ROOT)
from shutil import move, rmtree
from optparse import OptionParser
from workspace_tools.paths import EXPORT_DIR, EXPORT_WORKSPACE, EXPORT_TMP
from workspace_tools.paths import MBED_BASE,... | apache-2.0 |
amenonsen/ansible | lib/ansible/modules/net_tools/netbox/netbox_prefix.py | 34 | 13766 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Mikhail Yohman (@FragmentedPacket) <mikhail.yohman@gmail.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_MET... | gpl-3.0 |
pcchenxi/baseline | baselines/ppo1/environment/vrep_plugin/complexCommandTest.py | 1 | 3770 | # Copyright 2006-2017 Coppelia Robotics GmbH. All rights reserved.
# marc@coppeliarobotics.com
# www.coppeliarobotics.com
#
# -------------------------------------------------------------------
# THIS FILE IS DISTRIBUTED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
# WARRANTY. THE USER WILL USE IT AT HIS/HER OWN RIS... | mit |
bigswitch/horizon | openstack_dashboard/test/integration_tests/pages/project/compute/access_and_security/securitygroupspage.py | 10 | 3049 | # 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
# d... | apache-2.0 |
futurice/google-apps-contacts-copier | gapps_users_to_contacts_group_copier/options.py | 1 | 3224 | import argparse
def parse_options():
parser = argparse.ArgumentParser()
parser.add_argument(
"-S", "--select-pattern",
dest="select_pattern",
help="select users to copy by pattern GLOB against user's email address",
metavar="GLOB")
parser.add_argument(
"-P", "--no... | bsd-3-clause |
deepsrijit1105/edx-platform | lms/djangoapps/courseware/tests/test_middleware.py | 16 | 2040 | """
Tests for courseware middleware
"""
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from django.http import Http404
from mock import patch
from nose.plugins.attrib import attr
import courseware.courses as courses
from courseware.middleware import RedirectUnenrolledMiddle... | agpl-3.0 |
sergmelikyan/murano | murano/api/v1/router.py | 2 | 9297 | # Copyright (c) 2013 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... | apache-2.0 |
lshain-android-source/tools-idea | plugins/hg4idea/testData/bin/hgext/inotify/common.py | 94 | 1560 | # server.py - inotify common protocol code
#
# Copyright 2006, 2007, 2008 Bryan O'Sullivan <bos@serpentine.com>
# Copyright 2007, 2008 Brendan Cully <brendan@kublai.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import cStri... | apache-2.0 |
intel-iot-devkit/upm | examples/python/ina132.py | 6 | 2006 | #!/usr/bin/env 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 ... | mit |
SimtterCom/gyp | pylib/gyp/generator/analyzer.py | 2 | 7555 | # Copyright (c) 2014 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.
"""
This script is intended for use as a GYP_GENERATOR. It takes as input (by way of
the generator flag file_path) the list of relative file paths to consider. If
... | bsd-3-clause |
bbsan2k/nzbToMedia | libs/unidecode/x0c0.py | 253 | 4856 | data = (
'bbweok', # 0x00
'bbweot', # 0x01
'bbweop', # 0x02
'bbweoh', # 0x03
'bbwe', # 0x04
'bbweg', # 0x05
'bbwegg', # 0x06
'bbwegs', # 0x07
'bbwen', # 0x08
'bbwenj', # 0x09
'bbwenh', # 0x0a
'bbwed', # 0x0b
'bbwel', # 0x0c
'bbwelg', # 0x0d
'bbwelm', # 0x0e
'bbwelb', # 0x... | gpl-3.0 |
mephistophilis/samsung_nowplus_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 |
haliciyazilim/beste-yarismasi | server/api/models.py | 1 | 3576 | import random
import string
from django.contrib.auth.models import AbstractUser
from django.db import models
from membership.models import User
def random_name_generator(size=15):
"""
create string for given size
:param size: int
:return: string
"""
chars = string.ascii_uppercase + string.d... | mit |
yaolei313/python-study | internet_study/basic_auth.py | 1 | 1312 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from urllib import request, parse
import base64
URL = "http://app.yao.com"
USERNAME = "libai"
PASSWORD = "libai"
def handler_version(url):
password_mgr = request.HTTPPasswordMgrWithDefaultRealm()
handler = request.HTTPBasicAuthHandler(password_mgr)
netloc =... | gpl-2.0 |
nolanliou/tensorflow | tensorflow/python/keras/_impl/keras/applications/inception_resnet_v2_test.py | 22 | 2264 | # 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 |
ageron/tensorflow | tensorflow/contrib/seq2seq/python/ops/decoder.py | 6 | 18412 | # 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 |
sergei-maertens/django | django/contrib/admin/sites.py | 7 | 19712 | from functools import update_wrapper
from django.apps import apps
from django.conf import settings
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.db.models.base import ModelBa... | bsd-3-clause |
beacloudgenius/edx-platform | lms/djangoapps/course_wiki/utils.py | 204 | 3623 | """
Utility functions for course_wiki.
"""
from django.core.exceptions import ObjectDoesNotExist
from xmodule import modulestore
import courseware
def user_is_article_course_staff(user, article):
"""
The root of a course wiki is /<course_number>. This means in case there
are two courses which have the sa... | agpl-3.0 |
loopCM/chromium | tools/json_to_struct/element_generator_test.py | 14 | 5524 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from element_generator import GenerateFieldContent
from element_generator import GenerateElements
import unittest
class ElementGen... | bsd-3-clause |
natea/Miro-Community | localtv/views.py | 1 | 7460 | # Copyright 2009 - Participatory Culture Foundation
#
# This file is part of Miro Community.
#
# Miro Community is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at ... | agpl-3.0 |
chhsiao90/gviewer | gviewer/view/summary.py | 1 | 9540 | import urwid
from collections import OrderedDict
from gviewer.basic_widget import BasicWidget, FocusableText, SearchWidget
from gviewer.view.helper import (
HelpWidget, HelpContent, HelpCategory,
make_category_with_actions)
from gviewer.view.detail import DetailWidget
_ADVANCED_KEYS = OrderedDict([
("/",... | mit |
andrewfu0325/gem5-aladdin | util/minorview/colours.py | 55 | 3126 | # Copyright (c) 2013 ARM Limited
# 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 implementation of the functionality o... | bsd-3-clause |
arguman/arguman.org | web/newsfeed/views.py | 6 | 1459 | from newsfeed.models import Entry
from premises.views import HomeView
class NewsfeedView(HomeView):
tab_class = "newsfeed"
template_name = "newsfeed.html"
paginate_by = 20
def get_context_data(self, **kwargs):
return super(NewsfeedView, self).get_context_data(
news_entries=self.ge... | agpl-3.0 |
cjerdonek/pip | pip/_vendor/distlib/markers.py | 1261 | 6282 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Parser for the environment markers micro-language defined in PEP 345."""
import ast
import os
import sys
import platform
from .compa... | mit |
DueLaser/OctoPrint | src/octoprint/printer/profile.py | 15 | 14026 | # coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import os
import copy
impor... | gpl-3.0 |
gridengine/config-api | uge/api/impl/scheduler_configuration_manager.py | 1 | 2254 | #!/usr/bin/env python
#
# ___INFO__MARK_BEGIN__
#######################################################################################
# Copyright 2016-2021 Univa Corporation (acquired and owned by Altair Engineering Inc.)
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file e... | apache-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.4.3/Lib/test/test_pkg.py | 43 | 6926 | # Test packages (dotted-name import)
import sys, os, tempfile, traceback
from os import mkdir, rmdir, extsep # Can't test if these fail
del mkdir, rmdir
from test.test_support import verify, verbose, TestFailed
# Helpers to create and destroy hierarchies.
def mkhier(root, descr):
if not os.path.isdir(ro... | mit |
joram/sickbeard-orange | lib/unidecode/x014.py | 252 | 4300 | data = (
'[?]', # 0x00
'e', # 0x01
'aai', # 0x02
'i', # 0x03
'ii', # 0x04
'o', # 0x05
'oo', # 0x06
'oo', # 0x07
'ee', # 0x08
'i', # 0x09
'a', # 0x0a
'aa', # 0x0b
'we', # 0x0c
'we', # 0x0d
'wi', # 0x0e
'wi', # 0x0f
'wii', # 0x10
'wii', # 0x11
'wo', # 0x12
'wo', ... | gpl-3.0 |
uucidl/hammer | src/bindings/cpp/vendor/gtest-1.7.0/test/gtest_shuffle_test.py | 3023 | 12549 | #!/usr/bin/env python
#
# Copyright 2009 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... | gpl-2.0 |
google/apis-client-generator | src/googleapis/codegen/cpp_generator.py | 1 | 29652 | #!/usr/bin/python2.7
# Copyright 2012 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 requi... | apache-2.0 |
JimCircadian/ansible | lib/ansible/plugins/action/fail.py | 31 | 1439 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2012, Dag Wieers <dag@wieers.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 ... | gpl-3.0 |
kuntzer/SALSA-public | 6_mean_sl.py | 1 | 4202 | ''' 6-mean_sl.py
=========================
AIM: Compute the mean of the stray light in the sense of:
- Mean across all points then every minutes
- Mean of max value
- Mean of direction of maximum (in the orbit)
INPUT: files: - <orbit_id>_misc/orbits.dat
- <orbit_id>_flux/flux_*.dat
variables: see section PARAME... | bsd-3-clause |
lidiamcfreitas/FenixScheduleMaker | oldFiles/project-env/lib/python2.7/site-packages/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## 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... | bsd-2-clause |
johnraz/django-filer | filer/models/virtualitems.py | 41 | 2391 | #-*- coding: utf-8 -*-
from django.core import urlresolvers
from django.utils.translation import ugettext_lazy as _
from filer.models import mixins
from filer.models.filemodels import File
from filer.models.foldermodels import Folder
class DummyFolder(mixins.IconsMixin):
file_type = 'DummyFolder'
name = "Dumm... | bsd-3-clause |
GodBlessPP/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testwith.py | 739 | 5806 | import unittest
from warnings import catch_warnings
from unittest.test.testmock.support import is_instance
from unittest.mock import MagicMock, Mock, patch, sentinel, mock_open, call
something = sentinel.Something
something_else = sentinel.SomethingElse
class WithTest(unittest.TestCase):
def test_with_sta... | gpl-3.0 |
gotropo/gotropo | create/cloudfront.py | 1 | 5360 | from troposphere import GetAtt, Join, Output
from troposphere import Parameter, Ref, Template, Retain
from troposphere.cloudfront import Distribution, DistributionConfig, CacheBehavior
from troposphere.cloudfront import Origin, DefaultCacheBehavior, ViewerCertificate
from troposphere.cloudfront import ForwardedValues, ... | gpl-3.0 |
arthru/OpenUpgrade | addons/l10n_multilang/account.py | 34 | 3618 | # -*- 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 |
ibmjstart/bluemix-python-sample-twitter-influence-app | app/bottle.py | 71 | 129141 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bottle is a fast and simple micro-framework for small web applications. It
offers request dispatching (Routes) with url parameter support, templates,
a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and
template engines - all in a single file an... | apache-2.0 |
misugijunz/userinfuser | serverside/not_found.py | 12 | 1079 | # Copyright (C) 2011, CloudCaptive
#
# 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 |
geilerloui/deep-learning | language-translation/helper.py | 156 | 2683 | import os
import pickle
import copy
import numpy as np
CODES = {'<PAD>': 0, '<EOS>': 1, '<UNK>': 2, '<GO>': 3 }
def load_data(path):
"""
Load Dataset from File
"""
input_file = os.path.join(path)
with open(input_file, 'r', encoding='utf-8') as f:
return f.read()
def preprocess_and_save... | mit |
azatoth/pywikipedia | pywikibot/data/logentries.py | 1 | 8161 | # -*- coding: utf-8 -*-
"""
Objects representing Mediawiki log entries
"""
#
# (C) Pywikipedia bot team, 2007-08
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
from pywikibot.exceptions import *
import pywikibot
_logger = "wiki"
class LogDict(dict):
"""
Simple custom dictionary t... | mit |
mancoast/CPythonPyc_test | cpython/240_test_codecmaps_jp.py | 15 | 2552 | #!/usr/bin/env python
#
# test_codecmaps_jp.py
# Codec mapping tests for Japanese encodings
#
# $CJKCodecs: test_codecmaps_jp.py,v 1.3 2004/06/19 06:09:55 perky Exp $
from test import test_support
from test import test_multibytecodec_support
import unittest
class TestCP932Map(test_multibytecodec_support.TestBase_Ma... | gpl-3.0 |
tchype/ntlmaps | lib/des.py | 11 | 3160 | # This file is part of 'NTLM Authorization Proxy Server'
# Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru>
#
# NTLM APS 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 Licens... | gpl-2.0 |
kosz85/django | django/conf/locale/sr_Latn/formats.py | 130 | 1944 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_FORMAT = 'F Y.'
MONTH_DAY_FO... | bsd-3-clause |
complynx/nodemcu-IoT | tools/esptool.py | 8 | 25690 | #!/usr/bin/env python
#
# ESP8266 ROM Bootloader Utility
# https://github.com/themadinventor/esptool
#
# Copyright (C) 2014 Fredrik Ahlberg
#
# 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; eith... | mit |
quozl/sugar | extensions/deviceicon/speech.py | 2 | 5699 | # Copyright (C) 2011 One Laptop Per Child
#
# 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 distribu... | gpl-3.0 |
emedvedev/st2 | st2api/tests/unit/controllers/v1/test_traces.py | 5 | 4261 | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | apache-2.0 |
dims/cinder | cinder/tests/unit/test_xio.py | 1 | 59139 | # Copyright (c) 2014 X-IO Technologies.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | apache-2.0 |
stevenewey/django | django/db/backends/mysql/schema.py | 10 | 4822 | from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.models import NOT_PROVIDED
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_rename_table = "RENAME TABLE %(old_table)s TO %(new_table)s"
sql_alter_column_null = "MODIFY %(column)s %(type)s NULL"
sql_alter_column_... | bsd-3-clause |
pivonroll/Qt_Creator | tests/system/shared/suites_qtta.py | 4 | 4764 | ############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the co... | gpl-3.0 |
Chilledheart/ycmd | ycmd/tests/extra_conf_store_test.py | 21 | 1404 | #!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... | gpl-3.0 |
runekaagaard/django-contrib-locking | django/contrib/messages/storage/base.py | 113 | 6286 | from __future__ import unicode_literals
from django.conf import settings
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.contrib.messages import constants, utils
LEVEL_TAGS = utils.get_level_tags()
@python_2_unicode_compatible
class Message(object):
"""
Represents an a... | bsd-3-clause |
takahiro33/energyConsumption | .waf-1.7.9-786a25f4411038005f1f2ec0d121c503/waflib/extras/ns3.py | 3 | 1545 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
'''
When using this tool, the wscript will look like:
def options(opt):
opt.tool_options('ns3')
def configure(conf):
conf.load('compiler_cxx ns3')
... | agpl-3.0 |
resmo/ansible | lib/ansible/modules/cloud/google/gcpubsub_info.py | 23 | 4597 | #!/usr/bin/python
# Copyright 2016 Google Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
studio666/cjdns | node_build/dependencies/libuv/build/gyp/test/win/gyptest-link-enable-uac.py | 242 | 3382 | #!/usr/bin/env python
# Copyright 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.
"""
Verifies that embedding UAC information into the manifest works.
"""
import TestGyp
import sys
from xml.dom.minidom import parseString
if... | gpl-3.0 |
neubot/neubot-server | neubot/runtime/http_message.py | 2 | 8985 | #
# Copyright (c) 2010-2011, 2015
# Nexa Center for Internet & Society, Politecnico di Torino (DAUIN),
# and Simone Basso <bassosimone@gmail.com>.
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General ... | gpl-3.0 |
DarioGT/OMS-PluginXML | org.modelsphere.sms/lib/jython-2.2.1/Lib/Cookie.py | 1 | 25825 | #!/usr/bin/env python
#
####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
# 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 ... | gpl-3.0 |
BrutuZ/LegendasTV.bundle | Contents/Libraries/Shared/requests/packages/chardet/hebrewprober.py | 2929 | 13359 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | gpl-2.0 |
kastnerkyle/pylearn2 | pylearn2/datasets/tests/test_utlc.py | 1 | 2466 | import unittest
import numpy
import scipy.sparse
from pylearn2.testing.skip import skip_if_no_data
import pylearn2.datasets.utlc as utlc
def test_ule():
skip_if_no_data()
# Test loading of transfer data
train, valid, test, transfer = utlc.load_ndarray_dataset("ule",
... | bsd-3-clause |
futuresystems-courses/465-han2012w | assignment3.py | 2 | 1116 | #Assignment 3 - uebercool command
export PORTALNAME=name
export PROJECTID=fg465
ssh india
#type in password
ssh -l ubuntu -i ~/.ssh/$PORTALNAME-001 10.23.0.176
virtualenv ~/ENV2
source ~/ENV2/bin/activate
pip install --upgrade pip
pip --trusted-host pypi.python.org install cloudmesh_base
pip --trusted-host pypi.pytho... | apache-2.0 |
kdwink/intellij-community | python/lib/Lib/getopt.py | 167 | 7316 | # -*- coding: iso-8859-1 -*-
"""Parser for command line options.
This module helps scripts to parse the command line arguments in
sys.argv. It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--'). Long options similar to those supported by... | apache-2.0 |
rie-command/skistream-electron | node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # Copyright (c) 2011 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.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | gpl-3.0 |
AkizukiRyoko/mtasa-blue | vendor/google-breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/service_reflection_test.py | 560 | 5127 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | gpl-3.0 |
Ditmar/plugin.video.pelisalacarta | core/ClientCookie/_BSDDBCookieJar.py | 17 | 6238 | """Persistent CookieJar based on bsddb standard library module.
Copyright 2003-2004 John J Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it under
the terms of the BSD License (see the file COPYING included with the
distribution).
***********************************************... | gpl-3.0 |
stethewwolf/Sapy | sapy_modules/gui/gtk/widgets/lom_page_toolbar.py | 1 | 4961 | # Sapy
# Copyright (C) 2018 stefano prina <stefano-prina@outlook.it> <stethewwolf@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... | mit |
rbramwell/runbook | src/web/reactionforms/commando-group/__init__.py | 3 | 1423 | ######################################################################
# Cloud Routes Web Application
# -------------------------------------------------------------------
# SaltStack Services Reaction - Forms Class
######################################################################
from wtforms import TextField, S... | agpl-3.0 |
ChristineLaMuse/mozillians | vendor-local/lib/python/djcelery/tests/test_conf.py | 30 | 1353 | from __future__ import absolute_import
from django.conf import settings
from celery import conf
from djcelery.tests.utils import unittest
SETTING_VARS = (
("CELERY_DEFAULT_QUEUE", "DEFAULT_QUEUE"),
("CELERY_DEFAULT_ROUTING_KEY", "DEFAULT_ROUTING_KEY"),
("CELERY_DEFAULT_EXCHANGE_TYPE", "DEFAULT_EXCHANGE... | bsd-3-clause |
2014c2g4/2015cda_g7 | static/Brython3.1.3-20150514-095342/Lib/html/entities.py | 814 | 75240 | """HTML character entity references."""
# maps the HTML entity name to the Unicode codepoint
name2codepoint = {
'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1
'Acirc': 0x00c2, # latin capit... | gpl-3.0 |
uq-eresearch/uqam | mediaman/models.py | 1 | 3480 | from django.db import models
from mediaman.thumbs import ImageWithThumbsField
from cat.models import MuseumObject
from south.modelsinspector import add_introspection_rules
from easy_thumbnails.fields import ThumbnailerImageField
from django.contrib.auth.models import User
from django.db.models.signals import post_delet... | bsd-3-clause |
ga7g08/sympy | sympy/simplify/tests/test_hyperexpand.py | 51 | 37270 | from random import randrange
from sympy.simplify.hyperexpand import (ShiftA, ShiftB, UnShiftA, UnShiftB,
MeijerShiftA, MeijerShiftB, MeijerShiftC, MeijerShiftD,
MeijerUnShiftA, MeijerUnShiftB, MeijerUnShiftC,
MeijerUnShiftD,
Re... | bsd-3-clause |
kevinlondon/youtube-dl | youtube_dl/extractor/ceskatelevize.py | 32 | 6997 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
compat_urllib_parse,
compat_urllib_parse_unquote,
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
float_or_none,
)
c... | unlicense |
kongseokhwan/kulcloud-iitp-neutron | neutron/plugins/embrane/common/contexts.py | 59 | 1248 | # Copyright 2013 Embrane, 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... | apache-2.0 |
yize/grunt-tps | tasks/lib/python/Lib/python2.7/multiprocessing/reduction.py | 217 | 6582 | #
# Module to allow connection and socket objects to be transferred
# between processes
#
# multiprocessing/reduction.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditio... | mit |
DirtyUnicorns/android_external_chromium_org | tools/telemetry/third_party/pyserial/serial/tools/miniterm.py | 145 | 27451 | #!/usr/bin/env python
# Very simple serial terminal
# (C)2002-2011 Chris Liechti <cliechti@gmx.net>
# Input characters are sent directly (only LF -> CR/LF/CRLF translation is
# done), received characters are displayed as is (or escaped trough pythons
# repr, useful for debug purposes)
import sys, os, serial, thread... | bsd-3-clause |
j00bar/ansible | lib/ansible/modules/network/f5/bigip_selfip.py | 19 | 21466 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | gpl-3.0 |
birsoyo/conan | conans/client/store/localdb.py | 2 | 2577 | import os
import sqlite3
from conans.errors import ConanException
REMOTES_USER_TABLE = "users_remotes"
class LocalDB(object):
def __init__(self, dbfile):
if not os.path.exists(dbfile):
par = os.path.dirname(dbfile)
if not os.path.exists(par):
os.makedirs(par)
... | mit |
Fireblend/chromium-crosswalk | chrome/common/extensions/docs/server2/document_parser_test.py | 121 | 8495 | #!/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 unittest
from document_parser import ParseDocument, RemoveTitle
_WHOLE_DOCUMENT = '''
Preamble before heading.
<h1 id='main'... | bsd-3-clause |
rajul/Pydev | plugins/org.python.pydev/pysrc/pydevd_attach_to_process/winappdbg/thread.py | 100 | 75483 | #!~/.wine/drive_c/Python25/python.exe
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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 ... | epl-1.0 |
pdellaert/ansible | lib/ansible/modules/network/netvisor/pn_access_list.py | 35 | 4448 | #!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# 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': ['... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.