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
flockchat/pyflock
flockos/models/image.py
1
1421
# coding: utf-8 from pprint import pformat from ..utils import to_dict class Image(object): def __init__(self, src=None, width=None, height=None): self._src = src self._width = width self._height = height @property def src(self): return self._src @src.setter ...
apache-2.0
Stanislavska/MoviesRental1
vendor/doctrine/orm/docs/en/_exts/configurationblock.py
2577
3506
#Copyright (c) 2010 Fabien Potencier # #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, distrib...
mit
Denon/syncPlaylist
WYtoQQ.py
1
5106
import urlparse import re from time import sleep from base import BaseSpider from settings import * from urllib2 import quote from api.wy import get_playlist_detail from utils import _print, retry, RetryException class WYtoQQ(BaseSpider): @retry(retry_times=3, notice_message="login failed and retry") def pre...
mit
Philippe12/external_chromium_org
components/policy/tools/syntax_check_policy_template_json.py
51
18860
#!/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. ''' Checks a policy_templates.json file for conformity to its syntax specification. ''' import json import optparse import os impo...
bsd-3-clause
Just-D/chromium-1
third_party/cython/src/Cython/Distutils/build_ext.py
94
12955
"""Cython.Distutils.build_ext Implements a version of the Distutils 'build_ext' command, for building Cython extension modules.""" # This module should be kept compatible with Python 2.3. __revision__ = "$Id:$" import sys import os import re from distutils.core import Command from distutils.errors import DistutilsP...
bsd-3-clause
tanium/pytan
EXAMPLES/PYTAN_API/invalid_export_basetype_csv_bad_sort_type.py
1
3820
#!/usr/bin/env python """ Export a BaseType from getting objects using a bad header_sort """ # import the basic python packages we need import os import sys import tempfile import pprint import traceback # disable python from generating a .pyc file sys.dont_write_bytecode = True # change me to the path of pytan if th...
mit
mdrumond/tensorflow
tensorflow/python/training/gradient_descent.py
99
2907
# 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
meego-tablet-ux/meego-app-browser
chrome/test/functional/media_test_env_names.py
2
1899
#!/usr/bin/python # 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. class MediaTestEnvNames: """Class that contains all environment names used in media tests. Since PyAuto does not support command...
bsd-3-clause
cnbeining/shadowsocks
tests/test_udp_src.py
1009
2482
#!/usr/bin/python import socket import socks SERVER_IP = '127.0.0.1' SERVER_PORT = 1081 if __name__ == '__main__': # Test 1: same source port IPv4 sock_out = socks.socksocket(socket.AF_INET, socket.SOCK_DGRAM, socket.SOL_UDP) sock_out.set_proxy(socks.SOCKS5, SERVER_IP, S...
apache-2.0
indautgrp/frappe
frappe/api.py
1
4534
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import json import frappe import frappe.handler import frappe.client from frappe.utils.response import build_response from frappe import _ from urlparse import urlparse from urlli...
mit
cvanwie/namebench
libnamebench/reporter.py
173
16737
# Copyright 2009 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
neilhan/tensorflow
tensorflow/contrib/metrics/python/ops/metric_ops_test.py
4
151938
# 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
LinusU/ansible-modules-extras
cloud/profitbricks/profitbricks_volume.py
101
11378
#!/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
yograterol/django
tests/admin_widgets/tests.py
65
57929
# -*- coding: utf-8 -*- from __future__ import unicode_literals import gettext import os from datetime import datetime, timedelta from importlib import import_module from unittest import skipIf from django import forms from django.conf import settings from django.contrib import admin from django.contrib.admin import ...
bsd-3-clause
TailorDev/django-guardian
guardian/utils.py
2
6563
""" django-guardian helper functions. Functions defined within this module should be considered as django-guardian's internal functionality. They are **not** guaranteed to be stable - which means they actual input parameters/output type may change in future releases. """ from __future__ import unicode_literals import ...
bsd-2-clause
renhaoqi/gem5-stable
src/dev/mips/Malta.py
45
3026
# Copyright (c) 2007 The Regents of The University of Michigan # 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
sudheerchintala/LearnEraPlatForm
common/djangoapps/student/migrations/0011_auto__chg_field_courseenrollment_user__del_unique_courseenrollment_use.py
188
10239
# -*- 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): # This table is dropped in a subsequent migration. This migration was causing problems when using InnoDB, # ...
agpl-3.0
medunigraz/outpost
src/outpost/django/signage/admin.py
2
2693
from django.contrib import admin from ordered_model.admin import OrderedModelAdmin from polymorphic.admin import ( PolymorphicChildModelAdmin, PolymorphicChildModelFilter, PolymorphicParentModelAdmin, ) from reversion.admin import VersionAdmin from . import models @admin.register(models.Building) class B...
bsd-2-clause
sgmap/openfisca-france
openfisca_france/model/prestations/minima_sociaux/aefa.py
1
2983
# -*- coding: utf-8 -*- from openfisca_france.model.base import * from openfisca_france.model.prestations.prestations_familiales.base_ressource import nb_enf class aefa(Variable): ''' Aide exceptionelle de fin d'année (prime de Noël) Instituée en 1998 Apparaît sous le nom de complément de rmi dans le...
agpl-3.0
alex/pip
tests/lib/git_submodule_helpers.py
58
2960
from __future__ import absolute_import import textwrap def _create_test_package_submodule(env): env.scratch_path.join("version_pkg_submodule").mkdir() submodule_path = env.scratch_path / 'version_pkg_submodule' env.run('touch', 'testfile', cwd=submodule_path) env.run('git', 'init', cwd=submodule_path...
mit
simudream/linux
tools/perf/util/setup.py
766
1540
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
hdinsight/hue
desktop/core/ext-py/Django-1.6.10/django/utils/datastructures.py
105
15846
import copy import warnings from django.utils import six class MergeDict(object): """ A simple class for creating new "virtual" dictionaries that actually look up values in more than one dictionary, passed in the constructor. If a key appears in more than one of the given dictionaries, only the f...
apache-2.0
olyhaa/OlyEats
olyeats/recipe/forms.py
1
3642
from django.forms import ModelForm from django.template.loader import render_to_string from models import Recipe import django.forms as forms from django.forms.models import BaseInlineFormSet from django.conf import settings from django.contrib.sites.models import Site from django.template import loader, RequestContext...
gpl-2.0
leonardoarroyo/django-react-cms
react_cms/widgets.py
1
1852
import json from django.forms.widgets import Widget from django.conf import settings from django.utils.safestring import mark_safe from django.template.loader import render_to_string from collections import OrderedDict from react_cms.finders import ComponentFinder class ResourceEditorWidget(Widget): template_name ...
mit
Teagan42/home-assistant
homeassistant/components/xiaomi_tv/media_player.py
3
3138
"""Add support for the Xiaomi TVs.""" import logging import pymitv import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice from homeassistant.components.media_player.const import ( SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_STEP, ) from homeassi...
apache-2.0
spicyfish/freenos
site_scons/dist.py
6
6921
# # Copyright (C) 2009 Niek Linnenbank # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distribute...
gpl-3.0
Jbonnett/Mutagen-flo
mutagen/wavpack.py
12
1787
# A WavPack reader/tagger # # Copyright 2006 Joe Wreschnig # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # $Id: wavpack.py 3997 2007-02-25 21:44:53Z piman $ """WavPack reading a...
gpl-2.0
atheed/servo
tests/wpt/harness/wptrunner/update/update.py
118
5053
# 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/. import os import sys from metadata import MetadataUpdateRunner from sync import SyncFromUpstreamRunner from tree import...
mpl-2.0
noisypants/googletest
test/gtest_break_on_failure_unittest.py
2140
7339
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
opentrials/collectors
collectors/isrctn/record.py
2
2392
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from .. import base from ..base.fields import Text, Date, Json # Module API class Record(base.Record): # Config table = 'isrctn' ...
mit
henry808/quick_tutorial
jinja2/tutorial/tests.py
6
1137
import unittest from pyramid import testing class TutorialViewTests(unittest.TestCase): def setUp(self): self.config = testing.setUp() def tearDown(self): testing.tearDown() def test_home(self): from .views import TutorialViews request = testing.DummyRequest() i...
mit
danieljaouen/ansible
lib/ansible/modules/cloud/docker/docker_image.py
2
22355
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # 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', 'status': ['prev...
gpl-3.0
le9i0nx/ansible
lib/ansible/modules/system/hostname.py
15
24751
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Hiroaki Nakamura <hnakamur@gmail.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 ANSIBLE_METADATA = {'metadata_versi...
gpl-3.0
mindw/numpy
numpy/linalg/lapack_lite/clapack_scrub.py
76
7701
#!/usr/bin/env python from __future__ import division, absolute_import, print_function import sys, os from io import StringIO import re from Plex import * from Plex.Traditional import re as Re class MyScanner(Scanner): def __init__(self, info, name='<default>'): Scanner.__init__(self, self.lexicon, info,...
bsd-3-clause
kaichogami/scikit-learn
sklearn/externals/joblib/memory.py
68
36332
""" A context object for caching a function's return value each time it is called with the same input arguments. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. from __future__ import with_statement import os import shutil ...
bsd-3-clause
autogestion/sh_ctracker
ctracker/sql.py
1
7452
from django.db import connection claim_to_polygon_join = """ LEFT OUTER JOIN ctracker_polygon_organizations ON (houses.polygon_id = ctracker_polygon_organizations.polygon_id) LEFT OUTER JOIN ctracker_organization ON (ctracker_polygon_organizations.organization_id = ctracker_organization.id) LEFT OU...
bsd-3-clause
9Bdog2/Bachelor-Project
node_modules/meanio/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py
2485
5536
# This file comes from # https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py # Do not edit! Edit the upstream one instead. """Python module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that alr...
mit
wolverineav/horizon
openstack_dashboard/dashboards/admin/aggregates/urls.py
13
1031
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
retomerz/intellij-community
python/lib/Lib/site-packages/django/contrib/localflavor/us/us_states.py
69
7577
""" A mapping of state misspellings/abbreviations to normalized abbreviations, and alphabetical lists of US states, territories, military mail regions and non-US states to which the US provides postal service. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ # The...
apache-2.0
Deepakkothandan/ansible-modules-extras
network/f5/bigip_pool.py
9
20373
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Matt Hite <mhite@hotmail.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...
gpl-3.0
zynga/jasy
jasy/core/Config.py
1
10980
# # Jasy - Web Tooling Framework # Copyright 2010-2012 Zynga Inc. # import sys, os, yaml, json import jasy.core.Console as Console import jasy.core.File as File from jasy import UserError from jasy.core.Util import getKey __all__ = [ "Config", "findConfig", "loadConfig", "writeConfig" ] def findConfig(fileName):...
mit
kontrafiktion/ansible
lib/ansible/playbook/task.py
5
17794
# (c) 2012-2014, 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) an...
gpl-3.0
uni2u/neutron
neutron/plugins/ml2/drivers/type_flat.py
13
5104
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
lindsayad/sympy
sympy/physics/quantum/tests/test_qubit.py
83
7934
import random from sympy import Integer, Matrix, Rational, sqrt, symbols from sympy.core.compatibility import range from sympy.physics.quantum.qubit import (measure_all, measure_partial, matrix_to_qubit, matrix_to_density, qubit_to_matri...
bsd-3-clause
Dellware78/mtasa-blue
vendor/google-breakpad/src/third_party/protobuf/protobuf/gtest/test/gtest_help_test.py
227
5760
#!/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...
gpl-3.0
defionscode/ansible
lib/ansible/modules/cloud/google/gcp_pubsub_topic.py
12
6369
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
ceph/autotest
scheduler/monitor_db_functional_test.py
1
42015
#!/usr/bin/python import logging, os, unittest import common from autotest_lib.client.common_lib import enum, global_config, host_protections from autotest_lib.database import database_connection from autotest_lib.frontend import setup_django_environment from autotest_lib.frontend.afe import frontend_test_utils, model...
gpl-2.0
password123456/lotto
get_random_generate_number_sendmessage.py
1
5900
#!/usr/local/bin/python2.7 # -*- coding: utf-8 -*- __author__ = 'https://github.com/password123456/' import random import numpy as np import sys reload(sys) sys.setdefaultencoding('utf-8') import requests import urllib import urllib2 import json import datetime import time import dateutil.relativedelta as REL class b...
apache-2.0
selvasingh/azure-sdk-for-java
eng/pipelines/scripts/generate_overview_from_readme.py
1
3812
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # Use case: Given a README.md file, generate a readme_overview.html file and place it next # to the README.md. This will allow the javadocs jar step to append the contents of the # readme onto the landing page. # # This scrip...
mit
numerigraphe/odoo
addons/stock/__openerp__.py
261
4008
# -*- 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
Partoo/scrapy
tests/test_utils_signal.py
15
2991
from twisted.trial import unittest from twisted.python import log as txlog from twisted.python.failure import Failure from twisted.internet import defer, reactor from scrapy.xlib.pydispatch import dispatcher from scrapy.utils.signal import send_catch_log, send_catch_log_deferred from scrapy import log class SendCatch...
bsd-3-clause
rjhunter8285/nsc-cloudproject-s22016
prototype/api/FlaskApp/FlaskApp/python_modules/oauthlib/oauth2/__init__.py
86
1441
# -*- coding: utf-8 -*- """ oauthlib.oauth2 ~~~~~~~~~~~~~~ This module is a wrapper for the most recent implementation of OAuth 2.0 Client and Server classes. """ from __future__ import absolute_import, unicode_literals from .rfc6749.clients import Client from .rfc6749.clients import WebApplicationClient from .rfc674...
apache-2.0
kdheepak89/pelican-plugins
glossary/glossary.py
2
1830
""" Builds a glossary page containing definition lists found in articles and pages, and adds a `definitions` variable visible to all page templates. """ from pelican import signals, contents from bs4 import BeautifulSoup class Definitions(): definitions = [] exclude = [] def extract_definitions(content): ...
agpl-3.0
crustymonkey/pylibgal3
libg3/Errors.py
1
1431
# # Author: Jay Deiman # Email: admin@splitstreams.com # # This file is part of pylibgal3. # # pylibgal3 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 # ...
gpl-3.0
cathay4t/libstoragemgmt
python_binding/lsm/__init__.py
5
1330
# Copyright (C) 2011-2016 Red Hat, Inc. # This library 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 2.1 of the License, or any later version. # # This library is distributed in the h...
lgpl-2.1
youdonghai/intellij-community
python/helpers/coveragepy/coverage/misc.py
39
7819
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Miscellaneous stuff for coverage.py.""" import errno import hashlib import inspect import locale import os import sys import types from coverage import env fro...
apache-2.0
mwilliamson/toodlepip
toodlepip/build.py
1
3620
from . import config, files from .consoles import Console, Command from .platforms import builders from .temp import create_temp_dir def create_builder(shell, stdout): return Builder(builders, Console(shell, stdout)) class Builder(object): def __init__(self, builders, console): self._console = conso...
bsd-2-clause
kevinge314gh/tornado
tornado/process.py
109
12043
#!/usr/bin/env python # # Copyright 2011 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...
apache-2.0
opensvn/python
pygame/bpwpapcode/Chapter06/joystickdemo.py
1
3510
import pygame from pygame.locals import * from sys import exit pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) # Get a list of joystick objects joysticks = [] for joystick_no in xrange(pygame.joystick.get_count()): stick = pygame.joystick.Joystick(joystick_no) stick.init() jo...
gpl-2.0
cgwalters/imagefactory
imagefactory_plugins/OVA/OVA.py
1
3390
# encoding: utf-8 # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
brokenjacobs/ansible
test/runner/lib/core_ci.py
27
12857
"""Access Ansible Core CI remote services.""" from __future__ import absolute_import, print_function import json import os import traceback import uuid import errno import time from lib.http import ( HttpClient, HttpResponse, HttpError, ) from lib.util import ( ApplicationError, run_command, ...
gpl-3.0
constKutsy/GeoWiki
.compit/lib/python3.6/site-packages/pip/_vendor/progress/spinner.py
510
1314
# -*- coding: utf-8 -*- # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS P...
unlicense
aninternetof/bremen
bremenenv/lib/python3.5/site-packages/django/views/decorators/cache.py
586
2304
from functools import wraps from django.middleware.cache import CacheMiddleware from django.utils.cache import add_never_cache_headers, patch_cache_control from django.utils.decorators import ( available_attrs, decorator_from_middleware_with_args, ) def cache_page(*args, **kwargs): """ Decorator for view...
mit
queenp/wakatime
wakatime/packages/pygments_py3/pygments/__init__.py
29
2980
# -*- coding: utf-8 -*- """ Pygments ~~~~~~~~ Pygments is a syntax highlighting package written in Python. It is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code. Highlights are: * a ...
bsd-3-clause
rnixx/kivy-ios
tools/external/jinja2/ext.py
603
25078
# -*- coding: utf-8 -*- """ jinja2.ext ~~~~~~~~~~ Jinja extensions allow to add custom tags similar to the way django custom tags work. By default two example extensions exist: an i18n and a cache extension. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ from jinja2 import nod...
mit
philgyford/django-ditto
setup.py
1
4093
import codecs import os import re import sys from setuptools import setup with open(os.path.join(os.path.dirname(__file__), "README.rst")) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) def read(filepath):...
mit
hanguofeng/shadowsocks
shadowsocks/daemon.py
694
5602
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2014-2015 clowwindy # # 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 requi...
apache-2.0
brandon-rhodes/numpy
numpy/lib/tests/test_twodim_base.py
36
16684
"""Test functions for matrix module """ from __future__ import division, absolute_import, print_function from numpy.testing import ( TestCase, run_module_suite, assert_equal, assert_array_equal, assert_array_max_ulp, assert_array_almost_equal, assert_raises, rand, ) from numpy import ( arange, rot90,...
bsd-3-clause
MarcelGerber/brackets-shell
gyp/pylib/gyp/generator/gypsh.py
2779
1665
# 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. """gypsh output module gypsh is a GYP shell. It's not really a generator per se. All it does is fire up an interactive Python session with a few local variables...
mit
ahaldane/numpy
numpy/f2py/f2py2e.py
6
23995
#!/usr/bin/env python """ f2py2e - Fortran to Python C/API generator. 2nd Edition. See __usage__ below. Copyright 1999--2011 Pearu Peterson all rights reserved, Pearu Peterson <pearu@cens.ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRAN...
bsd-3-clause
rohitranjan1991/home-assistant
homeassistant/components/device_tracker/owntracks.py
2
1498
""" homeassistant.components.device_tracker.owntracks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OwnTracks platform for the device tracker. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.owntracks.html """ import json import logging...
mit
alibbaba/ShaniXBMCWork2
plugin.video.live.streamspro/websocket/_handshake.py
57
4830
""" websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) This library 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 2.1 of the License, ...
gpl-2.0
armanpazouki/chrono
src/demos/python/demo_crank_plot.py
1
5655
#------------------------------------------------------------------------------ # Name: pychrono example # Purpose: # # Author: Alessandro Tasora # # Created: 1/01/2019 # Copyright: (c) ProjectChrono 2019 #------------------------------------------------------------------------------ import pychrono...
bsd-3-clause
msmolens/VTK
ThirdParty/Twisted/twisted/words/test/test_tap.py
40
2169
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.cred import credentials, error from twisted.words import tap from twisted.trial import unittest class WordsTap(unittest.TestCase): """ Ensures that the twisted.words.tap API works. """ PASSWD_TEXT = "admin:admin\nj...
bsd-3-clause
dotpmrcunha/gnuradio
gr-digital/examples/narrowband/digital_bert_rx.py
58
7939
#!/usr/bin/env python # # Copyright 2008,2011,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your ...
gpl-3.0
not-nexus/shelf
shelf/search/update_manager.py
2
7045
from shelf.search.metadata import Metadata from elasticsearch_dsl.query import Q from elasticsearch_dsl import Search from elasticsearch.helpers import scan, bulk from shelf.search.type import Type as SearchType from shelf.metadata.keys import Keys as MetadataKeys class UpdateManager(object): def __init__(self, l...
mit
iakinsey/moneybot
moneybot/commands/fedspeak.py
1
1981
from moneybot.command import Command from moneybot.exc import InvalidCommand from moneybot.ledger import transfer_balance from random import choice class FedSpeak(Command): prefix = "fedspeak" description = "Speak like the federal reserve!" options = [ "The members of the Board of Governors and t...
mit
sve-odoo/odoo
addons/hr_gamification/wizard/grant_badge.py
180
2524
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
c86j224s/snippet
Python_asyncio_binary_echo/pyclient2/Lib/site-packages/pip/_vendor/chardet/langgreekmodel.py
269
12688
######################## 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...
apache-2.0
matsumoto-r/synciga
src/tools/gyp/test/compiler-override/gyptest-compiler-global-settings.py
88
1407
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that make_global_settings can be used to override the compiler settings. """ import TestGyp import os import copy import sys fro...
bsd-3-clause
Amber819/chatbot_AM
data_utils.py
1
9930
from __future__ import absolute_import import os import re import numpy as np import tensorflow as tf from six.moves import range, reduce stop_words=set(["a","an","the"]) def load_candidates(data_dir, task_id): assert task_id > 0 and task_id < 7 candidates=[] candidates_f=None candid_dic={} if t...
mit
jesseditson/rethinkdb
external/v8_3.30.33.16/testing/gmock/gtest/test/gtest_uninitialized_test.py
2901
2480
#!/usr/bin/env python # # Copyright 2008, 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...
agpl-3.0
privateip/ansible
lib/ansible/modules/cloud/centurylink/clc_blueprint_package.py
32
10573
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # 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 la...
gpl-3.0
vitek/wwwatch
wwwatch/storage.py
1
3245
import socket import json from collections import defaultdict import redis class BasicStorage(object): def __init__(self): self.counters = {} def register_counter(self, name=''): if name not in self.counters: self.counters[name] = defaultdict(int) return self.counters[nam...
mit
titasakgm/dsi2
proj4js/tools/pjjs.py
250
3061
#!/usr/bin/env python # # TODO explain # # -- Copyright 2007 IGN France / Geoportail project -- # import sys import os import re SUFFIX_JAVASCRIPT = ".js" def _pjcat2js_remove(rezDirectory,catName,targetDirectory): pjCatFilename = os.path.join(rezDirectory, catName) pjCat = open(pjCatFilename,'r') commen...
gpl-3.0
ysrc/xunfeng
vulscan/kunpeng.py
1
4090
# coding:utf-8 from ctypes import * import _ctypes import json import platform import os import urllib2 import sys from urllib import urlretrieve import zipfile class kunpeng: def __init__(self): self.kunpeng = None self.system = platform.system().lower() self.pwd = os.path.split(os.path....
gpl-3.0
pedrobaeza/knowledge
__unported__/document_page_multi_company/document_page_multi_company.py
2
1769
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it und...
agpl-3.0
pjg101/SickRage
lib/webencodings/x_user_defined.py
171
4307
# coding: utf-8 """ webencodings.x_user_defined ~~~~~~~~~~~~~~~~~~~~~~~~~~~ An implementation of the x-user-defined encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ from __future__ import unicode_literals import codecs ### Codec APIs class Code...
gpl-3.0
quinot/ansible
lib/ansible/modules/system/make.py
25
4773
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Linus Unnebäck <linus@folkdatorn.se> # 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
widowild/messcripts
exercice/python3/chap13/base_exercice_13_23.py
1
1776
# -*- coding:Utf8 -*- # Examen de programmation Python - 6TSIb - Juin 2004 from tkinter import * class FaceDom(object): def __init__(self, can, val, pos, taille =70): self.can =can # *** x, y, c = pos[0], pos[1], taille/2 can.create_rectangle(x -c, y-c, x+c, y+c, fill ='ivory', wi...
gpl-3.0
malikabhi05/upm
examples/python/grovevdiv.py
4
2183
#!/usr/bin/env python # Author: Zion Orent <zorent@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 ...
mit
BackupGGCode/python-for-android
python-modules/twisted/twisted/words/im/basesupport.py
55
7900
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # """Instance Messenger base classes for protocol support. You will find these useful if you're adding a new protocol to IM. """ # Abstract representation of chat "model" classes from twisted.words.im.locals import ONLINE, OFFLINE, O...
apache-2.0
scwhitehouse/rose
t/rose-macro/lib/custom_macro_check.py
2
2134
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2012-7 Met Office. # # This file is part of Rose, a framework for meteorological suites. # # Rose is free software: you can redistribute it and/or modify # it under...
gpl-3.0
gnieboer/gnuradio
gr-wxgui/python/wxgui/histosink_gl.py
58
3472
# # Copyright 2009,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version...
gpl-3.0
ingadhoc/demo
demo_simple/__manifest__.py
1
3001
############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
agpl-3.0
Anonymouslemming/ansible
lib/ansible/modules/storage/netapp/netapp_e_amg.py
63
10824
#!/usr/bin/python # (c) 2016, NetApp, Inc # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
tntraina/aff4
tests/test-read-comparative.py
3
1353
""" This is a test of the ability to read an image. You should have a image created beforehand using for example: python facquire.py -S10 -e ntfs1-gen2.dd test This test requires the sk python bindings and pyewf bindings because we test access speed to each other. """ import sk, fif, pyewf import time, sys, glob d...
gpl-3.0
axilleas/ansible
v1/ansible/module_utils/facts.py
81
120182
# (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
hkariti/ansible
lib/ansible/modules/messaging/rabbitmq_binding.py
60
7181
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Manuel Sousa <manuel.sousa@gmail.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 ANSIBLE_METADATA = {'metadata_version': '1.1'...
gpl-3.0
kellyschrock/ardupilot
Tools/autotest/apmrover2.py
1
80558
#!/usr/bin/env python # Drive APMrover2 in SITL from __future__ import print_function import os import pexpect import time from common import AutoTest from common import AutoTestTimeoutException from common import MsgRcvTimeoutException from common import NotAchievedException from common import PreconditionFailedEx...
gpl-3.0