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 |
|---|---|---|---|---|---|
dmateusp/PokemonGo-Bot | pokemongo_bot/inventory.py | 1 | 40711 | import json
import logging
import os
from collections import OrderedDict
from pokemongo_bot.base_dir import _base_dir
'''
Helper class for updating/retrieving Inventory data
Interesting info and formulas:
https://drive.google.com/file/d/0B0TeYGBPiuzaenhUNE5UWnRCVlU/view
https://www.reddit.com/r/pokemongodev/comments... | mit |
quamilek/django | django/utils/termcolors.py | 260 | 7480 | """
termcolors.py
"""
from django.utils import six
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink... | bsd-3-clause |
csrocha/OpenUpgrade | openerp/addons/base/tests/test_uninstall.py | 175 | 2660 | # -*- coding: utf-8 -*-
# This assumes an existing but uninitialized database.
import unittest2
import openerp
from openerp import SUPERUSER_ID
import common
DB = common.DB
ADMIN_USER_ID = common.ADMIN_USER_ID
def registry(model):
return openerp.modules.registry.RegistryManager.get(DB)[model]
def cursor():
... | agpl-3.0 |
watchamakulit02/namebench | tools/check_nameserver_popularity.py | 174 | 2456 | #!/usr/bin/env python
import os
import re
import sys
import pickle
import time
import traceback
import yahoo.search
from yahoo.search.web import WebSearch
APP_ID = 'P5ihFKzV34G69QolFfb3nN7p0rSsYfC9tPGq.IUS.NLWEeJ14SG9Lei0rwFtgwL8cDBrA6Egdw--'
QUERY_MODIFIERS = '-site:txdns.net -site:sitedossier.com -mx -site:dataopedi... | apache-2.0 |
JioCloud/cinder | cinder/scheduler/filters/instance_locality_filter.py | 25 | 5098 | # -*- coding: utf-8 -*-
# Copyright 2014, Adrien Vergé <adrien.verge@numergy.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 obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
driesdesmet/django-cms | cms/tests/page.py | 1 | 26525 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.admin.forms import PageForm
from cms.api import create_page
from cms.models import Page, Title
from cms.models.placeholdermodel import Placeholder
from cms.models.pluginmodel import CMSPlugin
from cms.plugins.text.models import Text
from cms.sitemap... | bsd-3-clause |
ge0rgi/cinder | cinder/tests/unit/test_volume.py | 1 | 340029 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
shigin/radist | radist/helpers.py | 1 | 5176 | import os, sys
import socket
import pty
import pwd
import subprocess
import exceptions
__all__ = ['r_exec', 'r_popen2', 'r_popen3']
PATH = os.environ['PATH'].split(os.path.pathsep) + ['/usr/local/radist/bin/']
def find_in_path(file, search_path=PATH):
for path in search_path:
c_file = os.path.join(path, ... | bsd-2-clause |
zidootech/zidoo-kodi-15.1 | lib/gtest/test/gtest_help_test.py | 2968 | 5856 | #!/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... | gpl-2.0 |
40223211/w16b_test | static/Brython3.1.1-20150328-091302/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."""
... | agpl-3.0 |
neeasade/qutebrowser | scripts/dev/src2asciidoc.py | 4 | 18512 | #!/usr/bin/env python3
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | gpl-3.0 |
anthonycodes/Python-Scripts | scp/0.3/scp.py | 1 | 1637 | # Steganography Cypher Program
# Made by AnthonyCodes
# Source Code: https://github.com/anthonycodes/Python-Scripts/tree/master/scp/
# Imports
import config as conf
import api as appapi
from sys import argv, exit
# Variables
unsecure = conf.unsecure
# Functions
def getstring():
try: arg = argv[1]
ex... | mit |
imzers/gsutil-with-php | gslib/daisy_chain_wrapper.py | 26 | 11679 | # -*- coding: utf-8 -*-
# Copyright 2014 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 require... | apache-2.0 |
colinnewell/odoo | addons/account/edi/invoice.py | 342 | 13984 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
kartikdhar/djangotest | virt1/lib/python2.7/site-packages/django/db/backends/mysql/introspection.py | 81 | 8902 | from collections import namedtuple
from MySQLdb.constants import FIELD_TYPE
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.utils.datastructures import OrderedSet
from django.utils.encoding import force_text
FieldInfo = namedtuple('FieldInfo', Fi... | mit |
ltilve/ChromiumGStreamerBackend | tools/telemetry/third_party/gsutilz/third_party/boto/boto/datapipeline/__init__.py | 141 | 1662 | # 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 |
LSIR/gsn | gsn-extra/src/monitoring-plugin/munin/gsn-munin.py | 3 | 1854 | #!/usr/bin/python
import urllib
import sys
from collections import defaultdict
def main():
f = urllib.urlopen("http://127.0.0.1:22001/stat")
r = f.read().splitlines()
if len(sys.argv) < 2:
data(r)
if sys.argv[1] == "config":
groups = defaultdict(list)
for k in r:
... | gpl-3.0 |
HwisooSo/gemV-update | src/arch/x86/isa/insts/x87/data_transfer_and_conversion/load_or_store_floating_point.py | 65 | 3563 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
pkg-ime/ibus | ibus/interface/iibus.py | 2 | 2579 | # vim:set et sts=4 sw=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2007-2010 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Sof... | lgpl-2.1 |
TaskEvolution/Task-Coach-Evolution | taskcoach/taskcoachlib/thirdparty/xhtml2pdf/xhtml2pdf_reportlab.py | 14 | 31590 | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 ... | gpl-3.0 |
laperry1/android_external_chromium_org | tools/perf/page_sets/alexa1-10000.py | 34 | 666264 | # 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.
from telemetry.page.page_set import PageSet
from telemetry.page.page import Page
class Alexa1To10000Page(Page):
def __init__(self, url, page_set):
su... | bsd-3-clause |
garciasolero/oauthlib | tests/oauth1/rfc5849/endpoints/test_base.py | 27 | 16073 | from __future__ import unicode_literals, absolute_import
from mock import MagicMock
from re import sub
from ....unittest import TestCase
from oauthlib.common import safe_string_equals
from oauthlib.oauth1 import Client, RequestValidator
from oauthlib.oauth1.rfc5849 import errors, SIGNATURE_RSA, SIGNATURE_HMAC
from oa... | bsd-3-clause |
felipebetancur/omim | data/benchmarks/cmd_results_viewer.py | 53 | 2305 | import math
import sys
f1 = open(sys.argv[2], "r")
lns1 = f1.readlines()
lns1 = [l.split(" ") for l in lns1]
bench_cfg = {}
for l in lns1:
c_name = l[1]
is_country = (len(l) == 3)
bench_cfg[l[1]] = []
bench_cfg[l[1]].append(is_country)
if len(l) > 0:
if not is_country:
bench... | apache-2.0 |
CongSmile/avocado-vt | virttest/step_editor.py | 4 | 50724 | #!/usr/bin/python
"""
Step file creator/editor.
:copyright: Red Hat Inc 2009
:author: mgoldish@redhat.com (Michael Goldish)
"""
import os
import glob
import shutil
import sys
import logging
import pygtk
import gtk
import ppm_utils
pygtk.require('2.0')
# General utilities
def corner_and_size_clipped(startpoint, ... | gpl-2.0 |
credativUK/OCB | openerp/report/pyPdf/utils.py | 123 | 3979 | # vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2006, Mathieu Fenniak
# 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 abov... | agpl-3.0 |
mhogg/pyvct | pyvct/pyvCT_plugin.py | 1 | 11088 | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Michael Hogg
# This file is part of pyvCT - See LICENSE.txt for information on usage and redistribution
from abaqusGui import *
from abaqusConstants import ALL, CARTESIAN, SCALAR, INTEGRATION_POINT, CENTROID, ELEMENT_NODAL
from pyvCT_version import version as __version__
... | mit |
catchmrbharath/servo | tests/wpt/css-tests/css-text-decor-3_dev/html/support/generate-text-emphasis-ruby-tests.py | 829 | 3042 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-ruby-001 ~ 004 which tests
emphasis marks with ruby in four directions. It outputs a list of all
tests it generated in the format of Mozilla reftest.list to the stdout.
"""
from __future__ import unicode_literals
TEST_FIL... | mpl-2.0 |
mogoweb/chromium-crosswalk | tools/deep_memory_profiler/lib/policy.py | 48 | 12592 | # 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.
import json
import logging
import os
import re
LOGGER = logging.getLogger('dmprof')
BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))... | bsd-3-clause |
xiamike/stanford-ctc | ctc/runNNet.py | 2 | 5741 | import optparse
import numpy as np
import gnumpy as gp
import cPickle as pickle
import sgd
import nnet, rnnet
import dataLoader as dl
#gp.board_id_to_use = 0
def run(args=None):
usage = "usage : %prog [options]"
parser = optparse.OptionParser(usage=usage)
parser.add_option("--test",action="store_true",d... | apache-2.0 |
pixbuffer/django-cms | cms/plugins/video/models.py | 12 | 2880 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models import CMSPlugin
from cms.plugins.video import settings
from os.path import basename
class Video(CMSPlugin):
# player settings
movie = models.FileField(_('movie file'), upload_to=CMSPlugin.get_media_path, help_... | bsd-3-clause |
ArthurGarnier/SickRage | lib/urllib3/util/ssl_.py | 87 | 12208 | from __future__ import absolute_import
import errno
import warnings
import hmac
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning
SSLContext = None
HAS_SNI = False
IS_PYOPENSSL = False
IS_SECURETRANSPORT = Fals... | gpl-3.0 |
MyKings/xunfeng | vulscan/vuldb/smb/base.py | 3 | 143498 |
import logging, binascii, time, hmac
from datetime import datetime
from smb_constants import *
from smb2_constants import *
from smb_structs import *
from smb2_structs import *
from nmb.base import NMBSession
from utils import convertFILETIMEtoEpoch
import ntlm, securityblob
try:
import hashlib
sha256 = hashl... | gpl-3.0 |
switowski/invenio | invenio/legacy/bibcheck/plugins/utf8.py | 17 | 1177 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | gpl-2.0 |
rodelrod/putsches | askbot/migrations/0062_transplant_question_closed_fields.py | 17 | 28169 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Thread.closed'
db.add_column('askbot_thread', 'closed', self.gf('django.db.models.fields.B... | gpl-3.0 |
Shrulik/Open-Knesset | mks/admin.py | 7 | 3764 | from django.contrib import admin
from django.contrib.contenttypes import generic
from django.db.models import Q
from models import Member, Membership, MemberAltname
from models import CoalitionMembership, Correlation, Party, \
Award, AwardType, Knesset
from links.models import Link
from video.models import Video
f... | bsd-3-clause |
ktnyt/chainer | examples/memnn/test_memnn.py | 2 | 2072 | #!/usr/bin/env python
import argparse
import numpy
import babi
import memnn
def main():
parser = argparse.ArgumentParser(
description='Chainer example: End-to-end memory networks')
parser.add_argument('MODEL',
help='Path to model directory specified with `-m` '
... | mit |
openmotics/gateway | src/gateway/api/serializers/ventilation.py | 1 | 4596 | # Copyright (C) 2020 OpenMotics BV
#
# 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 Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribu... | agpl-3.0 |
2014c2g4/w16b_test | static/Brython3.1.0-20150301-090019/Lib/_dummy_thread.py | 742 | 4769 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... | gpl-3.0 |
AVGInnovationLabs/DoNotSnap | train.py | 1 | 4886 | import cv2
import sys
import pickle
import numpy as np
import matplotlib.pyplot as plt
from AffineInvariantFeatures import AffineInvariant
from TemplateMatcher import TemplateMatch, Templates
from PIL import Image
from itertools import izip_longest
from sklearn.cross_validation import train_test_split
from sklearn.g... | gpl-3.0 |
sassystacks/DASS | Drone_Flight/ned_Test_roll.py | 1 | 3898 | from dronekit import connect, VehicleMode, LocationGlobal, LocationGlobalRelative
from pymavlink import mavutil # Needed for command message definitions
import logging
import time
import math
logging.basicConfig(filename='Roll_log.log', format = '%(levelname)s:%(asctime)s: %(message)s', level=logging.INFO)
im... | mit |
PeterDaveHello/eden | static/scripts/tools/import_supply_item_ifrc_standard.py | 19 | 1862 | # Script to import all
#
# run as python web2py.py -S eden -M -R applications/eden/static/scripts/tools/import_supply_item_ifrc_standard.py -A complete
#
# Equivalent to PrePop:
# supply,item_category,supply_item_category_ifrc_standard.csv,item_category_ifrc_standard.xsl
# supply,item,supply_item_ifrc_standard.csv, ite... | mit |
ed-/solum | solum/tests/test_db_manage.py | 5 | 2373 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | apache-2.0 |
chenyujie/hybrid-murano | murano/api/v1/actions.py | 1 | 3706 | # Copyright (c) 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
samithaj/headphones | lib/mako/ext/babelplugin.py | 60 | 2064 | # ext/babelplugin.py
# Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""gettext message extraction via Babel: http://babel.edgewall.org/"""
from babel.messages.extr... | gpl-3.0 |
yevgeniy-logachev/CATB15Kernel | kernel/scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
mitsei/dlkit | tests/commenting/test_objects.py | 1 | 27143 | """Unit tests of commenting objects."""
import pytest
from ..utilities.general import is_never_authz, is_no_authz, uses_cataloging, uses_filesystem_only
from dlkit.abstract_osid.commenting import objects as ABCObjects
from dlkit.abstract_osid.id.primitives import Id as ABC_Id
from dlkit.abstract_osid.locale.primiti... | mit |
michael-dev2rights/ansible | lib/ansible/modules/storage/infinidat/infini_vol.py | 29 | 4232 | #!/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 |
no2a/ansible | test/units/module_utils/basic/test_heuristic_log_sanitize.py | 99 | 3815 | # -*- coding: utf-8 -*-
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | gpl-3.0 |
rexyeah/jira-cli | jiracli/processor.py | 1 | 9984 | """
"""
from abc import ABCMeta, abstractmethod
import six
from jiracli.cli import colorfunc
from jiracli.errors import UsageError, UsageWarning
from jiracli.utils import get_text_from_editor, print_output
@six.add_metaclass(ABCMeta)
class Command(object):
def __init__(self, jira, args):
self.args = ar... | mit |
mirsys/amlogic_kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
poljeff/odoo | addons/website_gengo/controllers/main.py | 350 | 1799 | # -*- coding: utf-8 -*-
import openerp
from openerp import http, SUPERUSER_ID
from openerp.http import request
import time
GENGO_DEFAULT_LIMIT = 20
class website_gengo(http.Controller):
@http.route('/website/get_translated_length', type='json', auth='user', website=True)
def get_translated_length(self, tran... | agpl-3.0 |
ToonTownInfiniteRepo/ToontownInfinite | toontown/toon/NPCFriendPanel.py | 3 | 9972 | from direct.gui.DirectGui import *
from direct.directnotify import DirectNotifyGlobal
from pandac.PandaModules import *
import NPCToons
import ToonHead
import ToonDNA
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import ToontownBattleGlobals
from toontown... | mit |
parksandwildlife/static | static/firesource/static/admin/js/compress.py | 784 | 1896 | #!/usr/bin/env python
import os
import optparse
import subprocess
import sys
here = os.path.dirname(__file__)
def main():
usage = "usage: %prog [file1..fileN]"
description = """With no file paths given this script will automatically
compress all jQuery-based files of the admin app. Requires the Google Closure... | apache-2.0 |
liw/daos | src/tests/ftest/datamover/dm_copy_procs.py | 1 | 3305 | #!/usr/bin/python
'''
(C) Copyright 2020-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
from data_mover_test_base import DataMoverTestBase
from os.path import join
class DmvrCopyProcs(DataMoverTestBase):
# pylint: disable=too-many-ancestors
"""Test class for POSIX DataMover mult... | apache-2.0 |
y12uc231/edx-platform | common/djangoapps/util/models.py | 56 | 2768 | """Models for the util app. """
import cStringIO
import gzip
import logging
from django.db import models
from django.db.models.signals import post_init
from django.utils.text import compress_string
from config_models.models import ConfigurationModel
logger = logging.getLogger(__name__) # pylint: disable=invalid-na... | agpl-3.0 |
zzir/white | verificationcode.py | 1 | 2611 | from PIL import Image,ImageDraw, ImageFont, ImageFilter
import random
class VerifyCode():
def __init__(self):
self._letter_cases = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNOPRSTUVWXYZ3456789'
self._upper_cases = self._letter_cases.upper()
self._numbers = ''.join(map(str, range(3, 10)))
de... | mit |
foursquare/luigi | luigi/contrib/ecs.py | 4 | 6469 | # -*- coding: utf-8 -*-
#
# Copyright 2015 Outlier Bio, 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 la... | apache-2.0 |
kennedyshead/home-assistant | homeassistant/helpers/json.py | 3 | 1132 | """Helpers to help with encoding Home Assistant objects in JSON."""
from datetime import datetime, timedelta
import json
from typing import Any
class JSONEncoder(json.JSONEncoder):
"""JSONEncoder that supports Home Assistant objects."""
def default(self, o: Any) -> Any:
"""Convert Home Assistant obje... | apache-2.0 |
daanwierstra/pybrain | pybrain/rl/learners/blackboxoptimizers/evolution/nsga2.py | 1 | 7825 | from scipy import array
from pybrain.rl.learners.blackboxoptimizers.evolution.ga import GA
import collections
__author__ = 'Justin Bayer, Tom Schaul, {justin,tom}@idsia.ch'
# TODO: not very elegant, because of the conversions between tuples and arrays all the time...
class MultiObjectiveGA(GA):
""" Multi-objecti... | bsd-3-clause |
cualbondi/cualbondi.com.ar | settings.py | 1 | 11882 | # Django settings for cualbondi project.
import os
CUALBONDI_ENV = os.environ.get('CUALBONDI_ENV', 'development')
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['*',]
LOGIN_REDIRECT_URL = '/'
ABSOLUTE_URL_OVERRIDES = {
'auth.user': lambda u: "/usuarios/%s/" % u.username,
}
ADMINS = (
# ('Your Name'... | agpl-3.0 |
rhomobi/node-gyp | gyp/pylib/gyp/generator/cmake.py | 531 | 41681 | # 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.
"""cmake output module
This module is under development and should be considered experimental.
This module produces cmake (2.8.8+) input as its output. One CMake... | mit |
mguentner/tomahawk | thirdparty/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/wire_format.py | 561 | 8431 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | gpl-3.0 |
fw1121/genomics | docs/source/conf.py | 2 | 7884 | # -*- coding: utf-8 -*-
#
# genomics-bcftbx documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 19 12:09:50 2015.
#
# 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.... | artistic-2.0 |
codepantry/django | django/shortcuts.py | 129 | 7958 | """
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
import warnings
from django.core import urlresolvers
from django.db.models.base import ModelBase
from django.db.models.manager imp... | bsd-3-clause |
akretion/l10n-brazil | l10n_br_account_product/sped/nfe/document.py | 1 | 38700 | # -*- coding: utf-8 -*-
# Copyright (C) 2013 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from datetime import datetime
from unicodedata import normalize
from odoo.exceptions import Warning as UserError
from odoo.tools.translate import _
from odoo.addons.l10n_br_account.sp... | agpl-3.0 |
fredericosilva/node-gyp | gyp/pylib/gyp/MSVSSettings.py | 253 | 43329 | # 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.
"""Code to validate and convert settings of the Microsoft build tools.
This file contains code to validate and convert settings of the Microsoft
build tools. The... | mit |
dios-game/dios | src/oslibs/google_breakpad/google-breakpad-read-only/src/tools/gyp/test/intermediate_dir/gyptest-intermediate-dir.py | 243 | 1398 | #!/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.
"""
Verifies that targets have independent INTERMEDIATE_DIRs.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('test.gyp', chdir=... | mit |
wenderen/servo | components/script/dom/bindings/codegen/parser/tests/test_distinguishability.py | 50 | 12785 | def firstArgType(method):
return method.signatures()[0][1][0].type
def WebIDLTest(parser, harness):
parser.parse("""
dictionary Dict {
};
callback interface Foo {
};
interface Bar {
// Bit of a pain to get things that have dictionary types
void passDict(optional Di... | mpl-2.0 |
Eseoghene/bite-project | deps/gdata-python-client/src/gdata/Crypto/PublicKey/DSA.py | 228 | 6674 |
#
# DSA.py : Digital Signature Algorithm
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitness for use... | apache-2.0 |
ging/keystone | keystone/auth/plugins/two_factor.py | 1 | 3545 | # Copyright (C) 2015 Universidad Politecnica de Madrid
#
# 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 |
armadill-odyssey/aima-python | submissions/Karman/puzzles.py | 18 | 1974 | import search
from math import(cos, pi)
tuscany_map = search.UndirectedGraph(dict(
Florence=dict(Prato=24, Montevarchi=51, Sienna=75, Empoli=31),
Prato=dict(Pistoia=26, Florence=24, Empoli = 29.3),
Pistoia=dict(Prato=26, Lucca=43),
Lucca=dict(Pistoia=43, Pisa=18, Pontedera = 29, SanMiniato = 44.3),
Pisa=dict(Lucca=18... | mit |
demon-ru/iml-crm | addons/mail/wizard/__init__.py | 438 | 1075 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
hstau/covar-cryo | covariance/rotatefill.py | 1 | 1524 | '''function [out] = imrotateFill(inp, angle)
% function [out] = imrotateFill(inp)
% Rotates an 2D image couterclockwise by angle in degrees
% Output image has the same dimension as input.
% Undefined regions are filled in by repeating the original image
% Note: input images must be square
%
% Copyright (c) UWM, Peter ... | gpl-2.0 |
mtnbikenc/ansible-modules-extras | cloud/cloudstack/cs_instance.py | 22 | 36186 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (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 Software Foundation, either version 3 of the Lice... | gpl-3.0 |
rudivs/TaxonLinker | taxonlinker.py | 1 | 9916 | #!/usr/bin/env python
from settings import *
import os.path, Tkinter, tkFont, tkFileDialog
import taxonutils
class TaxonLinker():
def __init__(self,root):
self.taxondict = DICTIONARY_FILE
self.nameslist = []
self.results = []
self.dictload = False
self.nmload = False
# options and ... | mit |
wkentaro/catkin_tools | catkin_tools/commands/catkin.py | 4 | 8231 | # Copyright 2014 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
rahuldhote/odoo | addons/mrp_repair/wizard/cancel_repair.py | 384 | 3683 | # -*- 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 |
christoph-buente/phantomjs | src/qt/qtwebkit/Tools/TestResultServer/handlers/menu.py | 129 | 2770 | # Copyright (C) 2010 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 ... | bsd-3-clause |
dmaclay/python-smpp | test/pdu_hex_asserts.py | 2 | 3710 |
########################################
pdu_json_0000000001 = '''{
"body": {
"mandatory_parameters": {
"data_coding": 0,
"dest_addr_npi": "ISDN",
"dest_addr_ton": "international",
"destination_addr": "555555555",
"esm_class": 0,
... | bsd-3-clause |
pku9104038/edx-platform | common/lib/xmodule/xmodule/tests/test_peer_grading.py | 1 | 13961 | import unittest
import json
import logging
from mock import Mock
from webob.multidict import MultiDict
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.modulestore import Location
from xmodule.tests import get_test_system, get_test_descriptor_system
from xmodule.tests.test_u... | agpl-3.0 |
ms-iot/python | cpython/Lib/ctypes/test/test_macholib.py | 100 | 1830 | import os
import sys
import unittest
# Bob Ippolito:
#
# Ok.. the code to find the filename for __getattr__ should look
# something like:
#
# import os
# from macholib.dyld import dyld_find
#
# def find_lib(name):
# possible = ['lib'+name+'.dylib', name+'.dylib',
# name+'.framework/'+name]
# for dylib i... | bsd-3-clause |
MaximNevrov/neutron | neutron/services/bgp/scheduler/bgp_dragent_scheduler.py | 3 | 7889 | # Copyright 2016 Huawei Technologies India Pvt. Ltd.
# 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 |
F5Networks/f5-ansible-modules | ansible_collections/f5networks/f5_modules/tests/unit/modules/network/f5/test_bigip_ssl_ocsp.py | 2 | 3287 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | mit |
fernandezcuesta/ansible | lib/ansible/modules/monitoring/datadog_monitor.py | 31 | 13827 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Sebastian Kornehl <sebastian.kornehl@asideas.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 versi... | gpl-3.0 |
miguelparaiso/OdooAccessible | addons/l10n_fr_rib/__init__.py | 433 | 1046 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Numérigraphe SARL.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | agpl-3.0 |
zimmerle/gnuradio | gnuradio-core/src/lib/filter/generate_gr_freq_xlating_fir_filter_XXX.py | 17 | 1493 | #!/bin/env python
# -*- python -*-
#
# Copyright 2003,2004 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (... | gpl-3.0 |
albertoriva/bioscripts | bisconv.py | 1 | 3205 | #!/usr/bin/env python
import sys
import pysam
import os.path
import Script
def usage():
sys.stderr.write("""bisconv.py command [args...] - Extract aligned reads from BAM file based on conversion strand.
This program examines the ZS tag of the reads in a BAM file produced by BSMAP to identify reads
coming from ... | gpl-3.0 |
osrg/ryu | ryu/tests/unit/ofproto/test_parser_v10.py | 10 | 170013 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
akash1808/nova_test_latest | nova/console/fake.py | 114 | 1615 | # Copyright (c) 2010 OpenStack Foundation
# 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 ... | apache-2.0 |
bwsblake/lettercounter | django-norel-env/lib/python2.7/site-packages/django/contrib/admin/bin/compress.py | 193 | 1958 | #!/usr/bin/env python
import os
import optparse
import subprocess
import sys
js_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'static', 'admin', 'js')
def main():
usage = "usage: %prog [file1..fileN]"
description = """With no file paths given this script will automatically
compress all jQuer... | mit |
sergio-incaser/odoo | addons/bus/bus.py | 325 | 7324 | # -*- coding: utf-8 -*-
import datetime
import json
import logging
import select
import threading
import time
import random
import simplejson
import openerp
from openerp.osv import osv, fields
from openerp.http import request
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
_logger = logging.getLogger(__... | agpl-3.0 |
onyx-intl/ak98_kernel | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
kidaa30/spacewalk | client/rhel/rhn-client-tools/test/testRhnChannel.py | 36 | 1826 | #!/usr/bin/python
import sys
import settestpath
from up2date_client import rhnChannel
# lots of useful util methods for building/tearing down
# test enviroments...
import testutils
import unittest
def write(blip):
sys.stdout.write("\n|%s|\n" % blip)
class testRhnChannel(unittest.TestCase):
def setUp(sel... | gpl-2.0 |
Mattze96/youtube-dl | youtube_dl/extractor/ivi.py | 107 | 7231 | # encoding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
ExtractorError,
)
class IviIE(InfoExtractor):
IE_DESC = 'ivi.ru'
IE_NAME = 'ivi'
_VALID_URL = r'https?://(?:www\... | unlicense |
mattcongy/itshop | docker-images/taigav2/taiga-back/taiga/projects/translations.py | 2 | 4901 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | mit |
Sentdex/pygta5 | models.py | 1 | 47729 | '''
Copyright 2015 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | gpl-3.0 |
akshayaurora/kivy | kivy/uix/recyclelayout.py | 10 | 12070 | """
RecycleLayout
=============
.. versionadded:: 1.10.0
.. warning::
This module is highly experimental, its API may change in the future and
the documentation is not complete at this time.
"""
from kivy.uix.recycleview.layout import RecycleLayoutManagerBehavior
from kivy.uix.layout import Layout
from kivy.... | mit |
ojake/django | django/contrib/gis/gdal/raster/source.py | 297 | 13274 | import json
import os
from ctypes import addressof, byref, c_double, c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.driver import Driver
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
from django.contrib.gis... | bsd-3-clause |
adamrp/qiime | tests/test_truncate_reverse_primer.py | 15 | 15531 | #!/usr/bin/env python
# File created February 29, 2012
from __future__ import division
__author__ = "William Walters"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["William Walters"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "William Walters"
__email__ = "William.A.Walters@col... | gpl-2.0 |
rubenvereecken/pokemongo-api | POGOProtos/Enums/CameraInterpolation_pb2.py | 16 | 2450 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Enums/CameraInterpolation.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.