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
project-em/ns3-sentiment
stance/topic_scoring.py
1
1539
from gensim.models import KeyedVectors from nltk import pos_tag from nltk import word_tokenize import numpy as np word2vec_filepath = "./data/GoogleNews-vectors-negative300.bin" # word2vec similarity between the topic and the nouns of the candidate sentence def nouns_sim(word2vec, sentences, tagged_sentences, tagged_...
mit
jirikuncar/invenio
invenio/modules/records/views.py
2
12269
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012, 2013, 2014, 2015 CERN. # # Invenio 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...
gpl-2.0
telwertowski/QGIS
tests/src/python/test_qgsserver_plugins.py
13
9203
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer plugins and filters. From build dir, run: ctest -R PyQgsServerPlugins -V .. note:: 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 ve...
gpl-2.0
sumedhasingla/VTK
ThirdParty/Twisted/twisted/protocols/policies.py
35
20735
# -*- test-case-name: twisted.test.test_policies -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Resource limiting policies. @seealso: See also L{twisted.protocols.htb} for rate limiting. """ from __future__ import division, absolute_import # system imports import sys from zope.inte...
bsd-3-clause
messense/wechat-bot
plugins/oschina.py
3
1103
#coding=utf-8 import requests from xml.etree import ElementTree from tornado.util import ObjectDict __name__ = 'oschina' def test(data, msg=None, bot=None): if ('oschina' in data or '开源中国' in data) and '最新' in data and '新闻' in data: return True return False def respond(data, msg=None, bot=None): ...
mit
dendisuhubdy/tensorflow
tensorflow/python/data/kernel_tests/shard_dataset_op_test.py
42
4218
# 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
adelton/django
tests/m2m_through_regress/tests.py
182
9847
from __future__ import unicode_literals from django.contrib.auth.models import User from django.core import management from django.test import TestCase from django.utils.six import StringIO from .models import ( Car, CarDriver, Driver, Group, Membership, Person, UserMembership, ) class M2MThroughTestCase(TestCa...
bsd-3-clause
jorapi/android_kernel_lge_g3
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
jaggu303619/asylum-v2.0
openerp/addons/base_status/__init__.py
61
1087
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
rfk/regobj
setup.py
1
1664
# # This is the regobj setuptools script. # Originally developed by Ryan Kelly, 2009. # # This script is placed in the public domain. # from distutils.core import setup # Safely extract the docstring and version info from the module. # If we did a straight `import regobj` here we wouldn't be able # to build on ...
mit
ibazzi/xbmc
addons/script.module.html5lib/lib/html5lib/filters/optionaltags.py
1727
10500
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def slider(self): previous1 = previous2 = None for token in self.source: if previous1 is not None: yield previous2, previous1, token previous2...
gpl-2.0
tntC4stl3/scrapy
tests/test_downloadermiddleware_httpproxy.py
103
3439
import os import sys from twisted.trial.unittest import TestCase, SkipTest from scrapy.downloadermiddlewares.httpproxy import HttpProxyMiddleware from scrapy.exceptions import NotConfigured from scrapy.http import Response, Request from scrapy.spiders import Spider spider = Spider('foo') class TestDefaultHeadersMidd...
bsd-3-clause
fcurella/python-packager
pypackager/utils.py
1
1184
import collections def unflatten_dict(a_dict): resultDict = {} for key, value in a_dict.items(): parts = key.split("-") d = resultDict for part in parts[:-1]: if part not in d: d[part] = {} d = d[part] d[parts[-1]] = value return resu...
mit
Affix/CouchPotatoServer
libs/tornado/platform/posix.py
352
1859
#!/usr/bin/env python # # Copyright 2011 Facebook # # 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...
gpl-3.0
naototty/pyflag
src/plugins_old/MemoryForensics/Volatility-1.3_Linux_rc.1/forensics/win32/executable.py
7
12379
# Volatility # Copyright (C) 2007,2008 Volatile Systems # Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu> # # 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 o...
gpl-2.0
leilihh/nova
nova/tests/network/test_neutronv2.py
2
107698
# Copyright 2012 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 requi...
apache-2.0
bkahlert/seqan-research
raw/pmbs12/pmsb13-data-20120615/trunk/misc/seqan_instrumentation/bin/classes/simplejson/tests/test_indent.py
78
2570
from unittest import TestCase import simplejson as json import textwrap from StringIO import StringIO class TestIndent(TestCase): def test_indent(self): h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth', {'nifty': 87}, {'field': 'yes', 'morefield': False} ...
mit
smartforceplus/SmartForceplus
addons/website_partner/__openerp__.py
383
1498
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
unsiloai/syntaxnet-ops-hack
tensorflow/python/ops/logging_ops.py
64
14358
# 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
tedder/ansible
lib/ansible/module_utils/utm_utils.py
44
10446
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
shahar-stratoscale/nova
nova/tests/cells/test_cells_messaging.py
1
89277
# Copyright (c) 2012 Rackspace Hosting # 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 License at # # http://www.apache.org/license...
apache-2.0
marckuz/django
tests/admin_changelist/tests.py
55
41903
from __future__ import unicode_literals import datetime from django.contrib import admin from django.contrib.admin.models import LogEntry from django.contrib.admin.options import IncorrectLookupParameters from django.contrib.admin.templatetags.admin_list import pagination from django.contrib.admin.tests import AdminS...
bsd-3-clause
WebSpider/headphones
lib/apscheduler/schedulers/background.py
33
1468
from __future__ import absolute_import from threading import Thread, Event from apscheduler.schedulers.base import BaseScheduler from apscheduler.schedulers.blocking import BlockingScheduler from apscheduler.util import asbool class BackgroundScheduler(BlockingScheduler): """ A scheduler that runs in the bac...
gpl-3.0
Ramalus/kivy
examples/widgets/effectwidget3_advanced.py
43
1665
''' This example demonstrates creating and usind an AdvancedEffectBase. In this case, we use it to efficiently pass the touch coordinates into the shader. ''' from kivy.base import runTouchApp from kivy.properties import ListProperty from kivy.lang import Builder from kivy.uix.effectwidget import EffectWidget, Advance...
mit
vicky2135/lucious
oscar/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
bsd-3-clause
pataquets/phantomjs
src/qt/qtbase/src/3rdparty/freetype/src/tools/chktrcmp.py
381
3826
#!/usr/bin/env python # # Check trace components in FreeType 2 source. # Author: suzuki toshiya, 2009 # # This code is explicitly into the public domain. import sys import os import re SRC_FILE_LIST = [] USED_COMPONENT = {} KNOWN_COMPONENT = {} SRC_FILE_DIRS = [ "src" ] TRACE_DEF_FILES = [ "include/freetype/in...
bsd-3-clause
meteorcloudy/tensorflow
tensorflow/contrib/mixed_precision/python/loss_scale_manager.py
12
7768
# Copyright 2018 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
deepinsight/Deformable-ConvNets
deeplab/function/test_deeplab.py
1
3137
# -------------------------------------------------------- # Deformable Convolutional Networks # Copyright (c) 2016 by Contributors # Copyright (c) 2017 Microsoft # Licensed under The Apache-2.0 License [see LICENSE for details] # Modified by Zheng Zhang # -------------------------------------------------------- impor...
apache-2.0
zerobatu/edx-platform
lms/djangoapps/certificates/migrations/0013_auto__add_field_generatedcertificate_error_reason.py
188
5642
# -*- 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 'GeneratedCertificate.error_reason' db.add_column('certificates_generatedcertificate', 'error...
agpl-3.0
rizar/attention-lvcsr
libs/Theano/theano/tensor/tests/test_keepdims.py
3
3963
import unittest import numpy import theano from theano import tensor, function from theano.tests.unittest_tools import attr # this tests other ops to ensure they keep the dimensions of their # inputs correctly class TestKeepDims(unittest.TestCase): def makeKeepDims_local(self, x, y, axis): if axis is N...
mit
squarerootfury/distrochooser
backend/distrochooser/migrations/0017_auto_20190406_1159.py
2
1484
# Generated by Django 2.1.2 on 2019-04-06 09:59 import datetime from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('distrochooser', '0016_auto_20190331_1356'), ] operations = [ migrations.Creat...
mit
dset0x/invenio-workflows
invenio_workflows/logger.py
5
3182
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2013, 2014 CERN. # # Invenio 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 l...
gpl-2.0
nitely/Spirit
spirit/topic/views.py
1
3867
# -*- coding: utf-8 -*- from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect, get_object_or_404 from django.http import HttpResponsePermanentRedirect from djconfig import config from spirit.core.utils.views import is_post, post_data from spirit.core.utils.paginator ...
mit
rhertzog/django
django/core/management/commands/runserver.py
64
6371
from __future__ import unicode_literals import errno import os import re import socket import sys from datetime import datetime from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.core.servers.basehttp import get_internal_wsgi_application, run from django.uti...
bsd-3-clause
gdimitris/ChessPuzzlerBackend
Virtual_Environment/lib/python2.7/site-packages/setuptools/command/install_scripts.py
505
2231
from distutils import log import distutils.command.install_scripts as orig import os from pkg_resources import Distribution, PathMetadata, ensure_directory class install_scripts(orig.install_scripts): """Do normal script install, plus any egg_info wrapper scripts""" def initialize_options(self): ori...
mit
arbrandes/edx-platform
lms/djangoapps/mobile_api/tests/test_mobile_platform.py
5
2631
""" Tests for Platform against Mobile App Request """ import ddt from django.test import TestCase from lms.djangoapps.mobile_api.mobile_platform import MobilePlatform @ddt.ddt class TestMobilePlatform(TestCase): """ Tests for platform against mobile app request """ @ddt.data( ("edX/org.edx...
agpl-3.0
shell909090/shadowsocks
shadowsocks/crypto/rc4_md5.py
15
1393
#!/usr/bin/env python # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
pp-mo/iris
docs/iris/example_code/Oceanography/atlantic_profiles.py
2
3469
""" Oceanographic profiles and T-S diagrams ======================================= This example demonstrates how to plot vertical profiles of different variables in the same axes, and how to make a scatter plot of two variables. There is an oceanographic theme but the same techniques are equally applicable to atmosph...
lgpl-3.0
mne-tools/mne-tools.github.io
0.16/_downloads/plot_stats_cluster_time_frequency_repeated_measures_anova.py
7
10025
""" ==================================================================== Mass-univariate twoway repeated measures ANOVA on single trial power ==================================================================== This script shows how to conduct a mass-univariate repeated measures ANOVA. As the model to be fitted assume...
bsd-3-clause
lizardsystem/lizard-rijnmond
lizard_rijnmond/migrations/0006_auto__chg_field_strategy_name.py
1
2731
# 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): # Changing field 'Strategy.name' db.alter_column('lizard_rijnmond_strategy', 'name', self.gf('django.db.mo...
gpl-3.0
rec/echomesh
code/python/echomesh/util/string/Split_test.py
1
1508
from __future__ import absolute_import, division, print_function, unicode_literals from echomesh.util.string.Split import split_words, pair_split from echomesh.util.TestCase import TestCase class SplitTest(TestCase): def test_split_simple(self): self.assertEqual(split_words('hello, there!'), ['hello,', 't...
mit
Boussadia/weboob
modules/guerrillamail/browser.py
2
2689
# -*- coding: utf-8 -*- # Copyright(C) 2013 Vincent A # # This file is part of weboob. # # weboob 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, either version 3 of the License, or # (at your opt...
agpl-3.0
mastbaum/rat-pac
python/SCons/Tool/yacc.py
19
4762
"""SCons.Tool.yacc Tool-specific initialization for yacc. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permi...
bsd-3-clause
Webstr-framework/webstr
webstr/patternfly/modal/pages.py
1
1363
""" Page objects for patternfly/bootstrap modal window. Modal window is a window which makes itself the only active element on the page, so that one needs to close it first to access the rest of the page again. """ # Copyright 2016 Red Hat # # Licensed under the Apache License, Version 2.0 (the "License"); # you may ...
apache-2.0
mpare002/HackTech_2017
env/Lib/site-packages/pip/_vendor/html5lib/sanitizer.py
805
16428
from __future__ import absolute_import, division, unicode_literals import re from xml.sax.saxutils import escape, unescape from .tokenizer import HTMLTokenizer from .constants import tokenTypes class HTMLSanitizerMixin(object): """ sanitization of XHTML+MathML+SVG and of inline style attributes.""" accepta...
mit
dims/ironic
ironic/tests/unit/drivers/test_pxe.py
3
14871
# Copyright 2015 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 applicabl...
apache-2.0
anastasia-tarasova/indy-sdk
docs/how-tos/negotiate-proof/python/step4.py
2
1123
print_log('\n10. Prover creates Proof for Proof Request\n') cred_for_attr_1 = creds_for_proof_request['attrs']['attr1_referent'] referent = cred_for_attr_1[0]['referent'] print_log('Referent: ') pprint.pprint(referent) chosen_claims_json = json.dumps({ 'self_a...
apache-2.0
pullao/Farspeaker
app/main/routes.py
1
1698
import flask from . import main from . import forms import os from werkzeug import secure_filename from flask import Flask, render_template, request from . import activeCampaign @main.route('/', methods=['GET', 'POST']) def index(): """"Login form to enter a room.""" form = forms.LoginForm() if form.val...
mit
ifding/ifding.github.io
stylegan2-ada/dnnlib/tflib/tfutil.py
1
10240
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
mit
havellay/ADBMS_ABY
libevent/event_rpcgen.py
159
45222
#!/usr/bin/env python # # Copyright (c) 2005 Niels Provos <provos@citi.umich.edu> # All rights reserved. # # Generates marshaling code based on libevent. import sys import re # _NAME = "event_rpcgen.py" _VERSION = "0.1" _STRUCT_RE = '[a-z][a-z_0-9]*' # Globals line_count = 0 white = re.compile(r'^\s+') cppcomment =...
gpl-2.0
shadanan/hevante-points
src/requests/packages/chardet/escprober.py
2936
3187
######################## 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
loansindi/linux
tools/perf/scripts/python/export-to-postgresql.py
617
16128
# export-to-postgresql.py: export perf data to a postgresql database # Copyright (c) 2014, Intel Corporation. # # 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 the Free Software Foundation. # # Thi...
gpl-2.0
osvalr/odoo
addons/account_budget/account_budget.py
194
9368
# -*- 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
ndawe/pyAMI
pyAMI/extern/ZSI/generate/commands.py
1
13219
############################################################################ # Joshua Boverhof<JRBoverhof@lbl.gov>, LBNL # Monte Goode <MMGoode@lbl.gov>, LBNL # See Copyright for copyright notice! ############################################################################ import exceptions, sys, optparse, os, warning...
gpl-3.0
webgeodatavore/django
tests/gis_tests/geoapp/test_feeds.py
292
4194
from __future__ import unicode_literals from xml.dom import minidom from django.conf import settings from django.contrib.sites.models import Site from django.test import ( TestCase, modify_settings, override_settings, skipUnlessDBFeature, ) from .models import City @modify_settings(INSTALLED_APPS={'append': 'd...
bsd-3-clause
matthewalbani/scipy
scipy/stats/_continuous_distns.py
7
140183
# # Author: Travis Oliphant 2002-2011 with contributions from # SciPy Developers 2004-2011 # from __future__ import division, print_function, absolute_import import warnings import numpy as np from scipy.misc.doccer import inherit_docstring_from from scipy import optimize from scipy import integrate impor...
bsd-3-clause
julienbou/heroku-buildpack-serpan
vendor/distribute-0.6.36/setuptools/command/alias.py
135
2477
import distutils, os from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import * from setuptools.command.setopt import edit_config, option_base, config_file def shquote(arg): """Quote an argument for later parsing by shlex.split()""" for c in ...
mit
rakeshmi/tempest
tempest/tests/cmd/test_tempest_init.py
14
2793
# Copyright 2015 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 applicabl...
apache-2.0
sam-tsai/django
tests/utils_tests/test_dateformat.py
265
6177
from __future__ import unicode_literals from datetime import date, datetime from django.test import SimpleTestCase, override_settings from django.test.utils import TZ_SUPPORT, requires_tz_support from django.utils import dateformat, translation from django.utils.dateformat import format from django.utils.timezone imp...
bsd-3-clause
meowler/sandbox
node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py
1789
10585
# Copyright (c) 2014 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. """Xcode-ninja wrapper project file generator. This updates the data structures passed to the Xcode gyp generator to build with ninja instead. The Xcode project i...
mit
logituit/Recbot
IMDbPY-5.1.1/bin/search_character.py
7
1413
#!/usr/bin/env python """ search_character.py Usage: search_character "character name" Search for the given name and print the results. """ import sys # Import the IMDbPY package. try: import imdb except ImportError: print 'You bad boy! You need to install the IMDbPY package!' sys.exit(1) if len(sys....
mit
fpiot/mbed-ats
workspace_tools/toolchains/gcc.py
2
10915
""" mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
apache-2.0
jwlawson/tensorflow
tensorflow/contrib/training/python/training/device_setter_test.py
54
5692
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
sadleader/odoo
addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py
374
2830
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
proxysh/Safejumper-for-Desktop
buildmac/Resources/env/lib/python2.7/site-packages/twisted/test/test_ident.py
10
7012
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.protocols.ident module. """ import struct from twisted.protocols import ident from twisted.python import failure from twisted.internet import error from twisted.internet import defer from twisted.python.compat import ...
gpl-2.0
aaronsw/pytorctl
TorCtl/TorCtl.py
1
64194
#!/usr/bin/python # TorCtl.py -- Python module to interface with Tor Control interface. # Copyright 2005 Nick Mathewson # Copyright 2007-2010 Mike Perry. See LICENSE file. """ Library to control Tor processes. This library handles sending commands, parsing responses, and delivering events to and from the control port...
bsd-3-clause
zfrenchee/pandas
pandas/tests/frame/test_nonunique_indexes.py
2
18505
# -*- coding: utf-8 -*- from __future__ import print_function import pytest import numpy as np from pandas.compat import lrange, u from pandas import DataFrame, Series, MultiIndex, date_range import pandas as pd from pandas.util.testing import assert_series_equal, assert_frame_equal import pandas.util.testing as t...
bsd-3-clause
adviti/melange
thirdparty/google_appengine/lib/django_1_2/django/contrib/sessions/backends/db.py
81
2716
import datetime from django.conf import settings from django.contrib.sessions.models import Session from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.exceptions import SuspiciousOperation from django.db import IntegrityError, transaction, router from django.utils.encoding impor...
apache-2.0
gmr/consulate
consulate/api/catalog.py
1
6410
""" Consul Catalog Endpoint Access """ from consulate.api import base class Catalog(base.Endpoint): """The Consul agent is the core process of Consul. The agent maintains membership information, registers services, runs checks, responds to queries and more. The agent must run on every node that is part o...
bsd-3-clause
parksangkil/nw.js
tools/package_binaries.py
64
14511
#!/usr/bin/env python import argparse import getnwisrelease import getnwversion import gzip import os import platform import shutil import sys import tarfile import zipfile from subprocess import call steps = ['nw', 'chromedriver', 'symbol', 'headers', 'others'] ################################ # Parse command line a...
mit
armpc/repo
subcmds/upload.py
1
10547
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
apache-2.0
quarkonics/zstack-woodpecker
zstackwoodpecker/zstackwoodpecker/ansible.py
2
2482
''' @author: YYK ''' import zstacklib.utils.shell as shell import zstacklib.utils.ssh as ssh import os.path import sys def check_and_install_ansible(): cmd = 'which ansible' try: shell.call(cmd) except: print('ansible is not installed. Will try to install ansible') cmd = 'pip inst...
apache-2.0
hasteur/hasteurbot_task_3
families/wikitravel_shared_family.py
4
1070
# -*- coding: utf-8 -*- __version__ = '$Id$' import family # The Wikitravel shared family class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'wikitravel_shared' self.langs = { 'wikitravel_shared': 'wikitravel.org', } se...
gpl-2.0
jasonhamilton/hotwing-core
tests/test_coordinate.py
1
3883
import pytest import sys, os from decimal import Decimal myPath = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, myPath + '/../') from hotwing_core import Coordinate class TestCoordinate(): def test_create_coordinate(self): x = 1 y = 1.4 c = Coordinate(x, y) assert ...
gpl-3.0
SebastianMerz/calalert
Server/venv/lib/python2.7/site-packages/unittest2/runner.py
164
6757
"""Running tests""" import sys import time import unittest from unittest2 import result try: from unittest2.signals import registerResult except ImportError: def registerResult(_): pass __unittest = True class _WritelnDecorator(object): """Used to decorate file-like objects with a handy 'w...
gpl-2.0
elifeasley/metacademy-application
content_server/concepts.py
1
5579
import random import resources import string import work_estimates ID_LENGTH = 8 class Dependency: """A struct representing a dependency on another concept.""" def __init__(self, tag, reason, shortcut): self.tag = tag self.reason = reason assert type(shortcut) == int self.short...
gpl-3.0
dazhaoniel/1kg-more
js1kg/message/views.py
1
2298
from django.shortcuts import render from django.utils import timezone from django.contrib.auth.decorators import login_required from django.db.models import Q from django.template import RequestContext from guardian.decorators import permission_required_or_403 from .models import MessageThread, Message from .forms impo...
apache-2.0
alrusdi/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/null_fk_ordering/models.py
92
1357
""" Regression tests for proper working of ForeignKey(null=True). Tests these bugs: * #7512: including a nullable foreign key reference in Meta ordering has un xpected results """ from django.db import models # The first two models represent a very simple null FK ordering case. class Author(models.Model): n...
gpl-3.0
javifo/SM-G920F-kernel
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
cneill/barbican
barbican/tests/api/controllers/test_acls.py
2
43919
# Copyright (c) 2015 Rackspace, 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 wr...
apache-2.0
RapidRatings/mongo-connector
mongo_connector/doc_managers/solr_doc_manager.py
1
8749
# Copyright 2013-2014 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
ekaputra07/gempa-monitor
lib/bs4/tests/test_html5lib.py
20
3910
"""Tests to ensure that the html5lib tree builder generates good trees.""" import warnings try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError, e: HTML5LIB_PRESENT = False from bs4.element import SoupStrainer from bs4.testing import ( HTML5TreeBuilderSmokeTest, ...
mit
gic888/MIEN
optimizers/arraystore.py
1
5947
#!/usr/bin/env python ## Copyright (C) 2005-2006 Graham I Cummins ## 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. ##...
gpl-2.0
tmeits/pybrain
pybrain/tools/neuralnets.py
26
13763
# Neural network data analysis tool collection. Makes heavy use of the logging module. # Can generate training curves during the run (from properly setup IPython and/or with # TkAgg backend and interactive mode - see matplotlib documentation). __author__ = "Martin Felder" __version__ = "$Id$" from pylab import ion, fi...
bsd-3-clause
TheWardoctor/Wardoctors-repo
script.module.liveresolver/lib/liveresolver/modules/f4mproxy/utils/codec.py
88
2613
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """Classes for reading/writing binary data (such as TLS records).""" from .compat import * class Writer(object): def __init__(self): self.bytes = bytearray(0) def add(self, x, length): self.bytes...
apache-2.0
xzturn/tensorflow
tensorflow/python/ops/control_flow_grad.py
49
9381
# 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
eusi/MissionPlanerHM
Lib/site-packages/numpy/f2py/tests/test_callback.py
59
1707
from numpy.testing import * from numpy import array import math import util class TestF77Callback(util.F2PyTest): code = """ subroutine t(fun,a) integer a cf2py intent(out) a external fun call fun(a) end subroutine func(a) cf2py intent(in,out) a integer a ...
gpl-3.0
ddki/my_study_project
language/python/frameworks/flask/venv/lib/python2.7/site-packages/setuptools/depends.py
336
5837
import sys import imp import marshal from distutils.version import StrictVersion from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN from .py33compat import Bytecode __all__ = [ 'Require', 'find_module', 'get_module_constant', 'extract_constant' ] class Require: """A prerequisite to building o...
mit
samuelmaudo/yepes
yepes/utils/unidecode/x0b6.py
253
4996
data = ( 'ddyels', # 0x00 'ddyelt', # 0x01 'ddyelp', # 0x02 'ddyelh', # 0x03 'ddyem', # 0x04 'ddyeb', # 0x05 'ddyebs', # 0x06 'ddyes', # 0x07 'ddyess', # 0x08 'ddyeng', # 0x09 'ddyej', # 0x0a 'ddyec', # 0x0b 'ddyek', # 0x0c 'ddyet', # 0x0d 'ddyep', # 0x0e 'ddyeh', # 0x0f ...
bsd-3-clause
arista-eosplus/ansible-modules-extras
cloud/webfaction/webfaction_app.py
75
6195
#!/usr/bin/python # # Create a Webfaction application using Ansible and the Webfaction API # # Valid application types can be found by looking here: # http://docs.webfaction.com/xmlrpc-api/apps.html#application-types # # ------------------------------------------ # # (c) Quentin Stafford-Fraser 2015, with contributions...
gpl-3.0
Chibin/gpdb
gpMgmt/bin/gppylib/testold/testDriver.py
4
7987
import sys from gppylib.gplog import * from gppylib.system.configurationInterface import * from gppylib.system import configurationImplTest, fileSystemImplTest, fileSystemInterface, osInterface, osImplTest, \ faultProberInterface, faultProberImplTest from gppylib.gparray import Segment logger = get_default_lo...
apache-2.0
lidiamcfreitas/FenixScheduleMaker
ScheduleMaker/brython/www/src/Lib/encodings/cp875.py
37
13161
""" Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.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 deco...
bsd-2-clause
etuna-SBF-kog/Stadsparken
env/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py
102
5235
'''SSL with SNI-support for Python 2. This needs the following packages installed: * pyOpenSSL (tested with 0.13) * ndg-httpsclient (tested with 0.3.2) * pyasn1 (tested with 0.1.6) To activate it call :func:`~urllib3.contrib.pyopenssl.inject_into_urllib3`. This can be done in a ``sitecustomize`` module, or at any ot...
gpl-3.0
SnappleCap/oh-mainline
vendor/packages/Django/django/contrib/admin/validation.py
100
20755
from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.fields import FieldDoesNotExist from django.forms.models import (BaseModelForm, BaseModelFormSet, fields_for_model, _get_foreign_key) from django.contrib.admin import ListFilter, FieldListFilter from django.co...
agpl-3.0
recklessromeo/otm-core
opentreemap/importer/tasks.py
2
6486
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division import json from celery import task, chord from django.core.exceptions import ObjectDoesNotExist from django.db import transaction from treemap.models import Species from importer.mo...
agpl-3.0
tensorflow/estimator
tensorflow_estimator/python/estimator/canned/optimizers_test.py
1
3665
# 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
AuyaJackie/odoo
addons/stock_account/stock_account.py
77
19901
# -*- 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
ajrichards/htsint
docs/conf.py
1
8728
# -*- coding: utf-8 -*- # This file was auto-generated using lpEdit import sys, os, time, ast from lpedit import SphinxLogger from htsint import __version__ currentFilePath = os.path.realpath(__file__) logFilePath = os.path.join(os.path.split(currentFilePath)[0],'sphinx.log') sl = SphinxLogger(logFilePath) ## these ...
bsd-3-clause
hks-epod/configuration
util/jenkins/check-celery-queues.py
4
6892
import redis import click import boto3 import botocore import backoff from itertools import zip_longest max_tries = 5 class RedisWrapper(object): def __init__(self, *args, **kwargs): self.redis = redis.StrictRedis(*args, **kwargs) @backoff.on_exception(backoff.expo, (redis....
agpl-3.0
trulywireless/pjsip
pjsip-apps/build/get-footprint.py
59
12629
# $Id: get-footprint.py 1352 2007-06-08 01:41:25Z bennylp $ # # This file is used to generate PJSIP/PJMEDIA footprint report. # To use this file, just run it in pjsip-apps/build directory, to # produce footprint.txt and footprint.htm report files. # import os import sys import string import time compile_flags1 = [ ...
gpl-2.0