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
chirilo/mozillians
vendor-local/lib/python/kombu/compression.py
13
2104
""" kombu.compression ================= Compression utilities. :copyright: (c) 2009 - 2012 by Ask Solem. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from kombu.utils.encoding import ensure_bytes, bytes_to_str import zlib _aliases = {} _encoders = {} _decoders = {} __al...
bsd-3-clause
jwren/intellij-community
python/helpers/pycharm/_jb_pytest_runner.py
6
1693
# coding=utf-8 import pytest from distutils import version import sys from _pytest.config import get_plugin_manager from pkg_resources import iter_entry_points from _jb_runner_tools import jb_patch_separator, jb_doc_args, JB_DISABLE_BUFFERING, start_protocol, parse_arguments, \ set_parallel_mode from teamcity import...
apache-2.0
gilneidp/TADD
pox/lib/packet/rip.py
47
6250
# Copyright 2012 James McCauley # Copyright 2008 (C) Nicira, 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 ap...
apache-2.0
MichaelDrogalis/ansible
lib/ansible/module_utils/rax.py
280
11974
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by # Ansible still belong to the author of the module, and may assign their own # license to the complete wo...
gpl-3.0
tp-python-wfaiis/website
tppwebsite/lib/oauth2client/django_orm.py
261
3833
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
bsd-3-clause
rnikiforova/GuruTubeProject
GuruTube/libraries/django/contrib/gis/gdal/envelope.py
221
7049
""" The GDAL/OGR library uses an Envelope structure to hold the bounding box information for a geometry. The envelope (bounding box) contains two pairs of coordinates, one for the lower left coordinate and one for the upper right coordinate: +----------o Upper right; (max_x, max_y) ...
bsd-3-clause
ecomfe/sublime-etpl
etpl.py
2
2730
import os import sys import subprocess import plistlib import re import sublime, sublime_plugin settings = None cwd = os.path.abspath(os.path.dirname(__file__)) PLUGIN_NAME = 'ETPL' template_dir = os.path.join(cwd, 'template') yaml_path = os.path.join(cwd, 'ETPL.YAML-tmLanguage') new_plist_path = os.path.join(cwd, ...
mit
vikatory/kbengine
kbe/res/scripts/common/Lib/lib2to3/fixes/fix_isinstance.py
204
1608
# Copyright 2008 Armin Ronacher. # Licensed to PSF under a Contributor Agreement. """Fixer that cleans up a tuple argument to isinstance after the tokens in it were fixed. This is mainly used to remove double occurrences of tokens as a leftover of the long -> int / unicode -> str conversion. eg. isinstance(x, (int,...
lgpl-3.0
HONGCHAEHEE/TizenRT
external/protobuf/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/generator_test.py
253
11418
#! /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: # # ...
apache-2.0
edx/cookiecutter-django-ida
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/apps/core/tests/test_models.py
1
1676
""" Tests for core models. """ from django.test import TestCase from django_dynamic_fixture import G from social_django.models import UserSocialAuth from {{cookiecutter.repo_name}}.apps.core.models import User class UserTests(TestCase): """ User model tests. """ TEST_CONTEXT = {'foo': 'bar', 'baz': None} ...
apache-2.0
markrawlingson/SickRage
tornado/test/options_test.py
77
8086
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, with_statement import datetime import os import sys from tornado.options import OptionParser, Error from tornado.util import basestring_type from tornado.test.util import unittest try: from cStringIO import StringIO # pyth...
gpl-3.0
russelmahmud/mess-account
django/contrib/comments/models.py
313
7636
import datetime from django.contrib.auth.models import User from django.contrib.comments.managers import CommentManager from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.db import models from django.core im...
bsd-3-clause
denis-guillemenot/pmi_collect
simpleHTTPServer.py
1
1587
# ---------------------------------------------------------------- # name : simpleHTTPServer.py # object: Simple MultiThreaded Web Server # usage: python SimpleHTTPServer [port] / default port: 8080 # author: denis_guillemenot@fr.ibm.com / denis.guillemenot@gmail.com # date : 19/09/2013 # ---------------------------...
mit
sumedh123/debatify
venv/lib/python2.7/site-packages/PIL/ImageColor.py
21
8242
# # The Python Imaging Library # $Id$ # # map CSS3-style colour description strings to RGB # # History: # 2002-10-24 fl Added support for CSS-style color strings # 2002-12-15 fl Added RGBA support # 2004-03-27 fl Fixed remaining int() problems for Python 1.5.2 # 2004-07-19 fl Fixed gray/grey spelling issues # 2...
mit
abusse/cinder
cinder/tests/monkey_patch_example/__init__.py
57
1112
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
theolind/home-assistant
tests/helpers/test_init.py
1
1603
""" tests.test_helpers ~~~~~~~~~~~~~~~~~~~~ Tests component helpers. """ # pylint: disable=protected-access,too-many-public-methods import unittest from common import get_test_home_assistant import homeassistant as ha import homeassistant.loader as loader from homeassistant.const import STATE_ON, STATE_OFF, ATTR_ENT...
mit
sgraham/nope
third_party/webpagereplay/persistentmixin.py
7
1911
#!/usr/bin/env python # Copyright 2010 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
bsd-3-clause
sylvainnizac/Djangoctopus
blog/admin.py
1
2774
# -*- coding: utf8 -*- from django.contrib import admin from blog.models import Categorie, Article, Comment class ArticleAdmin(admin.ModelAdmin): list_display = ('titre', 'auteur', 'date', 'categorie', 'apercu_contenu') list_filter = ('auteur','categorie',) date_hierarchy = 'date' ordering =...
gpl-2.0
varunarya10/nova_test_latest
nova/compute/arch.py
97
3050
# Copyright 2014 Red Hat, 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
cchristelis/inasafe
realtime/test/test_shake_event.py
4
25962
# -*- coding: utf-8 -*- """ InaSAFE Disaster risk assessment tool developed by AusAid and World Bank - **Shake Event Test Cases.** Contact : ole.moller.nielsen@gmail.com .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publishe...
gpl-3.0
michaelhkw/incubator-impala
tests/comparison/data_generator_mapred_common.py
3
4353
# 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
talitalobo/radiola
lib/flask/logging.py
838
1398
# -*- coding: utf-8 -*- """ flask.logging ~~~~~~~~~~~~~ Implements the logging support for Flask. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from logging import getLogger, StreamHandler, Formatter, getLoggerClas...
apache-2.0
GdZ/scriptfile
software/googleAppEngine/lib/django_1_4/django/conf/locale/de/formats.py
329
1288
# -*- encoding: utf-8 -*- # 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:s' DATETIME_FORMAT = 'j. F Y H:i:s' YEAR_MONTH...
mit
sinhrks/numpy
numpy/distutils/lib2def.py
193
3512
from __future__ import division, absolute_import, print_function import re import sys import os import subprocess __doc__ = """This module generates a DEF file from the symbols in an MSVC-compiled DLL import library. It correctly discriminates between data and functions. The data is collected from the output of the...
bsd-3-clause
hanw/p4c-fpga
ext/src/gtest/test/gtest_list_tests_unittest.py
1898
6515
#!/usr/bin/env python # # Copyright 2006, 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...
apache-2.0
argonemyth/sentry
tests/sentry/api/bases/test_organization.py
24
2485
from __future__ import absolute_import from mock import Mock from sentry.api.bases.organization import OrganizationPermission from sentry.models import ApiKey, OrganizationMemberType, ProjectKey from sentry.testutils import TestCase class OrganizationPermissionBase(TestCase): def setUp(self): self.org =...
bsd-3-clause
ax003d/openerp
openerp/report/printscreen/ps_list.py
61
12012
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
googleapis/googleapis-gen
google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/services/services/media_file_service/transports/grpc.py
1
11285
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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
kaihua/Simple_kernel_jlo
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
sharifmamun/ansible
lib/ansible/plugins/lookup/sequence.py
11
7174
# (c) 2013, Jayson Vantuyl <jayson@aggressive.ly> # # 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
40223240/cadb_g3_0420
static/Brython3.1.1-20150328-091302/Lib/imp.py
637
9839
"""This module provides the components needed to build your own __import__ function. Undocumented functions are obsolete. In most cases it is preferred you consider using the importlib module's functionality over this module. """ # (Probably) need to stay in _imp from _imp import (lock_held, acquire_lock, release_lo...
gpl-3.0
mastizada/kuma
vendor/packages/nose/functional_tests/test_doctest_plugin.py
10
1280
import os import unittest from nose.plugins.doctests import Doctest from nose.plugins import PluginTester support = os.path.join(os.path.dirname(__file__), 'support') class TestDoctestPlugin(PluginTester, unittest.TestCase): activate = '--with-doctest' args = ['-v'] plugins = [Doctest()] suitepath = o...
mpl-2.0
derv82/wifite2
wifite/tools/ifconfig.py
1
1784
#!/usr/bin/env python # -*- coding: utf-8 -*- import re from .dependency import Dependency class Ifconfig(Dependency): dependency_required = True dependency_name = 'ifconfig' dependency_url = 'apt-get install net-tools' @classmethod def up(cls, interface, args=[]): '''Put interface up'''...
gpl-2.0
GirlsCodePy/girlscode-coursebuilder
modules/webserv/webserv.py
3
19617
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
gpl-3.0
HalcyonChimera/osf.io
website/project/metadata/schemas.py
1
2265
import os import json LATEST_SCHEMA_VERSION = 2 def _id_to_name(id): return ' '.join(id.split('_')) def _name_to_id(name): return '_'.join(name.split(' ')) def ensure_schema_structure(schema): schema['pages'] = schema.get('pages', []) schema['title'] = schema['name'] schema['version'] = schema.g...
apache-2.0
bala4901/odoo
addons/hr_payroll/report/report_payslip.py
377
1982
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
qma/pants
tests/python/pants_test/backend/jvm/tasks/test_jvm_run.py
5
2368
# 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 import re ...
apache-2.0
megcunningham/django-debug-toolbar
debug_toolbar/panels/sql/views.py
46
4223
from __future__ import absolute_import, unicode_literals from django.http import HttpResponseBadRequest from django.shortcuts import render_to_response from django.views.decorators.csrf import csrf_exempt from debug_toolbar.panels.sql.forms import SQLSelectForm @csrf_exempt def sql_select(request): """Returns t...
bsd-3-clause
freezmeinster/avagata-site
django/contrib/gis/gdal/prototypes/ds.py
311
4244
""" This module houses the ctypes function prototypes for OGR DataSource related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*, OGR_Fld_* routines are relevant here. """ from ctypes import c_char_p, c_double, c_int, c_long, c_void_p, POINTER from django.contrib.gis.gdal.envelope import OGREnvelope from djan...
bsd-3-clause
0x90/python-gsmmodem
gsmmodem/pdu.py
10
32236
# -*- coding: utf8 -*- """ SMS PDU encoding methods """ from __future__ import unicode_literals import sys, codecs, math from datetime import datetime, timedelta, tzinfo from copy import copy from .exceptions import EncodingError # For Python 3 support PYTHON_VERSION = sys.version_info[0] if PYTHON_VERSION >= 3: ...
lgpl-3.0
ashbc/tgrsite
tgrsite/settings.py
1
6161
""" Django settings for tgrsite project. Generated by 'django-admin startproject' using Django 1.10.2. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os...
isc
ximion/limba-hub
lihub/user/views.py
3
1576
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Matthias Klumpp <mak@debian.org> # Copyright (C) 2013 Wilson Xu <imwilsonxu@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 ve...
gpl-3.0
deployed/django
tests/staticfiles_tests/test_liveserver.py
16
3372
""" A subset of the tests in tests/servers/tests exercicing django.contrib.staticfiles.testing.StaticLiveServerCase instead of django.test.LiveServerTestCase. """ import os from django.core.exceptions import ImproperlyConfigured from django.test import override_settings from django.utils.six.moves.urllib.request impo...
bsd-3-clause
Guts/isogeo-api-py-minsdk
isogeo_pysdk/models/metadata.py
1
38320
# -*- coding: UTF-8 -*- #! python3 """ Isogeo API v1 - Model of Metadata (= Resource) entity See: http://help.isogeo.com/api/complete/index.html#definition-resource """ # ############################################################################# # ########## Libraries ############# # #####################...
gpl-3.0
moonboots/tensorflow
tensorflow/python/training/tensorboard_logging_test.py
7
4320
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
davidmueller13/kernel_samsung_trelte
Documentation/target/tcm_mod_builder.py
2358
40707
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
prashanthr/wakatime
wakatime/packages/pygments_py2/pygments/styles/vim.py
135
1976
# -*- coding: utf-8 -*- """ pygments.styles.vim ~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by vim. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keywor...
bsd-3-clause
pastebt/you-get
src/you_get/extractors/baidu.py
19
4236
#!/usr/bin/env python # -*- coding: utf-8 -*- __all__ = ['baidu_download'] from ..common import * from urllib import parse def baidu_get_song_data(sid): data = json.loads(get_html('http://music.baidu.com/data/music/fmlink?songIds=%s' % sid, faker = True))['data'] if data['xcode'] != '': # inside ch...
mit
jh23453/privacyidea
tests/test_lib_tokens_hotp.py
2
28489
""" This test file tests the lib.tokenclass The lib.tokenclass depends on the DB model and lib.user """ PWFILE = "tests/testdata/passwords" from .base import MyTestCase from privacyidea.lib.resolver import (save_resolver) from privacyidea.lib.realm import (set_realm) from privacyidea.lib.user import (User) from priva...
agpl-3.0
Yupeek/django-dynamic-logging
dynamic_logging/scheduler.py
1
8574
# -*- coding: utf-8 -*- import functools import logging import threading from django.db.utils import ProgrammingError from django.utils import timezone from dynamic_logging.models import Trigger logger = logging.getLogger(__name__) class Scheduler(object): """ a special class that keep trace of the next ev...
agpl-3.0
gazpachoking/deluge-old
deluge/ui/client.py
5
26991
# # client.py # # Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com> # Copyright (C) 2011 Pedro Algarvio <pedro@algarvio.me> # # Deluge is free software. # # You may redistribute it and/or modify it under the terms of the # GNU General Public License, as published by the Free Software # Foundation; either version ...
gpl-3.0
lochiiconnectivity/exabgp
lib/exabgp/configuration/engine/tokeniser.py
1
3330
# encoding: utf-8 """ tokeniser.py Created by Thomas Mangin on 2014-06-22. Copyright (c) 2014-2015 Exa Networks. All rights reserved. """ from exabgp.util import coroutine from exabgp.configuration.engine.location import Location from exabgp.configuration.engine.raised import Raised # convert special caracters @cor...
bsd-3-clause
sightmachine/SimpleCV
SimpleCV/Features/MorphologyFeatureExtractor.py
13
3284
from SimpleCV.base import * from SimpleCV.ImageClass import Image from SimpleCV.Features.FeatureExtractorBase import * from SimpleCV.Features.BlobMaker import * class MorphologyFeatureExtractor(FeatureExtractorBase): """ This feature extractor collects some basic morphology infromation about a given image....
bsd-3-clause
jalavik/invenio
invenio/ext/assets/__init__.py
22
1989
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2012, 2013, 2014, 2015 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 o...
gpl-2.0
stephendade/ardupilot
Tools/LogAnalyzer/tests/TestCompass.py
66
6392
from LogAnalyzer import Test,TestResult import DataflashLog from functools import reduce import math class TestCompass(Test): '''test for compass offsets and throttle interference''' def __init__(self): Test.__init__(self) self.name = "Compass" def run(self, logdata, verbose): s...
gpl-3.0
tmilicic/networkx
networkx/classes/function.py
1
16409
"""Functional interface to graph methods and assorted utilities. """ # Copyright (C) 2004-2015 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # import networkx as nx from networkx.utils import not_implemente...
bsd-3-clause
clintonblackmore/enchanting2
factory.py
1
1388
"""factory.py lets you deserialize an unknown type from XML""" import xml.etree.cElementTree as ElementTree import data import script import media import actor def deserialize_value(element, *args): """Get an object representing this element, be it a literal, list or what-not""" class_map = { "...
agpl-3.0
ESS-LLP/erpnext-healthcare
erpnext/hr/doctype/salary_slip/salary_slip.py
1
34819
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, erpnext import datetime from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words, getdate from fr...
gpl-3.0
velo/dockerfiles
sentry/sentry.conf.py
27
2467
import os.path import os CONF_ROOT = os.path.dirname(__file__) database_name = os.environ.get('SENTRY_NAME', 'sentry') database_user = os.environ.get('SENTRY_USER', 'sentry') database_password = os.environ.get('SENTRY_PASS', 'sentry') database_host = os.environ.get('SENTRY_HOST', '127.0.0.1') database_port = os.envir...
mit
sakuramilk/linux-3.0.y
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
keithroe/vtkoptix
Filters/Sources/Testing/Python/coneResolution.py
20
1956
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # create a rendering window and renderer ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(r...
bsd-3-clause
SISC2014/JobAnalysis
MongoRetrieval/src/EfficiencyHistogram.py
1
6076
''' Created on Jun 19, 2014 @author: Erik Halperin List of Keys _id JobStartDate Requirements TransferInput TotalSuspensions LastJobStatus BufferBlockSize OrigMaxHosts RequestMemory WantRemoteSyscalls LastHoldReasonCode ExitStatus Args JobFinishedHookDone JobCurrentStartDate CompletionDate JobLeaseDuration Err Remote...
mit
chrislyon/dj_ds1
static/Brython3.2.0-20150701-214155/Lib/test/unittests/test_compile.py
38
19068
import unittest import sys import _ast import types from test import support class TestSpecifics(unittest.TestCase): def compile_single(self, source): compile(source, "<single>", "single") def assertInvalidSingle(self, source): self.assertRaises(SyntaxError, self.compile_single, source) ...
gpl-2.0
freedesktop-unofficial-mirror/ldtp__ldtp2
ldtpd/constants.py
3
2643
""" LDTP v2 constants. @author: Eitan Isaacson <eitan@ascender.com> @author: Nagappan Alagappan <nagappan@gmail.com> @copyright: Copyright (c) 2009 Eitan Isaacson @copyright: Copyright (c) 2009-13 Nagappan Alagappan @license: LGPL http://ldtp.freedesktop.org This file may be distributed and/or modified under the ter...
lgpl-2.1
fr34k8/atomic-reactor
tests/test_cli.py
5
5147
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import print_function, unicode_literals import logging import os import sys import pytest from atomic_reactor.buildimage i...
bsd-3-clause
GDGLima/contentbox
third_party/social/tests/backends/test_skyrock.py
92
1343
import json from social.p3 import urlencode from social.tests.backends.oauth import OAuth1Test class SkyrockOAuth1Test(OAuth1Test): backend_path = 'social.backends.skyrock.SkyrockOAuth' user_data_url = 'https://api.skyrock.com/v2/user/get.json' expected_username = 'foobar' access_token_body = json.du...
apache-2.0
vheon/ycmd
ycmd/tests/utils_test.py
2
18523
# Copyright (C) 2016-2020 ycmd contributors. # # This file is part of ycmd. # # ycmd 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. # ...
gpl-3.0
openprocurement/openprocurement.edge
openprocurement/edge/views/auctions.py
1
7066
# -*- coding: utf-8 -*- from functools import partial from openprocurement.edge.utils import ( context_unpack, decrypt, encrypt, APIResource, json_view ) from openprocurement.edge.utils import eaopresource from openprocurement.edge.design import ( by_dateModified_view_ViewDefinition, real_b...
apache-2.0
IhToN/DAW1-PRG
Ejercicios/SeguTrim/Objetos/Punto.py
1
4377
""" Clase Punto coord x coord y suma(punto) resta(punto) Clase Traza instancias Punto en una Lista añadir punto comparar dos trazas (dos trazas serán iguales si sus puntos son iguales) """ import math import turtle class Punto: def __init__(self, x...
apache-2.0
jimi-c/ansible
lib/ansible/modules/network/avi/avi_api_session.py
46
8314
#!/usr/bin/python """ # Created on Aug 12, 2016 # # @author: Gaurav Rastogi (grastogi@avinetworks.com) GitHub ID: grastogi23 # # module_check: not supported # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # "...
gpl-3.0
alexfalcucc/anaconda
anaconda_lib/jedi/parser/pgen2/grammar.py
49
4691
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. # Modifications: # Copyright 2014 David Halter. Integration into Jedi. # Modifications are dual-licensed: MIT and PSF. """This module defines the data structures used to represent a grammar. These are...
gpl-3.0
cloud9UG/odoo
addons/sale/__openerp__.py
221
3467
# -*- 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
ricktaylord/django-filebrowser
filebrowser/tests/test_settings.py
15
3224
# coding: utf-8 # PYTHON IMPORTS import os # DJANGO IMPORTS from django.test import TestCase from django.contrib.auth.models import User # FILEBROWSER IMPORTS from filebrowser.settings import * class SettingsTests(TestCase): def setUp(self): pass def test_media_root(self): """ Tes...
bsd-3-clause
slagle/ansible-modules-extras
packaging/os/zypper_repository.py
73
9155
#!/usr/bin/python # encoding: utf-8 # (c) 2013, Matthias Vogelgesang <matthias.vogelgesang@gmail.com> # (c) 2014, Justin Lecher <jlec@gentoo.org> # # 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 #...
gpl-3.0
markYoungH/chromium.src
tools/telemetry/telemetry/web_perf/metrics/layout.py
14
2317
# 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 math from telemetry.value import scalar from telemetry.web_perf.metrics import timeline_based_metric class LayoutMetric(timeline_based_metric.Timeli...
bsd-3-clause
HesselTjeerdsma/Cyber-Physical-Pacman-Game
Algor/flask/lib/python2.7/site-packages/scipy/optimize/tests/test_optimize.py
9
48877
""" Unit tests for optimization routines from optimize.py Authors: Ed Schofield, Nov 2005 Andrew Straw, April 2008 To run it in its simplest form:: nosetests test_optimize.py """ from __future__ import division, print_function, absolute_import import warnings import itertools import numpy as np from numpy....
apache-2.0
pmediano/ComputationalNeurodynamics
Fall2016/Exercise_1/Solutions/IzNeuronRK4.py
1
1897
""" Computational Neurodynamics Exercise 1 Simulates Izhikevich's neuron model using the Runge-Kutta 4 method. Parameters for regular spiking, fast spiking and bursting neurons extracted from: http://www.izhikevich.org/publications/spikes.htm (C) Murray Shanahan et al, 2016 """ import numpy as np import matplotlib....
gpl-3.0
adhoc-dev/odoo-addons
project_task_contract/__openerp__.py
4
1571
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
agpl-3.0
jkettleb/iris
lib/iris/tests/test_cube_to_pp.py
1
15153
# (C) British Crown Copyright 2010 - 2015, Met Office # # This file is part of Iris. # # Iris 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 l...
lgpl-3.0
z-fork/scrapy
scrapy/loader/processors.py
145
2850
""" This module provides some commonly used processors for Item Loaders. See documentation in docs/topics/loaders.rst """ from scrapy.utils.misc import arg_to_iter from scrapy.utils.datatypes import MergeDict from .common import wrap_loader_context class MapCompose(object): def __init__(self, *functions, **def...
bsd-3-clause
joshuahoman/vivisect
PE/ordlookup/comctl32.py
11
3028
ord_names = { 2:'MenuHelp', 3:'ShowHideMenuCtl', 4:'GetEffectiveClientRect', 5:'DrawStatusTextA', 6:'CreateStatusWindowA', 7:'CreateToolbar', 8:'CreateMappedBitmap', 12:'CreatePropertySheetPage', 13:'MakeDragList', 14:'LBItemFromPt', 15:'DrawInsert', 16:'CreateUpDownContr...
apache-2.0
campbe13/openhatch
vendor/packages/twisted/twisted/conch/test/test_cftp.py
17
34378
# -*- test-case-name: twisted.conch.test.test_cftp -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE file for details. """ Tests for L{twisted.conch.scripts.cftp}. """ import locale import time, sys, os, operator, getpass, struct from StringIO import StringIO from twisted.conch.test.test_ssh i...
agpl-3.0
guettli/django
tests/gis_tests/geoapp/test_functions.py
8
23409
from __future__ import unicode_literals import re from decimal import Decimal from django.contrib.gis.db.models import functions from django.contrib.gis.geos import LineString, Point, Polygon, fromstr from django.contrib.gis.measure import Area from django.db import connection from django.db.models import Sum from dj...
bsd-3-clause
BenBoZ/hexaco
Engine/Components/tst/Test_PositionComponent.py
1
4037
""" This file is part of HexACO. HexACO 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. HexACO is distributed in t...
gpl-3.0
davidvon/pipa-pay-server
site-packages/pbr/version.py
13
3517
# Copyright 2012 OpenStack Foundation # Copyright 2012-2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.ap...
apache-2.0
cgoldberg/locust
locust/test/test_taskratio.py
6
2063
import unittest from locust.core import Locust, TaskSet, task from locust.inspectlocust import get_task_ratio_dict class TestTaskRatio(unittest.TestCase): def test_task_ratio_command(self): class Tasks(TaskSet): @task def root_task1(self): pass ...
mit
RaminderSinghSahni/micro-ram-bot
tasks.py
1
4411
#!/usr/bin/env python # -*- coding: utf-8 -*- from microsoftbotframework import Response import celery import os import sys import json # import argparse from google.cloud import language import google.auth # import language try: import apiai except ImportError: sys.path.append(os.path.join(os.path.dirname(os...
mit
laonawuli/addrest
web2py/gluon/streamer.py
15
4461
#!/usr/bin/env python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Facilities to handle file streaming ------------------------------------ """ import os import stat i...
mit
RAPD/RAPD
src/old_agents/subcontractors/xdsme/new/xdsme-0.4.9/XOconv/dnz2xds.py
10
3997
#!/usr/bin/env python """ 20/09/04 1st version pierre.legrand \at synchrotron-soleil.fr Note: This program assum that the most commons XDS frame is choosen (see the distributed XDS input files): Beam is along the Z axis, Y axis point verticaly down (like gravity), and the X ax...
agpl-3.0
malcolmwhite/DungeonsAndDragons
src/test/managers/test_model_conflict_manager.py
1
3021
from unittest import TestCase from itertools import permutations from src.main.managers.players.hard_coded_player_manager import HardCodedPlayerManager from src.main.managers.conflict.hard_coded_example_conflict_manager import HardCodedExampleConflictManager from src.main.managers.conflict.automated_conflict_manager i...
mit
petersanchez/django-allauth
allauth/account/managers.py
15
2412
from datetime import timedelta from django.utils import timezone from django.db import models from django.db.models import Q from . import app_settings class EmailAddressManager(models.Manager): def add_email(self, request, user, email, confirm=False, signup=False): try: ...
mit
govarguz/espressopp
contrib/mpi4py/mpi4py-2.0.0/demo/vampirtrace/cpilog.py
9
1072
#!/usr/bin/env python # If you want VampirTrace to log MPI calls, you have to add the two # lines below at the very beginning of your main bootstrap script. import mpi4py mpi4py.rc.threads = False mpi4py.profile('vt', logfile='cpilog') # Import the MPI extension module from mpi4py import MPI # Import the 'array' mod...
gpl-3.0
ooici/marine-integrations
mi/dataset/test/test_single_dir_harvester.py
1
22218
#!/usr/bin/env python """ @package mi.dataset.test.test_single_dir_harvester.py @file mi/dataset/test/test_single_dir_harvester.py @author Emily Hahn @brief Test code to exercize the single directory harvester """ import os import glob import gevent import time import shutil import hashlib from mi.core.log import get...
bsd-2-clause
mickele77/FreeCAD
src/Mod/Arch/importIFClegacy.py
14
98586
#*************************************************************************** #* * #* Copyright (c) 2011 * #* Yorik van Havre <yorik@uncreated.net> * #* ...
lgpl-2.1
Russell-Jones/django-wiki
wiki/editors/markitup.py
3
2654
# -*- coding: utf-8 from __future__ import unicode_literals from django import forms from django.forms.util import flatatt try: from django.utils.encoding import force_unicode except ImportError: def force_unicode(x): return(x) from django.utils.html import conditional_escape from django.utils.safestrin...
gpl-3.0
orlenko/sfpirg
sfpirgapp/migrations/0022_auto__del_field_organization_mailing_address__add_field_organization_m.py
1
25180
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Organization.mailing_address' db.delete_column(u'sfpirgapp_organization', 'mailing_address...
bsd-2-clause
QudevETH/PycQED_py3
pycqed/simulations/chevron_sim.py
1
2373
""" Based on Olli's mathematica notebook used to simulate chevrons """ import numpy as np from scipy.linalg import expm ham = lambda e, g: np.array([[0.5*e, g], [g, -0.5*e]]) evol = lambda e, g, dt: expm(dt*1j*ham(e, g)) def rabisim(efun, g, t, dt): """ This function returns the evolution of a system descri...
mit
rouge8/moto
moto/ec2/responses/availability_zones_and_regions.py
14
1517
from __future__ import unicode_literals from moto.core.responses import BaseResponse class AvailabilityZonesAndRegions(BaseResponse): def describe_availability_zones(self): zones = self.ec2_backend.describe_availability_zones() template = self.response_template(DESCRIBE_ZONES_RESPONSE) ret...
apache-2.0
theoryno3/gensim
gensim/test/test_models.py
1
26406
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for checking transformation algorithms (the models package). """ import logging import unittest import os import o...
gpl-3.0
jpablo128/TinCanPython
test/attachment_test.py
2
16412
# Copyright 2014 Rustici Software # # 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...
apache-2.0