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 |
|---|---|---|---|---|---|
intermezzo-fr/onedrive-d | onedrive_d/tests/api/test_resources.py | 2 | 6119 | __author__ = 'xb'
import json
import unittest
import requests
import requests_mock
from onedrive_d import str_to_datetime
from onedrive_d.api import items
from onedrive_d.api import resources
from onedrive_d.api import options
from onedrive_d.tests import get_data
from onedrive_d.tests.api import drive_... | gpl-3.0 |
thurt/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_profile.py | 51 | 7221 | """Test suite for the profile module."""
import os
import sys
import pstats
import unittest
from StringIO import StringIO
from test.test_support import run_unittest
import profile
from test.profilee import testfunc, timer
class ProfileTest(unittest.TestCase):
profilerclass = profile.Profile
methodnames = [... | apache-2.0 |
openstack/tempest | tempest/lib/services/network/segments_client.py | 3 | 2338 | # 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 |
ilyaraz/FALCONN | external/googletest/googletest/scripts/pump.py | 2471 | 23673 | #!/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 |
encbladexp/ansible | lib/ansible/plugins/lookup/together.py | 29 | 2195 | # (c) 2013, Bradley Young <young.bradley@gmail.com>
# (c) 2012-17 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
name: together
author: Brad... | gpl-3.0 |
DieBauer/flink | flink-libraries/flink-python/src/main/python/org/apache/flink/python/api/flink/functions/JoinFunction.py | 21 | 1366 | # ###############################################################################
# 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 thi... | apache-2.0 |
nixphix/ml-projects | sentiment_analysis/twitter_sentiment_analysis-jallikattu/code/twitter_sentiment_analysis-jallikattu_FINAL.py | 1 | 11757 |
# coding: utf-8
# ### Sentiment Analysis on "Jallikattu" with Twitter Data Feed <h3 style="color:red;">#DataScienceForSocialCause</h3>
#
# Twitter is flooded with Jallikattu issue, let us find peoples sentiment with Data Science tools. Following is the approach
# * Register a Twitter API handle for data feed
# * Pul... | mit |
orangeduck/PyAutoC | Python27/Lib/test/test_hashlib.py | 35 | 13615 | # Test hashlib module
#
# $Id$
#
# Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
import array
import hashlib
import itertools
import sys
try:
import threading
except ImportError:
threading = None
import unittest
import warnings
from test impor... | bsd-2-clause |
lkhomenk/integration_tests | sprout/appliances/migrations/0039_auto_20170403_0918.py | 13 | 5117 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-04-03 09:18
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
def appliances_forwards(apps, schema_editor):
Appliance = apps.get_model("appliances", "Appliance") # noqa
for appliance in A... | gpl-2.0 |
a10networks/a10sdk-python | a10sdk/core/aam/aam_authentication_relay_ws_federation_stats.py | 2 | 2071 | from a10sdk.common.A10BaseClass import A10BaseClass
class Stats(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param Failure: {"description": "Failure", "format": "counter", "type": "number", "oid": "3", "optional": true, "size": "8"}
:param Request: {"description"... | apache-2.0 |
thecodinghub/news-for-good | news/Lib/locale.py | 27 | 74724 | """Locale support module.
The module provides low-level access to the C lib's locale APIs and adds high
level number formatting APIs as well as a locale aliasing engine to complement
these.
The aliasing engine includes support for many commonly used locale names and
maps them to values suitable for passing to the C l... | bsd-3-clause |
abeyer/anki | tests/test_cards.py | 19 | 2950 | # coding: utf-8
from tests.shared import getEmptyCol
def test_previewCards():
deck = getEmptyCol()
f = deck.newNote()
f['Front'] = u'1'
f['Back'] = u'2'
# non-empty and active
cards = deck.previewCards(f, 0)
assert len(cards) == 1
assert cards[0].ord == 0
# all templates
cards ... | agpl-3.0 |
semonte/intellij-community | plugins/hg4idea/testData/bin/hgext/progress.py | 90 | 10860 | # progress.py show progress bars for some actions
#
# Copyright (C) 2010 Augie Fackler <durin42@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""show progress bars for some actions
This extension uses the progress in... | apache-2.0 |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdecore/KUser.py | 1 | 2592 | # encoding: utf-8
# module PyKDE4.kdecore
# from /usr/lib/python3/dist-packages/PyKDE4/kdecore.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtNetwork as __PyQt4_QtNetwork
class KUser(): # skipped bases: <class 'sip.wrapper'>
# no doc
... | gpl-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pycrypto-2.6.1/lib/Crypto/SelfTest/__init__.py | 111 | 3418 | # -*- coding: utf-8 -*-
#
# SelfTest/__init__.py: Self-test for PyCrypto
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public... | mit |
hpcugent/easybuild-easyblocks | easybuild/easyblocks/s/soapdenovo.py | 4 | 2059 | ##
# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild
#
# Copyright:: Copyright 2012-2019 Uni.Lu/LCSB, NTUA
# Authors:: Cedric Laczny <cedric.laczny@uni.lu>, Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste
# License:: MIT/GPL
# $Id$
#
# This work implements a part of the HPCBIOS proj... | gpl-2.0 |
TNT-Samuel/Coding-Projects | DNS Server/Source/Lib/encodings/iso8859_5.py | 272 | 13015 | """ Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | gpl-3.0 |
rooshilp/CMPUT410Lab6 | virt_env/virt1/lib/python2.7/site-packages/django/contrib/flatpages/tests/test_views.py | 56 | 5631 | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.flatpages.models import FlatPage
from django.test import TestCase, override_settings
@override_settings(
LOGIN_URL='/accounts/login/',
MIDDLEW... | apache-2.0 |
B-MOOC/edx-platform | common/djangoapps/student/tests/test_login_registration_forms.py | 14 | 8626 | """Tests for the login and registration form rendering. """
import urllib
import unittest
from collections import OrderedDict
import ddt
from mock import patch
from django.conf import settings
from django.core.urlresolvers import reverse
from util.testing import UrlResetMixin
from xmodule.modulestore.tests.factories ... | agpl-3.0 |
CookiesandCake/namebench | nb_third_party/jinja2/_stringdefs.py | 412 | 404256 | # -*- coding: utf-8 -*-
"""
jinja2._stringdefs
~~~~~~~~~~~~~~~~~~
Strings of all Unicode characters of a certain category.
Used for matching in Unicode-aware languages. Run to regenerate.
Inspired by chartypes_create.py from the MoinMoin project, original
implementation from Pygments.
:co... | apache-2.0 |
TheReverend403/ricedb | cappuccino/nickserv.py | 1 | 1603 | # This file is part of cappuccino.
#
# cappuccino 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.
#
# cappuccino is distributed i... | gpl-3.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-57/modules/sheets/lib/python2.7/site-packages/setuptools/command/install.py | 529 | 4683 | from distutils.errors import DistutilsArgError
import inspect
import glob
import warnings
import platform
import distutils.command.install as orig
import setuptools
# Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for
# now. See https://github.com/pypa/setuptools/issues/199/
_install = orig.in... | gpl-3.0 |
barachka/odoo | addons/event/res_partner.py | 329 | 1228 | # -*- 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 |
IllusionRom-deprecated/android_platform_tools_idea | plugins/hg4idea/testData/bin/mercurial/lsprofcalltree.py | 100 | 2760 | """
lsprofcalltree.py - lsprof output which is readable by kcachegrind
Authors:
* David Allouche <david <at> allouche.net>
* Jp Calderone & Itamar Shtull-Trauring
* Johan Dahlin
This software may be used and distributed according to the terms
of the GNU General Public License, incorporated herein by refer... | apache-2.0 |
pdamodaran/yellowbrick | tests/checks.py | 1 | 4707 | # tests.checks
# Performs checking that visualizers adhere to Yellowbrick conventions.
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Mon May 22 11:18:06 2017 -0700
#
# Copyright (C) 2017 District Data Labs
# For license information, see LICENSE.txt
#
# ID: checks.py [4131cb1] benjamin@ben... | apache-2.0 |
jymannob/CouchPotatoServer | couchpotato/core/notifications/notifymyandroid.py | 81 | 2345 | from couchpotato.core.helpers.variable import splitString
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
import pynma
import six
log = CPLog(__name__)
autoload = 'NotifyMyAndroid'
class NotifyMyAndroid(Notification):
def notify(self, message = '', data = ... | gpl-3.0 |
lmorchard/django | tests/template_tests/syntax_tests/test_include.py | 322 | 11505 | from django.template import (
Context, Engine, TemplateDoesNotExist, TemplateSyntaxError,
)
from django.test import SimpleTestCase
from ..utils import setup
from .test_basic import basic_templates
include_fail_templates = {
'include-fail1': '{% load bad_tag %}{% badtag %}',
'include-fail2': '{% load broke... | bsd-3-clause |
HiroIshikawa/21playground | payblog/blog/lib/python3.5/site-packages/pygments/formatters/svg.py | 76 | 5840 | # -*- coding: utf-8 -*-
"""
pygments.formatters.svg
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for SVG output.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt, get... | mit |
TNT-Samuel/Coding-Projects | DNS Server/Source - Copy/Lib/site-packages/dask/dataframe/tests/test_merge_column_and_index.py | 5 | 5592 | import dask.dataframe as dd
import numpy as np
import pandas as pd
import pytest
from dask.dataframe.utils import assert_eq, PANDAS_VERSION
# Fixtures
# ========
@pytest.fixture
def df_left():
# Create frame with 10 partitions
# Frame has 11 distinct idx values
partition_sizes = np.array([3, 4, 2, 5, 3, ... | gpl-3.0 |
jimpick/jaikuengine | common/test/validate.py | 34 | 7121 | # Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
wkentaro/chainer | chainerx/__init__.py | 5 | 2837 | import os
import warnings
try:
from chainerx import _build_info
except ImportError:
raise ImportError(
'''\
Cannot import chainerx because _build_info.py cannot be found.
The chainer and chainerx module being imported was not correctly \
installed by `pip install`.
It may be caused by either of the f... | mit |
NeilBryant/check_mk | web/htdocs/main.py | 2 | 2938 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | gpl-2.0 |
mikewiebe-ansible/ansible | lib/ansible/modules/cloud/cloudstack/cs_staticnat.py | 13 | 6997 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... | gpl-3.0 |
charlesvdv/servo | tests/wpt/web-platform-tests/tools/py/testing/process/test_cmdexec.py | 163 | 1127 | import py
from py.process import cmdexec
def exvalue():
return py.std.sys.exc_info()[1]
class Test_exec_cmd:
def test_simple(self):
out = cmdexec('echo hallo')
assert out.strip() == 'hallo'
assert py.builtin._istext(out)
def test_simple_newline(self):
import sys
ou... | mpl-2.0 |
albertjan/pypyjs | website/js/pypy.js-0.2.0/lib/modules/test/test_stat.py | 54 | 5696 | import unittest
import os
from test.test_support import TESTFN, run_unittest
import stat
class TestFilemode(unittest.TestCase):
file_flags = {'SF_APPEND', 'SF_ARCHIVED', 'SF_IMMUTABLE', 'SF_NOUNLINK',
'SF_SNAPSHOT', 'UF_APPEND', 'UF_COMPRESSED', 'UF_HIDDEN',
'UF_IMMUTABLE', 'UF_... | mit |
vmturbo/nova | nova/cmd/api_os_compute.py | 6 | 1735 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
bkirui/odoo | addons/sale_margin/sale_margin.py | 172 | 4679 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
gauribhoite/personfinder | rtd/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/specifiers.py | 258 | 28472 | # Copyright 2014 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | apache-2.0 |
wuxianghou/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/handlers/showresults.py | 146 | 1943 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | bsd-3-clause |
kevinlu1987/hadoop-mc | src/contrib/hod/hodlib/Hod/hadoop.py | 167 | 27677 | #Licensed to the Apache Software Foundation (ASF) under one
#or more contributor license agreements. See the NOTICE file
#distributed with this work for additional information
#regarding copyright ownership. The ASF licenses this file
#to you under the Apache License, Version 2.0 (the
#"License"); you may not use thi... | apache-2.0 |
marcosalcazar/django-currencies | currencies/management/commands/updatecurrencies.py | 2 | 4777 | # -*- coding: utf-8 -*-
import logging
from datetime import datetime
from decimal import Decimal
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from .currencies import Command as CurrencyCommand
from ...models import Currency
class Command(CurrencyCommand):
help = "Updat... | bsd-3-clause |
tessalt/ec-polymer-demo | node_modules/web-component-tester/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py | 2214 | 1347 | #!/usr/bin/env python
import re
import json
# http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | bsd-3-clause |
mensler/ansible | lib/ansible/modules/cloud/cloudstack/cs_host.py | 45 | 15623 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.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 Lice... | gpl-3.0 |
sparkslabs/kamaelia_ | Sketches/RJL/bittorrent/BitTorrent/launchmany-curses.py | 4 | 10226 | #!/usr/bin/env python
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/li... | apache-2.0 |
benpatterson/edx-platform | lms/djangoapps/instructor/tests/test_enrollment_store_provider.py | 136 | 2709 | """
Exercises tests on the base_store_provider file
"""
from django.test import TestCase
from instructor.enrollment_report import AbstractEnrollmentReportProvider
from instructor.paidcourse_enrollment_report import PaidCourseEnrollmentReportProvider
class BadImplementationAbstractEnrollmentReportProvider(AbstractEnr... | agpl-3.0 |
kartikdhar/djangotest | virt1/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/models.py | 396 | 2158 | """
The GeometryColumns and SpatialRefSys models for the PostGIS backend.
"""
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class PostGISGeometryColumns(models.Model):
... | mit |
pmarks-net/dtella | dtella/modules/push_dnsupdate.py | 4 | 1997 | """
Dtella - DNS Updater Plugin (Dynamic DNS)
Copyright (C) 2007 Dtella Labs (http://www.dtella.org)
Copyright (C) 2007 Jacob Feisley (http://www.feisley.com/)
Copyright (C) 2007 Paul Marks (http://www.pmarks.net/)
$Id$
This program is free software; you can redistribute it and/or
modify it under the terms of the ... | gpl-2.0 |
LearnEra/LearnEraPlaftform | lms/djangoapps/verify_student/tests/test_views.py | 1 | 29571 | # encoding: utf-8
"""
verify_student/start?course_id=MITx/6.002x/2013_Spring # create
/upload_face?course_id=MITx/6.002x/2013_Spring
/upload_photo_id
/confirm # mark_ready()
---> To Payment
"""
import json
import mock
import urllib
import decimal
from mock import patch, Mo... | agpl-3.0 |
kongseokhwan/kulcloud-iitp-neutron | neutron/tests/tempest/services/identity/v3/json/identity_client.py | 17 | 21676 | # Copyright 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
bgxavier/neutron | neutron/db/migration/alembic_migrations/versions/4dbe243cd84d_nsxv.py | 47 | 7134 | # Copyright 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
TedaLIEz/sentry | src/sentry/utils/cache.py | 15 | 3324 | """
sentry.utils.cache
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import functools
import logging
import random
import time
from django.core.cache import cache
... | bsd-3-clause |
pra85/calibre | src/calibre/utils/lock.py | 5 | 5157 | __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
'''
Secure access to locked files from multiple processes.
'''
from calibre.constants import iswindows, __appname__, \
win32api, win32event, winerror, fcntl
import time... | gpl-3.0 |
ironbox360/django | tests/auth_tests/models/invalid_models.py | 251 | 1340 | from django.contrib.auth.models import AbstractBaseUser, UserManager
from django.db import models
class CustomUserNonUniqueUsername(AbstractBaseUser):
"""
A user with a non-unique username.
This model is not invalid if it is used with a custom authentication
backend which supports non-unique username... | bsd-3-clause |
newmath/FuturesAndOptionsTradingSimulation | scripts/FuturesHashConvert.py | 1 | 2590 | from datetime import date
from TimeSeriesFunctions import GetDatesAndValuesByDateRange
def ConvertFuturesHashToCurvesHash(FUTURES,CURVES,minDate=date(1900,1,1),maxDate=date(2099,12,31)):
for code in FUTURES.keys():
for year in FUTURES[code].keys():
for month in FUTURES[code][year].keys():
... | mit |
NASA-Tournament-Lab/CoECI-CMS-Healthcare-Fraud-Prevention | study/hfppnetwork/hfppnetwork/wsgi.py | 3 | 1434 | """
WSGI config for hfppnetwork project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATIO... | apache-2.0 |
LChristakis/chalice-hunter | lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py | 87 | 2715 | import hashlib
import os
from pip._vendor.lockfile import FileLock
from ..cache import BaseCache
def _secure_open_write(filename, fmode):
# We only want to write to this file, so open it in write only mode
flags = os.O_WRONLY
# os.O_CREAT | os.O_EXCL will fail if the file already exists, so we only
... | mit |
Ashaba/rms | rmslocalenv/lib/python2.7/site-packages/pip/utils/appdirs.py | 340 | 8811 | """
This code was taken from https://github.com/ActiveState/appdirs and modified
to suit our purposes.
"""
from __future__ import absolute_import
import os
import sys
from pip.compat import WINDOWS, expanduser
from pip._vendor.six import PY2, text_type
def user_cache_dir(appname):
r"""
Return full path to t... | mit |
X-dark/Flexget | flexget/plugins/input/inputs.py | 14 | 2342 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('inputs')
class PluginInputs(object):
"""
Allows the same input plugin to be configured multiple times in a task.
Example::
inputs:... | mit |
zaitcev/swift-lfs | swift/proxy/controllers/account.py | 1 | 6160 | # Copyright (c) 2010-2012 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 |
notspiff/kodi-cmake | tools/EventClients/lib/python/xbmcclient.py | 164 | 22913 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# 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) ... | gpl-2.0 |
shumik/skencil-c | Sketch/Graphics/selinfo.py | 1 | 7864 | # Sketch - A Python-based interactive drawing program
# Copyright (C) 1996, 1997, 1998 by Bernhard Herzog
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the Lice... | gpl-2.0 |
JBonsink/GSOC-2013 | tools/ns-allinone-3.14.1/ns-3.14.1/bindings/python/topsort.py | 218 | 13288 | # topsort - dependency (topological) sorting and cycle finding functions
# Copyright (C) 2007 RADLogic
#
# This library 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;
# version 2.1 of the License.
# ... | gpl-3.0 |
keks2293/kernel_zte | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
hakonsbm/nest-simulator | extras/ConnPlotter/examples/connplotter_tutorial.py | 18 | 27730 | # -*- coding: utf-8 -*-
#
# connplotter_tutorial.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 Li... | gpl-2.0 |
kimond/miamm | miamm/recipes/serializers.py | 1 | 3262 | from rest_framework import serializers, fields
from recipes.models import Recipe, Step, RecipeIngredient, Ingredient, QuantityType
class QuantityTypeSerializer(serializers.ModelSerializer):
class Meta:
model = QuantityType
fields = ('name',)
class IngredientSerializer(serializers.ModelSerializer... | bsd-3-clause |
idea4bsd/idea4bsd | python/lib/Lib/site-packages/django/db/backends/mysql/creation.py | 311 | 3019 | from django.db.backends.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated MySQL column
# types, as strings. Column-type strings can contain format strings; they'll
# be interpolated against the values of Field.__dict_... | apache-2.0 |
yaoandw/joke | Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/test/ninja/normalize-paths-win/gyptest-normalize-paths.py | 165 | 1406 | #!/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.
"""
Make sure paths are normalized with VS macros properly expanded on Windows.
"""
import TestGyp
import sys
if sys.platform == 'win32':... | mit |
rishig/zulip | zerver/migrations/0037_disallow_null_string_id.py | 16 | 1423 | # -*- coding: utf-8 -*-
from django.db import migrations, models
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.db.utils import IntegrityError
def set_string_id_using_domain(apps: StateApps, schema_editor: DatabaseSchemaEditor... | apache-2.0 |
guerrerocarlos/odoo | addons/sale_crm/sale_crm.py | 320 | 1429 | # -*- 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 |
avanov/django | django/contrib/gis/db/backends/base/features.py | 20 | 3977 | import re
from functools import partial
from django.contrib.gis.db.models import aggregates
class BaseSpatialFeatures(object):
gis_enabled = True
# Does the database contain a SpatialRefSys model to store SRID information?
has_spatialrefsys_table = True
# Does the backend support the django.contrib... | bsd-3-clause |
comprna/SUPPA | scripts/generate_boxplot_event.py | 1 | 5584 | # The next script will format a phenotype table (junctions, events, trasncripts...)
# for runnning FastQTL analysis
#This version is for formatting the SCLC phenotype
"""
@authors: Juan L. Trincado
@email: juanluis.trincado@upf.edu
generate_boxplot_event.py: Generates a boxplot with the PSI values, given which sampl... | mit |
UrbanCCD-UChicago/sf-plenario-backend | wopr/etl.py | 1 | 17862 | import os
import numpy as np
from datetime import datetime
from wopr.database import task_engine as engine, Base
from wopr.models import crime_table, MasterTable, sf_crime_table,\
sf_meta_table, shp2table
from wopr.helpers import download_crime
from datetime import datetime, date
from sqlalchemy import Column, Inte... | mit |
misterhat/youtube-dl | youtube_dl/extractor/goshgay.py | 14 | 1544 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
)
from ..utils import (
parse_duration,
)
class GoshgayIE(InfoExtractor):
_VALID_URL = r'https?://www\.goshgay\.com/video(?P<id>\d+?)($|/)'
_TEST = {
'url'... | unlicense |
dragoon/kilogram | kilogram/entity_linking/app.py | 1 | 3555 | #!/usr/bin/env python
"""
./app.py --dbpedia-data-dir /home/roman/dbpedia --ner-host diufpc54.unifr.ch --types-table typogram --hbase-host diufpc304
"""
import argparse
import os.path
from flask import Flask, jsonify, request
import kilogram
from kilogram.dataset.entity_linking.gerbil import DataSet
from kilogram.ent... | apache-2.0 |
denischevalier/dkb | keylog_parser.py | 1 | 5565 | #!/usr/bin/python3
##########################################################################
## ##
## dkb: Simple Python Keybinder for Linux ##
## Copyright (C) 2014 chevalierdenis@gmx.com ##
#... | gpl-3.0 |
ytsarev/rally | rally/openstack/common/db/options.py | 1 | 8175 | # 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
# distributed u... | apache-2.0 |
jjmleiro/hue | desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/chart/pie_chart.py | 10 | 4723 |
#Autogenerated schema
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed,
Bool,
MinMax,
Integer,
NoneSet,
Float,
Alias,
Sequence,
)
from openpyxl.descriptors.excel import ExtensionList, Percentage
from openpyxl.descriptors.nested import (... | apache-2.0 |
tornadozou/tensorflow | tensorflow/user_ops/duplicate_op_test.py | 146 | 1303 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ABaldwinHunter/django-clone | django/contrib/admin/templatetags/log.py | 499 | 2080 | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... | bsd-3-clause |
j0nathan33/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/videofyme.py | 19 | 1697 | import re
from .common import InfoExtractor
from ..utils import (
find_xpath_attr,
determine_ext,
)
class VideofyMeIE(InfoExtractor):
_VALID_URL = r'https?://(www\.videofy\.me/.+?|p\.videofy\.me/v)/(?P<id>\d+)(&|#|$)'
IE_NAME = u'videofy.me'
_TEST = {
u'url': u'http://www.videofy.me/thisi... | gpl-3.0 |
PoppyPop/docker | webui-aria2/autounrar.py | 1 | 4224 | #!/usr/bin/python3
import subprocess
import os
import json
import shutil
maxlevel = 1
def CheckRarComplete( path, file, associatedFiles ):
plsar = subprocess.Popen(['lsar', '-j', os.path.join(path, file)], stdout=subprocess.PIPE)
lsarout, lsarerr = plsar.communicate()
jsonObject = json.loads(lsarout.decode("utf... | gpl-3.0 |
openhatch/oh-mainline | vendor/packages/sphinx/sphinx/util/smartypants.py | 35 | 11142 | r"""
This is based on SmartyPants.py by `Chad Miller`_ <smartypantspy@chad.org>,
version 1.5_1.6.
Copyright and License
=====================
SmartyPants_ license::
Copyright (c) 2003 John Gruber
(http://daringfireball.net/)
All rights reserved.
Redistribution and use in source and binary forms, wit... | agpl-3.0 |
aaronsw/watchdog | test/webtest.py | 3 | 1251 | import sys
sys.path.insert(0, '.')
sys.path.append('vendor')
import web
from web.browser import AppBrowser
import web.test as webtest
from web.test import * #including main
import settings
settings.db = web.database(dbn=os.environ.get('DATABASE_ENGINE', 'postgres'), db='watchdog_test')
db = settings.db
db.printing =... | agpl-3.0 |
ramielrowe/magnum | magnum/service/periodic.py | 4 | 4642 | # Copyright (c) 2015 Intel Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
oliverhr/odoo | doc/_themes/odoodoc/html_domain.py | 129 | 4109 | # -*- coding: utf-8 -*-
from docutils import nodes, utils
from docutils.parsers.rst import Directive, directives, docutils
from docutils.parsers.rst.directives.body import LineBlock
import sphinx.roles
from sphinx.domains import Domain
def setup(app):
app.add_domain(HtmlDomain)
app.add_node(div, html=(
... | agpl-3.0 |
benoit-canet/pyghmi | pyghmi/ipmi/oem/lookup.py | 1 | 1121 | # Copyright 2015 Lenovo 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
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 |
VamsikrishnaNallabothu/pox | pox/lib/pxpcap/strip_openflow.py | 47 | 2648 | # Copyright 2012,2013 James McCauley
#
# 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 ... | apache-2.0 |
pawaranand/phrerp | erpnext/buying/doctype/supplier/supplier.py | 20 | 4685 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe.utils import cint
from frappe import msgprint, _
from frappe.model.naming import make_autoname
from... | agpl-3.0 |
rbarraud/pelican | pelican/__init__.py | 12 | 19454 | # -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import argparse
import collections
import locale
import logging
import os
import re
import sys
import time
import six
# pelican.log has to be the first pelican module to be loaded
# because logging.setLoggerClass has to be called before ... | agpl-3.0 |
danjuanzzf/zzfhomework | H5/renwu11/gulptest/node_modules/.3.5.0@node-gyp/gyp/pylib/gyp/MSVSNew.py | 1835 | 12124 | # 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.
"""New implementation of Visual Studio project generation."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the replacemen... | apache-2.0 |
molobrakos/home-assistant | homeassistant/helpers/config_validation.py | 3 | 27057 | """Helpers for config validation using voluptuous."""
import inspect
import logging
import os
import re
from datetime import (timedelta, datetime as datetime_sys,
time as time_sys, date as date_sys)
from socket import _GLOBAL_DEFAULT_TIMEOUT
from typing import Any, Union, TypeVar, Callable, Sequen... | apache-2.0 |
Sterlingcoin/Sterlingcoin-1.5-Lite-Edition-Linux-Source | contrib/bitrpc/bitrpc.py | 2348 | 7835 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | mit |
yannickcr/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/downloader/mplayer.py | 19 | 1406 | import os
import subprocess
from .common import FileDownloader
from ..utils import (
encodeFilename,
)
class MplayerFD(FileDownloader):
def real_download(self, filename, info_dict):
url = info_dict['url']
self.report_destination(filename)
tmpfilename = self.temp_name(filename)
... | gpl-3.0 |
A-deLuna/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_stream.py | 496 | 2872 | #!/usr/bin/env python
#
# Copyright 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... | mpl-2.0 |
davgibbs/django | tests/field_deconstruction/tests.py | 189 | 18358 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.test import SimpleTestCase, override_settings
from django.test.utils import isolate_lru_cache
from django.utils import six
class FieldDeconstructionTests(SimpleTestCase):
"""
Tests the deconstruct() ... | bsd-3-clause |
sbidoul/odoo | addons/point_of_sale/report/pos_invoice.py | 317 | 2393 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
AunShiLord/sympy | sympy/physics/quantum/tests/test_boson.py | 18 | 1480 | from sympy import sqrt, exp, S, prod
from sympy.physics.quantum import Dagger, Commutator, qapply
from sympy.physics.quantum.boson import BosonOp
from sympy.physics.quantum.boson import (
BosonFockKet, BosonFockBra, BosonCoherentKet, BosonCoherentBra)
def test_bosonoperator():
a = BosonOp('a')
b = BosonOp... | bsd-3-clause |
yashu-seth/BinPy | BinPy/examples/source/ic/Series_7400/IC7427.py | 5 | 1254 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=2>
# Usage of IC 7427
# <codecell>
from __future__ import print_function
from BinPy import *
# <codecell>
# Usage of IC 7427:
ic = IC_7427()
print(ic.__doc__)
# <codecell>
# The Pin configuration is:
inp = {1: 1, 2: 0, 3: 0, 4: 0, 5: 0, ... | bsd-3-clause |
metagriffin/raspi-door | raspi_door/button.py | 1 | 2666 | # -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: $Id$
# auth: metagriffin <mg.github@metagriffin.net>
# date: 2014/05/27
# copy: (C) Copyright 2014-EOT metagriffin -- see LICENSE.txt
#-------------------------------------------------------------------------... | gpl-3.0 |
fabioz/PyDev.Debugger | tests_python/test_suspended_frames_manager.py | 2 | 6407 | import sys
from _pydevd_bundle.pydevd_constants import int_types, GENERATED_LEN_ATTR_NAME
from _pydevd_bundle.pydevd_resolver import MAX_ITEMS_TO_HANDLE, TOO_LARGE_ATTR
from _pydevd_bundle import pydevd_frame_utils
def get_frame():
var1 = 1
var2 = [var1]
var3 = {33: [var1]}
return sys._getframe()
de... | epl-1.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.