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
yigitguler/django
django/contrib/admin/utils.py
26
16393
from __future__ import unicode_literals from collections import defaultdict import datetime import decimal from django.contrib.auth import get_permission_codename from django.db import models from django.db.models.constants import LOOKUP_SEP from django.db.models.deletion import Collector from django.forms.forms impo...
bsd-3-clause
cxxgtxy/tensorflow
tensorflow/contrib/keras/api/keras/__init__.py
132
1935
# 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
srikanthk16/android_hammerhead_msm
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
cechrist/cardoon
cardoon/devices/autoThermal.py
1
6405
""" Generates an electrothermal device from a nonlinear device class One assumption is that the base class defines numTerms directly in the class definition and it is not changed in process_params(). ------------------------------------------------------------------- Copyright Carlos Christoffersen <c.christoffersen@...
gpl-3.0
Kussie/HTPC-Manager
libs/cherrypy/wsgiserver/ssl_builtin.py
56
3242
"""A library for integrating Python's builtin ``ssl`` library with CherryPy. The ssl module must be importable for SSL functionality. To use this module, set ``CherryPyWSGIServer.ssl_adapter`` to an instance of ``BuiltinSSLAdapter``. """ try: import ssl except ImportError: ssl = None try: from _pyio imp...
mit
lucernae/inasafe
safe/utilities/pivot_table.py
6
11615
# coding=utf-8 """InaSAFE Disaster risk assessment tool developed by AusAid Contact : ole.moller.nielsen@gmail.com .. 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...
gpl-3.0
timothycrosley/frosted
frosted/main.py
4
2347
#!/usr/bin/env python """ Implementation of the command-line frosted tool. """ from __future__ import absolute_import, division, print_function, unicode_literals import argparse import sys from pies.overrides import * from frosted import __version__ from frosted.api import check, check_path, check_recursive def m...
mit
t3hi3x/p-k.co
chartit/charts.py
6
26815
import copy from collections import defaultdict from itertools import groupby, izip # use SortedDict instead of native OrderedDict for Python 2.6 compatibility from django.utils.datastructures import SortedDict from highcharts import HCOptions from validation import clean_pcso, clean_cso, clean_x_sortf_mapf_mts...
mit
gacarrillor/QGIS
tests/src/python/test_qgsstylemodel.py
26
160093
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsStyleModel. .. 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 (at your option) any later version. """ __a...
gpl-2.0
ashray/VTK-EVM
ThirdParty/Twisted/twisted/names/test/test_dns.py
22
152665
# test-case-name: twisted.names.test.test_dns # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for twisted.names.dns. """ from __future__ import division, absolute_import from io import BytesIO import struct from zope.interface.verify import verifyClass from twisted.python.failure...
bsd-3-clause
atsolakid/edx-platform
lms/djangoapps/mobile_api/test_milestones.py
30
5648
""" Milestone related tests for the mobile_api """ from mock import patch from courseware.tests.helpers import get_request_for_user from courseware.tests.test_entrance_exam import answer_entrance_exam_problem, add_entrance_exam_milestone from util.milestones_helpers import ( add_prerequisite_course, fulfill_co...
agpl-3.0
pylonsoflight/kea
interfaces/rectangular/rectangular.py
1
30689
# rectangular # Created by Rains Jordan # Last updated 12/4/14 # # Non-standard shortcuts: # Ctrl+Home, Ctrl+End: Move to start/end of playlist column view, if the window size is # too small. # # Notes: # This is a simple demonstration of a sample kea interface, using a standard windowed interface # with a track ...
gpl-3.0
brianlsharp/MissionPlanner
Lib/lib2to3/fixes/fix_filter.py
61
2183
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes filter(F, X) into list(filter(F, X)). We avoid the transformation if the filter() call is directly contained in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:. N...
gpl-3.0
aabbox/kbengine
kbe/res/scripts/common/Lib/test/test_multiprocessing_main_handling.py
68
11424
# tests __main__ module handling in multiprocessing from test import support # Skip tests if _thread or _multiprocessing wasn't built. support.import_module('_thread') support.import_module('_multiprocessing') import importlib import importlib.machinery import zipimport import unittest import sys import os import os.p...
lgpl-3.0
peerster/CouchPotatoServer
libs/suds/client.py
150
25971
# 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 ...
gpl-3.0
technologiescollege/s2a_fr
Snap!Files/Snap!Mobile/arduino/serial/win32.py
155
10120
from ctypes import * from ctypes.wintypes import HANDLE from ctypes.wintypes import BOOL from ctypes.wintypes import LPCWSTR _stdcall_libraries = {} _stdcall_libraries['kernel32'] = WinDLL('kernel32') from ctypes.wintypes import DWORD from ctypes.wintypes import WORD from ctypes.wintypes import BYTE INVALID_HANDLE_VAL...
gpl-3.0
s40523216/2016fallcp_hw
publishconf.py
251
1705
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * # 因為 publishconf.py 在 pelicanconf.py 之後, 因此若兩處有相同變數的設定, ...
agpl-3.0
yangleo/cloud-github
openstack_dashboard/dashboards/admin/metering/forms.py
48
2736
# Copyright 2014 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
nurmd2/nurmd
openerp/tools/lru.py
69
3004
# -*- coding: utf-8 -*- # taken from http://code.activestate.com/recipes/252524-length-limited-o1-lru-cache-implementation/ import threading from func import synchronized __all__ = ['LRU'] class LRUNode(object): __slots__ = ['prev', 'next', 'me'] def __init__(self, prev, me): self.prev = prev ...
gpl-3.0
IronLanguages/ironpython3
Src/StdLib/Lib/test/test_codecmaps_kr.py
20
1218
# # test_codecmaps_kr.py # Codec mapping tests for ROK encodings # from test import support from test import multibytecodec_support import unittest class TestCP949Map(multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'cp949' mapfileurl = 'http://www.pythontest.net/un...
apache-2.0
uvgroovy/compose
tests/integration/state_test.py
27
9547
from __future__ import unicode_literals import tempfile import shutil import os from compose import config from compose.project import Project from compose.const import LABEL_CONFIG_HASH from .testcases import DockerClientTestCase class ProjectTestCase(DockerClientTestCase): def run_up(self, cfg, **kwargs): ...
apache-2.0
podhmo/boto
boto/swf/__init__.py
145
1792
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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...
mit
urosgruber/dd-agent
utils/platform.py
7
2004
# stdlib import sys # project from utils.dockerutil import get_client _is_ecs = None class Platform(object): """ Return information about the given platform. """ @staticmethod def is_darwin(name=None): name = name or sys.platform return 'darwin' in name @staticmethod def ...
bsd-3-clause
bluven/eonboard
eoncloud_web/biz/floating/utils.py
4
1220
#coding=utf-8 from cloud.tasks import allocate_floating_task, floating_action_task from biz.account.models import Operation from biz.floating.models import Floating from biz.floating.settings import ALLOWED_FLOATING_ACTIONS, \ FLOATING_ACTION_NEXT_STATE OPERATION_SUCCESS = 1 OPERATION_FAIL...
apache-2.0
jesuscript/topo-mpi
topo/sheet/lissom.py
1
18697
""" LISSOM and related sheet classes. $Id$ """ __version__='$Revision$' from numpy import zeros,ones import copy import param import topo from topo.base.projection import Projection from topo.base.sheet import activity_type from topo.base.simulation import EPConnectionEvent from topo.transferfn.basic import Piecew...
bsd-3-clause
hmpf/nav
python/nav/ipdevpoll/plugins/entity.py
2
5514
# # Copyright (C) 2009-2012, 2015 Uninett AS # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License version 3 as published by # the Free Software Foundation. # # This program is distributed ...
gpl-3.0
ericzolf/ansible
lib/ansible/plugins/doc_fragments/connection_pipelining.py
16
1180
# Copyright (c) 2021 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 class ModuleDocFragment(object): # common shelldocumentation fragment DOCUMENTATION = """ o...
gpl-3.0
jffifa/kyotogang-toolset
kotori/gconf.py
1
3723
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- import sys import os import urlparse import urllib class GConf: """global configuration """ GROUP_ID = '10079277' # encodings SHELL_ENCODING = sys.stdout.encoding INTERNAL_ENCODING = 'utf_8' # debug mode DEBUG = False # global d...
mit
internap/almanach
tests/api/test_api_authentication.py
1
1252
# Copyright 2016 Internap. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
apache-2.0
puzan/ansible
lib/ansible/modules/cloud/rackspace/rax_cbs_attachments.py
25
6784
#!/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
LUTAN/tensorflow
tensorflow/contrib/bayesflow/python/ops/stochastic_gradient_estimators.py
81
11577
# 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
jimsimon/sky_engine
build/gyp_helper.py
77
2220
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This file helps gyp_chromium and landmines correctly set up the gyp # environment from chromium.gyp_env on disk import os SCRIPT_DIR = os.path.dirnam...
bsd-3-clause
sjl767/woo
scripts/test-OLD/clump-hopper-viscoelastic.py
1
3251
# -*- coding: utf-8 from woo import utils,pack,export,qt import gts,os,random,itertools from numpy import * import woo.log #woo.log.setLevel('NewtonIntegrator',woo.log.TRACE) # Parameters tc=0.001# collision time en=.3 # normal restitution coefficient es=.3 # tangential restitution coefficient frictionAngle=radi...
gpl-2.0
paran0ids0ul/infernal-twin
build/reportlab/src/reportlab/lib/validators.py
32
10298
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/validators.py __version__=''' $Id$ ''' __doc__="""Standard verifying functions used by attrmap.""" import sys, codecs from reportlab.lib.utils imp...
gpl-3.0
bpowers/bcc
tests/cc/test_stat1.py
3
1877
#!/usr/bin/env python # Copyright (c) PLUMgrid, Inc. # Licensed under the Apache License, Version 2.0 (the "License") # test program to count the packets sent to a device in a .5 # second period from ctypes import c_uint, c_ulong, Structure from netaddr import IPAddress from bcc import BPF from subprocess import chec...
apache-2.0
thresholdsoftware/asylum
openerp/addons/project/__init__.py
436
1141
# -*- 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
alexanderfefelov/nav
python/nav/web/info/netboxgroup/urls.py
2
1031
# # Copyright (C) 2013 UNINETT AS # # This file is part of Network Administration Visualized (NAV). # # NAV 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...
gpl-2.0
iesugrace/book-reader
lib/noter.py
1
3267
from record import Record from recorder import Recorder from timeutils import isotime import time import interact import os class Noter(Recorder): def __init__(self, db_path, book_name): Recorder.__init__(self, db_path) self.book_name = book_name def make_makers(self): makers = [] ...
gpl-2.0
0x27/clusterd
src/platform/coldfusion/interfaces.py
6
1252
from cprint import FingerPrint from requests import exceptions from log import LOG import utility class CINTERFACES: CFM = "ColdFusion Manager" class AdminInterface(FingerPrint): """ """ def __init__(self): self.platform = "coldfusion" self.version = None self.title = CINTER...
mit
josephbisch/the-blue-alliance
helpers/event_team_updater.py
2
3155
import datetime from google.appengine.ext import ndb from models.award import Award from models.event import Event from models.event_team import EventTeam from models.match import Match from models.team import Team class EventTeamUpdater(object): @classmethod def update(self, event_key): """ ...
mit
frouty/odoo_oph
history/migrate/3.4.0-4.0.0/pre.py
52
5289
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
chjw8016/GreenOdoo7-haibao
openerp/addons/account_sequence/account_sequence_installer.py
52
3933
# -*- 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...
mit
wojons/rethinkdb
external/v8_3.30.33.16/tools/testrunner/server/main.py
111
8960
# Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
agpl-3.0
swiharta/django-user-accounts-old
account/auth_backends.py
2
1026
from __future__ import unicode_literals from django.db.models import Q from django.contrib.auth.backends import ModelBackend from django.contrib.auth.models import User from account.models import EmailAddress class UsernameAuthenticationBackend(ModelBackend): def authenticate(self, **credentials): try...
mit
amyshi188/osf.io
scripts/osfstorage/finish_oldel_migration.py
60
3431
import logging from framework.mongo import database import pymongo from framework.transactions.context import TokuTransaction from website.app import init_app logger = logging.getLogger(__name__) def migrate(): logger.info('migrating osfstorageguidfiles') ### OsfStorageGuidFile ### try: datab...
apache-2.0
taion/flask-jsonapiview
setup.py
1
1714
from setuptools import setup EXTRAS_REQUIRE = { "docs": ("sphinx", "pallets-sphinx-themes"), "jwt": ("PyJWT>=1.4.0", "cryptography>=2.0.0"), "tests": ("coverage", "psycopg2-binary", "pytest"), } EXTRAS_REQUIRE["dev"] = ( EXTRAS_REQUIRE["docs"] + EXTRAS_REQUIRE["tests"] + ("tox",) ) setup( name="Fl...
mit
Distrotech/mozjs
js/src/tests/lib/progressbar.py
5
3578
# Text progress bar library, like curl or scp. from datetime import datetime, timedelta import math import sys if sys.platform.startswith('win'): from terminal_win import Terminal else: from terminal_unix import Terminal class NullProgressBar(object): def update(self, current, data): pass def poke(se...
mpl-2.0
cgstudiomap/cgstudiomap
main/parts/odoo/setup.py
150
5628
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re from glob import glob from setuptools import find_packages, setup from os.path import join, dirname execfile(join(dirname(__file__), 'openerp', 'release.py')) # Load release variables lib_name = 'openerp' def py2exe_datafiles(): data_files = {}...
agpl-3.0
vFense/vFenseAgent-nix
agent/deps/rpm6-32/Python-2.7.5/lib/python2.7/idlelib/GrepDialog.py
81
4052
import os import fnmatch import sys from Tkinter import * from idlelib import SearchEngine from idlelib.SearchDialogBase import SearchDialogBase def grep(text, io=None, flist=None): root = text._root() engine = SearchEngine.get(root) if not hasattr(engine, "_grepdialog"): engine._grepdialog = GrepD...
lgpl-3.0
hronoses/vispy
vispy/ext/fontconfig.py
23
4236
# -*- coding: utf-8 -*- import warnings from ctypes import (util, cdll, c_void_p, c_char_p, c_double, c_int, c_bool, Union, Structure, byref, POINTER) from ..util.wrappers import run_subprocess # Some code adapted from Pyglet fc = util.find_library('fontconfig') if fc is None: raise ImportErr...
bsd-3-clause
fahhem/mbed-os
tools/misc/remove-device-h.py
53
9400
import json import os import stat import re from collections import OrderedDict from subprocess import Popen git_processes = [] class MyJSONEncoder(json.JSONEncoder): def __init__(self, *args, **kwargs): super(MyJSONEncoder, self).__init__(*args, **kwargs) self.current_indent = 0 self.curr...
apache-2.0
wbtuomela/mezzanine
mezzanine/blog/urls.py
15
1883
from __future__ import unicode_literals from django.conf.urls import url from mezzanine.blog import views from mezzanine.conf import settings # Trailing slahes for urlpatterns based on setup. _slash = "/" if settings.APPEND_SLASH else "" # Blog patterns. urlpatterns = [ url("^feeds/(?P<format>.*)%s$" % _slash,...
bsd-2-clause
suyashphadtare/sajil-final-erp
erpnext/accounts/doctype/pos_setting/pos_setting.py
42
2367
# 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 msgprint, _ from frappe.utils import cint from frappe.model.document import Document class POSSetting(Document): ...
agpl-3.0
niltmt/arm-eabi-4.7
share/gdb/python/gdb/command/pretty_printers.py
107
14696
# Pretty-printer commands. # Copyright (C) 2010-2012 Free Software Foundation, Inc. # 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 la...
gpl-2.0
Ivehui/DQN
dqn.py
1
2248
''' @author Ivehui @time 2016/06/05 @function: reinforcement agent ''' import random import caffe import parameters as pms import numpy as np class DqnAgent(object): def __init__(self, action_space, model=pms.newModel): self.action_space = action_space actionSolver = None actionSolver = ca...
mit
oe-alliance/oe-alliance-enigma2
lib/python/Components/ChoiceList.py
7
1268
from MenuList import MenuList from Tools.Directories import SCOPE_ACTIVE_SKIN, resolveFilename from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, gFont from Tools.LoadPixmap import LoadPixmap from Tools.Directories import fileExists import skin def ChoiceEntryComponent(key="", text=None): if not text: tex...
gpl-2.0
aricchen/openHR
openerp/addons/l10n_vn/__init__.py
425
1067
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved. # # This program is free software: you can redistribute it and/or...
agpl-3.0
bdero/edx-platform
lms/djangoapps/shoppingcart/views.py
9
15186
import logging import datetime import pytz from django.conf import settings from django.contrib.auth.models import Group from django.http import (HttpResponse, HttpResponseRedirect, HttpResponseNotFound, HttpResponseBadRequest, HttpResponseForbidden, Http404) from django.utils.translation import ugettext as _ from ...
agpl-3.0
weso/landportal-importers
IpfriExtractor/es/weso/translator/parser/indicators_parser.py
2
2855
__author__ = 'Dani' from es.weso.util.excell_utils import is_empty_cell, content_starts_in_second_column from es.weso.translator.parser.parsed_entities import ParsedIndicator class IndicatorsParser(object): def __init__(self, sheet): self.sheet = sheet self.row = None # Complete when running ...
unlicense
giordi91/python_misc
widgets/plotWidget/colorWidget.py
1
11019
from PySide import QtGui , QtCore import math #this is just a color picker class ColorWidget(QtGui.QWidget): colorChangedSignal = QtCore.Signal(int , int ,int) def __init__(self, parent = None , color = [255,0,0]): QtGui.QWidget.__init__(self,parent) self.width ...
mit
mapr/impala
thirdparty/thrift-0.9.0/contrib/zeromq/TZmqServer.py
108
2532
# # 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
a10networks/a10sdk-python
a10sdk/core/router/router_ospf_redistribute_vip_vip_redist.py
2
3403
from a10sdk.common.A10BaseClass import A10BaseClass class VipList(A10BaseClass): """This class does not support CRUD Operations please use parent. :param metric_type_vip: {"default": "2", "enum": ["1", "2"], "type": "string", "description": "1: \"Set OSPF External Type 1 metrics\"; 2: \"Set OSPF Externa...
apache-2.0
an4967/TizenRT
os/tools/memstats_gnueabil.py
10
12054
#!/usr/bin/env python ########################################################################### # # Copyright 2016 Samsung Electronics 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 ...
apache-2.0
vinilios/synnefo
snf-pithos-app/pithos/api/functions.py
6
51345
# 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
tanium/pytan
lib/libs_external/any/cryptography/hazmat/primitives/cmac.py
9
2221
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography import utils from cryptography.exceptions import ( ...
mit
MackZxh/OCA-Choice
reporting-engine/base_report_assembler/ir_report.py
13
4125
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
lgpl-3.0
ryanGT/sympy
sympy/functions/elementary/integers.py
5
5061
from sympy.core.basic import Basic, S, C, sympify from sympy.core.function import Lambda, Function from sympy.core.evalf import get_integer_part, PrecisionExhausted from sympy.utilities.decorator import deprecated ############################################################################### #######################...
bsd-3-clause
bamborrcoin/bamborrcoin
contrib/pyminer/pyminer.py
766
6434
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
mit
nvoron23/socialite
jython/Lib/xml/Uri.py
109
16394
# pylint: disable-msg=C0103 # # backported code from 4Suite with slight modifications, started from r1.89 of # Ft/Lib/Uri.py, by syt@logilab.fr on 2005-02-09 # # part if not all of this code should probably move to urlparse (or be used # to fix some existant functions in this module) # # # Copyright 2004 Fourthought, I...
apache-2.0
JGarcia-Panach/odoo
addons/mail/mail_followers.py
168
12482
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-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
gberl001/PCV
PCV/tools/ransac.py
21
8704
import numpy import scipy # use numpy if scipy unavailable import scipy.linalg # use numpy if scipy unavailable ## Copyright (c) 2004-2007, Andrew D. Straw. All rights reserved. ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ...
bsd-2-clause
jolene-esposito/osf.io
framework/tasks/__init__.py
21
1120
# -*- coding: utf-8 -*- """Asynchronous task queue module.""" from celery import Celery from celery.utils.log import get_task_logger from raven import Client from raven.contrib.celery import register_signal from website import settings app = Celery() # TODO: Hardcoded settings module. Should be set using framework...
apache-2.0
ycl2045/nova-master
nova/tests/api/openstack/compute/contrib/test_aggregates.py
4
20787
# Copyright (c) 2012 Citrix Systems, 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 ...
apache-2.0
Serag8/Bachelor
google_appengine/google/appengine/tools/devappserver2/python/request_handler.py
3
9525
#!/usr/bin/env python # # Copyright 2007 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 o...
mit
akalipetis/raven-python
raven/processors.py
4
4296
""" raven.core.processors ~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import re from raven._compat import string_types, text_type from raven.utils import varmap class Proces...
bsd-3-clause
listamilton/supermilton.repository
plugin.video.exodus/resources/lib/sources/pelispedia_mv_tv.py
2
8391
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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
alqfahad/odoo
addons/product/_common.py
316
1448
# -*- 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
HyperBaton/ansible
test/units/modules/network/fortios/test_fortios_system_link_monitor.py
21
15251
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
75651/kbengine_cloud
kbe/src/lib/python/Lib/test/test_thread.py
84
8285
import os import unittest import random from test import support thread = support.import_module('_thread') import time import sys import weakref from test import lock_tests NUMTASKS = 10 NUMTRIPS = 3 _print_mutex = thread.allocate_lock() def verbose_print(arg): """Helper function for printing out debugging outp...
lgpl-3.0
MTgeophysics/mtpy
mtpy/uofa/bayesian1d.py
1
2557
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on 31.07.2013 @author: LK@UofA mtpy/uofa/bayesian1d.py Module for handling the UofA Bayesian 1D inversion/modelling code. """ import os import sys import os.path as op import mtpy.utils.filehandling as MTfh import mtpy.core.edi as EDI import mtpy.utils.exce...
gpl-3.0
apache-spark-on-k8s/spark
examples/src/main/python/ml/word2vec_example.py
122
1776
# # 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
clobrano/personfinder
app/unidecode/x0be.py
253
4849
data = ( 'byum', # 0x00 'byub', # 0x01 'byubs', # 0x02 'byus', # 0x03 'byuss', # 0x04 'byung', # 0x05 'byuj', # 0x06 'byuc', # 0x07 'byuk', # 0x08 'byut', # 0x09 'byup', # 0x0a 'byuh', # 0x0b 'beu', # 0x0c 'beug', # 0x0d 'beugg', # 0x0e 'beugs', # 0x0f 'beun', # 0x10 '...
apache-2.0
apixandru/intellij-community
python/helpers/epydoc/docwriter/html.py
89
143938
# # epydoc -- HTML output generator # Edward Loper # # Created [01/30/01 05:18 PM] # $Id: html.py 1674 2008-01-29 06:03:36Z edloper $ # """ The HTML output generator for epydoc. The main interface provided by this module is the L{HTMLWriter} class. @todo: Add a cache to L{HTMLWriter.url()}? """ __docformat__ = 'epyt...
apache-2.0
zhouzhenghui/python-for-android
python-build/python-libs/gdata/src/gdata/media/__init__.py
221
12093
# -*-*- encoding: utf-8 -*-*- # # This is gdata.photos.media, implementing parts of the MediaRSS spec in gdata structures # # $Id: __init__.py 81 2007-10-03 14:41:42Z havard.gulldahl $ # # Copyright 2007 Håvard Gulldahl # Portions copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "Lice...
apache-2.0
steveblamey/nautilus-archive
setup.py
1
1285
#!/usr/bin/env python # coding: utf-8 from os import path from distutils.core import setup PROJECT_DIR = path.dirname(__file__) extension = [ ('/usr/share/nautilus-python/extensions', [path.join(PROJECT_DIR, 'extension', 'nautilus-archive.py')]), ('/usr/share/icons/hicolor/48x48/emblems', [path.joi...
gpl-3.0
zachjanicki/osf.io
api/base/urls.py
1
1810
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.views.generic.base import RedirectView from settings import API_BASE from . import views base_pattern = '^{}'.format(API_BASE) urlpatterns = [ url(base_pattern, include( ...
apache-2.0
DirtyUnicorns/android_kernel_samsung_trlte
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
jfpla/odoo
addons/payment_ogone/controllers/main.py
389
1179
# -*- coding: utf-8 -*- import logging import pprint import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class OgoneController(http.Controller): _accept_url = '/payment/ogone/test/accept' _decline_url = '/payment/ogone/test/decline' ...
agpl-3.0
srmagura/potential
ps/grid.py
1
8094
import numpy as np from ps.extend import EType class PsGrid: # FIXME old way is deprecated '''def ps_construct_grids(self, scheme_order): self.construct_grids(scheme_order) R = self.R # remove eventually? a = self.a self.all_Mplus = {0: set(), 1: set(), 2: set()} self...
gpl-3.0
wolftankk/livestreamer
src/livestreamer/plugins/twitch.py
15
14791
import re import requests from random import random from livestreamer.compat import urlparse from livestreamer.exceptions import NoStreamsError, PluginError, StreamError from livestreamer.plugin import Plugin, PluginOptions from livestreamer.plugin.api import http, validate from livestreamer.plugin.api.utils import ...
bsd-2-clause
a358003542/expython
expython/pattern/__init__.py
1
1439
#!/usr/bin/env python # -*- coding: utf-8 -*- from collections import UserList import logging logger = logging.getLogger(__name__) class CycleList(UserList): """ 一个无限循环输出元素的可迭代对象,如果是on-fly模式 (主要指for循环中的删除动作)推荐使用 `remove_item` 方法 """ def __init__(self, data): super().__init...
mit
mesosphere/aws-cfn-resource-bridge
aws/cfn/bridge/vendored/botocore/vendored/requests/packages/charade/charsetgroupprober.py
2929
3791
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
apache-2.0
ramanajee/phantomjs
src/qt/qtbase/util/local_database/enumdata.py
102
38654
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ## Contact: http://www.qt-project.org/legal ## ## This file is part of the test suite of the Qt Toolkit. ## ## $QT_BEGIN_LICENSE:LGPL$ ## Commercial License...
bsd-3-clause
ntiufalara/openerp7
openerp/addons/project_issue/__openerp__.py
52
2437
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
mit
JackDanger/sentry
tests/sentry/web/frontend/test_create_team.py
9
2815
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.models import OrganizationMember, OrganizationMemberTeam, Team from sentry.testutils import TestCase, PermissionTestCase class CreateTeamPermissionTest(PermissionTestCase): def setUp(self): super(CreateTeamPe...
bsd-3-clause
tumbl3w33d/ansible
lib/ansible/plugins/lookup/onepassword.py
19
9030
# -*- coding: utf-8 -*- # Copyright: (c) 2018, Scott Buchanan <sbuchanan@ri.pn> # Copyright: (c) 2016, Andrew Zenk <azenk@umn.edu> (lastpass.py used as starting point) # Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ imp...
gpl-3.0
nonhermitian/scipy
scipy/linalg/tests/test_decomp_polar.py
126
2797
from __future__ import division, print_function, absolute_import import numpy as np from numpy.linalg import norm from numpy.testing import (assert_, assert_allclose, assert_equal, run_module_suite) from scipy.linalg import polar, eigh diag2 = np.array([[2, 0], [0, 3]]) a13 = np.array([[1, 2, 2]]) precomputed_c...
bsd-3-clause
p4lang/p4app
docker/scripts/mininet/p4_mininet.py
1
5757
# Copyright 2013-present Barefoot Networks, 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 agre...
apache-2.0
kevinthesun/mxnet
python/mxnet/rtc.py
12
4907
# 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
iaz3/ModReader
modreader/game/__init__.py
1
1209
# !/usr/bin/env python3 """ Game Support Modules should be located in this package Names should be all lowercase, unique, and code should follow the template, The template represents the bare miniumum API you are required to conform to. You are allowed to add new files and extend it. """ # ====================== GPL ...
gpl-3.0