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 |
|---|---|---|---|---|---|
Spiderlover/Toontown | toontown/battle/FireCogPanel.py | 4 | 5821 | from toontown.toonbase.ToontownBattleGlobals import *
from toontown.toonbase import ToontownGlobals
from direct.fsm import StateData
from direct.directnotify import DirectNotifyGlobal
from toontown.battle import BattleBase
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from toontown.toonbase impor... | mit |
thomashaw/SecGen | modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/encodings/iso8859_6.py | 593 | 11089 | """ Python Character Mapping Codec iso8859_6 generated from 'MAPPINGS/ISO8859/8859-6.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | gpl-3.0 |
HaebinShin/tensorflow | tensorflow/contrib/layers/python/layers/layers.py | 1 | 58331 | # 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 |
EdLogan18/logan-repository | plugin.video.exodus/resources/lib/modules/changelog.py | 81 | 1456 | '''
Copyright (C) 2013 Sean Poyser (seanpoyser@gmail.com)
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) any later version.
... | gpl-2.0 |
chand3040/sree_odoo | openerp/addons/account_bank_statement_extensions/wizard/cancel_statement_line.py | 381 | 1484 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... | agpl-3.0 |
nkgilley/home-assistant | homeassistant/components/climate/device_condition.py | 9 | 3765 | """Provide the device automations for Climate."""
from typing import Dict, List
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID,
CONF_CONDITION,
CONF_DEVICE_ID,
CONF_DOMAIN,
CONF_ENTITY_ID,
CONF_TYPE,
)
from homeassistant.core import HomeAssistant, callback
from homea... | apache-2.0 |
AndrewPeelMV/Blender2.78c | 2.78/scripts/addons/mesh_tiny_cad/__init__.py | 2 | 2302 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | gpl-2.0 |
atopuzov/nitro-python | nssrc/com/citrix/netscaler/nitro/resource/config/network/Interface.py | 3 | 61394 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | apache-2.0 |
adragomir/bottle | test/test_outputfilter.py | 1 | 5031 | # -*- coding: utf-8 -*-
'''Everything returned by Bottle()._cast() MUST be WSGI compatiple.'''
import unittest
import bottle
from tools import ServerTestBase, tob, tobs
class TestOutputFilter(ServerTestBase):
''' Tests for WSGI functionality, routing and output casting (decorators) '''
def test_bytes(self):
... | mit |
paolodedios/tensorflow | tensorflow/compiler/tests/reshape_op_test.py | 25 | 1822 | # 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 |
bmanojlovic/ansible | lib/ansible/modules/database/influxdb/influxdb_database.py | 32 | 5579 | #!/usr/bin/python
# (c) 2016, Kamil Szczygiel <kamil.szczygiel () intel.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
# ... | gpl-3.0 |
SidSachdev/pycrunchbase | tests/test_organization.py | 2 | 4315 | from datetime import datetime
from unittest import TestCase
from pycrunchbase import Organization
TEST_DATA = {
"uuid": "df6628127f970b439d3e12f64f504fbb",
"type": "Organization",
"properties": {
"permalink": "testpermalink",
"api_path": "organizations/testpermalink",
"web_path": "... | mit |
cbenhagen/python-for-android | pythonforandroid/util.py | 7 | 4071 | import contextlib
from os.path import exists
from os import getcwd, chdir, makedirs
import io
import json
import shutil
import sys
from tempfile import mkdtemp
try:
from urllib.request import FancyURLopener
except ImportError:
from urllib import FancyURLopener
from pythonforandroid.logger import (logger, Err_F... | lgpl-2.1 |
gaocegege/treadmill | tests/dnsutils_test.py | 3 | 1405 | """Unit test for treadmill.dnsutils
"""
import unittest
from treadmill import dnsutils
class DnsutilsTest(unittest.TestCase):
"""treadmill.dnsutils tests."""
def test_srv_rec_to_url(self):
"""Test srv_rec_to_url method with no protocol"""
srv_rec = ('host', 1234, None, None)
url = d... | apache-2.0 |
emory-libraries/eulxml | eulxml/xpath/parserules.py | 1 | 7468 | # file eulxml/xpath/parserules.py
#
# Copyright 2010,2011 Emory University Libraries
#
# 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... | apache-2.0 |
PersianWikipedia/Database-reports | zzkootah.py | 1 | 7721 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Reza(User:reza1615), 2011
# MIT license
import catlib ,pagegenerators
import wikipedia,urllib,gzip,codecs,re
import MySQLdb as mysqldb
import config,os
from datetime import timedelta,datetime
wikipedia.config.put_throttle = 0
wikipedia.put_throttle.setDelay()
i... | mit |
palerdot/calibre | src/calibre/gui2/viewer/table_popup.py | 7 | 2960 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... | gpl-3.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/lxml-3.3.6/src/lxml/html/_html5builder.py | 110 | 3246 | """
Legacy module - don't use in new code!
html5lib now has its own proper implementation.
This module implements a tree builder for html5lib that generates lxml
html element trees. This module uses camelCase as it follows the
html5lib style guide.
"""
from html5lib.treebuilders import _base, etree as etree_builder... | apache-2.0 |
FireElementalNE/DERP | src/DerpMom/data/Port.py | 2 | 1321 | import pickle
class Port:
def __init__(self, oVal, nVal=None, service=None):
self.opened = oVal
self.number = nVal
self.service = service
def addService(self, service):
self.service = service
def setNumber(self, nVal):
self.number = nVal
def getPortState(self):
return self.opened
def getPo... | gpl-3.0 |
cadappl/krep | krep_subcmds/topic_subcmd.py | 1 | 2707 |
import re
from topics import all_topics, SubCommand
class TopicSubcmd(SubCommand):
COMMAND = 'topic'
help_summary = 'Print the topic summaries'
help_usage = '''\
%prog <topic> ...
Display all registered topics of the program for debugging purpose.
Topic contains the classes that can be imported from "... | lgpl-3.0 |
ct-23/home-assistant | tests/components/scene/test_init.py | 20 | 4086 | """The tests for the Scene component."""
import io
import unittest
from homeassistant.setup import setup_component
from homeassistant import loader
from homeassistant.components import light, scene
from homeassistant.util import yaml
from tests.common import get_test_home_assistant
class TestScene(unittest.TestCase... | apache-2.0 |
c-PRIMED/puq | test/UniformPDF_test.py | 1 | 4485 | #! /usr/bin/env python
'''
Testsuite for the UniformPDF class
'''
from __future__ import absolute_import, division, print_function
import numpy as np
from puq import *
import scipy.stats as stats
def _hisplot(y, nbins):
n, bins = np.histogram(y, nbins, normed=True)
mids = bins[:-1] + np.diff(bins) / 2.0
... | mit |
carletes/libcloud | libcloud/test/loadbalancer/test_softlayer.py | 37 | 8269 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
maxdeliso/elevatorSim | Lib/mailcap.py | 4 | 7435 | """Mailcap file handling. See RFC 1524."""
import os
__all__ = ["getcaps","findmatch"]
# Part 1: top-level interface.
def getcaps():
"""Return a dictionary containing the mailcap database.
The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
to a list of dictionaries corresponding to ... | bsd-2-clause |
codewatchorg/dirscalate | dirscalate.py | 1 | 7428 | # Josh Berry
# CodeWatch
# December 2013
#
import re
import argparse
import StringIO
import datetime
import requests
from requests.auth import HTTPBasicAuth
from requests.auth import HTTPDigestAuth
from requests_ntlm import HttpNtlmAuth
parser = argparse.ArgumentParser(prog='dirscalate.py',
formatter_class=argpars... | bsd-2-clause |
Empeeric/dirometer | django/forms/forms.py | 156 | 21754 | """
Form classes
"""
from django.core.exceptions import ValidationError
from django.utils.copycompat import deepcopy
from django.utils.datastructures import SortedDict
from django.utils.html import conditional_escape
from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode
from django.utils.safest... | mit |
9929105/KEEP | keep_backend/studies/models.py | 2 | 2680 | from django.core.serializers.python import Serializer
from django.db import models
class StudySerializer( Serializer ):
"""
Converts a QuerySet of Study objects into a specific JSON format.
"""
def end_object( self, obj ):
# Convert timestamps into JSON timestamps
self._current[ 'd... | mit |
gandalf000/googletest | test/gtest_xml_outfiles_test.py | 2526 | 5340 | #!/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 |
saurabh6790/test_final_med_app | patches/june_2013/p06_drop_unused_tables.py | 30 | 1768 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
tables = [
"About Us Team",
"Account Balance",
"Announcement",
"Answer",
"Blog Subscriber",
"Books",
"Call Log",
"Call Log Details",
"Campaign Expe... | agpl-3.0 |
Hubert51/AutoGrading | learning/web_Haotian/venv/Lib/site-packages/setuptools/command/upload_docs.py | 173 | 7311 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
"""
from base64 import standard_b64encode
from distutils import log
from distutils.errors import DistutilsOptionError
import os
import socket
import zipfile
import tempfile
import ... | mit |
davols/WhatManager2 | what_meta/views.py | 4 | 2008 | import os
import os.path
import urllib
import datetime
import time
from django.contrib.auth.decorators import login_required
from django.http.response import HttpResponse, HttpResponseNotFound
from django.utils import timezone
from django.utils.http import parse_http_date_safe, http_date
from django.views.decorators.h... | mit |
aajanki/youtube-dl | youtube_dl/extractor/sharesix.py | 128 | 2692 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
parse_duration,
)
class ShareSixIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?sharesix\.com/(?:f/)?(?P... | unlicense |
DONIKAN/django | tests/admin_inlines/tests.py | 118 | 44045 | from __future__ import unicode_literals
import datetime
import warnings
from django.contrib.admin import ModelAdmin, TabularInline
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.auth.models import Permission, User
from... | bsd-3-clause |
ivanhorvath/openshift-tools | openshift/installer/vendored/openshift-ansible-3.8.36-1/roles/lib_openshift/library/oc_adm_router.py | 4 | 109527 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | apache-2.0 |
otherness-space/myProject002 | my_project_002/lib/python2.7/site-packages/django/conf/locale/de_CH/formats.py | 107 | 1389 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
from __future__ import unicode_literals
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i:s'
DA... | mit |
RossLote/cloudplayer | mutagen/trueaudio.py | 28 | 2215 | # -*- coding: utf-8 -*-
# Copyright (C) 2006 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
"""True Audio audio stream information and tags.
True Audio is a los... | mit |
eul721/The-Perfect-Pokemon-Team-Balancer | libs/env/Lib/site-packages/setuptools/command/test.py | 285 | 5932 | from setuptools import Command
from distutils.errors import DistutilsOptionError
import sys
from pkg_resources import *
from pkg_resources import _namespace_packages
from unittest import TestLoader, main
class ScanningLoader(TestLoader):
def loadTestsFromModule(self, module):
"""Return a suite of all test... | gpl-2.0 |
FrankNagel/qlc | src/webapp/quanthistling/scripts/annotations/annotations_for_payne1989.py | 1 | 4018 | # -*- coding: utf8 -*-
import sys, os
sys.path.append(os.path.abspath('.'))
import re
from operator import attrgetter
import difflib
# Pylons model init sequence
import pylons.test
import logging
from quanthistling.config.environment import load_environment
from quanthistling.model.meta import Sessi... | gpl-3.0 |
sbalde/edx-platform | lms/djangoapps/courseware/entrance_exams.py | 37 | 6545 | """
This file contains all entrance exam related utils/logic.
"""
from django.conf import settings
from courseware.access import has_access
from courseware.model_data import FieldDataCache
from courseware.models import StudentModule
from opaque_keys.edx.keys import UsageKey
from student.models import EntranceExamConfi... | agpl-3.0 |
smallyear/linuxLearn | salt/salt/loader.py | 1 | 51863 | # -*- coding: utf-8 -*-
'''
We wanna be free to ride our machines without being hassled by The Man!
And we wanna get loaded!
And we wanna have a good time!
And that's what we are gonna do. We are gonna have a good time...
'''
# Import python libs
from __future__ import absolute_import
import os
import imp
import sys
i... | apache-2.0 |
InstitutoPascal/Staff | languages/my.py | 151 | 8210 | # coding: utf8
{
'!langcode!': 'my',
'!langname!': 'Malay',
'%d days ago': '%d hari yang lalu',
'%d hours ago': '%d jam yang lalu',
'%d minutes ago': '%d minit yang lalu',
'%d months ago': '%d bulan yang lalu',
'%d seconds ago': '%d saat yang lalu',
'%d seconds from now': '%d saat dari sekarang',
'%d weeks ago': '%d mi... | gpl-3.0 |
dmwu/sparrow | deploy/third_party/boto-2.1.1/boto/ec2/securitygroup.py | 4 | 12124 | # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011, Eucalyptus Systems, Inc.
#
# 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
# w... | apache-2.0 |
MikeAmy/django | tests/known_related_objects/tests.py | 363 | 6425 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Organiser, Pool, PoolStyle, Tournament
class ExistingRelatedInstancesTests(TestCase):
@classmethod
def setUpTestData(cls):
cls.t1 = Tournament.objects.create(name='Tourney 1')
cls.t2 = Tournament.ob... | bsd-3-clause |
nikolamilosevic86/yapf | yapftests/reformatter_test.py | 3 | 82146 | # Copyright 2015 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 a... | apache-2.0 |
aolindahl/streaking | process_hdf5.py | 1 | 46151 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 8 15:37:51 2015
@author: Anton O Lindahl
"""
import h5py
import argparse
import matplotlib.pyplot as plt
import numpy as np
import time
import os
import sys
import lmfit
import warnings
from aolPyModules import wiener, wavelet_filter
import time_to_energy_conversion as ... | gpl-2.0 |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_stats_py3.py | 9 | 1731 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
riteshshrv/django | django/contrib/admin/migrations/0001_initial.py | 419 | 1958 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.admin.models
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('conten... | bsd-3-clause |
shakilkanji/rmc | models/course_alert.py | 8 | 5092 | import datetime
import json
import mongoengine as me
import requests
import course
import rmc.shared.secrets as s
import section
from rmc.shared import util
class BaseCourseAlert(me.Document):
"""An abstract base class for notifying when a seat opens in a course.
Subclasses must define the behaviour for se... | mit |
fnouama/intellij-community | python/helpers/sphinxcontrib/napoleon/__init__.py | 64 | 13805 | # -*- coding: utf-8 -*-
# Copyright 2014 Rob Ruana
# Licensed under the BSD License, see LICENSE file for details.
"""Sphinx napoleon extension -- support for NumPy and Google style docstrings.
"""
import sys
from six import iteritems
from sphinxcontrib.napoleon.docstring import GoogleDocstring, NumpyDocstring
from ... | apache-2.0 |
dkliban/pulp_puppet | pulp_puppet_plugins/test/unit/test_distributor_configuration.py | 4 | 3040 | import mock
import unittest
from pulp.plugins.config import PluginCallConfiguration
from pulp_puppet.common import constants
from pulp_puppet.plugins.distributors import configuration
class HttpTests(unittest.TestCase):
def test_validate_serve_http(self):
# Test
config = PluginCallConfiguration... | gpl-2.0 |
rghe/ansible | lib/ansible/modules/cloud/openstack/os_user_group.py | 86 | 2880 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# 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',
... | gpl-3.0 |
CCI-MOC/nova | nova/network/opts.py | 51 | 1529 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | apache-2.0 |
houshengbo/nova_vmware_compute_driver | nova/api/openstack/compute/contrib/deferred_delete.py | 3 | 3069 | # Copyright 2011 OpenStack, LLC
# 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 b... | apache-2.0 |
mims2707/bite-project | deps/gdata-python-client/samples/oauth/oauth_on_appengine/appengine_utilities/sessions.py | 128 | 36373 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2008, appengine-utilities project
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
... | apache-2.0 |
nkrinner/nova | nova/tests/virt/hyperv/test_hypervapi.py | 5 | 73418 | # Copyright 2012 Cloudbase Solutions Srl
#
# 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 |
ar45/django | tests/m2m_regress/tests.py | 273 | 4695 | from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from django.utils import six
from .models import (
Entry, Line, Post, RegressionModelSplit, SelfRefer, SelfReferChild,
SelfReferChildSibling, Tag, TagCollection, Worksheet,
)
class M2MRegre... | bsd-3-clause |
lexqt/django-pipeline | pipeline/compilers/__init__.py | 3 | 6111 | from __future__ import unicode_literals
import os
import subprocess
from tempfile import NamedTemporaryFile
from django.contrib.staticfiles import finders
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.files.base import ContentFile
from django.utils.encoding import smart_bytes
fro... | mit |
mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/scipy/optimize/nnls.py | 23 | 1424 | from __future__ import division, print_function, absolute_import
from . import _nnls
from numpy import asarray_chkfinite, zeros, double
__all__ = ['nnls']
def nnls(A, b):
"""
Solve ``argmin_x || Ax - b ||_2`` for ``x>=0``. This is a wrapper
for a FORTRAN non-negative least squares solver.
Parameter... | mit |
junmin-kim/TizenRT | external/gmock/gtest/test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/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 |
slitvinov/lammps-swimmer | tools/moltemplate/examples/CG_biomolecules/membrane+protein/moltemplate_files/calc_table/version_charmm_cutoff/calc_table.py | 87 | 2404 | #!/usr/bin/env python
# Calculate a table of pairwise energies and forces between "INT" atoms
# in the lipid membrane model described in
# Brannigan et al, Phys Rev E, 72, 011915 (2005)
# The energy of this interaction U(r) = eps*(0.4*(sigma/r)^12 - 3.0*(sigma/r)^2)
# I realized later this is not what we want becau... | gpl-2.0 |
aidan-/ansible-modules-extras | cloud/cloudstack/cs_router.py | 44 | 10710 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | gpl-3.0 |
neiudemo1/django | tests/serializers/models/base.py | 112 | 4314 | """
Serialization
``django.core.serializers`` provides interfaces to converting Django
``QuerySet`` objects to and from "flat" data (i.e. strings).
"""
from __future__ import unicode_literals
from decimal import Decimal
from django.db import models
from django.utils import six
from django.utils.encoding import pytho... | bsd-3-clause |
M4rtinK/shiboken-bb10 | tests/samplebinding/date_test.py | 3 | 1823 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the Shiboken Python Bindings Generator project.
#
# Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
#
# Contact: PySide team <contact@pyside.org>
#
# This program is free software; you can redistribute it and/or
# modify it under t... | gpl-2.0 |
jds2001/ocp-checkbox | plainbox/plainbox/impl/providers/test_checkbox.py | 1 | 1330 | # This file is part of Checkbox.
#
# Copyright 2012, 2013 Canonical Ltd.
# Written by:
# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
#
# Checkbox 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 |
tieu/balrog | auslib/test/admin/views/test_history.py | 1 | 7025 | import json
from auslib.global_state import dbo
from auslib.test.admin.views.base import ViewTest
class TestHistoryView(ViewTest):
def testFieldViewBadValuesBadTable(self):
url = '/history/view/notatable/1/whatever'
ret = self.client.get(url)
self.assertStatusCode(ret, 400)
self.... | mpl-2.0 |
rosterloh/mbed | workspace_tools/host_tests/rpc.py | 125 | 1607 | """
mbed SDK
Copyright (c) 2011-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 law or agreed to in wr... | apache-2.0 |
kbaseapps/kb_phylogenomics | scripts/prepare_deploy_cfg.py | 1 | 1496 | import sys
import os
import os.path
from jinja2 import Template
try:
from ConfigParser import ConfigParser # py2
except:
from configparser import ConfigParser # py3
import StringIO
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: <program> <deploy_cfg_template_file> <file_with_prop... | mit |
anthonyfok/frescobaldi | frescobaldi_app/highlight2html.py | 4 | 3289 | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... | gpl-2.0 |
anthrotype/gobject-introspection | giscanner/msvccompiler.py | 1 | 3827 | # -*- Mode: Python -*-
# GObject-Introspection - a framework for introspecting GObject libraries
# Copyright (C) 2014 Chun-wei Fan
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; eithe... | gpl-2.0 |
ivanhorvath/openshift-tools | openshift/installer/vendored/openshift-ansible-3.5.91/library/rpm_q.py | 66 | 1818 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Tobias Florek <tob@butter.sh>
# Licensed under the terms of the MIT License
"""
An ansible module to query the RPM database. For use, when yum/dnf are not
available.
"""
# pylint: disable=redefined-builtin,wildcard-import,unused-wildcard-import
from ansible.module... | apache-2.0 |
Adai0808/scikit-learn | sklearn/externals/joblib/func_inspect.py | 239 | 11338 | """
My own variation on function-specific inspect-like features.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
from itertools import islice
import inspect
import warnings
import re
import os
from ._compat import _basestrin... | bsd-3-clause |
sbidoul/buildbot | master/buildbot/revlinks.py | 6 | 3273 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
pdp10/sbpipe | sbpipe/utils/dependencies.py | 2 | 3141 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 Piero Dalle Pezze
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the ... | mit |
cccs-web/mezzanine | mezzanine/pages/migrations/0005_rename_contentpage.py | 8 | 4732 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
orm.Page.objects.filter(content_model="contentpage").update(content_model="richtextpage")
def backwards(self, orm):
... | bsd-2-clause |
developerinlondon/ansible-modules-core | utilities/logic/set_fact.py | 115 | 2015 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Dag Wieers <dag@wieers.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 Lice... | gpl-3.0 |
dmonner/tweater | py/nltk/metrics/confusionmatrix.py | 4 | 7393 | # Natural Language Toolkit: Confusion Matrices
#
# Copyright (C) 2001-2011 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
class ConfusionMatrix(object):
"""
The confusio... | gpl-3.0 |
gentimouton/shop-heroes | db/db_items.py | 2 | 584695 | item_db = \
{ 'abyssal-brand': { 'category': 'swords',
'components': { 'silver-steel': 3,
'vorpal-sword': (1, 'flawless')},
'level': 32,
'name': 'Abyssal Brand',
'postcraf... | mit |
firebitsbr/raspberry_pwn | src/pentest/sqlmap/extra/safe2bin/safe2bin.py | 7 | 4106 | #!/usr/bin/env python
"""
safe2bin.py - Simple safe(hex) to binary format converter
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import binascii
import re
import string
import os
import sys
from optparse import OptionError
from optparse import ... | gpl-3.0 |
sattarvoybek/OwnKernel-sprout | tools/perf/util/setup.py | 2079 | 1438 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
yfried/ansible | lib/ansible/modules/network/aci/aci_domain_to_encap_pool.py | 15 | 11289 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers <dag@wieers.com>
# 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'... | gpl-3.0 |
breezechen/syncless | benchmark/speed_syncless_wsgi.py | 5 | 1072 | #! /usr/local/bin/stackless2.6
# by pts@fazekas.hu at Thu Jan 7 15:53:22 CET 2010
import logging
import socket
import stackless
import sys
from syncless import coio
from syncless import wsgi
from syncless import patch
import lprng
def WsgiApplication(env, start_response):
print >>sys.stderr, 'connection from %(RE... | apache-2.0 |
oser-cs/oser-website | tests/test_projects/test_edition_api.py | 1 | 2146 | """Editions API tests."""
from rest_framework import status
from tests.utils import SimpleAPITestCase, logged_in
from projects.factory import EditionFactory, EditionFormFactory
class EditionEndpointsTest(SimpleAPITestCase):
"""Test access to the editions endpoints."""
factory = EditionFactory
read_exp... | gpl-3.0 |
olituks/sentinella | frontend/library/web2py/applications/sentinella/languages/sk.py | 161 | 6877 | # coding: utf8
{
'!langcode!': 'sk',
'!langname!': 'Slovenský',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" je voliteľný výraz ako "field1=\'newvalue\'". Nemôžete upravovať alebo zmazať výsledky JOINu',
'%s %%{row} deleted': '%s zmazaných... | lgpl-2.1 |
justnom/ansible-modules-core | cloud/amazon/ec2_metric_alarm.py | 61 | 10684 | #!/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 |
ganeshnalawade/ansible | lib/ansible/modules/sysvinit.py | 30 | 13538 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Brian Coca <bcoca@ansible.com>
# (c) 2017, Adam Miller <admiller@redhat.com>
# (c) 2017 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
__m... | gpl-3.0 |
ojengwa/odoo | openerp/tools/safe_eval.py | 250 | 12368 | # -*- coding: utf-8 -*-
##############################################################################
# Copyright (C) 2004-2014 OpenERP s.a. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... | agpl-3.0 |
2ndQuadrant/ansible | lib/ansible/modules/network/fortios/fortios_log_webtrends_setting.py | 23 | 7429 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
leighpauls/k2cro4 | tools/gyp/pylib/gyp/__init__.py | 110 | 21271 | #!/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.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import traceback
from gyp.common import GypErr... | bsd-3-clause |
TitasNandi/Summer_Project | gensim-0.12.4/gensim/models/phrases.py | 17 | 10461 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automatically detect common phrases (multiword expressions) from a stream of sentences.
The phrases are collocations (frequently co-occurring tokens). See [1]_ for the
exact formula.
For examp... | apache-2.0 |
westinedu/newertrends | zinnia/tests/templatetags.py | 2 | 32756 | """Test cases for Zinnia's templatetags"""
from __future__ import with_statement
from django.test import TestCase
from django.template import Context
from django.template import Template
from django.template import TemplateSyntaxError
from django.contrib import comments
from django.core.paginator import Paginator
from... | bsd-3-clause |
yize/grunt-tps | tasks/lib/python/Lib/python2.7/email/test/test_email_renamed.py | 53 | 121318 | # Copyright (C) 2001-2007 Python Software Foundation
# Contact: email-sig@python.org
# email package unit tests
import os
import sys
import time
import base64
import difflib
import unittest
import warnings
from cStringIO import StringIO
import email
from email.charset import Charset
from email.header import Header, ... | mit |
yfried/ansible | lib/ansible/modules/cloud/ovirt/ovirt_cluster.py | 18 | 31464 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
# 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': 'community'}
DOCUME... | gpl-3.0 |
pdellaert/ansible | lib/ansible/modules/cloud/azure/azure_rm_rediscache_info.py | 20 | 11025 | #!/usr/bin/python
#
# Copyright (c) 2018 Yunge Zhu <yungez@microsoft.com>
#
# 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',
... | gpl-3.0 |
aasensio/elecciones2015 | dhondt.py | 2 | 7908 | #!/usr/bin/env python3
# −*− coding: UTF−8 −*−
import sys
from argparse import ArgumentParser
class dhondt():
"""Class to calculate d'Hondt statistics
:Authors: Pedro Ferrer, Silvia Fuentes
:Date: 2015-07-20
:version: 1.1
The minimum data to be providen is:
+ The number of seats [nseats]
... | mit |
gauribhoite/personfinder | env/site-packages/django/http/request.py | 86 | 21287 | from __future__ import unicode_literals
import copy
import os
import re
import sys
from io import BytesIO
from itertools import chain
from pprint import pformat
from django.conf import settings
from django.core import signing
from django.core.exceptions import DisallowedHost, ImproperlyConfigured
from django.core.fil... | apache-2.0 |
mdanielwork/intellij-community | python/helpers/pockets/inspect.py | 30 | 3524 | # -*- coding: utf-8 -*-
# Copyright (c) 2016 the Pockets team, see AUTHORS.
# Licensed under the BSD License, see LICENSE for details.
"""A pocket full of useful reflection functions!"""
from __future__ import absolute_import
import inspect
import functools
from pockets.collections import listify
from six import str... | apache-2.0 |
mrquim/repository.mrquim | repo/script.module.youtube.dl/lib/youtube_dl/extractor/learnr.py | 76 | 1185 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class LearnrIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?learnr\.pro/view/video/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://www.learnr.pro/view/video/51624-web-development-tutorial-for-beginners-1-how-to-bu... | gpl-2.0 |
TiKunze/CanMics | src/python/01_SingleChannel/3pop/EIN/HeHiVariation/RUM_Detektor_HeHi_2ndversion_cluster.py | 1 | 5917 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 22 17:15:03 2015
@author: Tim Kunze
Copyright (C) 2015, Tim Kunze. All rights reserved.
This script is a modified version of the RUM Detector:
instead of sweeping over He and Hi in every diagram, we sweep over lenge and intensity of the impulse (as in the actiation p... | gpl-3.0 |
yahoo/yos-social-python | build/lib/yahoo/application.py | 3 | 11168 | """
Yahoo! Python SDK
* Yahoo! Query Language
* Yahoo! Social API
Find documentation and support on Yahoo! Developer Network: http://developer.yahoo.com
Hosted on GitHub: http://github.com/yahoo/yos-social-python/tree/master
@copyright: Copyrights for code authored by Yahoo! Inc. is licensed under the following t... | bsd-3-clause |
devs1991/test_edx_docmode | common/djangoapps/track/tests/test_middleware.py | 31 | 7925 | # -*- coding: utf-8 -*-
"""Tests for tracking middleware."""
import ddt
from mock import patch
from mock import sentinel
from django.contrib.auth.models import User
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import TestCase
from django.test.client import RequestFactory
from djang... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.