repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
h4r5h1t/django-hauthy
tests/sitemaps_tests/urls/http.py
13
4302
from datetime import date, datetime from django.conf.urls import url from django.conf.urls.i18n import i18n_patterns from django.contrib.sitemaps import ( FlatPageSitemap, GenericSitemap, Sitemap, views, ) from django.http import HttpResponse from django.utils import timezone from django.views.decorators.cache imp...
bsd-3-clause
apporc/nova
nova/tests/unit/scheduler/filters/test_aggregate_instance_extra_specs_filters.py
16
4167
# 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
astuanax/django-postman
setup.py
1
1250
from setuptools import find_packages, setup setup( name='django-postman', version=__import__('postman').__version__, description='User-to-User messaging system for Django, with gateway to AnonymousUser,' \ ' moderation and thread management, user & exchange filters, inbox/sent/archives/trash folder...
bsd-3-clause
vivaxy/algorithms
python/problems/bulb_switcher_ii.py
1
2150
""" https://leetcode.com/problems/bulb-switcher-ii/ https://leetcode.com/submissions/detail/140962396/ """ class Solution1: def flipLights(self, n, m): """ :type n: int :type m: int :rtype: int """ def flipEvery(x, index): return not x def flip...
mit
kevin-teddy/gajim
src/common/crypto.py
2
2816
# common crypto functions (mostly specific to XEP-0116, but useful elsewhere) # -*- coding:utf-8 -*- ## src/common/crypto.py ## ## Copyright (C) 2007 Brendan Taylor <whateley AT gmail.com> ## ## This file is part of Gajim. ## ## Gajim is free software; you can redistribute it and/or modify ## it under the terms of the ...
gpl-3.0
garethsaxby/python_koans
python3/koans/about_monkey_patching.py
13
1355
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Related to AboutOpenClasses in the Ruby Koans # from runner.koan import * class AboutMonkeyPatching(Koan): class Dog: def bark(self): return "WOOF" def test_as_defined_dogs_do_bark(self): fido = self.Dog() self.assertEqual...
mit
snahelou/awx
awx/main/south_migrations/0065_v220_changes.py
1
59856
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'JobTemplate.become_enabled' db.add_column(u'main_jobtempl...
apache-2.0
GuessWhoSamFoo/pandas
pandas/tests/util/test_validate_kwargs.py
2
2040
# -*- coding: utf-8 -*- from collections import OrderedDict import pytest from pandas.util._validators import validate_bool_kwarg, validate_kwargs _fname = "func" def test_bad_kwarg(): good_arg = "f" bad_arg = good_arg + "o" compat_args = OrderedDict() compat_args[good_arg] = "foo" compat_args...
bsd-3-clause
edx/edx-platform
openedx/core/djangoapps/catalog/management/commands/tests/test_create_catalog_integrations.py
4
3596
""" Test cases for catalog_integrations command. """ import pytest from django.core.management import call_command, CommandError from openedx.core.djangolib.testing.utils import CacheIsolationTestCase from openedx.core.djangoapps.catalog.models import CatalogIntegration from openedx.core.djangoapps.catalog.tests.mixi...
agpl-3.0
dol-sen/gentoolkit
pym/gentoolkit/eshowkw/keywords_header.py
2
3622
# vim:fileencoding=utf-8 # Copyright 2001-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 __all__ = ['keywords_header'] from portage import settings as ports from portage.output import colorize from gentoolkit.eshowkw.display_pretty import colorize_string from gentoolkit.esho...
gpl-2.0
ninjablocks/kernel-VAR-SOM-AMxx
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
quoclieu/codebrew17-starving
env/lib/python3.5/site-packages/Crypto/Cipher/_mode_ccm.py
4
22663
# =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributio...
mit
FFMG/myoddweb.piger
monitor/api/python/Python-3.7.2/Lib/pipes.py
172
8916
"""Conversion pipeline templates. The problem: ------------ Suppose you have some data that you want to convert to another format, such as from GIF image format to PPM image format. Maybe the conversion involves several steps (e.g. piping it through compress or uuencode). Some of the conversion steps may require th...
gpl-2.0
selste/micropython
py/makecompresseddata.py
14
6800
from __future__ import print_function import collections import re import sys import gzip import zlib _COMPRESSED_MARKER = 0xFF def check_non_ascii(msg): for c in msg: if ord(c) >= 0x80: print( 'Unable to generate compressed data: message "{}" contains a non-ascii character...
mit
GbalsaC/bitnamiP
common/djangoapps/track/backends/django.py
102
2282
""" Event tracker backend that saves events to a Django database. """ # TODO: this module is very specific to the event schema, and is only # brought here for legacy support. It should be updated when the # schema changes or eventually deprecated. from __future__ import absolute_import import logging from django.d...
agpl-3.0
mmahut/openshift-ansible
roles/lib_openshift/src/ansible/oc_pvc.py
60
1107
# pylint: skip-file # flake8: noqa #pylint: disable=too-many-branches def main(): ''' ansible oc module for pvc ''' module = AnsibleModule( argument_spec=dict( kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'), state=dict(default='present', type...
apache-2.0
QuickSander/CouchPotatoServer
couchpotato/core/notifications/pushbullet.py
32
3088
import base64 import json from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable import splitString from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification log = CPLog(__name__) autoload = 'Pushbullet' class Pushbullet(Notifica...
gpl-3.0
Lektorium-LLC/edx-platform
lms/djangoapps/certificates/management/commands/create_fake_cert.py
5
3521
"""Utility for testing certificate display. This command will create a fake certificate for a user in a course. The certificate will display on the student's dashboard, but no PDF will be generated. Example usage: $ ./manage.py lms create_fake_cert test_user edX/DemoX/Demo_Course --mode honor --grade 0.89 """ ...
agpl-3.0
DavidLP/home-assistant
homeassistant/components/velbus/climate.py
6
1975
"""Support for Velbus thermostat.""" import logging from homeassistant.components.climate import ClimateDevice from homeassistant.components.climate.const import ( STATE_HEAT, SUPPORT_TARGET_TEMPERATURE) from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT from . import DOMAIN as VELBUS...
apache-2.0
binhex/moviegrabber
lib/site-packages/cherrypy/test/test_json.py
42
2541
import cherrypy from cherrypy.test import helper from cherrypy._cpcompat import json class JsonTest(helper.CPWebCase): def setup_server(): class Root(object): def plain(self): return 'hello' plain.exposed = True def json_string(self): re...
gpl-3.0
bpsinc-native/src_tools_gyp
test/rules-rebuild/gyptest-all.py
351
1662
#!/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 that a rule that generates multiple outputs rebuilds correctly when the inputs change. """ import TestGyp test = TestGyp.Test...
bsd-3-clause
yosukesuzuki/calendar-app
project/kay/management/utils.py
5
1772
# -*- coding: utf-8 -*- """ Kay framework. :Copyright: (c) 2009 Takashi Matsuo <tmatsuo@candit.jp> All rights reserved. :license: BSD, see LICENSE for more details. """ import sys import getpass from google.appengine.ext.remote_api import remote_api_stub import kay.app from kay.misc import get_appid def print_sta...
mit
tarequeh/django-modular-blog
fragments/constants.py
2
1514
""" Values that are used throughout the app """ FRAGMENT_TYPE_PLAINTEXT = 'plaintext' FRAGMENT_TYPE_HTML = 'html' FRAGMENT_TYPE_MARKDOWN = 'markdown' FRAGMENT_TYPE_IMAGE = 'image' FRAGMENT_TYPE_CODE = 'code' FRAGMENT_TYPE_EMBED = 'embed' FRAGMENT_TYPE_CHOICES = ( (FRAGMENT_TYPE_PLAINTEXT, 'Plaintext'), (FRAGM...
mit
DavidTingley/ephys-processing-pipeline
installation/klustaviewa-0.3.0/build/lib.linux-x86_64-2.7/klustaviewa/views/treemodel.py
2
7148
from qtools import QtGui, QtCore from collections import OrderedDict # Generic classes # --------------- class TreeItem(object): def __init__(self, parent=None, data=None): """data is an OrderedDict""" self.parent_item = parent self.index = QtCore.QModelIndex() self.childr...
gpl-3.0
Bismarrck/tensorflow
tensorflow/python/data/experimental/kernel_tests/parallel_interleave_test.py
10
28891
# 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
dd00/commandergenius
project/jni/python/src/Lib/test/profilee.py
398
3041
""" Input for test_profile.py and test_cprofile.py. IMPORTANT: This stuff is touchy. If you modify anything above the test class you'll have to regenerate the stats by running the two test files. *ALL* NUMBERS in the expected output are relevant. If you change the formatting of pstats, please don't just regenerate t...
lgpl-2.1
tech-server/gondul
templating/templating.py
1
3215
#!/usr/bin/python3 import argparse import traceback import sys import netaddr import requests from flask import Flask, request from jinja2 import Environment, FileSystemLoader, TemplateNotFound endpoints = "read/networks read/oplog read/snmp read/switches-management public/distro-tree public/config public/dhcp publ...
gpl-2.0
diogovk/ansible
contrib/inventory/zabbix.py
119
3956
#!/usr/bin/env python # (c) 2013, Greg Buehler # # 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 ve...
gpl-3.0
BackupTheBerlios/cuon-svn
cuon_client/cuon/Misc/cuon_dialog.py
5
1297
import gtk import pygtk class cuon_dialog: def __init__(self): # Dialog - Flags # DIALOG_MODAL - make the dialog modal # DIALOG_DESTROY_WITH_PARENT - destroy dialog when its parent is destroyed # DIALOG_NO_SEPARATOR - omit the separator between the vbox and the action_area ...
gpl-3.0
markwal/OctoPrint
src/octoprint/plugins/softwareupdate/scripts/update-octoprint.py
30
6010
#!/bin/env python from __future__ import absolute_import __author__ = "Gina Haeussge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" import errno import su...
agpl-3.0
shubhamgupta2021/atomic
Atomic/config.py
4
1724
import os try: import ConfigParser as configparser except ImportError: # py3 compat import configparser class PulpConfig(object): """ pulp configuration: 1. look in ~/.pulp/admin.conf configuration contents: [server] host = <pulp-server-hostname.example.com> verify_ssl = false ...
lgpl-2.1
fanquake/bitcoin
test/functional/wallet_labels.py
6
8597
#!/usr/bin/env python3 # Copyright (c) 2016-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test label RPCs. RPCs tested are: - getaddressesbylabel - listaddressgroupings - setlabel ...
mit
zerkrx/zerkbox
lib/pip/vcs/git.py
340
11197
from __future__ import absolute_import import logging import tempfile import os.path from pip.compat import samefile from pip.exceptions import BadCommand from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor.six.moves.urllib import request as urllib_request from pip._vendor.packaging.versio...
gpl-3.0
cedi4155476/QGIS
python/plugins/processing/algs/qgis/LinesIntersection.py
10
5061
# -*- coding: utf-8 -*- """ *************************************************************************** LinesIntersection.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *********************...
gpl-2.0
chemlab/chemlab
chemlab/mviewer/api/display.py
6
4689
from chemlab.mviewer.representations import BallAndStickRepresentation from chemlab.graphics.qttrajectory import format_time from .core import * from chemlab.db import CirDB from chemlab.io import datafile from chemlab.core import System import numpy as np db = CirDB() def display_system(system, autozoom=True): ...
gpl-3.0
mateor/pants
tests/python/pants_test/engine/test_isolated_process.py
2
10203
# coding=utf-8 # Copyright 2016 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 uni...
apache-2.0
afrolov1/nova
nova/api/openstack/compute/plugins/v3/deferred_delete.py
17
3215
# 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
Ex-Mente/auxi.0
auxi/tools/materialphysicalproperties/coals.py
1
5954
#!/usr/bin/env python3 """ This module provides physical property data sets and models for coals and cokes. """ from sys import modules from os.path import realpath, dirname, join from math import exp from auxi.tools.materialphysicalproperties.core import Model from auxi.tools.chemistry.stoichiometry import molar_mas...
lgpl-3.0
vijayanandnandam/youtube-dl
test/test_socks.py
50
3500
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import random import subprocess from test.helper import ( FakeYDL, get_params, ) from you...
unlicense
zlfben/gem5
src/arch/x86/isa/insts/general_purpose/data_transfer/move.py
40
9122
# Copyright (c) 2007-2008 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware imp...
bsd-3-clause
adw0rd/lettuce
tests/integration/lib/Django-1.3/django/contrib/auth/tests/tokens.py
227
3416
from datetime import date, timedelta from django.conf import settings from django.contrib.auth.models import User, AnonymousUser from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.test import TestCase class TokenGeneratorTest(TestCase): def test_make_token(self): """ ...
gpl-3.0
narurien/ganeti-ceph
test/py/ganeti.storage.drbd_unittest.py
1
17356
#!/usr/bin/python # # Copyright (C) 2006, 2007, 2010, 2012, 2013 Google 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 2 of the License, or # (at your option) any later v...
gpl-2.0
wkschwartz/django
tests/utils_tests/test_archive.py
1
3026
import os import stat import sys import tempfile import unittest from django.core.exceptions import SuspiciousOperation from django.test import SimpleTestCase from django.utils import archive class TestArchive(unittest.TestCase): def setUp(self): self.testdir = os.path.join(os.path.dirname(__file__), 'a...
bsd-3-clause
StevenSLXie/tinyble
build/lib/tinyble/query.py
2
14812
""" Contains the querying interface. Starting with :class:`~tinydb.queries.Query` you can construct complex queries: >>> ((where('f1') == 5) & (where('f2') != 2)) | where('s').matches(r'^\w+$') (('f1' == 5) and ('f2' != 2)) or ('s' ~= ^\w+$ ) Queries are executed by using the ``__call__``: >>> q = where('val') == 5 >>>...
mit
wwf5067/statsmodels
statsmodels/graphics/dotplots.py
31
18190
import numpy as np from statsmodels.compat import range from . import utils def dot_plot(points, intervals=None, lines=None, sections=None, styles=None, marker_props=None, line_props=None, split_names=None, section_order=None, line_order=None, stacked=False, styles_order=None, s...
bsd-3-clause
Mirantis/tempest
tempest/services/volume/json/extensions_client.py
1
1222
# 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
SnappleCap/oh-mainline
vendor/packages/Django/django/contrib/formtools/tests/wizard/forms.py
90
7721
from __future__ import unicode_literals from django import forms, http from django.conf import settings from django.db import models from django.test import TestCase from django.template.response import TemplateResponse from django.utils.importlib import import_module from django.contrib.auth.models import User from...
agpl-3.0
sujeet4github/MyLangUtils
LangPython/oreilly-intro-to-flask-video/venv/lib/python3.6/site-packages/pip/commands/check.py
336
1382
import logging from pip.basecommand import Command from pip.operations.check import check_requirements from pip.utils import get_installed_distributions logger = logging.getLogger(__name__) class CheckCommand(Command): """Verify installed packages have compatible dependencies.""" name = 'check' usage =...
gpl-3.0
windyuuy/opera
chromium/src/tools/gyp/test/win/gyptest-cl-debug-format.py
344
1270
#!/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. """ Make sure debug format settings are extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.Te...
bsd-3-clause
pratikmallya/heat
heat/engine/resources/openstack/nova/nova_floatingip.py
2
5929
# # 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 # ...
apache-2.0
JeremyRand/bitcoin
qa/rpc-tests/walletbackup.py
132
7263
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Exercise the wallet backup code. Ported from walletbackup.sh. Test case is: 4 nodes. 1 2 and 3 send tran...
mit
forge33/CouchPotatoServer
libs/requests/packages/urllib3/connection.py
371
8967
import datetime import sys import socket from socket import timeout as SocketTimeout import warnings from .packages import six try: # Python 3 from http.client import HTTPConnection as _HTTPConnection, HTTPException except ImportError: from httplib import HTTPConnection as _HTTPConnection, HTTPException cla...
gpl-3.0
xlk521/cloudguantou
django/contrib/admin/validation.py
153
19088
from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.fields import FieldDoesNotExist from django.forms.models import (BaseModelForm, BaseModelFormSet, fields_for_model, _get_foreign_key) from django.contrib.admin.util import get_fields_from_path, NotRelationFiel...
bsd-3-clause
alextruberg/custom_django
django/conf/locale/sl/formats.py
200
2120
# -*- 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 = 'd. F Y' TIME_FORMAT = 'H:i:s' DAT...
bsd-3-clause
tudyzhb/yichui
djangoappengine/main/__init__.py
53
2627
import os import sys # Add parent folder to sys.path, so we can import boot. # App Engine causes main.py to be reloaded if an exception gets raised # on the first request of a main.py instance, so don't add project_dir # multiple times. project_dir = os.path.abspath( os.path.dirname(os.path.dirname(os.path.dirnam...
bsd-3-clause
Shougo/python-client
pynvim/api/window.py
2
1983
"""API for working with Nvim windows.""" from pynvim.api.common import Remote __all__ = ('Window') class Window(Remote): """A remote Nvim window.""" _api_prefix = "nvim_win_" @property def buffer(self): """Get the `Buffer` currently being displayed by the window.""" return self.re...
apache-2.0
gkotton/neutron
neutron/tests/unit/test_extension_ext_net.py
10
7932
# Copyright (c) 2013 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...
apache-2.0
thresholdsoftware/asylum
openerp/addons/account/wizard/account_report_aged_partner_balance.py
48
4072
# -*- 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
smallswan267/octoplus
selenium/webdriver/ie/service.py
16
3920
#!/usr/bin/python # # Copyright 2012 Webdriver_name committers # Copyright 2012 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 ...
mit
mbox/django
tests/raw_query/models.py
150
1034
from django.db import models class Author(models.Model): first_name = models.CharField(max_length=255) last_name = models.CharField(max_length=255) dob = models.DateField() def __init__(self, *args, **kwargs): super(Author, self).__init__(*args, **kwargs) # Protect against annotations...
bsd-3-clause
rbalda/neural_ocr
env/lib/python2.7/site-packages/django/core/handlers/base.py
77
13346
from __future__ import unicode_literals import logging import sys import types import warnings from django import http from django.conf import settings from django.core import signals, urlresolvers from django.core.exceptions import ( MiddlewareNotUsed, PermissionDenied, SuspiciousOperation, ) from django.db impo...
mit
romanz/trezor-mcu
gen/bitmaps/generate.py
3
1293
#!/usr/bin/env python from __future__ import print_function import glob import os from PIL import Image hdrs = [] data = [] imgs = [] def encode_pixels(img): r = '' img = [ (x[0] + x[1] + x[2] > 384 and '1' or '0') for x in img] for i in range(len(img) // 8): c = ''.join(img[i * 8 : i * 8 + 8]) r += '0x%02x, '...
lgpl-3.0
elazarg/pythia
type_analysis/test_type_safety.py
1
3619
import type_analysis def all_tests(): basic_tests() def basic_tests(): # basic addition with variables assert type_analysis.analyze_type_safety("x = 1; y = 1; z = x + y") == True assert type_analysis.analyze_type_safety("x = 'r'; y = 'r'; z = x + y") == True assert type_analysis.analyze_type_safet...
mit
PXke/invenio
invenio/legacy/bibdocfile/icon_migration_kit.py
4
6992
## This file is part of Invenio. ## Copyright (C) 2010, 2011 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 version. ## ...
gpl-2.0
jesramirez/odoo
addons/web_analytics/__openerp__.py
305
1432
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 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
openfun/edx-platform
common/djangoapps/student/migrations/0009_auto__del_courseregistration__add_courseenrollment.py
188
10452
# -*- 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 model 'CourseRegistration' db.delete_table('student_courseregistration') # Adding model ...
agpl-3.0
pydoit/doit
doc/tutorial/tuto_1_1.py
2
1314
import pathlib import pygraphviz def task_imports(): """find imports from a python module""" return { 'file_dep': ['projects/requests/requests/models.py'], 'targets': ['requests.models.deps'], 'actions': ['python -m import_deps %(dependencies)s > %(targets)s'], 'clean': True, ...
mit
mgit-at/ansible
lib/ansible/modules/identity/keycloak/keycloak_clienttemplate.py
5
15142
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017, Eike Frost <ei@kefro.st> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1...
gpl-3.0
rubenvb/skia
infra/bots/recipe_modules/flavor/android.py
1
21248
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine import recipe_api from . import default import subprocess # TODO(borenet): No! Remove this. """Android flavor, used for running code ...
bsd-3-clause
jtolds/pants-lang
src/ir/types.py
1
13255
#!/usr/bin/env python # # Copyright (c) 2012, JT Olds <hello@jtolds.com> # # 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 us...
mit
zzcclp/spark
python/pyspark/pandas/plot/core.py
11
41921
# # 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 us...
apache-2.0
hammerlab/varcode
test/benchmark_vcf_load.py
1
1220
""" Time how long it takes to open a VCF. Run as: python -m profile -s cumtime %(prog)s to get profiling output. """ import argparse import time import varcode parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( "path", help="Path or URL to VCF") parser.add_argument( "--profile...
apache-2.0
binux/pyspider
tests/data_test_webpage.py
8
1727
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<roy@binux.me> # http://binux.me # Created on 2015-01-24 13:44:10 from httpbin import app @app.route('/pyspider/test.html') def test_page(): return ''' <a href="/404">404 <a href="/links/10/0">0...
apache-2.0
webmakin/scrapy
scrapy/exporters.py
118
9277
""" Item Exporters are used to export/serialize items into different formats. """ import csv import sys import pprint import marshal import six from six.moves import cPickle as pickle from xml.sax.saxutils import XMLGenerator from scrapy.utils.serialize import ScrapyJSONEncoder from scrapy.item import BaseItem __all...
bsd-3-clause
pombredanne/package-verify
test/test_validator_devspec.py
2
2566
# Copyright (C) 2014 Steve Milner # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in t...
gpl-3.0
windyuuy/opera
chromium/src/third_party/trace-viewer/third_party/pywebsocket/src/example/echo_client.py
30
38662
#!/usr/bin/env python # # Copyright 2011, 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...
bsd-3-clause
salimfadhley/jenkinsapi
jenkinsapi_tests/systests/test_nodes.py
3
5746
""" System tests for `jenkinsapi.jenkins` module. """ import logging import pytest from jenkinsapi.node import Node from jenkinsapi.credential import SSHKeyCredential from jenkinsapi_tests.test_utils.random_strings import random_string log = logging.getLogger(__name__) def test_online_offline(jenkins): """ C...
mit
dbaxa/django
tests/utils_tests/test_decorators.py
319
4870
from django.http import HttpResponse from django.template import engines from django.template.response import TemplateResponse from django.test import RequestFactory, SimpleTestCase from django.utils.decorators import classproperty, decorator_from_middleware class ProcessViewMiddleware(object): def process_view(s...
bsd-3-clause
raamana/pyradigm
pyradigm/_version.py
1
18454
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
mit
morpheby/levelup-by
common/lib/xmodule/xmodule/modulestore/parsers.py
9
4058
import re # Prefix for the branch portion of a locator URL BRANCH_PREFIX = "/branch/" # Prefix for the block portion of a locator URL BLOCK_PREFIX = "/block/" # Prefix for the version portion of a locator URL, when it is preceded by a course ID VERSION_PREFIX = "/version/" # Prefix for version when it begins the URL (...
agpl-3.0
XVPCoin/vaporcoin
qa/rpc-tests/util.py
115
5260
# Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Helpful routines for regression testing # # Add python-bitcoinrpc to module search path: import os import sys sys.path.append...
mit
degoldschmidt/pytrack-analysis
gui/videoplayer.py
1
2535
import numpy as np import cv2 import tkinter as tk from PIL import Image, ImageTk import os.path as op VIDEODIR = '/media/degoldschmidt/DATA_DENNIS_002/working_data/0007_KPEG' VIDEOFILE = op.join(VIDEODIR, 'cam01_2018-04-18T15_39_08.avi') START_FRAME = 4000 #Set up GUI window = tk.Tk() #Makes main window window.wm_...
gpl-3.0
malaterre/ITK
Modules/Filtering/ImageFeature/wrapping/test/HoughTransform2DLinesImageFilterTest.py
2
1337
#========================================================================== # # Copyright NumFOCUS # # 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/l...
apache-2.0
SecurityFTW/cs-suite
tools/G-Scout/G-Scout-master/categories/instance_groups.py
2
1836
from googleapiclient import discovery from tinydb import TinyDB from core.utility import get_gcloud_creds db = TinyDB('entities.json') group_table = db.table('Instance Groups') template_table = db.table('Instance Templates') credentials = GoogleCredentials.get_application_default() from oauth2client.file import Stora...
gpl-3.0
nre-aachen/GeMpy
gempy/GemPy_f.py
1
13575
""" Module with classes and methods to perform implicit regional modelling based on the potential field method. Tested on Ubuntu 14 Created on 10/10 /2016 @author: Miguel de la Varga """ from __future__ import division import os from os import path import sys # This is for sphenix to find the packages sys.path.appe...
mit
joone/chromium-crosswalk
tools/telemetry/third_party/webpagereplay/rules/log_url.py
30
2237
#!/usr/bin/env python # 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...
bsd-3-clause
rdeheele/odoo
addons/l10n_pa/__init__.py
2120
1456
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
agpl-3.0
madan96/sympy
sympy/solvers/ode.py
7
330554
r""" This module contains :py:meth:`~sympy.solvers.ode.dsolve` and different helper functions that it uses. :py:meth:`~sympy.solvers.ode.dsolve` solves ordinary differential equations. See the docstring on the various functions for their uses. Note that partial differential equations support is in ``pde.py``. Note t...
bsd-3-clause
2013Commons/HUE-SHARK
build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/utils/datetime_safe.py
496
2685
# Python's datetime strftime doesn't handle dates before 1900. # These classes override date and datetime to support the formatting of a date # through its full "proleptic Gregorian" date range. # # Based on code submitted to comp.lang.python by Andrew Dalke # # >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%m/%d was...
apache-2.0
jackxiang/google-app-engine-django
appengine_django/management/commands/rollback.py
60
1645
#!/usr/bin/python2.4 # # Copyright 2008 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...
apache-2.0
sebrandon1/nova
nova/tests/unit/api/openstack/compute/test_extended_server_attributes.py
3
10156
# 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
bsmr-docker/compose
tests/integration/resilience_test.py
29
1545
from __future__ import unicode_literals from __future__ import absolute_import import mock from compose.project import Project from .testcases import DockerClientTestCase class ResilienceTest(DockerClientTestCase): def setUp(self): self.db = self.create_service('db', volumes=['/var/db'], command='top') ...
apache-2.0
tonyli71/nuage-openstack-neutron
nuage_neutron/plugins/nuage/nuagedb.py
1
11936
# Copyright 2014 Alcatel-Lucent USA 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 l...
apache-2.0
chriscoyfish/coala-bears
bears/c_languages/ClangComplexityBear.py
4
4936
from clang.cindex import Index, CursorKind from coalib.bears.LocalBear import LocalBear from coalib.results.Result import Result from coalib.results.SourceRange import SourceRange from coalib.bearlib import deprecate_settings from bears.c_languages.ClangBear import clang_available, ClangBear class ClangComplexityBea...
agpl-3.0
Voluntarynet/BitmessageKit
BitmessageKit/Vendor/static-python/Lib/test/test_compile.py
45
18749
import unittest import sys import _ast from test import test_support import textwrap class TestSpecifics(unittest.TestCase): def test_no_ending_newline(self): compile("hi", "<test>", "exec") compile("hi\r", "<test>", "exec") def test_empty(self): compile("", "<test>", "exec") def...
mit
michaelforfxhelp/fxhelprepo
third_party/chromium/testing/gtest/test/gtest_xml_output_unittest.py
5
11521
#!/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,...
mpl-2.0
TomasTomecek/compose
tests/unit/interpolation_test.py
38
1676
import unittest from compose.config.interpolation import BlankDefaultDict as bddict from compose.config.interpolation import interpolate from compose.config.interpolation import InvalidInterpolation class InterpolationTest(unittest.TestCase): def test_valid_interpolations(self): self.assertEqual(interpol...
apache-2.0
elventear/ansible-modules-core
network/openswitch/_ops_template.py
23
7218
#!/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
pratikmallya/hue
desktop/core/ext-py/boto-2.38.0/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...
apache-2.0
mcardillo55/django
django/contrib/admindocs/utils.py
411
4187
"Misc. utility functions/classes for admin documentation generator." import re from email.errors import HeaderParseError from email.parser import HeaderParser from django.core.urlresolvers import reverse from django.utils.encoding import force_bytes from django.utils.safestring import mark_safe try: import docut...
bsd-3-clause