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
kyvinh/home-assistant
homeassistant/components/media_player/mpchc.py
11
5002
""" Support to interface with the MPC-HC Web API. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.mpchc/ """ import logging import re import requests import voluptuous as vol from homeassistant.components.media_player import ( SUPPORT_V...
apache-2.0
ychen820/microblog
y/google-cloud-sdk/platform/gsutil/gslib/tests/test_parallel_cp.py
16
9892
# -*- coding: utf-8 -*- # Copyright 2010 Google Inc. All Rights Reserved. # # 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 u...
bsd-3-clause
jd-delatorre/professional-js
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py
1825
17014
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be importe...
mit
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/boto-2.38.0/tests/unit/awslambda/__init__.py
586
1123
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
prateekgupta3991/justforlearn
languages/pt.py
42
4720
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "field1=\'newvalue\'". Não pode actualizar ou eliminar os resultados de um JOIN', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',...
mit
foobacca/django-cms
cms/plugins/file/migrations/0001_initial.py
11
3123
# -*- 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 model 'File' db.create_table('cmsplugin_file', ( ('cmsplugin_ptr', self.gf('django.db.m...
bsd-3-clause
shaunbrady/boto
boto/cloudfront/identity.py
170
4483
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
mit
giannitedesco/ircnukes
nukes/player.py
1
3727
# Copyright (c) 2007 Gianni Tedesco # Released under the terms of the GNU GPL v2 or later # # Player class from globals import * class player: def __init__(self, name): self.name = name self.hand = [] self.population = 0 self.card_stack = [] self.weapon = None self.game = None self.state = PLAYER_STATE...
gpl-2.0
takeshineshiro/django
django/contrib/gis/geos/base.py
437
1280
from ctypes import c_void_p from django.contrib.gis.geos.error import GEOSException class GEOSBase(object): """ Base object for GEOS objects that has a pointer access property that controls access to the underlying C pointer. """ # Initially the pointer is NULL. _ptr = None # Default all...
bsd-3-clause
LaunchlabAU/launchlab-django-utils
tests/test_formatters.py
1
1359
from django.test import TestCase from launchlab_django_utils.formatters.currency import currency_display from decimal import Decimal class CurrencyFormatterTestCase(TestCase): def test_nonzero_cents_int(self): value = 1234 self.assertEqual(currency_display(value), '$12.34') def test_nonzero_c...
mit
calee88/ParlAI
parlai/agents/remote_agent/agents.py
2
6850
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from parlai.core.agents imp...
bsd-3-clause
nharraud/invenio-upgrader
invenio_upgrader/upgrades/invenio_2013_09_02_new_bibARXIVPDF.py
5
1418
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
tareqalayan/ansible
lib/ansible/module_utils/facts/network/base.py
144
2402
# 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 distributed in the hope that ...
gpl-3.0
ReflexBow/ghost
tools/perf/scripts/python/net_dropmonitor.py
4235
1554
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
inonit/wagtail
wagtail/tests/customuser/migrations/0001_initial.py
4
3821
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.CreateModel( name='CustomUser', fields=[ ...
bsd-3-clause
nilsFK/py-privatekonomi
py_privatekonomi/core/parsers/avanza_parser.py
1
1212
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import py_privatekonomi.core.parser import re import csv from py_privatekonomi.core.parsers.csv_parser import CsvParser class AvanzaParser(py_privatekonomi.core.parser.Parser): def __init__(...
mit
OmarIthawi/edx-platform
lms/djangoapps/dashboard/tests/test_support.py
33
4665
""" Tests for support dashboard """ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from django.test.client import Client from django.test.utils import override_settings from django.contrib.auth.models import Permission from shoppingcart.models import CertificateItem, Order from courseware.tests....
agpl-3.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pylint/checkers/misc.py
4
3221
# Copyright (c) 2003-2016 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/COPYING """Check source code is ascii only or has an encoding declar...
gpl-3.0
rooshilp/CMPUT410Lab6
virt_env/virt1/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/generation.py
100
3976
""" This module contains functions that generate ctypes prototypes for the GDAL routines. """ from ctypes import c_char_p, c_double, c_int, c_void_p from django.contrib.gis.gdal.prototypes.errcheck import ( check_arg_errcode, check_errcode, check_geom, check_geom_offset, check_pointer, check_srs, check_str_a...
apache-2.0
abhishek-ch/hue
desktop/core/ext-py/Django-1.6.10/tests/generic_relations_regress/models.py
40
5583
from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.db.models.deletion import ProtectedError __all__ = ('Link', 'Place', 'Restaurant', 'Person', 'Address', ...
apache-2.0
rcarrillocruz/ansible
lib/ansible/modules/network/fortios/fortios_ipv4_policy.py
21
11211
#!/usr/bin/python # # Ansible module to manage IPv4 policy objects in fortigate devices # (c) 2017, Benjamin Jolivot <bjolivot@gmail.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...
gpl-3.0
Argon-Zhou/django
tests/inline_formsets/tests.py
326
6656
from __future__ import unicode_literals from django.forms.models import inlineformset_factory from django.test import TestCase, skipUnlessDBFeature from django.utils import six from .models import Child, Parent, Poem, Poet, School class DeletionTests(TestCase): def test_deletion(self): PoemFormSet = in...
bsd-3-clause
gelanivishal/pychargify
api.py
2
19966
# -*- coding: utf-8 -*- ''' 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 is distributed in the hope that it wil...
gpl-2.0
haridsv/pip
pip/_vendor/html5lib/treewalkers/__init__.py
499
5766
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
mit
raghavtan/youtube-dl
youtube_dl/extractor/novamov.py
125
2664
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urlparse, ) from ..utils import ( ExtractorError, ) class NovaMovIE(InfoExtractor): IE_NAME = 'novamov' IE_DESC = 'NovaMov' _VALID_URL_TEMPLATE = r'http://(?:(?:www\.)?%(host)s/(?:f...
unlicense
sumanthha/fundafriend
django/contrib/staticfiles/management/commands/collectstatic.py
78
12781
from __future__ import with_statement import os import sys from optparse import make_option from django.core.files.storage import FileSystemStorage from django.core.management.base import CommandError, NoArgsCommand from django.utils.encoding import smart_str, smart_unicode from django.utils.datastructures import Sor...
bsd-3-clause
HaloExchange/HaloBitcoin
contrib/spendfrom/spendfrom.py
1
10215
#!/usr/bin/env python # # Use the raw transactions API to spend halobitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a halobitcoin...
mit
spinda/liquidhaskell
benchmarks/vector-algorithms-0.5.4.2/count.py
24
1603
#!/usr/bin/python # used by count.sh import re import sys import string fname = sys.argv[1] str = (open(fname, 'r')).read() #measures = [(str[a.start():(3+string.find(str,"@-}", a.start()))]) for a in list(re.finditer('{-@ measure', str)) ] other = [(str[a.start():(3+string.find(str,"@-}", a.start()))]) for a i...
bsd-3-clause
Celelibi/syslinux
com32/cmenu/menugen.py
20
10693
#!/usr/bin/env python import sys, re, getopt class Menusystem: types = {"run" : "OPT_RUN", "inactive" : "OPT_INACTIVE", "checkbox" : "OPT_CHECKBOX", "radiomenu": "OPT_RADIOMENU", "sep" : "OPT_SEP", "invisible": "OPT_INVISIBLE", "rad...
gpl-2.0
Mauricio3000/cloth_snapshot
tests/test_snapshot.py
1
4128
import tempfile import unittest from datetime import datetime import os import pymel.core as pm from pymel.core.runtime import nClothCreate from mock import patch import tool.snapshot as ss class Test_snapshot(unittest.TestCase): def setUp(self): # New scene pm.newFile(f=True) # Get nclo...
gpl-3.0
IHTSDO/snomed-database-loader
NEO4J/snomed_g_graphdb_build_tools.py
2
21190
#!/usr/bin/python from __future__ import print_function import csv, optparse, datetime, json, sys, re, os, base64, errno, io, sqlite3, subprocess from subprocess import PIPE import snomed_g_lib_rf2, snomed_g_lib_neo4j, snomedct_constants ''' Module: snomed_g_graphdb_build_tools.py Author: Jay Pedersen, July 2016 Pur...
mit
andim/scipy
scipy/signal/_max_len_seq.py
47
3843
# Author: Eric Larson # 2014 """Tools for MLS generation""" import numpy as np from ._max_len_seq_inner import _max_len_seq_inner __all__ = ['max_len_seq'] # These are definitions of linear shift register taps for use in max_len_seq() _mls_taps = {2: [1], 3: [2], 4: [3], 5: [3], 6: [5], 7: [6], 8: [7, 6, 1], ...
bsd-3-clause
munnerz/CouchPotatoServer
libs/html5lib/treeadapters/sax.py
1835
1661
from __future__ import absolute_import, division, unicode_literals from xml.sax.xmlreader import AttributesNSImpl from ..constants import adjustForeignAttributes, unadjustForeignAttributes prefix_mapping = {} for prefix, localName, namespace in adjustForeignAttributes.values(): if prefix is not None: pre...
gpl-3.0
pprett/scikit-learn
sklearn/preprocessing/label.py
28
28237
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # Joel Nothman <joel.nothman@gmail.com> # Hamzeh Alsalhi <ha258@cornell.edu> # Licens...
bsd-3-clause
cmlasu/smm_gem5
configs/topologies/Mesh.py
47
5099
# Copyright (c) 2010 Advanced Micro Devices, 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...
bsd-3-clause
chetan/ansible
lib/ansible/runner/action_plugins/normal.py
148
2205
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.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 lat...
gpl-3.0
azatoth/scons
test/option/d.py
5
3759
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, merge, publish, ...
mit
ekwoodrich/nirha
nirhalib/venv/lib/python2.7/site-packages/pip/vcs/git.py
473
7898
import tempfile import re import os.path from pip.util import call_subprocess from pip.util import display_path, rmtree from pip.vcs import vcs, VersionControl from pip.log import logger from pip.backwardcompat import url2pathname, urlparse urlsplit = urlparse.urlsplit urlunsplit = urlparse.urlunsplit class Git(Versi...
apache-2.0
jni/skan
skan/gui.py
1
11875
import os import json import asyncio from pathlib import Path import numpy as np import matplotlib matplotlib.use('TkAgg') from matplotlib.figure import Figure from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, NavigationToolbar2Tk) import matplotlib.pyplot ...
bsd-3-clause
jfrazelle/boulder
test/v2_integration.py
1
22964
#!/usr/bin/env python2.7 """ Integration test cases for ACMEv2 as implemented by boulder-wfe2. """ import random import subprocess import requests import datetime import time import os import json import OpenSSL from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.h...
mpl-2.0
skirpichev/omg
diofant/polys/polytools.py
1
119397
"""User-friendly public interface to polynomial functions.""" import functools import operator import mpmath from ..core import (Add, Basic, Derivative, E, Expr, Integer, Mul, Tuple, oo, preorder_traversal, sympify) from ..core.compatibility import default_sort_key, iterable from ..core.decorator...
bsd-3-clause
ryfeus/lambda-packs
Tensorflow/source/tensorflow/python/ops/losses/util.py
57
3409
# 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...
mit
aifil/odoo
addons/hr_attendance/report/attendance_errors.py
47
2723
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import datetime import time from openerp.osv import osv from openerp.report import report_sxw class attendance_print(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(attendance_prin...
gpl-3.0
tushar-rishav/coala
coalib/bears/requirements/GoRequirement.py
1
1781
from coalib.bears.requirements.PackageRequirement import PackageRequirement from coalib.misc.Shell import call_without_output class GoRequirement(PackageRequirement): """ This class is a subclass of ``PackageRequirement``, and helps specifying requirements from ``go``, without using the manager name. ...
agpl-3.0
AccelAI/accel.ai
flask-aws/lib/python2.7/site-packages/botocore/model.py
4
23734
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
mit
gavin-feng/odoo
addons/mrp/__init__.py
437
1165
# -*- 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
flipjack/tecnoservicio
suit/widgets.py
10
4988
from django.contrib.admin.widgets import AdminTimeWidget, AdminDateWidget from django.forms import TextInput, Select, Textarea from django.utils.safestring import mark_safe from django import forms from django.utils.translation import ugettext as _ from django.contrib.admin.templatetags.admin_static import static cla...
bsd-3-clause
egafford/sahara
sahara/tests/unit/plugins/cdh/v5_5_0/test_edp_engine.py
3
8671
# Copyright (c) 2015 Intel Corporation # # 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
dudymas/python-openstacksdk
openstack/tests/unit/image/v2/test_tag.py
3
2140
# 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 # distributed under t...
apache-2.0
HiroIshikawa/21playground
learning/venv/lib/python3.5/site-packages/flask/testsuite/templating.py
562
11237
# -*- coding: utf-8 -*- """ flask.testsuite.templating ~~~~~~~~~~~~~~~~~~~~~~~~~~ Template functionality :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from flask.testsuite import FlaskTestCase class TemplatingTestCase(Flask...
mit
uzgit/ardupilot
mk/VRBRAIN/Tools/genmsg/scripts/genmsg_check_deps.py
51
3068
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2014, Open Source Robotics Foundation, 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: # # * ...
gpl-3.0
vencax/django-vxk-forum
vxkforum/fields.py
1
3734
""" Details about AutoOneToOneField: http://softwaremaniacs.org/blog/2007/03/07/auto-one-to-one-field/ """ try: from cStringIO import StringIO except ImportError: from StringIO import StringIO import random from django.db.models import OneToOneField from django.db.models.fields.related import SingleRelated...
bsd-3-clause
lucafavatella/intellij-community
python/lib/Lib/site-packages/django/contrib/localflavor/jp/forms.py
333
1211
""" JP-specific Form helpers """ from django.forms import ValidationError from django.utils.translation import ugettext_lazy as _ from django.forms.fields import RegexField, Select class JPPostalCodeField(RegexField): """ A form field that validates its input is a Japanese postcode. Accepts 7 digits, wit...
apache-2.0
FAB4D/humanitas
prediction/esn/meboot.py
1
2655
""" MEBOOT.PY - Python package for the meboot (Maximum Entropy Bootstrap) algorithm for Time Series Author: Fabian Brix Method by H.D. Vinod, Fordham University - """ import sys import numpy as np import matplotlib.pyplot as plt def sort(series): ind_sorted = np.argsort(series) s_sorted = series[i...
bsd-3-clause
Nikoala/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/aes.py
23
15187
from __future__ import unicode_literals __all__ = ['aes_encrypt', 'key_expansion', 'aes_ctr_decrypt', 'aes_cbc_decrypt', 'aes_decrypt_text'] import base64 from math import ceil from .utils import bytes_to_intlist, intlist_to_bytes BLOCK_SIZE_BYTES = 16 def aes_ctr_decrypt(data, key, counter): """ Decrypt ...
gpl-3.0
merrywhether/autoprotocol-python
autoprotocol/unit.py
1
4980
from __future__ import division, print_function from pint import UnitRegistry from pint.quantity import _Quantity import sys if sys.version_info[0] >= 3: string_type = str else: string_type = basestring ''' :copyright: 2016 by The Autoprotocol Development Team, see AUTHORS for more details. :l...
bsd-3-clause
ErikSeguinte/Personal-Code-library
Symbol_table/frequencyCounter.py
1
1209
import __future__ import sys import string def main(ST): if len(sys.argv) > 1: input_file = sys.argv[1] else: input_file = "tale.txt" st = ST() with open(input_file,'r') as i_file: for line in i_file: if line == '\n': continue line = l...
mit
1119553797/sprd-kernel-common
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
Subito/ansible-modules-extras
cloud/amazon/route53_zone.py
37
5487
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
Nosferatul/coala
coalib/core/Core.py
1
17806
import asyncio import concurrent.futures import functools import logging from coalib.core.DependencyTracker import DependencyTracker from coalib.core.Graphs import traverse_graph from coalib.core.PersistentHash import persistent_hash def group(iterable, key=lambda x: x): """ Groups elements (out-of-order) to...
agpl-3.0
lebauce/artub
bike/transformer/WordRewriter.py
2
1818
from bike.parsing.load import getSourceNode from bike.transformer.undo import getUndoStack from bike.transformer.save import queueFileToSave import re # This class maintains a set of changed lines to the original source # nodes. This is important because the act of changing a line messes # up the coordinates on which ...
gpl-2.0
xzYue/odoo
addons/base_report_designer/__openerp__.py
260
1704
# -*- 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
hydrospanner/DForurm
DForurm/env/Lib/site-packages/django/contrib/gis/serializers/geojson.py
36
2813
from __future__ import unicode_literals from django.contrib.gis.gdal import CoordTransform, SpatialReference from django.core.serializers.base import SerializerDoesNotExist from django.core.serializers.json import Serializer as JSONSerializer class Serializer(JSONSerializer): """ Convert a queryset to GeoJSO...
mit
Belgabor/django
django/contrib/localflavor/kw/forms.py
310
1988
""" Kuwait-specific Form helpers """ import re from datetime import date from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField from django.utils.translation import gettext as _ id_re = re.compile(r'^(?P<initial>\d{1})(?P<yy>\d\d)(?P<...
bsd-3-clause
tst-ppenev/earthenterprise
earth_enterprise/src/server/wsgi/serve/snippets_db_manager.py
1
4640
#!/usr/bin/python # # Copyright 2017 Google Inc. # Copyright 2018 Open GEE Contributors # # 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 # #...
apache-2.0
nazo/ansible
lib/ansible/modules/web_infrastructure/ejabberd_user.py
48
7599
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2013, Peter Sprygada <sprygada@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 3 of the License, or # (at ...
gpl-3.0
LittlePeng/redis-monitor
src/api/controller/SettingsController.py
4
1733
from BaseController import BaseController from api.util import settings import os class SettingsController(BaseController): def get(self): server_list="" for server in settings.get_redis_servers(): server_list+= "%(server)s:%(port)s %(group)s %(instance)s\r\n" % server ...
mit
rajadhva/servo
python/mach/mach/commands/settings.py
96
1799
# 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/. from __future__ import absolute_import, print_function, unicode_literals from textwrap import TextWrapper from mach.de...
mpl-2.0
ant6/Monte-Carlo-Modulators
mcm/peak_reader.py
1
1163
from itertools import zip_longest import numpy as np __all__ = ["read_one_peak"] def transposed(matrix): """Return transposed matrix (list of lists). This function can handle non-square matrices. In this case it fills shorter list with None. >>> transposed( [[1,2,3], [3,4]] ) [[1, 3], [2, 4], ...
mit
cmarguel/skybot
bot.py
8
1256
#!/usr/bin/env python import os import Queue import sys import traceback import time sys.path += ['plugins'] # so 'import hook' works without duplication sys.path += ['lib'] os.chdir(sys.path[0] or '.') # do stuff relative to the install directory class Bot(object): def __init__(self): self.conns = {}...
unlicense
SNoiraud/gramps
gramps/plugins/importer/importxml.py
2
132877
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 200?-2013 Benny Malengier # Copyright (C) 2009 Douglas S. Blank # Copyright (C) 2010-2011 Nick Hall # Copyright (C) 2011 Michiel D. Nauta # Copyright (C) 2011 Tim G L Lyons # # This pro...
gpl-2.0
EnEff-BIM/EnEffBIM-Framework
SimModel_Python_API/simmodel_swig/Release/SimGroup_HvacDemandGroup_WaterSystem.py
1
8891
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.7 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2, 6, 0): def swig_import_helper(): from os.path imp...
mit
Prash88/my-wedding
node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py
1824
3474
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """gypd output module This module produces gyp input as its output. Output files are given the .gypd extension to avoid overwriting the .gyp files that they are ...
mit
ioam/svn-history
contrib/basic.py
1
38948
""" Simple two-dimensional mathematical or geometrical pattern generators. $Id$ """ from __future__ import with_statement __version__='$Revision: 10131 $' from math import pi, sin, cos, sqrt import numpy from numpy.oldnumeric import around,bitwise_and,sin,add,Float,bitwise_or from numpy import alltrue from .. imp...
bsd-3-clause
llonchj/sentry
src/sentry/web/frontend/projects/plugins.py
13
5812
""" sentry.web.frontend.projects.plugins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from django.contrib import messages from django.core.context_processors import cs...
bsd-3-clause
Reflexe/doc_to_pdf
Windows/program/python-core-3.5.0/lib/encodings/tis_620.py
272
12300
""" Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='st...
mpl-2.0
tameemsafi/learning-python-3
projects/tic-tac-toe.py
1
2422
# Tic Tack Toe Game in Python 3 # -> Simple tic-tac-toe game in the console current_board_number = 0 board = ["{0}".format(i + 1) for i in range(9)] def print_board(): row1 = "| {0} | {1} | {2} |".format(board[0], board[1], board[2]) row2 = "| {0} | {1} | {2} |".format(board[3], board[4], board[5]) row3 = "| {0} |...
gpl-3.0
IsCoolEntertainment/debpkg_python-boto
boto/mturk/__init__.py
782
1108
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
mit
popazerty/dvbapp2-gui
lib/python/Plugins/SystemPlugins/VideoClippingSetup/plugin.py
7
5719
from Screens.Screen import Screen from Components.ConfigList import ConfigListScreen from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSlider, getConfigListEntry config.plugins.VideoClippingSetup = ConfigSubsection() config.plugins.VideoClippingSetup.clip_left = ConfigInteger(default = 0) co...
gpl-2.0
blighj/django
tests/utils_tests/test_safestring.py
58
3447
from django.template import Context, Template from django.test import SimpleTestCase from django.utils import html, text from django.utils.functional import lazy, lazystr from django.utils.safestring import SafeData, mark_safe class customescape(str): def __html__(self): # implement specific and obviously...
bsd-3-clause
mancoast/CPythonPyc_test
cpython/272_test_contains.py
136
3153
from test.test_support import have_unicode, run_unittest import unittest class base_set: def __init__(self, el): self.el = el class set(base_set): def __contains__(self, el): return self.el == el class seq(base_set): def __getitem__(self, n): return [self.el][n] class TestConta...
gpl-3.0
milkpku/BetaElephant
policy_experiment/analysis.py
1
1189
import numpy as np import matplotlib.pyplot as plt def load_log_file(file_path): fh = open(file_path) s = fh.readlines() accuarcy = np.zeros((len(s),)) for i in range(len(s)): accuarcy[i] = float(s[i][-5:-1]) return accuarcy def smooth(array, window=250): count = 0 for i in range...
mit
mwegrzynek/auth_ldap_set_email
__openerp__.py
1
1566
# -*- coding: utf-8 -*- ############################################################################## # # Odoo, Open Source Management Solution # Copyright (C) 2005-Today Litex Service Sp. z o.o. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affer...
agpl-3.0
Metronotes/bitcoin
contrib/devtools/update-translations.py
54
2334
#!/usr/bin/python # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script from the root of the repository to update all translations from transifex. It will do the follo...
mit
pouyana/teireader
webui/applications/admin/languages/uk.py
16
43559
# coding: utf8 { '!langcode!': 'uk', '!langname!': 'Українська', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Оновити" це додатковий вираз, такий, як "field1=\'нове_значення\'". Ви не можете змінювати або вилучати дані об\'єднаних таблиць', '"User...
mit
CUCWD/edx-platform
common/djangoapps/microsite_configuration/tests/backends/test_database.py
18
7307
""" Test Microsite database backends. """ import logging from mock import patch from django.conf import settings from microsite_configuration.backends.base import ( BaseMicrositeBackend, BaseMicrositeTemplateBackend, ) from microsite_configuration import microsite from microsite_configuration.models import ( ...
agpl-3.0
HutchinHuang/New_Intern_Reminder
change_input.py
1
2026
# -*- coding:utf-8 -*- # A small script to get the city-code in shixiseng.com and use shelve module to save all the parameters' change rules. import re import requests import shelve def get_city_code(): """ This Function is used to get the names and codes of the cities supported by shixiseng.com. :return:...
mit
GeraldLoeffler/nupic
nupic/encoders/__init__.py
40
1580
# ---------------------------------------------------------------------- # 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 apply: # # This progra...
agpl-3.0
JioCloud/neutron
neutron/tests/api/test_subnetpools.py
10
12170
# Copyright 2015 Hewlett-Packard Development Company, L.P. # 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...
apache-2.0
hdznrrd/siid
apps/powermeter.py
1
1250
#!/usr/bin/python # # get the latest power consumption values from redis in JSON format # pass parameter ?n=<number> to control the number of items returned # # {"Total": [3734, ...], "Minutes ago": [0, ...], "L1.Power": [1612, ...], "L3.Power": [1363, ...], "L2.Power": [759, ...]} # import redis import json import cg...
mit
Midrya/chromium
testing_support/trial_dir.py
47
2749
# Copyright (c) 2011 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 atexit import logging import os import sys import tempfile from testing_support import auto_stub import gclient_utils class TrialDir(object):...
bsd-3-clause
mKeRix/home-assistant
homeassistant/components/xiaomi_miio/sensor.py
4
7833
"""Support for Xiaomi Mi Air Quality Monitor (PM2.5).""" from dataclasses import dataclass import logging from miio import AirQualityMonitor, DeviceException # pylint: disable=import-error from miio.gateway import DeviceType import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from ho...
mit
mwv/scikit-learn
sklearn/lda.py
72
17751
""" Linear Discriminant Analysis (LDA) """ # Authors: Clemens Brunner # Martin Billinger # Matthieu Perrot # Mathieu Blondel # License: BSD 3-Clause from __future__ import print_function import warnings import numpy as np from scipy import linalg from .externals.six import string_types f...
bsd-3-clause
HerlanAssis/Django-AulaOsvandoSantana
lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py
1182
3734
######################## 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. # # Con...
mit
xsmart/bluecherry-client
breakpad/src/testing/test/gmock_test_utils.py
11
4157
#!/usr/bin/python2.4 # # 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 ...
gpl-2.0
glove747/liberty-neutron
neutron/tests/unit/plugins/ml2/drivers/mech_fake_agent.py
47
2697
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K. # Copyright (C) 2014 Fumihiko Kakuma <kakuma at valinux co jp> # Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp> # All Rights Reserved. # # Based on openvswitch mechanism driver. # # Copyright (c) 2013 OpenStack Foundation # All Rights Reserved....
apache-2.0
1adrianb/face-alignment
face_alignment/detection/blazeface/net_blazeface.py
1
16693
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class BlazeBlock(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=3, stride=1): super(BlazeBlock, self).__init__() self.stride = stride self.channel_pad = out_channels - i...
bsd-3-clause
akshatharaj/django
tests/proxy_model_inheritance/tests.py
278
1764
from __future__ import absolute_import, unicode_literals import os from django.core.management import call_command from django.test import TestCase, TransactionTestCase from django.test.utils import extend_sys_path from django.utils._os import upath from .models import ( ConcreteModel, ConcreteModelSubclass, Con...
bsd-3-clause
pongem/python-bot-project
appengine/standard/localtesting/mail_test.py
9
1506
# Copyright 2015 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 t...
apache-2.0
madjam/mxnet
example/python-howto/monitor_weights.py
12
1987
# 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