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 |
|---|---|---|---|---|---|
AsgerPetersen/QGIS | python/ext-libs/future/future/types/newint.py | 68 | 13233 | """
Backport of Python 3's int, based on Py2's long.
They are very similar. The most notable difference is:
- representation: trailing L in Python 2 removed in Python 3
"""
from __future__ import division
import struct
import collections
from future.types.newbytes import newbytes
from future.types.newobject import ... | gpl-2.0 |
deepakantony/sms-tools | workspace_2014/A1/A1Part2.py | 1 | 1706 | import sys
import os
sys.path.append('../../software/models/')
from utilFunctions import wavread
import scipy.io.wavfile
import numpy as np
"""
A1-Part-2: Basic operations with audio
Write a function that reads an audio file and returns the minimum and the maximum values of the audio
samples in that file.
The in... | agpl-3.0 |
Perferom/android_external_chromium_org | tools/telemetry/telemetry/page/actions/click_element.py | 24 | 1955 | # 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.
import re
from telemetry.core import util
from telemetry.core import exceptions
from telemetry.page.actions import page_action
def _EscapeSelector(sele... | bsd-3-clause |
google/gazoo-device | gazoo_device/base_classes/nrf_connect_sdk_device.py | 1 | 3562 | # Copyright 2021 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 agreed to in writing, ... | apache-2.0 |
chauhanhardik/populo_2 | lms/djangoapps/certificates/views/xqueue.py | 51 | 9592 | """
Views used by XQueue certificate generation.
"""
import json
import logging
from django.contrib.auth.models import User
from django.http import HttpResponse, Http404, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
import dogstats_wra... | agpl-3.0 |
Sendoushi/servo | python/tidy/servo_tidy_tests/test_tidy.py | 1 | 4818 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | mpl-2.0 |
isohybrid/dotfile | vim/bundle/git:--github.com-klen-python-mode/pylibs/logilab/common/hg.py | 24 | 4819 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | bsd-2-clause |
joebowen/LogMyRocket_API | LogMyRocket/libraries/sys_packages/requests/packages/charade/euckrfreq.py | 3121 | 45978 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
Ghostboy-287/okadminfinder3 | okadminfinder.py | 1 | 18022 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
try:
# Change main dir to this (need for Pentest Box)
import os
os.path.abspath(__file__)
from Classes import (Credits,
OKadminFinderClass,
MessengerClass)
import argparse
from colorama import Fore,... | apache-2.0 |
Ashaba/rms | rmslocalenv/lib/python2.7/site-packages/django/core/validators.py | 32 | 15447 | from __future__ import unicode_literals
import re
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.functional import SimpleLazyObject
from django.utils.ipv6 import is_vali... | mit |
cevaris/pants | src/python/pants/util/dirutil.py | 2 | 12074 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import atexit
import... | apache-2.0 |
pamfilos/invenio | modules/webaccess/lib/external_authentication_cern.py | 25 | 7730 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011 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
## Licens... | gpl-2.0 |
yceruto/django | django/conf/locale/nn/formats.py | 197 | 1810 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... | bsd-3-clause |
cuongthai/cuongthai-s-blog | django/contrib/localflavor/is_/is_postalcodes.py | 438 | 4913 | # -*- coding: utf-8 -*-
IS_POSTALCODES = (
('101', u'101 Reykjavík'),
('103', u'103 Reykjavík'),
('104', u'104 Reykjavík'),
('105', u'105 Reykjavík'),
('107', u'107 Reykjavík'),
('108', u'108 Reykjavík'),
('109', u'109 Reykjavík'),
('110', u'110 Reykjavík'),
('111', u'111 Reykjavík'... | bsd-3-clause |
dikyarga/modularitea | src/opt/pymodularitea/build/lib/modularitea/atom_.py | 2 | 2290 | #! /usr/bin/python3
import sys
import json
import os
import subprocess
import apt
import apt_pkg
import apt.progress.text
import apt.progress.base
from urllib.request import urlretrieve
from gi.repository import Gtk
# harus diganti saat rilis
PREFIX = '/home/mnirfan/Projects/modularitea/'
# executable apt
APT_PATH =... | mit |
hogasa/normalizador-amba | setup.py | 1 | 1202 | # coding: UTF-8
# !/usr/bin/env python
from __future__ import absolute_import
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import usig_normalizador_amba
with open('README.rst', 'r') as f:
readme = f.read()
setup(
name=usig_normalizador_amba.__title__,
ver... | mit |
sahana/Turkey | modules/s3db/msg.py | 7 | 91452 | # -*- coding: utf-8 -*-
""" Sahana Eden Messaging Model
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
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 wit... | mit |
pbrunet/pythran | pythran/tests/euler/euler41.py | 5 | 2648 | #runas solve()
#unittest.skip recursive generator
#pythran export solve()
''' From O'Reilly's Python Cookbook '''
def _combinators(_handle, items, n):
if n==0:
yield []
return
for i, item in enumerate(items):
this_one = [ item ]
for cc in _combinators(_handle, _handle(items, i),... | bsd-3-clause |
kimegitee/deep-learning | language-translation/helper.py | 156 | 2683 | import os
import pickle
import copy
import numpy as np
CODES = {'<PAD>': 0, '<EOS>': 1, '<UNK>': 2, '<GO>': 3 }
def load_data(path):
"""
Load Dataset from File
"""
input_file = os.path.join(path)
with open(input_file, 'r', encoding='utf-8') as f:
return f.read()
def preprocess_and_save... | mit |
arborh/tensorflow | tensorflow/python/keras/layers/recurrent_v2.py | 3 | 67355 | # Copyright 2019 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 |
jyemin/mongo-orchestration | mongo_orchestration/server.py | 2 | 3856 | #!/usr/bin/python
# coding=utf-8
import argparse
import atexit
import json
import os
import sys
from bson import SON
from mongo_orchestration.daemon import Daemon
work_dir = os.environ.get('MONGO_ORCHESTRATION_HOME', os.getcwd())
pid_file = os.path.join(work_dir, 'server.pid')
log_file = os.path.join(work_dir, 'ser... | apache-2.0 |
bkonkle/django-baseviews | docs/conf.py | 1 | 7253 | # -*- coding: utf-8 -*-
#
# django-baseviews documentation build configuration file, created by
# sphinx-quickstart on Mon Sep 20 23:11:20 2010.
#
# 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... | bsd-3-clause |
mckinseyacademy/xblock-diagnosticfeedback | diagnostic_feedback/settings.py | 1 | 2183 | """
Django settings for the diagnostic_feedback project.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
# Build paths inside the project like this: os.path.join(B... | agpl-3.0 |
Jonekee/chromium.src | third_party/typ/typ/tests/host_test.py | 35 | 6924 | # Copyright 2014 Dirk Pranke. 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 a... | bsd-3-clause |
jsalva/djember | djember/djember/wsgi.py | 1 | 1562 | """
WSGI config for djember project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... | mit |
hsaputra/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py | 8 | 31357 | # 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 |
wooga/airflow | airflow/contrib/hooks/sagemaker_hook.py | 5 | 1267 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
nicolasnoble/grpc | src/python/grpcio_tests/tests/unit/resources.py | 18 | 3134 | # Copyright 2015 gRPC authors.
#
# 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... | apache-2.0 |
e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/action/dellos9.py | 2 | 4467 | #
# (c) 2016 Red Hat Inc.
#
# Copyright (c) 2017 Dell 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) an... | bsd-3-clause |
lexus42/w17 | static/Brython3.1.1-20150328-091302/Lib/types.py | 756 | 3167 | """
Define names for built-in types that aren't directly accessible as a builtin.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check the type! Use hasattr to check for both
# "__iter__" and "... | gpl-3.0 |
numenta/nupic | src/nupic/algorithms/anomaly.py | 11 | 7246 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014-2016, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# Thi... | agpl-3.0 |
digitvaran/digitvaran | attendance_proxy/functions.py | 1 | 2810 | from pyvirtualdisplay import Display
from selenium.webdriver.support.ui import Select
from selenium import webdriver
from bs4 import BeautifulSoup
keys=webdriver.common.keys.Keys
def scroll_element_into_view(driver, element):
"""Scroll element into view"""
y = element.location['y']
driver.execute_script('... | gpl-2.0 |
stupidnetizen/selenium | py/test/selenium/webdriver/common/element_attribute_tests.py | 65 | 12160 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
analysiscenter/dataset | batchflow/opensets/imagenette.py | 1 | 5401 | """ Contains Imagenette and Imagewoof datasets """
import os
from os.path import dirname, basename
import tempfile
import logging
import urllib.request
import tarfile
from io import BytesIO
import PIL
import tqdm
import numpy as np
from sklearn.preprocessing import LabelEncoder
from . import ImagesOpenset
logger =... | apache-2.0 |
NOAA-ORR-ERD/gridded | gridded/tests/test_pysgrid/test_read_netcdf.py | 1 | 2349 | """
Created on Apr 7, 2015
@author: ayan
"""
from __future__ import absolute_import, division, print_function
from gridded.pysgrid.read_netcdf import NetCDFDataset, find_grid_topology_var
from .write_nc_test_files import roms_sgrid, wrf_sgrid
"""
Test NetCDF Dataset With Nodes.
"""
def test_finding_node_variab... | unlicense |
oostende/openblachole | lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py | 2 | 9282 | # -*- coding: iso-8859-1 -*-
from time import time
from boxbranding import getImageVersion
from enigma import eConsoleAppContainer
from Components.Console import Console
from Components.PackageInfo import PackageInfoHandler
from Components.Language import language
from Components.Sources.List import List
from Compone... | gpl-2.0 |
chokribr/inveniotest | modules/bibformat/lib/elements/bfe_arxiv_link.py | 16 | 1791 | ## This file is part of Invenio.
## Copyright (C) 2014 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 version.
##
## Inv... | gpl-2.0 |
v-iam/azure-sdk-for-python | azure-batch/azure/batch/models/pool_exists_options.py | 3 | 3078 | # 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 |
sunqm/pyscf | pyscf/cc/test/test_eom_rccsd.py | 2 | 38148 | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | apache-2.0 |
ahu-odoo/odoo | addons/account/company.py | 384 | 2814 | # -*- 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 |
SalesforceFoundation/CumulusCI | cumulusci/tasks/salesforce/Deploy.py | 1 | 5848 | import pathlib
from typing import Optional
from cumulusci.core.exceptions import TaskOptionsError
from cumulusci.core.utils import process_bool_arg, process_list_arg
from cumulusci.salesforce_api.metadata import ApiDeploy
from cumulusci.salesforce_api.package_zip import MetadataPackageZipBuilder
from cumulusci.tasks.s... | bsd-3-clause |
mapr/sahara | sahara/cli/sahara_api.py | 2 | 1907 | #!/usr/bin/env python
# Copyright (c) 2013 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 l... | apache-2.0 |
KredekPth/Kurs_django | website/urls.py | 1 | 1151 | """website URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | mit |
lukeiwanski/tensorflow-opencl | tensorflow/python/training/localhost_cluster_performance_test.py | 50 | 5457 | # 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 |
aisthesis/opttrack | opttrack/lib/ui/edit_handlers.py | 1 | 10897 | """
Copyright (c) 2015 Marshall Farrier
license http://opensource.org/licenses/MIT
lib/ui/handlers.py
Handlers for edit menu
"""
from bson.codec_options import CodecOptions
import datetime as dt
from functools import partial
import json
from pymongo.errors import BulkWriteError
from ..dbschema import SPREADS
from ... | mit |
loljoho-old/ainu | pyaib/config.py | 2 | 3302 | #!/usr/bin/env python
#
# Copyright 2013 Facebook
#
# 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 agree... | apache-2.0 |
gogoair/foremast | tests/iam/test_iam_create.py | 1 | 4229 | # Foremast - Pipeline Tooling
#
# Copyright 2018 Gogo, 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... | apache-2.0 |
tiagochiavericosta/edx-platform | lms/djangoapps/courseware/features/conditional.py | 102 | 4723 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, steps
from nose.tools import assert_in, assert_true # pylint: disable=no-name-in-module
from common import i_am_registered_for_the_course, visit_scenario_item
from problems_setup import add_problem_to_course, answer... | agpl-3.0 |
krother/maze_run | 03_semantic_errors/generate_maze.py | 4 | 1783 |
# Code for chapter 03 - Semantic Errors
import random
XMAX, YMAX = 19, 16
def create_grid_string(dots, xsize, ysize):
"""
Creates a grid of size (xx, yy)
with the given positions of dots.
"""
grid = ""
for y in range(ysize):
for x in range(xsize):
grid += "." if (x, y) i... | mit |
joone/chromium-crosswalk | tools/idl_parser/idl_ppapi_lexer.py | 81 | 2012 | #!/usr/bin/env python
# Copyright (c) 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.
""" Lexer for PPAPI IDL
The lexer uses the PLY library to build a tokenizer which understands both
WebIDL and Pepper tokens.
WebI... | bsd-3-clause |
kumajaya/android_kernel_samsung_espresso10 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
xiaoyuanW/gem5 | src/arch/x86/isa/insts/x87/arithmetic/multiplication.py | 50 | 2165 | # 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 |
lmacken/moksha | moksha/apps/feeds/moksha/widgets/feeds/widgets.py | 1 | 6186 | # This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, 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 b... | apache-2.0 |
TheMOOCAgency/edx-platform | common/test/acceptance/pages/lms/dashboard_search.py | 16 | 1161 | """
Dashboard search
"""
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL
class DashboardSearchPage(PageObject):
"""
Dashboard page featuring a search form
"""
search_bar_selector = '#dashboard-search-bar'
url = "{base}/dashboard".format(base=BASE... | agpl-3.0 |
cntnboys/cmput410-project | venv/lib/python2.7/site-packages/pip/vcs/git.py | 85 | 7833 | from __future__ import absolute_import
import logging
import tempfile
import os.path
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib import request as urllib_request
from pip.utils import call_subprocess
from pip.utils import display_path, rmtree
from pip.vcs import v... | apache-2.0 |
seann1/portfolio5 | .meteor/dev_bundle/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | 5099 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... | gpl-2.0 |
cloudbees/changelog-client-python | ccp/client.py | 1 | 2319 | # -*- coding: utf-8 -*-
"""
ccp.client
~~~~~~~~~~~~
This module implements the Changelog API.
:license: MIT, see LICENSE for more details.
"""
import sys
import requests
import json
from time import time
import logging
from pkg_resources import get_distribution
API_HOST = "localhost"
API_PORT = 5000
SEVERITY = di... | mit |
erikcas/android_kernel_sony_msm | 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 |
vathpela/blivet | blivet/dbus/constants.py | 3 | 1732 | #
# Copyright (C) 2016 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | gpl-2.0 |
DevangS/CoralNet | annotations/forms.py | 1 | 15430 | from decimal import Decimal
from exceptions import ValueError
from itertools import chain
from django.core.exceptions import ValidationError, MultipleObjectsReturned
from django.core.urlresolvers import reverse
from django.forms import Form
from django.forms.fields import BooleanField, CharField, DecimalField, IntegerF... | bsd-2-clause |
zero323/spark | python/pyspark/streaming/util.py | 23 | 5614 | #
# 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 us... | apache-2.0 |
childsish/lhc-python | lhc/binf/genomic_coordinate/genomic_position.py | 1 | 2868 | from functools import total_ordering
from lhc.order import natural_key
class ChromosomeIdentifier:
def __init__(self, chromosome: str):
self.chromosome = chromosome
self.parts = tuple(natural_key(chromosome))
def __str__(self):
return self.chromosome
def __hash__(self):
r... | gpl-2.0 |
pychess/pychess | lib/pychess/perspectives/games/historyPanel.py | 2 | 9491 | from gi.repository import Gtk, Gdk
from pychess.System import conf
from pychess.System.prefix import addDataPrefix
from pychess.Utils.const import BLACK
from pychess.Utils.Move import toSAN, toFAN
from pychess.widgets.Background import hexcol
__title__ = _("Move History")
__active__ = True
__icon__ = addDataPrefix("g... | gpl-3.0 |
knowsis/django | django/contrib/gis/geoip/base.py | 110 | 11124 | import os
import re
from ctypes import c_char_p
from django.core.validators import ipv4_re
from django.contrib.gis.geoip.libgeoip import GEOIP_SETTINGS
from django.contrib.gis.geoip.prototypes import (
GeoIPRecord, GeoIPTag, GeoIP_open, GeoIP_delete, GeoIP_database_info,
GeoIP_lib_version, GeoIP_record_by_addr... | bsd-3-clause |
Moriadry/tensorflow | tensorflow/contrib/keras/api/keras/applications/vgg16/__init__.py | 57 | 1133 | # 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 |
Zord13appdesa/python-for-android | python3-alpha/extra_modules/bs4/builder/_lxml.py | 46 | 5603 | __all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
TreeBuilder,
XML)
from bs4.dammit import UnicodeDammit... | apache-2.0 |
spartonia/django-oscar | src/oscar/management/commands/oscar_cleanup_alerts.py | 19 | 1703 | import logging
from datetime import timedelta
from optparse import make_option
from django.core.management.base import BaseCommand
from django.utils.timezone import now
from oscar.core.loading import get_model
ProductAlert = get_model('customer', 'ProductAlert')
logger = logging.getLogger(__name__)
class Command(... | bsd-3-clause |
saurabh6790/frappe | frappe/integrations/doctype/paypal_settings/paypal_settings.py | 2 | 14226 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
"""
# Integrating PayPal
### 1. Validate Currency Support
Example:
from frappe.integrations.utils import get_payment_gateway_controller
controller = get_payment_gateway_controller(... | mit |
nagyistoce/odoo-dev-odoo | addons/payment_ogone/tests/test_ogone.py | 430 | 9309 | # -*- coding: utf-8 -*-
from lxml import objectify
import time
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_ogone.controllers.main import OgoneController
from openerp.tools i... | agpl-3.0 |
archf/ansible | lib/ansible/modules/utilities/logic/fail.py | 113 | 1256 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
udacity/ggplot | ggplot/geoms/geom_tile.py | 12 | 3695 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pandas as pd
import numpy as np
from .geom import geom
from matplotlib.patches import Rectangle
import matplotlib.colors as colors
import matplotlib.colorbar as colorbar
class geom_tile(geom):
DEFAU... | bsd-2-clause |
GNOME/hamster-applet | src/hamster/widgets/dayline.py | 3 | 13606 | # -*- coding: utf-8 -*-
# Copyright (C) 2007-2010 Toms Bauģis <toms.baugis at gmail.com>
# This file is part of Project Hamster.
# Project Hamster 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 vers... | gpl-3.0 |
disconnect3d/pwndbg | pwndbg/argv.py | 4 | 1102 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import gdb
import pwndbg.abi
import pwndbg.arch
import pwndbg.events
import pwndbg.memory
import pwndbg.regs
#: Total numb... | mit |
havard024/prego | venv/lib/python2.7/site-packages/unidecode/x077.py | 252 | 4675 | data = (
'Ming ', # 0x00
'Sheng ', # 0x01
'Shi ', # 0x02
'Yun ', # 0x03
'Mian ', # 0x04
'Pan ', # 0x05
'Fang ', # 0x06
'Miao ', # 0x07
'Dan ', # 0x08
'Mei ', # 0x09
'Mao ', # 0x0a
'Kan ', # 0x0b
'Xian ', # 0x0c
'Ou ', # 0x0d
'Shi ', # 0x0e
'Yang ', # 0x0f
'Zheng ', # 0... | mit |
pokowaka/atreus-firmware | tmk/tmk_core/tool/mbed/mbed-sdk/workspace_tools/host_tests/host_tests_plugins/module_reset_mps2.py | 30 | 2470 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | gpl-3.0 |
eayunstack/horizon | openstack_dashboard/dashboards/project/instances/tables.py | 12 | 40417 | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
franziz/arcrawler | lib/saver/blog.py | 1 | 1508 | from curtsies import fmtstr
from ..monitor import Monitor
import pymongo
import bson.json_util
import re
import arrow
class BlogSaver:
def __init__(self, **kwargs):
self.db_address = kwargs.get("db_address", "mongo:27017")
self.db_name = kwargs.get("db_name", "news_crawler")
def save(self, article=None):
... | gpl-3.0 |
crdoconnor/olympia | lib/crypto/tasks.py | 8 | 14127 | import json
import logging
import os
import shutil
import zipfile
from django.conf import settings
from django.db.models import Q
from lxml import etree
import amo
from addons.models import AddonUser
from amo.celery import task
from lib.crypto.packaged import sign_file
from versions.compare import version_int
from v... | bsd-3-clause |
adamreese/kubernetes | examples/selenium/selenium-test.py | 497 | 1089 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 |
aYukiSekiguchi/ACCESS-Chromium | native_client_sdk/src/build_tools/make_nacl_tools.py | 8 | 7703 | #!/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.
"""Build NaCl tools (e.g. sel_ldr and ncval) at a given revision."""
import build_utils
import optparse
import os
import shutil
im... | bsd-3-clause |
tempbottle/Nuitka | nuitka/nodes/IndicatorMixins.py | 2 | 2961 | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | apache-2.0 |
UDST/choicemodels | tests/test_mnl_new.py | 1 | 3024 | """
These are tests for the refactored choicemodels MNL codebase.
"""
import numpy as np
import pandas as pd
import pytest
from pandas.testing import assert_frame_equal
from patsy import dmatrix
from choicemodels import MultinomialLogit
from choicemodels.tools import MergedChoiceTable
@pytest.fixture
def obs():
... | bsd-3-clause |
patricksnape/menpo | menpo/image/base.py | 2 | 131364 | from typing import Iterable, Optional
from warnings import warn
import PIL.Image as PILImage
import numpy as np
from menpo.base import MenpoDeprecationWarning, Vectorizable, copy_landmarks_and_path
from menpo.landmark import Landmarkable
from menpo.shape import PointCloud, bounding_box
from menpo.transform import (
... | bsd-3-clause |
cdrttn/samba-regedit | lib/dnspython/dns/rdtypes/ANY/NSEC3PARAM.py | 85 | 3169 | # Copyright (C) 2004-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 "... | gpl-3.0 |
dulems/hue | desktop/core/ext-py/Django-1.6.10/django/utils/translation/trans_real.py | 74 | 25651 | """Translation helper functions."""
from __future__ import unicode_literals
import locale
import os
import re
import sys
import gettext as gettext_module
from threading import local
import warnings
from django.utils.importlib import import_module
from django.utils.datastructures import SortedDict
from django.utils.en... | apache-2.0 |
kakunbsc/bb | lib/bb/fetch/cvs.py | 5 | 6216 | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it u... | gpl-2.0 |
petecummings/django | django/contrib/auth/backends.py | 468 | 6114 | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
class ModelBackend(object):
"""
Authenticates against settings.AUTH_USER_MODEL.
"""
def authenticate(self, username=None, password=None, **kwargs):
UserMod... | bsd-3-clause |
VagrantApe/flaskMicroblog | venv/lib/python2.7/site-packages/whoosh/filedb/gae.py | 96 | 4872 | """
This module contains EXPERIMENTAL support for storing a Whoosh index's files in
the Google App Engine blobstore. This will use a lot of RAM since all files are
loaded into RAM, but it potentially useful as a workaround for the lack of file
storage in Google App Engine.
Use at your own risk, but please report any p... | bsd-3-clause |
lzjever/django-guardian | docs/conf.py | 24 | 7168 | # -*- coding: utf-8 -*-
#
# django-guardian documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 18 23:18:28 2010.
#
# 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.... | bsd-2-clause |
akuster/yali | yali/gui/ScrAdmin.py | 1 | 6936 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2010 TUBITAK/UEKAE
#
# 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.
#
# ... | gpl-2.0 |
zacernst/python_cypher | test/test.py | 1 | 1583 | import unittest
import networkx as nx
from python_cypher import python_cypher
class TestPythonCypher(unittest.TestCase):
def test_upper(self):
"""Test we can parse a CREATE... RETURN query."""
g = nx.MultiDiGraph()
query = 'CREATE (n:SOMECLASS) RETURN n'
test_parser = python_cyphe... | gpl-2.0 |
asmodehn/pyros | tests/test_pyros/test_ros_ctx_server.py | 2 | 1788 | from __future__ import absolute_import, division, print_function
import time
import pytest
from pyros.client import PyrosClient
from pyros.server.ctx_server import pyros_ctx
pyros_interfaces_ros = pytest.importorskip("pyros_interfaces_ros") # , minversion="0.4") # TODO : make version avialable in pyros_interfaces_... | bsd-3-clause |
zhxwmessi/or-tools | examples/python/production.py | 34 | 2848 | # Copyright 2011 Hakan Kjellerstrand hakank@bonetmail.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 required by applicable ... | apache-2.0 |
p4datasystems/CarnotKE | jyhton/lib-python/2.7/encodings/base64_codec.py | 528 | 2338 | """ Python 'base64_codec' Codec - base64 content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs, base64
### Codec APIs
def base64_encode(i... | apache-2.0 |
kuzetsa/android_kernel_htc_msm8974 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
weimingtom/python-for-android | python-modules/twisted/twisted/internet/test/test_endpoints.py | 49 | 41233 | # Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test the C{I...Endpoint} implementations that wrap the L{IReactorTCP},
L{IReactorSSL}, and L{IReactorUNIX} interfaces found in
L{twisted.internet.endpoints}.
"""
from errno import EPERM
from zope.interface import implements
from twi... | apache-2.0 |
AdrianHuang/rt-thread | bsp/lpc5410x/rtconfig.py | 28 | 2379 | import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
BOARD_NAME = 'lpc5410x'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = r'D:/Program Files/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin'
elif CROSS_TOOL == 'keil':
... | gpl-2.0 |
FokkeZB/titanium_mobile | support/common/markdown/preprocessors.py | 112 | 7128 |
"""
PRE-PROCESSORS
=============================================================================
Preprocessors work on source text before we start doing anything too
complicated.
"""
import re
import markdown
HTML_PLACEHOLDER_PREFIX = markdown.STX+"wzxhzdk:"
HTML_PLACEHOLDER = HTML_PLACEHOLDER_PREFIX + "%d" + mark... | apache-2.0 |
NL66278/OCB | addons/sales_team/res_config.py | 366 | 1922 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
class sales_team_configuration(osv.TransientModel):
_name = 'sale.config.settings'
_inherit = ['sale.config.settings']
def set_group_multi_salesteams(self, cr, uid, ids, context=None):
""" This method is automatically called by res_conf... | agpl-3.0 |
chrislit/abydos | tests/distance/test_distance_lcsuffix.py | 1 | 3807 | # Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.