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
amenonsen/ansible
lib/ansible/modules/cloud/vmware/_vmware_host_config_facts.py
21
3727
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata...
gpl-3.0
homme/ansible-modules-core
system/authorized_key.py
55
15877
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to add authorized_keys for ssh logins. (c) 2012, Brad Olson <brado@movedbylight.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 ...
gpl-3.0
dvliman/jaikuengine
.google_appengine/lib/django-1.3/django/contrib/messages/storage/fallback.py
627
2171
from django.contrib.messages.storage.base import BaseStorage from django.contrib.messages.storage.cookie import CookieStorage from django.contrib.messages.storage.session import SessionStorage class FallbackStorage(BaseStorage): """ Tries to store all messages in the first backend, storing any unstored mes...
apache-2.0
mzbenami/pyeapi
pyeapi/api/varp.py
1
7989
# # Copyright (c) 2015, Arista Networks, 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 condit...
bsd-3-clause
andrewyoung1991/abjad
abjad/tools/lilypondparsertools/ContextSpeccedMusic.py
2
2353
# -*- encoding: utf-8 -*- from abjad.tools import stringtools from abjad.tools.lilypondparsertools.Music import Music class ContextSpeccedMusic(Music): r'''Abjad model of the LilyPond AST context-specced music node. ''' ### CLASS VARIABLES ### __slots__ = ( #'context', 'context_name'...
gpl-3.0
nalle/dyndd
dyndd/controller.py
1
9149
from twisted.internet import reactor, defer from twisted.python import failure from twisted.names import client, dns, error, server import ConfigParser import logging import os import time import datetime import socket import signal from twisted.internet.address import IPv4Address import MySQLdb class DynDDServerFac...
gpl-3.0
IronLanguages/ironpython2
Src/StdLib/Lib/distutils/tests/setuptools_build_ext.py
149
11489
from distutils.command.build_ext import build_ext as _du_build_ext try: # Attempt to use Pyrex for building extensions, if available from Pyrex.Distutils.build_ext import build_ext as _build_ext except ImportError: _build_ext = _du_build_ext import os, sys from distutils.file_util import copy_file from di...
apache-2.0
ianclegg/requests-ntlm2
requests_ntlm2/__init__.py
1
1172
# (c) 2015, Ian Clegg <ian.clegg@sourcewarp.com> # # ntlmlib is 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
Williams224/davinci-scripts
ksteta3pi/Consideredbkg/MC_12_11102202_MagUp.py
3
17903
#-- GAUDI jobOptions generated on Fri Jul 17 16:30:35 2015 #-- Contains event types : #-- 11102202 - 178 files - 3032774 events - 655.11 GBytes #-- Extra information about the data processing phases: #-- Processing Pass Step-124834 #-- StepId : 124834 #-- StepName : Reco14a for MC #-- ApplicationName : ...
mit
gymnasium/edx-platform
common/test/acceptance/pages/lms/discussion.py
11
29079
from contextlib import contextmanager from bok_choy.javascript import wait_for_js from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise from common.test.acceptance.pages.common.utils import hover from common.test.acceptance.pages.lms.course_page import CoursePage from common.test.accep...
agpl-3.0
utds3lab/pemu
scripts/tracetool/backend/dtrace.py
94
2484
#!/usr/bin/env python # -*- coding: utf-8 -*- """ DTrace/SystemTAP backend. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __e...
gpl-2.0
cbertinato/pandas
pandas/tests/io/test_packers.py
1
33090
import datetime from distutils.version import LooseVersion import glob from io import BytesIO import os from warnings import catch_warnings import numpy as np import pytest from pandas._libs.tslib import iNaT from pandas.errors import PerformanceWarning import pandas from pandas import ( Categorical, DataFrame, ...
bsd-3-clause
maleficarium/youtube-dl
youtube_dl/extractor/cbsnews.py
3
3855
# encoding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from .cbs import CBSBaseIE from ..utils import ( parse_duration, ) class CBSNewsIE(CBSBaseIE): IE_DESC = 'CBS News' _VALID_URL = r'https?://(?:www\.)?cbsnews\.com/(?:news|videos)/(?P<id>[\da-z_-]+)' _TESTS = ...
unlicense
wengyian/project-manager-system
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
1283
65086
# 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. """ This module contains classes that help to emulate xcodebuild behavior on top of other build systems, such as make and ninja. """ import copy import gyp.common...
mit
yiheng/BigDL
spark/dl/src/test/resources/tf/models/rnn.py
9
1652
# # Copyright 2016 The BigDL Authors. # # 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 ...
apache-2.0
poo12138/gem5-stable
src/arch/x86/isa/insts/general_purpose/control_transfer/__init__.py
91
2404
# 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
xzturn/tensorflow
tensorflow/lite/micro/examples/magic_wand/train/data_prepare.py
19
5911
# Lint as: python3 # coding=utf-8 # Copyright 2019 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-...
apache-2.0
edx/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/test_client_regress/views.py
50
4115
from django.conf import settings from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseRedirect from django.core.exceptions import SuspiciousOperation from django.shortcuts import render_to_response from django.utils import simplejson from django.utils.encoding impo...
gpl-3.0
jjhelmus/scipy
scipy/stats/tests/test_discrete_basic.py
38
8770
from __future__ import division, print_function, absolute_import import numpy.testing as npt import numpy as np from scipy._lib.six import xrange from scipy import stats from common_tests import (check_normalization, check_moment, check_mean_expect, check_var_expect, check_skew_expect, ...
bsd-3-clause
4shadoww/hakkuframework
core/lib/whois/__init__.py
3
2563
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from __future__ import division from future import standard_library standard_library.install_aliases() from builtins import * import re import sys import os import subprocess import socket from .parser i...
mit
atcoin/atcoin
share/qt/extract_strings_qt.py
2945
1844
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
mit
Funky7Monkey/WargamingAPI.py
WargamingAPI/enums.py
1
1356
""" The MIT License (MIT) Copyright (c) 2017 Funky7Monkey 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, modify, merge,...
mit
hosseinmh/jango_learning
.venv/lib/python2.7/site-packages/django/conf/locale/zh_Hans/formats.py
1008
1810
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y年n月j日' # 2016年9月5...
mit
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/GL/APPLE/ycbcr_422.py
9
3045
'''OpenGL extension APPLE.ycbcr_422 This module customises the behaviour of the OpenGL.raw.GL.APPLE.ycbcr_422 to provide a more Python-friendly API Overview (from the spec) This extension provides a method for GL to read, store and optionally process textures that are defined in Y'CbCr 422 video formats. This ...
gpl-3.0
abhattad4/Digi-Menu
digimenu2/tests/migrations/models.py
386
1780
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps.registry import Apps from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class CustomModelBase(models.base.ModelBase): pass class ModelWithCustomBase(six.with_met...
bsd-3-clause
jmagnusson/flask-admin
examples/geo_alchemy/app.py
39
2044
from flask import Flask from flask_sqlalchemy import SQLAlchemy import flask_admin as admin from geoalchemy2.types import Geometry from flask_admin.contrib.geoa import ModelView # Create application app = Flask(__name__) app.config.from_pyfile('config.py') db = SQLAlchemy(app) class Point(db.Model): id = db.Co...
bsd-3-clause
offlinehacker/pyfilesystem
fs/osfs/watch_win32.py
10
16983
""" fs.osfs.watch_win32 =================== Change watcher support for OSFS, using ReadDirectoryChangesW on win32. """ import os import sys import errno import threading import Queue import stat import struct import ctypes import ctypes.wintypes import traceback import weakref try: LPVOID = ctypes.wintypes.LPVO...
bsd-3-clause
40223209/test
static/Brython3.1.3-20150514-095342/Lib/unittest/case.py
743
48873
"""Test case implementation""" import sys import functools import difflib import pprint import re import warnings import collections from . import result from .util import (strclass, safe_repr, _count_diff_all_purpose, _count_diff_hashable) __unittest = True DIFF_OMITTED = ('\nDiff is %s charact...
agpl-3.0
kdwink/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/db/backends/mysql/introspection.py
624
1426
from MySQLdb.constants import FIELD_TYPE from django.contrib.gis.gdal import OGRGeomType from django.db.backends.mysql.introspection import DatabaseIntrospection class MySQLIntrospection(DatabaseIntrospection): # Updating the data_types_reverse dictionary with the appropriate # type for Geometry fields. d...
apache-2.0
franky88/emperioanimesta
env/Lib/site-packages/django/contrib/admin/options.py
27
83212
from __future__ import unicode_literals import copy import json import operator from collections import OrderedDict from functools import partial, reduce, update_wrapper from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import helpers, widgets from...
gpl-3.0
kamyu104/LeetCode
Python/design-phone-directory.py
2
1688
# init: Time: O(n), Space: O(n) # get: Time: O(1), Space: O(1) # check: Time: O(1), Space: O(1) # release: Time: O(1), Space: O(1) class PhoneDirectory(object): def __init__(self, maxNumbers): """ Initialize your data structure here @param maxNumbers - The maximum numbers that...
mit
nafex/pyload
module/network/Browser.py
40
4190
#!/usr/bin/env python # -*- coding: utf-8 -*- from logging import getLogger from HTTPRequest import HTTPRequest from HTTPDownload import HTTPDownload class Browser(object): __slots__ = ("log", "options", "bucket", "cj", "_size", "http", "dl") def __init__(self, bucket=None, options={}): self.log = ...
gpl-3.0
qrealka/skia-hc
third_party/externals/shaderc2/utils/remove-file-by-suffix.py
16
1028
#!/usr/bin/env python # Copyright 2015 The Shaderc 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...
apache-2.0
trevor/calendarserver
txdav/carddav/datastore/query/test/test_filter.py
1
3060
## # Copyright (c) 2011-2014 Apple 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 l...
apache-2.0
guerrerocarlos/fiware-IoTAgent-Cplusplus
third_party/gmock-1.7.0/test/gmock_test_utils.py
769
3684
#!/usr/bin/env python # # Copyright 2006, 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...
agpl-3.0
Alexoner/web-crawlers
scripts/12306/12306.py
1
63121
#!/usr/bin/env python2 # -*- encoding: utf-8 -*- # standard library import argparse import ConfigParser import datetime import sys import random import re import time import urllib # third party library import requests # customized libarary from utils import hasKeys,dumpObj # set default encoding to UTF-8 reload(sy...
gpl-2.0
msleal/amspy
amspy/examples/create_streaming_endpoint.py
2
2523
""" Copyright (c) 2016, Marcelo Leal Description: Simple Azure Media Services Python library License: MIT (see LICENSE.txt file for details) """ import os import json import amspy import time import logging import datetime ########################################################################################### ####...
mit
oudalab/phyllo
phyllo/extractors/hydatiusDB.py
1
5254
import sqlite3 import urllib import re from urllib.request import urlopen from bs4 import BeautifulSoup from phyllo.phyllo_logger import logger def getBooks(soup): siteURL = 'http://www.thelatinlibrary.com' textsURL = [] # get links to books in the collection for a in soup.find_all('a', href=True): ...
apache-2.0
fheinle/Photoblog
gdata/tlslite/TLSConnection.py
278
70347
""" MAIN CLASS FOR TLS LITE (START HERE!). """ from __future__ import generators import socket from utils.compat import formatExceptionTrace from TLSRecordLayer import TLSRecordLayer from Session import Session from constants import * from utils.cryptomath import getRandomBytes from errors import * from messages impor...
gpl-3.0
nmercier/linux-cross-gcc
linux/lib/python2.7/compiler/transformer.py
176
53108
"""Parse tree transformation module. Transforms Python source code into an abstract syntax tree (AST) defined in the ast module. The simplest ways to invoke this module are via parse and parseFile. parse(buf) -> AST parseFile(path) -> AST """ # Original version written by Greg Stein (gstein@lyra.org) # ...
bsd-3-clause
buuck/root
interpreter/cling/tools/Jupyter/kernel/clingkernel.py
9
11312
#!/usr/bin/env python #------------------------------------------------------------------------------ # CLING - the C++ LLVM-based InterpreterG :) # author: Min RK # Copyright (c) Min RK # # This file is dual-licensed: you can choose to license it under the University # of Illinois Open Source License or the GNU Lesse...
lgpl-2.1
rds0751/colinkers
env/Lib/site-packages/django/conf/locale/pt_BR/formats.py
504
1434
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = '...
agpl-3.0
kangfend/django
django/contrib/staticfiles/management/commands/findstatic.py
463
1745
from __future__ import unicode_literals import os from django.contrib.staticfiles import finders from django.core.management.base import LabelCommand from django.utils.encoding import force_text class Command(LabelCommand): help = "Finds the absolute paths for the given static file(s)." label = 'static file...
bsd-3-clause
cjmayo/xbmc
tools/EventClients/Clients/Kodi Send/kodi-send.py
10
2592
#!/usr/bin/python # # XBMC Media Center # XBMC Send # Copyright (c) 2009 team-xbmc # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any la...
gpl-2.0
SanPen/GridCal
src/GridCal/Gui/TowerBuilder/LineBuilderDialogue.py
1
9842
# This file is part of GridCal. # # GridCal 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. # # GridCal is distributed in the hope that...
gpl-3.0
rbalda/neural_ocr
env/lib/python2.7/site-packages/django/contrib/admin/sites.py
120
21146
from functools import update_wrapper from django.apps import apps from django.conf import settings from django.contrib.admin import ModelAdmin, actions from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.core.urlresolvers import NoRe...
mit
yawd/django-sphinxdoc
sphinxdoc/management/commands/updatedoc.py
1
4830
# encoding: utf-8 """ Management command for updading the documentation of one or more projects. """ import json import optparse import os import os.path import subprocess from django.core.management import call_command from django.core.management.base import BaseCommand, CommandError from sphinxdoc.models import Pr...
bsd-3-clause
rasata/ansible
lib/ansible/plugins/connections/jail.py
131
7291
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com> # (c) 2013, Michael Scherer <misc@zarb.org> # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it...
gpl-3.0
Phuehvk/gyp
test/mac/gyptest-depend-on-bundle.py
34
1270
#!/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. """ Verifies that a dependency on a bundle causes the whole bundle to be built. """ import TestGyp import sys if sys.platform == 'darwin'...
bsd-3-clause
krintoxi/NoobSec-Toolkit
NoobSecToolkit - MAC OSX/tools/inject/thirdparty/colorama/initialise.py
49
1222
import atexit import sys from .ansitowin32 import AnsiToWin32 orig_stdout = sys.stdout orig_stderr = sys.stderr wrapped_stdout = sys.stdout wrapped_stderr = sys.stderr atexit_done = False def reset_all(): AnsiToWin32(orig_stdout).reset_all() def init(autoreset=False, convert=None, strip=None, wrap=True): ...
gpl-2.0
vipmunot/Data-Analysis-using-Python
Exploratory Data Visualization/Multiple plots-216.py
1
2691
## 1. Recap ## import pandas as pd import matplotlib.pyplot as plt unrate = pd.read_csv('unrate.csv') unrate['DATE'] = pd.to_datetime(unrate['DATE']) plt.plot(unrate['DATE'].head(12),unrate['VALUE'].head(12)) plt.xticks(rotation=90) plt.xlabel('Month') plt.ylabel('Unemployment Rate') plt.title('Monthly Unemployment T...
mit
openstack/glance
glance/tests/unit/test_notifier.py
1
34473
# Copyright 2011 OpenStack Foundation # Copyright 2013 IBM Corp. # 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/LIC...
apache-2.0
ramadhane/odoo
addons/decimal_precision/__openerp__.py
261
1628
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
serverdensity/sd-agent-core-plugins
gunicorn/check.py
1
4768
# (C) Datadog, Inc. 2010-2017 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) """ Collects metrics from the gunicorn web server. http://gunicorn.org/ """ # stdlib import time # 3rd party import psutil # project from checks import AgentCheck class GUnicornCheck(AgentCheck): # Confi...
bsd-3-clause
stahnma/rpmdistro-gitoverlay
rdgo/utils.py
2
2141
#!/usr/bin/env python # # Copyright (C) 2015 Colin Walters <walters@verbum.org> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) an...
lgpl-2.1
d40223223/2015cdbg6team0622
static/Brython3.1.1-20150328-091302/Lib/heapq.py
628
18065
"""Heap queue algorithm (a.k.a. priority queue). Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always its smallest element. Usag...
gpl-3.0
theochem/horton
horton/meanfield/test/test_scf_cdiis.py
4
2038
# -*- coding: utf-8 -*- # HORTON: Helpful Open-source Research TOol for N-fermion systems. # Copyright (C) 2011-2017 The HORTON Development Team # # This file is part of HORTON. # # HORTON is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by th...
gpl-3.0
neilpelow/wmap-django
venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py
3127
1902
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
MQQiang/kbengine
kbe/res/scripts/common/Lib/xml/sax/xmlreader.py
824
12612
"""An XML Reader is the SAX 2 name for an XML parser. XML Parsers should be based on this code. """ from . import handler from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException # ===== XMLREADER ===== class XMLReader: """Interface for reading an XML document using callbacks. XMLReade...
lgpl-3.0
techdragon/django
tests/project_template/test_settings.py
23
1644
import os import shutil import unittest from django import conf from django.test import TestCase from django.utils import six from django.utils._os import upath @unittest.skipIf( six.PY2, 'Python 2 cannot import the project template because ' 'django/conf/project_template doesn\'t have an __init__.py fil...
bsd-3-clause
t-tran/libcloud
libcloud/test/loadbalancer/test_dimensiondata_v2_3.py
11
26689
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
NLeSC/cptm
cptm/utils/topics.py
1
1882
import pandas as pd def get_top_topic_words(topics, opinions, t, top=10): """Return dataframe containing top topics and opinions. Parameters t : str - index of topic number top : int - the number of words to store in the dataframe Returns Pandas DataFrame The DataFrame contains t...
apache-2.0
Oxygem/canaryd
canaryd_packages/requests/packages/chardet/latin1prober.py
1778
5232
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
tund/kaggle-galaxy-zoo
avg_result.py
1
2774
# Copyright (c) 2014, Tu Dinh Nguyen (nguyendinhtu@gmail.com) # 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 ...
bsd-3-clause
BAMitUp/Fantasy-Football-Shuffler
ENV/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py
2763
12628
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
chirilo/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/config/urls.py
117
3095
# 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
arxcruz/tempest-tool
tempestmail/tests/test_bugs.py
1
2571
import mock import unittest import tempestmail.bugs as bugs class TestBugs(unittest.TestCase): def setUp(self): self.bz_url = 'https://bugzilla.redhat.com/show_bug.cgi?id=1386421' self.lp_url = 'https://bugs.launchpad.net/tripleo/+bug/1634824' self.error_url = 'https://www.google.com' ...
gpl-3.0
victorbriz/sumatrapdf
scripts/trans_langs.py
16
5002
# List of languages we support, their iso codes and id as understood # by Windows SDK (LANG_* and SUBLANG_*_*). # See http://msdn.microsoft.com/en-us/library/dd318693.aspx for the full list. g_langs = [ ('af', 'Afrikaans', '_LANGID(LANG_AFRIKAANS)'), ('am', 'Armenian (Հայերեն)', '_LANGID(LANG_ARMENIAN)'),...
gpl-3.0
greenlion/mysql-server
storage/ndb/mcc/tst/unittest2/__init__.py
155
2406
""" unittest2 unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7. It is tested to run on Python 2.4 - 2.6. To use unittest2 instead of unittest simply replace ``import unittest`` with ``import unittest2``. Copyright (c) 1999-2003 Steve Purcell Copyright (c) 2003-2010 P...
gpl-2.0
AlperSaltabas/OR_Tools_Google_API
examples/python/volsay.py
34
1857
# Copyright 2011 Hakan Kjellerstrand hakank@bonetmail.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 applicable ...
apache-2.0
tibotic/simple-pokemongo-bot
pokemongo_bot/health_record/bot_event.py
17
2639
# -*- coding: utf-8 -*- from time import sleep import logging from raven import Client import raven import os import uuid import requests import time class BotEvent(object): def __init__(self, config): self.config = config self.logger = logging.getLogger(__name__) # UniversalAnalytics can ...
mit
andreasots/qrpth.eu
prism.py
1
2192
from server import app import datetime import psycopg2 import flask import pytz import re TIMEZONE = pytz.timezone("America/Vancouver") CONN = "postgres:///lrrbot" def convert_timezone(row): return (row[0], row[1], TIMEZONE.normalize(row[2].astimezone(TIMEZONE))) @app.route("/prism/") def prism(): with psyc...
gpl-2.0
Franky333/crazyflie-clients-python
src/cfclient/headless.py
1
6707
# -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 2013 Bitcraze AB # # Cr...
gpl-2.0
NaturalGIS/naturalgis_qgis
python/plugins/processing/modeler/ModelerScene.py
33
1934
# -*- coding: utf-8 -*- """ *************************************************************************** ModelerScene.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **************************...
gpl-2.0
rahul67/hue
desktop/core/ext-py/boto-2.38.0/boto/sdb/queryresultset.py
153
3674
from boto.compat import six # 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 t...
apache-2.0
imtapps/django-imt-fork
tests/regressiontests/expressions_regress/tests.py
46
15966
""" Spanning tests for all the operations that F() expressions can perform. """ from __future__ import absolute_import import datetime from django.db import connection from django.db.models import F from django.test import TestCase, Approximate, skipUnlessDBFeature from .models import Number, Experiment class Expr...
bsd-3-clause
Jank1310/gtest-mirror
test/gtest_color_test.py
3259
4911
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
factorlibre/OCB
addons/note/__openerp__.py
260
2182
# -*- 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
emilroz/openmicroscopy
components/tools/OmeroPy/src/path.py
1
34018
#!/usr/bin/env python # -*- coding: utf-8 -*- """ path.py - An object representing a path to a file or directory. Example: from path import path d = path('/home/guido/bin') for f in d.files('*.py'): f.chmod(0755) This module requires Python 2.2 or later. URL: http://www.jorendorff.com/articles/python/path ...
gpl-2.0
cloud9UG/odoo
doc/conf.py
184
8222
# -*- coding: utf-8 -*- import sys, os import sphinx # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. DIR = os.path.dirname(__file...
agpl-3.0
dwfreed/mitmproxy
test/mitmproxy/console/test_pathedit.py
4
2245
import os from os.path import normpath from mitmproxy.tools.console import pathedit from mitmproxy.test import tutils from unittest.mock import patch class TestPathCompleter: def test_lookup_construction(self): c = pathedit._PathCompleter() cd = os.path.normpath(tutils.test_data.path("mitmproxy...
mit
veltzer/demos-python
src/examples/short/parsing/math_expression.py
1
1056
#!/usr/bin/env python import pprint import sys import simpleparse.dispatchprocessor declaration = r'''# note use of raw string when embedding in python code... full := ws,expr,ws number := [0-9eE+.-]+ expr := number,'+',number/number,'-',number ws := [ \t\v]* ''' class MyProcessorClass(...
gpl-3.0
sfepy/sfepy
examples/linear_elasticity/dispersion_analysis.py
2
35004
#!/usr/bin/env python """ Dispersion analysis of a heterogeneous finite scale periodic cell. The periodic cell mesh has to contain two subdomains Y1 (with the cell ids 1), Y2 (with the cell ids 2), so that different material properties can be defined in each of the subdomains (see ``--pars`` option). The command line ...
bsd-3-clause
rajanandakumar/DIRAC
FrameworkSystem/private/monitoring/Activity.py
19
3551
# $HeadURL$ __RCSID__ = "$Id$" import types from string import Template class Activity: dbFields = [ 'activities.unit', 'activities.type', 'activities.description', 'activities.filename', 'activities.bucketLength', 'sources.site', ...
gpl-3.0
ging/horizon
openstack_dashboard/dashboards/admin/defaults/tables.py
9
2665
# Copyright 2013 Kylin, 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...
apache-2.0
pplatek/odoo
addons/portal/mail_thread.py
390
2004
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-TODAY OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
jfmartinez64/test
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/vine.py
25
3373
from __future__ import unicode_literals import re import json import itertools from .common import InfoExtractor from ..utils import unified_strdate class VineIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?vine\.co/v/(?P<id>\w+)' _TEST = { 'url': 'https://vine.co/v/b9KOOWX7HUx', 'md5':...
gpl-3.0
etetoolkit/ete
ete3/tools/ete_build_lib/task/uhire.py
4
4331
from __future__ import absolute_import # #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU Gener...
gpl-3.0
CEG-FYP-OpenStack/scheduler
nova/api/openstack/compute/legacy_v2/contrib/rescue.py
5
3852
# Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
HazenBabcock/opensdraw
opensdraw/scripts/list_parts_in_mpd.py
1
3902
#!/usr/bin/env python """ Lists all the unique parts and their colors in a .mpd file. This is sometimes useful for determining the name of a part and/or a color. Hazen 04/15 """ import os import re import sys import opensdraw.lcad_lib.datFileParser as datFileParser if (len(sys.argv) != 2): print("usage: <ldraw ...
mit
tectronics/timeside
tests/test_yaafe.py
2
2645
#! /usr/bin/env python from unit_timeside import * from timeside.decoder import * from timeside.analyzer import Yaafe from yaafelib import DataFlow,FeaturePlan class TestYaafe(unittest.TestCase): def setUp(self): self.sample_rate = 16000 def testOnSweepWithFeaturePlan(self): "runs on sweep a...
gpl-2.0
harmy/kbengine
kbe/res/scripts/common/Lib/cgi.py
3
35512
#! /usr/local/bin/python # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is # intentionally NOT "/usr/bin/env python". On many systems # (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI # scripts, and /usr/local/bin is the default directory where Python is # installed, so /usr/bin...
lgpl-3.0
adrgerez/ardublockly
package/wxcef_build/pack_ardublockly_wxcef.py
4
9610
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # # Creates a zip file of the self executable Ardublockly application. # # Copyright (c) 2015 carlosperate https://github.com/carlosperate/ # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licen...
apache-2.0
tosolveit/scikit-learn
sklearn/datasets/lfw.py
141
19372
"""Loader for the Labeled Faces in the Wild (LFW) dataset This dataset is a collection of JPEG pictures of famous people collected over the internet, all details are available on the official website: http://vis-www.cs.umass.edu/lfw/ Each picture is centered on a single face. The typical task is called Face Veri...
bsd-3-clause
illicitonion/givabit
lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_2/tests/modeltests/validation/tests.py
50
5106
from django import forms from django.test import TestCase from django.core.exceptions import NON_FIELD_ERRORS from modeltests.validation import ValidationTestCase from modeltests.validation.models import Author, Article, ModelToValidate # Import other tests for this package. from modeltests.validation.validators impor...
apache-2.0
b3j0f/schema
b3j0f/schema/test/registry.py
1
6783
#!/usr/bin/env python # -*- coding: utf-8 -*- # -------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2016 Jonathan Labéjof <jonathan.labejof@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and assoc...
mit
memakura/s2a_fm
Snap!Files/Snap!Mobile/arduino/serial/urlhandler/protocol_loop.py
141
9516
#! python # # Python Serial Port Extension for Win32, Linux, BSD, Jython # see __init__.py # # This module implements a loop back connection receiving itself what it sent. # # The purpose of this module is.. well... You can run the unit tests with it. # and it was so easy to implement ;-) # # (C) 2001-2011 Chris Liecht...
gpl-3.0
pleaseproject/python-for-android
python3-alpha/python3-src/Lib/wsgiref/simple_server.py
51
4859
"""BaseHTTPServer that implements the Python WSGI protocol (PEP 3333) This is both an example of how WSGI can be implemented, and a basis for running simple web applications on a local machine, such as might be done when testing or debugging an application. It has not been reviewed for security issues, however, and w...
apache-2.0
ASCrookes/django
django/contrib/gis/db/backends/mysql/operations.py
328
2746
from django.contrib.gis.db.backends.base.adapter import WKTAdapter from django.contrib.gis.db.backends.base.operations import \ BaseSpatialOperations from django.contrib.gis.db.backends.utils import SpatialOperator from django.contrib.gis.db.models import aggregates from django.db.backends.mysql.operations import D...
bsd-3-clause
vmp32k/litecoin
contrib/devtools/update-translations.py
23
8426
#!/usr/bin/env python3 # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script from the root of the repository to update all translations from transifex. It will do the foll...
mit