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
tshrinivasan/open-tamil
solthiruthi/dom.py
3
1718
## -*- coding: utf-8 -*- ## (C) 2015 Muthiah Annamalai, ## from __future__ import print_function import abc import codecs import re from tamil import utf8 from .datastore import Queue # DOM for documents class Position: __metaclass__ = abc.ABCMeta def __init__(self,row,col): self.row = row s...
mit
amirnissim/okqa
oshot/urls.py
1
1056
from django.conf import settings from django.conf.urls.defaults import patterns, include, url from django.conf.urls.static import static from django.views.generic import TemplateView from django.contrib import admin from entities.views.ui import EntityDetail, EntityList admin.autodiscover() urlpatterns = patterns('',...
bsd-3-clause
pgmillon/ansible
lib/ansible/modules/cloud/cloudstack/cs_securitygroup.py
38
5377
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # 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_version': '1.1', ...
gpl-3.0
zanph/zanph
flaskroulette/venv/lib/python2.7/site-packages/requests/models.py
187
29277
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
mit
biomassives/mezzanine
mezzanine/twitter/migrations/0001_initial.py
41
2426
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Query', fields=[ ('id', models.AutoField(verbos...
bsd-2-clause
ducthien1490/youtube-dl
youtube_dl/extractor/letv.py
78
7096
# coding: utf-8 from __future__ import unicode_literals import datetime import re import time from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, compat_urlparse, ) from ..utils import ( determine_ext, ExtractorError, parse_iso8601, int_or_n...
unlicense
samdoran/ansible
lib/ansible/modules/cloud/packet/packet_device.py
27
18500
#!/usr/bin/python # (c) 2016, Tomas Karasek <tom.to.the.k@gmail.com> # (c) 2016, Matt Baldwin <baldwin@stackpointcloud.com> # (c) 2016, Thibaud Morel l'Horset <teebes@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 P...
gpl-3.0
uw-it-aca/bridge-sis-provisioner
sis_provisioner/models/__init__.py
1
4704
import json from django.db import models from datetime import timedelta from django.utils import timezone from nameparser import HumanName GRACE_PERIOD = 180 def datetime_to_str(d_obj): if d_obj is not None: return d_obj.strftime("%Y-%m-%d %H:%M:%S") # +00:00 return None def get_now(): # retu...
apache-2.0
sunqb/oa_qian
flask/Lib/site-packages/pip/_vendor/requests/auth.py
149
8075
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import threading from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar from .utils import pa...
apache-2.0
arnif/CouchPotatoServer
couchpotato/core/plugins/library/main.py
3
5818
from couchpotato import get_session from couchpotato.core.event import addEvent, fireEventAsync, fireEvent from couchpotato.core.helpers.encoding import toUnicode, simplifyString from couchpotato.core.helpers.variable import mergeDicts from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import ...
gpl-3.0
sergiocorato/knowledge
document_page/document_page.py
7
5231
# -*- 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
firerszd/kbengine
kbe/src/lib/python/Lib/test/test_email/test_defect_handling.py
100
11325
import textwrap import unittest import contextlib from email import policy from email import errors from test.test_email import TestEmailBase class TestDefectsBase: policy = policy.default raise_expected = False @contextlib.contextmanager def _raise_point(self, defect): yield def test_s...
lgpl-3.0
IEEERobotics/bot
bot/hardware/servo.py
2
3170
"""Abstraction layer for servos.""" import time import bbb.pwm as pwm_mod import bot.lib.lib as lib class Servo(object): """Class for abstracting servo settings.""" def __init__(self, pwm_num): """Setup logger and PWM interface. :param pwm_num: PWM number used by this servo. :typ...
bsd-2-clause
olof/svtplay-dl
lib/svtplay_dl/tests/test_postprocess.py
1
6250
import os import unittest from svtplay_dl.fetcher import VideoRetriever from svtplay_dl.postprocess import _checktracks from svtplay_dl.postprocess import _getcodec from svtplay_dl.postprocess import _streams from svtplay_dl.postprocess import _sublanguage from svtplay_dl.service import Service from svtplay_dl.utils.p...
mit
imapp-pl/golem
tests/golem/transactions/test_incomeskeeper.py
1
6245
from golem.tools.testwithdatabase import TestWithDatabase from golem.tools.assertlogs import LogTestCase from golem.transactions.incomeskeeper import IncomesDatabase, IncomesKeeper, logger, IncomesState class TestIncomesDatabase(LogTestCase, TestWithDatabase): def test_init(self): id = IncomesDatabase() ...
gpl-3.0
miguelparaiso/OdooAccessible
addons/purchase/company.py
383
1576
# -*- 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
FantasticAndFlourishingWorld/sniff-app-client
lib/py/check_ip.py
2
3375
import re pattern_a1 = '^10(\.([2][0-4]\d|[2][5][0-5]|[01]?\d?\d)){3}$' pattern_a2 = '^100\.(6[4-9]|[7-9][0-9]|1[01][0-9]|12[07])(\.([2][0-4]\d|[2][5][0-5]|[01]?\d?\d)){2}$' pattern_b = '^172\.([1][6-9]|[2]\d|3[01])(\.([2][0-4]\d|[2][5][0-5]|[01]?\d?\d)){2}$' pattern_c = '^192\.168(\.([2][0-4]\d|[2][5][0-5]|[01]?\d?\...
gpl-3.0
c3nav/c3nav
src/c3nav/mapdata/render/engines/stl.py
1
1130
from itertools import chain import numpy as np from c3nav.mapdata.render.engines import register_engine from c3nav.mapdata.render.engines.base3d import Base3DEngine @register_engine class STLEngine(Base3DEngine): filetype = 'stl' facet_template = (b' facet normal %f %f %f\n' b' ou...
apache-2.0
as110/as110.github.io
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/manni.py
364
2374
# -*- coding: utf-8 -*- """ pygments.styles.manni ~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. This is a port of the style used in the `php port`_ of pygments by Manni. The style is called 'default' there. :copyright: Copyright 2006-2013 by the Pygments...
mit
sreith1/three.js
utils/exporters/blender/addons/io_three/__init__.py
60
31178
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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. # # This program is distrib...
mit
BrechtBa/plottools
plottools/cm/hotwater.py
1
13692
from matplotlib.colors import ListedColormap from numpy import nan, inf # Used to reconstruct the colormap in viscm parameters = {'xp': [1.2291944322885904, 15.686577994354849, 30.928398202273232, 36.957902166964374, 39.352619720280053, 37.854922859529893], 'yp': [-17.104696078108354, -28.20005858230811...
gpl-2.0
chaffra/sympy
sympy/solvers/solvers.py
2
123955
""" This module contain solvers for all kinds of equations: - algebraic or transcendental, use solve() - recurrence, use rsolve() - differential, use dsolve() - nonlinear (numerically), use nsolve() (you will need a good starting point) """ from __future__ import print_function, division fr...
bsd-3-clause
whitepyro/debian_server_setup
lib/unidecode/x07f.py
252
4664
data = ( 'Zhui ', # 0x00 'Zi ', # 0x01 'Ke ', # 0x02 'Xiang ', # 0x03 'Jian ', # 0x04 'Mian ', # 0x05 'Lan ', # 0x06 'Ti ', # 0x07 'Miao ', # 0x08 'Qi ', # 0x09 'Yun ', # 0x0a 'Hui ', # 0x0b 'Si ', # 0x0c 'Duo ', # 0x0d 'Duan ', # 0x0e 'Bian ', # 0x0f 'Xian ', # 0x10 '...
gpl-3.0
hpcuantwerpen/easybuild-easyblocks
easybuild/easyblocks/l/lammps.py
2
17758
# -*- coding: utf-8 -*- ## # Copyright 2009-2021 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the ...
gpl-2.0
ArcherSys/ArcherSys
Lib/site-packages/django/conf/locale/sk/formats.py
115
1173
# -*- 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 = 'j. F Y' TIME_FORMAT = 'G:i' DATET...
mit
rohitwaghchaure/alec_frappe5_erpnext
erpnext/tests/sel_tests.py
81
2550
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt """ Run Selenium Tests Requires a clean install. After reinstalling fresh db, call frappe --execute erpnext.tests.sel_tests.start """ from __future__ import unicode_literals import frappe...
agpl-3.0
tdr130/pupy
pupy/pupylib/PupyService.py
33
2980
# -*- coding: UTF8 -*- # -------------------------------------------------------------- # Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # #...
bsd-3-clause
qubole/qds-sdk-py
bin/qds.py
1
29205
#!/bin/env python from __future__ import print_function from qds_sdk.commands import * from qds_sdk.cluster import * import qds_sdk.exception from qds_sdk.scheduler import SchedulerCmdLine from qds_sdk.actions import ActionCmdLine from qds_sdk.report import ReportCmdLine from qds_sdk.dbtaps import DbTapCmdLine from qd...
apache-2.0
msiedlarek/qtwebkit
Tools/Scripts/webkitpy/common/system/logtesting.py
124
9435
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and...
lgpl-3.0
MatthewWilkes/django
django/db/models/aggregates.py
42
6612
""" Classes to represent the definitions of aggregate functions. """ from django.core.exceptions import FieldError from django.db.models.expressions import Func, Star from django.db.models.fields import FloatField, IntegerField __all__ = [ 'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance', ] ...
bsd-3-clause
stifoon/navitia
source/jormungandr/jormungandr/interfaces/v1/converters_collection_type.py
4
1928
# Copyright (c) 2001-2014, 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
calexil/FightstickDisplay
pyglet/text/formats/attributed.py
1
4441
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # Copyright (c) 2008-2021 pyglet contributors # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the follo...
gpl-3.0
jcfr/mystic
examples/test_mogi.py
1
5185
#!/usr/bin/env python # # Author: Patrick Hung (patrickh @caltech) # Author: Mike McKerns (mmckerns @caltech and @uqfoundation) # Copyright (c) 1997-2015 California Institute of Technology. # License: 3-clause BSD. The full license text is available at: # - http://trac.mystic.cacr.caltech.edu/project/mystic/browser/m...
bsd-3-clause
AQuadroTeam/CellsCycle
CellCycle/ChainModule/ChainList.py
1
3326
#! /usr/bin/env python class ChainList: def __init__(self): self.dictionary = dict() def add_node(self, target_node, target_master, target_slave): list_key = ListKey(target_node.id) list_value = ListValue(target_node) list_value.add_master(target_master) list_value.ad...
mit
geekboxzone/mmallow_external_deqp
modules/gles3/scripts/gen-keywords.py
9
5031
import sys from genutil import * # \todo [arttu 2012-12-20] Current set tests variable names only, add function names, structure names, and field selectors. # Templates identifierCaseTemplate = """ case ${{NAME}} expect compile_fail values {} version 300 es both "" #version 300 es precision mediump float; ...
apache-2.0
jiajiax/crosswalk-test-suite
wrt/wrt-packertoolmanu-android-tests/inst.xpk.py
57
6808
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
bsd-3-clause
carolFrohlich/nipype
nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFRecon.py
12
1764
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ....testing import assert_equal from ..odf import ODFRecon def test_ODFRecon_inputs(): input_map = dict(DWI=dict(argstr='%s', mandatory=True, position=1, ), args=dict(argstr='%s', ), dsi=dict(argstr='-dsi', ), environ=dict(...
bsd-3-clause
abhitopia/tensorflow
tensorflow/python/kernel_tests/io_ops_test.py
59
4362
# -*- coding: utf-8 -*- # 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 # # U...
apache-2.0
yangrongwei/gyp
pylib/gyp/xml_fix.py
2767
2174
# 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. """Applies a fix to CR LF TAB handling in xml.dom. Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293 Working around this: http://bugs.python.or...
bsd-3-clause
dkalashnik/tempest
tempest/api/compute/admin/test_live_migration.py
2
7449
# 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 requ...
apache-2.0
DARKPOP/external_chromium_org_third_party_WebKit
Tools/Scripts/webkitpy/common/config/irc.py
69
1467
# Copyright (c) 2013 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
pbarton666/buzz_bot
djangoproj/djangoapp/csc/pseudo_auth/backends.py
1
1175
from django.contrib.auth.models import User as DjangoUser, check_password from csc.pseudo_auth.models import LegacyUser class LegacyBackend: def authenticate(self, username=None, password=None): try: # Load user object u = LegacyUser.objects.get(username=username) # Abo...
mit
lombritz/odoo
addons/account/wizard/account_move_line_select.py
385
2800
# -*- 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
chiragjogi/odoo
addons/hr_holidays/report/hr_holidays_report.py
341
2369
# -*- 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
kustodian/ansible
test/units/modules/monitoring/test_pagerduty_alert.py
21
1944
from units.compat import unittest from ansible.modules.monitoring import pagerduty_alert class PagerDutyAlertsTest(unittest.TestCase): def _assert_incident_api(self, module, url, method, headers): self.assertTrue('https://api.pagerduty.com/incidents' in url, 'url must contain REST API v2 network path') ...
gpl-3.0
gooddata/openstack-nova
nova/api/openstack/placement/objects/project.py
2
3145
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
nomadcube/python-ngram
docs/conf.py
3
6399
# -*- coding: utf-8 -*- # # NGram documentation build configuration file, created by # sphinx-quickstart on Fri Dec 4 14:04:06 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
gpl-3.0
tvm1/CursedOrion
starmap.py
1
24509
import math import random import race PLANETNAMES = ["Andromeda", "Andromeda II", "Andromeda III", "Cygnus A"] class StarMap(object): """Main object that defines game map and keeps track of planets. :ivar width: Width of the starmap (in parsecs) :ivar height: Height of the starmap (in parsecs) :iva...
gpl-3.0
ckcollab/django-pin-passcode
pin_passcode/middleware.py
1
1703
from django.conf import settings from django.http import HttpResponseRedirect from django.urls import reverse, NoReverseMatch from django.utils.deprecation import MiddlewareMixin class PinPasscodeMiddleware(MiddlewareMixin): def process_request(self, request): actual_pin_code = getattr(settings, 'PIN_PASS...
mit
Nebuleon/barbie-seahorse-adventures
lib/boss.py
1
4147
import pygame from pygame.locals import * from cnst import * import sprites import sprite import player import math import random def init(g, r, n, *params): s = sprite.Sprite3(g, r, 'boss/left-0', (27, 62, 75, 39)) # 3 # s.rect.bottom = r.bottom s.rect.centery = r.centery s.rect....
gpl-2.0
ethanrowe/python-mandrel
mandrel/bootstrap.py
1
5497
import logging.config import os import sys from mandrel import config from mandrel import exception from mandrel import util __BOOTSTRAP_BASENAME = 'Mandrel.py' LOGGING_CONFIG_BASENAME = 'logging.cfg' DEFAULT_LOGGING_LEVEL = logging.INFO DEFAULT_LOGGING_FORMAT = '%(asctime)s.%(msecs)04d #%(process)d - %(levelname)s %...
mit
bitmazk/django-review
review/admin.py
1
1081
"""Admin classes for the review app.""" from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from hvad.admin import TranslatableAdmin from . import models class RatingAdmin(admin.ModelAdmin): list_display = ['review', 'category', 'value', ] raw_id_fields = ['review', ] ...
mit
wakatime/wakatime
wakatime/packages/urllib3/util/retry.py
137
14601
from __future__ import absolute_import import time import logging from collections import namedtuple from itertools import takewhile import email import re from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, InvalidHeader, ) from ..pack...
bsd-3-clause
CERNDocumentServer/cds
tests/unit/test_files_receivers.py
2
6891
# -*- coding: utf-8 -*- # # This file is part of CERN Document Server. # Copyright (C) 2018 CERN. # # CERN Document Server 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 ...
gpl-2.0
davidovich/pip
pip/_vendor/requests/packages/urllib3/util/connection.py
679
3293
import socket try: from select import poll, POLLIN except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is_connection_dropped(conn): # Platform-...
mit
Sentient07/scikit-learn
examples/classification/plot_classification_probability.py
138
2871
""" =============================== Plot classification probability =============================== Plot the classification probability for different classifiers. We use a 3 class dataset, and we classify it with a Support Vector classifier, L1 and L2 penalized logistic regression with either a One-Vs-Rest or multinom...
bsd-3-clause
WhireCrow/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/ConfigParser.py
186
27746
"""Configuration file parser. A setup file consists of sections, lead by a "[section]" header, and followed by "name: value" entries, with continuations and such in the style of RFC 822. The option values can contain format strings which refer to other values in the same section, or values in a special [DEFAULT] sect...
gpl-2.0
etos/django
tests/gis_tests/geoapp/feeds.py
133
1812
from django.contrib.gis import feeds from .models import City class TestGeoRSS1(feeds.Feed): link = '/city/' title = 'Test GeoDjango Cities' def items(self): return City.objects.all() def item_link(self, item): return '/city/%s/' % item.pk def item_geometry(self, item): ...
bsd-3-clause
a0u/binutils-gdb
gdb/python/lib/gdb/__init__.py
15
3509
# Copyright (C) 2010-2015 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This progr...
gpl-2.0
ivanvza/sshscan
sshscan.py
1
5406
#!/usr/bin/env python import sys import re import socket import optparse options = optparse.OptionParser(usage='%prog -t <IP>', description='SSH configuration scanner') options.add_option('-t', '--target', type='string', dest='target', help='The target hostname / IP') options.add_option('-p', '--port', type='string',...
mit
scottdangelo/RemoveVolumeMangerLocks
cinder/api/views/versions.py
1
2665
# Copyright 2010-2011 OpenStack Foundation # Copyright 2015 Clinton Knight # 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/li...
apache-2.0
pim89/youtube-dl
youtube_dl/extractor/nhl.py
2
13062
from __future__ import unicode_literals import re import json import os from .common import InfoExtractor from ..compat import ( compat_urlparse, compat_urllib_parse_urlencode, compat_urllib_parse_urlparse, compat_str, ) from ..utils import ( unified_strdate, determine_ext, int_or_none, ...
unlicense
jnmclarty/pysia
setup.py
1
1460
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ 'requests', 'simplejson' ] test_requirements = requirements + [ # T...
mit
remybaranx/qtaste
demo/pywinauto-0.3.8/pywinauto/unittests/test_win32controls.py
2
17502
# GUI Application automation and testing library # Copyright (C) 2006 Mark Mc Mahon # # 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 you...
gpl-3.0
PaulKinlan/cli-caniuse
site/app/scripts/bower_components/jsrepl-build/extern/python/reloop-closured/lib/python2.7/encodings/cp437.py
593
34820
""" Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.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...
apache-2.0
jeffh/rpi_courses
test/rpi_courses/test_scheduler.py
1
6474
import unittest import rpi_courses.scheduler as s from rpi_courses.parser import CourseCatalog from pyconstraints import Problem from constants import XML_SCHEDULE_TEST_FILE, XML_SCHEDULE_TEST_CONFLICT_FILE with open(XML_SCHEDULE_TEST_FILE) as f: SCHEDULE_CONTENTS = f.read() with open(XML_SCHEDULE_TEST_CONFLIC...
mit
FurSec/CloneFlood
cloneflood.py
1
1491
#!/usr/bin/python import socket import time import random import threading import socks global_command = '' server = socket.gethostbyname('SERVER.COM') port = 6667 with open('proxylist.txt','r'): as p: proxies = p.read().splitlines() with open('wordlist.txt','r') as w: wordlist = w.read().splitlines() class use...
mit
BetterWorks/pysaml2
src/s2repoze/plugins/entitlement.py
4
2551
#!/usr/bin/env python import shelve from zope.interface import implements #from repoze.who.interfaces import IChallenger, IIdentifier, IAuthenticator from repoze.who.interfaces import IMetadataProvider class EntitlementMetadataProvider(object): implements(IMetadataProvider) def __init__(self, filen...
bsd-2-clause
mne-tools/mne-tools.github.io
stable/_downloads/e2d6793c13f4efc273574a721815d5b9/20_seeg.py
10
7388
""" .. _tut_working_with_seeg: ====================== Working with sEEG data ====================== MNE supports working with more than just MEG and EEG data. Here we show some of the functions that can be used to facilitate working with stereoelectroencephalography (sEEG) data. This example shows how to use: - sEE...
bsd-3-clause
kinooo/Sick-Beard
sickbeard/clients/__init__.py
38
2409
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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
Sidney84/pa-chromium
third_party/protobuf/python/google/protobuf/internal/reflection_test.py
253
99091
#! /usr/bin/python # -*- coding: utf-8 -*- # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following cond...
bsd-3-clause
hackerkid/zulip
zerver/management/commands/backup.py
6
5298
import os import re import tempfile from argparse import ArgumentParser, RawTextHelpFormatter from typing import Any from django.conf import settings from django.db import connection from django.utils.timezone import now as timezone_now from scripts.lib.zulip_tools import TIMESTAMP_FORMAT, parse_os_release, run from ...
apache-2.0
Gela/deepdive
examples/tutorial_example/step1-basic/udf/ext_people.py
161
1752
#! /usr/bin/env python # Sample input data (piped into STDIN): ''' 118238@10 Sen.~^~Barack~^~Obama~^~and~^~his~^~wife~^~,~^~Michelle~^~Obama~^~,~^~have~^~released~^~eight~^~years~^~of~^~joint~^~returns~^~. O~^~PERSON~^~PERSON~^~O~^~O~^~O~^~O~^~PERSON~^~PERSON~^~O~^~O~^~O~^~DURATION~^~DURATION~^~O~^~O~^~O~^~O 118238@12...
apache-2.0
auduny/home-assistant
homeassistant/components/auth/__init__.py
7
16747
"""Component to allow users to login and get tokens. # POST /auth/token This is an OAuth2 endpoint for granting tokens. We currently support the grant types "authorization_code" and "refresh_token". Because we follow the OAuth2 spec, data should be send in formatted as x-www-form-urlencoded. Examples will be in JSON ...
apache-2.0
zahanm/foodpedia
django/core/management/commands/shell.py
230
3263
import os from django.core.management.base import NoArgsCommand from optparse import make_option class Command(NoArgsCommand): option_list = NoArgsCommand.option_list + ( make_option('--plain', action='store_true', dest='plain', help='Tells Django to use plain Python, not IPython.'), ) ...
bsd-3-clause
pichina/linux-bcache
arch/ia64/scripts/unwcheck.py
916
1718
#!/usr/bin/env python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthe...
gpl-2.0
SeanHayes/python-social-auth
examples/django_me_example/example/settings.py
4
7062
import sys from os.path import abspath, dirname, join import mongoengine sys.path.insert(0, '../..') DEBUG = True TEMPLATE_DEBUG = DEBUG ROOT_PATH = abspath(dirname(__file__)) ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.d...
bsd-3-clause
proximate/proximate
typevalidator.py
1
6006
# # Proximate - Peer-to-peer social networking # # Copyright (c) 2008-2011 Nokia Corporation # # All rights reserved. # # This software is licensed under The Clear BSD license. # See the LICENSE file for more details. # # A simple type validator to check types of bdecoded data that comes from # an untrusted source (say...
bsd-3-clause
ohyeah521/pyadb
pyadb/adb.py
1
13863
# Author: Chema Garcia (aka sch3m4) # Contact: chema@safetybits.net | @sch3m4 | http://safetybits.net/contact # Homepage: http://safetybits.net # Project Site: http://github.com/sch3m4/pyadb try: import sys import os import subprocess except ImportError,e: # should never be reached prin...
bsd-2-clause
amyvmiwei/kbengine
kbe/src/lib/python/Tools/scripts/objgraph.py
101
5980
#! /usr/bin/env python3 # objgraph # # Read "nm -o" input (on IRIX: "nm -Bo") of a set of libraries or modules # and print various interesting listings, such as: # # - which names are used but not defined in the set (and used where), # - which names are defined in the set (and where), # - which modules use which other...
lgpl-3.0
ChronoMonochrome/android_external_chromium_org
chrome/test/functional/media/worker_thread.py
68
4994
# 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. """Worker thread base class. Worker threads are used to run multiple PyUITests simultaneously. They synchronize calls to the browser.""" import itertoo...
bsd-3-clause
tealover/nova
nova/tests/functional/v3/test_volumes.py
30
14313
# Copyright 2012 Nebula, Inc. # Copyright 2014 IBM Corp. # # 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...
apache-2.0
Titulacion-Sistemas/PythonTitulacion-EV
Lib/site-packages/pylint/checkers/utils.py
2
18083
# pylint: disable=W0611 # # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # 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 v...
mit
wanderer2/pymc3
pymc3/step_methods/nuts.py
1
7126
from .quadpotential import quad_potential from .arraystep import ArrayStepShared, ArrayStep, SamplerHist, Competence from ..model import modelcontext, Point from ..vartypes import continuous_types from numpy import exp, log, array from numpy.random import uniform from .hmc import leapfrog, Hamiltonian, bern, energy fro...
apache-2.0
hargup/sympy
sympy/ntheory/primetest.py
8
17799
""" Primality testing """ from __future__ import print_function, division from sympy.core.compatibility import range, as_int from sympy.core.numbers import Float from mpmath.libmp import bitcount as _bitlength def _int_tuple(*i): return tuple(int(_) for _ in i) def is_square(n, prep=True): """Return Tr...
bsd-3-clause
aricchen/openHR
openerp/tools/mail.py
18
14160
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
FCH808/FCH808.github.io
Intro to Data Science/Project1_Part1.py
2
34015
# -*- coding: utf-8 -*- """ Created on Fri Dec 19 13:46:12 2014 @author: fch """ import pandas as pd import pandasql import csv filename="..\\data\\turnstile_data_master_with_weather.csv" ## Question 2.1 def num_rainy_days(filename): ''' This function should run a SQL query on a dataframe of weather da...
mit
yawnosnorous/python-for-android
python3-alpha/extra_modules/gdata/tlslite/utils/PyCrypto_RSAKey.py
48
1817
"""PyCrypto RSA implementation.""" from .cryptomath import * from .RSAKey import * from .Python_RSAKey import Python_RSAKey if pycryptoLoaded: from Crypto.PublicKey import RSA class PyCrypto_RSAKey(RSAKey): def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0): if not d: ...
apache-2.0
chris-statzer/survivebynine
bubble.py
1
3615
################################################################################ # Copyright 2011 Chris Statzer and David Reichard # # # # Licensed under the Apache License, Version 2.0 (the "License"); ...
apache-2.0
OpenUpgrade/OpenUpgrade
addons/l10n_fr/report/compute_resultant_report.py
374
4004
# -*- coding: utf-8 -*- # # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential # consequences resulting from its eventual inadequacies and bugs # End users w...
agpl-3.0
drkcat/api
endpoints/zgzpls.py
1
11437
import hug, requests, json from falcon import HTTP_400, HTTP_404 from bs4 import BeautifulSoup import datetime @hug.get('/bus/stations', output=hug.output_format.pretty_json, examples=["number=1169"]) def get_buses(number:int=None, source=None): def get_buses_from_web(number): url = 'http://www.urbanosdeza...
agpl-3.0
kongseokhwan/kulcloud-iitp-neutron
neutron/tests/unit/agent/linux/test_ipset_manager.py
2
5283
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
finron/luokr.com
www.luokr.com/lib/utils.py
1
1466
#coding=utf-8 import re import hashlib from collections import OrderedDict class Utils: @staticmethod def array_keyto(ary, key): ret = {} for val in ary: ret[val[key]] = val return ret @staticmethod def array_group(ary, key): ret = {} for val in ary...
bsd-3-clause
yro/veda_worker
veda_worker/tests/test_video_images.py
1
1947
""" Video image generation tests. """ from ddt import ddt, data, unpack import os import sys import unittest import yaml from PIL import Image from veda_worker import video_images MOCK_SETTINGS = { 'ffmpeg_compiled': 'ffmpeg' } class MockVideo(object): """ Mock VideoObject """ mezz_duration = 1...
gpl-3.0
AnishShah/tensorflow
tensorflow/tools/docs/parser_test.py
22
25251
# 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
ivoflipse/devide.johannes
install_packages/ip_scipy.py
5
5081
# Copyright (c) Charl P. Botha, TU Delft. # All rights reserved. # See COPYRIGHT for details. # this was just an experiment to see how far we could get with # gohlke's MKL built scipy binaries on Windows. Not far enough # (and there are licensing issues in any case). Ask me (cpbotha) # about the details if you'...
bsd-3-clause
yotchang4s/cafebabepy
src/main/python/concurrent/futures/thread.py
6
5192
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Implements ThreadPoolExecutor.""" __author__ = 'Brian Quinlan (brian@sweetapp.com)' import atexit from concurrent.futures import _base import queue import threading import weakref import os # Workers are created...
bsd-3-clause
joariasl/odoo
addons/account_budget/wizard/account_budget_crossovered_summary_report.py
373
2191
# -*- 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
tudennis/LeetCode---kamyu104-11-24-2015
Python/can-i-win.py
2
2234
# Time: O(n!) # Space: O(n) # In the "100 game," two players take turns adding, to a running total, any integer from 1..10. # The player who first causes the running total to reach or exceed 100 wins. # # What if we change the game so that players cannot re-use integers? # # For example, two players might take turns ...
mit
BT-rmartin/odoo
addons/auth_crypt/__init__.py
435
1050
############################################################################## # # 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 GNU Affero General Publ...
agpl-3.0