repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
nagyistoce/odoo-dev-odoo | addons/l10n_in_hr_payroll/__init__.py | 430 | 1117 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
virgree/odoo | addons/mrp_repair/wizard/__init__.py | 445 | 1096 | # -*- 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... | agpl-3.0 |
RockySteveJobs/python-for-android | python3-alpha/python3-src/Tools/scripts/findnocoding.py | 46 | 2722 | #!/usr/bin/env python3
"""List all those Python files that require a coding directive
Usage: nocoding.py dir1 [dir2...]
"""
__author__ = "Oleg Broytmann, Georg Brandl"
import sys, os, re, getopt
# our pysource module finds Python source files
try:
import pysource
except ImportError:
# emulate the module wi... | apache-2.0 |
rmcgibbo/numpy | tools/win32build/build.py | 81 | 4108 | """Python script to build windows binaries to be fed to the "superpack".
The script is pretty dumb: it assumes python executables are installed the
standard way, and the location for blas/lapack/atlas is harcoded.
TODO:
- integrate the x86analysis script to check built binaries
- make the config configurable ... | bsd-3-clause |
leandrotoledo/oppia | extensions/interactions/LogicProof/LogicProof.py | 6 | 1780 | # coding: utf-8
#
# 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 requi... | apache-2.0 |
xi/cplay-ng | cplay.py | 1 | 22873 | import curses
import functools
import json
import os
import random
import re
import selectors
import signal
import socket
import subprocess
import sys
import termios
import time
from contextlib import contextmanager
__version__ = 'cplay-ng 4.0.0'
AUDIO_EXTENSIONS = [
'mp3', 'ogg', 'oga', 'opus', 'flac', 'm4a', 'm... | gpl-2.0 |
queenp/wakatime | wakatime/packages/pygments_py3/pygments/token.py | 125 | 5772 | # -*- coding: utf-8 -*-
"""
pygments.token
~~~~~~~~~~~~~~
Basic token types and the standard tokens.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
class _TokenType(tuple):
parent = None
def split(self):
buf = []
... | bsd-3-clause |
JasonSanchez/w261 | week2/NaiveBayesL.py | 1 | 1635 |
import sys
import re
from mrjob.job import MRJob
from mrjob.step import MRStep
from mrjob.protocol import TextProtocol, TextValueProtocol
# Prevents broken pipe errors from using ... | head
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE,SIG_DFL)
def sum_hs(counts):
h_total, s_total = 0, 0
for h,... | mit |
alu042/edx-platform | lms/djangoapps/course_api/blocks/transformers/block_counts.py | 35 | 1703 | """
Block Counts Transformer
"""
from openedx.core.lib.block_structure.transformer import BlockStructureTransformer
class BlockCountsTransformer(BlockStructureTransformer):
"""
Keep a count of descendant blocks of the requested types
"""
VERSION = 1
BLOCK_COUNTS = 'block_counts'
def __init__(... | agpl-3.0 |
luotao1/Paddle | python/paddle/fluid/tests/unittests/dygraph_to_static/test_slice.py | 2 | 4916 | # Copyright (c) 2020 PaddlePaddle 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 appli... | apache-2.0 |
ergodicbreak/evennia | evennia/scripts/scripts.py | 1 | 18627 | """
This module defines Scripts, out-of-character entities that can store
data both on themselves and on other objects while also having the
ability to run timers.
"""
from twisted.internet.defer import Deferred, maybeDeferred
from twisted.internet.task import LoopingCall
from django.core.exceptions import ObjectDoes... | bsd-3-clause |
npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/distributions/python/kernel_tests/bijectors/power_transform_test.py | 72 | 2610 | # 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 |
acquia/Diamond | src/collectors/ip/test/testip.py | 30 | 4179 | #!/usr/bin/env python
# coding=utf-8
###############################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
try:
from cStringIO import StringIO
except ImportErro... | mit |
PKRoma/python-for-android | pythonforandroid/recipes/libzmq/__init__.py | 4 | 1426 | from pythonforandroid.recipe import Recipe
from pythonforandroid.logger import shprint
from pythonforandroid.util import current_directory
from os.path import join
import sh
class LibZMQRecipe(Recipe):
version = '4.3.2'
url = 'https://github.com/zeromq/libzmq/releases/download/v{version}/zeromq-{version}.zip'... | mit |
rghe/ansible | lib/ansible/modules/network/aci/aci_rest.py | 8 | 13847 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_ve... | gpl-3.0 |
carolFrohlich/nipype | nipype/interfaces/afni/tests/test_auto_BlurToFWHM.py | 2 | 1327 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..preprocess import BlurToFWHM
def test_BlurToFWHM_inputs():
input_map = dict(args=dict(argstr='%s',
),
automask=dict(argstr='-automask',
),
blurmaster=dict(argstr='-blurmaster %s',
),
environ=d... | bsd-3-clause |
andyakins/GCPOC | cloud/container_vm.py | 1 | 2141 | """Creates a Container VM with the provided Container manifest."""
from container_helper import GenerateManifest
COMPUTE_URL_BASE = 'https://www.googleapis.com/compute/v1/'
def GlobalComputeUrl(project, collection, name):
return ''.join([COMPUTE_URL_BASE, 'projects/', project,
'/global/', collect... | mit |
utluiz/utluiz.github.io | pyscript/Lib/datetime.py | 113 | 74954 | """Concrete date/time and related types.
See http://www.iana.org/time-zones/repository/tz-link.html for
time zone and DST data sources.
"""
import time as _time
import math as _math
def _cmp(x, y):
return 0 if x == y else 1 if x > y else -1
MINYEAR = 1
MAXYEAR = 9999
_MAXORDINAL = 3652059 # date.max.toordinal()... | mit |
axiom-data-science/django-celery | djcelery/schedulers.py | 1 | 9679 | from __future__ import absolute_import
import logging
from multiprocessing.util import Finalize
from anyjson import loads, dumps
from celery import current_app
from celery import schedules
from celery.beat import Scheduler, ScheduleEntry
from celery.utils.encoding import safe_str, safe_repr
from celery.utils.log imp... | bsd-3-clause |
caplin/qa-browsers | nodejs/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1 | 7632 | # 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
_TARGET_TYPE_EXT = {
'executable': '.exe',
'shared_library'... | unlicense |
EricMuller/mywebmarks-backend | requirements/twisted/Twisted-17.1.0/src/twisted/words/test/test_jabberxmppstringprep.py | 13 | 5549 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.words.protocols.jabber.xmpp_stringprep import (
nodeprep, resourceprep, nameprep)
class DeprecationTests(unittest.TestCase):
"""
Deprecations in L{twisted.words.protocols.jabber.xmpp_... | mit |
AnCh7/sweetshot | python3-src/piston/account.py | 4 | 9182 | import datetime
import json
import math
import time
from contextlib import suppress
from piston.instance import shared_steem_instance
from .amount import Amount
from .converter import Converter
from .exceptions import AccountDoesNotExistsException
from .utils import parse_time
class Account(dict):
""" This clas... | unlicense |
sagar30051991/ozsmart-erp | erpnext/selling/doctype/customer/test_customer.py | 7 | 4063 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.test_runner import make_test_records
from erpnext.exceptions import PartyFrozen, PartyDisabled
test_ignore ... | agpl-3.0 |
Mec-iS/chronostriples-backup | flankers/tagmeapi/tagMeService.py | 3 | 7680 | #
# A basic API to query TagMe RESTful services
#
__author__ = ['lorenzo']
import time
from pprint import pprint
import urllib
import urllib2
from flankers.tagmeapi.secret.keys import return_api_key
from flankers.tools import retrieve_json
api_key = return_api_key()
class TagMeService:
"""
Contains metho... | apache-2.0 |
cherry-hyx/divio-django-cms | cms/management/commands/subcommands/list.py | 43 | 3281 | # -*- coding: utf-8 -*-
from cms.management.commands.subcommands.base import SubcommandsCommand
from cms.models import Page
from cms.models.pluginmodel import CMSPlugin
from cms.plugin_pool import plugin_pool
from django.core.management.base import NoArgsCommand
class ListApphooksCommand(NoArgsCommand):
help = 'L... | bsd-3-clause |
badloop/SickRage | sickbeard/tvcache.py | 2 | 14587 | # Author: Nic Wolfe <nic@wolfeden.ca>
# 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,... | gpl-3.0 |
alexdzul/propiedades | resty/apps/properties/models.py | 1 | 1066 | import os
import uuid
from django.utils import timezone
from django.db import models
def image_path_post(self, filename):
today = timezone.now()
path = "{0}/{1}/{2}/".format(today.year, today.month, today.day)
ext = filename.split('.')[-1]
my_filename = "{0}.{1}".format(str(uuid.uuid1()).replace('-', ... | mit |
Yangqing/caffe2 | caffe2/python/pipeline_test.py | 4 | 3358 | # Copyright (c) 2016-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | apache-2.0 |
cernops/python-neutronclient | neutronclient/neutron/v2_0/lb/v2/listener.py | 2 | 3798 | # Copyright 2014 Blue Box Group, Inc.
# Copyright 2015 Hewlett-Packard Development Company, L.P.
# All Rights Reserved
#
# Author: Craig Tracey <craigtracey@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obt... | apache-2.0 |
19kestier/taiga-back | taiga/hooks/github/services.py | 20 | 1748 | # 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 |
Architektor/PySnip | venv/lib/python2.7/site-packages/twisted/python/systemd.py | 12 | 2834 | # -*- test-case-name: twisted.python.test.test_systemd -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Integration with systemd.
Currently only the minimum APIs necessary for using systemd's socket activation
feature are supported.
"""
from __future__ import division, absolute_import
... | gpl-3.0 |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_compute_raw_data_spectrum.py | 8 | 3431 | """
==================================================
Compute the power spectral density of raw data
==================================================
This script shows how to compute the power spectral density (PSD)
of measurements on a raw dataset. It also show the effect of applying SSP
to the data to reduce ECG ... | bsd-3-clause |
tcheehow/MissionPlanner | Lib/pprint.py | 57 | 12282 | # Author: Fred L. Drake, Jr.
# fdrake@acm.org
#
# This is a simple little module I wrote to make life easier. I didn't
# see anything quite like it in the library, though I may have overlooked
# something. I wrote this when I was trying to read some heavily nested
# tuples with fairly no... | gpl-3.0 |
sileht/deb-openstack-keystone | keystone/contrib/ec2/backends/kvs.py | 2 | 1772 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
#
# 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 requ... | apache-2.0 |
lqp276/repo_lqp | repopy/src/program/IpReqServer.py | 1 | 1468 | '''
Created on Sep 27, 2018
@author: lqp
'''
import os
from os import environ
from flask.app import Flask
from util.TrackUtil import current_milli_time
import json
from flask.globals import request
from util.logger import mainLogger
from util import TrackUtil
from flask import logging
rootDir = '../..'
if 'rootDir' ... | gpl-2.0 |
brkt/brkt-cli | brkt_cli/aws/test_wrap_guest_image.py | 1 | 9220 | # Copyright 2017 Bracket Computing, 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.
# A copy of the License is located at
#
# https://github.com/brkt/brkt-cli/blob/master/LICENSE
#
# or in the "license" file... | apache-2.0 |
40223108/w18 | static/Brython3.1.1-20150328-091302/Lib/errno.py | 624 | 4096 | """
This module makes available standard errno system symbols.
The value of each symbol is the corresponding integer value,
e.g., on most systems, errno.ENOENT equals the integer 2.
The dictionary errno.errorcode maps numeric codes to symbol names,
e.g., errno.errorcode[2] could be the string 'ENOENT'.
Symbols that ar... | gpl-3.0 |
ashhher3/seaborn | seaborn/tests/test_utils.py | 11 | 11338 | """Tests for plotting utilities."""
import warnings
import tempfile
import shutil
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import nose
import nose.tools as nt
from nose.tools import assert_equal, raises
import numpy.testing as npt
import pandas.util.testing as pdt
from distutils.version ... | bsd-3-clause |
livc/Paddle | demo/traffic_prediction/gen_result.py | 10 | 1702 | # Copyright (c) 2016 PaddlePaddle Authors, 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 a... | apache-2.0 |
mcus/SickRage | lib/cachecontrol/caches/file_cache.py | 56 | 3508 | import hashlib
import os
from lockfile import LockFile
from lockfile.mkdirlockfile import MkdirLockFile
from ..cache import BaseCache
from ..controller import CacheController
def _secure_open_write(filename, fmode):
# We only want to write to this file, so open it in write only mode
flags = os.O_WRONLY
... | gpl-3.0 |
lucashmorais/x-Bench | mozmill-env/python/Lib/io.py | 53 | 3321 | """The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.
At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams; impl... | mit |
fduraffourg/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/util.py | 497 | 13858 | # Copyright 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 list of conditions and the f... | mpl-2.0 |
catapult-project/catapult-csm | third_party/gsutil/third_party/boto/tests/integration/cognito/identity/test_cognito_identity.py | 112 | 2545 | # Copyright (c) 2014 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 (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | bsd-3-clause |
parekhmitchell/Machine-Learning | Machine Learning A-Z Template Folder/Part 2 - Regression/Section 8 - Decision Tree Regression/regression_template.py | 22 | 1424 | # Regression Template
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Position_Salaries.csv')
X = dataset.iloc[:, 1:2].values
y = dataset.iloc[:, 2].values
# Splitting the dataset into the Training set and Test set
"""fro... | mit |
Marina-Gurrieri/montheme | node_modules/node-sass/node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | 5099 | #!/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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... | mit |
ehazon/chrome-app-samples | samples/push-guestbook/guestbook-srv/third_party/apiclient/mimeparse.py | 189 | 6486 | # Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.o... | apache-2.0 |
Stavitsky/nova | nova/objects/tag.py | 11 | 2321 | # 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 |
jhuapl-boss/intern | examples/dvid/general_test.py | 1 | 3757 | import intern
from intern.remote.dvid import DVIDRemote
from intern.resource.dvid.resource import DataInstanceResource
from intern.resource.dvid.resource import RepositoryResource
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
########### NOTE ###########
# This test requires an accessible DV... | apache-2.0 |
Zarokka/exaile | plugins/grouptagger/gt_prefs.py | 4 | 1526 | # 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 1, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY W... | gpl-2.0 |
DarioI/DroidSec | androguard/gui/helpers.py | 14 | 2956 | class Signature(object):
def __init__(self, cls, method=None, descriptor=None):
self.cls = cls
self.class_components = self.cls.name.strip('L').strip(';').split('/')
self.class_path = self.class_components[:-1]
self.class_name = self.class_components[-1]
self.full_class_name... | apache-2.0 |
sauloal/linuxscripts | apache/var/www/html/saulo/torrent/html/bin/clients/mainline/BitTorrent/GetTorrent.py | 6 | 5371 | # The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software di... | mit |
xiaohutushen30/seentao-xblock-sdk | sample_xblocks/basic/problem.py | 11 | 20841 | """Problem XBlock, and friends.
These implement a general mechanism for problems containing input fields
and checkers, wired together in interesting ways.
This code is in the XBlock layer.
A rough sequence diagram::
BROWSER (Javascript) SERVER (Python)
Problem Input Checker ... | agpl-3.0 |
163gal/Time-Line | specs/Backend.py | 2 | 2029 | # Copyright (C) 2009, 2010, 2011 Rickard Lindberg, Roger Lindberg
#
# This file is part of Timeline.
#
# Timeline 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... | gpl-3.0 |
Kraxi/YTplaylist | venv/Lib/site-packages/flask/testsuite/config.py | 556 | 11820 | # -*- coding: utf-8 -*-
"""
flask.testsuite.config
~~~~~~~~~~~~~~~~~~~~~~
Configuration and instances.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import flask
import pkgutil
import unittest
from contextlib import contextmanager
fr... | gpl-2.0 |
dsfsdgsbngfggb/odoo | addons/account/wizard/account_move_line_select.py | 385 | 2800 | # -*- 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 |
pygeek/django | django/contrib/auth/tests/urls.py | 3 | 3301 | from django.conf.urls import patterns, url
from django.contrib.auth import context_processors
from django.contrib.auth.urls import urlpatterns
from django.contrib.auth.views import password_reset
from django.contrib.auth.decorators import login_required
from django.contrib.messages.api import info
from django.http impo... | bsd-3-clause |
legalosLOTR/mdb | MDB/gui.py | 1 | 12480 | #!/usr/bin/python
import sys
import wx
import wx.lib.agw.ultimatelistctrl as ULC
from wx.lib.mixins.listctrl import ColumnSorterMixin
import sqlite3
from DBbuilder import create_database, is_in_db, DBbuilderThread, get_from_db
import os
import wx_signal
import wx.html
from html_window import ClickableHtmlWindow
from d... | isc |
xxd3vin/spp-sdk | opt/Python27/Lib/site-packages/numpy/ma/tests/test_old_ma.py | 81 | 34283 | import numpy
import types
from numpy.ma import *
from numpy.core.numerictypes import float32
from numpy.ma.core import umath
from numpy.testing import *
import sys
if sys.version_info[0] >= 3:
from functools import reduce
pi = numpy.pi
def eq(v, w, msg=''):
result = allclose(v, w)
if not result:
p... | mit |
martiert/bitbake | lib/bb/ui/crumbs/imageconfigurationpage.py | 2 | 23776 | #!/usr/bin/env python
#
# BitBake Graphical GTK User Interface
#
# Copyright (C) 2012 Intel Corporation
#
# Authored by Dongxiao Xu <dongxiao.xu@intel.com>
# Authored by Shane Wang <shane.wang@intel.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Gene... | gpl-2.0 |
raffaelespazzoli/origin | vendor/github.com/google/certificate-transparency/cpp/server/ct-dns-server-test.py | 33 | 10792 | import base64
import dns.resolver
import dns.rdatatype
import logging
import math
import os
import random
import shlex
import signal
import subprocess
import sys
import time
NUMBER_OF_CERTS = 100
basepath = os.path.dirname(sys.argv[0])
sys.path.append(os.path.join(basepath, '../../python'))
from ct.crypto import mer... | apache-2.0 |
Diaoul/pyjulius | pyjulius/__init__.py | 1 | 1118 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of pyjulius.
#
# pyjulius 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 of the... | lgpl-3.0 |
taknevski/tensorflow-xsmm | tensorflow/contrib/tensor_forest/hybrid/python/models/decisions_to_data_then_nn_test.py | 101 | 4681 | # 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 |
shurihell/testasia | openedx/core/lib/tests/test_js_utils.py | 33 | 2886 | """
Tests for js_utils.py
"""
import json
from unittest import TestCase
from openedx.core.lib.js_utils import (
escape_json_dumps, escape_js_string
)
class TestJSUtils(TestCase):
"""
Test JS utils
"""
class NoDefaultEncoding(object):
"""
Helper class that has no default JSON encod... | agpl-3.0 |
Shugabuga/zeroclickinfo-goodies | share/goodie/currency_in/parse.py | 87 | 2347 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Released under the GPL v2 license
# https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
import lxml.html
import sys
#url = "http://en.wikipedia.org/wiki/List_of_circulating_currencies"
url = "https://secure.wikimedia.org/wikipedia/en/wiki/List_of_circulating_currencies"... | apache-2.0 |
kfcpaladin/sze-the-game | game/models/achievements/AchievementManager.py | 1 | 1635 | from .AchievementListener import AchievementListener
from models.popups import Popup
class AchievementManager(object):
def __init__(self, popups):
self._achievements = {}
self._listeners = []
self._popups = popups
def __iter__(self):
for achievement in self._achievements.value... | mit |
sexroute/commandergenius | project/jni/python/src/Lib/json/__init__.py | 57 | 12286 | r"""A simple, fast, extensible JSON encoder and decoder
JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
json exposes an API familiar to uses of the standard library
marshal and pickle modules.
Encoding basic Py... | lgpl-2.1 |
cdht/androguard | demos/geinimi_analysis.py | 23 | 2912 | #!/usr/bin/env python
import sys
import hashlib
import pyDes
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "./")
sys.path.append(PATH_INSTALL + "/core")
sys.path.append(PATH_INSTALL + "/core/bytecodes")
sys.path.append(PATH_INSTALL + "/core/analysis")
from androguard import *
import analysis
TEST = "./geinimi... | apache-2.0 |
fafaman/django | tests/annotations/models.py | 238 | 2901 | # coding: utf-8
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
friends = models.ManyToManyField('self', blank=True)
def __str__(self... | bsd-3-clause |
scroiset/cmsplugin-filer | cmsplugin_filer_link/migrations/0001_initial.py | 28 | 14201 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (
("filer", "0008_polymorphic__del_field_file__file_type_plugin_name"),
)
def forwards(self, orm):
# Addi... | bsd-3-clause |
glwu/python-for-android | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_callable.py | 161 | 1151 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for callable().
This converts callable(obj) into isinstance(obj, collections.Callable), adding a
collections import if needed."""
# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import ... | apache-2.0 |
jiachenning/odoo | openerp/loglevels.py | 380 | 3930 | # -*- coding: 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 the GNU... | agpl-3.0 |
hbrunn/OCB | addons/portal_project_issue/tests/__init__.py | 260 | 1086 | # -*- 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 |
dalejung/naginpy | naginpy/special_eval/tests/test_manifest.py | 1 | 15685 | import ast
from unittest import TestCase
from textwrap import dedent
import pandas as pd
import numpy as np
from numpy.testing import assert_almost_equal
import nose.tools as nt
from asttools import (
ast_equal
)
from ..manifest import (
Expression,
Manifest,
_manifest
)
from ..exec_context import (... | mit |
KrullBorg/MINGW-packages | mingw-w64-openvr/cxx_header_generator.py | 20 | 3300 | #! python3
import argparse
import shlex
import sys
import os
import re
import io
parser = argparse.ArgumentParser(
prog='cxx_header_generator', description="Generate C++ header for openvr",
epilog='Run cxx_header_generator.py --help for more information',
allow_abbrev=F... | bsd-3-clause |
hazzl/chirpy | sqlistmodel.py | 1 | 2229 | from PyQt5.QtCore import QAbstractListModel, Qt, QModelIndex
import sqlite3
class sqlistmodel(QAbstractListModel):
def __init__(self, conn):
super().__init__()
self._conn = conn
self._data = [(0, '')]
self._rolesindex = {
Qt.DisplayRole: 1,
Qt.UserRole: 0}
def printData(self):
print(self._data)
def... | gpl-3.0 |
linuxipho/mycroft-core | test/unittests/util/test_parse_sv.py | 1 | 5775 | # -*- coding: utf-8 -*-
#
# Copyright 2017 Mycroft AI 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 ... | apache-2.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/Cookie.py | 19 | 26492 | ####
# 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 all
# copies and that bot... | gpl-2.0 |
sayan801/indivo_server | utils/pha_setup.py | 4 | 3833 | import sys
import hashlib
import string
from indivo.models import PHA
from indivo.models import Account
from indivo.models import Record
from indivo.models import DocumentSchema
#Order on the arguments: pha_name, contact_email, pha_start_url_template, pha_callback_url
class PHA_Creation:
def __init__(self, pha_na... | gpl-3.0 |
bc-python-tools/orpyste | orpyste/parse/walk.py | 1 | 23403 | #! /usr/bin/env python3
"""
prototype::
date = 2017-07-31
This module contains a class ``WalkInAST`` to be subclassed so as to walk in
the intermediate AST view made by the class ``parse.ast.AST``, and also to act
regarding the context or the data met during the walk.
info::
The class ``WalkInAST`` do some... | gpl-3.0 |
elky/django | tests/prefetch_related/models.py | 14 | 8132 | import uuid
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.query import ModelIterable, QuerySet
from django.utils.functional import cached_property
class Author(mo... | bsd-3-clause |
openhatch/oh-mainline | vendor/packages/Jinja2/jinja2/testsuite/lexnparse.py | 402 | 22314 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.lexnparse
~~~~~~~~~~~~~~~~~~~~~~~~~~
All the unittests regarding lexing, parsing and syntax.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja... | agpl-3.0 |
omnirom/android_external_chromium-org | third_party/markupsafe/_constants.py | 1535 | 4795 | # -*- coding: utf-8 -*-
"""
markupsafe._constants
~~~~~~~~~~~~~~~~~~~~~
Highlevel implementation of the Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
HTML_ENTITIES = {
'AElig': 198,
'Aacute': 193,
'Acirc': 194,
'Agrave': 1... | bsd-3-clause |
maraoz/proofofexistence | pycoin/scripts/bitcoin_utils.py | 3 | 4930 | #!/usr/bin/env python
import argparse
import binascii
import sys
from pycoin import ecdsa, encoding
from pycoin.ecdsa import secp256k1
def b2h(b):
return binascii.hexlify(b).decode("utf8")
def parse_as_number(s):
try:
return int(s)
except ValueError:
pass
try:
... | mit |
OpenTSDB/tcollector | collectors/etc/config.py | 1 | 3086 | #!/usr/bin/env python
# This file is part of tcollector.
# Copyright (C) 2010 The tcollector Authors.
#
# This program 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 of the License, o... | lgpl-3.0 |
brokenjacobs/ansible | lib/ansible/modules/identity/ipa/ipa_group.py | 71 | 9707 | #!/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.
#
... | gpl-3.0 |
ptisserand/ansible | lib/ansible/modules/windows/win_audit_rule.py | 24 | 4723 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Noah Sparks <nsparks@outlook.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': ... | gpl-3.0 |
astondbs/googletest | test/gtest_shuffle_test.py | 3023 | 12549 | #!/usr/bin/env python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | bsd-3-clause |
wkschwartz/django | tests/schema/tests.py | 1 | 172263 | import datetime
import itertools
import unittest
from copy import copy
from unittest import mock
from django.core.exceptions import FieldError
from django.core.management.color import no_style
from django.db import (
DatabaseError, DataError, IntegrityError, OperationalError, connection,
)
from django.db.models im... | bsd-3-clause |
bpgc-cte/python2017 | Week 7/django/lib/python3.6/site-packages/django/template/response.py | 50 | 5594 | from django.http import HttpResponse
from django.utils import six
from .loader import get_template, select_template
class ContentNotRenderedError(Exception):
pass
class SimpleTemplateResponse(HttpResponse):
rendering_attrs = ['template_name', 'context_data', '_post_render_callbacks']
def __init__(self... | mit |
muntasirsyed/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/es/es_provinces.py | 436 | 1482 | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
PROVINCE_CHOICES = (
('01', _('Arava')),
('02', _('Albacete')),
('03', _('Alacant')),
('04', _('Almeria')),
('05', _('Avila')),
('06', _('Badajoz')),
('07', _('Illes Balears')),
('08', _('Barcelona')),
(... | apache-2.0 |
coldeasy/python-driver | example_mapper.py | 1 | 4657 | #!/usr/bin/env python
# Copyright 2013-2017 DataStax, 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 la... | apache-2.0 |
atsushieno/cerbero | test/test_cerbero_build_filesprovider.py | 4 | 4885 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | lgpl-2.1 |
OpenTrons/opentrons_sdk | robot-server/robot_server/service/session/session_types/check_session.py | 1 | 3703 | from opentrons.calibration.check.session import CheckCalibrationSession
from opentrons.calibration.check import models as calibration_models
from opentrons.calibration.session import CalibrationException
from robot_server.service.session import models
from robot_server.service.session.command_execution import \
Co... | apache-2.0 |
sdgdsffdsfff/chameleon | client/tools/buildtool/chameleon_tool/modifyWx.py | 3 | 1205 | import os,sys
BASEDIR = os.path.split(os.path.realpath(__file__))[0]
channleinfo = os.path.join(BASEDIR, '..', '..', '..' ,'channelinfo')
POSITION_HOLDER_PACKAGE = '%package%'
def makeWXEntryActivity(smaliRoot, channel, newPackage):
channelSmali = os.path.join(channleinfo, channel, 'script', 'WXEntryActivity.sm... | mit |
qvazzler/Flexget | flexget/plugins/cli/t411.py | 1 | 4526 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from flexget import options, plugin
from flexget.event import event
from flexget.logger import console
from flexget.manager import Session
try:
from flexget.plugins.api_t41... | mit |
provaleks/o8 | addons/l10n_eu_service/wizard/wizard.py | 242 | 8513 | # -*- coding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Business Applications
# Copyright (C) 2015 Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Aff... | agpl-3.0 |
naylor-b/aserver | analysis_server/cfg_wrapper.py | 1 | 6200 |
import os
import sys
import time
import logging
from inspect import getmembers, ismethod, isfunction
from itertools import chain
from fnmatch import fnmatchcase
from six import iteritems
from openmdao.core.problem import Problem
import openmdao.util.log
from analysis_server.varwrapper import _find_var_wrapper
from ... | apache-2.0 |
quxiaolong1504/django | django/utils/safestring.py | 478 | 4414 | """
Functions for working with "safe strings": strings that can be displayed safely
without further escaping in HTML. Marking something as a "safe string" means
that the producer of the string has already turned characters that should not
be interpreted by the HTML engine (e.g. '<') into the appropriate entities.
"""
f... | bsd-3-clause |
srjoglekar246/sympy | sympy/printing/conventions.py | 2 | 1781 | """
A few practical conventions common to all printers.
"""
import re
def split_super_sub(text):
"""Split a symbol name into a name, superscripts and subscripts
The first part of the symbol name is considered to be its actual
'name', followed by super- and subscripts. Each superscript is
p... | bsd-3-clause |
wangcan04/chatbot | NeuralChat/util/vocabutils.py | 1 | 3245 | import pickle
from tensorflow.python.platform import gfile
import util.tokenizer
import re
import os
import special_vocab as config
_PAD = config._PAD
_GO = config._GO
_EOS = config._EOS
_UNK = config._UNK
_START_VOCAB = config._START_VOCAB
PAD_ID = config.PAD_ID
EOS_ID = config.EOS_ID
GO_ID = config.GO_ID
UNK_ID = c... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.