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
elephone-dev/P8000-Kernel
Documentation/target/tcm_mod_builder.py
2358
40707
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
azjps/bokeh
bokeh/server/tests/utils.py
3
2395
from __future__ import absolute_import, print_function from bokeh.server.server import Server from tornado.ioloop import IOLoop from tornado.httpclient import AsyncHTTPClient, HTTPRequest from tornado.websocket import websocket_connect def url(server, prefix=""): return "http://localhost:" + str(server.port) + pr...
bsd-3-clause
stshine/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/mux.py
636
71218
# Copyright 2012, 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
popazerty/zde-e2
lib/python/Components/Converter/ValueToPixmap.py
33
1211
from Components.Converter.Converter import Converter from Components.Element import cached, ElementError from Tools.Directories import fileExists, SCOPE_SKIN_IMAGE, SCOPE_CURRENT_SKIN, resolveFilename from Tools.LoadPixmap import LoadPixmap class ValueToPixmap(Converter, object): LANGUAGE_CODE = 0 PATH = 1 def __...
gpl-2.0
FluidityProject/multifluids
tests/sloshing_tank/plot_freesurface.py
5
2631
#!/usr/bin/env python import settings import ana_sol import sys import math import commands import matplotlib.pyplot as plt import getopt from scipy.special import erf from numpy import poly1d from matplotlib.pyplot import figure, show from numpy import pi, sin, linspace from matplotlib.mlab import stineman_interp ...
lgpl-2.1
jxs/servo
tests/wpt/harness/wptrunner/update/tree.py
142
11075
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import re import subprocess from .. import vcs from ..vcs import bind_to_repo, git, hg def get_unique_name(...
mpl-2.0
nkoep/pymanopt
pymanopt/manifolds/psd.py
1
15204
import warnings import numpy as np from numpy import linalg as la, random as rnd from scipy.linalg import expm # Workaround for SciPy bug: https://github.com/scipy/scipy/pull/8082 try: from scipy.linalg import solve_continuous_lyapunov as lyap except ImportError: from scipy.linalg import solve_lyapunov as lyap...
bsd-3-clause
c0defreak/python-for-android
python3-alpha/python3-src/Lib/imghdr.py
57
3531
"""Recognize image file formats based on their first few bytes.""" __all__ = ["what"] #-------------------------# # Recognize image headers # #-------------------------# def what(file, h=None): if h is None: if isinstance(file, str): f = open(file, 'rb') h = f.read(32) els...
apache-2.0
rubenvb/skia
tools/skpbench/_hardware_pixel2.py
12
4472
# Copyright 2018 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from _hardware import Expectation from _hardware_android import HardwareAndroid CPU_CLOCK_RATE = 2035200 MEM_CLOCK_RATE = 13763 GPU_CLOCK_RATE = 670000000 GPU_POWER_LEVEL = 1 # lower i...
bsd-3-clause
Anonymouslemming/ansible
lib/ansible/modules/cloud/rackspace/rax_clb_ssl.py
70
9636
#!/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
jarias/heroku-buildpack-go
vendor/virtualenv-1.9/bin/refresh-support-files.py
2
1877
#!/usr/bin/env python """ Refresh any files in ../virtualenv_support/ that come from elsewhere """ import os try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen import sys here = os.path.dirname(__file__) support_location = os.path.join(here, '..', 'virtualenv_support') emb...
apache-2.0
ftl-toolbox/lib_openshift
lib_openshift/models/v1_project_list.py
2
6198
# coding: utf-8 """ OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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 ...
apache-2.0
wagtail/wagtail
wagtail/search/tests/elasticsearch_common_tests.py
6
8051
import unittest from datetime import date from io import StringIO from django.core import management from wagtail.search.query import MATCH_ALL from wagtail.search.tests.test_backends import BackendTests from wagtail.tests.search import models class ElasticsearchCommonSearchBackendTests(BackendTests): def test...
bsd-3-clause
zero-ui/miniblink49
v8_7_5/testing/gmock/scripts/upload_gmock.py
770
2833
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
gpl-3.0
sikmir/QGIS
python/plugins/processing/gui/DestinationSelectionPanel.py
3
15921
# -*- coding: utf-8 -*- """ *************************************************************************** OutputSelectionPanel.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******************...
gpl-2.0
stefanfoulis/django-cms
cms/signals/plugins.py
11
2026
# -*- coding: utf-8 -*- from cms.constants import PUBLISHER_STATE_DIRTY from cms.models import CMSPlugin, Title, Page, StaticPlaceholder, Placeholder def get_placeholder(plugin): if plugin.placeholder_id: try: return plugin.placeholder except Placeholder.DoesNotExist: retur...
bsd-3-clause
aclifton/cpeg853-gem5
src/arch/x86/isa/insts/simd64/integer/data_reordering/extract_and_insert.py
91
2597
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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 implemen...
bsd-3-clause
UrLab/DocHub
www/rest_urls.py
1
1862
from rest_framework.routers import APIRootView, DefaultRouter import catalog.rest import documents.rest import notifications.rest import search.rest import telepathy.rest import users.rest import www.rest class DochubAPI(APIRootView): """ This is the API of DocHub. You are free to use it to crawl DocHub...
agpl-3.0
EventGhost/EventGhost
plugins/MediaMonkey/__init__.py
2
170702
# -*- coding: utf-8 -*- # # plugins/MediaMonkey/__init__.py # # Copyright (C) 2009-2011 Pako <lubos.ruckl@quick.cz> # # This file is a plugin for EventGhost. # Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/> # # EventGhost is free software: you can redistribute it and/or modify it under # the te...
gpl-2.0
ujenmr/ansible
lib/ansible/modules/network/nxos/nxos_pim.py
83
5321
#!/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 distribut...
gpl-3.0
pombredanne/django-bulbs
example/settings.py
1
2779
import os MODULE_ROOT = os.path.dirname(os.path.realpath(__file__)) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:' } } USE_TZ = True, CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', } } TEMPLATE_DIRS = (...
mit
pombredanne/discern
examples/problem_grader/grader/models.py
1
5156
from django.db import models from django.contrib.auth.models import User from django.forms.models import model_to_dict from django.db.models.signals import post_save, pre_save import random import string from django.conf import settings import requests import json import logging log= logging.getLogger(__name__) class...
agpl-3.0
mujiansu/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/ctypes/test/test_simplesubclasses.py
51
1384
import unittest from ctypes import * class MyInt(c_int): def __cmp__(self, other): if type(other) != MyInt: return -1 return cmp(self.value, other.value) def __hash__(self): # Silence Py3k warning return hash(self.value) class Test(unittest.TestCase): def test_compare(...
apache-2.0
mabotech/mabo.io
py/AK/test/redis_lua000.py
1
1801
# -*- coding: utf-8 -*- """ redis lua redis eval, notyify in lua script """ import time import redis def main(key, val, key2, val2): # connection pool r = redis.Redis(host='localhost', port=6379, db=5) d = {"a":"v1"} """ eval("lua script","number of kkeys", keys[],argv[]) KEYS[...
mit
switchboardpy/switchboard
switchboard/manager.py
1
7753
""" switchboard.manager ~~~~~~~~~~~~~~~~ :copyright: (c) 2015 Kyle Adams. :license: Apache License 2.0, see LICENSE for more details. """ import logging from .base import ModelDict from .models import ( Switch, DISABLED, SELECTIVE, GLOBAL, INHERIT, INCLUDE, EXCLUDE, ) from .proxy import SwitchProxy from ...
apache-2.0
dhoffman34/django
django/templatetags/i18n.py
84
17694
from __future__ import unicode_literals import re import sys from django.conf import settings from django.template import (Node, Variable, TemplateSyntaxError, TokenParser, Library, TOKEN_TEXT, TOKEN_VAR) from django.template.base import render_value_in_context from django.template.defaulttags import token_kwargs ...
bsd-3-clause
rcbops/nova-buildpackage
nova/virt/vmwareapi_conn.py
2
15563
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack 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 # # htt...
apache-2.0
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/pylint/test/input/func_block_disable_msg.py
4
4619
# pylint: disable=C0302,bare-except,print-statement """pylint option block-disable""" __revision__ = None class Foo(object): """block-disable test""" def __init__(self): pass def meth1(self, arg): """this issues a message""" print self def meth2(self, arg): """and thi...
agpl-3.0
Quizp2p/uimap
src/uimap/drivers/wpf/service.py
2
1327
import subprocess import traceback import sys import os from SimpleXMLRPCServer import SimpleXMLRPCServer as Server PID_FILE = 'c:\wpf_service.pid' try: with file(PID_FILE, 'r') as f: pid = f.read() proc = subprocess.Popen(['tasklist', '/fi', 'imagename eq ipy.exe', '/fi', 'pid eq ' + str(pid)], st...
mit
levilucio/SyVOLT
t_core/HTopClass2TableNAC0.py
1
8862
from core.himesis import Himesis, HimesisPreConditionPatternNAC import cPickle as pickle from uuid import UUID class HTopClass2TableNAC0(HimesisPreConditionPatternNAC): def __init__(self, LHS): """ Creates the himesis graph representing the AToM3 model HTopClass2TableNAC0. """ ...
mit
deapubhi/myblog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_asybuiltins.py
369
27319
# -*- coding: utf-8 -*- """ pygments.lexers._asybuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the asy-function names and asy-variable names of Asymptote. Do not edit the ASYFUNCNAME and ASYVARNAME sets by hand. TODO: perl/python script in Asymptote SVN similar to asy-list.pl but onl...
mit
blademainer/intellij-community
plugins/hg4idea/testData/bin/hgext/convert/__init__.py
92
15637
# convert.py Foreign SCM converter # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''import revisions from foreign VCS repositories into Mercurial''' import convcmd import c...
apache-2.0
thiblahute/hotdoc
hotdoc/extensions/c/utils.py
2
5492
import os from collections import namedtuple import cchardet from hotdoc.parsers.c_comment_scanner.c_comment_scanner import extract_comments from hotdoc.core.symbols import * from hotdoc.utils.loggable import debug RawMacro = namedtuple('RawMacro', ['raw', 'filename']) def unicode_dammit(data): encoding = ccha...
lgpl-2.1
Paytokens/payblockd
lib/components/assets.py
1
14549
import os import logging import decimal import base64 import json from datetime import datetime from lib import config, util, util_litecoin ASSET_MAX_RETRY = 3 D = decimal.Decimal def parse_issuance(db, message, cur_block_index, cur_block): if message['status'] != 'valid': return def modify_extended...
mit
spoonysonny/SAKS-tutorials
saks-v1.x/digital-stopwatch/sakshat.py
6
3444
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2015 NXEZ.COM. # http://www.nxez.com # # Licensed under the GNU General Public 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.gnu.org/licen...
gpl-2.0
formath/mxnet
example/model-parallel/lstm/lstm.py
25
21619
# 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
devinbalkind/eden
static/scripts/tools/xsltransform.py
34
1391
# -*- coding: utf-8 -*- # # Debug/Helper script for XSL stylesheet development # # >>> python xsltransform <XML File> <XSLT Stylesheet> [<name>] # ... transforms the XML file using the stylesheet # import sys from lxml import etree def parse(source): parser = etree.XMLParser(no_network=False) result = e...
mit
MalloyDelacroix/DownloaderForReddit
Tools/ui_converter.py
1
5130
#!/usr/bin/env python import sys import os import subprocess class Converter: base_ui_path = os.path.relpath('Resources/ui_files') base_out_path = os.path.relpath('DownloaderForReddit/guiresources') def __init__(self, ui_file): self.ui_file = ui_file self.callable_methods = [ ...
gpl-3.0
aparo/django-nonrel
django/template/defaulttags.py
13
42287
"""Default tags used by the template system, available to all templates.""" import sys import re from itertools import groupby, cycle as itertools_cycle from django.template import Node, NodeList, Template, Context, Variable from django.template import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_START, BLOCK...
bsd-3-clause
marcwebbie/youtube-dl
youtube_dl/extractor/thisamericanlife.py
135
1549
from __future__ import unicode_literals from .common import InfoExtractor class ThisAmericanLifeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?thisamericanlife\.org/(?:radio-archives/episode/|play_full\.php\?play=)(?P<id>\d+)' _TESTS = [{ 'url': 'http://www.thisamericanlife.org/radio-archives/e...
unlicense
goodhacker/Mobile-Security-Framework-MobSF
StaticAnalyzer/views.py
32
107586
# -*- coding: utf_8 -*- from django.shortcuts import render from django.http import HttpResponseRedirect from django.http import HttpResponse from django.template.loader import get_template from StaticAnalyzer.models import StaticAnalyzerAndroid,StaticAnalyzerIPA,StaticAnalyzerIOSZIP from django.conf import settings fr...
gpl-3.0
dannyperry571/theapprentice
script.module.pydevd/lib/_pydev_jy_imports_tipper.py
52
16526
import StringIO import traceback from java.lang import StringBuffer #@UnresolvedImport from java.lang import String #@UnresolvedImport import java.lang #@UnresolvedImport import sys from _pydev_tipper_common import DoFind try: False True except NameError: # version < 2.3 -- didn't have the True/False builtins...
gpl-2.0
BlackPole/bp-openembedded
contrib/oe-stylize.py
27
11412
#!/usr/bin/env python """\ Sanitize a bitbake file following the OpenEmbedded style guidelines, see http://openembedded.org/wiki/StyleGuide (C) 2006 Cyril Romain <cyril.romain@gmail.com> MIT license TODO: - add the others OpenEmbedded variables commonly used: - parse command arguments and print usage on misuse ...
mit
hatwar/Das_erpnext
erpnext/utilities/doctype/address/address.py
24
4033
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import throw, _ from frappe.utils import cstr from frappe.model.document import Document class Address(Document): def auto...
agpl-3.0
duncan-r/SHIP
ship/utils/fileloaders/fileloader.py
1
2254
""" Summary: Main file loader for the API. This offers convenience methods to make it simple to load any type of file from one place. Author: Duncan Runnacles Created: 01 Apr 2016 Copyright: Duncan Runnacles 2016 TODO: Updates: """ from __future__ import unicode_literals fro...
mit
Cojacfar/Maker
comm/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/geom.py
214
4428
from ctypes import c_char_p, c_int, c_size_t, c_ubyte, POINTER from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import ( check_geom, check_minus_one, check_sized_string, check_string, check_zero) from django.contrib.gis.geos.prototypes.threadsafe import G...
gpl-2.0
smeissner/eden
private/templates/DRRPP/maintenance.py
20
2677
# -*- coding: utf-8 -*- from datetime import timedelta from gluon import * #from s3 import * # ============================================================================= class Daily(): """ Daily Maintenance Tasks """ def __call__(self): db = current.db request = current.request s...
mit
boundlessgeo/QGIS
python/plugins/processing/algs/qgis/StatisticsByCategories.py
11
13487
# -*- coding: utf-8 -*- """ *************************************************************************** StatisticsByCategories.py --------------------- Date : September 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *************...
gpl-2.0
ahmedaljazzar/edx-platform
lms/djangoapps/courseware/entrance_exams.py
14
2199
""" This file contains all entrance exam related utils/logic. """ from courseware.access import has_access from opaque_keys.edx.keys import UsageKey from student.models import EntranceExamConfiguration from util.milestones_helpers import get_required_content, is_entrance_exams_enabled from xmodule.modulestore.django i...
agpl-3.0
ds-hwang/chromium-crosswalk
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
3
50805
# 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
erikriver/eduIntelligent-cynin
src/ubify.cyninv2theme/ubify/cyninv2theme/browser/review.py
5
2417
############################################################################### #cyn.in is an open source Collaborative Knowledge Management Appliance that #enables teams to seamlessly work together on files, documents and content in #a secure central environment. # #cyn.in v2 an open source appliance is distrib...
gpl-3.0
arrabito/DIRAC
ConfigurationSystem/Service/ConfigurationHandler.py
1
3918
""" The CS! (Configuration Service) """ __RCSID__ = "$Id$" from DIRAC.Core.Utilities.ReturnValues import S_OK, S_ERROR from DIRAC.ConfigurationSystem.private.ServiceInterface import ServiceInterface from DIRAC.Core.DISET.RequestHandler import RequestHandler from DIRAC.Core.Utilities import DErrno gServiceInterface =...
gpl-3.0
Accontech/ace-ios
tools/python/unittests/test_setup.py
15
3308
from nose.tools import assert_equals import linphone from linphonetester import * import os class TestSetup: def test_address(self): create_address(None) def test_version(self): lc = linphone.Core.new({}, None, None) assert_equals(lc.version.find("unknown"), -1) def test_address(...
gpl-2.0
lunixbochs/nullstatic
gen.py
1
2581
#!/usr/bin/env python2 from collections import defaultdict from datetime import date, datetime from email.Utils import formatdate import frontmatter import jinja2 import markdown import os import sys import time import yaml @jinja2.contextfilter def _render(context, data): return env.from_string(data['source']).re...
mit
feigames/Odoo
openerp/addons/base/tests/test_xmlrpc.py
48
1169
# -*- coding: utf-8 -*- import time import unittest2 import xmlrpclib import openerp.tests.common DB = openerp.tests.common.DB class test_xmlrpc(openerp.tests.common.HttpCase): def test_01_xmlrpc_login(self): """ Try to login on the common service. """ uid = self.xmlrpc_common.login(DB, 'admin',...
agpl-3.0
JioCloud/contrail-controller
src/opserver/opserver_util.py
3
23670
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # # # OpServer Utils # # Utility functions for Operational State Server for VNC # import datetime import time import requests import pkg_resources import xmltodict import json import gevent import socket, struct try: from pysandesh.gen_py.sandesh...
apache-2.0
wzbozon/statsmodels
statsmodels/tsa/vector_ar/svar_model.py
21
23901
""" Vector Autoregression (VAR) processes References ---------- Lutkepohl (2005) New Introduction to Multiple Time Series Analysis """ from __future__ import print_function, division from statsmodels.compat.python import range import numpy as np import numpy.linalg as npl from numpy.linalg import slogdet from statsm...
bsd-3-clause
dbertha/odoo
openerp/addons/test_workflow/models.py
337
2268
# -*- coding: utf-8 -*- import openerp.osv.orm class m(openerp.osv.orm.Model): """ A model for which we will define a workflow (see data.xml). """ _name = 'test.workflow.model' def print_(self, cr, uid, ids, s, context=None): print ' Running activity `%s` for record %s' % (s, ids) return ...
agpl-3.0
clebergnu/autotest
conmux/contrib/console_check.py
4
10617
#!/usr/bin/python _author_ = 'Scott Zawalski (scottz@google.com)' """Console check script to be used with conmux. Checks if machines are not only connected to conmux but also responding in an expected way Supports options to show all, good, bad, unknown and add them to autotest as well. *In order fo...
gpl-2.0
wulin9005/cocosbuilder
CocosBuilder/libs/nodejs/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py
1049
4803
# 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. import re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. ...
mit
mohamed--abdel-maksoud/chromium.src
tools/perf/measurements/memory.py
12
1234
# Copyright 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. from metrics import memory from metrics import power from telemetry.page import page_test class Memory(page_test.PageTest): def __init__(self): super(...
bsd-3-clause
ByteInternet/libcloud
libcloud/dns/providers.py
2
3979
# 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 use ...
apache-2.0
owais/django-simple-activity
simple_activity/models.py
1
1965
from django.db import models from django.utils.timezone import now from django.conf import settings from django.contrib.contenttypes.models import ContentType from filtered_contenttypes.fields import FilteredGenericForeignKey from django_pgjson.fields import JsonBField from .managers import ActionManager from . impor...
bsd-2-clause
EmanueleCannizzaro/scons
test/Clean/Option.py
1
2620
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
mit
joshblum/django-with-audit
django/db/backends/__init__.py
5
35773
from django.db.utils import DatabaseError try: import thread except ImportError: import dummy_thread as thread from contextlib import contextmanager from django.conf import settings from django.db import DEFAULT_DB_ALIAS from django.db.backends import util from django.db.transaction import TransactionManageme...
bsd-3-clause
mhogg/scipy
scipy/weave/converters.py
92
2703
from __future__ import absolute_import, print_function from . import common_info from . import c_spec #---------------------------------------------------------------------------- # The "standard" conversion classes #---------------------------------------------------------------------------- default = [c_spec.int_c...
bsd-3-clause
Lektorium-LLC/edx-platform
common/test/acceptance/pages/lms/video/video.py
11
31155
""" Video player in the courseware. """ import json import logging import time import requests from bok_choy.javascript import js_defined, wait_for_js from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise, Promise from selenium.webdriver.common.action_chains import ActionChains log = ...
agpl-3.0
ngageoint/voxel-globe
voxel_globe/create_site/tools.py
2
9353
import requests from requests.packages.urllib3.util.retry import Retry import os import urlparse import sys import time import json from contextlib import closing #-------------------------------------------------- # PLANETLABS COMMUNICATION #-------------------------------------------------- class PlanetClient(): ...
mit
olhoneles/olhoneles
montanha/management/commands/collectors/algo.py
1
12094
# -*- coding: utf-8 -*- # # Copyright (©) 2010-2013 Estêvão Samuel Procópio # Copyright (©) 2010-2013 Gustavo Noronha Silva # Copyright (©) 2013 Marcelo Jorge Vieira # Copyright (©) 2014 Wilson Pinto Júnior # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero...
agpl-3.0
Noviat/odoo
addons/gamification/wizard/update_goal.py
386
1848
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
whitehorse-io/encarnia
pyenv/lib/python2.7/site-packages/pip/_vendor/requests/compat.py
327
1687
# -*- coding: utf-8 -*- """ requests.compat ~~~~~~~~~~~~~~~ This module handles import compatibility issues between Python 2 and Python 3. """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_p...
mit
bmanojlovic/ansible
lib/ansible/playbook/playbook_include.py
12
6365
# (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
XiaosongWei/chromium-crosswalk
tools/memory_inspector/memory_inspector/classification/mmap_classifier.py
108
2420
# Copyright 2014 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 module classifies MemoryMap objects filtering their mmap entries. Two filters are currently available: - 'mmap_file': 'foo.*\.so': matches any ent...
bsd-3-clause
kaynfiretvguru/Eldritch
plugin.video.exodus/resources/lib/sources/ko/drama4u.py
4
5870
# -*- 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
chemelnucfin/tensorflow
tensorflow/python/ops/linalg/linear_operator_block_diag.py
4
14158
# Copyright 2018 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
ybellavance/python-for-android
python3-alpha/python3-src/Lib/distutils/command/build.py
139
5413
"""distutils.command.build Implements the Distutils 'build' command.""" import sys, os from distutils.core import Command from distutils.errors import DistutilsOptionError from distutils.util import get_platform def show_compilers(): from distutils.ccompiler import show_compilers show_compilers() class bu...
apache-2.0
holdenk/spark
python/pyspark/ml/tests/test_stat.py
23
2069
# # 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
mupif/mupif
mupif/Field.py
1
42683
# # MuPIF: Multi-Physics Integration Framework # Copyright (C) 2010-2015 Borek Patzak # # Czech Technical University, Faculty of Civil Engineering, # Department of Structural Mechanics, 166 29 Prague, Czech Republic # # This library is free software; you can redistribute it and/or # modify i...
lgpl-3.0
j4321/tkFileBrowser
docs/conf.py
1
5256
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
gpl-3.0
unisport/thumblr
thumblr/tasks.py
1
1681
from django.conf import settings from celery import Celery, Task from raven import Client import usecases client = Client(settings.SENTRY_DSN) celery = Celery('tasks') celery.conf.update( AWS_ACCESS_KEY_ID=settings.AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY=settings.AWS_SECRET_ACCESS_KEY, CELERY_TASK_SE...
mit
sander76/home-assistant
homeassistant/components/group/__init__.py
3
22278
"""Provide the functionality to group entities.""" from __future__ import annotations from abc import abstractmethod import asyncio from contextvars import ContextVar import logging from typing import Any, Iterable, List, cast import voluptuous as vol from homeassistant import core as ha from homeassistant.const imp...
apache-2.0
tchellomello/home-assistant
homeassistant/components/broadlink/switch.py
7
10218
"""Support for Broadlink switches.""" from abc import ABC, abstractmethod import logging from broadlink.exceptions import BroadlinkException import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_OUTLET, DEVICE_CLASS_SWITCH, PLATFORM_SCHEMA, SwitchEntity, ) from homeassist...
apache-2.0
pan0007/test
doc/conf.py
8
1182
import sys import os sys.path.insert(0, os.path.abspath('../rpg')) AUTHORS = [u'See AUTHORS in RPG source distribution.'] extensions = ['sphinx.ext.autodoc'] source_suffix = '.rst' master_doc = 'index' project = u'rpg' copyright = u'2015, Red Hat, Licensed under GPLv2+' version = '0.0.1' release = '0.0.1' ex...
gpl-2.0
guaka/trust-metrics
trustlet/pymmetry/file_certs.py
1
9725
#!/usr/bin/env python """ file_certs.py: File-based Trust Metric Profiles (example code) Copyright (C) 2001 Luke Kenneth Casson Leighton <lkcl@samba-tng.org> 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 S...
gpl-2.0
varunarya10/nova_test_latest
nova/api/openstack/compute/plugins/v3/hide_server_addresses.py
36
2997
# Copyright 2012 OpenStack Foundation # 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 requ...
apache-2.0
kaplun/ops
modules/bibindex/lib/bibindex_engine_tokenizer_unit_tests.py
2
18405
# -*- coding:utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011, 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at you...
gpl-2.0
natduca/ndbg
util/vec2.py
1
3522
# Copyright 2011 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 agreed to in writing,...
apache-2.0
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/setuptools/command/setopt.py
130
5067
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import distutils import os from six.moves import configparser from setuptools import Command __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="local"): """Ge...
mit
thisisshi/cloud-custodian
tools/c7n_azure/c7n_azure/policy.py
2
21478
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import logging import re import time from azure.mgmt.eventgrid.models import \ StorageQueueEventSubscriptionDestination, StringInAdvancedFilter, EventSubscriptionFilter import jmespath from c7n_azure.azure_events import AzureEvents, A...
apache-2.0
abantam/pmtud
examples/wireless/wifi-ap.py
108
5883
# -*- Mode: Python; -*- # /* # * Copyright (c) 2005,2006,2007 INRIA # * Copyright (c) 2009 INESC Porto # * # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License version 2 as # * published by the Free Software Foundation; # * # * This p...
gpl-2.0
alisidd/tensorflow
tensorflow/contrib/keras/python/keras/layers/merge.py
17
18999
# 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
LiXizhi/NPLRuntime
Client/trunk/externals/assimp-4.0.0/port/PyAssimp/pyassimp/helper.py
6
10874
#-*- coding: UTF-8 -*- """ Some fancy helper functions. """ import os import ctypes from ctypes import POINTER import operator try: import numpy except: numpy = None import logging;logger = logging.getLogger("pyassimp") from .errors import AssimpError additional_dirs, ext_whitelist = [],[] # populate search dire...
gpl-2.0
caesar2164/edx-platform
lms/djangoapps/grades/new/course_grade.py
3
16576
""" CourseGrade Class """ from collections import defaultdict, namedtuple, OrderedDict from logging import getLogger from django.conf import settings from django.core.exceptions import PermissionDenied import dogstats_wrapper as dog_stats_api from lazy import lazy from lms.djangoapps.course_blocks.api import get_cou...
agpl-3.0
sorenk/ansible
lib/ansible/modules/cloud/vmware/vmware_guest_find.py
3
4040
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
KT26/PythonCourse
8. Class/8.py
1
1268
# Created by PyCharm Pro Edition # User: Kaushik Talukdar # Date: 24-04-17 # Time: 12:29 AM # INHERITANCE # We can create a new class, but instead of writing it from scratch, we can base it on an existing class. # Lets understand inheritance better with an exa...
mit
mjocean/PyProcGameHD-SkeletonGame
procgame/game/game.py
1
34216
import os import sys import pinproc import Queue import yaml import time import copy import logging from procgame import config from gameitems import * from procgame import util from mode import * from pdb import PDBConfig, LED from procgame import LEDs def config_named(name): if not os.path.isfile(name): # If we ...
mit
superberny70/pelisalacarta
python/main-classic/channels/datoporn.py
2
2506
# -*- coding: utf-8 -*- # ----------------------------------------------------------- # pelisalacarta - XBMC Plugin # Canal para Datoporn # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # ----------------------------------------------------------- from core import httptools from core import logger from core i...
gpl-3.0
Faeriol/news-summarizer
summarizer.py
1
3274
import os from goose3 import Goose from selenium import webdriver from selenium.common.exceptions import UnexpectedAlertPresentException, SessionNotCreatedException, WebDriverException from sumy.parsers.plaintext import PlaintextParser from sumy.nlp.tokenizers import Tokenizer from sumy.summarizers.lsa import LsaSummar...
mit
kaushik94/sympy
sympy/combinatorics/tests/test_testutil.py
129
1718
from sympy.combinatorics.named_groups import SymmetricGroup, AlternatingGroup,\ CyclicGroup from sympy.combinatorics.testutil import _verify_bsgs, _cmp_perm_lists,\ _naive_list_centralizer, _verify_centralizer,\ _verify_normal_closure from sympy.combinatorics.permutations import Permutation from sympy.combi...
bsd-3-clause
corerd/PyDomo
powerman/pwrmonitor.py
1
6768
#!/usr/bin/env python # # The MIT License (MIT) # # Copyright (c) 2019 Corrado Ubezio # # 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 r...
mit