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
cjwilburn/git-sweep
src/gitsweep/inspector.py
5
1465
from git import Git from .base import BaseOperation class Inspector(BaseOperation): """ Used to introspect a Git repository. """ def merged_refs(self, skip=[]): """ Returns a list of remote refs that have been merged into the master branch. The "master" branch may h...
mit
supersven/intellij-community
python/lib/Lib/site-packages/django/conf/locale/ka/formats.py
329
1888
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'l, j F, Y' TIME_FORMAT = 'h:i:s a' DATETIME_FORMAT = 'j F, Y h:i:s a' YEA...
apache-2.0
bombless/rust
src/etc/generate-keyword-tests.py
53
1985
#!/usr/bin/env python # # Copyright 2013 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license #...
apache-2.0
sysadmin75/ansible
lib/ansible/modules/subversion.py
4
12080
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_v...
gpl-3.0
mdrumond/tensorflow
tensorflow/contrib/stateless/python/kernel_tests/stateless_random_ops_test.py
54
3287
# 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
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/scipy/io/_fortran.py
60
7592
""" Module to read / write Fortran unformatted sequential files. This is in the spirit of code written by Neil Martinsen-Burrell and Joe Zuntz. """ from __future__ import division, print_function, absolute_import import warnings import numpy as np __all__ = ['FortranFile'] class FortranFile(object): """ A...
apache-2.0
BT-astauder/odoo
addons/auth_oauth/__openerp__.py
300
1654
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 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
arista-eosplus/ansible
test/integration/cleanup_rax.py
25
6501
#!/usr/bin/env python import os import re import yaml import argparse try: import pyrax HAS_PYRAX = True except ImportError: HAS_PYRAX = False def rax_list_iterator(svc, *args, **kwargs): method = kwargs.pop('method', 'list') items = getattr(svc, method)(*args, **kwargs) while items: ...
gpl-3.0
James1345/django-rest-framework
rest_framework/permissions.py
71
6444
""" Provides a set of pluggable permission policies. """ from __future__ import unicode_literals from django.http import Http404 from rest_framework.compat import get_model_name SAFE_METHODS = ('GET', 'HEAD', 'OPTIONS') class BasePermission(object): """ A base class from which all permission classes should...
bsd-2-clause
olafdietsche/scrapy
tests/test_spider.py
61
14158
import gzip import inspect import warnings from io import BytesIO from testfixtures import LogCapture from twisted.trial import unittest from scrapy import signals from scrapy.settings import Settings from scrapy.http import Request, Response, TextResponse, XmlResponse, HtmlResponse from scrapy.spiders.init import In...
bsd-3-clause
dmsuehir/spark-tk
python/sparktk/frame/ops/join_right.py
14
7799
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel 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 require...
apache-2.0
yipenggao/moose
python/peacock/PeacockMainWindow.py
3
6789
#!/usr/bin/env python from Input import OutputNames from PythonConsoleWidget import PythonConsoleWidget from ExodusViewer.ExodusViewer import ExodusViewer from PostprocessorViewer.PostprocessorViewer import PostprocessorViewer from peacock.utils import WidgetUtils from peacock.BasePeacockMainWindow import BasePeacockMa...
lgpl-2.1
Versent/ansible-modules-core
utilities/logic/wait_for.py
82
18083
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # 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 Licens...
gpl-3.0
kmee/l10n-brazil
l10n_br_account_product/sped/nfe/serializer/txt.py
4
57917
# -*- coding: utf-8 -*- # Copyright (C) 2009 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from datetime import datetime from unicodedata import normalize import pytz from openerp import SUPERUSER_ID from openerp import pooler from openerp.addons.l10n_br_base.tools.misc impor...
agpl-3.0
boakley/robotframework-workbench
rwb/widgets/toolbutton.py
1
2154
import Tkinter as tk import ttk class ToolButton(ttk.Button): '''A button designed to be placed on a toolbar This has the behavior of looking flat until you hover over it. It also supports tooltips. ''' def __init__(self, parent, imagedata=None, tooltip="the tooltip", text=None,command=None, width...
apache-2.0
dmitriy-serdyuk/EncDecASR
doc/conf.py
28
6225
# -*- coding: utf-8 -*- # # pylearn2 documentation build configuration file # It is based on Theano documentation build # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable (module impo...
bsd-3-clause
rancher/linux
Documentation/target/tcm_mod_builder.py
237
23549
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
daonb/Open-Knesset
mks/migrations/0029_auto__add_field_party_knesset__add_unique_party_knesset_name.py
14
13215
# -*- coding: 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 field 'Party.knesset' db.add_column('mks_party', 'knesset', self.gf('django.d...
bsd-3-clause
kbidarkar/robottelo
robottelo/cli/docker.py
8
18778
# -*- encoding: utf-8 -*- """Docker related hammer commands""" from robottelo.cli.base import Base class DockerContainer(Base): """Manipulates Docker containers Usage:: hammer docker container [OPTIONS] SUBCOMMAND [ARG] ... Parameters:: SUBCOMMAND subcommand ...
gpl-3.0
EulerProject/RCC-in-ASP
DLV/python-aux/gen-comp-table.py
1
1484
# Output facts corresponding to the RCC-5 composition table (5x5 entries) d = 16 # dr (disjoint region) e = 8 # eq (equals) i = 4 # ppi (proper part inverse) o = 2 # po (partial overlap) p = 1 # pp (proper part...
apache-2.0
rwl/PyCIM
CIM15/IEC61968/Common/Document.py
1
17456
# 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...
mit
lerina/livecoding
scripts2/inheritanceSuperclasses_FunctionUpdate.py
4
1320
# Purpose: ... class OldStyleBase: """ Updated OldStyleBase doc string. """ def __init__(self, *args, **kwargs): """ Updated OldStyleBase __init__ doc string """ self.args = args self.kwargs = kwargs def Func(self, *args, **kwargs): """ Updated OldStyleBase Func doc s...
bsd-3-clause
coala/coala-bears
tests/python/PyromaBearTest.py
23
2191
import unittest import os.path from queue import Queue from coalib.settings.Section import Section from bears.python.PyromaBear import PyromaBear def get_testdir_path(name): return os.path.join(os.path.dirname(__file__), 'pyroma_test_files', name) def get_message_list(results): return [result.message for r...
agpl-3.0
markusmichel/Tworpus-Client
tworpus/views.py
1
1476
from django.shortcuts import render_to_response, RequestContext from django.http import HttpResponse, Http404 import tworpus_user_id from models import TworpusSettings import json import data_converter from tworpus import settings def home(request): request.META["CSRF_COOKIE_USED"] = True return render_to_res...
apache-2.0
curvetips/s4u.sqlalchemy
src/s4u/sqlalchemy/inet.py
2
1229
import IPy from sqlalchemy.types import TypeDecorator from sqlalchemy.types import CHAR from sqlalchemy.dialects import postgresql class INET(TypeDecorator): """Platform-independent INET type. This type stores IPv4 and IPv6 addresses and netmarks. This type uses the `IPy.IP <http://pypi.python.org/pypi/I...
bsd-3-clause
henryroe/PyNOMAD
nomad/nomad.py
1
39768
import os.path import os from pandas import DataFrame from pandas.io.parsers import read_csv import numpy as np import datetime import gzip import sys import pickle import glob base_dir = os.path.abspath(os.path.dirname(__file__)) about = {} with open(os.path.join(base_dir, "__about__.py")) as f: exec(f.read(), a...
mit
hellckt/micblog
migrations/versions/d66f086b258_user_information.py
127
1101
"""user information Revision ID: d66f086b258 Revises: 56ed7d33de8d Create Date: 2013-12-29 23:50:49.566954 """ # revision identifiers, used by Alembic. revision = 'd66f086b258' down_revision = '56ed7d33de8d' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic -...
mit
AnthonyBroadCrawford/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/treeadapters/sax.py
1835
1661
from __future__ import absolute_import, division, unicode_literals from xml.sax.xmlreader import AttributesNSImpl from ..constants import adjustForeignAttributes, unadjustForeignAttributes prefix_mapping = {} for prefix, localName, namespace in adjustForeignAttributes.values(): if prefix is not None: pre...
mpl-2.0
shsingh/ansible
lib/ansible/modules/storage/purestorage/purefa_smtp.py
19
4504
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Simon Dodsley (simon@purestorage.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1',...
gpl-3.0
tequa/ammisoft
ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/compiler/syntax.py
369
1444
"""Check for errs in the AST. The Python parser does not catch all syntax errors. Others, like assignments with invalid targets, are caught in the code generation phase. The compiler package catches some errors in the transformer module. But it seems clearer to write checkers that use the AST to detect errors. """ ...
bsd-3-clause
kmoocdev2/edx-platform
common/djangoapps/util/tests/test_date_utils.py
20
7787
# -*- coding: utf-8 -*- """ Tests for util.date_utils """ import unittest from datetime import datetime, timedelta, tzinfo import ddt from mock import patch from nose.tools import assert_equals, assert_false # pylint: disable=no-name-in-module from pytz import utc from util.date_utils import almost_same_datetime, g...
agpl-3.0
aclifton/cpeg853-gem5
util/dram_lat_mem_rd_plot.py
13
5155
#!/usr/bin/env python # Copyright (c) 2015 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation...
bsd-3-clause
Nexenta/s3-tests
virtualenv/lib/python2.7/site-packages/boto/ec2/volume.py
155
10436
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files ...
mit
genome-vendor/cython
Cython/TestUtils.py
8
7517
import Cython.Compiler.Errors as Errors from Cython.CodeWriter import CodeWriter from Cython.Compiler.TreeFragment import TreeFragment, strip_common_indent from Cython.Compiler.Visitor import TreeVisitor, VisitorTransform from Cython.Compiler import TreePath import unittest import os, sys import tempfile class NodeTy...
apache-2.0
luceatnobis/youtube-dl
youtube_dl/extractor/bambuser.py
60
4791
from __future__ import unicode_literals import re import itertools from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, float_or_none, int_or_none, sanitized_Request, urlencode_postdata, ) class BambuserIE(InfoExtractor): IE_NAME = 'bambuser...
unlicense
pycook/cmdb
cmdb-api/api/lib/utils.py
1
4910
# -*- coding:utf-8 -*- import json import redis import six from elasticsearch import Elasticsearch from flask import current_app def get_page(page): try: page = int(page) except ValueError: page = 1 return page if page >= 1 else 1 def get_page_size(page_size): if page_size == "all...
gpl-2.0
qtproject/qtwebengine
tools/buildscripts/qtwebengine_utils.py
2
2078
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2016 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the QtWebEngine module of the Qt Toolkit. ## ## $QT_BEGIN_LICENSE:GPL-EXCEPT$ ## Commercial License Usage ...
gpl-2.0
raccoongang/edx-platform
openedx/core/djangoapps/user_api/verification_api/tests/test_views.py
11
4207
""" Tests for API endpoints. """ from __future__ import unicode_literals import datetime import freezegun import json from django.conf import settings from django.core.urlresolvers import reverse from django.test import TestCase from django.test.utils import override_settings from lms.djangoapps.verify_student.model...
agpl-3.0
BigBrother1984/android_external_chromium_org
tools/json_schema_compiler/cpp_type_generator.py
23
11468
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from code import Code from model import Namespace, PropertyType, Type import cpp_util from json_parse import OrderedDict from operator import attrgetter ...
bsd-3-clause
buttoshianamoto/aprilcoin
contrib/bitrpc/bitrpc.py
2348
7835
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:8332") else: access = Ser...
mit
penberg/linux
scripts/kconfig/tests/choice/__init__.py
564
1079
# SPDX-License-Identifier: GPL-2.0 """ Basic choice tests. The handling of 'choice' is a bit complicated part in Kconfig. The behavior of 'y' choice is intuitive. If choice values are tristate, the choice can be 'm' where each value can be enabled independently. Also, if a choice is marked as 'optional', the whole c...
gpl-2.0
hgdeoro/pilas
pilas/actores/texto_inferior.py
5
2088
# -*- encoding: utf-8 -*- # Pilas engine - A video game framework. # # Copyright 2010 - Hugo Ruscitti # License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html) # # Website - http://www.pilas-engine.com.ar import pilas from .texto import Texto class TextoInferior(Texto): """Representa un texto al pie de la ve...
lgpl-3.0
AJ9/HomeLightSystem
docs/conf.py
75
7722
# -*- coding: utf-8 -*- # # sample documentation build configuration file, created by # sphinx-quickstart on Mon Apr 16 21:22:43 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
bsd-2-clause
kayframework/kay-framework
kay/tests/formtest.py
9
8188
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Tests for forms. :Copyright: (c) 2009 Accense Technology, Inc. All rights reserved. :license: BSD, see LICENSE for more details. """ import sys import os import unittest import logging from google.appengine.ext import db import kay kay.setup() from kay.misc import g...
bsd-3-clause
carstooon/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/base/Histogram.py
41
3360
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
maheshcn/memory-usage-from-ldfile
resource_usage.py
1
7909
################################################################################ #Generate a memory usage summary excel file from a linker map file #Usage: python resource_usage.py input_file [output_file] #Author :Mahesh C # ############################################################################### import s...
gpl-2.0
ehashman/oh-mainline
vendor/packages/zope.interface/src/zope/interface/tests/test_interface.py
17
18844
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
agpl-3.0
iamaleksey/cassandra-dtest
configuration_test.py
7
8242
import os import logging import parse import pytest from cassandra.concurrent import execute_concurrent_with_args from tools.misc import ImmutableMapping from dtest_setup_overrides import DTestSetupOverrides from dtest import Tester, create_ks from tools.jmxutils import (JolokiaAgent, make_mbean, ...
apache-2.0
Ms2ger/servo
tests/wpt/web-platform-tests/tools/pytest/doc/en/_themes/flask_theme_support.py
2228
4875
# flasky extensions. flasky pygments style based on tango style from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal class FlaskyStyle(Style): background_color = "#f8f8f8" default_style = "...
mpl-2.0
draperjames/bokeh
bokeh/models/plots.py
2
19214
''' Models for representing top-level plot objects. ''' from __future__ import absolute_import from six import string_types from ..core.enums import Location from ..core.properties import Auto, Bool, Dict, Either, Enum, Include, Instance, Int, List, Override, String from ..core.property_mixins import LineProps, Fill...
bsd-3-clause
p0psicles/SickRage
lib/unidecode/x00e.py
252
4092
data = ( '[?]', # 0x00 'k', # 0x01 'kh', # 0x02 'kh', # 0x03 'kh', # 0x04 'kh', # 0x05 'kh', # 0x06 'ng', # 0x07 'cch', # 0x08 'ch', # 0x09 'ch', # 0x0a 'ch', # 0x0b 'ch', # 0x0c 'y', # 0x0d 'd', # 0x0e 't', # 0x0f 'th', # 0x10 'th', # 0x11 'th', # 0x12 'n', #...
gpl-3.0
MQQiang/kbengine
kbe/res/scripts/common/Lib/idlelib/idle_test/test_searchdialogbase.py
67
5860
'''Unittests for idlelib/SearchDialogBase.py Coverage: 99%. The only thing not covered is inconsequential -- testing skipping of suite when self.needwrapbutton is false. ''' import unittest from test.support import requires from tkinter import Tk, Toplevel, Frame, Label, BooleanVar, StringVar from idlelib import Sear...
lgpl-3.0
Lightmatter/django-inlineformfield
.tox/py27/lib/python2.7/site-packages/IPython/core/magics/logging.py
21
6597
"""Implementation of magic functions for IPython's own logging. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 The IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distribut...
mit
cessor/pywinauto
pywinauto/tests/truncation.py
15
18971
# GUI Application automation and testing library # Copyright (C) 2006 Mark Mc Mahon # # This library 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 2.1 # of the License, or (at you...
lgpl-2.1
bakhtout/odoo-educ
addons/account_anglo_saxon/purchase.py
427
2043
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
windedge/odoo
addons/mail/update.py
221
4668
# -*- coding: utf-8 -*- from ast import literal_eval import datetime from functools import partial import logging import werkzeug.urls import urllib2 from openerp import release, SUPERUSER_ID from openerp.models import AbstractModel from openerp.osv import osv from openerp.tools.translate import _ from openerp.tools.c...
agpl-3.0
TheMOOCAgency/edx-platform
common/djangoapps/django_comment_common/migrations/0001_initial.py
12
1450
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings from openedx.core.djangoapps.xmodule_django.models import CourseKeyField class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(setti...
agpl-3.0
jeffdwyatt/taiga-back
taiga/timeline/management/commands/rebuild_timeline_iterating_per_projects.py
14
1500
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the F...
agpl-3.0
LinguList/burmish
pyburmish/phonology.py
2
3516
from pyburmish import * from lingpy._plugins.chinese import sinopy as sp from collections import defaultdict import networkx as nx def split_tokens(tokens, separator='+'): out = [[]] for k in tokens: if k == separator: out += [[]] else: out[-1] += [k] return out def...
gpl-2.0
tyrasd/openaddresses
scripts/at/split.py
38
1591
# -*- coding: utf-8 -*- import __future__ import csv, sys, json, copy, datetime, time def main(address_filename, street_filename): timestamp = datetime.datetime.now().strftime('%Y%m%d') streets = {} with open(street_filename) as f: reader = csv.reader(f, delimiter=';') next(reader) ...
bsd-3-clause
spiceqa/virt-test
tests/nic_promisc.py
2
2109
import logging import os import time from autotest.client import utils from autotest.client.shared import error from virttest import utils_test, utils_net, aexpect @error.context_aware def run_nic_promisc(test, params, env): """ Test nic driver in promisc mode: 1) Boot up a VM. 2) Repeatedly enable/d...
gpl-2.0
achedeuzot/django-envconf
envconf/envconf.py
1
23688
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import logging import os import re import sys import warnings from .path import Path # Patch for urllib try: from urllib import parse as urlparse except ImportError: import urlparse import urllib # Patch for basestring to work un...
mit
nicolargo/intellij-community
python/helpers/pycharm_generator_utils/util_methods.py
19
20781
from pycharm_generator_utils.constants import * try: import inspect except ImportError: inspect = None def create_named_tuple(): #TODO: user-skeleton return """ class __namedtuple(tuple): '''A mock base class for named tuples.''' __slots__ = () _fields = () def __new__(cls, *args, **kw...
apache-2.0
trangnm58/idrec
localization_cnn/dataset.py
1
4286
from __future__ import division, print_function, unicode_literals from os import listdir import os import json import sys import random import cv2 import pickle import numpy as np seed = 13 np.random.seed(seed) sys.path.insert(0, "..") from utils import Timer from localization_cnn.constants import ( HEIGHT, WIDTH, ...
mit
surligas/gnuradio
gr-wxgui/python/wxgui/forms/forms.py
46
26068
# # Copyright 2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version. # #...
gpl-3.0
w1ll1am23/home-assistant
tests/components/plugwise/test_config_flow.py
6
11142
"""Test the Plugwise config flow.""" from unittest.mock import MagicMock, patch from plugwise.exceptions import ( ConnectionFailedError, InvalidAuthentication, PlugwiseException, ) import pytest from homeassistant import config_entries, data_entry_flow, setup from homeassistant.components.plugwise.const i...
apache-2.0
cuttlefishh/papers
cyanophage-light-dark-transcriptomics/code/RNAseq_getpileup_directional.py
1
4586
#!/usr/bin/env python ''' Steve Biller, March 2011 Usage: RNAseq_getpileup_directional.py Goal: Get a pileup file for a given SAM/BAM file that can be brought into R, etc Output: Chromosome, position, # reads mapping to + strand, # reads mapping to - strand ''' import sys, re, pysam, os from optparse import Optio...
mit
DazWorrall/ansible
lib/ansible/modules/cloud/amazon/lambda.py
5
18968
#!/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 distributed...
gpl-3.0
ProfessorX/CIS508
Codes/xen-4.3.1/tools/python/xen/xm/xenapi_create.py
21
38950
#!/usr/bin/python #============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distribu...
gpl-2.0
timsnyder/bokeh
bokeh/models/tests/test_axes.py
2
2112
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
Adam13531/OpHog
src/tools/publisher.py
1
9854
# Thu 04/03/2014 - 01:37 PM # # This will concatenate all .js files into a single file, then run UglifyJS on # it. # # Order of the JavaScript files matters, so we can't just consolidate them all # using a one-line batch script: # for /F %%G in ('dir /s /b %1\*.js') do (type %%G >> %outputFile%) # # Requirements ...
gpl-2.0
almeidapaulopt/frappe
frappe/tests/test_exporter_fixtures.py
13
8714
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import frappe.defaults from frappe.core.doctype.data_import.data_import import export_csv import unittest import os class TestDataImportFixtures(unittest.TestCase):...
mit
Marsfan/GY88
Compass/compass.py
1
1284
"""Get data from the GY88 Compass module.""" import time import math import smbus bus = smbus.SMBus(1) addr = 0x1E pi = 3.141592653 xmax = 0 xmin = 0 ymax = 0 ymin = 0 xoffset = -144 yoffset = - 350 bus.write_byte_data(addr, 0x02, 0x00) # todo adjust so that the M_drdy pin will trigger reading, # making reading fast...
gpl-2.0
olapaola/olapaola-android-scripting
python/src/Demo/tkinter/guido/mbox.py
43
7478
#! /usr/bin/env python # Scan MH folder, display results in window import os import sys import re import getopt import string import mhlib from Tkinter import * from dialog import dialog mailbox = os.environ['HOME'] + '/Mail' def main(): global root, tk, top, mid, bot global folderbox, foldermenu, scanbox...
apache-2.0
mrkm4ntr/incubator-airflow
tests/cli/commands/test_pool_command.py
1
4754
# # 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...
apache-2.0
ryangallen/django
django/template/loader_tags.py
190
11946
from collections import defaultdict from django.utils import six from django.utils.safestring import mark_safe from .base import ( Node, Template, TemplateSyntaxError, TextNode, Variable, token_kwargs, ) from .library import Library register = Library() BLOCK_CONTEXT_KEY = 'block_context' class ExtendsError(E...
bsd-3-clause
Duoxilian/home-assistant
homeassistant/components/device_tracker/gpslogger.py
10
2684
""" Support for the GPSLogger platform. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.gpslogger/ """ import asyncio from functools import partial import logging from homeassistant.const import HTTP_UNPROCESSABLE_ENTITY from homeassistant...
mit
tudyzhb/yichui
django/core/management/commands/makemessages.py
80
17291
import fnmatch import glob import os import re import sys from itertools import dropwhile from optparse import make_option from subprocess import PIPE, Popen import django from django.core.management.base import CommandError, NoArgsCommand from django.utils.text import get_text_list from django.utils.jslex import prep...
bsd-3-clause
numba/numba
numba/core/interpreter.py
4
73716
import builtins import collections import dis import operator import logging from numba.core import errors, dataflow, controlflow, ir, config from numba.core.errors import NotDefinedError, error_extras from numba.core.utils import (PYVERSION, BINOPS_TO_OPERATORS, INPLACE_BINOPS_TO_OPERATO...
bsd-2-clause
MagiChau/Hearthstone-Card-Lookup
card_lookup/searcher.py
1
4417
""" Completes Hearthstone Card Lookup through comparing search queries to card names """ import copy class Searcher: def __init__(self, card_dict): """Initializes a Searcher object with a card dictionary provided Args: card_dict(dict): Card dictionary with cards are separated into sub dictionaries by set and...
mit
simone-campagna/shells-kitchen
tests/unit/test_default_command.py
1
1281
# -*- coding: utf-8 -*- import pytest from testutils.utils import COMM_TEXT, COMM_TEXT2, COMM_TEXT3, create_cmd, add_comm, add_comm2, add_comm3 from shells_kitchen import IGNORE, REPEAT_LAST @pytest.fixture(params=[None, IGNORE, REPEAT_LAST, 'comm3'], ids=[None, 'IGNORE', 'REPEAT_LAST', 'comm3']) def default_comman...
apache-2.0
proxysh/Safejumper-for-Mac
buildlinux/env32/lib/python2.7/site-packages/twisted/test/test_udp.py
24
24676
# -*- test-case-name: twisted.test.test_udp -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for implementations of L{IReactorUDP} and L{IReactorMulticast}. """ from __future__ import division, absolute_import from twisted.trial import unittest from twisted.python.compat import ...
gpl-2.0
m2candre/ansible-modules-extras
cloud/misc/proxmox_template.py
85
8476
#!/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 distributed...
gpl-3.0
rcurtin/shogun
examples/undocumented/python_static/kernel_combined.py
22
1068
from tools.load import LoadMatrix from sg import sg lm=LoadMatrix() traindat=lm.load_numbers('../data/fm_train_real.dat') testdat=lm.load_numbers('../data/fm_test_real.dat') parameter_list=[[traindat,testdat,1.,10],[traindat,testdat,1.5,11]] def kernel_combined(fm_train_real=traindat,fm_test_real=testdat, weight=1...
gpl-3.0
mhessels/Frobit_Mapping
ros_ws/src/frobit_mapping/scripts/bug2.py
2
6000
""" Implementation of bug2 navigation from Principle of Robot Motion Author Matthias Hessels Feb 2017 """ import numpy as np import time import math from PIL import Image as img class Bug2Algorithm: def __init__(self): self.im = img.open("bug_test.png").convert('L') self.current = ...
gpl-2.0
datamade/openelections-core
openelex/tests/test_lib.py
2
3263
from unittest import TestCase from openelex.lib import format_date, standardized_filename from openelex.lib.text import ocd_type_id, election_slug class TestText(TestCase): def test_ocd_type_id(self): # Test that function converst spaces to underscores and # non-word characters to tildes ...
mit
gojira/tensorflow
tensorflow/examples/benchmark/sample_benchmark.py
94
1605
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
bhargav2408/python-for-android
python3-alpha/python3-src/Lib/encodings/ptcp154.py
647
8950
""" Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,err...
apache-2.0
skosukhin/spack
var/spack/repos/builtin/packages/tmalign/package.py
1
1702
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
agat63/GS4_test
scripts/build-all.py
1182
9486
#! /usr/bin/env python # Copyright (c) 2009-2011, The Linux Foundation. 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 # ...
gpl-2.0
GunnerJnr/_CodeInstitute
Stream-3/Full-Stack-Development/18.Creating-Forum-Polls/1.What-Taking-Polls-Requires-In-Terms-Of-Data-Models/we_are_social/accounts/models.py
16
2185
# -*- coding: utf-8 -*- """ This is the models file for creating models for the accounts app """ from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import AbstractUser, UserManager from django.utils import timezone # Create your models here. # Create our new user clas...
mit
minorua/QGIS
python/plugins/processing/gui/MultipleInputDialog.py
45
9238
# -*- coding: utf-8 -*- """ *************************************************************************** MultipleInputDialog.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *******************...
gpl-2.0
hefen1/chromium
chrome/common/extensions/docs/server2/blob_reference_store.py
146
1119
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from appengine_wrappers import db from appengine_wrappers import BlobReferenceProperty BLOB_REFERENCE_BLOBSTORE = 'BlobReferenceBlobstore' class _Model...
bsd-3-clause
Kefkius/pycoin
tests/validate_tx_test.py
11
11255
#!/usr/bin/env python import binascii import io import unittest from pycoin.block import Block from pycoin.serialize import h2b from pycoin.tx import Tx, ValidationFailureError from pycoin.tx.script import tools class ValidatingTest(unittest.TestCase): def test_validate(self): # block 80971 bloc...
mit
BeDjango/intef-openedx
lms/djangoapps/course_api/blocks/forms.py
22
5211
""" Course API Forms """ from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.forms import Form, CharField, ChoiceField, IntegerField from django.http import Http404 from rest_framework.exceptions import PermissionDenied from opaque_keys import InvalidKeyError from...
agpl-3.0
ligature/ansible-modules-extras
messaging/rabbitmq_queue.py
78
9505
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Manuel Sousa <manuel.sousa@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...
gpl-3.0
GdZ/scriptfile
software/googleAppEngine/lib/django_1_2/django/contrib/gis/gdal/tests/test_envelope.py
68
3767
import unittest from django.contrib.gis.gdal import Envelope, OGRException class TestPoint(object): def __init__(self, x, y): self.x = x self.y = y class EnvelopeTest(unittest.TestCase): def setUp(self): self.e = Envelope(0, 0, 5, 5) def test01_init(self): "Testing Enve...
mit
Donkyhotay/MoonPy
zope/server/logger/m_syslog.py
1
7101
# -*- Mode: Python; tab-width: 4 -*- # ====================================================================== # Copyright 1997 by Sam Rushing # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose and without fee is here...
gpl-3.0
mrunge/openstack_horizon
openstack_horizon/dashboards/admin/aggregates/urls.py
1
1248
# 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 # d...
apache-2.0
apark263/tensorflow
tensorflow/python/saved_model/signature_constants.py
5
4893
# 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