repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
Cazomino05/Test1
refs/heads/master
vendor/google-breakpad/src/tools/gyp/pylib/gyp/generator/xcode_test.py
2479
#!/usr/bin/env python # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the xcode.py file. """ import gyp.generator.xcode as xcode import unittest import sys class TestEscapeXcodeDefine(unit...
uberamd/NGECore2
refs/heads/master
scripts/object/mobile/chirq_med_m_1.py
85615
import sys def setup(core, object): return
GhostThrone/django
refs/heads/master
tests/migrations/test_migrations_squashed_complex_multi_apps/app2/1_auto.py
770
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [("app1", "1_auto")] operations = [ migrations.RunPython(migrations.RunPython.noop) ]
HiroIshikawa/21playground
refs/heads/master
thumblelog/tumblelog/models.py
1
import datetime from flask import url_for from tumblelog import db class Comment(db.EmbeddedDocument): created_at = db.DateTimeField(default=datetime.datetime.now, required=True) body = db.StringField(verbose_name="Comment", required=True) author = db.StringField(verbose_name="Name", max_length=255, requi...
IshankGulati/scikit-learn
refs/heads/master
sklearn/metrics/regression.py
47
"""Metrics to assess performance on regression task Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Ma...
gsmartway/odoo
refs/heads/8.0
openerp/addons/base/report/__init__.py
462
import preview_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
cXhristian/django-wiki
refs/heads/master
tests/plugins/globalhistory/__init__.py
2878
from __future__ import absolute_import
luispedro/milksets
refs/heads/master
milksets/abalone/__init__.py
2
from .abalone import *
mscherer/ansible
refs/heads/devel
v1/tests/TestFilters.py
107
''' Test bundled filters ''' import os.path import unittest, tempfile, shutil from ansible import playbook, inventory, callbacks import ansible.runner.filter_plugins.core import ansible.runner.filter_plugins.mathstuff INVENTORY = inventory.Inventory(['localhost']) BOOK = ''' - hosts: localhost vars: var: { a: ...
risicle/django
refs/heads/master
tests/template_tests/test_parser.py
288
""" Testing some internals of the template processing. These are *not* examples to be copied in user code. """ from __future__ import unicode_literals from unittest import TestCase from django.template import Library, TemplateSyntaxError from django.template.base import ( TOKEN_BLOCK, FilterExpression, Parser, To...
gomiero/PTVS
refs/heads/master
Python/Tests/TestData/Grammar/FuncDefV2.py
18
def f(a, (b, c), d): pass
FlaskGuys/Flask-Imagine
refs/heads/master
flask_imagine/filters/downscale.py
2
""" This module implement a downscale filter. """ from __future__ import division from .interface import ImagineFilterInterface from PIL import Image class DownscaleFilter(ImagineFilterInterface): """ Downscale filter """ size = None def __init__(self, **kwargs): """ :param kwargs...
JorisBolsens/PYNQ
refs/heads/master
python/pynq/iop/grove_th02.py
2
# Copyright (c) 2016, NECST Laboratory, Politecnico di Milano # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright not...
waseem18/oh-mainline
refs/heads/master
vendor/packages/distribute/setuptools/archive_util.py
65
"""Utilities for extracting common archive formats""" __all__ = [ "unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter", "UnrecognizedFormat", "extraction_drivers", "unpack_directory", ] import zipfile, tarfile, os, shutil from pkg_resources import ensure_directory from distutils.errors impo...
utecuy/edx-platform
refs/heads/master
lms/djangoapps/mobile_api/users/models.py
1644
""" A models.py is required to make this an app (until we move to Django 1.7) """
opoplawski/ansible
refs/heads/devel
test/units/module_utils/test_database.py
325
import collections import mock import os import re from nose.tools import eq_ try: from nose.tools import assert_raises_regexp except ImportError: # Python < 2.7 def assert_raises_regexp(expected, regexp, callable, *a, **kw): try: callable(*a, **kw) except expected as e: ...
endlessm/chromium-browser
refs/heads/master
third_party/catapult/telemetry/telemetry/internal/story_runner.py
1
# Copyright 2014 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. import contextlib import itertools import logging import optparse import os import re import sys import time import py_utils from py_utils import cloud_stor...
minhphung171093/GreenERP
refs/heads/master
openerp/addons/project/res_config.py
18
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import fields, osv from openerp.tools.translate import _ class project_configuration(osv.osv_memory): _name = 'project.config.settings' _inherit = 'res.config.settings' _columns = { ...
Cirrus-Link/Sparkplug
refs/heads/master
client_libraries/products/third_party/ignition/7.9.3/user-lib/pylib/google/protobuf/internal/type_checkers.py
68
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
bhargav2408/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/test/test_copyreg.py
173
import copyreg import unittest from test import support from test.pickletester import ExtensionSaver class C: pass class WithoutSlots(object): pass class WithWeakref(object): __slots__ = ('__weakref__',) class WithPrivate(object): __slots__ = ('__spam',) class WithSingleString(object): __slot...
bkj/ernest
refs/heads/master
scrape/dep/scrape-edgar-forms-v1.py
2
#!/usr/bin/env python ''' Update ernest_forms_cat index with newly ingested edgar_index documents ** Note ** This runs prospectively using a back-fill parameter only to grab docs that have not been tried or that have failed ''' import re import time import json import xmltodict import argpars...
SnappleCap/oh-mainline
refs/heads/master
vendor/packages/Pygments/pygments/styles/vim.py
364
# -*- coding: utf-8 -*- """ pygments.styles.vim ~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by vim. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keywor...
JetBrains/intellij-community
refs/heads/master
python/testData/debug/test3.py
10
class A: def __init__(self, z): self.z = z def foo(self, x): y = 2 * x + self.z return 1 + y def zoo(x): y = int((x - 2) / (x - 1)) return A(y) print(zoo(2).foo(2)) try: try: print(zoo(1).foo(2)) #we got ZeroDivision here finally: print(zoo(0).foo(4)...
Kalissaac/Mountainz
refs/heads/master
node_modules/erlpack/py/tests/test_generated.py
4
from erlpack import Atom, pack, unpack def test_pack_string(): assert pack('string') == '\x83m\x00\x00\x00\x06string' def test_unpack_string(): assert unpack('\x83m\x00\x00\x00\x06string') == 'string' def test_pack_empty_list(): assert pack([]) == '\x83j' def test_unpack_empty_list(): assert unp...
jhonatajh/mtasa-blue
refs/heads/master
vendor/google-breakpad/src/tools/gyp/test/make/gyptest-dependencies.py
344
#!/usr/bin/env python # Copyright (c) 2012 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 that .d files and all.deps are properly generated. """ import TestGyp # .d files are only used by the make build. test = Test...
depaoli/toolz
refs/heads/master
depaoli_pylib/type7decrypt.py
1
#!/usr/bin/env python # # Rough script (or module) to decrypt Cisco Type 7 passwords. # ############################################################# def type7decrypt(type7_string): """ Function to decrypt Cisco Type 7 passwords. """ type0_string = '' cipher_key = ( 0x64, 0x73, 0x66, 0x64, 0...
bigswitch/tempest
refs/heads/master
tempest/tests/common/test_waiters.py
1
# Copyright 2014 IBM Corp. # # 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 t...
lodow/portia-proxy
refs/heads/master
slybot/slybot/linkextractor/__init__.py
23
""" Link extraction for auto scraping """ from scrapy.utils.misc import load_object from .base import BaseLinkExtractor, ALLOWED_SCHEMES from .html import HtmlLinkExtractor from .xml import XmlLinkExtractor, RssLinkExtractor, SitemapLinkExtractor, AtomLinkExtractor from .regex import RegexLinkExtractor from .ecsv impo...
dendisuhubdy/tensorflow
refs/heads/master
tensorflow/python/ops/linalg/linear_operator_circulant.py
14
# Copyright 2018 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...
yamila-moreno/django
refs/heads/master
tests/template_tests/syntax_tests/test_if_equal.py
368
from django.test import SimpleTestCase from ..utils import setup class IfEqualTagTests(SimpleTestCase): @setup({'ifequal01': '{% ifequal a b %}yes{% endifequal %}'}) def test_ifequal01(self): output = self.engine.render_to_string('ifequal01', {'a': 1, 'b': 2}) self.assertEqual(output, '') ...
garthomp/ruby_blog
refs/heads/master
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/autumn.py
364
# -*- coding: utf-8 -*- """ pygments.styles.autumn ~~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.to...
nwiizo/workspace_2017
refs/heads/master
ryu/example/simple_switch_lacp_13.py
10
# Copyright (C) 2016 Nippon Telegraph and Telephone Corporation. # # 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 appli...
patilsangram/erpnext
refs/heads/develop
erpnext/patches/v6_0/multi_currency.py
80
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): # Reload doctype for dt in ("Account", "GL Entry", "Journal Entry", "Journal Entry Account", "Sales Invoice", "Purc...
gangadhar-kadam/verve_test_frappe
refs/heads/v5.0
frappe/tests/test_fmt_money.py
54
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt, cstr def fmt_money(amount, precision=None): """ Convert to string with commas for thousands, millions etc """ ...
miniconfig/home-assistant
refs/heads/dev
homeassistant/components/introduction.py
27
""" Component that will help guide the user taking its first steps. For more details about this component, please refer to the documentation at https://home-assistant.io/components/introduction/ """ import logging import voluptuous as vol DOMAIN = 'introduction' CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({...
SFII/cufcq-new
refs/heads/master
services/digestor.py
1
import csv import logging import os import rethinkdb as r from time import sleep from models.fcq import Fcq from models.grade import Grade from models.instructor import Instructor from models.course import Course from models.department import Department from models.college import College from models.campus import Campu...
inares/edx-platform
refs/heads/inares_sass
common/test/acceptance/pages/lms/dashboard_search.py
138
""" Dashboard search """ from bok_choy.page_object import PageObject from . import BASE_URL class DashboardSearchPage(PageObject): """ Dashboard page featuring a search form """ search_bar_selector = '#dashboard-search-bar' url = "{base}/dashboard".format(base=BASE_URL) @property def se...
qguv/rpcalc
refs/heads/master
rpcalc/stack.py
1
#!/usr/bin/env python3 # the stack class for rpcalc # for more info, see github.com/qguv/rpcalc import math from rpcalc.inout import clear class Stack: ''' An implementation of the RPN stack in Python3. Internally uses a list and negative indexes. The most recent input rests at the end of the stack. ...
feikname/spades-server
refs/heads/master
setup.py
1
#!/usr/bin/env python3 import sys import os from distutils.core import run_setup # build_ext is subclassed, so we import it with a _ to avoid a collision from distutils.command.build_ext import build_ext as _build_ext from setuptools import setup, Extension PKG_NAME = "piqueserver" PKG_URL = "https://github.com/piqu...
jjscarafia/odoo
refs/heads/master
addons/hr_payroll_account/hr_payroll_account.py
41
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
supriyagarg/pydatalab
refs/heads/master
tests/bigquery/schema_tests.py
6
# Copyright 2015 Google 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 required by applicable law or agreed ...
edanweis/overdewey
refs/heads/development
overdewey/contrib/sites/migrations/__init__.py
14224
# -*- coding: utf-8 -*-
p0cisk/Quantum-GIS
refs/heads/master
python/ext-libs/jinja2/runtime.py
606
# -*- coding: utf-8 -*- """ jinja2.runtime ~~~~~~~~~~~~~~ Runtime helpers. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ from itertools import chain from jinja2.nodes import EvalContext, _context_function_types from jinja2.utils import Markup, soft_unicode, escape, missing, concat, \ ...
gborri/SickRage
refs/heads/develop
sickrage/providers/torrent/filelist.py
1
# coding=utf-8 # # URL: https://sickrage.ca # # This file is part of SickRage. # # SickRage 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 vers...
xpansa/hr
refs/heads/8.0
setup/hr_webcam/odoo_addons/__init__.py
13048
__import__('pkg_resources').declare_namespace(__name__)
8thmatyr/evnt-web
refs/heads/master
app/userOps/__init__.py
22
import os import glob __all__ = [os.path.basename( f)[:-3] for f in glob.glob(os.path.dirname(__file__) + "/*.py")]
dbckz/ansible
refs/heads/devel
lib/ansible/modules/monitoring/uptimerobot.py
36
#!/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. ...
shl198/Pipeline
refs/heads/master
DE_pipeline/f04_htseq.py
2
import subprocess,os from natsort import natsorted import pandas as pd import HTSeq def htseq_count(sortedBamFiles,annotation,outputpath,annotationSource): """ This function use htseq_count to count reads * sortedBamFiles: a list of bam files * annotation: annotation gff3 files * outputpath: pathwa...
cloudera/hue
refs/heads/master
desktop/core/ext-py/SQLAlchemy-1.3.17/test/engine/test_ddlevents.py
2
import sqlalchemy as tsa from sqlalchemy import create_engine from sqlalchemy import event from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import String from sqlalchemy import testing from sqlalchemy import text from sqlalchemy.schema import AddConstraint from sqlalchemy.schema import Che...
Mikescher/Project-Euler_Befunge
refs/heads/master
compiled/Python2/Euler_Problem-007.py
1
#!/usr/bin/env python2 # transpiled with BefunCompile v1.3.0 (c) 2017 import sys import zlib, base64 _g = ("Ah+LCAAAAAAABACT7+ZgAAEWhrfXHLOvOEg0PNxvdObW6ba3dTfvKrRsqvj47uLhTbqvjAK0ZLveZdbvEd4b4bo6IKr1uSKPj5HnDOeKYp/JT4327ty9127P/ylx9fss" + "7yw9alJfXvxjRpzaA3tzZoZBBh54LjleUpNx8OjifXw/jG//UeR3Npf/veL1nlOfC0VL5QLDX6+w...
buffer/thug
refs/heads/master
tests/functional/test_silverlight.py
1
import os import logging from thug.ThugAPI.ThugAPI import ThugAPI log = logging.getLogger("Thug") class TestSilverLight(object): cwd_path = os.path.dirname(os.path.realpath(__file__)) misc_path = os.path.join(cwd_path, os.pardir, "samples/misc") def do_perform_test(self, caplog, sample, silverlight, e...
lpsinger/astropy
refs/heads/main
astropy/constants/tests/test_pickle.py
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from astropy import constants as const from astropy.tests.helper import pickle_protocol, check_pickling_recovery # noqa originals = [const.Constant('h_fake', 'Not Planck', 0.0, 'J s', 0.0, 'fakeref', ...
mhvk/astropy
refs/heads/placeholder
astropy/coordinates/angle_formats.py
5
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # This module includes files automatically generated from ply (these end in # _lextab.py and _parsetab.py). To generate these files, remove them from this # folder, then build astropy and run the tests in-place: # # python setup....
invisiblek/android_kernel_htc_qsd8k
refs/heads/cm-12.1
tools/perf/scripts/python/syscall-counts.py
11181
# system call counts # (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 import sys sys.path.append(os.envir...
cool104/kernel-zenfone-4
refs/heads/master
tools/perf/scripts/python/syscall-counts.py
11181
# system call counts # (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 import sys sys.path.append(os.envir...
40223222/2015cd_midterm
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/http/cookies.py
735
#!/usr/bin/env python3 # #### # Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in...
mdietrichc2c/OCB
refs/heads/8.0
addons/stock/wizard/__init__.py
323
# -*- 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...
russomi/ferris3-tutorial
refs/heads/master
main.py
2
import endpoints as google_cloud_endpoints import webapp2 from ferris3.discovery import discover_api_services, discover_webapp2_routes # APIs API_CLASSES = discover_api_services() API_APPLICATION = google_cloud_endpoints.api_server(API_CLASSES) # WSGI handlers WSGI_ROUTES = discover_webapp2_routes() WSGI_APPLICATIO...
0Chencc/CTFCrackTools
refs/heads/master
Lib/Lib/hmac.py
253
"""HMAC (Keyed-Hashing for Message Authentication) Python module. Implements the HMAC algorithm as described by RFC 2104. """ import warnings as _warnings trans_5C = "".join ([chr (x ^ 0x5C) for x in xrange(256)]) trans_36 = "".join ([chr (x ^ 0x36) for x in xrange(256)]) # The size of the digests returned by HMAC ...
Python-Devs-Brasil/pynocchio-comic-reader
refs/heads/master
pynocchio/uic_files/go_to_page_dialog_ui.py
5
# Form implementation generated from reading ui file './forms/go_to_page_dialog.ui' # # Created by: PyQt5 UI code generator 5.9 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets from . import main_window_view_rc class Ui_GoPageDialog(object): def setupUi(self,...
talon-one/talon_one.py
refs/heads/master
test/test_campaign_set_node.py
1
# coding: utf-8 """ Talon.One API The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #...
ecederstrand/django
refs/heads/master
django/core/signing.py
84
""" Functions for creating and restoring url-safe signed JSON objects. The format used looks like this: >>> signing.dumps("hello") 'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk' There are two components here, separated by a ':'. The first component is a URLsafe base64 encoded JSON of the object passed to dumps(). T...
huguesv/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Tools/scripts/analyze_dxp.py
122
""" Some helper functions to analyze the output of sys.getdxp() (which is only available if Python was built with -DDYNAMIC_EXECUTION_PROFILE). These will tell you which opcodes have been executed most frequently in the current process, and, if Python was also built with -DDXPAIRS, will tell you which instruction _pair...
MarcosCommunity/odoo
refs/heads/marcos-8.0
comunity_modules/hotel_pos_restaurant/models/pos_restaurant.py
1
# -*- encoding: utf-8 -*- ############################################################################# # # OpenERP, Open Source Management Solution # Copyright (C) 2012-Today Serpent Consulting Services Pvt. Ltd. # (<http://www.serpentcs.com>) # Copyright (C) 2004 OpenERP SA (<http://www.openerp.com>) # # ...
mcgachey/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/tests/test_lti_unit.py
12
# -*- coding: utf-8 -*- """Test for LTI Xmodule functional logic.""" import datetime from django.utils.timezone import UTC from mock import Mock, patch, PropertyMock import textwrap from lxml import etree from webob.request import Request from copy import copy import urllib from xmodule.fields import Timedelta from x...
pkdevbox/cassandra
refs/heads/trunk
pylib/cqlshlib/test/ansi_colors.py
192
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
atomic-labs/flask-dashboards
refs/heads/master
flask_dashboards/store.py
1
import json import logging import pylibmc logger = logging.getLogger(__name__) def validate(data_set): if not isinstance(data_set, list): logger.debug("Data set must be a list") return False for ds in data_set: if not isinstance(ds, dict): logger.debug("Data set must be a ...
pytorch/text
refs/heads/master
torchtext/experimental/datasets/raw/wmt14.py
1
import os from torchtext.utils import (download_from_url, extract_archive) from torchtext.data.datasets_utils import ( _RawTextIterableDataset, _wrap_split_argument, _read_text_iterator, ) from torchtext.data.datasets_utils import _create_dataset_directory URL = 'https://drive.google.com/uc?export=download...
molebot/brython
refs/heads/master
www/src/Lib/test/mock_socket.py
28
"""Mock socket module used by the smtpd and smtplib tests. """ # imported for _GLOBAL_DEFAULT_TIMEOUT import socket as socket_module # Mock socket module _defaulttimeout = None _reply_data = None # This is used to queue up data to be read through socket.makefile, typically # *before* the socket object is even create...
OCA/contract
refs/heads/12.0
agreement_stock/models/stock.py
1
# Copyright (C) 2018 - TODAY, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields, models class StockPicking(models.Model): _inherit = "stock.picking" agreement_id = fields.Many2one('agreement', 'Agreement') class StockMove(models.Model): _in...
spaceone/pyjs
refs/heads/master
examples/libtest/DatetimeModuleTest.py
7
# Testing datetime module import sys import UnitTest import datetime class DatetimeModuleTest(UnitTest.UnitTest): def testDate(self): d = datetime.date(2010, 4, 9) self.assertEqual(d.year, 2010) self.assertEqual(d.month, 4) self.assertEqual(d.day, 9) self.assertEqual(d.we...
sorenk/ansible
refs/heads/devel
lib/ansible/modules/database/vertica/vertica_user.py
45
#!/usr/bin/python # -*- coding: utf-8 -*- # 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', ...
rwl/PyCIM
refs/heads/master
CIM15/IEC61970/Informative/InfCustomers/ComplianceEvent.py
1
# Copyright (C) 2010-2011 Richard Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish...
Affix/CouchPotatoServer
refs/heads/master
libs/suds/resolver.py
206
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
okfse/froide
refs/heads/master
froide/foirequest/migrations/0021_auto__add_field_foiattachment_can_approve.py
6
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from froide.helper.auth_migration_util import USER_DB_NAME APP_MODEL, APP_MODEL_NAME = 'account.User', 'account.user' class Migration(SchemaMigration): def forwards(self, orm): ...
TranscribersOfReddit/TranscribersOfReddit
refs/heads/master
tor/core/posts.py
1
import logging from typing import Dict, Union from praw.models import Submission # type: ignore from tor.core.config import Config from tor.core.helpers import _ from tor.helpers.flair import flair, flair_post from tor.helpers.reddit_ids import add_complete_post_id, has_been_posted from tor.helpers.youtube import (h...
chouseknecht/ansible
refs/heads/devel
test/units/parsing/utils/test_jsonify.py
113
# -*- coding: utf-8 -*- # (c) 2016, James Cammarata <jimi@sngx.net> # # 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 o...
realityone/MentalUs
refs/heads/master
manage.py
1
#!/usr/bin/env python import os from MentalUs import create_app, db from MentalUs.models import MTUser, MTScale, MTAnnouncement, \ MTExtendFields, MTUserExtendInfo, MTScaleResult, MTUnfinishedScale from flask.ext.script import Manager, Shell from flask.ext.migrate import Migrate, MigrateCommand app = create_app(...
zdary/intellij-community
refs/heads/master
python/testData/highlighting/importStarAtTopLevel.py
83
def foo(): <warning descr="'import *' only allowed at module level">from sys import *</warning>
destinmoulton/squabble
refs/heads/master
pythonclient/venv/lib/python2.7/site-packages/pip/vcs/git.py
473
import tempfile import re import os.path from pip.util import call_subprocess from pip.util import display_path, rmtree from pip.vcs import vcs, VersionControl from pip.log import logger from pip.backwardcompat import url2pathname, urlparse urlsplit = urlparse.urlsplit urlunsplit = urlparse.urlunsplit class Git(Versi...
Johnzero/OE7
refs/heads/master
openerp/addons-modules/auth_crypt/auth_crypt.py
12
# # Implements encrypting functions. # # Copyright (c) 2008, F S 3 Consulting Inc. # # Maintainer: # Alec Joseph Rivera (agi<at>fs3.ph) # refactored by Antony Lesuisse <al<at>openerp.com> # import hashlib import hmac import logging from random import sample from string import ascii_letters, digits import openerp from...
gojira/tensorflow
refs/heads/master
tensorflow/compiler/tests/extract_image_patches_op_test.py
15
# Copyright 2018 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...
nttks/edx-platform
refs/heads/gacco/dogwood
common/djangoapps/student/management/commands/6002exportusers.py
138
## ## One-off script to export 6.002x users into the edX framework ## ## Could be modified to be general by: ## * Changing user_keys and up_keys to handle dates more cleanly ## * Providing a generic set of tables, rather than just users and user profiles ## * Handling certificates and grades ## * Handling merge/forks o...
pedrobaeza/OpenUpgrade
refs/heads/8.0
openerp/cli/__init__.py
135
import logging import sys import os import openerp from openerp import tools from openerp.modules import module _logger = logging.getLogger(__name__) commands = {} class CommandType(type): def __init__(cls, name, bases, attrs): super(CommandType, cls).__init__(name, bases, attrs) name = getattr(...
01000101/cloudify-cli
refs/heads/master
cloudify_cli/activate_bash_completion.py
2
######## # Copyright (c) 2013 GigaSpaces Technologies 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...
azunite/chrome_build
refs/heads/master
third_party/boto/manage/volume.py
70
# 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...
LLNL/spack
refs/heads/develop
lib/spack/external/jsonschema/validators.py
13
from __future__ import division import contextlib import json import numbers requests = None from jsonschema import _utils, _validators from jsonschema.compat import ( Sequence, urljoin, urlsplit, urldefrag, unquote, urlopen, str_types, int_types, iteritems, ) from jsonschema.exceptions import ErrorTree # B...
surligas/gnuradio
refs/heads/master
gnuradio-runtime/python/gnuradio/gr_xmlrunner.py
78
""" XML Test Runner for PyUnit """ # Written by Sebastian Rittau <srittau@jroger.in-berlin.de> and placed in # the Public Domain. With contributions by Paolo Borelli and others. # Added to GNU Radio Oct. 3, 2010 __version__ = "0.1" import os.path import re import sys import time import traceback import unittest from...
JulienPalard/licensename
refs/heads/master
src/licensename/known_licenses.py
1
MIT_PREAMBLE = "permission is hereby granted, free of charge, to any person obtaining a copy of" BSD_PREAMBLE = "redistribution and use in source and binary forms, with or without modification" BSD_CLAUSE_1 = "redistributions of source code must retain the above copyright notice, this list of conditions and the followi...
TribeMedia/sky_engine
refs/heads/master
sky/engine/build/scripts/make_css_property_metadata.py
11
#!/usr/bin/env python # Copyright 2014 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. import sys import css_properties import in_generator from name_utilities import lower_first import template_expander class CSSProper...
pdxcycling/carv.io
refs/heads/master
machine_learning/code/video_features.py
1
''' Quality Metrics: - Top 3 colors across active scenes - These probably need to be binned - Avg_sat across active scenes - Avg_val across active scenes Longest scene: - All metadata Most active scene: - All metadata Scenes: - Number of total scenes - Number of static scenes - Number of action scenes - Average du...
indashnet/InDashNet.Open.UN2000
refs/heads/master
android/external/chromium_org/third_party/WebKit/Source/core/inspector/inline-javascript-imports.py
140
#!/usr/bin/env python # # Copyright (C) 2011 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...
Bachmann1234/letsencrypt
refs/heads/master
letsencrypt/auth_handler.py
4
"""ACME AuthHandler.""" import itertools import logging import time import zope.component from acme import challenges from acme import messages from letsencrypt import achallenges from letsencrypt import constants from letsencrypt import errors from letsencrypt import error_handler from letsencrypt import interfaces...
Thraxis/SickRage
refs/heads/master
sickbeard/providers/nyaatorrents.py
1
# Author: Mr_Orange # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 opt...
HousekeepLtd/django
refs/heads/master
tests/flatpages_tests/settings.py
514
import os FLATPAGES_TEMPLATES = [{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(os.path.dirname(__file__), 'templates')], 'OPTIONS': { 'context_processors': ( 'django.contrib.auth.context_processors.auth', ), }, }]
azureplus/hue
refs/heads/master
apps/zookeeper/src/zookeeper/rest.py
24
#!/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...
vickenty/ookoobah
refs/heads/master
pyglet-c9188efc2e30/pyglet/image/__init__.py
22
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
andrea9a/oslab
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
leungmanhin/opencog
refs/heads/master
opencog/python/attic/spatiotemporal/unix_time.py
34
from datetime import datetime from time import mktime from random import random from scipy.stats.distributions import rv_frozen __author__ = 'keyvan' class UnixTime(float): def __new__(cls, datetime_or_number): if type(datetime_or_number) is UnixTime: return datetime_or_number assert ...
idovear/odoo
refs/heads/master
openerp/addons/base/tests/test_db_cursor.py
175
# -*- coding: utf-8 -*- import unittest2 import openerp from openerp.tools.misc import mute_logger from openerp.tests import common DB = common.DB ADMIN_USER_ID = common.ADMIN_USER_ID def registry(): return openerp.modules.registry.RegistryManager.get(DB) class test_cr_execute(unittest2.TestCase): """ Try...