repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jrgdiz/cardwalker | refs/heads/master | grammar/mana/decl.py | 1 | from pyparsing import *
import act
colorname = Forward().setParseAction(act.colorname)
noncolorname = Forward().setParseAction(act.noncolorname)
colorfeature = Forward().setParseAction(act.colorfeature)
color = Forward()
manasymbol = Forward().setParseAction(act.manasymbol)
tapsymbol = Forward().setParseAction(act.t... |
jr55662003/My_Rosalind | refs/heads/master | LEXF.py | 2 | '''
Given: A collection of at most 10 symbols defining an ordered alphabet,
and a positive integer n .
Return: All strings of length n that can be formed from the alphabet, ordered lexicographically.
'''
from itertools import product
def lexi_kmers(symbol, n):
lexi = list(product(symbol, repeat = n))
new_lexi = []... |
zhouzhenghui/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_reprlib.py | 56 | """
Test cases for the repr module
Nick Mathewson
"""
import sys
import os
import shutil
import unittest
from test.support import run_unittest
from reprlib import repr as r # Don't shadow builtin repr
from reprlib import Repr
from reprlib import recursive_repr
def nestedTuple(nesting):
t = ()
for i in r... |
Aravinthu/odoo | refs/heads/master | addons/website_sale/__init__.py | 1315 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import controllers
from . import models
|
dev-lord/estruturas-dados-com-python3 | refs/heads/master | aula04/desempacotamento.py | 1 | """
Material complementar: https://pythonhelp.wordpress.com/2013/01/10/desempacotamento-de-tupla/
"""
lista = [1, 2, 3, 4]
print('tipo: {0} | valor: {1}'.format(type(lista), lista))
# desempacotando a lista e atribuindo a variáveis
a, b, c, d = lista
print('tipo: {0} | a: {1}'.format(type(a), a))
print('tipo: {0} |... |
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/platform/gsutil/third_party/boto/boto/fps/exception.py | 239 | from boto.exception import BotoServerError
class ResponseErrorFactory(BotoServerError):
def __new__(cls, *args, **kw):
error = BotoServerError(*args, **kw)
newclass = globals().get(error.error_code, ResponseError)
obj = newclass.__new__(newclass, *args, **kw)
obj.__dict__.update(e... |
tensorflow/addons | refs/heads/master | tensorflow_addons/activations/hardshrink.py | 1 | # 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... |
wannaphongcom/flappy | refs/heads/master | samples/keyboard.py | 2 | #! /usr/bin/env python
# encoding: utf-8
import flappy
from flappy.display import Sprite
from flappy.events import Event, MouseEvent, KeyboardEvent
from flappy.ui import Keyboard
from time import time
WIDTH = 600
HEIGHT = 600
BALL_RADIUS = 40
GRAVITY = 200
THRUST = 5000
DAMP = 0.8
class KeyboardExample(Sprite):
... |
arokem/nipype | refs/heads/master | nipype/interfaces/spm/tests/test_auto_Normalize12.py | 9 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.spm.preprocess import Normalize12
def test_Normalize12_inputs():
input_map = dict(affine_regularization_type=dict(field='eoptions.affreg',
),
apply_to_files=dict(copyfile=True,
field='su... |
h0s/c3py | refs/heads/master | c3py/tooltip.py | 2 | from .chart_component import ChartComponentDict
class TooltipFormat(ChartComponentDict):
"""
Manipulate the format of the tooltip.
"""
def __init__(self):
super(TooltipFormat, self).__init__()
def set_title(self, title):
"""
Set the title of the tooltip. The variable 'x' ... |
DigitalSlideArchive/large_image | refs/heads/master | test/test_config.py | 2 | from large_image.config import getConfig, setConfig
def testConfigFunctions():
assert isinstance(getConfig(), dict)
setConfig('cache_backend', 'python')
assert getConfig('cache_backend') == 'python'
setConfig('cache_backend', 'memcached')
assert getConfig('cache_backend') == 'memcached'
setCon... |
DataDog/stashboard | refs/heads/master | stashboard/contrib/dateutil/__init__.py | 253 | """
Copyright (c) 2003-2010 Gustavo Niemeyer <[email protected]>
This module offers extensions to the standard python 2.3+
datetime module.
"""
__author__ = "Gustavo Niemeyer <[email protected]>"
__license__ = "PSF License"
__version__ = "1.5"
|
gargleblaster/trading-with-python | refs/heads/master | historicDataDownloader/testData.py | 77 | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 05 22:06:13 2012
@author: jev
"""
import numpy as np
from pandas import *
from matplotlib.pyplot import *
#df1 = DataFrame.from_csv('test1.csv').astype(np.dtype('f4'))
#df2 = DataFrame.from_csv('test2.csv').astype(np.dtype('f4'))
#df = DataFrame([df1,df2]... |
40223202/test2-1 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/dummy/__init__.py | 693 | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
... |
broferek/ansible | refs/heads/devel | test/units/modules/system/test_iptables.py | 18 | from units.compat.mock import patch
from ansible.module_utils import basic
from ansible.modules.system import iptables
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args
def get_bin_path(*args, **kwargs):
return "/sbin/iptables"
def get_iptables_version(iptables_pa... |
sirMackk/ZeroNet | refs/heads/master | plugins/Newsfeed/__init__.py | 8 | import NewsfeedPlugin |
coder-james/mxnet | refs/heads/master | example/reinforcement-learning/dqn/dqn_demo.py | 15 | import mxnet as mx
import mxnet.ndarray as nd
import numpy
from base import Base
from operators import *
from atari_game import AtariGame
from utils import *
import logging
import argparse
root = logging.getLogger()
root.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatt... |
jhseu/tensorflow | refs/heads/master | tensorflow/python/training/session_manager_test.py | 8 | # 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... |
0x000000FF/yocto-edison-meta | refs/heads/master | meta-intel-edison-distro/recipes-mostfun/avr-isp/files/avr_isp/intelHex.py | 3 | """
Module to read intel hex files into binary data blobs.
IntelHex files are commonly used to distribute firmware
See: http://en.wikipedia.org/wiki/Intel_HEX
"""
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
import io
def readHex(filename):
"""
Read an verify an intel... |
yoki/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/commit.py | 124 | # 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 th... |
fernandezcuesta/ansible | refs/heads/devel | lib/ansible/modules/network/illumos/ipadm_addrprop.py | 8 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <[email protected]>
# 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.0',
... |
t3dev/odoo | refs/heads/master | odoo/addons/test_pylint/tests/__init__.py | 20 | from . import test_pylint
|
rubikloud/scikit-learn | refs/heads/0.17.1-RUBIKLOUD | sklearn/metrics/cluster/bicluster.py | 359 | from __future__ import division
import numpy as np
from sklearn.utils.linear_assignment_ import linear_assignment
from sklearn.utils.validation import check_consistent_length, check_array
__all__ = ["consensus_score"]
def _check_rows_and_columns(a, b):
"""Unpacks the row and column arrays and checks their shap... |
simo-tuomisto/portfolio | refs/heads/master | Statistical Methods 2014 - Home exam/Code/exam_p02.py | 1 | import numpy as np
import string
import random
import matplotlib.pyplot as mpl
class Passenger:
def __init__(self, rowNumber, seatLetter):
self.rowNumber = float(rowNumber)
self.seatLetter = seatLetter
self.hasWaited = False
def checkPosition(self, position):
return position == self.rowNumber
def __re... |
ilsindia/php-cf-buildtest | refs/heads/master | lib/yaml/dumper.py | 543 |
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper']
from emitter import *
from serializer import *
from representer import *
from resolver import *
class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver):
def __init__(self, stream,
default_style=None, default_flow_style=None,
c... |
MonicaHsu/truvaluation | refs/heads/master | venv/lib/python2.7/site-packages/werkzeug/datastructures.py | 314 | # -*- coding: utf-8 -*-
"""
werkzeug.datastructures
~~~~~~~~~~~~~~~~~~~~~~~
This module provides mixins and classes with an immutable interface.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
import cod... |
marc-sensenich/ansible | refs/heads/devel | test/units/plugins/test_plugins.py | 31 | # (c) 2012-2014, Michael DeHaan <[email protected]>
#
# 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... |
asnorkin/sentiment_analysis | refs/heads/master | site/lib/python2.7/site-packages/numpy/lib/index_tricks.py | 66 | from __future__ import division, absolute_import, print_function
import sys
import math
import numpy.core.numeric as _nx
from numpy.core.numeric import (
asarray, ScalarType, array, alltrue, cumprod, arange
)
from numpy.core.numerictypes import find_common_type, issubdtype
from . import function_base
import ... |
frenchfrywpepper/ansible-modules-extras | refs/heads/devel | cloud/vmware/vca_nat.py | 25 | #!/usr/bin/python
# Copyright (c) 2015 VMware, Inc. All Rights Reserved.
#
# 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 ... |
jwkozel/demobx | refs/heads/master | test/unit/object/test_item.py | 2 | # coding: utf-8
from __future__ import unicode_literals
import json
import pytest
@pytest.fixture(params=('file', 'folder'))
def test_item_and_response(test_file, test_folder, mock_file_response, mock_folder_response, request):
if request.param == 'file':
return test_file, mock_file_response
elif req... |
chemelnucfin/tensorflow | refs/heads/master | tensorflow/compiler/tests/scatter_nd_op_test.py | 13 | # Copyright 2018 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... |
rainaashutosh/MyTestRekall | refs/heads/4.0MR2 | rekall-core/rekall/type_generator.py | 3 | # Rekall Memory Forensics
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <[email protected]>
#
# 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 ... |
chromium2014/src | refs/heads/master | third_party/tlslite/tlslite/integration/clienthelper.py | 116 | # Authors:
# Trevor Perrin
# Dimitris Moraitis - Anon ciphersuites
#
# See the LICENSE file for legal information regarding use of this file.
"""
A helper class for using TLS Lite with stdlib clients
(httplib, xmlrpclib, imaplib, poplib).
"""
from tlslite.checker import Checker
class ClientHelper(object):
"... |
ysekky/GPy | refs/heads/devel | GPy/core/parameterization/priors.py | 3 | # Copyright (c) 2012 - 2014, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from scipy.special import gammaln, digamma
from ...util.linalg import pdinv
from paramz.domains import _REAL, _POSITIVE
import warnings
import weakref
class Prior(object):
d... |
Jgarcia-IAS/localizacion | refs/heads/master | openerp/report/render/makohtml2html/__init__.py | 381 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/scatter/line/__init__.py | 2 | import sys
if sys.version_info < (3, 7):
from ._width import WidthValidator
from ._smoothing import SmoothingValidator
from ._simplify import SimplifyValidator
from ._shape import ShapeValidator
from ._dash import DashValidator
from ._color import ColorValidator
else:
from _plotly_utils.imp... |
plotly/python-api | refs/heads/master | packages/python/plotly/plotly/validators/box/_ysrc.py | 1 | import _plotly_utils.basevalidators
class YsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="ysrc", parent_name="box", **kwargs):
super(YsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwar... |
shubhamgupta123/erpnext | refs/heads/master | erpnext/hr/doctype/repayment_schedule/repayment_schedule.py | 45 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class RepaymentSchedule(Document):
pass
|
chand3040/sree_odoo | refs/heads/master | openerp/addons/gamification/models/challenge.py | 91 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... |
google-research/tiny-differentiable-simulator | refs/heads/master | python/examples/whole_body_control/static_gait_controller.py | 2 | # Lint as: python3
"""A static gait controller for a quadruped robot. Experimental code."""
import os
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
os.sys.path.insert(0, parentdir)
import numpy as np
from mpc_controller i... |
syci/OCB | refs/heads/9.0 | addons/google_calendar/__openerp__.py | 19 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Google Calendar',
'version': '1.0',
'category': 'Tools',
'description': """
The module adds the possibility to synchronize Google Calendar with OpenERP
========================================... |
supermanue/distributedController | refs/heads/master | clusterController/PbsTask.py | 1 | '''
Created on Feb 22, 2013
@author: u5682
'''
from DistributedTask import DistributedTask
import ShellExecution
import os
class PBSTask(object):
'''
classdocs
'''
def __init__(self, distributedTask):
'''
Constructor
'''
self.task = distributedTask
def submit(self):
arguments = ' '.j... |
csparpa/robograph | refs/heads/master | robograph/datamodel/nodes/lib/transcoders.py | 1 | import json
import os
from robograph.datamodel.base import node
class ToJSON(node.Node):
"""
This node converts serializable data to JSON
Requirements:
data --> data to be dumped to JSON
Eg:
ToJSON(data=[1,2,3])
ToJSON(dict(a="1",b="2"))
"""
_reqs = ['data']
def output... |
Yas3r/OWASP-ZSC | refs/heads/master | lib/encoder/freebsd_x86/xor_random.py | 20 | #!/usr/bin/env python
'''
OWASP ZSC | ZCR Shellcoder
ZeroDay Cyber Research
Z3r0D4y.Com
Ali Razmjoo
'''
import random,binascii,string
chars = string.digits + string.ascii_letters
def start(shellcode,job):
if 'chmod(' in job:
shellcode = 'N' + shellcode
if 'dir_create(' in job:
shellcode = 'N' + shellcode
if 'd... |
suutari/shoop | refs/heads/master | shuup/core/models/_shops.py | 1 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.conf import se... |
timvandermeij/drone-tomography | refs/heads/master | tests/zigbee_rf_sensor.py | 3 | # Core imports
import Queue
import thread
import time
# Library imports
from mock import patch, MagicMock, PropertyMock
# Package imports
from ..core.Thread_Manager import Thread_Manager
from ..core.Threadable import Threadable
from ..settings.Arguments import Arguments
from ..reconstruction.Buffer import Buffer
from... |
alekz112/statsmodels | refs/heads/master | statsmodels/tsa/arima_model.py | 7 | # Note: The information criteria add 1 to the number of parameters
# whenever the model has an AR or MA term since, in principle,
# the variance could be treated as a free parameter and restricted
# This code does not allow this, but it adds consistency with other
# packages such as gretl and X1... |
nonemaw/pynet | refs/heads/master | learnpy_ecourse/class2/ex4_show_version.py | 4 | #!/usr/bin/env python
'''
Disclaimer - This is a solution to the below problem given the content we have
discussed in class. It is not necessarily the best solution to the problem.
In other words, I only use things we have covered up to this point in the class.
Python for Network Engineers
https://pynet.twb-tech.com... |
juanifioren/django-oidc-provider | refs/heads/master | oidc_provider/tests/app/urls.py | 2 | from django.contrib.auth import views as auth_views
try:
from django.urls import include, url
except ImportError:
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='home.htm... |
blehman/Data-Science-45min-Intros | refs/heads/master | python-oop-101/life/__init__.py | 30 | __all__ = [
"beast"
, "human"
]
|
rhyolight/soda-tap | refs/heads/master | server.py | 1 | import os
import json
import urlparse
import web
import redis
from sodatap import createCatalog, Resource
ITEMS_PER_PAGE = 10
GOOGLE_MAPS_API_KEY = os.environ["GOOGLE_MAPS_API_KEY"]
REDIS_URL = os.environ["REDIS_URL"]
REDIS_DB = 1
POOL = None
urls = (
"/", "index",
"/catalog", "catalog",
"/catalog/(.+)", "ca... |
plotly/python-api | refs/heads/master | packages/python/plotly/plotly/validators/splom/_ids.py | 1 | import _plotly_utils.basevalidators
class IdsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="ids", parent_name="splom", **kwargs):
super(IdsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type... |
Dino0631/RedRain-Bot | refs/heads/develop | cogs/lib/youtube_dl/extractor/oktoberfesttv.py | 64 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class OktoberfestTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?oktoberfest-tv\.de/[^/]+/[^/]+/video/(?P<id>[^/?#]+)'
_TEST = {
'url': 'http://www.oktoberfest-tv.de/de/kameras/video/hb-zelt',
'i... |
edevil/django | refs/heads/master | django/utils/checksums.py | 105 | """
Common checksum routines.
"""
__all__ = ['luhn']
import warnings
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
warnings.warn(
"django.utils.checksums will be removed in Django 2.0. The "
"luhn() function is now included in django-localflavor 1.1+.",
Remov... |
xin3liang/platform_external_chromium_org | refs/heads/master | third_party/closure_linter/closure_linter/errorrules_test.py | 126 | #!/usr/bin/env python
# Copyright 2013 The Closure Linter Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... |
proversity-org/edx-platform | refs/heads/master | lms/djangoapps/lti_provider/tests/test_outcomes.py | 5 | """
Tests for the LTI outcome service handlers, both in outcomes.py and in tasks.py
"""
from django.test import TestCase
from lxml import etree
from mock import ANY, MagicMock, patch
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
import lti_provider.outcomes as outcomes
from lti_provider.models ... |
botswana-harvard/tshilo-dikotla | refs/heads/develop | td_maternal/admin/maternal_medical_history_admin.py | 1 | from django.contrib import admin
from collections import OrderedDict
from edc_export.actions import export_as_csv_action
from ..forms import MaternalMedicalHistoryForm
from ..models import MaternalMedicalHistory
from .base_maternal_model_admin import BaseMaternalModelAdmin
class MaternalMedicalHistoryAdmin(BaseMate... |
ajinabraham/Mobile-Security-Framework-MobSF | refs/heads/master | MobSF/settings.py | 1 | """
Django settings for MobSF project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import imp
import os
import logging
import colorlog
from MobSF import utils
... |
jnovinger/django | refs/heads/master | tests/utils_tests/test_glob.py | 331 | from __future__ import unicode_literals
from django.test import SimpleTestCase
from django.utils.glob import glob_escape
class TestUtilsGlob(SimpleTestCase):
def test_glob_escape(self):
filename = '/my/file?/name[with special chars*'
expected = '/my/file[?]/name[[]with special chars[*]'
f... |
googleapis/googleapis-gen | refs/heads/master | google/cloud/bigquery/migration/v2alpha/bigquery-migration-v2alpha-py/tests/unit/gapic/migration_v2alpha/test_migration_service.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
rversteegen/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/encodings/iso8859_11.py | 593 | """ Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... |
CourseTalk/edx-platform | refs/heads/master | lms/djangoapps/mobile_api/__init__.py | 218 | """
Mobile API
"""
|
ssbarnea/ansible | refs/heads/devel | lib/ansible/cli/__init__.py | 10 | # Copyright: (c) 2012-2014, Michael DeHaan <[email protected]>
# Copyright: (c) 2016, Toshio Kuratomi <[email protected]>
# Copyright: (c) 2018, 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 ... |
mcgettin/githubLabNMG | refs/heads/master | cloudComp/euler/eu6.py | 1 | """
The sum of the squares of the first ten natural numbers is,
12 + 22 + ... + 102 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... + 10)2 = 552 = 3025
Hence the difference between the sum of the squares of the first ten
natural numbers and the square of the sum is 3025 − 385 = 2640.
Fi... |
hslee16/ansible-modules-extras | refs/heads/devel | packaging/os/pkg5.py | 75 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014 Peter Oliver <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... |
Tivix/django-rest-auth | refs/heads/master | rest_auth/tests/test_api.py | 2 | from django.test import TestCase, override_settings
from django.contrib.auth import get_user_model
from django.core import mail
from django.conf import settings
from django.utils.encoding import force_text
from allauth.account import app_settings as account_app_settings
from rest_framework import status
from rest_fram... |
nhippenmeyer/django | refs/heads/master | django/contrib/sites/migrations/0002_alter_domain_unique.py | 170 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.sites.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='... |
XeCycle/indico | refs/heads/master | indico/web/http_api/metadata/jsonp.py | 2 | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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... |
Mark24Code/python | refs/heads/master | NKUCodingCat/0015/0015.py | 40 | #coding=utf-8
import json, xlwt, os
f = open(os.path.split(os.path.realpath(__file__))[0]+"/city.txt")
dict = json.loads(f.read().decode("GBK"))
xls = xlwt.Workbook()
sheet = xls.add_sheet("city")
for i in range(len(dict.keys())):
row = i
col = 0
sheet.write(row, col, dict.keys()[i])
sheet.write(row, col+1, dict[d... |
heimdalerp/heimdalerp | refs/heads/master | invoice/serializers.py | 2 | from decimal import Decimal
from contact.models import Contact
from contact.serializers import ContactSerializer
from django.db import transaction
from django.utils.translation import ugettext_lazy as _
from invoice import models
from persons.models import Company, PhysicalAddress
from persons.serializers import Compa... |
google-research/evoflow | refs/heads/master | tests/backend/test_random.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, ... |
nash-x/hws | refs/heads/master | neutron/agent/l3_proxy.py | 1 | '''
Created on 2014-5-23
'''
import sys
import datetime
import eventlet
eventlet.monkey_patch()
import netaddr
import os
from oslo.config import cfg
from oslo import messaging
import Queue
import random
import socket
import time
from neutron.agent.common import config
from neutron.agent import l3_ha_agent
from neut... |
heyf/cloaked-octo-adventure | refs/heads/master | leetcode/053_maximum-subarray.py | 1 | # 53. Maximum Subarray - LeetCode
# https://leetcode.com/problems/maximum-subarray/description/
# For example, given the array [-2,1,-3,4,-1,2,1,-5,4],
# the contiguous subarray [4,-1,2,1] has the largest sum = 6.
class Solution(object):
def maxSubArray(self, nums):
"""
:type nums: List[int]
... |
beepee14/scikit-learn | refs/heads/master | examples/classification/plot_classifier_comparison.py | 66 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=====================
Classifier comparison
=====================
A comparison of a several classifiers in scikit-learn on synthetic datasets.
The point of this example is to illustrate the nature of decision boundaries
of different classifiers.
This should be taken with ... |
ktbyers/netmiko | refs/heads/develop | netmiko/raisecom/__init__.py | 1 | from netmiko.raisecom.raisecom_roap import RaisecomRoapSSH
from netmiko.raisecom.raisecom_roap import RaisecomRoapTelnet
__all__ = ["RaisecomRoapSSH", "RaisecomRoapTelnet"]
|
moreati/django | refs/heads/master | django/db/migrations/operations/base.py | 356 | from __future__ import unicode_literals
from django.db import router
class Operation(object):
"""
Base class for migration operations.
It's responsible for both mutating the in-memory model state
(see db/migrations/state.py) to represent what it performs, as well
as actually performing it agains... |
cctaylor/googleads-python-lib | refs/heads/master | examples/dfp/v201411/inventory_service/update_ad_units.py | 4 | #!/usr/bin/python
#
# 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 required b... |
ltilve/chromium | refs/heads/igalia-sidebar | build/android/gyp/create_device_library_links.py | 52 | #!/usr/bin/env python
#
# 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.
"""Creates symlinks to native libraries for an APK.
The native libraries should have previously been pushed to the device (in
option... |
umuzungu/zipline | refs/heads/master | tests/pipeline/test_frameload.py | 4 | """
Tests for zipline.pipeline.loaders.frame.DataFrameLoader.
"""
from unittest import TestCase
from mock import patch
from numpy import arange, ones
from numpy.testing import assert_array_equal
from pandas import (
DataFrame,
DatetimeIndex,
Int64Index,
)
from zipline.lib.adjustment import (
ADD,
... |
mlperf/training_results_v0.7 | refs/heads/master | Inspur/benchmarks/transformer/implementations/implementation_closed/fairseq/sequence_scorer.py | 6 | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
from fairseq import ... |
ChromeDevTools/devtools-frontend | refs/heads/master | third_party/pyjson5/src/json5/fakes/host_fake.py | 14 | # 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... |
jimmy201602/webterminal | refs/heads/master | webterminal/commandextract.py | 1 | import re
class CommandDeal(object):
@staticmethod
def remove_obstruct_char(cmd_str):
'''delete some special control delimiter'''
control_char = re.compile(r'\x07 | \x1b\[1P | \r ', re.X)
cmd_str = control_char.sub('', cmd_str.strip())
# 'delete left and right delete'
... |
hynnet/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/host/lib/python2.7/distutils/tests/setuptools_extension.py | 149 | from distutils.core import Extension as _Extension
from distutils.core import Distribution as _Distribution
def _get_unpatched(cls):
"""Protect against re-patching the distutils if reloaded
Also ensures that no other distutils extension monkeypatched the distutils
first.
"""
while cls.__module__.s... |
amaniak/fabric | refs/heads/master | tests/support/mapping.py | 44 | from fabric.tasks import Task
class MappingTask(dict, Task):
def run(self):
pass
mapping_task = MappingTask()
mapping_task.name = "mapping_task"
|
Claod44/GokemonReborn | refs/heads/master | config.example.py | 1 | ### All lines that are commented out (and some that aren't) are optional ###
DB_ENGINE = 'sqlite:///db.sqlite'
#DB_ENGINE = 'mysql://user:pass@localhost/pokeminer'
#DB_ENGINE = 'postgresql://user:pass@localhost/pokeminer
AREA_NAME = 'SLC' # the city or region you are scanning
LANGUAGE = 'EN' # ISO 639-1 codes E... |
alforro/TSP-Solver | refs/heads/master | artificial_intelligence/models.py | 1 | from __future__ import unicode_literals
from django.db import models
# Create your models here.
class TSP_Solution(models.Model):
matrix_size = models.IntegerField(default=0)
solution_cost = models.FloatField(default=0.0)
coordinates = models.CharField(max_length=100000)
expanded_nodes = models.Integ... |
nomadjourney/django-tastypie | refs/heads/master | docs/conf.py | 12 | # -*- coding: utf-8 -*-
#
# Tastypie documentation build configuration file, created by
# sphinx-quickstart on Sat May 22 21:44:34 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.
#
# Al... |
misterben/whetstone | refs/heads/master | whetstone-0.0.2/whetstone.py | 1 | #!/usr/bin/env python
# Whetstone
# A tool to help you memorise scripture
#
# Whetstone - Helping you keep your Sword sharp
# Copyright (C) 2009 Ben Thorp ( [email protected] )
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publishe... |
dtroyer/osc-cloud | refs/heads/master | osccloud/tests/test_osccloud.py | 1 | # -*- coding: utf-8 -*-
# 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, softw... |
kk9599/django-cms | refs/heads/develop | cms/test_utils/project/sampleapp/urls_example.py | 58 | # -*- coding: utf-8 -*-
from django.conf.urls import url
from ..placeholderapp import views
urlpatterns = [
url(r'^example/$', views.example_view, name="example"),
]
|
SickGear/SickGear | refs/heads/master | lib/apprise/plugins/NotifyGrowl/__init__.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Chris Caron <[email protected]>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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 th... |
kodi-czsk/plugin.video.pohadkar.cz | refs/heads/master | default.py | 1 | # -*- coding: UTF-8 -*-
#/*
# * Copyright (C) 2013 Libor Zoubek
# *
# *
# * 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, or (at your option)
# * any later version... |
TwinkleChawla/nova | refs/heads/master | nova/api/openstack/compute/hide_server_addresses.py | 32 | # Copyright 2012 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 requ... |
bbengfort/TextBlob | refs/heads/dev | text/tokenizers.py | 1 | '''Deprecated tokenizers module. Import ``textblob.tokenizers`` instead.
'''
from textblob.tokenizers import *
|
wa1tnr/ainsuSPI | refs/heads/master | 0-Distribution.d/circuitpython-master/tests/basics/builtin_hash_intbig.py | 23 | # test builtin hash function
print({1 << 66:1}) # hash big int
print({-(1 << 66):2}) # hash negative big int
# __hash__ returning a large number should be truncated
class F:
def __hash__(self):
return 1 << 70 | 1
print(hash(F()) != 0)
|
Thielak/program-y | refs/heads/rc | src/programy/mappings/person.py | 5 | """
Copyright (c) 2016 Keith Sterling
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, modify, merge, publish, distribute,... |
commtrack/temp-rapidsms | refs/heads/master | apps/backends/urls.py | 3 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from django.conf.urls.defaults import *
urlpatterns = patterns('')
|
denismakogon/savanna-dashboard | refs/heads/master | savannadashboard/openstack/common/version.py | 1 |
# Copyright 2012 OpenStack Foundation
# Copyright 2012-2013 Hewlett-Packard Development Company, L.P.
#
# 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.ap... |
paluh/django-tz | refs/heads/master | django_tz/templatetags/django_tz_tags.py | 1 | import pytz
from django.conf import settings
from django.template import Node
from django.template import Library
from django_tz.utils import adjust_datetime_to_timezone
from django_tz import global_tz
register = Library()
@register.filter
def to_global_tz(value, from_timezone=None):
with_tzinfo = value.tzinfo ... |
marclaporte/clearskies_core | refs/heads/master | tools/gyp/test/same-target-name-different-directory/src/touch.py | 679 | #!/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.
import sys
f = open(sys.argv[1], 'w+')
f.write('Hello from touch.py\n')
f.close()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.