repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
felixfontein/ansible
test/units/cli/galaxy/test_execute_list_collection.py
19
10617
# -*- coding: utf-8 -*- # Copyright (c) 2020 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type import pytest from ansible import context from ansible.cli.galaxy import Gala...
gpl-3.0
dementrock/nbgrader
nbgrader/tests/nbextensions/test_assignment_list.py
1
13208
import pytest import os from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException, NoSuchElementException from .. import run_python_module def _wait(brow...
bsd-3-clause
liangz0707/scikit-learn
sklearn/externals/joblib/disk.py
320
3280
""" Disk management utilities. """ # Authors: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Lars Buitinck <L.J.Buitinck@uva.nl> # Copyright (c) 2010 Gael Varoquaux # License: BSD Style, 3 clauses. import errno import os import shutil import sys import time def disk_used(path): """ Return...
bsd-3-clause
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pip-7.1.0/pip/_vendor/cachecontrol/caches/file_cache.py
762
3532
import hashlib import os from pip._vendor.lockfile import LockFile from pip._vendor.lockfile.mkdirlockfile import MkdirLockFile from ..cache import BaseCache from ..controller import CacheController def _secure_open_write(filename, fmode): # We only want to write to this file, so open it in write only mode ...
mit
zhhf/charging
charging/db/migration/alembic_migrations/versions/40dffbf4b549_nvp_dist_router.py
11
1928
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 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...
apache-2.0
souzainf3/namebench
nb_third_party/dns/tokenizer.py
246
17962
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
cycotech/WAR-app
env/lib/python3.5/site-packages/wheel/signatures/__init__.py
70
3766
""" Create and verify jws-js format Ed25519 signatures. """ import json from ..util import urlsafe_b64decode, urlsafe_b64encode, native, binary __all__ = ['sign', 'verify'] ed25519ll = None ALG = "Ed25519" def get_ed25519ll(): """Lazy import-and-test of ed25519 module""" global ed25519ll if not ed255...
mit
laosiaudi/tensorflow
tensorflow/python/kernel_tests/segment_reduction_ops_test.py
20
23513
# Copyright 2015 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
gunan/tensorflow
tensorflow/compiler/tests/slice_ops_test.py
23
9455
# 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
fgesora/odoo
addons/l10n_be/__init__.py
430
1060
# -*- 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
ogrisel/numpy
doc/numpybook/comparison/timing.py
4
1059
from __future__ import division, absolute_import, print_function import timeit pyrex_pre = """ import numpy as N a = N.random.rand(%d,%d) import filter """ pyrex_run = """ b = filter.filter(a) """ weave_pre = """ import numpy as N a = N.random.rand(%d,%d) import filter """ weave_run = """ b = filter.filter(a) """ ...
bsd-3-clause
madscatt/zazmol
src/python/calculate.py
2
15079
from __future__ import absolute_import from __future__ import division from __future__ import print_function #from __future__ import unicode_literals # # SASMOL: Copyright (C) 2011 Joseph E. Curtis, Ph.D. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
gpl-3.0
laperry1/android_external_chromium_org
chrome/test/chromedriver/server/server.py
121
2131
# Copyright 2013 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 atexit import os import socket import subprocess import time import urllib2 class Server(object): """A running ChromeDriver server.""" def __in...
bsd-3-clause
40223246/0622W17test2
static/Brython3.1.3-20150514-095342/Lib/imp.py
637
9839
"""This module provides the components needed to build your own __import__ function. Undocumented functions are obsolete. In most cases it is preferred you consider using the importlib module's functionality over this module. """ # (Probably) need to stay in _imp from _imp import (lock_held, acquire_lock, release_lo...
gpl-3.0
sarantapichos/faircoop-market
addons/stock/stock.py
15
269641
# -*- 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
white-wolf-17/hero-instantcms
templates/hero/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/ninja_syntax.py
2485
5536
# This file comes from # https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py # Do not edit! Edit the upstream one instead. """Python module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that alr...
gpl-2.0
merc-devel/merc
merc/errors.py
1
2503
from merc import message class BaseError(Exception, message.Reply): pass class Error(Exception, message.Message): NAME = "ERROR" FORCE_TRAILING = True def __init__(self, reason): self.reason = reason def as_params(self, client): return [self.reason] class LinkError(Error): NAME = "ERROR" F...
mit
fitermay/intellij-community
python/helpers/py2only/docutils/utils/math/unichar2tex.py
130
17590
# LaTeX math to Unicode symbols translation table # for use with the translate() method of unicode objects. # Generated with ``write_unichar2tex.py`` from the data in # http://milde.users.sourceforge.net/LUCR/Math/ # Includes commands from: standard LaTeX, amssymb, amsmath uni2tex_table = { 160: u'~', 163: u'\\pounds...
apache-2.0
andmos/ansible
lib/ansible/plugins/action/net_lldp.py
756
1058
# (c) 2017, Ansible 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. # # Ansible is di...
gpl-3.0
ypcs/bearded-adventure
bearded_adventure/webvm/api.py
1
1904
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS from webvm.models import Slave, Snapshot, VirtualMachine, MachineImage, HwConfiguration, JobQueueItem from bearded_adventure.common import CamelCaseJSONSerializer from tastypie import fields from tastypie.authentication import ApiKeyAuthentication c...
gpl-3.0
zenoss/ZenPacks.community.IBMSystemxIMM
ZenPacks/community/IBMSystemxIMM/modeler/plugins/community/snmp/IBMIMMMemVpdMap.py
1
3309
# ============================================================================== # IBMIMMMemVpdMap modeler plugin # # Zenoss community Zenpack for IBM SystemX Integrated Management Module # version: 0.3 # # (C) Copyright IBM Corp. 2011. All Rights Reserved. # # This program is free software; you can redistribute it an...
gpl-2.0
llvm-mirror/llvm
test/CodeGen/SystemZ/Large/branch-range-09.py
16
3627
# Test 32-bit COMPARE LOGICAL AND BRANCH in cases where the sheer number of # instructions causes some branches to be out of range. # RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s # Construct: # # before0: # conditional branch to after0 # ... # beforeN: # conditional branch to after0 # main: # 0...
apache-2.0
OpenDSA/OpenDSA-stable
SourceCode/Python/Sorting/Bubblesort.py
5
2991
def sorttime(B): A = [randrange(1,1000) for _ in range(testsize)] # To make it create a real A for copying numruns = 5 for i in range(len(B)): A[i] = B[i] time1 = datetime.now() bubblesort(A) time2 = datetime.now() checkorder(A) print "Standard Bubble Sort: Size ", testsize, ", Time: ", millis(tim...
mit
saukrIppl/seahub
tests/api/test_dir.py
1
1041
import json import os from django.core.urlresolvers import reverse from seahub.test_utils import BaseTestCase class DirTest(BaseTestCase): def setUp(self): self.login_as(self.user) self.endpoint = reverse('DirView', args=[self.repo.id]) self.folder_name = os.path.basename(self.folder) ...
apache-2.0
BoltzmannBrain/nupic.research
tests/sensorimotor/unit/one_d_universe_test.py
9
2621
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
sdague/home-assistant
tests/components/homekit_controller/test_fan.py
8
12536
"""Basic checks for HomeKit motion sensors and contact sensors.""" from aiohomekit.model.characteristics import CharacteristicsTypes from aiohomekit.model.services import ServicesTypes from tests.components.homekit_controller.common import setup_test_component V1_ON = ("fan", "on") V1_ROTATION_DIRECTION = ("fan", "ro...
apache-2.0
davidmueller13/david_kernel_aosp_flo_6.0
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
lgarren/spack
var/spack/repos/builtin/packages/r-yaml/package.py
1
1687
############################################################################## # Copyright (c) 2013-2017, 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
sujithshankar/systemd-work
tools/xml_helper.py
119
1281
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ # # This file is part of systemd. # # Copyright 2012-2013 Zbigniew Jędrzejewski-Szmek # # systemd 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 Softwar...
gpl-2.0
gpitel/pyjs
pygtkweb/demos/049-filelisting-gtm.py
6
5884
#!/usr/bin/env python import os, stat, time import pygtk pygtk.require('2.0') import gtk folderxpm = [ "17 16 7 1", " c #000000", ". c #808000", "X c yellow", "o c #808080", "O c #c0c0c0", "+ c white", "@ c None", "@@@@@@@@@@@@@@@@@", "@@@@@@@@@@@@@@@@@", "@@+XXXX.@@@@@@@@...
apache-2.0
peterfpeterson/mantid
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/USANSReduction.py
3
15000
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 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 + #pyl...
gpl-3.0
ganeshrn/ansible
lib/ansible/module_utils/facts/network/generic_bsd.py
58
12273
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
gpl-3.0
kohnle-lernmodule/exeLearningPlus1_04
twisted/cred/perspective.py
17
5793
# -*- test-case-name: twisted.test.test_cred -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ This module is for domain-specific representations of users. Stability: semi-stable Future Plans: Errors may be changed to unify reporting in twisted.cred. """ from twisted.python...
gpl-2.0
hoangt/gem5v
src/arch/x86/isa/insts/x87/stack_management/stack_control.py
91
2162
# 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
mensler/ansible
lib/ansible/modules/network/f5/bigip_virtual_server.py
66
29027
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Etienne Carriere <etienne.carriere@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 ...
gpl-3.0
orbisgis/orbiswps
tools/gettext-all.py
2
1223
from __future__ import print_function import os import shutil from subprocess import call import mmap def pom_with_gettext(filename): with open(filename) as f: s = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) return s.find('<artifactId>gettext-maven-plugin</artifactId>') > 0 def callext(tab):...
gpl-3.0
EvanzzzZ/mxnet
example/nce-loss/wordvec.py
15
5514
# pylint:skip-file from __future__ import print_function import logging import sys, random, time, math sys.path.insert(0, "../../python") import mxnet as mx import numpy as np from collections import namedtuple from nce import * from operator import itemgetter from optparse import OptionParser def get_net(vocab_size, ...
apache-2.0
kidaa/aurora
src/test/python/apache/thermos/monitoring/test_disk.py
8
1761
# # 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 ...
apache-2.0
SebasSBM/django
tests/template_tests/test_nodelist.py
173
3234
from unittest import TestCase from django.template import Context, Engine from django.template.base import TextNode, VariableNode from django.utils import six class NodelistTest(TestCase): @classmethod def setUpClass(cls): cls.engine = Engine() super(NodelistTest, cls).setUpClass() def ...
bsd-3-clause
eventql/eventql
deps/3rdparty/spidermonkey/mozjs/testing/mozbase/mozprofile/tests/server_locations.py
3
5364
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import mozfile import unittest from mozprofile.permissions import ServerLocations, \ MissingP...
agpl-3.0
lochiiconnectivity/libcloud
docs/examples/compute/trystack.py
63
1064
from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver import libcloud.security # At the time this example was written, https://nova-api.trystack.org:5443 # was using a certificate issued by a Certificate Authority (CA) which is # not included in the default Ubuntu certificates ...
apache-2.0
ccortezb/troposphere
troposphere/sqs.py
27
1054
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty from .validators import integer try: from awacs.aws import Policy policytypes = (dict, Policy) except ImportError: policytypes = dict, class RedrivePolic...
bsd-2-clause
betoesquivel/fil2014
filenv/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/errcheck.py
623
3522
""" Error checking functions for GEOS ctypes prototype functions. """ import os from ctypes import c_void_p, string_at, CDLL from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.libgeos import GEOS_VERSION from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc # Getting the...
mit
chamaelj/tools-artbio
tools/msp_oases/oases_optimiser.py
3
1789
#!/usr/bin/env python """ VelvetOptimiser Wrapper refactored using the adaptation of Konrad Paszkiewicz University of Exeter, UK. """ import os, sys import subprocess def stop_err(msg): sys.stderr.write("%s\n" % msg) sys.exit() def oases_optimiser(starthash, endhash, input): ''' Replaces call to o...
mit
maiklos-mirrors/jfx78
modules/web/src/main/native/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
119
23221
# 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 ...
gpl-2.0
ewdurbin/ansible-modules-extras
database/misc/riak.py
57
7967
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, James Martin <jmartin@basho.com>, Drew Kerrigan <dkerrigan@basho.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 Fou...
gpl-3.0
Krozark/Kraggne
Kraggne/contrib/contentblocks/utils.py
3
1530
# -*- coding: utf-8 -*- from Kraggne.contrib.contentblocks.conf.settings import CONTENT_CHOICE_MODELS, CONTENT_FORM_MODELS from django.contrib.contenttypes.models import ContentType from django import forms def get_content_choice_models(): if CONTENT_CHOICE_MODELS: q = ContentType.objects.filter(pk=-1)#im...
bsd-2-clause
EricNeedham/assignment-1
venv/lib/python2.7/site-packages/sqlalchemy/engine/util.py
33
2338
# engine/util.py # Copyright (C) 2005-2014 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 .. import util def connection_memoize(key): """Decorator, memoize a functi...
mit
jcatw/deep_q_rl
deep_q_rl/ale_data_set.py
2
9391
"""This class stores all of the samples for training. It is able to construct randomly selected batches of phi's from the stored history. """ import numpy as np import time import theano floatX = theano.config.floatX class DataSet(object): """A replay memory consisting of circular buffers for observed images, a...
bsd-3-clause
sarakha63/persomov
libs/html5lib/serializer/htmlserializer.py
235
12897
from __future__ import absolute_import, division, unicode_literals from six import text_type import gettext _ = gettext.gettext try: from functools import reduce except ImportError: pass from ..constants import voidElements, booleanAttributes, spaceCharacters from ..constants import rcdataElements, entities,...
gpl-3.0
emoon/ProDBG
src/external/edbee-lib/vendor/onig/onigmo.py
6
25586
# -*- coding: utf-8 -*- """Using Onigmo (Oniguruma-mod) regular expression library. This is a low level wrapper for Onigmo regular expression DLL/shared object. (This module does not support static link library.) This provides almost same API as the original C API, so the API is not object oriented. Onigmo DLL (onig...
mit
soarpenguin/ansible
lib/ansible/plugins/terminal/vyos.py
191
1700
# # (c) 2016 Red Hat 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. # # Ansible is d...
gpl-3.0
blaffoy/jenkins-job-builder
jenkins_jobs/modules/parameters.py
12
24380
# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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...
apache-2.0
pikhovkin/instructor
instructor/model.py
1
2702
from collections import OrderedDict from .errors import InvalidData, InvalidDataSize, InvalidModelDeclaration from .fields import BaseFieldInstructor, DefaultByteOrder __all__ = ( 'InstructorModel', ) class Opts(object): pass class MetaInstructor(type): def __new__(cls, name, bases, attrs): d...
mit
asadziach/tensorflow
tensorflow/python/ops/histogram_ops_test.py
71
2968
# Copyright 2015 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
rzarzynski/tempest
tempest/scenario/test_volume_boot_pattern.py
1
8285
# 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 # d...
apache-2.0
phillxnet/rockstor-core
src/rockstor/cli/disks_console.py
2
3121
""" Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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-3.0
dajhorn/ps2binutils
gdb/testsuite/gdb.perf/backtrace.py
46
1825
# Copyright (C) 2013-2015 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This progr...
gpl-2.0
wbcyclist/django-xadmin
xadmin/plugins/chart.py
17
5683
import datetime import decimal import calendar from django.template import loader from django.http import HttpResponseNotFound from django.core.serializers.json import DjangoJSONEncoder from django.http import HttpResponse from django.utils.encoding import smart_unicode from django.db import models from django.utils....
bsd-3-clause
soft-matter/mr
mr/tests/test_feature_saving.py
1
1721
import unittest import nose from numpy.testing import assert_almost_equal, assert_allclose from numpy.testing.decorators import slow from pandas.util.testing import (assert_series_equal, assert_frame_equal) import os from tempfile import NamedTemporaryFile import pandas as pd from pandas import DataFrame, Series imp...
gpl-3.0
alexryndin/ambari
ambari-server/src/test/python/TestAmbariServer.py
1
340374
''' 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 this ...
apache-2.0
gena/qgis-earthengine-plugin
ee_plugin.py
1
5587
# -*- coding: utf-8 -*- """ Main plugin file. """ from __future__ import absolute_import import configparser import requests import webbrowser from builtins import object import os.path import json from qgis.PyQt.QtCore import QSettings, QTranslator, qVersion, QCoreApplication from qgis.PyQt.QtWidgets import QAction...
mit
ravenland/ycmWinRepo
third_party/ycmd/third_party/jedi/test/test_api/test_unicode.py
27
2147
# -*- coding: utf-8 -*- """ All character set and unicode related tests. """ from jedi import Script from jedi._compatibility import u, unicode def test_unicode_script(): """ normally no unicode objects are being used. (<=2.7) """ s = unicode("import datetime; datetime.timedelta") completions = Script(s)....
gpl-3.0
1905410/Misago
misago/users/management/commands/synchronizeusers.py
1
1305
import time from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand from misago.core.management.progressbar import show_progress from misago.core.pgutils import batch_update class Command(BaseCommand): help = 'Synchronizes users' def handle(self, *args, **options)...
gpl-2.0
eyadsibai/rep
tests/test_pybrain.py
3
3872
# Copyright 2014-2015 Yandex LLC and contributors <https://yandex.com/> # # 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
jamesrobertcarthew/notes
midiutil/MidiFile3.py
12
40732
#----------------------------------------------------------------------------- # Name: MidiFile.py # Purpose: MIDI file manipulation utilities # # Author: Mark Conway Wirt <emergentmusics) at (gmail . com> # # Created: 2008/04/17 # Copyright: (c) 2009 Mark Conway Wirt # License: Please see Lic...
mit
kustodian/ansible
test/units/modules/network/f5/test_bigip_traffic_selector.py
22
3034
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # 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 import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
ybalgir/Quantop
Lec7.py
1
1822
import numpy as np import pandas as pd from statsmodels import regression import statsmodels.api as sm import matplotlib.pyplot as plt import math import pandas_datareader.data as web from datetime import datetime def Starter_Lec7(): start = datetime(2014, 1, 1) end = datetime(2015, 1, 1) asset = web.Da...
gpl-3.0
othelarian/arcns
mainscene/mainscene.py
1
75804
# -*- coding: utf-8 -*- from direct.showbase.DirectObject import DirectObject from direct.fsm.FSM import FSM from direct.gui.OnscreenText import OnscreenText from direct.gui.DirectGui import DirectFrame, DGG from direct.stdpy.file import * from direct.actor.Actor import Actor from panda3d.core import Point3, TextNode,...
lgpl-3.0
nextgis/NextGIS_QGIS_open
python/plugins/processing/algs/gdal/ogr2ogr.py
5
4067
# -*- coding: utf-8 -*- """ *************************************************************************** ogr2ogr.py --------------------- Date : November 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *****************************...
gpl-2.0
studywolf/pydmps
pydmps/dmp_rhythmic.py
1
5004
""" Copyright (C) 2013 Travis DeWolf 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 distributed in the hope t...
gpl-3.0
idrogeno/enigma2
lib/python/Components/NimManager.py
1
85000
from boxbranding import getBoxType from time import localtime, mktime from datetime import datetime import xml.etree.cElementTree from os import path from enigma import eDVBSatelliteEquipmentControl as secClass, \ eDVBSatelliteLNBParameters as lnbParam, \ eDVBSatelliteDiseqcParameters as diseqcParam, \ eDVBSatellit...
gpl-2.0
cogeorg/BlackRhino
examples/firesales_simple/networkx/generators/random_clustered.py
46
4093
# -*- coding: utf-8 -*- """Generate graphs with given degree and triangle sequence. """ # Copyright (C) 2004-2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import random import networkx as nx __author_...
gpl-3.0
barbuza/django
tests/template_tests/templatetags/custom.py
152
5394
import operator import warnings from django import template from django.template.defaultfilters import stringfilter from django.utils import six from django.utils.html import escape, format_html register = template.Library() @register.filter @stringfilter def trim(value, num): return value[:num] @register.fil...
bsd-3-clause
michaelray/Iristyle-ChocolateyPackages
EthanBrown.SublimeText2.UtilPackages/tools/PackageCache/EncodingHelper/chardet/escprober.py
215
3029
######################## 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...
mit
zhangjunli177/sahara
sahara/plugins/vanilla/v2_7_1/edp_engine.py
2
1663
# Copyright (c) 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
openstack/sahara-dashboard
sahara_dashboard/content/data_processing/clusters/cluster_templates/workflows/create.py
1
16094
# 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...
apache-2.0
bhargavvader/gensim
gensim/models/rpmodel.py
14
4006
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html import logging import numpy as np from gensim import interfaces, matutils, utils logger = logging.getLogger('gensim.models.rpmodel'...
lgpl-2.1
harshilasu/LinkurApp
y/google-cloud-sdk/lib/googlecloudsdk/core/remote_completion.py
5
4288
# Copyright 2014 Google Inc. All Rights Reserved. """Remote resource completion and caching.""" import logging import os import time from googlecloudsdk.core import config from googlecloudsdk.core import properties class RemoteCompletion(object): """Class to cache the names of remote resources.""" CACHE_HITS = ...
gpl-3.0
yongshengwang/hue
build/env/lib/python2.7/site-packages/django_extensions-1.5.0-py2.7.egg/django_extensions/mongodb/fields/json.py
44
2251
""" JSONField automatically serializes most Python terms to JSON data. Creates a TEXT field with a default value of "{}". See test_json.py for more information. from django.db import models from django_extensions.db.fields import json class LOL(models.Model): extra = json.JSONField() """ import six import d...
apache-2.0
knkinnard/byte-2
lib/werkzeug/urls.py
77
36634
# -*- coding: utf-8 -*- """ werkzeug.urls ~~~~~~~~~~~~~ ``werkzeug.urls`` used to provide several wrapper functions for Python 2 urlparse, whose main purpose were to work around the behavior of the Py2 stdlib and its lack of unicode support. While this was already a somewhat inconvenient situat...
apache-2.0
SahilTikale/haas
hil/cli/project.py
2
1764
"""Commands related to projects are in this module""" import click import sys from hil.cli.client_setup import client @click.group() def project(): """Commands related to project""" @project.command(name='create') @click.argument('project') def project_create(project): """Create a new project""" client....
apache-2.0
vlvkobal/netdata
collectors/python.d.plugin/python_modules/pyyaml3/events.py
8
2476
# SPDX-License-Identifier: MIT # Abstract classes. class Event(object): def __init__(self, start_mark=None, end_mark=None): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in ['anchor', 'tag', 'implicit', 'value'] if h...
gpl-3.0
FATruden/boto
tests/integration/sns/test_connection.py
3
1448
# Copyright (c) 2013 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 right...
mit
charlescearl/VirtualMesos
third_party/boto-2.0b2/boto/mturk/question.py
8
14194
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
apache-2.0
frouty/odoo_oph
addons/l10n_ec/__openerp__.py
170
1775
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010-2012 Cristian Salamea Gnuthink Software Labs Cia. Ltda # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
agpl-3.0
greenapes/python-blitline
tools/scrape.py
1
1910
import re import string import urllib.request, urllib.error, urllib.parse from datetime import datetime from lxml import etree def function_name(text, rex=re.compile(r'"name"\s*:\s*"([^"]+)"')): match = rex.search(text) if match: return match.group(1) return None parser = etree.HTMLParser() tree...
mit
awemulya/fieldsight-kobocat
onadata/apps/viewer/south_migrations/0003_auto__add_field_datadictionary_user.py
13
8720
# encoding: 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 'DataDictionary.user' db.add_column('odk_viewer_datadictionary', 'user', self.gf('django.db...
bsd-2-clause
gojira/tensorflow
tensorflow/contrib/autograph/utils/type_hints.py
12
1477
# 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
gojira/tensorflow
tensorflow/python/keras/layers/recurrent_test.py
9
20464
# 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
sk413025/thug
src/DOM/UserProfile.py
9
3165
#!/usr/bin/env python # # UserProfile.py # # 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. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANT...
gpl-2.0
python-gitlab/python-gitlab
gitlab/v4/objects/hooks.py
1
3071
from gitlab.base import RequiredOptional, RESTManager, RESTObject from gitlab.mixins import CRUDMixin, NoUpdateMixin, ObjectDeleteMixin, SaveMixin __all__ = [ "Hook", "HookManager", "ProjectHook", "ProjectHookManager", "GroupHook", "GroupHookManager", ] class Hook(ObjectDeleteMixin, RESTObjec...
lgpl-3.0
kxliugang/edx-platform
lms/djangoapps/staticbook/views.py
91
6351
""" Views for serving static textbooks. """ from django.contrib.auth.decorators import login_required from django.http import Http404 from edxmako.shortcuts import render_to_response from opaque_keys.edx.locations import SlashSeparatedCourseKey from xmodule.annotator_token import retrieve_token from courseware.acces...
agpl-3.0
DistrictDataLabs/topicmaps
topics/models.py
1
3031
# topics.models # Topic modeling for data survey analysis # # Author: Benjamin Bengfort <bbengfort@districtdatalabs.com> # Created: Tue Sep 08 19:43:58 2015 -0400 # # Copyright (C) 2015 District Data Labs # For license information, see LICENSE.txt # # ID: models.py [] benjamin@bengfort.com $ """ Topic modeling for ...
mit
onyxfish/journalism
tests/test_table/test_rename.py
3
4715
#!/usr/bin/env python # -*- coding: utf8 -*- import warnings from agate import Table from agate.testcase import AgateTestCase from agate.data_types import * class TestRename(AgateTestCase): def setUp(self): self.rows = ( (1, 4, 'a'), (2, 3, 'b'), (None, 2, 'c') ...
mit
iw3hxn/server
openerp/tools/yaml_tag.py
14
6064
import yaml import logging class YamlTag(object): """ Superclass for constructors of custom tags defined in yaml file. __str__ is overriden in subclass and used for serialization in module recorder. """ def __init__(self, **kwargs): self.__dict__.update(kwargs) def __getitem__(self, key...
agpl-3.0
edmorley/treeherder
treeherder/services/pulse/consumers.py
1
5645
import logging import newrelic.agent from kombu import (Exchange, Queue) from kombu.mixins import ConsumerMixin from treeherder.etl.common import fetch_json from treeherder.etl.tasks.pulse_tasks import (store_pulse_jobs, store_pulse_pushes) from .excha...
mpl-2.0
kursitet/edx-platform
common/test/acceptance/pages/lms/courseware.py
26
6723
""" Courseware page. """ from .course_page import CoursePage from selenium.webdriver.common.action_chains import ActionChains class CoursewarePage(CoursePage): """ Course info. """ url_path = "courseware/" xblock_component_selector = '.vert .xblock' section_selector = '.chapter' subsecti...
agpl-3.0
keulraesik/pyelftools
examples/elf_relocations.py
9
1693
#------------------------------------------------------------------------------- # elftools example: elf_relocations.py # # An example of obtaining a relocation section from an ELF file and examining # the relocation entries it contains. # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #--------...
unlicense
tigeorgia/fixmystreet
apps/users/migrations/0001_initial.py
1
2962
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.CreateMode...
gpl-2.0