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
CallaJun/hackprince
indico/skimage/feature/censure.py
4
11833
import numpy as np from scipy.ndimage.filters import maximum_filter, minimum_filter, convolve from ..transform import integral_image from ..feature import structure_tensor from ..morphology import octagon, star from ..feature.censure_cy import _censure_dob_loop from ..feature.util import (FeatureDetector, _prepare_gra...
lgpl-3.0
calfonso/ansible
lib/ansible/utils/module_docs_fragments/iosxr.py
58
3361
# # (c) 2015, Peter Sprygada <psprygada@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
felixma/nova
nova/tests/unit/servicegroup/test_db_servicegroup.py
41
3447
# Copyright 2012 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
kgrvamsi/lightwave
vmca/tools/certificate-manager/certificateManagerUtils.py
5
14613
#!/usr/bin/env python # Copyright 2015 VMware, Inc. All rights reserved. -- VMware Confidential """ Utility functions to support certificate-manager """ __author__ = 'Charudath Gopal (cgopal@vmware.com)' __copyright__ = 'Copyright 2015, VMware Inc.' __version__ = 1.0 import logging import os import sys import errno...
apache-2.0
ifduyue/sentry
tests/sentry/test_coreapi.py
3
1750
from __future__ import absolute_import from collections import namedtuple import mock from sentry.coreapi import ClientApiHelper from sentry.testutils import TestCase from sentry.utils.data_filters import FilterStatKeys class ClientApiHelperTestCase(TestCase): @mock.patch('sentry.coreapi.is_valid_error_message')...
bsd-3-clause
denisenkom/django-sqlserver
broken-tests/schema/tests.py
1
101650
import datetime import itertools import unittest from copy import copy import django from django.db import ( DatabaseError, IntegrityError, OperationalError, connection, ) from django.db.models import Model from django.db.models.deletion import CASCADE, PROTECT from django.db.models.fields import ( AutoField, ...
mit
cloud9ers/gurumate
environment/lib/python2.7/site-packages/IPython/parallel/tests/test_lbview.py
3
5834
# -*- coding: utf-8 -*- """test LoadBalancedView objects Authors: * Min RK """ #------------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distribu...
lgpl-3.0
nitzmahone/ansible
test/units/modules/network/f5/test_bigip_profile_http_compression.py
21
3949
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
material-foundation/xctestrunner
shared/provisioning_profile.py
2
3757
# Copyright 2017 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
mvaled/OpenUpgrade
addons/mail/res_partner.py
379
2454
# -*- 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
SerpentCS/odoo
addons/sale_margin/__openerp__.py
261
1592
############################################################################## # # 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 Affero General Public L...
agpl-3.0
inonit/wagtail
wagtail/wagtailcore/migrations/0019_verbose_names_cleanup.py
28
1154
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0018_pagerevision_submitted_for_moderation_index'), ] operations = [ migrations.AlterModelOptions( name='...
bsd-3-clause
janelia-flyem/neuroglancer
python/tests/equivalence_map_test.py
3
2337
# @license # Copyright 2017 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...
apache-2.0
mlperf/training_results_v0.7
DellEMC/benchmarks/maskrcnn/implementation/pytorch/maskrcnn_benchmark/modeling/make_layers.py
4
4036
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # Copyright (c) 2018-2019 NVIDIA CORPORATION. All rights reserved. """ Miscellaneous utility functions """ import torch from torch import nn from torch.nn import functional as F from maskrcnn_benchmark.config import cfg from maskrcnn_benchmark.lay...
apache-2.0
megaumi/django
tests/admin_filters/tests.py
181
43655
from __future__ import unicode_literals import datetime from django.contrib.admin import ( AllValuesFieldListFilter, BooleanFieldListFilter, ModelAdmin, RelatedOnlyFieldListFilter, SimpleListFilter, site, ) from django.contrib.admin.views.main import ChangeList from django.contrib.auth.admin import UserAdmin ...
bsd-3-clause
henemer/exercicios
babynames/babynames.py
29
1953
#!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import sys import re """Baby Names exercise Define the extract_names() function below and c...
apache-2.0
harigowtham/sos
sos/plugins/systemd.py
8
2004
# Copyright (C) 2012 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # ...
gpl-2.0
hcs/mailman
src/mailman/runners/tests/test_bounce.py
3
10550
# Copyright (C) 2011-2012 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at you...
gpl-3.0
iho/wagtail
wagtail/wagtailcore/migrations/0001_squashed_0016_change_page_url_path_to_text_field.py
23
10503
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import django.db.models.deletion from django import VERSION as DJANGO_VERSION import wagtail.wagtailsearch.index def initial_data(apps, schema_editor): ContentType = apps.get_...
bsd-3-clause
dapengchen123/code_v1
reid/models/resnet_btfu.py
1
3793
from __future__ import absolute_import import torch.nn.functional as F import torch.nn.init as init from torch import nn from torchvision.models import resnet18, resnet34, resnet50, resnet101, \ resnet152 class ResNet_btfu(nn.Module): __factory = { 18: resnet18, 34: resnet34, 50: resne...
mit
pypy90/graphite-web
contrib/test_aggregator_rules.py
65
1172
import sys from os.path import dirname, join, abspath # Figure out where we're installed ROOT_DIR = dirname(dirname(abspath(__file__))) # Make sure that carbon's 'lib' dir is in the $PYTHONPATH if we're running from source. LIB_DIR = join(ROOT_DIR, 'graphite', 'lib') sys.path.insert(0, LIB_DIR) from carbon.aggregato...
apache-2.0
ahmadio/edx-platform
lms/djangoapps/certificates/migrations/0007_auto__add_revokedcertificate.py
188
9450
# encoding: 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): # Adding model 'RevokedCertificate' db.create_table('certificates_revokedcertificate', ( ('id', self....
agpl-3.0
Eivindbergman/Skrapa
libs/requests/auth.py
109
9728
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import threading import warnings from base64 import b64encode from .compat import urlparse, str, basestring from .cookies import extract_cookies_...
gpl-3.0
SophieIPP/ipp-macro-series-parser
ipp_macro_series_parser/demographie/parser.py
1
3235
# -*- coding: utf-8 -*- # TAXIPP -- A French microsimulation model # By: IPP <taxipp@ipp.eu> # # Copyright (C) 2012, 2013, 2014, 2015 IPP # https://github.com/taxipp # # This file is part of TAXIPP. # # TAXIPP is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Publi...
gpl-3.0
doublerr/kubernetes
build/json-extractor.py
413
2111
#!/usr/bin/env python # Copyright 2014 The Kubernetes 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 # # Unle...
apache-2.0
waynew/simple-importer
importer/importer.py
1
1305
from __future__ import print_function, division try: import tkinter as tk import configparser as configparser from tkinter.filedialog import askdirectory except ImportError: # I guess we're running Python2 import Tkinter as tk import ConfigParser as configparser from tkFileDialog import ask...
mit
EliotBerriot/django
tests/view_tests/views.py
279
9554
from __future__ import unicode_literals import datetime import decimal import logging import sys from django.core.exceptions import PermissionDenied, SuspiciousOperation from django.core.urlresolvers import get_resolver from django.http import Http404, HttpResponse, JsonResponse from django.shortcuts import render, r...
bsd-3-clause
StoicLoofah/sc2reader
sc2reader/readers.py
2
90447
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals, division import struct from sc2reader.exceptions import ParseError, ReadError from sc2reader.objects import * from sc2reader.events.game import * from sc2reader.events.message import * from sc2reader.events.tracker impor...
mit
lacatus/TFM
__init__.py
1
1514
#!/usr/bin/env python """ Initialization of the project global variables """ import cv2 import os from var import variables def init(): initvariables() def initvariables(): variables.app_path = os.path.dirname(os.path.realpath(__file__)) variables.datasets_path = variables.app_path + '/data' "...
apache-2.0
nhhegde/minimalist_item_catalog
Item_Catalog/add_test_user.py
1
1698
from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from database_setup import Base, User, Item engine = create_engine('postgresql://postgres:postgresql@localhost:5432/user_item_catalog') Base.metadata.bind = engine DBSession = sessionmaker(bind=engine) session = DBSession() te...
agpl-3.0
m-stein/linux
tools/perf/scripts/python/event_analyzing_sample.py
4719
7393
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
gpl-2.0
emidln/django_roa
env/lib/python2.7/site-packages/PIL/SpiderImagePlugin.py
40
9025
# # The Python Imaging Library. # # SPIDER image file handling # # History: # 2004-08-02 Created BB # 2006-03-02 added save method # 2006-03-13 added support for stack images # # Copyright (c) 2004 by Health Research Inc. (HRI) RENSSELAER, NY 12144. # Copyright (c) 2004 by William Baxter. # Copyright (c) 2004 ...
bsd-3-clause
peterjoel/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/formatters/wptscreenshot.py
2
1746
import requests from mozlog.structured.formatters.base import BaseFormatter class WptscreenshotFormatter(BaseFormatter): """Formatter that outputs screenshots in the format expected by wpt.fyi.""" # TODO(Hexcles): Make this configurable. API = "https://staging.wpt.fyi/api/screenshots/hashes" def __i...
mpl-2.0
cfelton/minnesota
examples/boards/nexys/fpgalink/fpgalink.py
1
2931
from myhdl import * from mn.cores.usbext import fpgalink from mn.cores.usbext import m_fpgalink_fx2 def fpgalink_nexys( # ~~ FX2 interface signals ~~ IFCLK, # 48 MHz clock from FX2 RST, # active low async reset SLWR, # active low write strobe SLRD, # active low read stro...
gpl-3.0
willhardy/django
django/contrib/gis/db/backends/postgis/schema.py
333
3091
from django.db.backends.postgresql.schema import DatabaseSchemaEditor class PostGISSchemaEditor(DatabaseSchemaEditor): geom_index_type = 'GIST' geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND' rast_index_wrapper = 'ST_ConvexHull(%s)' sql_add_spatial_index = "CREATE INDEX %(index)s ON %(table)s USING %(inde...
bsd-3-clause
mitsuhiko/celery
celery/backends/amqp.py
1
7035
"""celery.backends.amqp""" import socket import time from datetime import timedelta from carrot.messaging import Consumer, Publisher from celery import conf from celery import states from celery.backends.base import BaseDictBackend from celery.exceptions import TimeoutError from celery.messaging import establish_con...
bsd-3-clause
plish/Trolly
trolly/organisation.py
1
3394
from . import trelloobject class Organisation(trelloobject.TrelloObject): def __init__(self, trello_client, organisation_id, name='', **kwargs): super(Organisation, self).__init__(trello_client, **kwargs) self.id = organisation_id self.name = name self.base_uri = '/organizations...
mit
hasgeek/outreach
tests/test_kharcha.py
1
1236
import json import unittest from flask import url_for from outreach import app from outreach.models import (db, SaleItem) from fixtures import init_data class TestKharchaAPI(unittest.TestCase): def setUp(self): self.ctx = app.test_request_context() self.ctx.push() db.drop_all() db...
agpl-3.0
vware/android_kernel_sony_apq8064
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
BellScurry/gem5-fault-injection
src/arch/x86/isa/insts/general_purpose/data_conversion/endian_conversion.py
91
2658
# Copyright (c) 2007 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 implemen...
bsd-3-clause
titasakgm/brc-stock
openerp/addons/base/res/wizard/change_password_wizard.py
25
3100
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
nhicher/ansible
test/units/module_utils/network/nso/test_nso.py
28
22037
# Copyright (c) 2017 Cisco and/or its affiliates. # # 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
remidechazelles/mycroft-core
test/unittests/configuration/__init__.py
5
4988
import unittest from os.path import dirname, join from mycroft.configuration import ConfigurationLoader, ConfigurationManager, \ DEFAULT_CONFIG, SYSTEM_CONFIG, USER_CONFIG, RemoteConfiguration __author__ = 'jdorleans' class AbstractConfigurationTest(unittest.TestCase): def setUp(self): self.config_...
gpl-3.0
kambysese/mne-python
tutorials/epochs/plot_50_epochs_to_data_frame.py
10
6955
""" .. _tut-epochs-dataframe: Exporting Epochs to Pandas DataFrames ===================================== This tutorial shows how to export the data in :class:`~mne.Epochs` objects to a :class:`Pandas DataFrame <pandas.DataFrame>`, and applies a typical Pandas :doc:`split-apply-combine <pandas:user_guide/groupby>` wo...
bsd-3-clause
gylian/sickrage
lib/guessit/transfo/split_explicit_groups.py
21
1739
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free...
gpl-3.0
phanikishoreg/dist-sys-exercises
lec-3/discovery/prototypes/conv_server_1/convServer.py
2
3791
#!/usr/bin/env python #****************************************************************************** # # CS 6421 - Simple Conversation for cm<->m # Execution: python convServer.py portnum # # Students: Phani, Changle # #****************************************************************************** import socke...
mit
QualityVan/tgstation
tools/expand_filedir_paths.py
166
3839
#!/usr/bin/env python import re, os, sys, fnmatch # Regex pattern to extract the directory path in a #define FILE_DIR filedir_pattern = re.compile(r'^#define\s*FILE_DIR\s*"(.*?)"') # Regex pattern to extract any single quoted piece of text. This can also # match single quoted strings inside of double quote...
agpl-3.0
lucernae/geonode
geonode/services/migrations/24_initial.py
18
6442
# -*- 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), ('base', '__first__'), ('layers', '...
gpl-3.0
halober/ovirt-engine
packaging/setup/plugins/ovirt-engine-rename/ovirt-engine/misc.py
3
3281
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013 Red Hat, 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 r...
apache-2.0
phenoxim/nova
nova/api/openstack/compute/fping.py
1
4844
# Copyright 2011 Grid Dynamics # 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...
apache-2.0
maciekcc/tensorflow
tensorflow/contrib/learn/python/learn/preprocessing/tests/text_test.py
137
3303
# encoding: utf-8 # 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 r...
apache-2.0
paboldin/rally
tests/unit/plugins/openstack/scenarios/neutron/test_loadbalancer_v1.py
5
13188
# 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
scalingdata/Impala
tests/shell/test_shell_commandline.py
4
15450
#!/usr/bin/env python # encoding=utf-8 # Copyright 2012 Cloudera 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 app...
apache-2.0
Arcanemagus/SickRage
lib/oauthlib/oauth1/rfc5849/__init__.py
9
15245
# -*- coding: utf-8 -*- """ oauthlib.oauth1.rfc5849 ~~~~~~~~~~~~~~ This module is an implementation of various logic needed for signing and checking OAuth 1.0 RFC 5849 requests. """ from __future__ import absolute_import, unicode_literals import base64 import hashlib import logging log = logging.getLogger(__name__) i...
gpl-3.0
dntt1/youtube-dl
youtube_dl/extractor/golem.py
186
2181
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_urlparse, ) from ..utils import ( determine_ext, ) class GolemIE(InfoExtractor): _VALID_URL = r'^https?://video\.golem\.de/.+?/(?P<id>.+?)/' _TEST = { 'url': 'http://video.g...
unlicense
ASinanSaglam/westpa
lib/west_tools/w_crawl.py
2
4862
# Copyright (C) 2013 Matthew C. Zwier and Lillian T. Chong # # This file is part of WESTPA. # # WESTPA 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
aevum/moonstone
src/moonstone/ilsa/plugin.py
2
5947
# -*- coding: utf-8 -*- # # Moonstone is platform for processing of medical images (DICOM). # Copyright (C) 2009-2011 by Neppo Tecnologia da Informação LTDA # and Aevum Softwares LTDA # # This file is part of Moonstone. # # Moonstone is free software: you can redistribute it and/or modify # it under the terms of the GN...
lgpl-3.0
kejbaly2/invoke
invoke/vendor/yaml2/serializer.py
560
4171
__all__ = ['Serializer', 'SerializerError'] from error import YAMLError from events import * from nodes import * class SerializerError(YAMLError): pass class Serializer(object): ANCHOR_TEMPLATE = u'id%03d' def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=No...
bsd-2-clause
elventear/ansible
test/units/modules/network/vyos/vyos_module.py
59
3256
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
openstack/heat
heat/engine/resources/template_resource.py
1
14723
# # 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
nagyistoce/edx-platform
lms/djangoapps/shoppingcart/migrations/0024_auto__add_field_courseregistrationcode_mode_slug.py
109
18586
# -*- 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): # Adding field 'CourseRegistrationCode.mode_slug' db.add_column('shoppingcart_courseregistrationcode', 'mode...
agpl-3.0
DirtyUnicorns/android_external_chromium_org
build/env_dump.py
160
1717
#!/usr/bin/python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This script can either source a file and dump the enironment changes done by # it, or just simply dump the current environment as JSON in...
bsd-3-clause
aaronmckinstry706/twitter-crime-prediction
src/jobs/crime_prediction/grid.py
1
4226
import bisect import collections import math """A class which defines a square by its upper and lower lat/lon bounds.""" LatLonSquare = collections.namedtuple('Square', ['lat_min', 'lat_max', 'lon_min', 'lon_max']) class LatLonGrid(object): """ A data structure representing a rectangular grid of lati...
gpl-3.0
stonebig/winpython_afterdoc
docs/Solvers_Raymond_Hettinger/python/puzzle.py
2
3364
''' Generic Puzzle Solving Framework License: MIT Author: Raymond Hettinger Simple Instructions: ==================== Create your puzzle as a subclass of Puzzle(). The first step is to choose a representation of the problem state preferably stored as a string. Set 'pos' to the starting position and 'goal' to the...
mit
mcs07/PubChemPy
tests/test_errors.py
1
1060
# -*- coding: utf-8 -*- """ test_errors ~~~~~~~~~~~~~ Test errors. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import pytest from pubchempy import * def test_invalid_identifier(): """BadRequestError s...
mit
EdLogan18/logan-repository
plugin.video.SportsDevil/lib/utils/xbmcUtils.py
27
2568
# -*- coding: utf-8 -*- import xbmcgui, xbmc, xbmcplugin enable_debug = False ####################################### # Xbmc Helpers ####################################### def select(title, menuItems): select = xbmcgui.Dialog().select(title, menuItems) if select == -1: return None else: ...
gpl-2.0
yelizariev/project-service
project_analytic_line_view/__openerp__.py
3
1452
# -*- coding: utf-8 -*- ############################################################################## # # Author: Joël Grand-Guillaume, Matthieu Dietrich # Copyright 2010-2015 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gener...
agpl-3.0
cjhak/b2share
invenio/legacy/bibclassify/engine.py
10
26848
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2013, 2014 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 # Li...
gpl-2.0
donjordano/skype4py
unittests/applicationtest.py
17
6104
import unittest import skype4pytest from Skype4Py.application import * class ApplicationTest(skype4pytest.TestCase): def setUpObject(self): self.obj = Application(self.skype, 'spam') # Methods # ======= def testConnect(self): # Returned type: ApplicationStream or None self.a...
bsd-3-clause
toddeye/home-assistant
homeassistant/components/thermostat/homematic.py
9
4668
""" homeassistant.components.thermostat.homematic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adds support for Homematic (HM-TC-IT-WM-W-EU, HM-CC-RT-DN) thermostats using Homegear or Homematic central (CCU1/CCU2). For more details about this platform, please refer to the documentation at https://home-assistant.io/co...
mit
genius1611/horizon
openstack-dashboard/dashboard/settings.py
5
4094
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
adobe/chromium
chrome/test/gpu/generate_webgl_conformance_test_list.py
6
3335
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Auto-generates the WebGL conformance test list header file. Parses the WebGL conformance test *.txt file, which contains a list...
bsd-3-clause
MobProgramming/MobTimer.Python
Frames/MinimalScreenBlockerFrame.py
1
8157
from datetime import datetime from tkinter import ttk, N, E, W from Infrastructure import MobberManager from Infrastructure.ImageUtility import ImageUtility from Infrastructure.PathUtility import PathUtility from Infrastructure.ScreenUtility import ScreenUtility class MinimalScreenBlockerFrame(ttk.Frame): def __i...
mit
philipbl/home-assistant
homeassistant/components/lock/demo.py
18
1359
""" Demo lock platform that has two fake locks. For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ """ from homeassistant.components.lock import LockDevice from homeassistant.const import (STATE_LOCKED, STATE_UNLOCKED) # pylint: disable=unused-argument ...
mit
digwanderlust/pants
tests/python/pants_test/authentication/test_netrc_util.py
14
1953
# 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 re from conte...
apache-2.0
libyal/libmsiecf
tests/pymsiecf_test_file.py
1
7245
#!/usr/bin/env python # # Python-bindings file type test script # # Copyright (C) 2009-2021, Joachim Metz <joachim.metz@gmail.com> # # Refer to AUTHORS for acknowledgements. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as publishe...
lgpl-3.0
ShawnPengxy/Flask-madeBlog
site-packages/markdown/extensions/footnotes.py
46
11143
""" ========================= FOOTNOTES ================================= This section adds footnote handling to markdown. It can be used as an example for extending python-markdown with relatively complex functionality. While in this case the extension is included inside the module itself, it could just as easily b...
mit
davasqueza/eriskco_conector_CloudSQL
lib/jinja2/testsuite/api.py
402
10381
# -*- coding: utf-8 -*- """ jinja2.testsuite.api ~~~~~~~~~~~~~~~~~~~~ Tests the public API and related stuff. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest import os import tempfile import shutil from jinja2.testsuite import JinjaTestCase...
apache-2.0
liuliwork/django
django/contrib/postgres/fields/array.py
186
8424
import json from django.contrib.postgres import lookups from django.contrib.postgres.forms import SimpleArrayField from django.contrib.postgres.validators import ArrayMaxLengthValidator from django.core import checks, exceptions from django.db.models import Field, IntegerField, Transform from django.utils import six f...
bsd-3-clause
TheRevanchist/Google-Python-Code
basic/solution/list2.py
207
2774
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Additional basic list exercises # D. Given a list of numbers, return a list where # al...
apache-2.0
arkanis/minidyndns
references/minidns.py
1
3101
#!/usr/bin/env python # From https://code.google.com/p/minidns import sys import socket import fcntl import struct # DNSQuery class from http://code.activestate.com/recipes/491264-mini-fake-dns-server/ class DNSQuery: def __init__(self, data): self.data=data self.domain='' tipo = (ord(data[2]) >> 3) & ...
mit
lostdj/Jaklin-OpenJFX
modules/web/src/main/native/Tools/Scripts/webkitpy/tool/steps/addsvnmimetypeforpng_unittest.py
124
2556
# Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this lis...
gpl-2.0
yantrabuddhi/FreeCAD
src/Mod/Test/TestGui.py
4
8053
# FreeCAD Part module # (c) 2001 Juergen Riegel # # Part design module #*************************************************************************** #* (c) Juergen Riegel (juergen.riegel@web.de) 2002 * #* * #* Th...
lgpl-2.1
ozgurgunes/django-filizver
filizver/utils/views.py
1
1468
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from django.views.generic import View, ListView from django.http import HttpResponse from django.utils import simplejson as json from filizver.forms import TopicForm class ExtraContextMixin(View): """ A mixin that passes ``extra_c...
mit
wkoathp/glance
glance/db/sqlalchemy/migrate_repo/versions/002_add_image_properties_table.py
10
3399
# 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
motion2015/a3
common/djangoapps/edxmako/shortcuts.py
34
5290
# Copyright (c) 2008 Mikeal Rogers # # 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 agre...
agpl-3.0
manasi24/jiocloud-tempest-qatempest
tempest/stress/driver.py
11
9256
# Copyright 2013 Quanta Research Cambridge, 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 appli...
apache-2.0
alsoicode/django-maintenancemode-2
testproject/testproject/settings.py
1
4846
""" Django settings for testproject project. Generated by 'django-admin startproject' using Django 1.8.7. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build ...
apache-2.0
tedi3231/openerp
openerp/addons/l10n_be/wizard/l10n_be_vat_intra.py
7
14673
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # Adapted by Noviat to # - make the 'mand_id' field optional # - support Noviat tax code scheme #...
agpl-3.0
lindenlab/eventlet
tests/convenience_test.py
5
4666
import os import eventlet from eventlet import debug, event from eventlet.green import socket from eventlet.support import six from tests import LimitedTestCase, skip_if_no_ssl certificate_file = os.path.join(os.path.dirname(__file__), 'test_server.crt') private_key_file = os.path.join(os.path.dirname(__file__), 'te...
mit
TeamExodus/external_chromium_org
tools/telemetry/third_party/png/png.py
161
157814
#!/usr/bin/env python # $URL$ # $Rev$ # png.py - PNG encoder/decoder in pure Python # # Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org> # Portions Copyright (C) 2009 David Jones <drj@pobox.com> # And probably portions Copyright (C) 2006 Nicko van Someren <nicko@nicko.org> # # Original concept by Johann...
bsd-3-clause
ppyordanov/HCI_4_Future_Cities
Server/src/virtualenv/Lib/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py
2
2653
# ####################### BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Co...
mit
yujikato/DIRAC
src/DIRAC/Resources/Computing/test/Test_SSHComputingElement.py
1
2483
#!/bin/env python """ tests for SSHComputingElement module """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import shutil import subprocess32 as subprocess import shlex import pytest import DIRAC from DIRAC.Resources.Computing.SSHComputingElem...
gpl-3.0
teeple/pns_server
work/install/Python-2.7.4/Lib/test/test_warnings.py
61
32265
from contextlib import contextmanager import linecache import os import StringIO import sys import unittest import subprocess from test import test_support from test.script_helper import assert_python_ok import warning_tests import warnings as original_warnings py_warnings = test_support.import_fresh_module('warning...
gpl-2.0
frederikhermans/pyfftw-arm
test/test_pyfftw_nbyte_align.py
6
12808
# Copyright 2014 Knowledge Economy Developments Ltd # Copyright 2014 David Wells # # Henry Gomersall # heng@kedevelopments.co.uk # David Wells # drwells <at> vt.edu # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following c...
bsd-3-clause
Vogeltak/pauselan
lib/python3.4/site-packages/tornado/auth.py
40
43945
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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...
gpl-2.0
grantila/q
3rdparty/gtest-1.8.0/scripts/gen_gtest_pred_impl.py
2538
21986
#!/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
zixan/django-crispy-forms
setup.py
9
1270
import crispy_forms from setuptools import setup, find_packages tests_require = [ 'Django>=1.3,<1.8', ] setup( name='django-crispy-forms', version=crispy_forms.__version__, description="Best way to have Django DRY forms", long_description=open('README.rst').read(), classifiers=[ "Dev...
mit
tempbottle/Nuitka
nuitka/nodes/ExecEvalNodes.py
1
10309
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
apache-2.0
ened/scancode-toolkit
tests/textcode/test_markup.py
11
7836
# -*- coding: utf-8 -*- # # Copyright (c) 2015 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB ...
apache-2.0