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
cordmata/mediaampy
mediaamp/services.py
1
10270
from functools import partial import re from .exceptions import ServiceNotAvailable services = {} def register(cls): if issubclass(cls, BaseService): key = getattr(cls, 'registry_key', None) if not key: key = ' '.join(re.findall('[A-Z][^A-Z]*', cls.__name__)) services[key] = cl...
apache-2.0
devops2014/djangosite
django/contrib/gis/gdal/prototypes/ds.py
122
4254
""" This module houses the ctypes function prototypes for OGR DataSource related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*, OGR_Fld_* routines are relevant here. """ from ctypes import POINTER, c_char_p, c_double, c_int, c_long, c_void_p from django.contrib.gis.gdal.envelope import OGREnvelope from djan...
bsd-3-clause
EvanK/ansible
lib/ansible/modules/cloud/ovirt/ovirt_vnic_profile.py
37
8981
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCU...
gpl-3.0
TUM-AERIUS/Aerius
Raspberry/Stereo/photo-client.py
1
1956
import io import socket import struct import time import picamera # Connect a client socket to my_server:8000 (change my_server to the # hostname of your server) client_socket = socket.socket() client_socket.connect(('169.254.251.208', 8000)) # Make a file-like object out of the connection connection = client_socket....
mit
lzkelley/zcode
zcode/math/statistic.py
1
25108
"""General functions for mathematical and numerical operations. Functions --------- - confidence_bands - Bin by `xx` to calculate confidence intervals in `yy`. - confidence_intervals - Compute the values bounding desired confidence intervals. - cumstats - Calculate a cumulative averag...
mit
qtproject/pyside-pyside
doc/inheritance_diagram.py
10
12497
# -*- coding: utf-8 -*- r""" sphinx.ext.inheritance_diagram ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defines a docutils directive for inserting inheritance diagrams. Provide the directive with one or more classes or modules (separated by whitespace). For modules, all of the classes in that module will ...
lgpl-2.1
nushio3/chainer
chainer/functions/batch_normalization.py
2
8989
import numpy from chainer import cuda, Function def _kernel_with_I(args, expr, name): return cuda.elementwise( '{}, int cdim, int rdim'.format(args), 'int I = i / rdim % cdim; {};'.format(expr), name) def _cumean_axis02(x): with cuda.using_cumisc(): if x.shape[2] > 1: ...
mit
marcok/odoo_modules
hr_employee_time_clock/migrations/11.0.0.0.13/post-migrate.py
1
2402
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2016 - now Bytebrand Outsourcing AG (<http://www.bytebrand.net>). # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
Rerito/linux-ubi
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
DavidLP/home-assistant
tests/components/fritzbox/test_climate.py
10
6783
"""The tests for the demo climate component.""" import unittest from unittest.mock import Mock, patch import requests from homeassistant.components.fritzbox.climate import FritzboxThermostat class TestFritzboxClimate(unittest.TestCase): """Test Fritz!Box heating thermostats.""" def setUp(self): """...
apache-2.0
rajanandakumar/DIRAC
DataManagementSystem/scripts/dirac-dms-create-removal-request.py
13
3399
#!/usr/bin/env python """ Create a DIRAC RemoveReplica|RemoveFile request to be executed by the RMS """ __RCSID__ = "ea64b42 (2012-07-29 16:45:05 +0200) ricardo <Ricardo.Graciani@gmail.com>" import os from hashlib import md5 import time from DIRAC.Core.Base import Script from DIRAC.Core.Utilities.List import breakList...
gpl-3.0
jacobparra/redditclone
config/urls.py
2
1276
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from django.views import defaults as default_views urlpat...
bsd-3-clause
valesi/electrum
lib/daemon.py
1
6276
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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 y...
gpl-3.0
pidah/st2contrib
packs/hpe-icsp/actions/icsp_server_attribute_set.py
5
2444
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
apache-2.0
rajalokan/nova
nova/policies/server_groups.py
1
2174
# Copyright 2016 Cloudbase Solutions Srl # 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
andyzsf/Cactus-
cactus/plugin/loader.py
9
3295
#coding:utf-8 import os import sys import imp import logging from cactus.plugin import defaults from cactus.utils.filesystem import fileList logger = logging.getLogger(__name__) class BasePluginsLoader(object): def load(self): raise NotImplementedError("Subclasses must implement load") def _initia...
bsd-3-clause
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/sqlite3/test/factory.py
51
7928
#-*- coding: ISO-8859-1 -*- # pysqlite2/test/factory.py: tests for the various factories in pysqlite # # Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liab...
apache-2.0
cmcantalupo/geopm
scripts/test/TestPolicyStoreIntegration.py
1
3364
#!/usr/bin/env python # # Copyright (c) 2015 - 2021, Intel Corporation # # 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, thi...
bsd-3-clause
salaria/odoo
addons/hr_payroll/wizard/__init__.py
442
1159
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
smvv/trs
src/rules/fractions.py
1
14707
# This file is part of TRS (http://math.kompiler.org) # # TRS is free software: you can redistribute it and/or modify it under the # terms of the GNU Affero General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # TRS is distrib...
agpl-3.0
zhangtuoparis13/Vintageous
tests/commands/test__vi_big_e.py
9
1113
from collections import namedtuple from Vintageous.tests import ViewTest from Vintageous.vi.utils import modes test_data = namedtuple('test_data', 'text startRegion mode expectedRegion msg') ALL_CASES = ( test_data('01. 4', (1, 1), modes.NORMAL, (2, 2), 'Normal'), test_data('012 4', (1, 1), modes.INTERN...
mit
nerzhul/ansible
lib/ansible/modules/cloud/azure/azure_rm_securitygroup_facts.py
50
11254
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@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 Soft...
gpl-3.0
ParanoidAndroid/android_external_chromium
testing/gtest/scripts/fuse_gtest_files.py
2577
8813
#!/usr/bin/env python # # Copyright 2009, 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
dsysoev/fun-with-algorithms
queue/maxheap.py
1
3185
""" Max heap implementation https://en.wikipedia.org/wiki/Min-max_heap Algorithm Average Build heap O(n) """ from __future__ import print_function from math import log, ceil class MaxHeap(object): """ Binary Max heap implementation """ def __init__(self): self.__data = [] def max_heapify(...
mit
googleapis/googleapis-gen
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/errors/types/billing_setup_error.py
1
1902
# -*- 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
arcz/ansible-modules-core
cloud/google/gce_lb.py
130
12230
#!/usr/bin/python # Copyright 2013 Google 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 vers...
gpl-3.0
ojii/django-nani
hvad/tests/forms.py
1
5295
# -*- coding: utf-8 -*- from django.core.exceptions import FieldError from hvad.forms import TranslatableModelForm, TranslatableModelFormMetaclass from hvad.test_utils.context_managers import LanguageOverride from hvad.test_utils.testcase import NaniTestCase from testproject.app.models import Normal from django.db impo...
bsd-3-clause
pravsripad/mne-python
mne/io/constants.py
4
42745
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Matti Hämäläinen <msh@nmr.mgh.harvard.edu> # # License: BSD (3-clause) from ..utils._bunch import BunchConstNamed FIFF = BunchConstNamed() # # FIFF version number in use # FIFF.FIFFC_MAJOR_VERSION = 1 FIFF.FIFFC_MINOR_VERSION = 4 FIFF.FIFFC_VERSI...
bsd-3-clause
jdemel/gnuradio
gnuradio-runtime/python/gnuradio/gr/tag_utils.py
1
5013
from __future__ import unicode_literals import pmt from . import gr_python as gr class PythonTag(object): " Python container for tags " def __init__(self): self.offset = None self.key = None self.value = None self.srcid = False def tag_to_python(tag): """ Convert a st...
gpl-3.0
ytjiang/django
django/contrib/gis/maps/google/__init__.py
158
2762
""" This module houses the GoogleMap object, used for generating the needed javascript to embed Google Maps in a Web page. Google(R) is a registered trademark of Google, Inc. of Mountain View, California. Example: * In the view: return render_to_response('template.html', {'google' : GoogleMap(key="...
bsd-3-clause
mkaluza/external_chromium_org
chrome/common/extensions/docs/server2/test_servlet_test.py
122
1476
#!/usr/bin/env 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. import unittest from empty_dir_file_system import EmptyDirFileSystem from host_file_system_provider import HostFileSystemProvider from...
bsd-3-clause
hyperized/ansible
lib/ansible/modules/network/netscaler/netscaler_gslb_site.py
52
14162
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # 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
lulandco/SickRage
lib/sqlalchemy/dialects/sybase/pyodbc.py
79
2162
# sybase/pyodbc.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: sybase+pyodbc :name: PyODBC :dbapi: pyodbc :connectstrin...
gpl-3.0
Workday/OpenFrame
native_client_sdk/src/build_tools/build_sdk.py
1
36370
#!/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. """Entry point for both build and try bots. This script is invoked from XXX, usually without arguments to package an SDK. It autom...
bsd-3-clause
teamstoreheddinge/osmc
package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x0b7.py
253
4833
data = ( 'ddwim', # 0x00 'ddwib', # 0x01 'ddwibs', # 0x02 'ddwis', # 0x03 'ddwiss', # 0x04 'ddwing', # 0x05 'ddwij', # 0x06 'ddwic', # 0x07 'ddwik', # 0x08 'ddwit', # 0x09 'ddwip', # 0x0a 'ddwih', # 0x0b 'ddyu', # 0x0c 'ddyug', # 0x0d 'ddyugg', # 0x0e 'ddyugs', # 0x0f 'dd...
gpl-2.0
dragon96/nbproject
apps/django_remote_forms/widgets.py
7
7767
import datetime from django.utils.dates import MONTHS from django.utils.datastructures import SortedDict class RemoteWidget(object): def __init__(self, widget, field_name=None): self.field_name = field_name self.widget = widget def as_dict(self): widget_dict = SortedDict() wi...
mit
mgadi/naemonbox
sources/psdash/gevent-1.0.1/gevent/greenlet.py
22
15658
# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. import sys from gevent.hub import greenlet, getcurrent, get_hub, GreenletExit, Waiter, PY3, iwait, wait from gevent.timeout import Timeout from collections import deque __all__ = ['Greenlet', 'joinall', 'killall'] class Spawned...
gpl-2.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/jedi/evaluate/finder.py
3
14884
""" Searching for names with given scope and name. This is very central in Jedi and Python. The name resolution is quite complicated with descripter, ``__getattribute__``, ``__getattr__``, ``global``, etc. If you want to understand name resolution, please read the first few chapters in http://blog.ionelmc.ro/2015/02/0...
gpl-3.0
avlach/univbris-ocf
optin_manager/src/python/openflow/common/rpc4django/tests/test_rpcviews.py
4
7325
''' Views Tests ------------------------- ''' import unittest import xmlrpclib from rpc4django.jsonrpcdispatcher import json, JSONRPC_SERVICE_ERROR from expedient.common.tests.manager import SettingsTestCase from django.core.urlresolvers import reverse class TestRPCViews(SettingsTestCase): urls = "expedient.com...
bsd-3-clause
lanthaler/schemaorg
lib/rdflib/plugins/parsers/pyRdfa/transform/prototype.py
23
1357
# -*- coding: utf-8 -*- """ Encoding of the RDFa prototype vocabulary behavior. This means processing the graph by adding and removing triples based on triples using the rdfa:Prototype and rdfa:ref class and property, respectively. For details, see the HTML5+RDFa document. @author: U{Ivan Herman<a href="http://www.w3...
apache-2.0
lra/boto
boto/ec2/elb/securitygroup.py
152
1576
# Copyright (c) 2010 Reza Lotun http://reza.lotun.name # # 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, modify, m...
mit
Azulinho/ansible
lib/ansible/modules/cloud/cloudstack/cs_iso.py
49
14061
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
quru/wagtail
wagtail/wagtailforms/views.py
3
3887
from __future__ import absolute_import, unicode_literals import csv import datetime from django.core.exceptions import PermissionDenied from django.http import HttpResponse from django.shortcuts import get_object_or_404, redirect, render from django.utils.encoding import smart_str from django.utils.translation import...
bsd-3-clause
sdhash/sdhash
external/tools/build/v2/build/property.py
10
17674
# Status: ported, except for tests and --abbreviate-paths. # Base revision: 64070 # # Copyright 2001, 2002, 2003 Dave Abrahams # Copyright 2006 Rene Rivera # Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or ...
apache-2.0
errx/django
tests/swappable_models/tests.py
59
2156
from __future__ import unicode_literals from django.utils.six import StringIO from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.core import management from django.test import TestCase, override_settings from swappable_models.models import Article...
bsd-3-clause
aadrian/w2ui
server/python/django_w2ui/django_w2ui/demo/views.py
25
1369
# Create your views here. from django_w2ui.demo.models import Users, Tipo_User from django_w2ui.views import W2uiGridView,W2uiFormView from django.views.generic.base import TemplateView import json class IndexView(TemplateView): template_name = 'django_w2ui/index.html' class ServerSideObjectsView(TemplateView): ...
mit
wangpanjun/django-rest-framework
tests/test_renderers.py
53
17136
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import re from collections import MutableMapping from django.conf.urls import include, url from django.core.cache import cache from django.db import models from django.test import TestCase from django.utils import six from django.utils.transl...
bsd-2-clause
aranjan7/contrail-controller-aranjan
src/config/api-server/tests/fab_tasks.py
3
4553
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import sys from fabric.api import task, lcd, prefix, execute, local @task def setup_venv(build_top = "../../../../../build"): venv_base = "%s/debug/config/api-server" %(build_top) with lcd(venv_base): local("virtualenv ut-venv") ...
apache-2.0
Lektorium-LLC/edx-platform
lms/tests.py
5
2048
"""Tests for the lms module itself.""" import mimetypes from django.core.urlresolvers import reverse from django.test import TestCase from mock import patch from edxmako import LOOKUP, add_lookup from lms import startup from openedx.features.course_experience import course_home_url_name from xmodule.modulestore.test...
agpl-3.0
lmorchard/badg.us
vendor-local/lib/python/chardet/langcyrillicmodel.py
235
17817
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
bsd-3-clause
allenai/deep_qa
tests/data/instances/sequence_tagging/test_tagging_instance.py
2
1148
# pylint: disable=no-self-use,invalid-name from deep_qa.data.instances.sequence_tagging.tagging_instance import IndexedTaggingInstance from deep_qa.testing.test_case import DeepQaTestCase from numpy.testing import assert_array_almost_equal class TestIndexedTaggingInstance(DeepQaTestCase): def setUp(self): ...
apache-2.0
qedi-r/home-assistant
homeassistant/components/mysensors/light.py
3
8091
"""Support for MySensors lights.""" from homeassistant.components import mysensors from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_HS_COLOR, ATTR_WHITE_VALUE, DOMAIN, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_WHITE_VALUE, Light, ) from homeassistant.const import STATE...
apache-2.0
pbrod/numpy
numpy/lib/ufunclike.py
7
8031
""" Module of functions that are like ufuncs in acting on arrays and optionally storing results in an output array. """ __all__ = ['fix', 'isneginf', 'isposinf'] import numpy.core.numeric as nx from numpy.core.overrides import ( array_function_dispatch, ARRAY_FUNCTION_ENABLED, ) import warnings import functools ...
bsd-3-clause
scorphus/django
tests/admin_checks/models.py
281
1836
""" Tests of ModelAdmin system checks logic. """ from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible class Album(models.Model): title = models.CharFie...
bsd-3-clause
hojel/calibre
src/calibre/gui2/dialogs/catalog.py
10
8552
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import os, sys, importlib from calibre.customize.ui import config from calibre.gui2...
gpl-3.0
jpalvarezf/csvkit
tests/test_utilities/test_csvjson.py
20
4672
#!/usr/bin/env python import json import six try: import unittest2 as unittest except ImportError: import unittest from csvkit.exceptions import NonUniqueKeyColumnException from csvkit.utilities.csvjson import CSVJSON class TestCSVJSON(unittest.TestCase): def test_simple(self): args = ['example...
mit
bluevoda/BloggyBlog
lib/python3.4/site-packages/django/utils/tree.py
116
4871
""" A class for storing a tree graph. Primarily used for filter constructs in the ORM. """ import copy from django.utils.encoding import force_str, force_text class Node(object): """ A single internal node in the tree graph. A Node should be viewed as a connection (the root) with the children being eith...
gpl-3.0
HKUST-SING/tensorflow
tensorflow/contrib/ndlstm/python/misc_test.py
93
2875
# 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 applicable ...
apache-2.0
40223110/w16b_test
static/Brython3.1.3-20150514-095342/Lib/site-packages/editor.py
84
5287
# -*- coding: utf-8 -*- import sys import time import traceback import dis from browser import document as doc, window, alert, ajax # set height of container to 66% of screen _height = doc.documentElement.clientHeight _s = doc['container'] _s.style.height = '%spx' % int(_height * 0.66) has_ace = True try: editor...
agpl-3.0
dims/cinder
cinder/tests/unit/test_hitachi_hbsd_snm2_fc.py
20
29876
# Copyright (C) 2014, Hitachi, Ltd. # # 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
TeslaProject/external_chromium_org
third_party/cython/src/Cython/Compiler/Tests/TestSignatureMatching.py
125
3408
import unittest from Cython.Compiler import PyrexTypes as pt from Cython.Compiler.ExprNodes import NameNode from Cython.Compiler.PyrexTypes import CFuncTypeArg def cfunctype(*arg_types): return pt.CFuncType(pt.c_int_type, [ CFuncTypeArg("name", arg_type, None) for arg_type in arg_types ]) def cppclasstyp...
bsd-3-clause
Jgarcia-IAS/Fidelizacion_odoo
openerp/addons/account/edi/invoice.py
342
13984
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
sauloal/PiCastPy
werkzeug/testsuite/security.py
66
1838
# -*- coding: utf-8 -*- """ werkzeug.testsuite.security ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the security helpers. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import unittest from werkzeug.testsuite import WerkzeugTestCase from werkzeug.securit...
mit
cliffe/SecGen
modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/distutils/tests/test_install_headers.py
141
1269
"""Tests for distutils.command.install_headers.""" import sys import os import unittest import getpass from distutils.command.install_headers import install_headers from distutils.tests import support from test.test_support import run_unittest class InstallHeadersTestCase(support.TempdirManager, ...
gpl-3.0
ujenmr/ansible
lib/ansible/module_utils/network/fortimanager/fortimanager.py
9
20630
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
PrathapB/LTLMoP
src/lib/executeStrategy.py
7
6765
import fsa import sys import logging,random import project class ExecutorStrategyExtensions(object): """ Extensions to Executor to allow for the strategy structure. This class provides functions to update the outputs and to check for new states in every iteration. """ def __init__(self): s...
gpl-3.0
jzoldak/edx-platform
openedx/core/djangoapps/oauth_dispatch/tests/factories.py
23
1067
# pylint: disable=missing-docstring from datetime import datetime, timedelta import factory from factory.django import DjangoModelFactory from factory.fuzzy import FuzzyText import pytz from oauth2_provider.models import Application, AccessToken, RefreshToken from student.tests.factories import UserFactory class ...
agpl-3.0
tuos/FlowAndCorrelations
mc/step2/src/RECOHI_mc.py
1
4615
# Auto generated configuration file # using: # Revision: 1.19 # Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v # with command line options: step3 --conditions auto:run2_mc_hi -s RAW2DIGI,L1Reco,RECO -n 4 --eventcontent RECODEBUG --runUnscheduled --scenario HeavyIons --datatier G...
mit
ieee8023/PDFViewer
jni/mupdf/freetype/src/tools/chktrcmp.py
381
3826
#!/usr/bin/env python # # Check trace components in FreeType 2 source. # Author: suzuki toshiya, 2009 # # This code is explicitly into the public domain. import sys import os import re SRC_FILE_LIST = [] USED_COMPONENT = {} KNOWN_COMPONENT = {} SRC_FILE_DIRS = [ "src" ] TRACE_DEF_FILES = [ "include/freetype/in...
gpl-2.0
moodpulse/l2
refprocessor/processor.py
1
1703
from typing import Tuple, Union, List from appconf.manager import SettingManager from refprocessor.age_parser import AgeRight from refprocessor.common import ValueRange, RANGE_IN from refprocessor.result_parser import ResultRight class RefProcessor: def __init__(self, ref: dict, age: List[int]): actual_k...
mit
ArcherSys/ArcherSys
Lib/site-packages/django/db/models/expressions.py
30
33239
import copy import datetime from django.conf import settings from django.core.exceptions import FieldError from django.db.backends import utils as backend_utils from django.db.models import fields from django.db.models.constants import LOOKUP_SEP from django.db.models.query_utils import Q, refs_aggregate from django.u...
mit
TacticalGoat/reddit
AutoContributor/autocontributor.py
1
2306
#/u/GoldenSights import praw # simple interface to the reddit API, also handles rate limiting of requests import time import sqlite3 '''USER CONFIGURATION''' APP_ID = "" APP_SECRET = "" APP_URI = "" APP_REFRESH = "" # https://www.reddit.com/comments/3cm1p8/how_to_make_your_bot_use_oauth2/ USERAGENT = "" #This is a sho...
mit
wildchildyn/autism-website
yanni_env/lib/python3.6/site-packages/pip/wheel.py
338
32010
""" Support for installing and building the "wheel" binary package format. """ from __future__ import absolute_import import compileall import csv import errno import functools import hashlib import logging import os import os.path import re import shutil import stat import sys import tempfile import warnings from ba...
gpl-3.0
gramps-project/gramps
gramps/plugins/quickview/linkreferences.py
11
2320
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2010 Doug Blank <doug.blank@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or ...
gpl-2.0
mganeva/mantid
Framework/PythonInterface/test/python/plugins/algorithms/CreateWorkspaceTest.py
1
4168
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
gpl-3.0
openhatch/oh-greenhouse
greenhouse/migrations/0008_auto__add_field_people_control_group.py
1
9876
# -*- 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 'People.control_group' db.add_column(u'people', 'control_group', self.g...
agpl-3.0
Milad-Rakhsha/chrono
src/demos/python/irrlicht/demo_IRR_rot_spring.py
3
4788
# ============================================================================= # PROJECT CHRONO - http:#projectchrono.org # # Copyright (c) 2014 projectchrono.org # All rights reserved. # # Use of this source code is governed by a BSD-style license that can be found # in the LICENSE file at the top level of the distri...
bsd-3-clause
sszlm/MissionPlanner
Lib/os.py
52
27059
r"""OS routines for Mac, NT, or Posix depending on what system we're on. This exports: - all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc. - os.path is one of the modules posixpath, or ntpath - os.name is 'posix', 'nt', 'os2', 'ce' or 'riscos' - os.curdir is a string representing the curr...
gpl-3.0
scrollback/kuma
vendor/packages/pyparsing/docs/examples/chemicalFormulas.py
16
2052
# chemicalFormulas.py # # Copyright (c) 2003, Paul McGuire # from pyparsing import Word, Optional, OneOrMore, Group, ParseException, Regex atomicWeight = { "O" : 15.9994, "H" : 1.00794, "Na" : 22.9897, "Cl" : 35.4527, "C" : 12.0107 } def test( bnf, strg, fn=None ): ...
mpl-2.0
spectrumone/django-outlook-api
python_tutorial/tutorial/outlookservice.py
1
4799
import requests import uuid import json outlook_api_endpoint = 'https://outlook.office.com/api/v2.0{0}' # Generic API Sending def make_api_call(method, url, token, payload = None, parameters = None): # Send these headers with all API calls headers = { 'User-Agent' : 'django-tutorial/1.0', 'Aut...
mit
abutcher/openshift-ansible
roles/lib_openshift/src/class/oc_configmap.py
46
6206
# pylint: skip-file # flake8: noqa # pylint: disable=too-many-arguments class OCConfigMap(OpenShiftCLI): ''' Openshift ConfigMap Class ConfigMaps are a way to store data inside of objects ''' def __init__(self, name, from_file, from_literal, ...
apache-2.0
andreabrambilla/libres
python/tests/res/fm/test_fm_config.py
2
1414
import os import unittest from tests import ResTest class TestFMValidity(ResTest): def setUp(self): pass def _extract_executable(self, filename): with open(filename,'r') as f: for line in f.readlines(): l = line.strip().split() if len(l)>1 and l[0]=...
gpl-3.0
mwiencek/picard
picard/ui/itemviews.py
1
27669
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # Copyright (C) 2006 Lukáš Lalinský # # 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...
gpl-2.0
mglukhikh/intellij-community
python/testData/inspections/PyArgumentListInspection/typingNamedTupleReplace.py
5
1593
import typing MyTup1 = typing.NamedTuple("MyTup1", bar=int, baz=int) mt1 = MyTup1(1, 2) # empty mt1._replace() # one mt1._replace(bar=2) mt1._replace(baz=1) mt1._replace(<warning descr="Unexpected argument">foo=1</warning>) mt1._replace(<warning descr="Unexpected argument">1</warning>) # two mt1._replace(bar=1...
apache-2.0
rubyinhell/brython
www/tests/test_re.py
15
2078
import re m = re.search('world', 'hello world') assert m is not None assert m.string == 'hello world' assert m.groups() == () m = re.match('world', 'hello world') assert m is None m = re.match('hello', 'hello world') assert m is not None assert m.string == 'hello world' assert m.groups() == () # Samples code in Pyt...
bsd-3-clause
GitHublong/hue
desktop/core/ext-py/Django-1.6.10/django/conf/locale/en_GB/formats.py
117
2112
# -*- 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 = 'j M Y' # '25 Oc...
apache-2.0
frankban/UbuntuPaste
ubuntupaste.py
1
6417
# This software is licensed under the GNU Affero General Public License # version 3 (see the file LICENSE). import itertools import os import pwd import threading import urllib import urllib2 import webbrowser import sublime import sublime_plugin class UserInterface(object): """User interface for this plugin.""...
agpl-3.0
MontrealCorpusTools/polyglot-server
iscan/annotator/models.py
1
4133
from django.db import models from polyglotdb import CorpusContext # Create your models here. class Annotation(models.Model): ITEM_TYPE_CHOICES = (('U', 'Utterance'), ('W', 'Word'), ('Y', 'Syllable'), ('P', 'Phone')) corpus = models.Fo...
mit
kkuunnddaannkk/vispy
examples/basics/gloo/multi_texture.py
18
2149
# !/usr/bin/env python # -*- coding: utf-8 -*- """Example demonstrating (and testing) multi-texturing. We create two textures. One that shows a red, green and blue band in the horizontal direction and one that does the same in the vertical direction. In the fragment shader the colors from both textures are added. """...
bsd-3-clause
dednal/chromium.src
third_party/cython/src/Cython/Compiler/PyrexTypes.py
87
136844
# # Cython/Python language types # from Code import UtilityCode, LazyUtilityCode, TempitaUtilityCode import StringEncoding import Naming import copy from Errors import error class BaseType(object): # # Base class for all Cython types including pseudo-types. # List of attribute names of any subtypes ...
bsd-3-clause
AustereCuriosity/numpy
numpy/distutils/npy_pkg_config.py
30
13241
from __future__ import division, absolute_import, print_function import sys import re import os if sys.version_info[0] < 3: from ConfigParser import RawConfigParser, NoOptionError else: from configparser import RawConfigParser, NoOptionError __all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSe...
bsd-3-clause
40223101/w16b_test
static/Brython3.1.1-20150328-091302/Lib/site-packages/highlight.py
617
2518
import keyword import _jsre as re from browser import html letters = 'abcdefghijklmnopqrstuvwxyz' letters += letters.upper()+'_' digits = '0123456789' builtin_funcs = ("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" + "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" +...
agpl-3.0
ningirsu/stepmania-server
smserver/smutils/smpacket/smpacket.py
1
34459
""" The ```SMpacket`` module ======================== Provide easy utilisation of the stepmania protocol. :Example: >>> from smserver.smutils.smpacket import smcommand >>> from smserver.smutils.smpacket import smpacket >>> # Create a new packet instance >>> packet = SMPacket.new(smcom...
mit
bobvanderlinden/machinekit
configs/sim/axis/orphans/pysubs/remap.py
28
7604
import os import signal from interpreter import * import emccanon # # to remap Tx (prepare) to an NGC file 'prepare.ngc', incantate like so: # # REMAP=T prolog=prepare_prolog epilog=prepare_epilog ngc=prepare # This means: # # prolog=prepare_prolog # before calling prepare.ngc, execute the Python function 'prepa...
lgpl-2.1
clairetang6/bokeh
tests/examples/collect_examples.py
8
2668
import yaml import os from os.path import join, dirname, abspath, pardir base_dir = dirname(__file__) example_dir = abspath(join(base_dir, pardir, pardir, 'examples')) class Flags(object): file = 1 << 1 server = 1 << 2 notebook = 1 << 3 animated = 1 << 4 skip = 1 << 5 def example_type(flags): ...
bsd-3-clause
rdo-management/ironic
ironic/db/sqlalchemy/models.py
5
7091
# -*- encoding: utf-8 -*- # # Copyright 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICE...
apache-2.0
chauhanhardik/populo_2
common/djangoapps/status/tests.py
115
2136
# -*- coding: utf-8 -*- """ Tests for setting and displaying the site status message. """ import ddt import unittest from django.test import TestCase from django.core.cache import cache from django.conf import settings from opaque_keys.edx.locations import CourseLocator from .status import get_site_status_msg from .m...
agpl-3.0
newyork167/volatility
volatility/plugins/procdump.py
44
9643
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu> # # Additional Authors: # Mike Auty <mike.auty@gmail.com> # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of...
gpl-2.0
cogmission/nupic
tests/unit/nupic/regions/knn_anomaly_classifier_region_test.py
35
30031
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
lidavidm/mathics-heroku
venv/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py
115
5836
""" This module houses the ctypes initialization procedures, as well as the notice and error handler function callbacks (get called when an error occurs in GEOS). This module also houses GEOS Pointer utilities, including get_pointer_arr(), and GEOM_PTR. """ import logging import os import re from ctypes import c_...
gpl-3.0