repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
elventear/ansible-modules-core | refs/heads/devel | network/junos/junos_package.py | 50 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
OSSESAC/odoopubarquiluz | refs/heads/7.0 | addons/stock/product.py | 1 | # -*- 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... |
michalochman/complex-networks | refs/heads/master | code/create-network-gexf.py | 1 | import os
from xml.sax.saxutils import escape
import MySQLdb
from MySQLdb.cursors import SSDictCursor
import sys
from scur_mgr import DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_TABLE_USERS, DB_TABLE_WORDS, DB_TABLE_RELATIONSHIPS
bucket = 1
if len(sys.argv) > 1 and sys.argv[1].isdigit():
bucket = int(sys.argv[1])
__di... |
BiznetGIO/horizon | refs/heads/stable/pike-gio | openstack_dashboard/dashboards/project/routers/ports/forms.py | 2 | # Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... |
Zord13appdesa/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_int_literal.py | 182 | """Test correct treatment of hex/oct constants.
This is complex because of changes due to PEP 237.
"""
import unittest
from test import support
class TestHexOctBin(unittest.TestCase):
def test_hex_baseline(self):
# A few upper/lowercase tests
self.assertEqual(0x0, 0X0)
self.assertEqual(0... |
ujenmr/ansible | refs/heads/devel | lib/ansible/modules/cloud/google/gcp_cloudbuild_trigger_facts.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
tvtsoft/odoo8 | refs/heads/master | addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 2 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from datetime import datetime
from dateutil.relativedelta import relativedelta
from pytz import timezone
import pytz
from openerp.osv import fields, osv
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, ... |
sysadminmatmoz/ingadhoc | refs/heads/8.0 | project_task_activity/__openerp__.py | 4 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... |
VioletRed/script.module.urlresolver | refs/heads/master | lib/urlresolver/plugins/exashare.py | 1 | """
Exashare.com urlresolver XBMC Addon
Copyright (C) 2014 JUL1EN094
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This pro... |
wyn/heroku-buildpack-python | refs/heads/master | vendor/virtualenv-1.7/virtualenv.py | 77 | #!/usr/bin/env python
"""Create a "virtual" Python installation
"""
# If you change the version here, change it in setup.py
# and docs/conf.py as well.
virtualenv_version = "1.7"
import base64
import sys
import os
import optparse
import re
import shutil
import logging
import tempfile
import zlib
import errno
import d... |
acsone/stock-logistics-workflow | refs/heads/8.0 | stock_ownership_availability_rules/tests/test_delivery_with_owner.py | 6 | # -*- coding: utf-8 -*-
# Author: Leonardo Pistone
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or... |
jacobajit/ion | refs/heads/master | intranet/apps/emerg/api.py | 1 | # -*- coding: utf-8 -*-
import logging
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from .views import get_emerg
logger = logging.getLogger(__name__)
@api_view(('GET',))
# @renderer_classes((JSONRend... |
samuelsh/pyFstress | refs/heads/master | io_tools/msrsync_sim.py | 1 | #!/usr/bin/env python3.6
"""
author: samuels
"""
import argparse
import hashlib
import os
import queue
import sys
import random
import threading
sys.path.append(os.path.join(os.path.join('../')))
from concurrent.futures import ThreadPoolExecutor
from threading import Event
from client.generic_mounter import Mounter
... |
bernardokyotoku/skillplant | refs/heads/master | django/contrib/formtools/models.py | 13 | """ models.py (even empty) currently required by the runtests.py to enable unit tests """
|
ML-Design/ta-kernel | refs/heads/master | tools/perf/scripts/python/failed-syscalls-by-pid.py | 944 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
indhub/mxnet | refs/heads/master | example/nce-loss/toy_nce.py | 27 | # 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... |
rootdefyxt320/android_kernel_motorola_tinboost | refs/heads/xda | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
epitron/youtube-dl | refs/heads/master | youtube_dl/extractor/nationalgeographic.py | 6 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .adobepass import AdobePassIE
from .theplatform import ThePlatformIE
from ..utils import (
smuggle_url,
url_basename,
update_url_query,
get_element_by_class,
)
class NationalGeographicVideoIE(InfoExtractor):
... |
misterhat/youtube-dl | refs/heads/master | youtube_dl/extractor/foxsports.py | 32 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
smuggle_url,
update_url_query,
)
class FoxSportsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?foxsports\.com/(?:[^/]+/)*(?P<id>[^/]+)'
_TEST = {
'url': 'http://www.foxsports.com/video?vid=4... |
certik/sympy-oldcore | refs/heads/master | sympy/polynomials/tests/test_polynomials.py | 1 | import sys
sys.path.append(".")
import py
from sympy import *
from sympy.core.basic import S # Use Singleton comparisons.
Pi = pi
## sympy/modules/polynomials/base.py
def test_Polynomial():
x = Symbol("x")
y = Symbol("y")
z = Symbol('z')
f = Polynomial(x+2)
g = Polynomial(y**2-1)
h = f + g
... |
franzelunico/Moviestar | refs/heads/master | Moviestar/Moviestar/urls.py | 1 | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),
)
|
tychotatitscheff/OpenShadingLanguage | refs/heads/master | testsuite/color/run.py | 68 | #!/usr/bin/python
command = testshade("-g 2 2 test")
|
bubichain/blockchain | refs/heads/master | src/3rd/src/jsoncpp/scons-2.1.0/engine/SCons/Memoize.py | 21 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
#
# 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
# with... |
solashirai/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/xml/factories.py | 42 | """
Factories for generating edXML for testing XModule import
"""
import inspect
from fs.memoryfs import MemoryFS
from factory import Factory, lazy_attribute, post_generation, Sequence
from lxml import etree
from xmodule.modulestore.inheritance import InheritanceMixin
from xmodule.x_module import XModuleMixin
from x... |
EdwinKato/bucket-list | refs/heads/master | backend/migrations/env.py | 127 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config ... |
DeltaEpsilon-HackFMI2/FMICalendar-REST | refs/heads/master | venv/lib/python2.7/site-packages/psycopg2/extras.py | 16 | """Miscellaneous goodies for psycopg2
This module is a generic place used to hold little helper functions
and classes until a better place in the distribution is found.
"""
# psycopg/extras.py - miscellaneous extra goodies for psycopg
#
# Copyright (C) 2003-2010 Federico Di Gregorio <fog@debian.org>
#
# psycopg2 is f... |
quimaguirre/diana | refs/heads/master | diana/toolbox/parse_sider.py | 1 | import TsvReader
import os, cPickle
def main():
base_dir = "/home/emre/arastirma/data/drug/sider"
label_file = base_dir + "label_mapping.tsv"
side_effect_file = base_dir + "adverse_effects_raw.tsv"
meddra_side_effect_file = base_dir + "meddra_adverse_effects.tsv"
dump_file = base_dir + "sider.pcl... |
BT-astauder/odoo | refs/heads/8.0 | addons/payment_ogone/__openerp__.py | 391 | # -*- coding: utf-8 -*-
{
'name': 'Ogone Payment Acquirer',
'category': 'Hidden',
'summary': 'Payment Acquirer: Ogone Implementation',
'version': '1.0',
'description': """Ogone Payment Acquirer""",
'author': 'OpenERP SA',
'depends': ['payment'],
'data': [
'views/ogone.xml',
... |
Shiroy/servo | refs/heads/master | tests/wpt/harness/wptrunner/wpttest.py | 21 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEFAULT_TIMEOUT = 10 # seconds
LONG_TIMEOUT = 60 # seconds
import os
import mozinfo
from wptmanifest.parser import ... |
geertj/python-tdbus | refs/heads/master | lib/tdbus/test/test_connection.py | 1 | #
# This file is part of python-tdbus. Python-tdbus is free software
# available under the terms of the MIT license. See the file "LICENSE" that
# was provided together with this source file for the licensing terms.
#
# Copyright (c) 2012 the python-tdbus authors. See the file "AUTHORS" for a
# complete list.
import t... |
cdeil/rootpy | refs/heads/master | rootpy/tree/model.py | 1 | import inspect
from cStringIO import StringIO
import types
import ROOT
from ..types import Column
from .buffer import TreeBuffer
class TreeModelMeta(type):
"""
Metaclass for all TreeModels
Addition/subtraction of TreeModels is handled
as set union and difference of class attributes
"""
def _... |
tempbottle/servo | refs/heads/master | python/mach/mach/test/test_entry_point.py | 121 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals
import imp
import os
import sys
from mach.base import MachError
from mach.test.... |
fxfitz/ansible | refs/heads/devel | lib/ansible/modules/notification/bearychat.py | 43 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Jiangge Zhang <tonyseek@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... |
epandurski/django | refs/heads/master | tests/messages_tests/base.py | 319 | from django import http
from django.contrib.messages import constants, get_level, set_level, utils
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.constants import DEFAULT_LEVELS
from django.contrib.messages.storage import base, default_storage
from django.contrib.messages.storage.ba... |
Yhgenomics/kubernetes | refs/heads/master | cluster/juju/charms/trusty/kubernetes-master/hooks/hooks.py | 202 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... |
Kewal69/ADB-Sync | refs/heads/master | final_code_adb/adb.py | 1 | import os
class ADB():
def call_adb(self, command):
command_result = ''
command_text = 'adb %s' % command
results = os.popen(command_text, "r")
while 1:
line = results.readline()
if not line: break
command_result += line
return comman... |
rkmaddox/mne-python | refs/heads/master | mne/io/egi/egi.py | 7 | # Authors: Denis A. Engemann <denis.engemann@gmail.com>
# Teon Brooks <teon.brooks@gmail.com>
#
# simplified BSD-3 license
import datetime
import time
import numpy as np
from .egimff import _read_raw_egi_mff
from .events import _combine_triggers
from ..base import BaseRaw
from ..utils import _read... |
fairbird/OpenPLI-TSimage | refs/heads/master | lib/python/Components/Converter/ServiceOrbitalPosition.py | 102 | # -*- coding: utf-8 -*-
from Components.Converter.Converter import Converter
from enigma import iServiceInformation, iPlayableService, iPlayableServicePtr, eServiceCenter
from ServiceReference import resolveAlternate
from Components.Element import cached
class ServiceOrbitalPosition(Converter, object):
FULL = 0
SHO... |
clebergnu/autotest | refs/heads/master | client/tests/kvm/tests/virtio_console.py | 2 | """
virtio_console test
@copyright: 2010 Red Hat, Inc.
"""
import array, logging, os, random, re, select, shutil, socket, sys, tempfile
import threading, time, traceback
from collections import deque
from threading import Thread
from autotest_lib.client.common_lib import error
from autotest_lib.client.bin import util... |
lizardsystem/lizard-wms | refs/heads/master | lizard_wms/migrations/0023_auto__chg_field_featureline_description.py | 2 | # encoding: 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):
# Changing field 'FeatureLine.description'
db.alter_column('lizard_wms_featureline', 'description', self.g... |
fabianmurariu/FrameworkBenchmarks | refs/heads/master | frameworks/Python/wsgi/gunicorn_conf.py | 82 | import multiprocessing
import os
import sys
_is_pypy = hasattr(sys, 'pypy_version_info')
_is_travis = os.environ.get('TRAVIS') == 'true'
# only implements json and plain. Not wait DB.
workers = multiprocessing.cpu_count()
if _is_travis:
workers = 2
bind = "0.0.0.0:8080"
keepalive = 120
errorlog = '-'
pidfile = '... |
vrenaville/hr | refs/heads/8.0 | hr_webcam/__openerp__.py | 9 | # -*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, eit... |
jbedorf/tensorflow | refs/heads/master | tensorflow/python/keras/applications/imagenet_utils.py | 12 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
cvfish/keras | refs/heads/master | keras/initializations.py | 38 | from __future__ import absolute_import
import theano
import theano.tensor as T
import numpy as np
from .utils.theano_utils import sharedX, shared_zeros, shared_ones
def get_fans(shape):
fan_in = shape[0] if len(shape) == 2 else np.prod(shape[1:])
fan_out = shape[1] if len(shape) == 2 else shape[0]
return... |
hwmaier/esp-idf | refs/heads/master | components/idf_test/integration_test/TestCaseScript/WiFiStress/WifiSmartConfig.py | 15 | import random
import os
import time
import copy
from TCAction import TCActionBase
from NativeLog import NativeLog
from Utility import Encoding
from Utility import MakeFolder
AP_PROP = ("ssid", "ssid_len", "pwd",
"pwd_len", "channel", "enc", "apc")
SMART_TYPE = ("esp-touch", "airkiss")
TEST_METHOD = ("ssi... |
garrettcap/Bulletproof-Backup | refs/heads/master | wx/lib/analogclock/__init__.py | 9 | __author__ = "E. A. Tacao <e.a.tacao |at| estadao.com.br>"
__date__ = "15 Fev 2006, 22:00 GMT-03:00"
__version__ = "0.02"
__doc__ = """
AnalogClock - an analog clock.
This control creates an analog clock window. Its features include shadowing,
the ability to render numbers as well as any arbitrary polygon as t... |
paplorinc/intellij-community | refs/heads/master | python/testData/resolve/multiFile/ambiguousImplicitRelativeImport/pkg/__init__.py | 70 | import mod
<ref> |
arocks/tiny | refs/heads/master | tiny/wsgi.py | 1 | """
WSGI config for tiny project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` set... |
brewneaux/mycli | refs/heads/master | mycli/packages/special/iocommands.py | 12 | import os
import re
import logging
from codecs import open
import click
import sqlparse
from . import export
from .main import special_command, NO_QUERY, PARSED_QUERY
from .favoritequeries import favoritequeries
TIMING_ENABLED = False
use_expanded_output = False
ORIGINAL_PAGER = os.environ.get('PAGER', '')
@export
... |
SciTools/iris-grib | refs/heads/v0.17.x | iris_grib/tests/integration/save_rules/test_grid_definition_section.py | 1 | # Copyright iris-grib contributors
#
# This file is part of iris-grib and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
Integration tests for :func:`iris_grib._save_rules.grid_definition_section`
to confirm that the correct grid_defi... |
Kaffa-MY/mit6.858Fall2014 | refs/heads/lab1 | exploit-2a.py | 1 | #!/usr/bin/python
import sys
import socket
import traceback
import urllib
import struct
####
## You might find it useful to define variables that store various
## stack or function addresses from the zookd / zookfs processes,
## which you can then use in build_exploit(); the following are just
## examples.
stack_buf... |
sqlbyme/python-slackclient | refs/heads/master | slackclient/_slackrequest.py | 17 | import time
try:
# Try for Python3
from urllib.parse import urlencode
from urllib.request import urlopen
except:
# Looks like Python2
from urllib import urlencode
from urllib2 import urlopen
class SlackRequest(object):
def __init__(self):
pass
def do(self, token, request=... |
smartdj/zer0m0n | refs/heads/master | signatures/origin_langid.py | 6 | # Copyright (C) 2012 Benjamin K., Kevin R., Claudio "nex" Guarnieri
#
# 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 versio... |
dannyperry571/theapprentice | refs/heads/master | script.module.urlresolver/lib/urlresolver/plugins/kingfiles.py | 5 | """
grifthost urlresolver plugin
Copyright (C) 2015 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is d... |
poiesisconsulting/openerp-restaurant | refs/heads/master | hw_escpos/__openerp__.py | 67 | # -*- 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... |
cjaymes/pyscap | refs/heads/master | src/scap/model/ocil_2_0/QuestionTestActionIDPattern.py | 1 | # Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... |
OCA/vertical-abbey | refs/heads/10.0 | stay/stay.py | 1 | # -*- coding: utf-8 -*-
# © 2014-2017 Barroux Abbey (www.barroux.org)
# © 2014-2017 Akretion France (www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# @author: Brother Bernard <informatique@barroux.org>
# @author: Brother Irénée
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)... |
emakis/erpnext | refs/heads/develop | erpnext/patches/v4_2/fix_account_master_type.py | 120 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for d in frappe.db.sql("""select name from `tabAccount`
where ifnull(master_type, '') not in ('Customer', 'Supplier', '... |
devasia1000/mitmproxy | refs/heads/master | libmproxy/protocol/rawtcp.py | 13 | from __future__ import (absolute_import, print_function, division)
import socket
import select
import six
import sys
from OpenSSL import SSL
from netlib.exceptions import TcpException
from netlib.tcp import ssl_read_select
from netlib.utils import clean_bin
from ..exceptions import ProtocolException
from .base import... |
Aluriak/dotfiles | refs/heads/master | scripts/jaiquelage.py | 1 | #!/usr/bin/env python3
from datetime import datetime
birthday = datetime(1993, 10, 13)
now = datetime.now()
print((now - birthday))
|
axinging/chromium-crosswalk | refs/heads/master | chrome/common/extensions/docs/server2/data_source_registry.py | 78 | # Copyright 2013 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 api_data_source import APIDataSource
from api_list_data_source import APIListDataSource
from data_source import DataSource
from manifest_data_source imp... |
JetBrains/intellij-community | refs/heads/master | python/testData/breadcrumbs/asyncSeveralWithAs.py | 31 | async def foo():
async with open("file.txt") as f, open("file2.txt") as f2:
print("a<caret>bc") |
jkandasa/integration_tests | refs/heads/master | cfme/cloud/provider/gce.py | 4 | from wrapanapi.google import GoogleCloudSystem
from widgetastic.widget import View
from widgetastic_patternfly import Button, Input
from cfme.base.credential import ServiceAccountCredential
from cfme.common.provider import DefaultEndpoint
from . import CloudProvider
class GCEEndpoint(DefaultEndpoint):
"""
r... |
mindnervestech/mnrp | refs/heads/master | addons/hr_payroll_account/__init__.py | 433 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# ... |
victorliun/flask-restless | refs/heads/master | tests/helpers.py | 7 | """
tests.helpers
~~~~~~~~~~~~~
Provides helper functions for unit tests in this package.
:copyright: 2012, 2013, 2014, 2015 Jeffrey Finkelstein
<jeffrey.finkelstein@gmail.com> and contributors.
:license: GNU AGPLv3+ or BSD
"""
import sys
is_python_version_2 = sys.version_info[0] ... |
TamiaLab/PySkCode | refs/heads/master | tests/tests_tags/tests_notabene.py | 1 | """
SkCode Nota Bene tag definitions code.
"""
import unittest
from skcode.etree import RootTreeNode
from skcode.tags import (
NotaBeneTreeNode,
DEFAULT_RECOGNIZED_TAGS_LIST
)
class NotaBeneTreeNodeTestCase(unittest.TestCase):
""" Tests suite for the Nota Bene tag module. """
def test_tag_and_alias... |
pselle/calibre | refs/heads/master | setup/commands.py | 8 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
__all__ = [
'pot', 'translations', 'get_translations', 'iso639', 'iso3166',
... |
PHOTOX/fuase | refs/heads/master | ase/doc/tutorials/N2Cu.py | 7 | from ase import Atoms
from ase.visualize import view
from ase.calculators.emt import EMT
from ase.constraints import FixAtoms
from ase.optimize import QuasiNewton
from ase.lattice.surface import fcc111,add_adsorbate
h = 1.85
d = 1.10
slab = fcc111('Cu', size=(4,4,2), vacuum=10.0)
slab.set_calculator(EMT())
e_slab = ... |
daevaorn/sentry | refs/heads/master | tests/sentry/data/tests.py | 33 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from sentry.constants import DATA_ROOT
from sentry.testutils import TestCase
from sentry.utils import json
class DataGenerator(type):
def __new__(cls, name, bases, attrs):
root = os.path.join(DATA_ROOT, 'samples')
for file... |
skulldreamz/bullhead_kernel | refs/heads/master | tools/perf/util/setup.py | 2079 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
dims/ironic | refs/heads/master | ironic/common/service.py | 2 | # -*- encoding: utf-8 -*-
#
# Copyright © 2012 eNovance <licensing@enovance.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... |
poojavade/Genomics_Docker | refs/heads/master | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/statsmodels-0.5.0-py2.7-linux-x86_64.egg/statsmodels/stats/tests/test_anova.py | 3 | from StringIO import StringIO
import numpy as np
from statsmodels.stats.anova import anova_lm
from statsmodels.formula.api import ols
from pandas import read_table
kidney_table = StringIO("""Days Duration Weight ID
0.0 1 1 1
2.0 1 1 2
1.0 1 1 3
3.0 ... |
jicahoo/numpy | refs/heads/master | numpy/f2py/tests/test_return_logical.py | 145 | from __future__ import division, absolute_import, print_function
from numpy import array
from numpy.compat import long
from numpy.testing import run_module_suite, assert_, assert_raises, dec
import util
class TestReturnLogical(util.F2PyTest):
def check_function(self, t):
assert_(t(True) == 1, repr(t(Tru... |
rschnapka/server-tools | refs/heads/8.0 | base_report_auto_create_qweb/models/report_xml.py | 11 | # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, api, exceptions, _
import lo... |
Ravenm/2143-OOP-NASH | refs/heads/master | python3env/Lib/site-packages/PIL/ImImagePlugin.py | 46 | #
# The Python Imaging Library.
# $Id$
#
# IFUNC IM file handling for PIL
#
# history:
# 1995-09-01 fl Created.
# 1997-01-03 fl Save palette images
# 1997-01-08 fl Added sequence support
# 1997-01-23 fl Added P and RGB save support
# 1997-05-31 fl Read floating point images
# 1997-06-22 fl Save floating poi... |
kenorb-contrib/BitTorrent | refs/heads/master | python_bt_codebase_library/BTL/obsoletepythonsupport.py | 11 | # The contents of this file are subject to the Python Software Foundation
# License Version 2.3 (the License). You may not copy or use this file, in
# either source code or executable form, except in compliance with the License.
# You may obtain a copy of the License at http://www.python.org/license.
#
# Software dist... |
bpeng2000/SOS | refs/heads/master | src/sos/step_executor.py | 1 | #!/usr/bin/env python3
#
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import ast
import copy
import os
import subprocess
import sys
import time
from collections import Iterable, Mapping, Sequence, defaultdict
from typing import... |
lmascare/utils | refs/heads/master | python/admin/lm.py | 1 | #!/usr/bin/python
#
# Utils is always imported first
#
import csv
import string
def main():
#import lank.utils
# print (logfile)'
#lank.utils.logit("hello",1,"crit")
#from lank import utils
# We set the PYTHONPATH so that we don't have to specify the modules dir.
# Alternatively, we can s... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/loot/creature_loot/kashyyyk_loot/snake_riverweed.py | 85615 | import sys
def setup(core, object):
return |
lunafeng/django | refs/heads/master | django/contrib/messages/constants.py | 837 | DEBUG = 10
INFO = 20
SUCCESS = 25
WARNING = 30
ERROR = 40
DEFAULT_TAGS = {
DEBUG: 'debug',
INFO: 'info',
SUCCESS: 'success',
WARNING: 'warning',
ERROR: 'error',
}
DEFAULT_LEVELS = {
'DEBUG': DEBUG,
'INFO': INFO,
'SUCCESS': SUCCESS,
'WARNING': WARNING,
'ERROR': ERROR,
}
|
charbeljc/OCB | refs/heads/8.0 | addons/l10n_br/__openerp__.py | 430 | # -*- encoding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2009 Renato Lima - Akretion
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by th... |
besacier/WCE-LIG | refs/heads/master | wce_system/feature/polysemy_count_dbnary.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 4 14:36:31 2014
"""
#####################################################################################################
# Groupe d'Étude pour la Traduction/le Traitement Automatique des Langues et de la Parole (GETALP)
# Homepage: http://getalp.imag.fr
#
# Author: Chri... |
dwang159/oncall | refs/heads/master | src/oncall/messengers/iris_messenger.py | 1 | # Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.
from oncall.constants import EMAIL_SUPPORT, SMS_SUPPORT, CALL_SUPPORT, SLACK_SUPPORT
from irisclient import IrisClient
class iris_messenger(object):
supp... |
JunerMe/Dream | refs/heads/master | migrations/env.py | 605 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... |
rysson/filmkodi | refs/heads/master | plugin.video.mrknow/mylib/pydevd_attach_to_process/winappdbg/win32/psapi.py | 102 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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... |
ujjwalwahi/odoo | refs/heads/8.0 | openerp/report/render/rml2txt/utils.py | 443 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
hkawasaki/kawasaki-aio8-0 | refs/heads/gacco2/master | common/test/acceptance/tests/test_studio_general.py | 8 | """
Acceptance tests for Studio.
"""
from bok_choy.web_app_test import WebAppTest
from ..pages.studio.asset_index import AssetIndexPage
from ..pages.studio.auto_auth import AutoAuthPage
from ..pages.studio.checklists import ChecklistsPage
from ..pages.studio.course_import import ImportPage
from ..pages.studio.course_i... |
admcrae/tensorflow | refs/heads/master | tensorflow/python/framework/sparse_tensor.py | 91 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
Djabbz/wakatime | refs/heads/master | wakatime/packages/simplejson/tests/test_encode_basestring_ascii.py | 147 | from unittest import TestCase
import simplejson.encoder
from simplejson.compat import b
CASES = [
(u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
(u'\u0123\u4567\... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.7/Lib/test/test_operator.py | 3 | import operator
import unittest
from test import test_support
class Seq1:
def __init__(self, lst):
self.lst = lst
def __len__(self):
return len(self.lst)
def __getitem__(self, i):
return self.lst[i]
def __add__(self, other):
return self.lst + other.lst
def __mul__(s... |
petewarden/tensorflow | refs/heads/master | tensorflow/python/keras/tests/get_config_test.py | 8 | # Copyright 2020 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... |
ntt-sic/neutron | refs/heads/master | neutron/services/firewall/__init__.py | 267 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... |
talhajaved/nyuadmarket | refs/heads/master | flask/lib/python2.7/site-packages/pkg_resources/tests/test_pkg_resources.py | 242 | import sys
import tempfile
import os
import zipfile
import datetime
import time
import subprocess
import pkg_resources
try:
unicode
except NameError:
unicode = str
def timestamp(dt):
"""
Return a timestamp for a local, naive datetime instance.
"""
try:
return dt.timestamp()
except... |
mrinalabrol/magik | refs/heads/master | env/lib/python3.4/site-packages/flask/testsuite/test_apps/flask_newext_package/__init__.py | 629 | ext_id = 'newext_package'
|
zaffra/Donate | refs/heads/master | django/contrib/messages/storage/session.py | 456 | from django.contrib.messages.storage.base import BaseStorage
class SessionStorage(BaseStorage):
"""
Stores messages in the session (that is, django.contrib.sessions).
"""
session_key = '_messages'
def __init__(self, request, *args, **kwargs):
assert hasattr(request, 'session'), "The sessi... |
filias/django | refs/heads/master | django/contrib/auth/context_processors.py | 189 | # PermWrapper and PermLookupDict proxy the permissions system into objects that
# the template system can understand.
class PermLookupDict(object):
def __init__(self, user, app_label):
self.user, self.app_label = user, app_label
def __repr__(self):
return str(self.user.get_all_permissions())
... |
petosegan/scikit-learn | refs/heads/master | examples/model_selection/plot_learning_curve.py | 250 | """
========================
Plotting Learning Curves
========================
On the left side the learning curve of a naive Bayes classifier is shown for
the digits dataset. Note that the training score and the cross-validation score
are both not very good at the end. However, the shape of the curve can be found
in ... |
MatthieuCourbariaux/deep-learning-multipliers | refs/heads/master | utilities/goliat4_script.py | 2 | import os
import time
# gpu
nb_gpu = 4
delay_between_lauches = 5*60 # 2 minutes
time_per_job = 7*60*60 # 9 in float32 for 1.3 more neurones, partial sum, no range updates, for 200 epochs
gpu_id = 0
# hyper parameters lists
comp_NOB = [31]
up_NOB = [31... |
oshanz/Learn-Django | refs/heads/master | tests/model_inheritance_regress/models.py | 49 | from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
class Meta:
... |
nhtera/github.io | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/vim.py | 364 | # -*- coding: utf-8 -*-
"""
pygments.styles.vim
~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by vim.
: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 Keywor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.