repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
sattarvoybek/android_kernel_zte_p839f30 | refs/heads/stock | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # 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... |
lthall/Leonard_ardupilot | refs/heads/master | libraries/AP_OSD/fonts/mcm2bin.py | 37 | #!/usr/bin/env python
import sys
if len(sys.argv) < 3:
print("Usage: ./mcm2bin.py clarity.mcm clarity.bin")
exit()
with open(sys.argv[1]) as inp:
content = inp.readlines()
content.pop(0)
with open(sys.argv[2], 'wb') as out:
for i, line in enumerate(content):
if i % 64 < 54:
b = int... |
jgmize/kuma | refs/heads/master | kuma/users/migrations/0005_update_tz.py | 4 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0004_update_locales'),
]
operations = [
migrations.AlterField(
model_name='user',
name='tim... |
bowlofstew/common | refs/heads/develop | utils/decorators.py | 5 | """Module with biicode custom decorators."""
from biicode.common.settings.osinfo import OSInfo
def os_constraint(os_name):
"""Wraps a method checking if client runs in give operating system.
Class should have WorkspacePaths and UserIO as attributes."""
def decorator(func):
def _os_constraint(se... |
Pablo126/SSBW | refs/heads/master | Entrega1/lib/python3.5/site-packages/django/utils/text.py | 46 | from __future__ import unicode_literals
import re
import unicodedata
from gzip import GzipFile
from io import BytesIO
from django.utils import six
from django.utils.encoding import force_text
from django.utils.functional import (
SimpleLazyObject, keep_lazy, keep_lazy_text, lazy,
)
from django.utils.safestring im... |
GoogleCloudPlatform/cloud-spanner-emulator | refs/heads/master | tests/gcloud/operation_test.py | 1 | #
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
BackupGGCode/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_userdict.py | 91 | # Check every path through every method of UserDict
from test import support, mapping_tests
import collections
d0 = {}
d1 = {"one": 1}
d2 = {"one": 1, "two": 2}
d3 = {"one": 1, "two": 3, "three": 5}
d4 = {"one": None, "two": None}
d5 = {"one": 1, "two": 1}
class UserDictTest(mapping_tests.TestHashMappingProtocol):
... |
HadiOfBBG/pegasusrises | refs/heads/master | gcs-client/demo/blobstore.py | 8 | # Copyright 2013 Google Inc. All Rights Reserved.
"""A sample app that operates on GCS files with blobstore API."""
from __future__ import with_statement
import cloudstorage as gcs
import main
import webapp2
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
def... |
quamilek/django | refs/heads/master | tests/gis_tests/rasterapp/test_rasterfield.py | 241 | import json
from unittest import skipIf
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.shortcuts import numpy
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from ..data.rasters.textrasters import JSON_RASTER
from... |
andresgz/django | refs/heads/master | django/db/backends/dummy/base.py | 429 | """
Dummy database backend for Django.
Django uses this if the database ENGINE setting is empty (None or empty string).
Each of these API functions, except connection.close(), raises
ImproperlyConfigured.
"""
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.base.base import BaseDatabas... |
EricSchles/flask-oauth | refs/heads/master | example/google.py | 1 | from flask import Flask, redirect, url_for, session
from flask_oauth import OAuth
# You must configure these 3 values from Google APIs console
# https://code.google.com/apis/console
GOOGLE_CLIENT_ID = '973159820575-tf9ilfou58tppeikflp9161rrgvmn827.apps.googleusercontent.com'
GOOGLE_CLIENT_SECRET = 'jMqKXk4kqhXgpaDtjg... |
pettai/capirca | refs/heads/master | lib/juniper.py | 1 | # Copyright 2011 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 a... |
jakevdp/scipy | refs/heads/master | scipy/signal/_upfirdn.py | 40 | # Code adapted from "upfirdn" python library with permission:
#
# Copyright (c) 2009, Motorola, 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 re... |
dulems/hue | refs/heads/master | desktop/core/src/desktop/management/commands/runcpserver.py | 36 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
honnibal/spaCy | refs/heads/master | spacy/tests/serialize/test_serialize_pipeline.py | 1 | # coding: utf-8
from __future__ import unicode_literals
import pytest
from spacy.pipeline import Tagger, DependencyParser, EntityRecognizer
from spacy.pipeline import Tensorizer, TextCategorizer
from ..util import make_tempdir
test_parsers = [DependencyParser, EntityRecognizer]
@pytest.fixture
def parser(en_vocab... |
bzcheeseman/Py_Cpp | refs/heads/master | tests/gtest/test/gtest_catch_exceptions_test.py | 2139 | #!/usr/bin/env python
#
# Copyright 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 o... |
amyshi188/osf.io | refs/heads/develop | api_tests/guids/views/test_guid_detail.py | 8 | from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from website.files.models.osfstorage import OsfStorageFile
from website.settings import API_DOMAIN
from tests.base import ApiTestCase
from tests.factories import (AuthUserFactory, ProjectFactory, RegistrationFactory,
... |
mindm/2017Challenges | refs/heads/master | challenge_1/python/kar-moore/src/challenge1.py | 5 | def reverse_string(s):
return s[::-1]
print reverseStr("abc")
print reverseStr("hello everyone") |
ryfeus/lambda-packs | refs/heads/master | Spacy/source2.7/spacy/tests/regression/test_issue588.py | 3 | # coding: utf-8
from __future__ import unicode_literals
from ...matcher import Matcher
import pytest
def test_issue588(en_vocab):
matcher = Matcher(en_vocab)
with pytest.raises(ValueError):
matcher.add('TEST', None, [])
|
ycl2045/nova-master | refs/heads/master | nova/api/openstack/compute/contrib/hosts.py | 10 | # Copyright (c) 2011 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 ... |
antoinecarme/pyaf | refs/heads/master | tests/artificial/transf_Integration/trend_MovingAverage/cycle_12/ar_12/test_artificial_32_Integration_MovingAverage_12_12_20.py | 1 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 12, transform = "Integration", sigma = 0.0, exog_count = 20, ar_order = 12); |
wanchouchou/codecombat | refs/heads/master | scripts/analytics/parseMixpanelPayments.py | 97 | # Parse subscription conversion rates via Mixpanel raw export API
import sys
from datetime import tzinfo, timedelta, datetime
from mixpanel import Mixpanel
try:
import json
except ImportError:
import simplejson as json
# NOTE: mixpanel dates are by day and inclusive
# E.g. '2014-12-08' is any date that day,... |
thaim/ansible | refs/heads/fix-broken-link | lib/ansible/plugins/cliconf/ce.py | 18 | #
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/component/weapon/scope_weapon_sm_s01.py | 85615 | import sys
def setup(core, object):
return |
siddhika1889/Pydev-Editor | refs/heads/master | pysrc/_pydev_imps/_pydev_uuid_old.py | 170 | r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.
If all you want is a unique ID, you should probably call uuid1() ... |
sandvine/horizon | refs/heads/master | openstack_dashboard/dashboards/project/stacks/template_versions/tables.py | 3 | # 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 the... |
DeBortoliWines/Bika-LIMS | refs/heads/hotfix/next | bika/lims/content/rejectanalysis.py | 5 | """ RejectAnalysis """
from Products.Archetypes.public import ReferenceField, Schema, registerType
from bika.lims.content.analysis import Analysis
from bika.lims.config import PROJECTNAME
from bika.lims.content.analysis import schema as analysis_schema
schema = analysis_schema + Schema((
# The analysis that was o... |
MichSchli/Speciale | refs/heads/master | code/processing/ref_to_graph.py | 1 | import imp
import argparse
io = imp.load_source('io', 'code/common/io.py')
parser = argparse.ArgumentParser(description="Convert a reference-to-head formt to a graph-format.")
parser.add_argument("--infile", help="Input filepath (CoNLL format).", required=True)
parser.add_argument("--outfile", help="Output filepath (... |
AdamISZ/joinmarket-clientserver | refs/heads/master | setupall.py | 3 | #!/usr/bin/env python
from __future__ import print_function
import sys, os, subprocess
"""A script to install in one of 3 modes:
(a) daemon - installs jmbase, jmdaemon
(b) client-only - installs jmbase, jmclient
(c) client-bitcoin - installs jmbase, jmclient, jmbitcoin
(d) all - installs jmbase, jmclient, jmbitcoin, j... |
gavoski/audacity | refs/heads/master | lib-src/lv2/lilv/waflib/Node.py | 62 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,re,sys,shutil
from waflib import Utils,Errors
exclude_regs='''
**/*~
**/#*#
**/.#*
**/%*%
**/._*
**/CVS
**/CVS/**
**/.cvsignore
**/SCCS
**/SCCS/**
**/vssver.scc
**/.... |
t0mm0/youtube-dl | refs/heads/master | youtube_dl/extractor/ndtv.py | 129 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
month_by_name,
int_or_none,
)
class NDTVIE(InfoExtractor):
_VALID_URL = r'^https?://(?:www\.)?ndtv\.com/video/player/[^/]*/[^/]*/(?P<id>[a-z0-9]+)'
_TEST = {
'url': 'http://www.ndtv.com... |
dhermes/google-cloud-python | refs/heads/master | kms/google/cloud/kms_v1/proto/resources_pb2_grpc.py | 573 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
|
alexston/calibre-webserver | refs/heads/master | src/calibre/ebooks/azw4/reader.py | 21 | # -*- coding: utf-8 -*-
'''
Read content from azw4 file.
azw4 is essentially a PDF stuffed into a MOBI container.
'''
__license__ = 'GPL v3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
import re
from calibre.ebooks.pdb.formatreader import FormatRe... |
Mistobaan/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/distributions/uniform_test.py | 73 | # 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... |
tangshi/DIGITS | refs/heads/master | tools/download_data/downloader.py | 19 | # Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
import os
import shutil
import urllib
class DataDownloader(object):
"""Base class for downloading data and setting it up for DIGITS"""
def __init__(self, outdir, clean=False, file_extension='png'):
"""
Arguments:
outdir -... |
MSFTOSSMgmt/WPSDSCLinux | refs/heads/master | Providers/nxOMSAutomationWorker/automationworker/scripts/onboarding.py | 2 | #!/usr/bin/env python2
#
# Copyright (C) Microsoft Corporation, All rights reserved.
PY_MAJOR_VERSION = 0
PY_MINOR_VERSION = 2
import sys
import os
import subprocess
from optparse import OptionParser
def get_options_and_arguments():
version_info = sys.version
parser = None
if int(version_info[PY_MAJOR_V... |
eahneahn/free | refs/heads/master | lib/python2.7/site-packages/requests/packages/__init__.py | 1849 | from __future__ import absolute_import
from . import urllib3
|
inessadl/kinect-2-libras | refs/heads/master | Kinect2Libras/KinectFingerTracking/Lib/pydoc_data/topics.py | 45 | # Autogenerated by Sphinx on Sat Jul 3 08:52:04 2010
topics = {'assert': u'\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, ``assert expression``,... |
zulip/zulip | refs/heads/master | zerver/webhooks/slack/tests.py | 1 | from zerver.lib.test_classes import WebhookTestCase
class SlackWebhookTests(WebhookTestCase):
STREAM_NAME = "slack"
URL_TEMPLATE = "/api/v1/external/slack?stream={stream}&api_key={api_key}"
WEBHOOK_DIR_NAME = "slack"
def test_slack_channel_to_topic(self) -> None:
expected_topic = "channel: g... |
bheesham/servo | refs/heads/master | tests/wpt/css-tests/tools/sslutils/__init__.py | 463 | import openssl
import pregenerated
from base import NoSSLEnvironment
from openssl import OpenSSLEnvironment
from pregenerated import PregeneratedSSLEnvironment
environments = {"none": NoSSLEnvironment,
"openssl": OpenSSLEnvironment,
"pregenerated": PregeneratedSSLEnvironment}
|
rubencabrera/odoo | refs/heads/8.0 | addons/mass_mailing/wizard/test_mailing.py | 140 | # -*- coding: utf-8 -*-
from openerp import tools
from openerp.osv import osv, fields
class TestMassMailing(osv.TransientModel):
_name = 'mail.mass_mailing.test'
_description = 'Sample Mail Wizard'
_columns = {
'email_to': fields.char('Recipients', required=True,
help='Comma-separate... |
wilsonxiao/machinekit | refs/heads/master | src/emc/usr_intf/touchy/filechooser.py | 38 | # Touchy is Copyright (c) 2009 Chris Radek <chris@timeguy.com>
#
# Touchy 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.
#
# Touchy i... |
acetcom/nextepc | refs/heads/timer | lib/nas/eps/support/cache/nas-msg-68.py | 2 | ies = []
ies.append({ "iei" : "", "value" : "EMM cause", "type" : "EMM cause", "reference" : "9.9.3.9", "presence" : "M", "format" : "V", "length" : "1"})
ies.append({ "iei" : "78", "value" : "ESM message container", "type" : "ESM message container", "reference" : "9.9.3.15", "presence" : "O", "format" : "TLV-E", "leng... |
tlodge/homehub.nox | refs/heads/master | src/nox/lib/packet/vlan.py | 5 | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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.
#
# NOX is d... |
PARINetwork/pari | refs/heads/master | resources/migrations/0007_auto_20180306_1150.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtaildocs', '0007_merge'),
('resources', '0006_add_field_for_absolute_slideshare_url'),
]
... |
benkiel/ufo2fdk | refs/heads/master | Lib/ufo2fdk/fdkBridge.py | 1 | """
This module is the bridge between Python and the FDK.
It uses subprocess.Popen to create a process that
executes an FDK program.
"""
import sys
import os
import re
import tempfile
# ----------------
# Public Functions
# ----------------
minMakeOTFVersion = (2, 0, 39)
minMakeOTFVersionRE = re.compile(
"\s*"... |
jeezybrick/django | refs/heads/master | tests/timezones/models.py | 415 | from django.db import models
class Event(models.Model):
dt = models.DateTimeField()
class MaybeEvent(models.Model):
dt = models.DateTimeField(blank=True, null=True)
class Session(models.Model):
name = models.CharField(max_length=20)
class SessionEvent(models.Model):
dt = models.DateTimeField()
... |
lmprice/ansible | refs/heads/devel | lib/ansible/modules/cloud/vultr/vr_dns_record.py | 37 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
# 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',
... |
jiazichenzhan/Server_Manage_Plugin | refs/heads/master | ironic-plugin-pike/ironic/drivers/modules/cimc/management.py | 10 | # Copyright 2015, Cisco Systems.
#
# 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 wri... |
hubsif/kodi-tk_bbl | refs/heads/master | resources/lib/mechanize/_beautifulsoup.py | 131 | """Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
v2.1.1
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup parses arbitrarily invalid XML- or HTML-like substance
into a tree representation. It provides methods and Pythonic idioms
that make it easy to search and modify the tree.
A well-formed... |
WizardVan/VanFrame | refs/heads/master | Dependencies/protobuf/gtest/test/gtest_break_on_failure_unittest.py | 1050 | #!/usr/bin/env python
#
# Copyright 2006, 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... |
mesosphere/dcos-cli | refs/heads/master | cli/tests/integrations/test_ssl.py | 1 | import os
import pytest
from dcos import constants
from .helpers.common import exec_command, update_config
@pytest.fixture
def env():
r = os.environ.copy()
r.update({
constants.PATH_ENV: os.environ[constants.PATH_ENV],
'DCOS_SNAKEOIL_CRT_PATH': os.environ.get(
"DCOS_SNAKEOIL_CRT... |
tynn/numpy | refs/heads/master | numpy/f2py/f2py_testing.py | 40 | from __future__ import division, absolute_import, print_function
import sys
import re
from numpy.testing import jiffies, memusage
def cmdline():
m = re.compile(r'\A\d+\Z')
args = []
repeat = 1
for a in sys.argv[1:]:
if m.match(a):
repeat = eval(a)
else:
args.a... |
liyitest/rr | refs/heads/master | openstack_dashboard/dashboards/project/networks/ports/tabs.py | 68 | # Copyright 2012 NEC 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 applicable law or ag... |
cooniur/ansible-modules-core | refs/heads/devel | cloud/openstack/os_security_group_rule.py | 27 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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... |
slozier/ironpython2 | refs/heads/master | Src/StdLib/Lib/test/test_socketserver.py | 4 | """
Test suite for SocketServer.py.
"""
import contextlib
import imp
import os
import select
import signal
import socket
import select
import errno
import tempfile
import unittest
import SocketServer
import test.test_support
from test.test_support import reap_children, reap_threads, verbose
try:
import threading
... |
phoebusliang/parallel-lettuce | refs/heads/master | tests/integration/lib/Django-1.3/tests/regressiontests/initial_sql_regress/tests.py | 88 | from django.test import TestCase
from models import Simple
class InitialSQLTests(TestCase):
def test_initial_sql(self):
# The format of the included SQL file for this test suite is important.
# It must end with a trailing newline in order to test the fix for #2161.
# However, as pointed ... |
dmargala/blupe | refs/heads/master | python/plot_mag_residuals.py | 1 | #!/usr/bin/env python
"""
"""
import argparse
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
mpl.rcParams.update({'font.size': 18})
mpl.rcParams.update({'savefig.dpi': 200})
mpl.rcParams.update({'savefig.bbox': 'tight'})
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotl... |
rocketmiles/alooma-scripts | refs/heads/master | src/fix-mapping.py | 1 | import alooma
import os
import sys
import pprint
api = alooma.Alooma(
hostname=os.environ['ALOOMA_HOST'],
port=int(os.environ['ALOOMA_PORT']),
username=os.environ['ALOOMA_USERNAME'],
password=os.environ['ALOOMA_PASSWORD'])
mapping_name = sys.argv[1]
schema_name = sys.argv[2]
table_name = sys.argv[3]
... |
thinksource/angularbigquery | refs/heads/master | lib/simplejson/scanner.py | 153 | """JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner', 'JSONDecodeError']
NUMBER_RE = re.compile(
r... |
mmbtba/odoo | refs/heads/8.0 | addons/mrp/wizard/__init__.py | 374 | # -*- 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... |
sgonzalez/cell-tower-population | refs/heads/master | grid_converter.py | 1 | # ------------------------------------------------------------------------------- #
# grid_converter.py - Converts a grid map with population to the following format #
# lon, lat, population #
# Author: Thyago Mota ... |
bala4901/odoo | refs/heads/master | addons/l10n_cl/__openerp__.py | 170 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... |
weqopy/blog_instance | refs/heads/master | app/api_1_0/authentication.py | 1 | from flask import g, jsonify
from flask_httpauth import HTTPBasicAuth
from . import api
from .errors import forbidden, unauthorized
from ..models import User, AnonymousUser
auth = HTTPBasicAuth()
@auth.verify_password
def verify_password(email_or_token, password):
if email_or_token == '':
g.current_user =... |
azaghal/ansible | refs/heads/devel | hacking/build-ansible.py | 28 | #!/usr/bin/env python3
# coding: utf-8
# PYTHON_ARGCOMPLETE_OK
# Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
imp... |
victorshch/axiomatic | refs/heads/master | datasets/synthetic2/generate/trajectory.py | 1 | import numpy as np
from scipy.signal import resample
from sklearn.preprocessing import scale
class Trajectory:
def __init__(self, segments):
self.segments = segments
self.n_dims = len(segments[0])
def generate(self, amp_distortion, time_distortion, base=0, time=0, **kwargs):
base ... |
cseelye/pyirobot | refs/heads/master | pyirobot/test/test_robot.py | 1 | #!/usr/bin/env python
#pylint: skip-file
from __future__ import print_function
import itertools
import pytest
import types
from .util import RandomComplexString, RandomIP
class Test_PreferenceFlags(object):
def test_DecodeFlags(self):
print()
from pyirobot import CarpetBoost, CleaningPasses, Fin... |
farisi/rcinventory | refs/heads/master | user_guide_src/cilexer/cilexer/cilexer.py | 241 | # CodeIgniter
# http://codeigniter.com
#
# An open source application development framework for PHP
#
# This content is released under the MIT License (MIT)
#
# Copyright (c) 2014 - 2015, British Columbia Institute of Technology
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of thi... |
cboling/xos | refs/heads/master | xos/tosca/engine.py | 3 | import os
import pdb
import sys
import tempfile
import traceback
sys.path.append("/opt/tosca")
from translator.toscalib.tosca_template import ToscaTemplate
from core.models import Slice,Instance,User,Flavor,Node,Image
from nodeselect import XOSNodeSelector
from imageselect import XOSImageSelector
import resources
c... |
mattilyra/scikit-learn | refs/heads/master | examples/gaussian_process/plot_gpc_isoprobability.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=================================================================
Iso-probability lines for Gaussian Processes classification (GPC)
=================================================================
A two-dimensional classification example showing iso-probability lines for... |
sidiandi/doxygen | refs/heads/master | src/languages.py | 23 | #
# This file is an aid to generated the Languages rules file.
# usage:
# python languages.py > ..\winbuild\Languages.rules
#
import os
import re
files = [f for f in os.listdir('.') if re.match(r'translator_[a-z][a-z]\.h', f)]
new_list = []
for f in files:
new_list.append([f,(os.path.splitext(f)[0]).replace("tra... |
veltri/DLV2 | refs/heads/master | tests/parser/aggregates.domain.sum.1.test.py | 1 | input = """
f(one).
true :- #sum{ X : f(X) } >= 0.
"""
output = """
f(one).
true :- #sum{ X : f(X) } >= 0.
"""
|
tsuru/try | refs/heads/master | registration/app.py | 1 | from flask import render_template, request, redirect, url_for
import flask
import requests
from .forms import SignupForm
import json
import os
app = flask.Flask(__name__)
app.secret_key = "secret?"
app.debug = True
def add_user(email, password, identify):
tsuru_host = os.environ.get("TSURU_HOST")
url = "{... |
nichung/wwwflaskBlogrevA | refs/heads/master | venv/lib/python2.7/site-packages/pip/vendor/distlib/_backport/shutil.py | 1002 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os... |
ibinti/intellij-community | refs/heads/master | python/testData/quickFixes/PyRenameElementQuickFixTest/renameAsyncVariableInPy36.py | 26 | <warning descr="'async' and 'await' are not recommended to be used as variable, class, function or module names. They will become proper keywords in Python 3.7.">async</warning> = 1 |
samgoodgame/sf_crime | refs/heads/master | iterations/spark-sklearn/nn.py | 1 | import numpy as np
from time import time
from operator import itemgetter
from sklearn import svm, grid_search
from sklearn.ensemble import RandomForestClassifier
from sknn.mlp import Classifier, Layer
from spark_sklearn import GridSearchCV
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from sklearn.... |
cloudera/hue | refs/heads/master | desktop/core/ext-py/boto-2.46.1/boto/sdb/db/blob.py | 153 | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# 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 to use, copy,... |
heracek/django-nonrel | refs/heads/master | django/contrib/messages/storage/base.py | 399 | from django.conf import settings
from django.utils.encoding import force_unicode, StrAndUnicode
from django.contrib.messages import constants, utils
LEVEL_TAGS = utils.get_level_tags()
class Message(StrAndUnicode):
"""
Represents an actual message that can be stored in any of the supported
storage class... |
dhylands/micropython | refs/heads/master | tests/basics/string_endswith.py | 79 | print("foobar".endswith("bar"))
print("foobar".endswith("baR"))
print("foobar".endswith("bar1"))
print("foobar".endswith("foobar"))
print("foobar".endswith(""))
print("foobar".endswith("foobarbaz"))
#print("1foobar".startswith("foo", 1))
#print("1foo".startswith("foo", 1))
#print("1foo".startswith("1foo", 1))
#print("... |
askeing/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/pytest/doc/en/example/assertion/global_testmodule_config/test_hello.py | 260 |
hello = "world"
def test_func():
pass
|
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/spyderlib/widgets/comboboxes.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""Customized combobox widgets"""
# pylint: disable=C0103
# pylint: disable=R0903
# pylint: disable=R0911
# pylint: disable=R0201
from spyderlib.qt.QtGui import (QC... |
caseyrollins/osf.io | refs/heads/develop | api/subscriptions/views.py | 8 | from rest_framework import generics
from rest_framework import permissions as drf_permissions
from rest_framework.exceptions import NotFound
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from framework.auth.oauth_scopes import CoreScopes
from api.base.views import JSONAPIBaseView... |
pculture/mirocommunity | refs/heads/master | localtv/inline_edit/simple.py | 1 | from django.http import HttpResponse, HttpResponseForbidden
from django.shortcuts import get_object_or_404
from django.views.decorators.csrf import csrf_protect
from localtv.decorators import require_site_admin
from localtv.templatetags.editable_widget import WIDGET_DIRECTORY, \
editable_widget
@require_site_admi... |
nazeehshoura/crawler | refs/heads/master | env/lib/python2.7/site-packages/django/conf/locale/sr_Latn/formats.py | 394 | # -*- 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'
DATE... |
PerilousApricot/bigcouch | refs/heads/master | couchjs/scons/scons-local-2.0.1/SCons/Tool/Subversion.py | 61 | """SCons.Tool.Subversion.py
Tool-specific initialization for Subversion.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons F... |
SatoshiNXSimudrone/sl4a-damon-clone | refs/heads/master | python/gdata/src/gdata/tlslite/utils/dateFuncs.py | 407 |
import os
#Functions for manipulating datetime objects
#CCYY-MM-DDThh:mm:ssZ
def parseDateClass(s):
year, month, day = s.split("-")
day, tail = day[:2], day[2:]
hour, minute, second = tail[1:].split(":")
second = second[:2]
year, month, day = int(year), int(month), int(day)
hour, minute, secon... |
sestrella/ansible | refs/heads/devel | test/units/modules/network/check_point/test_cp_mgmt_application_site.py | 19 | # Ansible module to manage CheckPoint Firewall (c) 2019
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dist... |
Aptitudetech/ERPNext | refs/heads/master | erpnext/patches/v4_1/fix_sales_order_delivered_status.py | 120 | # 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
def execute():
for si in frappe.db.sql_list("""select name
from `tabSales Invoice`
where ifnull(update_stock,0) = 1 and docstatus = ... |
person142/scipy | refs/heads/master | scipy/sparse/csgraph/tests/test_graph_laplacian.py | 21 | # Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Jake Vanderplas <vanderplas@astro.washington.edu>
# License: BSD
import numpy as np
from numpy.testing import assert_allclose, assert_array_almost_equal
from pytest import raises as assert_raises
from scipy import sparse
from scipy.sparse import csgrap... |
chunywang/crosswalk-test-suite | refs/heads/master | cordova/cordova-webapp-android-tests/webapp/webapp_run.py | 18 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
TathagataChakraborti/resource-conflicts | refs/heads/master | PLANROB-2015/seq-sat-lama/Python-2.5.2/Tools/unicode/gencodec.py | 1 | """ Unicode Mapping Parser and Codec Generator.
This script parses Unicode mapping files as available from the Unicode
site (ftp://ftp.unicode.org/Public/MAPPINGS/) and creates Python codec
modules from them. The codecs use the standard character mapping codec
to actually apply the mapping.
Synopsis: gencodec.py dir ... |
Tesora/tesora-horizon | refs/heads/master | openstack_dashboard/dashboards/admin/volumes/volume_types/tests.py | 16 | # 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 the ... |
Intrepid90/Projects | refs/heads/master | Numbers/factorial.py | 14 | """
Factorial Finder - The Factorial of a positive integer, n,
is defined as the product of the sequence n, n-1, n-2, ...1
and the factorial of zero, 0, is defined as being 1. Solve
this using both loops and recursion.
"""
def fact_loop(n):
"""
Returns the factorial of a given positive, non-zero integ... |
sittingbull/artefact.connectors | refs/heads/master | artefact/connectors/dataiku/custom-recipes/artefact-connectors_compute_havas_cost_data/tests/test_recipe.py | 2 | import unittest
import mock
# Workaround to import recipe.py
import sys
from os.path import dirname, join
connector_pkg = join(dirname(__file__), '..')
sys.path.append(connector_pkg)
from recipe import get_files_to_process, append_files_to_dataset, DatasetWrapper # nopep8
class RecipeTest(unittest.TestCase):
... |
dillonjerry/aws | refs/heads/master | AWS-ElasticBeanstalk-CLI-2.6.2/eb/macosx/python3/lib/aws/requests/certs.py | 17 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
certs.py
~~~~~~~~
This module returns the preferred default CA certificate bundle.
If you are packaging Requests, e.g., for a Linux distribution or a managed
environment, you can change the definition of where() to return a separately
packaged CA bundle.
"""
import ... |
ciex/motor | refs/heads/master | lib/flask/templating.py | 783 | # -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... |
talishte/ctigre | refs/heads/master | env/lib/python2.7/site-packages/django/db/backends/oracle/base.py | 15 | """
Oracle database backend for Django.
Requires cx_Oracle: http://cx-oracle.sourceforge.net/
"""
from __future__ import unicode_literals
import decimal
import re
import sys
import warnings
def _setup_environment(environ):
import platform
# Cygwin requires some special voodoo to set the environment variables... |
schriftgestalt/Mekka-Scripts | refs/heads/master | Metrics/Extract kern strings 1st char.py | 2 | #MenuTitle: Extract kern strings (1st character)
# -*- coding: utf-8 -*-
__doc__="""
Analyze a textfile: look for certain characters and output all letter combinations occurring in the text file to the Macro Window.
"""
import GlyphsApp
import vanilla
from PyObjCTools.AppHelper import callAfter
myExcludeString = """
... |
aishraj/pykons_solution | refs/heads/master | python2/runner/helper.py | 277 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def cls_name(obj):
return obj.__class__.__name__ |
jordifierro/abidria-api | refs/heads/master | experiences/validators.py | 1 | from abidria.exceptions import InvalidEntityException, NoPermissionException
class ExperienceValidator:
MIN_TITLE_LENGHT = 1
MAX_TITLE_LENGHT = 30
def validate_experience(self, experience):
if experience.author_id is None:
raise InvalidEntityException(source='author', code='empty_att... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.