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 |
|---|---|---|---|---|---|
naototty/pyflag | src/plugins_old/MemoryForensics/Volatility-1.3_Linux_rc.1/forensics/win32/domcachedump.py | 7 | 4338 | # Volatility
# Copyright (c) 2008 Volatile Systems
# Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu>
#
# 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... | gpl-2.0 |
litchfield/django | django/test/testcases.py | 3 | 55668 | from __future__ import unicode_literals
import difflib
import errno
import json
import os
import posixpath
import re
import socket
import sys
import threading
import unittest
import warnings
from collections import Counter
from copy import copy
from functools import wraps
from unittest.util import safe_repr
from djan... | bsd-3-clause |
tomlanyon/dnspython | tests/test_grange.py | 4 | 2916 | # 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 "... | isc |
willingc/oh-mainline | vendor/packages/kombu/kombu/__init__.py | 15 | 3835 | """Messaging library for Python"""
from __future__ import absolute_import
from collections import namedtuple
version_info_t = namedtuple(
'version_info_t', ('major', 'minor', 'micro', 'releaselevel', 'serial'),
)
VERSION = version_info_t(3, 0, 22, '', '')
__version__ = '{0.major}.{0.minor}.{0.micro}{0.releaselev... | agpl-3.0 |
wkschwartz/django | django/db/models/fields/mixins.py | 40 | 1801 | from django.core import checks
NOT_PROVIDED = object()
class FieldCacheMixin:
"""Provide an API for working with the model's fields value cache."""
def get_cache_name(self):
raise NotImplementedError
def get_cached_value(self, instance, default=NOT_PROVIDED):
cache_name = self.get_cache... | bsd-3-clause |
dataxu/ansible | lib/ansible/modules/network/illumos/dladm_vnic.py | 56 | 6606 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Adam Števko <adam.stevko@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_version': '1.1'... | gpl-3.0 |
njwilson23/scipy | scipy/stats/mstats_extras.py | 67 | 14221 | """
Additional statistics functions with support for masked arrays.
"""
# Original author (2007): Pierre GF Gerard-Marchant
from __future__ import division, print_function, absolute_import
__all__ = ['compare_medians_ms',
'hdquantiles', 'hdmedian', 'hdquantiles_sd',
'idealfourths',
... | bsd-3-clause |
beernarrd/gramps | gramps/gen/filters/rules/citation/_hasnote.py | 6 | 1806 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2007 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2008 Jerome Rapinat
# Copyright (C) 2008 Benny Malengier
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it ... | gpl-2.0 |
seanjohnson20/BudgetBuddy | routes.py | 1 | 18267 | # coding: utf-8
## u.t.f.-8 line included so Jinja templates can handle '%.02f' in them.
from flask import Flask, render_template, request, g, session, flash, \
redirect, url_for, abort
from database import db_session, engine
from models import User, Accounts, Categories, Transactions, Goals
from flask import Fla... | gpl-3.0 |
aruneli/validation-tests | tests/validation_v2/cattlevalidationtest/core/test_services_sidekick.py | 1 | 36672 | from common_fixtures import * # NOQA
WEB_IMAGE_UUID = "docker:sangeetha/testlbsd:latest"
SSH_IMAGE_UUID = "docker:sangeetha/testclient:latest"
def create_env_with_sidekick(testname, client, service_scale, expose_port):
launch_config_consumed_service = {
"imageUuid": WEB_IMAGE_UUID}
# Adding service... | apache-2.0 |
vamanea/linux-odroidxu | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
googleads/google-ads-python | google/ads/googleads/v8/common/types/final_app_url.py | 1 | 1997 | # -*- coding: utf-8 -*-
# Copyright 2020 Google 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 required by applicable law or... | apache-2.0 |
googleads/google-ads-python | google/ads/googleads/v7/errors/types/string_format_error.py | 1 | 1160 | # -*- coding: utf-8 -*-
# Copyright 2020 Google 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 required by applicable law or... | apache-2.0 |
zqzhang/crosswalk-test-suite | misc/sampleapp-android-tests/sampleapp/simd.py | 14 | 4150 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
niavlys/kivy | kivy/tests/test_multistroke.py | 56 | 13829 | import unittest
import kivy.multistroke
from kivy.multistroke import Recognizer, MultistrokeGesture
from kivy.vector import Vector
best_score = 0.0
counter = 0
def best_score_cb(result):
global best_score
best_score = result.best['score']
def counter_cb(result):
global counter
counter += 1
# Thes... | mit |
alexryndin/ambari | ambari-common/src/main/python/resource_management/libraries/functions/list_ambari_managed_repos.py | 3 | 1906 | #!/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
"License");... | apache-2.0 |
showtimesynergy/mojify | main.py | 1 | 2619 | from PIL import Image
import csv
from ast import literal_eval as make_tuple
from math import sqrt
import argparse
import os.path
def load_img(image):
# load an image as a PIL object
im = Image.open(image).convert('RGBA')
return im
def color_distance(c_tuple1, c_tuple2):
# calculate the color distanc... | bsd-2-clause |
kickstandproject/asterisk-testsuite-temporary | tests/channels/pjsip/transfers/blind_transfer/caller_refer_only/transfer.py | 2 | 6588 | #!/usr/bin/env python
'''
Copyright (C) 2014, Digium, Inc.
John Bigelow <jbigelow@digium.com>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
'''
import logging
import pjsua as pj
from twisted.internet import reactor
LOGGER = logging.getLogger(__name__)
URI = [... | gpl-2.0 |
tarballs-are-good/sympy | sympy/physics/quantum/innerproduct.py | 8 | 3833 | """Symbolic inner product."""
from sympy import Expr, conjugate
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.state import KetBase, BraBase, _lbracket
__all__ = [
'InnerProduct'
]
# InnerProduct is not an QExpr because it is r... | bsd-3-clause |
superdesk/superdesk-aap | scripts/update-cores-references.py | 2 | 1935 | #!/usr/bin/env python3
import feedparser
import fileinput
import re
import sys
import getopt
TO_BE_UPDATED = [
# superdesk-core
{
'feed_url': 'https://github.com/superdesk/superdesk-core/commits/',
'file_name': 'server/requirements.txt',
'pattern': 'superdesk-core.git@([a-f0-9]*)'
}... | agpl-3.0 |
jcoady9/python-for-android | python3-alpha/python3-src/Lib/distutils/tests/test_file_util.py | 65 | 1908 | """Tests for distutils.file_util."""
import unittest
import os
import shutil
from distutils.file_util import move_file
from distutils import log
from distutils.tests import support
from test.support import run_unittest
class FileUtilTestCase(support.TempdirManager, unittest.TestCase):
def _log(self, msg, *args):... | apache-2.0 |
khwilson/PynamoDB | examples/model.py | 3 | 5905 | """
An example using Amazon's Thread example for motivation
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SampleTablesAndData.html
"""
from __future__ import print_function
import logging
from pynamodb.models import Model
from pynamodb.attributes import (
UnicodeAttribute, NumberAttribute, Unicod... | mit |
dbarbier/privot | python/test/t_SquareMatrixLapack_std.py | 1 | 1446 | #! /usr/bin/env python
from openturns import *
TESTPREAMBLE()
try :
matrix1 = SquareMatrix(2)
matrix1.setName("matrix1")
matrix1[0, 0] = 1.0
matrix1[1, 0] = 2.0
matrix1[0, 1] = 5.0
matrix1[1, 1] = 12.0
print "matrix1 = ", matrix1
pt = NumericalPoint()
pt.add(5.0)
pt.add(0.0)
... | lgpl-3.0 |
verma-varsha/zulip | analytics/lib/time_utils.py | 17 | 1174 | from zerver.lib.timestamp import floor_to_hour, floor_to_day, timestamp_to_datetime
from analytics.lib.counts import CountStat
from datetime import datetime, timedelta
from typing import List, Optional
# If min_length is None, returns end_times from ceiling(start) to floor(end), inclusive.
# If min_length is greater ... | apache-2.0 |
zhjunlang/kbengine | kbe/src/lib/python/Lib/genericpath.py | 106 | 3882 | """
Path operations common to more than one OS
Do not use directly. The OS specific modules import the appropriate
functions from this module themselves.
"""
import os
import stat
__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
'getsize', 'isdir', 'isfile', 'samefile', 'sameopenfil... | lgpl-3.0 |
mbauskar/phrerp | erpnext/setup/page/setup_wizard/setup_wizard.py | 10 | 13323 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe.utils import cstr, flt, getdate
from frappe import _
from frappe.utils.file_manager import save_file
from frappe.tra... | agpl-3.0 |
rysson/filmkodi | plugin.video.fanfilm/resources/lib/libraries/cleantitle.py | 2 | 2591 | # -*- coding: utf-8 -*-
'''
FanFilm Add-on
Copyright (C) 2015 lambda
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 ... | apache-2.0 |
heihachi/PokemonGo-Bot | pokemongo_bot/walkers/polyline_generator.py | 8 | 7061 | # -*- coding: utf-8 -*-
from geographiclib.geodesic import Geodesic
from itertools import chain
import math
import polyline
import requests
from geopy.distance import great_circle
def distance(point1, point2):
return Geodesic.WGS84.Inverse(point1[0], point1[1], point2[0], point2[1])["s12"] # @UndefinedVariable
... | mit |
geier/alot | tests/commands/global_test.py | 1 | 7054 | # encoding=utf-8
# Copyright © 2017 Dylan Baker
#
# 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 later version.
#
# This program is di... | gpl-3.0 |
nirmeshk/oh-mainline | vendor/packages/python-social-auth/social/tests/backends/test_yahoo.py | 76 | 2535 | import json
import requests
from httpretty import HTTPretty
from social.p3 import urlencode
from social.tests.backends.oauth import OAuth1Test
class YahooOAuth1Test(OAuth1Test):
backend_path = 'social.backends.yahoo.YahooOAuth'
user_data_url = 'https://social.yahooapis.com/v1/user/a-guid/profile?' \
... | agpl-3.0 |
Red680812/android_44_KitKat_kernel_htc_dlxpul-2 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
creasyw/IMTAphy | documentation/doctools/tags/0.4.2/sphinx/util/console.py | 9 | 1809 | # -*- coding: utf-8 -*-
"""
sphinx.util.console
~~~~~~~~~~~~~~~~~~~
Format colored console output.
:copyright: 2007-2008 by Georg Brandl.
:license: BSD.
"""
codes = {}
def get_terminal_width():
"""Borrowed from the py lib."""
try:
import os, termios, fcntl, struct
call = ... | gpl-2.0 |
PriceChild/ansible | lib/ansible/module_utils/junos.py | 16 | 6193 | #
# (c) 2017 Red Hat, Inc.
#
# 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 ... | gpl-3.0 |
DonaldTrumpHasTinyHands/tiny_hands_pac | products/models.py | 1 | 3762 | from django.db import models
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from wagtail.wagtailcore.models import Page, Orderable
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.wagtailimages.models import Im... | mit |
shenyy/lily2-gem5 | tests/long/se/60.bzip2/test.py | 21 | 1751 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... | bsd-3-clause |
tmpgit/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/ro/ro_counties.py | 428 | 1231 | # -*- coding: utf-8 -*-
"""
A list of Romanian counties as `choices` in a formfield.
This exists as a standalone file so that it's only imported into memory when
explicitly needed.
"""
COUNTIES_CHOICES = (
('AB', u'Alba'),
('AR', u'Arad'),
('AG', u'Argeş'),
('BC', u'Bacău'),
('BH', u'Bihor'),
... | apache-2.0 |
pfnet/chainer | tests/chainermn_tests/iterators_tests/test_iterator_compatibility.py | 8 | 5655 | # This test is based on Chainer's iterator compatibility test.
# The major changed point is that we do not test
# the order SerialIterator -> MultiNodeIterator,
# because slave iterator must synchronize the batch order with master
# thus should not accept overwriting the batch order by serialization.
# See: chainer/t... | mit |
cancro7/gem5 | src/arch/x86/isa/insts/system/segmentation.py | 25 | 7202 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# Copyright (c) 2012-2013 AMD
# 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 rel... | bsd-3-clause |
raphael0202/spaCy | spacy/fr/_tokenizer_exceptions_list.py | 3 | 513595 | # coding: utf8
from __future__ import unicode_literals
BASE_EXCEPTIONS = [
"0-day",
"0-days",
"1000Base-T",
"100Base-T",
"100Base-T4",
"100Base-TX",
"10BASE-F",
"10Base-T",
"1,1-diméthylhydrazine",
"11-septembre",
"11-Septembre",
"120-cellules",
"1,2,3-tris-nitrooxy-propane",
"1,2-diazine",
"1,2-dichloropropane",
"1... | mit |
KittyTristy/roguekit | libs/libtcodpy.py | 1 | 60843 | #
# libtcod 1.5.1 python wrapper
# Copyright (c) 2008,2009,2010 Jice & Mingos
# 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 |
openmips/gbremote-client | src/GBIpboxTimer.py | 1 | 3289 | #############################################################################
#
# Copyright (C) 2014 Impex-Sat Gmbh & Co.KG
# Written by Sandro Cavazzoni <sandro@skanetwork.com>
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public... | gpl-2.0 |
striges/gapuff | gapuff/met_def.py | 1 | 2212 | #coding=utf-8
import numpy
import global_settings
class met_def:
"""We define meterological data here. And we can define meterological sequence and field here.
Met的数据格式有三种
0 恒定气象场,必须是一个tuple并且长度是(u,v,z,stab)
1 SAM站点数据,必须是一个list,并且list中的每个tuple都是(u,v,z,stab), then convert it to a numpy array (t_index, value_index)
... | gpl-3.0 |
whs/django | tests/raw_query/models.py | 112 | 1358 | from django.db import models
class Author(models.Model):
first_name = models.CharField(max_length=255)
last_name = models.CharField(max_length=255)
dob = models.DateField()
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Protect against annotations being passe... | bsd-3-clause |
openstack/manila | manila/api/v2/quota_class_sets.py | 2 | 3475 | # Copyright 2012 OpenStack LLC.
# Copyright (c) 2015 Mirantis 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/L... | apache-2.0 |
hyuh/villec2-kernel | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
laurentb/weboob | modules/residentadvisor/pages.py | 2 | 4917 | # -*- coding: utf-8 -*-
# Copyright(C) 2014 Alexandre Morignot
#
# This file is part of a weboob module.
#
# This weboob module 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 Free Software Foundation, either version 3 of ... | lgpl-3.0 |
openstack/nova | nova/tests/functional/regressions/test_bug_1797580.py | 2 | 4260 | # 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
# distributed under t... | apache-2.0 |
ArthurGarnier/SickRage | lib/lxml/_elementpath.py | 18 | 10121 | #
# ElementTree
# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl created
# 2003-05-28 fl added support for // etc
# 2003-08-27 fl fixed parsing of periods in element names
# 2007-09-10 fl new selection engine
# 2007-09-12 fl fix... | gpl-3.0 |
Tomasuh/Anti-virus-in-python | superior.py | 1 | 3498 | import psutil,time,database,pefile2,os,psfunc
class processWatcher:
"""docstring for processWatcher"""
def __init__(self):
self.db = database.databaseHandler()
self.mode =self.db.runMode()
self.pe = pefile2.peInfo()
self.ps = psfunc.psutilFunc()
#Action against process d... | gpl-3.0 |
unindented/streamcode | client/static/jsrepl/extern/python/closured/lib/python2.7/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... | mit |
AmandaCMS/amanda-cms | amanda/product/migrations/0001_initial.py | 1 | 2898 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ProductImage'
db.create_table(u'product_productimage', (
... | mit |
cesargtz/YecoraOdoo | addons/account/account_financial_report.py | 339 | 7636 | # -*- 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 |
masamichi/bite-project | deps/gdata-python-client/samples/blogger/oauth-appengine/main.py | 41 | 1765 | __author__ = 'wiktorgworek@google.com (Wiktor Gworek)'
import wsgiref.handlers
import atom
import os
import cgi
import gdata.blogger.service
from oauth import OAuthDanceHandler, OAuthHandler, requiresOAuth
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
class MainHandler(OA... | apache-2.0 |
AevumDecessus/fragforce.org | ffsfdc/models.py | 2 | 15743 | from django.db import models
from django.utils import timezone
class Hcmeta(models.Model):
hcver = models.IntegerField(blank=True, null=True)
org_id = models.CharField(max_length=50, blank=True, null=True)
details = models.TextField(blank=True, null=True)
class Meta:
managed = False
d... | gpl-2.0 |
googleapis/python-logging | google/cloud/logging_v2/types/__init__.py | 1 | 3610 | # -*- coding: utf-8 -*-
# Copyright 2020 Google 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 required by applicable law or... | apache-2.0 |
danalec/dotfiles | sublime/.config/sublime-text-3/Packages/python-markdown/st3/markdown/extensions/smarty.py | 62 | 10360 | # -*- coding: utf-8 -*-
'''
Smarty extension for Python-Markdown
====================================
Adds conversion of ASCII dashes, quotes and ellipses to their HTML
entity equivalents.
See <https://pythonhosted.org/Markdown/extensions/smarty.html>
for documentation.
Author: 2013, Dmitry Shachnev <mitya57@gmail.c... | mit |
mgadi/naemonbox | sources/psdash/pyzmq-13.1.0/zmq/tests/test_context.py | 5 | 6745 | #-----------------------------------------------------------------------------
# Copyright (c) 2010-2012 Brian Granger, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----... | gpl-2.0 |
jimi-c/ansible | lib/ansible/modules/network/netscaler/netscaler_cs_action.py | 72 | 9032 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# 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 |
akash1808/nova | nova/tests/functional/v3/test_flavor_access.py | 29 | 4566 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
wangjun/wakatime | wakatime/packages/pygments_py2/pygments/formatters/terminal.py | 76 | 5401 | # -*- coding: utf-8 -*-
"""
pygments.formatters.terminal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for terminal output with ANSI sequences.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
from pygments.formatter import Format... | bsd-3-clause |
DanielSBrown/osf.io | scripts/migration/migrate_mailing_lists_to_mailchimp_field.py | 40 | 1043 | """
Used to transfer over subscriptions current users might have from their mailing_list field (which is to be deprecated),
to the new mailchimp_mailing_lists field. After that is done, to clean-up, remove mailing_lists as a User field.
"""
import logging
import sys
from website import models
from website.app import i... | apache-2.0 |
pombreda/django-hotclub | apps/local_apps/account/templatetags/other_service_tags.py | 12 | 1234 | import re
from django import template
from account.models import other_service
register = template.Library()
class OtherServiceNode(template.Node):
def __init__(self, user, key, asvar):
self.user = user
self.key = key
self.asvar = asvar
def render(self, context):
user = s... | mit |
RO-ny9/python-for-android | python3-alpha/extra_modules/gdata/contacts/service.py | 120 | 17345 | #!/usr/bin/env python
#
# Copyright 2009 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 requir... | apache-2.0 |
40223136/w11-2 | static/Brython3.1.0-20150301-090019/Lib/multiprocessing/process.py | 694 | 2304 | #
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Process', 'current_process', 'active_children']
#
# Imports
#
import os
import sys
import signal
import itert... | gpl-3.0 |
cherusk/ansible | lib/ansible/plugins/cache/jsonfile.py | 36 | 1681 | # (c) 2014, Brian Coca, Josh Drake, et al
#
# 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 |
openregister/openregister-python | openregister/item.py | 2 | 1777 | from copy import copy
from .datatypes.digest import git_hash, base32_encode
class Item(object):
"""An Item, a content addressable set of attributes."""
def __init__(self, **kwds):
self.__dict__.update(kwds)
def __getitem__(self, key, default=None):
try:
return self.__dict__[ke... | mit |
rversteegen/commandergenius | project/jni/python/src/Demo/pdist/makechangelog.py | 43 | 2989 | #! /usr/bin/env python
"""Turn a pile of RCS log output into ChangeLog file entries.
"""
import sys
import string
import re
import getopt
import time
def main():
args = sys.argv[1:]
opts, args = getopt.getopt(args, 'p:')
prefix = ''
for o, a in opts:
if p == '-p': prefix = a
f = sys.std... | lgpl-2.1 |
2014c2g9/c2g9 | exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/atexit.py | 743 | 1049 | """allow programmer to define multiple exit functions to be executedupon normal program termination.
Two public functions, register and unregister, are defined.
"""
class __loader__(object):
pass
def _clear(*args,**kw):
"""_clear() -> None
Clear the list of previously registered exit functions."""
... | gpl-2.0 |
edum1978/eduengage | boilerplate/external/babel/messages/tests/checkers.py | 31 | 12764 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists of v... | lgpl-3.0 |
kaiyou/docker-py | tests/unit/api_network_test.py | 4 | 6282 | import json
import six
from .api_test import BaseAPIClientTest, url_prefix, response
from ..helpers import requires_api_version
from docker.types import IPAMConfig, IPAMPool
try:
from unittest import mock
except ImportError:
import mock
class NetworkTest(BaseAPIClientTest):
@requires_api_version('1.21'... | apache-2.0 |
huiren/ece511 | ext/ply/doc/makedoc.py | 177 | 5862 | #!/usr/local/bin/python
###############################################################################
# Takes a chapter as input and adds internal links and numbering to all
# of the H1, H2, H3, H4 and H5 sections.
#
# Every heading HTML tag (H1, H2 etc) is given an autogenerated name to link
# to. However, if the n... | bsd-3-clause |
bratsche/Neutron-Drive | google_appengine/lib/django_1_3/django/contrib/localflavor/pl/forms.py | 273 | 5444 | """
Polish-specific form helpers
"""
import re
from django.forms import ValidationError
from django.forms.fields import Select, RegexField
from django.utils.translation import ugettext_lazy as _
from django.core.validators import EMPTY_VALUES
class PLProvinceSelect(Select):
"""
A select widget with list of P... | bsd-3-clause |
lmazuel/azure-sdk-for-python | azure-mgmt-web/azure/mgmt/web/models/deleted_site.py | 1 | 2033 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
tux-00/ansible | lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule.py | 54 | 11383 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Darren Worrall <darren@iweb.co.uk>
# (c) 2015, René Moser <mail@renemoser.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free So... | gpl-3.0 |
JimCircadian/ansible | lib/ansible/modules/storage/infinidat/infini_export_client.py | 43 | 5489 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Gregory Shulov (gregory.shulov@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_version': '... | gpl-3.0 |
timpaul/remember | node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # Copyright (c) 2011 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.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | mit |
Elettronik/SickRage | tests/config_tests.py | 12 | 25664 | # coding=utf-8
"""
Test sickbeard.config's classes and methods
Classes:
ConfigMigrator
migrate_config
_migrate_v1
_name_to_pattern
_migrate_v2
_migrate_v3
_migrate_v4
_migrate_v5
_migrate_v6
_migrate_v7
_migrate_v8
_migrate_v9
... | gpl-3.0 |
sorenk/ansible | test/units/modules/network/nxos/test_nxos_acl_interface.py | 57 | 2910 | # (c) 2016 Red Hat Inc.
#
# 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 dis... | gpl-3.0 |
40223110/2015CDAFinal_test2 | static/Brython3.1.0-20150301-090019/Lib/_sysconfigdata.py | 731 | 18167 | build_time_vars={'HAVE_SYS_WAIT_H': 1, 'HAVE_UTIL_H': 0, 'HAVE_SYMLINKAT': 1, 'HAVE_LIBSENDFILE': 0, 'SRCDIRS': 'Parser Grammar Objects Python Modules Mac', 'SIZEOF_OFF_T': 8, 'BASECFLAGS': '-Wno-unused-result', 'HAVE_UTIME_H': 1, 'EXTRAMACHDEPPATH': '', 'HAVE_SYS_TIME_H': 1, 'CFLAGSFORSHARED': '-fPIC', 'HAVE_HYPOT': 1... | gpl-3.0 |
semplice/alan2 | alan-menu-updater.py | 1 | 2227 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# alan2 - An openbox menu builder
# Copyright (C) 2013 Semplice Project
#
# 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... | gpl-3.0 |
shaon/eutester | testcases/cloud_admin/testcase_template.py | 6 | 1143 | #!/usr/bin/python
from eucaops import Eucaops
from eutester.eutestcase import EutesterTestCase
class SampleTest(EutesterTestCase):
def __init__(self):
self.setuptestcase()
self.setup_parser()
self.get_args()
# Setup basic eutester object
self.tester = Eucaops( config_file=s... | bsd-2-clause |
theochem/horton | scripts/horton-esp-test.py | 4 | 3918 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2017 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Licens... | gpl-3.0 |
cynnjjs/HangingMobile | revision2.py | 1 | 7778 | #!/usr/bin/python
# ---------------------------------------------------------------------------
# File: revision2.py
# Author: Yining Chen
# Modified from IBM's cplex mixed integer programming example mipex1.py
# ---------------------------------------------------------------------------
# Vector x: 2*n*n+7*n total
# 0... | mit |
paulrouget/servo | tests/wpt/web-platform-tests/tools/third_party/py/testing/path/common.py | 55 | 16410 | import py
import sys
import pytest
class CommonFSTests(object):
def test_constructor_equality(self, path1):
p = path1.__class__(path1)
assert p == path1
def test_eq_nonstring(self, path1):
p1 = path1.join('sampledir')
p2 = path1.join('sampledir')
assert p1 == p2
d... | mpl-2.0 |
hynnet/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/macurl2path.py | 332 | 3275 | """Macintosh-specific module for conversion between pathnames and URLs.
Do not import directly; use urllib instead."""
import urllib
import os
__all__ = ["url2pathname","pathname2url"]
def url2pathname(pathname):
"""OS-specific conversion from a relative URL of the 'file' scheme
to a file system path; not r... | gpl-2.0 |
jzoldak/edx-platform | lms/djangoapps/certificates/tests/factories.py | 23 | 3036 | # Factories are self documenting
# pylint: disable=missing-docstring
from uuid import uuid4
from factory.django import DjangoModelFactory
from certificates.models import (
GeneratedCertificate, CertificateStatuses, CertificateHtmlViewConfiguration, CertificateWhitelist,
CertificateInvalidation,
)
from student... | agpl-3.0 |
ssorgatem/qiime | scripts/parallel_multiple_rarefactions.py | 15 | 4939 | #!/usr/bin/env python
# File created on 14 Jul 2012
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "gregcaporaso@gmail.com"
from... | gpl-2.0 |
8u1a/plaso | plaso/engine/worker.py | 2 | 27179 | # -*- coding: utf-8 -*-
"""The event extraction worker."""
import logging
import os
from dfvfs.analyzer import analyzer
from dfvfs.lib import definitions as dfvfs_definitions
from dfvfs.lib import errors as dfvfs_errors
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import resolver as path_sp... | apache-2.0 |
adelina-t/neutron | neutron/api/versions.py | 23 | 1958 | # Copyright 2011 Citrix Systems.
# 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 ... | apache-2.0 |
simobasso/ansible | contrib/inventory/zone.py | 138 | 1466 | #!/usr/bin/env python
# (c) 2015, Dagobert Michelsen <dam@baltic-online.de>
#
# 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
# ... | gpl-3.0 |
mzhaom/dpdk | lib/librte_vhost/libvirt/qemu-wrap.py | 20 | 12379 | #!/usr/bin/python
#/*
# * BSD LICENSE
# *
# * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# * All rights reserved.
# *
# * Redistribution and use in source and binary forms, with or without
# * modification, are permitted provided that the following conditions
# * are met:
# *
# * * R... | gpl-2.0 |
Micronaet/micronaet-addons-private | intervention_report_trip/wizard/wizard_create_intervent.py | 1 | 8852 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# Copyright (C) 2004-2012 Micronaet srl. All Rights Reserved
# d$
#
# This pr... | agpl-3.0 |
Tranzystorek/servo | tests/wpt/css-tests/tools/py/py/_io/terminalwriter.py | 175 | 12542 | """
Helper functions for writing to terminals and files.
"""
import sys, os
import py
py3k = sys.version_info[0] >= 3
from py.builtin import text, bytes
win32_and_ctypes = False
colorama = None
if sys.platform == "win32":
try:
import colorama
except ImportError:
try:
import ctyp... | mpl-2.0 |
aexeagmbh/swampdragon | swampdragon/pubsub_providers/mock_publisher.py | 14 | 1454 | import json
subscribers = {}
class MockPublisher(object):
def __init__(self):
self.subscribers = subscribers
def publish(self, channel, message):
subs = subscribers.get(channel)
if not subs:
return
for subscriber in subs:
if isinstance(message, str):
... | bsd-3-clause |
richese/i3pystatus | i3pystatus/core/__init__.py | 3 | 4792 | import logging
import os
import sys
from threading import Thread
from i3pystatus.core import io, util
from i3pystatus.core.exceptions import ConfigError
from i3pystatus.core.imputil import ClassFinder
from i3pystatus.core.modules import Module
DEFAULT_LOG_FORMAT = '%(asctime)s [%(levelname)-8s][%(name)s %(lineno)d] %... | mit |
whitehorse-io/encarnia | evennia/evennia/players/migrations/0004_auto_20150403_2339.py | 12 | 1937 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import evennia.players.manager
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('players', '0003_auto_20150209_2234'),
]
operations = [
migratio... | mit |
patrickm/chromium.src | tools/telemetry/telemetry/value/value_backcompat.py | 36 | 1984 | # Copyright 2013 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.
"""Backward compatibility for old results API.
This module helps convert the old PageMeasurementResults API into the new
style one. This exists as a bridging... | bsd-3-clause |
zjffdu/zeppelin | python/src/main/resources/python/bootstrap_sql.py | 60 | 1189 | # 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 use ... | apache-2.0 |
laiyuncong8404/RFAUtils | utils/ScreenShot.py | 2 | 1648 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os,re,time,platform,subprocess
#判断系统类型,windows使用findstr,linux使用grep
system = platform.system()
if system is "Windows":
find_util = "findstr"
else:
find_util = "grep"
#判断是否设置环境变量ANDROID_HOME
if "ANDROID_HOME" in os.environ:
if system == "Windows":
... | mit |
pawaranand/phrerp | erpnext/setup/doctype/item_group/test_item_group.py | 40 | 6965 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils.nestedset import NestedSetRecursionError, NestedSetMultipleRootsError, \
NestedSetChildExistsError, ... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.