repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
henryre/shalo | refs/heads/master | utils/language_data_utils.py | 1 | import cPickle
import numpy as np
DATA_DIR = 'data/'
def senna(vector_f='embeddings.txt', words_f ='words.lst', out_f='senna.pkl'):
"""Process raw Senna word vectors"""
with open(DATA_DIR + words_f, 'rb') as f:
words = [line.strip() for line in f]
M = np.loadtxt(DATA_DIR + vector_f)
print "F... |
6WIND/scapy | refs/heads/master | scapy/layers/tls/crypto/compression.py | 7 | # This file is part of Scapy
# Copyright (C) 2007, 2008, 2009 Arnaud Ebalard
# 2015, 2016 Maxence Tury
# This program is published under a GPLv2 license
"""
TLS compression.
"""
from __future__ import absolute_import
import zlib
from scapy.error import warning
import scapy.modules.six as six
_tls_com... |
zofuthan/edx-platform | refs/heads/master | lms/djangoapps/courseware/features/homepage.py | 140 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from nose.tools import assert_equals, assert_greater # pylint: disable=no-name-in-module
@step(u'I should see the following links and ids')
def should_see_a_link_called(step):
for link_id_pair in step.hash... |
stupschwartz/branching | refs/heads/master | src/branching.py | 1 | import os
class Branch(object):
def __init__(self, name):
self.name = name
def push(self):
os.system('git push origin %s' % self.name)
print 'branching'
|
jnerin/ansible | refs/heads/devel | lib/ansible/modules/cloud/rackspace/rax_mon_entity.py | 45 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
jonashaag/jedi | refs/heads/master | test/test_evaluate/not_in_sys_path/not_in_sys_path_package/module.py | 34 | value = 'package.module'
|
Hellowlol/PyTunes | refs/heads/master | libs/simplejson/tests/test_default.py | 149 | from unittest import TestCase
import simplejson as json
class TestDefault(TestCase):
def test_default(self):
self.assertEqual(
json.dumps(type, default=repr),
json.dumps(repr(type)))
|
chjw8016/GreenOdoo7-haibao | refs/heads/master | openerp/addons/warning/warning.py | 5 | # -*- 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... |
sarutobi/djamizdat | refs/heads/master | migration/insert_data.py | 1 | # -*- coding: utf-8 -*-
import sys
import sqlite3 as lite
from datetime import datetime
from lxml import etree
def parse_file(dname):
fname = "data/{0}.xml".format(dname)
return etree.parse(fname)
def store_data(conn, query, data):
conn.executemany(query, data)
conn.commit()
def get_int_value(pa... |
rbrito/pkg-youtube-dl | refs/heads/master | youtube_dl/extractor/rottentomatoes.py | 64 | from __future__ import unicode_literals
from .common import InfoExtractor
from .internetvideoarchive import InternetVideoArchiveIE
class RottenTomatoesIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rottentomatoes\.com/m/[^/]+/trailers/(?P<id>\d+)'
_TEST = {
'url': 'http://www.rottentomatoes.co... |
goodwinnk/intellij-community | refs/heads/master | python/testData/completion/funcParamsStar.after.py | 83 | def foo(xboo1, *boo2, **boo3):
pass
foo(xboo1=)
|
psdh/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/command_contexts/open_and_close_window_test.py | 141 | import os
import sys
import random
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
repo_root = os.path.abspath(os.path.join(__file__, "../../.."))
sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
from webdriver import exceptions
class OpenAndCl... |
skybird6672/micropython | refs/heads/master | tests/basics/try_reraise.py | 118 | # Reraising last exception with raise w/o args
def f():
try:
raise ValueError("val", 3)
except:
raise
try:
f()
except ValueError as e:
print(repr(e))
# Can reraise only in except block
try:
raise
except RuntimeError:
print("RuntimeError")
|
Bolt64/sdes | refs/heads/master | file_encryptor.py | 2 | #!/usr/bin/env python3
import s_des_encryption_tools as sdes
import bit_manipulator as bt
import s_des_key_creator as keygen
def encryptor(src, key, decrypt=False):
"""
This generates encrypted bytes from the plaintext source file
"""
assert 0<=key<1023, "key must be a 10 bit binary"
key1,key2=key... |
HiSPARC/station-software | refs/heads/master | user/python/Lib/site-packages/chardet/sbcharsetprober.py | 269 | ######################## 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... |
Brother-Simon/django-dynamic-scraper | refs/heads/master | dynamic_scraper/south_migrations/0001_initial.py | 10 | # 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):
# Adding model 'ScrapedObjClass'
db.create_table('dynamic_scraper_scrapedobjclass', (
('id', s... |
laysakura/chainer | refs/heads/master | chainer/functions/activation/lstm.py | 18 | import numpy
import six
from chainer import cuda
from chainer import function
from chainer.utils import type_check
def _extract_gates(x):
r = x.reshape((x.shape[0], x.shape[1] // 4, 4) + x.shape[2:])
return (r[:, :, i] for i in six.moves.range(4))
def _sigmoid(x):
return 1 / (1 + numpy.exp(-x))
def _... |
indautgrp/erpnext | refs/heads/develop | erpnext/patches/v7_0/update_prevdoc_values_for_supplier_quotation_item.py | 44 | import frappe
def execute():
frappe.reload_doctype('Supplier Quotation Item')
for data in frappe.db.sql(""" select prevdoc_docname, prevdoc_detail_docname, name
from `tabSupplier Quotation Item` where prevdoc_docname is not null""", as_dict=True):
frappe.db.set_value("Supplier Quotation Item", data.name, "materi... |
crwilcox/PTVS | refs/heads/master | Python/Tests/TestData/DjangoTemplateCodeIntelligence/urls.py | 18 | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'DjangoTemplateCodeIntelligence.views.home', name='home'),
# url(r'^DjangoTemplateC... |
creativcoder/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/testing/test_genscript.py | 194 | import pytest
import sys
@pytest.fixture(scope="module")
def standalone(request):
return Standalone(request)
class Standalone:
def __init__(self, request):
self.testdir = request.getfuncargvalue("testdir")
script = "mypytest"
result = self.testdir.runpytest("--genscript=%s" % script)
... |
dfdx2/django | refs/heads/master | django/contrib/gis/geometry/regex.py | 657 | import re
# Regular expression for recognizing HEXEWKB and WKT. A prophylactic measure
# to prevent potentially malicious input from reaching the underlying C
# library. Not a substitute for good Web security programming practices.
hex_regex = re.compile(r'^[0-9A-F]+$', re.I)
wkt_regex = re.compile(r'^(SRID=(?P<srid... |
cowlicks/numpy | refs/heads/master | numpy/distutils/tests/swig_ext/setup.py | 135 | #!/usr/bin/env python
from __future__ import division, print_function
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('swig_ext', parent_package, top_path)
config.add_extension('_example',
['src/example.... |
Shedward/timus | refs/heads/master | templates/template.py | 1 |
print('Hello!')
|
waldyrious/GraphUI | refs/heads/master | old/capnf/code/__init__.py | 6 | import base
import builtins
|
lucychambers/pepperrage | refs/heads/gh-pages | .bundle/ruby/2.0.0/gems/pygments.rb-0.6.0/vendor/pygments-main/pygments/styles/vs.py | 135 | # -*- coding: utf-8 -*-
"""
pygments.styles.vs
~~~~~~~~~~~~~~~~~~
Simple style with MS Visual Studio colors.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Co... |
bjodah/mpmath | refs/heads/master | mpmath/tests/test_levin.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from mpmath import mp
from mpmath import libmp
xrange = libmp.backend.xrange
# Attention:
# These tests run with 15-20 decimal digits precision. For higher precision the
# working precision must be raised.
def test_levin_0():
mp.dps = 17
eps = mp.mpf(mp.eps)
... |
Menooker/gem5_pcm | refs/heads/master | src/sim/Process.py | 15 | # Copyright (c) 2005-2008 The Regents of The University of Michigan
# 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 ... |
dydek/django | refs/heads/master | django/contrib/admindocs/middleware.py | 477 | from django import http
from django.conf import settings
class XViewMiddleware(object):
"""
Adds an X-View header to internal HEAD requests -- used by the documentation system.
"""
def process_view(self, request, view_func, view_args, view_kwargs):
"""
If the request method is HEAD and... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.4/Lib/encodings/punycode.py | 15 | # -*- coding: iso-8859-1 -*-
""" Codec for the Punicode encoding, as specified in RFC 3492
Written by Martin v. Löwis.
"""
import codecs
##################### Encoding #####################################
def segregate(str):
"""3.1 Basic code point segregation"""
base = []
extended = {}
for c in st... |
40023255/w16b_test | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/version.py | 607 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... |
tbeadle/django | refs/heads/master | tests/utils_tests/test_feedgenerator.py | 6 | from __future__ import unicode_literals
import datetime
import unittest
from django.test import TestCase
from django.utils import feedgenerator
from django.utils.timezone import get_fixed_timezone, utc
class FeedgeneratorTest(unittest.TestCase):
"""
Tests for the low-level syndication feed framework.
""... |
FireBladeNooT/Medusa_1_6 | refs/heads/master | lib/feedparser/namespaces/dc.py | 43 | # Support for the Dublin Core metadata extensions
# Copyright 2010-2015 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that... |
shishengjia/OnlineCourses | refs/heads/master | extra_apps/xadmin/plugins/topnav.py | 21 |
from django.template import loader
from django.utils.text import capfirst
from django.core.urlresolvers import reverse, NoReverseMatch
from django.utils.translation import ugettext as _
from xadmin.sites import site
from xadmin.filters import SEARCH_VAR
from xadmin.views import BaseAdminPlugin, CommAdminView
class ... |
ltowarek/budget-supervisor | refs/heads/dependabot/pip/django-3.1.10 | third_party/saltedge/swagger_client/models/connection_response.py | 1 | # coding: utf-8
"""
Salt Edge Account Information API
API Reference for services # noqa: E501
OpenAPI spec version: 5.0.0
Contact: support@saltedge.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ConnectionRespons... |
seraphlnWu/wekka | refs/heads/master | wekka/wekka/themes/steward/admin.py | 1 | # coding=utf8
#
from django.contrib import admin
from models import SiteConfig, Category, Videos
class SiteConfigAdmin(admin.ModelAdmin):
''' '''
list_display = ('site_name', 'site_url', 'admin_email', 'icp_info',
'show_icp', 'third_analysis_code', 'close_site')
class CategoryAdmin(adm... |
gencer/python-phonenumbers | refs/heads/dev | python/phonenumbers/data/region_DK.py | 2 | """Auto-generated file, do not edit by hand. DK metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_DK = PhoneMetadata(id='DK', country_code=45, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2-9]\\d{7}', possible_length=(8,)),
... |
Freso/beets | refs/heads/master | beetsplug/importfeeds.py | 7 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Fabrice Laporte.
#
# 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 ... |
schristakidis/p2ner | refs/heads/development | p2ner/components/ui/gtkgui/gtkgui/options/optServers.py | 1 | import os, sys
# Copyright 2012 Loris Corazza, Sakis Christakidis
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... |
andreif/django | refs/heads/master | tests/select_for_update/tests.py | 123 | from __future__ import unicode_literals
import threading
import time
from multiple_database.routers import TestRouter
from django.db import DatabaseError, connection, router, transaction
from django.test import (
TransactionTestCase, override_settings, skipIfDBFeature,
skipUnlessDBFeature,
)
from .models im... |
QUANTAXIS/QUANTAXIS | refs/heads/master | docker/kite/qa-jupyter_rust2/jupyter_notebook_config.py | 2 | # 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... |
AlanZatarain/python-astm | refs/heads/master | astm/tests/test_protocol.py | 16 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
import unittest
from astm import constants
from astm.tests.utils import DummyMixIn, track_call
from ast... |
MrLoick/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/cgi.py | 46 | #! /usr/local/bin/python
# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
# intentionally NOT "/usr/bin/env python". On many systems
# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
# scripts, and /usr/local/bin is the default directory where Python is
# installed, so /usr/bin/env w... |
stefan-jonasson/home-assistant | refs/heads/dev | tests/components/test_sleepiq.py | 24 | """The tests for the SleepIQ component."""
import unittest
from unittest.mock import MagicMock, patch
import requests_mock
from homeassistant import setup
import homeassistant.components.sleepiq as sleepiq
from tests.common import load_fixture, get_test_home_assistant
def mock_responses(mock):
"""Mock response... |
shon/simplenote.py | refs/heads/master | docs/conf.py | 2 | # -*- coding: utf-8 -*-
#
# simplenote.py documentation build configuration file, created by
# sphinx-quickstart on Sat Jun 25 17:40:25 2011.
#
# 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.
#... |
mattharrison/PgPartition | refs/heads/master | test/testpgpartitionlib.py | 1 | # Copyright (c) 2010 Matt Harrison
import unittest
import sqlalchemy as sa
import pgpartitionlib
dburl = "postgres://postgres@localhost"
start_part = 1
end_part = 3
new_end = 6
class TestPgpartitionlib(unittest.TestCase):
def test_main(self):
ddl = """CREATE TABLE test_part (
key INTEGER NOT NU... |
damnfine/mezzanine | refs/heads/master | mezzanine/accounts/defaults.py | 44 | """
Default settings for all mezzanine.accounts app. Each of these can be
overridden in your project's settings module, just like regular
Django settings. The ``editable`` argument for each controls whether
the setting is editable via Django's admin.
Thought should be given to how a setting is actually used before
mak... |
Bysmyyr/blink-crosswalk | refs/heads/master | Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py | 21 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
ric96/joypi | refs/heads/master | joypi.py | 1 | import time
import signal
import pygame
import sys
import RPi.GPIO as GPIO
# The following is an example code written to controll the l298n motor contoller
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT) #input-1
GPIO.setup(12, GPIO.OUT) #input-2
GPIO.setup(15, GPIO.OUT) #input-3
GPIO.setup(16, GPIO.OUT) #input-4
GPI... |
XiaosongWei/chromium-crosswalk | refs/heads/master | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/process_json_data_unittest.py | 59 | # Copyright (C) 2014 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
apache/bigtop | refs/heads/master | bigtop-packages/src/charm/hbase/layer-hbase/tests/01-basic-deployment.py | 10 | #!/usr/bin/env python3
# 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 "Lic... |
KrishMunot/swift | refs/heads/master | test/Driver/Dependencies/Inputs/fake-build-for-bitcode.py | 12 | #!/usr/bin/env python
# fake-build-for-bitcode.py - Fake build with -embed-bitcode -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://sw... |
lextoumbourou/txstripe | refs/heads/master | setup.py | 1 | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='txstripe',
version='0.1.0',
description='Stripe Twisted bindings',
author='Lex Toumbourou',
author_email='lextoumbourou@gmail.com',
url='https://github.com/lextoumbourou/txstripe',
p... |
bayasist/vbox | refs/heads/master | src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py | 11 | ## @file
# Patch value into the binary file.
#
# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be f... |
NorfolkDataSci/presentations | refs/heads/master | 2018-01_chatbot/serverless-chatbots-workshop-master/LambdaFunctions/sentiment-analysis/nltk/cluster/__init__.py | 7 | # Natural Language Toolkit: Clusterers
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
This module contains a number of basic clustering algorithms. Clustering
describes the task of discovering groups of simila... |
pjdelport/django | refs/heads/master | django/contrib/gis/db/models/proxy.py | 220 | """
The GeometryProxy object, allows for lazy-geometries. The proxy uses
Python descriptors for instantiating and setting Geometry objects
corresponding to geographic model fields.
Thanks to Robert Coup for providing this functionality (see #4322).
"""
from django.contrib.gis import memoryview
from django.utils impor... |
GedheFoundation/sidesa2.0 | refs/heads/master | laporan_profil.py | 1 | #Boa:Frame:laporan_profil_desa
import wx
import sqlite3
def connect():
db = sqlite3.connect('sidesa')
return db
db.close()
def create(parent):
return laporan_profil_desa(parent)
[wxID_LAPORAN_PROFIL_DESA, wxID_LAPORAN_PROFIL_DESAINPUT_ALAMAT,
wxID_LAPORAN_PROFIL_DESAINPUT_DESA, wxID_LAPO... |
hustodemon/spacewalk | refs/heads/master | backend/server/action/kickstart_guest.py | 2 | #
# Copyright (c) 2008--2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
mlperf/inference_results_v0.7 | refs/heads/master | closed/CentaurTechnology/code/python-code/python/dataset.py | 1 | """
dataset related classes and methods
"""
# pylint: disable=unused-argument,missing-docstring
import logging
import sys
import time
import cv2
import numpy as np
logging.basicConfig(level=logging.INFO)
log = logging.getLogger("dataset")
class Item():
def __init__(self, label, img, idx):
self.label =... |
prutseltje/ansible | refs/heads/devel | lib/ansible/modules/cloud/webfaction/webfaction_db.py | 51 | #!/usr/bin/python
#
# (c) Quentin Stafford-Fraser 2015, with contributions gratefully acknowledged from:
# * Andy Baker
# * Federico Tarantini
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Create a webfaction database using Ansible and the Webfaction API
fro... |
yuyangit/tornado | refs/heads/master | demos/chat/chatdemo.py | 14 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
marteinn/Skeppa | refs/heads/master | examples/2-ecr-registry/web/example/views.py | 3 | from django.http import HttpResponse
def index(request):
return HttpResponse("Index")
|
n0m4dz/odoo | refs/heads/8.0 | doc/_extensions/odoo/__init__.py | 119 | # -*- coding: utf-8 -*-
from . import pygments_override
from . import switcher
import sphinx.environment
import sphinx.builders.html
from docutils import nodes
def setup(app):
if getattr(app.config, 'html_translator_class', None):
app.warn("Overriding the explicitly set html_translator_class setting",
... |
poljeff/odoo | refs/heads/8.0 | doc/_extensions/odoo/__init__.py | 119 | # -*- coding: utf-8 -*-
from . import pygments_override
from . import switcher
import sphinx.environment
import sphinx.builders.html
from docutils import nodes
def setup(app):
if getattr(app.config, 'html_translator_class', None):
app.warn("Overriding the explicitly set html_translator_class setting",
... |
prawn-cake/vk-requests | refs/heads/master | vk_requests/settings.py | 1 | # -*- coding: utf-8 -*-
"""Test settings"""
import os
# Set your environment variables for testing or put values here
# user email or phone number
USER_LOGIN = os.getenv('VK_USER_LOGIN', '')
USER_PASSWORD = os.getenv('VK_USER_PASSWORD', '')
# aka API/Client ID
APP_ID = os.getenv('VK_APP_ID')
PHONE_NUMBER = os.getenv... |
raphaelmerx/django | refs/heads/master | tests/migrations/migrations_test_apps/alter_fk/author_app/migrations/0002_alter_id.py | 379 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('author_app', '0001_initial'),
('book_app', '0001_initial'), # Forces the book table to alter the FK
]
operations = [
... |
bhavanaananda/DataStage | refs/heads/master | test/RDFDatabank/rdflib/compare.py | 4 | # -*- coding: utf-8 -*-
"""
A collection of utilities for canonicalizing and inspecting graphs.
Among other things, they solve of the problem of deterministic bnode
comparisons.
Warning: the time to canonicalize bnodes may increase exponentially on larger
graphs. Use with care!
Example of comparing two graphs::
... |
shakamunyi/tensorflow | refs/heads/master | tensorflow/python/training/adam.py | 15 | # 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... |
kuiwei/kuiwei | refs/heads/master | lms/djangoapps/courseware/features/events.py | 16 | # pylint: disable=C0111
from lettuce import step
from lettuce import world
from lettuce import before
from pymongo import MongoClient
from nose.tools import assert_equals
from nose.tools import assert_in
REQUIRED_EVENT_FIELDS = [
'agent',
'event',
'event_source',
'event_type',
'host',
'ip',
... |
alexbredo/honeypot-pop3 | refs/heads/master | pop3.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Alexander Bredo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the abov... |
scripnichenko/nova | refs/heads/master | nova/objects/block_device.py | 11 | # Copyright 2013 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
stvstnfrd/edx-platform | refs/heads/master | import_shims/studio/contentstore/management/commands/edit_course_tabs.py | 2 | """Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
# pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('contentstore.management.commands.edit_course_tabs'... |
wangmiao1981/spark | refs/heads/master | examples/src/main/python/avro_inputformat.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 us... |
frossigneux/blazar | refs/heads/master | climate/openstack/common/policy.py | 2 | # Copyright (c) 2012 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.apache.org/licenses/LICENSE-2.0
#
# Unless... |
mathLab/RBniCS | refs/heads/master | rbnics/backends/__init__.py | 1 | # Copyright (C) 2015-2021 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
import importlib
import sys
# Initialize __all__ variable
__all__ = []
# Process configuration files first
from rbnics.utils.config import config
# Helper function to load required backen... |
pygeek/django | refs/heads/master | tests/regressiontests/null_fk/tests.py | 118 | from __future__ import absolute_import, unicode_literals
from django.db.models import Q
from django.test import TestCase
from .models import (SystemDetails, Item, PropertyValue, SystemInfo, Forum,
Post, Comment)
class NullFkTests(TestCase):
def test_null_fk(self):
d = SystemDetails.objects.create(... |
nvoron23/paragraph2vec | refs/heads/master | test_word2vec.py | 2 | import gensim
s = []
with open("../text8") as f:
for l in f:
s.append(l.strip().split())
w = gensim.models.Word2Vec(s,workers=24)
print w.similarity("man","woman")
|
DougFirErickson/qgisSpaceSyntaxToolkit | refs/heads/master | esstoolkit/external/networkx/algorithms/operators/product.py | 33 | """
Graph products.
"""
# Copyright (C) 2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
from itertools import product
__author__ = """\n""".join(['Aric Hagberg (hagberg@lanl.gov)'... |
eramirem/astroML | refs/heads/master | book_figures/chapter10/fig_fft_example.py | 3 | """
Fast Fourier Transform Example
------------------------------
Figure 10.5
The discrete Fourier transform (bottom panel) for two noisy data sets shown in
the top panel. For 512 evenly sampled times t (dt = 0.977), points are drawn
from h(t) = a + sin(t)G(t), where G(t) is a Gaussian N(mu = 0,sigma = 10).
Gaussian n... |
leonardocsantoss/ehventos | refs/heads/master | lib/reportlab/graphics/charts/axes.py | 10 | #Copyright ReportLab Europe Ltd. 2000-2010
#see license.txt for license details
__version__=''' $Id: axes.py 3748 2010-07-27 09:36:33Z rgbecker $ '''
__doc__="""Collection of axes for charts.
The current collection comprises axes for charts using cartesian
coordinate systems. All axes might have tick marks and labels.... |
pataquets/namecoin-core | refs/heads/master | test/functional/test_framework/test_node.py | 1 | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for namecoind node under test"""
import contextlib
import decimal
import errno
from enum import ... |
CeltonMcGrath/TACTIC | refs/heads/master | src/tactic/ui/cgapp/__init__.py | 7 | ###########################################################
#
# Copyright (c) 2005-2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written ... |
ScalaInc/exp-python2-sdk | refs/heads/master | setup.py | 1 | from setuptools import setup
setup(
name='exp-sdk',
packages= ['exp_sdk'],
version='1.0.7',
description='EXP Python SDK',
author='Scala',
author_email='james.dalessio@scala.com',
url='https://github.com/scalainc/exp-python2-sdk',
download_url='https://github.com/scalainc/exp-python2-sdk/tarball/1.0.7',... |
riadnassiffe/Simulator | refs/heads/master | src/tools/ecos/cvxpy/examples/extensions/mixed_integer/sparse_var.py | 1 | """
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY 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.
CVXPY is distributed i... |
razvanphp/arangodb | refs/heads/devel | 3rdParty/V8-3.31.74.1/third_party/python_26/Lib/site-packages/win32comext/shell/demos/dump_link.py | 17 | # dump_link.py - dumps information about shell shortcuts
#
import sys, os
from win32com.shell import shell, shellcon
import pythoncom
import glob
from win32com.storagecon import *
def DumpLink(fname):
shellLink = pythoncom.CoCreateInstance(shell.CLSID_ShellLink, None, pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IShellL... |
TanguyPatte/phantomjs-packaging | refs/heads/master | src/qt/qtbase/src/3rdparty/freetype/src/tools/docmaker/utils.py | 515 | # Utils (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
import string, sys, os, glob
# current output directory
#
output_dir = None
# This function is used to sort the index. It is a simple lexicographical
# sort, except that it places capital letters before lowercase ones.
#
def index_sort( s1, ... |
shinose/kodi-qplay | refs/heads/master | lib/gtest/test/gtest_break_on_failure_unittest.py | 2140 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
argentumproject/electrum-arg | refs/heads/master | gui/kivy/nfc_scanner/scanner_dummy.py | 1 | ''' Dummy NFC Provider to be used on desktops in case no other provider is found
'''
from electrum_arg_gui.kivy.nfc_scanner import NFCBase
from kivy.clock import Clock
from kivy.logger import Logger
class ScannerDummy(NFCBase):
'''This is the dummy interface that gets selected in case any other
hardware interf... |
yongtang/tensorflow | refs/heads/master | tensorflow/lite/testing/op_tests/zeros_like.py | 16 | # Copyright 2019 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... |
okere-prince/googlemock | refs/heads/master | scripts/generator/cpp/utils.py | 1158 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... |
tectronics/mpmath | refs/heads/master | doc/source/plots/coulombg.py | 30 | # Irregular Coulomb wave functions -- equivalent to figure 14.5 in A&S
F1 = lambda x: coulombg(0,0,x)
F2 = lambda x: coulombg(0,1,x)
F3 = lambda x: coulombg(0,5,x)
F4 = lambda x: coulombg(0,10,x)
F5 = lambda x: coulombg(0,x/2,x)
plot([F1,F2,F3,F4,F5], [0,30], [-2,2]) |
Dapid/numpy | refs/heads/master | numpy/lib/_version.py | 156 | """Utility to compare (Numpy) version strings.
The NumpyVersion class allows properly comparing numpy version strings.
The LooseVersion and StrictVersion classes that distutils provides don't
work; they don't recognize anything like alpha/beta/rc/dev versions.
"""
from __future__ import division, absolute_import, pri... |
JanikNex/adventure16 | refs/heads/master | src/utilclasses/cdialoguehandler.py | 1 | from src.utilclasses.cjsonhandler import *
class DialogueHandler(object):
def __init__(self, game):
"""
Erstellt neuen DialogueHandler
:param game: Game
:type game: Game
"""
self.game = game
self.jsonparser = JSONHandler()
self.path = None
se... |
SKA-ScienceDataProcessor/FastImaging-Python | refs/heads/master | tests/test_utils.py | 1 | import numpy as np
from fastimgproto.utils import nonzero_bounding_slice_2d
def test_bounding_slice_2d():
a = np.zeros((5, 5), dtype=np.float_)
# Should return None if no non-zero elements:
assert nonzero_bounding_slice_2d(a) == None
val1 = 42
val2 = 3.14
a[1, 2] = val1
bs = nonzero_boun... |
dbckz/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_elb_facts.py | 27 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... |
iizukak/nupic-nlp-experiment | refs/heads/master | src/encoder/vector_test.py | 1 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
jkocherhans/maillib | refs/heads/master | maillib/tests/attachments.py | 1 | from maillib import Message
import unittest
RAW_MESSAGE = """\
Return-path: <jkocherhans@gmail.com>
Received: from smtpin132-bge351000 ([10.150.68.132])
by ms041.mac.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26
2008; 64bit)) with ESMTP id <0KRV00HDRSA264C0@ms041.mac.com> for
jkocherhans@mac.com;... |
kreatorkodi/repository.torrentbr | refs/heads/master | plugin.video.quasar/resources/site-packages/bjsonrpc/main.py | 11 | """
bjson/main.py
Copyright (c) 2010 David Martinez Marti
All rights reserved.
Licensed under 3-clause BSD License.
See LICENSE.txt for the full license text.
"""
import socket
import bjsonrpc.server
import bjsonrpc.connection
import bjsonrpc.handlers
__all__ = [
"createserver",
"connec... |
physycom/QGIS | refs/heads/master | tests/src/python/test_qgsserver_wms.py | 4 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServer WMS.
From build dir, run: ctest -R PyQgsServerWMS -V
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the Licen... |
hhLeo/ucore_lab | refs/heads/master | related_info/lab7/semaphore_condition/thr-ex4.py | 48 | import threading
class MyThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
print "I am %s" % (self.name)
if __name__ == "__main__":
for i in range(0, 5):
my_thread = MyThread()
my_thread.start()
|
collegboi/Raspi-Media | refs/heads/master | TVShowClass.py | 1 | #!/usr/bin/python
class TVClass(object):
def __init__(self, name, season, episode, avail):
self.name = name
self.season = season
self.episode = episode
self.avail = avail
def getName(self):
return self.name
def getSeason(self):
return self.season
def getEpisode(self):
return self.episode
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.