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
rTreutlein/atomspace
tests/cython/atomspace/test_linkvalue_containing_atoms.py
2
3093
import unittest import re from opencog.atomspace import AtomSpace from opencog.type_constructors import * from opencog.utilities import initialize_opencog, finalize_opencog class LinkValueContainingAtomsTest(unittest.TestCase): def setUp(self): self.space = AtomSpace() initialize_opencog(self.spa...
agpl-3.0
ArcherSys/ArcherSys
Lib/test/test_selectors.py
1
43481
<<<<<<< HEAD <<<<<<< HEAD import errno import os import random import selectors import signal import socket import sys from test import support from time import sleep import unittest import unittest.mock try: from time import monotonic as time except ImportError: from time import time as time try: import re...
mit
famz/patchew
mods/tags.py
1
4962
#!/usr/bin/env python3 # # Copyright 2016 Red Hat, Inc. # # Authors: # Fam Zheng <famz@redhat.com> # # This work is licensed under the MIT License. Please see the LICENSE file or # http://opensource.org/licenses/MIT. from mod import PatchewModule from mbox import parse_address from event import register_handler, ...
mit
tojon/treeherder
treeherder/autoclassify/matchers.py
3
10482
import logging import time from abc import (ABCMeta, abstractmethod) from collections import namedtuple from difflib import SequenceMatcher from django.conf import settings from django.db.models import Q from elasticsearch_dsl.query import Match as ESMatch from treeherder.autoclassify.autoclassify im...
mpl-2.0
johnkit/vtk-dev
Filters/Core/Testing/Python/TestSynchronizedTemplates3D.py
12
2199
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() class TestSynchronizedTemplates3D(Testing.vtkTest): def testAll(self): reader = vtk.vtkImageReader() reader.SetDataByteOrderToLittleEndian() reader.SetDataExtent(0,63,0,...
bsd-3-clause
IronLanguages/ironpython3
Src/StdLib/Lib/tkinter/test/test_tkinter/test_loadtk.py
162
1503
import os import sys import unittest import test.support as test_support from tkinter import Tcl, TclError test_support.requires('gui') class TkLoadTest(unittest.TestCase): @unittest.skipIf('DISPLAY' not in os.environ, 'No $DISPLAY set.') def testLoadTk(self): tcl = Tcl() self.assertRaises(Tc...
apache-2.0
LeeMendelowitz/basketball-reference
run_games.py
1
1036
""" Download all 2013 boxscores. """ import os import sys from file_utils import make_dirs import pandas import time import requests from basketball_reference import games_table from basketball_reference.globals import URL_BASE def games_to_csv(): src = os.path.join('pages', 'NBA_2013_games.html') games_table.t...
gpl-3.0
mandeepdhami/horizon
openstack_dashboard/dashboards/admin/metadata_defs/forms.py
54
5852
# # (c) Copyright 2014 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.apache.org/licenses/LICENSE-2.0 # # Unle...
apache-2.0
nkcr/WebIndex
app/venv/lib/python3.5/site-packages/nltk/tokenize/punkt.py
7
61452
# Natural Language Toolkit: Punkt sentence tokenizer # # Copyright (C) 2001-2016 NLTK Project # Algorithm: Kiss & Strunk (2006) # Author: Willy <willy@csse.unimelb.edu.au> (original Python port) # Steven Bird <stevenbird1@gmail.com> (additions) # Edward Loper <edloper@gmail.com> (rewrite) # Joel...
mit
joakim-hove/django
django/contrib/gis/db/models/query.py
224
36645
import warnings from django.contrib.gis.db.models import aggregates from django.contrib.gis.db.models.fields import ( GeometryField, LineStringField, PointField, get_srid_info, ) from django.contrib.gis.db.models.lookups import GISLookup from django.contrib.gis.db.models.sql import ( AreaField, DistanceField, ...
bsd-3-clause
glucoseinc/naumanni-server
naumanni/web/server.py
2
11683
# -*- coding: utf-8 -*- import asyncio import collections import logging import functools import json import multiprocessing import os import signal import socket import time import psutil from tornado import gen, ioloop, iostream, routing, web from tornado.httpserver import HTTPServer from tornado.wsgi import WSGICon...
agpl-3.0
allanlewis/behave
test/test_ansi_escapes.py
12
2733
# -*- coding: utf-8 -*- # pylint: disable=C0103,R0201,W0401,W0614,W0621 # C0103 Invalid name (setUp(), ...) # R0201 Method could be a function # W0401 Wildcard import # W0614 Unused import ... from wildcard import # W0621 Redefining name ... from outer scope from __future__ import absolute_import f...
bsd-2-clause
googleapis/googleapis-gen
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/enums/types/product_type_level.py
1
1201
# -*- 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
tpo/ansible
lib/ansible/module_utils/facts/system/apparmor.py
232
1311
# Collect facts related to apparmor # # 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. # # An...
gpl-3.0
mdodsworth/hadoop-common
src/contrib/hod/hodlib/Common/miniHTMLParser.py
182
1402
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
apache-2.0
fkolacek/FIT-VUT
bp-revok/python/lib/python2.7/_threading_local.py
2
7116
"""Thread-local objects. (Note that this module provides a Python version of the threading.local class. Depending on the version of Python you're using, there may be a faster one available. You should always import the `local` class from `threading`.) Thread-local objects support the management of thread-local d...
apache-2.0
ACJTeam/enigma2
lib/python/Components/Renderer/Pig.py
16
1156
## ## P(icture)i(n)g(raphics) renderer ## from Renderer import Renderer from enigma import eVideoWidget, getDesktop from Screens.PictureInPicture import PipPigMode class Pig(Renderer): def __init__(self): Renderer.__init__(self) self.Position = self.Size = None self.hidePip = True GUI_WIDGET = eVideoWidget ...
gpl-2.0
yoer/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/xlrd/compdoc.py
64
14974
# -*- coding: cp1252 -*- ## # Implements the minimal functionality required # to extract a "Workbook" or "Book" stream (as one big string) # from an OLE2 Compound Document file. # <p>Copyright © 2005-2008 Stephen John Machin, Lingfo Pty Ltd</p> # <p>This module is part of the xlrd package, which is released under a BS...
apache-2.0
naav97/upgradeFileUbuntu
configs/cmus/status_display_notify_send.py
1
6807
#! /usr/bin/env python # # cmus_desktop_notify.py: display song cmus is playing using notify-send. # Copyright (C) 2011 Travis Poppe <tlp@lickwid.net> # # Version 2011.06.24 # http://tlp.lickwid.net/cmus_desktop_notify.py # Usage: Run script for instructions. # This program is free software; you can redistribute i...
gpl-3.0
kinverarity1/bruges
bruges/attribute/test/similarity_test.py
3
2688
import unittest import numpy from bruges.attribute import similarity class SimilarityTest( unittest.TestCase ): def test_same_data( self ): """ Simple test to check if the algorithm works for the trivial case. """ data = numpy.zeros( [100, 100] ) check_data = dat...
apache-2.0
daviddrysdale/python-phonenumbers
python/phonenumbers/data/region_NA.py
1
1959
"""Auto-generated file, do not edit by hand. NA metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_NA = PhoneMetadata(id='NA', country_code=264, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[68]\\d{7,8}', possible_length=(8, 9)), ...
apache-2.0
UPenn-RoboCup/UPennalizers
Lib/Modules/Util/Python/monitor_shm.py
3
2295
#!/usr/bin/env python import matplotlib.pyplot as mpl import numpy as np from scipy.misc import pilutil import time import shm import os vcmImage = shm.ShmWrapper('vcmImage181%s' % str(os.getenv('USER'))); def draw_data(rgb, labelA): mpl.subplot(2,2,1); mpl.imshow(rgb) # disp('Received image.') mpl.subplot(...
gpl-3.0
shanot/imp
modules/atom/test/test_create_protein.py
1
1316
from __future__ import print_function import IMP import IMP.test import IMP.core import IMP.atom import IMP.display from IMP.algebra import * class Tests(IMP.test.TestCase): """Test molecular dynamics optimizer""" def broken_until_swig_hierarchies_gets_fixed_test_cp(self): """Testing create_protein"...
gpl-3.0
eustislab/horton
horton/part/test/test_symmetry.py
1
2963
# -*- coding: utf-8 -*- # HORTON: Helpful Open-source Research TOol for N-fermion systems. # Copyright (C) 2011-2015 The HORTON Development Team # # This file is part of HORTON. # # HORTON is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by th...
gpl-3.0
lc525/gtest
scripts/upload.py
2511
51024
#!/usr/bin/env python # # Copyright 2007 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 o...
bsd-3-clause
jesramirez/odoo
addons/note_pad/__openerp__.py
312
1691
# -*- 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
jsoref/django
django/core/management/commands/testserver.py
200
2074
from django.core.management import call_command from django.core.management.base import BaseCommand from django.db import connection class Command(BaseCommand): help = 'Runs a development server with data from the given fixture(s).' requires_system_checks = False def add_arguments(self, parser): ...
bsd-3-clause
HaraldWeber/client
src/coop/__init__.py
1
1079
#------------------------------------------------------------------------------- # Copyright (c) 2012 Gael Honorez. # All rights reserved. This program and the accompanying materials # are made available under the terms of the GNU Public License v3.0 # which accompanies this distribution, and is available at # http://w...
gpl-3.0
Applied-GeoSolutions/gips
gips/scripts/process.py
1
3787
#!/usr/bin/env python ################################################################################ # GIPS: Geospatial Image Processing System # # AUTHOR: Matthew Hanson # EMAIL: matt.a.hanson@gmail.com # # Copyright (C) 2014-2018 Applied Geosolutions # # This program is free software; you can redist...
gpl-3.0
WSDC-NITWarangal/django
tests/migrate_signals/tests.py
324
3585
from django.apps import apps from django.core import management from django.db.models import signals from django.test import TestCase, override_settings from django.utils import six APP_CONFIG = apps.get_app_config('migrate_signals') PRE_MIGRATE_ARGS = ['app_config', 'verbosity', 'interactive', 'using'] MIGRATE_DATABA...
bsd-3-clause
alena1108/cattle
tests/integration/cattletest/core/test_ssh_key.py
2
1253
from common_fixtures import * # NOQA import requests def test_create_ssh_key_default(admin_client): key = admin_client.create_ssh_key() assert key.state == 'registering' key = admin_client.wait_success(key) assert key.state == 'active' assert key.publicValue.startswith('ssh-rsa ') assert ke...
apache-2.0
ednad/ooi-ui-services
tests/model/test_adaptor.py
1
1361
#!/usr/bin/env python ''' tests.model.test_adaptor The base class for the Services Test Case ''' from ooiservices.adaptor.file import FileAdaptor from tests.services_test_case import ServicesTestCase import os import shutil class TestAdaptor(ServicesTestCase): ''' Unit tests for the file adaptor ''' ...
apache-2.0
ghickman/django
django/contrib/staticfiles/management/commands/collectstatic.py
24
14280
from __future__ import unicode_literals import os from collections import OrderedDict from django.contrib.staticfiles.finders import get_finders from django.contrib.staticfiles.storage import staticfiles_storage from django.core.files.storage import FileSystemStorage from django.core.management.base import BaseComman...
bsd-3-clause
ioanpocol/superdesk-core
tests/media/crop_test.py
2
8659
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from unittes...
agpl-3.0
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/zmq/eventloop/minitornado/ioloop.py
17
41351
#!/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...
mit
ampax/edx-platform-backup
lms/djangoapps/instructor/management/commands/dump_grades.py
39
3227
#!/usr/bin/python """ django management command: dump grades to csv files for use by batch processes """ import csv from instructor.views.legacy import get_student_grade_summary_data from courseware.courses import get_course_by_id from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from ...
agpl-3.0
hundeboll/core
lib/oelite/meta/dict.py
3
14552
from oelite.meta import * import oelite.path import sys import copy import warnings import cPickle import operator import types import os def unpickle(file): return DictMeta(meta=file) class DictMeta(MetaData): def pickle(self, file): cPickle.dump(self.dict, file, 2) cPickle.dump(self.exp...
mit
clinton-hall/nzbToMedia
libs/common/unidecode/x028.py
253
5069
data = ( ' ', # 0x00 'a', # 0x01 '1', # 0x02 'b', # 0x03 '\'', # 0x04 'k', # 0x05 '2', # 0x06 'l', # 0x07 '@', # 0x08 'c', # 0x09 'i', # 0x0a 'f', # 0x0b '/', # 0x0c 'm', # 0x0d 's', # 0x0e 'p', # 0x0f '"', # 0x10 'e', # 0x11 '3', # 0x12 'h', # 0x13 '9', # ...
gpl-3.0
sparkslabs/kamaelia_
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Internet/Multicast_receiver.py
3
4324
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Ve...
apache-2.0
nomaro/SickBeard_Backup
sickbeard/naming.py
30
6135
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Lice...
gpl-3.0
isb-cgc/ISB-CGC-Webapp
bq_data_access/v1/mrna_data.py
1
6752
# # Copyright 2015-2019, Institute for Systems Biology # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
garyfeng/pybrain
pybrain/structure/networks/bidirectional.py
31
4053
__author__ = 'Tom Schaul, tom@idsia.ch' from pybrain.structure.modules import TanhLayer, SigmoidLayer from pybrain.structure.networks.feedforward import FeedForwardNetwork from pybrain.structure.connections.shared import MotherConnection, SharedFullConnection from pybrain.structure.modules.linearlayer import LinearLay...
bsd-3-clause
supersven/intellij-community
python/helpers/pydev/_pydev_imps/_pydev_BaseHTTPServer.py
54
22554
"""HTTP server base class. Note: the class in this module doesn't implement any HTTP request; see SimpleHTTPServer for simple implementations of GET, HEAD and POST (including CGI scripts). It does, however, optionally implement HTTP/1.1 persistent connections, as of version 0.3. Contents: - BaseHTTPRequestHandler: ...
apache-2.0
flyfei/python-for-android
python3-alpha/python3-src/Doc/tools/sphinxext/pyspecific.py
45
9791
# -*- coding: utf-8 -*- """ pyspecific.py ~~~~~~~~~~~~~ Sphinx extension with Python doc-specific markup. :copyright: 2008, 2009, 2010 by Georg Brandl. :license: Python license. """ ISSUE_URI = 'http://bugs.python.org/issue%s' SOURCE_URI = 'http://hg.python.org/cpython/file/3.2/%s' from docutils...
apache-2.0
kobejean/tensorflow
tensorflow/python/data/kernel_tests/optional_ops_test.py
9
10950
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
DmitryDmitrienko/kube-form-editor
editorform/editor/models.py
1
1398
from django.db import models from django.contrib.auth.models import User class FormModel(models.Model): name = models.CharField(max_length=60, verbose_name=u'name form') user = models.ForeignKey(User, verbose_name=u'user form') created = models.DateField(auto_now_add=True, verbose_name=u'date created') ...
gpl-2.0
yd0str/infernal-twin
build/pillow/build/lib.linux-i686-2.7/PIL/CurImagePlugin.py
52
1943
# # The Python Imaging Library. # $Id$ # # Windows Cursor support for PIL # # notes: # uses BmpImagePlugin.py to read the bitmap data. # # history: # 96-05-27 fl Created # # Copyright (c) Secret Labs AB 1997. # Copyright (c) Fredrik Lundh 1996. # # See the README file for information on usage and redist...
gpl-3.0
ax003d/openerp
openerp/addons/point_of_sale/wizard/pos_discount.py
55
2903
# -*- 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
abzaloid/kazakh-story-generator
webserver/lib/werkzeug/local.py
107
14553
# -*- coding: utf-8 -*- """ werkzeug.local ~~~~~~~~~~~~~~ This module implements context-local objects. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import copy from functools import update_wrapper from werkzeug.wsgi impo...
mit
llhe/tensorflow
tensorflow/contrib/layers/python/layers/feature_column.py
12
104580
# Copyright 2015 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
LeZhang2016/openthread
tests/toranj/wpan.py
2
56145
#!/usr/bin/env python # # Copyright (c) 2018, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
bsd-3-clause
bing-ads-sdk/BingAds-Python-SDK
bingads/v12/bulk/entities/target_criterions/bulk_ad_group_location_intent_criterion.py
1
4669
from bingads.v12.bulk.entities import * from bingads.service_client import _CAMPAIGN_OBJECT_FACTORY_V12 from bingads.v12.internal.bulk.entities.single_record_bulk_entity import _SingleRecordBulkEntity from bingads.v12.internal.bulk.mappings import _SimpleBulkMapping from bingads.v12.internal.bulk.string_table import _S...
mit
cherusk/ansible
lib/ansible/modules/network/panos/panos_service.py
78
5072
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
liggitt/openshift-ansible
roles/openshift_health_checker/openshift_checks/logging/logging_index_time.py
49
5031
""" Check for ensuring logs from pods can be queried in a reasonable amount of time. """ import json import time from uuid import uuid4 from openshift_checks import OpenShiftCheckException from openshift_checks.logging.logging import LoggingCheck ES_CMD_TIMEOUT_SECONDS = 30 class LoggingIndexTime(LoggingCheck): ...
apache-2.0
niketanpansare/systemml
projects/breast_cancer/breastcancer/visualization.py
18
2001
#------------------------------------------------------------- # # 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...
apache-2.0
flyfei/python-for-android
python3-alpha/python3-src/Lib/unittest/test/test_discovery.py
785
13838
import os import re import sys import unittest class TestableTestProgram(unittest.TestProgram): module = '__main__' exit = True defaultTest = failfast = catchbreak = buffer = None verbosity = 1 progName = '' testRunner = testLoader = None def __init__(self): pass class TestDisc...
apache-2.0
superbobry/pymc3
pymc3/examples/ARM5_4.py
14
1026
''' Created on May 18, 2012 @author: jsalvatier ''' import numpy as np from pymc3 import * import theano.tensor as t import pandas as pd wells = get_data_file('pymc3.examples', 'data/wells.dat') data = pd.read_csv(wells, delimiter=u' ', index_col=u'id', dtype={u'switch': np.int8}) data.dist /= 10...
apache-2.0
olaurendeau/v6_ui
c2corg_ui/views/xreport.py
3
6402
from c2corg_common.document_types import XREPORT_TYPE from c2corg_ui.caching import cache_document_detail from c2corg_ui.views import call_api, get_with_etag from pyramid.httpexceptions import HTTPInternalServerError from pyramid.renderers import render from pyramid.view import view_config from c2corg_ui.views.documen...
agpl-3.0
anryko/ansible
test/units/cli/test_vault.py
45
9495
# -*- coding: utf-8 -*- # (c) 2017, Adrian Likins <alikins@redhat.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 you...
gpl-3.0
shastikk/youtube-dl
youtube_dl/extractor/thisamericanlife.py
135
1549
from __future__ import unicode_literals from .common import InfoExtractor class ThisAmericanLifeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?thisamericanlife\.org/(?:radio-archives/episode/|play_full\.php\?play=)(?P<id>\d+)' _TESTS = [{ 'url': 'http://www.thisamericanlife.org/radio-archives/e...
unlicense
Faysir/cuda-convnet2
python_util/gpumodel.py
175
14896
# Copyright 2014 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...
apache-2.0
baylee-d/osf.io
osf/utils/workflows.py
5
11263
# -*- coding: utf-8 -*- from __future__ import unicode_literals from enum import Enum, IntEnum, unique class ModerationEnum(IntEnum): '''A helper Enum superclass that provides easy translation to Int/CharChoices fields.''' @classmethod def int_field_choices(cls): return tuple((member.value, memb...
apache-2.0
paypal/keystone
keystone/service.py
1
3306
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack 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 requ...
apache-2.0
petrvanblokland/Xierpa3App
Xierpa3App/run.py
1
1377
# -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # xierpa server # Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com # # X I E R P A 3 A P P # Distribution by the MIT License. # # --------------------------------------------------------...
mit
endlessm/chromium-browser
third_party/catapult/third_party/gsutil/gslib/discard_messages_queue.py
5
1323
# -*- coding: utf-8 -*- # Copyright 2018 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 require...
bsd-3-clause
cristiana214/cristianachavez214-cristianachavez
python/src/Mac/Modules/ibcarbon/IBCarbonsupport.py
39
1223
# IBCarbonsupport.py from macsupport import * IBNibRef = OpaqueByValueType('IBNibRef', 'IBNibRefObj') #CFBundleRef = OpaqueByValueType('CFBundleRef') IBCarbonFunction = OSErrFunctionGenerator IBCarbonMethod = OSErrMethodGenerator includestuff = """ #include <Carbon/Carbon.h> #include "pymactoolbox.h" #ifdef USE_TO...
apache-2.0
f-prettyland/angr
angr/analyses/identifier/functions/fdprintf.py
4
4343
import random import string import logging import claripy from ..func import Func, TestData l = logging.getLogger("identifier.functions.printf") class fdprintf(Func): non_null = [chr(i) for i in range(1, 256)] def __init__(self): super(fdprintf, self).__init__() self.format_spec_char = N...
bsd-2-clause
kjung/scikit-learn
doc/tutorial/machine_learning_map/svg2imagemap.py
360
3411
#!/usr/local/bin/python """ This script converts a subset of SVG into an HTML imagemap Note *subset*. It only handles <path> elements, for which it only pays attention to the M and L commands. Futher, it only notices the "translate" transform. It was written to generate the examples in the documentation f...
bsd-3-clause
nervous-laughter/qiime2
qiime2/sdk/tests/test_artifact.py
2
17709
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2017, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
bsd-3-clause
nrc/rustc-perf
collector/benchmarks/script-servo/components/script/dom/bindings/codegen/GlobalGen.py
73
3185
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # We do one global pass over all the WebIDL to generate our prototype enum # and generate information for subsequent pha...
mit
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/sklearn/tests/test_grid_search.py
53
28730
""" Testing for grid search module (sklearn.grid_search) """ from collections import Iterable, Sized from sklearn.externals.six.moves import cStringIO as StringIO from sklearn.externals.six.moves import xrange from itertools import chain, product import pickle import sys import numpy as np import scipy.sparse as sp ...
gpl-2.0
jamespcole/home-assistant
tests/components/yessssms/test_notify.py
8
7584
"""The tests for the notify yessssms platform.""" import unittest import requests_mock import homeassistant.components.yessssms.notify as yessssms class TestNotifyYesssSMS(unittest.TestCase): """Test the yessssms notify.""" def setUp(self): # pylint: disable=invalid-name """Set up things to be run w...
apache-2.0
dmoon4117/mutagen
mutagen/aiff.py
6
10863
# -*- coding: utf-8 -*- # Copyright (C) 2014 Evan Purkhiser # 2014 Ben Ockmore # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. """AIFF audio stream information a...
gpl-2.0
mikeolteanu/livepythonconsole-app-engine
boilerplate/external/apiclient/model.py
102
11708
#!/usr/bin/python2.4 # # 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 l...
lgpl-3.0
ty707/airflow
airflow/operators/postgres_operator.py
18
1910
# -*- coding: utf-8 -*- # # 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
tzabian/fuego-pootle
external_apps/djblets/util/testing.py
7
1900
# # djblets/util/testing.py - Some classes useful for unit testing django-based # applications # # Copyright (c) 2007 David Trowbridge # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to ...
gpl-2.0
ANNarchy/ANNarchy
ANNarchy/extensions/convolution/Convolve.py
1
40983
# ============================================================================= # # Convolution.py # # This file is part of ANNarchy. # # Copyright (C) 2019 Julien Vitay <julien.vitay@gmail.com>, # Helge Uelo Dinkelbach <helge.dinkelbach@gmail.com> # # This program is free software: you can redistr...
gpl-2.0
ducngtuan/my-python3-koans-solution
python2/koans/about_sets.py
1
1706
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutSets(Koan): def test_sets_make_keep_lists_unique(self): highlanders = ['MacLeod', 'Ramirez', 'MacLeod', 'Matunas', 'MacLeod', 'Malcolm', 'MacLeod'] there_can_only_be_only_one = set(highlanders) ...
mit
EventGhost/EventGhost
eg/Classes/Translation.py
2
30507
# -*- coding: utf-8 -*- # # This file is part of EventGhost. # Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/> # # EventGhost 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 versio...
gpl-2.0
chatcannon/scipy
scipy/signal/tests/test_windows.py
74
9476
from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy import array from numpy.testing import (assert_array_almost_equal, assert_array_equal, run_module_suite, assert_raises, assert_allclose) from scipy import signal window_funcs = [ ...
bsd-3-clause
jmartinm/InvenioAuthorLists
modules/websubmit/lib/functions/Move_to_Done.py
8
2441
## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 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 ...
gpl-2.0
mancoast/CPythonPyc_test
fail/341_test_winsound.py
84
9070
# Ridiculously simple test of the winsound module for Windows. import unittest from test import support support.requires('audio') import time import os import subprocess winsound = support.import_module('winsound') ctypes = support.import_module('ctypes') import winreg def has_sound(sound): """Find out if a part...
gpl-3.0
nunogt/tempest
tempest/api/compute/servers/test_list_server_filters.py
6
14862
# 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
noam09/deluge-telegramer
telegramer/include/future/utils/__init__.py
8
20325
""" A selection of cross-compatible functions for Python 2 and 3. This module exports useful functions for 2/3 compatible code: * bind_method: binds functions to classes * ``native_str_to_bytes`` and ``bytes_to_native_str`` * ``native_str``: always equal to the native platform string object (because ...
gpl-3.0
deschler/django-filebrowser
filebrowser/signals.py
21
1706
# coding: utf-8 # DJANGO IMPORTS from django.dispatch import Signal # upload signals # path: Absolute server path to the file/folder # name: Name of the file/folder # site: Current FileBrowserSite instance filebrowser_pre_upload = Signal(providing_args=["path", "file", "site"]) filebrowser_post_upload = Signal(provid...
bsd-3-clause
kracwarlock/convnet
py/test_conv.py
2
18678
import sys from convnet import * import numpy as np import conv_cpu test_gemm = True def DivUp(a, b): return (a + b - 1) / b def TestConvUp(images_shape, conv_desc): filters_shape = (conv_desc.num_output_channels, conv_desc.kernel_size_x, conv_desc.kernel_size_y, conv_desc.num_input_channels) output_shape = cm...
bsd-2-clause
jerryz1982/neutron
neutron/db/migration/alembic_migrations/versions/1955efc66455_weight_scheduler.py
47
1036
# Copyright 2015 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
savoirfairelinux/OpenUpgrade
addons/stock_account/wizard/stock_valuation_history.py
33
8129
from openerp import tools from openerp.osv import fields, osv from openerp.tools.translate import _ class wizard_valuation_history(osv.osv_memory): _name = 'wizard.valuation.history' _description = 'Wizard that opens the stock valuation history table' _columns = { 'choose_date': fields.boolean('C...
agpl-3.0
pyronimous/flappy
flappy/display/stage.py
2
19536
# encoding: utf-8 import time import flappy from flappy import _core from flappy.events import Event, KeyboardEvent, MouseEvent, TouchEvent from flappy.events import FocusEvent from flappy.geom import Point from flappy.display import DisplayObject, DisplayObjectContainer class StageQuality(object): LOW = '...
mit
mortada/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/transform_test.py
62
3360
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
mattvick/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/qt.py
113
7883
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
peterlauri/django
tests/model_indexes/tests.py
22
3199
from django.db import models from django.test import TestCase from .models import Book class IndexesTests(TestCase): def test_repr(self): index = models.Index(fields=['title']) multi_col_index = models.Index(fields=['title', 'author']) self.assertEqual(repr(index), "<Index: fields='title...
bsd-3-clause
weimingtom/python-for-android
python3-alpha/python3-src/Doc/includes/sqlite3/text_factory.py
45
1355
import sqlite3 con = sqlite3.connect(":memory:") cur = con.cursor() # Create the table con.execute("create table person(lastname, firstname)") AUSTRIA = "\xd6sterreich" # by default, rows are returned as Unicode cur.execute("select ?", (AUSTRIA,)) row = cur.fetchone() assert row[0] == AUSTRIA # but we can make sql...
apache-2.0
rhattersley/iris
lib/iris/coords.py
4
74738
# (C) British Crown Copyright 2010 - 2016, 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
Tatsh-ansible/ansible
lib/ansible/modules/cloud/azure/azure_rm_publicipaddress_facts.py
10
5699
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.com> # # 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 ANS...
gpl-3.0
authbox-lib/thrift
test/crossrunner/prepare.py
50
1686
# # 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
xianjunzhengbackup/Cloud-Native-Python
env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/request.py
714
5988
from __future__ import absolute_import try: from urllib.parse import urlencode except ImportError: from urllib import urlencode from .filepost import encode_multipart_formdata __all__ = ['RequestMethods'] class RequestMethods(object): """ Convenience mixin for classes who implement a :meth:`urlopen...
mit
ClearCorp-dev/odoo-clearcorp
TODO-8.0/account_bank_statement_reconcile_ccorp/account_bank_statement_reconcile_ccorp.py
4
5712
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
agpl-3.0
o5k/openerp-oemedical-v0.1
openerp/addons/email_template/wizard/mail_compose_message.py
31
9734
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
sarahn/ganeti
test/py/ganeti.impexpd_unittest.py
9
8733
#!/usr/bin/python # # Copyright (C) 2010 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 version. # # This program...
gpl-2.0