repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
naousse/odoo
refs/heads/8.0
addons/web_linkedin/__openerp__.py
383
{ 'name' : 'LinkedIn Integration', 'version': '0.1', 'category': 'Tools', 'complexity': 'easy', 'description': """ OpenERP Web LinkedIn module. ============================ This module provides the Integration of the LinkedIn with OpenERP. """, 'data': [ 'web_linkedin_vie...
petemounce/ansible
refs/heads/devel
test/integration/consul_running.py
364
''' Checks that the consul agent is running locally. ''' if __name__ == '__main__': try: import consul consul = consul.Consul(host='0.0.0.0', port=8500) consul.catalog.nodes() print("True") except: pass
lihui7115/ChromiumGStreamerBackend
refs/heads/master
tools/perf/page_sets/key_mobile_sites.py
8
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import shared_page_state from telemetry import story from page_sets import key_mobile_site...
regardscitoyens/Collaborateurs-Senat
refs/heads/master
bin/convert.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, re, json filepath = sys.argv[1] with open(filepath, 'r') as xml_file: xml = xml_file.read() drawMap = False if len(sys.argv) > 2: drawMap = True minl = 100 mint = 200 maxt = 1100 l1 = 300 parls_type = "senateurs" parls_first = True if "senateurs_coll...
ChinaQuants/PTVS
refs/heads/master
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/utf_32_le.py
101
""" Python 'utf-32-le' Codec """ import codecs ### Codec APIs encode = codecs.utf_32_le_encode def decode(input, errors='strict'): return codecs.utf_32_le_decode(input, errors, True) class IncrementalEncoder(codecs.IncrementalEncoder): def encode(self, input, final=False): return codec...
vincepandolfo/django
refs/heads/master
django/contrib/gis/db/backends/postgis/models.py
75
""" The GeometryColumns and SpatialRefSys models for the PostGIS backend. """ from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class PostGISGeometryColumns(models.Model): ...
HydrelioxGitHub/home-assistant
refs/heads/dev
homeassistant/components/default_config/__init__.py
2
"""Component providing default configuration for new users.""" DOMAIN = 'default_config' DEPENDENCIES = ( 'automation', 'cloud', 'config', 'conversation', 'discovery', 'frontend', 'history', 'logbook', 'map', 'mobile_app', 'person', 'script', 'sun', 'system_healt...
jcoady9/python-for-android
refs/heads/master
python-modules/twisted/twisted/words/protocols/__init__.py
93
"Chat protocols"
bliti/tienda
refs/heads/master
wsgi.py
1
""" WSGI config for tienda project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tienda.settings") from django.core.wsg...
trishnaguha/ansible
refs/heads/devel
lib/ansible/modules/storage/netapp/na_ontap_volume.py
16
#!/usr/bin/python # (c) 2018, NetApp, 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', 'status': ['preview'], ...
fxfitz/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_gtm_global.py
20
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks 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 import os import json import pytest import sys from nose.plugins.skip i...
GetSomeBlocks/ServerStatus
refs/heads/master
resources/test/mythboxtest/ui/test_player.py
6
# # MythBox for XBMC - http://mythbox.googlecode.com # Copyright (C) 2011 analogue@yahoo.com # # 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 you...
tmm1/pygments.rb
refs/heads/master
vendor/pygments-main/pygments/lexers/inferno.py
1
# -*- coding: utf-8 -*- """ pygments.lexers.inferno ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for Inferno os and all the related stuff. :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, by...
dkodnik/arp
refs/heads/master
addons/website/models/res_config.py
105
from openerp.osv import fields, osv class website_config_settings(osv.osv_memory): _name = 'website.config.settings' _inherit = 'res.config.settings' _columns = { 'website_id': fields.many2one('website', string="website", required=True), 'language_ids': fields.related('website_id', 'lang...
alvaroaleman/ansible
refs/heads/devel
lib/ansible/plugins/lookup/first_found.py
14
# (c) 2013, seth vidal <skvidal@fedoraproject.org> red hat, 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 optio...
community-ssu/alarmd
refs/heads/master
build_tools/resolve_syms.py
1
#! /usr/bin/env python # ============================================================================ # # This file is part of Alarmd # # Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). # # Contact: Simo Piiroinen <simo.piiroinen@nokia.com> # # Alarmd is free software; you can redistribute i...
bionikspoon/Annotation-Tool
refs/heads/develop
server/annotation_tool/contrib/sites/migrations/0001_initial.py
1
from __future__ import unicode_literals from django.db import models, migrations import django.contrib.sites.models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Site', fields=[ ('id', models.AutoFi...
jlisee/statepy
refs/heads/master
statepy/core.py
1
# Copyright (c) 2009, Joseph Lisee # 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 an...
tmenjo/cinder-2015.1.1
refs/heads/master
cinder/tests/test_block_device.py
8
# Copyright (c) 2013 Mirantis, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
xpndlabs/kivy
refs/heads/master
kivy/config.py
10
''' Configuration object ==================== The :class:`Config` object is an instance of a modified Python ConfigParser. See the `ConfigParser documentation <http://docs.python.org/library/configparser.html>`_ for more information. Kivy has a configuration file which determines the default settings. In order to cha...
phektus/Django-Google-AppEngine-OpenId-Auth
refs/heads/master
django/contrib/gis/geos/prototypes/coordseq.py
624
from ctypes import c_double, c_int, c_uint, POINTER from django.contrib.gis.geos.libgeos import GEOM_PTR, CS_PTR from django.contrib.gis.geos.prototypes.errcheck import last_arg_byref, GEOSException from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc ## Error-checking routines specific to coordinate seq...
tysonholub/twilio-python
refs/heads/master
twilio/base/exceptions.py
2
# -*- coding: utf-8 -*- import sys from six import u class TwilioException(Exception): pass class TwilioRestException(TwilioException): """ A generic 400 or 500 level exception from the Twilio API :param int status: the HTTP status that was returned for the exception :param str uri: The URI that c...
ivan-fedorov/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/databrowse/datastructures.py
312
""" These classes are light wrappers around Django's database API that provide convenience functionality and permalink functions for the databrowse app. """ from django.db import models from django.utils import formats from django.utils.text import capfirst from django.utils.encoding import smart_unicode, smart_str, i...
davidharrigan/django
refs/heads/master
tests/template_tests/syntax_tests/test_verbatim.py
521
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class VerbatimTagTests(SimpleTestCase): @setup({'verbatim-tag01': '{% verbatim %}{{bare }}{% endverbatim %}'}) def test_verbatim_tag01(self): output = self.engine.render_to_string('verb...
sarlalian/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...
Ragowit/fireplace
refs/heads/master
fireplace/cards/blackrock/__init__.py
10
from .adventure import * from .brawl import * from .collectible import *
HyperBaton/ansible
refs/heads/devel
lib/ansible/modules/storage/netapp/na_ontap_snapmirror.py
19
#!/usr/bin/python # (c) 2018-2019, NetApp, 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', 'status': ['preview'], ...
Johnzero/erp
refs/heads/fga
openerp/addons/sale/report/sale_order.py
10
# -*- 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...
ministryofjustice/slumber
refs/heads/master
tests/serializer.py
2
import unittest import slumber import slumber.serialize class ResourceTestCase(unittest.TestCase): def test_json_get_serializer(self): s = slumber.serialize.Serializer() for content_type in [ "application/json", "application/x-javas...
MidwestCommunications/django-askmeanything
refs/heads/master
project/views.py
1
from django.shortcuts import render_to_response def polldone(request): return render_to_response('polldone.html', {'current_user': request.user})
Depado/pexpect
refs/heads/master
tests/echo_wait.py
20
#!/usr/bin/env python ''' PEXPECT LICENSE This license is approved by the OSI and FSF as GPL-compatible. http://opensource.org/licenses/isc-license.txt Copyright (c) 2012, Noah Spurrier <noah@noah.org> PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY PURPOSE WITH OR WIT...
TomT0m/fabulous
refs/heads/master
fabulous/grapefruit.py
1
#!/usr/bin/python # -*- coding: utf-8 -*-# # Copyright (c) 2008, Xavier Basty # # 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 req...
skyling/shadowsocks
refs/heads/master
setup.py
929
import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name="shadowsocks", version="2.8.2", license='http://www.apache.org/licenses/LICENSE-2.0', description="A fast tunnel proxy that help you get through firewalls", ...
vbshah1992/microblog
refs/heads/master
flask/lib/python2.7/site-packages/openid/extensions/ax.py
166
# -*- test-case-name: openid.test.test_ax -*- """Implements the OpenID Attribute Exchange specification, version 1.0. @since: 2.1.0 """ __all__ = [ 'AttributeRequest', 'FetchRequest', 'FetchResponse', 'StoreRequest', 'StoreResponse', ] from openid import extension from openid.server.trustroot...
wikimedia/operations-debs-python-diamond
refs/heads/master
src/collectors/squid/test/testsquid.py
35
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from diamond.collector import Collector from squid import Sq...
mameneses/python-deployment
refs/heads/master
venv/lib/python2.7/site-packages/pip/__init__.py
176
#!/usr/bin/env python import os import optparse import sys import re from pip.exceptions import InstallationError, CommandError, PipError from pip.log import logger from pip.util import get_installed_distributions, get_prog from pip.vcs import git, mercurial, subversion, bazaar # noqa from pip.baseparser import Conf...
asa93/Batch
refs/heads/master
web/bundles/train/bootstrap/test-infra/s3_cache.py
2166
#!/usr/bin/env python2.7 # pylint: disable=C0301 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, chdir, remove as _delete_file from os.path import dirname, basename, abspath, realpath, expandvars from hashlib import sha256 from subpr...
android-ia/platform_external_chromium_org
refs/heads/master
build/android/pylib/instrumentation/test_result.py
110
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from pylib.base import base_test_result class InstrumentationTestResult(base_test_result.BaseTestResult): """Result information for a single instrume...
tholum/PiBunny
refs/heads/master
system.d/library/tools_installer/tools_to_install/responder/tools/MultiRelay/creddump/cachedump.py
1
#!/usr/bin/env python # This file is part of creddump. # # creddump 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. # # creddump is di...
foodszhang/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/linecache.py
97
"""Cache lines from files. This is intended to read lines from modules imported -- hence if a filename is not found, it will look down the module search path for a file by that name. """ import sys import os import tokenize __all__ = ["getline", "clearcache", "checkcache"] def getline(filename, lineno, module_globa...
samatdav/zulip
refs/heads/master
confirmation/migrations/0001_initial.py
167
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0001_initial'), ] operations = [ migrations.CreateModel( name='Confirmation', fields...
superdesk/superdesk-core
refs/heads/develop
tests/templates/content_templates_test.py
2
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014, 2015 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...
roadmapper/ansible
refs/heads/devel
lib/ansible/modules/cloud/podman/podman_container_info.py
10
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2019 Ansible Project # 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', 'sta...
arvinsingla/CouchPotatoServer
refs/heads/master
libs/rtorrent/__init__.py
64
# Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com> # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, ...
balloob/home-assistant
refs/heads/dev
homeassistant/bootstrap.py
3
"""Provide methods to bootstrap a Home Assistant instance.""" import asyncio import contextlib from datetime import datetime import logging import logging.handlers import os import sys import threading from time import monotonic from typing import TYPE_CHECKING, Any, Dict, Optional, Set import voluptuous as vol import...
miguelgrinberg/api-pycon2015
refs/heads/master
manage.py
5
#!/usr/bin/env python from flask import Flask, g, jsonify from flask.ext.script import Manager from api.app import create_app from api.models import db, User, Class manager = Manager(create_app) @manager.command def createdb(testdata=False): app = create_app() with app.app_context(): db.drop_all() ...
danieljabailey/inkscape_experiments
refs/heads/master
share/extensions/color_removeblue.py
7
#!/usr/bin/env python import coloreffect class C(coloreffect.ColorEffect): def colmod(self,r,g,b): return '%02x%02x%02x' % (r,g,0) c = C() c.affect()
broferek/ansible
refs/heads/devel
lib/ansible/modules/network/dellos6/dellos6_facts.py
50
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # Copyright (c) 2016 Dell 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_versio...
pasqualguerrero/django
refs/heads/master
tests/generic_views/test_dates.py
190
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, override_settings, skipUnlessDBFeature from django.test.utils import requires_tz_support from django.utils import timezone from .models import Arti...
karthik339/Agni
refs/heads/master
MainDemo/venv/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py
294
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Or...
peertracksinc/muse
refs/heads/muse
programs/genesis_util/change_key_prefix.py
12
#!/usr/bin/env python3 import argparse import json import sys def dump_json(obj, out, pretty): if pretty: json.dump(obj, out, indent=2, sort_keys=True) else: json.dump(obj, out, separators=(",", ":"), sort_keys=True) return def main(): parser = argparse.ArgumentParser(description="Set...
Jaiz909/youtube-dl
refs/heads/master
youtube_dl/extractor/muenchentv.py
160
# coding: utf-8 from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, js_to_json, ) class MuenchenTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?muenchen\.tv/livestream' IE_DESC = 'münchen.tv' _TEST = {...
szeged/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/capture.py
32
""" per-test stdout/stderr capturing mechanism. """ from __future__ import absolute_import, division, print_function import collections import contextlib import sys import os import io from io import UnsupportedOperation from tempfile import TemporaryFile import six import pytest from _pytest.compat import CaptureIO...
mmalecki/util-linux
refs/heads/master
libmount/python/__init__.py
44
from .pylibmount import *
linktlh/Toontown-journey
refs/heads/master
toontown/fishing/GenusPanel.py
4
from toontown.toonbase import ToontownGlobals from direct.directnotify import DirectNotifyGlobal from direct.gui.DirectGui import * from pandac.PandaModules import * from toontown.toonbase import TTLocalizer import FishBase import FishGlobals import FishPhoto class GenusPanel(DirectFrame): notify = DirectNotifyGlo...
crakensio/django_training
refs/heads/master
lib/python2.7/site-packages/django/db/backends/mysql/creation.py
114
from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated MySQL column # types, as strings. Column-type strings can contain format strings; they'll # be interpolated against the values of Field.__dict_...
tulip-control/tulip-control
refs/heads/master
tulip/spec/transformation.py
1
# Copyright (c) 2014, 2015 by California Institute of Technology # All rights reserved. # # 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...
svub/whatsapp-rest-webservice
refs/heads/master
service/yowsup/yowsup/layers/protocol_chatstate/protocolentities/chatstate_outgoing.py
70
from .chatstate import ChatstateProtocolEntity class OutgoingChatstateProtocolEntity(ChatstateProtocolEntity): ''' INCOMING <chatstate from="xxxxxxxxxxx@s.whatsapp.net"> <{{composing|paused}}></{{composing|paused}}> </chatstate> OUTGOING <chatstate to="xxxxxxxxxxx@s.whatsapp.net"> <{{...
akbarpn136/logapp-dj
refs/heads/master
perek_laporan/apps.py
1
from django.apps import AppConfig class PerekLaporanConfig(AppConfig): name = 'perek_laporan'
ldjebran/robottelo
refs/heads/master
robottelo/cli/srpm.py
2
# -*- encoding: utf-8 -*- """ Usage: hammer srpm [OPTIONS] SUBCOMMAND [ARG] ... Parameters: SUBCOMMAND Subcommand [ARG] ... Subcommand arguments Subcommands: info Show a SRPM Details list List srpms """ from robottelo.cli...
paweljasinski/ironpython3
refs/heads/master
Src/StdLib/Lib/ctypes/test/test_wintypes.py
49
import sys import unittest if not sys.platform.startswith('win'): raise unittest.SkipTest('Windows-only test') from ctypes import * from ctypes import wintypes class WinTypesTest(unittest.TestCase): def test_variant_bool(self): # reads 16-bits from memory, anything non-zero is True for true_v...
sholtebeck/knarflog
refs/heads/master
lib/markupsafe/_constants.py
27
# -*- coding: utf-8 -*- """ markupsafe._constants ~~~~~~~~~~~~~~~~~~~~~ :copyright: 2010 Pallets :license: BSD-3-Clause """ HTML_ENTITIES = { "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Alpha": 913, "Aring": 197, "Atilde": 195, "Auml": 196, "Beta": 914, "Ccedil":...
matthappens/taskqueue
refs/heads/master
taskqueue/venv_tq/lib/python2.7/site-packages/boto/rds/dbsubnetgroup.py
170
# Copyright (c) 2013 Franc Carter - franc.carter@gmail.com # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modif...
etherkit/OpenBeacon2
refs/heads/master
client/macos/venv/lib/python3.8/site-packages/PyInstaller/hooks/hook-PySide2.QtXml.py
4
#----------------------------------------------------------------------------- # Copyright (c) 2013-2020, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt...
TarasRudnyk/scrapy
refs/heads/master
scrapy/telnet.py
141
""" Scrapy Telnet Console extension See documentation in docs/topics/telnetconsole.rst """ import pprint import logging from twisted.internet import protocol try: from twisted.conch import manhole, telnet from twisted.conch.insults import insults TWISTED_CONCH_AVAILABLE = True except ImportError: TWI...
yatbear/nlangp
refs/heads/master
hmm/preprocess.py
2
#! /usr/bin/env python __author__ = "yatbear <sapphirejyt@gmail.com>" __date__ = "$Dec 21, 2015" # Map the infrequent words (count < 5) to a common symbol _RARE_ def remap(): # Read original training data trainset = [line.strip().split() for line in open('gene.train', 'r').readlines()] rare_candidates = d...
cheeseywhiz/cheeseywhiz
refs/heads/master
math/Extend Normal/main.py
1
from math import atan, cos, sin import matplotlib.pyplot as plt xmin, xmax = -10, 10 ymin, ymax = -8, 8 dx_ = (xmax - xmin) / 10000 def in_domain(f, x): try: f(x) return True # f(x) exists; x is in domain of f except Exception: return False # f(x) raised an error; x is ...
pfohjo/nitro-kmod
refs/heads/master
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
lzw120/django
refs/heads/master
build/lib/django/contrib/localflavor/fr/forms.py
86
""" FR-specific Form helpers """ from __future__ import absolute_import import re from django.contrib.localflavor.fr.fr_department import DEPARTMENT_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.ut...
Ramshackle-Jamathon/Interactive-Experiments
refs/heads/master
SpaceMan-2.0/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py
2479
#!/usr/bin/env python # Copyright (c) 2013 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. """ Unit tests for the xcode.py file. """ import gyp.generator.xcode as xcode import unittest import sys class TestEscapeXcodeDefine(unit...
Zack-Tillotson/open-door-the-game
refs/heads/master
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/xcode_test.py
2479
#!/usr/bin/env python # Copyright (c) 2013 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. """ Unit tests for the xcode.py file. """ import gyp.generator.xcode as xcode import unittest import sys class TestEscapeXcodeDefine(unit...
asadziach/tensorflow
refs/heads/pedestrian_detection_walabot_tf
tensorflow/python/kernel_tests/multinomial_op_test.py
56
# 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...
wanggang3333/scikit-learn
refs/heads/master
examples/cluster/plot_birch_vs_minibatchkmeans.py
333
""" ================================= Compare BIRCH and MiniBatchKMeans ================================= This example compares the timing of Birch (with and without the global clustering step) and MiniBatchKMeans on a synthetic dataset having 100,000 samples and 2 features generated using make_blobs. If ``n_clusters...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/tangible/loot/misc/firework_dud_s2.py
85615
import sys def setup(core, object): return
danuker/trading-with-python
refs/heads/master
lib/indicators.py
77
''' Created on Jul 3, 2014 author: Jev Kuznetsov License: BSD Description: Module containing some (technical) indicators ''' import pandas as pd def rsi(price, n=14): ''' rsi indicator ''' gain = price.diff().fillna(0) # fifference between day n and n-1, replace nan (first value) with 0 ...
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks
refs/heads/master
Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py3/solnlib/packages/requests/adapters.py
79
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import os.path import socket from urllib3.poolmanager import PoolManager, proxy_from_url from urllib3.response import HTTPResponse from urllib3.util ...
henriknelson/micropython
refs/heads/master
tests/basics/frozenset_difference.py
41
try: frozenset except NameError: print("SKIP") raise SystemExit l = [1, 2, 3, 4] s = frozenset(l) outs = [s.difference(), s.difference(frozenset({1})), s.difference(frozenset({1}), [1, 2]), s.difference(frozenset({1}), {1, 2}, {2, 3})] for out in outs: print(type(out), sorted(ou...
frappe/erpnext
refs/heads/develop
erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py
12
from __future__ import unicode_literals import frappe def pre_process(issue): project = frappe.db.get_value('Project', filters={'project_name': issue.milestone}) return { 'title': issue.title, 'body': frappe.utils.md_to_html(issue.body or ''), 'state': issue.state.title(), 'project': project or '' }
CasparLi/calibre
refs/heads/master
src/calibre/gui2/lrf_renderer/document.py
15
__license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' import collections, itertools, glob from PyQt5.Qt import ( Qt, QByteArray, pyqtSignal, QGraphicsRectItem, QGraphicsScene, QPen, QBrush, QColor, QFontDatabase, QGraphicsItem, QGraphicsLineItem) from calibre.gui2.lrf_renderer...
mastizada/kuma
refs/heads/master
kuma/wiki/migrations/0038_auto__add_field_revision_render_max_age__add_field_revision_render_exp.py
5
# -*- 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 field 'Revision.render_max_age' db.add_column('wiki_revision', 'render_max_age', ...
meejah/AutobahnPython
refs/heads/master
examples/twisted/websocket/wrapping/server_endpoint.py
13
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
eckucukoglu/arm-linux-gnueabihf
refs/heads/master
lib/python2.7/encodings/cp852.py
593
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP852.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'): ...
maisilex/Lets-Begin-Python
refs/heads/master
happy_ticket.py
1
s = str(input()) sum1=int(s[0])+int(s[1])+int(s[2]) sum2=int(s[3])+int(s[4])+int(s[5]) if sum1==sum2: print('Happy!!!') else: print('Simple')
emilk/sproxel
refs/heads/master
distro/common/lib/multiprocessing/util.py
5
# # Module providing various facilities to other parts of the package # # multiprocessing/util.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met:...
peterfpeterson/mantid
refs/heads/master
scripts/test/SANS/gui_logic/add_runs_presenter_test.py
3
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
steinwurf/yaml-cpp
refs/heads/master
test/gmock-1.7.0/scripts/generator/cpp/tokenize.py
679
#!/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...
detiber/lib_openshift
refs/heads/master
test/test_v1_persistent_volume_access_mode.py
2
# coding: utf-8 """ OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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 ...
minorua/QGIS
refs/heads/master
python/plugins/processing/gui/BatchPanel.py
4
# -*- coding: utf-8 -*- """ *************************************************************************** BatchPanel.py --------------------- Date : November 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com *************...
jounex/hue
refs/heads/master
desktop/core/ext-py/lxml/src/lxml/html/tests/test_diff.py
48
import unittest, sys from lxml.tests.common_imports import make_doctest, doctest from lxml.html import diff def test_suite(): suite = unittest.TestSuite() if sys.version_info >= (2,4): suite.addTests([make_doctest('test_diff.txt'), doctest.DocTestSuite(diff)]) return suite ...
ragavvenkatesan/Convolutional-Neural-Networks
refs/heads/master
setup.py
1
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='yann', version='1.0rc1', description='Toolbox for building and le...
agriffis/django-allauth
refs/heads/master
allauth/socialaccount/providers/oauth/models.py
4209
# Create your models here.
akkufix/Omni_kernel_ge444_m7ul
refs/heads/master
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
rhijul/jaikuengine
refs/heads/master
blob/models.py
1073
# Copyright 2009 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 or agreed to in writing, ...
liang0-0/emq-lwm2m
refs/heads/master
integration_test/case2.py
1
import sys, time import paho.mqtt.client as mqtt quit_now = False DeviceId = "jXtestlwm2m" test_step = 0 def on_connect(mqttc, userdata, flags, rc): global DeviceId json = "{\"CmdID\":5,\"Command\":\"Execute\",\"BaseName\":\"/3/0/4\"}" mqttc.publish("lwm2m/"+DeviceId+"/command", json) def on_message(...
Tesora-Release/tesora-horizon
refs/heads/master
horizon/test/test_dashboards/dogs/puppies/panel.py
102
# 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 # distributed under t...
agry/NGECore2
refs/heads/master
scripts/object/static/structure/naboo/gungan_filler_building_s02.py
85615
import sys def setup(core, object): return
blancltd/django-haystack
refs/heads/master
test_haystack/whoosh_tests/test_forms.py
13
# encoding: utf-8 """Tests for Whoosh spelling suggestions""" from __future__ import absolute_import, division, print_function, unicode_literals from django.conf import settings from django.http import HttpRequest from haystack.forms import SearchForm from haystack.query import SearchQuerySet from haystack.views impo...
pentestfail/TA-FireEye_TAP
refs/heads/master
bin/ta_fireeye_tap/solnlib/packages/simpleyaml/loader.py
277
__all__ = ['BaseLoader', 'SafeLoader', 'Loader'] from .reader import * from .scanner import * from .parser import * from .composer import * from .constructor import * from .resolver import * class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): def __init__(self, stream): R...
charbeljc/OCB
refs/heads/8.0
openerp/modules/db.py
442
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
1and1/confluencer
refs/heads/master
src/tests/conftest.py
1
# -*- coding: utf-8 -*- # pylint: disable= """ py.test dynamic configuration. For details needed to understand these tests, refer to: https://pytest.org/ http://pythontesting.net/start-here/ """ # Copyright © 2015 1&1 Group <git@1and1.com> # # Licensed under the Apache License, Version 2.0 (the "L...