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 |
|---|---|---|---|---|---|
terranodo/geonode | geonode/security/tests.py | 13 | 19666 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
keitaroyam/yamtbx | dxtbx_formats/FormatEMD.py | 1 | 7738 | # Class for reading .emd file by Velox.
# This code was written based on FormatSER.py from https://github.com/cctbx/dxtbx/blob/master/format/FormatSER.py
from __future__ import absolute_import, division, print_function
import struct
import h5py
import numpy
import os
import json
from scitbx.array_family import flex
f... | bsd-3-clause |
ec-geolink/glharvest | glharvest/tests/test_scenarios.py | 1 | 6841 | """test_scenarios.py
End-end-end tests for the Harvester.
"""
import sys
import os
import RDF
from glharvest import jobs, registry, void
def test_can_update_a_provider_with_a_new_resource(repository):
"""This test tests the case where a provider gives informationa about one
resource at time t0 then, at tim... | apache-2.0 |
Duoxilian/home-assistant | homeassistant/helpers/event_decorators.py | 7 | 2746 | """Event Decorators for custom components."""
import functools
import logging
# pylint: disable=unused-import
from typing import Optional # NOQA
from homeassistant.core import HomeAssistant # NOQA
from homeassistant.helpers import event
HASS = None # type: Optional[HomeAssistant]
_LOGGER = logging.getLogger(__nam... | mit |
imply/chuu | build/android/pylib/constants.py | 23 | 3998 | # 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.
"""Defines a set of constants shared by test runners and other scripts."""
import os
import subprocess
import sys
DIR_SOURCE_ROOT = os.path.abspath(os... | bsd-3-clause |
Laurawly/tvm-1 | python/tvm/te/hybrid/preprocessor.py | 4 | 4750 | # 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 |
Klafyvel/ISN_2015 | nom molecule.py | 1 | 5422 | # Nomenclature
# Copyright (C) 2015 BOUVIN Valentin, HONNORATY Vincent, LEVY-FALK Hugo
# 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 opti... | gpl-3.0 |
seann1/portfolio5 | .meteor/dev_bundle/python/Lib/lib-tk/Dialog.py | 187 | 1567 | # dialog.py -- Tkinter interface to the tk_dialog script.
from Tkinter import *
from Tkinter import _cnfmerge
if TkVersion <= 3.6:
DIALOG_ICON = 'warning'
else:
DIALOG_ICON = 'questhead'
class Dialog(Widget):
def __init__(self, master=None, cnf={}, **kw):
cnf = _cnfmerge((cnf, kw))
self.... | gpl-2.0 |
prathik/thrift | lib/py/setup.py | 46 | 3406 | #!/usr/bin/env python
#
# 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
# "L... | apache-2.0 |
jonashagstedt/swampdragon | chat_example/chat_example/settings.py | 13 | 2576 | import os
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '))%*y#of%4cnju5=$-1sab!k... | bsd-3-clause |
Shao-Feng/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_object-src_cross-origin_multi_blocked_int-manual.py | 30 | 2479 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "object-src " + url2 +... | bsd-3-clause |
erudit/eruditorg | eruditorg/erudit/migrations/0089_thesisprovider.py | 1 | 1911 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-04-24 15:15
from __future__ import unicode_literals
from django.db import migrations, models
def populate_thesis_providers(apps, schema_editor):
ThesisProvider = apps.get_model("erudit", "ThesisProvider")
Collection = apps.get_model("erudit", "Coll... | gpl-3.0 |
117111302/PyGithub | github/tests/GitBlob.py | 39 | 2801 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
tbeadle/django | tests/forms_tests/widget_tests/test_checkboxselectmultiple.py | 13 | 4796 | from django.forms import CheckboxSelectMultiple
from .base import WidgetTest
class CheckboxSelectMultipleTest(WidgetTest):
widget = CheckboxSelectMultiple
def test_render_value(self):
self.check_html(self.widget(choices=self.beatles), 'beatles', ['J'], html=(
"""<ul>
<li><lab... | bsd-3-clause |
itsjeyd/edx-platform | openedx/core/djangoapps/api_admin/decorators.py | 27 | 1127 | """Decorators for API access management."""
from functools import wraps
from django.core.urlresolvers import reverse
from django.http import HttpResponseNotFound
from django.shortcuts import redirect
from openedx.core.djangoapps.api_admin.models import ApiAccessRequest, ApiAccessConfig
def api_access_enabled_or_404... | agpl-3.0 |
eduNEXT/edunext-platform | openedx/core/lib/gating/tests/test_api.py | 3 | 17438 | """
Tests for the gating API
"""
import unittest
import six
from completion.models import BlockCompletion
from ddt import data, ddt, unpack
from django.conf import settings
from milestones import api as milestones_api
from milestones.tests.utils import MilestonesTestCaseMixin
from mock import Mock, patch
from lms.d... | agpl-3.0 |
autosportlabs/podium-api | podium_api/types/venue.py | 1 | 2122 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class PodiumVenue(object):
"""
Object that represents a Venue.
**Attributes:**
**venue_id** (int): Venue Id
**uri** (string): URI for the Venue.
**name** (string): The Venue's name.
"""
def __init__(self, venue_i... | mit |
vegetableman/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/steps_unittest.py | 121 | 5674 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | bsd-3-clause |
demon-ru/iml-crm | addons/report_webkit/company.py | 431 | 2562 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who... | agpl-3.0 |
jkonecki/autorest | AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/models/custom_domain.py | 2 | 1213 | # 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 |
pombreda/https-gitorious.org-appstream-software-center | softwarecenter/ui/gtk3/widgets/cellrenderers.py | 4 | 18064 | # Copyright (C) 2011 Canonical
#
# Authors:
# Matthew McGowan
# Michael Vogt
#
# 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; version 3.
#
# This program is distributed in the hope that it wi... | gpl-3.0 |
upndwn4par/graviton_s4_kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
tx137884746/IzayoiMiku | toughradius/tools/livecd.py | 4 | 4933 | #!/usr/bin/env python
#coding:utf-8
from toughradius.tools.secret import gen_secret
def echo_radiusd_cnf():
return '''[DEFAULT]
debug = 0
tz = CST-8
secret = %s
ssl = 1
privatekey = /var/toughradius/privkey.pem
certificate = /var/toughradius/cacert.pem
[database]
dbtype = mysql
dburl = mysql://radiusd:root@127.0.... | agpl-3.0 |
shumik/skencil-c | Sketch/UI/gradientedit.py | 1 | 9796 | # Sketch - A Python-based interactive drawing program
# Copyright (C) 1998, 1999, 2000, 2002 by Bernhard Herzog
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of th... | gpl-2.0 |
MrNuggles/HeyBoet-Telegram-Bot | temboo/Library/Utilities/DataConversions/XMLToXLS.py | 5 | 2894 | # -*- coding: utf-8 -*-
###############################################################################
#
# XMLToXLS
# Converts an XML file to a Base64 encoded Excel file.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not... | gpl-3.0 |
umitproject/openmonitor-aggregator | simplejson/tests/test_fail.py | 136 | 3555 | from unittest import TestCase
import simplejson as json
# Fri Dec 30 18:57:26 2005
JSONDOCS = [
# http://json.org/JSON_checker/test/fail1.json
'"A JSON payload should be an object or array, not a string."',
# http://json.org/JSON_checker/test/fail2.json
'["Unclosed array"',
# http://json.org/JSON_... | agpl-3.0 |
sadmansk/servo | components/script/dom/bindings/codegen/parser/tests/test_constructor.py | 23 | 9627 | import WebIDL
def WebIDLTest(parser, harness):
def checkArgument(argument, QName, name, type, optional, variadic):
harness.ok(isinstance(argument, WebIDL.IDLArgument),
"Should be an IDLArgument")
harness.check(argument.identifier.QName(), QName, "Argument has the right QName")
... | mpl-2.0 |
taktik/account-invoicing | account_invoice_shipping_address/tests/test_invoice_shipping_test.py | 30 | 2274 | # -*- coding: utf-8 -*-
##############################################################################
# This file is part of account_invoice_shipping_address, an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# account_invoice_line_sort is free software: you can redistribute it
# ... | agpl-3.0 |
josiah-wolf-oberholtzer/supriya | tests/commands/test_commands_SynthNewRequest.py | 1 | 3544 | import pytest
import uqbar.strings
import supriya
def test_do_not_coerce_arguments():
synth = supriya.realtime.Synth()
group = supriya.realtime.Group()
assert synth.node_id is None
assert group.node_id is None
request = supriya.commands.SynthNewRequest(
node_id=synth, synthdef=synth.synth... | mit |
zsoltdudas/lis-tempest | tempest/services/object_storage/object_client.py | 4 | 9809 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
adamncasey/servo | tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_parser.py | 451 | 3612 | from __future__ import absolute_import, division, unicode_literals
import os
import sys
import traceback
import warnings
import re
warnings.simplefilter("error")
from .support import get_data_files
from .support import TestData, convert, convertExpected, treeTypes
from html5lib import html5parser, constants
# Run t... | mpl-2.0 |
chrishokamp/fuel | fuel/transformers/image.py | 6 | 12409 | from __future__ import division
from io import BytesIO
import math
import numpy
from PIL import Image
from six import PY3
try:
from ._image import window_batch_bchw
window_batch_bchw_available = True
except ImportError:
window_batch_bchw_available = False
from . import ExpectsAxisLabels, SourcewiseTransfo... | mit |
jandom/rdkit | rdkit/Chem/FeatMaps/FeatMapParser.py | 12 | 5307 | # $Id$
#
# Copyright (C) 2006 Greg Landrum
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
from rdkit import Geometry
from rdkit.Chem.FeatMaps imp... | bsd-3-clause |
xingyepei/edx-platform | common/lib/capa/capa/safe_exec/lazymod.py | 193 | 1200 | """A module proxy for delayed importing of modules.
From http://barnesc.blogspot.com/2006/06/automatic-python-imports-with-autoimp.html,
in the public domain.
"""
import sys
class LazyModule(object):
"""A lazy module proxy."""
def __init__(self, modname):
self.__dict__['__name__'] = modname
... | agpl-3.0 |
nycholas/ask-undrgz | src/ask-undrgz/django/contrib/gis/tests/geoapp/feeds.py | 326 | 1856 | from django.contrib.gis import feeds
from django.contrib.gis.tests.utils import mysql
from models import City, Country
class TestGeoRSS1(feeds.Feed):
link = '/city/'
title = 'Test GeoDjango Cities'
def items(self):
return City.objects.all()
def item_link(self, item):
return '/city/%s/... | bsd-3-clause |
ammiranda/python_koans | python3/libs/colorama/win32.py | 86 | 2730 |
# from winbase.h
STDOUT = -11
STDERR = -12
try:
from ctypes import windll
except ImportError:
windll = None
SetConsoleTextAttribute = lambda *_: None
else:
from ctypes import (
byref, Structure, c_char, c_short, c_uint32, c_ushort
)
handles = {
STDOUT: windll.kernel32.GetStdHa... | mit |
DimensionDataCBUSydney/libcloud | libcloud/test/test_file_fixtures.py | 50 | 1229 | # 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 use ... | apache-2.0 |
jazkarta/edx-platform-for-isc | cms/djangoapps/contentstore/management/commands/git_export.py | 18 | 2804 | """
This command exports a course from CMS to a git repository.
It takes as arguments the course id to export (i.e MITx/999/2020 ) and
the repository to commit too. It takes username as an option for identifying
the commit, as well as a directory path to place the git repository.
By default it will use settings.GIT_R... | agpl-3.0 |
mrshelly/openerp71313 | openerp/addons/mail/tests/test_mail_message.py | 1 | 23446 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
inflector/singnet | agent/sn_agent/api/poller.py | 6 | 1373 | import asyncio
import datetime
import logging
from contextlib import suppress
from aiohttp import web
logger = logging.getLogger(__file__)
class Periodic:
def __init__(self, func, time):
self.func = func
self.time = time
self.is_started = False
self._task = None
async def st... | mit |
echodaemon/Empire | lib/common/messages.py | 8 | 16901 | """
Common terminal messages used across Empire.
Titles, agent displays, listener displays, etc.
"""
import os
import time
import textwrap
# Empire imports
import helpers
###############################################################
#
# Messages
#
###############################################################... | bsd-3-clause |
augustozuniga/arisgames | zxing-master/cpp/scons/scons-local-2.0.0.final.0/SCons/compat/_scons_collections.py | 34 | 1869 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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
# without li... | mit |
ychfan/tensorflow | tensorflow/python/profiler/profile_context_test.py | 32 | 4282 | # 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 |
pjurik2/pykarma | feeds/rss.py | 1 | 3205 | import os, sys
import random
import time
import feedparser
import itertools
import HTMLParser
from feed import Feed
if os.getcwd().rstrip(os.sep).endswith('feeds'):
os.chdir('..')
sys.path.insert(0, os.getcwd())
from gui_client import new_rpc
import web
import reddit
class RSSFeed(Feed):
def __init__(se... | mit |
aman-iitj/scipy | scipy/linalg/tests/test_special_matrices.py | 36 | 22800 | """Tests for functions in special_matrices.py."""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import arange, add, array, eye, copy, sqrt
from numpy.testing import (TestCase, run_module_suite, assert_raises,
assert_equal, assert_array_equal, assert_array_almost_eq... | bsd-3-clause |
leedm777/ansible-modules-core | files/acl.py | 47 | 9778 | #!/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 distributed... | gpl-3.0 |
tashaxe/Red-DiscordBot | lib/discord/ext/commands/bot.py | 17 | 27409 | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2016 Rapptz
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 u... | gpl-3.0 |
slank/ansible | lib/ansible/modules/system/hostname.py | 12 | 23676 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Hiroaki Nakamura <hnakamur@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... | gpl-3.0 |
qtekfun/htcDesire820Kernel | external/chromium_org/chrome/test/mini_installer/verifier.py | 85 | 2063 | # 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.
class Verifier:
"""Verifies that the current machine states match the expectation."""
def VerifyInput(self, verifier_input, variable_expander):
"""... | gpl-2.0 |
jpike88/crosswalk | tools/reflection_generator/java_method.py | 3 | 29922 | #!/usr/bin/env python
# Copyright (c) 2014 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
from collections import OrderedDict
from string import Template
def ConvertClassExpressionToClassType(class_name):
""" ... | bsd-3-clause |
polypmer/obligarcy | obligarcy/migrations/0040_action.py | 1 | 1184 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0002_remove_content_type_... | gpl-3.0 |
pombredanne/disco | tests/test_util.py | 10 | 1840 | import os
from datetime import datetime
from disco.test import TestCase
from disco.util import flatten, iterify, urlsplit
def function(x):
return x + 0
sequence = 0, [1, [2, 3], [[4, [5, [6]]]]]
class UtilTestCase(TestCase):
def test_flatten(self):
self.assertEquals(list(range(7)), list(flatten(sequ... | bsd-3-clause |
napsternxg/twitter_nlp | hbc/python/Vocab.py | 10 | 1046 | class Vocab:
def __init__(self, vocabFile=None):
self.nextId = 1
self.word2id = {}
self.id2word = {}
if vocabFile:
for line in open(vocabFile):
line = line.rstrip('\n')
(word, wid) = line.split('\t')
self.word2id[word] = int... | gpl-3.0 |
michaelWagner/oppia | extensions/triggers/trigger_classes.py | 19 | 2484 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
jermowery/xos | xos/tosca/tests/computetest.py | 4 | 4688 | from basetest import BaseToscaTest
from core.models import Instance, Slice
class ComputeTest(BaseToscaTest):
tests = [ # "create_compute_m1_tiny", XXX m1.tiny does not exist on cloudlab
"create_compute_m1_small",
"create_compute_m1_large_8192MB",
"create_compute_m1_large_8GB... | apache-2.0 |
yampiopl/Yamcoin | contrib/bitrpc/bitrpc.py | 2348 | 7835 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | mit |
ashray/VTK-EVM | ThirdParty/Twisted/twisted/web/test/test_static.py | 28 | 56293 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.static}.
"""
import inspect
import mimetypes
import os
import re
import StringIO
from zope.interface.verify import verifyObject
from twisted.internet import abstract, interfaces
from twisted.python.runtime import plat... | bsd-3-clause |
liukaijv/XlsxWriter | xlsxwriter/test/worksheet/test_worksheet03.py | 8 | 4143 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
from ...format ... | bsd-2-clause |
petertodd/bitcoin | contrib/devtools/update-translations.py | 54 | 2334 | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the follo... | mit |
traveloka/ansible | lib/ansible/modules/network/eos/eos_config.py | 25 | 12504 | #!/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 |
0k/odoo | addons/web_tip/__openerp__.py | 31 | 1291 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
alex/warehouse | tests/unit/test_sessions.py | 1 | 21090 | # 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 Li... | apache-2.0 |
tensorflow/tensorflow | tensorflow/python/ops/structured/structured_array_ops.py | 6 | 20742 | # Lint as python3
# 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 r... | apache-2.0 |
theheros/kbengine | kbe/res/scripts/common/Lib/test/test_winreg.py | 3 | 18930 | # Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
import os, sys
import unittest
from test import support
threading = support.import_module("threading")
from platform import machine
# Do this first so test will be skipped if module doesn't exis... | lgpl-3.0 |
vhaupert/mitmproxy | mitmproxy/proxy/protocol/http2.py | 1 | 30035 | import threading
import time
import functools
from typing import Dict, Callable, Any, List, Optional # noqa
import h2.exceptions
from h2 import connection
from h2 import events
import queue
from mitmproxy import connections # noqa
from mitmproxy import exceptions
from mitmproxy import http
from mitmproxy.proxy.prot... | mit |
creasyw/IMTAphy | documentation/doctools/tags/0.4.3/sphinx/linkcheck.py | 11 | 3581 | # -*- coding: utf-8 -*-
"""
sphinx.linkcheck
~~~~~~~~~~~~~~~~
The CheckExternalLinksBuilder class.
:copyright: 2008 by Georg Brandl, Thomas Lamb.
:license: BSD.
"""
import socket
from os import path
from urllib2 import build_opener, HTTPError
from docutils import nodes
from sphinx.builder impor... | gpl-2.0 |
ahmadiga/min_edx | common/test/acceptance/tests/studio/test_studio_asset.py | 37 | 1708 | """
Acceptance tests for Studio related to the asset index page.
"""
from ...pages.studio.asset_index import AssetIndexPage
from .base_studio_test import StudioCourseTest
from ...fixtures.base import StudioApiLoginError
class AssetIndexTest(StudioCourseTest):
"""
Tests for the Asset index page.
"""
... | agpl-3.0 |
renfredxh/pylletTown | pylletTown.py | 1 | 8123 | import pygame
import tmx
class Player(pygame.sprite.Sprite):
def __init__(self, location, orientation, *groups):
super(Player, self).__init__(*groups)
self.image = pygame.image.load('sprites/player.png')
self.imageDefault = self.image.copy()
self.rect = pygame.Rect(location, (64,64)... | mit |
carlmw/oscar-wager | django/contrib/gis/gdal/field.py | 264 | 6059 | from ctypes import byref, c_int
from datetime import date, datetime, time
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException
from django.contrib.gis.gdal.prototypes import ds as capi
# For more information, see the OGR C API source code:
# http://www.gdal.org/ogr/... | bsd-3-clause |
DJMelonz/basic-blog | django/views/generic/simple.py | 245 | 2319 | from django.template import loader, RequestContext
from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseGone
from django.utils.log import getLogger
import warnings
warnings.warn(
'Function-based generic views have been deprecated; use class-based views instead.',
... | bsd-3-clause |
RockRaidersInc/ROS-Main | gps/src/FSM.py | 1 | 1234 | """TODO."""
from enum import Enum
import UBX
def isObj(obj, cls):
"""Test if UBX message obj is of class cls."""
return obj._class == cls._class and obj._id == cls._id
def isACK(obj):
"""Test whether message obj is a ACK."""
return isObj(obj, UBX.ACK.ACK)
def isNAK(obj):
"""Test whether messag... | gpl-3.0 |
incaser/odoo-odoo | doc/_extensions/odoo/translator.py | 207 | 26718 | # -*- coding: utf-8 -*-
import os.path
import posixpath
import re
import urllib
from docutils import nodes
from sphinx import addnodes, util
from sphinx.locale import admonitionlabels
def _parents(node):
while node.parent:
node = node.parent
yield node
class BootstrapTranslator(nodes.NodeVisitor... | agpl-3.0 |
brettatoms/cerberus | docs/conf.py | 1 | 8056 | # -*- coding: utf-8 -*-
#
# Cerberus documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 11 15:52:25 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | isc |
aam-at/tensorflow | tensorflow/python/ops/ragged/ragged_tensor.py | 1 | 117296 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
niphlod/pydal | pydal/connection.py | 1 | 5577 | # -*- coding: utf-8 -*-
import os
from ._compat import itervalues
from ._globals import GLOBAL_LOCKER, THREAD_LOCAL
from ._load import OrderedDict
from .helpers._internals import Cursor
class ConnectionPool(object):
POOLS = {}
check_active_connection = True
def __init__(self):
_iid_ = str(id(self... | bsd-3-clause |
pmav99/praktoras | checks.d/windows_service.py | 9 | 3049 | """ Collect status information for Windows services
"""
# project
from checks import AgentCheck
from checks.wmi_check import WinWMICheck
from utils.containers import hash_mutable
from utils.timeout import TimeoutException
class WindowsService(WinWMICheck):
STATE_TO_VALUE = {
'Stopped': AgentCheck.CRITICAL... | bsd-3-clause |
av8ramit/tensorflow | tensorflow/contrib/copy_graph/python/util/copy_test.py | 112 | 3739 | # 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 |
jparyani/capnproto | doc/_plugins/capnp_lexer.py | 35 | 2103 | #! /usr/bin/env python
from pygments.lexer import RegexLexer
from pygments.token import *
class CapnpLexer(RegexLexer):
name = "Cap'n Proto lexer"
aliases = ['capnp']
filenames = ['*.capnp']
tokens = {
'root': [
(r'#.*?$', Comment.Single),
(r'@[0-9a-zA-Z]*', Name.Decor... | mit |
inveniosoftware/iugw2017 | 3-datamodels/custom-data-module/custom_data_module/providers.py | 1 | 1974 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2017 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | gpl-3.0 |
PowerDNS/exabgp | dev/unittest2/connection.py | 6 | 1401 | #!/usr/bin/env python
# encoding: utf-8
"""
connection.py
Created by Thomas Mangin on 2013-07-13.
Copyright (c) 2009-2013 Exa Networks. All rights reserved.
"""
import os
import sys
import unittest
from exabgp.util.od import od
def test ():
OPEN = ''.join([chr(int(_,16)) for _ in "FF FF FF FF FF FF FF FF FF FF FF ... | bsd-3-clause |
infoxchange/django-localflavor | localflavor/nz/forms.py | 4 | 4267 | # -*- coding: utf-8 -*-
"""
New Zealand specific form helpers
"""
from __future__ import unicode_literals
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_str
from djang... | bsd-3-clause |
huanpc/IoT-1 | gui/controller/.venv/lib/python3.5/site-packages/rest_framework/test.py | 7 | 8635 | # -- coding: utf-8 --
# Note that we import as `DjangoRequestFactory` and `DjangoClient` in order
# to make it harder for the user to import the wrong thing without realizing.
from __future__ import unicode_literals
from django.conf import settings
from django.test import testcases
from django.test.client import Clie... | mit |
shanot/imp | modules/multifit/test/test_connected_components.py | 2 | 1704 | import sys
import os
import IMP
import IMP.em
import IMP.test
import IMP.core
import IMP.atom
import IMP.multifit
class Tests(IMP.test.TestCase):
"""Test connected components """
def setUp(self):
"""Build test model and optimizer"""
IMP.test.TestCase.setUp(self)
IMP.set_log_level(IMP... | gpl-3.0 |
yunlongliukm/chm1_scripts | AlignmentReaders.py | 2 | 1464 | #!/usr/bin/env python
class Alignment:
def __init__(self):
self.qname = ""
self.tname = ""
self.qstat = 0
self.qend = 0
self.qstrand = 0
self.qlen = 0
self.tstart = 0
self.tend = 0
self.tstrand = 0
self.tlen = 0
self.score... | mit |
jriehl/numba | numba/roc/hsadrv/devices.py | 2 | 3256 | """
Expose each GPU device directly
"""
from __future__ import print_function, absolute_import, division
import functools
from numba import servicelib
from .driver import hsa as driver, Context as _Context
class _culist(object):
"""A thread local list of GPU instances
"""
def __init__(self):
self... | bsd-2-clause |
prestoncarman/vxquery | vxquery-server/src/main/resources/scripts/cluster_cli.py | 11 | 3506 | #!/usr/bin/env python
#
# 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 "Lic... | apache-2.0 |
dyyi/moneybook | venv/Lib/site-packages/pip/_vendor/requests/packages/urllib3/fields.py | 200 | 5872 | from __future__ import absolute_import
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`.
... | apache-2.0 |
Endika/OpenUpgrade | addons/account/wizard/account_report_general_journal.py | 378 | 1697 | # -*- 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 |
thaumos/ansible | lib/ansible/modules/network/fortios/fortios_webfilter_content.py | 24 | 10670 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
kemalakyol48/python-for-android | python-modules/twisted/twisted/names/test/test_names.py | 49 | 31329 | # -*- test-case-name: twisted.names.test.test_names -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for twisted.names.
"""
import socket, operator, copy
from twisted.trial import unittest
from twisted.internet import reactor, defer, error
from twisted.internet.de... | apache-2.0 |
openconnectome/m2g | MR-OCP/MROCPdjango/computation/plotting/HBMPlot.py | 2 | 14895 | #!/usr/bin/env python
# Copyright 2014 Open Connectome Project (http://openconnecto.me)
#
# 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
#
#... | apache-2.0 |
arush0311/scrapy | scrapy/mail.py | 12 | 4745 | """
Mail sending helpers
See documentation in docs/topics/email.rst
"""
import logging
from six.moves import cStringIO as StringIO
import six
from email.utils import COMMASPACE, formatdate
from six.moves.email_mime_multipart import MIMEMultipart
from six.moves.email_mime_text import MIMEText
from six.moves.email_mim... | bsd-3-clause |
kaplun/inspire-next | inspirehep/modules/literaturesuggest/__init__.py | 1 | 1056 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | gpl-3.0 |
stinos/micropython | tests/extmod/uasyncio_lock_cancel.py | 16 | 1373 | # Test that locks work when cancelling multiple waiters on the lock
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
async def task(i, lock, lock_flag):
print("task", i, "start")
try:
await l... | mit |
travisjwarren/train_track | train_track/tests/apps/event/test_event_delete_attendee_views.py | 1 | 2680 | __author__ = 'traviswarren'
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from train_track.apps.profile.models import UserProfileEvent
from train_track.tests.model_factory import UserProfileEventFactory
class EventGetDeleteViewTestCases(Tes... | gpl-3.0 |
reinout/django | tests/migrations/test_loader.py | 26 | 19137 | from django.db import connection, connections
from django.db.migrations.exceptions import (
AmbiguityError, InconsistentMigrationHistory, NodeNotFoundError,
)
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.recorder import MigrationRecorder
from django.test import TestCase, modify_... | bsd-3-clause |
kmoocdev/edx-platform | docs/shared/conf.py | 158 | 10580 | # -*- coding: utf-8 -*-
#
# getting_started documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 16 11:19:12 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | agpl-3.0 |
longman694/youtube-dl | youtube_dl/extractor/vube.py | 64 | 6933 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
int_or_none,
ExtractorError,
)
class VubeIE(InfoExtractor):
IE_NAME = 'vube'
IE_DESC = 'Vube.com'
_VALID_URL = r'https?://vube\.com/(?:[^/]+/)+(?P<id... | unlicense |
kleins11/intdatasci-byte2 | jmankoff-mobile/lib/werkzeug/__init__.py | 55 | 6917 | # -*- coding: utf-8 -*-
"""
werkzeug
~~~~~~~~
Werkzeug is the Swiss Army knife of Python web development.
It provides useful classes and functions for any WSGI application to make
the life of a python web developer much easier. All of the provided
classes are independent from each other so yo... | apache-2.0 |
goliate/sarakha63-persomov | couchpotato/core/media/_base/providers/nzb/binnewz/nzbdownloader.py | 7 | 2796 | import urllib2
from StringIO import StringIO
import gzip
import cookielib
import time
class NZBDownloader(object):
def __init__( self ):
self.cj = cookielib.CookieJar()
self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cj))
self.lastRequestTime = None
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.