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 |
|---|---|---|---|---|---|
multikatt/beets | beetsplug/permissions.py | 1 | 3116 | from __future__ import (division, absolute_import, print_function,
unicode_literals)
"""Fixes file permissions after the file gets written on import. Put something
like the following in your config.yaml to configure:
permissions:
file: 644
dir: 755
"""
import os
fro... | mit |
ghickman/django | tests/auth_tests/test_decorators.py | 279 | 4124 | from django.conf import settings
from django.contrib.auth import models
from django.contrib.auth.decorators import login_required, permission_required
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.test.client impo... | bsd-3-clause |
Befera/portfolio | node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | mit |
nitzmahone/ansible | lib/ansible/utils/cmd_functions.py | 233 | 2793 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
gonadarian/kagen | kagen/khan.py | 1 | 1955 | import os
import csv
import json
import pymongo
from kagen import utils
from kagen.utils import config
from datetime import datetime
logger = utils.get_logger("khan")
def work():
khan = utils.get_conn_khan()
db = utils.get_conn_mongo()
dtf = "%Y-%m-%dT%H:%M:%SZ"
doc = utils.get_response_json(khan, ... | mit |
Chilledheart/chromium | tools/telemetry/third_party/webpagereplay/third_party/ipaddr/setup.py | 93 | 1274 | #!/usr/bin/python
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | bsd-3-clause |
ychfan/tensorflow | tensorflow/python/debug/cli/evaluator.py | 80 | 5731 | # 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 |
buntyke/GPy | GPy/testing/examples_tests.py | 15 | 3721 | # Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import unittest
import numpy as np
import GPy
import inspect
import pkgutil
import os
import random
from nose.tools import nottest
import sys
import itertools
class ExamplesTests(unittest.TestCase):
de... | mit |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | .meteor/local/dev_bundle/python/Lib/stringold.py | 293 | 12449 | # module 'string' -- A collection of string operations
# Warning: most of the code you see here isn't normally used nowadays. With
# Python 1.6, many of these functions are implemented as methods on the
# standard string object. They used to be implemented by a built-in module
# called strop, but strop is now obsolet... | gpl-3.0 |
ZLLab-Mooc/edx-platform | common/test/acceptance/tests/test_annotatable.py | 31 | 5304 | # -*- coding: utf-8 -*-
"""
E2E tests for the LMS.
"""
from .helpers import UniqueCourseTest
from ..pages.studio.auto_auth import AutoAuthPage
from ..pages.lms.courseware import CoursewarePage
from ..pages.lms.annotation_component import AnnotationComponentPage
from ..fixtures.course import CourseFixture, XBlockFixtur... | agpl-3.0 |
alon/servo | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/http_header_util.py | 694 | 6905 | # Copyright 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... | mpl-2.0 |
mancoast/CPythonPyc_test | fail/341_test_builtin.py | 72 | 58513 | # Python test set -- built-in functions
import ast
import builtins
import collections
import io
import locale
import os
import pickle
import platform
import random
import sys
import traceback
import types
import unittest
import warnings
from operator import neg
from test.support import TESTFN, unlink, run_unittest, c... | gpl-3.0 |
kjc88/sl4a | python/src/Lib/email/charset.py | 58 | 15791 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org
__all__ = [
'Charset',
'add_alias',
'add_charset',
'add_codec',
]
import email.base64mime
import email.quoprimime
from email import errors
from email.encoders import encode_... | apache-2.0 |
irvined1982/olweb-clients | bin/bkill.py | 1 | 3674 | #!/usr/bin/env python
# Copyright 2014 David Irvine
#
# This file is part of olwclients
#
# olwclients 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 |
aselle/tensorflow | tensorflow/python/debug/wrappers/framework_test.py | 57 | 16639 | # 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 |
saumishr/django | tests/regressiontests/admin_views/tests.py | 4 | 168171 | # coding: utf-8
from __future__ import with_statement, absolute_import
import os
import re
import datetime
import urlparse
from django.conf import settings
from django.core import mail
from django.core.exceptions import SuspiciousOperation
from django.core.files import temp as tempfile
from django.core.urlresolvers i... | bsd-3-clause |
panosl/helios | helios/orders/forms.py | 1 | 1114 | from django import forms
from helios.shipping.models import ShippingMethodRegions
class ShippingChoiceField(forms.ModelChoiceField):
def label_from_instance(self, obj):
return u'%s, %s - %s' % (obj.method.name, obj.method.shipper, obj.cost)
# todo this needs to be handled either here
# or in the checkou... | bsd-3-clause |
auready/flask | scripts/flaskext_compat.py | 153 | 5038 | # -*- coding: utf-8 -*-
"""
flaskext_compat
~~~~~~~~~~~~~~~
Implements the ``flask.ext`` virtual package for versions of Flask
older than 0.7. This module is a noop if Flask 0.8 was detected.
Usage::
import flaskext_compat
flaskext_compat.activate()
from flask.ext import ... | bsd-3-clause |
stshine/servo | tests/wpt/css-tests/tools/manifest/sourcefile.py | 60 | 17459 | import hashlib
import re
import os
from six import binary_type
from six.moves.urllib.parse import urljoin
from fnmatch import fnmatch
try:
from xml.etree import cElementTree as ElementTree
except ImportError:
from xml.etree import ElementTree
import html5lib
from . import XMLParser
from .item import Stub, Man... | mpl-2.0 |
daler3/smack-next | Documentation/sphinx/kerneldoc.py | 210 | 5888 | # coding=utf-8
#
# Copyright © 2016 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 limitation
# the rights to use, copy, modify, me... | gpl-2.0 |
buaawp/pums | mock/migrations/0001_initial.py | 1 | 3879 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | mit |
40023256/2015cdag1man | static/Brython3.1.0-20150301-090019/Lib/unittest/test/test_assertions.py | 738 | 15398 | import datetime
import warnings
import unittest
from itertools import product
class Test_Assertions(unittest.TestCase):
def test_AlmostEqual(self):
self.assertAlmostEqual(1.00000001, 1.0)
self.assertNotAlmostEqual(1.0000001, 1.0)
self.assertRaises(self.failureException,
... | gpl-3.0 |
erjac77/ansible-module-f5bigip | library/f5bigip_net_vlan_interface.py | 2 | 4309 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016-2018, Eric Jacob <erjac77@gmail.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/LICENS... | apache-2.0 |
markodolancic/selenium | py/selenium/webdriver/support/abstract_event_listener.py | 61 | 2033 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
Paczesiowa/youtube-dl | youtube_dl/extractor/wat.py | 114 | 5370 | # coding: utf-8
from __future__ import unicode_literals
import re
import hashlib
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unified_strdate,
)
class WatIE(InfoExtractor):
_VALID_URL = r'http://www\.wat\.tv/video/(?P<display_id>.*)-(?P<short_id>.*?)_.*?\.html'
IE_NAME = '... | unlicense |
pasv/Empire | lib/modules/situational_awareness/network/get_computer.py | 10 | 3447 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-NetComputer',
'Author': ['@harmj0y'],
'Description': ('Queries the domain for current computer objects.'),
'Background' : True,
... | bsd-3-clause |
cossatot/culpable | culpable/magnitudes.py | 1 | 22751 | import numpy as np
from .stats import Pdf, pdf_from_samples, multiply_pdfs, divide_pdfs
"""
Scaling relationships and related equations for earthquake magnitude
calculations.
"""
"""
Normalized slip distribution from Biasi and Weldon, 2006
"""
Dn_x = np.array(
[ 0. , 0.03852144, 0.07704287, 0.11556431... | mit |
ocadotechnology/django-tastypie | tests/core/models.py | 10 | 3235 | from itertools import count
import uuid
from django.contrib.auth.models import User
from django.db import models
from tastypie.utils import now, aware_datetime
class DateRecord(models.Model):
date = models.DateField()
username = models.CharField(max_length=20)
message = models.CharField(max_length=20)
... | bsd-3-clause |
adw0rd/lettuce | tests/integration/lib/Django-1.3/django/contrib/gis/db/backends/spatialite/models.py | 403 | 1847 | """
The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
"""
from django.db import models
from django.contrib.gis.db.backends.base import SpatialRefSysMixin
class GeometryColumns(models.Model):
"""
The 'geometry_columns' table from SpatiaLite.
"""
f_table_name = models.CharField(ma... | gpl-3.0 |
giopastor/moose | python/calphad/free_energy.py | 11 | 1485 | #!/usr/bin/env python
"""
free_energy.py exports free energy expressions from a TDB thermodynamic databse
to the MOOSE input file format.
Usage:
free_energy.py database.tdb [list of phases]
If no list of phases is supplied all phases are exported.
"""
import sys
from pycalphad import Database, Model
from utils.fp... | lgpl-2.1 |
cselis86/edx-platform | openedx/core/djangoapps/user_api/preferences/api.py | 78 | 16486 | """
API for managing user preferences.
"""
import logging
import analytics
from eventtracking import tracker
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db import IntegrityError
from django.utils.translation import ugettext as _
from student.models import User, Us... | agpl-3.0 |
hassaanm/stock-trading | src/pybrain/optimization/memetic/memetic.py | 5 | 2448 | __author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.optimization.optimizer import BlackBoxOptimizer, TopologyOptimizer
from pybrain.optimization.hillclimber import HillClimber
from pybrain.structure.evolvables.maskedparameters import MaskedParameters
class MemeticSearch(HillClimber, TopologyOptimizer):
""" Inte... | apache-2.0 |
krishnazure/ansible | v1/ansible/runner/action_plugins/normal.py | 148 | 2205 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
LEXmono/q | bs4/tests/test_lxml.py | 41 | 2379 | """Tests to ensure that the lxml tree builder generates good trees."""
import re
import warnings
try:
import lxml.etree
LXML_PRESENT = True
LXML_VERSION = lxml.etree.LXML_VERSION
except ImportError as e:
LXML_PRESENT = False
LXML_VERSION = (0,)
if LXML_PRESENT:
from bs4.builder import LXMLTre... | apache-2.0 |
charmander/livestreamer | src/livestreamer_cli/utils/stream.py | 25 | 1050 | def stream_to_url(stream):
stream_type = type(stream).shortname()
if stream_type in ("hls", "http"):
url = stream.url
elif stream_type == "rtmp":
params = [stream.params.pop("rtmp", "")]
stream_params = dict(stream.params)
if "swfVfy" in stream.params:
stream_p... | bsd-2-clause |
sohrabtowfighi/pyTriMeshAxisymmetric | py_tri_axisym_calc/py_tri_axisym_calc.py | 2 | 15030 | """
Title: py_tri_calc
Licence: GNU Public Licence (GPL) v3.0
Purpose: Integrals and derivatives of elements in 2D triangular mesh
Description: Given a set of points at coordinates (x,y), where some
fields are defined (e.g velocity u, energy phi),
... | gpl-3.0 |
katrid/django | tests/lookup/tests.py | 153 | 37208 | from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from unittest import skipUnless
from django.core.exceptions import FieldError
from django.db import connection
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from .models import Article, ... | bsd-3-clause |
Moriadry/tensorflow | tensorflow/contrib/slim/__init__.py | 101 | 2359 | # 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 |
huwiki/featured-feeds | rsslib.py | 1 | 4281 | #!/usr/bin/python
# -*- coding: iso-8859-2 -*-
import sys, os
import re, string
import time, datetime, calendar, locale
import urllib
import cPickle
import xml.sax.saxutils
locale.setlocale(locale.LC_TIME, 'en_GB')
currenttimestamp = time.strftime(u'%a, %d %b %Y %H:%M:%S +0000', time.gmtime())
locale.setlocale(locale... | mit |
siddharthteotia/arrow | python/doc/source/conf.py | 3 | 11129 | # -*- 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 |
woodscn/scipy | scipy/special/c_misc/struve_convergence.py | 76 | 3725 | """
Convergence regions of the expansions used in ``struve.c``
Note that for v >> z both functions tend rapidly to 0,
and for v << -z, they tend to infinity.
The floating-point functions over/underflow in the lower left and right
corners of the figure.
Figure legend
=============
Red region
Power series is clo... | bsd-3-clause |
joeythesaint/yocto-autobuilder | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/scripts/cftp.py | 19 | 28118 | # -*- test-case-name: twisted.conch.test.test_cftp -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation module for the I{cftp} command.
"""
import os, sys, getpass, struct, tty, fcntl, stat
import fnmatch, pwd, glob
from twisted.conch.client import connect, default, options
... | gpl-2.0 |
mrquim/mrquimrepo | plugin.video.salts/scrapers/noobroom_scraper.py | 7 | 7730 | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | gpl-2.0 |
varund7726/android_kernel_oneplus_msm8974 | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
mgedmin/objgraph | objgraph.py | 1 | 43531 | """
Tools for drawing Python object reference graphs with graphviz.
You can find documentation online at https://mg.pov.lt/objgraph/
Copyright (c) 2008-2017 Marius Gedminas <marius@pov.lt> and contributors
Released under the MIT licence.
"""
# Permission is hereby granted, free of charge, to any person obtaining a
#... | mit |
Maccimo/intellij-community | python/helpers/profiler/prof_io.py | 36 | 2363 | import struct
import traceback
from _prof_imports import IS_PY3K
from _prof_imports import ProfilerRequest
from _prof_imports import TBinaryProtocolFactory
from _prof_imports import serialize, deserialize
from prof_util import ProfDaemonThread
def send_message(sock, message):
""" Send a serialized message (proto... | apache-2.0 |
jlopezmalla/spark | examples/src/main/python/ml/onehot_encoder_example.py | 72 | 1605 | #
# 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 |
android-ia/platform_external_chromium_org | build/android/symbolize.py | 97 | 2639 | #!/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.
"""Symbolizes stack traces generated by Chromium for Android.
Sample usage:
adb logcat chromium:V | symbolize.py
"""
import os
im... | bsd-3-clause |
mi4i-dev/android_kernel_xiaomi_ferrari | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
dfdx2/django | tests/forms_tests/field_tests/test_typedmultiplechoicefield.py | 106 | 3520 | import decimal
from django.forms import TypedMultipleChoiceField, ValidationError
from django.test import SimpleTestCase
class TypedMultipleChoiceFieldTest(SimpleTestCase):
def test_typedmultiplechoicefield_1(self):
f = TypedMultipleChoiceField(choices=[(1, "+1"), (-1, "-1")], coerce=int)
self.a... | bsd-3-clause |
t794104/ansible | lib/ansible/plugins/inventory/gcp_compute.py | 1 | 19487 | # 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 = '''
name: gcp_compute
plugin_type: inventory
short_description: Google C... | gpl-3.0 |
NeovaHealth/odoo | addons/auth_signup/res_config.py | 445 | 2860 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
erhuabushuo/crossbar | crossbar/controller/processtypes.py | 2 | 8570 | #####################################################################################
#
# Copyright (C) Tavendo GmbH
#
# Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you
# have purchased a commercial license), the license terms below apply.
#
# Should you enter into a separate licen... | agpl-3.0 |
saurabhbajaj207/CarpeDiem | venv/Lib/site-packages/pip/_vendor/html5lib/_trie/py.py | 1323 | 1775 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... | mit |
zstars/weblabdeusto | server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment2/experiment32/server_config.py | 968 | 1526 | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
weblab_xilinx_experiment_xilinx_device = 'FPGA'
weblab_xilinx_experiment_port_number = 1
# This should be something like this:
# import os as _os
# xilinx_home = _os.getenv('XILINX_HOME')
# if xilinx_home == None:
# if _os.name == 'nt':
# xilinx_home = r'C:... | bsd-2-clause |
pwnall/ansible | lib/ansible/inventory/__init__.py | 13 | 28266 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
hudora/huTools | huTools/http/_httplib2/socks.py | 811 | 18459 | """SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. 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 notice, this
... | bsd-3-clause |
pyecs/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_handlers.py | 293 | 9198 | import json
import os
import unittest
import urllib2
import uuid
import wptserve
from base import TestUsingServer, doc_root
class TestFileHandler(TestUsingServer):
def test_GET(self):
resp = self.request("/document.txt")
self.assertEquals(200, resp.getcode())
self.assertEquals("text/plain"... | mpl-2.0 |
LePetitDev/quizIO | node_modules/node-gyp/gyp/pylib/gyp/win_tool.py | 1417 | 12751 | #!/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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | mit |
acg/lwpb | python/pbsplit.py | 1 | 1605 | #!/usr/bin/env python
'''
pbsplit - split a protobuf stream into multiple files
'''
import sys
import getopt
import lwpb
import lwpb.stream
import lwpb.codec
def shift(L): e = L[0] ; del L[0:1] ; return e
def main():
typename = ""
skip = 0
count = -1
splitsize = 1000 # in number of records
pb2file = ... | apache-2.0 |
alvin319/CarnotKE | jyhton/lib-python/2.7/lib2to3/tests/test_main.py | 57 | 6227 | # -*- coding: utf-8 -*-
import sys
import codecs
import logging
import os
import re
import shutil
import StringIO
import sys
import tempfile
import unittest
from lib2to3 import main
TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "data")
PY2_TEST_MODULE = os.path.join(TEST_DATA_DIR, "py2_test_grammar.py")
... | apache-2.0 |
lgscofield/odoo | addons/purchase/partner.py | 210 | 2566 | # -*- 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... | agpl-3.0 |
Bjay1435/capstone | rootfs/usr/lib/python3.4/encodings/cp720.py | 270 | 13686 | """Python Character Mapping Codec cp720 generated on Windows:
Vista 6.0.6002 SP2 Multiprocessor Free with the command:
python Tools/unicode/genwincodec.py 720
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,error... | mit |
VasilyNemkov/percona-xtrabackup | storage/innobase/xtrabackup/test/python/subunit/tests/test_subunit_tags.py | 62 | 2267 | #
# subunit: extensions to python unittest to get test results from subprocesses.
# Copyright (C) 2005 Robert Collins <robertc@robertcollins.net>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project sour... | gpl-2.0 |
bitmovin/bitmovin-python | examples/encoding/create_progressive_webm_encoding_with_vp9_and_opus_codecs.py | 1 | 4978 | import datetime
from bitmovin import Bitmovin, Encoding, HTTPSInput, S3Output, \
StreamInput, SelectionMode, Stream, EncodingOutput, ACLEntry, ACLPermission, \
MuxingStream, CloudRegion, ProgressiveWebMMuxing, VP9CodecConfiguration, OpusCodecConfiguration, VP9Quality
from bitmovin.errors import BitmovinError
... | unlicense |
bowang/tensorflow | tensorflow/python/ops/bitwise_ops_test.py | 17 | 4180 | # 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 |
sjfloat/youtube-dl | youtube_dl/extractor/muenchentv.py | 160 | 2133 | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
js_to_json,
)
class MuenchenTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?muenchen\.tv/livestream'
IE_DESC = 'münchen.tv'
_TEST = {... | unlicense |
zaxliu/scipy | scipy/sparse/csgraph/_components.py | 125 | 2317 | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.sparse._sparsetools import cs_graph_components as _cs_graph_components
from scipy.sparse.csr import csr_matrix
from scipy.sparse.base import isspmatrix
_msg0 = 'x must be a symmetric square matrix!'
_msg1 = _msg0 + '(has ... | bsd-3-clause |
netscaler/horizon | horizon/middleware.py | 5 | 5866 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
f3at/feat | src/feat/models/value.py | 1 | 25453 | # F3AT - Flumotion Asynchronous Autonomous Agent Toolkit
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
# 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... | gpl-2.0 |
xsynergy510x/android_kernel_samsung_jf | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
Mazecreator/tensorflow | tensorflow/contrib/distributions/python/ops/bijectors/sigmoid_impl.py | 82 | 1573 | # 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 |
youssef-emad/shogun | examples/undocumented/python_modular/transfer_multitask_l12_logistic_regression.py | 17 | 1288 | #!/usr/bin/env python
from numpy import array,hstack
from numpy.random import seed, rand
from tools.load import LoadMatrix
lm=LoadMatrix()
traindat = lm.load_numbers('../data/fm_train_real.dat')
testdat = lm.load_numbers('../data/fm_test_real.dat')
label_traindat = lm.load_labels('../data/label_train_twoclass.dat')
p... | gpl-3.0 |
grupoprog3/proyecto_final | Entrega Final/flask/Lib/site-packages/coverage/phystokens.py | 40 | 9876 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Better tokenizing for coverage.py."""
import codecs
import keyword
import re
import sys
import token
import tokenize
from coverage import env
from coverage.bac... | apache-2.0 |
beiko-lab/gengis | bin/Lib/site-packages/numpy/ma/mrecords.py | 1 | 28557 | """:mod:`numpy.ma..mrecords`
Defines the equivalent of :class:`numpy.recarrays` for masked arrays,
where fields can be accessed as attributes.
Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes
and the masking of individual fields.
:author: Pierre Gerard-Marchant
"""
#!!!: * We sho... | gpl-3.0 |
the-adrian/demoFlask | venv/lib/python2.7/site-packages/pip/_vendor/colorama/ansi.py | 527 | 1039 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
def code_to_chars(code):
return CSI + str(code) + 'm'
class AnsiCodes(object):
def __... | gpl-3.0 |
hbrunn/OCB | addons/website_blog/tests/test_website_blog_flow.py | 269 | 2860 | # -*- coding: utf-8 -*-
from openerp.addons.website_blog.tests.common import TestWebsiteBlogCommon
class TestWebsiteBlogFlow(TestWebsiteBlogCommon):
def test_website_blog_followers(self):
""" Test the flow of followers and notifications for blogs. Intended
flow :
- people subscribe to ... | agpl-3.0 |
techstormteam/12-vision-connect-ios-linphone | submodules/externals/libxml2/doc/apibuild.py | 18 | 64917 | #!/usr/bin/python -u
#
# This is the API builder, it parses the C sources and build the
# API formal description in XML.
#
# See Copyright for the status of this software.
#
# daniel@veillard.com
#
import os, sys
import string
import glob
debug=0
#debugsym='ignorableWhitespaceSAXFunc'
debugsym=None
#
# C parser analy... | gpl-2.0 |
yaybu/touchdown | touchdown/tests/test_aws_s3_file.py | 1 | 3062 | # Copyright 2015 Isotoma Limited
#
# 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... | apache-2.0 |
PeterPetrik/QGIS | tests/src/python/test_qgssettingsentry.py | 12 | 16850 | # -*- coding: utf-8 -*-
"""
Test the QgsSettingsEntry classes
Run with: ctest -V -R PyQgsSettingsEntry
.. note:: 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
(... | gpl-2.0 |
mscuthbert/abjad | abjad/tools/sievetools/Sieve.py | 2 | 8252 | # -*- encoding: utf-8 -*-
import operator
from abjad.tools import mathtools
from abjad.tools.sievetools.BaseResidueClass import BaseResidueClass
class Sieve(BaseResidueClass):
r'''A Xenakis sieve.
'''
### CLASS VARIABLES ###
__slots__ = (
'_logical_operator',
'_rcs',
)
l... | gpl-3.0 |
Tempel/bcam | bcam/tool.py | 2 | 2105 | from __future__ import absolute_import, division, print_function
from bcam.generalized_setting import TOSetting
class ToolType(object):
cylinder = "cylinder"
cone = "cone"
ball = "ball"
class Tool(object):
def __init__(self, name=None, typ=None, diameter=3, step=0.1, feedrate=20, default_height=20, d... | gpl-3.0 |
hdinsight/hue | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/jobs/daily/cache_cleanup.py | 35 | 2068 | """
Daily cleanup job.
Can be run as a cronjob to clean out old data from the database (only expired
sessions at the moment).
"""
import six
from contextlib import contextmanager
from django_extensions.management.jobs import DailyJob
class Job(DailyJob):
help = "Cache (db) cleanup Job"
def execute(self):
... | apache-2.0 |
goodwinnk/intellij-community | plugins/hg4idea/testData/bin/mercurial/win32.py | 93 | 13963 | # win32.py - utility functions that use win32 API
#
# Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import ctypes, errno, os, subprocess, random
_kernel32 = ctypes.w... | apache-2.0 |
schleichdi2/OPENNFR-6.1-CORE | opennfr-openembedded-core/meta/lib/oeqa/utils/qemurunner.py | 1 | 24225 | # Copyright (C) 2013 Intel Corporation
#
# Released under the MIT license (see COPYING.MIT)
# This module provides a class for starting qemu images using runqemu.
# It's used by testimage.bbclass.
import subprocess
import os
import sys
import time
import signal
import re
import socket
import select
import errno
impor... | gpl-2.0 |
chasetb/sal | server/migrations/0010_auto_20150811_2209.py | 3 | 1946 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('server', '0009_auto_20150811_1734'),
]
operations = [
migrations.CreateModel(
name='OSQueryColumn',
... | apache-2.0 |
impmihai/coala | tests/results/AbsolutePositionTest.py | 35 | 2511 | import unittest
from coalib.results.AbsolutePosition import AbsolutePosition, calc_line_col
from coalib.misc.Constants import COMPLEX_TEST_STRING
class AbsolutePositionTest(unittest.TestCase):
def test_calc_line_col_newlines(self):
# no newlines
text = ("find position of 'z'",)
z_pos = t... | agpl-3.0 |
tinkerinestudio/Tinkerine-Suite | TinkerineSuite/python/Lib/multiprocessing/process.py | 45 | 9361 | #
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#... | agpl-3.0 |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/django/contrib/gis/sitemaps/views.py | 82 | 2239 | from __future__ import unicode_literals
from django.apps import apps
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.shortcuts import render_to_kml, render_to_kmz
from django.core.exceptions import FieldDoesNotExist
from django.db import DEFAULT_DB_ALIAS, connections
from django.h... | bsd-3-clause |
Orpheus11/nile | nile/common/lockutils.py | 1 | 3733 | import threading
import weakref
import contextlib
import logging
import fasteners
import os
LOG = logging.getLogger(__name__)
class Semaphores(object):
def __init__(self):
self._semaphores = weakref.WeakValueDictionary()
self._lock = threading.Lock()
def get(self, name):
with self._loc... | apache-2.0 |
Fokko/incubator-airflow | tests/test_utils/mock_operators.py | 1 | 1355 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
noxora/flask-base | flask/lib/python3.4/site-packages/alembic/testing/warnings.py | 14 | 1380 | # testing/warnings.py
# Copyright (C) 2005-2017 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
"""NOTE: copied/adapted from SQLAlchemy master for backwards compatibility;
t... | mit |
krishna11888/ai | third_party/gensim/gensim/models/__init__.py | 49 | 1920 | """
This package contains algorithms for extracting document representations from their raw
bag-of-word counts.
"""
# bring model classes directly into package namespace, to save some typing
from .hdpmodel import HdpModel
from .ldamodel import LdaModel
from .lsimodel import LsiModel
from .tfidfmodel import TfidfModel
... | gpl-2.0 |
FedoraScientific/salome-paravis | test/VisuPrs/ImportMedField/B3.py | 1 | 1389 | # Copyright (C) 2010-2014 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library ... | lgpl-2.1 |
xforce/jc3-handling-editor | tools/gyp/test/ios/gyptest-per-config-settings.py | 11 | 7054 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that device and simulator bundles are built correctly.
"""
import plistlib
import TestGyp
import os
import struct
import subpr... | mit |
ojii/django-filer | filer/admin/fileadmin.py | 3 | 4673 | from django.core.urlresolvers import reverse
from django.contrib.admin.util import unquote
from django.utils.translation import ugettext as _
from django.http import HttpResponseRedirect
from django import forms
from filer.admin.permissions import PrimitivePermissionAwareModelAdmin
from filer.models import File
# for... | mit |
elkingtonmcb/cloudbiolinux | cloudbio/custom/phylogeny.py | 10 | 2360 | """Install instructions for non-packaged phyologeny programs.
"""
import os
from fabric.api import *
from fabric.contrib.files import *
from cloudbio.custom.shared import _if_not_installed, _make_tmp_dir
def install_tracer(env):
"""A program for analysing results from Bayesian MCMC programs such as BEAST & MrBay... | mit |
Greymerk/python-rpg | src/world/terrain/chunkmanager.py | 1 | 1344 | from random import choice
from mapcache import MapCache
from chunk import Chunk
class ChunkManager:
def __init__(self, world):
self.world = world
self.chunkCache = []
self.mapCache = MapCache(self, self.world.seed)
self.maxCacheSize = 64
def getChunk(self, x, y):
chunkX = int(x) >> 4
chunkY = int(y) ... | gpl-3.0 |
mmbtba/odoo | addons/mrp/wizard/mrp_product_produce.py | 168 | 6150 | # -*- 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 |
bbockelm/htcondor | src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/user.py | 10 | 12943 | '''Users and groups.
'''
from utils import *
from enums import *
class IUser(Cached):
'''Represents a Skype user.
'''
def __repr__(self):
return '<%s with Handle=%s>' % (Cached.__repr__(self)[1:-1], repr(self.Handle))
def _Init(self, Handle, Skype):
self._Skype = Skype
self.... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.