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
bruunio/private
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py
1835
1748
#!/usr/bin/env python # 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. """These functions are executed via gyp-flock-tool when using the Makefile generator. Used on systems that don't have a built-in flock.""" ...
mit
compuwizard123/RSync
rsyncconfig/fstree.py
2
1958
# Copyright (C) 2011 Thomas W. Most # # 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 distributed in...
gpl-3.0
prathamtandon/g4gproblems
Arrays/four_elements_with_given_sum.py
1
3437
import unittest """ Given an array of integers, find all combination of four elements in the array whose sum is equal to a given value X. Input: 10 2 3 4 5 9 7 8, X = 23 Output: 2 3 10 8 Input: -3 4 112 -1 5 0 5, X = 8 Output: 4 -1 5 0 """ """ Approach 1: 1. Sort the array. 2. Run outermost loop which fixes the first...
mit
dangillet/cocos
cocos/actions/interval_actions.py
3
21160
# ---------------------------------------------------------------------------- # cocos2d # Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa, # Lucio Torre # Copyright (c) 2009-2015 Richard Jones, Claudio Canepa # All rights reserved. # # Redistribution and use in source and binary forms, with o...
bsd-3-clause
scotthartbti/android_external_chromium_org
tools/json_schema_compiler/code_test.py
131
4108
#!/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. from code import Code import unittest class CodeTest(unittest.TestCase): def testAppend(self): c = Code() c.Append('line...
bsd-3-clause
thaumos/ansible-modules-extras
windows/win_webpicmd.py
138
1721
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Peter Mounce <public@neverrunwithscissors.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...
gpl-3.0
Shraddha512/servo
components/script/dom/bindings/codegen/Codegen.py
37
239292
# 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/. # Common codegen classes. import os import string import operator from WebIDL import * from Configuration import NoSuc...
mpl-2.0
rockyzhang/zhangyanhit-python-for-android-mips
python-modules/twisted/twisted/web/server.py
50
17004
# -*- test-case-name: twisted.web.test.test_web -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ This is a web-server which integrates with the twisted.internet infrastructure. """ # System Imports import warnings import string import types import copy import os from urllib ...
apache-2.0
lindsayad/sympy
sympy/logic/algorithms/dpll2.py
71
21116
"""Implementation of DPLL algorithm Features: - Clause learning - Watch literal scheme - VSIDS heuristic References: - http://en.wikipedia.org/wiki/DPLL_algorithm """ from __future__ import print_function, division from collections import defaultdict from heapq import heappush, heappop from sympy.core.compa...
bsd-3-clause
mathhun/scipy_2015_sklearn_tutorial
notebooks/figures/plot_rbf_svm_parameters.py
19
2018
import matplotlib.pyplot as plt import numpy as np from sklearn.svm import SVC from sklearn.datasets import make_blobs from .plot_2d_separator import plot_2d_separator def make_handcrafted_dataset(): # a carefully hand-designed dataset lol X, y = make_blobs(centers=2, random_state=4, n_samples=30) y[np.ar...
cc0-1.0
brandsoulmates/incubator-airflow
tests/contrib/sensors/test_ftp_sensor.py
42
2085
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
OpenMined/PySyft
packages/grid/apps/domain/src/main/core/manager/environment_manager.py
1
2053
# stdlib from datetime import datetime from typing import List from typing import Union # grid relative from ..database.environment.environment import Environment from ..database.environment.environment import states from ..database.environment.user_environment import UserEnvironment from ..exceptions import Environme...
apache-2.0
nikolas/edx-platform
openedx/core/djangoapps/credit/email_utils.py
24
6905
""" This file contains utility functions which will responsible for sending emails. """ import os import logging import pynliner import urlparse import uuid import HTMLParser from django.conf import settings from django.contrib.auth.models import User from django.contrib.staticfiles import finders from django.core.c...
agpl-3.0
AndrewPeelMV/Blender2.78c
2.78/scripts/modules/bl_i18n_utils/utils_rtl.py
7
6313
#!/usr/bin/env python3 # ***** BEGIN GPL LICENSE BLOCK ***** # # 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...
gpl-2.0
bcaine/maddux
maddux/environment.py
1
6599
""" Our experiment environment. """ import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import matplotlib.animation as animation GRAVITY = -9.81 class Environment: def __init__(self, dimensions=None, dynamic_objects=None, static_objects=None, robot=None):...
mit
lovelysystems/pyjamas
pyjs/src/pyjs/lib/sys.py
1
1789
from __pyjamas__ import JS # a dictionary of module override names (platform-specific) overrides = None # to be updated by app, on compile # the remote path for loading modules loadpath = None stacktrace = None appname = None def setloadpath(lp): global loadpath loadpath = lp def setappname(an): glob...
apache-2.0
supertom/ansible-modules-core
cloud/azure/azure_rm_storageaccount.py
42
17777
#!/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
masters3d/coursebuilder-masters3d
tests/functional/model_student_work.py
16
7522
# Copyright 2013 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
pmylund/haveabit
console/app/pygments/styles/emacs.py
24
2463
# -*- coding: utf-8 -*- """ pygments.styles.emacs ~~~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by Emacs. :copyright: 2006-2007 by Georg Brandl. :license: BSD, see LICENSE for more details. """ from pygments.style import Style from pygments.token import Keyword, Name, Comment,...
mit
Akuli/editor
tests/test_settings.py
1
6923
import dataclasses import json import sys import tkinter from tkinter import ttk from tkinter.font import Font from typing import List, Optional import dacite import pytest from porcupine import settings # Could replace some of this with non-global setting objects, but I don't feel # like rewriting the tests just b...
mit
MikeAmy/django
django/db/models/fields/related.py
6
67331
from __future__ import unicode_literals import warnings from functools import partial from django import forms from django.apps import apps from django.core import checks, exceptions from django.db import connection, router from django.db.backends import utils from django.db.models.deletion import CASCADE, SET_DEFAUL...
bsd-3-clause
yeming233/rally
tests/unit/plugins/common/context/test_dummy.py
21
1361
# 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 agreed to in...
apache-2.0
Southpaw-TACTIC/Team
src/python/Lib/site-packages/PySide/examples/hyperui/hyperuilib/phoneview.py
1
21585
""" /* * This file is part of PySide: Python for Qt * * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * versio...
epl-1.0
alexandrujuncu/sos
sos/plugins/soundcard.py
12
1475
# 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 will be useful, # but...
gpl-2.0
tszym/ansible
test/utils/shippable/tools/run.py
136
3570
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK # (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
gpl-3.0
abhishekgahlot/or-tools
examples/python/fill_a_pix.py
34
4969
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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
jorvis/biocode
gff/convert_fasta_contigs_to_gff3.py
2
2260
#!/usr/bin/env python3 """ This script assumes that the input FASTA represents genomic sequence and creates a GFF3 file for these, devoid of anything other than placeholder rows for each molecule. It is assumed other processes will add to this. Input example (fake): >AL009126.2 Bacillus subtilis contig 2 ATCTTTTTC...
mit
VitalPet/8-addonsddrap
project_scrum/report/task_burndown.py
15
3549
# -*- 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...
gpl-2.0
barachka/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py
382
1726
########################################################################## # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gener...
agpl-3.0
TreeNote/TreeNote
treenote/util.py
1
2097
# source: http://daringfireball.net/2010/07/improved_regex_for_matching_urls url_regex = r"""(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|...
gpl-3.0
fzsens/zookeeper
src/contrib/zkpython/src/test/create_test.py
164
4170
#!/usr/bin/python # # 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 # "Lic...
apache-2.0
Gr1ph00n/staticwebanalyzer
SDK/dnspython-1.11.1/dns/node.py
49
6028
# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 PROVIDED "...
mit
grandquista/rethinkdb
test/common/http_support/jinja2/defaults.py
659
1068
# -*- coding: utf-8 -*- """ jinja2.defaults ~~~~~~~~~~~~~~~ Jinja default filters and tags. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2._compat import range_type from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner # defaults for ...
apache-2.0
cchurch/ansible
lib/ansible/module_utils/azure_rm_common_rest.py
67
3696
# Copyright (c) 2018 Zim Kalinowski, <zikalino@microsoft.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from ansible.module_utils.ansible_release import __version__ as ANSIBLE_VERSION try: from msrestazure.azure_exceptions import CloudError from msrestazure...
gpl-3.0
Tejal011089/trufil-erpnext
erpnext/accounts/doctype/shipping_rule/shipping_rule.py
38
3213
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _, msgprint, throw from frappe.utils import flt, fmt_money from frap...
agpl-3.0
Mixser/django
django/core/checks/registry.py
53
3058
# -*- coding: utf-8 -*- from __future__ import unicode_literals from itertools import chain from django.utils.itercompat import is_iterable class Tags(object): """ Built-in tags for internal checks. """ admin = 'admin' compatibility = 'compatibility' models = 'models' security = 'securit...
bsd-3-clause
endlessm/chromium-browser
ui/file_manager/base/gn/js_test_gen_html.py
3
5074
# Copyright 2019 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. """Generates HTML file with all dependencies from a js_unittest build target.""" import os import sys from argparse import ArgumentParser _HTML_FILE = r"""<...
bsd-3-clause
odicraig/kodi2odi
addons/plugin.video.roggerstream-5.0.2/securi.py
82
3059
debug=False def printdebug(ss): if debug: print ss def getval(strval): strval=strval.strip() if 'slice' in strval: strval=strval.split(".slice(")#.replace(',',':')+']' strval=strval[0]+"["+strval[1].split(')')[0].replace(',',':')+"]" elif 'String.fromCharCode' in strval: ...
gpl-3.0
jvrsantacruz/XlsxWriter
xlsxwriter/test/comparison/test_chart_blank05.py
8
1689
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
bepitulaz/huntingdimana
env/Lib/site-packages/werkzeug/datastructures.py
54
87447
# -*- coding: utf-8 -*- """ werkzeug.datastructures ~~~~~~~~~~~~~~~~~~~~~~~ This module provides mixins and classes with an immutable interface. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import codecs import ...
gpl-3.0
andriibekker/biddingsbase
django/db/backends/mysql/base.py
101
13899
""" MySQL database backend for Django. Requires MySQLdb: http://sourceforge.net/projects/mysql-python """ import re import sys try: import MySQLdb as Database except ImportError, e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) ...
bsd-3-clause
GhostThrone/django
tests/get_or_create/tests.py
282
15058
from __future__ import unicode_literals import traceback from datetime import date from django.db import DatabaseError, IntegrityError from django.test import TestCase, TransactionTestCase, ignore_warnings from django.utils.encoding import DjangoUnicodeDecodeError from .models import ( Author, Book, DefaultPerso...
bsd-3-clause
dennybaa/st2
st2common/st2common/models/base.py
11
1579
# 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
weblabdeusto/weblabdeusto
server/src/test/unit/voodoo/test_representable.py
3
7531
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2005 onwards University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individuals, # list...
bsd-2-clause
kailIII/geraldo
site/newsite/site-geraldo/django/contrib/localflavor/pe/forms.py
26
2238
# -*- coding: utf-8 -*- """ PE-specific Form helpers. """ from django.forms import ValidationError from django.forms.fields import RegexField, CharField, Select, EMPTY_VALUES from django.utils.translation import ugettext_lazy as _ class PERegionSelect(Select): """ A Select widget that uses a list of Peruvian ...
lgpl-3.0
22rostislav/xhtml2pdf
xhtml2pdf/paragraph2.py
1
26923
#!/bin/env/python # -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 # # U...
apache-2.0
chshu/openthread
tests/toranj/test-018-child-supervision.py
7
7002
#!/usr/bin/env python3 # # Copyright (c) 2018, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
bsd-3-clause
elmerdpadilla/iv
addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py
374
2830
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
anish/buildbot
master/buildbot/process/workerforbuilder.py
1
8107
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
openstack/congress
congress/tests/test_data_types.py
1
4900
# Copyright (c) 2018 VMware # # 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, so...
apache-2.0
bikashgupta11/javarobot
src/main/resources/jython/Lib/lib2to3/fixes/fix_imports.py
326
5693
"""Fix incompatible imports and module references.""" # Authors: Collin Winter, Nick Edds # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {'StringIO': 'io', 'cStringIO': 'io', 'cPickle': 'pickle', '__builtin__' : 'builtins', 'c...
gpl-3.0
ganeshrn/ansible
test/support/integration/plugins/module_utils/rabbitmq.py
57
9054
# -*- coding: utf-8 -*- # # Copyright: (c) 2016, Jorge Rodriguez <jorge.rodriguez@tiriel.eu> # Copyright: (c) 2018, John Imison <john+github@imison.net> # # 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 __meta...
gpl-3.0
SylvainCorlay/PyDev.Debugger
pydev_runfiles.py
52
30194
from __future__ import nested_scopes import fnmatch import os.path from pydev_runfiles_coverage import StartCoverageSupport from pydevd_constants import * #@UnusedWildImport import re import time #======================================================================================================================= ...
epl-1.0
martinrajdl/faunafilm
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py
2354
10366
# Unmodified from http://code.activestate.com/recipes/576693/ # other than to add MIT license header (as specified on page, but not in code). # Linked from Python documentation here: # http://docs.python.org/2/library/collections.html#collections.OrderedDict # # This should be deleted once Py2.7 is available on all bot...
mit
tinkhaven-organization/odoo
openerp/addons/base/tests/test_mail.py
322
24683
#!/usr/bin/env python # -*- coding: utf-8 -*- # This test can be run stand-alone with something like: # > PYTHONPATH=. python2 openerp/tests/test_misc.py ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP...
agpl-3.0
petecummings/django
django/db/migrations/autodetector.py
140
56583
from __future__ import unicode_literals import datetime import re from itertools import chain from django.conf import settings from django.db import models from django.db.migrations import operations from django.db.migrations.migration import Migration from django.db.migrations.operations.models import AlterModelOpti...
bsd-3-clause
mykytamorachov/outpost
flask/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/vendor/html5lib/tokenizer.py
1710
76929
from __future__ import absolute_import, division, unicode_literals try: chr = unichr # flake8: noqa except NameError: pass from collections import deque from .constants import spaceCharacters from .constants import entities from .constants import asciiLetters, asciiUpper2Lower from .constants import digits, ...
gpl-2.0
TinLe/Diamond
src/collectors/ping/ping.py
6
2186
# coding=utf-8 """ Collect icmp round trip times Only valid for ipv4 hosts currently #### Dependencies * ping #### Configuration Configuration is done by: Create a file named: PingCollector.conf in the collectors_config_path * enabled = true * interval = 60 * target_1 = example.org * target_fw = 192.168.0.1...
mit
tcwriting/tcwriting
vendor/cache/ruby/2.3.0/gems/nokogiri-1.7.0.1/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.4/libxml2-2.9.4/python/tests/compareNodes.py
35
1516
#!/usr/bin/python -u import sys import libxml2 # Memory debug specific libxml2.debugMemory(1) # # Testing XML Node comparison and Node hash-value # doc = libxml2.parseDoc("""<root><foo/></root>""") root = doc.getRootElement() # Create two different objects which point to foo foonode1 = root.children foonode2 = root....
mit
callmeonlyashu/MEANJS
node_modules/node-gyp/gyp/pylib/gyp/input_test.py
1841
3207
#!/usr/bin/env python # Copyright 2013 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. """Unit tests for the input.py file.""" import gyp.input import unittest import sys class TestFindCycles(unittest.TestCase): def setUp(self...
mit
r39132/airflow
airflow/contrib/operators/vertica_to_mysql.py
4
6016
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
ampax/edx-platform-backup
lms/djangoapps/shoppingcart/migrations/0013_auto__add_field_invoice_is_valid.py
114
13795
# -*- 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 'Invoice.is_valid' db.add_column('shoppingcart_invoice', 'is_valid', se...
agpl-3.0
dwitvliet/CATMAID
scripts/remote/example.py
6
1242
### Example for using CATMAID Frontend to retrieve a neuron's skeleton ### including the synaptic connectors import urllib, json import http.cookiejar as cj from catmaid_frontend import * remote_instance = None #Provide Credentials for CATMAID Server http_user = '' http_pw = '' catmaid_user = '' catmaid_pw = '' #S...
gpl-3.0
SmithsonianEnterprises/django-cms
cms/test_utils/project/bunch_of_plugins/migrations/0001_initial.py
66
1144
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import cms.test_utils.project.bunch_of_plugins.models class Migration(migrations.Migration): dependencies = [ ('cms', '0001_initial'), ] operations = [ migrations.CreateModel( ...
bsd-3-clause
kingofsystem/django-allauth
allauth/socialaccount/providers/stackexchange/provider.py
75
1254
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class StackExchangeAccount(ProviderAccount): def get_profile_url(self): return self.account.extra_data.get('html_url') ...
mit
peguin40/zulip
zerver/tests/webhooks/test_stash.py
26
1101
# -*- coding: utf-8 -*- from typing import Text from zerver.lib.test_classes import WebhookTestCase class StashHookTests(WebhookTestCase): STREAM_NAME = 'stash' URL_TEMPLATE = u"/api/v1/external/stash?stream={stream}" def test_stash_message(self): # type: () -> None """ Messages ar...
apache-2.0
kurikaesu/arsenalsuite
cpp/lib/PyQt4/examples/sql/connection.py
17
6103
#!/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENSE:BS...
gpl-2.0
eul-721/The-Perfect-Pokemon-Team-Balancer
libs/env/Lib/encodings/iso8859_9.py
593
13412
""" Python Character Mapping Codec iso8859_9 generated from 'MAPPINGS/ISO8859/8859-9.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='...
gpl-2.0
huchoi/edx-platform
common/djangoapps/edxmako/tests.py
30
1489
from django.test import TestCase from django.test.utils import override_settings from django.core.urlresolvers import reverse from edxmako import add_lookup, LOOKUP from edxmako.shortcuts import marketing_link from mock import patch from util.testing import UrlResetMixin class ShortcutsTests(UrlResetMixin, TestCase):...
agpl-3.0
ProfessorKaos64/ds4drv
ds4drv/device.py
3
7173
from struct import Struct from sys import version_info as sys_version class StructHack(Struct): """Python <2.7.4 doesn't support struct unpack from bytearray.""" def unpack_from(self, buf, offset=0): buf = buffer(buf) return Struct.unpack_from(self, buf, offset) if sys_version[0] == 2 and s...
mit
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/db/backends/oracle/base.py
1
25877
""" Oracle database backend for Django. Requires cx_Oracle: http://cx-oracle.sourceforge.net/ """ from __future__ import unicode_literals import datetime import decimal import os import platform import sys import warnings from django.conf import settings from django.db import utils from django.db.bac...
mit
jellysheep/pyload
module/plugins/hoster/FilepostCom.py
12
4821
# -*- coding: utf-8 -*- import re import time from module.common.json_layer import json_loads from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilepostCom(SimpleHoster): __name__ = "FilepostCom" __type__ = "hoste...
gpl-3.0
City-of-Bloomington/green-rental
building/migrations/0015_auto__chg_field_building_energy_score.py
2
24390
# -*- 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): # Changing field 'Building.energy_score' db.alter_column(u'building_building', 'energy_score', self.gf('dja...
agpl-3.0
zhhf/charging
charging/services/loadbalancer/agent/agent_api.py
13
3086
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 New Dream Network, LLC (DreamHost) # # 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/li...
apache-2.0
oliverhr/odoo
addons/pos_restaurant/__openerp__.py
311
2001
# -*- 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
catapult-project/catapult
third_party/gsutil/gslib/commands/cat.py
4
5134
# -*- coding: utf-8 -*- # Copyright 2011 Google Inc. All Rights Reserved. # Copyright 2011, Nexenta Systems 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/...
bsd-3-clause
sahlinet/fastapp
fastapp/south_migrations/0011_auto__chg_field_instance_last_beat.py
2
8409
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Instance.last_beat' db.alter_column(u'fastapp_instance...
mit
xbezdick/packstack
packstack/plugins/nova_300.py
1
35617
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software...
apache-2.0
binhqnguyen/ln
.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Tools/c_osx.py
329
4274
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,shutil,sys,platform from waflib import TaskGen,Task,Build,Options,Utils,Errors from waflib.TaskGen import taskgen_method,feature,after_method,before_method app_info=...
gpl-2.0
naturali/tensorflow
tensorflow/python/kernel_tests/batchtospace_op_test.py
21
10783
# 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
onsightit/solarcoin
share/qt/extract_strings_qt.py
95
2709
#!/usr/bin/env python # Copyright (c) 2012-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Extract _("...") strings for translation and convert to Qt stringdefs so that they can be picked up by ...
mit
aniavasq/uncertaintyServerComponentsKUL
dispatcher.py
1
4477
############################################################################### # MIT License (MIT) # # Copyright (c) # # 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, in...
mit
bikong2/django
django/template/exceptions.py
483
1392
""" This module contains generic exceptions used by template backends. Although, due to historical reasons, the Django template language also internally uses these exceptions, other exceptions specific to the DTL should not be added here. """ class TemplateDoesNotExist(Exception): """ The exception used when ...
bsd-3-clause
AkA84/edx-platform
common/lib/xmodule/xmodule/modulestore/xml.py
25
41945
import hashlib import itertools import json import logging import os import re import sys import glob from collections import defaultdict from cStringIO import StringIO from fs.osfs import OSFS from importlib import import_module from lxml import etree from path import path from contextlib import contextmanager from l...
agpl-3.0
MeirKriheli/Open-Knesset
notify/management/commands/notify.py
5
13040
from __future__ import absolute_import from django.core.management.base import NoArgsCommand from django.contrib.auth.models import User, Group from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.utils.translation import ugettext as _ from django.utils imp...
bsd-3-clause
mihailignatenko/erp
addons/account_asset/account_asset_invoice.py
193
3070
# -*- encoding: 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 G...
agpl-3.0
gauribhoite/personfinder
env/google_appengine/lib/django-1.4/django/contrib/localflavor/nl/forms.py
87
2859
""" NL-specific Form helpers """ from __future__ import absolute_import import re from django.contrib.localflavor.nl.nl_provinces import PROVINCE_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, Select from django.utils.encoding i...
apache-2.0
eddiep1101/django-oscar
src/oscar/apps/catalogue/reviews/migrations/0001_initial.py
51
3324
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion import oscar.core.validators from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('catalogue', '0001_initial'), migration...
bsd-3-clause
Ca1ne/EnochPrima
Documentation/target/tcm_mod_builder.py
3119
42754
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
matpalm/malmomo
viz_advantage_surface.py
1
3160
#!/usr/bin/env python # hacktasic viz of the quadratic surface of advantage around the max output # for a couple of clear block on right / left / center cases import agents import argparse import base_network import Image import numpy as np import models import sys import tensorflow as tf import replay_memory import ...
mit
jkarabas/py-snarkx
snarkx/io/graph6.py
1
3675
import networkx as nx from os.path import abspath, isfile, join, dirname, isdir, basename, splitext from tempfile import TemporaryFile from snarkx.io import ParseFileError __all__ = ['GraphReaderG6', 'GraphWriterG6'] class GraphReaderG6(object): def __init__(self, path: str): if path is None: ...
gpl-3.0
me4488/NOPE_Kernel_V2
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
DCSO/tie2misp
loader.py
2
8612
""" DCSO TIE2MISP Parser Copyright (c) 2017, DCSO GmbH """ import requests from requests import HTTPError, ConnectionError, ConnectTimeout from model import Config from model.events import C2Server, Malware, Actor, Family from datetime import datetime, timedelta import logging import sys class Loader: @staticmet...
bsd-3-clause
alxnov/ansible-modules-core
cloud/digital_ocean/digital_ocean_sshkey.py
23
5127
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
Minizinger/discordKuubioBot
bot/file_config.py
1
1384
import json import os import re from emoji import UNICODE_EMOJI import codecs import random class Config: def __init__(self): with codecs.open('../config/reactions.json', 'r', 'utf-8') as f: self.reactions = json.load(f) self.reaction_chance = self.reactions.pop('chance', 100) / 100...
mit
Permutatrix/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/lxmletree.py
618
6033
from __future__ import absolute_import, division, unicode_literals from six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from gettext import gettext _ = gettext from . import _base from .. import ihatexml def ensure_str(s): if s is None: return None elif isin...
mpl-2.0
MahdiZareie/event-recorder
event_recorder/settings.py
1
3735
""" Django settings for event_recorder project. Generated by 'django-admin startproject' using Django 1.9.4. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ impor...
mit
gohin/django
tests/template_loader/tests.py
289
6920
from django.template import TemplateDoesNotExist from django.template.loader import ( get_template, render_to_string, select_template, ) from django.test import SimpleTestCase, override_settings from django.test.client import RequestFactory @override_settings(TEMPLATES=[{ 'BACKEND': 'django.template.backends....
bsd-3-clause
akulakov/mangotrac
proj_issues/issues/tests.py
1
2392
""" This file demonstrates two different styles of tests (one doctest and one unittest). These will both pass when you run "manage.py test". Replace these with more appropriate tests for your application. """ from django.test import TestCase, Client from issues.models import * urls = "/admin/issues/issue/ /issues/cr...
mit
gaddman/ansible
lib/ansible/modules/cloud/misc/terraform.py
5
14769
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ryan Scott Brown <ryansb@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1',...
gpl-3.0