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 |
|---|---|---|---|---|---|
dezgeg/debbindiff | setup.py | 1 | 1468 | #!/usr/bin/env python2
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import debbindiff
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(s... | gpl-3.0 |
szeged/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/manifestexpected.py | 2 | 14111 | import os
import urlparse
from collections import deque
from wptmanifest.backends import static
from wptmanifest.backends.static import ManifestItem
import expected
"""Manifest structure used to store expected results of a test.
Each manifest file is represented by an ExpectedManifest that
has one or more TestNode ... | mpl-2.0 |
diagonalwalnut/Experience | fabfile.py | 2 | 1815 | import os
import sys
from fabric.api import local
def setup_env():
INSTALL_STEPS = ['virtualenv ../env;. ../env/bin/activate;pip install -r requirements.txt;deactivate']
for step in INSTALL_STEPS:
local(step)
def setup_lrs():
# Media folder names
agent_profile = 'agent_profile'
activity_pr... | apache-2.0 |
Micronaet/micronaet-mx8 | mx_stock_status_multicompany/__init__.py | 1 | 1084 | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | agpl-3.0 |
SamHames/scikit-image | skimage/util/noise.py | 3 | 7610 | import numpy as np
from .dtype import img_as_float
__all__ = ['random_noise']
def random_noise(image, mode='gaussian', seed=None, clip=True, **kwargs):
"""
Function to add random noise of various types to a floating-point image.
Parameters
----------
image : ndarray
Input image data. Wi... | bsd-3-clause |
keans/dstools | dstools/utils.py | 1 | 1422 | import itertools
def pairwise(iterable):
"""
s -> (s0,s1), (s1,s2), (s2, s3), ...
"""
a, b = itertools.tee(iterable)
next(b, None)
return list(zip(a, b))
def str2bool(v):
"""
converts a string to a boolean
"""
return v.lower() in ("yes", "true", "t", "1")
def chunks(li, siz... | mit |
avanov/django | tests/gis_tests/geos_tests/test_mutable_list.py | 166 | 14952 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com
# All rights reserved.
#
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
import unittest
from django.contrib.gis.geos.mutable_list import ListMixin
from django.utils import six
class Use... | bsd-3-clause |
archesproject/arches | arches/app/models/migrations/0005_4_0_1.py | 1 | 6158 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-04-25 11:36
import os
from django.db import migrations, models
from django.core import management
from arches.app.models.system_settings import settings
from arches.app.models.concept import Concept
from arches.app.search.search_engine_factory import SearchE... | agpl-3.0 |
Shihta/python-novaclient | novaclient/tests/v3/test_keypairs.py | 4 | 1070 | # 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 |
kyleconroy/python-oauth2 | oauth2/clients/imap.py | 885 | 1685 | """
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | mit |
zerolab/wagtail | wagtail/sites/tests.py | 8 | 11977 | from django.contrib.auth.models import Permission
from django.test import TestCase
from django.urls import reverse
from wagtail.core.models import Page, Site
from wagtail.tests.utils import WagtailTestUtils
class TestSiteIndexView(TestCase, WagtailTestUtils):
def setUp(self):
self.login()
self.ho... | bsd-3-clause |
tuhangdi/django | tests/ordering/tests.py | 301 | 10033 | from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from django.db.models import F
from django.test import TestCase
from .models import Article, Author, Reference
class OrderingTests(TestCase):
def setUp(self):
self.a1 = Article.objects.create(
... | bsd-3-clause |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/django/db/migrations/topological_sort.py | 538 | 1129 | def topological_sort_as_sets(dependency_graph):
"""Variation of Kahn's algorithm (1962) that returns sets.
Takes a dependency graph as a dictionary of node => dependencies.
Yields sets of items in topological order, where the first set contains
all nodes without dependencies, and each following set co... | bsd-3-clause |
lmazuel/azure-sdk-for-python | azure-servicemanagement-legacy/azure/servicemanagement/_common_conversion.py | 13 | 1896 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apa... | mit |
theblindr/blindr-backend | tests/models/test_user.py | 1 | 2530 | from datetime import datetime
from freezegun import freeze_time
from unittest import mock
from tests.blindrtest import BlindrTest
from tests.factory_boy.user_factory import UserFactory
from blindr.models.user import User
class UserTests(BlindrTest):
@freeze_time('2015-01-01')
@mock.patch('blindr.models.user.... | gpl-3.0 |
akretion/sale-workflow | __unported__/sale_fiscal_position_update/sale.py | 37 | 3620 | # -*- coding: utf-8 -*-
#
#
# Sale Fiscal Position Update module for OpenERP
# Copyright (C) 2011-2014 Julius Network Solutions SARL <contact@julius.fr>
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Mathieu Vatel <mathieu _at_ julius.fr>
# @author Alexis de Lattre <alexis.delattre@akr... | agpl-3.0 |
openstate/yournextrepresentative | candidates/static_data.py | 2 | 7306 | from collections import defaultdict
import json
from os.path import abspath, dirname, join, exists
import requests
from django.conf import settings
from django.utils.translation import ugettext as _
data_directory = abspath(join(
dirname(__file__), '..', 'elections', settings.ELECTION_APP, 'data'
))
def get_map... | agpl-3.0 |
tectronics/madcow | madcow/modules/summon.py | 3 | 1271 | """Summon people"""
import re
from learn import Main as Learn
from madcow.util import Module
from smtplib import SMTP
from madcow.conf import settings
from madcow.util.text import *
class Main(Module):
pattern = re.compile(r'^\s*summons?\s+(\S+)(?:\s+(.*?))?\s*$')
require_addressing = True
help = u'summo... | gpl-3.0 |
OpenTrons/opentrons_sdk | api/src/opentrons/deck_calibration/endpoints.py | 1 | 24629 | from uuid import uuid1
from typing import Dict, Tuple, Optional, NamedTuple
import logging
from enum import Enum
try:
from opentrons import instruments
except ImportError:
pass
from opentrons.config import pipette_config, robot_configs, feature_flags
from opentrons.types import Mount, Point
from opentrons.hard... | apache-2.0 |
dnlm92/chokoretto | main/lib/unidecode/x08b.py | 252 | 4643 | data = (
'Mou ', # 0x00
'Ye ', # 0x01
'Wei ', # 0x02
'[?] ', # 0x03
'Teng ', # 0x04
'Zou ', # 0x05
'Shan ', # 0x06
'Jian ', # 0x07
'Bo ', # 0x08
'Ku ', # 0x09
'Huang ', # 0x0a
'Huo ', # 0x0b
'Ge ', # 0x0c
'Ying ', # 0x0d
'Mi ', # 0x0e
'Xiao ', # 0x0f
'Mi ', # 0x10
'Xi ... | mit |
NL66278/odoo | addons/account_budget/report/__init__.py | 444 | 1139 | # -*- 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 |
dbckz/ansible | lib/ansible/modules/messaging/rabbitmq_plugin.py | 69 | 4777 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chatham Financial <oss@chathamfinancial.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... | gpl-3.0 |
yaegashi/ansible-modules-extras | packaging/os/pkgutil.py | 46 | 7089 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Winkler <mail () winkler-alexander.de>
# based on svr4pkg by
# Boyd Adamson <boyd () boydadamson.com> (2012)
#
# 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 Publ... | gpl-3.0 |
RyanSkraba/beam | sdks/python/apache_beam/metrics/metric_test.py | 1 | 5846 | #
# 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 |
benitesf/Skin-Lesion-Analysis-Towards-Melanoma-Detection | main.py | 1 | 9476 | # Import methods of features extraction
from features_extraction.feature_extraction import FeatureExtraction
# Import methods of learning
from learning.learning import neural_network
# Import methods of classification
from classification.classification import classify, confusion_matrix, total_error, local_error
#
fr... | mit |
robbat2/teuthology | teuthology/test/test_matrix.py | 7 | 2445 | from .. import matrix
def verify_matrix_output_diversity(res):
"""
Verifies that the size of the matrix passed matches the number of unique
outputs from res.index
"""
sz = res.size()
s = frozenset([matrix.generate_lists(res.index(i)) for i in range(sz)])
for i in range(res.size()):
... | mit |
tipabu/swift | swift/common/middleware/versioned_writes/__init__.py | 3 | 2091 | # Copyright (c) 2019 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 |
twitchyliquid64/misc-scripts | s3tool/boto-develop/tests/integration/cloudhsm/test_cloudhsm.py | 99 | 1883 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
risent/unidecode | unidecode/x06c.py | 252 | 4643 | data = (
'Lu ', # 0x00
'Mu ', # 0x01
'Li ', # 0x02
'Tong ', # 0x03
'Rong ', # 0x04
'Chang ', # 0x05
'Pu ', # 0x06
'Luo ', # 0x07
'Zhan ', # 0x08
'Sao ', # 0x09
'Zhan ', # 0x0a
'Meng ', # 0x0b
'Luo ', # 0x0c
'Qu ', # 0x0d
'Die ', # 0x0e
'Shi ', # 0x0f
'Di ', # 0x10
'Min... | gpl-2.0 |
dmsimard/ansible | test/units/galaxy/test_collection.py | 21 | 36575 | # -*- coding: utf-8 -*-
# Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import os
import pytest
import ... | gpl-3.0 |
jhoos/django | tests/model_formsets_regress/models.py | 144 | 1146 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class User(models.Model):
username = models.CharField(max_length=12, unique=True)
serial = models.IntegerField()
class UserSite(models.Model):
user = models.ForeignKey(User, to_field="username")
data = models.... | bsd-3-clause |
snakeleon/YouCompleteMe-x64 | third_party/ycmd/third_party/watchdog_deps/watchdog/src/watchdog/events.py | 2 | 16163 | # coding: utf-8
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 Google, Inc & contributors.
#
# 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.a... | gpl-3.0 |
rbrito/pkg-youtube-dl | youtube_dl/extractor/thestar.py | 75 | 1404 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class TheStarIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?thestar\.com/(?:[^/]+/)*(?P<id>.+)\.html'
_TEST = {
'url': 'http://www.thestar.com/life/2016/02/01/mankind-why-this-woman-started-a-men-s-skincar... | unlicense |
vebin/Wox | PythonHome/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py | 319 | 1348 | from socket import error as SocketError
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is_connection_dr... | mit |
igorgai/django-custom-user | custom_user/forms.py | 1 | 3880 | """EmailUser forms."""
import django
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.utils.translation import ugettext_lazy as _
class EmailUserCreationForm(forms.ModelForm):
"""A form for creating new users.
... | bsd-3-clause |
videologyincengineering/TFMIPI_Kernel | Documentation/target/tcm_mod_builder.py | 3119 | 42754 | #!/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 |
maniteja123/sympy | sympy/stats/tests/test_finite_rv.py | 42 | 8106 | from sympy.core.compatibility import range
from sympy import (FiniteSet, S, Symbol, sqrt,
symbols, simplify, Eq, cos, And, Tuple, Or, Dict, sympify, binomial,
cancel)
from sympy.stats import (DiscreteUniform, Die, Bernoulli, Coin, Binomial,
Hypergeometric, Rademacher, P, E, variance, covariance, ske... | bsd-3-clause |
quater/calico-containers | calicoctl/calico_ctl/status.py | 1 | 9262 | # Copyright (c) 2015-2016 Tigera, 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 applicabl... | apache-2.0 |
Zhongqilong/kbengine | kbe/res/scripts/common/Lib/test/test_ast.py | 72 | 44795 | import os
import sys
import unittest
import ast
import weakref
from test import support
def to_tuple(t):
if t is None or isinstance(t, (str, int, complex)):
return t
elif isinstance(t, list):
return [to_tuple(e) for e in t]
result = [t.__class__.__name__]
if hasattr(t, 'lineno') and ha... | lgpl-3.0 |
xindus40223115/w17_test | static/Brython3.1.0-20150301-090019/Lib/long_int1/__init__.py | 109 | 3805 | from browser import html, document, window
import javascript
#memorize/cache?
def _get_value(other):
if isinstance(other, LongInt):
return other.value
return other
class BigInt:
def __init__(self):
pass
def __abs__(self):
return LongInt(self.value.abs())
def __add__(self, other):
... | gpl-3.0 |
niwinz/Green-Mine | src/greenmine/wiki/views.py | 1 | 4981 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.template.defaultfilters import slugify
from django.shortcuts import get_object_or_404
from ..core.utils.slug import slugify_uniquely
from ..core.generic import GenericView
from ..core.decorators im... | bsd-3-clause |
liggitt/docker-registry | docker_registry/drivers/s3.py | 7 | 4568 | # -*- coding: utf-8 -*-
"""
docker_registry.drivers.s3
~~~~~~~~~~~~~~~~~~~~~~~~~~
This is a s3 based driver.
"""
import gevent.monkey
gevent.monkey.patch_all()
import docker_registry.core.boto as coreboto
# from docker_registry.core import exceptions
from docker_registry.core import compat
from docker_registry.core... | apache-2.0 |
SVADemoAPP/Server | WebContent/WEB-INF/python/qpid/tests/spec010.py | 5 | 2710 | #
# 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... | apache-2.0 |
kreatorkodi/repository.torrentbr | plugin.video.yatp/site-packages/hachoir_parser/audio/real_audio.py | 95 | 3762 | """
RealAudio (.ra) parser
Author: Mike Melanson
References:
http://wiki.multimedia.cx/index.php?title=RealMedia
Samples:
http://samples.mplayerhq.hu/real/RA/
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet,
UInt8, UInt16, UInt32,
Bytes, RawBytes, String,
PascalString8)
... | gpl-2.0 |
jayfans3/example | liupeng/src/main/java/python/pyAbacus/JythonAbacus.py | 123 | 2767 | #
# 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... | bsd-2-clause |
akesterson/dpath-python | tests/test_util_set.py | 1 | 1710 | import dpath.util
def test_set_existing_separator():
dict = {
"a": {
"b": 0,
},
}
dpath.util.set(dict, ';a;b', 1, separator=";")
assert(dict['a']['b'] == 1)
dict['a']['b'] = 0
dpath.util.set(dict, ['a', 'b'], 1, separator=";")
assert(dict['a']['b'] == 1)
def... | mit |
sigma-random/scrapy | scrapy/core/downloader/webclient.py | 16 | 4889 | from time import time
from six.moves.urllib.parse import urlparse, urlunparse, urldefrag
from twisted.web.client import HTTPClientFactory
from twisted.web.http import HTTPClient
from twisted.internet import defer
from scrapy.http import Headers
from scrapy.utils.httpobj import urlparse_cached
from scrapy.responsetype... | bsd-3-clause |
TeamRegular/android_kernel_lge_e2nxx | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
windyuuy/opera | chromium/src/third_party/python_26/Lib/ctypes/test/test_arrays.py | 51 | 4378 | import unittest
from ctypes import *
formats = "bBhHiIlLqQfd"
formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \
c_long, c_ulonglong, c_float, c_double, c_longdouble
class ArrayTestCase(unittest.TestCase):
def test_simple(self):
# create classes holding simple numeric types, and che... | bsd-3-clause |
bitprophet/fabric | fabric/io.py | 10 | 9655 | from __future__ import with_statement
import sys
import time
import re
import socket
from select import select
from fabric.state import env, output, win32
from fabric.auth import get_password, set_password
import fabric.network
from fabric.network import ssh, normalize
from fabric.utils import RingBuffer
from fabric.... | bsd-2-clause |
openlawlibrary/pygls | examples/json-extension/server/tests/unit/test_features.py | 1 | 3751 | ############################################################################
# Copyright(c) Open Law Library. All rights reserved. #
# See ThirdPartyNotices.txt in the project root for additional notices. #
# #
# Licensed u... | apache-2.0 |
sublime1809/django | tests/template_tests/tests.py | 11 | 125116 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import date, datetime
import os
import sys
import traceback
import unittest
import warnings
from django import template
from django.conf import settings
from django.contrib.auth.models import Group
from django.core import urlresolvers
from ... | bsd-3-clause |
ustuehler/git-cvs | cvsgit/command/clone.py | 1 | 3887 | """Command to clone a CVS repository or module as a Git repository."""
import os.path
import shutil
from cvsgit.main import Command, Conduit
from cvsgit.i18n import _
from cvsgit.command.verify import Verify
class Clone(Command):
__doc__ = _(
"""Clone a CVS repository or module into a Git repository.
Us... | isc |
Cuuuurzel/KiPyCalc | sympy_old/mpmath/libmp/libmpi.py | 20 | 27586 | """
Computational functions for interval arithmetic.
"""
from .backend import xrange
from .libmpf import (
ComplexResult,
round_down, round_up, round_floor, round_ceiling, round_nearest,
prec_to_dps, repr_dps, dps_to_prec,
bitcount,
from_float,
fnan, finf, fninf, fzero, fhalf, fone, fnone,
... | mit |
psi4/DatenQM | benchmarks/bench_molecule_add.py | 2 | 1624 | import time
import qcfractal
import qcelemental as qcel
import numpy as np
print("Building and clearing the database...\n")
db_name = "molecule_tests"
storage = qcfractal.storage_socket_factory(f"postgresql://localhost:5432/{db_name}")
storage._delete_DB_data(db_name)
run_tests = False
mol_trials = [1, 5, 10, 25, 50... | bsd-3-clause |
chuan9/chromium-crosswalk | tools/valgrind/asan/third_party/asan_symbolize.py | 64 | 16609 | #!/usr/bin/env python
#===- lib/asan/scripts/asan_symbolize.py -----------------------------------===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===----------------------------------------... | bsd-3-clause |
Clinical-Genomics/scout | scout/server/blueprints/dashboard/controllers.py | 1 | 12437 | import logging
from flask import flash, redirect, request, url_for
from flask_login import current_user
from scout.server.extensions import store
from scout.server.utils import user_institutes
from .forms import DashboardFilterForm
LOG = logging.getLogger(__name__)
def institute_select_choices():
"""Return a ... | bsd-3-clause |
thaim/ansible | lib/ansible/modules/cloud/cloudstack/cs_vpc_offering.py | 25 | 9891 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017, David Passante (@dpassante)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'commu... | mit |
mpercich/Calendarize | ios/dateparser/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.py | 327 | 4608 | import types
import functools
from pip._vendor.requests.adapters import HTTPAdapter
from .controller import CacheController
from .cache import DictCache
from .filewrapper import CallbackFileWrapper
class CacheControlAdapter(HTTPAdapter):
invalidating_methods = set(['PUT', 'DELETE'])
def __init__(self, cach... | mit |
HenningOp/ACS | GIS-Tools/Q_prePro1/ACS_preProcessing1/acs_preProcessing1_dialog.py | 1 | 1828 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
ACS_preProcessing1Dialog
A QGIS plugin
Transfer stream data
-------------------
begin : 2017-07-26
git sha ... | gpl-3.0 |
kirananto/RaZorKernel | scripts/build-all.py | 704 | 14699 | #! /usr/bin/env python
# Copyright (c) 2009-2014, The Linux Foundation. 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
# ... | gpl-2.0 |
phammin1/QaManagement | QaManagement/env/Lib/site-packages/django/core/files/storage.py | 281 | 13339 | import errno
import os
import warnings
from datetime import datetime
from django.conf import settings
from django.core.exceptions import SuspiciousFileOperation
from django.core.files import File, locks
from django.core.files.move import file_move_safe
from django.utils._os import abspathu, safe_join
from django.utils... | mit |
sid88in/incubator-airflow | tests/contrib/sensors/test_wasb_sensor.py | 8 | 4520 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
twobob/buildroot-kindle | output/build/host-python-2.7.2/Lib/idlelib/Debugger.py | 89 | 15818 | import os
import bdb
import types
from Tkinter import *
from idlelib.WindowList import ListedToplevel
from idlelib.ScrolledList import ScrolledList
from idlelib import macosxSupport
class Idb(bdb.Bdb):
def __init__(self, gui):
self.gui = gui
bdb.Bdb.__init__(self)
def user_line(self, frame):... | gpl-2.0 |
benhoff/listenerplugins | listenerplugins/steam_user.py | 33 | 2667 | import requests
from lxml import etree
from cloudbot import hook
from cloudbot.util import formatting
# security
parser = etree.XMLParser(resolve_entities=False, no_network=True)
API_URL = "http://steamcommunity.com/id/{}/"
ID_BASE = 76561197960265728
headers = {}
class SteamError(Exception):
pass
def conve... | gpl-3.0 |
cgarrard/osgeopy-code | Chapter3/chapter3.py | 1 | 17766 | # I use the print function in this code, even though I don't in the book text,
# so that you can run it as a regular script and still get the output. You only
# get output without using print if you're using the interactive window.
# Set this variable to your osgeopy-data directory so that the following
# examples wi... | mit |
Alzon/SUR | magnum/common/pythonk8sclient/client/models/V1beta3_ExecAction.py | 15 | 1589 | #!/usr/bin/env python
"""
Copyright 2015 Reverb Technologies, 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 require... | apache-2.0 |
Hitachi-Data-Systems/org-chart-builder | openpyxl/worksheet/dimensions.py | 1 | 6673 | from __future__ import absolute_import
# Copyright (c) 2010-2014 openpyxl
from openpyxl.compat import safe_string
from openpyxl.cell import get_column_interval, column_index_from_string
from openpyxl.descriptors import Integer, Float, Bool, Strict, String, Alias
from openpyxl.compat import OrderedDict
class Dimensio... | apache-2.0 |
Workday/OpenFrame | tools/telemetry/telemetry/timeline/tracing_options.py | 2 | 3118 | # 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.
RECORD_UNTIL_FULL = 'record-until-full'
RECORD_CONTINUOUSLY = 'record-continuously'
RECORD_AS_MUCH_AS_POSSIBLE = 'record-as-much-as-possible'
ECHO_TO_CONSOLE... | bsd-3-clause |
lduarte1991/edx-platform | lms/djangoapps/mobile_api/course_info/views.py | 24 | 3727 | """
Views for course info API
"""
from rest_framework import generics
from rest_framework.response import Response
from courseware.courses import get_course_info_section_module
from openedx.core.lib.xblock_utils import get_course_update_items
from static_replace import make_static_urls_absolute
from ..decorators imp... | agpl-3.0 |
anarchivist/pyflag | src/plugins/MemoryForensics/Volatility-1.3_Linux_rc.1/forensics/object2.py | 7 | 27340 | # Volatility
# Copyright (C) 2007,2008 Volatile Systems
#
# Copyright (C) 2005,2006 4tphi Research
# Author: {npetroni,awalters}@4tphi.net (Nick Petroni and AAron Walters)
#
# 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
# th... | gpl-2.0 |
MiroK/dolfin | test/unit/python/mesh/test_boundary_mesh.py | 3 | 1738 | #!/usr/bin/env py.test
"Unit tests for BoundaryMesh library"
# Copyright (C) 2012 Garth N. Wells
#
# This file is part of DOLFIN.
#
# DOLFIN 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 vers... | gpl-3.0 |
vnsofthe/odoo-dev | addons/crm/base_partner_merge.py | 182 | 30903 | #!/usr/bin/env python
from __future__ import absolute_import
from email.utils import parseaddr
import functools
import htmlentitydefs
import itertools
import logging
import operator
import psycopg2
import re
from ast import literal_eval
from openerp.tools import mute_logger
# Validation Library https://pypi.python.org... | agpl-3.0 |
bpsinc-native/src_third_party_webpagereplay | platformsettings_test.py | 4 | 8260 | #!/usr/bin/env python
# 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 |
ProfessorKaos64/python-evdev | evdev/util.py | 4 | 2712 | # encoding: utf-8
import os
import stat
import glob
from evdev import ecodes
from evdev.events import event_factory
def list_devices(input_device_dir='/dev/input'):
'''List readable character devices in ``input_device_dir``.'''
fns = glob.glob('{}/event*'.format(input_device_dir))
fns = list(filter(is_... | bsd-3-clause |
ujenmr/ansible | test/units/modules/storage/netapp/test_na_ontap_volume.py | 5 | 16064 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock
from ans... | gpl-3.0 |
rwakulszowa/servo | tests/wpt/web-platform-tests/tools/html5lib/utils/entities.py | 438 | 2734 | import json
import html5lib
def parse(path="html5ents.xml"):
return html5lib.parse(open(path), treebuilder="lxml")
def entity_table(tree):
return dict((entity_name("".join(tr[0].xpath(".//text()"))),
entity_characters(tr[1].text))
for tr in tree.xpath("//h:tbody/h:tr",
... | mpl-2.0 |
SummerLW/Perf-Insight-Report | telemetry/telemetry/internal/backends/form_based_credentials_backend.py | 9 | 3614 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from telemetry.core import exceptions
class FormBasedCredentialsBackend(object):
def __init__(self):
self._logged_in = False
def Is... | bsd-3-clause |
axinging/chromium-crosswalk | tools/copyright_scanner/copyright_scanner.py | 6 | 16707 | # 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.
"""Utilities for scanning source files to determine code authorship.
"""
import itertools
def ForwardSlashesToOsPathSeps(input_api, path):
"""Converts fo... | bsd-3-clause |
Entropy512/kernel_motorola_falcon_reference | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
goliate/sarakha63-persomov | libs/suds/builder.py | 197 | 4220 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
ehashman/oh-mainline | vendor/packages/gdata/src/gdata/tlslite/integration/HTTPTLSConnection.py | 271 | 6668 | """TLS Lite + httplib."""
import socket
import httplib
from gdata.tlslite.TLSConnection import TLSConnection
from gdata.tlslite.integration.ClientHelper import ClientHelper
class HTTPBaseTLSConnection(httplib.HTTPConnection):
"""This abstract class provides a framework for adding TLS support
to httplib."""
... | agpl-3.0 |
EricMountain-1A/openshift-ansible | roles/lib_openshift/src/class/oc_serviceaccount_secret.py | 66 | 4640 | # pylint: skip-file
# flake8: noqa
class OCServiceAccountSecret(OpenShiftCLI):
''' Class to wrap the oc command line tools '''
kind = 'sa'
def __init__(self, config, verbose=False):
''' Constructor for OpenshiftOC '''
super(OCServiceAccountSecret, self).__init__(config.namespace, kubeconfi... | apache-2.0 |
Alwnikrotikz/cortex-vfx | test/IECoreMaya/FnParameterisedHolderTest.py | 9 | 35881 | ##########################################################################
#
# Copyright (c) 2008-2012, Image Engine Design 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:
#
# * Redis... | bsd-3-clause |
timberline-secondary/hackerspace | src/portfolios/views.py | 1 | 8722 | import os
from django.urls import reverse
from django.http import Http404
from django.contrib import messages
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.messages.views import Success... | gpl-3.0 |
haad/ansible | test/runner/lib/util.py | 18 | 18750 | """Miscellaneous utility functions and classes."""
from __future__ import absolute_import, print_function
import atexit
import errno
import filecmp
import inspect
import json
import os
import pipes
import pkgutil
import random
import re
import shutil
import stat
import string
import subprocess
import sys
import tempf... | gpl-3.0 |
bankonme/gnucash | src/optional/python-bindings/example_scripts/simple_invoice_insert.py | 8 | 4324 | #!/usr/bin/env python
# simple_invoice_insert.py -- Add an invoice to a set of books
#
# Copyright (C) 2010 ParIT Worker Co-operative <transparency@parit.ca>
# 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... | gpl-2.0 |
dnephin/compose | compose/cli/command.py | 2 | 4807 | from __future__ import absolute_import
from __future__ import unicode_literals
import logging
import os
import re
import six
from . import errors
from . import verbose_proxy
from .. import config
from .. import parallel
from ..config.environment import Environment
from ..const import API_VERSIONS
from ..project impo... | apache-2.0 |
fedepad/espressopp | testsuite/python_tools/test_python_tools.py | 2 | 3140 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#unittests for python tools in $ESPRESSOPPHOME/tools
import sys
import time
import espressopp
import mpi4py.MPI as MPI
import unittest
class TestPythonTools(unittest.TestCase):
def setUp(self):
system = espressopp.System()
box = (10, 10, 10)
... | gpl-3.0 |
Sorsly/subtle | google-cloud-sdk/platform/gsutil/third_party/boto/tests/integration/dynamodb/test_table.py | 136 | 3553 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
bzamecnik/sms-tools | tests/sprModel_test.py | 1 | 1710 | import math
import numpy as np
from scipy.signal import get_window
from smst.utils.math import rmse
from smst.utils import audio
from smst.models import spr
from .common import sound_path
# TODO: the test needs fixing after the model is fixed
def test_reconstruct_sound():
fs, x = audio.read_wav(sound_path("sax-... | agpl-3.0 |
hojel/epubia | markdown2pdf.py | 1 | 3489 | # -*- coding: utf-8 -*-
import markdown
import ho.pisa as pisa
import StringIO
import os
import re
from Cheetah.Template import Template
from tempfile import NamedTemporaryFile
debug = False
def markdown2pdf(text, pdffile, cssfile='xhtml2pdf.css', src_dir='.',
fontfile='arial.ttf', skipTo1st=False... | mit |
kickapoo/prometheus | prometheus/__init__.py | 1 | 1867 | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask.ext.moment import Moment
from flask.ext.bootstrap import Bootstrap
import pyowm
app = Flask(__name__, instance_relative_config=True)
# config.default
app.config.from_object('config.default')
# config... | gpl-3.0 |
yangming85/lettuce | tests/integration/lib/Django-1.3/django/template/base.py | 158 | 38683 | import imp
import re
from inspect import getargspec
from django.conf import settings
from django.template.context import Context, RequestContext, ContextPopException
from django.utils.importlib import import_module
from django.utils.itercompat import is_iterable
from django.utils.functional import curry, Promise
from ... | gpl-3.0 |
v-iam/azure-sdk-for-python | azure-mgmt/tests/test_mgmt_notificationhubs.py | 5 | 1313 | # coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#---------------------------------------------------------------------... | mit |
40223225/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/optparse.py | 728 | 60616 | """A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Simple usage example:
from optparse import OptionParser
pa... | gpl-3.0 |
nagyistoce/edx-platform | lms/djangoapps/verify_student/migrations/0008_auto__del_field_verificationcheckpoint_checkpoint_name__add_field_veri.py | 84 | 11766 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'VerificationCheckpoint', fields ['course_id', 'c... | agpl-3.0 |
shuitian/pokemon_rpg | Assets/server/sqldata.py | 1 | 2027 | #-*- coding:utf-8 –*-
import sqlite3,os,time,json
class sql(object):
"""处理数据库的类"""
def __init__(self):
"""获取数据库连接"""
super(sql, self).__init__()
db = 'monsters.db'
self.conn = sqlite3.connect(db)
print "Open",db,"Success"
def __del__(self):
"""关闭数据库连接"""
self.conn.close()
def show_table(self, tab... | mit |
jsonchin/nba_stats_scraper_db_storage | nba_ss_db/scrape/query_param_values.py | 1 | 2097 | """
Contains functions to retrieve fillable values for
API request jobs.
"""
import datetime
from .. import db, CONFIG
from ..scrape.utils import get_date_before, format_date_for_api_request, PROPER_DATE_FORMAT
QUERY_PARAM_VALUES = {}
def get_possible_query_param_values(query_param, is_daily):
"""
Valid quer... | apache-2.0 |
DanLipsitt/flask-socketio-dbus-demo | myapp/views.py | 2 | 1207 | # -*- coding: utf-8 -*-
from flask import render_template
from . import app, socketio
SIO_SENSOR_NAMESPACE = "/sensors"
SIO_EVT_BATTERY_CHANGED = 'battery_changed'
@app.route('/')
def index():
return render_template('index.html')
@app.route('/battery')
def battery():
return render_template('battery.html... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.