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 |
|---|---|---|---|---|---|
meln1k/marathon | tests/system/dcos_service_marathon_tests.py | 2 | 3693 | """Tests for root marathon specific to frameworks and readinessChecks """
import apps
import common
import retrying
import shakedown
import time
from datetime import timedelta
from dcos import marathon
from dcos.errors import DCOSUnprocessableException
def test_deploy_custom_framework():
"""Launches an app that... | apache-2.0 |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/scipy/weave/swigptr.py | 103 | 12378 | # swigptr.py
from __future__ import absolute_import, print_function
swigptr_code = """
/***********************************************************************
* $Header$
* swig_lib/python/python.cfg
*
* Contains variable linking and pointer type-checking code.
***************************************************... | mit |
zjj/trac_hack | trac/db_default.py | 1 | 13648 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Daniel Lundin <daniel@edgewall.com>
# 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 |
ProtouProject/android_kernel_msm | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
osrg/ryu | ryu/tests/unit/packet/test_llc.py | 56 | 1294 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | apache-2.0 |
sredmond/menlo-mathsci-help | db_repository/versions/006_migration.py | 1 | 1180 | from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
user = Table('user', post_meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('email', String(length=120)),
Column('hashed_password', String(length=60)),
C... | mit |
maartenq/ansible | test/units/modules/network/cnos/test_cnos_vlan.py | 7 | 1870 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import os
from ansible.compat.tests.mock import patch
from ansible.modules.network.cnos import cnos_vlan
from units.modules.utils import set_module_args
from .cnos_module import TestCnosModule, load_fixture
class Test... | gpl-3.0 |
oped/ud858 | Lesson_5/00_Conference_Central/main.py | 39 | 1248 | #!/usr/bin/env python
"""
main.py -- Udacity conference server-side Python App Engine
HTTP controller handlers for memcache & task queue access
$Id$
created by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import webapp2
from google.appengine.api import app_identity
from google.appe... | gpl-3.0 |
abalakh/robottelo | docs/conf.py | 1 | 3707 | """Sphinx documentation generator configuration file.
The full set of configuration options is listed on the Sphinx website:
http://sphinx-doc.org/config.html
"""
import sys
import os
# pylint:disable=invalid-name
# Add the Robottelo root directory to the system path. This allows references
# such as :mod:`robottelo... | gpl-3.0 |
bigswitch/nova | nova/tests/functional/api_sample_tests/test_preserve_ephemeral_rebuild.py | 1 | 3070 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
WoLpH/EventGhost | lib27/site-packages/requests/packages/chardet/langhebrewmodel.py | 2763 | 11318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | gpl-2.0 |
Dtambara/cadastroLivros | node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py | 1869 | 1247 | # Copyright 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.
"""A clone of the default copy.deepcopy that doesn't handle cyclic
structures or complex types except for dicts and lists. This is
because gyp copies so large structur... | mit |
Kongsea/tensorflow | tensorflow/contrib/crf/python/kernel_tests/crf_test.py | 5 | 12919 | # 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 |
JasonDeving/python_game | character.py | 1 | 1119 | import random
from combat import Combat
class Character(Combat):
attack_limit = 10
experience = 0
base_hit_points = 10
def attack(self):
roll = random.randint(1, self.attack_limit)
if self.weapon == 'sword':
roll += 1
elif self.weapon == 'axe':
roll +=2
return roll > 4
def ... | mit |
anudr01d/anudr01d.github.io | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/compiled.py | 94 | 155159 | # -*- coding: utf-8 -*-
"""
pygments.lexers.compiled
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for compiled languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from string import Template
from pygments.lexer import Lexer, Rege... | mit |
NMGRL/pychron | docs/user_guide/operation/scripts/examples/argus/measurement/jan_unknown400_120_long_equil.py | 2 | 2327 | #!Measurement
'''
baseline:
after: true
before: false
counts: 120
detector: H1
mass: 34.2
settling_time: 15.0
default_fits: nominal
equilibration:
eqtime: 40
inlet: R
inlet_delay: 3
outlet: O
use_extraction_eqtime: false
multicollect:
counts: 400
detector: H1
isotope: Ar40
peakcenter:
afte... | apache-2.0 |
NMGRL/pychron | pychron/lasers/laser_managers/chromium_laser_manager.py | 1 | 9853 | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | apache-2.0 |
polimediaupv/edx-platform | openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py | 96 | 15088 | # -*- coding: utf-8 -*-
"""Tests for the email opt-in list management command. """
import os.path
import tempfile
import shutil
import csv
from collections import defaultdict
from unittest import skipUnless
import ddt
from django.conf import settings
from django.core.management.base import CommandError
from xmodule.m... | agpl-3.0 |
cordoval/myhdl-python | olddoc/tools/indfix.py | 4 | 2295 | #! /usr/bin/env python
"""Combine similar index entries into an entry and subentries.
For example:
\item {foobar} (in module flotz), 23
\item {foobar} (in module whackit), 4323
becomes
\item {foobar}
\subitem in module flotz, 23
\subitem in module whackit, 4323
Note that an item which matc... | lgpl-2.1 |
b52/lala | setup.py | 1 | 1548 | #!/usr/bin/env python
# Copyright (C) 2010 Oliver Mader <b52@reaktor42.de>
#
# 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
# t... | mit |
zamzterz/Flask-pyoidc | tests/test_pyoidc_facade.py | 1 | 13038 | import time
import base64
import pytest
import responses
from oic.oic import AuthorizationResponse, AccessTokenResponse, TokenErrorResponse, OpenIDSchema, \
AuthorizationErrorResponse
from urllib.parse import parse_qsl, urlparse
from flask_pyoidc.provider_configuration import ProviderConfiguration, ClientMetadata... | apache-2.0 |
aboudreault/cassandra | pylib/cqlshlib/pylexotron.py | 28 | 18528 | # 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 |
pratikmallya/hue | desktop/core/ext-py/Django-1.6.10/django/conf/locale/lv/formats.py | 117 | 1908 | # -*- 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 = r'Y. \g\a\d\a j. F'
TIME_FORMAT = ... | apache-2.0 |
miiicmueller/android_kernel_raspberryPi_rpiv2 | tools/perf/python/twatch.py | 1565 | 1316 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
shawntan/opencog | opencog/python/inference_analyze.py | 2 | 16139 | ## @todo analyze data like stupid goals
import tree
import networkx as nx
from rules import Rule
from util import *
from sets import Set
import pdb
from opencog.atomspace import AtomSpace, Atom, types, TruthValue as tv
#from opencog.atomspace import TruthValue
def analyze(chainer):
"""docstring for analyze"""
i... | agpl-3.0 |
hkawasaki/kawasaki-aio8-2 | lms/djangoapps/instructor/tests/test_access.py | 18 | 6351 | """
Test instructor.access
"""
from nose.tools import raises
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from django.test.utils import override_settings
from courseware.tests.module... | agpl-3.0 |
mylvari/namubufferi | namubufferiapp/urls.py | 2 | 1840 | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from namubufferiapp import views
from namubufferiapp.forms import MagicAuthForm, TagAuthForm
urlpatterns = [
url(r'^$', views.home, name="home"),
url(r'^anonymous/$', views.home_anonymous, name="home_anonymous"),
url(r'^... | mit |
zijistark/HIP-tools | match-flags/match-titles.py | 2 | 4106 | __author__ = 'zijistark'
VERSION = '1.0'
import sys
import os
import traceback
import argparse
import re
DEFAULT_VANILLA_DIR = "/cygdrive/d/SteamLibrary/steamapps/common/Crusader Kings II/common/landed_titles"
DEFAULT_VANILLA_HISTORY_DIR = "/cygdrive/d/SteamLibrary/steamapps/common/Crusader Kings II/history/titles"
p... | gpl-2.0 |
django-stars/pytest-yapf | pytest_yapf.py | 1 | 2014 | import os
from yapf.yapflib import file_resources
from yapf.yapflib.style import CreateStyleFromConfig
from yapf.yapflib.yapf_api import FormatFile
import pytest
def pytest_addoption(parser):
group = parser.getgroup('yapf')
group.addoption('--yapf', action='store_true', help='run yapf on *.py files.')
g... | mit |
joshloyal/scikit-learn | sklearn/metrics/regression.py | 47 | 19967 | """Metrics to assess performance on regression task
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Ma... | bsd-3-clause |
berrange/nova | nova/tests/compute/test_flavors.py | 15 | 2327 | # Copyright 2014 IBM Corp.
# 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 app... | apache-2.0 |
wrouesnel/ansible | test/units/modules/cloud/google/test_gcp_url_map.py | 158 | 6086 | import unittest
from ansible.modules.cloud.google.gcp_url_map import _build_path_matchers, _build_url_map_dict
class TestGCPUrlMap(unittest.TestCase):
"""Unit tests for gcp_url_map module."""
params_dict = {
'url_map_name': 'foo_url_map_name',
'description': 'foo_url_map description',
... | gpl-3.0 |
aaront/calcmymarks2 | lib/jinja2/sandbox.py | 284 | 9423 | # -*- coding: utf-8 -*-
"""
jinja2.sandbox
~~~~~~~~~~~~~~
Adds a sandbox layer to Jinja as it was the default behavior in the old
Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the
default behavior is easier to use.
The behavior can be changed by subclassing the environm... | apache-2.0 |
rwarren14/robotframework | src/robot/reporting/jsmodelbuilders.py | 17 | 6988 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 |
segalaj/hammr | hammr/utils/bundle_utils.py | 2 | 6280 | # Copyright (c) 2007-2019 UShareSoft, 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 |
lthurlow/Boolean-Constrained-Routing | networkx-1.8.1/networkx/generators/tests/test_directed.py | 77 | 1313 | #!/usr/bin/env python
"""Generators - Directed Graphs
----------------------------
"""
from nose.tools import *
from networkx import *
from networkx.generators.directed import *
class TestGeneratorsDirected():
def test_smoke_test_random_graphs(self):
G=gn_graph(100)
G=gnr_graph(100,0.5)
G... | mit |
drmrd/ansible | test/units/modules/source_control/test_gitlab_project.py | 36 | 2704 | # -*- coding: utf-8 -*-
# Copyright (c) 2018 Pierre-Louis Bonicoli <pierre-louis@libregerbil.fr>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import json
from ansible.compat.tests.mock import MagicMock
from ansible.modules.source_control import gitlab_project
import py... | gpl-3.0 |
Stanford-Online/edx-platform | openedx/core/djangoapps/user_api/permissions.py | 54 | 1309 | """
Permissions classes for User-API aware views.
"""
from django.contrib.auth.models import User
from django.http import Http404
from django.shortcuts import get_object_or_404
from rest_framework import permissions
from openedx.core.djangoapps.user_api.accounts.api import visible_fields
def is_field_shared_factory(... | agpl-3.0 |
Hui-Zhi/gpu_cgroup_kernel | tools/perf/scripts/python/call-graph-from-postgresql.py | 758 | 11125 | #!/usr/bin/python2
# call-graph-from-postgresql.py: create call-graph from postgresql database
# Copyright (c) 2014, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free So... | gpl-2.0 |
nekulin/arangodb | 3rdParty/V8-4.3.61/tools/release/test_scripts.py | 12 | 59677 | #!/usr/bin/env python
# Copyright 2013 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
# notice... | apache-2.0 |
MadeiraCloud/opsagent | libs/requests/packages/urllib3/filepost.py | 551 | 2512 | # urllib3/filepost.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import codecs
import mimetypes
from uuid import uuid4
from io import BytesIO
from .packages ... | apache-2.0 |
photoninger/ansible | lib/ansible/plugins/action/patch.py | 2 | 2565 | # (c) 2015, Brian Coca <briancoca+dev@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 later v... | gpl-3.0 |
tupes/School | CS333/utilities.py | 1 | 1130 |
from string import ascii_letters
import re
NONLETTERS_PATTERN = re.compile('[^A-Z]')
def removeTextNonLetters(message):
return NONLETTERS_PATTERN.sub('', message.upper())
def removeBinaryNonLetters(message):
return ''.join([chr(b).upper() for b in message if chr(b) in ascii_letters])
def getInBothCount(s1, s2):... | gpl-3.0 |
Bryukh-Checkio-Tasks/checkio-task-stick-sawing | verification/tests.py | 2 | 1457 | """
TESTS is a dict with all you tests.
Keys for this will be categories' names.
Each test is dict with
"input" -- input data for user function
"answer" -- your right answer
"explanation" -- not necessary key, it's using for additional info in animation.
"""
TESTS = {
"Basics": [
{
... | gpl-2.0 |
0x90sled/catapult | third_party/gsutil/third_party/boto/boto/sqs/message.py | 135 | 9892 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | bsd-3-clause |
thnee/ansible | lib/ansible/plugins/doc_fragments/utm.py | 43 | 1586 | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, Johannes Brunswicker <johannes.brunswicker@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
DOCUMENTATION = r'''
options:
headers:
description:
- A dictiona... | gpl-3.0 |
christoph-buente/phantomjs | src/breakpad/src/tools/gyp/test/defines/gyptest-defines-env.py | 501 | 1874 | #!/usr/bin/env python
# Copyright (c) 2009 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 build of an executable with C++ define specified by a gyp define.
"""
import os
import TestGyp
test = TestGyp.TestGyp()
# Wi... | bsd-3-clause |
g19-hs/personfinder | app/unidecode/x000.py | 113 | 3035 | data = (
# Code points u+007f and below are equivalent to ASCII and are handled by a
# special case in the code. Hence they are not present in this table.
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '... | apache-2.0 |
zooba/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_vendor/chardet/jpcntx.py | 289 | 19643 | ######################## 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... | apache-2.0 |
hgl888/chromium-crosswalk-efl | tools/valgrind/asan/third_party/asan_symbolize.py | 26 | 14490 | #!/usr/bin/env python
#===- lib/asan/scripts/asan_symbolize.py -----------------------------------===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===----------------------------------------... | bsd-3-clause |
shakedel/tensorboard | tensorboard/plugins/distribution/distributions_plugin.py | 1 | 2702 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
0359xiaodong/viewfinder | backend/db/test/photo_test.py | 13 | 3056 | # Copyright 2011 Viewfinder Inc. All Rights Reserved.
"""Tests for Photo data object.
"""
__author__ = 'spencer@emailscrubbed.com (Spencer Kimball)'
import time
from functools import partial
from viewfinder.backend.base import util
from viewfinder.backend.base.testing import async_test
from viewfinder.backend.db.e... | apache-2.0 |
sowbiba/ansible | lib/ansible/plugins/shell/sh.py | 34 | 6175 | # (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 |
florianjacob/webassets | tests/test_environment.py | 12 | 6888 | from __future__ import with_statement
import os
from nose.tools import assert_raises, with_setup
from webassets import six
from webassets import Environment
from webassets.env import RegisterError
from webassets import Bundle
from webassets.test import TempEnvironmentHelper
class TestEnvApi(object):
"""General... | bsd-2-clause |
wdurhamh/statsmodels | statsmodels/sandbox/regression/onewaygls.py | 33 | 15131 | # -*- coding: utf-8 -*-
"""
F test for null hypothesis that coefficients in several regressions are the same
* implemented by creating groupdummies*exog and testing appropriate contrast
matrices
* similar to test for structural change in all variables at predefined break points
* allows only one group variable
* cur... | bsd-3-clause |
t1m0thy/autograd | autograd/numpy/numpy_wrapper.py | 4 | 2132 | from __future__ import absolute_import
from __future__ import print_function
import types
from .use_gpu_numpy import use_gpu_numpy
import six
if use_gpu_numpy():
print("Using GPU-supporting numpy wrapper")
import gpu_numpy as np
else:
import numpy as np
import warnings
from autograd.core import primitive
... | mit |
utamaro/youtube-dl | youtube_dl/extractor/crunchyroll.py | 25 | 14338 | # encoding: utf-8
from __future__ import unicode_literals
import re
import json
import base64
import zlib
import xml.etree.ElementTree
from hashlib import sha1
from math import pow, sqrt, floor
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_parse_unquote,
compa... | unlicense |
alip/pinktrace | python/TEST_socket.py | 1 | 1433 | #!/usr/bin/env python
# coding: utf-8
import os, signal, socket, sys, unittest
sys.path.insert(0, '.')
import pinktrace
import pinktrace.event
import pinktrace.socket
import pinktrace.syscall
import pinktrace.trace
UNAME = os.uname()
class TestSocket_01_Invalid(unittest.TestCase):
def test_01_name(self):
... | bsd-3-clause |
gdgellatly/OCB1 | openerp/report/render/rml2txt/rml2txt.py | 442 | 16460 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009, P. Christeas, Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or ... | agpl-3.0 |
quxiaolong1504/django | django/core/management/commands/sendtestemail.py | 349 | 1449 | import socket
from django.core.mail import mail_admins, mail_managers, send_mail
from django.core.management.base import BaseCommand
from django.utils import timezone
class Command(BaseCommand):
help = "Sends a test email to the email addresses specified as arguments."
missing_args_message = "You must specif... | bsd-3-clause |
PeterDaveHello/eden | modules/tests/volunteer/export_volunteers.py | 25 | 1890 | # -*- coding: utf-8 -*-
""" Sahana Eden Volunteer Module Automated Tests
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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... | mit |
sushantgoel/Flask | Work/Trivia - Module 5/env/Lib/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py | 2965 | 12784 | ######################## 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... | apache-2.0 |
micromagnetics/magnum.fe | site-packages/magnumfe/integrators/integrator.py | 2 | 1259 | # Copyright (C) 2011-2015 Claas Abert
#
# This file is part of magnum.fe.
#
# magnum.fe is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... | lgpl-3.0 |
Dave-ts/Sigil | src/Resource_Files/plugin_launchers/python/wrapper.py | 3 | 26384 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# Copyright (c) 2014 Kevin B. Hendricks, John Schember, and Doug Massay
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following ... | gpl-3.0 |
benshiue/bistro_forum | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py | 289 | 21425 | #!/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.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import traceback
from gyp.common import GypErr... | gpl-3.0 |
vismartltd/edx-platform | common/lib/capa/capa/tests/test_input_templates.py | 1 | 39385 | """
Tests for the logic in input type mako templates.
"""
import unittest
import capa
import os.path
import json
from lxml import etree
from mako.template import Template as MakoTemplate
from mako import exceptions
from capa.inputtypes import Status
class TemplateError(Exception):
"""
Error occurred while re... | agpl-3.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/test/test_pep352.py | 135 | 9047 | import unittest
import __builtin__
import exceptions
import warnings
from test.test_support import run_unittest, check_warnings
import os
import sys
from platform import system as platform_system
DEPRECATION_WARNINGS = ["BaseException.message has been deprecated"]
if sys.py3kwarning:
DEPRECATION_WARNINGS.extend(
... | mit |
andela-ooladayo/django | tests/template_tests/syntax_tests/test_width_ratio.py | 342 | 6095 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from django.utils import six
from ..utils import setup
class WidthRatioTagTests(SimpleTestCase):
libraries = {'custom': 'template_tests.templatetags.custom'}
@setup({'widthratio01': '{% widthratio a b 0 %}'})
def test... | bsd-3-clause |
hyiltiz/youtube-dl | youtube_dl/extractor/bloomberg.py | 99 | 1566 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class BloombergIE(InfoExtractor):
_VALID_URL = r'https?://www\.bloomberg\.com/news/videos/[^/]+/(?P<id>[^/?#]+)'
_TEST = {
'url': 'http://www.bloomberg.com/news/videos/b/aaeae121-5949-481e-a1ce-4562db6f5df2',
... | unlicense |
bburan/psiexperiment | tests/test_expression.py | 1 | 3838 | import pytest
import unittest
import numpy as np
from atom.api import Atom, Bool
from psi.context.expression import Expr, ExpressionNamespace
class TestExpression(unittest.TestCase):
def test_eval(self):
context = dict(a=1, b=2, c=3)
test_cases = [
('1+2', 3),
... | mit |
xen0l/ansible | lib/ansible/modules/cloud/google/gcp_compute_router_facts.py | 12 | 8629 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
messense/shadowsocks | shadowsocks/crypto/sodium.py | 1032 | 3778 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 |
sgallagher/reviewboard | docs/manual/conf.py | 2 | 10262 | # -*- coding: utf-8 -*-
#
# Review Board Manual build configuration file, created by
# sphinx-quickstart on Thu Feb 12 02:10:34 2009.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't picklea... | mit |
nuclon/gnlpy | taskstats.py | 1 | 3337 | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
"""Taskstats module
Thi... | bsd-3-clause |
dbaxa/django | tests/admin_checks/models.py | 281 | 1836 | """
Tests of ModelAdmin system checks logic.
"""
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Album(models.Model):
title = models.CharFie... | bsd-3-clause |
SOKP/external_chromium_org | tools/memory_inspector/PRESUBMIT.py | 35 | 3194 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for memory_inspector.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit... | bsd-3-clause |
sometallgit/AutoUploader | Python27/Lib/site-packages/pip/_vendor/webencodings/tests.py | 340 | 6562 | # coding: utf8
"""
webencodings.tests
~~~~~~~~~~~~~~~~~~
A basic test suite for Encoding.
:copyright: Copyright 2012 by Simon Sapin
:license: BSD, see LICENSE for details.
"""
from __future__ import unicode_literals
from . import (lookup, LABELS, decode, encode, iter_decode, iter_encode,
... | mit |
adaptivdesign/odooku-compat | odooku/services/wsgi/server.py | 1 | 1636 | from gevent.wsgi import WSGIServer as BaseWSGIServer
from werkzeug.debug import DebuggedApplication
from werkzeug.contrib.fixers import ProxyFix
import odoo.http
from odoo.service.wsgi_server import application_unproxied as odoo_application
from odoo.tools import config
import logging
import greenlet
import gevent
... | apache-2.0 |
rvlad1987/repository.rvlad1987.xbmc-addons | matrix/source/plugin.video.filmix.net.dev/core/image_loader.py | 1 | 8009 | # -*- coding: utf-8 -*-
# Used in
# http.py - format_poster_link()
# list.py - add_movies()
import xbmcvfs
import xbmcup.app, xbmcup.net
from .xbmcup.db import SQL
from .xbmcup.system import FS
from .image_size import get_image_size_from_bytesio
from .auth import Auth
from .defines import *
# https://githu... | gpl-2.0 |
bjolivot/ansible | lib/ansible/modules/storage/netapp/netapp_e_hostgroup.py | 63 | 14716 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, NetApp, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | gpl-3.0 |
Ruide/angr-dev | cle/cle/backends/elf/symbol.py | 1 | 2191 | from ..symbol import Symbol
from ...address_translator import AT
class ELFSymbol(Symbol):
"""
Represents a symbol for the ELF format.
:ivar str elftype: The type of this symbol as an ELF enum string
:ivar str binding: The binding of this symbol as an ELF enum string
:ivar section: ... | bsd-2-clause |
ascott1/regulations-site | regulations/tests/layers_formatting_tests.py | 5 | 5874 | from unittest import TestCase
from mock import Mock, patch
from regulations.generator.layers.formatting import FormattingLayer
class FormattingLayerTest(TestCase):
@patch('regulations.generator.layers.formatting.loader')
def test_apply_layer(self, loader):
render = loader.get_template.return_value.r... | cc0-1.0 |
mfcabrera/luigi | test/event_callbacks_test.py | 24 | 9029 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
gencer/sentry | src/debug_toolbar/panels/sql/tracking.py | 4 | 5304 | from __future__ import absolute_import, unicode_literals
import json
from threading import local
from time import time
from django.utils.encoding import force_text
from django.utils import six
from debug_toolbar.utils import tidy_stacktrace, get_template_info, get_stack
from debug_toolbar import settings as dt_setti... | bsd-3-clause |
featherweightweb/django-composer | composer/templatetags/composer.py | 1 | 5201 | """
composer.py
"""
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from ..models import Element
register = template.Library()
class LazyContent:
"""
Wrapper around a `NodeList` that is lazily-evaluated to a string.
"""
def __init__(self, no... | mit |
openaid-IATI/OIPA | OIPA/api/country/tests/test_country_serializers.py | 1 | 3343 | from unittest import skip
from django.contrib.gis.geos import Point
from django.test import RequestFactory, TestCase
from api.country import serializers
from geodata.factory import geodata_factory
class TestCountrySerializers(TestCase):
request_dummy = RequestFactory().get('/')
@skip
def test_CountrySe... | agpl-3.0 |
nic7aller/bip-switch | BipFlaskProject/BipFlaskProject/env/Lib/encodings/mac_croatian.py | 593 | 13889 | """ Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... | mit |
pinkavaj/gnuradio | gr-analog/python/analog/qa_pwr_squelch.py | 47 | 3279 | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... | gpl-3.0 |
frvannes16/Cops-Robbers-Coding-Challenge | src/competition_code/libs/chardet/euckrprober.py | 290 | 1748 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | apache-2.0 |
pandaproject/panda | panda/tasks/export_csv.py | 4 | 3167 | #!/usr/bin/env python
import datetime
import logging
from math import floor
import os.path
import time
from csvkit import CSVKitWriter
from django.conf import settings
from django.utils import simplejson as json
from django.utils.translation import ugettext
from livesettings import config_value
from panda import sol... | mit |
colinligertwood/odoo | addons/website_mail/controllers/main.py | 10 | 3844 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
isandlaTech/cohorte-platforms | cohorte-home/extra/linux/aarch64/jpype/_pykeywords.py | 7 | 1081 | # *****************************************************************************
# Copyright 2004-2008 Steve Menard
#
# 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:... | apache-2.0 |
russross/codegrinder | files/python3unittest/tests/asttest.py | 1 | 9348 | import ast
import os
import sys
import trace
import unittest
class ASTTest(unittest.TestCase):
def setUp(self, filename, parse_file=True):
"""Stores the raw text of the student submission, the lines that were
printed when executing the student submission, and the AST tree of the
submission... | agpl-3.0 |
kogotko/carburetor | openstack_dashboard/test/integration_tests/tests/test_metadata_definitions.py | 14 | 7023 | # 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 |
navjeet0211/Mara | ANN/Learn.py | 1 | 2320 | #!/usr/bin/python
# -*- coding: ISO-8859-1 -*-
"""
Mara.ANN.Learn (v. 0.1):
Learning algorithms for neural networks.
Author: Martti Louhivuori (martti.louhivuori@helsinki.fi)
Date: 14.2.2006
"""
class Teacher:
def __init__(self, net, method='bp', targets=None, rate=1,
gradient_delta=... | gpl-2.0 |
lutris/lutris | lutris/util/wine/wine.py | 1 | 15483 | """Utilities for manipulating Wine"""
import os
from collections import OrderedDict
from functools import lru_cache
from gettext import gettext as _
from lutris import runtime, settings
from lutris.gui.dialogs import DontShowAgainDialog, ErrorDialog
from lutris.runners.steam import steam
from lutris.util import linux,... | gpl-3.0 |
mudiarto/BibleSeeds | appengine/boilerplate/external/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 |
DARKPOP/external_chromium_org | tools/telemetry/telemetry/page/actions/action_runner.py | 42 | 25683 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import time
from telemetry.page.actions.javascript_click import ClickElementAction
from telemetry.page.actions.loop import LoopAction
from telemetry.page.ac... | bsd-3-clause |
aliyun/oss-ftp | python27/win32/Lib/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py | 3133 | 82594 | ######################## 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 |
mKeRix/home-assistant | homeassistant/components/owntracks/messages.py | 5 | 12148 | """OwnTracks Message handlers."""
import json
import logging
from nacl.encoding import Base64Encoder
from nacl.secret import SecretBox
from homeassistant.components import zone as zone_comp
from homeassistant.components.device_tracker import (
SOURCE_TYPE_BLUETOOTH_LE,
SOURCE_TYPE_GPS,
)
from homeassistant.co... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.