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 |
|---|---|---|---|---|---|
tjduigna/exatomic | exatomic/widgets/widget_utils.py | 3 | 9089 | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2018, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
"""
Widget Utilities
#########################
Widget layout and structure.
"""
import six
from collections import OrderedDict
from ipywidgets import VBox, Layout, FloatSlider, IntSl... | apache-2.0 |
neurobin/acme-tiny | acme_tiny.py | 1 | 10110 | #!/usr/bin/env python
import argparse, subprocess, json, os, sys, base64, binascii, time, hashlib, re, copy, textwrap, logging
try:
from urllib.request import urlopen # Python 3
except ImportError:
from urllib2 import urlopen # Python 2
#DEFAULT_CA = "https://acme-staging.api.letsencrypt.org"
DEFAULT_CA = "htt... | mit |
ganeshnalawade/ansible | test/units/_vendor/test_vendor.py | 23 | 2128 | # (c) 2020 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
import os
import pkgutil
import pytest
import sys
from units.compat.mock import MagicMock, NonCallableMagicMo... | gpl-3.0 |
sephii/django | django/contrib/admin/templatetags/admin_modify.py | 139 | 2353 | from django import template
register = template.Library()
@register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True)
def prepopulated_fields_js(context):
"""
Creates a list of prepopulated_fields that should render Javascript for
the prepopulated fields for both the admin form and i... | bsd-3-clause |
michaelbrunnbauer/rdf2rdb | settings.py | 1 | 5319 | from datetime import datetime as _datetime
import iso8601 as _iso8601
# set to 'mysql' or 'postgres'
dbtype='mysql'
dbhost=''
dbname='rdf2rdb'
dbuser='rdf2rdb'
dbpasswd=''
# postgresql does not allow to connect to a server without specifying a
# database and does not allow to drop the database you are connected to.
#... | gpl-2.0 |
hdmetor/scikit-learn | sklearn/utils/optimize.py | 135 | 5671 | """
Our own implementation of the Newton algorithm
Unlike the scipy.optimize version, this version of the Newton conjugate
gradient solver uses only one function call to retrieve the
func value, the gradient value and a callable for the Hessian matvec
product. If the function call is very expensive (e.g. for logistic
... | bsd-3-clause |
ardeaf/Reddit-Image-Scraper | redditimagescraper/modules/accessreddit.py | 1 | 2567 | import time
from datetime import datetime
import praw
import prawcore.exceptions
from . import config
# Returns a list of urls posted to the subreddit_name between start_date and end_date.
# The list is in the form: [url, date_string], [url, date_string], [url, date_string], ... ]
def subs_to_download(subreddit_name... | gpl-3.0 |
Shao-Feng/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_default-src_none_style.py | 25 | 3912 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
response.headers.set(
"Content-Security-Policy",
"default-src 'none';script-src '... | bsd-3-clause |
rg3915/spark | spark/selenium/selenium_event.py | 1 | 1303 | import time
from random import choice, randint
from decouple import config
from selenium import webdriver
from gen_address import address
from gen_random_values import gen_string, gen_date, convert_date
HOME = config('HOME')
# page = webdriver.Firefox()
page = webdriver.Chrome(executable_path=HOME + '/chromedriver/ch... | mit |
genome-vendor/cython | build/lib.linux-x86_64-2.6/Cython/Compiler/Errors.py | 8 | 7130 | #
# Errors
#
import sys
from Cython.Utils import open_new_file
import DebugFlags
import Options
class PyrexError(Exception):
pass
class PyrexWarning(Exception):
pass
def context(position):
source = position[0]
assert not (isinstance(source, unicode) or isinstance(source, str)), (
"Please... | apache-2.0 |
PableraShow/Learn-to-program-with-Python-guide | 02 - Functions, logic and conditionals/more_operations-numbers_and_strings.py | 1 | 2156 | # More Operations
# Numbers and Strings
# You can convert a string to a number (float or int) and
# vice versa using a few simple functions.
print "Ex. 1:", int("3")
print "Ex. 2:", float("3.4")
print "Ex. 3:", str(34)
print "Ex. 4:", str(3.4)
print
# Since the above outputs look exactly the same as... | mit |
mrfuxi/django | tests/m2m_recursive/tests.py | 424 | 5410 | from __future__ import unicode_literals
from operator import attrgetter
from django.test import TestCase
from .models import Person
class RecursiveM2MTests(TestCase):
def setUp(self):
self.a, self.b, self.c, self.d = [
Person.objects.create(name=name)
for name in ["Anne", "Bill"... | bsd-3-clause |
saurabh6790/frappe | frappe/website/context.py | 1 | 9236 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, os, json
from frappe.website.doctype.website_settings.website_settings import get_website_settings
from frappe.website.router import get_page_context
from frappe.m... | mit |
cmdunkers/winter_ws | protobuf-2.6.0/gtest/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... | bsd-3-clause |
emilk/sproxel | distro/common/lib/httplib.py | 50 | 49485 | """HTTP/1.1 client library
<intro stuff goes here>
<other stuff, too>
HTTPConnection goes through a number of "states", which define when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:
(null)
|
| HTTPC... | bsd-3-clause |
bslatkin/8-bits | appengine-mapreduce/python/test/testlib/mox.py | 5 | 62680 | #!/usr/bin/env python
#
# Copyright 2008 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 ... | apache-2.0 |
Mj258/weiboapi | srapyDemo/envs/Lib/site-packages/twisted/news/nntp.py | 8 | 32091 | # -*- test-case-name: twisted.news.test.test_nntp -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
NNTP protocol support.
The following protocol commands are currently understood::
LIST LISTGROUP XOVER XHDR
POST GROUP ARTICLE ... | mit |
pferreir/indico-backup | indico/ext/statistics/piwik/implementation.py | 2 | 7990 | # -*- coding: utf-8 -*-
##
##
## This file is part of Indico
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN)
##
## Indico 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... | gpl-3.0 |
kholidfu/django | django/utils/synch.py | 586 | 2558 | """
Synchronization primitives:
- reader-writer lock (preference to writers)
(Contributed to Django by eugene@lazutkin.com)
"""
import contextlib
import threading
class RWLock(object):
"""
Classic implementation of reader-writer lock with preference to writers.
Readers can access a resource simult... | bsd-3-clause |
odoo-brazil/odoo-brazil-addons | l10n_br_search_zip/models/l10n_br_zip.py | 1 | 5338 | # -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2015 TrustCode - www.trustcode.com.br #
# Danimar Ribeiro <danimaribeiro@gmail.co... | agpl-3.0 |
myerpengine/odoo | addons/hr/res_users.py | 44 | 3136 | from openerp.osv import fields, osv
from openerp.tools.translate import _
class res_users(osv.Model):
""" Update of res.users class
- if adding groups to an user, check if base.group_user is in it
(member of 'Employee'), create an employee form linked to it.
"""
_name = 'res.users'
_in... | agpl-3.0 |
heeraj123/oh-mainline | vendor/packages/gdata/src/gdata/contacts/__init__.py | 119 | 28208 | #!/usr/bin/env python
#
# Copyright 2009 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 requir... | agpl-3.0 |
bitifirefly/edx-platform | lms/djangoapps/notification_prefs/tests.py | 137 | 10272 | import json
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from mock import Mock, patch
from notifica... | agpl-3.0 |
ben-hopps/nupic | tests/unit/nupic/research/spatial_pooler_cpp_api_test.py | 35 | 1320 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | agpl-3.0 |
0x0all/nupic | py/nupic/encoders/multi.py | 2 | 5878 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
J861449197/edx-platform | common/djangoapps/django_comment_common/utils.py | 104 | 2909 | from django_comment_common.models import Role
class ThreadContext(object):
""" An enumeration that represents the context of a thread. Used primarily by the comments service. """
STANDALONE = 'standalone'
COURSE = 'course'
_STUDENT_ROLE_PERMISSIONS = ["vote", "update_thread", "follow_thread", "unfollow_... | agpl-3.0 |
armab/st2 | st2common/tests/unit/test_rbac_resolvers_action.py | 3 | 24521 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 |
yawnosnorous/python-for-android | python3-alpha/python3-src/Lib/test/test_re.py | 49 | 42150 | from test.support import verbose, run_unittest
import re
from re import Scanner
import sys
import string
import traceback
from weakref import proxy
# Misc tests from Tim Peters' re.doc
# WARNING: Don't change details in these tests if you don't know
# what you're doing. Some of these tests were carefully modeled to
#... | apache-2.0 |
bcoca/ansible | test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/modules/cli_config.py | 47 | 15653 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"s... | gpl-3.0 |
jessstrap/servotk | tests/wpt/web-platform-tests/tools/py/conftest.py | 161 | 2347 | import py
import sys
pytest_plugins = 'doctest pytester'.split()
collect_ignore = ['build', 'doc/_build']
import os, py
pid = os.getpid()
def pytest_addoption(parser):
group = parser.getgroup("pylib", "py lib testing options")
group.addoption('--runslowtests',
action="store_true", dest="runslowt... | mpl-2.0 |
jernsthausen/datesplitter | lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py | 2929 | 3791 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... | mit |
hbiyik/tribler | src/tribler-core/tribler_core/modules/metadata_store/tests/test_tracker_state.py | 1 | 1420 | from ipv8.keyvault.crypto import default_eccrypto
from pony.orm import db_session
from tribler_core.modules.metadata_store.store import MetadataStore
from tribler_core.tests.tools.base_test import TriblerCoreTest
from tribler_core.utilities.tracker_utils import MalformedTrackerURLException
class TestTrackerState(Tr... | lgpl-3.0 |
cslzchen/osf.io | osf_tests/test_draft_registration.py | 3 | 30690 | import mock
import pytest
import datetime
from framework.auth.core import Auth
from framework.exceptions import PermissionsError
from osf.exceptions import UserNotAffiliatedError, DraftRegistrationStateError, NodeStateError
from osf.models import RegistrationSchema, DraftRegistration, DraftRegistrationContributor, Nod... | apache-2.0 |
kingvuplus/xrd-alliance | lib/python/Components/Renderer/Canvas.py | 49 | 1478 | from Renderer import Renderer
from enigma import eCanvas, eRect, ePoint, gRGB
class Canvas(Renderer):
GUI_WIDGET = eCanvas
def __init__(self):
Renderer.__init__(self)
self.sequence = None
self.draw_count = 0
def pull_updates(self):
if self.instance is None:
return
# do an incremental update
list ... | gpl-2.0 |
deepmind/grid-cells | utils.py | 1 | 5720 | # Copyright 2018 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
haridsv/pip | tests/functional/test_install_user.py | 27 | 11282 | """
tests specific to "pip install --user"
"""
import os
import textwrap
import pytest
from os.path import curdir, isdir, isfile
from pip.compat import uses_pycache, cache_from_source
from tests.lib.local_repos import local_checkout
from tests.lib import pyversion
def _patch_dist_in_site_packages(script):
site... | mit |
zedr/django | tests/get_earliest_or_latest/tests.py | 41 | 6119 | from __future__ import unicode_literals
from datetime import datetime
from django.test import TestCase
from .models import Article, Person
class EarliestOrLatestTests(TestCase):
"""Tests for the earliest() and latest() objects methods"""
def tearDown(self):
"""Makes sure Article has a get_latest_b... | bsd-3-clause |
dabiboo/youtube-dl | youtube_dl/extractor/pinkbike.py | 136 | 3411 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
remove_end,
remove_start,
str_to_int,
unified_strdate,
)
class PinkbikeIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www\.)?pinkbike\.com/video/|es\.pinkb... | unlicense |
KDB2/OpenReliability | veusz/plugins/datasetplugin.py | 2 | 74727 | # -*- coding: utf-8 -*-
# Copyright (C) 2010 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# 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... | gpl-2.0 |
ovnicraft/openerp-restaurant | auth_openid/controllers/main.py | 382 | 10399 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
GarySparrow/mFlaskWeb | venv/Lib/site-packages/sqlalchemy/orm/evaluator.py | 21 | 5032 | # orm/evaluator.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import operator
from ..sql import operators
from .. import util
class Unevaluatab... | mit |
HydrelioxGitHub/home-assistant | homeassistant/components/homekit_controller/binary_sensor.py | 2 | 1445 | """Support for Homekit motion sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.homekit_controller import (
KNOWN_ACCESSORIES, HomeKitEntity)
DEPENDENCIES = ['homekit_controller']
_LOGGER = logging.getLogger(__name__)
def setup_platfo... | apache-2.0 |
jonashaag/django-nonrel-nohistory | django/contrib/gis/db/backends/oracle/models.py | 310 | 2184 | """
The GeometryColumns and SpatialRefSys models for the Oracle spatial
backend.
It should be noted that Oracle Spatial does not have database tables
named according to the OGC standard, so the closest analogs are used.
For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns
model and the `SDO_... | bsd-3-clause |
Orange-OpenSource/tinypyki | setup.py | 1 | 1758 | # Copyright (C) 2014 Orange
# This software is distributed under the terms and conditions of the 'BSD
# 3-Clause' license which can be found in the 'LICENSE.txt' file in this package
# distribution or at 'http://opensource.org/licenses/BSD-3-Clause'.
#!/usr/bin/env python
"""Setup script for tinypyki."""
from distu... | bsd-3-clause |
chensuchun/fas | plugins/fas-plugin-yubikey/burn-key.py | 11 | 2393 | #!/usr/bin/python
# ykpersonalize -ofixed=ccccccccccci -afcaa0c5bf2e83ec040e4aeb7f8565293 -ouid=1e7f1da7d6d1
from fedora.client import AccountSystem, AuthError
from getpass import getpass, getuser
import subprocess, sys, gettext
from optparse import OptionParser
t = gettext.translation('fas', '/usr/share/locale', fal... | gpl-2.0 |
40223123/raven | static/Brython3.1.0-20150301-090019/Lib/test/test_re.py | 718 | 56009 | # FIXME: brython: implement test.support
#from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
# cpython_only
verbose = True
# FIXME: brython: Not used in this module ?
#import io
import re
# FIXME: brython: implement re.Scanner
#from re import Scanner
import sre_constants
import sys... | gpl-3.0 |
nagyistoce/edx-platform | cms/djangoapps/contentstore/management/commands/export_convert_format.py | 34 | 2454 | """
Script for converting a tar.gz file representing an exported course
to the archive format used by a different version of export.
Sample invocation: ./manage.py export_convert_format mycourse.tar.gz ~/newformat/
"""
import os
from path import path
from django.core.management.base import BaseCommand, CommandError
fr... | agpl-3.0 |
joshmoore/bioformats | components/xsd-fu/python/generateDS/process_includes.py | 17 | 5947 | #!/usr/bin/env python
# -*- mode: pymode; coding: latin1; -*-
"""
Synopsis:
Recusively process the include elements in an XML Schema file.
Produce a single file that contains all included content.
Input is read either from a file or from stdin.
Output is written either to a file or to stdout.
Usage:
... | gpl-2.0 |
jetskijoe/SickGear | lib/unidecode/x06a.py | 252 | 4674 | data = (
'Di ', # 0x00
'Zhuang ', # 0x01
'Le ', # 0x02
'Lang ', # 0x03
'Chen ', # 0x04
'Cong ', # 0x05
'Li ', # 0x06
'Xiu ', # 0x07
'Qing ', # 0x08
'Shuang ', # 0x09
'Fan ', # 0x0a
'Tong ', # 0x0b
'Guan ', # 0x0c
'Ji ', # 0x0d
'Suo ', # 0x0e
'Lei ', # 0x0f
'Lu ', # 0x1... | gpl-3.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/test/test_userlist.py | 136 | 1894 | # Check every path through every method of UserList
from UserList import UserList
from test import test_support, list_tests
class UserListTest(list_tests.CommonTest):
type2test = UserList
def test_getslice(self):
super(UserListTest, self).test_getslice()
l = [0, 1, 2, 3, 4]
u = self.t... | gpl-2.0 |
ofekd/servo | tests/wpt/web-platform-tests/tools/py/testing/code/test_assertion.py | 160 | 7843 | import pytest, py
def exvalue():
return py.std.sys.exc_info()[1]
def f():
return 2
def test_assert():
try:
assert f() == 3
except AssertionError:
e = exvalue()
s = str(e)
assert s.startswith('assert 2 == 3\n')
def test_assert_within_finally():
excinfo = py.test.r... | mpl-2.0 |
devilry/devilry-django | devilry/devilry_admin/views/assignment/students/overview.py | 1 | 3478 | # -*- coding: utf-8 -*-
from django.utils.translation import gettext_lazy
from cradmin_legacy import crapp
from cradmin_legacy.crinstance import reverse_cradmin_url
from cradmin_legacy.viewhelpers.listbuilder.itemframe import DefaultSpacingItemFrame
from cradmin_legacy.viewhelpers.listbuilder.lists import RowList
fr... | bsd-3-clause |
teeple/pns_server | work/install/Python-2.7.4/Lib/test/test_bsddb.py | 91 | 11674 | #! /usr/bin/env python
"""Test script for the bsddb C module by Roger E. Masse
Adapted to unittest format and expanded scope by Raymond Hettinger
"""
import os, sys
import unittest
from test import test_support
# Skip test if _bsddb wasn't built.
test_support.import_module('_bsddb')
bsddb = test_support.import_mod... | gpl-2.0 |
kuiwei/edx-platform | lms/djangoapps/instructor/views/api.py | 6 | 78005 | """
Instructor Dashboard API views
JSON views which the instructor dashboard requests.
Many of these GETs may become PUTs in the future.
"""
import StringIO
import json
import logging
import re
import time
import requests
from django.conf import settings
from django_future.csrf import ensure_csrf_cookie
from django.v... | agpl-3.0 |
leesavide/pythonista-docs | Documentation/matplotlib/mpl_examples/pylab_examples/boxplot_demo.py | 12 | 1162 | #!/usr/bin/python
#
# Example boxplot code
#
from pylab import *
# fake up some data
spread= rand(50) * 100
center = ones(25) * 50
flier_high = rand(10) * 100 + 100
flier_low = rand(10) * -100
data =concatenate((spread, center, flier_high, flier_low), 0)
# basic plot
boxplot(data)
# notched plot
figure()
boxplot(d... | apache-2.0 |
Hodorable/0602 | openstack_dashboard/dashboards/project/networks/ports/forms.py | 25 | 4064 | # Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
diegocortassa/TACTIC | src/tactic/ui/widget/swap_display_wdg.py | 1 | 7595 | ###########################################################
#
# Copyright (c) 2009, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
XiaodunServerGroup/xiaodun-platform | common/djangoapps/edxmako/tests.py | 30 | 1489 | from django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from edxmako import add_lookup, LOOKUP
from edxmako.shortcuts import marketing_link
from mock import patch
from util.testing import UrlResetMixin
class ShortcutsTests(UrlResetMixin, TestCase):... | agpl-3.0 |
ClearCorp/odoo-clearcorp | TODO-6.1/ccorp_account/__init__.py | 4 | 2003 | # -*- encoding: utf-8 -*-
##############################################################################
#
# __init__.py
# ccorp_account
# First author: Carlos Vásquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.)
# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
#... | agpl-3.0 |
fjbatresv/odoo | addons/website_mail_group/models/mail_group.py | 321 | 2678 | # -*- coding: utf-8 -*-
from openerp.osv import osv
from openerp import tools
from openerp.tools.translate import _
from openerp.tools.safe_eval import safe_eval as eval
from openerp.addons.website.models.website import slug
class MailGroup(osv.Model):
_inherit = 'mail.group'
def message_get_email_values(sel... | agpl-3.0 |
achals/servo | tests/wpt/css-tests/css21_dev/html4/reference/support/fonts/makegsubfonts.py | 1616 | 14125 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
danalec/dotfiles | sublime/.config/sublime-text-3/Packages/pygments/all/pygments/regexopt.py | 50 | 3067 | # -*- coding: utf-8 -*-
"""
pygments.regexopt
~~~~~~~~~~~~~~~~~
An algorithm that generates optimized regexes for matching long lists of
literal strings.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from re import esc... | mit |
ralphtheninja/cjdns | contrib/python/cjdnsadmin/publicToIp6.py | 18 | 2228 | #!/usr/bin/env python2
# You may redistribute this program 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.
#
# This program is distributed in the hope that it will be useful,
# bu... | gpl-3.0 |
llvtt/mongo-python-driver | test/test_common.py | 1 | 8501 | # Copyright 2011-2014 MongoDB, 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 writin... | apache-2.0 |
taaviteska/django | tests/template_tests/syntax_tests/test_cycle.py | 79 | 6974 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class CycleTagTests(SimpleTestCase):
@setup({'cycle01': '{% cycle a %}'})
def test_cycle01(self):
with self.assertRaises(TemplateSyntaxError):
self.engine.get_template('cycle0... | bsd-3-clause |
lmtierney/watir-snake | tests/browser/elements/hn_tests.py | 1 | 2878 | from re import compile
import pytest
from nerodia.exception import UnknownObjectException
pytestmark = pytest.mark.page('non_control_elements.html')
class TestHnExist(object):
def test_returns_true_if_the_element_exists(self, browser):
assert browser.h1(id='header1').exists is True
assert brows... | mit |
eemirtekin/edx-platform | common/djangoapps/xblock_django/user_service.py | 104 | 2842 | """
Support for converting a django user to an XBlock user
"""
from django.contrib.auth.models import User
from opaque_keys.edx.keys import CourseKey
from xblock.reference.user_service import XBlockUser, UserService
from student.models import anonymous_id_for_user, get_user_by_username_or_email
ATTR_KEY_IS_AUTHENTICAT... | agpl-3.0 |
aayushidwivedi01/spark-tk | regression-tests/sparktkregtests/testcases/frames/lda_groupby_flow_test.py | 11 | 3240 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel 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 require... | apache-2.0 |
Work4Labs/lettuce | tests/integration/lib/Django-1.3/django/contrib/localflavor/tr/forms.py | 159 | 3430 | """
TR-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select, CharField
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits_... | gpl-3.0 |
mattgiguere/scikit-learn | sklearn/utils/arpack.py | 265 | 64837 | """
This contains a copy of the future version of
scipy.sparse.linalg.eigen.arpack.eigsh
It's an upgraded wrapper of the ARPACK library which
allows the use of shift-invert mode for symmetric matrices.
Find a few eigenvectors and eigenvalues of a matrix.
Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/
"""
#... | bsd-3-clause |
slevenhagen/odoo-npg | addons/payment_ogone/controllers/main.py | 389 | 1179 | # -*- coding: utf-8 -*-
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class OgoneController(http.Controller):
_accept_url = '/payment/ogone/test/accept'
_decline_url = '/payment/ogone/test/decline'
... | agpl-3.0 |
BMan-L/shadowsocks | shadowsocks/daemon.py | 386 | 5602 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
willthames/ansible | lib/ansible/modules/network/a10/a10_server_axapi3.py | 54 | 9517 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage A10 Networks slb server objects
(c) 2014, Mischa Peters <mpeters@a10networks.com>, 2016, Eric Chou <ericc@a10networks.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 ... | gpl-3.0 |
aforalee/rally | tests/unit/plugins/openstack/scenarios/nova/test_keypairs.py | 3 | 2647 | # Copyright 2015: Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | apache-2.0 |
ahmadshahwan/cohorte-runtime | python/src/lib/python/pelix/remote/transport/commons.py | 3 | 11987 | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Pelix remote services: Abstract RPC implementation
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.5.7
:status: Beta
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0... | apache-2.0 |
map222/spark | examples/src/main/python/mllib/gradient_boosting_regression_example.py | 106 | 2443 | #
# 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 |
BackupGGCode/python-for-android | python-modules/twisted/twisted/conch/test/test_cftp.py | 56 | 33079 | # -*- test-case-name: twisted.conch.test.test_cftp -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE file for details.
"""
Tests for L{twisted.conch.scripts.cftp}.
"""
import time, sys, os, operator, getpass, struct
from StringIO import StringIO
from twisted.conch.test.test_ssh import Crypto, ... | apache-2.0 |
geerlingguy/ansible-modules-extras | cloud/webfaction/webfaction_site.py | 76 | 6889 | #!/usr/bin/python
#
# Create Webfaction website using Ansible and the Webfaction API
#
# ------------------------------------------
#
# (c) Quentin Stafford-Fraser 2015
#
# 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 Lic... | gpl-3.0 |
NL66278/OCB | addons/stock_landed_costs/__openerp__.py | 49 | 1932 | # -*- 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 |
ppiotr/Invenio | modules/websearch/lib/websearchadminlib.py | 3 | 163797 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, ... | gpl-2.0 |
waytai/django | docs/_ext/djangodocs.py | 321 | 12049 | """
Sphinx plugins for Django documentation.
"""
import json
import os
import re
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx import __version__ as sphinx_ver, addnodes
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.util.compat import Directive
from sphinx.util... | bsd-3-clause |
ondra-novak/chromium.src | tools/memory_inspector/classification_rules/default/mmap-android.py | 54 | 1887 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This is a generic rule-tree for classifying memory maps on Android. It is a
# simple hierarchical python data structure (list of dictionaries). Some rules:... | bsd-3-clause |
jspargo/AneMo | thermo/flask/lib/python2.7/site-packages/setuptools/site-patch.py | 720 | 2389 | def __boot():
import sys
import os
PYTHONPATH = os.environ.get('PYTHONPATH')
if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH):
PYTHONPATH = []
else:
PYTHONPATH = PYTHONPATH.split(os.pathsep)
pic = getattr(sys,'path_importer_cache',{})
stdpath = sys.path[le... | gpl-2.0 |
indico/indico | indico/modules/auth/__init__.py | 4 | 6003 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from flask import redirect, request, session
from flask_multipass import MultipassException
from werkzeug.... | mit |
aracnoz/xbmc | addons/service.xbmc.versioncheck/lib/viewer.py | 82 | 3086 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2013 Martijn Kaijser
#
# 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 ... | gpl-2.0 |
google/material-design-icons | update/venv/lib/python3.9/site-packages/pip/_internal/cli/main.py | 2 | 2483 | """Primary application entrypoint.
"""
import locale
import logging
import os
import sys
from typing import List, Optional
from pip._internal.cli.autocompletion import autocomplete
from pip._internal.cli.main_parser import parse_command
from pip._internal.commands import create_command
from pip._internal.exceptions im... | apache-2.0 |
pgum/emi1 | lib/python3.5/site-packages/pip/_vendor/requests/sessions.py | 149 | 24897 | # -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from collections import Mapping
from datetime import datetime
from .auth import _basic_auth_str
from .compat import cookielib, Or... | gpl-3.0 |
knittledan/Location_Search_Prediction | thirdParty/requests/packages/chardet/codingstatemachine.py | 2931 | 2318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
Rickyfox/SPR | SPR_Crawl/label.py | 1 | 4142 | __author__ = 'nick'
from pymongo import MongoClient
class DocLabeler:
"""
Class to manually label the instances in the database
"""
def __init__(self):
"""
Sole constructor. Creates database connection and auto executes the labeling process
:return:
"""
self.... | apache-2.0 |
ThiefMaster/sqlalchemy | lib/sqlalchemy/orm/persistence.py | 1 | 51586 | # orm/persistence.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""private module containing functions used to emit INSERT, UPDATE
and DELETE sta... | mit |
openstack/rally | tests/unit/test_ddt.py | 1 | 4367 | # 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 |
VincentHHL/otp | lib/asn1/test/asn1_SUITE_data/CommonDataTypes.py | 97 | 84084 | CommonDataTypes DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- @prop dataType
-- @descr This types only purpose is to avoid OSS compiler warning : Duplicate PDU tag
-- @
CommonDataTypeWrapper ::= CHOICE
{
wrapAddAnalysisRejectReason AddAnalysisRejectReason,
wrapAddServiceToServiceProfileRejectReason AddServiceToServicePro... | apache-2.0 |
ctrlaltdel/neutrinator | vendor/dogpile/cache/plugins/mako_cache.py | 70 | 2941 | """
Mako Integration
----------------
dogpile.cache includes a `Mako <http://www.makotemplates.org>`_ plugin
that replaces `Beaker <http://beaker.groovie.org>`_
as the cache backend.
Setup a Mako template lookup using the "dogpile.cache" cache implementation
and a region dictionary::
from dogpile.cache import mak... | gpl-3.0 |
canwe/NewsBlur | vendor/feedvalidator/iso639codes.py | 16 | 18360 | """$Id: iso639codes.py 699 2006-09-25 02:01:18Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 699 $"
__date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
i... | mit |
Carmezim/tensorflow | tensorflow/contrib/opt/python/training/moving_average_optimizer.py | 84 | 5839 | # 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 |
apollo13/ansible | test/units/module_utils/common/parameters/test_list_deprecations.py | 37 | 1535 | # -*- 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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
from ansible.module_utils.common.parameters import list_depreca... | gpl-3.0 |
matthiasdiener/spack | var/spack/repos/builtin/packages/gource/package.py | 5 | 2259 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
jinghaomiao/apollo | cyber/python/cyber_py3/cyber.py | 2 | 13565 | #!/usr/bin/env python3
# ****************************************************************************
# Copyright 2019 The Apollo 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... | apache-2.0 |
futurulus/scipy | scipy/integrate/odepack.py | 47 | 7285 | # Author: Travis Oliphant
from __future__ import division, print_function, absolute_import
__all__ = ['odeint']
from . import _odepack
from copy import copy
import warnings
class ODEintWarning(Warning):
pass
_msgs = {2: "Integration successful.",
1: "Nothing was done; the integration time was 0.",
... | bsd-3-clause |
Mahdisadjadi/arxivscraper | arxivscraper/arxivscraper.py | 1 | 9520 | """
A python program to retreive recrods from ArXiv.org in given
categories and specific date range.
Author: Mahdi Sadjadi (sadjadi.seyedmahdi[AT]gmail[DOT]com).
"""
from __future__ import print_function
import xml.etree.ElementTree as ET
import datetime
import time
import sys
PYTHON3 = sys.version_info[0] == 3
if PYT... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.