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 |
|---|---|---|---|---|---|
Keeward/RatticWeb | cred/migrations/0018_fix_unicode_filename.py | 7 | 6419 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.mo... | gpl-2.0 |
gptech/ansible | lib/ansible/modules/cloud/azure/azure_rm_resourcegroup.py | 29 | 9119 | #!/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 |
jenshenrik/destiny-trader | destiny.py | 1 | 3112 | import sys
import re
TYPE_BATTLEFIELD = "Battlefield"
def print_usage():
print("""
Star Wars: Destiny trade list builder
Usage:
$>python destiny.py <target-file>
where <target-file> is the text-file to process.
This file should be generated by logging into swdestiny.com, going to 'My coll... | gpl-3.0 |
goergeBerg/drupal | sites/all/modules/proj4js/lib/proj4js/tools/toposort.py | 261 | 8594 | #
# According to <http://www.vrplumber.com/programming/> this file
# is licensed under a BSD-style license. We only use the section
# originally by Tim Peters.
#
# TODO: The use of this code needs to be okayed by someone.
#
class RecursionError( OverflowError, ValueError ):
'''Unable to calculate result because of... | gpl-2.0 |
bfarr/kombine | examples/kepler/correlated_likelihood.py | 1 | 2577 | import numpy as np
import numpy.linalg as nl
import numpy.random as nr
import rv_model as rv
import scipy.linalg as sl
import scipy.stats as ss
def generate_covariance(ts, sigma, tau):
r"""Generates a covariance matrix according to an
squared-exponential autocovariance
.. math::
\left\lang... | mit |
gallifrey17/eden | tests/unit_tests/modules/s3/s3gis/TrueCodePaths.py | 23 | 13607 |
import unittest
class TrueCodePaths(unittest.TestCase):
def setUp(self):
vars = request.vars
vars["lat"] = 0
vars["lon"] = 0
vars["zoom"] = 1
self.old_s3roles = list(session.s3.roles)
session.s3.roles.append(1)
def tearDown(self):
... | mit |
clovett/MissionPlanner | ExtLibs/Mavlink/pymavlink/generator/lib/genxmlif/xmlifODict.py | 82 | 1506 | from types import DictType
from UserDict import UserDict
class odict(UserDict):
def __init__(self, dictOrTuple = None):
self._keys = []
UserDict.__init__(self, dictOrTuple)
def __delitem__(self, key):
UserDict.__delitem__(self, key)
self._keys.remove(key)
de... | gpl-3.0 |
nishad-jobsglobal/odoo-marriot | 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 |
jjyycchh/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_mock.py | 126 | 3744 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
ARMmbed/yotta_osx_installer | workspace/lib/python2.7/site-packages/github/tests/Logging_.py | 39 | 9038 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | apache-2.0 |
kingmotley/SickRage | lib/imdb/Company.py | 143 | 7385 | """
company module (imdb package).
This module provides the company class, used to store information about
a given company.
Copyright 2008-2009 Davide Alberani <da@erlug.linux.it>
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... | gpl-3.0 |
0k/connector-telephony | asterisk_click2dial/controller.py | 16 | 1296 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Asterisk click2dial module for OpenERP
# Copyright (C) 2014 Alexis de Lattre (alexis@via.ecp.fr)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
lakshayg/tensorflow | tensorflow/contrib/rnn/python/kernel_tests/benchmarking.py | 67 | 1906 | # Copyright 2017 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 |
ASlave2Audio/Restaurant-App | mingw/bin/lib/fileinput.py | 224 | 14143 | """Helper class to quickly write a loop over all standard input files.
Typical use is:
import fileinput
for line in fileinput.input():
process(line)
This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty. If a filename is '-' it
is also replace... | mit |
ewjoachim/django-extensions | django_extensions/management/commands/runjob.py | 28 | 1938 | from optparse import make_option
from django.core.management.base import LabelCommand
from django_extensions.management.jobs import get_job, print_jobs
from django_extensions.management.utils import signalcommand
class Command(LabelCommand):
option_list = LabelCommand.option_list + (
make_option('--list... | mit |
splunk/splunk-webframework | contrib/django/django/conf/locale/tr/formats.py | 106 | 1043 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'd F Y H:i:s'
YEAR_MONTH_F... | apache-2.0 |
naslanidis/ansible | contrib/inventory/vmware_inventory.py | 11 | 25368 | #!/usr/bin/env python
# Requirements
# - pyvmomi >= 6.0.0.2016.4
# TODO:
# * more jq examples
# * optional folder heriarchy
"""
$ jq '._meta.hostvars[].config' data.json | head
{
"alternateguestname": "",
"instanceuuid": "5035a5cd-b8e8-d717-e133-2d383eb0d675",
"memoryhotaddenabled": false,
"guestfullna... | gpl-3.0 |
xuweiliang/Codelibrary | nova/virt/vmwareapi/network_util.py | 27 | 9040 | # Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://w... | apache-2.0 |
ClearCorp-dev/odoo-clearcorp | TODO-8.0/account_tax_translate_name/__openerp__.py | 3 | 1599 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | agpl-3.0 |
lepistone/server-tools | fetchmail_attach_from_folder/match_algorithm/email_exact.py | 54 | 2397 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>)
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
#... | agpl-3.0 |
sagar30051991/ozsmart-erp | erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py | 8 | 4130 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import _
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
if... | agpl-3.0 |
ZenDevelopmentSystems/pdnn | utils/network_config.py | 2 | 7314 | # Copyright 2014 Yajie Miao Carnegie Mellon University
# 2015 Yun Wang Carnegie Mellon University
# 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... | apache-2.0 |
zarboz/EvilZ-Kernel122 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
Jon-ICS/upm | examples/python/l298-stepper.py | 7 | 2459 | #!/usr/bin/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 limi... | mit |
FrancescoRizzi/AWSomesauce | articles/BAS4-pws/custauth/custauth.py | 1 | 18186 | #!/usr/bin/env python
import os
import json
import StringIO
from contextlib import closing
import re
import time
import pprint
import boto3
from boto3.session import Session
import botocore
import jwt
from cryptography.x509 import load_pem_x509_certificate
from cryptography.hazmat.backends import default_backend
#... | mit |
n0trax/ansible | lib/ansible/plugins/connection/winrm.py | 12 | 25632 | # (c) 2014, Chris Church <chris@ninemoreminutes.com>
# Copyright (c) 2017 Ansible Project
# 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
DOCUMENTATION = """
author: Ansible Core Te... | gpl-3.0 |
DarKnight--/owtf | framework/interface/html/filter/sanitiser.py | 2 | 3574 | #!/usr/bin/env python
'''
The sanitiser module allows the rest of the framework to sanitise input
Requires lxml, installation instructions here: http://lxml.de/installation.html
In Backtrack 5: /usr/bin/easy_install --allow-hosts=lxml.de,*.python.org lxml
Tip for Ubuntu courtesy of Mario Heiderich: Python2.7-dev is nee... | bsd-3-clause |
CTSRD-SOAAP/chromium-42.0.2311.135 | native_client/buildbot/buildbot_selector.py | 1 | 18629 | #!/usr/bin/python
# Copyright (c) 2012 The Native Client 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 json
import os
import subprocess
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import pynacl.p... | bsd-3-clause |
adrianpaesani/odoo-argentina | l10n_ar_invoice_sale/__openerp__.py | 2 | 1545 | # -*- coding: utf-8 -*-
{
'name': 'Argentinian Sale Total Fields',
'version': '1.0',
'category': 'Localization/Argentina',
'sequence': 14,
'author': 'ADHOC SA',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
'summary': '',
'description': """
Argentinian Sale Total Fields
======... | agpl-3.0 |
omemo/python-omemo | src/omemo/liteprekeystore.py | 1 | 2577 | # -*- coding: utf-8 -*-
#
# Copyright 2015 Tarek Galal <tare2.galal@gmail.com>
#
# This file is part of Gajim-OMEMO plugin.
#
# The Gajim-OMEMO plugin 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 ver... | gpl-3.0 |
kevinmora94/proyectoDrupal | web/themes/custom/proyectofinal/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py | 2710 | 5094 | # 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.
"""Visual Studio user preferences file writer."""
import os
import re
import socket # for gethostname
import gyp.common
import gyp.easy_xml as easy_xml
#------... | gpl-2.0 |
diegosarmentero/ninja-ide | ninja_ide/gui/dialogs/wizard_new_project.py | 6 | 1116 | # -*- coding: utf-8 -*-
#
# This file is part of NINJA-IDE (http://ninja-ide.org).
#
# NINJA-IDE 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
# any later version.
#
# NIN... | gpl-3.0 |
devstructure/blueprint | blueprint/io/__init__.py | 4 | 4378 | import logging
import sys
from blueprint import Blueprint
from blueprint import cfg
from blueprint import git
import http
def pull(server, secret, name):
"""
Pull a blueprint from the secret and name on the configured server.
"""
r = http.get('/{0}/{1}'.format(secret, name), server=server)
if 200... | bsd-2-clause |
ryfeus/lambda-packs | Keras_tensorflow/source/tensorflow/contrib/learn/python/learn/dataframe/transforms/example_parser.py | 86 | 2370 | # 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 |
nitmir/django-cas-server | cas_server/admin.py | 1 | 6813 | # This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License version 3 for
# more details.
#
# You should have received a copy of the GNU General Public License... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/254_test_htmlparser.py | 19 | 10454 | """Tests for HTMLParser.py."""
import HTMLParser
import pprint
import sys
import unittest
from test import test_support
class EventCollector(HTMLParser.HTMLParser):
def __init__(self):
self.events = []
self.append = self.events.append
HTMLParser.HTMLParser.__init__(self)
def get_eve... | gpl-3.0 |
sidmitra/django_nonrel_testapp | dbindexer/compiler.py | 11 | 1312 | from resolver import resolver
from django.utils.importlib import import_module
def __repr__(self):
return '<%s, %s, %s, %s>' % (self.alias, self.col, self.field.name,
self.field.model.__name__)
from django.db.models.sql.where import Constraint
Constraint.__repr__ = __repr__
# TODO: manipulate a copy of t... | bsd-3-clause |
waseem18/oh-mainline | vendor/packages/twisted/twisted/python/modules.py | 18 | 26357 | # -*- test-case-name: twisted.test.test_modules -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module aims to provide a unified, object-oriented view of Python's
runtime hierarchy.
Python is a very dynamic language with wide variety of introspection utilities.
However, these util... | agpl-3.0 |
lesh1k/beatport-verifier | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/connection.py | 483 | 9011 | import datetime
import sys
import socket
from socket import timeout as SocketTimeout
import warnings
from .packages import six
try: # Python 3
from http.client import HTTPConnection as _HTTPConnection, HTTPException
except ImportError:
from httplib import HTTPConnection as _HTTPConnection, HTTPException
cla... | cc0-1.0 |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/scipy/spatial/tests/test_spherical_voronoi.py | 29 | 4636 | from __future__ import print_function
import numpy as np
from numpy.testing import (TestCase,
assert_almost_equal,
assert_array_equal,
assert_array_almost_equal)
from scipy.spatial import SphericalVoronoi, distance
from scipy.spatial impor... | gpl-3.0 |
synicalsyntax/zulip | zerver/views/archive.py | 4 | 3287 | from typing import List, Optional
from django.http import HttpRequest, HttpResponse
from django.shortcuts import render
from django.template import loader
from zerver.lib.avatar import get_gravatar_url
from zerver.lib.exceptions import JsonableError
from zerver.lib.response import json_success
from zerver.lib.streams... | apache-2.0 |
nonsensews/mango | mango/system/tasks.py | 2 | 16555 | # -*- coding: utf-8 -*-
# This file is part of mango.
# Distributed under the terms of the last AGPL License.
# The full license is in the file LICENCE, distributed as part of this software.
__author__ = 'Team Machine'
import uuid
import logging
import ujson as json
from tornado import gen
from schematics.types i... | agpl-3.0 |
ryfeus/lambda-packs | pytorch/source/PIL/BdfFontFile.py | 4 | 3000 | #
# The Python Imaging Library
# $Id$
#
# bitmap distribution font (bdf) file parser
#
# history:
# 1996-05-16 fl created (as bdf2pil)
# 1997-08-25 fl converted to FontFile driver
# 2001-05-25 fl removed bogus __init__ call
# 2002-11-20 fl robustification (from Kevin Cazabon, Dmitry Vasiliev)
# 2003-04-22 fl ... | mit |
magvugr/AT | EntVirtual/lib/python2.7/site-packages/django/db/backends/postgresql/client.py | 47 | 2120 | import os
import subprocess
from django.core.files.temp import NamedTemporaryFile
from django.db.backends.base.client import BaseDatabaseClient
from django.utils.six import print_
def _escape_pgpass(txt):
"""
Escape a fragment of a PostgreSQL .pgpass file.
"""
return txt.replace('\\', '\\\\').replace... | gpl-3.0 |
cloakedcode/CouchPotatoServer | couchpotato/core/providers/automation/bluray/main.py | 9 | 1053 | from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.automation.base import Automation
log = CPLog(__name__)
class Bluray(Automation, RSS):
interval = 1800
rss_url = 'http://www.blu-ray.com... | gpl-3.0 |
torufuru/OFPatchPanel | ryu/tests/unit/packet/test_mpls.py | 18 | 1677 | # Copyright (C) 2013 Nippon Telegraph and Telephone 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 applicab... | apache-2.0 |
dcroc16/skunk_works | google_appengine/lib/django-1.2/tests/modeltests/one_to_one/tests.py | 92 | 5714 | from django.test import TestCase
from django.db import transaction, IntegrityError
from models import Place, Restaurant, Waiter, ManualPrimaryKey, RelatedModel, MultiModel
class OneToOneTests(TestCase):
def setUp(self):
self.p1 = Place(name='Demon Dogs', address='944 W. Fullerton')
self.p1.save()
... | mit |
classner/fertilized-devtools | binding_generator/ordered_set.py | 1 | 1936 | # See http://code.activestate.com/recipes/576694/.
import collections
class OrderedSet(collections.MutableSet):
def __init__(self, iterable=None):
self.end = end = []
end += [None, end, end] # sentinel node for doubly linked list
self.map = {} # key --> [key, pre... | bsd-2-clause |
timopulkkinen/BubbleFish | tools/generate_stubs/generate_stubs.py | 63 | 41074 | #!/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.
"""Creates windows and posix stub files for a given set of signatures.
For libraries that need to be loaded outside of the standar... | bsd-3-clause |
The-Compiler/qutebrowser | qutebrowser/browser/webengine/certificateerror.py | 2 | 1605 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
aglitke/vdsm | vdsm_hooks/vmdisk/before_vm_start.py | 2 | 2632 | #!/usr/bin/python
import os
import sys
import hooking
import traceback
'''
vmdisk hook:
add additional disk image for a VM (raw or qcow2)
syntax:
vmdisk=/path/to/disk.img:qcow2,/other/disk.img:raw
'''
driver_types = ('raw', 'qcow2')
def indexToDiskName(i):
s = ''
while True:
s = chr(ord('a'... | gpl-2.0 |
ion-storm/Unleashed-N5 | 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 |
brianv0/sqlalchemy | lib/sqlalchemy/util/compat.py | 70 | 6809 | # util/compat.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Handle Python version/platform incompatibilities."""
import sys
try:
import ... | mit |
balloob/home-assistant | tests/components/mobile_app/test_http_api.py | 12 | 3643 | """Tests for the mobile_app HTTP API."""
import json
from unittest.mock import patch
import pytest
from homeassistant.components.mobile_app.const import CONF_SECRET, DOMAIN
from homeassistant.const import CONF_WEBHOOK_ID
from homeassistant.setup import async_setup_component
from .const import REGISTER, REGISTER_CLEA... | apache-2.0 |
googleapis/googleapis-gen | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/types/feed_item_target_service.py | 1 | 5926 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
thaim/ansible | lib/ansible/module_utils/network/apconos/apconos.py | 18 | 3650 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by
# Ansible still belong to the author of the module, and may assign their own
# license to the complete wo... | mit |
krafczyk/spack | var/spack/repos/builtin/packages/laghos/package.py | 2 | 3127 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
dset0x/invenio | invenio/modules/groups/forms.py | 14 | 2468 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 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... | gpl-2.0 |
ifaoe/daisi-tk | daisi_images.py | 1 | 5255 | #!/usr/bin/python3
import logging
import psycopg2
from argparse import ArgumentParser
from gdal_tif2geo import process
import multiprocessing
import subprocess
from joblib import Parallel, delayed
from math import ceil
import tempfile
import os
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name... | gpl-2.0 |
DanielNeugebauer/adhocracy | scripts/common.py | 6 | 2881 | """
Utility code to use in command line scripts.
You need some boilerplate code to import from this module
Cause it's probably not in the python path::
# boilerplate code. copy that to a new commandline script
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from common im... | agpl-3.0 |
def-/commandergenius | project/jni/python/src/Demo/newmetaclasses/Eiffel.py | 37 | 3713 | """Support Eiffel-style preconditions and postconditions."""
from types import FunctionType as function
class EiffelBaseMetaClass(type):
def __new__(meta, name, bases, dict):
meta.convert_methods(dict)
return super(EiffelBaseMetaClass, meta).__new__(meta, name, bases,
... | lgpl-2.1 |
HankFaan/fbthrift | thrift/lib/py/transport/TSSLSocketOverHttpTunnel.py | 16 | 1645 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import ssl
from .TSocketOverHttpTunnel import TSocketOverHttpTunnel
from .TTransport import TTransportException
class TSSLSocketOverHttpTunnel(TSocketOverHttpTunnel):
... | apache-2.0 |
fnoorian/Free-buck-boost | drivers/json_server.py | 1 | 1329 | from werkzeug.wrappers import Request, Response
from werkzeug.serving import run_simple
# this use package json-rpc (not jsonrpc!)
from jsonrpc import JSONRPCResponseManager, dispatcher
from drivers.boost_driver import FCCBoostDriver
from drivers.buck_driver import FCCBuckDriver, FCCMPPTDriver
from drivers.mi... | bsd-2-clause |
googleinterns/cabby | cabby/model/datasets.py | 1 | 4391 | # coding=utf-8
# Copyright 2020 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 |
sarthakmeh03/django | django/db/migrations/writer.py | 58 | 11569 | from __future__ import unicode_literals
import os
import re
from importlib import import_module
from django import get_version
from django.apps import apps
from django.db import migrations
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.serializer import serializer_factory
from djang... | bsd-3-clause |
udacity/ggplot | ggplot/components/alphas.py | 12 | 1784 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from .legend import get_labels
from ..utils.exceptions import GgplotError
def assign_alphas(data, aes):
"""
Assigns alpha values to the given data based
on the aes creates an ap... | bsd-2-clause |
pwong-mapr/private-hue | desktop/core/ext-py/Mako-0.8.1/examples/bench/basic.py | 58 | 6913 | # basic.py - basic benchmarks adapted from Genshi
# Copyright (C) 2006 Edgewall Software
# 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 ... | apache-2.0 |
m0ppers/arangodb | 3rdParty/V8/V8-5.0.71.39/build/gyp/test/win/gyptest-cl-function-level-linking.py | 332 | 1595 | #!/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.
"""
Make sure function-level linking setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = Te... | apache-2.0 |
qenter/vlc-android | toolchains/arm/lib/python2.7/test/test_httplib.py | 40 | 19698 | import httplib
import array
import httplib
import StringIO
import socket
import errno
import unittest
TestCase = unittest.TestCase
from test import test_support
HOST = test_support.HOST
class FakeSocket:
def __init__(self, text, fileclass=StringIO.StringIO):
self.text = text
self.fileclass = fil... | gpl-2.0 |
jsha/letsencrypt | certbot/tests/ocsp_test.py | 2 | 6447 | """Tests for ocsp.py"""
# pylint: disable=protected-access
import unittest
import mock
from certbot import errors
out = """Missing = in header key=value
ocsp: Use -help for summary.
"""
class OCSPTest(unittest.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
from certbot import ocsp
... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/254_test_ioctl.py | 12 | 2469 | import unittest
from test.test_support import TestSkipped, run_unittest
import os, struct
try:
import fcntl, termios
except ImportError:
raise TestSkipped("No fcntl or termios module")
if not hasattr(termios,'TIOCGPGRP'):
raise TestSkipped("termios module doesn't have TIOCGPGRP")
try:
tty = open("/dev/... | gpl-3.0 |
physycom/QGIS | python/plugins/processing/gui/matrixmodelerwidget.py | 14 | 5165 | # -*- coding: utf-8 -*-
"""
***************************************************************************
MatrixModelerWidget.py
---------------------
Date : May 2018
Copyright : (C) 2018 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*********... | gpl-2.0 |
jnewland/home-assistant | homeassistant/scripts/keyring.py | 11 | 2187 | """Script to get, set and delete secrets stored in the keyring."""
import argparse
import getpass
import os
from homeassistant.util.yaml import _SECRET_NAMESPACE
REQUIREMENTS = ['keyring==17.1.1', 'keyrings.alt==3.1.1']
def run(args):
"""Handle keyring script."""
parser = argparse.ArgumentParser(
de... | apache-2.0 |
subfusc/anki | thirdparty/send2trash/plat_win.py | 20 | 1695 | # Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
from ctypes import windll, Structure, b... | agpl-3.0 |
majidaldo/ansible-modules-core | database/mysql/mysql_variables.py | 84 | 8413 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage mysql variables
(c) 2013, Balazs Pocze <banyek@gawker.com>
Certain parts are taken from Mark Theunissen's mysqldb module
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GNU G... | gpl-3.0 |
yencarnacion/jaikuengine | .google_appengine/lib/django-1.5/tests/regressiontests/csrf_tests/tests.py | 41 | 13716 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.core.context_processors import csrf
from django.http import HttpRequest, HttpResponse
from django.middleware.csrf import CsrfViewMiddleware, CSRF_KEY_LENGTH
from django.template import RequestContext, Template
... | apache-2.0 |
0sw4l/villas-de-san-pablo | apps/utils/views.py | 1 | 1899 | from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import CreateView
from django.views.generic import ListView
from django.views.generic import TemplateView
from django.views.generic import UpdateView, DetailView
from apps.utils.shortcuts import get_object_or_none
class BaseListView(L... | mit |
tekton/DocuCanvas | accounts/migrations/0007_auto__add_recordpermission__add_unique_recordpermission_contentType_us.py | 1 | 8125 | # -*- 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 'RecordPermission'
db.create_table(u'accounts_recordpermission', (
(u'id', self.g... | gpl-3.0 |
Ivoz/pip | pip/_vendor/requests/packages/chardet/chardetect.py | 743 | 1141 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from ... | mit |
usakey/vnpy | vn.lts/pyscript/generate_md_functions.py | 73 | 6980 | # encoding: UTF-8
__author__ = 'CHENXY'
from string import join
from lts_struct import structDict
def processCallBack(line):
orignalLine = line
line = line.replace('\tvirtual void ', '') # 删除行首的无效内容
line = line.replace('{};\n', '') # 删除行尾的无效内容
content = line.split('(')
cbNa... | mit |
Jumpscale/jumpscale_portal8 | apps/portalbase/AYS81/.macros/wiki/aysservice/3_aysservice.py | 1 | 2580 | from collections import OrderedDict
def main(j, args, params, tags, tasklet):
try:
role = args.getTag('aysrole')
name = args.getTag('aysname')
ayspath = args.getTag('ayspath') or ''
repo = j.atyourservice.repoGet(ayspath)
service = repo.serviceGet(role, name, die=False)
... | apache-2.0 |
GinnyN/Team-Fortress-RPG-Generators | django/contrib/gis/geos/linestring.py | 411 | 5568 | from django.contrib.gis.geos.base import numpy
from django.contrib.gis.geos.coordseq import GEOSCoordSeq
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.point import Point
from django.contrib.gis.geos import prototypes as cap... | bsd-3-clause |
rec/echomesh | code/python/external/platform/darwin/numpy/distutils/tests/gen_ext/setup.py | 49 | 1099 | #!/usr/bin/env python
fib3_f = '''
C FILE: FIB3.F
SUBROUTINE FIB(A,N)
C
C CALCULATE FIRST N FIBONACCI NUMBERS
C
INTEGER N
REAL*8 A(N)
Cf2py intent(in) n
Cf2py intent(out) a
Cf2py depend(n) a
DO I=1,N
IF (I.EQ.1) THEN
A(I) = 0.0D0
ELSEIF (I.EQ.2) THEN
... | mit |
varuntiwari27/rally | todo-api/flask/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/markers.py | 228 | 8248 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import operator
import os
import platform
import sys
from pkg_resources.e... | apache-2.0 |
DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/sklearn/externals/funcsigs.py | 1 | 29802 | # Copyright 2001-2013 Python Software Foundation; All Rights Reserved
"""Function signature objects for callables
Back port of Python 3.3's function signature tools from the inspect module,
modified to be compatible with Python 2.6, 2.7 and 3.2+.
"""
from __future__ import absolute_import, division, print_function
im... | mit |
panda73111/aiohttp | demos/polls/tests/conftest.py | 5 | 1110 | import pathlib
import subprocess
import pytest
import aiohttp
@pytest.yield_fixture
def create_app(event_loop, unused_tcp_port):
app = handler = srv = client_session = None
async def create():
nonlocal app, handler, srv, client_session
import aiohttpdemo_polls.main
app, host, port =... | apache-2.0 |
credativ/pulp | server/pulp/server/managers/repo/group/cud.py | 2 | 12615 | import logging
import sys
from celery import task
from pymongo.errors import DuplicateKeyError
from pulp.common.plugins import distributor_constants
from pulp.server import exceptions as pulp_exceptions
from pulp.server.async.tasks import Task
from pulp.server.db.model.repo_group import RepoGroup
from pulp.server.db.... | gpl-2.0 |
codekaki/odoo | addons/account_bank_statement_extensions/__openerp__.py | 55 | 2308 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it u... | agpl-3.0 |
noif/locust | docs/conf.py | 34 | 2953 | # -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed automatically).
#
# All configuration values have a default value;... | mit |
goldsborough/.emacs | .emacs.d/.python-environments/default/lib/python3.5/encodings/mac_latin2.py | 219 | 14118 | """ Python Character Mapping Codec mac_latin2 generated from 'MAPPINGS/VENDORS/MICSFT/MAC/LATIN2.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.... | mit |
Pablo126/SSBW | Tarea1y2/flask_1/flask1/lib/python3.5/site-packages/flask/json.py | 121 | 9183 | # -*- coding: utf-8 -*-
"""
flask.jsonimpl
~~~~~~~~~~~~~~
Implementation helpers for the JSON support in Flask.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import io
import uuid
from datetime import date
from .globals import current_app, request
from ._... | gpl-3.0 |
enen92/script.tvlogo.downloader | resources/lib/tvlogodownloader.py | 5 | 13160 | # -*- coding: utf-8 -*-
# Copyright (C) 2015 enen92
#
# 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 i... | gpl-2.0 |
brinbois/Sick-Beard | lib/hachoir_metadata/metadata_item.py | 90 | 4916 | from lib.hachoir_core.tools import makeUnicode, normalizeNewline
from lib.hachoir_core.error import HACHOIR_ERRORS
from lib.hachoir_metadata import config
from lib.hachoir_metadata.setter import normalizeString
MIN_PRIORITY = 100
MAX_PRIORITY = 999
QUALITY_FASTEST = 0.0
QUALITY_FAST = 0.25
QUALITY_NORMAL = 0.5
QUALIT... | gpl-3.0 |
cockroachdb/examples-orms | python/django/cockroach_example/settings.py | 1 | 3362 | """
Django settings for cockroach_example project.
Generated by 'django-admin startproject' using Django 2.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
im... | apache-2.0 |
jbzdak/data-base-checker | bazydanych2/settingsdev.py | 1 | 1181 |
from bazydanych2.settingsshared import *
DEBUG=True
TEMPLATE_DEBUG=True
STATIC_ROOT = '/tmp/staticfiles'
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
},
'require_debug_tru... | gpl-3.0 |
ted-gould/nova | nova/tests/unit/compute/test_compute_mgr.py | 1 | 197801 | # 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 |
jn7163/django | tests/null_fk_ordering/tests.py | 381 | 2012 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Article, Author, Comment, Forum, Post, SystemInfo
class NullFkOrderingTests(TestCase):
def test_ordering_across_null_fk(self):
"""
Regression test for #7512
ordering across nullable Foreign Key... | bsd-3-clause |
cmelange/ansible | lib/ansible/modules/storage/netapp/netapp_e_storage_system.py | 6 | 11504 | #!/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 |
ezequielpereira/Time-Line | libs/wx/tools/Editra/src/eclib/filterdlg.py | 2 | 5746 | ###############################################################################
# Name: filterdlg.py #
# Purpose: Filter dialog #
# Author: Cody Precord <cprecord@editra.org> #
... | gpl-3.0 |
Lujeni/ansible | lib/ansible/modules/cloud/google/gcp_iam_service_account_key.py | 16 | 9842 | #!/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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.