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 |
|---|---|---|---|---|---|
zstars/weblabdeusto | server/src/weblab/core/coordinator/scheduler_transactions_synchronizer.py | 3 | 4486 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... | bsd-2-clause |
hobu/arbiter | third/gtest-1.7.0/test/gtest_color_test.py | 3259 | 4911 | #!/usr/bin/env python
#
# Copyright 2008, 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... | mit |
opencord/voltha | ofagent/main.py | 1 | 9975 | #!/usr/bin/env python
#
# Copyright 2017 the original author or authors.
#
# 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 require... | apache-2.0 |
giannisfs/Vault | vault/qrc_resources.py | 1 | 335309 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: ??? ??? 21 00:36:17 2012
# by: The Resource Compiler for PyQt (Qt v4.7.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x01\x2b\xe6\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x... | gpl-3.0 |
gsvaldevieso/tempo-certo | app/node_modules/node-gyp/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | gpl-3.0 |
KNMI/VERCE | verce-hpc-pe/src/networkx/algorithms/centrality/tests/test_closeness_centrality.py | 84 | 2746 | """
Tests for degree centrality.
"""
from nose.tools import *
import networkx as nx
class TestClosenessCentrality:
def setUp(self):
self.K = nx.krackhardt_kite_graph()
self.P3 = nx.path_graph(3)
self.P4 = nx.path_graph(4)
self.K5 = nx.complete_graph(5)
self.C4=nx.cycle_gra... | mit |
apagac/robottelo | tests/foreman/ui/test_operatingsys.py | 2 | 19232 | # -*- encoding: utf-8 -*-
"""Test class for Operating System UI"""
from ddt import ddt
from fauxfactory import gen_string
from robottelo import entities
from robottelo.common.constants import (
INSTALL_MEDIUM_URL, PARTITION_SCRIPT_DATA_FILE)
from robottelo.common.decorators import data
from robottelo.common.decora... | gpl-3.0 |
clovis/PhiloLogic4 | www/webApp.py | 2 | 7294 | #!/usr/bin/env python3
"""Bootstrap Web app"""
import os.path
from philologic.runtime import WebConfig
from philologic.runtime import WSGIHandler
from philologic.runtime import access_control
from philologic.utils import load_module
config = WebConfig(os.path.abspath(os.path.dirname(__file__)))
global_config = load... | gpl-3.0 |
fiuba08/robotframework | src/robot/libraries/Collections.py | 3 | 29511 | # Copyright 2008-2014 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 |
edxnercel/edx-platform | common/djangoapps/microsite_configuration/tests/test_microsites.py | 187 | 1186 | # -*- coding: utf-8 -*-
"""
Tests microsite_configuration templatetags and helper functions.
"""
from django.test import TestCase
from django.conf import settings
from microsite_configuration.templatetags import microsite
class MicroSiteTests(TestCase):
"""
Make sure some of the helper functions work
"""
... | agpl-3.0 |
ludojmj/treelud | server/paramiko/sftp_client.py | 1 | 32863 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of Paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License,... | mit |
ksmaheshkumar/weevely3 | core/vectors.py | 12 | 9253 | """
The module `core.vectors` defines the following vectors classes.
* `ModuleExec` vector executes a given module with given arguments.
* `PhpCode` vector contains PHP code, executed via `shell_php` module.
* `PhpFile` vector loads PHP code from an external file, and execute it via `shell_php` module.
* `ShellCmd` ve... | gpl-3.0 |
pigshell/nhnick | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/stack_utils_unittest.py | 124 | 2709 | # 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 |
likelyzhao/mxnet | example/reinforcement-learning/parallel_actor_critic/model.py | 15 | 4253 | from itertools import chain
import numpy as np
import scipy.signal
import mxnet as mx
class Agent(object):
def __init__(self, input_size, act_space, config):
super(Agent, self).__init__()
self.input_size = input_size
self.num_envs = config.num_envs
self.ctx = config.ctx
sel... | apache-2.0 |
vmturbo/nova | nova/config.py | 5 | 1949 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the ... | apache-2.0 |
peastman/deepchem | examples/tox21/tox21_IRV.py | 6 | 1286 | """
Script that trains multitask models on Tox21 dataset.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import shutil
import numpy as np
import deepchem as dc
import time
from deepchem.molnet import load_tox21
# Only for debug!
np.random.se... | mit |
endorphinl/horizon | openstack_dashboard/dashboards/project/routers/extensions/routerrules/tables.py | 51 | 2806 | # Copyright 2013, Big Switch 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 applicabl... | apache-2.0 |
wehkamp/ansible-modules-core | cloud/amazon/ec2_elb_lb.py | 7 | 33856 | #!/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 |
arista-eosplus/pyeapi | test/system/test_api_ospf.py | 1 | 9101 | #
# Copyright (c) 2016, Arista Networks, 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 condit... | bsd-3-clause |
praekelt/txtalert | txtalert/apps/gateway/migrations/0002_auto__add_field_sendsms_group__add_field_pleasecallme_group.py | 1 | 4637 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# all previous data belongs to Temba Lethu Clinic
from django.contrib.auth.models import Group
gro... | gpl-3.0 |
M4rtinK/pyside-android | tests/QtCore/qflags_test.py | 6 | 3405 | #!/usr/bin/python
'''Test cases for QFlags'''
import unittest
from PySide.QtCore import Qt, QTemporaryFile, QFile, QIODevice, QObject
class QFlagTest(unittest.TestCase):
'''Test case for usage of flags'''
def testCallFunction(self):
f = QTemporaryFile()
self.assertTrue(f.open())
fileN... | lgpl-2.1 |
Azulinho/ansible | lib/ansible/utils/module_docs_fragments/openstack.py | 133 | 3961 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... | gpl-3.0 |
pombredanne/MOG | tools/regression_tester.py | 14 | 3537 | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 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
#
... | apache-2.0 |
rghe/ansible | test/runner/lib/sanity/sanity_docs.py | 78 | 1312 | """Sanity test for documentation of sanity tests."""
from __future__ import absolute_import, print_function
import os
from lib.sanity import (
SanitySingleVersion,
SanityMessage,
SanityFailure,
SanitySuccess,
sanity_get_tests,
)
from lib.config import (
SanityConfig,
)
class SanityDocsTest(... | gpl-3.0 |
DazWorrall/ansible | hacking/report.py | 46 | 6657 | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""A tool to aggregate data about Ansible source and testing into a sqlite DB for reporting."""
from __future__ import (absolute_import, print_function)
import argparse
import os
import requests
import sqlite3
import sys
DATABASE_PATH = os.path.expanduser('~/.ansible/rep... | gpl-3.0 |
nohe427/developer-support | arcsde-sql/python/create-sdo-geometry-golden-ratio/golden.py | 10 | 2731 | """
In Oracle 12c, using the SDO Geometry type, this script will create the
polygons from the golden ratio spiral.
Authors:
Danny B
-- original concept and code
-- added and subtracted coordinates to generate new polygons
Ashley S
-- cleared up rough spots by using phi to create perfect... | apache-2.0 |
awanga/tuna-kernel | tools/perf/util/setup.py | 2079 | 1438 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
plotly/plotly.py | packages/python/plotly/plotly/validators/mesh3d/__init__.py | 1 | 6255 | import sys
if sys.version_info < (3, 7):
from ._zsrc import ZsrcValidator
from ._zhoverformat import ZhoverformatValidator
from ._zcalendar import ZcalendarValidator
from ._z import ZValidator
from ._ysrc import YsrcValidator
from ._yhoverformat import YhoverformatValidator
from ._ycalendar... | mit |
lizardsystem/freq | freq/lizard_connector.py | 1 | 30266 | import copy
import datetime as dt
import json
import logging
from pprint import pprint # left here for debugging purposes
from time import time
from time import sleep
import urllib
import numpy as np
import django.core.exceptions
from freq import jsdatetime
try:
from django.conf import settings
USR, PWD = se... | gpl-3.0 |
heyavery/lopenr | venv/lib/python2.7/site-packages/django/contrib/gis/db/models/aggregates.py | 414 | 2395 | from django.contrib.gis.db.models.fields import ExtentField
from django.db.models.aggregates import Aggregate
__all__ = ['Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union']
class GeoAggregate(Aggregate):
function = None
is_extent = False
def as_sql(self, compiler, connection):
# this will be c... | mit |
steventimberman/masterDebater | env/lib/python2.7/site-packages/django/db/backends/base/operations.py | 44 | 23686 | import datetime
import decimal
import warnings
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import utils
from django.utils import six, timezone
from django.utils.dateparse import parse_duration
from django.utils.dep... | mit |
brothaedhung/external_chromium | net/tools/testserver/asn1der.py | 67 | 1324 | #!/usr/bin/python2.5
# Copyright (c) 2011 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.
"""Helper module for ASN.1/DER encoding."""
import binascii
import struct
# Tags as defined by ASN.1.
INTEGER = 2
BIT_STRING = 3
N... | bsd-3-clause |
lucashmorais/x-Bench | mozmill-env/python/Lib/site-packages/mercurial/sshpeer.py | 90 | 7356 | # sshpeer.py - ssh repository proxy class for mercurial
#
# Copyright 2005, 2006 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 re
from i18n import _
import util, error, wireproto
class remo... | mit |
j0nathan33/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/kickstarter.py | 9 | 2230 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class KickStarterIE(InfoExtractor):
_VALID_URL = r'https?://www\.kickstarter\.com/projects/(?P<id>[^/]*)/.*'
_TESTS = [{
'url': 'https://www.kickstarter.com/projects/1404461844/intersection-the-stor... | gpl-3.0 |
mne-tools/mne-python | mne/preprocessing/realign.py | 1 | 4237 | # -*- coding: utf-8 -*-
# Authors: Eric Larson <larson.eric.d@gmail.com>
# License: BSD (3-clause)
import numpy as np
from numpy.polynomial.polynomial import Polynomial
from ..io import BaseRaw
from ..utils import _validate_type, warn, logger, verbose
@verbose
def realign_raw(raw, other, t_raw, t_other, verbose=No... | bsd-3-clause |
andela-ooladayo/django | tests/template_tests/filter_tests/test_dictsortreversed.py | 342 | 1066 | from django.template.defaultfilters import dictsortreversed
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_sort(self):
sorted_dicts = dictsortreversed(
[{'age': 23, 'name': 'Barbara-Ann'},
{'age': 63, 'name': 'Ra Ra Rasputin'},
{... | bsd-3-clause |
asmacdo/pulp-automation | tests/general_tests/test_06_roles.py | 2 | 6147 | import unittest, json
from tests import pulp_test
from pulp_auto import Pulp
from pulp_auto.role import Role
from pulp_auto.user import User
from pulp_auto.repo import Repo
def setUpModule():
pass
class RoleTest(pulp_test.PulpTest):
@classmethod
def setUpClass(cls):
super(RoleTest, cls).setUpCla... | gpl-2.0 |
jamii/inkling | jottinks/src/NoteTree2.py | 1 | 4804 | """
Copyright 2008 Jamie Brandon, Mark Haines
This file is part of jottinKs.
JottinKs 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 late... | gpl-3.0 |
ovnicraft/edx-platform | lms/djangoapps/instructor_task/models.py | 24 | 16357 | """
WE'RE USING MIGRATIONS!
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py schemamigration instructor_task --auto description_of_your_change
3. Add the migration file cr... | agpl-3.0 |
LuminateWireless/grpc | src/python/grpcio_tests/tests/unit/framework/interfaces/face/_future_invocation_asynchronous_event_service.py | 23 | 25112 | # Copyright 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
raphaelmerx/django | tests/view_tests/tests/test_debug.py | 99 | 40145 | # -*- coding: utf-8 -*-
# This coding header is significant for tests, as the debug view is parsing
# files to search for such a header to decode the source file content
from __future__ import unicode_literals
import importlib
import inspect
import os
import re
import sys
import tempfile
from unittest import skipIf
f... | bsd-3-clause |
sharad/calibre | src/calibre/ebooks/metadata/sources/big_book_search.py | 8 | 2177 | #!/usr/bin/env python
# vim:fileencoding=UTF-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.ebooks.metadata.sources.bas... | gpl-3.0 |
fidomason/kbengine | kbe/src/lib/python/Lib/contextlib.py | 83 | 11648 | """Utilities for with-statement contexts. See PEP 343."""
import sys
from collections import deque
from functools import wraps
__all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack",
"redirect_stdout", "suppress"]
class ContextDecorator(object):
"A base class or mixin that enables c... | lgpl-3.0 |
brianjimenez/lightdock | lightdock/scoring/dfire2/driver.py | 1 | 7814 | """DFIRE2 potential scoring function
Yuedong Yang, Yaoqi Zhou. Ab initio folding of terminal segments with secondary structures
reveals the fine difference between two closely related all-atom statistical energy functions.
Protein Science,17:1212-1219(2008)
"""
import os
import numpy as np
from lightdock.structure.mo... | gpl-3.0 |
Osokorn/tgstation | tools/midi2piano/pyperclip/windows.py | 110 | 5405 | """
This module implements clipboard handling on Windows using ctypes.
"""
import time
import contextlib
import ctypes
from ctypes import c_size_t, sizeof, c_wchar_p, get_errno, c_wchar
from .exceptions import PyperclipWindowsException
class CheckedCall(object):
def __init__(self, f):
super(CheckedCall, s... | agpl-3.0 |
MediaBrowser/MediaBrowser.Kodi | default.py | 2 | 1454 | '''
@document : default.py
@package : XBMB3C add-on
@authors : xnappo, null_pointer, im85288
@copyleft : 2013, xnappo
@license : Gnu General Public License - see LICENSE.TXT
@description: XBMB3C XBMC add-on
This file is part of the XBMC XBMB3C Plugin.
XBMB3C Plugin is fre... | gpl-2.0 |
moraesnicol/scrapy | scrapy/settings/deprecated.py | 160 | 1383 | import warnings
from scrapy.exceptions import ScrapyDeprecationWarning
DEPRECATED_SETTINGS = [
('TRACK_REFS', 'no longer needed (trackref is always enabled)'),
('RESPONSE_CLASSES', 'no longer supported'),
('DEFAULT_RESPONSE_ENCODING', 'no longer supported'),
('BOT_VERSION', 'no longer used (user agent ... | bsd-3-clause |
liaorubei/depot_tools | third_party/pylint/checkers/similar.py | 64 | 14174 | # pylint: disable=W0622
# Copyright (c) 2004-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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 ver... | bsd-3-clause |
Tesora/tesora-tempest | tempest/tests/test_list_tests.py | 34 | 1824 | # Copyright 2013 IBM Corp.
#
# 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 t... | apache-2.0 |
mvaled/sentry | src/sentry/message_filters.py | 1 | 16944 | # TODO RaduW 8.06.2019 remove the sentry.filters package and rename this module to filters
from __future__ import absolute_import
import collections
from collections import namedtuple
import re
from sentry.models.projectoption import ProjectOption
from sentry.utils.data_filters import FilterStatKeys
from rest_framewo... | bsd-3-clause |
eResearchSA/reporting-storage-hcp | ersa_storage_hcp/__init__.py | 1 | 5549 | #!/usr/bin/python3
"""Application and persistence management."""
# pylint: disable=no-member, import-error, no-init, too-few-public-methods
# pylint: disable=cyclic-import, no-name-in-module, invalid-name
import os
from flask import Flask
from flask.ext import restful
from flask.ext.cors import CORS
from flask.ext.s... | apache-2.0 |
Elico-Corp/odoo_OCB | addons/l10n_multilang/l10n_multilang.py | 10 | 5981 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import api, models, SUPERUSER_ID
import logging
_logger = logging.getLogger(__name__)
class AccountChartTemplate(models.Model):
_inherit = 'account.chart.template'
@api.multi
def process_transl... | agpl-3.0 |
analurandis/Tur | backend/venv/Lib/site-packages/Cheetah/Tools/CGITemplate.py | 15 | 2200 | # $Id: CGITemplate.py,v 1.6 2006/01/29 02:09:59 tavis_rudd Exp $
"""A subclass of Cheetah.Template for use in CGI scripts.
Usage in a template:
#extends Cheetah.Tools.CGITemplate
#implements respond
$cgiHeaders#slurp
Usage in a template inheriting a Python class:
1. The template
#extends MyPythonClass... | mit |
TraurigeNarr/ThirdParties | assimp-3.2/test/regression/gen_db.py | 16 | 8088 | #!/usr/bin/env python3
# -*- Coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# Open Asset Import Library (ASSIMP)
# ---------------------------------------------------------------------------
#
# Copyright (c) 2006-2010, ASSIMP Development Team
#
# All rights reserved.
#... | gpl-2.0 |
varunarya10/oslo.serialization | oslo_serialization/jsonutils.py | 1 | 8936 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | apache-2.0 |
aavanian/bokeh | bokeh/sampledata/tests/test_world_cities.py | 2 | 1963 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
strk/QGIS | tests/src/python/test_processing_alg_decorator.py | 23 | 5963 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for the @alg processing algorithm.
.. 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 ... | gpl-2.0 |
LockScreen/Backend | venv/lib/python2.7/site-packages/boxsdk/object/item.py | 6 | 9391 | # coding: utf-8
from __future__ import unicode_literals
import json
from .base_object import BaseObject
from boxsdk.config import API
from boxsdk.exception import BoxAPIException
class Item(BaseObject):
"""Box API endpoint for interacting with files and folders."""
def _get_accelerator_upload_url(self, fi... | mit |
20uf/ansible | contrib/inventory/docker.py | 132 | 12104 | #!/usr/bin/env python
# (c) 2013, Paul Durivage <paul.durivage@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
# (a... | gpl-3.0 |
schrd/django-crispy-forms | crispy_forms/helper.py | 14 | 14012 | # -*- coding: utf-8 -*-
import re
from django.core.urlresolvers import reverse, NoReverseMatch
from django.utils.safestring import mark_safe
from crispy_forms.compatibility import string_types
from crispy_forms.layout import Layout
from crispy_forms.layout_slice import LayoutSlice
from crispy_forms.utils import rende... | mit |
OWASP/django-DefectDojo | dojo/tools/appspider/parser.py | 2 | 3838 |
from datetime import datetime
from xml.dom import NamespaceErr
from defusedxml import ElementTree
from dojo.models import Endpoint, Finding
import html2text
import urllib.parse
__author__ = "Jay Paz"
class AppSpiderXMLParser(object):
def __init__(self, filename, test):
if "VulnerabilitiesSummary.xml... | bsd-3-clause |
wteiken/letsencrypt | certbot/tests/account_test.py | 4 | 6573 | """Tests for certbot.account."""
import datetime
import os
import shutil
import stat
import tempfile
import unittest
import mock
import pytz
from acme import jose
from acme import messages
from certbot import errors
from certbot.tests import test_util
KEY = jose.JWKRSA.load(test_util.load_vector("rsa512_key_2.pem... | apache-2.0 |
ryanjoneil/docker-image-construction | ipynb/examples/example1.py | 1 | 3732 | from mosek.fusion import Model, Domain, Expr, ObjectiveSense
import sys
# Example 1. Full representation of 3-image problem with all maximal cliques.
# DICP instance:
#
# Resource consumption by command:
#
# C = {A, B, C, D}
#
# | x = A: 5 |
# r(c) = | x = B: 10 |
# | x = C: 7 |
# ... | mit |
dreamer7/ZOPO-TSN | 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 |
apocalypsebg/odoo | addons/hr/__init__.py | 382 | 1092 | # -*- 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 |
clld/tsammalex | tsammalex/util.py | 1 | 4317 | from collections import OrderedDict
from purl import URL
from sqlalchemy.orm import joinedload, contains_eager
from clld.web.util.multiselect import MultiSelect
from clld.db.meta import DBSession
from clld.db.models.common import Language, Unit, Value, ValueSet
from clld.web.util.htmllib import HTML
from clld.web.uti... | apache-2.0 |
mpdehaan/ansible | v2/ansible/errors/__init__.py | 5 | 6685 | # (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 |
royveshovda/pifog | source/piclient/sensorpi/sensor_runner.py | 2 | 4086 | import json
import time
import settings
from shared import common
from datetime import datetime
from uptime import boottime
handler = None
loudness_sensor_pin = 2
dht_sensor_pin = 4
def init():
global handler
if settings.is_fake():
from sensorpi import read_faker
handler = read_faker
else:... | apache-2.0 |
Kelfast/mamba-framework | mamba/test/test_unittest.py | 3 | 4197 |
# Copyright (c) 2012 ~ 2014 - Oscar Campos <oscar.campos@member.fsf.org>
# See LICENSE for more details
"""Unit tests for unittesting module helper
"""
import os
from storm.store import Store
from twisted.trial import unittest
from twisted.python.threadpool import ThreadPool
from mamba.utils import config
from mam... | gpl-3.0 |
fidomason/kbengine | kbe/res/scripts/common/Lib/distutils/dir_util.py | 59 | 7780 | """distutils.dir_util
Utility functions for manipulating directories and directory trees."""
import os
import errno
from distutils.errors import DistutilsFileError, DistutilsInternalError
from distutils import log
# cache for by mkpath() -- in addition to cheapening redundant calls,
# eliminates redundant "creating ... | lgpl-3.0 |
mcanthony/cython | tests/run/generators_py.py | 20 | 7054 | # mode: run
# tag: generators
import cython
def very_simple():
"""
>>> x = very_simple()
>>> next(x)
1
>>> next(x)
Traceback (most recent call last):
StopIteration
>>> next(x)
Traceback (most recent call last):
StopIteration
>>> x = very_simple()
>>> x.send(1)
Trac... | apache-2.0 |
michaelld/gnuradio | grc/converter/flow_graph.py | 5 | 3929 | # Copyright 2017,2018 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# GNU Radio Companion 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 opti... | gpl-3.0 |
mhugent/Quantum-GIS | python/plugins/processing/algs/grass7/ext/r_coin.py | 20 | 1212 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_coin.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
******************************... | gpl-2.0 |
cchauve/lrcstats | src/preprocessing/multi2singlefasta.py | 2 | 1641 | import sys, getopt
if __name__ == "__main__":
helpMessage = "Process FASTA files such that sequences for each sample are contained in one line."
usageMessage = "Usage: %s [-h help and usage] [-i long reads FASTA inputPath] [-o output path]" % (sys.argv[0])
options = "hi:o:"
try:
opts, args = getopt.getopt(sys.a... | gpl-3.0 |
4022321818/40223218w11 | static/Brython3.1.0-20150301-090019/Lib/keyword.py | 761 | 2049 | #! /usr/bin/env python3
"""Keywords (from "graminit.c")
This file is automatically generated; please don't muck it up!
To update the symbols in this file, 'cd' to the top directory of
the python source tree after building the interpreter and run:
./python Lib/keyword.py
"""
__all__ = ["iskeyword", "kwlist"]
k... | gpl-3.0 |
tsengj10/physics-admit | admissions/management/commands/jelley.py | 1 | 1202 | from django.core.management.base import BaseCommand, CommandError
from admissions.models import *
class Command(BaseCommand):
help = 'Recalculate Jelley scores and ranks'
def add_arguments(self, parser):
parser.add_argument('tag', nargs='?', default='test')
def handle(self, *args, **options):
weights ... | gpl-2.0 |
Serag8/Bachelor | google_appengine/lib/distutils/distutils/msvc9compiler.py | 148 | 31018 | """distutils.msvc9compiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio 2008.
The module is compatible with VS 2005 and VS 2008. You can find legacy support
for older versions of VS in distutils.msvccompiler.
"""
# Written by Perry Stoll
# hacked by Robin B... | mit |
realsobek/freeipa | ipaclient/remote_plugins/2_49/ping.py | 8 | 1648 | #
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
#
# pylint: disable=unused-import
import six
from . import Command, Method, Object
from ipalib import api, parameters, output
from ipalib.parameters import DefaultFrom
from ipalib.plugable import Registry
from ipalib.text import _
from ipapython.dn ... | gpl-3.0 |
public-ink/public-ink | server/appengine-staging/lib/graphql/type/__init__.py | 3 | 1366 | # flake8: noqa
from .definition import ( # no import order
GraphQLScalarType,
GraphQLObjectType,
GraphQLField,
GraphQLArgument,
GraphQLInterfaceType,
GraphQLUnionType,
GraphQLEnumType,
GraphQLEnumValue,
GraphQLInputObjectType,
GraphQLInputObjectField,
GraphQLList,
GraphQ... | gpl-3.0 |
sdague/home-assistant | tests/components/mqtt/test_tag.py | 6 | 24527 | """The tests for MQTT tag scanner."""
import copy
import json
import pytest
from tests.async_mock import ANY, patch
from tests.common import (
async_fire_mqtt_message,
async_get_device_automations,
mock_device_registry,
mock_registry,
)
DEFAULT_CONFIG_DEVICE = {
"device": {"identifiers": ["0AFFD2... | apache-2.0 |
digwanderlust/pants | src/python/pants/backend/android/distribution/android_distribution.py | 31 | 3997 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import shu... | apache-2.0 |
xiawei0000/Kinectforactiondetect | ChalearnLAPSample.py | 1 | 41779 | # coding=gbk
#-------------------------------------------------------------------------------
# Name: Chalearn LAP sample
# Purpose: Provide easy access to Chalearn LAP challenge data samples
#
# Author: Xavier Baro
#
# Created: 21/01/2014
# Copyright: (c) Xavier Baro 2014
# Licence: <your lic... | mit |
icandigitbaby/openchange | script/bug-analysis/buganalysis/pkgshelper.py | 1 | 24843 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) Enrique J. Hernández 2014
# 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-3.0 |
porcobosso/spark-ec2 | lib/boto-2.34.0/boto/ec2/instancetype.py | 152 | 2273 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | apache-2.0 |
eckucukoglu/arm-linux-gnueabihf | lib/python2.7/unittest/test/test_program.py | 111 | 7555 | from cStringIO import StringIO
import os
import sys
import unittest
class Test_TestProgram(unittest.TestCase):
def test_discovery_from_dotted_path(self):
loader = unittest.TestLoader()
tests = [self]
expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
self.w... | gpl-2.0 |
RossMcKenzie/ACJ | ACJ.py | 1 | 20954 | from __future__ import division
import random
import os
import numpy as np
import pickle
import datetime
import json
class Decision(object):
def __init__(self, pair, result, reviewer, time):
self.pair = pair
self.result = result
self.reviewer = reviewer
self.time = time
def dic... | mit |
andmos/ansible | lib/ansible/modules/network/cloudengine/ce_snmp_traps.py | 25 | 19335 | #!/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 |
memtoko/django | django/db/migrations/loader.py | 56 | 15911 | from __future__ import unicode_literals
import os
import sys
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.db.migrations.graph import MigrationGraph, NodeNotFoundError
from django.db.migrations.recorder import MigrationRecorder
from django.utils import s... | bsd-3-clause |
cvegaj/ElectriCERT | venv3/lib/python3.6/site-packages/pip/utils/ui.py | 490 | 11597 | from __future__ import absolute_import
from __future__ import division
import itertools
import sys
from signal import signal, SIGINT, default_int_handler
import time
import contextlib
import logging
from pip.compat import WINDOWS
from pip.utils import format_size
from pip.utils.logging import get_indentation
from pip... | gpl-3.0 |
2ndQuadrant/ansible | lib/ansible/modules/network/fortios/fortios_log_syslogd_override_setting.py | 23 | 12526 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# 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 Lic... | gpl-3.0 |
gdreich/geonode | geonode/geoserver/tests.py | 12 | 16664 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
alexei-matveev/ccp1gui | jobmanager/slaveprocess.py | 1 | 12014 | """
This collection of routines are alternatives to those
in subprocess.py but which create additional controlling
threads.
Since this feature is not needed in the GUI as a separate thread
is spawned of to handle each job they are no longer needed,
but retained for possible future use.
"""
import os,sys
if __name__ =... | gpl-2.0 |
kbussell/pydocusign | pydocusign/client.py | 1 | 20977 | """DocuSign client."""
from collections import namedtuple
import base64
import json
import logging
import os
import warnings
import requests
from pydocusign import exceptions
logger = logging.getLogger(__name__)
Response = namedtuple('Response', ['status_code', 'text'])
class DocuSignClient(object):
"""DocuS... | bsd-3-clause |
Thhhza/XlsxWriter | examples/chart_gradient.py | 9 | 1685 | #######################################################################
#
# An example of creating an Excel charts with gradient fills using
# Python and XlsxWriter.
#
# Copyright 2013-2015, John McNamara, jmcnamara@cpan.org
#
import xlsxwriter
workbook = xlsxwriter.Workbook('chart_gradient.xlsx')
worksheet = workbook... | bsd-2-clause |
wangsai/oppia | core/platform/email/gae_email_services_test.py | 15 | 1874 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
bdoner/SickRage | lib/unidecode/x08a.py | 253 | 4647 | data = (
'Yan ', # 0x00
'Yan ', # 0x01
'Ding ', # 0x02
'Fu ', # 0x03
'Qiu ', # 0x04
'Qiu ', # 0x05
'Jiao ', # 0x06
'Hong ', # 0x07
'Ji ', # 0x08
'Fan ', # 0x09
'Xun ', # 0x0a
'Diao ', # 0x0b
'Hong ', # 0x0c
'Cha ', # 0x0d
'Tao ', # 0x0e
'Xu ', # 0x0f
'Jie ', # 0x10
'Yi... | gpl-3.0 |
rubencabrera/odoo | doc/conf.py | 184 | 8222 | # -*- coding: utf-8 -*-
import sys, os
import sphinx
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
DIR = os.path.dirname(__file... | agpl-3.0 |
heli522/scikit-learn | examples/cluster/plot_lena_ward_segmentation.py | 271 | 1998 | """
===============================================================
A demo of structured Ward hierarchical clustering on Lena image
===============================================================
Compute the segmentation of a 2D image with Ward hierarchical
clustering. The clustering is spatially constrained in order
... | bsd-3-clause |
kineticadb/kinetica-api-python | gpudb/packages/avro/avro_py2/ipc.py | 2 | 18070 | # 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... | mit |
chfoo/cloaked-octo-nemesis | visibli/visibli_url_grab.py | 1 | 14609 | '''Grab Visibli hex shortcodes'''
# Copyright 2013 Christopher Foo <chris.foo@gmail.com>
# Licensed under GPLv3. See COPYING.txt for details.
import argparse
import base64
import collections
import gzip
import html.parser
import http.client
import logging
import logging.handlers
import math
import os
import queue
impor... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.