repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
foundit/Piped | refs/heads/develop | contrib/status_testing/piped_status_testing/test/test_processors.py | 2 | # Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors.
# See LICENSE for details.
from StringIO import StringIO
from twisted.internet import defer
from twisted.trial import unittest
from piped import processing
from piped_status_testing import processors, statustest
class TestProcessor(processors.S... |
drexly/openhgsenti | refs/heads/master | lib/django/contrib/gis/serializers/geojson.py | 275 | from __future__ import unicode_literals
from django.contrib.gis.gdal import HAS_GDAL
from django.core.serializers.base import (
SerializationError, SerializerDoesNotExist,
)
from django.core.serializers.json import Serializer as JSONSerializer
if HAS_GDAL:
from django.contrib.gis.gdal import CoordTransform, S... |
breakhearts/wallstreet | refs/heads/master | wallstreet/notification/notifier.py | 1 | from mailthon import postman, email
from wallstreet import config
class Notifier(object):
def send_text(self, title, msg):
"""
:params title:title msg: raw text msg
"""
raise NotImplementedError
class EmailNotifier(Notifier):
def __init__(self, host, port, username, password,... |
lumig242/Hue-Integration-with-CDAP | refs/heads/pull3 | desktop/core/src/desktop/lib/test_export_csvxls.py | 3 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
tgavankar/PlaydohSlideSync | refs/heads/master | bin/update_site.py | 32 | #!/usr/bin/env python
"""
Usage: update_site.py [options]
Updates a server's sources, vendor libraries, packages CSS/JS
assets, migrates the database, and other nifty deployment tasks.
Options:
-h, --help show this help message and exit
-e ENVIRONMENT, --environment=ENVIRONMENT
T... |
dnozay/lettuce | refs/heads/master | lettuce/django/steps/mail.py | 20 | """
Step definitions for working with Django email.
"""
from smtplib import SMTPException
from django.core import mail
from lettuce import step
STEP_PREFIX = r'(?:Given|And|Then|When) '
CHECK_PREFIX = r'(?:And|Then) '
EMAIL_PARTS = ('subject', 'body', 'from_email', 'to', 'bcc', 'cc')
GOOD_MAIL = mail.EmailMessage.s... |
boberfly/gaffer | refs/heads/master | python/GafferSceneUI/ShaderAssignmentUI.py | 11 | ##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... |
nubbel/swift-tensorflow | refs/heads/master | PythonGenerated/tensorflow/core/example/example_pb2.py | 1 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/example/example.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf imp... |
chugunovyar/factoryForBuild | refs/heads/master | env/lib/python2.7/site-packages/scipy/weave/numpy_scalar_spec.py | 100 | """ Converters for all of NumPy's scalar types such as
int32, float32, complex128, etc.
"""
from __future__ import absolute_import, print_function
import numpy
from . import c_spec
class numpy_complex_scalar_converter(c_spec.complex_converter):
""" Handles conversion of all the NumPy complex types.
T... |
xpol/gyp | refs/heads/master | test/subdirectory/gyptest-SYMROOT-all.py | 102 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies building a target and a subsidiary dependent target from a
.gyp file in a subdirectory, without specifying an explicit output b... |
xaroth8088/tournament-of-lulz | refs/heads/master | servers/python/tournament_of_lulz/modules/top_images/model_top_images.py | 1 | from tournament_of_lulz.database.database import fetchall
from tournament_of_lulz.modules.image.model_image import ModelImage
class ModelTopImages():
def __init__(self, db_connection):
self.db_connection = db_connection
self.top_images = []
def load_top_images(self, start, limit):
sel... |
ycaihua/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_json/test_fail.py | 84 | from test.test_json import PyTest, CTest
import re
# 2007-10-05
JSONDOCS = [
# http://json.org/JSON_checker/test/fail1.json
'"A JSON payload should be an object or array, not a string."',
# http://json.org/JSON_checker/test/fail2.json
'["Unclosed array"',
# http://json.org/JSON_checker/test/fail3.j... |
Narcolapser/PyGameLearningByDoing | refs/heads/master | Old PyGame stuff/pong/pong.py | 1 | ####################################################################################################
# Name: Pygame Pong Experiement
# Purpose: Make a simple pygame game to get a handle on PyGame
# Date: 2014/02/26
# Programmer: Toben "Littlefoo" "Narcolapser" Archer
# Version: 0.1
###################################... |
nawarian/PHPBot | refs/heads/master | ext/pyautogui/bin/build/bdist.win-amd64/winexe/temp/_hashlib.py | 29 |
def __load():
import imp, os, sys
try:
dirname = os.path.dirname(__loader__.archive)
except NameError:
dirname = sys.prefix
path = os.path.join(dirname, '_hashlib.pyd')
#print "py2exe extension module", __name__, "->", path
mod = imp.load_dynamic(__name__, path)
## mod.frozen... |
blakerouse/python-libmaas | refs/heads/master | maas/client/bones/tests/test_helpers.py | 3 | """Tests for `maas.client.bones.helpers`."""
import json
from unittest.mock import Mock
from urllib.parse import urlparse, urlsplit
import aiohttp.web
from macaroonbakery.httpbakery import Client
from testtools import ExpectedException
from testtools.matchers import Equals, Is, IsInstance, MatchesDict
from .. import... |
lyndon160/REF | refs/heads/master | openflow_bandwidth/report_throughput.py | 1 | #!/usr/bin/python
# coding: utf-8
# This is the command line interface to the JSON-RPC service for the services report_all_ports, report_port and report_switch_ports
# implemented in the server enforce_bandwodth_simple_switch
# if called with -a (for all) then report_all_ports is invoked
# if called with -s (for swit... |
gizmachi/sorting_students | refs/heads/master | inri.py | 1 | #!/usr/bin/python
# coding=utf-8
from random import randint
import openpyxl
import copy
import os
import sys
import datetime
data_filename = "enkater.xlsx"
mission_filename = "missions.txt"
classes_filename = "klasslista.txt"
class_sorting_filename = "klasssortering.txt"
questions_filename = "questions.txt"
sorting_f... |
idegtiarov/gnocchi-rep | refs/heads/master | gnocchi/ceilometer/dispatcher.py | 1 | #
# Copyright 2014 eNovance
#
# Authors: Julien Danjou <julien@danjou.info>
# Mehdi Abaakouk <mehdi.abaakouk@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
#
# ht... |
yunstanford/sanic | refs/heads/master | tests/test_custom_protocol.py | 3 | from sanic.response import text
from sanic.server import HttpProtocol
class CustomHttpProtocol(HttpProtocol):
def write_response(self, response):
if isinstance(response, str):
response = text(response)
self.transport.write(response.output(self.request.version))
self.transport.c... |
shrimpboyho/git.js | refs/heads/master | emscript/python/2.7.5.1_32bit/Lib/test/test_exception_variations.py | 214 |
from test.test_support import run_unittest
import unittest
class ExceptionTestCase(unittest.TestCase):
def test_try_except_else_finally(self):
hit_except = False
hit_else = False
hit_finally = False
try:
raise Exception, 'nyaa!'
except:
hit_except =... |
siemens/rpyc | refs/heads/master | tests/test_refcount.py | 9 | import rpyc
import gc
import unittest
class TestRefcount(unittest.TestCase):
def setUp(self):
self.conn = rpyc.classic.connect_thread()
def tearDown(self):
self.conn.close()
def test_refcount(self):
self.conn.execute("""
deleted_objects = []
class DummyObject(object):
def __... |
mariosky/evo-drawings | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/operations.py | 63 | import re
import sys
from decimal import Decimal
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction
from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter
from django.contrib.gis.geometry.backe... |
DirkdeDraak/easybuild-easyblocks | refs/heads/master | easybuild/easyblocks/w/wrf.py | 10 | ##
# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... |
7agner/Python3-Curso-em-Video | refs/heads/master | Mundo 01 Fundamentos/Aulas e Desafios/Aula 09/Codigo 05 - Print de Texto Longo.py | 1 | """
Usando aspas triplas dentro dos parênteses do comando "print", ao invés do texto se tornar meramamente
um comentário ignorando pelo Python, como este, é possível exibir um texto inteiro com várias linhas,
sem precisar repetir o "print" em cada uma delas.
"""
print("""Lorem ipsum dolor sit amet, consectetur adipisc... |
zasdfgbnm/tensorflow | refs/heads/master | tensorflow/tools/quantization/quantize_graph_test.py | 64 | # 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... |
coolsnowwolf/lede | refs/heads/master | scripts/cfe-partition-tag.py | 27 | #!/usr/bin/env python3
"""
CFE Partition Tag
{
u32 part_id;
u32 part_size;
u16 flags;
char part_name[33];
char part_version[21];
u32 part_crc32;
}
"""
import argparse
import os
import struct
PART_NAME_SIZE = 33
PART_VERSION_SIZE = 21
CRC32_INIT = 0xFFFFFFFF
CRC32_TABLE = [
0x00000000, 0x77073096, 0xEE0E612... |
pjdelport/Django-facebook | refs/heads/master | docs/docs_env/Lib/ntpath.py | 32 | # Module 'ntpath' -- common operations on WinNT/Win95 pathnames
"""Common pathname manipulations, WindowsNT/95 version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import stat
import sys
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
... |
giojavi04/Sais | refs/heads/master | apps/usersProfiles/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
ctripcorp/tars | refs/heads/master | tars/__init__.py | 1 | from tars.engine.celery_app import app
|
n0m4dz/odoo | refs/heads/8.0 | addons/portal_sale/res_config.py | 445 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
cloudify-cosmo/cloudify-manager | refs/heads/master | rest-service/manager_rest/rest/resources_v3_1/summary.py | 1 | #########
# Copyright (c) 2019 Cloudify Platform Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
AnasGhrab/scikit-learn | refs/heads/master | sklearn/cluster/tests/common.py | 416 | """
Common utilities for testing clustering.
"""
import numpy as np
###############################################################################
# Generate sample data
def generate_clustered_data(seed=0, n_clusters=3, n_features=2,
n_samples_per_cluster=20, std=.4):
prng = np.ran... |
rspavel/spack | refs/heads/develop | var/spack/repos/builtin/packages/popt/package.py | 3 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Popt(AutotoolsPackage):
"""The popt library parses command line options."""
homepage ... |
xuru/pyvisdk | refs/heads/master | pyvisdk/do/user_upgrade_event.py | 1 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def UserUpgradeEvent(vim, *args, **kwargs):
'''This event is a general user event from up... |
jmhsi/justin_tinker | refs/heads/master | data_science/lendingclub_bak/investing/count_loans.py | 2 | #import requests
from datetime import datetime
import json
import lendingclub.account_info as acc_info
import re
import lendingclub.dataprep_and_modeling.modeling_utils.data_prep_new as data_prep
import lendingclub.investing.investing_utils as investing_utils
import pandas as pd
# constants
token = acc_info.token
inv_... |
takeflight/wagtail | refs/heads/master | wagtail/core/migrations/0011_page_first_published_at.py | 24 | # -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0010_change_page_owner_to_null_on_delete'),
]
operations = [
migrations.AddField(
model_name='page',
name='first_published_at'... |
bioinfinio/seqmagick | refs/heads/master | seqmagick/test/test_subcommands_backtrans_align.py | 3 | import unittest
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Data import CodonTable
from seqmagick.subcommands import backtrans_align
class BatchTestCase(unittest.TestCase):
def test_no_input(self):
i = []
b = backtrans_align.batch(i, 1)
self.assertRaises(StopItera... |
alexschiller/osf.io | refs/heads/develop | api_tests/registrations/views/test_registration_forks.py | 2 | import mock
import pytest
from nose.tools import * # flake8: noqa
from framework.auth.core import Auth
from website.models import Node
from website.util import permissions
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from osf_tests.factories import (
NodeFactory,
Proje... |
GustavoHennig/ansible | refs/heads/devel | lib/ansible/plugins/connection/__init__.py | 21 | # (c) 2015 Toshio Kuratomi <tkuratomi@ansible.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 License, or
# (at your option) any later ... |
eloquence/unisubs | refs/heads/staging | apps/videos/migrations/0101_fix_subtitle_language_is_complete.py | 5 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
if db.dry_run:
return
count = orm.SubtitleLanguage.objects.count()
i = 0
for ... |
mzie/RATRACTION | refs/heads/master | graphical_programming_v5.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 3 00:53:41 2016
@author: Matt
"""
from PyQt4 import Qt
from collections import OrderedDict
import sys
class MainWindow(Qt.QMainWindow):
def __init__(self, pins_assigned, arduino_sp, parent=None):
'''
Constructor
'''
... |
mlperf/inference_results_v0.5 | refs/heads/master | closed/Habana/code/resnet/Habana_benchmark/preprocess/ssd_mx_symbol/common.py | 4 | '''
Parts were adapted from https://github.com/zhreshold/mxnet-ssd/blob/master/symbol/common.py
This is mathematicly equivelent mxnet implementation - weights are imported from MLPerf resnet34-ssd1200.onnx model
'''
import mxnet as mx
import numpy as np
import math
import sys
import importlib
from mxnet.symbol impo... |
noppanit/airfare-recommendation | refs/heads/master | scripts/import_data.py | 1 | import sys
import os.path
parent = os.path.abspath(os.path.join(os.path.dirname(__file__),'..'))
sys.path.append(parent)
from airfare.atc import create_unique_city, create_flight_details
import csv
with open('data/domestic-flights.csv', 'rt') as csv_file:
routes = csv.reader(csv_file)
for idx, route in enu... |
codeAshu/cgt | refs/heads/master | cgt/tests/test_conv.py | 3 | import numpy as np
import cgt
from cgt import nn
def test_conv():
np.random.seed(0)
x = np.random.randn(2,2,5,17)
filt = np.random.randn(3,2,4,7)
filtrows = filt.shape[2]
filtcols = filt.shape[3]
batchsize = x.shape[0]
outchans = filt.shape[0]
try:
import scipy.signal
... |
ejpbruel/servo | refs/heads/master | tests/power/PowerMeasure.py | 216 | #!/usr/bin/env python
# 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/.
# ---------Power measurement ------------------------------#
# This script will run the servo wi... |
VincentGong/chess | refs/heads/master | cocos2d-x/tools/bindings-generator/clang/cindex.py | 21 | #===- cindex.py - Python Indexing Library Bindings -----------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... |
tarthy6/dozer-thesis | refs/heads/master | scripts/test-OLD/force-network-video.py | 3 | print 30*'*'+' WARNING '+30*'*'+'\nFor hardware/driver/...? reasons related to 3d, this script might\nsometimes crash when the first snapshot is taken with message such as\n\n\tQGLContext::makeCurrent(): Failed.\n\nor\n\n\tFatal IO error 11 (Resource temporarily unavailable) on X server :0.0.\n\nA workaround is to open... |
nealtodd/django | refs/heads/master | tests/builtin_server/tests.py | 368 | from __future__ import unicode_literals
import sys
import traceback
from io import BytesIO
from unittest import TestCase
from wsgiref import simple_server
# If data is too large, socket will choke, so write chunks no larger than 32MB
# at a time. The rationale behind the 32MB can be found on Django's Trac:
# https://... |
xia0pin9/capstone | refs/heads/next | bindings/python/capstone/xcore_const.py | 37 | # For Capstone Engine. AUTO-GENERATED FILE, DO NOT EDIT [xcore_const.py]
# Operand type for instruction's operands
XCORE_OP_INVALID = 0
XCORE_OP_REG = 1
XCORE_OP_IMM = 2
XCORE_OP_MEM = 3
# XCore registers
XCORE_REG_INVALID = 0
XCORE_REG_CP = 1
XCORE_REG_DP = 2
XCORE_REG_LR = 3
XCORE_REG_SP = 4
XCORE_REG_R0 = 5
XCOR... |
tjsavage/rototutor_djangononrel | refs/heads/master | djangotoolbox/__init__.py | 12133432 | |
ejesse/gobblegobble | refs/heads/master | tests/__init__.py | 12133432 | |
pearsontechnology/st2contrib | refs/heads/master | packs/dimensiondata/actions/create_vm_mcp1.py | 6 | from libcloud.compute.base import NodeAuthPassword
from libcloud.common.dimensiondata import DimensionDataServerCpuSpecification
from lib import actions
__all__ = [
'CreateVMMcp1Action',
]
class CreateVMMcp1Action(actions.BaseAction):
def run(self, region, location, network_id, image_name,
name,... |
shiquanwang/numba | refs/heads/master | numba/minivect/__init__.py | 1 | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import os
root = os.path.dirname(os.path.abspath(__file__))
def get_include():
return os.path.join(root, 'include')
|
MichaelKohler/bedrock | refs/heads/master | tests/functional/test_styleguide.py | 11 | # 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/.
import pytest
from pages.styleguide import StyleGuidePage
@pytest.mark.skipif(reason='https://webqa-ci.mozilla.com/jo... |
WebSpider/SickRage | refs/heads/master | lib/hachoir_parser/misc/chm.py | 74 | """
InfoTech Storage Format (ITSF) parser, used by Microsoft's HTML Help (.chm)
Document:
- Microsoft's HTML Help (.chm) format
http://www.wotsit.org (search "chm")
- chmlib library
http://www.jedrea.com/chmlib/
- Unofficial CHM Spec
http://savannah.nongnu.org/projects/chmspec
- Microsoft's HTML Help (.chm) form... |
slohse/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_gtm_server.py | 9 | #!/usr/bin/python
# -*- 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
clinicalml/anchorExplorer | refs/heads/master | test.py | 2 | #from Tkinter import *
import random
from copy import deepcopy
#import tkFileDialog
import itertools
from multiprocessing import Pool
import string
import ttk
import shelve
import time
import sys
import cPickle as pickle
from collections import defaultdict
import numpy as np
import re
from sklearn import metrics
from D... |
eduNEXT/edx-platform | refs/heads/master | cms/djangoapps/xblock_config/models.py | 3 | """
Models used by Studio XBlock infrastructure.
Includes:
StudioConfig: A ConfigurationModel for managing Studio.
"""
from config_models.models import ConfigurationModel
from django.db.models import TextField
class StudioConfig(ConfigurationModel):
"""
Configuration for XBlockAsides.
.. no_pii:
... |
mattseymour/django | refs/heads/master | django/contrib/admin/tests.py | 113 | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test import modify_settings
from django.test.selenium import SeleniumTestCase
from django.utils.deprecation import MiddlewareMixin
from django.utils.translation import ugettext as _
class CSPMiddleware(MiddlewareMixin):
"""The adm... |
kreeger/etcetera | refs/heads/master | checkout/managers.py | 1 | import datetime as dt
from django.db import models
class CheckoutManager(models.Manager):
def active(self):
return self.get_query_set().filter(completion_date=None)
def closed(self):
return self.get_query_set().exclude(completion_date=None) |
Ictp/indico | refs/heads/master | bin/legacy/rebuildAuthorIndex.py | 1 | # -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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; eith... |
adamjmcgrath/glancydesign | refs/heads/master | src/django-nonrel/django/contrib/localflavor/ie/ie_counties.py | 503 | """
Sources:
Irish Counties: http://en.wikipedia.org/wiki/Counties_of_Ireland
"""
from django.utils.translation import ugettext_lazy as _
IE_COUNTY_CHOICES = (
('antrim', _('Antrim')),
('armagh', _('Armagh')),
('carlow', _('Carlow')),
('cavan', _('Cavan')),
('clare', _('Clare')),
('cork... |
ueshin/apache-spark | refs/heads/master | python/pyspark/ml/tuning.py | 13 | #
# 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... |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/celery/loaders/__init__.py | 8 | # -*- coding: utf-8 -*-
"""
celery.loaders
~~~~~~~~~~~~~~
Loaders define how configuration is read, what happens
when workers start, when tasks are executed and so on.
"""
from __future__ import absolute_import
from celery._state import current_app
from celery.utils import deprecated
from celery.util... |
krzysztofwos/BitcoinUnlimited | refs/heads/dev | qa/rpc-tests/test_framework/util.py | 3 | #!/usr/bin/env python3
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2015-2017 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#... |
manishpatell/erpcustomizationssaiimpex123qwe | refs/heads/master | openerp/addons/test_new_api/tests/test_new_fields.py | 15 | #
# test cases for new-style fields
#
from datetime import date, datetime
from collections import defaultdict
from openerp.tests import common
from openerp.exceptions import except_orm
class TestNewFields(common.TransactionCase):
def test_00_basics(self):
""" test accessing new fields """
# find... |
andybab/Impala | refs/heads/master | tests/query_test/test_sort.py | 7 | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, 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... |
mattiamaestrini/spotipy | refs/heads/master | examples/simple0.py | 10 | import spotipy
sp = spotipy.Spotify()
results = sp.search(q='weezer', limit=20)
for i, t in enumerate(results['tracks']['items']):
print(' ', i, t['name'])
|
defance/edx-platform | refs/heads/master | openedx/core/djangoapps/credit/tests/test_signature.py | 43 | # coding=utf-8
"""
Tests for digital signatures used to validate messages to/from credit providers.
"""
from django.test import TestCase
from django.test.utils import override_settings
from openedx.core.djangoapps.credit import signature
@override_settings(CREDIT_PROVIDER_SECRET_KEYS={
"asu": u'abcd1234'
})
cl... |
DigitalPandacoin/pandacoin | refs/heads/master | test/functional/test_framework/test_framework.py | 1 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Base class for RPC testing."""
from enum import Enum
import logging
import optparse
import os
import p... |
thaim/ansible | refs/heads/fix-broken-link | test/integration/targets/ansible-doc/library/test_docs.py | 64 | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'core'}
DOCUMENTATION = '''
---
module: test_docs
short_description: Test modul... |
381426068/MissionPlanner | refs/heads/master | Lib/ihooks.py | 59 | """Import hook support.
Consistent use of this module will make it possible to change the
different mechanisms involved in loading modules independently.
While the built-in module imp exports interfaces to the built-in
module searching and loading algorithm, and it is possible to replace
the built-in function ... |
AbhaySingh/pjproject | refs/heads/master | tests/pjsua/mod_sendto.py | 40 | # $Id$
import imp
import sys
import inc_sip as sip
import inc_const as const
import re
from inc_cfg import *
# Read configuration
cfg_file = imp.load_source("cfg_file", ARGS[1])
# Test body function
def test_func(t):
pjsua = t.process[0]
# Create dialog
dlg = sip.Dialog("127.0.0.1", pjsua.inst_param.sip_port,
... |
csmm/multiase | refs/heads/master | multiasecalc/lammps/dynamics.py | 1 | from multiasecalc.lammps import unitconversion
from ase.optimize.optimize import Dynamics
from ase.io.trajectory import PickleTrajectory
from ase.md.logger import MDLogger
from ase import units
from random import random
import numpy as np
class LAMMPSOptimizer(Dynamics):
""" Geometry optimizer for LAMMPS. works only ... |
pavlovml/tensorflow | refs/heads/master | tensorflow/python/ops/common_shapes.py | 4 | """A library of common shape functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import tensor_shape
def scalar_shape(unused_op):
"""Shape function for ops that output a scalar value."""
return [tensor_shape.s... |
AnturK/-tg-station | refs/heads/master | tools/minibot/config.py | 207 | # Configuration for the minibot.py bot starts here
server = "irc.rizon.net"
port = 6667
channels = ["#asdfgbus", "#botbus"]
defaultchannel = "#asdfgbus"
nick = "minibot-testing-ss13"
altnick = "minibot-testing-ss13_"
name = "minibot"
ident = "minibot"
realname = "minibot"
password = "CHANGETHIS"
# Configuration ends ... |
HyperBaton/ansible | refs/heads/devel | lib/ansible/modules/network/aci/mso_schema_site_anp_epg_staticport.py | 13 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Dag Wieers (@dagwieers) <dag@wieers.com>
# 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_ve... |
markfinger/python-js-host | refs/heads/master | js_host/js_host.py | 1 | import atexit
import sys
from requests.exceptions import ConnectionError as RequestsConnectionError
from .conf import settings
from .exceptions import ProcessError
from .utils import six, verbosity
from .base_server import BaseServer
class JSHost(BaseServer):
expected_type_name = 'Host'
manager = None
lo... |
ax003d/openerp | refs/heads/master | openerp/addons/account/__openerp__.py | 14 | # -*- 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... |
sreejithr/emacs.d | refs/heads/master | pyenv/emacs/lib/python2.7/site-packages/setuptools/command/test.py | 285 | from setuptools import Command
from distutils.errors import DistutilsOptionError
import sys
from pkg_resources import *
from pkg_resources import _namespace_packages
from unittest import TestLoader, main
class ScanningLoader(TestLoader):
def loadTestsFromModule(self, module):
"""Return a suite of all test... |
fedya/ajenti | refs/heads/master | plugins/sysload/api.py | 20 | from ajenti.apis import API
from ajenti.com import Interface
class SysStat(API):
class ISysStat(Interface):
def get_load(self):
pass
def get_ram(self):
pass
def get_swap(self):
pass
|
dialounke/pylayers | refs/heads/master | pylayers/location/geometric/constraints/tdoa.py | 2 | """
.. autoclass:: TDOA
:members:
"""
# -*- coding:Utf-8 -*-
#####################################################################
#This file is part of RGPA.
#Foobar 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 ... |
davido/buck | refs/heads/master | third-party/py/pywatchman/pywatchman/encoding.py | 29 | # Copyright 2016-present Facebook, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions a... |
klmitch/pbr | refs/heads/master | pbr/hooks/base.py | 101 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# Unles... |
jordanemedlock/psychtruths | refs/heads/master | temboo/core/Library/Twilio/ConnectApps/ListConnectApps.py | 5 | # -*- coding: utf-8 -*-
###############################################################################
#
# ListConnectApps
# Returns a list of Connect Apps within your Twilio account.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
... |
mvernacc/proptools | refs/heads/master | proptools/nozzle.py | 1 | """Nozzle flow calculations.
.. autosummary::
thrust_coef
c_star
er_from_p
throat_area
mass_flow
thrust
mach_from_er
mach_from_pr
is_choked
mach_from_area_subsonic
area_from_mach
pressure_from_er
"""
import numpy as np
from scipy.optimize import fsolve
import warnings
import proptools.consta... |
azavea/nyc-trees | refs/heads/develop | src/nyc_trees/apps/home/templatetags/training.py | 4 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django import template
from apps.home.training import training_summary
register = template.Library()
@register.filter
def flatpage_next_url(flatpage):
# the url for this fl... |
garg10may/youtube-dl | refs/heads/master | youtube_dl/extractor/fivemin.py | 102 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse,
)
from ..utils import (
ExtractorError,
)
class FiveMinIE(InfoExtractor):
IE_NAME = '5min'
_VALID_URL = r'''(?x)
(?:https?://[^/]*?5min\.com/Scripts/PlayerSeed... |
richardnpaul/FWL-Website | refs/heads/master | lib/python2.7/sre_compile.py | 4 | /usr/lib/python2.7/sre_compile.py |
rdezavalia/ansible | refs/heads/devel | lib/ansible/cli/doc.py | 4 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# 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 distributed i... |
dentaku65/pelisalacarta | refs/heads/master | python/main-classic/servers/sharpfile.py | 44 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para sharpfile
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core imp... |
guitarmanj/king-phisher | refs/heads/master | tests/client/dialogs.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tests/client/dialogs.py
#
# 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 lis... |
ProfessionalIT/professionalit-webiste | refs/heads/master | sdk/google_appengine/lib/django-1.5/django/conf/locale/sk/formats.py | 108 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'G:i:s'
DAT... |
skullydazed/kle2xy | refs/heads/master | kle2xy.py | 1 | import hjson
from decimal import Decimal
class KLE2xy(list):
"""Abstract interface for interacting with a KLE layout.
"""
def __init__(self, layout=None, name='', invert_y=True):
super(KLE2xy, self).__init__()
self.name = name
self.invert_y = invert_y
self.key_width = Deci... |
tedelhourani/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_cloudproperties.py | 27 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... |
KokareIITP/django | refs/heads/master | tests/transactions/models.py | 411 | """
Transactions
Django handles transactions in three different ways. The default is to commit
each transaction upon a write, but you can decorate a function to get
commit-on-success behavior. Alternatively, you can manage the transaction
manually.
"""
from __future__ import unicode_literals
from django.db import mod... |
zhouzhenghui/python-for-android | refs/heads/master | python-modules/zope/zope/interface/verify.py | 50 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... |
wonikjang/wonikjang.github.io | refs/heads/master | _posts/cnn111.py | 2 | import numpy as np
import matplotlib.pyplot as plt
# y = w1 * x1 + w2 * x2 + b
n = 30
epoch = 5
np.random.seed(0)
# x = np.random.uniform(0, 5, n)
x = np.random.rand(n,2)
x.shape
#x = np.reshape( np.arange(60), (30,2))
#x.shape
d = np.random.uniform(0, 5, n)
d.shape
#d = 2 * x[:,0]
w = np.random.rand(1,2)
b = np.... |
Alberto-Beralix/Beralix | refs/heads/master | i386-squashfs-root/usr/lib/python2.7/encodings/mac_iceland.py | 593 | """ Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.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_table)
def decode(self,input... |
reinvantveer/semcontext | refs/heads/master | lib/rdflib/serializer.py | 25 | """
Serializer plugin interface.
This module is useful for those wanting to write a serializer that can
plugin to rdflib. If you are wanting to invoke a serializer you likely
want to do so through the Graph class serialize method.
TODO: info for how to write a serializer that can plugin to rdflib.
See also rdflib.plu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.