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
factorlibre/OCB
addons/crm_partner_assign/crm_partner_assign.py
174
11357
# -*- 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
RandyLowery/erpnext
erpnext/stock/stock_ledger.py
1
17296
# 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, erpnext from frappe import _ from frappe.utils import cint, flt, cstr, now from erpnext.stock.utils import get_valuation_method import js...
gpl-3.0
AMOboxTV/AMOBox.LegoBuild
plugin.video.specto/resources/lib/resolvers/googlepicasa.py
23
2529
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
gpl-2.0
anhhoangiot/people_recognition_pi
fscognitive/commons/process_parallel.py
1
1048
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2016-10-08 # @Author : Anh Hoang (anhhoang.work.mail@gmail.com) # @Project : FSCognitive # @Version : 1.0 from multiprocessing import Process class ProcessParallel(object): """ To Process the functions parallely """ def __init__(self, *job...
mit
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/numpy/ctypeslib.py
34
14636
""" ============================ ``ctypes`` Utility Functions ============================ See Also --------- load_library : Load a C library. ndpointer : Array restype/argtype with verification. as_ctypes : Create a ctypes array from an ndarray. as_array : Create an ndarray from a ctypes array. References ----------...
mit
wnoc-drexel/gem5-stable
src/arch/alpha/AlphaISA.py
61
2377
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
enthought/python-analytics
python_analytics/tests/test_tracker.py
1
3916
from __future__ import absolute_import, unicode_literals import unittest import uuid from mock import patch import requests import responses import six from six import PY2, binary_type from six.moves.urllib import parse from ..events import Event from ..tracker import _AnalyticsHandler, Tracker from ..utils import ...
bsd-3-clause
iagapov/ocelot
demos/optics/ex7.py
2
1987
''' example07 -- crystal -- dynamical diffraction (ocelot.optics.bragg) ''' from ocelot.optics.utils import * def save_filter(filt, f_name): f= open(f_name,'w') for i in xrange( len(filt.ev)): f.write(str(filt.ev[i]) + '\t' + str(np.abs(filt.tr[i])**2) + '\t' + str(np.abs(filt.ref[i])**2) + '\n') E_...
gpl-3.0
warner/python-spake2
src/spake2/ed25519_basic.py
1
12317
import binascii, hashlib, itertools from .groups import expand_arbitrary_element_seed Q = 2**255 - 19 L = 2**252 + 27742317777372353535851937790883648493 def inv(x): return pow(x, Q-2, Q) d = -121665 * inv(121666) I = pow(2,(Q-1)//4,Q) def xrecover(y): xx = (y*y-1) * inv(d*y*y+1) x = pow(xx,(Q+3)//8,Q) ...
mit
M0ses/ansible
v2/ansible/plugins/action/synchronize.py
3
6877
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012-2013, Timothy Appnel <tim@appnel.com> # # 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
mitar/django
tests/modeltests/select_for_update/tests.py
7
10812
from __future__ import absolute_import import sys import time from django.conf import settings from django.db import transaction, connection from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError from django.test import (TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature) from djang...
bsd-3-clause
dakerfp/AutobahnPython
examples/twisted/wamp/basic/server.py
10
4373
############################################################################### ## ## Copyright (C) 2011-2014 Tavendo GmbH ## ## 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 ## ## h...
apache-2.0
mitsei/dlkit
dlkit/abstract_osid/commenting/queries.py
1
19767
"""Implementations of commenting abstract base class queries.""" # pylint: disable=invalid-name # Method names comply with OSID specification. # pylint: disable=no-init # Abstract classes do not define __init__. # pylint: disable=too-few-public-methods # Some interfaces are specified as 'markers' and includ...
mit
RadioFreeAsia/RDacity
lib-src/lv2/sratom/waflib/Context.py
177
8376
#! /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,imp,sys from waflib import Utils,Errors,Logs import waflib.Node HEXVERSION=0x1071000 WAFVERSION="1.7.16" WAFREVISION="73c1705078f8c9c51a33e20f221a309d5a94b5e1" ABI=9...
gpl-2.0
softak/webfaction_demo
apps/profiles/resources.py
1
1364
from django.contrib.auth.models import User from django.core.urlresolvers import reverse from tastypie import fields, http from tastypie.authorization import Authorization from friends.models import Friendship from utils.tastypie_ import ModelResource class UserResource(ModelResource): name = fields.CharField(...
bsd-3-clause
402231466/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/_weakrefset.py
766
5570
# Access WeakSet through the weakref module. # This code is separated-out because it is needed # by abc.py to load everything else at startup. from _weakref import ref __all__ = ['WeakSet'] class _IterationGuard: # This context manager registers itself in the current iterators of the # weak container, such ...
gpl-3.0
UniversalMasterEgg8679/ansible
lib/ansible/utils/helpers.py
34
1270
# (c) 2016, Ansible by Red Hat <info@ansible.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 later v...
gpl-3.0
garbled1/ansible
contrib/inventory/nagios_ndo.py
74
3843
#!/usr/bin/env python # (c) 2014, Jonathan Lestrelin <jonathan.lestrelin@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 Licens...
gpl-3.0
hkawasaki/kawasaki-aio8-2
common/djangoapps/util/tests/test_memcache.py
101
3655
""" Tests for memcache in util app """ from django.test import TestCase from django.core.cache import get_cache from util.memcache import safe_key class MemcacheTest(TestCase): """ Test memcache key cleanup """ # Test whitespace, control characters, and some non-ASCII UTF-16 UNICODE_CHAR_CODES =...
agpl-3.0
dpiers/coderang-meteor
public/jsrepl/extern/python/reloop-closured/lib/python2.7/logging/config.py
76
34326
# Copyright 2001-2010 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
mit
RobertoMalatesta/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/handlers/updatebase.py
143
1902
# Copyright (C) 2010 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...
bsd-3-clause
nachandr/cfme_tests
cfme/tests/services/test_pxe_service_catalogs.py
2
5962
import fauxfactory import pytest from widgetastic.utils import partial_match from cfme import test_requirements from cfme.infrastructure.provider import InfraProvider from cfme.infrastructure.provider.rhevm import RHEVMProvider from cfme.infrastructure.pxe import get_pxe_server_from_config from cfme.infrastructure.pxe...
gpl-2.0
moijes12/oh-mainline
vendor/packages/requests/requests/packages/chardet/constants.py
3008
1335
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
agpl-3.0
MarkWh1te/xueqiu_predict
p3_env/lib/python3.5/site-packages/sqlalchemy/engine/util.py
55
2338
# engine/util.py # Copyright (C) 2005-2016 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 from .. import util def connection_memoize(key): """Decorator, memoize a functi...
mit
FCP-INDI/nipype
nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberprocess.py
12
1767
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ......testing import assert_equal from ..fiberprocess import fiberprocess def test_fiberprocess_inputs(): input_map = dict(args=dict(argstr='%s', ), displacement_field=dict(argstr='--displacement_field %s', ), environ=dict(nohash=True, ...
bsd-3-clause
Yajo/website
website_logo/models/website.py
16
1221
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Agile Business Group sagl (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licen...
agpl-3.0
zx8/youtube-dl
youtube_dl/extractor/lifenews.py
6
6729
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( determine_ext, int_or_none, unified_strdate, ExtractorError, ) class LifeNewsIE(InfoExtractor): IE_NAME = 'lifenews' IE_DESC = 'LIF...
unlicense
jessefeinman/FintechHackathon
venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/dom.py
505
1421
from __future__ import absolute_import, division, unicode_literals from xml.dom import Node from . import _base class TreeWalker(_base.NonRecursiveTreeWalker): def getNodeDetails(self, node): if node.nodeType == Node.DOCUMENT_TYPE_NODE: return _base.DOCTYPE, node.name, node.publicId, node.sy...
bsd-2-clause
fusionpig/ansible
lib/ansible/plugins/connections/libvirt_lxc.py
140
5234
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com> # (c) 2013, Michael Scherer <misc@zarb.org> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU Gene...
gpl-3.0
llautert/psychoPYTHON
models.py
1
9417
from time import time from sklearn import * import matplotlib as mpl mpl.use('Agg') from utils import plot_learning_curve from keras.losses import * from keras.models import Sequential from keras.layers import * from keras.optimizers import SGD from keras.utils.np_utils import to_categorical from multiproce...
mit
zstackio/zstack-woodpecker
integrationtest/vm/simulator/iam2/test_iam2_no_delete_admin_query.py
1
15753
''' cover ZSTAC-22633 1.create nodelete vid 2.create,query,delete test @author: zhaohao.chen ''' import os import zstackwoodpecker.test_util as test_util import apibinding.inventory as inventory import zstackwoodpecker.operations.account_operations as acc_ops import zstackwoodpecker.operations.iam2_operations as iam2_o...
apache-2.0
fedosov/django-generic-ratings
ratings/forms/__init__.py
3
13110
from __future__ import absolute_import import time from django import forms from django.contrib.contenttypes.models import ContentType from django.utils.crypto import salted_hmac, constant_time_compare from ratings import cookies, exceptions from .widgets import SliderWidget, StarWidget, BootstrapWidget class Vot...
mit
cancan101/tensorflow
tensorflow/tensorboard/tensorboard.py
6
6737
# 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
takeflight/django
tests/migrations/models.py
35
1316
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps.registry import Apps from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class CustomModelBase(models.base.ModelBase): pass class ModelWithCustomBase(six.with_met...
bsd-3-clause
morrisonwudi/zipline
tests/test_versioning.py
30
3539
# # Copyright 2015 Quantopian, 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 agreed to in wr...
apache-2.0
cristiana214/cristianachavez214-cristianachavez
python-build/python-libs/gdata/src/gdata/apps/migration/__init__.py
168
8177
#!/usr/bin/python # # Copyright (C) 2008 Google # # 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 ag...
apache-2.0
bm5w/pychal
6.py
1
1025
"""Python challenge number 6: http://www.pythonchallenge.com/pc/def/channel.html""" import os # from os.path import normpath, join curr_dir = os.path.abspath('channel') # equivalent to above # curr_dir = normpath(join(os.getcwd(), 'channel')) import zipfile query = u'Next nothing is ' def main(num=90052): output ...
mit
patricklaw/pip
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 __...
mit
linzhonghong/dnspod_desktop
dnspod_api.py
1
6268
#-*- coding:utf-8 -*- __author__ = 'linzhonghong' import sys reload(sys) sys.setdefaultencoding('utf8') import json import urllib2,cookielib,urllib import re import traceback import time class dnspod_api(object): def __init__(self,user="",passwd="",domain="yourdomain.com"): self.cookies = ...
gpl-2.0
facelessuser/ThemeScheduler
tests/validate_json_format.py
1
6115
""" Validate JSON format. Licensed under MIT Copyright (c) 2012-2015 Isaac Muse <isaacmuse@gmail.com> """ import re import codecs import json RE_LINE_PRESERVE = re.compile(r"\r?\n", re.MULTILINE) RE_COMMENT = re.compile( r'''(?x) (?P<comments> /\*[^*]*\*+(?:[^/*][^*]*\*+)*/ # multi-line comme...
mit
SpootDev/py-mysql2pgsql
mysql2pgsql/lib/mysql_reader.py
9
9445
from __future__ import with_statement, absolute_import import re from contextlib import closing import MySQLdb import MySQLdb.cursors re_column_length = re.compile(r'\((\d+)\)') re_column_precision = re.compile(r'\((\d+),(\d+)\)') re_key_1 = re.compile(r'CONSTRAINT `(\w+)` FOREIGN KEY \(`(\w+)`\) REFERENCES `(\w+)`...
mit
rpdillon/wikid
wikid/docutils/parsers/__init__.py
70
1457
# $Id: __init__.py 5618 2008-07-28 08:37:32Z strank $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ This package contains Docutils parser modules. """ __docformat__ = 'reStructuredText' from docutils import Component class Parser(Component): co...
gpl-3.0
Zelgadis87/Sick-Beard
lib/hachoir_parser/video/flv.py
90
4787
""" FLV video parser. Documentation: - FLV File format: http://osflash.org/flv - libavformat from ffmpeg project - flashticle: Python project to read Flash (SWF and FLV with AMF metadata) http://undefined.org/python/#flashticle Author: Victor Stinner Creation date: 4 november 2006 """ from lib.hachoir_parser ...
gpl-3.0
puttarajubr/commcare-hq
custom/bihar/__init__.py
1
1119
from custom.bihar.reports import supervisor, due_list, mch_reports from custom.bihar.reports.indicators import reports as indicators BIHAR_DOMAINS = ('care-bihar', 'bihar') CUSTOM_REPORTS = ( ('Custom Reports', ( supervisor.MainNavReport, due_list.DueListSelectionReport, due_list.DueListNa...
bsd-3-clause
msebire/intellij-community
python/lib/Lib/distutils/bcppcompiler.py
85
15086
"""distutils.bcppcompiler Contains BorlandCCompiler, an implementation of the abstract CCompiler class for the Borland C++ compiler. """ # This implementation by Lyle Johnson, based on the original msvccompiler.py # module and using the directions originally published by Gordon Williams. # XXX looks like there's a L...
apache-2.0
jianajavier/pnc-cli
test/integration/test_productversions_api.py
1
2388
import pytest import conftest from pnc_cli import utils from pnc_cli import productversions from pnc_cli.swagger_client.apis import ProductversionsApi from test import testutils @pytest.fixture(scope='function', autouse=True) def get_versions_api(): global versions_api versions_api = ProductversionsApi(utils...
apache-2.0
MatthieuBizien/scikit-learn
benchmarks/bench_lasso.py
111
3364
""" Benchmarks of Lasso vs LassoLars First, we fix a training set and increase the number of samples. Then we plot the computation time as function of the number of samples. In the second benchmark, we increase the number of dimensions of the training set. Then we plot the computation time as function of the number o...
bsd-3-clause
krattai/noo-ebs
docs/zeroMQ-guide2/examples/Python/bstarsrv.py
1
4193
# Binary Star Server # # Author: Dan Colish <dcolish@gmail.com> from argparse import ArgumentParser import time from zhelpers import zmq STATE_PRIMARY = 1 STATE_BACKUP = 2 STATE_ACTIVE = 3 STATE_PASSIVE = 4 PEER_PRIMARY = 1 PEER_BACKUP = 2 PEER_ACTIVE = 3 PEER_PASSIVE = 4 CLIENT_REQUEST = 5 HEARTBEAT = 1000 clas...
bsd-2-clause
virgree/odoo
addons/base_gengo/__init__.py
377
1122
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Openerp sa (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
grnet/synnefo
snf-admin-app/synnefo_admin/admin/resources/networks/filters.py
2
2559
# Copyright (C) 2010-2014 GRNET S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed i...
gpl-3.0
cesarmarinhorj/ansible
test/units/template/test_templar.py
23
4193
# (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
chromium2014/src
chrome/common/extensions/docs/server2/timer.py
122
1702
# 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 time class Timer(object): '''A simple timer which starts when constructed and stops when Stop is called. ''' def __init__(self): self._st...
bsd-3-clause
yunqing/AR
preprocess.py
1
9393
import nltk from nltk.tokenize import word_tokenize from nltk.corpus import stopwords import re from nltk.stem.lancaster import LancasterStemmer from gensim import corpora, models, similarities import logging # data articles = [line.strip() for line in file('raw-data.txt')] articles_title = [article.split('"')[1] for ...
mit
sridevikoushik31/openstack
nova/api/openstack/compute/contrib/flavor_disabled.py
39
3161
# Copyright 2012 Nebula, 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 agreed to...
apache-2.0
GheRivero/ansible
lib/ansible/modules/network/aci/aci_aep_to_domain.py
26
8771
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Dag Wieers <dag@wieers.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1'...
gpl-3.0
ghdk/networkx
networkx/algorithms/cycles.py
30
16789
""" ======================== Cycle finding algorithms ======================== """ # Copyright (C) 2010-2012 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. from collections import defaultdict import networ...
bsd-3-clause
Vixionar/django
django/core/management/commands/createcachetable.py
342
4389
from django.conf import settings from django.core.cache import caches from django.core.cache.backends.db import BaseDatabaseCache from django.core.management.base import BaseCommand, CommandError from django.db import ( DEFAULT_DB_ALIAS, connections, models, router, transaction, ) from django.db.utils import Databa...
bsd-3-clause
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks
Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py2/libpasteurize/fixes/fix_raise.py
71
1099
u"""Fixer for 'raise E(V).with_traceback(T)' -> 'raise E, V, T'""" from lib2to3 import fixer_base from lib2to3.fixer_util import Comma, Node, Leaf, token, syms class FixRaise(fixer_base.BaseFix): PATTERN = u""" raise_stmt< 'raise' (power< name=any [trailer< '(' val=any* ')' >] [trailer< '.' 'with_tra...
isc
Zac-HD/home-assistant
homeassistant/components/switch/acer_projector.py
18
5066
""" Use serial protocol of Acer projector to obtain state of the projector. For more details about this component, please refer to the documentation at https://home-assistant.io/components/switch.acer_projector/ """ import logging import re import voluptuous as vol from homeassistant.components.switch import (Switch...
apache-2.0
Pal3love/otRebuilder
Package/otRebuilder/Dep/fontTools/ttLib/tables/otConverters.py
1
54321
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.misc.fixedTools import ( fixedToFloat as fi2fl, floatToFixed as fl2fi, ensureVersionIsLong as fi2ve, versionToFixed as ve2fi) from fontTools.misc.textTools import pad, safeEval from fontTools.ttLib import...
mit
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/keyword_plan_ad_group_keyword_service/transports/base.py
1
4439
# -*- 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
kawamon/hue
desktop/core/ext-py/pyu2f-0.1.4/pyu2f/tests/model_test.py
7
1918
# Copyright 2016 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 ag...
apache-2.0
thomasvs/morituri
morituri/result/logger.py
2
5017
# -*- Mode: Python; test-case-name: morituri.test.test_result_logger -*- # vi:si:et:sw=4:sts=4:ts=4 # Morituri - for those about to RIP # Copyright (C) 2009 Thomas Vander Stichele # This file is part of morituri. # # morituri is free software: you can redistribute it and/or modify # it under the terms of the GNU Gen...
gpl-3.0
mattuuh7/incubator-airflow
airflow/contrib/hooks/vertica_hook.py
60
1381
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
iniqua/plecost
plecost_lib/api.py
1
3488
#!/usr/bin/python # -*- coding: utf-8 -*- # # Plecost: Wordpress vulnerabilities finder # # @url: http://iniqua.com/labs/ # @url: https://github.com/iniqua/plecost # # @author:Francisco J. Gomez aka ffranz (http://iniqua.com/) # @author:Daniel Garcia aka cr0hn (http://www.cr0hn.com/me/) # # Copyright (c) 2015, Iniqua T...
bsd-3-clause
avalonfr/avalon_core_v1
dep/libmpq/bindings/python/mpq.py
17
10752
"""wrapper for libmpq""" # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the ...
gpl-2.0
ovnicraft/odoo
addons/lunch/__init__.py
440
1031
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
devs4v/devs4v-information-retrieval15
project/venv/lib/python2.7/site-packages/django/contrib/sessions/backends/db.py
37
2943
import logging from django.contrib.sessions.backends.base import CreateError, SessionBase from django.core.exceptions import SuspiciousOperation from django.db import IntegrityError, router, transaction from django.utils import timezone from django.utils.encoding import force_text class SessionStore(SessionBase): ...
mit
DevTable/gantryd
gantryd/client.py
2
7460
from runtime.manager import RuntimeManager from config.GantryConfig import Configuration from config.object import ConfigParseException from gantryd.componentwatcher import ComponentWatcher from gantryd.machinestate import MachineState from gantryd.componentstate import ComponentState, STOPPED_STATUS, KILLED_STATUS fr...
apache-2.0
akshatharaj/django
tests/generic_views/test_edit.py
199
19217
from __future__ import unicode_literals import warnings from django import forms from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.test import ( SimpleTestCase, TestCase, ignore_warnings, override_settings, ) from django.test.client import RequestFact...
bsd-3-clause
mrichards42/xword
scripts/xworddebug/wxFB.py
1
1821
# -*- coding: utf-8 -*- ########################################################################### ## Python code generated with wxFormBuilder (version Oct 10 2016) ## http://www.wxformbuilder.org/ ## ## PLEASE DO "NOT" EDIT THIS FILE! ##########################################################################...
gpl-3.0
KhronosGroup/COLLADA-CTS
StandardDataSets/1_5/collada/library_visual_scenes/visual_scene/asset/modified/modified/modified.py
2
5469
# Copyright (c) 2012 The Khronos Group Inc. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ...
mit
egaxegax/django-dbcartajs
django/core/paginator.py
103
5245
from math import ceil from django.utils import six class InvalidPage(Exception): pass class PageNotAnInteger(InvalidPage): pass class EmptyPage(InvalidPage): pass class Paginator(object): def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True): self.object_list = ...
gpl-2.0
cdjones32/vertx-web
src/test/sockjs-protocol/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py
1093
8936
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_ide...
apache-2.0
marcsans/cnn-physics-perception
phy/lib/python2.7/site-packages/matplotlib/tests/test_dviread.py
7
1814
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six from nose.tools import assert_equal import matplotlib.dviread as dr import os.path original_find_tex_file = dr.find_tex_file def setup(): dr.find_tex_file = lambda x:...
mit
vvuk/servo
tests/wpt/css-tests/tools/html5lib/html5lib/html5parser.py
423
117297
from __future__ import absolute_import, division, unicode_literals from six import with_metaclass import types from . import inputstream from . import tokenizer from . import treebuilders from .treebuilders._base import Marker from . import utils from . import constants from .constants import spaceCharacters, ascii...
mpl-2.0
skbly7/serc
website/wiki/plugins/attachments/wiki_plugin.py
14
1547
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import from django.conf.urls import url, include from django.utils.translation import ugettext as _ from wiki.core.plugins import registry from wiki.core.plugins.base import BasePlugin from wiki.plugins.attachments import v...
mit
NooNameR/bravo_kernel_3.0
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
Imlunar/DJStew
cogs/downloader.py
17
26747
from discord.ext import commands from cogs.utils.dataIO import dataIO from cogs.utils import checks from cogs.utils.chat_formatting import pagify, box from __main__ import send_cmd_help, set_cog import os from subprocess import run as sp_run, PIPE import shutil from asyncio import as_completed from setuptools import di...
gpl-3.0
hydai/sligen
src/wordgen/wordgen.py
6
1075
import random, itertools class Wordgen(object): def __init__(self): self.verb = [] self.final_noun = [] self.other = [] f = open('data/newbuzzword.txt', 'r', encoding='utf-8') for line in f: dat = line.split('\t') word = dat[0] ...
mit
krummler/zxing-ios
cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/Perforce.py
34
3814
"""SCons.Tool.Perforce.py Tool-specific initialization for Perforce Source Code Management system. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 20...
apache-2.0
gangadharkadam/v5_erp
erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.py
3
2654
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt def execute(filters=None): if not filters: filters = {} elif filters.get("from_d...
agpl-3.0
nharraud/b2share
invenio/legacy/websubmit/admincli.py
13
21347
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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...
gpl-2.0
lucasrangit/twitter-winner
twitter-winner/httplib2/test/miniserver.py
303
3327
import logging import os import select import SimpleHTTPServer import SocketServer import threading HERE = os.path.dirname(__file__) logger = logging.getLogger(__name__) class ThisDirHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def translate_path(self, path): path = path.split('?', 1)[0].split('#'...
mit
kennedyshead/home-assistant
homeassistant/components/syslog/notify.py
14
2401
"""Syslog notification service.""" import syslog import voluptuous as vol from homeassistant.components.notify import ( ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService, ) CONF_FACILITY = "facility" CONF_OPTION = "option" CONF_PRIORITY = "priority" SYSLOG_FACILITY = { "ke...
apache-2.0
matrix-org/synapse
synapse/types.py
1
24839
# Copyright 2014-2016 OpenMarket Ltd # Copyright 2019 The Matrix.org Foundation C.I.C. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
apache-2.0
alkemics/luigi
luigi/contrib/gcs.py
5
14722
# -*- coding: utf-8 -*- # # Copyright 2015 Twitter 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 ...
apache-2.0
DiamondLightSource/auto_tomo_calibration-experimental
old_code_scripts/lmfit-py/doc/sphinx/numpydoc/comment_eater.py
83
5181
from cStringIO import StringIO import compiler import inspect import textwrap import tokenize from compiler_unparse import unparse class Comment(object): """ A comment block. """ is_comment = True def __init__(self, start_lineno, end_lineno, text): # int : The first line number in the block. ...
apache-2.0
crocodoc/graphite
carbon/lib/carbon/util.py
6
4715
import sys import os import pwd from os.path import abspath, basename, dirname, join try: from cStringIO import StringIO except ImportError: from StringIO import StringIO try: import cPickle as pickle USING_CPICKLE = True except: import pickle USING_CPICKLE = False from twisted.python.util import initgrou...
apache-2.0
Jaccorot/django-cms
cms/south_migrations/0051_auto__add_placeholderreference.py
63
17030
# -*- 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 'PlaceholderReference' db.create_table(u'cmsplugin_placeholderreference', ( (u'cm...
bsd-3-clause
aminghadersohi/airflow
tests/dags/test_default_impersonation.py
45
1214
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
INNUENDOWEB/INNUca
src/SPAdes-3.11.0-Linux/share/spades/spades_pipeline/truspades/generate_quality.py
12
1843
############################################################################ # Copyright (c) 2015 Saint Petersburg State University # All Rights Reserved # See file LICENSE for details. ############################################################################ import re import sys import itertools import sam_parser ...
gpl-3.0
tst-ahernandez/earthenterprise
earth_enterprise/src/server/wsgi/search/plugin/federated_search_handler.py
4
5020
#!/usr/bin/python # # Copyright 2017 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...
apache-2.0
clobrano/personfinder
app/unidecode/x076.py
252
4639
data = ( 'Yu ', # 0x00 'Cui ', # 0x01 'Ya ', # 0x02 'Zhu ', # 0x03 'Cu ', # 0x04 'Dan ', # 0x05 'Shen ', # 0x06 'Zhung ', # 0x07 'Ji ', # 0x08 'Yu ', # 0x09 'Hou ', # 0x0a 'Feng ', # 0x0b 'La ', # 0x0c 'Yang ', # 0x0d 'Shen ', # 0x0e 'Tu ', # 0x0f 'Yu ', # 0x10 'Gua ',...
apache-2.0
kapilrastogi/Impala
thirdparty/hive-1.1.0-cdh5.8.0-SNAPSHOT/lib/py/fb303/FacebookService.py
54
57351
# # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # from thrift.Thrift import * from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol try: from thrift.protocol import fastbinary exce...
apache-2.0
sun1991/lvsys
lvsys/env_lvsys/Lib/site-packages/jinja2/sandbox.py
324
13327
# -*- coding: utf-8 -*- """ jinja2.sandbox ~~~~~~~~~~~~~~ Adds a sandbox layer to Jinja as it was the default behavior in the old Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the default behavior is easier to use. The behavior can be changed by subclassing the environm...
mit
Juraci/tempest
tempest/common/compute.py
8
5021
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # 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/LICENS...
apache-2.0
Alwnikrotikz/stoqs
loaders/MarMenor/loadMarMenor_nov2011.py
5
1210
#!/usr/bin/env python __author__ = 'Mike McCann' __copyright__ = '2011' __license__ = 'GPL v3' __contact__ = 'mccann at mbari.org' __doc__ = ''' Master loader for all CANON activities Mike McCann MBARI 22 April 2012 @var __date__: Date of last svn commit @undocumented: __doc__ parser @status: production @lic...
gpl-3.0
rue89-tech/edx-platform
common/djangoapps/course_about/views.py
28
2124
""" Implementation of the RESTful endpoints for the Course About API. """ from rest_framework.throttling import UserRateThrottle from rest_framework.views import APIView from course_about import api from rest_framework import status from rest_framework.response import Response from course_about.errors import CourseNot...
agpl-3.0
sedden/django-basic-apps
basic/groups/views/topics.py
10
3555
from django.shortcuts import get_object_or_404 from basic.groups.decorators import * from basic.groups.models import * from basic.groups.forms import * from basic.tools.shortcuts import render, redirect def topic_list(request, slug, template_name='groups/topics/topic_list.html'): """ Returns a group topic li...
bsd-3-clause