repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
davidsamu/seal | seal/plot/putil.py | 1 | 26402 | # -*- coding: utf-8 -*-
"""
Collection of plotting-related utility functions.
@author: David Samu
"""
import warnings
from itertools import cycle
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.ticker as plticker
from matplotlib import pyplot as plt
from matplotlib import gridspec ... | gpl-3.0 |
notmyname/swift | swift/obj/reconstructor.py | 1 | 55698 | # Copyright (c) 2010-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 or agree... | apache-2.0 |
tobegit3hub/deep_cnn | java_predict_client/src/main/proto/tensorflow/examples/how_tos/reading_data/fully_connected_preloaded_var.py | 6 | 6287 | # Copyright 2015 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 |
Arafatk/sympy | sympy/printing/tests/test_mathml.py | 62 | 16917 | from sympy import diff, Integral, Limit, sin, Symbol, Integer, Rational, cos, \
tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, E, I, oo, \
pi, GoldenRatio, EulerGamma, Sum, Eq, Ne, Ge, Lt, Float
from sympy.core.compatibility import u
from sympy.printing.mathml import mathml, MathMLPrinter
from s... | bsd-3-clause |
Jai-Chaudhary/termite-data-server | web2py/gluon/highlight.py | 33 | 13310 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
"""
import re
import cgi
__all__ = ['highlight']
class Highlighter(object):
"""Does syntax hi... | bsd-3-clause |
cernanalysispreservation/analysis-preservation.cern.ch | cap/modules/records/resolvers/__init__.py | 6 | 1113 | # -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2018 CERN.
#
# CERN Analysis Preservation Framework 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-2.0 |
jaruba/chromium.src | ppapi/generators/idl_c_header.py | 100 | 12554 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Generator for C style prototypes and definitions """
import glob
import os
import re
import sys
from idl_log import ErrOut, I... | bsd-3-clause |
erudit/eruditorg | eruditorg/core/authorization/defaults.py | 1 | 3418 | # -*- coding: utf-8 -*-
import inspect
from django.utils.translation import gettext_lazy as _
class AuthorizationDef:
def __init__(self, codename, label, staff_only=False):
self.codename = codename
self.label = label
self.staff_only = staff_only
class AuthorizationConfig:
""" Defin... | gpl-3.0 |
khandavally/devstack | EPAQA/vf_allocation.py | 1 | 4020 | from nova.db.sqlalchemy import api as model_api
from nova.db.sqlalchemy.models import PciDevice, Instance, ComputeNode
import collections
#, VFAllocation
session = model_api.get_session()
WORK_LOAD = ["cp","cr"]
def execute_vf_allocation(req_vf,los,req_work,bus_list, *args,**kwargs):
"""This method is ... | apache-2.0 |
2015fallproject/2015fallcase1 | static/Brython3.2.0-20150701-214155/Lib/pydoc_data/topics.py | 694 | 385454 | # -*- coding: utf-8 -*-
# Autogenerated by Sphinx on Sat Mar 23 15:42:31 2013
topics = {'assert': '\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form,... | agpl-3.0 |
mcus/SickRage | lib/hachoir_core/memory.py | 177 | 2417 | import gc
#---- Default implementation when resource is missing ----------------------
PAGE_SIZE = 4096
def getMemoryLimit():
"""
Get current memory limit in bytes.
Return None on error.
"""
return None
def setMemoryLimit(max_mem):
"""
Set memory limit in bytes.
Use value 'None' to d... | gpl-3.0 |
CloCkWeRX/rabbitvcs | rabbitvcs/vcs/git/gittyup/tests/stage.py | 3 | 1995 | #
# test/stage.py
#
import os
from shutil import rmtree
from sys import argv
from optparse import OptionParser
from gittyup.client import GittyupClient
from gittyup.objects import *
from util import touch, change
parser = OptionParser()
parser.add_option("-c", "--cleanup", action="store_true", default=False)
(option... | gpl-2.0 |
nijinashok/sos | sos/plugins/lustre.py | 1 | 1812 | # This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... | gpl-2.0 |
xianjimli/uclib | 3rd-party/googletest/scripts/fuse_gtest_files.py | 346 | 8884 | #!/usr/bin/env python
#
# Copyright 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... | apache-2.0 |
abgworrall/test-infra | hack/verify_boilerplate.py | 1 | 6301 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
web30s/odoo-9.0c-20160402 | hello/templates/openerp/addons/account/tests/test_account_validate_account_move.py | 47 | 1708 | from openerp.addons.account.tests.account_test_classes import AccountingTestCase
class TestAccountValidateAccount(AccountingTestCase):
def test_account_validate_account(self):
account_move_line = self.env['account.move.line']
account_cash = self.env['account.account'].search([('user_type_id.type',... | gpl-3.0 |
CenterForOpenScience/osf.io | addons/zotero/apps.py | 18 | 1188 | import os
from addons.base.apps import BaseAddonAppConfig
HERE = os.path.dirname(os.path.abspath(__file__))
NODE_SETTINGS_TEMPLATE = os.path.join(
HERE,
'templates',
'zotero_node_settings.mako',
)
class ZoteroAddonAppConfig(BaseAddonAppConfig):
name = 'addons.zotero'
label = 'addons_zotero'
f... | apache-2.0 |
neilpelow/wmap-django | venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.py | 360 | 5668 | # -*- coding: utf-8 -*-
"""
SOCKS support for urllib3
~~~~~~~~~~~~~~~~~~~~~~~~~
This contrib module contains provisional support for SOCKS proxies from within
urllib3. This module supports SOCKS4 (specifically the SOCKS4A variant) and
SOCKS5. To enable its functionality, either install PySocks or install this
module w... | gpl-3.0 |
jymannob/Sick-Beard | lib/html5lib/filters/whitespace.py | 1730 | 1142 | from __future__ import absolute_import, division, unicode_literals
import re
from . import _base
from ..constants import rcdataElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
class Filter(_base.Filter):
spacePreserveElements = frozenset... | gpl-3.0 |
EricMuller/mywebmarks-backend | requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/names/authority.py | 12 | 16530 | # -*- test-case-name: twisted.names.test.test_names -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Authoritative resolvers.
"""
from __future__ import absolute_import, division
import os
import time
from twisted.names import dns, error, common
from twisted.internet import defer
from... | mit |
ElementsProject/elements | test/functional/mining_getblocktemplate_longpoll.py | 7 | 3612 | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test longpolling with getblocktemplate."""
from decimal import Decimal
import random
import threading
... | mit |
MobinRanjbar/hue | desktop/core/ext-py/South-1.0.2/south/management/commands/__init__.py | 153 | 1542 |
# Common framework for syncdb actions
import copy
from django.core import management
from django.conf import settings
# Make sure the template loader cache is fixed _now_ (#448)
import django.template.loaders.app_directories
from south.hacks import hacks
from south.management.commands.syncdb import Command as Sync... | apache-2.0 |
wbhuber/local_swift_branch | swift/common/middleware/recon.py | 12 | 16593 | # Copyright (c) 2010-2012 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 agree... | apache-2.0 |
flccrakers/dj-tango | mutagen/_file.py | 6 | 8667 | # -*- coding: utf-8 -*-
# Copyright (C) 2005 Michael Urman
#
# 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.
import wa... | gpl-3.0 |
lmr/autotest | cli/rpc_unittest.py | 4 | 1363 | #!/usr/bin/python
#
# Copyright 2008 Google Inc. All Rights Reserved.
"""Test for the rpc proxy class."""
import unittest
import os
try:
import autotest.common as common
except ImportError:
import common
from autotest.cli import rpc
from autotest.client.shared.settings import settings
class rpc_unittest(uni... | gpl-2.0 |
Daniel-CA/odoo | addons/crm_profiling/wizard/__init__.py | 438 | 1080 | # -*- 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... | agpl-3.0 |
ableiten/twoxy | twoxy/settings.py | 1 | 1785 |
# SQLAlchemy database URI. Currently tested, PGSQL, SQLite. Many others should
# also work fine.
SQLALCHEMY_DATABASE_URI = "mydatabaseuri"
# Set to true if you want people to be able to post Tweets from the site index.
INDEX_POSTING_ENABLED = True
# Number of handles an IP address can add to the opted-out list in an... | gpl-2.0 |
ocdude/mbzextract | mbzextract/mbzextract.py | 1 | 1599 | #!/usr/bin/env python3
import argparse
import sys
import os
from mbzextract import mbz
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='''A utility to extract files
from a .mbz Moodle backup file''')
parser.add_argument("input",
metavar="MOODLE BACKUP FI... | mit |
Tibo-R/jamplaygen | boilerplate/external/wtforms/ext/sqlalchemy/fields.py | 50 | 6565 | """
Useful form fields for use with SQLAlchemy ORM.
"""
from __future__ import unicode_literals
import operator
from wtforms import widgets
from wtforms.compat import text_type, string_types
from wtforms.fields import SelectFieldBase
from wtforms.validators import ValidationError
try:
from sqlalchemy.orm.util im... | lgpl-3.0 |
NDManh/numbbo | code-postprocessing/bbob_pproc/changeAlgIdAndComment.py | 4 | 5418 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import warnings
import getopt
from shutil import move
from os import remove, close
"""Modify meta information in raw experimental data.
While comparing algorithms with the bbob_proc package, it is sometimes
needed to change the algorithm name (given ... | bsd-3-clause |
ignicaodigitalbr/aws-beanstalk-deploy | deploy-hs.py | 1 | 3943 | #!/usr/bin/env python
from __future__ import print_function
import os
import sys
from time import sleep
import boto3
import commands
from botocore.exceptions import ClientError
APP_NAME = os.getenv('BITBUCKET_REPO_SLUG')
COMMIT_HASH = os.getenv('BITBUCKET_COMMIT')
del os.environ['GIT_DIR']
TAG = commands.getoutput("g... | gpl-3.0 |
sdiehl/ghc | testsuite/tests/pmcheck/should_compile/genS.py | 5 | 1474 | #! /usr/bin/env python3
# See #17264.
#
# Generates a module of Luc Maranget's S series
#
# module S where
#
# data T = A | B
#
# s :: T -> T -> T -> T -> T -> T -> T -> T -> ()
# s A A _ _ _ _ _ _ = ()
# s _ _ A A _ _ _ _ = ()
# s _ _ _ _ A A _ _ = ()
# s _ _ _ _ _ _ A A = ()
# s A B A B A B A B = ()
... | bsd-3-clause |
andela-ifageyinbo/django | django/contrib/messages/storage/base.py | 526 | 6285 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.messages import constants, utils
from django.utils.encoding import force_text, python_2_unicode_compatible
LEVEL_TAGS = utils.get_level_tags()
@python_2_unicode_compatible
class Message(object):
"""
Represents an ac... | bsd-3-clause |
nkalodimas/invenio | modules/bibformat/lib/elements/bfe_sword_push.py | 17 | 2077 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2010, 2011 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, or (at your opt... | gpl-2.0 |
tianyi33/simple_blog | django/contrib/gis/tests/distapp/models.py | 221 | 2069 | from django.contrib.gis.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class SouthTexasCity(models.Model):
"City model on projected coordinate system for South Texas."
name = models.CharField(max_length=30)
point = models.PointField(srid=32140)
... | mit |
camptocamp/collective.eggproxy | collective/eggproxy/tests/test_utils.py | 1 | 2669 | # -*- coding: utf-8 -*-
import unittest
import os
class TestUtils(unittest.TestCase):
def setUp(self):
import tempfile
from collective.eggproxy.utils import IndexProxy
from collective.eggproxy.config import config
self.tempdir = tempfile.mkdtemp()
self.base_index = os.pat... | gpl-2.0 |
mkaluza/external_chromium_org | components/test/data/autofill/merge/tools/autofill_merge_common.py | 137 | 2204 | # 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.
class UnknownColumnNameException(Exception):
"""Exception type raised when encountering an unknown column name."""
def __init__(self, column_name):
... | bsd-3-clause |
bda2017-shallowermind/MusTGAN | magenta/magenta/models/improv_rnn/improv_rnn_generate.py | 2 | 10852 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
khushboo9293/mailman | src/mailman/chains/base.py | 7 | 3956 | # Copyright (C) 2008-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | gpl-3.0 |
azureplus/swftools-1 | setup.py | 4 | 14452 | #!/usr/bin/env python
from distutils import ccompiler
from distutils.core import CompileError
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
cc = ccompiler.new_compiler()
# leave it to gcc to detect c/c++ files. we'll be linking against -lstdc++
... | gpl-2.0 |
tanujs22/crowdsource-platform | crowdsourcing/viewsets/dropbox.py | 13 | 3434 | from csp import settings
from crowdsourcing import models
from rest_framework.views import APIView
from django.http import HttpResponse, HttpResponseRedirect
# TODO change this to support ajax requests, remove HttpResponseRedirect
class DropboxOauth(APIView):
"""
Handles the Dropbox Oauth2 integration
... | mit |
suhe/odoo | addons/account/report/account_invoice_report.py | 6 | 9794 | # -*- coding: utf-8 -*-
from openerp import tools
from openerp import models, fields, api
class AccountInvoiceReport(models.Model):
_name = "account.invoice.report"
_description = "Invoices Statistics"
_auto = False
_rec_name = 'date'
@api.multi
@api.depends('currency_id', 'date', 'price_tot... | gpl-3.0 |
s20121035/rk3288_android5.1_repo | external/antlr/antlr-3.4/runtime/Python/tests/t047treeparser.py | 20 | 4342 | import unittest
import textwrap
import antlr3
import antlr3.tree
import testbase
class T(testbase.ANTLRTest):
def walkerClass(self, base):
class TWalker(base):
def __init__(self, *args, **kwargs):
base.__init__(self, *args, **kwargs)
self.traces = []
... | gpl-3.0 |
heiligeslama/devilsBackbone | python2.7libs/threadingTests.py | 1 | 1871 | '''
Copyright (c) 2013, Nikola Wuttke
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following ... | bsd-3-clause |
svenstaro/ansible | lib/ansible/modules/windows/win_feature.py | 23 | 3312 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Paul Durivage <paul.durivage@rackspace.com>, Trond Hindenes <trond@hindenes.com> and others
#
# 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
#... | gpl-3.0 |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | SplunkforPaloAltoNetworks/bin/lib/pandevice/pandevice/__init__.py | 2 | 9882 | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Palo Alto Networks
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS"... | isc |
Southpaw-TACTIC/TACTIC | src/context/client/tactic-api-python-4.0.api04/Tools/Scripts/fixcid.py | 3 | 10299 | #! /usr/bin/env python
# Perform massive identifier substitution on C source files.
# This actually tokenizes the files (to some extent) so it can
# avoid making substitutions inside strings or comments.
# Inside strings, substitutions are never made; inside comments,
# it is a user option (off by default).
#
... | epl-1.0 |
mattesno1/CouchPotatoServer | libs/pyutil/test/current/json_tests/test_pass1.py | 106 | 1814 | from unittest import TestCase
from pyutil import jsonutil as json
# from http://json.org/JSON_checker/test/pass1.json
JSON = r'''
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
... | gpl-3.0 |
ENCODE-DCC/chip-seq-pipeline | dnanexus/pool/src/pool.py | 2 | 1464 | #!/usr/bin/env python
# pool 0.0.1
# Generated by dx-app-wizard.
#
# Basic execution pattern: Your app will run on a single machine from
# beginning to end.
#
# See https://wiki.dnanexus.com/Developer-Portal for documentation and
# tutorials on how to modify this file.
#
# DNAnexus Python Bindings (dxpy) documentation:... | mit |
kmoocdev2/edx-platform | common/djangoapps/microsite_configuration/management/commands/delete_historical_microsite_data.py | 18 | 1287 | """
Command to delete all rows from these tables:
microsite_configuration_historicalmicrositeorganizationmapping
microsite_configuration_historicalmicrositetemplate
"""
import logging
from microsite_configuration.models import MicrositeOrganizationMapping, MicrositeTemplate
from openedx.core.djangoapps.util.row_delete... | agpl-3.0 |
AloneRoad/Inforlearn | vendor/gdata/spreadsheets/data.py | 23 | 9166 | #!/usr/bin/env python
#
# Copyright (C) 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 ... | apache-2.0 |
cesarmarinhorj/ansible | lib/ansible/utils/hashing.py | 202 | 3125 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
gsehub/edx-platform | cms/djangoapps/contentstore/views/tests/test_credit_eligibility.py | 25 | 2976 | """
Unit tests for credit eligibility UI in Studio.
"""
import mock
from contentstore.tests.utils import CourseTestCase
from contentstore.utils import reverse_course_url
from openedx.core.djangoapps.credit.api import get_credit_requirements
from openedx.core.djangoapps.credit.models import CreditCourse
from openedx.c... | agpl-3.0 |
FrenchSoup/Clever | tools/disassembler.py | 1 | 5338 | #
# Emulator engine main class
#
def dhex(number: int) -> str:
return "0x{:04x}".format(number)
def x0000(opcode):
# Clear screen
if opcode == 0x00E0:
return "CLS"
# Return
if opcode == 0x00EE:
return "RET"
# 1XXX => Jump(XXX)
def x1000(opcode):
return "JP " + dhex(opcode & ... | gpl-3.0 |
Friday21/python_show_me_the_code | protream/0023/run.py | 40 | 2241 | """
Message Board
~~~~~~~~~~~~~
A simple message board application written with Flask and sqlite3.
Since it's a small application, I have not use SQLAlchemy and wtf.
:copyright: (c) 2015 by proteam@gmail.com.
:license: BSD.
"""
import os
import sqlite3
from datetime import datetime
from flask ... | mit |
ondra-novak/chromium.src | tools/update_reference_build.py | 17 | 13909 | #!/usr/bin/env python
#
# Copyright (c) 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.
"""Updates the Chrome reference builds.
To update Chromium (unofficial) reference build, use the -r option and give a
Chromium S... | bsd-3-clause |
milad-soufastai/ansible-modules-extras | monitoring/rollbar_deployment.py | 138 | 3898 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014, Max Riveiro, <kavu13@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the... | gpl-3.0 |
txm/make-good | django/views/csrf.py | 289 | 3834 | from django.http import HttpResponseForbidden
from django.template import Context, Template
from django.conf import settings
# We include the template inline since we need to be able to reliably display
# this error message, especially for the sake of developers, and there isn't any
# other way of making it available ... | bsd-3-clause |
joebowen/movement_validation_cloud | djangodev/lib/python2.7/site-packages/django/core/cache/backends/base.py | 104 | 8793 | "Base Cache class."
from __future__ import unicode_literals
import time
import warnings
from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning
from django.utils.module_loading import import_string
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(DjangoRun... | mit |
bandwidthcom/python-bandwidth-iris | tests/test_subscriptions.py | 1 | 4815 | #!/usr/bin/env python
import os
import sys
# For coverage.
if __package__ is None:
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..")
from unittest import main, TestCase
import requests
import requests_mock
from iris_sdk.client import Client
from iris_sdk.models.account import Account
XML_RES... | mit |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/test/test_buffer.py | 2 | 163648 | #
# The ndarray object from _testbuffer.c is a complete implementation of
# a PEP-3118 buffer provider. It is independent from NumPy's ndarray
# and the tests don't require NumPy.
#
# If NumPy is present, some tests check both ndarray implementations
# against each other.
#
# Most ndarray tests also check that memoryvi... | apache-2.0 |
cyrustabatab/mptcp | test.py | 23 | 75968 | #! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2009 University of Washington
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free ... | gpl-2.0 |
loele/samba | python/samba/tests/policy.py | 52 | 1174 | # Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2010
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) a... | gpl-3.0 |
manqala/erpnext | erpnext/patches/v6_0/set_default_title.py | 59 | 1308 | import frappe
def execute():
frappe.reload_doctype("Quotation")
frappe.db.sql("""update tabQuotation set title = customer_name""")
frappe.reload_doctype("Sales Order")
frappe.db.sql("""update `tabSales Order` set title = customer_name""")
frappe.reload_doctype("Delivery Note")
frappe.db.sql("""update `tabDeliv... | gpl-3.0 |
CYBAI/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/testing/test_runner_xunit.py | 12 | 7581 | """Test correct setup/teardowns at module, class, and instance level."""
from typing import List
import pytest
def test_module_and_function_setup(testdir):
reprec = testdir.inline_runsource(
"""
modlevel = []
def setup_module(module):
assert not modlevel
module.mod... | mpl-2.0 |
srikantbmandal/ansible | lib/ansible/modules/net_tools/dnsimple.py | 63 | 12241 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
dchadic/linux-cmps107 | scripts/gdb/linux/modules.py | 774 | 2718 | #
# gdb helper commands and functions for Linux kernel debugging
#
# module tools
#
# Copyright (c) Siemens AG, 2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import cpus, utils
module_type = utils.CachedType("str... | gpl-2.0 |
darron/dd-agent | checks.d/activemq_xml.py | 25 | 6192 | # stdlib
from xml.etree import ElementTree
# third party
import requests
# project
from checks import AgentCheck
QUEUE_URL = "/admin/xml/queues.jsp"
TOPIC_URL = "/admin/xml/topics.jsp"
SUBSCRIBER_URL = "/admin/xml/subscribers.jsp"
TOPIC_QUEUE_METRICS = {
"consumerCount": "consumer_count",
"dequeueCount": "d... | bsd-3-clause |
KonradBreitsprecher/espresso | testsuite/interactions_bonded.py | 1 | 5159 | #
# Copyright (C) 2013,2014,2015,2016 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option)... | gpl-3.0 |
Rogentos/legacy-anaconda | installclasses/xfce.py | 1 | 2609 | #
# xfce.py
#
# Copyright (C) 2010 Fabio Erculiani
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is... | gpl-2.0 |
vrieni/orange | Orange/OrangeWidgets/Data/OWConcatenate.py | 6 | 8919 | import Orange
from OWWidget import *
import OWGUI
from itertools import izip
NAME = "Concatenate"
DESCRIPTION = "Concatenates data tables."
ICON = "icons/Concatenate.svg"
PRIORITY = 1111
MAINTAINER = "Janez Demsar"
MAINTAINER_EMAIL = "janez.demsar(@at@)fri.uni-lj.si"
INPUTS = [("Primary Data", Orange.data.Table, "setD... | gpl-3.0 |
fatiando/fatiando | gallery/gridder/padding.py | 6 | 1944 | """
Pad the edges of grids using various methods
=============================================
Sometimes it is useful to add some padding points to the edges of grids, for
example during FFT-based processing to avoid edge effects.
Function :func:`fatiando.gridder.pad_array` does this using various padding
methods.
Fun... | bsd-3-clause |
nesdis/djongo | tests/django_tests/tests/v22/tests/model_forms/tests.py | 8 | 117358 | import datetime
import os
from decimal import Decimal
from unittest import mock, skipUnless
from django import forms
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldError, ImproperlyConfigured,
)
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.validators import Validation... | agpl-3.0 |
mjgrav2001/scikit-learn | examples/cluster/plot_agglomerative_clustering_metrics.py | 402 | 4492 | """
Agglomerative clustering with different metrics
===============================================
Demonstrates the effect of different metrics on the hierarchical clustering.
The example is engineered to show the effect of the choice of different
metrics. It is applied to waveforms, which can be seen as
high-dimens... | bsd-3-clause |
bfirsh/django-old | tests/modeltests/validators/tests.py | 49 | 6299 | # -*- coding: utf-8 -*-
import re
import types
from unittest import TestCase
from datetime import datetime, timedelta
from django.core.exceptions import ValidationError
from django.core.validators import *
NOW = datetime.now()
TEST_DATA = (
# (validator, value, expected),
(validate_integer, '42', None),
(... | bsd-3-clause |
ramadhane/odoo | addons/l10n_fr_hr_payroll/__openerp__.py | 374 | 2165 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
rajiteh/taiga-back | tests/integration/test_memberships.py | 19 | 6725 | from unittest import mock
from django.core.urlresolvers import reverse
from taiga.projects import services
from taiga.base.utils import json
from .. import factories as f
import pytest
pytestmark = pytest.mark.django_db
def test_get_members_from_bulk():
data = [{"role_id": "1", "email": "member1@email.com"},
... | agpl-3.0 |
EuropeCoinERC/ERC | share/qt/extract_strings_qt.py | 1294 | 1784 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by xgettext.
Ret... | mit |
cantren/Twitch-plays-LSD-neural-net | zoomingstream.py | 6 | 11688 | from twitch import TwitchOutputStream
import numpy as np
import threading
import time
import collections
from skimage import transform
import multiprocessing
from functools import partial
import Queue
from PIL import Image, ImageFont, ImageDraw
from collections import deque
import sys
font = ImageFont.truetype(font="H... | mit |
arju88nair/projectCulminate | venv/lib/python3.5/site-packages/jinja2/compiler.py | 117 | 62929 | # -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from itertools import chain
from copy import deepcopy
from keyword import iskeyword as is_python_keyword
from functo... | apache-2.0 |
qnib/qcollect | resources/diamond/collectors/puppetagent/test/testpuppetagent.py | 26 | 2883 | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from test import run_only
from mock import patch
from diamond.collector import Collector
from puppetagent... | apache-2.0 |
Distrotech/intellij-community | python/helpers/pydev/pydevd_attach_to_process/_test_attach_to_process_linux.py | 82 | 2779 | '''
This module is just for testing concepts. It should be erased later on.
Experiments:
// gdb -p 4957
// call dlopen("/home/fabioz/Desktop/dev/PyDev.Debugger/pydevd_attach_to_process/linux/attach_linux.so", 2)
// call dlsym($1, "hello")
// call hello()
// call open("/home/fabioz/Desktop/dev/PyDev.Debugger/pydevd_... | apache-2.0 |
markeTIC/OCB | addons/mail/res_partner.py | 379 | 2454 | # -*- 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 |
milanlenco/vpp | test/test_interface_crud.py | 2 | 4704 | #!/usr/bin/env python
"""CRUD tests of APIs (Create, Read, Update, Delete) HLD:
- interface up/down/add/delete - interface type:
- pg (TBD)
- loopback
- vhostuser (TBD)
- af_packet (TBD)
- netmap (TBD)
- tuntap (root privileges needed)
- vxlan (TBD)
"""
import unittest
from scapy.layers.i... | apache-2.0 |
ktdreyer/ceph-deploy | ceph_deploy/hosts/debian/install.py | 1 | 5596 | from urlparse import urlparse
from ceph_deploy.lib import remoto
from ceph_deploy.util import pkg_managers
def install(distro, version_kind, version, adjust_repos):
codename = distro.codename
machine = distro.machine_type
if version_kind in ['stable', 'testing']:
key = 'release'
else:
... | mit |
LChristakis/chalice-hunter | lib/python3.4/site-packages/flask_assets.py | 2 | 16162 | from __future__ import print_function
from os import path
from flask import _request_ctx_stack
from flask.templating import render_template_string
from webassets.env import (\
BaseEnvironment, ConfigStorage, env_options, Resolver, url_prefix_join)
from webassets.filter import Filter, register_filter
from webassets.... | mit |
Aegeaner/spark | examples/src/main/python/status_api_demo.py | 106 | 2258 | #
# 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 |
Yurlungur/cactus_scripts | plot_gaugewave_of_time.py | 1 | 6944 | #!/usr/bin/env python2
"""
plot_gaugewave_of_time.py
Author: Jonah Miller (jonah.maxwell.miller@gmail.com)
Time-stamp: <2014-02-07 18:01:28 (jonah)>
This is a simple library to plot the norm of g_{xx} as a function of
time for a gaugewave. Several gaugewave files can be plotted at the
same time.
Example call
python2... | gpl-2.0 |
dplorimer/osf | website/addons/badges/tests/test_models.py | 59 | 4069 | # -*- coding: utf-8 -*-
from nose.tools import *
from website.addons.badges.model import BadgeAssertion
from utils import *
from tests.base import OsfTestCase
from tests.factories import AuthUserFactory, ProjectFactory
class TestUserSettingsModel(OsfTestCase):
def setUp(self):
super(TestUserSettingsMode... | apache-2.0 |
honnibal/spaCy | spacy/tests/parser/test_parse.py | 1 | 5932 | # coding: utf-8
from __future__ import unicode_literals
import pytest
from ..util import get_doc, apply_transition_sequence
def test_parser_root(en_tokenizer):
text = "i don't have other assistance"
heads = [3, 2, 1, 0, 1, -2]
deps = ["nsubj", "aux", "neg", "ROOT", "amod", "dobj"]
tokens = en_tokeni... | mit |
yebrahim/pydatalab | datalab/context/_utils.py | 4 | 5412 | # Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
glarrain/django-linkcheck | linkcheck/management/commands/checkexternal.py | 7 | 1427 | from optparse import make_option
from django.core.management.base import BaseCommand
from linkcheck.utils import check_links
from linkcheck.linkcheck_settings import EXTERNAL_RECHECK_INTERVAL
from linkcheck.linkcheck_settings import MAX_CHECKS_PER_RUN
class Command(BaseCommand):
option_list = BaseCommand.option_l... | bsd-3-clause |
israelbenatar/boto | tests/unit/sqs/test_message.py | 99 | 4281 | # Copyright (c) 2013 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 |
Instagram/django | django/db/backends/sqlite3/creation.py | 230 | 3239 | import os
import sys
from django.db.backends.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
# SQLite doesn't actually support most of these types, but it "does the right
# thing" given more verbose field definitions, so leave them as is so that
# schema inspection is mor... | bsd-3-clause |
farrajota/dbcollection | dbcollection/core/api/download.py | 2 | 5987 | """
Download API class.
"""
from __future__ import print_function
import os
from dbcollection.core.manager import CacheManager
from .metadata import MetadataConstructor
def download(name, data_dir='', extract_data=True, verbose=True):
"""Download a dataset data to disk.
This method will download a datase... | mit |
mathebox/django_hana_pyhdb | django_hana/base.py | 2 | 12806 | """
SAP HANA database backend for Django.
"""
import logging
import sys
from time import time
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
from django.db import utils
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.backends.base.features import BaseDatabaseFe... | bsd-3-clause |
bfelbo/deepmoji | deepmoji/finetuning.py | 2 | 23552 | """ Finetuning functions for doing transfer learning to new datasets.
"""
from __future__ import print_function
import sys
import uuid
from time import sleep
import h5py
import math
import pickle
import numpy as np
from keras.layers.wrappers import Bidirectional, TimeDistributed
from sklearn.metrics import f1_score
... | mit |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/platform/gsutil/third_party/pyasn1/test/type/test_namedtype.py | 28 | 3059 | from pyasn1.type import namedtype, univ
from pyasn1.error import PyAsn1Error
from sys import version_info
if version_info[0:2] < (2, 7) or \
version_info[0:2] in ( (3, 0), (3, 1) ):
try:
import unittest2 as unittest
except ImportError:
import unittest
else:
import unittest
class NamedTyp... | apache-2.0 |
marcydoty/geraldo | site/newsite/site-geraldo/django/views/generic/date_based.py | 16 | 13366 | import datetime
import time
from django.template import loader, RequestContext
from django.core.exceptions import ObjectDoesNotExist
from django.core.xheaders import populate_xheaders
from django.db.models.fields import DateTimeField
from django.http import Http404, HttpResponse
def archive_index(request, queryset, d... | lgpl-3.0 |
ninja-ide/ninja-ide | ninja_tests/gui/editor/test_code_editor.py | 1 | 1111 | import pytest
from PyQt5.QtGui import QTextCursor
from ninja_ide.gui.editor.base import CodeEditor
@pytest.fixture
def code_editor():
editor = CodeEditor()
editor.text = "NINJA-IDE is not just another IDE"
return editor
def test_find_match(code_editor):
assert code_editor.find_match('IDE') is True... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.