repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
futurecolors/suds | tests/axis1.py | 30 | 8749 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 the hope that it will ... | lgpl-3.0 |
SrNetoChan/QGIS | python/plugins/processing/modeler/ExportModelAsPythonScriptAction.py | 33 | 1955 | # -*- coding: utf-8 -*-
"""
***************************************************************************
EditModelAction.py
---------------------
Date : February 2019
Copyright : (C) 2019 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
************... | gpl-2.0 |
takeshineshiro/cinder | cinder/volume/drivers/prophetstor/dplcommon.py | 16 | 62523 | # Copyright (c) 2014 ProphetStor, 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 req... | apache-2.0 |
ehirt/odoo | addons/crm_profiling/wizard/open_questionnaire.py | 333 | 3800 | # -*- 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 |
Team-Blackout/Blackout-MSM7x30-3.0.xx | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
credativUK/OCB | addons/crm/wizard/__init__.py | 60 | 1205 | # -*- 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 |
lashwang/pyspider | pyspider/libs/result_dump.py | 12 | 3952 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2015-03-27 20:12:11
import six
import csv
import json
import itertools
from io import StringIO, BytesIO
from six import iteritems
def result_formater(r... | apache-2.0 |
kirca/OpenUpgrade | addons/account/report/account_entries_report.py | 93 | 7777 | # -*- 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 |
cpina/science-cruise-data-management | ScienceCruiseDataManagement/metadata/management/commands/importrucontenttypes.py | 1 | 1765 | from django.core.management.base import BaseCommand, CommandError
from metadata.models import RUContentType
from django.conf import settings
import csv
# This file is part of https://github.com/cpina/science-cruise-data-management
#
# This project was programmed in a hurry without any prior Django experience,
# while ... | mit |
erramuzpe/seattle-perceptual-learning | perclearn/scripts/fashion_mnist_cnn_experiment1.py | 1 | 2826 | # -*- coding: utf-8 -*-
'''Trains a simple convnet on the Fashion MNIST dataset modified:
- Experiment 1: Training with the image in upper left cuadrant
and testing randomly distributed among other cuadrants.
Gets to % test accuracy after 12 epochs
'''
from __future__ import print_function
import keras
... | apache-2.0 |
boooka/GeoPowerOff | venv/lib/python2.7/site-packages/grab/tools/pwork.py | 2 | 3555 | from multiprocessing import Process, Queue
import time
try:
from Queue import Empty
except ImportError:
from queue import Empty
import logging
from grab.util.py3k_support import *
class Stop(object):
pass
STOP = Stop()
class Worker(Process):
def __init__(self, callback, taskq, resultq, ignore_except... | apache-2.0 |
andmos/ansible | lib/ansible/plugins/action/net_vrf.py | 756 | 1058 | # (c) 2017, Ansible 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.
#
# Ansible is di... | gpl-3.0 |
AMOboxTV/AMOBox.LegoBuild | script.module.youtube.dl/lib/youtube_dl/extractor/funimation.py | 9 | 8214 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
clean_html,
determine_ext,
encode_dict,
int_or_none,
sanitized_Request,
ExtractorError,
urlencode_postdata
)
class FunimationIE(InfoExtractor):
_VALID_URL = r'https?://(?:ww... | gpl-2.0 |
rileychapman/roscopter-1 | mavlink/pymavlink/build/lib.linux-x86_64-2.7/pymavlink/dialects/v09/common.py | 4 | 225949 | '''
MAVLink protocol implementation (auto-generated by mavgen.py)
Generated from: common.xml
Note: this file has been auto-generated. DO NOT EDIT
'''
import struct, array, time, json
from ...generator.mavcrc import x25crc
WIRE_PROTOCOL_VERSION = "0.9"
# some base types from mavlink_types.h
MAVLINK_TYPE_CHAR =... | bsd-3-clause |
hbhzwj/imalse | tools/ns-allinone-3.14.1/ns-3.14.1/src/bridge/examples/csma-bridge.py | 29 | 5276 | # /*
# * 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
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the i... | gpl-3.0 |
AustinRoy7/Pomodoro-timer | venv/Lib/site-packages/pip/vcs/git.py | 142 | 10218 | from __future__ import absolute_import
import logging
import tempfile
import os.path
from pip.compat import samefile
from pip.exceptions import BadCommand
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib import request as urllib_request
from pip.utils import display_pa... | mit |
biotty/rmg | graphics/py/icons.py | 1 | 5473 | #!/usr/bin/env python3
#
# (c) Christian Sommerfeldt OEien
# All rights reserved
import pygame, os
from rmg import avrepr
from exceptions import Exception, EOFError, SystemExit
from random import randrange
PS1 = ">>>"
PS2 = "..."
class Recorder:
frames_per_second = 10
def __init__(self, screen... | bsd-2-clause |
sushifant/namebench | libnamebench/site_connector.py | 175 | 4048 | # Copyright 2010 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 |
wamgoo/FPGA-Imaging-Library | Generator/FrameController2/SimResCheck/compare.py | 68 | 1961 | __author__ = 'Tianyu Dai (dtysky)'
from PIL import Image, ImageChops, ImageStat
import os, json, re, math
FileFormat = ['.jpg', '.bmp']
def name_format(root, name, ex, conf):
return '%s-%s' % (name, conf['lm_gain'])
def get_psnr(FileAll):
psnrs = {}
for name, f_pair in FileAll.items():
diffs = ImageChops.diffe... | lgpl-2.1 |
Jeebeevee/DouweBot | plugins/seen.py | 13 | 1722 | " seen.py: written by sklnd in about two beers July 2009"
import time
from util import hook, timesince
def db_init(db):
"check to see that our db has the the seen table and return a connection."
db.execute("create table if not exists seen(name, time, quote, chan, "
"primary key(name, chan))")... | unlicense |
alexpear/commander | gamestate.py | 1 | 12255 | import math
import random
from random import randrange
import unit_modu
import util
HEIGHT = 8
WIDTH = 12
TERRAIN_FREQUENCY = 0.25
# doesn't really do anything in this build but whatever
# maybe useful for terrain/cover later
# alt names: Tile Space Spot Location
class Square:
def __init__(self):
self.terrain... | gpl-2.0 |
futurice/vdsm | vdsm_hooks/scratchpad/before_vm_start.py | 2 | 3936 | #!/usr/bin/python
import os
import re
import sys
import traceback
import hooking
'''
scratchpad vdsm hook
====================
Hook creates a disk for a VM onetime usage,
the disk will be erased when the VM destroyed.
VM cannot be migrated when using scratchpad hook
syntax:
scratchpad=size,path
ie:
scra... | gpl-2.0 |
jayceyxc/hue | apps/oozie/src/oozie/importlib/workflows.py | 3 | 25932 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
atiberghien/makerscience-server | makerscience_profile/migrations/0001_initial.py | 1 | 4891 | # -*- 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):
# Adding model 'MakerScienceProfile'
db.create_table(u'makerscience_profi... | agpl-3.0 |
DominoTree/servo | tests/wpt/web-platform-tests/tools/manifest/tests/test_XMLParser.py | 142 | 1445 | from xml.etree.ElementTree import ParseError
import pytest
from ..XMLParser import XMLParser
@pytest.mark.parametrize("s", [
'<foo> </foo>',
'<!DOCTYPE foo><foo> </foo>',
'<!DOCTYPE foo PUBLIC "fake" "id"><foo> </foo>',
'<!DOCTYPE foo PUBLIC "fake" "http://www.w3.org/TR/xhtml1/DTD/xht... | mpl-2.0 |
leedm777/ansible | v1/ansible/module_utils/known_hosts.py | 229 | 6532 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
bclau/nova | nova/tests/virt/docker/test_driver.py | 4 | 2809 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2013 dotCloud, 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... | apache-2.0 |
staslev/incubator-beam | sdks/python/apache_beam/runners/__init__.py | 23 | 1342 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
loco-odoo/localizacion_co | openerp/addons-extra/odoo-pruebas/odoo-server/addons/account_payment/report/__init__.py | 436 | 1066 | # -*- 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 |
Crystal-SDS/filter-middleware | crystal_filter_middleware/handlers/base.py | 1 | 5971 | from swift.proxy.controllers.base import get_account_info
from swift.common.utils import config_true_value
try:
from crystal_filter_middleware.filters.storlet import StorletFilter
STORLETS = True
except:
STORLETS = False
import redis
class NotCrystalRequest(Exception):
pass
def _request_instance_pro... | gpl-3.0 |
Boussadia/weboob | weboob/capabilities/housing.py | 4 | 3614 | # -*- coding: utf-8 -*-
# Copyright(C) 2012 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | agpl-3.0 |
Plain-Andy-legacy/android_external_chromium_org | tools/perf/page_sets/PRESUBMIT.py | 25 | 4592 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import re
import sys
def LoadSupport(input_api):
if 'cloud_storage' not in globals():
# Avoid leaking changes to global sys.path.
_old_... | bsd-3-clause |
dlazz/ansible | lib/ansible/plugins/terminal/exos.py | 58 | 2026 | #
# (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 your option) any later version.
#
# Ansible is d... | gpl-3.0 |
Sylrob434/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/soundcloud.py | 8 | 12135 | # encoding: utf-8
from __future__ import unicode_literals
import re
import itertools
from .common import InfoExtractor
from ..utils import (
compat_str,
compat_urlparse,
compat_urllib_parse,
ExtractorError,
int_or_none,
unified_strdate,
)
class SoundcloudIE(InfoExtractor):
"""Informatio... | gpl-3.0 |
emonty/ansible | test/units/module_utils/urls/test_RedirectHandlerFactory.py | 70 | 5490 | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.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
__metaclass__ = type
from ansible.module_utils.urls import HAS_SSLCONTEXT, RedirectHandlerFactor... | gpl-3.0 |
M4sse/chromium.src | chrome/common/extensions/docs/server2/content_providers_test.py | 60 | 6784 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import unittest
from compiled_file_system import CompiledFileSystem
from content_providers import ContentProviders
from ex... | bsd-3-clause |
bmanojlovic/ansible | lib/ansible/modules/cloud/amazon/elasticache.py | 25 | 21695 | #!/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 |
samchrisinger/osf.io | scripts/analytics/links.py | 55 | 1227 | # -*- coding: utf-8 -*-
import os
import matplotlib.pyplot as plt
from framework.mongo import database
from website import settings
from .utils import plot_dates, mkdirp
link_collection = database['privatelink']
FIG_PATH = os.path.join(settings.ANALYTICS_PATH, 'figs', 'features')
mkdirp(FIG_PATH)
def analyze_vi... | apache-2.0 |
tonk/ansible | test/units/plugins/action/test_raw.py | 47 | 3845 | # (c) 2016, Saran Ahluwalia <ahlusar.ahluwalia@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... | gpl-3.0 |
walac/servo | tests/wpt/css-tests/tools/html5lib/html5lib/tests/mockParser.py | 452 | 1263 | from __future__ import absolute_import, division, unicode_literals
import sys
import os
if __name__ == '__main__':
# Allow us to import from the src directory
os.chdir(os.path.split(os.path.abspath(__file__))[0])
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, "src")))
from html5lib.tokenizer ... | mpl-2.0 |
de-wolff/caf_msm_kernel | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# 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.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
Geontech/Code_Blocks | Tutorials/Devices and Ports/simple_tcp/python/simple_tcp_base.py | 1 | 9729 | #!/usr/bin/env python
#
# AUTO-GENERATED CODE. DO NOT MODIFY!
#
# Source: simple_tcp.spd.xml
from ossie.cf import CF, CF__POA
from ossie.utils import uuid
from ossie.device import Device
from ossie.properties import simple_property
import Queue, copy, time, threading
from ossie.resource import usesport, providesport... | gpl-3.0 |
ar45/django | tests/template_tests/syntax_tests/test_if.py | 73 | 23743 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import TestObj, setup
class IfTagTests(SimpleTestCase):
@setup({'if-tag01': '{% if foo %}yes{% else %}no{% endif %}'})
def test_if_tag01(self):
output = self.engine.render_to_string('if-tag01', {'foo'... | bsd-3-clause |
gspeedtech/Audacity-2 | lib-src/lv2/lv2/plugins/eg-midigate.lv2/waflib/Tools/compiler_fc.py | 287 | 1846 | #! /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,sys,imp,types
from waflib import Utils,Configure,Options,Logs,Errors
from waflib.Tools import fc
fc_compiler={'win32':['gfortran','ifort'],'darwin':['gfortran','g95'... | gpl-2.0 |
ZachRiegel/scriptbin | pypyjs/modules/test/test_traceback.py | 8 | 8456 | """Test cases for traceback module"""
from StringIO import StringIO
import sys
import unittest
from imp import reload
from test.test_support import run_unittest, is_jython, Error, cpython_only
from test.test_support import check_impl_detail, impl_detail
import traceback
class TracebackCases(unittest.TestCase):
... | gpl-3.0 |
browseinfo/odoo_saas3_nicolas | addons/lunch/tests/test_lunch.py | 95 | 5040 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
cfwprpht/WinObjC | deps/scripts/zlib.py | 159 | 8470 |
# python 2.7.9
import subprocess, os.path, os, shutil
DEBUG = False
BUILD_CONFIGURATION = "RelWithDebInfo"
PATCH_FILE = os.path.realpath(os.path.join(".", "zlib.patch"))
BUILD_DIR = "temp_build"
PATH_FILE = "paths.txt"
OUTPUT_DIR = os.path.realpath(os.path.join("..", "prebuilt"))
HEADER_DIR = os.path.realpath(os.pat... | mit |
sdpython/cvxpy | cvxpy/tests/test_elemental.py | 11 | 2895 | from cvxpy import *
from cvxpy.tests.base_test import BaseTest
class TestSolvers(BaseTest):
""" Unit tests for solver specific behavior. """
def setUp(self):
self.a = Variable(name='a')
self.b = Variable(name='b')
self.c = Variable(name='c')
self.x = Variable(2, name='x')
... | gpl-3.0 |
pblottiere/QGIS | tests/src/python/test_qgsblendmodes.py | 45 | 7527 | # -*- coding: utf-8 -*-
"""
***************************************************************************
test_qgsblendmodes.py
---------------------
Date : May 2013
Copyright : (C) 2013 by Nyall Dawson, Massimo Endrighi
Email : nyall dot dawson at gmail.com
... | gpl-2.0 |
wjr1005/p2pool | SOAPpy/NS.py | 289 | 3724 | from __future__ import nested_scopes
"""
################################################################################
#
# SOAPpy - Cayce Ullman (cayce@actzero.com)
# Brian Matthews (blm@actzero.com)
# Gregory Warnes (Gregory.R.Warnes@Pfizer.com)
# Christopher Blunck (blunck... | gpl-3.0 |
ejeschke/ginga | ginga/util/stages/base.py | 3 | 1889 | #
# stage.py -- Classes for pipeline stages
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from ginga.misc import Bunch
#__all__ = ['Pipeline']
class StageError(Exception):
pass
class Stage(object):
"""Class to handle a pipeline stage."""
... | bsd-3-clause |
illicitonion/givabit | lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_0_96/django/middleware/cache.py | 32 | 4058 | from django.conf import settings
from django.core.cache import cache
from django.utils.cache import get_cache_key, learn_cache_key, patch_response_headers
class CacheMiddleware(object):
"""
Cache middleware. If this is enabled, each Django-powered page will be
cached for CACHE_MIDDLEWARE_SECONDS seconds. C... | apache-2.0 |
chrmoritz/starcheat | starcheat/assets/techs.py | 3 | 1657 | import os
import logging
from io import BytesIO
from PIL import Image
class Techs():
def __init__(self, assets):
self.assets = assets
self.starbound_folder = assets.starbound_folder
def is_tech(self, key):
if key.endswith(".tech"):
return True
else:
re... | mit |
pedro-r-marques/kubernetes | cluster/juju/charms/trusty/kubernetes-master/hooks/setup.py | 149 | 1410 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
jiyuren/android_kernel_oneplus_msm8994 | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
balena/turnover | gtest/scripts/upload_gtest.py | 1963 | 2851 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
PanDAWMS/panda-harvester | pandaharvester/harvesterbody/job_fetcher.py | 1 | 7669 | import socket
import datetime
import random
from future.utils import iteritems
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestercore import core_utils
from pandaharvester.harvestercore.job_spec import JobSpec
from pandaharvester.harvestercore.file_spec import FileSpec
from panda... | apache-2.0 |
nwjs/chromium.src | tools/polymer/generate_gn_v3.py | 9 | 2433 | #!/usr/bin/env python
# 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.
from __future__ import print_function
from datetime import date
import json
import os.path as path
import sys
_COMPILE_JS = '//third_... | bsd-3-clause |
prampey/servo | tests/wpt/harness/wptrunner/wptmanifest/tests/test_static.py | 57 | 2776 | # 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 unittest
from cStringIO import StringIO
from ..backends import static
# There aren't many tests here because i... | mpl-2.0 |
LaGvidilo/steganorus | debian/steganorus/usr/lib/python2.7/dist-packages/steganorus/AboutSteganorusDialog.py | 3 | 1333 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2015 COELHO <cyrilcoelho67@gmail.com>
# 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 Softwar... | gpl-2.0 |
hasadna/django | tests/regressiontests/model_forms_regress/tests.py | 54 | 20179 | from __future__ import absolute_import, unicode_literals
from datetime import date
from django import forms
from django.core.exceptions import FieldError, ValidationError
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms.models import (modelform_factory, ModelChoiceField,
fields_for_... | bsd-3-clause |
Antiun/c2c-rd-addons | sale_margin_invoice_rel/__openerp__.py | 4 | 1897 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Ferdinand Gassauer (ChriCar Beteiligungs- und Beratungs- GmbH)
#
# WARNING: This program as such is intended to be us... | agpl-3.0 |
rishita/mxnet | python/mxnet/module/module.py | 1 | 28224 | # pylint: disable=too-many-instance-attributes, too-many-arguments, protected-access, too-many-branches
# pylint: disable=too-many-public-methods
"""A `Module` implement the `BaseModule` API by wrapping a `Symbol` and one or
more `Executor` for data parallelization.
"""
import logging
import warnings
from .. import c... | apache-2.0 |
Cocuyo-Labs-Team/ccytsk | ccytsk/core/database/fake.py | 1 | 7867 | import random
import os
import csv
import datetime
import pandas as pd
import copy
from orm import ForeignKey, ColumnFake
from ccytsk.core.fake.mfaker import MFaker
class SchemaFaker(object):
def __init__(self, schema, locale=None):
self.schema = schema
self.data = {}
self.fkey_data = {}
... | bsd-3-clause |
pandorabots/Virtual-Guide-Generator | Virtual_Guide_Generator.py | 2 | 14140 | import argparse
import sys
import re
import requests
import csv
from pb_py import main as api
""""
This code will enable anyone to be able to instantaneously create and upload a virtual guide bot to their website by filling out
a simple txt or csv and providing their sdk credentials.
"""
# a dictionary where each ke... | gpl-3.0 |
freeworldxbmc/pluging.video.Jurassic.World.Media | resources/lib/libraries/f4mproxy/utils/python_rc4.py | 207 | 1073 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Pure-Python RC4 implementation."""
from .rc4 import RC4
from .cryptomath import *
def new(key):
return Python_RC4(key)
class Python_RC4(RC4):
def __init__(self, keyBytes):
RC4.__init__(self, keyBytes,... | gpl-3.0 |
rupran/ansible | lib/ansible/modules/network/cumulus/_cl_interface_policy.py | 70 | 5315 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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... | gpl-3.0 |
blackms/myTelegramBot | myTelegramBot/libs/gmail/message.py | 1 | 8081 | import datetime
import email
import os
import re
import time
from email.header import decode_header
from imaplib import ParseFlags
class Message(object):
def __init__(self, mailbox, uid):
self.uid = uid
self.mailbox = mailbox
self.gmail = mailbox.gmail if mailbox else None
self.me... | mit |
kingvuplus/bh-s | lib/python/Components/Converter/ValueToPixmap.py | 33 | 1211 | from Components.Converter.Converter import Converter
from Components.Element import cached, ElementError
from Tools.Directories import fileExists, SCOPE_SKIN_IMAGE, SCOPE_CURRENT_SKIN, resolveFilename
from Tools.LoadPixmap import LoadPixmap
class ValueToPixmap(Converter, object):
LANGUAGE_CODE = 0
PATH = 1
def __... | gpl-2.0 |
mapbox/gyp | pylib/gyp/generator/analyzer.py | 15 | 21406 | # Copyright (c) 2014 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.
"""
This script is intended for use as a GYP_GENERATOR. It takes as input (by way of
the generator flag config_path) the path of a json file that dictates the file... | bsd-3-clause |
facebookresearch/ParlAI | tests/test_self_chat.py | 1 | 1656 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from tempfile import NamedTemporaryFile
import unittest
from parlai.scripts.self_chat import SelfChat
import parlai.uti... | mit |
ferabra/edx-platform | lms/djangoapps/shoppingcart/migrations/0017_auto__add_field_courseregistrationcode_order__chg_field_registrationco.py | 114 | 15384 | # -*- 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 'CourseRegistrationCode.order'
db.add_column('shoppingcart_courseregistrationcode', 'order',
... | agpl-3.0 |
TAJaroszewski/lma_contrail_monitoring | deployment_scripts/puppet/modules/lma_contrail_monitoring/files/scripts/check-api-contrail-8086.py | 1 | 4630 | # !/usr/bin/python
#
# Copyright 2016 Mirantis, 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 ... | apache-2.0 |
luebbers/reconos | tools/python/simulation/rsimgui/rsimguiMainWindowController.py | 1 | 2377 | #
# \file rsimguiMainWindowController.py
#
# \author Enno Luebbers <luebbers@reconos.de>
# \date 22.08.2009
#
#---------------------------------------------------------------------------
# %%%RECONOS_COPYRIGHT_BEGIN%%%
#
# This file is part of ReconOS (http://www.reconos.de).
# Copyright (c) 2006-2010 The Re... | gpl-3.0 |
4eek/edx-platform | lms/djangoapps/courseware/migrations/0008_add_xmodule_storage.py | 114 | 13726 | # -*- 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 'XModuleStudentInfoField'
db.create_table('courseware_xmodulestudentinfofield', (
... | agpl-3.0 |
Workday/OpenFrame | tools/cr/cr/commands/install.py | 113 | 1206 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A module for the install command."""
import cr
class InstallCommand(cr.Command):
"""The implementation of the install command.
This first uses Bui... | bsd-3-clause |
thnee/ansible | lib/ansible/plugins/connection/oc.py | 38 | 5091 | # Based on the docker connection plugin
#
# Connection plugin for configuring kubernetes containers with kubectl
# (c) 2017, XuXinkun <xuxinkun@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 publis... | gpl-3.0 |
devkev/mtools | mtools/test/test_util_logevent.py | 7 | 8723 | import sys
from nose.tools import *
from mtools.util.logevent import LogEvent
import time
import datetime
from dateutil import parser
line_ctime_pre24 = "Sun Aug 3 21:52:05 [initandlisten] db version v2.2.4, pdfile version 4.5"
line_ctime = "Sun Aug 3 21:52:05.995 [initandlisten] db version v2.4.5"
line_iso8601_loca... | apache-2.0 |
AlexRobson/scikit-learn | doc/tutorial/machine_learning_map/svg2imagemap.py | 360 | 3411 | #!/usr/local/bin/python
"""
This script converts a subset of SVG into an HTML imagemap
Note *subset*. It only handles <path> elements, for which it only pays
attention to the M and L commands. Futher, it only notices the "translate"
transform.
It was written to generate the examples in the documentation f... | bsd-3-clause |
sYnfo/samba | third_party/pep8/testsuite/W19.py | 34 | 2637 | #: W191
if False:
print # indented with 1 tab
#:
#: W191
y = x == 2 \
or x == 3
#: E101 W191
if (
x == (
3
) or
y == 4):
pass
#: E101 W191
if x == 2 \
or y > 1 \
or x == 3:
pass
#: E101 W191
if x == 2 \
or y > 1 \
or x == 3:
pass
#:
#: E101 W191
i... | gpl-3.0 |
mdrumond/tensorflow | tensorflow/compiler/tests/unary_ops_test.py | 4 | 22277 | # 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 |
lummyare/lummyare-lummy | py/selenium/common/exceptions.py | 8 | 4338 | # Copyright 2008-2009 WebDriver committers
# Copyright 2008-2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
brchiu/tensorflow | tensorflow/python/kernel_tests/cholesky_op_test.py | 5 | 15415 | # 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 |
dims/neutron | neutron/common/rpc.py | 4 | 7659 | # Copyright (c) 2012 OpenStack Foundation.
# Copyright (c) 2014 Red Hat, 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... | apache-2.0 |
bgris/ODL_bgris | odl/tomo/backends/stir_bindings.py | 2 | 11187 | # Copyright 2014-2016 The ODL development group
#
# This file is part of ODL.
#
# ODL 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 |
inventree/InvenTree | InvenTree/part/serializers.py | 2 | 15798 | """
JSON serializers for Part app
"""
import imghdr
from decimal import Decimal
from django.urls import reverse_lazy
from django.db import models
from django.db.models import Q
from django.db.models.functions import Coalesce
from rest_framework import serializers
from sql_util.utils import SubqueryCount, SubquerySum
... | mit |
vrv/tensorflow | tensorflow/python/debug/cli/profile_analyzer_cli.py | 5 | 16128 | # 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 |
kawamon/hue | desktop/core/ext-py/Django-1.11.29/tests/middleware_exceptions/tests.py | 24 | 6903 | from django.conf import settings
from django.core.exceptions import MiddlewareNotUsed
from django.test import RequestFactory, SimpleTestCase, override_settings
from django.test.utils import patch_logger
from . import middleware as mw
@override_settings(ROOT_URLCONF='middleware_exceptions.urls')
class MiddlewareTests... | apache-2.0 |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/django-1.2/django/core/context_processors.py | 65 | 3353 | """
A set of request processors that return dictionaries to be merged into a
template context. Each function takes the request object as its only parameter
and returns a dictionary to add to the context.
These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by
RequestContext.
"""
from django.conf... | mit |
Matt-Deacalion/django | django/utils/synch.py | 586 | 2558 | """
Synchronization primitives:
- reader-writer lock (preference to writers)
(Contributed to Django by eugene@lazutkin.com)
"""
import contextlib
import threading
class RWLock(object):
"""
Classic implementation of reader-writer lock with preference to writers.
Readers can access a resource simult... | bsd-3-clause |
hmcmooc/muddx-platform | common/djangoapps/lang_pref/tests/test_middleware.py | 54 | 1744 | from django.test import TestCase
from django.test.client import RequestFactory
from django.contrib.sessions.middleware import SessionMiddleware
from lang_pref.middleware import LanguagePreferenceMiddleware
from user_api.models import UserPreference
from lang_pref import LANGUAGE_KEY
from student.tests.factories import... | agpl-3.0 |
xindus40223115/2015cd_midterm | static/Brython3.1.0-20150301-090019/Lib/browser/local_storage.py | 617 | 2786 | # local storage in browser
import sys
from javascript import JSObject
class __UnProvided():
pass
class LocalStorage():
storage_type = "local_storage"
def __init__(self):
if not sys.has_local_storage:
raise EnvironmentError("LocalStorage not available")
self.store = JSObject(__... | gpl-3.0 |
ProjexSoftware/projex | projex/locks.py | 2 | 2447 | """
Defines useful thread locks. Credit for this code goes to:
http://code.activestate.com/recipes/577803-reader-writer-lock-with-priority-for-writers/
"""
import datetime
import logging
import threading
log = logging.getLogger(__name__)
class _MutexSwitcher(object):
"""An auxiliary "light switch"-like object... | lgpl-3.0 |
iandees/pyosm | examples/osm2csv.py | 1 | 5252 | import pyosm.model
from pyosm.parsing import iter_osm_file
import sys
import unicodecsv
import gzip
import re
class ThingHolder(object):
def __init__(self, nodes, ways, relations, changesets):
self.nodes = nodes
self.ways = ways
self.relations = relations
self.changesets = changeset... | mit |
angdraug/nova | nova/cmd/idmapshift.py | 68 | 7093 | # Copyright 2014 Rackspace, Andrew Melton
#
# 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 |
czimmerman9/ThinkStats2 | code/cumulative.py | 67 | 6252 | """This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import numpy as np
import nsfg
import first
import thinkstats2
import thi... | gpl-3.0 |
RyanYoung25/tensorflow | tensorflow/g3doc/how_tos/adding_an_op/zero_out_1_test.py | 3 | 1170 | # Copyright 2015 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 a... | apache-2.0 |
jiangzm/Bonobo-Git-Server | Bonobo.Git.Server/Content/components/highlight/docs/conf.py | 20 | 7771 | # -*- coding: utf-8 -*-
#
# highlight.js documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 12 23:48:27 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | mit |
anushbmx/kitsune | kitsune/dashboards/tests/test_views.py | 6 | 3861 | from datetime import timedelta, datetime
from nose.tools import eq_
from kitsune.announcements.tests import AnnouncementFactory
from kitsune.dashboards.readouts import CONTRIBUTOR_READOUTS
from kitsune.sumo.tests import TestCase
from kitsune.sumo.urlresolvers import reverse
from kitsune.users.tests import UserFactory... | bsd-3-clause |
bop/foundation | lib/python2.7/site-packages/django/utils/simplejson/encoder.py | 430 | 15620 | """Implementation of JSONEncoder
"""
import re
c_encode_basestring_ascii = None
c_make_encoder = None
ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]')
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')
HAS_UTF8 = re.compile(r'[\x80-\xff]')
ESCAPE_DCT = {
'\\': '\\\\',
'"': '\\"',
'\b': '\\b',
'\f': '\\f',
... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.