repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
aabbox/kbengine | kbe/src/lib/python/Lib/test/test_zlib.py | 84 | 26766 | import unittest
from test import support
import binascii
import random
import sys
from test.support import bigmemtest, _1G, _4G
zlib = support.import_module('zlib')
requires_Compress_copy = unittest.skipUnless(
hasattr(zlib.compressobj(), "copy"),
'requires Compress.copy()')
requires_Decompress_copy =... | lgpl-3.0 |
onitake/ansible | lib/ansible/modules/identity/cyberark/cyberark_user.py | 18 | 16119 | #!/usr/bin/python
# Copyright: (c) 2017, 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': ['pre... | gpl-3.0 |
sdrogers/lda | code/formula.py | 2 | 1874 | import re
class Formula(object):
def __init__(self,formula):
self.atom_names = ['C','H','N','O','P','S','Cl','I','Br','Si','F','D']
self.formula = formula
self.atoms = {}
for atom in self.atom_names:
self.atoms[atom] = self.get_atoms(atom)
def equals(self,formula):
is_equal = True
for atom in self.a... | gpl-3.0 |
amghost/myblog | node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexer.py | 95 | 26928 | # -*- coding: utf-8 -*-
"""
pygments.lexer
~~~~~~~~~~~~~~
Base lexer classes.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re, itertools
from pygments.filter import apply_filters, Filter
from pygments.filters import get_filt... | mit |
wwj718/ANALYSE | common/djangoapps/student/management/commands/6002exportusers.py | 68 | 1840 | ##
## 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... | agpl-3.0 |
code-sauce/tensorflow | tensorflow/python/summary/writer/writer.py | 1 | 12539 | # Copyright 2016 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... | apache-2.0 |
virgree/odoo | addons/note/tests/__init__.py | 260 | 1076 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
CLOUGH/info3180-project-2 | lib/werkzeug/testsuite/exceptions.py | 100 | 3325 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.exceptions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The tests for the exception classes.
TODO:
- This is undertested. HTML is never checked
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
fro... | apache-2.0 |
Garee/pytodoist | pytodoist/test/test_api.py | 1 | 5203 | #!/usr/bin/env python
"""This module contains unit tests for the pytodoist.api module."""
import json
import time
import unittest
from pytodoist.api import TodoistAPI
from pytodoist.test.util import TestUser
# No magic numbers
_HTTP_OK = 200
class TodoistAPITest(unittest.TestCase):
@classmethod
def setUpCl... | mit |
Pistachitos/Sick-Beard | lib/hachoir_parser/container/riff.py | 90 | 16966 | # -*- coding: UTF-8 -*-
"""
RIFF parser, able to parse:
* AVI video container
* WAV audio container
* CDA file
Documents:
- libavformat source code from ffmpeg library
http://ffmpeg.mplayerhq.hu/
- Video for Windows Programmer's Guide
http://www.opennet.ru/docs/formats/avi.txt
- What is an animated curso... | gpl-3.0 |
tornadozou/tensorflow | tensorflow/python/saved_model/loader_impl.py | 49 | 9488 | # 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... | apache-2.0 |
sodafree/backend | build/ipython/IPython/zmq/completer.py | 3 | 2950 | """Tab-completion over zmq"""
# Trying to get print statements to work during completion, not very
# successfully...
from __future__ import print_function
import itertools
try:
import readline
except ImportError:
readline = None
import rlcompleter
import time
import session
class KernelCompleter(object):
... | bsd-3-clause |
bdoner/SickRage | lib/hachoir_parser/file_system/iso9660.py | 85 | 4954 | """
ISO 9660 (cdrom) file system parser.
Documents:
- Standard ECMA-119 (december 1987)
http://www.nondot.org/sabre/os/files/FileSystems/iso9660.pdf
Author: Victor Stinner
Creation: 11 july 2006
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, ParserError,
UInt8, UInt32, UInt64, ... | gpl-3.0 |
ThiagoGarciaAlves/intellij-community | python/lib/Lib/site-packages/django/dispatch/dispatcher.py | 315 | 9292 | import weakref
import threading
from django.dispatch import saferef
WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref)
def _make_id(target):
if hasattr(target, 'im_func'):
return (id(target.im_self), id(target.im_func))
return id(target)
class Signal(object):
"""
Base class ... | apache-2.0 |
mdavid/horizon | openstack_dashboard/dashboards/admin/volumes/volumes/tests.py | 9 | 4211 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | apache-2.0 |
KoertJanssens/MasterBall.be | pogom/captcha.py | 1 | 12626 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
- Captcha Overseer:
- Tracks incoming new captcha tokens
- Monitors the captcha'd accounts queue
- Launches captcha_solver threads
- Captcha Solver Threads each:
- Have a unique captcha token
- Attempts to verifyChallenge
- Puts account back in active q... | agpl-3.0 |
skyoo/jumpserver | apps/perms/api/asset/user_permission/user_permission_nodes_with_assets.py | 1 | 8244 | # -*- coding: utf-8 -*-
#
from itertools import chain
from rest_framework.generics import ListAPIView
from rest_framework.request import Request
from rest_framework.response import Response
from django.db.models import F, Value, CharField, Q
from django.conf import settings
from orgs.utils import tmp_to_root_org
from... | gpl-2.0 |
glovebx/odoo | addons/document/odt2txt.py | 435 | 2110 | #!/usr/bin/python
# -*- 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 unde... | agpl-3.0 |
mottosso/be | be/vendor/requests/packages/urllib3/__init__.py | 155 | 1864 | """
urllib3 - Thread-safe connection pooling and re-using.
"""
__author__ = 'Andrey Petrov (andrey.petrov@shazow.net)'
__license__ = 'MIT'
__version__ = '1.10.2'
from .connectionpool import (
HTTPConnectionPool,
HTTPSConnectionPool,
connection_from_url
)
from . import exceptions
from .filepost import en... | lgpl-2.1 |
JioCloud/nova_test_latest | nova/db/sqlalchemy/migrate_repo/versions/233_add_stats_in_compute_nodes.py | 81 | 1460 | # Copyright (c) 2014 Rackspace Hosting
# 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 req... | apache-2.0 |
home-assistant/home-assistant | homeassistant/components/melcloud/__init__.py | 1 | 5055 | """The MELCloud Climate integration."""
from __future__ import annotations
import asyncio
from datetime import timedelta
import logging
from typing import Any
from aiohttp import ClientConnectionError
from async_timeout import timeout
from pymelcloud import Device, get_devices
import voluptuous as vol
from homeassis... | apache-2.0 |
vlukes/sfepy | tests/test_msm_symbolic.py | 5 | 7423 | from __future__ import absolute_import
from sfepy import data_dir
import six
filename_mesh = data_dir + '/meshes/2d/special/circle_in_square.mesh'
dim = 2
field_1 = {
'name' : 'a_harmonic_field',
'dtype' : 'real',
'shape' : 'scalar',
'region' : 'Omega',
'approx_order' : 1,
}
variables = {
't... | bsd-3-clause |
keyurpatel076/MissionPlannerGit | Lib/distutils/command/config.py | 75 | 13130 | """distutils.command.config
Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications. The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" i... | gpl-3.0 |
soodoku/get-weather-data | setup.py | 1 | 5471 | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install... | mit |
ptmr3/GalaxyNote3_Kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # 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... | gpl-2.0 |
roelvv/pyrax | samples/autoscale/delete_webhook.py | 13 | 3216 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, 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.ap... | apache-2.0 |
repotvsupertuga/tvsupertuga.repository | plugin.video.TVsupertuga/resources/lib/sources/moviexk_mv_tv.py | 6 | 6002 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... | gpl-2.0 |
ivandevp/django | tests/postgres_tests/test_hstore.py | 193 | 9011 | import json
from django.core import exceptions, serializers
from django.forms import Form
from . import PostgreSQLTestCase
from .models import HStoreModel
try:
from django.contrib.postgres import forms
from django.contrib.postgres.fields import HStoreField
from django.contrib.postgres.validators import K... | bsd-3-clause |
lidaohang/beansdb | python/sync.py | 3 | 3600 | #!/usr/bin/python
import sys, os, os.path
from dbclient import Beansdb, db
def get_dir(s, dir):
def parse(line):
p,h,c = line.split(' ')
return p, (int(h), int(c))
return dict(parse(line) for line in
filter(None, (s.get(dir) or '').split('\n')))
def is_dir(d):
return len(... | bsd-3-clause |
Bulochkin/tensorflow_pack | tensorflow/contrib/losses/python/losses/loss_ops_test.py | 82 | 55012 | # Copyright 2016 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... | apache-2.0 |
linsomniac/luigi | luigi/contrib/simulate.py | 16 | 3280 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
hieukypc/ERP | openerp/addons/sale_stock/res_config.py | 28 | 2068 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import SUPERUSER_ID
from openerp import api, fields, models, _
from openerp.exceptions import AccessError
class SaleConfiguration(models.TransientModel):
_inherit = 'sale.config.settings'
module_de... | gpl-3.0 |
karthikv1392/Machine_Learning | naive_bayes.py | 1 | 15135 | # Karthik V
# Program to implement Naive Bayes classification
import collections
import math
count_clusters=0
fo=open("trainingdata.txt","r+")
array_cluster=[]
i=0
dict_word_map={}
# we create 8 list to put all the word count associations into that list
list1=[]
list2=[]
list3=[]
list4=[]
list5=[]
list6=[]
list7=[]
fo... | gpl-3.0 |
PhilippeMorere/RLTrader | v1/World.py | 1 | 3890 | import math
import random
from qAgent import QAgent
from perceptronAgent import PerceptronAgent
import matplotlib.pyplot as plt
__author__ = 'philippe'
class DataGenerator:
def __init__(self):
self.sinus_offset = 1.2
self.sinus_period = 0.1
self.time = 0
def generate_sinus_data(self)... | gpl-2.0 |
blackPantherOS/packagemanagement | smartpm/smart/backends/rpm/__init__.py | 9 | 1061 | #
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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 Fou... | apache-2.0 |
ManageIQ/integration_tests | cfme/utils/stats.py | 2 | 1964 | def tol_check(ref, compare, min_error=0.05, low_val_correction=3.0):
"""Tolerance check
The tolerance check is very simple. In essence it checks to ensure
that the ``compare`` value is within ``min_error`` percentage of the ``ref`` value.
However there are special conditions.
If the ref value is z... | gpl-2.0 |
vvv1559/intellij-community | python/lib/Lib/encodings/gb18030.py | 816 | 1031 | #
# gb18030.py: Python Unicode Codec for GB18030
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_cn, codecs
import _multibytecodec as mbc
codec = _codecs_cn.getcodec('gb18030')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteInc... | apache-2.0 |
dmilith/SublimeText3-dmilith | Packages/Debugger/modules/views/variable.py | 1 | 6654 | from __future__ import annotations
from ..typecheck import *
from ..import core
from ..import ui
from ..import dap
from . import css
import sublime
class VariableComponentState:
def __init__(self):
self._expanded: dict[int, bool] = {}
self._number_expanded: dict[int, int] = {}
def is_expanded(self, variable:... | mit |
chokribr/invenio | invenio/modules/multimedia/restful.py | 11 | 4723 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | gpl-2.0 |
e-sailing/openplotter | tools/kplex/add_kplex.py | 1 | 18795 | #!/usr/bin/env python
# This file is part of Openplotter.
# Copyright (C) 2015 by sailoog <https://github.com/sailoog/openplotter>
#
# Openplotter 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 versio... | gpl-2.0 |
allenai/allennlp | tests/training/metrics/boolean_accuracy_test.py | 1 | 4788 | from typing import Any, Dict, List, Tuple, Union
import torch
import pytest
from allennlp.common.testing import (
AllenNlpTestCase,
multi_device,
global_distributed_metric,
run_distributed_test,
)
from allennlp.training.metrics import BooleanAccuracy
class BooleanAccuracyTest(AllenNlpTestCase):
... | apache-2.0 |
viswimmer1/PythonGenerator | data/python_files/32676842/bzr.py | 1 | 7918 | import calendar
from datetime import datetime, timedelta
import re
import time
import urlparse
try:
from bzrlib import bzrdir, revisionspec
from bzrlib.errors import BzrError, NotBranchError
from bzrlib.transport import register_lazy_transport
from bzrlib.transport.remote import RemoteSSHTransport
... | gpl-2.0 |
jkstrick/samba | third_party/dnspython/dns/namedict.py | 99 | 2106 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-3.0 |
Cadasta/cadasta-qgis-plugin | cadasta/test/test_qgis_environment.py | 1 | 1823 | # coding=utf-8
"""Tests for QGIS functionality.
.. 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 License, or
(at your option) any later version.
"""
... | gpl-3.0 |
dudepare/django | tests/template_tests/templatetags/custom.py | 161 | 5408 | import operator
import warnings
from django import template
from django.template.defaultfilters import stringfilter
from django.utils import six
from django.utils.html import escape, format_html
register = template.Library()
@register.filter
@stringfilter
def trim(value, num):
return value[:num]
@register.fil... | bsd-3-clause |
shsingh/ansible | lib/ansible/modules/storage/netapp/netapp_e_amg_role.py | 52 | 7909 | #!/usr/bin/python
# (c) 2016, NetApp, 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',
'status': ['preview'],
... | gpl-3.0 |
hhg2288/mkdocs | mkdocs/tests/cli_tests.py | 20 | 2079 | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import unittest
import mock
from click.testing import CliRunner
from mkdocs import __main__ as cli
class CLITests(unittest.TestCase):
def setUp(self):
self.runner = CliRunner()
@mock.patch('mkdocs.commands.serve.serve',... | bsd-2-clause |
GoogleCloudPlatform/python-compat-runtime | appengine-compat/exported_appengine_sdk/google/appengine/_internal/django/core/cache/backends/memcached.py | 23 | 3612 | "Memcached cache backend"
import time
from google.appengine._internal.django.core.cache.backends.base import BaseCache, InvalidCacheBackendError
from google.appengine._internal.django.utils.encoding import smart_unicode, smart_str
try:
import cmemcache as memcache
import warnings
warnings.warn(
"... | apache-2.0 |
credativ/pulp | server/test/unit/server/db/migrations/test_migration_0011.py | 17 | 1861 | import unittest
import mock
from pulp.server.db.migrate.models import MigrationModule
MIGRATION = 'pulp.server.db.migrations.0011_permissions_schema_change'
class TestMigration(unittest.TestCase):
@mock.patch('pulp.server.db.migrations.0011_permissions_schema_change.Permission')
def test_migrate(self, mock_... | gpl-2.0 |
ImmortalBen/TeamTalk | win-client/3rdParty/src/json/test/runjsontests.py | 175 | 5469 | import sys
import os
import os.path
from glob import glob
import optparse
VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes '
def compareOutputs( expected, actual, message ):
expected = expected.strip().replace('\r','').split('\n')
actual = actual.strip().replace('\r','').spli... | apache-2.0 |
songmonit/CTTMSONLINE | addons/hr_payroll_account/wizard/__init__.py | 433 | 1116 | #-*- 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
# ... | agpl-3.0 |
cryptobanana/ansible | lib/ansible/modules/network/cloudengine/ce_config.py | 12 | 11355 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
ramadhane/odoo | addons/resource/tests/__init__.py | 261 | 1085 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
davidzchen/tensorflow | tensorflow/python/data/kernel_tests/placement_test.py | 1 | 4839 | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ravello/ansible | lib/ansible/runner/action_plugins/patch.py | 93 | 2501 | # (c) 2015, Brian Coca <briancoca+dev@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | gpl-3.0 |
jbdubois/obus | src/obusgen/c/obus_c_enum.py | 1 | 6588 | #!/usr/bin/env python
#===============================================================================
# obusgen - obus source code generator.
#
# @file obus_c.py
#
# @brief obus c enum code generator
#
# @author jean-baptiste.dubois@parrot.com
#
# Copyright (c) 2013 Parrot S.A.
# All rights reserved.
#
# Redistributio... | lgpl-2.1 |
2014c2g23/2015cda-w17 | static/Brython3.1.1-20150328-091302/Lib/configparser.py | 692 | 50025 | """Configuration file parser.
A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.
Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.
class:
ConfigParse... | gpl-3.0 |
miguelparaiso/PracticaOdoo | addons/crm_helpdesk/crm_helpdesk.py | 182 | 7480 | # -*- 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... | agpl-3.0 |
ajose01/rethinkdb | external/gtest_1.6.0/test/gtest_xml_test_utils.py | 356 | 8722 | #!/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... | agpl-3.0 |
jaywunder/jacobwunder.com | public/lib/threejslib/utils/exporters/blender/addons/io_three/exporter/api/material.py | 10 | 5773 | from bpy import data, types
from .. import constants, logger
from .constants import MULTIPLY, WIRE, IMAGE
def _material(func):
def inner(name, *args, **kwargs):
if isinstance(name, types.Material):
material = name
else:
material = data.materials[name]
return fun... | mit |
PsychoTV/PsychoTeam.repository | plugin.video.p2psport/default.py | 6 | 11222 | # -*- coding: utf-8 -*-
import re
import urllib2
import HTMLParser
import urllib,urlparse
import xbmcgui
import xbmcplugin
import xbmcaddon
import requests
from BeautifulSoup import BeautifulSoup as bs
from utils.webutils import *
from scrapers import *
try:
from addon.common.addon import Addon
from addon.... | gpl-2.0 |
PatrickChrist/scikit-learn | sklearn/utils/mocking.py | 267 | 2064 | import numpy as np
from ..base import BaseEstimator, ClassifierMixin
from .testing import assert_true
from .validation import _num_samples, check_array
class ArraySlicingWrapper(object):
def __init__(self, array):
self.array = array
def __getitem__(self, aslice):
return MockDataFrame(self.ar... | bsd-3-clause |
youdonghai/intellij-community | python/lib/Lib/encodings/iso2022_jp_1.py | 816 | 1061 | #
# iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_1')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... | apache-2.0 |
noroutine/ansible | contrib/inventory/nsot.py | 117 | 9825 | #!/usr/bin/env python
'''
nsot
====
Ansible Dynamic Inventory to pull hosts from NSoT, a flexible CMDB by Dropbox
Features
--------
* Define host groups in form of NSoT device attribute criteria
* All parameters defined by the spec as of 2015-09-05 are supported.
+ ``--list``: Returns JSON hash of host groups -... | gpl-3.0 |
mSenyor/sl4a | python/src/Lib/lib-tk/tkMessageBox.py | 52 | 3635 | # tk common message boxes
#
# this module provides an interface to the native message boxes
# available in Tk 4.2 and newer.
#
# written by Fredrik Lundh, May 1997
#
#
# options (all have default values):
#
# - default: which button to make default (one of the reply codes)
#
# - icon: which icon to display (see below)... | apache-2.0 |
sharhar/USB-Thing | UpdaterFiles/Lib/python-3.5.1.amd64/Lib/pkgutil.py | 9 | 21201 | """Utilities to support packages."""
from functools import singledispatch as simplegeneric
import importlib
import importlib.util
import importlib.machinery
import os
import os.path
import sys
from types import ModuleType
import warnings
__all__ = [
'get_importer', 'iter_importers', 'get_loader', 'find_loader',
... | apache-2.0 |
cvium/Flexget | flexget/utils/sqlalchemy_utils.py | 18 | 4634 | """
Miscellaneous SQLAlchemy helpers.
"""
from __future__ import unicode_literals, division, absolute_import
import logging
import sqlalchemy
from sqlalchemy import ColumnDefault, Sequence, Index
from sqlalchemy.types import TypeEngine
from sqlalchemy.schema import Table, MetaData
from sqlalchemy.exc import NoSuchTabl... | mit |
SolaWing/ycmd | cpp/ycm/tests/gmock/gtest/test/gtest_uninitialized_test.py | 2901 | 2480 | #!/usr/bin/env python
#
# Copyright 2008, 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... | gpl-3.0 |
GeoscienceAustralia/PyRate | setup.py | 1 | 4217 | # This Python module is part of the PyRate software package.
#
# Copyright 2020 Geoscience Australia
#
# 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/... | apache-2.0 |
shsingh/ansible | lib/ansible/cli/arguments/option_helpers.py | 14 | 17027 | # Copyright: (c) 2018, 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
import copy
import operator
import argparse
import os
import os.path
import sys
import time
import... | gpl-3.0 |
clarko1/Cramd | storage/cloud-client/quickstart_test.py | 8 | 1029 | # Copyright 2016 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 a... | apache-2.0 |
Kazade/NeHe-Website | google_appengine/lib/django-1.3/django/db/models/sql/subqueries.py | 230 | 8070 | """
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.core.exceptions import FieldError
from django.db import connections
from django.db.models.fields import DateField, FieldDoesNotExist
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures... | bsd-3-clause |
nevil-brownlee/python-libtrace | test/v2-test-cases/plt_testing.py | 1 | 7672 | # Thu, 13 Mar 14 (PDT)
# plt-testing.py: Support routines for testing python-libtrace
# Copyright (C) 2017, Nevil Brownlee, U Auckland | WAND
import plt # Also imports ipp and datetime
import os # Contains getcwd
import sys # exit and stdout
import re # regular expressions
# import socket # get... | gpl-3.0 |
rugk/letsencrypt | letsencrypt/plugins/manual_test.py | 8 | 4559 | """Tests for letsencrypt.plugins.manual."""
import signal
import unittest
import mock
from acme import challenges
from acme import jose
from letsencrypt import achallenges
from letsencrypt import errors
from letsencrypt.tests import acme_util
from letsencrypt.tests import test_util
KEY = jose.JWKRSA.load(test_uti... | apache-2.0 |
ebukoz/thrive | erpnext/selling/doctype/selling_settings/selling_settings.py | 28 | 1566 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe.utils import cint
from frappe.custom.doctype.propert... | gpl-3.0 |
unseenlaser/python-for-android | python-build/python-libs/gdata/build/lib/gdata/apps/groups/service.py | 137 | 10118 | #!/usr/bin/python
#
# Copyright (C) 2008 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
#
# Unless required by applicable law... | apache-2.0 |
tylerjereddy/scipy | scipy/special/tests/test_basic.py | 8 | 132780 | # this program corresponds to special.py
### Means test is not done yet
# E Means test is giving error (E)
# F Means test is failing (F)
# EF Means test is giving error and Failing
#! Means test is segfaulting
# 8 Means test runs forever
### test_besselpoly
### test_mathieu_a
### test_mathieu_even_coef
##... | bsd-3-clause |
leki75/ansible | lib/ansible/utils/module_docs_fragments/postgres.py | 143 | 2774 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
dscorbett/pygments | pygments/lexers/graph.py | 4 | 2756 | # -*- coding: utf-8 -*-
"""
pygments.lexers.graph
~~~~~~~~~~~~~~~~~~~~~
Lexers for graph query languages.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, this... | bsd-2-clause |
Padavan/marinade | app/main.py | 1 | 9895 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import pyqtSlot,SIGNAL,SLOT
<<<<<<< HEAD
import time
=======
import time,threading
>>>>>>> f85633c86d99f9bef1ec0634728cbf7cdbfc08f9
class MainWindow(QtGui.QMainWindow):
def __init__(self):
super(MainWind... | mit |
Ambuj-UF/ConCat-1.0 | src/Utils/Bio/Medline/__init__.py | 4 | 5384 | # Copyright 1999 by Jeffrey Chang. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Code to work with Medline from the NCBI.
Classes:
- Record A dictionary holding... | gpl-2.0 |
yanheven/horizon | openstack_dashboard/dashboards/project/loadbalancers/tables.py | 16 | 13632 | # Copyright 2013, Big Switch Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | apache-2.0 |
achals/servo | tests/wpt/css-tests/tools/html5lib/html5lib/treewalkers/__init__.py | 1229 | 2323 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... | mpl-2.0 |
anggorodewanto/oppia | core/controllers/reader.py | 1 | 21891 | # Copyright 2014 The Oppia 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 applicable ... | apache-2.0 |
halvertoluke/edx-platform | lms/djangoapps/courseware/features/annotatable.py | 158 | 3492 | import textwrap
from lettuce import world, steps
from nose.tools import assert_in, assert_equals
from common import i_am_registered_for_the_course, visit_scenario_item
DATA_TEMPLATE = textwrap.dedent("""\
<annotatable>
<instructions>Instruction text</instructions>
<p>{}</p>
</annotatable>
"""... | agpl-3.0 |
bbockelm/root | interpreter/llvm/src/utils/DSAextract.py | 124 | 3350 | #! /usr/bin/python
#this is a script to extract given named nodes from a dot file, with
#the associated edges. An edge is kept iff for edge x -> y
# x and y are both nodes specified to be kept.
#known issues: if a line contains '->' and is not an edge line
#problems will occur. If node labels do not begin with
#Nod... | lgpl-2.1 |
kalxas/QGIS | python/plugins/processing/algs/gdal/sieve.py | 15 | 5672 | # -*- coding: utf-8 -*-
"""
***************************************************************************
sieve.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************************... | gpl-2.0 |
lepricon49/CouchPotatoServer | libs/enzyme/mkv.py | 17 | 30471 | # -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Thomas Schueppel <stain@acm.org>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
# Copyright 2003-2006 Jason Tackaberry <tack@urandom.ca>
#
# This file is part of enzyme.
#
# en... | gpl-3.0 |
sukisuki/mvn | mvn/examples/kalman.py | 2 | 6229 | #! /usr/bin/env python
print 'starting'
import os
import sys
import numpy
import matplotlib
#matplotlib.use('cairo')
from matplotlib.gridspec import GridSpec
from matplotlib.ticker import MultipleLocator
import pylab
from mvn import Mvn
from mvn.matrix import Matrix
import mvn.plotTools
from collections import O... | bsd-2-clause |
elbruno/Blog | 20190521 Python FaceRecognition/Labs2.py | 2 | 1799 | import face_recognition
import cv2
import numpy as np
def LoadFaces():
bruno_image = face_recognition.load_image_file("d:\Faces\Bruno1.jpg")
bruno_face_encoding = face_recognition.face_encodings(bruno_image)[0]
valentino_image = face_recognition.load_image_file("d:\Faces\Valen1.jpg")
valentino_face_enc... | gpl-2.0 |
TechInvestLab/dot15926 | editor_qt/iso15926/kb/other_defs.py | 1 | 2658 | """
.15925 Editor
Copyright 2014 TechInvestLab.ru dot15926@gmail.com
.15925 Editor is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.... | lgpl-3.0 |
hibooboo2/python-agent | cattle/plugins/host_info/memory.py | 2 | 1502 | import platform
class MemoryCollector(object):
def __init__(self):
self.key_map = {'memtotal': 'memTotal',
'memfree': 'memFree',
'memvailable': 'memAvailable',
'buffers': 'buffers',
'cached': 'cached',
... | apache-2.0 |
srajag/nova | nova/tests/api/openstack/compute/contrib/test_rescue.py | 5 | 7244 | # Copyright 2011 OpenStack Foundation
#
# 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... | apache-2.0 |
mechaxl/mixer | setup.py | 2 | 2027 | #!/usr/bin/env python
""" mixer -- Generate tests data.
mixer -- Description
"""
import re
import sys
from os import path as op
from setuptools import setup
def _read(fname):
try:
return open(op.join(op.dirname(__file__), fname)).read()
except IOError:
return ''
_meta = _read('mixer/__ini... | bsd-3-clause |
bascht/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/as.py | 61 | 2989 | """SCons.Tool.as
Tool-specific initialization for as, the generic Posix assembler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010... | apache-2.0 |
yewang15215/django | tests/template_tests/filter_tests/test_addslashes.py | 473 | 1202 | from django.template.defaultfilters import addslashes
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class AddslashesTests(SimpleTestCase):
@setup({'addslashes01': '{% autoescape off %}{{ a|addslashes }} {{ b|addslashes }}{% endautoescape %}'})
... | bsd-3-clause |
anant-dev/django | tests/files/tests.py | 277 | 11286 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gzip
import os
import struct
import tempfile
import unittest
from io import BytesIO, StringIO
from django.core.files import File
from django.core.files.base import ContentFile
from django.core.files.move import file_move_safe
from django.core.file... | bsd-3-clause |
achals/servo | tests/wpt/web-platform-tests/tools/py/testing/test_iniconfig.py | 162 | 8194 | import py
import pytest
from py._iniconfig import IniConfig, ParseError, __all__ as ALL
from py._iniconfig import iscommentline
from textwrap import dedent
def pytest_generate_tests(metafunc):
if 'input' in metafunc.funcargnames:
for name, (input, expected) in check_tokens.items():
metafunc.add... | mpl-2.0 |
nhomar/odoo-mirror | addons/l10n_pl/__openerp__.py | 63 | 2148 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Grzegorz Grzelak grzegorz.grzelak@cirrus.pl
# All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it an... | agpl-3.0 |
siemens/thrift | test/py/SerializationTest.py | 2 | 15256 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.