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
Juniper/nova
nova/tests/unit/virt/libvirt/volume/test_vrtshyperscale.py
2
3191
# Copyright (c) 2017 Veritas Technologies 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 # # Unl...
apache-2.0
smasala/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/test_expectations.py
126
4421
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
maxplanck-ie/HiCExplorer
hicexplorer/test/long_run/test_hicAggregateContacts_trivial_runs_two.py
1
3482
import warnings warnings.simplefilter(action="ignore", category=RuntimeWarning) warnings.simplefilter(action="ignore", category=PendingDeprecationWarning) import pytest from tempfile import NamedTemporaryFile import os from psutil import virtual_memory import hicexplorer.hicAggregateContacts mem = virtual_memory() me...
gpl-2.0
sivaprakashniet/push_pull
p2p/lib/python2.7/site-packages/nose/commands.py
68
6310
""" nosetests setuptools command ---------------------------- The easiest way to run tests with nose is to use the `nosetests` setuptools command:: python setup.py nosetests This command has one *major* benefit over the standard `test` command: *all nose plugins are supported*. To configure the `nosetests` comman...
bsd-3-clause
skozilla/betfair.py
betfair/models.py
2
14047
# -*- coding: utf-8 -*- from __future__ import absolute_import from schematics.types import IntType from schematics.types import LongType from schematics.types import FloatType from schematics.types import StringType from schematics.types import BooleanType from schematics.types.compound import DictType from schemati...
mit
jeffery9/mixprint_addons
account_payment/wizard/account_payment_pay.py
54
2479
# -*- 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
nicolargo/intellij-community
python/lib/Lib/site-packages/django/contrib/admin/media/js/compress.py
784
1896
#!/usr/bin/env python import os import optparse import subprocess import sys here = os.path.dirname(__file__) def main(): usage = "usage: %prog [file1..fileN]" description = """With no file paths given this script will automatically compress all jQuery-based files of the admin app. Requires the Google Closure...
apache-2.0
Qihoo360/luajit-jsonnet
libjsonnet/setup.py
6
1969
# 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 ag...
apache-2.0
grimreaper/parallel-ssh
psshlib/cli.py
58
4364
# Copyright (c) 2009-2012, Andrew McNabb # Copyright (c) 2003-2008, Brent N. Chun import optparse import os import shlex import sys import textwrap from psshlib import version _DEFAULT_PARALLELISM = 32 _DEFAULT_TIMEOUT = 0 # "infinity" by default def common_parser(): """ Create a basic OptionParser wit...
bsd-3-clause
mohierf/bottle-webui
alignak_webui/objects/element_state.py
1
13027
#!/usr/bin/env python # -*- coding: utf-8 -*- # Many functions need to use protected members of a base class # pylint: disable=protected-access # Attributes need to be defined in constructor before initialization # pylint: disable=attribute-defined-outside-init # Copyright (c) 2015-2017: # Frederic Mohier, frederic....
agpl-3.0
spacy-io/thinc
thinc/neural/_classes/rnn.py
1
8999
# coding: utf8 from __future__ import unicode_literals from .model import Model from ... import describe from ...describe import Dimension, Synapses, Biases, Gradient from ...api import wrap, layerize from .._lsuv import svd_orthonormal from ..util import copy_array def BiLSTM(nO, nI): """Create a bidirectional ...
mit
elgambitero/FreeCAD_sf_master
src/Mod/Plot/plotSeries/__init__.py
280
1806
#*************************************************************************** #* * #* Copyright (c) 2011, 2012 * #* Jose Luis Cercos Pita <jlcercos@gmail.com> * #* ...
lgpl-2.1
berquist/PyQuante
PyQuante/IO/FormatHandlers/XYZ.py
2
1987
from PyQuante.IO.Data import Data class Handler(object): key = "xyz" description = "XYZ File Format" ext = ".xyz" def read(self,string): """ Arguments: - string: String to parse Return: - data: Data object, with a molecule and a molecul...
bsd-3-clause
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/boto-2.38.0/boto/cognito/sync/exceptions.py
135
1648
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
mit
krafczyk/spack
var/spack/repos/builtin/packages/dyninst/package.py
2
4619
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
eugeniashurko/ReGraph
docs/source/conf.py
1
5928
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # ReGraph documentation build configuration file, created by # sphinx-quickstart on Mon Dec 4 16:51:07 2017. # # 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 # au...
mit
saeki-masaki/glance
glance/async/flows/convert.py
5
3953
# Copyright 2015 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 requ...
apache-2.0
roisagiv/webrtc-ios
third_party/jsoncpp/scons-tools/targz.py
264
3055
"""tarball Tool-specific initialization for tarball. """ ## Commands to tackle a command based implementation: ##to unpack on the fly... ##gunzip < FILE.tar.gz | tar xvf - ##to pack on the fly... ##tar cvf - FILE-LIST | gzip -c > FILE.tar.gz import os.path import SCons.Builder import SCons.Node.FS import SCons.Ut...
bsd-3-clause
glatard/nipype
nipype/interfaces/camino/tests/test_auto_DT2NIfTI.py
9
1184
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.camino.convert import DT2NIfTI def test_DT2NIfTI_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), header_file=dict(argstr='-head...
bsd-3-clause
llasram/zmforth
zmerge.py
2
2162
#! /usr/bin/python # Copyright (c) 2009 Marshall Vandegrift # # 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. # # Thi...
gpl-3.0
jbaginski/androguard
elsim/elsim/similarity/simhash.py
44
2143
""" Implementation of Charikar similarity hashes in Python. Most useful for creating 'fingerprints' of documents or metadata so you can quickly find duplicates or cluster items. Part of python-hashes by sangelone. See README and LICENSE. """ from hashtype import hashtype class simhash(hashtype): def create_hash...
apache-2.0
CuonDeveloper/cuon
cuon_client/cuon/bin/Adressenconv.py
5
2725
# -*- coding: utf-8 -*- import sys,os notconvert=['Autoelektrik','Brauereibedarf', 'Bildhauer', 'Bauelemente', 'Feuerwehren'] format = sys.argv[1] CalcFiles = os.listdir('./') print CalcFiles for onefile in CalcFiles: if onefile[len(onefile)-4:] == '.xls': os.system('unoconvCSV.py ' + one...
gpl-3.0
DarrenRainey/gpicsync
gpicsync-GUI.py
19
71580
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################### # # Developer: francois.schnell francois.schnell@gmail.com # http://francois.schnell.free.fr # # Contributors, see: http://code.google.com/p/gpicsync/wiki/Contributi...
gpl-2.0
jay-lau/magnum
magnum/tests/functional/api/v1/test_baymodel.py
1
7160
# 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
abhishek-ch/hue
desktop/core/ext-py/Django-1.6.10/tests/admin_util/tests.py
51
11281
from __future__ import absolute_import, unicode_literals from datetime import datetime from django.conf import settings from django.contrib import admin from django.contrib.admin import helpers from django.contrib.admin.util import (display_for_field, flatten_fieldsets, label_for_field, lookup_field, NestedObject...
apache-2.0
jilljenn/django-planet
planet/views.py
1
9854
# -*- coding: utf-8 -*- from django.core.urlresolvers import reverse, reverse_lazy from django.forms import ValidationError from django.http import HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404, redirect from django.template import RequestContext from django.utils.translation i...
bsd-3-clause
cvegaj/ElectriCERT
venv3/lib/python3.6/site-packages/pkg_resources/extern/__init__.py
245
2487
import sys class VendorImporter: """ A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. """ def __init__(self, root_name, vendored_names=(), vendor_pkg=None): self.root_name = root_name self.vendored_names = set(v...
gpl-3.0
OmgOhnoes/Flexget
flexget/plugins/list/pending_list.py
3
8325
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin import logging from collections import MutableSet from datetime import datetime from sqlalchemy import Column, Unicode, Integer, DateTime, or_, func, Boolean from sqlalchemy.or...
mit
bartoldeman/easybuild-framework
easybuild/toolchains/compiler/gcc.py
1
8302
## # Copyright 2012-2018 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
jf-parent/webbase
{{cookiecutter.project_name}}/admin/app.py
1
11726
import os import importlib import base64 import logging from logging.handlers import TimedRotatingFileHandler import sys import asyncio from cryptography import fernet from pymongo import MongoClient from bson.objectid import ObjectId from wtforms import form, fields, validators from flask import Flask, url_for, redir...
mit
JetBrains/intellij-community
plugins/hg4idea/testData/bin/mercurial/merge.py
90
28398
# merge.py - directory-level update/merge handling for Mercurial # # Copyright 2006, 2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from node import nullid, nullrev, hex, bin from i18n import _...
apache-2.0
amisrs/one-eighty
venv2/lib/python2.7/site-packages/sqlalchemy/orm/strategy_options.py
19
35455
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ """ from .interfaces import MapperOption, PropComparator from .. import util from ..sql.base imp...
mit
CitrineInformatics/python-citrination-client
citrination_client/models/columns/alloy_composition.py
1
2265
from citrination_client.models.columns.base import BaseColumn class AlloyCompositionColumn(BaseColumn): """ An alloy composition column configuration for a data view. Parameterized with the basic column options, plus the balance element for the column and the basis value for the composition. """ ...
apache-2.0
wanghaven/nupic
src/nupic/database/Connection.py
49
22041
# ---------------------------------------------------------------------- # 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 apply: # # This progra...
agpl-3.0
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/pypy/lib-python/2.7/plat-freebsd6/IN.py
172
12416
# Generated by h2py from /usr/include/netinet/in.h # Included from sys/cdefs.h __GNUCLIKE_ASM = 3 __GNUCLIKE_ASM = 2 __GNUCLIKE___TYPEOF = 1 __GNUCLIKE___OFFSETOF = 1 __GNUCLIKE___SECTION = 1 __GNUCLIKE_ATTRIBUTE_MODE_DI = 1 __GNUCLIKE_CTOR_SECTION_HANDLING = 1 __GNUCLIKE_BUILTIN_CONSTANT_P = 1 __GNUCLIKE_BUILTIN_VARA...
agpl-3.0
wvengen/ndg_oauth_server
ndg/oauth/server/lib/authenticate/password_client_authenticator.py
1
2157
"""OAuth 2.0 WSGI server middleware providing MyProxy certificates as access tokens """ __author__ = "W van Engen" __date__ = "01/11/12" __copyright__ = "(C) 2011 FOM / Nikhef" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "wvengen+oauth2@nikhef.nl" __revision__ = "$Id$" from base64 impor...
bsd-3-clause
ruacon35/ns3-wireless-planning.ns-3
bindings/python/apidefs/gcc-ILP32/ns3_module_onoff.py
8
5346
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() ## onoff-application.h: ns3::OnOffApplication [class] module.add_class('OnOffApplication', parent=root_module['ns3::Application']) ## Register a nested...
gpl-2.0
apache/incubator-airflow
tests/providers/google/cloud/operators/test_dataproc_system.py
10
2378
# # 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...
apache-2.0
wkennington/rethinkdb
external/v8_3.30.33.16/build/gyp/pylib/gyp/generator/ninja_test.py
610
1611
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
agpl-3.0
ypwalter/evennia
evennia/server/session.py
4
5214
""" This module defines a generic session class. All connection instances (both on Portal and Server side) should inherit from this class. """ import time #------------------------------------------------------------ # Server Session #------------------------------------------------------------ class Session(objec...
bsd-3-clause
numenta/nupic
src/nupic/support/configuration_custom.py
10
10011
# ---------------------------------------------------------------------- # 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 apply: # # This progra...
agpl-3.0
mancoast/CPythonPyc_test
cpython/230_test_unpack.py
9
2513
from test.test_support import TestFailed, verbose t = (1, 2, 3) l = [4, 5, 6] class Seq: def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError a = -1 b = -1 c = -1 # unpack tuple if verbose: print 'unpack tuple' a, b, c = t if a != 1 or b != 2 or c != 3: raise TestFail...
gpl-3.0
huangwenjun06/libvpx_mips
third_party/googletest/src/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...
bsd-3-clause
c4fcm/MediaCloud-API-Client
mediacloud/storage.py
1
4358
import copy import logging class StoryDatabase(object): # callbacks you can register listeners against EVENT_PRE_STORY_SAVE = "preStorySave" EVENT_POST_STORY_SAVE = "postStorySave" def __init__(self): self._logger = logging.getLogger(__name__) self._db = None def storyExists(sel...
mit
JordiCarreraVentura/spellchecker
lib/WordEmbeddings.py
1
1457
import gensim from collections import ( Counter, defaultdict as deft ) from multiprocessing import cpu_count from tqdm import tqdm class WordEmbeddings: def __init__( self, dimensions=100, window=5, min_count=1, workers=1, # workers=cpu_count(), ...
gpl-3.0
adelton/django
tests/contenttypes_tests/test_models.py
249
12059
from __future__ import unicode_literals import warnings from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.views import shortcut from django.contrib.sites.shortcuts import get_current_site from django.db.utils import IntegrityError, OperationalError, ProgrammingError from djan...
bsd-3-clause
DataFighter/Lasagne-tutorial
lasagne/objectives.py
2
6976
import theano import theano.tensor as T from theano.tensor.nnet import binary_crossentropy, categorical_crossentropy def mse(x, t): """Calculates the MSE mean across all dimensions, i.e. feature dimension AND minibatch dimension. :parameters: - x : predicted values - t : target values ...
mit
WSDC-NITWarangal/django
tests/template_tests/filter_tests/test_dictsort.py
342
1477
from django.template.defaultfilters import dictsort from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_sort(self): sorted_dicts = dictsort( [{'age': 23, 'name': 'Barbara-Ann'}, {'age': 63, 'name': 'Ra Ra Rasputin'}, {'name': 'Jonny B...
bsd-3-clause
playm2mboy/edx-platform
cms/djangoapps/contentstore/features/problem-editor.py
116
12757
# disable missing docstring # pylint: disable=missing-docstring import json from lettuce import world, step from nose.tools import assert_equal, assert_true # pylint: disable=no-name-in-module from common import type_in_codemirror, open_new_course from advanced_settings import change_value, ADVANCED_MODULES_KEY from ...
agpl-3.0
kushalbhola/MyStuff
venv/Lib/site-packages/pip/_vendor/chardet/euckrprober.py
290
1748
######################## 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. # # Con...
apache-2.0
jonparrott/gcloud-python
dns/tests/unit/test_resource_record_set.py
3
3290
# Copyright 2015 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 agreed to in writing, s...
apache-2.0
mdehollander/bioconda-recipes
recipes/fgbio/fgbio.py
27
3054
#!/usr/bin/env python # # Wrapper script for invoking the jar. # # This script is written for use with the Conda package manager. import subprocess import sys import os from os import access, getenv, path, X_OK # Expected name of the VarScan JAR file. JAR_NAME = 'fgbio.jar' PKG_NAME = 'fgbio' # Default options pass...
mit
shiminsh/youtube_analytics
youtube/youtube/settings.py
1
2602
""" Django settings for youtube project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) f...
mit
svn2github/django
tests/regressiontests/comment_tests/tests/comment_view_tests.py
15
11790
from __future__ import absolute_import import re from django.conf import settings from django.contrib.auth.models import User from django.contrib.comments import signals from django.contrib.comments.models import Comment from . import CommentTestCase from ..models import Article, Book post_redirect_re = re.compile...
bsd-3-clause
goodwinnk/intellij-community
python/lib/Lib/site-packages/django/core/files/utils.py
901
1230
class FileProxyMixin(object): """ A mixin class used to forward file methods to an underlaying file object. The internal file object has to be called "file":: class FileProxy(FileProxyMixin): def __init__(self, file): self.file = file """ encoding = property(la...
apache-2.0
ZachRiegel/scriptbin
pypyjs/modules/unittest/test/test_assertions.py
52
11961
import datetime import unittest class Test_Assertions(unittest.TestCase): def test_AlmostEqual(self): self.assertAlmostEqual(1.00000001, 1.0) self.assertNotAlmostEqual(1.0000001, 1.0) self.assertRaises(self.failureException, self.assertAlmostEqual, 1.0000001, 1.0...
gpl-3.0
TeslaProject/external_chromium_org
tools/auto_bisect/math_utils.py
27
3966
# 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. """General statistical or mathematical functions.""" import math def TruncatedMean(data_set, truncate_percent): """Calculates the truncated mean of a se...
bsd-3-clause
mspark93/VTK
ThirdParty/Twisted/twisted/web/test/test_httpauth.py
41
22445
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web._auth}. """ from zope.interface import implements from zope.interface.verify import verifyObject from twisted.trial import unittest from twisted.python.failure import Failure from twisted.internet.error import Conne...
bsd-3-clause
TwilioDevEd/api-snippets
quickstart/python/autopilot/create-joke-samples/create_joke_samples.6.x.py
1
1102
# Download the helper library from https://www.twilio.com/docs/python/install import os from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/console # To set up environmental variables, see http://twil.io/secure account_sid = os.environ['TWILIO_ACCOUNT_SID'] auth_token = os.environ['TWILIO_...
mit
sdoran35/hate-to-hugs
venv/lib/python3.6/site-packages/pip/utils/glibc.py
350
2939
from __future__ import absolute_import import re import ctypes import platform import warnings def glibc_version_string(): "Returns glibc version string, or None if not using glibc." # ctypes.CDLL(None) internally calls dlopen(NULL), and as the dlopen # manpage says, "If filename is NULL, then the retur...
mit
felixma/nova
nova/virt/xenapi/fake.py
47
38557
# Copyright (c) 2010 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 applicab...
apache-2.0
jorge2703/scikit-learn
sklearn/utils/tests/test_random.py
230
7344
from __future__ import division import numpy as np import scipy.sparse as sp from scipy.misc import comb as combinations from numpy.testing import assert_array_almost_equal from sklearn.utils.random import sample_without_replacement from sklearn.utils.random import random_choice_csc from sklearn.utils.testing import ...
bsd-3-clause
sadad111/leetcodebox
Add Two Numbers II.py
1
1969
# /** # * Definition for singly-linked list. # * public class ListNode { # * int val; # * ListNode next; # * ListNode(int x) { val = x; } # * } # */ # public class Solution { # public ListNode addTwoNumbers(ListNode l1, ListNode l2) { # Stack<Integer> s1 = new Stack<Integer>(); # ...
gpl-3.0
117111302/iris-panel
iris/packagedb/tests/test_apiviews.py
7
12682
# -*- coding: utf-8 -*- #This file is part of IRIS: Infrastructure and Release Information System # # Copyright (C) 2013 Intel Corporation # # IRIS is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # version 2.0 as published by the Free Software Foundation. "...
gpl-2.0
ryancoleman/autodock-vina
boost_1_54_0/tools/build/v2/test/build_file.py
44
5117
#!/usr/bin/python # Copyright (C) 2006. Vladimir Prus # Copyright (C) 2008. Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Tests that we explicitly request a file (not target) to be built by #...
apache-2.0
calico/basenji
bin/sonnet_sat_bed.py
1
9499
#!/usr/bin/env python # Copyright 2017 Calico LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
strahlc/exaile
plugins/somafm/__init__.py
3
6699
# Copyright (C) 2012 Rocco Aliberti # 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, or (at your option) # any later version. # # This program is distributed in the hope that it...
gpl-2.0
chirilo/airmozilla
airmozilla/manage/views/approvals.py
9
3643
from django import http from django.contrib import messages from django.shortcuts import render, redirect, get_object_or_404 from django.views.decorators.http import require_POST from django.db import transaction from airmozilla.main.models import ( Approval, Event, SuggestedEvent ) from airmozilla.manage ...
bsd-3-clause
mhvk/astropy
astropy/tests/command.py
8
13858
"""Implements the wrapper for the Astropy test runner. This is for backward-compatibility for other downstream packages and can be removed once astropy-helpers has reached end-of-life. """ import os import stat import shutil import subprocess import sys import tempfile from contextlib import contextmanager from setu...
bsd-3-clause
ryfeus/lambda-packs
H2O/ArchiveH2O/requests/auth.py
73
10206
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import threading import warnings from base64 import b64encode from .compat import urlparse, str, basestring from .cookies import extract_cookies_...
mit
brokenjacobs/ansible
lib/ansible/constants.py
8
2934
# (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
dhimmel/networkx
networkx/convert_matrix.py
13
33243
"""Functions to convert NetworkX graphs to and from numpy/scipy matrices. The preferred way of converting data to a NetworkX graph is through the graph constuctor. The constructor calls the to_networkx_graph() function which attempts to guess the input type and convert it automatically. Examples -------- Create a 10...
bsd-3-clause
sekikn/incubator-airflow
tests/providers/google/marketing_platform/operators/test_search_ads_system.py
10
1707
# # 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...
apache-2.0
telwertowski/QGIS
python/plugins/MetaSearch/dialogs/maindialog.py
3
38847
# -*- coding: utf-8 -*- ############################################################################### # # CSW Client # --------------------------------------------------------- # QGIS Catalog Service client. # # Copyright (C) 2010 NextGIS (http://nextgis.org), # Alexander Bruy (alexander.bruy@gmail...
gpl-2.0
BrandonY/python-docs-samples
appengine/flexible/sendgrid/main_test.py
8
1447
# Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
LecomteEmerick/Essentia-build
test/src/unittest/standard/test_unaryoperator.py
10
3671
#!/usr/bin/env python # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation (FSF), e...
agpl-3.0
haowu4682/gem5
src/arch/x86/isa/insts/general_purpose/rotate_and_shift/shift.py
91
6764
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
webmull/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/config/committervalidator_unittest.py
120
2649
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
octavioturra/aritial
google_appengine/google/appengine/cron/groctimespecification.py
5
10878
#!/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...
apache-2.0
tarballs-are-good/sympy
sympy/physics/units.py
2
5278
""" Physical units and dimensions. The base class is Unit, where all here defined units (~200) inherit from. """ from sympy import Rational, pi from sympy.core import AtomicExpr class Unit(AtomicExpr): """ Base class for all physical units. Create own units like: m = Unit("meter", "m") """ i...
bsd-3-clause
SRabbelier/Melange
thirdparty/google_appengine/google/appengine/api/mail_service_pb.py
1
18516
#!/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...
apache-2.0
tboyce021/home-assistant
homeassistant/util/ssl.py
9
3197
"""Helper to create SSL contexts.""" from os import environ import ssl import certifi def client_context() -> ssl.SSLContext: """Return an SSL context for making requests.""" # Reuse environment variable definition from requests, since it's already a requirement # If the environment variable has no valu...
apache-2.0
basysKom/freeopcua
python/examples/inductive_client.py
9
1516
import sys import time sys.path.append(".") from IPython import embed import opcua class SubHandler(opcua.SubscriptionHandler): def __init__(self, *args): opcua.SubscriptionHandler.__init__(self, *args) self.val = MessageSecurityMode::None def data_change(self, handle, node, val, attr): ...
lgpl-3.0
BT-ojossen/odoo
addons/auth_signup/controllers/main.py
26
6356
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
twodee/blockly
i18n/json_to_js.py
1
6581
#!/usr/bin/python # Converts .json files into .js files for use within Blockly apps. # # Copyright 2013 Google Inc. # https://developers.google.com/blockly/ # # 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 ...
apache-2.0
pchauncey/ansible
lib/ansible/modules/cloud/vmware/vmware_guest_snapshot.py
21
12709
#!/usr/bin/python # -*- coding: utf-8 -*- # # This module is also sponsored by E.T.A.I. (www.etai.fr) # 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_versio...
gpl-3.0
cafe-grader-team/cafe-grader-web
lib/assets/Lib/browser/indexed_db.py
9
3114
class EventListener: def __init__(self, events=[]): self._events=events def append(self, event): self._events.append(event) def fire(self, e): for _event in self._events: _event(e) class IndexedDB: def __init__(self): if not __BRYTHON__.has_indexedDB: ...
mit
s20121035/rk3288_android5.1_repo
external/skia/platform_tools/android/gyp_gen/vars_dict_lib.py
146
4422
#!/usr/bin/python # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import types # The goal of this class is to store a set of unique items in the order in # which they are inserted. This is important for the final ...
gpl-3.0
Pakketeretet2/lammps
tools/python/dump2pdb.py
51
1217
#!/usr/bin/env python # Script: dump2pdb.py # Purpose: convert a LAMMPS dump file to PDB format # Syntax: dump2pdb.py dumpfile Nid Ntype Nx Ny Nz pdbfile template # dumpfile = LAMMPS dump file in native LAMMPS format # Nid,Ntype,Nx,Ny,Nz = columns #s for ID,type,x,y,z # ...
gpl-2.0
defivelo/db
apps/user/migrations/0064_merge_WS_in_VS.py
1
4091
from django.db import migrations, models import multiselectfield.db.fields from memoize import delete_memoized from defivelo.roles import user_cantons def ws_to_vs(apps, schema_editor): UserManagedState = apps.get_model("user", "UserManagedState") for ums in UserManagedState.objects.filter(canton="WS"): ...
agpl-3.0
pigate/mongo-python-driver
pymongo/auth.py
23
15619
# Copyright 2013-2015 MongoDB, 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 or agreed to in writin...
apache-2.0
jbeee/jquery-pjaxr
test_app/tests/test_ignored_metatag.py
2
1373
from __future__ import unicode_literals from selenium.common.exceptions import NoSuchElementException from .helpers import SeleniumTestCase class IgnoredMetatagTest(SeleniumTestCase): def test_ignored_metatag_pjaxr(self): self.browser_get_reverse('index') self.assert_title('index-title') ...
mit
ns950/calibre
src/calibre/ebooks/mobi/debug/headers.py
14
25842
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import struct...
gpl-3.0
FusionSP/android_external_chromium_org
tools/telemetry/telemetry/util/cloud_storage.py
25
7906
# 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. """Wrappers for gsutil, for basic interaction with Google Cloud Storage.""" import contextlib import cStringIO import hashlib import logging import os impor...
bsd-3-clause
eusi/MissionPlanerHM
Lib/encodings/koi8_r.py
593
14035
""" Python Character Mapping Codec koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.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
openstack/oslo.db
oslo_db/sqlalchemy/migration.py
1
7224
# coding=utf-8 # Copyright (c) 2013 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
fyfcauc/android_external_chromium-org
chrome/test/functional/media/media_stat_perf.py
56
3328
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """CPU, Memory, and FPS performance test for <video>. Calculates decoded fps, dropped fps, CPU, and memory statistics while playin...
bsd-3-clause
yqm/sl4a
python/src/Lib/encodings/palmos.py
647
2936
""" Python Character Mapping Codec for PalmOS 3.5. Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,inp...
apache-2.0
mancoast/CPythonPyc_test
cpython/252_test_pep277.py
34
4098
# Test the Unicode versions of normal file functions # open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir import sys, os, unittest from test import test_support if not os.path.supports_unicode_filenames: raise test_support.TestSkipped, "test works only on NT+" filenames = [ ...
gpl-3.0
micwypych/github-cmake-project-checker
project_checker/tests/studentprojecttest.py
1
2674
from unittest import TestCase from unittest.mock import MagicMock from project_checker.checker.project import StudentProject class ReportTest(TestCase): def test_result_ranking_of_two_labs(self): r1 = MagicMock(report={'lab1_ex1': 0, 'lab1_ex2': 2, 'lab1_ex3': 0}, __getitem__=lambd...
mit