repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
antepsis/anteplahmacun | sympy/sets/tests/test_sets.py | 7 | 39316 | from sympy import (Symbol, Set, Union, Interval, oo, S, sympify, nan,
GreaterThan, LessThan, Max, Min, And, Or, Eq, Ge, Le, Gt, Lt, Float,
FiniteSet, Intersection, imageset, I, true, false, ProductSet, E,
sqrt, Complement, EmptySet, sin, cos, Lambda, ImageSet, pi,
Eq, Pow, Contains, Sum, rootof, Symmetr... | bsd-3-clause |
rhndg/openedx | common/djangoapps/track/backends/tests/test_logger.py | 108 | 1977 | from __future__ import absolute_import
import json
import logging
import datetime
from django.test import TestCase
from track.backends.logger import LoggerBackend
class TestLoggerBackend(TestCase):
def setUp(self):
super(TestLoggerBackend, self).setUp()
self.handler = MockLoggingHandler()
... | agpl-3.0 |
CSCI1200Course/csci1200OnlineCourse | modules/course_explorer/course_explorer.py | 19 | 2859 | # Copyright 2013 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 ... | apache-2.0 |
pabulumm/neighbors | lib/python3.4/site-packages/django/contrib/gis/db/backends/postgis/adapter.py | 373 | 1695 | """
This object provides quoting for GEOS geometries into PostgreSQL/PostGIS.
"""
from __future__ import unicode_literals
from psycopg2 import Binary
from psycopg2.extensions import ISQLQuote
class PostGISAdapter(object):
def __init__(self, geom, geography=False):
"Initializes on the geometry."
... | bsd-3-clause |
BryanQuigley/sos | sos/report/plugins/openstack_nova.py | 1 | 8428 | # Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
# Copyright (C) 2012 Rackspace US, Inc.,
# Justin Shepherd <jshepher@rackspace.com>
# Copyright (C) 2013 Red Hat, Inc., Jeremy Agee <jagee@redhat.com>
# Copyright (C) 2015 Red Hat, Inc., Abhijeet Kasurde <akasurde@redhat.com>
# Copyri... | gpl-2.0 |
tuxxy/CloudBot | plugins/locate.py | 31 | 2234 | import requests
from cloudbot import hook
from cloudbot.util import web
# Define some constants
base_url = 'https://maps.googleapis.com/maps/api/'
geocode_api = base_url + 'geocode/json'
# Change this to a ccTLD code (eg. uk, nz) to make results more targeted towards that specific country.
# <https://developers.goog... | gpl-3.0 |
hoelsner/product-database | app/ciscoeox/tests/test_ciscoeox_views.py | 1 | 4220 | """
Test suite for the ciscoeox.views module
"""
import pytest
from django.contrib.auth.models import AnonymousUser, User
from django.core.cache import cache
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from django.test import RequestFactory
from app.ciscoeox import tasks
from app... | mit |
dexterx17/nodoSocket | clients/Python-2.7.6/Lib/unittest/test/test_loader.py | 8 | 49874 | import sys
import types
import unittest
class Test_TestLoader(unittest.TestCase):
### Tests for TestLoader.loadTestsFromTestCase
################################################################
# "Return a suite of all tests cases contained in the TestCase-derived
# class testCaseClass"
def te... | mit |
ProjectSWGCore/NGECore2 | scripts/mobiles/talus/aakuan_follower.py | 2 | 1620 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | lgpl-3.0 |
Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/orca/dectalk.py | 1 | 14816 | # Orca
#
# Copyright 2005-2008 Google Inc.
#
# 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; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library i... | gpl-3.0 |
hidekb/espressopp | src/bc/SlabBC.py | 7 | 2456 | # Copyright (C) 2014
# Pierre de Buyl
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it ... | gpl-3.0 |
davehunt/selenium | py/test/selenium/webdriver/common/frame_switching_tests.py | 7 | 17301 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
googleapis/googleapis-gen | google/cloud/secretmanager/v1/secretmanager-v1-py/google/cloud/secretmanager_v1/services/secret_manager_service/transports/grpc.py | 1 | 30493 | # -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
heeraj123/oh-mainline | vendor/packages/scrapy/scrapy/tests/test_commands.py | 16 | 5641 | from __future__ import with_statement
import sys
import os
import subprocess
from os.path import exists, join, abspath
from shutil import rmtree
from tempfile import mkdtemp
from twisted.trial import unittest
class ProjectTest(unittest.TestCase):
project_name = 'testproject'
def setUp(self):
self.t... | agpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.6.0/Lib/test/test_email/test_inversion.py | 10 | 2075 | """Test the parser and generator are inverses.
Note that this is only strictly true if we are parsing RFC valid messages and
producing RFC valid messages.
"""
import io
import unittest
from email import policy, message_from_bytes
from email.message import EmailMessage
from email.generator import BytesGenerator
from t... | mit |
elpaso/QGIS | python/plugins/processing/algs/grass7/ext/r_li_richness_ascii.py | 45 | 1446 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_richness_ascii.py
----------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
**************... | gpl-2.0 |
h0tw1r3/mame | 3rdparty/googletest/googlemock/test/gmock_output_test.py | 986 | 5999 | #!/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... | gpl-2.0 |
brianjmiller/TinCanPython | tincan/context_activities.py | 7 | 3538 | # Copyright 2014 Rustici Software
#
# 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... | apache-2.0 |
broxtronix/thunder | python/thunder/extraction/block/methods/nmf.py | 8 | 3873 | from thunder.extraction.block.base import BlockMethod, BlockAlgorithm
from thunder.extraction.source import Source
class BlockNMF(BlockMethod):
def __init__(self, **kwargs):
algorithm = NMFBlockAlgorithm(**kwargs)
super(self.__class__, self).__init__(algorithm, **kwargs)
class NMFBlockAlgorithm... | apache-2.0 |
sohonetlabs/sizefs | tests/test_sfs.py | 1 | 6577 | import pytest
from fs.errors import ResourceInvalidError, ResourceNotFoundError
from sizefs.contents import (
SizeFSAlphaNumGen, SizeFSOneGen, SizeFSZeroGen
)
from sizefs.sizefs import SizeFS, SizeFile, DirEntry, doc_test
__author__ = "Mark McArdle, Joel Wright"
@pytest.fixture
def sfs():
return SizeFS()
... | mit |
Stillbot/stillbot-master | stillbot_master/server.py | 1 | 3453 | #!/usr/bin/env python
from werkzeug.exceptions import HTTPException, NotAcceptable, NotFound, InternalServerError
from werkzeug.routing import Map, Rule
from werkzeug.wrappers import Response
import json
from arduino import StillbotMaster
from stillbot_master.webapp.models import Session, Thermistor, Temperature
cla... | mit |
Ungolianth/qmk_firmware | lib/lufa/Demos/Device/ClassDriver/GenericHID/HostTestApp/test_generic_hid_winusb.py | 92 | 2725 | """
LUFA Library
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
"""
"""
LUFA Generic HID device demo host test script. This script will send a
continuous stream of generic reports to the device, to show a variable LED
pattern on the t... | gpl-2.0 |
lanbing510/GTDWeb | django/db/models/base.py | 30 | 71689 | from __future__ import unicode_literals
import copy
import inspect
import sys
import warnings
from itertools import chain
from django.apps import apps
from django.apps.config import MODELS_MODULE_NAME
from django.conf import settings
from django.core import checks
from django.core.exceptions import (
NON_FIELD_ER... | gpl-2.0 |
maxiberta/django-asterisk | django_asterisk/models.py | 1 | 1440 | # coding=utf-8
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.core import urlresolvers
import datetime
class Call(models.Model):
content_type = models.ForeignKey(ContentType, blank=True, null=True)
object_id =... | mit |
therewillbecode/ichnaea | ichnaea/webapp/settings.py | 1 | 1687 | """
Contains :ref:`Gunicorn configuration settings <gunicorn:settings>`.
This needs to be specified on the command line via the `-c` argument:
.. code-block:: bash
bin/gunicorn -c ichnaea.webapp.settings ichnaea.webapp.app:wsgi_app
"""
# Use our own Gevent worker
worker_class = 'ichnaea.webapp.worker.LocationG... | apache-2.0 |
gnowxilef/youtube-dl | youtube_dl/extractor/sohu.py | 12 | 6761 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse_urlencode,
)
from ..utils import ExtractorError
class SohuIE(InfoExtractor):
_VALID_URL = r'https?://(?P<mytv>my\.)?tv\.sohu\.com/.+?/(?(mytv)|n)(?P<... | unlicense |
ffosilva/kernel | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
srluge/SickRage | lib/tornado/simple_httpclient.py | 39 | 23547 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
from tornado.concurrent import is_future
from tornado.escape import utf8, _unicode
from tornado.httpclient import HTTPResponse, HTTPError, AsyncHTTPClient, main, _RequestProxy
from tornado import httputil
from tornad... | gpl-3.0 |
liukaijv/XlsxWriter | xlsxwriter/test/comparison/test_button02.py | 8 | 1142 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
amyvmiwei/kbengine | kbe/src/lib/python/Lib/msilib/__init__.py | 86 | 17536 | # Copyright (C) 2005 Martin v. Löwis
# Licensed to PSF under a Contributor Agreement.
from _msi import *
import os, string, re, sys
AMD64 = "AMD64" in sys.version
Itanium = "Itanium" in sys.version
Win64 = AMD64 or Itanium
# Partially taken from Wine
datasizemask= 0x00ff
type_valid= 0x0100
type_localizabl... | lgpl-3.0 |
mozvip/CouchPotatoServer | libs/werkzeug/contrib/fixers.py | 87 | 9071 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.fixers
~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module includes various helpers that fix bugs in web servers. They may
be necessary for some versions of a buggy web server but not others. We try
to stay updated with the status of the bug... | gpl-3.0 |
supertom/libcloud | libcloud/test/backup/test_base.py | 19 | 1053 | # 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 |
kbdick/RecycleTracker | recyclecollector/scrap/gdata-2.0.18/build/lib.linux-x86_64-2.7/gdata/geo/data.py | 132 | 2385 | #!/usr/bin/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 law ... | gpl-3.0 |
ryfeus/lambda-packs | Spacy/source2.7/numpy/matrixlib/tests/test_regression.py | 8 | 1082 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (
run_module_suite, assert_, assert_equal, assert_raises
)
class TestRegression(object):
def test_kron_matrix(self):
# Ticket #71
x = np.matrix('[1 0; 1 0]')
assert_equal(... | mit |
vladikr/nova_drafts | nova/tests/api/openstack/compute/contrib/test_createserverext.py | 9 | 17191 | # Copyright 2010-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.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
petrutlucian94/nova_dev | nova/api/openstack/compute/plugins/v3/certificates.py | 15 | 2966 | # Copyright (c) 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 ... | apache-2.0 |
mukulsoni/android_kernel_samsung_ms013g-G4SWA | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# 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 Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
dnerdy/namesync | namesync/packages/requests/packages/chardet/charsetgroupprober.py | 2929 | 3791 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... | mit |
peguin40/zulip | zerver/views/webhooks/librato.py | 13 | 7611 | from __future__ import absolute_import
from typing import Any, Optional, Callable, Tuple, Text
from six.moves import zip
from django.utils.translation import ugettext as _
from django.utils.datetime_safe import datetime
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webho... | apache-2.0 |
smattis/BET-1 | examples/FEniCS/myModel_serial.py | 1 | 4729 | # Copyright (C) 2016 The BET Development Team
# -*- coding: utf-8 -*-
import numpy as np
from dolfin import *
from meshDS import meshDS
from projectKL import projectKL
from poissonRandField import solvePoissonRandomField
import scipy.io as sio
import sys
import ast
def my_model(parameter_sample):
KL_mdat = sio.l... | gpl-3.0 |
IllusionRom-deprecated/android_platform_external_chromium_org_tools_gyp | pylib/gyp/win_tool.py | 83 | 6501 | #!/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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | bsd-3-clause |
Cl3MM/metagoofil | unzip.py | 25 | 3848 | """ unzip.py
Version: 1.1
Extract a zipfile to the directory provided
It first creates the directory structure to house the files
then it extracts the files to it.
Sample usage:
command line
unzip.py -p 10 -z c:\testfile.zip -o c:\testoutput
python class
import unzip
un = unzi... | gpl-2.0 |
SeanDMatthews/n0tb0t | src/core_modules/auto_quotes.py | 2 | 17393 | import threading
import time
import gspread
import sqlalchemy
import src.models as models
import src.utils as utils
class AutoQuoteMixin:
def __init__(self):
self.starting_spreadsheets_list.append('auto_quotes')
self.auto_quotes_timers = {}
@utils.retry_gspread_func
def _initialize_auto... | mit |
GovReady/govready-q | guidedmodules/migrations/0031_auto_20171023_2033.py | 1 | 1332 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-10-23 20:33
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('guidedmodules', '0030_module_key_rename_module_name'),
... | gpl-3.0 |
canwe/NewsBlur | vendor/feedvalidator/__init__.py | 16 | 10034 | """$Id: __init__.py 699 2006-09-25 02:01:18Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 699 $"
__date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
impo... | mit |
bithinalangot/ecidadania-dev | docs/config/all.py | 1 | 7998 | # -*- coding: utf-8 -*-
#
# a documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 26 13:02:19 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All confi... | gpl-3.0 |
eeshangarg/oh-mainline | vendor/packages/sphinx/sphinx/addnodes.py | 16 | 5432 | # -*- coding: utf-8 -*-
"""
sphinx.addnodes
~~~~~~~~~~~~~~~
Additional docutils nodes.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from docutils import nodes
class toctree(nodes.General, nodes.Element):
"""Node for inserting a... | agpl-3.0 |
abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/code/model/tests/test_branchset.py | 1 | 5920 | # Copyright 2009-2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for BranchSet."""
__metaclass__ = type
from testtools.matchers import LessThan
from zope.security.proxy import removeSecurityProxy
from lp.app.enums import Informa... | agpl-3.0 |
vhavlena/appreal | netbench/pattern_match/bin/library/eap/toolbox.py | 2 | 47101 | # This file is part of EAP.
#
# EAP 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, either version 3 of
# the License, or (at your option) any later version.
#
# EAP is distributed in ... | gpl-2.0 |
deklungel/iRulez | old/modules/libraries/mysql/connector/locales/eng/__init__.py | 39 | 1153 | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | mit |
dan1/django_openstack_auth_proto | openstack_auth/plugin/token.py | 2 | 1501 | # 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 t... | apache-2.0 |
hsaputra/tensorflow | tensorflow/contrib/nn/python/ops/alpha_dropout.py | 39 | 3516 | # 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 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/paramiko/win_pageant.py | 6 | 5371 | # Copyright (C) 2005 John Arbash-Meinel <john@arbash-meinel.com>
# Modified up by: Todd Whiteman <ToddW@ActiveState.com>
#
# This file is part of paramiko.
#
# Paramiko 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
# Softwa... | agpl-3.0 |
Averroes/statsmodels | statsmodels/examples/ex_multivar_kde.py | 34 | 1504 |
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import axes3d
import statsmodels.api as sm
"""
This example illustrates the nonparametric estimation of a
bivariate bi-modal distribution that is a mixture of two normal
distri... | bsd-3-clause |
DepthDeluxe/ansible | lib/ansible/modules/storage/netapp/sf_volume_manager.py | 20 | 11481 | #!/usr/bin/python
# (c) 2017, NetApp, Inc
#
# 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.... | gpl-3.0 |
hep-gc/glint-horizon | openstack_dashboard/dashboards/project/routers/tabs.py | 8 | 2061 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Nachi Ueno, NTT MCL, 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... | apache-2.0 |
figarocorso/mss | mss/agent/tests/utils.py | 4 | 1115 | import os
import shutil
from subprocess import Popen
import time
import unittest
modules_dir = "/tmp/mss_modules/"
log_file = "/tmp/mss-agent.log"
db_file = "/tmp/mss-agent.db"
def cleanup_tests():
# Cleanup before running the tests
if os.path.isdir(modules_dir):
shutil.rmtree(modules_dir)
if os.p... | gpl-3.0 |
bobisme/odoo | addons/hr/hr.py | 28 | 20373 | # -*- 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 |
droyuki/jieba-slidingw | jieba/posseg/viterbi.py | 3 | 1467 | import operator
MIN_FLOAT = -3.14e100
MIN_INF = float("-inf")
def get_top_states(t_state_v, K=4):
return sorted(t_state_v, key=t_state_v.__getitem__, reverse=True)[:K]
def viterbi(obs, states, start_p, trans_p, emit_p):
V = [{}] #tabular
mem_path = [{}]
all_states = trans_p.keys()
for y in states.... | mit |
mvo5/snapcraft | tests/integration/general/test_yaml_in_subdir.py | 4 | 1401 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016-2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | gpl-3.0 |
gnu-sandhi/gnuradio | gr-wxgui/src/python/waterfallsink_gl.py | 14 | 5514 | #
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version... | gpl-3.0 |
narendrameena/featuerSelectionAssignment | crossValidation.py | 1 | 3370 | import numpy as np
from sklearn import cross_validation
from sklearn import svm
from sklearn.svm import LinearSVC
from sklearn.datasets import load_svmlight_file
from sklearn.pipeline import make_pipeline
from sklearn.feature_selection import SelectFromModel
from sklearn.feature_selection import RFE
from sklearn.cross_... | cc0-1.0 |
tobegit3hub/deep_cnn | java_predict_client/src/main/proto/tensorflow/contrib/learn/python/learn/basic_session_run_hooks.py | 27 | 1408 | # 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 |
weidongxu84/info-gatherer | django/contrib/flatpages/tests/csrf.py | 228 | 3780 | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase, Client
class FlatpageCSRFTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.tests.urls'
def setUp(self):
self.client = Client(enforce_csrf_checks=... | mit |
KiChjang/servo | tests/wpt/web-platform-tests/tools/third_party/h2/examples/asyncio/asyncio-server.py | 14 | 7261 | # -*- coding: utf-8 -*-
"""
asyncio-server.py
~~~~~~~~~~~~~~~~~
A fully-functional HTTP/2 server using asyncio. Requires Python 3.5+.
This example demonstrates handling requests with bodies, as well as handling
those without. In particular, it demonstrates the fact that DataReceived may
be called multiple times, and ... | mpl-2.0 |
xu-hong/AirbnbScrape | DataCleanAirbnb.py | 3 | 3629 | import pandas as pd
import numpy as np
import datetime as dt
import sexmachine.detector as gender
# Read data as a pandas dataframe
def DataClean(data):
#convert datetime to membership length
data['MemberDateNew'] = pd.DataFrame(data['MemberDate']).applymap(DeleteSpace).MemberDate
data['MemberLength... | mit |
sugarlabs/sugar | src/jarabe/desktop/activitieslist.py | 2 | 28610 | # Copyright (C) 2008 One Laptop Per Child
# Copyright (C) 2009 Tomeu Vizoso
# Copyright (C) 2008-2013 Sugar Labs
# Copyright (C) 2013 Daniel Francis
# Copyright (C) 2013 Walter Bender
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | gpl-3.0 |
jmesteve/openerp | openerp/addons/l10n_es_aeat/wizard/__init__.py | 4 | 1055 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2011
# Pexego Sistemas Informáticos. (http://pexego.es) All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
liberorbis/libernext | env/lib/python2.7/site-packages/unidecode/x001.py | 247 | 3891 | data = (
'A', # 0x00
'a', # 0x01
'A', # 0x02
'a', # 0x03
'A', # 0x04
'a', # 0x05
'C', # 0x06
'c', # 0x07
'C', # 0x08
'c', # 0x09
'C', # 0x0a
'c', # 0x0b
'C', # 0x0c
'c', # 0x0d
'D', # 0x0e
'd', # 0x0f
'D', # 0x10
'd', # 0x11
'E', # 0x12
'e', # 0x13
'E', # 0... | gpl-2.0 |
azureplus/swftools-1 | rendertest/testpdfs.py | 11 | 10664 | import Image
import ImageChops
import ImageFilter
import sys
import os
import traceback
from athana import getTALstr
import random
import md5
filenames = []
directories = ["pdfs"]
SWFRENDER="swfrender"
PDFTOPPM="./pdftoppm"
CONVERT="convert"
PDF2SWF="pdf2swf"
COMPARE=["xpdf", "xpdf -C"]
OUTPUTDIR = "results.clip/"
... | gpl-2.0 |
PythonCharmers/orange3 | Orange/canvas/gui/toolbar.py | 10 | 3417 | """
A custom toolbar with linear uniform size layout.
"""
import logging
from PyQt4.QtGui import QToolBar
from PyQt4.QtCore import Qt, QSize, QEvent
log = logging.getLogger(__name__)
class DynamicResizeToolBar(QToolBar):
"""
A :class:`QToolBar` subclass that dynamically resizes its tool buttons
to f... | gpl-3.0 |
peterayeni/libforensics | unittests/tests/win/shell/link/objects.py | 13 | 47648 | # Copyright 2010 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics 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, either version 3 of the License, or
# (at your option) any later ver... | lgpl-3.0 |
audreyr/cookiecutter | cookiecutter/prompt.py | 1 | 7891 | """Functions for prompting the user for project info."""
import json
from collections import OrderedDict
import click
from jinja2.exceptions import UndefinedError
from cookiecutter.environment import StrictEnvironment
from cookiecutter.exceptions import UndefinedVariableInTemplate
def read_user_variable(var_name, d... | bsd-3-clause |
mantidproject/mantid | Framework/PythonInterface/test/python/plugins/algorithms/CylinderPaalmanPingsCorrection2Test.py | 3 | 13268 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... | gpl-3.0 |
peregrinius/web2py-liscio | languages/zh-tw.py | 149 | 10618 | # coding: utf8
{
'!langcode!': 'zh-cn',
'!langname!': '中文',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"更新" 是選擇性的條件式, 格式就像 "欄位1=\'值\'". 但是 JOIN 的資料不可以使用 update 或是 delete"',
'%s %%{row} deleted': '已刪除 %s 筆',
'%s %%{row} updated': '已更新 %s 筆',
'%s s... | mit |
SHornung1/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/write/DataWriter.py | 41 | 8289 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | bsd-3-clause |
seawaywen/vim-config | bundle/python-mode/pymode/libs/pylama/lint/pylama_pylint/pylint/checkers/classes.py | 17 | 34392 | # Copyright (c) 2003-2014 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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, o... | apache-2.0 |
ar7z1/ansible | lib/ansible/modules/cloud/azure/azure_rm_cdnprofile.py | 8 | 9902 | #!/usr/bin/python
#
# Copyright (c) 2018 Hai Cao, <t-haicao@microsoft.com>, 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 = {'metadat... | gpl-3.0 |
txomon/pytest | testing/test_skipping.py | 2 | 33249 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import pytest
from _pytest.runner import runtestprotocol
from _pytest.skipping import folded_skips
from _pytest.skipping import MarkEvaluator
from _pytest.skipping import pytest_runtest_setup
clas... | mit |
kalahbrown/HueBigSQL | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/meta.py | 98 | 2136 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# 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; either
# version 2.1 of the License, or (at you... | apache-2.0 |
tigwyk/eve-wspace | evewspace/SiteTracker/tests.py | 138 | 1244 | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# 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 ... | gpl-3.0 |
noba3/KoTos | addons/script.module.oauth2client/lib/oauth2client/gce.py | 57 | 3532 | # Copyright 2014 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 ... | gpl-2.0 |
calvinsettachatgul/athena | athena_env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py | 156 | 2945 | from __future__ import absolute_import, division, unicode_literals
from . import base
class Filter(base.Filter):
"""Injects ``<meta charset=ENCODING>`` tag into head of document"""
def __init__(self, source, encoding):
"""Creates a Filter
:arg source: the source token stream
:arg en... | mit |
allthroughthenight/aces | web2py/gluon/contrib/pyrtf/Renderer.py | 44 | 26038 | from types import StringType, ListType, TupleType
from copy import deepcopy
from Elements import *
DEFAULT_TAB_WIDTH = 720
ParagraphAlignmentMap = { ParagraphPropertySet.LEFT : 'ql',
ParagraphPropertySet.RIGHT : 'qr',
ParagraphPropertySet.CENTER : 'qc... | gpl-3.0 |
idncom/odoo | addons/hr_expense/report/__init__.py | 380 | 1071 | # -*- 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 |
Taketrung/betfair.py | tests/test_utils.py | 3 | 1270 | # -*- coding: utf-8 -*-
import pytest
import json
import datetime
from schematics.exceptions import ValidationError
from betfair import models
from betfair import constants
from betfair.utils import BetfairEncoder
from betfair.utils import make_payload
def test_encode_enum():
raw = {'enum': constants.MarketPr... | mit |
h3biomed/ansible | lib/ansible/plugins/strategy/__init__.py | 1 | 55217 | # (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 |
Endika/edx-platform | openedx/core/djangoapps/bookmarks/tests/test_models.py | 11 | 20826 | """
Tests for Bookmarks models.
"""
from contextlib import contextmanager
import datetime
import ddt
from freezegun import freeze_time
import mock
import pytz
from unittest import skipUnless
from django.conf import settings
from opaque_keys.edx.keys import UsageKey
from opaque_keys.edx.locator import CourseLocator, B... | agpl-3.0 |
bzero/networkx | examples/graph/napoleon_russian_campaign.py | 44 | 3216 | #!/usr/bin/env python
"""
Minard's data from Napoleon's 1812-1813 Russian Campaign.
http://www.math.yorku.ca/SCS/Gallery/minard/minard.txt
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
# Copyright (C) 2006 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <sw... | bsd-3-clause |
dietrichc/streamline-ppc-reports | examples/dfp/v201411/workflow_request_service/get_workflow_external_condition_requests_by_statement.py | 4 | 2277 | #!/usr/bin/python
#
# Copyright 2014 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 b... | apache-2.0 |
rahushen/ansible | lib/ansible/modules/network/cnos/cnos_backup.py | 35 | 11398 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
#
# Copyright (C) 2017 Lenovo, Inc.
#
# 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 Licens... | gpl-3.0 |
sjjhsjjh/blender-driver | path_store/test/restinterface.py | 1 | 3684 | #!/usr/bin/python
# (c) 2018 Jim Hawkins. MIT licensed, see https://opensource.org/licenses/MIT
# Part of Blender Driver, see https://github.com/sjjhsjjh/blender-driver
"""Path Store unit test module. Tests in this module can be run like:
python3 path_store/test.py TestRestInterface
"""
# Exit if run other than as... | mit |
cfairbanks/calibre-comicvine | utils.py | 1 | 1469 | """
calibre_plugins.comicvine - A calibre metadata source for comicvine
"""
from calibre.ebooks.metadata.book.base import Metadata
from client import PyComicvineWrapper
def build_meta(log, issue_id):
"""Build metadata record based on comicvine issue_id."""
issue = PyComicvineWrapper(log).lookup_issue(issue_... | mit |
kalahbrown/HueBigSQL | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/tests/test_clean_pyc.py | 38 | 2430 | import os
import six
import shutil
import fnmatch
from django.test import TestCase
from django.core.management import call_command
from django_extensions.management.utils import get_project_root
class CleanPycTests(TestCase):
def setUp(self):
self._settings = os.environ.get('DJANGO_SETTINGS_MODULE')
... | apache-2.0 |
alejo8591/maker | sales/migrations/0002_auto__del_updaterecord__add_field_orderedproduct_tax__add_field_ordere.py | 1 | 37552 | # encoding: utf-8
# Copyright 2013 maker
# License
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from decimal import Decimal
from maker.sales.models import OrderedProduct, Product
class Migration(SchemaMigration):
def forwards(self, orm):
if not db.dry... | mit |
zarafagroupware/zarafa-zsm | webservice/libzsm/crawler.py | 3 | 3385 | # Copyright 2012 - 2013 Zarafa B.V.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3,
# as published by the Free Software Foundation with the following additional
# term according to sec. 7:
#
# According to sec. 7 of the ... | agpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.2/Lib/plat-aix4/IN.py | 108 | 3622 | # Generated by h2py from /usr/include/netinet/in.h
# Included from net/nh.h
# Included from sys/machine.h
LITTLE_ENDIAN = 1234
BIG_ENDIAN = 4321
PDP_ENDIAN = 3412
BYTE_ORDER = BIG_ENDIAN
DEFAULT_GPR = 0xDEADBEEF
MSR_EE = 0x8000
MSR_PR = 0x4000
MSR_FP = 0x2000
MSR_ME = 0x1000
MSR_FE = 0x0800
MSR_FE0 = 0x0800
MSR_SE = ... | mit |
johannesrohrer/lilypond | python/book_texinfo.py | 8 | 11113 | # -*- coding: utf-8 -*-
import re
import tempfile
import subprocess
import sys
import book_base as BookBase
from book_snippets import *
import lilylib as ly
global _;_=ly._
# Recognize special sequences in the input.
#
# (?P<name>regex) -- Assign result of REGEX to NAME.
# *? -- Match non-greedily.
# (?!...) -... | gpl-3.0 |
snapcore/snapcraft | tests/unit/project_loader/extensions/test_gnome_3_28.py | 1 | 4748 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2019 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
cervoise/Hardware-Bruteforce-Framework-2 | Raspberry/Classes/Keyboard.py | 1 | 4499 | import os
import sys
import time
import re
#For test and debug
class KeyboardTest:
def __init__(self):
self.delta = 0
return None
def setDelta(self, value):
self.delta = value
def press(self, string, delay):
for letter in string:
print letter
time.sleep(delay/1000.)
def pressSpecial(self, speci... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.