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 |
|---|---|---|---|---|---|
brain-research/self-attention-gan | eval_imagenet.py | 1 | 9274 | # 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, so... | apache-2.0 |
jhultgre/one-shot-bot | episodeparsers/baseparser.py | 1 | 4958 | from __future__ import unicode_literals
import logging
import re
from collections import defaultdict
import wikiatools
logger = logging.getLogger(__name__)
class Parser(object):
"""
Base parser class
Attributes:
adjacent_link (str): form the links should take for prev and next episodes
... | mit |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py2/mako/template.py | 3 | 26530 | # mako/template.py
# Copyright 2006-2019 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Provides the Template class, a facade for parsing, generating and executing
template strings, as w... | isc |
WhySoGeeky/DroidPot | venv/lib/python2.7/site-packages/django/contrib/gis/gdal/base.py | 654 | 1179 | from ctypes import c_void_p
from django.contrib.gis.gdal.error import GDALException
from django.utils import six
class GDALBase(object):
"""
Base object for GDAL objects that has a pointer access property
that controls access to the underlying C pointer.
"""
# Initially the pointer is NULL.
_... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/pandas/tests/test_msgpack/test_pack.py | 9 | 4979 | #!/usr/bin/env python
# coding: utf-8
import unittest
import struct
from pandas import compat
from pandas.compat import u, OrderedDict
from pandas.msgpack import packb, unpackb, Unpacker, Packer
class TestPack(unittest.TestCase):
def check(self, data, use_list=False):
re = unpackb(packb(data), use_list... | gpl-3.0 |
batxes/4Cin | Six_mouse_models/Six_mouse_models_final_output_0.2_-0.1_11000/mtx1_models/Six_mouse_models23349.py | 4 | 18209 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
zadgroup/edx-platform | cms/djangoapps/contentstore/tests/test_permissions.py | 136 | 5704 | """
Test CRUD for authorization.
"""
import copy
from django.contrib.auth.models import User
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from contentstore.tests.utils import AjaxEnabledTestClient
from contentstore.utils import reverse_url, reverse_course_url
from student.roles import Course... | agpl-3.0 |
OpenSciViz/cloudstack | openstack/src/python/nova-libvirt/backup/config.py | 6 | 85122 | # Copyright (C) 2012-2013 Red Hat, 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 la... | mit |
basicthinker/ThyNVM | src/mem/CommMonitor.py | 14 | 5702 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
ravibhure/ansible | lib/ansible/modules/cloud/amazon/route53_zone.py | 18 | 11570 | #!/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 |
Yukarumya/Yukarum-Redfoxes | testing/tps/create_venv.py | 2 | 6873 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
This scripts sets up a virtualenv and installs TPS into it.
It's probably best to specify a pa... | mpl-2.0 |
glessard/swift | utils/pass-pipeline/src/passes.py | 39 | 3101 |
from pass_pipeline import Pass
# TODO: This should not be hard coded. Create a tool in the compiler that knows
# how to dump the passes and the pipelines themselves.
AADumper = Pass('AADumper')
ABCOpt = Pass('ABCOpt')
AddressLowering = Pass('AddressLowering')
AllocBoxToStack = Pass('AllocBoxToStack')
CFGPrinter = Pas... | apache-2.0 |
kislerdm/alibava_analysis-tool | ilcinstall_eutel-git/ilcsoft/util.py | 2 | 7565 | ##################################################
#
# Utilities
#
# Author: Frank Gaede, DESY
# Date: Jan, 2007
#
##################################################
from version import Version
from commands import getstatusoutput
from commands import getoutput
import os
import os.path
import sys
import shutil
import ... | gpl-2.0 |
gadybadger/mixpanel-celery | setup.py | 1 | 2116 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import codecs
import os
import re
import sys
import mixpanel
def get_packages(package):
"""
Return root package and all sub-packages.
"""
return [dirpath
for dirpath, dirnames, filenames in os.walk(package)
... | bsd-3-clause |
nightmarebadger/kivy-trying-out | KivEnt/tutorials/5-add-pause-button/main.py | 1 | 5966 | from functools import partial
from kivent_cython import GameSystem
from kivy.app import App
from kivy.clock import Clock
from kivy.properties import StringProperty
from kivy.uix.widget import Widget
from math import radians
from random import randint
import kivent_cython # import needed for kv to work!
class DebugPan... | mit |
nealtodd/wagtail | wagtail/core/tests/test_jinja2.py | 13 | 6558 | from django.template import engines
from django.template.loader import render_to_string
from django.test import TestCase
from wagtail import __version__
from wagtail.core import blocks
from wagtail.core.models import Page, Site
from wagtail.tests.testapp.blocks import SectionBlock
class TestCoreGlobalsAndFilters(Tes... | bsd-3-clause |
TheMOOCAgency/edx-platform | openedx/core/djangoapps/models/tests/test_course_details.py | 18 | 8385 | """
Tests for CourseDetails
"""
import datetime
import ddt
from django.utils.timezone import UTC
from nose.plugins.attrib import attr
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
fr... | agpl-3.0 |
DemocracyClub/UK-Polling-Stations | polling_stations/apps/data_importers/management/commands/import_ealing.py | 1 | 1675 | from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "EAL"
addresses_name = "2021-04-12T12:33:03.476596/GLA Ealing Polling Station List - Democracy_Club__06May2021.tsv"
stations_name = "2021-04-12T12:33:03.476596/... | bsd-3-clause |
Percona-QA/percona-qa | myrocks-tests/myrocks_mysqlx_plugin/myrocks_mysqlx_plugin.py | 1 | 3893 | # Created by Shahriyar Rzayev from Percona
# Connecting to MySQL and working with a Session
import mysqlx
class MyXPlugin:
def __init__(self, schema_name, collection_name):
# Connect to a dedicated MySQL server
self.session = mysqlx.get_session({
'host': 'localhost',
'port... | gpl-2.0 |
nilsonmorales/Badass | Packages_POU/pre-paquetes/20140430/20140430.pet/usr/share/lib/ROX-Lib2/python/rox/mime.py | 1 | 14321 | """This module provides access to the shared MIME database.
types is a dictionary of all known MIME types, indexed by the type name, e.g.
types['application/x-python']
Applications can install information about MIME types by storing an
XML file as <MIME>/packages/<application>.xml and running the
update-mime-database... | gpl-3.0 |
kg-bot/SupyBot | plugins/Mafia/config.py | 1 | 1984 | ###
# Copyright (c) 2010, Julian Aloofi
#
# This file is part of supybot-werewolf.
#
# supybot-werewolf 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-3.0 |
alanjw/GreenOpenERP-Win-X86 | openerp/addons/l10n_bo/__openerp__.py | 39 | 1785 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... | agpl-3.0 |
HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/Imaging/Core/Testing/Python/TestStencilWithImage.py | 20 | 1266 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# A script to test the stencil filter by using one image
# to stencil another
# Image pipeline
reader1 = vtk.vtkBMPReader()
reader1.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/masonr... | gpl-3.0 |
nazo/ansible | lib/ansible/modules/system/authorized_key.py | 27 | 22026 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to add authorized_keys for ssh logins.
(c) 2012, Brad Olson <brado@movedbylight.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 ... | gpl-3.0 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/sklearn/metrics/scorer.py | 15 | 16488 | """
The :mod:`sklearn.metrics.scorer` submodule implements a flexible
interface for model selection and evaluation using
arbitrary score functions.
A scorer object is a callable that can be passed to
:class:`sklearn.model_selection.GridSearchCV` or
:func:`sklearn.model_selection.cross_val_score` as the ``scoring``
par... | mit |
m-ober/byceps | byceps/util/framework/templating.py | 1 | 2232 | """
byceps.util.framework.templating
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Templating utilities
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from functools import wraps
from typing import Callable, Optional
from flask import render_template
_TEMPLATE_FILENAME_EXTENSIO... | bsd-3-clause |
crakensio/django_training | lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_list.py | 105 | 16417 | from __future__ import unicode_literals
import datetime
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.contrib.admin.util import (lookup_field, display_for_field,
display_for_value, label_for_field)
from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST_... | cc0-1.0 |
ABaldwinHunter/django-clone-classic | django/template/loader.py | 39 | 2101 | from django.utils import six
from django.utils.deprecation import (
DeprecationInstanceCheck, RemovedInDjango20Warning,
)
from . import engines
from .base import Origin
from .exceptions import TemplateDoesNotExist
def get_template(template_name, using=None):
"""
Loads and returns a template for the given... | bsd-3-clause |
Peddle/hue | desktop/core/ext-py/boto-2.38.0/boto/cloudfront/__init__.py | 164 | 15176 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | apache-2.0 |
ondra-novak/blink | Tools/Scripts/webkitpy/layout_tests/servers/cli_wrapper.py | 50 | 2801 | # Copyright (C) 2010 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 |
viger/docker | proxy/proxy/code/default/gae_proxy/server/lib/google/appengine/api/search/ExpressionParser.py | 7 | 55228 | #!/usr/bin/env python
#
# Copyright 2007 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 o... | mit |
adieu/django-nonrel | django/contrib/sessions/backends/cached_db.py | 270 | 1256 | """
Cached, database-backed sessions.
"""
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DBStore
from django.core.cache import cache
class SessionStore(DBStore):
"""
Implements cached, database backed sessions.
"""
def __init__(self, session_key=None)... | bsd-3-clause |
roselleebarle04/django | django/db/migrations/loader.py | 165 | 16926 | from __future__ import unicode_literals
import os
import sys
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.db.migrations.graph import MigrationGraph
from django.db.migrations.recorder import MigrationRecorder
from django.utils import six
from .exception... | bsd-3-clause |
rtindru/django | django/utils/tree.py | 372 | 4883 | """
A class for storing a tree graph. Primarily used for filter constructs in the
ORM.
"""
import copy
class Node(object):
"""
A single internal node in the tree graph. A Node should be viewed as a
connection (the root) with the children being either leaf nodes or other
Node instances.
"""
# ... | bsd-3-clause |
hacklabr/timtec | setup.py | 7 | 1207 | import os
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import sys
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#... | agpl-3.0 |
yarikoptic/scrapy | scrapy/utils/response.py | 55 | 3129 | """
This module provides some useful functions for working with
scrapy.http.Response objects
"""
import os
import re
import weakref
import webbrowser
import tempfile
from twisted.web import http
from scrapy.utils.python import to_bytes, to_native_str
from w3lib import html
from scrapy.utils.decorators import deprecat... | bsd-3-clause |
zigitax/pupy | client/sources/gen_library_compressed_string.py | 33 | 1086 | #!/usr/bin/env python
# -*- coding: UTF8 -*-
import StringIO, zipfile, os.path, imp, sys
import marshal
import zlib
def get_encoded_library_string(arch):
filepath=None
if arch=="x86":
filepath=os.path.join("resources","libraryx86.zip")
elif arch=="x64":
filepath=os.path.join("resources","libraryx64.zip")
else:... | bsd-3-clause |
MakesmithAccessibleTech/MakesmithGroundControl | UIElements/backgroundPickDlg.py | 2 | 3238 | from kivy.uix.gridlayout import GridLayout
from kivy.properties import StringProperty, ListProperty, ObjectProperty
from DataStructures.makesmithInitFuncs import MakesmithInitFuncs
from kivy.vector import Vector
class BackgroundPickDlg(GridLayout, MakesmithInitFuncs):
instructionText = StringProperty("Drag boundi... | gpl-3.0 |
CIFASIS/pylearn2 | pylearn2/packaged_dependencies/theano_linear/test_matrixmul.py | 44 | 3272 | import numpy
import unittest
import warnings
import theano
from theano import tensor
from .linear import dot_shape
from .linear import dot_shape_from_shape
from .linear import dot
def assert_compute_equal(outputs, inputs=[]):
outputs = [tensor.as_tensor_variable(o) for o in outputs]
f = theano.function(input... | bsd-3-clause |
allenp/odoo | addons/account/models/account_invoice.py | 1 | 65187 | # -*- coding: utf-8 -*-
import json
from lxml import etree
from datetime import datetime
from dateutil.relativedelta import relativedelta
from openerp import api, fields, models, _
from openerp.tools import float_is_zero
from openerp.tools.misc import formatLang
from openerp.exceptions import UserError, RedirectWarn... | gpl-3.0 |
knabar/openmicroscopy | components/tools/OmeroPy/src/omero/plugins/delete.py | 3 | 2995 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Startup plugin for command-line deletes
Copyright 2009-2015 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import sys
from omero.cli import CLI, GraphControl
HELP = """Delete OMERO data.
Remove enti... | gpl-2.0 |
facelessuser/sublime-markdown-popups | st3/mdpopups/pygments/formatters/other.py | 1 | 5134 | # -*- coding: utf-8 -*-
"""
pygments.formatters.other
~~~~~~~~~~~~~~~~~~~~~~~~~
Other formatters: NullFormatter, RawTokenFormatter.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from ..formatter import Formatter
from ..util import O... | mit |
2014cdag10/2014cdaGG | wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/test/test_setups.py | 791 | 16440 | import io
import sys
import unittest
def resultFactory(*_):
return unittest.TestResult()
class TestSetups(unittest.TestCase):
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=io.StringIO())
def runTests(self, *cases... | gpl-2.0 |
ayyucedemirbas/Minix-Source-Code | minix-master/external/bsd/llvm/dist/llvm/utils/lit/lit/TestingConfig.py | 10 | 5640 | import os
import sys
PY2 = sys.version_info[0] < 3
class TestingConfig:
""""
TestingConfig - Information on the tests inside a suite.
"""
@staticmethod
def fromdefaults(litConfig):
"""
fromdefaults(litConfig) -> TestingConfig
Create a TestingConfig object with default val... | apache-2.0 |
dyyi/moneybook | venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py | 152 | 6305 | import base64
import io
import json
import zlib
from pip._vendor.requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle, text_type
def _b64_encode_bytes(b):
return base64.b64encode(b).decode("ascii")
def _b64_encode_str(s):
return _b64_encode_bytes(s.encode("utf8"))
def ... | apache-2.0 |
mppmu/secdec | pySecDec/decomposition/test_geometric_decomposition.py | 1 | 18147 | from .geometric import *
from .common import Sector
from ..algebra import Polynomial, ExponentiatedPolynomial, LogOfPolynomial
from ..misc import argsort_2D_array
from nose.plugins.attrib import attr
import numpy as np
import sympy as sp
import sys
import unittest
python_major_version = sys.version[0]
def sort_2D_arr... | gpl-3.0 |
kenxwagner/PythonPlay | Project/webscrap/websc/Lib/site-packages/setuptools/installer.py | 6 | 5336 | import glob
import os
import subprocess
import sys
from distutils import log
from distutils.errors import DistutilsError
import pkg_resources
from setuptools.command.easy_install import easy_install
from setuptools.extern import six
from setuptools.wheel import Wheel
from .py31compat import TemporaryDirectory
def _... | mit |
getredash/redash | redash/tasks/queries/execution.py | 2 | 10126 | import signal
import time
import redis
from rq import get_current_job
from rq.job import JobStatus
from rq.timeouts import JobTimeoutException
from rq.exceptions import NoSuchJobError
from redash import models, redis_connection, settings
from redash.query_runner import InterruptException
from redash.tasks.worker impo... | bsd-2-clause |
dstanek/keystone | keystone/tests/unit/backend/role/test_ldap.py | 9 | 7036 | # -*- coding: utf-8 -*-
# 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, softwa... | apache-2.0 |
wylok/opsweb | index.py | 1 | 11498 | #-*- coding: utf-8 -*-
import time
from flask import Flask,Blueprint,render_template,g,request,make_response,flash,redirect,url_for
from module import loging,user_auth,db_idc,tools,db_op
import string
from kubernetes import client
import redis
import datetime
from pyecharts import Line,Bar,EffectScatter
from collection... | gpl-3.0 |
isyippee/nova | nova/network/api.py | 41 | 23187 | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you... | apache-2.0 |
kvar/ansible | test/units/modules/storage/netapp/test_na_ontap_dns.py | 21 | 10363 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit tests for Ansible module: na_ontap_dns'''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import pytest
from units.compat import unittest
f... | gpl-3.0 |
afrolov1/nova | nova/tests/objects/test_instance.py | 12 | 50449 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
r-icarus/openstack_microserver | openstack_dashboard/openstack/common/timeutils.py | 24 | 5552 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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.apac... | apache-2.0 |
Orav/kbengine | kbe/res/scripts/common/Lib/encodings/quopri_codec.py | 2 | 1568 | """Codec for quoted-printable encoding.
This codec de/encodes from bytes to bytes.
"""
import codecs
import quopri
from io import BytesIO
def quopri_encode(input, errors='strict'):
assert errors == 'strict'
f = BytesIO(input)
g = BytesIO()
quopri.encode(f, g, 1)
return (g.getvalue()... | lgpl-3.0 |
ChristopherHogan/numpy | numpy/distutils/system_info.py | 5 | 83108 | #!/bin/env python
"""
This file defines a set of system_info classes for getting
information about various resources (libraries, library directories,
include directories, etc.) in the system. Currently, the following
classes are available:
atlas_info
atlas_threads_info
atlas_blas_info
atlas_blas_threads_info
... | bsd-3-clause |
jampekka/statcubeserver | load_hri_sql.py | 2 | 3203 | # encoding: utf-8
import os
import sys
from urllib2 import urlopen
import urllib2
import urlparse
import json
import pydatacube
import pydatacube.pcaxis
import pydatacube.sql
import psycopg2
METADATA_URL="http://www.hri.fi/wp-content/uploads/ckan/hri-ckan-active-metadata-daily-output.json"
# From the werkzeug-project... | mit |
tedder/ansible | test/units/modules/storage/netapp/test_na_ontap_nvme_subsystem.py | 45 | 9265 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit tests ONTAP Ansible module: na_ontap_nvme_subsystem '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch
f... | gpl-3.0 |
espadrine/opera | chromium/src/tools/grit/grit/gather/txt.py | 62 | 1175 | #!/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.
'''Supports making amessage from a text file.
'''
from grit.gather import interface
from grit import tclib
class TxtFile(interfa... | bsd-3-clause |
Yuri-ren/Python | get_shuping.py | 1 | 5259 | #coding: utf-8
'''
add by yuri
拉取数据平台获取海外带宽每日api数据,并汇总每日带宽
'''
import time,requests,md5,datetime
from echarts import Echart,Legend,Bar,Axis
import os
###倒置一个list 为了最后填充数据使用
# temp_l=[2268.1028273066668, 1549.2366309600034, 1737.9599384799994, 1597.4116898133348, 1852.0315420533348, 3023.488939999995, 2833.0235811999... | gpl-2.0 |
jalexvig/tensorflow | tensorflow/contrib/data/python/kernel_tests/serialization/group_by_reducer_serialization_test.py | 14 | 2518 | # Copyright 2018 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 |
pLeBlanc93/ArcREST | samples/update_item.py | 1 | 2300 | """
This sample shows how to update tan item
Python 2.x
ArcREST 3.0.1
"""
import arcrest
from arcresthelper import securityhandlerhelper
def trace():
"""
trace finds the line, the filename
and error message and returns it
to the user
"""
import traceback, inspect, sys
t... | apache-2.0 |
nugget/home-assistant | homeassistant/components/simplisafe/__init__.py | 2 | 4367 | """Support for SimpliSafe alarm systems."""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import (
CONF_CODE, CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_TOKEN, CONF_USERNAME)
from homeassistant.core import callba... | apache-2.0 |
stefanfoulis/django-cms | cms/test_utils/project/emailuserapp/migrations/0001_initial.py | 23 | 2448 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='EmailUser',
... | bsd-3-clause |
mcdaniel67/sympy | sympy/polys/tests/test_heuristicgcd.py | 126 | 3554 | from sympy.polys.rings import ring
from sympy.polys.domains import ZZ
from sympy.polys.heuristicgcd import heugcd
def test_heugcd_univariate_integers():
R, x = ring("x", ZZ)
f = x**4 + 8*x**3 + 21*x**2 + 22*x + 8
g = x**3 + 6*x**2 + 11*x + 6
h = x**2 + 3*x + 2
cff = x**2 + 5*x + 4
cfg = x + ... | bsd-3-clause |
saurabh6790/test-med-app | buying/doctype/supplier/supplier.py | 20 | 6977 | # 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 webnotes
import webnotes.defaults
from webnotes.utils import cint
from webnotes import msgprint, _
from webnotes.model.doc import make_autona... | agpl-3.0 |
silviacanessa/oq-hazardlib | openquake/hazardlib/scalerel/__init__.py | 2 | 3157 | # The Hazard Library
# Copyright (C) 2012-2014, GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
... | agpl-3.0 |
ARMmbed/yotta_osx_installer | workspace/lib/python2.7/site-packages/pyOCD/target/target_nrf51.py | 5 | 1678 | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 |
OuterDeepSpace/OuterDeepSpace | libs/server/ige/IssueMngr.py | 1 | 1318 | #
# Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/]
#
# This file is part of IGE - Outer Space.
#
# IGE - Outer Space 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 Lice... | gpl-2.0 |
listamilton/supermilton.repository | script.module.youtube.dl/lib/youtube_dl/extractor/lrt.py | 16 | 2254 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
remove_end,
)
class LRTIE(InfoExtractor):
IE_NAME = 'lrt.lt'
_VALID_URL = r'https?://(?:www\.)?lrt\.lt/mediateka/irasas/(?P<id>[0-9]+)'
_TEST = {
... | gpl-2.0 |
aral/isvat | django/contrib/sites/models.py | 103 | 2979 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
SITE_CACHE = {}
class SiteManager(models.Manager):
def get_current(self):
"""
Returns the current ``Site`` based on the SITE_ID in the
proje... | mit |
MarcosCommunity/odoo | addons/portal_project/tests/__init__.py | 260 | 1086 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY 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 |
RaoUmer/django | tests/modeltests/expressions/tests.py | 6 | 7341 | from __future__ import absolute_import, unicode_literals
from django.core.exceptions import FieldError
from django.db.models import F
from django.test import TestCase
from django.utils import six
from .models import Company, Employee
class ExpressionsTests(TestCase):
def test_filter(self):
Company.objec... | bsd-3-clause |
tefasmile/Mi_Blog | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_phpbuiltins.py | 274 | 122046 | # -*- coding: utf-8 -*-
"""
pygments.lexers._phpbuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file loads the function names and their modules from the
php webpage and generates itself.
Do not alter the MODULES dict by hand!
WARNING: the generation transfers quite much data over your
... | mit |
ganeshnalawade/ansible | test/support/windows-integration/plugins/modules/win_data_deduplication.py | 57 | 2605 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: 2019, rnsc(@rnsc) <github@rnsc.be>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'communit... | gpl-3.0 |
guru-digital/CouchPotatoServer | libs/suds/umx/basic.py | 210 | 1394 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
kholia/Loki | modules/module_rip.py | 1 | 14453 | # module_rip.py
#
# Copyright 2010 Daniel Mende <dmende@ernw.de>
#
# 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 ... | bsd-3-clause |
jayceyxc/hue | desktop/core/ext-py/guppy-0.1.10/guppy/gsl/XHTML.py | 37 | 16293 | #._cv_part guppy.gsl.XHTML
class Node2XHTML:
def __init__(self, mod, node=None, error_report = None, encode_name=None
):
self.mod = mod
self.valid_html40 = False
self.encode = self.mod.encode
if encode_name is None:
encode_name = self.mod.encode_name
self.encode_name = encode_nam... | apache-2.0 |
kusamau/cedaMarkup | ceda_markup/tests/atom.py | 1 | 4125 | '''
BSD Licence
Copyright (c) 2012, Science & Technology Facilities Council (STFC)
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 n... | bsd-3-clause |
google/tensorstore | python/tensorstore/tests/index_transform_test.py | 1 | 5020 | # Copyright 2020 The TensorStore 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 applicable law or agreed to... | apache-2.0 |
bcl/pykickstart | pykickstart/commands/multipath.py | 2 | 4678 | #
# Chris Lumens <clumens@redhat.com>
# Peter Jones <pjones@redhat.com>
#
# Copyright 2006, 2007 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distri... | gpl-2.0 |
techtonik/pip | src/pip/_vendor/chardet/langturkishmodel.py | 269 | 11102 | # -*- coding: utf-8 -*-
######################## 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... | mit |
hdinsight/hue | desktop/core/ext-py/boto-2.38.0/boto/vpc/vpnconnection.py | 168 | 7722 | # Copyright (c) 2009-2010 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | apache-2.0 |
andriisoldatenko/Django-facebook | docs/docs_env/Lib/encodings/cp875.py | 593 | 13110 | """ Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.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... | bsd-3-clause |
chasedog/EpisodeDiscussions | web.py | 1 | 1054 | from flask import Flask, jsonify, render_template
import test, stats, os
app = Flask(__name__)
cache = {}
@app.route('/')
def hello_world():
return 'Hello World!'
@app.route('/r/<string:subreddit>')
def episodes(subreddit):
seasonsAndEpisodes = _getEpisodes(subreddit)
return render_template('index.html',... | apache-2.0 |
etzhou/edx-platform | lms/djangoapps/survey/models.py | 89 | 8631 | """
Models to support Course Surveys feature
"""
import logging
from lxml import etree
from collections import OrderedDict
from django.db import models
from student.models import User
from django.core.exceptions import ValidationError
from model_utils.models import TimeStampedModel
from survey.exceptions import Surv... | agpl-3.0 |
marinho/geraldo | site/newsite/django_1_0/django/contrib/localflavor/mx/mx_states.py | 350 | 1251 | # -*- coding: utf-8 -*-
"""
A list of Mexican states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
from django.utils.translation import ugettext_lazy as _
STATE_CHOICES = (
('AGU', _(u'Aguascalientes')),
('BCN', _(u... | lgpl-3.0 |
pgmillon/ansible | lib/ansible/modules/packaging/os/portage.py | 16 | 14711 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, William L Thomson Jr
# (c) 2013, Yap Sok Ann
# Written by Yap Sok Ann <sokann@gmail.com>
# Modified by William L. Thomson Jr. <wlt@o-sinc.com>
# Based on apt module written by Matthew Williams <matthew@flowroute.com>
#
# GNU General Public License v3.0+ (see COPYIN... | gpl-3.0 |
caihaoyu/scrapy-liferay | liferay/settings.py | 1 | 2132 | # -*- coding: utf-8 -*-
# Scrapy settings for liferay project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest... | mit |
crodrigues96/mtasa-blue | vendor/google-breakpad/src/tools/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | gpl-3.0 |
MarcoVogt/basil | basil/TL/Visa.py | 1 | 1747 | #
# ------------------------------------------------------------
# Copyright (c) All rights reserved
# SiLab, Institute of Physics, University of Bonn
# ------------------------------------------------------------
#
import visa
import logging
from basil.TL.TransferLayer import TransferLayer
class Visa(TransferLayer)... | bsd-3-clause |
meilinxiaoxue/diaphora | pygments/lexers/_mql_builtins.py | 48 | 24736 | # -*- coding: utf-8 -*-
"""
pygments.lexers._mql_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Builtins for the MqlLexer.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
types = (
'AccountBalance',
'AccountCompany',
'AccountCredit... | gpl-2.0 |
mastizada/kuma | vendor/packages/sqlalchemy/lib/sqlalchemy/connectors/zxJDBC.py | 18 | 1677 | import sys
from sqlalchemy.connectors import Connector
class ZxJDBCConnector(Connector):
driver = 'zxjdbc'
supports_sane_rowcount = False
supports_sane_multi_rowcount = False
supports_unicode_binds = True
supports_unicode_statements = sys.version > '2.5.0+'
description_encoding = None... | mpl-2.0 |
jart/tensorflow | tensorflow/contrib/batching/python/ops/batch_ops.py | 15 | 7839 | # Copyright 2017 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 |
Dingmatt/AMSA | Plug-ins/Amsa.bundle/Contents/Libraries/Shared/unidecode/x00c.py | 252 | 4102 | data = (
'[?]', # 0x00
'N', # 0x01
'N', # 0x02
'H', # 0x03
'[?]', # 0x04
'a', # 0x05
'aa', # 0x06
'i', # 0x07
'ii', # 0x08
'u', # 0x09
'uu', # 0x0a
'R', # 0x0b
'L', # 0x0c
'[?]', # 0x0d
'e', # 0x0e
'ee', # 0x0f
'ai', # 0x10
'[?]', # 0x11
'o', # 0x12
'oo', # 0x... | gpl-3.0 |
pombredanne/readthedocs.org | readthedocs/doc_builder/python_environments.py | 1 | 9244 | """An abstraction over virtualenv and Conda environments."""
from __future__ import absolute_import
from builtins import object
import logging
import os
import shutil
from django.conf import settings
from readthedocs.doc_builder.config import ConfigWrapper
from readthedocs.doc_builder.loader import get_builder_class... | mit |
PandaWei/avocado | selftests/functional/test_output_check.py | 2 | 5437 | import os
import sys
import tempfile
import shutil
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
from avocado.core import exit_codes
from avocado.utils import process
from avocado.utils import script
basedir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '... | gpl-2.0 |
fuhrmanator/course-activity-planner | python/tests/calendar_test.py | 2 | 1555 | import unittest
import arrow
from dateutil import tz
from ics_calendar import CalendarReader, Seminar, Practicum, Laboratory, \
GenericMeeting
class TestCalendarParsing(unittest.TestCase):
calendar_path = '../data/multi-fr.ics'
def setUp(self):
self.calendar = CalendarReader(self.calendar_path... | gpl-3.0 |
hsrky/pythoninfo | pythoninfo/lib/file_uploader/sftp_uploader.py | 1 | 4629 | import time
import logging
from base import Base as Uploader
log = logging.getLogger(__name__)
class SFtpUploader(Uploader):
'''
SFTP Upload handler, see parent class for more info
'''
default_port = 22
connect_attempt_count = 0
upload_attempt_count = 0
sftp = None
ssh_client = None
... | mit |
jrl-umi3218/eigen-qld | binding/python/tests/test_qp.py | 2 | 2828 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2019 CNRS-UM LIRMM, CNRS-AIST JRL
#
# Port of the C++ test
import unittest
import eigen
import eigen_qld
class QP1(object):
def __init__(self):
self.nrvar = 6
self.nreq = 3
self.nrineq = 2
self.Q = eigen.MatrixXd.Identity(self.nrvar, self.nrvar)
se... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.