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 |
|---|---|---|---|---|---|
Acidburn0zzz/servo | tests/wpt/web-platform-tests/webdriver/tests/execute_async_script/collections.py | 7 | 4669 | import os
from six import text_type
from tests.support.asserts import assert_same_element, assert_success
from tests.support.inline import inline
def execute_async_script(session, script, args=None):
if args is None:
args = []
body = {"script": script, "args": args}
return session.transport.sen... | mpl-2.0 |
bzhou26/Delaware-Crawler | bs4/builder/_lxml.py | 16 | 8663 | __all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
from io import BytesIO
from io import StringIO
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
ParserRejec... | mit |
TheJJ/linux | tools/perf/scripts/python/net_dropmonitor.py | 1812 | 1749 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
tudennis/LeetCode---kamyu104-11-24-2015 | Python/sentence-similarity-ii.py | 2 | 2614 | # Time: O(n + p)
# Space: O(p)
# Given two sentences words1, words2 (each represented as an array of strings),
# and a list of similar word pairs pairs, determine if two sentences are similar.
#
# For example, words1 = ["great", "acting", "skills"] and
# words2 = ["fine", "drama", "talent"] are similar,
# if the simi... | mit |
ifcodingmaastricht/blockchainbot | simulator_offline_team2.py | 1 | 2868 | import yaml
import json
import urllib.request
import time
from wallet import Wallet
from database.database import Database
config = yaml.safe_load(open("config.yml"))
f = open('dataset.txt', 'r')
dataset = f.readlines()
dataset = [float(i) for i in dataset]
walletBitcoin = 0.0
cash_wallet = Wallet()
firstrun = True
... | mit |
bsmr-ansible/ansible-modules-extras | monitoring/airbrake_deployment.py | 57 | 3911 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Bruce Pennypacker <bruce@pennypacker.org>
#
# 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... | gpl-3.0 |
iqas/e2gui | lib/python/Screens/AutoDiseqc.py | 14 | 9199 | from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.ActionMap import ActionMap
from Components.Sources.FrontendStatus import FrontendStatus
from Components.Sources.StaticText import StaticText
from Components.config import config, configfile, getConfigListEntry
from Comp... | gpl-2.0 |
liamgh/liamgreenhughes-sl4a-tf101 | python-modules/pybluez/python/bluetooth/msbt.py | 68 | 8490 | from btcommon import *
import _msbt as bt
bt.initwinsock ()
# ============== SDP service registration and unregistration ============
def discover_devices (duration=8, flush_cache=True, lookup_names=False):
return bt.discover_devices (flush_cache, lookup_names)
def lookup_name (address, timeout=10):
if not ... | apache-2.0 |
mitsei/dlkit | dlkit/services/authentication.py | 1 | 13950 | """DLKit Services implementations of authentication service."""
# pylint: disable=no-init
# osid specification includes some 'marker' interfaces.
# pylint: disable=too-many-ancestors
# number of ancestors defined in spec.
# pylint: disable=too-few-public-methods,too-many-public-methods
# number of methods d... | mit |
biolink/ontobio | ontobio/sparql/wikidata_ontology.py | 1 | 5814 | """
An ontology backed by a remote Wikidata SPARQL service.
"""
import networkx as nx
import logging
import ontobio.ontol
from ontobio.ontol import Ontology, Synonym
from prefixcommons.curie_util import contract_uri, expand_uri, get_prefixes
from SPARQLWrapper import SPARQLWrapper, JSON, RDF
from ontobio.sparql.rdflib... | bsd-3-clause |
JazzeYoung/VeryDeepAutoEncoder | theano/misc/tests/test_cudamat_utils.py | 1 | 1195 | from __future__ import absolute_import, print_function, division
import numpy
import theano
from theano.misc.cudamat_utils import cudamat_available
if not cudamat_available: # noqa
from nose.plugins.skip import SkipTest
raise SkipTest("gnumpy not installed. Skip test of theano op with pycuda "
... | bsd-3-clause |
mfisher31/libjuce | waflib/extras/clangxx_cross.py | 37 | 3018 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy 2009-2018 (ita)
# DragoonX6 2018
"""
Detect the Clang++ C++ compiler
This version is an attempt at supporting the -target and -sysroot flag of Clang++.
"""
from waflib.Tools import ccroot, ar, gxx
from waflib.Configure import conf
import waflib.extras.clang_cross_... | gpl-2.0 |
amrdraz/kodr | app/brython/www/src/Lib/test/test_typechecks.py | 184 | 2700 | """Unit tests for __instancecheck__ and __subclasscheck__."""
import unittest
from test import support
class ABC(type):
def __instancecheck__(cls, inst):
"""Implement isinstance(inst, cls)."""
return any(cls.__subclasscheck__(c)
for c in {type(inst), inst.__class__})
def ... | mit |
bmi-forum/bmi-pyre | pythia-0.8/packages/pyre/tests/geometry/pickle.py | 2 | 1303 | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~~~~~~~... | gpl-2.0 |
guorendong/iridium-browser-ubuntu | third_party/chromite/lib/stats_unittest.py | 2 | 8677 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for stats."""
from __future__ import print_function
import time
import urllib2
from chromite.lib import cros_test_lib
from chromite.li... | bsd-3-clause |
Smerity/keras | tests/auto/keras/layers/test_convolutional.py | 7 | 6580 | import unittest
import numpy as np
from numpy.testing import assert_allclose
import theano
from keras.layers import convolutional
class TestConvolutions(unittest.TestCase):
def test_convolution_1d(self):
nb_samples = 9
nb_steps = 7
input_dim = 10
filter_length = 6
nb_filte... | mit |
andante20/volatility | volatility/plugins/malware/apihooks.py | 44 | 42960 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# Authors:
# Michael Hale Ligh <michael.ligh@mnin.org>
#
# This file is part of Volatility.
#
# Volatility 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 Fou... | gpl-2.0 |
pyzaba/pyzaba | lib/requests/packages/charade/utf8prober.py | 205 | 2728 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
... | bsd-3-clause |
jdoherty7/Adaptive_Interpolation | tests/generate_tests.py | 1 | 1522 | from nose.tools import *
import adaptive_interpolation.generate as generate
def test_generation():
pass
def test_code_execution():
func1 = lambda x: np.sin(x**1.1)
a, b = -10, 10
domain_size = 500
x = np.linspace(a, b, domain_size, dtype=np.float64)
max_val = la.norm(func1(x), n... | mit |
jlegendary/nupic | tests/unit/nupic/algorithms/tp10x2_test.py | 12 | 13288 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 |
developerworks/scrapy | scrapy/http/request/rpc.py | 40 | 1077 | """
This module implements the XmlRpcRequest class which is a more convenient class
(that Request) to generate xml-rpc requests.
See documentation in docs/topics/request-response.rst
"""
import xmlrpclib
from scrapy.http.request import Request
from scrapy.utils.python import get_func_args
DUMPS_ARGS = get_func_args... | bsd-3-clause |
hkawasaki/kawasaki-aio8-0 | lms/djangoapps/instructor_task/tasks_helper.py | 8 | 26536 | """
This file contains tasks that are designed to perform background operations on the
running state of a course.
"""
import json
import urllib
from datetime import datetime
from time import time
from celery import Task, current_task
from celery.utils.log import get_task_logger
from celery.states import SUCCESS, FAIL... | agpl-3.0 |
oscarolar/odoo | addons/edi/models/res_currency.py | 437 | 2892 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
AzePUG/Data_Structures_Algo_Python | Source_Code/python_kodlar/fesil6/fesil6_list_stack.py | 2 | 1936 | # Öz məxsusi exception-larımızı hazırlayırıq
class Error(Exception):
pass
class StackOverFlow(Error):
def __init__(self, message):
self.message = message
class StackUnderFlow(Error):
def __init__(self, message):
self.message = message
class ArrayStack:
def __init__(self, limit=10)... | mit |
BabeNovelty/numpy | numpy/distutils/exec_command.py | 26 | 20412 | #!/usr/bin/env python
"""
exec_command
Implements exec_command function that is (almost) equivalent to
commands.getstatusoutput function but on NT, DOS systems the
returned status is actually correct (though, the returned status
values may be different by a factor). In addition, exec_command
takes keyword arguments fo... | bsd-3-clause |
acsone/hr | hr_family/models/res_partner.py | 1 | 2586 | # -*- coding: utf-8 -*-
# © 2017 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import _, api, models, fields
from openerp.exceptions import Warning as UserError
class ResPartner(models.Model):
_inherit = 'res.partner'
# added to port old field fa... | agpl-3.0 |
macruz21/trading-with-python | lib/eventSystem.py | 79 | 2514 | '''
Created on 26 dec. 2011
Copyright: Jev Kuznetsov
License: BSD
sender-reciever pattern.
'''
import logger as logger
import types
class Sender(object):
"""
Sender -> dispatches messages to interested callables
"""
def __init__(self):
self.listeners = {}
self.logg... | bsd-3-clause |
CapOM/ChromiumGStreamerBackend | tools/telemetry/telemetry/testing/gtest_progress_reporter_unittest.py | 23 | 3562 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import unittest
from telemetry.core import exceptions
from telemetry.testing import gtest_progress_reporter
from telemetry.testing import simple_... | bsd-3-clause |
dannyperry571/theapprentice | script.module.urlresolver-master/lib/urlresolver/plugins/streamcloud.py | 2 | 1824 | """
streamcloud urlresolver plugin
Copyright (C) 2012 Lynx187
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.
This program is ... | gpl-2.0 |
open-forcefield-group/openforcefield | examples/deprecated/SMIRNOFF_comparison/compare_molecule_energies.py | 1 | 1818 | #!/usr/bin/env python
"""
Cross-check energies of molecules from AlkEthOH set using SMIRNOFF xml file
versus energies from AMBER .prmtop and .crd files (parm@frosst params).
"""
import os
# datapath = './AlkEthOH_tripos/AlkEthOH_chain_filt1'
# datapath = './AlkEthOH_tripos/AlkEthOH_rings_filt1'
datapath = './AlkEthO... | mit |
rebstar6/servo | components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py | 241 | 6622 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface SpecialMethodSignatureMismatch1 {
getter long long foo(long index);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have... | mpl-2.0 |
2013Commons/HUE-SHARK | desktop/core/ext-py/south/build/lib.linux-i686-2.7/south/management/commands/syncdb.py | 4 | 4491 | """
Overridden syncdb command
"""
import sys
from optparse import make_option
from django.core.management.base import NoArgsCommand, BaseCommand
from django.core.management.color import no_style
from django.utils.datastructures import SortedDict
from django.core.management.commands import syncdb
from django.conf imp... | apache-2.0 |
noskill/virt-manager | virtinst/idmap.py | 5 | 1427 | #
# Copyright 2014 Fujitsu Limited.
# Chen Hanxiao <chenhanxiao at cn.fujitsu.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 2 of the License, or
# (at your option) any la... | gpl-2.0 |
bancek/egradebook | src/lib/docutils/languages/fr.py | 148 | 1893 | # $Id: fr.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Stefane Fermigier <sf@fermigier.com>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translat... | gpl-3.0 |
moijes12/oh-mainline | vendor/packages/sphinx/sphinx/websupport/storage/sqlalchemy_db.py | 16 | 7477 | # -*- coding: utf-8 -*-
"""
sphinx.websupport.storage.sqlalchemy_db
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SQLAlchemy table and mapper definitions used by the
:class:`sphinx.websupport.storage.sqlalchemystorage.SQLAlchemyStorage`.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
... | agpl-3.0 |
akiss77/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/tokenizertotree.py | 483 | 1965 | from __future__ import absolute_import, division, unicode_literals
import sys
import os
import json
import re
import html5lib
from . import support
from . import test_tokenizer
p = html5lib.HTMLParser()
unnamespaceExpected = re.compile(r"^(\|\s*)<html ([^>]+)>", re.M).sub
def main(out_path):
if not os.path.ex... | mpl-2.0 |
Aniq55/UIP | uiplib/gui/mainGui.py | 1 | 5199 | """Module that builds the Graphical User Interface."""
import os
from shutil import copy
from tkinter import *
from tkinter.ttk import *
from tkinter import messagebox
from threading import Thread, active_count
from uiplib.gui import generalTab, settingsTab
from uiplib.scheduler import scheduler
from uiplib.utils.uti... | agpl-3.0 |
tinkerinestudio/Tinkerine-Suite | TinkerineSuite/python/Lib/OpenGL/raw/GL/APPLE/object_purgeable.py | 3 | 2117 | '''OpenGL extension APPLE.object_purgeable
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_APPLE_object_purgeable'
_DEPRECATED = False
GL_BUFFE... | agpl-3.0 |
onceuponatimeforever/oh-mainline | vendor/packages/Django/django/utils/six.py | 84 | 24371 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2014 Benjamin Peterson
#
# 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 with... | agpl-3.0 |
lckung/spark-ec2 | launch-script/lib/boto-2.34.0/tests/unit/__init__.py | 12 | 4277 | from boto.compat import http_client
from tests.compat import mock, unittest
class AWSMockServiceTestCase(unittest.TestCase):
"""Base class for mocking aws services."""
# This param is used by the unittest module to display a full
# diff when assert*Equal methods produce an error message.
maxDiff = Non... | apache-2.0 |
dcroc16/skunk_works | google_appengine/google/appengine/tools/old_dev_appserver.py | 1 | 133800 | #!/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 |
jamiebull1/eppy | eppy/loops.py | 2 | 7122 | # Copyright (c) 2012 Santosh Philip
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# =======================================================================
"""get the lo... | mit |
eltonsantos/django | django/contrib/gis/geos/collections.py | 219 | 4667 | """
This module houses the Geometry Collection objects:
GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon
"""
from ctypes import c_int, c_uint, byref
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.libgeos i... | bsd-3-clause |
rysson/filmkodi | plugin.video.mrknow/lib/jsbeautifier/unpackers/tests/testpacker.py | 111 | 1177 | #
# written by Stefano Sanfilippo <a.little.coder@gmail.com>
#
"""Tests for P.A.C.K.E.R. unpacker."""
import unittest
from jsbeautifier.unpackers.packer import detect, unpack
# pylint: disable=R0904
class TestPacker(unittest.TestCase):
"""P.A.C.K.E.R. testcase."""
def test_detect(self):
"""Test d... | apache-2.0 |
mattuuh7/incubator-airflow | tests/www/api/experimental/test_endpoints.py | 11 | 3938 | # -*- 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, software
... | apache-2.0 |
dmitry-sobolev/ansible | lib/ansible/modules/network/f5/bigip_gtm_virtual_server.py | 78 | 8532 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Michael Perzel
#
# 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 you... | gpl-3.0 |
pavelchristof/gomoku-ai | tensorflow/python/util/tf_export_test.py | 2 | 5528 | # 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 |
carthagecollege/django-djspace | djspace/registration/models.py | 2 | 9192 | # -*- coding: utf-8 -*-
from functools import partial
from django.db import models
from djspace.core.models import FILE_VALIDATORS
from djspace.core.models import Base
from djspace.core.models import GenericChoice
from djspace.core.utils import upload_to_path
from djspace.registration.choices import GRADUATE_DEGREE
f... | bsd-3-clause |
lucychambers/lucychambers.github.io | .bundle/ruby/2.0.0/gems/pygments.rb-0.6.0/vendor/pygments-main/pygments/lexers/jvm.py | 47 | 64358 | # -*- coding: utf-8 -*-
"""
pygments.lexers.jvm
~~~~~~~~~~~~~~~~~~~
Pygments lexers for JVM languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, ... | gpl-2.0 |
tal-nino/edwin | edwinServer/web/app/api.py | 2 | 5463 | # -*- coding: utf-8 -*-
'''
Created on 2014-2-10
'''
from __future__ import absolute_import
from flask import Blueprint, abort, request, flash, jsonify
from flask.globals import current_app
from ...common.job_state_updater import JobStateUpdater
from ...common.model_meta import dashboard_check_cfg
mod = Blueprint('c... | apache-2.0 |
ghandiosm/Test | openerp/sql_db.py | 17 | 22794 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""
The PostgreSQL connector is a connectivity layer between the OpenERP code and
the database, *not* a database abstraction toolkit. Database abstraction is what
the ORM does, in fact.
"""
from contextlib import conte... | gpl-3.0 |
mzetea/django-guardian | guardian/utils.py | 10 | 4610 | """
django-guardian helper functions.
Functions defined within this module should be considered as django-guardian's
internal functionality. They are **not** guaranteed to be stable - which means
they actual input parameters/output type may change in future releases.
"""
import os
import logging
from django.conf impor... | bsd-2-clause |
msarana/selenium_python | ENV/Lib/encodings/cp500.py | 593 | 13377 | """ Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.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... | apache-2.0 |
strongh/GPy | GPy/kern/_src/psi_comp/ssrbf_psi_comp.py | 4 | 19342 | # Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
"""
The package for the psi statistics computation
"""
import numpy as np
try:
from scipy import weave
def _psicomputations(variance, lengthscale, Z, variational_posterior):
"""
... | bsd-3-clause |
mezgani/gomoz | Gomoz/scan/cmd.py | 2 | 4153 | #-*- coding: utf-8 -*-
# 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 distributed in the hop... | gpl-3.0 |
baylee/django | tests/m2m_through/tests.py | 36 | 16560 | from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from django.test import TestCase, skipUnlessDBFeature
from .models import (
CustomMembership, Employee, Event, Friendship, Group, Ingredient,
Invitation, Membership, Person, PersonSelfRefM2M, Recipe, RecipeI... | bsd-3-clause |
iuliat/nova | nova/tests/functional/v3/test_evacuate.py | 30 | 4580 | # Copyright 2012 Nebula, Inc.
# 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... | apache-2.0 |
nhippenmeyer/django | django/conf/locale/fr/formats.py | 504 | 1454 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i'
DATETI... | bsd-3-clause |
yarikoptic/pystatsmodels | statsmodels/regression/tests/results/results_regression.py | 3 | 8038 | """
Hard-coded results for test_regression
"""
### REGRESSION MODEL RESULTS : OLS, GLS, WLS, AR###
import numpy as np
class Longley(object):
'''
The results for the Longley dataset were obtained from NIST
http://www.itl.nist.gov/div898/strd/general/dataarchive.html
Other results were obtained from ... | bsd-3-clause |
ivmech/iviny-scope | lib/xlsxwriter/test/worksheet/test_sparkline11.py | 1 | 9378 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
class TestAssemble... | gpl-3.0 |
starlightknight/citra | dist/scripting/citra.py | 3 | 3387 | import zmq
import struct
import random
import binascii
import enum
CURRENT_REQUEST_VERSION = 1
MAX_REQUEST_DATA_SIZE = 32
class RequestType(enum.IntEnum):
ReadMemory = 1,
WriteMemory = 2
CITRA_PORT = "45987"
class Citra:
def __init__(self, address="127.0.0.1", port=CITRA_PORT):
self.context = zm... | gpl-2.0 |
megasnort/django-utf8field | dev_example/migrations/0009_auto_20171005_1402.py | 1 | 1508 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-10-05 14:02
from __future__ import unicode_literals
from django.db import migrations, models
import utf8field.fields
class Migration(migrations.Migration):
dependencies = [
('dev_example', '0008_auto_20170912_1343'),
]
operations = [
... | apache-2.0 |
gaolichuang/py-task-framework | nova/notifications.py | 1 | 14715 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
# Copyright 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 Lice... | apache-2.0 |
devs4v/devs4v-information-retrieval15 | project/venv/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/schema.py | 608 | 4050 | from django.contrib.gis.db.models.fields import GeometryField
from django.db.backends.oracle.schema import DatabaseSchemaEditor
from django.db.backends.utils import truncate_name
class OracleGISSchemaEditor(DatabaseSchemaEditor):
sql_add_geometry_metadata = ("""
INSERT INTO USER_SDO_GEOM_METADATA
... | mit |
bocaaust/FreshLife | django_project/env/lib/python2.7/site-packages/django/contrib/comments/templatetags/comments.py | 104 | 11719 | from django import template
from django.template.loader import render_to_string
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib import comments
from django.utils.encoding import smart_text
register = template.Library()
class BaseCommentNode(template.Node... | apache-2.0 |
briennakh/BIOF509 | Wk03/lpthw_ex43.py | 1 | 2367 | # Learn Python The Hard Way
# Exercise 43: Basic Object-Oriented Analysis and Design
# http://learnpythonthehardway.org/book/ex43.html
# Aliens have invaded a space ship and our hero has to go through a maze
# of rooms defeating them so he can escape into an escape pod to the planet
# below. The game will be more li... | mit |
a-parhom/edx-platform | openedx/core/djangoapps/bookmarks/tests/test_views.py | 4 | 21024 | """
Tests for bookmark views.
"""
import json
import urllib
import ddt
from django.conf import settings
from django.urls import reverse
from mock import patch
from rest_framework.test import APIClient
from openedx.core.djangolib.testing.utils import skip_unless_lms
from xmodule.modulestore import ModuleStoreEnum
from... | agpl-3.0 |
faux123/flounder | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
ENjOyAbLE1991/scrapy | scrapy/commands/bench.py | 151 | 1640 | import sys
import time
import subprocess
from six.moves.urllib.parse import urlencode
import scrapy
from scrapy.commands import ScrapyCommand
from scrapy.linkextractors import LinkExtractor
class Command(ScrapyCommand):
default_settings = {
'LOG_LEVEL': 'INFO',
'LOGSTATS_INTERVAL': 1,
'... | bsd-3-clause |
isleei/xhtml2pdf | xhtml2pdf/pdf.py | 41 | 1949 | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 ... | apache-2.0 |
mspublic/openair4G-mirror | targets/TEST/OAI/log.py | 1 | 6608 | #******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by ... | gpl-3.0 |
michaelhkw/incubator-impala | tests/comparison/cli_options.py | 1 | 10688 | # 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 u... | apache-2.0 |
ChristianMoesl/selfie | grader/tests/utils.py | 1 | 3629 | import sys
import shlex
from io import BytesIO, TextIOWrapper
from os import WEXITSTATUS, listdir, system
from subprocess import Popen, PIPE
from os.path import isfile, join
from unittest.mock import patch
import self as grader
def list_files(path, extension=''):
return [f for f in listdir(path) if isfile(join(p... | bsd-2-clause |
tonybaloney/st2 | st2actions/tests/unit/test_execution_cancellation.py | 3 | 5724 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | apache-2.0 |
vstoykov/django-cms | cms/test_utils/project/customuserapp/models.py | 11 | 3292 | # -*- coding: utf-8 -*-
from django.core.mail import send_mail
from django.db import models
from django.utils import timezone
from django.utils.http import urlquote
try:
import re
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager
from django.core import validators
f... | bsd-3-clause |
azumimuo/Zon-Kuliah | plugin.video.youtube/resources/lib/kodion/utils/access_manager.py | 33 | 3629 | import hashlib
import time
from .. import constants
__author__ = 'bromix'
class AccessManager(object):
def __init__(self, settings):
self._settings = settings
pass
def has_login_credentials(self):
"""
Returns True if we have a username and password.
:return: True if ... | gpl-3.0 |
rzr/PyBitmessage | src/tr.py | 15 | 1424 | import shared
import os
# This is used so that the translateText function can be used when we are in daemon mode and not using any QT functions.
class translateClass:
def __init__(self, context, text):
self.context = context
self.text = text
def arg(self,argument):
if '%' in self.text:
... | mit |
MinFu/youtube-dl | youtube_dl/extractor/theonion.py | 126 | 2146 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class TheOnionIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?theonion\.com/video/[^,]+,(?P<id>[0-9]+)/?'
_TEST = {
'url': 'http://www.theonion.com/video/man-wearing-mm-jacket-gods-image,36918/',... | unlicense |
Azure/azure-linux-extensions | CustomScript/test/MockUtil.py | 8 | 1127 | #!/usr/bin/env python
#
#CustomScript extension
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | apache-2.0 |
ArteliaTelemac/PostTelemac | PostTelemac/meshlayerlibs/pyqtgraph/widgets/ComboBox.py | 12 | 8134 | import sys
from ..Qt import QtGui, QtCore
from ..SignalProxy import SignalProxy
from ..pgcollections import OrderedDict
from ..python2_3 import asUnicode, basestring
class ComboBox(QtGui.QComboBox):
"""Extends QComboBox to add extra functionality.
* Handles dict mappings -- user selects a text key, and the C... | gpl-3.0 |
Dandandan/wikiprogramming | jsrepl/extern/python/closured/lib/python2.7/distutils/command/bdist_wininst.py | 72 | 14917 | """distutils.command.bdist_wininst
Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program."""
__revision__ = "$Id$"
import sys
import os
import string
from sysconfig import get_python_version
from distutils.core import Command
from distutils.dir_util import remove_tree
from distut... | mit |
jrha/aquilon | lib/python2.6/aquilon/worker/commands/del_switch.py | 2 | 3339 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy... | apache-2.0 |
joomel1/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/config/irc.py | 122 | 1584 | # Copyright (c) 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 of conditions and the ... | bsd-3-clause |
erikedin/glowing-sceptre | googletest-release-1.8.0/googlemock/scripts/upload_gmock.py | 770 | 2833 | #!/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 |
iabdalkader/openmv | scripts/examples/10-Color-Tracking/ir_beacon_grayscale_tracking.py | 3 | 1224 | # IR Beacon Grayscale Tracking Example
#
# This example shows off IR beacon Grayscale tracking using the OpenMV Cam.
import sensor, image, time
thresholds = (255, 255) # thresholds for bright white light from IR.
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.VGA)
sensor.set_window... | mit |
stannynuytkens/youtube-dl | youtube_dl/extractor/defense.py | 90 | 1242 | from __future__ import unicode_literals
from .common import InfoExtractor
class DefenseGouvFrIE(InfoExtractor):
IE_NAME = 'defense.gouv.fr'
_VALID_URL = r'https?://.*?\.defense\.gouv\.fr/layout/set/ligthboxvideo/base-de-medias/webtv/(?P<id>[^/?#]*)'
_TEST = {
'url': 'http://www.defense.gouv.fr/l... | unlicense |
Wikitalia/edgesense | python/edgesense/twitter/extract.py | 3 | 2666 | """ Maps the tweet user into the requires data structure (the same as that used by the
network script.)
For each mentioned user the creation timestamp is the timestamp of the earliest
tweet we see that has is present.
"""
def add_user(users_map,user_id,screen_name,created_ts):
link = "https://twitter.co... | mit |
chop-dbhi/varify | varify/samples/views.py | 1 | 3935 | from guardian.shortcuts import get_objects_for_user
from django.http import Http404, HttpResponseRedirect
from django.db.models import Count
from django.core.urlresolvers import reverse
from django.shortcuts import render, get_object_or_404
from vdw.samples.models import Sample, Project, Batch, Cohort
from .forms impor... | bsd-2-clause |
xasopheno/audio_visual | audio/venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.py | 490 | 4141 | import calendar
import time
from email.utils import formatdate, parsedate, parsedate_tz
from datetime import datetime, timedelta
TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
def expire_after(delta, date=None):
date = date or datetime.now()
return date + delta
def datetime_to_header(dt):
return formatdate(c... | mit |
yamaneko1212/webpay-python | webpay/webpay.py | 1 | 2625 | from .api import Account, Charges, Customers, Events, Tokens
from . import errors
import requests
import json
class WebPay:
"""Main interface of webpay library.
See `API reference<https://webpay.jp/docs/api/python>`.
"""
_headers = {
'Content-Type': 'application/json',
'Accept': 'ap... | mit |
Tejal011089/med2-app | buying/doctype/purchase_order/purchase_order.py | 1 | 9762 | # 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
from webnotes.utils import cstr, flt
from webnotes.model.bean import getlist
from webnotes.model.code import get_obj
from webnotes i... | agpl-3.0 |
Endika/OpenUpgrade | addons/payment_paypal/models/paypal.py | 8 | 19144 | # -*- coding: utf-'8' "-*-"
import base64
try:
import simplejson as json
except ImportError:
import json
import logging
import urlparse
import werkzeug.urls
import urllib2
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment_paypal.controllers.main import Payp... | agpl-3.0 |
ludoT/PFCLS | node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py | 1569 | 23354 | #!/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 to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile generator.
""... | gpl-3.0 |
jreback/pandas | pandas/tests/indexes/period/test_period.py | 2 | 19866 | import numpy as np
import pytest
from pandas._libs.tslibs.period import IncompatibleFrequency
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
DatetimeIndex,
Index,
NaT,
Period,
PeriodIndex,
Series,
date_range,
offsets,
period_range,... | bsd-3-clause |
edmundgentle/schoolscript | SchoolScript/bin/Debug/pythonlib/Lib/xml/sax/_exceptions.py | 63 | 4916 | """Different kinds of SAX Exceptions"""
import sys
if sys.platform[:4] == "java":
from java.lang import Exception
del sys
# ===== SAXEXCEPTION =====
class SAXException(Exception):
"""Encapsulate an XML error or warning. This class can contain
basic error or warning information from either the XM... | gpl-2.0 |
jakevdp/scipy | benchmarks/benchmarks/spatial.py | 8 | 8893 | from __future__ import division, absolute_import, print_function
import numpy as np
try:
from scipy.spatial import (cKDTree, KDTree, SphericalVoronoi, distance,
ConvexHull, Voronoi)
except ImportError:
pass
from .common import Benchmark
class Build(Benchmark):
params = [
[(3,10000,1000), (8... | bsd-3-clause |
Enlik/entropy | rigo/rigo/ui/gtk3/widgets/generictreeview.py | 5 | 9057 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2009 Canonical
Copyright (C) 2012 Fabio Erculiani
Authors:
Michael Vogt
Fabio Erculiani
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 3.
This... | gpl-2.0 |
bva24/smart | cartridge/shop/migrations/0018_auto__add_field_product_in_sitemap.py | 7 | 22629 | from __future__ import unicode_literals
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Product.in_sitemap'
db.add_column('shop_product', 'i... | bsd-2-clause |
Dobatymo/livestreamer | src/livestreamer/plugins/vgtv.py | 34 | 5195 | """Plugin for VGTV, Norwegian newspaper VG Nett's streaming service."""
import re
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HDSStream, HLSStream, HTTPStream
# This will have to be set to handle "secure" HDS streams. For now we
# leave it... | bsd-2-clause |
newrocknj/horizon | openstack_dashboard/api/cinder.py | 21 | 20488 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 OpenStack Foundation
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apach... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.