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
Oliver2213/NVDAYoutube-dl
addon/globalPlugins/nvdaYoutubeDL/youtube_dl/aes.py
114
15203
from __future__ import unicode_literals import base64 from math import ceil from .utils import bytes_to_intlist, intlist_to_bytes BLOCK_SIZE_BYTES = 16 def aes_ctr_decrypt(data, key, counter): """ Decrypt with aes in counter mode @param {int[]} data cipher @param {int[]} key 16/24/3...
gpl-2.0
welex91/ansible-modules-core
web_infrastructure/apache2_module.py
6
3579
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013-2014, Christian Berendt <berendt@b1-systems.de> # # This module 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 o...
gpl-3.0
biemond/biemond-orawls
files/wlst/utils.py
1
7556
def create_boot_properties_file(directory_path, file_name, username, password): server_dir = File(directory_path) server_dir.mkdirs() full_file_name = directory_path + '/' + file_name file_new = open(full_file_name, 'w') file_new.write('username=%s\n' % username) file_new.write('password=%s\n'...
apache-2.0
LukasRychtecky/django-chamber
chamber/migrations/fixtures.py
1
1343
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os from six.moves import cStringIO from django.core.management import call_command from django.core.serializers import base, python class MigrationLoadFixture(object): def __init__(self, migration_file, fixture_dir=None, fixture_filename=N...
lgpl-3.0
Ritvik1512/namebench
nb_third_party/dns/rdtypes/IN/AAAA.py
248
2187
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
abcht/pattern
pattern/server/__init__.py
21
61640
#### PATTERN | SERVER ############################################################################## # -*- coding: utf-8 -*- # Copyright (c) 2014 University of Antwerp, Belgium # Copyright (c) 2014 St. Lucas University College of Art & Design, Antwerp. # Author: Tom De Smedt <tom@organisms.be> # License: BSD (see LICEN...
bsd-3-clause
web2py/pydal
pydal/dialects/couchdb.py
2
1390
from ..adapters.couchdb import CouchDB from .base import NoSQLDialect from . import dialects @dialects.register_for(CouchDB) class CouchDBDialect(NoSQLDialect): def _and(self, first, second, query_env={}): return "(%s && %s)" % ( self.expand(first, query_env=query_env), self.expand...
bsd-3-clause
jjingrong/PONUS-1.2
venv/Lib/site-packages/pip/baseparser.py
329
8162
"""Base option parser setup""" import sys import optparse import os import textwrap from distutils.util import strtobool from pip.backwardcompat import ConfigParser, string_types from pip.locations import default_config_file from pip.util import get_terminal_size, get_prog from pip._vendor import pkg_resources clas...
mit
sxjscience/tvm
python/tvm/relay/backend/vm.py
2
9793
# 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
LethusTI/supportcenter
vendor/django/django/contrib/gis/db/backends/spatialite/operations.py
78
14881
import re from decimal import Decimal from django.contrib.gis.db.backends.base import BaseSpatialOperations from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter from django.contrib.gis.geometry.backend import G...
gpl-3.0
golsun/GPS
src/ck/def_cheminp.py
1
2124
from def_build_mech_dict import * import os import shutil def rename_sp(sp_list): sp_list_new = [] for s in sp_list: sp_list_new.append(s.replace("(","-").replace(")","-").replace(",","-")) return sp_list_new def skeletal(detailed_folder, sk_folder, species_kept, notes=None): if not os.path.exists(sk_folder...
mit
betoesquivel/PLYpractice
env/lib/python2.7/site-packages/setuptools/dist.py
75
35307
__all__ = ['Distribution'] import re import os import sys import warnings import numbers import distutils.log import distutils.core import distutils.cmd import distutils.dist from distutils.core import Distribution as _Distribution from distutils.errors import (DistutilsOptionError, DistutilsPlatformError, Distuti...
mit
averagehat/scikit-bio
skbio/util/tests/test_misc.py
3
10592
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause
willingc/oh-mainline
vendor/packages/Django/tests/modeltests/raw_query/tests.py
59
8494
from __future__ import absolute_import from datetime import date from django.db.models.query_utils import InvalidQuery from django.test import TestCase from .models import Author, Book, Coffee, Reviewer, FriendlyAuthor class RawQueryTests(TestCase): fixtures = ['raw_query_books.json'] def assertSuccessful...
agpl-3.0
nash-x/hws
neutron/plugins/ryu/agent/ryu_neutron_agent.py
1
10548
#!/usr/bin/env python # Copyright 2012 Isaku Yamahata <yamahata at private email ne jp> # Based on openvswitch agent. # # Copyright 2011 VMware, 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 ma...
apache-2.0
NoelMacwan/kernel_sony_msm8x27
tools/perf/scripts/python/net_dropmonitor.py
4235
1554
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
alpeware/gcms
lib/oauth2client/contrib/multiprocess_file_storage.py
60
11679
# 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 ...
mit
t1g0r/ramey
src/backend/libs/telepot/async/__init__.py
1
18967
import io import json import time import asyncio import aiohttp import traceback import re from requests.utils import guess_filename from concurrent.futures._base import CancelledError import collections import telepot import telepot.async.helper from ..exception import BadFlavor, BadHTTPResponse, TelegramError def f...
gpl-3.0
ibis-project/ibis
ibis/backends/impala/tests/test_parquet_ddl.py
1
2838
from posixpath import join as pjoin import pytest import ibis from ibis.backends.impala.compat import HS2Error from ibis.tests.util import assert_equal pytestmark = pytest.mark.impala def test_cleanup_tmp_table_on_gc(con, test_data_dir): import gc hdfs_path = pjoin(test_data_dir, 'parquet/tpch_region') ...
apache-2.0
posemukkl/android_kernel_oneplus_msm8974
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
speed-of-light/pyslider
summ.py
1
9220
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> rks = [ "lib.exp.summ.storage", "lib.exp.summ"] reload_mods(rks) from lib.exp.summ import Mary mm = Mary() import warnings warnings.filterwarnings('ignore') # <codecell> #dc = mm.df_classify_perf(key="coverages_9") #saf = mm.df_rec_ans() if False...
agpl-3.0
michaelgugino/turbo-lister
jinja2/bccache.py
241
10996
# -*- coding: utf-8 -*- """ jinja2.bccache ~~~~~~~~~~~~~~ This module implements the bytecode cache system Jinja is optionally using. This is useful if you have very complex template situations and the compiliation of all those templates slow down your application too much. Situations whe...
gpl-3.0
VishvajitP/Django-facebook
django_facebook/signals.py
27
1132
from django.dispatch import Signal # Sent right after user is created facebook_user_registered = Signal(providing_args=['user', 'facebook_data']) # Sent after user is created, before profile is updated with data from Facebook facebook_pre_update = Signal( providing_args=['user', 'profile', 'facebook_data']) face...
bsd-3-clause
riverma/climate
ocw-ui/backend/tests/test_directory_helpers.py
12
6632
# 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
chirilo/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/workspace_unittest.py
124
3610
# 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 f...
bsd-3-clause
rogerthat-platform/rogerthat-backend
src/mcfw/exceptions.py
1
2422
# -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # 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...
apache-2.0
benschmaus/catapult
telemetry/telemetry/internal/results/page_test_results.py
1
15233
# 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. import collections import copy import datetime import json import logging import os import random import sys import tempfile import time import traceback fr...
bsd-3-clause
omergertel/flux
doc/conf.py
2
7915
# -*- coding: utf-8 -*- # # flux documentation build configuration file, created by # sphinx-quickstart on Thu Apr 25 12:00:38 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
bsd-3-clause
ingadhoc/odoo-infrastructure
infrastructure/models/mailserver.py
1
1038
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import models, fields class mailser...
agpl-3.0
gebart/RIOT
dist/tests/if_lib/philip_if.py
3
22519
# Copyright (C) 2018 Kevin Weiss <kevin.weiss@haw-hamburg.de> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. """@package PyToAPI This module handles offset and sizes dictated by the memory map for ...
lgpl-2.1
noskill/virt-manager
tests/storage.py
1
8815
# Copyright (C) 2013 Red Hat, 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 2 of the License, or # (at your option) any later version. # # This program is distributed in ...
gpl-2.0
alrifqi/django
tests/template_tests/test_context.py
166
5389
# -*- coding: utf-8 -*- from django.http import HttpRequest from django.template import ( Context, Engine, RequestContext, Template, Variable, VariableDoesNotExist, ) from django.template.context import RenderContext from django.test import RequestFactory, SimpleTestCase class ContextTests(SimpleTestCase): ...
bsd-3-clause
enoodle/virt-deploy
virtdeploy/test_cli.py
3
8249
# # Copyright 2015 Red Hat, 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 2 of the License, or # (at your option) any later version. # # This program is distributed in th...
gpl-2.0
voidfiles/ansible-1
test/units/executor/test_task_executor.py
69
10274
# (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
free2000fly/shadowsocks
shadowsocks/daemon.py
386
5602
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2014-2015 clowwindy # # 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 requi...
apache-2.0
jilljenn/tryalgo
tryalgo/subsetsum_divide.py
1
2217
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """\ Subsetsum by splitting christoph dürr et jill-jênn vie - 2014-2019 """ # snip{ def part_sum(x_table, i=0): """All subsetsums from x_table[i:] :param x_table: table of values :param int i: index_table defining suffix_table of x_table to be considered ...
mit
git-artes/GNUWiNetwork
gwn/utils/framers/ieee80211/mac_frmspecs.py
2
11956
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of GNUWiNetwork, # Copyright (C) 2014 by # Pablo Belzarena, Gabriel Gomez Sena, Victor Gonzalez Barbone, # Facultad de Ingenieria, Universidad de la Republica, Uruguay. # # GNUWiNetwork is free software: you can redistribute it ...
gpl-3.0
fabiocerqueira/django-allauth
allauth/socialaccount/providers/google/provider.py
59
1970
from allauth.account.models import EmailAddress from allauth.socialaccount import providers from allauth.socialaccount.providers.base import (ProviderAccount, AuthAction) from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider from allauth.socialaccou...
mit
grahamhayes/designate
contrib/tempest/dns_clients/json/records_client.py
9
3252
# Copyright 2014 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/LICENSE-2....
apache-2.0
plum-umd/java-sketch
jskparser/ast/body/variabledeclarator.py
1
1508
#!/usr/bin/env python from . import _import from ..node import Node class VariableDeclarator(Node): def __init__(self, kwargs={}): if kwargs.get(u'id', ''): super(VariableDeclarator, self).__init__(kwargs) locs = _import() # VariableDeclaratorId self._id =...
mit
dims/cinder
cinder/wsgi/wsgi.py
1
1253
# 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 # di...
apache-2.0
Nikoala/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/metacafe.py
40
10132
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urllib_parse, compat_urllib_request, ) from ..utils import ( determine_ext, ExtractorError, int_or_none, ) class MetacafeIE(InfoExtractor): _VALID_URL = r'ht...
gpl-3.0
gurneyalex/purchase-workflow
__unported__/framework_agreement/tests/test_framework_agreement_on_change.py
4
9448
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # 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 # publi...
agpl-3.0
pet1330/strands_qsr_lib
qsr_lib/tests/mwe_tester.py
8
1416
#!/usr/bin/env python from __future__ import print_function, division import sys from abstractclass_unittest_dyadic import Abstractclass_Unittest_Dyadic class MWE_Test(Abstractclass_Unittest_Dyadic): def __init__(self, *args): super(MWE_Test, self).__init__(*args) self._unique_id = "mwe" def ...
mit
lithiumoxide/scical
astronomy.py
1
1465
# astronomy.py 12.10.3 from math import * G = 6.673e-11 c = 2.998e8 H = 80 # km/s/Mpc v = 0 relg = 1/(sqrt(1-((v/c)**2))) def gforce(m1, m2, r): ''' (int, int, int) -> int Calculates gravitational force between masses m1 and m2 (kg) at a separation of r (m). ''' global G return str((G*m1*m2)/(r**2)) + ' N' ...
gpl-3.0
ghisvail/vispy
vispy/io/mesh.py
7
2324
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Reading and writing of data like images and meshes. """ from os import path as op from .wavefront import WavefrontReader, WavefrontWriter def read_mesh(fname): """...
bsd-3-clause
bcicen/multicrane
multicrane/crane.py
1
1817
#!/usr/bin/env python import os, yaml, urllib2, logging, termcolor from sh import crane from util import randomcolor log = logging.getLogger() class CraneConfig(object): def __init__(self, cranefile): """ CraneConfig object """ self.txtcolor = randomcolor() self.cranefile...
mit
LIKAIMO/MissionPlanner
Lib/rfc822.py
58
34306
"""RFC 2822 message manipulation. Note: This is only a very rough sketch of a full RFC-822 parser; in particular the tokenizing of addresses does not adhere to all the quoting rules. Note: RFC 2822 is a long awaited update to RFC 822. This module should conform to RFC 2822, and is thus mis-named (it's not wort...
gpl-3.0
giggsey/SickRage
lib/babelfish/converters/__init__.py
71
9253
# Copyright (c) 2013 the BabelFish authors. All rights reserved. # Use of this source code is governed by the 3-clause BSD license # that can be found in the LICENSE file. # import collections from pkg_resources import iter_entry_points, EntryPoint from ..exceptions import LanguageConvertError, LanguageReverseError #...
gpl-3.0
danielneis/osf.io
website/addons/figshare/tests/utils.py
53
4566
import mock from website.addons.figshare.api import Figshare article = {u'count': 1, u'items': [{u'status': u'Draft', u'files': [{u'thumb': None, u'download_url': u'http://files.figshare.com/1348803/0NUTZ', u'name': u'0NUTZ', u'id': 1348803, u'mime_type': u'text/plain', u'size': u'0 KB'}, {u'thumb': None, u'download_...
apache-2.0
bengosney/romrescue.org
dogs/migrations/0015_auto_20170825_2005.py
1
4585
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2017-08-25 20:05 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dogs', '0014_dog_cost'), ] operations = [ migrations.AlterField( ...
gpl-3.0
geerlingguy/ansible-modules-extras
system/ohai.py
86
1695
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
gpl-3.0
MaDKaTZe/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/watchlist/amountchangedpattern_unittest.py
124
3350
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
jammerful/buildbot
master/buildbot/changes/mail.py
6
19456
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
fevxie/odoo
addons/sale_stock/__openerp__.py
214
2553
# -*- 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
Sonicbids/django
django/db/backends/mysql/schema.py
18
2871
from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.models import NOT_PROVIDED class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_rename_table = "RENAME TABLE %(old_table)s TO %(new_table)s" sql_alter_column_null = "MODIFY %(column)s %(type)s NULL" sql_alter_column_...
bsd-3-clause
alexbrasetvik/Piped
contrib/zookeeper/piped_zookeeper/providers.py
1
20750
# Copyright (c) 2011, Found IT A/S and Piped Project Contributors. # See LICENSE for details. import base64 import logging import hashlib import itertools import operator import zookeeper from zope import interface from twisted.application import service from twisted.python import failure from twisted.internet import ...
mit
timkrentz/SunTracker
IMU/VTK-6.2.0/Filters/Hybrid/Testing/Python/banana.py
2
2883
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # use a sphere as a basis of the shape sphere = vtk.vtkSphereSource() sphere.SetPhiResolution(40) sphere.SetThetaResolution(40) sphere.Update() sphereData = sphere.GetOutpu...
mit
XristosMallios/cache
exareme-tools/madis/src/lib/chardet/codingstatemachine.py
212
2178
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
littletiny/generator
struct_nest_parser.py
2
14305
# -*- coding:utf-8 -*- from lepl import * # TODO json不是以{}开头 import traceback from mako.template import Template as tp def __function__(): stack = traceback.extract_stack() (filename, line, procname, text) = stack[-2] return procname class field_type(object): def __init__(self): pass def ...
mit
iarroyof/lxmls-toolkit
lxmls/labs/day4.py
3
1229
###### Exercises for lab day 4 Parsing. import sys sys.path.append('.') import lxmls.parsing.dependency_parser as depp import pdb print "Exercise 4.3.1" dp = depp.DependencyParser() dp.read_data("portuguese") goon = raw_input("Enter to go on to next exercise:") print "Exercise 4.3.2" dp.train_perceptron(10) dp.t...
mit
mzizzi/ansible
test/units/playbook/test_included_file.py
145
3975
# (c) 2016, Adrian Likins <alikins@redhat.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 vers...
gpl-3.0
gurneyalex/hr
__unported__/hr_schedule/wizard/compute_alerts.py
28
2821
# -*- coding:utf-8 -*- # # # Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, eit...
agpl-3.0
metno/EVA
eva/rest/resources.py
1
6034
import eva import eva.globe import eva.job import eva.rest.resources import productstatus.exceptions import datetime import falcon class BaseResource(eva.globe.GlobalMixin): def set_eventloop_instance(self, eventloop): self.eventloop = eventloop def set_response_message(self, req, message): ...
gpl-2.0
timvideos/flumotion
flumotion/component/encoders/dirac/dirac.py
3
2332
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # # This file may be distributed and/or modified under the terms of # the GNU Lesser General Pub...
lgpl-2.1
gorkinovich/DefendersOfMankind
dependencies/boost-1.46.0/tools/build/v2/tools/gcc.py
10
35928
# Status: being ported by Steven Watanabe # Base revision: 47077 # TODO: common.jam needs to be ported # TODO: generators.jam needs to have register_c_compiler. # # Copyright 2001 David Abrahams. # Copyright 2002-2006 Rene Rivera. # Copyright 2002-2003 Vladimir Prus. # Copyright (c) 2005 Reece H. Dunn. # Copyright 200...
gpl-3.0
hejuna/bite-project
deps/gdata-python-client/src/gdata/apps/groups/client.py
53
11884
#!/usr/bin/python2.4 # # Copyright 2011 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 ...
apache-2.0
leshchevds/ganeti
test/py/testutils_ssh.py
1
28653
#!/usr/bin/python # # Copyright (C) 2010, 2013, 2015 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: # # 1. Redistributions of source code must retain the above copyright notice, # ...
bsd-2-clause
lebabouin/CouchPotatoServer-develop
libs/sqlalchemy/__init__.py
18
2016
# sqlalchemy/__init__.py # Copyright (C) 2005-2013 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 import inspect import sys import sqlalchemy.exc as exceptions from sqlalchemy...
gpl-3.0
hkariti/ansible
lib/ansible/utils/module_docs_fragments/rackspace.py
168
4206
# (c) 2014, Matt Martz <matt@sivel.net> # # 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. # ...
gpl-3.0
sharad/calibre
src/calibre/gui2/preferences/columns.py
1
7594
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import copy, sys from PyQt5.Qt import Qt, QListWidgetItem, QIcon from calibre.gui2.preferences import ConfigWidgetBase, t...
gpl-3.0
alex4108/scLikesDownloader
soundcloud/resource.py
4
1734
try: import json except ImportError: import simplejson as json from UserList import UserList class Resource(object): """Object wrapper for resources. Provides an object interface to resources returned by the Soundcloud API. """ def __init__(self, obj): self.obj = obj def __getst...
gpl-2.0
michaupl/materialsapp
forms/migrations/0003_set_type_on_subcategory.py
1
5162
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Don't use "from appname.models imp...
apache-2.0
USGSDenverPychron/pychron
pychron/experiment/image_browser.py
1
9889
# =============================================================================== # Copyright 2012 Jake Ross # # 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/licens...
apache-2.0
bioinformatics-IBCH/logloss-beraf
logloss_beraf/model_ops/trainer.py
1
12714
# coding=utf-8 import copy import logging import os # https://github.com/matplotlib/matplotlib/issues/3466/#issuecomment-195899517 import itertools import matplotlib matplotlib.use('agg') import numpy as np import pandas from sklearn import ( preprocessing, model_selection, ) from sklearn.cross_validation imp...
gpl-3.0
wetneb/django
django/contrib/gis/geos/prototypes/misc.py
103
1381
""" This module is for the miscellaneous GEOS routines, particularly the ones that return the area, distance, and length. """ from ctypes import POINTER, c_double, c_int from django.contrib.gis.geos.libgeos import GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import check_dbl, check_string from django.co...
bsd-3-clause
skyddv/neutron
neutron/agent/l3/ha.py
13
6204
# Copyright (c) 2014 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...
apache-2.0
Just-D/chromium-1
tools/perf/page_sets/tough_energy_cases.py
35
4626
# 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. from telemetry.page import page as page_module from telemetry import story class ToughEnergyCasesPage(page_module.Page): def __init__(self, url, page_set...
bsd-3-clause
arximboldi/pigeoncide
src/phys/geom.py
1
1351
# # Copyright (C) 2009 Juan Pedro Bolivar Puente, Alberto Villegas Erce # # This file is part of Pigeoncide. # # Pigeoncide 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 # Lic...
gpl-3.0
Ryanglambert/pybrain
pybrain/rl/learners/valuebased/qlambda.py
31
1396
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de' from pybrain.rl.learners.valuebased.valuebased import ValueBasedLearner class QLambda(ValueBasedLearner): """ Q-lambda is a variation of Q-learning that uses an eligibility trace. """ offPolicy = True batchMode = False def __init__(self, alpha=0...
bsd-3-clause
NixaSoftware/CVis
venv/lib/python2.7/site-packages/wheel/signatures/__init__.py
70
3766
""" Create and verify jws-js format Ed25519 signatures. """ import json from ..util import urlsafe_b64decode, urlsafe_b64encode, native, binary __all__ = ['sign', 'verify'] ed25519ll = None ALG = "Ed25519" def get_ed25519ll(): """Lazy import-and-test of ed25519 module""" global ed25519ll if not ed255...
apache-2.0
BevoLJ/KRPC
Lagadha/Lunar_XFer_Manager.py
1
6215
import numpy as np import time # from numba import jit from Orbit_Manager import OrbitManager class LunarXFerManager(OrbitManager): def __init__(self): super().__init__() self.mode = "LEO" self.earth = self.KSC.bodies['Earth'] self.moon = self.KSC.bodies['Moon'].orbit # ...
mit
glwu/python-for-android
python3-alpha/python3-src/Lib/encodings/rot_13.py
55
2454
#!/usr/bin/env python """ Python Character Mapping Codec for ROT13. This codec de/encodes from str to str and is therefore usable with str.transform() and str.untransform(). Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self, input, erro...
apache-2.0
dylwhich/schedule
setup.py
2
1254
import codecs import os import sys from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload -r pypi') sys.exit() SCHEDULE_VERSION = '0.3.1' SCHEDULE_DOWNLOAD_URL = ( 'https://github.com/dbader/schedule/tarball/' + SCHEDULE_VERSION ) def read_file(filename): ...
mit
zachjanicki/osf.io
tests/test_spam_mixin.py
20
4845
from __future__ import absolute_import from datetime import datetime from nose.tools import * # noqa PEP8 asserts from modularodm.exceptions import ValidationValueError, ValidationTypeError from framework.auth import Auth from tests.base import OsfTestCase from tests.factories import UserFactory, CommentFactory cl...
apache-2.0
michaelsmit/openparliament
parliament/hansards/models.py
1
21145
#coding: utf-8 import gzip, os, re from collections import defaultdict import datetime from django.db import models from django.conf import settings from django.core import urlresolvers from django.core.files.base import ContentFile from django.template.defaultfilters import slugify from django.utils.datastructures i...
agpl-3.0
softelnet/sponge
sponge-midi/examples/midi/midi_generate_sound.py
1
1294
""" Sponge Knowledge Base MIDI generate sound """ from javax.sound.midi import ShortMessage from org.openksavi.sponge.midi import MidiUtils class SameSound(Trigger): def onConfigure(self): self.withEvent("midiShort") def onRun(self, event): midi.sound(event.message) class Log(Trigger): de...
apache-2.0
ax003d/openerp
openerp/addons/l10n_es/__openerp__.py
86
2661
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2008-2010 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved. # Jordi Esteve <jesteve@zikzakmedia.com> # Copy...
agpl-3.0
rnixx/python-for-android
pythonforandroid/build.py
3
40694
from os.path import ( abspath, join, realpath, dirname, expanduser, exists, split, isdir ) from os import environ import copy import os import glob import sys import re import sh import shutil import subprocess from contextlib import suppress from pythonforandroid.util import ( current_directory, ensure_di...
mit
chromium2014/src
tools/diagnose-me.py
128
3534
#!/usr/bin/python # 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. """Diagnose some common system configuration problems on Linux, and suggest fixes.""" import os import subprocess import sys all_chec...
bsd-3-clause
faywong/FFPlayer
project/jni/python/src/Lib/plat-mac/Carbon/Components.py
81
2301
# Generated from 'Components.h' def FOUR_CHAR_CODE(x): return x kAppleManufacturer = FOUR_CHAR_CODE('appl') kComponentResourceType = FOUR_CHAR_CODE('thng') kComponentAliasResourceType = FOUR_CHAR_CODE('thga') kAnyComponentType = 0 kAnyComponentSubType = 0 kAnyComponentManufacturer = 0 kAnyComponentFlagsMask = 0 cmpIsM...
lgpl-2.1
noam09/deluge-telegramer
telegramer/include/future/backports/email/__init__.py
83
2269
# Copyright (C) 2001-2007 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """ Backport of the Python 3.3 email package for Python-Future. A package for parsing, handling, and generating email messages. """ from __future__ import unicode_literals from __future__ import division from _...
gpl-3.0
rapidhere/open-hackathon
open-hackathon-client/src/client/user/user.py
6
1954
# -*- coding: utf-8 -*- """ Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd.  All rights reserved. The MIT License (MIT) 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 restr...
mit
quattor/aquilon
tests/broker/test_add_required_service.py
1
16213
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance...
apache-2.0
adrienbrault/home-assistant
homeassistant/components/pi_hole/__init__.py
4
5042
"""The pi_hole component.""" import asyncio import logging from hole import Hole from hole.exceptions import HoleError import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const import ( CONF_API_KEY, CONF_HOST, CONF_NAME, CONF_SSL, CONF_VERIFY_SSL, ) ...
mit
dims/heat
heat_integrationtests/functional/test_purge.py
3
1934
# 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 # d...
apache-2.0
vpelletier/neoppod
neo/scripts/simple.py
1
2244
#!/usr/bin/env python # # Copyright (C) 2011-2016 Nexedi SA # # 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 ...
gpl-2.0
rd37/horizon
openstack_dashboard/dashboards/project/networks/tables.py
8
3864
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 NEC Corporation # # 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 #...
apache-2.0
tomlof/scikit-learn
sklearn/utils/tests/test_linear_assignment.py
421
1349
# Author: Brian M. Clapper, G Varoquaux # License: BSD import numpy as np # XXX we should be testing the public API here from sklearn.utils.linear_assignment_ import _hungarian def test_hungarian(): matrices = [ # Square ([[400, 150, 400], [400, 450, 600], [300, 225, 300]], ...
bsd-3-clause
dwong/Tag-Music-Organizer
TagMusicOrganizer.py
1
6734
# TagMusicOrganizer.py # # Parse id3 tags for mp3 # Put into target directory with the format # # Artist/ # Album/ # NN. Artist - Title import sys import os import eyed3 import glob import argparse import re import configparser config = configparser.ConfigParser() config.readfp(open(os.path.dirname(os.path.real...
gpl-3.0