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
praveenkumar/ansible
lib/ansible/plugins/lookup/password.py
32
5268
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com> # (c) 2013, Javier Candeira <javier@candeira.com> # (c) 2013, Maykel Moya <mmoya@speedyrails.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...
gpl-3.0
open-austin/capture
distance.py
1
4386
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, print_function import argparse import glob import os import numpy as np import pandas as pd from geopy.distance import vincenty as point_distance def ingest(fn, route_id, begin_latlng, end_latlng): df = pd.read_csv(fn, parse_dates=[...
gpl-3.0
wenhuizhang/swift
test/unit/obj/test_auditor.py
11
27236
# Copyright (c) 2010-2012 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 agree...
apache-2.0
borg-project/borg
borg/unix/accounting.py
1
8038
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os import select import signal import datetime import collections import borg log = borg.get_logger(__name__) class SessionTimeAccountant(object): """ Track the total CPU (user) time for members of a session. Process accounting under Linux is ...
mit
tqchen/tvm
tutorials/language/schedule_primitives.py
3
7722
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
PersonalGenomesOrg/american-gut-web
amgut/handlers/base_handlers.py
2
4035
import logging from tornado.web import RequestHandler, StaticFileHandler from amgut import media_locale, text_locale from amgut.connections import ag_data from amgut.lib.config_manager import AMGUT_CONFIG from amgut.lib.mail import send_email class BaseHandler(RequestHandler): def get_current_user(self): ...
bsd-3-clause
jbedorf/tensorflow
tensorflow/python/tpu/xla.py
3
3936
# 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
arenadata/ambari
ambari-server/src/main/resources/stacks/BigInsights/4.2.5/services/HDFS/package/scripts/params.py
1
1253
""" 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
ressu/SickGear
lib/unidecode/x09a.py
253
4623
data = ( 'E ', # 0x00 'Cheng ', # 0x01 'Xin ', # 0x02 'Ai ', # 0x03 'Lu ', # 0x04 'Zhui ', # 0x05 'Zhou ', # 0x06 'She ', # 0x07 'Pian ', # 0x08 'Kun ', # 0x09 'Tao ', # 0x0a 'Lai ', # 0x0b 'Zong ', # 0x0c 'Ke ', # 0x0d 'Qi ', # 0x0e 'Qi ', # 0x0f 'Yan ', # 0x10 'Fei '...
gpl-3.0
sunjincheng121/flink
flink-python/pyflink/ml/tests/test_pipeline_it_case.py
2
7370
################################################################################ # 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...
apache-2.0
pymo/pymo
symbian/PythonForS60_1.9.6/module-repo/standard-modules/xml/dom/minicompat.py
76
3329
"""Python version compatibility support for minidom.""" # This module should only be imported using "import *". # # The following names are defined: # # NodeList -- lightest possible NodeList implementation # # EmptyNodeList -- lightest possible NodeList that is guarateed to # remain empty ...
mit
geosolutions-it/geonode
geonode/base/management/commands/delete_resources.py
4
5949
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2018 OSGeo # # 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 ...
gpl-3.0
Velmont/medlemssys
medlemssys/innhenting/management/commands/medlem_import.py
2
3483
# -*- coding: utf-8 -*- # vim: shiftwidth=4 tabstop=4 expandtab softtabstop=4 ai # Copyright 2009-2014 Odin Hørthe Omdal # This file is part of Medlemssys. # Medlemssys 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 Sof...
agpl-3.0
pudo/archivekit
archivekit/store/s3.py
1
4834
import os from urllib2 import urlopen from boto.s3.connection import S3Connection, S3ResponseError from boto.s3.connection import Location from archivekit.store.common import Store, StoreObject, MANIFEST DELIM = os.path.join(' ', ' ').strip() ALL_USERS = 'http://acs.amazonaws.com/groups/global/AllUsers' class S3St...
mit
supertcy/mt_kernel
tools/perf/scripts/python/failed-syscalls-by-pid.py
34
2054
# failed 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 failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
GladeRom/android_external_chromium_org
third_party/closure_compiler/checker.py
28
7969
#!/usr/bin/python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs Closure compiler on a JavaScript file to check for errors.""" import argparse import os import re import subprocess import sys imp...
bsd-3-clause
EzyInsights/Diamond
src/collectors/cpu/test/testcpu.py
30
8004
#!/usr/bin/python # coding=utf-8 ########################################################################## from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch try: from cStringIO import StringIO except ImportError: fr...
mit
turbokongen/home-assistant
script/scaffold/templates/config_flow_oauth2/integration/api.py
2
1844
"""API for NEW_NAME bound to Home Assistant OAuth.""" from asyncio import run_coroutine_threadsafe from aiohttp import ClientSession import my_pypi_package from homeassistant import core from homeassistant.helpers import config_entry_oauth2_flow # TODO the following two API examples are based on our suggested best p...
apache-2.0
phammin1/QaManagement
QaManagement/env/Lib/site-packages/pip/_vendor/requests/status_codes.py
926
3200
# -*- coding: utf-8 -*- from .structures import LookupDict _codes = { # Informational. 100: ('continue',), 101: ('switching_protocols',), 102: ('processing',), 103: ('checkpoint',), 122: ('uri_too_long', 'request_uri_too_long'), 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'...
mit
MohammedWasim/scikit-learn
sklearn/decomposition/tests/test_online_lda.py
21
13171
import numpy as np from scipy.linalg import block_diag from scipy.sparse import csr_matrix from scipy.special import psi from sklearn.decomposition import LatentDirichletAllocation from sklearn.decomposition._online_lda import (_dirichlet_expectation_1d, _dirichlet_expect...
bsd-3-clause
FHannes/intellij-community
plugins/hg4idea/testData/bin/mercurial/templatekw.py
92
13228
# templatekw.py - common changeset template keywords # # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from node import hex import patch, util, error import hbisect # This help...
apache-2.0
DonHilborn/DataGenerator
faker/providers/es_MX/company.py
1
8627
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from ..company import Provider as CompanyProvider class Provider(CompanyProvider): formats = ( '{{last_name}} {{company_suffix}}', '{{last_name}}-{{last_name}}', '{{company_prefix}} {{last_name}}-{{last_name}}', '{{c...
mit
yqm/sl4a
python/src/Tools/faqwiz/faqconf.py
44
15122
"""FAQ Wizard customization module. Edit this file to customize the FAQ Wizard. For normal purposes, you should only have to change the FAQ section titles and the small group of parameters below it. """ # Titles of FAQ sections SECTION_TITLES = { # SectionNumber : SectionTitle; need at least one entry 1: "...
apache-2.0
kose-y/pylearn2
pylearn2/costs/autoencoder.py
34
6161
""" Costs related to autoencoders. """ from functools import wraps from theano.tensor.shared_randomstreams import RandomStreams from theano import tensor import theano.sparse from pylearn2.costs.cost import Cost, DefaultDataSpecsMixin class GSNFriendlyCost(DefaultDataSpecsMixin, Cost): """ A Cost that can ...
bsd-3-clause
cocoloco69/pynet
ANSIBLE/library/eos_vxlan.py
5
17103
#!/usr/bin/python # # Copyright (c) 2014, 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, # t...
apache-2.0
ThinkOpen-Solutions/odoo
addons/analytic_user_function/__openerp__.py
52
2069
# -*- 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
chrys87/orca-beep
src/orca/generator.py
1
43334
# Orca # # Copyright 2009 Sun Microsystems Inc. # # 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.1 of the License, or (at your option) any later version. # # This libr...
lgpl-2.1
peterheim1/robbie
bin/speech_text.py
1
2005
#!/usr/bin/env python # Author: Derek Green PKG = 'pocketsphinx' #import roslib; roslib.load_manifest(PKG) import rospy import re import os from std_msgs.msg import String from subprocess import Popen, PIPE class SpeechText(): def __init__(self): self.pub = rospy.Publisher('speech_text', String) ...
gpl-3.0
noppanit/sweepy
sweepy.py
1
3267
#!/usr/bin/env python import pymongo import tweepy from pymongo import MongoClient from sweepy.get_config import get_config config = get_config() consumer_key = config.get('PROCESS_TWITTER_CONSUMER_KEY') consumer_secret = config.get('PROCESS_TWITTER_CONSUMER_SECRET') access_token = config.get('PROCESS_TWITTER_ACCES...
mit
direvus/ansible
lib/ansible/utils/vars.py
29
5792
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
kaajavi/ninformes
escolar/test_dev.py
1
3482
from django.shortcuts import render_to_response from django.template import RequestContext import os from django.conf import settings from django.template import Context from django.template.loader import get_template from xhtml2pdf import pisa #INSTALAR ESTA LIBRERIA from django.templatetags.static import static from...
gpl-2.0
VinnieJohns/ggrc-core
src/ggrc/models/__init__.py
5
4561
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> import inspect import sqlalchemy as sa from ggrc import db from ggrc import settings from ggrc.models import inflector from ggrc.models.reflection import SanitizeHtmlInfo from ggrc.models.all_models import ...
apache-2.0
prutseltje/ansible
lib/ansible/modules/cloud/cloudstack/cs_staticnat.py
29
7371
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
xiaoxiamii/scikit-learn
examples/cross_decomposition/plot_compare_cross_decomposition.py
128
4761
""" =================================== Compare cross decomposition methods =================================== Simple usage of various cross decomposition algorithms: - PLSCanonical - PLSRegression, with multivariate response, a.k.a. PLS2 - PLSRegression, with univariate response, a.k.a. PLS1 - CCA Given 2 multivari...
bsd-3-clause
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/scipy/linalg/_interpolative_backend.py
143
44935
#****************************************************************************** # Copyright (C) 2013 Kenneth L. Ho # # 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 t...
apache-2.0
cloudnull/genastack_roles
genastack_roles/nova_api_os_compute/__init__.py
1
1103
# ============================================================================= # Copyright [2013] [Kevin Carter] # License Information : # This software has no warranty, it is provided 'as is'. It is your # responsibility to validate the behavior of the routines and its accuracy # using the code provided. Consult the ...
gpl-3.0
burakbayramli/classnotes
algs/algs_175_ocr/tf/ctc.py
2
3275
from __future__ import absolute_import from __future__ import division import numpy as np import tensorflow as tf from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import errors_impl from tensorflow.python.framework import sparse_tensor ...
gpl-3.0
debkbanerji/super-mem
ocrtest/myenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py
1776
6840
######################## 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
rupran/ansible
lib/ansible/modules/network/nxos/nxos_ospf.py
26
5598
#!/usr/bin/python # # 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 distribut...
gpl-3.0
kitsunde/ansible
lib/ansible/plugins/shell/sh.py
20
6337
# (c) 2014, Chris Church <chris@ninemoreminutes.com> # # This file is part of Ansible. # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
svenfraeys/sftoolbox
sftoolboxmaya/widgets.py
1
1480
import sftoolboxmaya.utils from sftoolboxqt import qtgui from sftoolboxqt.widgets import ProjectWidget class MayaProjectWidget(sftoolboxmaya.utils.DialogWidget): """toolbox widget """ def _wrapped_set_window_title(self, func): """wrap for the set window title to keep it synced """ ...
mit
kennho/oppia
core/domain/recommendations_services_test.py
2
17960
# coding: utf-8 # # Copyright 2015 The Oppia 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 requi...
apache-2.0
seem-sky/kbengine
kbe/res/scripts/common/Lib/encodings/cp865.py
272
34618
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP865.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_map) def decode(self,input,errors='strict'): ...
lgpl-3.0
RyanofRIT/DjangoWebsite
HealthNet/HealthNet/urls.py
1
2087
from django.conf.urls import include, url, patterns from django.contrib import admin from HealthApp import views """ The urlpatterns is how we map the site urls to specific views in the views.py. The first part is a regular expression to describe the url pattern, followed by the view that should be called. Lastly, a n...
gpl-2.0
chuan9/chromium-crosswalk
tools/json_to_struct/struct_generator_test.py
38
2642
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from struct_generator import GenerateField from struct_generator import GenerateStruct import unittest class StructGeneratorTest(u...
bsd-3-clause
XinSong/blaze
blaze/compute/llgetitem.py
7
11586
from __future__ import absolute_import, division, print_function from .llvm_array import (array_type, const_intp, auto_const_intp, intp_type, int_type, store_at, load_at, get_shape_ptr, get_data_ptr, get_strides_ptr, sizeof, isinteger, isiterab...
bsd-3-clause
vasyarv/edx-platform
lms/djangoapps/instructor_task/tests/test_base.py
107
14772
""" Base test classes for LMS instructor-initiated background tasks """ import os import json from mock import Mock import shutil import unicodecsv from uuid import uuid4 from celery.states import SUCCESS, FAILURE from django.core.urlresolvers import reverse from django.conf import settings from django.test.testcases...
agpl-3.0
williamfeng323/py-web
flask/lib/python3.6/site-packages/migrate/changeset/ansisql.py
74
11422
""" Extensions to SQLAlchemy for altering existing tables. At the moment, this isn't so much based off of ANSI as much as things that just happen to work with multiple databases. """ import sqlalchemy as sa from sqlalchemy.schema import SchemaVisitor from sqlalchemy.engine.default import DefaultDialect from ...
mit
LEAMgroup/leam.stress
leam/stress/interfaces/stressanalysis.py
1
1042
from zope.interface import Interface # -*- Additional Imports Here -*- from zope import schema from leam.stress import stressMessageFactory as _ class IStressAnalysis(Interface): """Frontend to the LEAM Stress Analysis Model""" # -*- schema definition goes here -*- layer = schema.Object( title=...
gpl-2.0
fivejjs/PTVS
Python/Tests/TestData/Grammar/DedentErrorLargeFile.py
18
3050
# On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks. When you create pictures, charts, or diagrams, they also coordinate with your ...
apache-2.0
snehasi/servo
components/script/dom/bindings/codegen/parser/tests/test_bytestring.py
118
3772
# -*- coding: UTF-8 -*- import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface TestByteString { attribute ByteString bs; attribute DOMString ds; }; """) results = parser.finish(); harness.ok(True, "TestByteString interface parsed without error...
mpl-2.0
JasonTam/keras
tests/auto/keras/test_constraints.py
78
2446
import unittest import numpy as np from numpy.testing import assert_allclose from theano import tensor as T class TestConstraints(unittest.TestCase): def setUp(self): self.some_values = [0.1, 0.5, 3, 8, 1e-7] np.random.seed(3537) self.example_array = np.random.random((100, 100)) * 100. - 5...
mit
artemh/asuswrt-merlin
release/src/router/samba36/lib/dnspython/tests/set.py
21
5264
# 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 ...
gpl-2.0
MarsSnail/gyp_tools
test/mac/gyptest-postbuild.py
345
1708
#!/usr/bin/env python # Copyright (c) 2011 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 postbuild steps work. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.TestGyp(formats=['nin...
bsd-3-clause
milinbhakta/flaskmaterialdesign
venv/Lib/encodings/aliases.py
726
15414
""" Encoding Aliases Support This module is used by the encodings package search function to map encodings names to module names. Note that the search function normalizes the encoding names before doing the lookup, so the mapping will have to map normalized encoding names to module names. Con...
gpl-2.0
Desarrollo-CeSPI/meran
dev-plugins/node/lib/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/make.py
9
87838
# 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. # Notes: # # This is all roughly based on the Makefile system used by the Linux # kernel, but is a non-recursive make -- we put the entire dependency # graph in fr...
gpl-3.0
minhlongdo/scipy
scipy/weave/accelerate_tools.py
97
12946
#**************************************************************************# #* FILE ************** accelerate_tools.py ************************# #**************************************************************************# #* Author: Patrick Miller February 9 2002 *# #***********...
bsd-3-clause
ventrixcode/yowsup
yowsup/env/env_s40.py
4
1209
from .env import YowsupEnv import hashlib class S40YowsupEnv(YowsupEnv): _VERSION = "2.16.11" _OS_NAME= "S40" _OS_VERSION = "14.26" _DEVICE_NAME = "302" _MANUFACTURER = "Nokia" _TOKEN_STRING = "PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk1478194306452{phone}" _AXOLOTL = True def getVersion...
gpl-3.0
dereulenspiegel/spotimc
resources/libs/spotimcgui/views/__init__.py
1
7854
''' Copyright 2011 Mikel Azkolain This file is part of Spotimc. Spotimc 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. Spotimc ...
gpl-3.0
anubhabsen/NotesKeeper
languages/pl.py
160
6719
# coding: utf8 { '!langcode!': 'pl', '!langname!': 'Polska', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyrażeniem postaci "pole1=\'nowawartość\'". Nie możesz uaktualnić lub usunąć wyników z JOIN:', '%s %%{row} delete...
mit
rlugojr/django
django/contrib/gis/gdal/geomtype.py
62
3175
from django.contrib.gis.gdal.error import GDALException class OGRGeomType: "Encapsulate OGR Geometry Types." wkb25bit = -2147483648 # Dictionary of acceptable OGRwkbGeometryType s and their string names. _types = {0: 'Unknown', 1: 'Point', 2: 'LineString', 3...
bsd-3-clause
mitocw/edx-platform
common/test/acceptance/tests/helpers.py
3
37454
""" Test helper functions and base classes. """ import functools import inspect import io import json import operator import os import pprint import sys from contextlib import contextmanager from datetime import datetime from unittest import SkipTest, TestCase import requests import six from bok_choy.javascript impo...
agpl-3.0
ity/pants
tests/python/pants_test/base/test_pants_ignore_scm.py
3
1299
# coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import subprocess im...
apache-2.0
meeza/PythonWork
SearchEngines/crawler.py
1
1625
import urllib def get_page(url): try: return urllib.urlopen(url).read() except: return "" def get_next_target(page): start_link = page.find('<a href=') if start_link == -1: return None, 0 start_quote = page.find('"', start_link) end_quote = page.find('"', start_qu...
mit
radhikabhanu/crowdsource-platform
crowdsourcing/serializers/worker.py
2
8045
__author__ = 'elsabakiu, dmorina, neilthemathguy, megha, asmita' from crowdsourcing import models from rest_framework import serializers from crowdsourcing.serializers.template import TemplateItemSerializer from crowdsourcing.serializers.dynamic import DynamicFieldsModelSerializer from rest_framework.exceptions import...
mit
rbalda/neural_ocr
env/lib/python2.7/site-packages/numpy/fft/fftpack.py
72
45497
""" Discrete Fourier Transforms Routines in this module: fft(a, n=None, axis=-1) ifft(a, n=None, axis=-1) rfft(a, n=None, axis=-1) irfft(a, n=None, axis=-1) hfft(a, n=None, axis=-1) ihfft(a, n=None, axis=-1) fftn(a, s=None, axes=None) ifftn(a, s=None, axes=None) rfftn(a, s=None, axes=None) irfftn(a, s=None, axes=None...
mit
Brainbuster/openpli-buildumgebung
openembedded-core/scripts/contrib/verify-homepage.py
5
2175
#!/usr/bin/env python # This script is used for verify HOMEPAGE. # The result is influenced by network environment, since the timeout of connect url is 5 seconds as default. import sys import os import subprocess import urllib2 def search_bitbakepath(): bitbakepath = "" # Search path to bitbake lib dir in o...
gpl-2.0
frankiecjunle/yunblog
venv/lib/python2.7/site-packages/pip/req/req_uninstall.py
510
6897
from __future__ import absolute_import import logging import os import tempfile from pip.compat import uses_pycache, WINDOWS, cache_from_source from pip.exceptions import UninstallationError from pip.utils import rmtree, ask, is_local, renames, normalize_path from pip.utils.logging import indent_log logger = loggin...
mit
pawaranand/phrerp
erpnext/config/hr.py
28
4458
from frappe import _ def get_data(): return [ { "label": _("Documents"), "icon": "icon-star", "items": [ { "type": "doctype", "name": "Employee", "description": _("Employee records."), }, { "type": "doctype", "name": "Leave Application", "description": _("Applicati...
agpl-3.0
xthirtyfive/gamemod
log.py
1
1077
# Copyright 2013 X35 # # This file is part of gamemod. # # gamemod 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. # ...
gpl-3.0
jwhitlock/kuma
kuma/users/signal_handlers.py
1
4279
from allauth.account.signals import email_confirmed, user_signed_up from allauth.socialaccount.signals import social_account_removed from django.conf import settings from django.contrib import messages from django.core.exceptions import ObjectDoesNotExist from django.db.models.signals import post_delete, post_save from...
mpl-2.0
DataReplyUK/datareplyuk
GenesAssociation/spark-2.0.0-bin-hadoop2.7/examples/src/main/python/parquet_inputformat.py
34
2385
from __future__ import print_function # # 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...
apache-2.0
TEAM-Gummy/android_kernel_lge_mako
scripts/build-all.py
1182
9486
#! /usr/bin/env python # Copyright (c) 2009-2011, The Linux Foundation. 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 # ...
gpl-2.0
fti7/ansible-modules-core
system/ping.py
59
1667
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
gpl-3.0
baroquebobcat/pants
tests/python/pants_test/base/test_deprecated.py
5
6357
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import unittest impo...
apache-2.0
Samcbehrens/VisualAnalytics
dataProcessing/USTimeline.py
1
2413
import csv import datetime import json import calendar from timeline3 import convertToFile def convertTime(dateAsString): MillisecNum='' conv ='' if len(dateAsString)>4: conv = datetime.datetime.strptime(dateAsString, '%m/%d/%Y') MillisecNum = calendar.timegm(conv.timetuple()) else: numberAsInt = int(dateA...
bsd-3-clause
JRock007/boxxy
dist/Boxxy server.app/Contents/Resources/lib/python2.7/pygame/tests/run_tests__tests/print_stderr/fake_2_test.py
75
1178
if __name__ == '__main__': import sys import os pkg_dir = (os.path.split( os.path.split( os.path.split( os.path.abspath(__file__))[0])[0])[0]) parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'test...
mit
lodemo/CATANA
src/face_recognition/youtube_dl/extractor/skynewsarabia.py
83
5382
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import ( parse_iso8601, parse_duration, ) class SkyNewsArabiaBaseIE(InfoExtractor): _IMAGE_BASE_URL = 'http://www.skynewsarabia.com/web/images' def _call_api(self, p...
mit
okey/aduana
example/example/settings.py
2
1573
#-------------------------------------------------------------------------- # Scrapy Settings #-------------------------------------------------------------------------- BOT_NAME = 'example' SPIDER_MODULES = ['example.spiders'] NEWSPIDER_MODULE = 'example.spiders' HTTPCACHE_ENABLED = True REDIRECT_ENABLED = True COOK...
bsd-3-clause
godlzr/Three.js
utils/exporters/blender/addons/io_three/exporter/__init__.py
119
2708
import os import sys import traceback from .. import constants, logger, exceptions, dialogs from . import scene, geometry, api, base_classes def _error_handler(func): def inner(filepath, options, *args, **kwargs): level = options.get(constants.LOGGING, constants.DISABLED) version = options.ge...
mit
sshiting/electron
script/create-dist.py
65
5723
#!/usr/bin/env python import os import re import shutil import subprocess import sys import stat from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ get_target_arch, get_chromedriver_version from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \ ...
mit
eMerzh/Diamond-1
src/collectors/squid/squid.py
28
3046
# coding=utf-8 """ Collects data from squid servers #### Dependencies """ import re import socket import diamond.collector class SquidCollector(diamond.collector.Collector): def __init__(self, *args, **kwargs): self.host_pattern = re.compile("(([^@]+)@)?([^:]+)(:([0-9]+))?") self.stat_pattern...
mit
edhuckle/statsmodels
ez_setup.py
33
10432
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
bsd-3-clause
sapcc/monasca-notification
monasca_notification/plugins/jira_notifier.py
1
8896
# (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP # # 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
anthonyryan1/xbmc
lib/gtest/test/gtest_output_test.py
363
12259
#!/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...
gpl-2.0
DavidAndreev/indico
indico/MaKaC/webinterface/wcomponents.py
1
44542
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
c2g14/cda_0628
static/Brython3.1.1-20150328-091302/Lib/opcode.py
714
5442
""" opcode module - potentially shared between dis and other modules which operate on bytecodes (e.g. peephole optimizers). """ __all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs", "haslocal", "hascompare", "hasfree", "opname", "opmap", "HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs"] ...
agpl-3.0
gcblue/gcblue
bin/Lib/test/test_pep292.py
103
7682
# Copyright (C) 2004 Python Software Foundation # Author: barry@python.org (Barry Warsaw) # License: http://www.opensource.org/licenses/PythonSoftFoundation.php import unittest from string import Template class Bag: pass class Mapping: def __getitem__(self, name): obj = self for part in name...
bsd-3-clause
is06/navitia
source/eitri/docker_wrapper.py
2
4476
# Copyright (c) 2001-2015, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
agpl-3.0
Argon-Zhou/django
django/utils/regex_helper.py
432
12673
""" Functions for reversing a regular expression (used in reverse URL resolving). Used internally by Django and not intended for external use. This is not, and is not intended to be, a complete reg-exp decompiler. It should be good enough for a large class of URLS, however. """ from __future__ import unicode_literals ...
bsd-3-clause
aaabhilash97/google-python-exercises
basic/string2.py
1
2740
#!/usr/bin/python2.4 -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Additional basic string exercises # D. verbing # Given a string, if its length is a...
apache-2.0
zhaochl/python-utils
agrith_util/graph/g.py
1
9283
#!/usr/bin/env python # coding=utf-8 import pygraphviz as pgv from pdb import * gdata = [ ['A', '->', 'B',1], ['A', '->', 'C',1], ['B', '->', 'C',1], ['B', '->', 'D',1], ['C', '->', 'D',1], ['D', '->', '',1], ] graph = { 'A': ['B', 'C'], 'B': ['C', 'D'], 'C': ['D'], 'D':[] } def...
apache-2.0
XiaodunServerGroup/ddyedx
common/lib/xmodule/xmodule/tests/test_html_module.py
61
1377
import unittest from mock import Mock from xblock.field_data import DictFieldData from xmodule.html_module import HtmlModule from . import get_test_system class HtmlModuleSubstitutionTestCase(unittest.TestCase): descriptor = Mock() def test_substitution_works(self): sample_xml = '''%%USER_ID%%''' ...
agpl-3.0
valkjsaaa/sl4a
python/src/Lib/idlelib/PyParse.py
185
19510
import re import sys # Reason last stmt is continued (or C_NONE if it's not). (C_NONE, C_BACKSLASH, C_STRING_FIRST_LINE, C_STRING_NEXT_LINES, C_BRACKET) = range(5) if 0: # for throwaway debugging output def dump(*stuff): sys.__stdout__.write(" ".join(map(str, stuff)) + "\n") # Find what looks like the...
apache-2.0
ybellavance/python-for-android
python-build/python-libs/gdata/src/gdata/apps/migration/service.py
168
4519
#!/usr/bin/python # # Copyright (C) 2008 Google. # # 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
yvxiang/tera
src/benchmark/eva/run.py
2
14091
# Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. #!/usr/bin/env pythons import sys import subprocess import time import threading import traceback import json import signal from bin import eva...
bsd-3-clause
astrofrog/numpy
numpy/doc/constants.py
94
8888
""" ========= Constants ========= Numpy includes several constants: %(constant_list)s """ # # Note: the docstring is autogenerated. # import textwrap, re # Maintain same format as in numpy.add_newdocs constants = [] def add_newdoc(module, name, doc): constants.append((name, doc)) add_newdoc('numpy', 'Inf', ...
bsd-3-clause
edagar/censorship-analyser
tcpconnect.py
1
1629
# -*- coding: utf-8 -*- from twisted.internet.error import ConnectionRefusedError from ooni.utils import log from ooni.templates import tcpt from twisted.python import usage class UsageOptions(usage.Options): optParameters = [ ['target', 't', None, 'Specify a single host to test.'], ['port', 'p', ...
bsd-3-clause
epam-mooc/edx-platform
common/lib/xmodule/xmodule/tests/test_conditional.py
37
12428
import json import unittest from fs.memoryfs import MemoryFS from mock import Mock, patch from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from xmodule.error_module import NonStaffErrorDescriptor from opaque_keys.edx.locations import SlashSeparatedCourseKey, Location from xmodule.modules...
agpl-3.0
yjmade/odoo
openerp/report/render/rml2html/utils.py
438
2386
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2005, Fabien Pinckaers, UCL, FSA # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesse...
agpl-3.0