repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
RWTH-OS/linux | scripts/gdb/linux/utils.py | 509 | 4833 | #
# gdb helper commands and functions for Linux kernel debugging
#
# common utilities
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
class CachedType:
def __init__(self, name):
s... | gpl-2.0 |
lxshopping/p2pool | wstools/UserTuple.py | 295 | 4047 | """
A more or less complete user-defined wrapper around tuple objects.
Adapted version of the standard library's UserList.
Taken from Stefan Schwarzer's ftputil library, available at
<http://www.ndh.net/home/sschwarzer/python/python_software.html>, and used under this license:
Copyright (C) 1999, Stefan Schwarzer ... | gpl-3.0 |
DueLaser/due_rasp | src/octoprint/util/comm_acc2.py | 2 | 41794 | # coding=utf-8
from __future__ import absolute_import
__author__ = "Florian Becker <florian@mr-beam.org> based on work by Gina Häußge and David Braam"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGP... | agpl-3.0 |
uncled1023/pygments | Pygments/pygments-lib/pygments/filter.py | 2 | 2038 | # -*- coding: utf-8 -*-
"""
pygments.filter
~~~~~~~~~~~~~~~
Module that implements the default filter.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
def apply_filters(stream, filters, lexer=None):
"""
Use this method to app... | bsd-2-clause |
vrv/tensorflow | tensorflow/python/kernel_tests/split_op_test.py | 11 | 10108 | # 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 |
nlevitt/youtube-dl | youtube_dl/extractor/sandia.py | 106 | 4090 | # coding: utf-8
from __future__ import unicode_literals
import itertools
import json
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
int_or_none,
js_to_json,
mimetype2ext,
unified_strdate,
)
class SandiaIE(Inf... | unlicense |
AOSP-S4-KK/platform_external_chromium_org | chrome/common/extensions/docs/server2/link_converter.py | 25 | 2973 | #!/usr/bin/env python
# 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.
# This script converts old-style <a> links to API docs to the new $ref links.
# See reference_resolver.py for more info on the form... | bsd-3-clause |
ksmaheshkumar/My-Gray-Hacker-Resources | Cryptography/Hash_Functions/MD5/MD4/md4.py | 5 | 3645 | # MD4 Python 2 implementation
# Copyright (C) 2013 Filippo Valsorda
#
# 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.
#... | mit |
f0rki/cb-multios | original-challenges/Sorter/poller/for-release/machine.py | 1 | 6612 | from generator.actions import Actions
import random
import string
import struct
import numpy as np
import math
import datetime as dt
import ctypes
def kaprica_mixin(self):
if hasattr(self, 'xlat_seed'):
return
def xlat_seed(seed):
def hash_string(seed):
H = 0x314abc86
f... | mit |
guptaankita/python-novaclient | novaclient/tests/unit/fixture_data/availability_zones.py | 5 | 3264 | # 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 |
rrah/PyLiteCo | setup.py | 1 | 5472 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Created by: python.exe -m py2exe -W setup.py win_service.py
from distutils.core import setup
import py2exe
class Target(object):
'''Target is the baseclass for all executables that are created.
It defines properties that are shared by all of them.
'''
def _... | gpl-2.0 |
elastic-coders/aiohttp | tests/test_client_connection.py | 6 | 2657 | import gc
import pytest
from unittest import mock
from aiohttp.connector import Connection
@pytest.fixture
def key():
return object()
@pytest.fixture
def connector():
return mock.Mock()
@pytest.fixture
def request():
return mock.Mock()
@pytest.fixture
def transport():
return mock.Mock()
@pytes... | apache-2.0 |
cgstudiomap/cgstudiomap | main/eggs/Python_Chart-1.39-py2.7.egg/pychart/afm/Helvetica_Bold.py | 12 | 1488 | # AFM font Helvetica-Bold (path: /usr/share/fonts/afms/adobe/phvb8a.afm).
# Derived from Ghostscript distribution.
# Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code.
import dir
dir.afm["Helvetica-Bold"] = (500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500,... | agpl-3.0 |
MrKriss/vigilance | vigilance/conditions.py | 1 | 1484 | #!/usr/bin/env python
""" The module conditions.py
Holds functions for testing statistical conditions on DataFrame rows or columns.
Author: cmusselle
"""
import numpy as np
def maha_dist(df):
"""Compute the squared Mahalanobis Distance for each row in the dataframe
Given a list of rows `x`, each with... | mit |
Djabbz/wakatime | wakatime/packages/pygments_py3/pygments/scanner.py | 135 | 3114 | # -*- coding: utf-8 -*-
"""
pygments.scanner
~~~~~~~~~~~~~~~~
This library implements a regex based scanner. Some languages
like Pascal are easy to parse but have some keywords that
depend on the context. Because of this it's impossible to lex
that just by using a regular expression lexer like ... | bsd-3-clause |
griffinqiu/airflow | airflow/hooks/hdfs_hook.py | 6 | 1572 | from airflow.hooks.base_hook import BaseHook
from airflow import configuration
try:
snakebite_imported = True
from snakebite.client import Client, HAClient, Namenode
except ImportError:
snakebite_imported = False
from airflow.utils import AirflowException
class HDFSHookException(AirflowException):
p... | apache-2.0 |
zasdfgbnm/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimator_test_utils.py | 81 | 2065 | # 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 |
Pablo126/SSBW | Tarea3/tarea3/lib/python3.5/site-packages/pip/_vendor/requests/status_codes.py | 481 | 3316 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... | gpl-3.0 |
hecrj/fast | fast/commands/base.py | 1 | 2092 | """
A command-line tool to test the optimizations performed to a program
"""
import os
from reticular import argument, say
from fast.benchmarks import load_benchmarks, get_benchmark
@argument('names', help='Names of the benchmarks to perform', action='append', nargs='?')
def checkpoint(names):
"""
Creates a c... | mit |
matte1/ardupilot | Tools/autotest/pysim/multicopter.py | 67 | 6374 | #!/usr/bin/env python
from aircraft import Aircraft
import util, time, math
from math import degrees, radians
from rotmat import Vector3, Matrix3
class Motor(object):
def __init__(self, angle, clockwise, servo):
self.angle = angle # angle in degrees from front
self.clockwise = clockwise # clockwis... | gpl-3.0 |
Codefans-fan/odoo | addons/point_of_sale/report/pos_details.py | 16 | 9331 | # -*- 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 |
benjello/openfisca-core | openfisca_core/tests/test_cycles.py | 1 | 5366 | # -*- coding: utf-8 -*-
from nose.tools import raises
from openfisca_core import periods
from openfisca_core.columns import IntCol
from openfisca_core.formulas import CycleError
from openfisca_core.variables import Variable
from openfisca_core.tests import dummy_country
from openfisca_core.tests.dummy_country import... | agpl-3.0 |
moocowmoo/pycoin | pycoin/scripts/tx.py | 1 | 25050 | #!/usr/bin/env python
from __future__ import print_function
import argparse
import calendar
import codecs
import datetime
import io
import os.path
import re
import subprocess
import sys
from pycoin.convention import tx_fee, satoshi_to_mbtc
from pycoin.encoding import hash160
from pycoin.key import Key
from pycoin.ke... | mit |
aurarad/auroracoin | qa/rpc-tests/p2p-acceptblock.py | 1 | 12427 | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import AuroracoinTestFramework
... | mit |
MadeiraCloud/salt | sources/salt/states/grains.py | 1 | 4672 | # -*- coding: utf-8 -*-
'''
Manage grains on the minion
===========================
This state allows for grains to be set.
Grains set or altered this way are stored in the 'grains'
file on the minions, by default at: /etc/salt/grains
Note: This does NOT override any grains set in the minion file.
'''
def present(n... | apache-2.0 |
marcore/edx-platform | common/lib/xmodule/xmodule/modulestore/store_utilities.py | 64 | 4611 | import re
import logging
from collections import namedtuple
import uuid
from xblock.core import XBlock
DETACHED_XBLOCK_TYPES = set(name for name, __ in XBlock.load_tagged_classes("detached"))
def _prefix_only_url_replace_regex(pattern):
"""
Match urls in quotes pulling out the fields from pattern
"""
... | agpl-3.0 |
michelleN/deployment-manager | cmd/expandybird/test/templates/python_template.py | 4 | 1802 | #% description: Creates a VM running a Salt master daemon in a Docker container.
#% parameters:
#% - name: masterAddress
#% type: string
#% description: Name of the Salt master VM.
#% required: true
#% - name: project
#% type: string
#% description: Name of the Cloud project.
#% required: true
#% - name: zo... | apache-2.0 |
robbiet480/home-assistant | homeassistant/components/growatt_server/sensor.py | 5 | 12763 | """Read status of growatt inverters."""
import datetime
import json
import logging
import re
import growattServer
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_NAME,
CONF_PASSWORD,
CONF_USERNAME,
ELECTRICAL_CURRENT_AMPERE,
... | apache-2.0 |
pec0ra/abricot | 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 |
hatstand/webcal-filter | lib/pytz/__init__.py | 44 | 34032 | '''
datetime.tzinfo timezone definitions generated from the
Olson timezone database:
ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
See the datetime section of the Python Library Reference for information
on how to use these modules.
'''
# The Olson database is updated several times a year.
OLSON_VERSION = '2015g'
VERSI... | mit |
jumpstarter-io/nova | nova/api/openstack/compute/contrib/rescue.py | 12 | 4195 | # Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
leppa/home-assistant | homeassistant/components/toon/climate.py | 3 | 4943 | """Support for Toon thermostat."""
import logging
from typing import Any, Dict, List, Optional
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
HVAC_MODE_HEAT,
PRESET_AWAY,
PRESET_COMFORT,
PRES... | apache-2.0 |
diegueus9/django-rest-framework-jwt | rest_framework_jwt/authentication.py | 1 | 3706 | import jwt
from django.contrib.auth.signals import user_logged_in
from django.utils.encoding import smart_text
from django.utils.translation import ugettext as _
from rest_framework import exceptions
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header
)
from rest_framework_jwt... | mit |
wistoch/meego-app-browser | chrome/test/functional/ui_perf_test_utils.py | 3 | 9822 | #!/usr/bin/python
# Copyright (c) 2011 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.
"""Module for performance testing using the psutil library.
Ref: http://code.google.com/p/psutil/wiki/Documentation
Most part of thi... | bsd-3-clause |
syci/l10n-spain | l10n_es_aeat_sii/wizards/send_first_semester.py | 7 | 2413 | # -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3).
from openerp import models, fields, api
SII_SEMESTER_DATE_INI = '2017-01-01'
SII_SEMESTER_DATE_END = '2017-06-30'
class L10nEsSiiFirstSemester(models.TransientModel):
_name = 'l10n.es.sii.first.semester'
date_to = fi... | agpl-3.0 |
walterst/qiime | tests/test_convert_fastaqual_fastq.py | 15 | 52110 | #!/usr/bin/env python
__author__ = "Adam Robbins-Pianka, Abhisaar Yadav"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Adam Robbins-Pianka", "Abhisaar Yadav", "Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Adam Robbins-Pianka"
__email__ = "adam.robbinspianka@co... | gpl-2.0 |
tjsavage/tmrwmedia | django/contrib/gis/tests/relatedapp/models.py | 274 | 1686 | from django.contrib.gis.db import models
from django.contrib.localflavor.us.models import USStateField
class Location(models.Model):
point = models.PointField()
objects = models.GeoManager()
def __unicode__(self): return self.point.wkt
class City(models.Model):
name = models.CharField(max_length=50)
... | bsd-3-clause |
heytcass/homeassistant-config | deps/sqlalchemy/sql/default_comparator.py | 7 | 10464 | # sql/default_comparator.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Default implementation of SQL comparison operations.
"""
from .. impor... | mit |
natefoo/ansible-modules-extras | system/facter.py | 72 | 1685 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@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... | gpl-3.0 |
kho0810/flaskr | lib/sqlalchemy/engine/__init__.py | 10 | 15923 | # engine/__init__.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""SQL connections, SQL execution and high-level DB-API interface.
The engine pa... | apache-2.0 |
sebdelsol/pyload | module/lib/bottle.py | 41 | 115481 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bottle is a fast and simple micro-framework for small web applications. It
offers request dispatching (Routes) with url parameter support, templates,
a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and
template engines - all in a single file an... | gpl-3.0 |
sachitanandpandey/sos_spandey | sos/plugins/pci.py | 2 | 1227 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but... | gpl-2.0 |
ptphp/PyLib | src/webpy/src/code.py | 1 | 1681 | #!/usr/bin/env python
#-*-coding:utf-8-*-
import web
import sys,logging
import config
urls = ("","reurl","/(.*)/","redirect","/ww(.*)","index")
render = web.template.render("templates/",cache = False)
app = web.application(urls,globals())
#===============================================================================... | apache-2.0 |
e-gun/HipparchiaServer | server/dbsupport/lexicaldbfunctions.py | 1 | 30487 | # -*- coding: utf-8 -*-
"""
HipparchiaServer: an interface to a database of Greek and Latin texts
Copyright: E Gunderson 2016-21
License: GNU GENERAL PUBLIC LICENSE 3
(see LICENSE in the top level directory of the distribution)
"""
import re
from typing import List
import psycopg2
from flask import session
from... | gpl-3.0 |
AthinaB/synnefo | snf-astakos-app/astakos/im/migrations/0016_auth_providers_and_projects.py | 10 | 26050 | # encoding: utf-8
import datetime
import uuid
from south.db import db
from south.v2 import DataMigration
from django.db import models
from django.core.validators import email_re
from django.conf import settings
class Migration(DataMigration):
def forwards(self, orm):
# valid activation_sent/email_verifi... | gpl-3.0 |
hflynn/bioformats | components/xsd-fu/python/generateDS/Demos/Outline/outline_extended.py | 33 | 2224 | #!/usr/bin/env python
#
# Generated Mon Aug 18 17:12:21 2003 by generateDS.py.
#
import sys
from xml.dom import minidom
import outline as supermod
#
# Support/utility functions.
#
def showIndent(outfile, level):
for idx in range(level):
outfile.write(' ')
class outlineSub(supermod.outline):
de... | gpl-2.0 |
lerouxb/seymour | thirdparty/pycaptcha/Captcha/Visual/Base.py | 3 | 2235 | """ Captcha.Visual.BAse
Base classes for visual CAPTCHAs. We use the Python Imaging Library
to manipulate these images.
"""
#
# PyCAPTCHA Package
# Copyright (C) 2004 Micah Dowty <micah@navi.cx>
#
import Captcha
import Image
__all__ = ['ImageCaptcha', 'Layer']
class ImageCaptcha(Captcha.BaseCaptcha):
"""Base c... | mit |
pwong-mapr/private-hue | desktop/core/ext-py/requests-2.0.0/requests/adapters.py | 28 | 13390 | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import socket
from .models import Response
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
from .packages.urllib3.response impo... | apache-2.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/babel/localtime/_win32.py | 82 | 2801 | try:
import _winreg as winreg
except ImportError:
try:
import winreg
except ImportError:
winreg = None
from babel.core import get_global
import pytz
tz_names = get_global('windows_zone_mapping')
def valuestodict(key):
"""Convert a registry key's values to a dictionary."""
dict =... | agpl-3.0 |
Eddy0402/Environment | vim/ycmd/ycmd/request_wrap.py | 28 | 3720 | #!/usr/bin/env python
#
# Copyright (C) 2014 Google Inc.
#
# YouCompleteMe 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.
#
# YouCompl... | gpl-3.0 |
anandpdoshi/erpnext | erpnext/selling/doctype/sales_order/sales_order.py | 1 | 22495 | # 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 json
import frappe.utils
from frappe.utils import cstr, flt, getdate, comma_and, cint
from frappe import _
from frappe.model.mapper... | agpl-3.0 |
benjaoming/kolibri | kolibri/utils/cli.py | 1 | 20860 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import importlib # noqa
import logging # noqa
import os # noqa
import signal # noqa
import sys # noqa
from sqlite3 import DatabaseError as SQLite3DatabaseError # noqa
import django # noqa
from d... | mit |
TeamExodus/external_chromium_org | tools/usb_gadget/usb_descriptors_test.py | 95 | 6817 | #!/usr/bin/python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import hid_constants
import usb_descriptors
class DescriptorWithField(usb_descriptors.Descriptor):
pass
DescriptorWit... | bsd-3-clause |
CrowdStrike/cs.eyrie | cs/eyrie/transistor/drain.py | 1 | 14820 | import zmq
from collections import namedtuple
from cs.eyrie.config import INITIAL_TIMEOUT, MAX_TIMEOUT
from cs.eyrie.interfaces import IDrain, IKafka
from cs.eyrie.transistor import (
CLOSED, CLOSING, RUNNING, TRANSIENT_ERRORS,
SQSError,
)
from cs.eyrie.transistor.source import (
KafkaMessage,
)
from dateti... | bsd-2-clause |
clawpack/adjoint | examples/acoustics_2d_radial_walls/compare/setrun.py | 1 | 14088 | """
Module to set up run time parameters for Clawpack.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import os
import numpy as np
#-----------------------------------------------
# Set these parameters for adjoint flagging....
# location... | bsd-2-clause |
grengojbo/satchmo | satchmo/apps/product/views/filters.py | 12 | 1481 | from django import http
from django.core.paginator import Paginator, InvalidPage
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
from livesettings import config_value
from product.models import Product
from product.queries import bestsellers
import logging
... | bsd-3-clause |
unseenlaser/python-for-android | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_execfile.py | 175 | 1990 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for execfile.
This converts usages of the execfile function into calls to the built-in
exec() function.
"""
from .. import fixer_base
from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node,
... | apache-2.0 |
LukasSlouka/MindMapper | mind_mapper/models/project.py | 3 | 1649 | from mind_mapper.models import Model
from mind_mapper.models.edge import Edge
from mind_mapper.models.node import Node
import re
class Project(Model):
def __init__(self):
self.nodes = {}
self.edges = {}
self.workspace_width = 800
self.workspace_height = 600
def append(self, l... | mit |
T2DREAM/t2dream-portal | src/encoded/upgrade/analysis_step_run.py | 1 | 1124 | from snovault import (
ROOT,
upgrade_step,
)
'''
This upgrade is no longer needed but just kept for posterity. It no longer works after versionof: was removed as
a valid namespace in aliases. See http://redmine.encodedcc.org/issues/4748
@upgrade_step('analysis_step_run', '1', '2')
def analysis_step_run_1_2(va... | mit |
raziel057/FrameworkBenchmarks | toolset/travis/travis_diff.py | 16 | 5304 | #!/usr/bin/env python
# @file: toolset/travis/travis_diff.py
# @author: Nate Brady
# @description: This script is only for use within Travis-CI. It is meant to look through the commit history
# and determine whether or not the current framework test directory needs to be run.
#
# Notes: This script will ... | bsd-3-clause |
direvus/ansible | lib/ansible/modules/network/nxos/nxos_l3_interface.py | 41 | 7076 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
paulsoh/moxie | moxie/social/apps/flask_app/routes.py | 38 | 1614 | from flask import g, Blueprint, request
from flask.ext.login import login_required, login_user
from social.actions import do_auth, do_complete, do_disconnect
from social.apps.flask_app.utils import psa
social_auth = Blueprint('social', __name__)
@social_auth.route('/login/<string:backend>/', methods=('GET', 'POST'... | mit |
govarguz/espressopp | contrib/mpi4py/mpi4py-2.0.0/test/test_cco_nb_buf.py | 8 | 26348 | from mpi4py import MPI
import mpiunittest as unittest
import arrayimpl
from functools import reduce
prod = lambda sequence,start=1: reduce(lambda x, y: x*y, sequence, start)
def maxvalue(a):
try:
typecode = a.typecode
except AttributeError:
typecode = a.dtype.char
if typecode == ('f'):
... | gpl-3.0 |
catlee/hashsync | hashsync/utils.py | 1 | 1873 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
import calendar
import time
import email.utils
from functools import partial
import os
import logging
log = logging.getLogger(__name__)
# The SHA-1 hash of zero bytes
SHA1SUM_ZERO = 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
def traverse_directory(dirname... | bsd-3-clause |
LLNL/spack | var/spack/repos/builtin/packages/nyancat/package.py | 5 | 1416 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Nyancat(MakefilePackage):
"""Nyancat in your terminal, rendered through ANSI escape sequenc... | lgpl-2.1 |
captainpete/rethinkdb | test/rql_test/connections/http_support/jinja2/__init__.py | 256 | 2270 | # -*- coding: utf-8 -*-
"""
jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
Django inspired non-XML syntax but supports inline expressions and
an optional sandboxed environment.
Nutshell
--------
Here a small example of a Jinja2 template::
{% ... | agpl-3.0 |
JStheguy/tgstation | tools/HitboxExpander/hitbox_expander.py | 206 | 2697 | import os
import sys
import inspect
import shutil
def AddToPath(path):
if path not in sys.path:
sys.path.insert(0, path)
delimeter = ':' if os.name == "posix" else ";"
os.environ['PATH'] = path + delimeter + os.environ['PATH']
current_dir = os.path.split(inspect.getfile(inspect.currentframe()... | agpl-3.0 |
SohKai/ChronoLogger | web/flask/lib/python2.7/site-packages/openid/store/interface.py | 180 | 7083 | """
This module contains the definition of the C{L{OpenIDStore}}
interface.
"""
class OpenIDStore(object):
"""
This is the interface for the store objects the OpenID library
uses. It is a single class that provides all of the persistence
mechanisms that the OpenID library needs, for both servers and
... | mit |
40423143/2016fallcadp_hw | plugin/liquid_tags/test_flickr.py | 278 | 2466 | from . import flickr
try:
from unittest.mock import patch
except ImportError:
from mock import patch
import os
import pytest
import re
PLUGIN_DIR = os.path.dirname(__file__)
TEST_DATA_DIR = os.path.join(PLUGIN_DIR, 'test_data')
@pytest.mark.parametrize('input,expected', [
('18873146680 large "test 1"',
... | gpl-3.0 |
LockScreen/Backend | venv/lib/python2.7/site-packages/gunicorn/workers/gthread.py | 28 | 11637 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
# design:
# a threaded worker accepts connections in the main loop, accepted
# connections are are added to the thread pool as a connection job. On
# keepalive connections are put back in the ... | mit |
wiggi/huntercore | qa/rpc-tests/assumevalid.py | 45 | 7764 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
assumevalid.py
Test logic for skipping signature validation on blocks which we've assumed
valid (http... | mit |
HuygensING/bioport-repository | bioport_repository/datamanipulation/nnbw_and_vdaa_matches.py | 1 | 4354 | #!/usr/bin/env python
##########################################################################
# Copyright (C) 2009 - 2014 Huygens ING & Gerbrandy S.R.L.
#
# This file is part of bioport.
#
# bioport is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
#... | gpl-3.0 |
luistorresm/odoo | addons/portal_project_issue/__openerp__.py | 375 | 1713 | # -*- 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 |
alanjw/GreenOpenERP-Win-X86 | python/Lib/test/test_whichdb.py | 10 | 1867 | #! /usr/bin/env python
"""Test script for the whichdb module
based on test_anydbm.py
"""
import os
import test.test_support
import unittest
import whichdb
import glob
_fname = test.test_support.TESTFN
# Silence Py3k warning
anydbm = test.test_support.import_module('anydbm', deprecated=True)
def _... | agpl-3.0 |
dmccloskey/SBaaS_MFA | SBaaS_MFA/stage02_isotopomer_fittedFluxRatios_execute.py | 1 | 4023 | #SBaaS
from .stage02_isotopomer_fittedFluxRatios_io import stage02_isotopomer_fittedFluxRatios_io
from .stage02_isotopomer_fittedFluxRatios_postgresql_models import *
#Resources
from genomeScale_MFA.MFA_methods import MFA_methods
class stage02_isotopomer_fittedFluxRatios_execute(stage02_isotopomer_fittedFluxRatios_io)... | mit |
codeofdusk/ProjectMagenta | src/platform_utils/libloader.py | 3 | 1334 | import ctypes
import collections
import platform
import os
TYPES = {
'Linux': {
'loader': ctypes.CDLL,
'functype': ctypes.CFUNCTYPE,
'prefix': 'lib',
'extension': '.so'
},
'Darwin': {
'loader': ctypes.CDLL,
'functype': ctypes.CFUNCTYPE,
'prefix': 'lib',
'extension': '.dylib'
},
}
if platform.system... | gpl-2.0 |
chronicwaffle/PokemonGo-DesktopMap | app/pylibs/win32/Cryptodome/SelfTest/Cipher/test_ChaCha20.py | 2 | 8491 | # ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redi... | mit |
BrakeValve/brake-valve-server | data-preprocessor/preprocessor.py | 2 | 5153 | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 08 16:16:41 2016
@author: SISQUAKE
"""
from optparse import OptionParser
import os
from Game import Game
import datetime
from listFile import listFilePath
# def main():
METADATA_DIRECTORY = '../../new_meta'
PRICE_DATA_DIRECTORY = '../../price_data'
TRAINING_OUTPUT_DIREC... | mit |
SOKP/external_chromium_org | build/copy_test_data_ios.py | 206 | 3233 | #!/usr/bin/env python
# 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.
"""Copies test data files or directories into a given output directory."""
import optparse
import os
import shutil
import sys
cla... | bsd-3-clause |
skg-net/ansible | lib/ansible/modules/network/aci/aci_epg_to_domain.py | 10 | 12494 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
johankaito/fufuka | microblog/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py | 1010 | 4507 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from ntlm import ntlm
from urllib3 import HTT... | apache-2.0 |
vaginessa/pyload | module/plugins/hoster/DlFreeFr.py | 13 | 4583 | # -*- coding: utf-8 -*-
import pycurl
import re
from module.network.Browser import Browser
from module.network.CookieJar import CookieJar
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, replace_patterns
class CustomBrowser(Browser):
def __init__(self, bucket=None, options={}):
... | gpl-3.0 |
Rhoana/butterfly2 | butterfly/butterfly.py | 1 | 6140 | from UtilityLayer import *
from Webserver import Webserver
import DatabaseLayer
import sys, argparse
import logging
import json
import os
class Butterfly():
'''
Butterfly 2.0
EM Data server
2017 VCG + Lichtman Lab
'''
log_info = {
'filename': 'bfly.log',
'level': logging.INFO
... | mit |
carolineLe/miasm | miasm/analysis/gdbserver.py | 4 | 14342 | #-*- coding:utf-8 -*-
from __future__ import print_function
from future.builtins import map, range
from miasm.core.utils import decode_hex, encode_hex, int_to_byte
import socket
import struct
import time
import logging
from io import BytesIO
import miasm.analysis.debugging as debugging
from miasm.jitter.jitload impo... | gpl-2.0 |
sephiroth6/nodeshot | nodeshot/interop/sync/tests.py | 2 | 28282 | import sys
from cStringIO import StringIO
from django.test import TestCase
from django.core import management
from django.core.urlresolvers import reverse
from django.core.exceptions import ValidationError
from django.contrib.gis.geos import Point, GEOSGeometry
from nodeshot.core.layers.models import Layer
from node... | gpl-3.0 |
beezee/GAE-Django-base-app | django/contrib/admindocs/utils.py | 314 | 3796 | "Misc. utility functions/classes for admin documentation generator."
import re
from email.Parser import HeaderParser
from email.Errors import HeaderParseError
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from django.utils.encoding import smart_str
try:
import docutils.... | bsd-3-clause |
joeythesaint/yocto-autobuilder | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/process/subunitlogobserver.py | 8 | 4296 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
jordanemedlock/psychtruths | temboo/core/Library/Google/ComputeEngine/ZoneOperations/ListZoneOperations.py | 5 | 6249 | # -*- coding: utf-8 -*-
###############################################################################
#
# ListZoneOperations
# Retrieves the list of Zone Operation resources contained within the specified Zone.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, V... | apache-2.0 |
DolphinDream/sverchok | nodes/curve/line.py | 2 | 3751 |
import numpy as np
import bpy
from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nesting_level, throttle_and_update_node
from sverchok.utils.curve import SvLine
class... | gpl-3.0 |
insiderr/insiderr-app | ios-patches/basemodules/Crypto/SelfTest/Hash/test_MD4.py | 116 | 2368 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/MD4.py: Self-test for the MD4 hash function
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication ... | gpl-3.0 |
koying/SPMC | lib/libUPnP/Neptune/Build/Tools/SCons/gcc-generic.py | 199 | 1249 | import os
def generate(env, gcc_cross_prefix=None, gcc_strict=True, gcc_stop_on_warning=None):
if gcc_stop_on_warning == None: gcc_stop_on_warning = env['stop_on_warning']
### compiler flags
if gcc_strict:
env.AppendUnique(CCFLAGS = ['-pedantic', '-Wall', '-W', '-Wundef', '-Wno-long-long'])
... | gpl-2.0 |
LaoZhongGu/kbengine | kbe/src/lib/python/Lib/xml/dom/pulldom.py | 50 | 11843 | import xml.sax
import xml.sax.handler
import types
START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
COMMENT = "COMMENT"
START_DOCUMENT = "START_DOCUMENT"
END_DOCUMENT = "END_DOCUMENT"
PROCESSING_INSTRUCTION = "PROCESSING_INSTRUCTION"
IGNORABLE_WHITESPACE = "IGNORABLE_WHITESPACE"
CHARACTERS = "CHARACTERS"
c... | lgpl-3.0 |
pjdelport/django | django/contrib/localflavor/ch/forms.py | 101 | 3963 | """
Swiss-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.contrib.localflavor.ch.ch_states import STATE_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
f... | bsd-3-clause |
chenhh/PySPPortfolio | PySPPortfolio/pysp_portfolio/exp_cvar.py | 1 | 38832 | # -*- coding: utf-8 -*-
"""
Authors: Hung-Hsin Chen <chenhh@par.cse.nsysu.edu.tw>
License: GPL v2
"""
import os
from time import time
import numpy as np
import pandas as pd
from PySPPortfolio.pysp_portfolio import *
from min_cvar_sp import (MinCVaRSPPortfolio, MinCVaRSPPortfolio2 )
from min_cvar_sip import (MinCVaRSIP... | gpl-3.0 |
ChrisBeaumont/luigi | doc/conf.py | 17 | 9335 | # -*- coding: utf-8 -*-
#
# Luigi documentation build configuration file, created by
# sphinx-quickstart on Sat Feb 8 00:56:43 2014.
#
# 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... | apache-2.0 |
leighpauls/k2cro4 | third_party/trace-viewer/third_party/closure_linter/closure_linter/fixjsstyle.py | 139 | 1741 | #!/usr/bin/env python
# python2.6 for command-line runs using p4lib. pylint: disable-msg=C6301
#
# Copyright 2007 The Closure Linter 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 co... | bsd-3-clause |
microdee/IronHydra | src/IronHydra/Lib/lib2to3/fixes/fix_sys_exc.py | 327 | 1039 | """Fixer for sys.exc_{type, value, traceback}
sys.exc_type -> sys.exc_info()[0]
sys.exc_value -> sys.exc_info()[1]
sys.exc_traceback -> sys.exc_info()[2]
"""
# By Jeff Balogh and Benjamin Peterson
# Local imports
from .. import fixer_base
from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms
clas... | mit |
MusculoskeletalAtlasProject/mapclient | src/mapclientplugins/imagesourcestep/widgets/ui_configuredialog.py | 3 | 7555 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'qt/configuredialog.ui'
#
# Created: Fri Sep 5 07:45:48 2014
# by: pyside-uic 0.2.15 running on PySide 1.2.1
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_ConfigureDialog(object):
... | gpl-3.0 |
google-code-export/pyglet | contrib/wydget/wydget/widgets/movie.py | 29 | 6591 | from pyglet.gl import *
from pyglet.window import mouse
from pyglet import media, clock
from wydget import element, event, util, data, layouts, anim
from wydget.widgets.frame import Frame
from wydget.widgets.label import Image, Label
from wydget.widgets.button import Button
class Movie(Frame):
name='movie'
de... | bsd-3-clause |
LBenzahia/cltk | cltk/tests/test_languages/test_middle_high_german.py | 2 | 5663 | """Test Middle High German"""
import unittest
import unicodedata
from cltk.corpus.middle_high_german.alphabet import normalize_middle_high_german
from cltk.stem.middle_high_german.stem import stemmer_middle_high_german as middle_high_german_stemmer
from cltk.stop.middle_high_german.stops import STOPS_LIST as MIDDLE_H... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.