repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
kool79/intellij-community
refs/heads/master
python/testData/joinLines/ListOfStrings.py
83
a = [ "AAAAAAA", "BBBBB" "AAAAAAA", "BBBBB" "AAAAAAA",<caret> "BBBBB" "AAAAAAA", "BBBBB" "AAAAAAA", "BBBBB" "AAAAAAA", "BBBBB"]
realraum/r3pi-temperature
refs/heads/master
r3door.py
1
import json import requests def getStatusByName(data, name): try: return filter(lambda x: x['name'] == name, data['sensors']['door_locked'])[0]['value'] except KeyError: return true def getDoorstatus(): resp = requests.get(url="http://realraum.at/status.json") data = resp.json() ...
colinnewell/odoo
refs/heads/8.0
addons/multi_company/__init__.py
886
# -*- 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...
dagwieers/ansible
refs/heads/devel
lib/ansible/module_utils/network/common/netconf.py
60
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
mvaled/sentry
refs/heads/master
src/sentry/rules/conditions/tagged_event.py
1
from __future__ import absolute_import from collections import OrderedDict from django import forms from sentry import tagstore from sentry.rules.conditions.base import EventCondition class MatchType(object): EQUAL = "eq" NOT_EQUAL = "ne" STARTS_WITH = "sw" ENDS_WITH = "ew" CONTAINS = "co" N...
Maarc/openshift-ansible
refs/heads/master
roles/lib_zabbix/library/zbx_item.py
1
#!/usr/bin/env python ''' Ansible module for zabbix items ''' # vim: expandtab:tabstop=4:shiftwidth=4 # # Zabbix item ansible module # # # Copyright 2015 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You m...
qilicun/python
refs/heads/master
python3/src/plot/movie1_mpl1.py
1
import numpy as np import matplotlib.pyplot as mpl import time, glob, os # Clean up old frames for name in glob.glob('tmp_*.eps'): os.remove(name) def f(x, m, s): return (1.0/(np.sqrt(2*np.pi)*s))*np.exp(-0.5*((x-m)/s)**2) m = 0 s_max = 2 s_min = 0.2 x = np.linspace(m -3*s_max, m + 3*s_max, 1000) s_values = ...
un33k/CouchPotatoServer
refs/heads/master
couchpotato/core/media/movie/providers/userscript/tmdb.py
37
import re from couchpotato.core.event import fireEvent from couchpotato.core.media._base.providers.userscript.base import UserscriptBase autoload = 'TMDB' class TMDB(UserscriptBase): version = 2 includes = ['*://www.themoviedb.org/movie/*'] def getMovie(self, url): match = re.search('(?P<id>...
Filechaser/nzbToMedia
refs/heads/master
libs/unidecode/x06e.py
252
data = ( 'Ben ', # 0x00 'Yuan ', # 0x01 'Wen ', # 0x02 'Re ', # 0x03 'Fei ', # 0x04 'Qing ', # 0x05 'Yuan ', # 0x06 'Ke ', # 0x07 'Ji ', # 0x08 'She ', # 0x09 'Yuan ', # 0x0a 'Shibui ', # 0x0b 'Lu ', # 0x0c 'Zi ', # 0x0d 'Du ', # 0x0e '[?] ', # 0x0f 'Jian ', # 0x10 'Mi...
fengyuanjs/catawampus
refs/heads/master
tr/vendor/curtain/digest.py
5
from tornado.web import * from hashlib import md5 class DigestAuthMixin(object): def apply_checksum(self, data): return md5(data).hexdigest() def apply_digest(self, secret, data): return self.apply_checksum(secret + ":" + data) def A1(self, algorithm, auth_pass): """ If '...
craigderington/striker_api
refs/heads/master
.env/bin/activate_this.py
1076
"""By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used when you must use an existing Python interpreter, not the virtualenv bin/python """ try: __file__ except NameError: raise AssertionError( "You must run this like execfile('path/to/...
RCOSDP/waterbutler
refs/heads/nii-mergework-201901
waterbutler/core/streams/base.py
1
import abc import asyncio class BaseStream(asyncio.StreamReader, metaclass=abc.ABCMeta): """A wrapper class around an existing stream that supports teeing to multiple reader and writer objects. Though it inherits from `asyncio.StreamReader` it does not implement/augment all of its methods. Only ``read()...
evro/CouchPotatoServer
refs/heads/master
libs/caper/step.py
81
# Copyright 2013 Dean Gardiner <gardiner91@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
unseenlaser/python-for-android
refs/heads/master
python-modules/twisted/twisted/trial/test/test_testcase.py
59
# Copyright (c) 2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Direct unit tests for L{twisted.trial.unittest.TestCase}. """ from twisted.trial.unittest import TestCase class TestCaseTests(TestCase): """ L{TestCase} tests. """ class MyTestCase(TestCase): """ Some te...
omefire/bitcoin
refs/heads/master
qa/rpc-tests/smartfees.py
131
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test fee estimation code # from test_framework.test_framework import BitcoinTestFramework from test_...
Mechazawa/WordOn-HD-Bot
refs/heads/master
wordonhd/__main__.py
1
#!/usr/bin/env python3 from Session import Session from getpass import getpass s = Session.login('spam@ioexception.at', getpass()) s.resume() s.listen()
pstjohn/cobrapy
refs/heads/master
cobra/test/design.py
3
from unittest import TestCase, TestLoader, TextTestRunner, skipIf import sys if __name__ == "__main__": sys.path.insert(0, "../..") from cobra.test import create_test_model, data_directory from cobra.design import * from cobra.design.design_algorithms import _add_decision_variable from cobra.solve...
jpadilla/django-extensions
refs/heads/master
django_extensions/jobs/minutely/__init__.py
1054
# coding=utf-8
devs1991/test_edx_docmode
refs/heads/master
venv/lib/python2.7/site-packages/piexif/__init__.py
1
from ._remove import remove from ._load import load from ._dump import dump from ._transplant import transplant from ._insert import insert from ._exif import * VERSION = '1.0.2'
mjirayu/sit_academy
refs/heads/master
lms/djangoapps/instructor/tests/test_enrollment.py
12
# -*- coding: utf-8 -*- """ Unit tests for instructor.enrollment methods. """ import json import mock from abc import ABCMeta from courseware.models import StudentModule from django.conf import settings from django.test import TestCase from django.utils.translation import get_language from django.utils.translation imp...
tinkerinestudio/Tinkerine-Suite
refs/heads/master
TinkerineSuite/python/Tools/Scripts/eptags.py
102
#! /usr/bin/env python """Create a TAGS file for Python programs, usable with GNU Emacs. usage: eptags pyfiles... The output TAGS file is usable with Emacs version 18, 19, 20. Tagged are: - functions (even inside other defs or classes) - classes eptags warns about files it cannot open. eptags will not give warning...
petrjasek/superdesk-core
refs/heads/master
apps/dictionaries/service.py
2
# -*- 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 io im...
MSOpenTech/edx-platform
refs/heads/master
common/djangoapps/track/management/tests/test_tracked_command.py
239
import json from StringIO import StringIO from django.test import TestCase from eventtracking import tracker as eventtracker from track.management.tracked_command import TrackedCommand class DummyCommand(TrackedCommand): """A locally-defined command, for testing, that returns the current context as a JSON strin...
eltoncarr/tubular
refs/heads/master
tubular/scripts/check_pr_against_branch.py
1
#! /usr/bin/env python3 """ Script to check if a PR's base is the specified branch. """ from __future__ import absolute_import from __future__ import print_function from os import path import sys import click # Add top-level module path to sys.path before importing tubular code. sys.path.append(path.dirname(path.dir...
ahartel/brick
refs/heads/master
source/python/pre_run/preRunHook.py
2
class preRunHook(object): def __init__(self,f): brick.add_pre_run_hook(f) def __call__(self,f): pass
adriano-arce/Interview-Problems
refs/heads/master
Sorting-Problems/Scheduling-Lunch/Scheduling-Lunch.py
1
from collections import deque class Scheduler(object): def __init__(self, schedule): self._schedule = Scheduler.preprocess(schedule) print(self._schedule) @staticmethod def preprocess(schedule): sorted_schedule = deque(sorted(schedule)) merged_schedule = [] while s...
indashnet/InDashNet.Open.UN2000
refs/heads/master
android/external/chromium/testing/gmock/scripts/generator/cpp/utils.py
1158
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions Copyright 2007 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...
ityaptin/ceilometer
refs/heads/master
ceilometer/agent/plugin_base.py
1
# # Copyright 2012 New Dream Network, LLC (DreamHost) # # 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...
porduna/flask-admin
refs/heads/master
flask_admin/contrib/mongoengine/fields.py
2
from werkzeug.datastructures import FileStorage from wtforms import fields from wtforms.fields.core import _unset_value from . import widgets class ModelFormField(fields.FormField): """ Customized ModelFormField for MongoEngine EmbeddedDocuments. """ def __init__(self, model, view, *args, **kwar...
Allow2CEO/browser-ios
refs/heads/master
brave/node_modules/hashset-cpp/vendor/depot_tools/third_party/coverage/annotate.py
55
"""Source file annotation for Coverage.""" import os, re from coverage.report import Reporter class AnnotateReporter(Reporter): """Generate annotated source files showing line coverage. This reporter creates annotated copies of the measured source files. Each .py file is copied as a .py,cover file, with...
simontakite/sysadmin
refs/heads/master
pythonscripts/programmingpython/Internet/Ftp/sousa.py
2
#!/usr/local/bin/python """ Usage: sousa.py. Fetch and play the Monty Python theme song. This will not work on your system as is: it requires a machine with Internet access and an FTP server account you can access, and uses audio filters on Unix and your .au player on Windows. Configure this and playfile.py as ...
Sharecare/cyclops
refs/heads/master
lib/passlib/_setup/stamp.py
21
"update version string during build" #============================================================================= # imports #============================================================================= from __future__ import with_statement # core import os import re import time from distutils.dist import Distributio...
hainm/pythran
refs/heads/master
pythran/transformations/normalize_method_calls.py
3
""" NormalizeMethodCalls turns built in method calls into function calls. """ from pythran.analyses import Globals from pythran.passmanager import Transformation from pythran.syntax import PythranSyntaxError from pythran.tables import attributes, functions, methods, MODULES import ast class NormalizeMethodCalls(Tra...
TheTypoMaster/chromium-crosswalk
refs/heads/master
native_client_sdk/src/build_tools/build_artifacts.py
12
#!/usr/bin/env 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. """Script to build binary components of the SDK. This script builds binary components of the Native Client SDK, create tarballs for th...
dacaiguoguo/ghost
refs/heads/master
ghost074/node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/default.py
364
# -*- coding: utf-8 -*- """ pygments.styles.default ~~~~~~~~~~~~~~~~~~~~~~~ The default highlighting style. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Name, Com...
adaptivelogic/django-cms
refs/heads/refactor-viewperms
cms/tests/nested_plugins.py
6
# -*- coding: utf-8 -*- from __future__ import with_statement from cms.api import create_page, add_plugin from cms.models import Page from cms.models.placeholdermodel import Placeholder from cms.models.pluginmodel import CMSPlugin from cms.plugins.text.models import Text from cms.tests.plugins import PluginsTestBaseCa...
Krossom/python-for-android
refs/heads/master
python-modules/twisted/twisted/internet/reactor.py
69
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ The reactor is the Twisted event loop within Twisted, the loop which drives applications using Twisted. The reactor provides APIs for networking, threading, dispatching events, and more. The default reactor is based on C{select(2)} ...
waytai/odoo
refs/heads/8.0
addons/hr_holidays/wizard/__init__.py
442
# -*- 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...
JasonVann/CLRS
refs/heads/master
S2_SortingAndOrderStatistics/C7_QuickSort/Ex7.1-1.py
1
# For CLRS Ex7.1-1 from quick_sort import * A = [13, 19, 9, 5, 12, 8, 7, 4, 21, 2, 6, 11] pivot = partition(A, 0, len(A) - 1) print(pivot, A)
n5047c/android_kernel_chagall
refs/heads/master
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
yousseb/django_pytds
refs/heads/master
tests/mssql_dbapi/tests.py
1
from __future__ import absolute_import import unittest # Base is used to get connection string using Django settings from sqlserver_ado import base # Internal dbapi module from sqlserver_ado import dbapi # Base unit test from . import dbapi20 class DbApiTest(dbapi20.DatabaseAPI20Test): driver = dbapi connec...
wenyu1001/scrapy
refs/heads/master
scrapy/spiders/init.py
95
from scrapy.spiders import Spider from scrapy.utils.spider import iterate_spider_output class InitSpider(Spider): """Base Spider with initialization facilities""" def start_requests(self): self._postinit_reqs = super(InitSpider, self).start_requests() return iterate_spider_output(self.init_re...
hgl888/buck
refs/heads/master
third-party/py/twitter-commons/src/python/twitter/common/python/http/tracer.py
23
from ..tracer import Tracer __all__ = ('TRACER',) TRACER = Tracer(predicate=Tracer.env_filter('TWITTER_COMMON_PYTHON_HTTP'), prefix='twitter.common.python.http: ')
nanolearningllc/edx-platform-cypress
refs/heads/master
common/djangoapps/django_locale/__init__.py
81
""" TODO: This module is imported from the stable Django 1.8 branch, as a copy of https://github.com/django/django/blob/stable/1.8.x/django/middleware/locale.py. Remove this file and re-import this middleware from Django once the codebase is upgraded with a modern version of Django. [PLAT-671] """
spcartman/python_qa
refs/heads/master
model/contact.py
1
from sys import maxsize class Contact: def __init__(self, id=None, fname=None, mname=None, lname=None, nick=None, title=None, company=None, address1=None, hphone=None, mphone=None, wphone=None, fax=None, email1=None, email2=None, email3=None, homepage=None, bday=None, bmonth=Non...
jmontoyam/mne-python
refs/heads/master
mne/io/array/array.py
3
"""Tools for creating Raw objects from numpy arrays""" # Authors: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import numpy as np from ..base import _BaseRaw from ..meas_info import Info from ...utils import verbose, logger class RawArray(_BaseRaw): """Raw object from numpy array Para...
RoAbreu/AulaJavaScripts
refs/heads/master
PROJETO/backend/appengine/apps/listaDicionarios_app/commands.py
2
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaebusiness.gaeutil import SaveCommand, ModelSearchCommand from gaeforms.ndb.form import ModelForm from gaegraph.business_base import UpdateNode from listaDicionarios_app.model import ListaDicionarios class ListaDicionariosPublicForm...
beatrizjesus/my-first-blog
refs/heads/master
pasta/Lib/site-packages/django/db/models/options.py
45
from __future__ import unicode_literals import warnings from bisect import bisect from collections import OrderedDict, defaultdict from itertools import chain from django.apps import apps from django.conf import settings from django.core.exceptions import FieldDoesNotExist from django.db.models.fields import AutoFiel...
pytroll/mpop
refs/heads/master
mpop/saturn/__init__.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009, 2014. # SMHI, # Folkborgsvägen 1, # Norrköping, # Sweden # Author(s): # Martin Raspaud <martin.raspaud@smhi.se> # Adam Dybbroe <adam.dybbroe@smhi.se> # This file is part of the mpop. # mpop is free software: you can redistribute it and/or modi...
Fl0rianFischer/sme_odoo
refs/heads/9.0
addons/website_payment/models/website.py
47
from openerp import api, models class Website(models.Model): _inherit = "website" @api.model def payment_acquirers(self): return list(self.env['payment.acquirer'].sudo().search([('website_published', '=', True)]))
untom/scikit-learn
refs/heads/master
examples/ensemble/plot_bias_variance.py
357
""" ============================================================ Single estimator versus bagging: bias-variance decomposition ============================================================ This example illustrates and compares the bias-variance decomposition of the expected mean squared error of a single estimator again...
echopen/PRJ-medtec_sigproc
refs/heads/master
EchoImageProcessing/EchoImageProcessing/data.py
5
__author__ = 'mehdibenchoufi' from constants import Constants import numpy as np class Data: def get_rows(self): return self.rows def set_rows(self, value): self.rows = value def get_larger_rows(self): return self.larger_rows def set_larger_rows(self, value): self....
etherkit/OpenBeacon2
refs/heads/master
client/macos/venv/lib/python3.8/site-packages/pip/_internal/utils/models.py
15
"""Utilities for defining models """ # The following comment should be removed at some point in the future. # mypy: disallow-untyped-defs=False import operator class KeyBasedCompareMixin(object): """Provides comparison capabilities that is based on a key """ __slots__ = ['_compare_key', '_defining_class...
samsu/neutron
refs/heads/master
db/migration/alembic_migrations/vpn_init_ops.py
17
# Copyright 2014 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 ...
meabsence/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/inspect.py
45
"""Get useful information from live Python objects. This module encapsulates the interface provided by the internal special attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module:...
fhaoquan/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/test_inspect.py
60
import collections import datetime import functools import importlib import inspect import io import linecache import os from os.path import normcase import _pickle import re import shutil import sys import types import unicodedata import unittest import unittest.mock try: from concurrent.futures import ThreadPool...
zorilla/python-automation
refs/heads/master
python/ssh_expect.py
1
#!/usr/bin/env python # # Platform independent expect-like behaviour over SSH # # mdeacon@zorillaeng.com # import paramiko from paramiko import SSHClient import logging logger = logging.getLogger(__name__) class SSHExpectException(Exception): def __init__(self, value): self.value = value def __str__(...
kevinmel2000/sl4a
refs/heads/master
python/src/Lib/test/test_poplib.py
58
import socket import threading import poplib import time from unittest import TestCase from test import test_support HOST = test_support.HOST def server(evt, serv): serv.listen(5) try: conn, addr = serv.accept() except socket.timeout: pass else: conn.send("+ Hola mundo\n") ...
monhustla/line-bot-sdk-python
refs/heads/master
tests/models/__init__.py
12
# -*- coding: utf-8 -*- # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
pgmcd/ansible
refs/heads/devel
test/integration/gce_credentials.py
275
import collections import os import yaml try: from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver _ = Provider.GCE except ImportError: print("failed=True " + \ "msg='libcloud with GCE support (0.13.3+) required for this module'") sys.exit(1) def a...
mauzeh/formation-flight
refs/heads/master
runs/validate/run.py
1
#!/usr/bin/env python """Simulation bootstrapper""" from formation_flight.formation import handlers as formation_handlers from formation_flight.aircraft import handlers as aircraft_handlers from formation_flight.aircraft import generators from formation_flight.hub import builders from formation_flight.hub import alloc...
jspargo/AneMo
refs/heads/master
django/lib/python2.7/site-packages/django/middleware/transaction.py
54
import warnings from django.core.exceptions import MiddlewareNotUsed from django.db import connection, transaction from django.utils.deprecation import RemovedInDjango18Warning class TransactionMiddleware(object): """ Transaction middleware. If this is enabled, each view function will be run with commit_...
esikachev/sahara-backup
refs/heads/master
sahara/plugins/cdh/client/role_config_groups.py
7
# Copyright (c) 2014 Intel Corporation. # # 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...
zhujzhuo/MySQL-5.6
refs/heads/mysql-5.6.11
xtrabackup/test/python/testtools/tests/test_content.py
42
# Copyright (c) 2008-2011 testtools developers. See LICENSE for details. import os import tempfile import unittest from testtools import TestCase from testtools.compat import ( _b, _u, StringIO, ) from testtools.content import ( attach_file, Content, content_from_file, content_from_str...
AndreyAyres/ArduinoJson
refs/heads/master
third-party/gtest-1.7.0/test/gtest_catch_exceptions_test.py
2139
#!/usr/bin/env python # # Copyright 2010 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list o...
hryamzik/ansible
refs/heads/devel
lib/ansible/modules/cloud/cloudstack/cs_user.py
37
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (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) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supporte...
iradul/phantomjs-clone
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/preparechangelog_unittest.py
122
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
2ndQuadrant/ansible
refs/heads/master
test/units/module_utils/aws/test_aws_module.py
68
# -*- coding: utf-8 -*- # (c) 2017, Michael De La Rue # # 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...
sstone/bitcoin
refs/heads/master
test/functional/p2p_segwit.py
5
#!/usr/bin/env python3 # Copyright (c) 2016-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test segwit transactions and blocks on P2P network.""" from decimal import Decimal import math import r...
CuonDeveloper/cuon
refs/heads/master
cuon_client/cuon/Addresses/SingleCountry.py
5
# -*- coding: utf-8 -*- ##Copyright (C) [2003] [Jürgen Hamel, D-32584 Löhne] ##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 ver...
xin3liang/platform_external_chromium_org_third_party_WebKit
refs/heads/master
Tools/Scripts/webkitpy/layout_tests/views/__init__.py
6014
# Required for Python to search this directory for module files
adtidiane/Nouabook
refs/heads/master
secretballot/views.py
2
from django.template import loader, RequestContext from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponseForbidden from django.db.models.base import ModelBase from django.contrib.contenttypes.models import ContentType from secretballot.m...
TanguyPatte/phantomjs-packaging
refs/heads/master
src/qt/qtwebkit/Source/ThirdParty/gtest/scripts/upload_gtest.py
1963
#!/usr/bin/env python # # Copyright 2009, 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...
wwf5067/statsmodels
refs/heads/master
statsmodels/examples/ex_ols_robustcov.py
33
from __future__ import print_function import numpy as np from statsmodels.regression.linear_model import OLS, GLSAR from statsmodels.tools.tools import add_constant from statsmodels.datasets import macrodata import statsmodels.regression.tests.results.results_macro_ols_robust as res d2 = macrodata.load().data g_gdp ...
eeshangarg/oh-mainline
refs/heads/master
vendor/packages/twisted/twisted/words/test/__init__.py
137
"Words tests"
wutali/sauron
refs/heads/master
sauron/emitters/CloudWatch.py
1
import urllib2 # Need this to determine our instance ID import datetime from sauron import logger from boto.sns import SNSConnection from boto.ec2.cloudwatch.alarm import MetricAlarm from boto.ec2.cloudwatch import connect_to_region from sauron.emitters import Emitter, EmitterException from boto.ec2.cloudwatch...
klingebj/regreg
refs/heads/master
code/regreg/setup.py
1
""" RegReg: A package to solve regularized regression problems """ import os, sys import string from Cython.Compiler import Main def cython_extension(srcfile): options = Main.CompilationOptions(include_path=[os.path.join(os.path.abspath(os.path.dirname(__file__)), 'include')]) Main.compile(srcfile, options=o...
dsfsdgsbngfggb/odoo
refs/heads/8.0
addons/crm/report/crm_lead_report.py
309
# -*- 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...
maehler/Synergy
refs/heads/master
src/python/export_motif_logo.py
1
import sys import argparse import urllib2 import json from time import time import os from subprocess import Popen, PIPE import config from meme_util import create_meme def run_meme2images(meme, format, out_dir): args = [ config.meme2images, '-%s' % (format), meme, out_dir ] p = Popen(args, shell=False) p....
SrNetoChan/QGIS
refs/heads/master
tests/src/python/test_qgshighlight.py
45
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsHighlight. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __au...
skosukhin/spack
refs/heads/esiwace
var/spack/repos/builtin/packages/braker/package.py
1
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
ssbarnea/ansible
refs/heads/devel
lib/ansible/plugins/callback/minimal.py
29
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' ...
omazapa/root-old
refs/heads/master
interpreter/llvm/src/tools/clang/tools/scan-view/startfile.py
98
"""Utility for opening a file using the default application in a cross-platform manner. Modified from http://code.activestate.com/recipes/511443/. """ __version__ = '1.1x' __all__ = ['open'] import os import sys import webbrowser import subprocess _controllers = {} _open = None class BaseController(object): ''...
mukheema/projEagleEye
refs/heads/master
strings/validate_email_addr.py
1
#!/usr/bin/python import re import optparse def validateEmailAddress(email=None): if not email: raise "Pass email address" if not isinstance(email, str): raise "Pass a email address string" emailCompilePattern = re.compile(r'(?P<EMAIL_ID>[^@]+)@(?P<COMPANY_NAME>[^@]+)\.(?P<DOMAIN>[^@|\d]+...
leonardoarroyo/django-google-address
refs/heads/master
google_address/tests/test_signals.py
1
from unittest import mock from django.test import TestCase from django.test.utils import override_settings from google_address.signals import address_post_save from google_address.models import Address class PostSaveSignalTestCase(TestCase): def setUp(self): self.instance = Address(raw="Chicago") self.inst...
ESS-LLP/erpnext-medical
refs/heads/develop
erpnext/assets/doctype/linked_location/linked_location.py
33
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class LinkedLocation(Document): pass
jasonlcrane/sked
refs/heads/master
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/ordered_dict.py
2354
# Unmodified from http://code.activestate.com/recipes/576693/ # other than to add MIT license header (as specified on page, but not in code). # Linked from Python documentation here: # http://docs.python.org/2/library/collections.html#collections.OrderedDict # # This should be deleted once Py2.7 is available on all bot...
mdanielwork/intellij-community
refs/heads/master
python/testData/selectWord/comma/after1.py
83
d = {'school_id':parent_id, "next": <selection>next</selection>}
cristian69/KernotekV3
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/__init__.py
1849
from __future__ import absolute_import from . import urllib3
iandees/all-the-places
refs/heads/master
locations/spiders/xpo_logistics.py
1
# -*- coding: utf-8 -*- import scrapy import re import ast from locations.items import GeojsonPointItem class XPOLogisticsSpider(scrapy.Spider): name = "xpo_logistics" allowed_domains = ["www.xpo.com"] start_urls = ( 'https://www.xpo.com/global-locations/', ) def parse(self, response): ...
setjet/spark
refs/heads/master
python/pyspark/sql/__init__.py
63
# # 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 us...
Lucas-Wong/ToolsProject
refs/heads/master
Download/ximalaya.py
1
# -*- coding: utf-8 -*- """ ----------------------------------------------------- File Name: ximalaya Author: Lucas.wang Date: 2018-11-28 15:34 Description: ----------------------------------------------------- Change Activity: 2018-11-28 15:34 Description: ...
casselineau/Tracer
refs/heads/master
tests/test_ray_bundle.py
2
# Test suit for the ray_bundle module import math import unittest import numpy as N from scipy import stats import tracer.ray_bundle as RB from tracer.sources import solar_disk_bundle class TestInheritance(unittest.TestCase): def test_inherit_empty_from_empty(self): """Inherit empty bundle completely"""...
Fillll/reddit2telegram
refs/heads/master
reddit2telegram/channels/r_polandball/app.py
1
#encoding:utf-8 from utils import weighted_random_subreddit # Subreddit that will be a source of content subreddit = weighted_random_subreddit({ 'polandball': 1.0, # If we want get content from several subreddits # please provide here 'subreddit': probability # 'any_other_subreddit': 0.02 }) # Telegr...
INM-6/python-neo
refs/heads/master
neo/rawio/neuroscoperawio.py
3
""" Reading from neuroscope format files. Ref: http://neuroscope.sourceforge.net/ It is an old format from Buzsaki's lab Some old open datasets from spike sorting are still using this format. This only the signals. This should be done (but maybe never will): * SpikeTrain file '.clu' '.res' * Event '.ext.evt'...
albertomurillo/ansible
refs/heads/devel
test/runner/lib/cloud/vultr.py
14
"""Vultr plugin for integration tests.""" from __future__ import absolute_import, print_function import os from lib.cloud import ( CloudProvider, CloudEnvironment, CloudEnvironmentConfig, ) from lib.util import ConfigParser class VultrCloudProvider(CloudProvider): """Checks if a configuration file ...
adael/goldminer
refs/heads/master
goldminer/geom.py
1
import enum import math class Rect: @classmethod def from_points(cls, x1, y1, x2, y2): return cls(x1, y1, x2 - x1, y2 - y1) @classmethod def from_rect(cls, other): return cls(other.x, other.y, other.w, other.h) def __init__(self, x=0, y=0, w=0, h=0): self.x = x se...
imoseyon/leanKernel-d2usc-deprecated
refs/heads/lk-tw
external/webkit/Tools/Scripts/webkitpy/thirdparty/simplejson/decoder.py
15
""" Implementation of JSONDecoder """ import re from scanner import Scanner, pattern FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): import struct import sys _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') if sys.byteorder != 'big': _BYTES = _BYTES[:8][::-1] + _...
dharmabumstead/ansible
refs/heads/devel
lib/ansible/modules/network/junos/junos_lldp.py
12
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # 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', ...
vaginessa/pyload
refs/heads/stable
module/plugins/crypter/Movie2KTo.py
15
# -*- coding: utf-8 -*- from module.plugins.internal.DeadCrypter import DeadCrypter, create_getInfo class Movie2KTo(DeadCrypter): __name__ = "Movie2KTo" __type__ = "crypter" __version__ = "0.52" __status__ = "testing" __pattern__ = r'http://(?:www\.)?movie2k\.to/(.+)\.html' __config__...