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
xwolf12/androguard
androguard/decompiler/dad/instruction.py
13
38538
# This file is part of Androguard. # # Copyright (C) 2012, Geoffroy Gueguen <geoffroy.gueguen@gmail.com> # 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:/...
apache-2.0
srivassumit/servo
tests/wpt/css-tests/tools/pytest/testing/test_collection.py
187
23182
import pytest, py from _pytest.main import Session, EXIT_NOTESTSCOLLECTED class TestCollector: def test_collect_versus_item(self): from pytest import Collector, Item assert not issubclass(Collector, Item) assert not issubclass(Item, Collector) def test_compat_attributes(self, testdir,...
mpl-2.0
egenerat/gae-django
django/core/files/images.py
12
1795
""" Utility functions for handling images. Requires PIL, as you might imagine. """ from django.core.files import File class ImageFile(File): """ A mixin for use alongside django.core.files.base.File, which provides additional features for dealing with images. """ def _get_width(self)...
mit
wdm0006/categorical_encoding
category_encoders/target_encoder.py
1
10127
"""Target Encoder""" import numpy as np import pandas as pd from sklearn.base import BaseEstimator, TransformerMixin from category_encoders.ordinal import OrdinalEncoder import category_encoders.utils as util __author__ = 'chappers' class TargetEncoder(BaseEstimator, TransformerMixin): """Target encoding for cat...
bsd-3-clause
nephila/django-filer
filer/fields/folder.py
3
5039
#-*- coding: utf-8 -*- from django.template.loader import render_to_string import inspect import warnings from django import forms from django.conf import settings from django.contrib.admin.widgets import ForeignKeyRawIdWidget from django.contrib.admin.sites import site from django.core.urlresolvers import reverse from...
bsd-3-clause
boland1992/seissuite_iran
build/lib/ambient/spectrum/find_maxima.py
8
13563
# -*- coding: utf-8 -*- """ Created on Fri July 6 11:04:03 2015 @author: boland """ import os import datetime import numpy as np import multiprocessing as mp import matplotlib.pyplot as plt from scipy import signal from obspy import read from scipy.signal import argrelextrema from info_dataless import locs_from_dat...
gpl-3.0
feer56/Kitsune1
kitsune/upload/migrations/0001_initial.py
4
4996
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ImageAttachment' db.create_table('upload_imageattachment', ( ('id', self.gf('dja...
bsd-3-clause
sarantapichos/faircoop-market
addons/fleet/fleet.py
266
46376
# -*- 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
MichaelCoughlinAN/Odds-N-Ends
Python/Python Modules/lxml-4.2.0/doc/mkhtml.py
2
11648
from __future__ import absolute_import from docstructure import SITE_STRUCTURE, HREF_MAP, BASENAME_MAP from lxml.etree import (parse, fromstring, ElementTree, Element, SubElement, XPath, XML) import os import re import sys import copy import shutil import textwrap import subprocess from io imp...
gpl-3.0
pedro2d10/SickRage-FR
lib/unidecode/x059.py
252
4644
data = ( 'Shou ', # 0x00 'Yi ', # 0x01 'Zhi ', # 0x02 'Gu ', # 0x03 'Chu ', # 0x04 'Jiang ', # 0x05 'Feng ', # 0x06 'Bei ', # 0x07 'Cay ', # 0x08 'Bian ', # 0x09 'Sui ', # 0x0a 'Qun ', # 0x0b 'Ling ', # 0x0c 'Fu ', # 0x0d 'Zuo ', # 0x0e 'Xia ', # 0x0f 'Xiong ', # 0x10 ...
gpl-3.0
bbozhev/flask-test
flask/lib/python2.7/site-packages/sqlalchemy/dialects/oracle/zxjdbc.py
33
8034
# oracle/zxjdbc.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: oracle+zxjdbc :name: zxJDBC for Jython :dbapi: zxjdbc ...
mit
ville-k/tensorflow
tensorflow/contrib/training/python/training/device_setter_test.py
76
4315
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
tangentlabs/wagtail
wagtail/wagtailadmin/urls/__init__.py
20
3195
from django.conf.urls import url, include from django.contrib.auth.decorators import permission_required from django.views.decorators.cache import cache_control from wagtail.wagtailadmin.urls import pages as wagtailadmin_pages_urls from wagtail.wagtailadmin.urls import password_reset as wagtailadmin_password_reset_url...
bsd-3-clause
sampsyo/confit
test/test_yaml.py
2
1400
from __future__ import division, absolute_import, print_function import confuse import yaml import unittest from . import TempDir def load(s): return yaml.load(s, Loader=confuse.Loader) class ParseTest(unittest.TestCase): def test_dict_parsed_as_ordereddict(self): v = load("a: b\nc: d") sel...
mit
praneethkumarpidugu/matchmaking
lib/python2.7/site-packages/django/core/servers/basehttp.py
46
7407
""" HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21). Based on wsgiref.simple_server which is part of the standard library since 2.5. This is a simple server for use in testing or debugging Django apps. It hasn't been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE! """ from __f...
mit
xushiwei/nova
nova/tests/api/openstack/contrib/test_security_groups.py
3
41730
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC # # 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 # #...
apache-2.0
kashif/chainer
tests/chainer_tests/utils_tests/test_walker_alias.py
8
1098
import unittest import numpy from chainer import cuda from chainer import testing from chainer.testing import attr from chainer import utils class TestWalkerAlias(unittest.TestCase): def setUp(self): self.ps = numpy.array([5, 3, 4, 1, 2], dtype=numpy.int32) self.sampler = utils.WalkerAlias(self...
mit
adrienbrault/home-assistant
homeassistant/components/fireservicerota/binary_sensor.py
3
2498
"""Binary Sensor platform for FireServiceRota integration.""" from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.helpers.typing import HomeAssistantType from homeassistant.helpers.update_coordinator import ( CoordinatorEntity...
mit
replicat0r/mitro
mitro-core/tools/icons_crawler/build_update_list.py
25
1567
# Reads a list of urls and an old list of services and outputs the list # of hostnames that are missing from the old list of services. # # List of urls can be generated from the mitro db using: # # psql -P tuples_only=on -c "select hostname from secrets" mitro # from collections import defaultdict import json import o...
gpl-3.0
mfjb/scikit-learn
examples/manifold/plot_manifold_sphere.py
258
5101
#!/usr/bin/python # -*- coding: utf-8 -*- """ ============================================= Manifold Learning methods on a severed sphere ============================================= An application of the different :ref:`manifold` techniques on a spherical data-set. Here one can see the use of dimensionality reducti...
bsd-3-clause
FlintHill/SUAS-Competition
env/lib/python2.7/site-packages/pip/_internal/req/req_set.py
8
7264
from __future__ import absolute_import import logging from collections import OrderedDict from pip._internal.exceptions import InstallationError from pip._internal.utils.logging import indent_log from pip._internal.wheel import Wheel logger = logging.getLogger(__name__) class RequirementSet(object): def __ini...
mit
vFense/vFenseAgent-nix
agent/tests/core_tests/utils_test/test_display_info.py
1
2697
import unittest from src.utils import hardware class TestDisplayInfoLinux(unittest.TestCase): # \n\n is needed at the end so that the parsing can stop. # This simulates the real output from lscpi -v one = \ """00:02.0 VGA compatible controller: Cirrus Logic GD 5446 (prog-if 00 [VGA controller]) ...
lgpl-3.0
jespino/anillo
examples/example_rest_api.py
3
1138
from anillo.app import application from anillo.handlers.routing import router, url, context from anillo.utils.common import chain from anillo.middlewares.json import wrap_json from anillo.http import NotFound, NoContent, Created, Ok database = [] def list(request): return Ok(database, mimetype="application/json"...
bsd-2-clause
ChronoMonochrome/android_external_chromium_org
tools/generate_shim_headers/generate_shim_headers.py
150
3434
#!/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. """ Generates shim headers that mirror the directory structure of bundled headers, but just forward to the system ones. This allow...
bsd-3-clause
lowitty/selenium
libs/windows/paramiko/ssh_gss.py
5
22354
# Copyright (C) 2013-2014 science + computing ag # Author: Sebastian Deiss <sebastian.deiss@t-online.de> # # # This file is part of paramiko. # # Paramiko 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;...
mit
tarlabs/selenium
py/test/selenium/webdriver/common/cookie_tests.py
61
4050
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
llvm-mirror/lldb
packages/Python/lldbsuite/test/commands/watchpoints/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
5
3272
""" Test that a variable watchpoint should only hit when in scope. """ from __future__ import print_function import unittest2 import lldb from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.decorators import * class WatchedVariableHitWhenInScopeTestCase(TestBase): ...
apache-2.0
chushao/Gradesource-Uploader---GUI
Gradesource-Uploader-master/requests/packages/charade/mbcharsetprober.py
206
3354
######################## 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....
mit
jestapinski/oppia
core/controllers/feedback_test.py
1
26845
# coding: utf-8 # # Copyright 2014 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
KaranToor/MA450
google-cloud-sdk/.install/.backup/lib/googlecloudsdk/third_party/appengine/datastore/datastore_pbs.py
6
62760
# !/usr/bin/python2.4 # pylint: disable=g-unknown-interpreter # # Copyright 2013 Google 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...
apache-2.0
MyAOSP/external_chromium_org
tools/python/google/path_utils.py
191
2910
# Copyright (c) 2011 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. """Some utility methods for getting and manipulating paths.""" # TODO(pamg): Have the buildbot use these, too. import errno import os import sys clas...
bsd-3-clause
NewpTone/stacklab-nova
nova/tests/api/openstack/compute/test_consoles.py
8
11502
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 OpenStack LLC. # Copyright 2011 Piston Cloud Computing, 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 o...
apache-2.0
fastio/pedis
tools/scyllatop/views/aggregate.py
4
1497
import groups import table import base import helpers class Aggregate(base.Base): def update(self, liveData): self.clearScreen() self.writeStatusLine(liveData.measurements) metricGroups = groups.Groups(liveData.measurements) visible = metricGroups.all() tableForm = self._pr...
agpl-3.0
arbrandes/edx-platform
lms/djangoapps/mobile_api/course_info/tests.py
3
9329
""" Tests for course_info """ import ddt from django.conf import settings from milestones.tests.utils import MilestonesTestCaseMixin from lms.djangoapps.mobile_api.testutils import MobileAPITestCase, MobileAuthTestMixin, MobileCourseAccessTestMixin from lms.djangoapps.mobile_api.utils import API_V1, API_V05 from xmo...
agpl-3.0
MarkTheF4rth/youtube-dl
youtube_dl/extractor/videopremium.py
146
1540
from __future__ import unicode_literals import re import random from .common import InfoExtractor class VideoPremiumIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?videopremium\.(?:tv|me)/(?P<id>\w+)(?:/.*)?' _TEST = { 'url': 'http://videopremium.tv/4w7oadjsf156', 'info_dict': { ...
unlicense
slightstone/SickRage
lib/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
crwilcox/PyGithub
github/tests/GitRef.py
39
2812
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
geekaia/edx-platform
lms/djangoapps/verify_student/views.py
8
20265
""" Views for the verification flow """ import json import logging import decimal import datetime from pytz import UTC from edxmako.shortcuts import render_to_response from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseBadRequest, HttpRespo...
agpl-3.0
mne-tools/mne-tools.github.io
stable/_downloads/4879a0c2f8430c81b09ff19ed69e5d4c/30_info.py
4
8785
# -*- coding: utf-8 -*- """ .. _tut-info-class: The Info data structure ======================= This tutorial describes the :class:`mne.Info` data structure, which keeps track of various recording details, and is attached to :class:`~mne.io.Raw`, :class:`~mne.Epochs`, and :class:`~mne.Evoked` objects. We'll begin by...
bsd-3-clause
kushalbhola/MyStuff
Practice/PythonApplication/env/Lib/site-packages/pip/_internal/compat.py
7
7677
"""Stuff that differs in different Python versions and platform distributions.""" from __future__ import absolute_import, division import codecs import locale import logging import os import shutil import sys from pip._vendor.six import text_type try: import ipaddress except ImportError: try: from pi...
apache-2.0
moniqx4/bite-project
deps/mrtaskman/server/mapreduce/lib/graphy/bar_chart.py
77
5798
#!/usr/bin/env python # # Copyright 2008 Google 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 ...
apache-2.0
cwu2011/scikit-learn
examples/ensemble/plot_ensemble_oob.py
259
3265
""" ============================= OOB Errors for Random Forests ============================= The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where each new tree is fit from a bootstrap sample of the training observations :math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er...
bsd-3-clause
sunils34/buffer-django-nonrel
django/contrib/comments/feeds.py
310
1439
from django.conf import settings from django.contrib.syndication.views import Feed from django.contrib.sites.models import Site from django.contrib import comments from django.utils.translation import ugettext as _ class LatestCommentFeed(Feed): """Feed of latest comments on the current site.""" def title(sel...
bsd-3-clause
cherusk/ansible
lib/ansible/utils/module_docs_fragments/validate.py
366
1146
# Copyright (c) 2015 Ansible, Inc # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansi...
gpl-3.0
petermat/phantomjs
src/breakpad/src/tools/gyp/gyptest.py
137
7245
#!/usr/bin/env python # Copyright (c) 2009 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. __doc__ = """ gyptest.py -- test runner for GYP tests. """ import os import optparse import subprocess import sys class CommandRunner: "...
bsd-3-clause
chrisfilda/edx_platform
lms/djangoapps/courseware/tests/test_view_authentication.py
22
15818
import datetime import pytz from mock import patch from django.core.urlresolvers import reverse from django.test.utils import override_settings # Need access to internal func to put users in the right group from courseware.access import has_access from xmodule.modulestore.tests.django_utils import ModuleStoreTestCa...
agpl-3.0
helium/helium-commander
tests/test_writer.py
1
1170
from helium_commander import Sensor, DataPoint from itertools import islice import pytest def validate_format(output, client, sensors, capsys): first_sensor = sensors[0] # With sort Sensor.display(client, sensors, format=output, sort='name') out, err = capsys.readouterr() assert first_sensor.shor...
bsd-3-clause
robweber/maraschino
lib/sqlalchemy/util/topological.py
14
2608
# util/topological.py # Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Topological sorting algorithms.""" from sqlalchemy.exc import CircularDependen...
mit
ahkab/ahkab
tests/acnl/test_acnl.py
1
1086
import numpy as np import ahkab from ahkab import testing cli = False def test(): """Test NL AC analysis (API)""" cir = ahkab.Circuit('CS amplifier') mys = ahkab.time_functions.sin(0, 1, 60) cir.add_vsource('vin', '1', '0', dc_value=3, ac_value=1) cir.add_vsource('vdd', '3', '0', dc_value=30) ...
gpl-2.0
JetStarBlues/Nand-2-Tetris
OldArchitecture/v1.0/Components/_7__cpu_performance.py
1
6645
''' Selection is implemented using Python if-statements instead of muxes ''' '''----------------------------- Imports -----------------------------''' # Hack computer from ._x__components import * '''------------------------------- CPU -------------------------------''' ''' Instruction - 0123456789ABCDEF 0 -> ...
mit
muntasirsyed/intellij-community
python/helpers/docutils/transforms/misc.py
183
4882
# $Id: misc.py 6314 2010-04-26 10:04:17Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Miscellaneous transforms. """ __docformat__ = 'reStructuredText' from docutils import nodes from docutils.transforms import Transform, TransformError clas...
apache-2.0
Varentsov/servo
tests/wpt/mozilla/tests/webgl/conformance-2.0.0/deqp/functional/gles3/texturewrap/texturewrap_test_generator.py
51
3662
#!/usr/bin/env python # Copyright (c) 2016 The Khronos Group Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and/or associated documentation files (the # "Materials"), to deal in the Materials without restriction, including # without limitation the rights to use...
mpl-2.0
SemaiCZE/TrainDeathToll
lib/oauthlib/oauth2/rfc6749/clients/backend_application.py
87
2498
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals from .base import Client from ..parameters import prepare_token_request from ...
mit
breavo/GitPython
git/exc.py
2
4854
# exc.py # Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php """ Module containing all exceptions thrown throughout the git package, """ from gitdb.exc import * ...
bsd-3-clause
244xiao/blender-java
blender-java/src/resources/release/scripts/modules/rna_prop_ui.py
1
4892
# ##### 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 ...
gpl-2.0
almarklein/imageio
imageio.proxy.py
7
1569
# -*- coding: utf-8 -*- # Copyright (c) 2014, Almar Klein # (new) BSD License. """ This module provides an easy way to enable importing a package event if it's not on sys.path. The main use case is to import a package from its developmment repository without having to install it. This module is sort of like a symlin...
bsd-2-clause
bsmrstu-warriors/Moytri--The-Drone-Aider
Lib/site-packages/numpy/lib/tests/test__datasource.py
54
10225
import os import sys from tempfile import mkdtemp, mkstemp, NamedTemporaryFile from shutil import rmtree from urlparse import urlparse from urllib2 import URLError import urllib2 from numpy.testing import * from numpy.compat import asbytes import numpy.lib._datasource as datasource def urlopen_stub(url, data=None):...
gpl-3.0
SerCeMan/intellij-community
python/lib/Lib/sre_compile.py
98
16736
# # Secret Labs' Regular Expression Engine # # convert template to internal format # # Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" import _sre, sys from sre_constants import * assert _sr...
apache-2.0
apache/incubator-mxnet
tests/python/gpu/test_gluon_transforms.py
2
4072
# 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
shelsonjava/TeaJS
deps/v8/tools/testrunner/objects/peer.py
123
3561
# Copyright 2012 the V8 project authors. 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 conditi...
bsd-3-clause
CI-WATER/TethysCluster
tethyscluster/plugins/pypkginstaller.py
2
2858
# Copyright 2009-2014 Justin Riley # # This file is part of TethysCluster. # # TethysCluster 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 3 of the License, or (at your option) any # la...
gpl-3.0
xinwu/horizon
horizon/test/dummy_auth/backend.py
60
1259
# 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
autosub-team/autosub
VELS_WEB/languages/id.py
148
11233
# coding: utf8 { '!langcode!': 'id', '!langname!': 'Indonesian', '%d days ago': '%d hari yang lalu', '%d hours ago': '%d jam yang lalu', '%d minutes ago': '%d menit yang lalu', '%d months ago': '%d bulan yang lalu', '%d seconds ago': '%d detik yang lalu', '%d seconds from now': '%d detik dari sekarang', '%d weeks ago':...
gpl-2.0
plissonf/scikit-learn
sklearn/neighbors/nearest_centroid.py
199
7249
# -*- coding: utf-8 -*- """ Nearest Centroid Classification """ # Author: Robert Layton <robertlayton@gmail.com> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import warnings import numpy as np from scipy import sparse as sp from ..base import BaseEstimator, ClassifierMixin from ..met...
bsd-3-clause
MyAOSP/external_chromium_org
chrome/common/extensions/docs/examples/apps/hello-python/oauth2/clients/imap.py
885
1685
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
bsd-3-clause
mandeepdhami/horizon
openstack_dashboard/dashboards/project/routers/extensions/extraroutes/forms.py
54
2286
# Copyright 2015, Thales Services SAS # 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
zenoss/ZenPacks.zenoss.CloudStack
ZenPacks/zenoss/CloudStack/RouterVM.py
1
4769
########################################################################### # # This program is part of Zenoss Core, an open source monitoring platform. # Copyright (C) 2012-2013, Zenoss Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License ...
gpl-2.0
dougluce/ansible-modules-core
commands/shell.py
60
2743
# There is actually no actual shell module source, when you use 'shell' in ansible, # it runs the 'command' module with special arguments and it behaves differently. # See the command source and the comment "#USE_SHELL". DOCUMENTATION = ''' --- module: shell short_description: Execute commands in nodes. description: ...
gpl-3.0
xlab-si/fcoclient
fcoclient/client.py
1
5952
# Copyright (c) 2017 XLAB d.o.o. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0
pveglia/django-tastypie
tests/core/tests/resources.py
1
188906
import base64 import copy import datetime from decimal import Decimal import django import json from mock import patch from django.conf import settings from django.contrib.auth.models import User from django.core.cache import cache from django.core.exceptions import FieldError, MultipleObjectsReturned from django.core...
bsd-3-clause
nguyentu1602/statsmodels
statsmodels/stats/weightstats.py
19
43052
'''Ttests and descriptive statistics with weights Created on 2010-09-18 Author: josef-pktd License: BSD (3-clause) References ---------- SPSS manual SAS manual This follows in large parts the SPSS manual, which is largely the same as the SAS manual with different, simpler notation. Freq, Weight in SAS seems redu...
bsd-3-clause
adrienbrault/home-assistant
tests/components/dexcom/test_config_flow.py
5
4501
"""Test the Dexcom config flow.""" from unittest.mock import patch from pydexcom import AccountError, SessionError from homeassistant import config_entries, data_entry_flow, setup from homeassistant.components.dexcom.const import DOMAIN, MG_DL, MMOL_L from homeassistant.const import CONF_UNIT_OF_MEASUREMENT, CONF_USE...
mit
hoskerism/reefx
devices/MCP230xx/Adafruit_I2C.py
1
4698
#!/usr/bin/python import smbus # =========================================================================== # Adafruit_I2C Class # =========================================================================== class Adafruit_I2C : @staticmethod def getPiRevision(): "Gets the version number of the Raspberry Pi...
gpl-2.0
vmax-feihu/hue
desktop/libs/aws/src/aws/s3/s3stat.py
6
2614
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
apache-2.0
tntnatbry/tensorflow
tensorflow/contrib/linalg/python/ops/linear_operator_addition.py
30
15248
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
jeffmahoney/crash-python
doc-source/mock/gdb/__init__.py
1
1259
# -*- coding: utf-8 -*- # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: class Target(object): class kdump(object): pass def get_addrxlat_ctx(): pass class get_addrxlat_sys(): def get_map(self, x): return [] class Register(object): pa...
gpl-2.0
alangwansui/mtl_ordercenter
openerp/addons/stock_no_autopicking/stock_no_autopicking.py
53
1517
# -*- 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
nicholasvmoore/rpi-thermostat
greenhouse_fan.py
1
3102
#!/usr/bin/python3 import subprocess import RPi.GPIO as GPIO from time import sleep #from subprocess import Popen, PIPE # This script is meant for Python 3.2 on a RPi, # it will grap the ambient temperature and control # a fan based on the data collected. # Global variables timeframe = 5 interval = 60 past_temp = [0]...
gpl-3.0
mdhaman/superdesk-aap
server/aap/macros/pollution_report.py
1
5011
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
agpl-3.0
mdhaman/superdesk-aap
server/aap/publish/formatters/aap_odbc_formatter.py
2
4943
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from superdes...
agpl-3.0
sathnaga/avocado-vt
virttest/cartesian_config.py
2
78813
#!/usr/bin/python """ Cartesian configuration format file parser. Filter syntax: * ``,`` means ``OR`` * ``..`` means ``AND`` * ``.`` means ``IMMEDIATELY-FOLLOWED-BY`` * ``(xx=yy)`` where ``xx=VARIANT_NAME`` and ``yy=VARIANT_VALUE`` Example: :: qcow2..(guest_os=Fedora).14, RHEL.6..raw..boot, smp2..qcow2..migr...
gpl-2.0
ZLLab-Mooc/edx-platform
lms/envs/aws.py
1
34899
""" This is the default template for our main set of AWS servers. This does NOT cover the content machines, which use content.py Common traits: * Use memcached, and cache-backed sessions * Use a MySQL 5.1 database """ # We intentionally define lots of variables that aren't used, and # want to import all variables fro...
agpl-3.0
adamschaub/contrib
scale-demo/Godeps/_workspace/src/github.com/ugorji/go/codec/test.py
1138
3876
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
apache-2.0
bcarr092/CSignal
test/test_bit_packer.py
1
9437
from csignal_tests import * from array import array import random import struct import socket import ctypes import unittest class TestsBitPacker( unittest.TestCase ): def test_get_bytes_add_bits( self ): bitPacker = python_bit_packer_initialize() self.assertNotEquals( bitPacker, None ) data = "\x12\x34...
apache-2.0
marinho/geraldo
site/newsite/django_1_0/tests/regressiontests/forms/localflavor/cl.py
33
2914
# Tests for the contrib/localflavor/ CL form fields. tests = r""" ## CLRutField ############################################################# CLRutField is a Field that checks the validity of the Chilean personal identification number (RUT). It has two modes relaxed (default) and strict. >>> from django.contrib.loc...
lgpl-3.0
cjfuller/mobile_video_zoom
mvz/methods/bandpass_and_snapping.py
2
7180
"""Bandpass filter the positions, then snap to as few shots as possible.""" from typing import Any, List, Optional, Tuple import funcy as fn import numpy as np import pandas as pd import scipy.signal as sig import scipy.stats as stats from mvz import const from mvz.methods import shared from mvz.methods.shared import...
mit
fhahn/casmi
src/etc/shared_glue.py
1
3188
import sys import re #builtin_re = re.compile("DEFINE_CASM_SHARED\((\w+,)(ARG\(.+\),)*\)") #builtin_re = re.compile("DEFINE_CASM_SHARED\((\w+), (?:ARG\(Int, (\w+)\),? ?)+\)") builtin_re = re.compile("DEFINE_CASM_SHARED\((\w+), (.*)\)") arg_re = re.compile("(?:ARG\(Int, (\w+)\),? ?)") def create_typecheck_defines(bui...
bsd-3-clause
jteehan/cfme_tests
cfme/containers/template.py
1
3332
# -*- coding: utf-8 -*- import random import itertools from functools import partial from navmazing import NavigateToAttribute, NavigateToSibling from widgetastic_manageiq import Table from cfme.base.ui import BaseLoggedInPage from cfme.common import SummaryMixin, Taggable from cfme.containers.provider import Labelab...
gpl-2.0
sgerhart/ansible
lib/ansible/modules/clustering/znode.py
55
7599
#!/usr/bin/python # Copyright 2015 WP Engine, Inc. All rights reserved. # 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', ...
mit
abhitopia/tensorflow
tensorflow/python/debug/cli/stepper_cli_test.py
47
19722
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
pombredanne/pytype
pytype/pytd/utils.py
1
12541
# -*- coding:utf-8; python-indent:2; indent-tabs-mode:nil -*- # Copyright 2013 Google 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/l...
apache-2.0
23andMe/ansible-modules-extras
packaging/os/portinstall.py
79
6913
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, berenddeboer # Written by berenddeboer <berend@pobox.com> # Based on pkgng module written by bleader <bleader at ratonland.org> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
gpl-3.0
equa/wal-e
wal_e/subprocess.py
11
58130
# subprocess - Subprocesses with accessible I/O streams # # For more information about this module, see PEP 324. # # This module should remain compatible with Python 2.2, see PEP 291. # # Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se> # # Licensed to PSF under a Contributor Agreement. # See http://ww...
bsd-3-clause
shaufi10/odoo
addons/mrp_operations/__openerp__.py
260
2897
# -*- 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
arielmakestuff/loadlimit
test/functional/test_import_taskfiles.py
1
2583
# -*- coding: utf-8 -*- # test/unit/importhook/test_taskimporter.py # Copyright (C) 2016 authors and contributors (see AUTHORS file) # # This module is released under the MIT License. """Test taskfilematch()""" # ============================================================================ # Imports # ================...
mit
winndows/cinder
cinder/zonemanager/drivers/cisco/cisco_fc_san_lookup_service.py
23
14774
# (c) Copyright 2014 Cisco Systems 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 # # Unl...
apache-2.0
zzjkf2009/Midterm_Astar
vendor/googletest/googletest/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...
mit
Jokebin/openwrt
scripts/flashing/jungo-image.py
758
7069
#!/usr/bin/env python # # Copyright 2008, 2009 (C) Jose Vasconcellos <jvasco@verizon.net> # # A script that can communicate with jungo-based routers # (such as MI424-WR, USR8200 and WRV54G) to backup the installed # firmware and replace the boot loader. # # Tested with Python 2.5 on Linux and Windows # """Usage: %s [op...
gpl-2.0
anbangleo/NlsdeWeb
Python-3.6.0/Lib/xml/dom/domreg.py
841
3402
"""Registration facilities for DOM. This module should not be used directly. Instead, the functions getDOMImplementation and registerDOMImplementation should be imported from xml.dom.""" # This is a list of well-known implementations. Well-known names # should be published by posting to xml-sig@python.org, and are # ...
mit
telwertowski/Books-Mac-OS-X
Versions/Books_3.0b4/Bundled plugins/Amazon (FR).plugin/Contents/Resources/amazon.py
126
16017
"""Python wrapper for Amazon web APIs This module allows you to access Amazon's web APIs, to do things like search Amazon and get the results programmatically. Described here: http://www.amazon.com/webservices You need a Amazon-provided license key to use these services. Follow the link above to get one. These f...
mit