repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
RPGOne/Skynet | refs/heads/Miho | scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/sklearn/datasets/tests/test_samples_generator.py | 4 | from __future__ import division
from collections import defaultdict
from functools import partial
import numpy as np
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
fr... |
idegtiarov/ceilometer | refs/heads/master | ceilometer/database/notifications.py | 1 | #
# Copyright 2015 Hewlett Packard
#
# 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 wr... |
ntonjeta/iidea-Docker | refs/heads/master | examples/sobel/src/boost_1_63_0/libs/python/test/object.py | 20 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
from __future__ import print_function
'''
>>> from object_ext import *
>>> type(ref_to_noncopyable())
<class 'object_ext.NotCopyable'>
... |
yaroslavvb/tensorflow | refs/heads/master | tensorflow/python/layers/base_test.py | 27 | # 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... |
cuongthai/cuongthai-s-blog | refs/heads/master | django/contrib/staticfiles/handlers.py | 160 | import urllib
from urlparse import urlparse
from django.conf import settings
from django.core.handlers.wsgi import WSGIHandler
from django.contrib.staticfiles import utils
from django.contrib.staticfiles.views import serve
class StaticFilesHandler(WSGIHandler):
"""
WSGI middleware that intercepts calls to th... |
deanhiller/ormPerformanceTest | refs/heads/master | tools/ant/bin/runant.py | 124 | #!/usr/bin/python
# 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 "Licen... |
ThorbenJensen/wifi-locator | refs/heads/master | src/utils_wifi.py | 1 | """Module that provides all wifi sensor functionality (i.e. returning scan)."""
import os
import re
import subprocess
import pandas as pd
def get_signals():
"""Get wifi signals."""
operating_system = os.name
if operating_system == 'nt':
return get_signals_windows()
if operating_system == 'po... |
ravenac95/simpleyaml | refs/heads/master | tests/lib/test_all.py | 1 |
import sys, simpleyaml as yaml, test_appliance
def main(args=None):
collections = []
import test_yaml
collections.append(test_yaml)
if yaml.__with_libyaml__:
import test_yaml_ext
collections.append(test_yaml_ext)
test_appliance.run(collections, args)
if __name__ == '__main__':
... |
TheGameCreators/AGKIDE | refs/heads/master | tests/ctags/py_constructor_arglist.py | 26 | """
Test arglist parsing of a class' __init__ method:
the __init__() method's argument list should be assigned to the class' argument list.
This is somewhat special to Python and the Python parses uses tm_source_file_set_tag_arglist()
to do this and tm_source_file_set_tag_arglist() uses tm_tags_find() which by default... |
unnikrishnankgs/va | refs/heads/master | venv/lib/python3.5/site-packages/tensorflow/models/object_detection/builders/model_builder_test.py | 21 | # Copyright 2017 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... |
jean/sentry | refs/heads/master | tests/sentry/plugins/mail/activity/__init__.py | 2878 | from __future__ import absolute_import
|
Thraxis/SickRage | refs/heads/master | lib/chardet/charsetgroupprober.py | 53 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
andreabrambilla/libres | refs/heads/master | test-data/local/snake_oil_structure/snake_oil/jobs/snake_oil_simulator.py | 2 | #!/usr/bin/env python
from datetime import datetime
import os
import sys
from ecl.summary import EclSum, EclSumTStep
from ecl.test import ExtendedTestCase
from res.test.synthesizer import OilSimulator
def globalIndex(i, j, k, nx=10, ny=10, nz=10):
return i + nx * (j - 1) + nx * ny * (k - 1)
def readParameters... |
lebauce/artub | refs/heads/master | plugins/speculoos/poujolobjs.py | 1 | # Glumol - An adventure game creator
# Copyright (C) 1998-2008 Sylvain Baubeau & Alexis Contour
# This file is part of Glumol.
# Glumol 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 th... |
with-git/tensorflow | refs/heads/master | tensorflow/contrib/bayesflow/python/ops/custom_grad.py | 44 | # Copyright 2017 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... |
md1024/rams | refs/heads/init_master | uber/tests/email/test_automated_email_categories.py | 1 | from uber.tests.email.email_fixtures import *
class FakeModel:
pass
@pytest.mark.usefixtures("email_subsystem_sane_setup")
class TestAutomatedEmailCategory:
def test_testing_environment(self, get_test_email_category):
assert len(AutomatedEmail.instances) == 1
assert len(AutomatedEmail.querie... |
wileeam/airflow | refs/heads/master | airflow/ti_deps/deps/dagrun_exists_dep.py | 4 | #
# 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... |
qianyu668899/Django | refs/heads/master | depot/depotapp/views.py | 2 | #/usr/bin/python
#coding: utf8
# Create your views here.
from django import forms
from django.template import RequestContext
from django.http import HttpResponse, HttpResponseRedirect
from django.template.loader import get_template
from django.core.paginator import Paginator
from django.core.urlresolvers import rever... |
xaviercobain88/framework-python | refs/heads/master | build/lib.linux-i686-2.7/openerp/addons/account/partner.py | 9 | # -*- 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... |
hejuna/bite-project | refs/heads/master | deps/gdata-python-client/samples/apps/marketplace_sample/gdata/tlslite/utils/ASN1Parser.py | 281 | """Class for parsing ASN.1"""
from compat import *
from codec import *
#Takes a byte array which has a DER TLV field at its head
class ASN1Parser:
def __init__(self, bytes):
p = Parser(bytes)
p.get(1) #skip Type
#Get Length
self.length = self._getASN1Length(p)
#Get Value
... |
ericli1989/ali_kernel | refs/heads/master | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # 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 system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
qsnake/py2js | refs/heads/master | tests/modules/import_diamond.py | 6 |
import modules.diamond1
import modules.diamond2
modules.diamond1.run()
modules.diamond2.run()
|
UTAlan/HavePest.net | refs/heads/master | havepest/paste/util/UserDict24.py | 28 | """A more or less complete user-defined wrapper around dictionary objects."""
class UserDict:
def __init__(self, dict=None, **kwargs):
self.data = {}
if dict is not None:
if not hasattr(dict,'keys'):
dict = type({})(dict) # make mapping from a sequence
self... |
MikkCZ/kitsune | refs/heads/master | kitsune/announcements/models.py | 6 | from datetime import datetime
from django.contrib.auth.models import User, Group
from django.db import models
from django.db.models import Q
from django.db.models.signals import post_save
from kitsune.sumo.templatetags.jinja_helpers import wiki_to_html
from kitsune.sumo.models import ModelBase
from kitsune.wiki.model... |
bobisjan/django-shanghai | refs/heads/master | shanghai/mixins/__init__.py | 1 | from .dispatcher import DispatcherMixin
from .fetcher import FetcherMixin, ModelFetcherMixin
from .fields import FieldsMixin
from .filter import FilterMixin, ModelFilterMixin
from .inclusion import InclusionMixin
from .linker import LinkerMixin
from .meta import MetaMixin
from .pagination import PaginationMixin, ModelP... |
ryfeus/lambda-packs | refs/heads/master | Sklearn_scipy_numpy/source/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py | 2768 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
Alwnikrotikz/marinemap | refs/heads/master | lingcod/common/templatetags/appname.py | 3 | from django.conf import settings
from django.template import Node, Library
register = Library()
@register.simple_tag
def appname():
try:
name = settings.APP_NAME
except AttributeError:
name = '... settings.APP_NAME ...'
return str(name)
@register.simple_tag
def help_email():
try:
... |
rangadi/incubator-beam | refs/heads/master | sdks/python/apache_beam/examples/wordcount_it_test.py | 5 | #
# 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... |
LadyClaire/project-euler-solutions | refs/heads/master | 0001/pe0001.py | 1 | #! /usr/bin/env python3
# If we list all the natural numbers below 10 that are multiples of 3 or 5, we
# get 3, 5, 6 and 9. The sum of these multiples is 23.
#
# Find the sum of all the multiples of 3 or 5 below 1000.
def sumMultiples(upperLimit, *multiples):
'''Finds the sum of all multiples of the specified nu... |
danielnyga/pracmln | refs/heads/master | python2/pracmln/utils/locs.py | 2 | import os
import appdirs
from pracmln._version import APPNAME, APPAUTHOR
root = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..'))
user_data = appdirs.user_data_dir(APPNAME, APPAUTHOR)
if os.path.basename(root).startswith('python'):
root = os.path.realpath(os.path.join(root, '..'))
app_dat... |
jkrcma/passIon | refs/heads/master | index.py | 2 |
import logging
import pickle
from time import time
from hashlib import md5
from base64 import urlsafe_b64encode
from os import urandom
import redis
from flask import Flask, request, render_template
import config
logging.basicConfig(level=logging.DEBUG)
app = Flask(__name__,static_folder='public')
r = redis.Strict... |
sumedhasingla/VTK | refs/heads/master | ThirdParty/Twisted/twisted/internet/test/test_epollreactor.py | 39 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet.epollreactor}.
"""
from __future__ import division, absolute_import
from twisted.trial.unittest import TestCase
try:
from twisted.internet.epollreactor import _ContinuousPolling
except ImportError:
_Conti... |
bzero/bitex | refs/heads/master | apps/mailer/util.py | 10 | from smtplib import SMTP
from email.MIMEText import MIMEText
from email.Header import Header
from email.Utils import parseaddr, formataddr
def send_email(sender, recipient, subject, body, content_type='plain'):
"""Send an email.
All arguments should be Unicode strings (plain ASCII works as well).
Only t... |
asascience-open/ooi-ui-services | refs/heads/master | ooiservices/app/redmine/routes.py | 4 | #!/usr/bin/env python
'''
Redmine endpoints
'''
from flask import (jsonify, request, Response, current_app)
from ooiservices.app.redmine import redmine as api
from ooiservices.app.main.authentication import auth
from ooiservices.app.decorators import scope_required
from collections import OrderedDict
from redmine imp... |
rfhk/awo-custom | refs/heads/8.0 | product_listprice_list_view/models/stock_quant.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2017-2018 Quartile Limited
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
class StockQuant(models.Model):
_inherit = "stock.quant"
@api.multi
def write(self, vals):
res = super(StockQuant, self).wri... |
strands-project/mongodb_store | refs/heads/kinetic-devel | mongodb_store/scripts/mongodb_play.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy
import mongodb_store.util as mg_util
import sys
import time
import pymongo
from multiprocessing import Process
import calendar
import datetime
import threading
import multiprocessing
from rosgraph_msgs.msg import Clock
import signal
import Queue
from optparse... |
DynastyDYN/Dynasty | refs/heads/master | contrib/bitrpc/bitrpc.py | 1 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:7875")
else:
access = Ser... |
openshift/openshift-tools | refs/heads/prod | openshift_tools/monitoring/generic_metric_sender.py | 13 | #!/usr/bin/env python
# vim: expandtab:tabstop=4:shiftwidth=4
"""
Base class for sending metrics
"""
import os
import yaml
class GenericMetricSenderException(Exception):
'''
GenericMetricSenderException
Exists to propagate errors up from the api
'''
pass
class GenericMetricSender(object)... |
chienlieu2017/it_management | refs/heads/master | odoo/addons/barcodes/models/__init__.py | 15 | # -*- coding: utf-8 -*-
import barcodes
import barcode_events_mixin
|
danicampora/micropython | refs/heads/master | tests/extmod/uctypes_ptr_le.py | 59 | import sys
import uctypes
if sys.byteorder != "little":
print("SKIP")
sys.exit()
desc = {
"ptr": (uctypes.PTR | 0, uctypes.UINT8),
"ptr16": (uctypes.PTR | 0, uctypes.UINT16),
"ptr2": (uctypes.PTR | 0, {"b": uctypes.UINT8 | 0}),
}
bytes = b"01"
addr = uctypes.addressof(bytes)
buf = addr.to_bytes(... |
molobrakos/home-assistant | refs/heads/master | homeassistant/components/lovelace/__init__.py | 8 | """Support for the Lovelace UI."""
from functools import wraps
import logging
import os
import time
import voluptuous as vol
from homeassistant.components import websocket_api
from homeassistant.exceptions import HomeAssistantError
from homeassistant.util.yaml import load_yaml
_LOGGER = logging.getLogger(__name__)
... |
randynobx/ansible | refs/heads/devel | lib/ansible/modules/notification/hipchat.py | 34 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... |
bgris/ODL_bgris | refs/heads/master | lib/python3.5/distutils/unixccompiler.py | 7 | """distutils.unixccompiler
Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
* macros defined with -Dname[=value]
* macros undefined with -Uname
* include search directories specified with -Idir
* libraries specified with -lllib
* library... |
joachimmetz/plaso | refs/heads/main | plaso/parsers/sqlite_plugins/chrome_history.py | 3 | # -*- coding: utf-8 -*-
"""SQLite parser plugin for Google Chrome history database files."""
from dfdatetime import posix_time as dfdatetime_posix_time
from dfdatetime import webkit_time as dfdatetime_webkit_time
from plaso.containers import events
from plaso.containers import time_events
from plaso.lib import defini... |
epfl-lts2/room_transfer_function_toolkit | refs/heads/master | room_transfer_function_toolkit_python/room_transfer_function_toolkit/io_methods.py | 1 | import datetime
import math
import numpy as np
import os
import pickle
import scipy.io
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
def write_load_parameters(data_path, file_name):
'''
Saves and loads the parameters of the experiment into 'config.pckl' file.
If needed, change ... |
ShridharSattur/WhereHows | refs/heads/master | wherehows-etl/src/main/resources/jython/requests/packages/chardet/constants.py | 3007 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
Neamar/django | refs/heads/master | tests/apps/tests.py | 126 | from __future__ import unicode_literals
import os
import warnings
from unittest import skipUnless
from django.apps import AppConfig, apps
from django.apps.registry import Apps
from django.contrib.admin.models import LogEntry
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.db i... |
zzjkf2009/Midterm_Astar | refs/heads/master | opencv/modules/ts/misc/trace_profiler.py | 1 | from __future__ import print_function
import os
import sys
import csv
from pprint import pprint
from collections import deque
# trace.hpp
REGION_FLAG_IMPL_MASK = 15 << 16;
REGION_FLAG_IMPL_IPP = 1 << 16;
REGION_FLAG_IMPL_OPENCL = 2 << 16;
DEBUG = False
if DEBUG:
dprint = print
dpprint = pprint
else:
def... |
Hazelsuko07/17WarmingUp | refs/heads/hy_try | py3.6/lib/python3.6/site-packages/wheel/metadata.py | 62 | """
Tools for converting old- to new-style metadata.
"""
import email.parser
import os.path
import re
import textwrap
from collections import namedtuple, OrderedDict
import pkg_resources
from . import __version__ as wheel_version
from .pkginfo import read_pkg_info
from .util import OrderedDefaultDict
METADATA_VERSI... |
diofant/diofant | refs/heads/master | diofant/polys/polytools.py | 1 | """User-friendly public interface to polynomial functions."""
import functools
import math
import operator
import mpmath
from ..core import (Add, Basic, E, Expr, Integer, Mul, Tuple, oo,
preorder_traversal)
from ..core.compatibility import iterable
from ..core.decorators import _sympifyit
from ..... |
CSD-Public/stonix | refs/heads/master | src/stonix_resources/main_window_pyqt5.py | 1 | ###############################################################################
# #
# Copyright 2019. Triad National Security, LLC. All rights reserved. #
# This program was produced under U.S. Government contract 89233218CNA000001 #
... |
Bysmyyr/chromium-crosswalk | refs/heads/master | tools/telemetry/third_party/gsutilz/third_party/apitools/apitools/base/py/stream_slice.py | 23 | #!/usr/bin/env python
"""Small helper class to provide a small slice of a stream."""
from apitools.base.py import exceptions
class StreamSlice(object):
"""Provides a slice-like object for streams."""
def __init__(self, stream, max_bytes):
self.__stream = stream
self.__remaining_bytes = max_... |
roger-zhao/ardupilot-3.3 | refs/heads/master | mk/PX4/Tools/genmsg/test/test_genmsg_names.py | 216 | # Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, 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... |
fnielsen/dasem | refs/heads/master | tests/test_gutenberg.py | 1 |
import pytest
from dasem.gutenberg import Word2Vec
@pytest.fixture
def w2v():
return Word2Vec()
def test_w2v(w2v):
word_and_similarities = w2v.most_similar('dreng')
assert len(word_and_similarities) == 10
|
abendleiter/Django-facebook | refs/heads/master | django_facebook/settings.py | 22 | from django.conf import settings
import logging
logger = logging.getLogger(__name__)
# : Your facebook app id
FACEBOOK_APP_ID = getattr(settings, 'FACEBOOK_APP_ID', None)
# : Your facebook app secret
FACEBOOK_APP_SECRET = getattr(settings, 'FACEBOOK_APP_SECRET', None)
# : The default scope we should use, note that re... |
agaffney/ansible | refs/heads/devel | test/lib/ansible_test/_data/sanity/code-smell/no-get-exception.py | 68 | #!/usr/bin/env python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
import sys
def main():
basic_allow_once = True
for path in sys.argv[1:] or sys.stdin.read().splitlines():
with open(path, 'r') as path_fd:
for line, text in enumerate(p... |
barjuegocreador93/pycab | refs/heads/master | resources/model.py | 1 | from sqlalchemy import *
from settings import DATABASE
def init_connection():
if 'engine' in DATABASE.keys():
if DATABASE['engine']=='sqlite3' and 'path' in DATABASE.keys():
return create_engine('sqlite://'+DATABASE['path'])
return object()
from sqlalchemy.ext.declarative import declarative_base
Base = decl... |
laffra/pava | refs/heads/master | pava/implementation/natives/sun/awt/windows/WKeyboardFocusManagerPeer.py | 1 | def add_native_methods(clazz):
def setNativeFocusOwner__java_awt_peer_ComponentPeer__(a0):
raise NotImplementedError()
def getNativeFocusOwner____():
raise NotImplementedError()
def getNativeFocusedWindow____():
raise NotImplementedError()
clazz.setNativeFocusOwner__java_awt_p... |
invisiblek/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/wsgiref/util.py | 55 | """Miscellaneous WSGI-related Utilities"""
import posixpath
__all__ = [
'FileWrapper', 'guess_scheme', 'application_uri', 'request_uri',
'shift_path_info', 'setup_testing_defaults',
]
class FileWrapper:
"""Wrapper to convert file-like objects to iterables"""
def __init__(self, filelike, blksize=819... |
danielharbor/openerp | refs/heads/master | openerp/tools/amount_to_text.py | 393 | # -*- 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... |
jabdoa2/FreeCAD | refs/heads/master | src/Mod/Draft/DraftTrackers.py | 8 | #***************************************************************************
#* *
#* Copyright (c) 2011 *
#* Yorik van Havre <yorik@uncreated.net> *
#* ... |
glaubitz/fs-uae-debian | refs/heads/master | launcher/OpenGL/GLES1/APPLE/copy_texture_levels.py | 8 | '''OpenGL extension APPLE.copy_texture_levels
This module customises the behaviour of the
OpenGL.raw.GLES1.APPLE.copy_texture_levels to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/APPLE/copy_texture_levels.txt
'''
from OpenGL i... |
SCOAP3/invenio | refs/heads/master | invenio/legacy/bibcirculation/web/admin/bibcirculationadmin.py | 13 | # This file is part of Invenio.
# Copyright (C) 2008, 2009, 2010, 2011 CERN.
#
# Invenio 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... |
junghans/lammps | refs/heads/master | tools/i-pi/ipi/tests/test_contraction.py | 41 | """Tests ring polymer contraction.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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... |
ol-loginov/intellij-community | refs/heads/master | python/testData/findUsages/ReassignedClassAttribute.py | 83 | class A(object):
bacaba = 0
def __init__(self):
self.bacaba = 1
def foo(self, x):
self.bacaba = x
class B(A):
bacaba = 2
def __init__(self):
super(B, self).__init__()
self.bacaba = 3
def foo2(self):
print self.bac<caret>aba |
chrisy/vpp | refs/heads/master | test/test_l2tp.py | 2 | #!/usr/bin/env python3
import unittest
from scapy.layers.l2 import Ether
from scapy.layers.inet6 import IPv6
from framework import tag_fixme_vpp_workers
from framework import VppTestCase
@tag_fixme_vpp_workers
class TestL2tp(VppTestCase):
""" L2TP Test Case """
@classmethod
def setUpClass(cls):
... |
jhd/spunout | refs/heads/master | flask/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py | 220 | # -*- 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 .compat import cookielib, OrderedDict, urljoin, urlparse, buil... |
kcrt/electron | refs/heads/master | script/upload-node-headers.py | 141 | #!/usr/bin/env python
import argparse
import glob
import os
import shutil
import sys
import tarfile
from lib.config import PLATFORM, get_target_arch, s3_config
from lib.util import execute, safe_mkdir, scoped_cwd, s3put
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DIST_DIR = os.path.... |
Jgarcia-IAS/SAT | refs/heads/master | openerp/addons/gamification/models/challenge.py | 25 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... |
nashve/mythbox | refs/heads/master | resources/lib/twisted/twisted/test/test_internet.py | 59 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for lots of functionality provided by L{twisted.internet}.
"""
import os
import sys
import time
from twisted.trial import unittest
from twisted.internet import reactor, protocol, error, abstract, defer
from twisted.internet i... |
ojengwa/talk | refs/heads/master | venv/lib/python2.7/site-packages/django/test/__init__.py | 99 | """
Django Unit Test and Doctest framework.
"""
from django.test.client import Client, RequestFactory
from django.test.testcases import (
TestCase, TransactionTestCase,
SimpleTestCase, LiveServerTestCase, skipIfDBFeature,
skipUnlessDBFeature
)
from django.test.utils import modify_settings, override_setting... |
jotes/boto | refs/heads/develop | boto/rds/dbsnapshot.py | 168 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... |
jamesblunt/twine | refs/heads/master | tests/test_upload.py | 2 | # Copyright 2014 Ian Cordasco
#
# 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, sof... |
rajpushkar83/cloudmesh | refs/heads/master | cloudmesh_common/tables.py | 1 | """Convenient methods and classes to print tables"""
from pytimeparse.timeparse import timeparse
from prettytable import PrettyTable
from datetime import datetime
from datetime import timedelta
import json
import yaml
import hostlist
def print_format_dict(d, header=None, kind='table'):
"""kind = json, yaml, table... |
ddrager/python-bitcoinlib | refs/heads/master | doc/conf.py | 8 | # -*- coding: utf-8 -*-
#
# bitcoin documentation build configuration file, created by
# sphinx-quickstart on Thu May 28 20:40:55 2015.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... |
h2oloopan/easymerge | refs/heads/master | EasyMerge/tests/scrapy/scrapy/contrib/pipeline/media.py | 28 | from __future__ import print_function
from collections import defaultdict
from twisted.internet.defer import Deferred, DeferredList
from twisted.python.failure import Failure
from scrapy.utils.defer import mustbe_deferred, defer_result
from scrapy import log
from scrapy.utils.request import request_fingerprint
from sc... |
drufat/sympy | refs/heads/master | sympy/physics/optics/tests/test_medium.py | 70 | from __future__ import division
from sympy import sqrt, simplify
from sympy.physics.optics import Medium
from sympy.abc import epsilon, mu
from sympy.physics.units import c, u0, e0, m, kg, s, A
def test_medium():
m1 = Medium('m1')
assert m1.intrinsic_impedance == sqrt(u0/e0)
assert m1.speed == 1/sqrt(e0*u... |
unlessbamboo/grocery-shop | refs/heads/master | language/python/src/descripter/descripter-test.py | 1 | #!/usr/bin/env python
# coding:utf-8
##
# @file testDescipter.py
# @brief 测试descipter的某些简单功能
# 1,descripter是属性、实例方法、静态方法、类方法、super的实现机制
# @author unlessbamboo
# @version 0.1
# @date 2016-01-29
import types
import requests
class TestDescipter(object):
"""TestDescipter"""
def __init__(self, name):
... |
box/ClusterRunner | refs/heads/master | app/util/url_builder.py | 2 | import re
from urllib.parse import urljoin
from app.util.conf.configuration import Configuration
class UrlBuilder(object):
"""
Stores the host, port, scheme, and api version information for our URLs and centralizes their generation
"""
API_VERSION_1 = 'v1'
def __init__(self, service_address, api_... |
packenx/PythonInstaller | refs/heads/master | app/src/main/assets/arm/static/python/lib/python2.7/site-packages/dpkt/stp.py | 15 | # $Id: stp.py 23 2006-11-08 15:45:33Z dugsong $
"""Spanning Tree Protocol."""
import dpkt
class STP(dpkt.Packet):
__hdr__ = (
('proto_id', 'H', 0),
('v', 'B', 0),
('type', 'B', 0),
('flags', 'B', 0),
('root_id', '8s', ''),
('root_path', 'I', 0),
('bridge_id... |
valexandersaulys/prudential_insurance_kaggle | refs/heads/master | venv/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/specifiers.py | 527 | # Copyright 2014 Donald Stufft
#
# 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, so... |
woogers/volatility | refs/heads/master | volatility/debug.py | 54 | # Volatility
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This file is part of Volatility.
#
# Volatility 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, o... |
cuboxi/android_external_chromium_org | refs/heads/kitkat | tools/json_schema_compiler/cpp_util.py | 23 | # 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.
"""Utilies and constants specific to Chromium C++ code.
"""
from code import Code
from datetime import datetime
from model import PropertyType
import os... |
macs03/demo-cms | refs/heads/master | cms/lib/python2.7/site-packages/django/conf/app_template/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
justincassidy/scikit-learn | refs/heads/master | examples/model_selection/plot_roc.py | 146 | """
=======================================
Receiver Operating Characteristic (ROC)
=======================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality.
ROC curves typically feature true positive rate on the Y axis, and false
positive rate on the X a... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/deed/city_deed/garage_tatooine_deed.py | 85615 | import sys
def setup(core, object):
return |
fiduswriter/fiduswriter | refs/heads/master | fiduswriter/document/models.py | 1 | import uuid
from builtins import str
from builtins import object
from django.db import models
from django.db.utils import OperationalError, ProgrammingError
from django.contrib.auth.models import User
from django.core import checks
# FW_DOCUMENT_VERSION:
# Also defined in frontend
# document/static/js/modules/schema... |
elainenaomi/sciwonc-dataflow-examples | refs/heads/master | dissertation2017/Experiment 1B/instances/10_0_workflow_full_10files_primary_3sh_3rs_noannot_with_proj_3s_range/calculateratio_0/CalculateRatioCpuMemory_0.py | 38 | #!/usr/bin/env python
"""
This activity will calculate the ratio between CPU request and Memory request by (job ID, task index, event type).
These fields are optional and could be null.
"""
# It will connect to DataStoreClient
from sciwonc.dataflow.DataStoreClient import DataStoreClient
import math
import sys
#######... |
sarthakmeh03/django | refs/heads/master | tests/migrations/test_writer.py | 9 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import decimal
import functools
import math
import os
import re
import sys
import tokenize
import unittest
import uuid
import custom_migration_operations.more_operations
import custom_migration_operations.operations
from django import ge... |
detrout/pykolab | refs/heads/master | tests/functional/test_kolabd/__init__.py | 7 | import pykolab
def setup_package():
conf = pykolab.getConf()
conf.finalize_conf(fatal=False)
|
dhavalmanjaria/dma-student-information-system | refs/heads/master | timetable/views.py | 1 | from django.shortcuts import render, redirect
from .models import TimeTable
from curriculum.models import Course, Semester, Subject
from django.contrib.auth.decorators import login_required, permission_required
import logging
from datetime import datetime
from collections import OrderedDict
from actions.views import Se... |
idea4bsd/idea4bsd | refs/heads/idea4bsd-master | python/testData/resolve/multiFile/importOsPath2/yos.py | 83 | import sys
if True:
import ypath as path
else:
import zpath as path
sys.modules['yos.path'] = path
|
ProfessorX/Config | refs/heads/master | .PyCharm30/system/python_stubs/-1247972723/PyKDE4/kdecore/KLockFile.py | 1 | # encoding: utf-8
# module PyKDE4.kdecore
# from /usr/lib/python2.7/dist-packages/PyKDE4/kdecore.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtNetwork as __PyQt4_QtNetwork
class KLockFile(): # skipped bases: <type 'sip.wrapper'>
# no doc
def getLockInfo(self,... |
glycerine/goq | refs/heads/master | vendor/git.apache.org/thrift.git/tutorial/py.tornado/PythonServer.py | 34 | #!/usr/bin/env python
#
# 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
# "L... |
labsanmartin/Bika-LIMS | refs/heads/master | bika/lims/jsonapi/remove.py | 5 | from bika.lims.jsonapi.read import read
from plone.jsonapi.core import router
from plone.jsonapi.core.interfaces import IRouteProvider
from Products.CMFCore.utils import getToolByName
from zExceptions import BadRequest
from zope import interface
import json
import transaction
class Remove(object):
interface.imple... |
nicolasderam/itools | refs/heads/master | itools/tmx/__init__.py | 3 | # -*- coding: UTF-8 -*-
# Copyright (C) 2005-2009 J. David Ibáñez <jdavid.ibp@gmail.com>
# Copyright (C) 2008 David Versmisse <versmisse@lil.univ-littoral.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... |
p4datasystems/CarnotKEdist | refs/heads/master | dist/Lib/unittest/test/test_loader.py | 99 | import sys
import types
import unittest
class Test_TestLoader(unittest.TestCase):
### Tests for TestLoader.loadTestsFromTestCase
################################################################
# "Return a suite of all tests cases contained in the TestCase-derived
# class testCaseClass"
def te... |
undoware/neutron-drive | refs/heads/master | google_appengine/lib/webapp2/tests/extras_appengine_sessions_ndb_test.py | 21 | # -*- coding: utf-8 -*-
from google.appengine.api import datastore_errors
from google.appengine.api import memcache
import webapp2
from webapp2_extras import sessions
from webapp2_extras import sessions_ndb
import test_base
app = webapp2.WSGIApplication(config={
'webapp2_extras.sessions': {
'secret_key'... |
aleida/django | refs/heads/master | django/contrib/auth/forms.py | 1 | from __future__ import unicode_literals
from django import forms
from django.forms.util import flatatt
from django.template import loader
from django.utils.datastructures import SortedDict
from django.utils.html import format_html, format_html_join
from django.utils.http import int_to_base36
from django.utils.safestri... |
brownharryb/erpnext | refs/heads/develop | erpnext/assets/doctype/asset_settings/asset_settings.py | 13 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class AssetSettings(Document):
pass
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.