repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
medunigraz/outpost | src/outpost/django/kages/api.py | 1 | 1284 | import logging
import ldap
from rest_framework import (
exceptions,
permissions,
viewsets,
)
from rest_framework.response import Response
from . import models
from .conf import settings
logger = logging.getLogger(__name__)
class TranslateViewSet(viewsets.ViewSet):
permission_classes = (
per... | bsd-2-clause |
asdofindia/kitsune | kitsune/questions/tests/test_es.py | 13 | 9455 | from datetime import datetime, timedelta
from nose.tools import eq_
from pyquery import PyQuery as pq
from kitsune.products.tests import product
from kitsune.questions.models import (
QuestionMappingType, AnswerMetricsMappingType)
from kitsune.questions.tests import question, answer, answervote, questionvote
from... | bsd-3-clause |
jscn/django | django/contrib/contenttypes/models.py | 1 | 7319 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.db.utils import IntegrityError, OperationalError, ProgrammingError
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
class Cont... | bsd-3-clause |
tntraina/aff4 | python2.6/tests/encrypted.py | 3 | 2727 | import pyaff4
import os, time, sys
time.sleep(1)
oracle = pyaff4.Resolver()
CERT_LOCATION = os.getcwd() + "/tests/sign.key"
SOURCE = "/bin/ls"
## For this test make sure there are certs:
try:
data = open(CERT_LOCATION).read()
except IOError:
print "Creating certs on %s" % CERT_LOCATION
os.system("openss... | gpl-3.0 |
Acidburn0zzz/archiso-gui | releng/root-image/usr/share/cnchi/src/misc.py | 1 | 28903 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2012 Canonical Ltd.
# Copyright (c) 2013 Antergos
#
# 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, o... | gpl-3.0 |
yazidkucrit/android_kernel_samsung_aries | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
bytedance/fedlearner | test/data_join/test_data_portal_job_manager.py | 1 | 8196 | # Copyright 2021 The FedLearner 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 |
mosbasik/fluidspaces | src/fluidspaces/i3_commands.py | 1 | 1215 | import subprocess
class i3Commands(object):
@staticmethod
def send_to_wp(i3_name):
'''Send the currently focused window/container to the named workspace'''
subprocess.Popen(['i3-msg', 'move container to workspace', i3_name], stdout=subprocess.PIPE)
@staticmethod
def go_to_wp(i3_name)... | mit |
0x46616c6b/ansible | lib/ansible/modules/network/nxos/nxos_vrrp.py | 11 | 13801 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
gigglearrows/anniesbot | pajbot/models/timer.py | 1 | 6625 | import json
import logging
from pajbot.models.db import DBManager, Base
from pajbot.models.action import ActionParser
from pajbot.tbutil import find
from sqlalchemy import orm
from sqlalchemy import Column, Integer, String, Boolean
from sqlalchemy.dialects.mysql import TEXT
log = logging.getLogger('pajbot')
class ... | mit |
mgit-at/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_net.py | 6 | 19095 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterf... | gpl-3.0 |
frreiss/tensorflow-fred | tensorflow/python/kernel_tests/distributions/bijector_test.py | 6 | 11167 | # 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 |
SerCeMan/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/db/models/sql/aggregates.py | 309 | 1804 | from django.db.models.sql.aggregates import *
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql.conversion import GeomField
class GeoAggregate(Aggregate):
# Default SQL template for spatial aggregates.
sql_template = '%(function)s(%(field)s)'
# Conversion ... | apache-2.0 |
tunneln/CarnotKE | jyhton/lib-python/2.7/test/test_userlist.py | 136 | 1894 | # Check every path through every method of UserList
from UserList import UserList
from test import test_support, list_tests
class UserListTest(list_tests.CommonTest):
type2test = UserList
def test_getslice(self):
super(UserListTest, self).test_getslice()
l = [0, 1, 2, 3, 4]
u = self.t... | apache-2.0 |
torqie/esportscms | node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | lgpl-3.0 |
sinkuri256/python-for-android | python3-alpha/python3-src/Lib/importlib/test/util.py | 46 | 3919 | from contextlib import contextmanager
import imp
import os.path
from test import support
import unittest
import sys
CASE_INSENSITIVE_FS = True
# Windows is the only OS that is *always* case-insensitive
# (OS X *can* be case-sensitive).
if sys.platform not in ('win32', 'cygwin'):
changed_name = __file__.upper()
... | apache-2.0 |
white-lab/pyproteome | brainrnaseq/__init__.py | 1 | 2373 |
from . import cache, mapping, enrichments
CELL_TYPE_COLS = {
'Homo sapiens': {
'Astrocyte': [
'8yo',
'13yo', '16yo', '21yo.1', '22yo.1', '35yo', '47yo', '51yo', '53yo',
'60yo', '63yo - 1', '63yo - 2',
],
'Neuron': [
'25yo',
],
... | bsd-2-clause |
mdj2/django | django/utils/dates.py | 488 | 2237 | "Commonly-used date structures"
from django.utils.translation import ugettext_lazy as _, pgettext_lazy
WEEKDAYS = {
0:_('Monday'), 1:_('Tuesday'), 2:_('Wednesday'), 3:_('Thursday'), 4:_('Friday'),
5:_('Saturday'), 6:_('Sunday')
}
WEEKDAYS_ABBR = {
0:_('Mon'), 1:_('Tue'), 2:_('Wed'), 3:_('Thu'), 4:_('Fri')... | bsd-3-clause |
arthur-e/gass | public/views.py | 1 | 3181 | import datetime
from django.shortcuts import render_to_response
from django.http import HttpResponse
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist
from django.views.decorators.cache import cache_page
from public.models import News
from bering.models import Station, Ablation
... | mit |
duducosmos/pgs4a | python-install/lib/python2.7/encodings/idna.py | 540 | 8474 | # This module implements the RFCs 3490 (IDNA) and 3491 (Nameprep)
import stringprep, re, codecs
from unicodedata import ucd_3_2_0 as unicodedata
# IDNA section 3.1
dots = re.compile(u"[\u002E\u3002\uFF0E\uFF61]")
# IDNA section 5
ace_prefix = "xn--"
uace_prefix = unicode(ace_prefix, "ascii")
# This assumes query st... | lgpl-2.1 |
synthesio/infra-ovh-ansible-module | plugins/modules/dedicated_server_install.py | 1 | 2843 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils.basic import AnsibleModule
DOCUMENTATION = '''
---
module: dedicated_server_install
short_description: Install a new dedicated server
description:
- Install ... | mit |
GunoH/intellij-community | python/helpers/pycharm/noserunner.py | 7 | 2705 | import sys
import os
import sys
sys.stderr.write("Warning: You are using test runners in legacy mode\n. "
"That means you have 'python.tests.enableUniversalTests=false' in registry.\n"
"This mode will be dropped in 2021. Consider removing this entry from registry and migrating to new t... | apache-2.0 |
balloob/home-assistant | homeassistant/components/ted5000/sensor.py | 16 | 3201 | """Support gathering ted5000 information."""
from datetime import timedelta
import logging
import requests
import voluptuous as vol
import xmltodict
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT, POWER_WATT, VOLT
from homeassistant.helpers ... | apache-2.0 |
Lujeni/ansible | test/integration/targets/azure_rm_keyvault/lookup_plugins/azure_service_principal_attribute.py | 84 | 3519 | # (c) 2018 Yunge Zhu, <yungez@microsoft.com>
# (c) 2017 Ansible Project
# 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
DOCUMENTATION = """
lookup: azure_service_principal_attribute
req... | gpl-3.0 |
certik/sfepy | tests/test_parsing.py | 1 | 3180 | from sfepy.base.testing import TestCommon
##
# 16.07.2007, c
class Test( TestCommon ):
##
# 16.07.2007, c
def from_conf( conf, options ):
return Test( conf = conf, options = options )
from_conf = staticmethod( from_conf )
##
# c: 16.07.2007, r: 08.07.2008
def test_parse_equations(... | bsd-3-clause |
kuza55/keras | keras/layers/advanced_activations.py | 7 | 9818 | from .. import initializations
from ..engine import Layer
from .. import backend as K
import numpy as np
class LeakyReLU(Layer):
'''Special version of a Rectified Linear Unit
that allows a small gradient when the unit is not active:
`f(x) = alpha * x for x < 0`,
`f(x) = x for x >= 0`.
# Input sha... | mit |
rruebner/odoo | addons/hr_payroll_account/wizard/__init__.py | 433 | 1116 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
yashsharan/sympy | sympy/physics/vector/tests/test_printing.py | 24 | 5857 | # -*- coding: utf-8 -*-
from sympy import symbols, sin, cos, sqrt, Function
from sympy.core.compatibility import u_decode as u
from sympy.physics.vector import ReferenceFrame, dynamicsymbols
from sympy.physics.vector.printing import (VectorLatexPrinter, vpprint)
# TODO : Figure out how to make the pretty printing tes... | bsd-3-clause |
marc-sensenich/ansible | test/integration/targets/mail/files/smtpserver.py | 54 | 2023 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Dag Wieers (@dagwieers) <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
import asyncore
import os.pa... | gpl-3.0 |
qedi-r/home-assistant | homeassistant/components/imap/sensor.py | 3 | 5924 | """IMAP sensor support."""
import asyncio
import logging
from aioimaplib import IMAP4_SSL, AioImapException
import async_timeout
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,
CONF_USERNAME,
... | apache-2.0 |
gangadhar-kadam/helpdesk-erpnext | erpnext/buying/doctype/purchase_order/test_purchase_order.py | 8 | 4347 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
import frappe.defaults
from frappe.utils import flt, add_days, nowdate
from erpnext.buying.doctype.purchase_order.purchase... | agpl-3.0 |
Shanec132006/lab3 | lib/werkzeug/useragents.py | 317 | 5300 | # -*- coding: utf-8 -*-
"""
werkzeug.useragents
~~~~~~~~~~~~~~~~~~~
This module provides a helper to inspect user agent strings. This module
is far from complete but should work for most of the currently available
browsers.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more deta... | apache-2.0 |
xxsergzzxx/python-for-android | python3-alpha/python3-src/Tools/scripts/db2pickle.py | 116 | 3630 | #!/usr/bin/env python3
"""
Synopsis: %(prog)s [-h|-g|-b|-r|-a] dbfile [ picklefile ]
Convert the database file given on the command line to a pickle
representation. The optional flags indicate the type of the database:
-a - open using dbm (any supported format)
-b - open as bsddb btree file
-d - open as... | apache-2.0 |
xuzhao1211/OnlineExam | misago/users/api/auth.py | 7 | 7485 | from django.contrib import auth
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
from django.views.decorators.csrf import csrf_protect
from rest_framework import status
from rest_framework.decorators import api_view, permission_classes
from rest_framework.response i... | gpl-2.0 |
neerajvashistha/pa-dude | lib/python2.7/site-packages/docutils/readers/standalone.py | 197 | 2340 | # $Id: standalone.py 4802 2006-11-12 18:02:17Z goodger $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Standalone file Reader for the reStructuredText markup syntax.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import frontend, rea... | mit |
programming086/omim | 3party/protobuf/gtest/scripts/pump.py | 2471 | 23673 | #!/usr/bin/env python
#
# Copyright 2008, 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... | apache-2.0 |
robtherad/BC-Mod | tools/make.py | 1 | 56000 | #!/usr/bin/env python3
# vim: set fileencoding=utf-8 :
# make.py
# An Arma 3 addon build system
# Created by ACE 3 team, modified by BC: https://github.com/acemod/ACE3
###############################################################################
# The MIT License (MIT)
# Copyright (c) 2013-2014 Ryan Schultz
# Per... | gpl-3.0 |
waidyanatha/pingsam | visualize.py | 1 | 8668 | import numpy as np
import datetime as dtm
from dateutil import rrule
import pandas as pd
import csv
import matplotlib.pylab as plt
import sys, os
#lets first create the csv file
#
#change this to actual csv file name
pingfile="weeklylogs.csv"
#paramters @plotinterval = 10 minutes
plotinterval = 10
#csv file columns
col... | mit |
accton/onie | contrib/oce/test-onie.py | 5 | 28056 | #!/usr/bin/env python
# -----------------------------------------------------------------------------
# Copyright (C) 2014-2016 Carlos Cardenas <carlos@cumulusnetworks.com>
#
# SPDX-License-Identifier: GPL-2.0
#
# -----------------------------------------------------------------------------
import logging
import ... | gpl-2.0 |
pbauman/libmesh | doc/statistics/libmesh_pagehits.py | 1 | 10542 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
# Import stuff for working with dates
from datetime import datetime
from matplotlib.dates import date2num
# Hits/month, pages, and gigabytes served.
# To get the Google analytics data:
# .) Go to analytics.google.com.
# .) There should be (as o... | lgpl-2.1 |
xpandan/elasticsearch | dev-tools/create_bwc_index.py | 60 | 14994 | # Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | apache-2.0 |
ace02000/pyload | module/gui/LinkDock.py | 41 | 1915 | # -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program is distributed in ... | gpl-3.0 |
not-na/peng3d | peng3d/gui/layout.py | 1 | 8877 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# layout.py
#
# Copyright 2020 notna <notna@apparat.org>
#
# This file is part of peng3d.
#
# peng3d 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, ei... | gpl-2.0 |
dkubiak789/odoo | addons/l10n_fr_hr_payroll/__init__.py | 430 | 1086 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
ferabra/edx-platform | common/test/acceptance/pages/studio/settings_group_configurations.py | 51 | 10070 | """
Course Group Configurations page.
"""
from bok_choy.promise import EmptyPromise
from ..common.utils import confirm_prompt
from .course_page import CoursePage
class GroupConfigurationsPage(CoursePage):
"""
Course Group Configurations page.
"""
url_path = "group_configurations"
experiment_group... | agpl-3.0 |
ahb0327/intellij-community | python/lib/Lib/site-packages/django/contrib/staticfiles/management/commands/runserver.py | 71 | 1267 | from optparse import make_option
from django.conf import settings
from django.core.management.commands.runserver import BaseRunserverCommand
from django.contrib.staticfiles.handlers import StaticFilesHandler
class Command(BaseRunserverCommand):
option_list = BaseRunserverCommand.option_list + (
make_opti... | apache-2.0 |
ahmed-mahran/hue | desktop/core/ext-py/simplejson/setup.py | 45 | 3648 | #!/usr/bin/env python
from ez_setup import use_setuptools
import sys
if 'cygwin' in sys.platform.lower():
min_version='0.6c6'
else:
min_version='0.6a9'
try:
use_setuptools(min_version=min_version)
except TypeError:
# If a non-local ez_setup is already imported, it won't be able to
# use the min_versi... | apache-2.0 |
szilveszter/django | tests/validation/models.py | 139 | 4590 | from __future__ import unicode_literals
from datetime import datetime
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
def validate_answer_to_universe(value):
if value != 42:
raise ValidationError('This is not t... | bsd-3-clause |
agiacomolli/odfpy | contrib/html2odt/htmlstyles.py | 2 | 5426 | from odf.style import Style, ParagraphProperties, TextProperties
def addStandardStyles(doc):
style = Style(name="Standard", family="paragraph", attributes={'class':"text"})
doc.styles.addElement(style)
style = Style(name="Text_20_body", displayname="Text body", family="paragraph", parentstylename="Standar... | apache-2.0 |
cs-au-dk/Artemis | WebKit/Tools/Scripts/webkitpy/style/main.py | 2 | 6977 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | gpl-3.0 |
Kingclove/info3180project2 | server/lib/flask/ctx.py | 776 | 14266 | # -*- coding: utf-8 -*-
"""
flask.ctx
~~~~~~~~~
Implements the objects required to keep the context.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
from functools import update_wrapper
from werkzeug.excep... | apache-2.0 |
franosincic/edx-platform | lms/djangoapps/course_blocks/__init__.py | 24 | 1366 | """
The Course Blocks app, built upon the Block Cache framework in
openedx.core.lib.block_cache, is a higher layer django app in LMS that
provides additional context of Courses and Users (via usage_info.py) with
implementations for Block Structure Transformers that are related to
block structure course access.
As desc... | agpl-3.0 |
ubuntuvim/google-blog-converters-appengine | src/wordpress2blogger/wp2b.py | 30 | 19371 | #!/usr/bin/env python
# Copyright 2008 Google 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.txt
#
# Unless required by applicable law or... | apache-2.0 |
akchinSTC/systemml | src/main/python/systemml/mllearn/__init__.py | 13 | 1815 | #-------------------------------------------------------------
#
# 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... | apache-2.0 |
hellhovnd/dentexchange | dentexchange/apps/employer/forms.py | 2 | 5587 | # -*- coding:utf-8 -*-
from django import forms
from libs.mixins.forms import (MeaningfulEmptyValueFormMixin,
UserInitializationFormMixin)
from libs import constants as lib_constants
from employee import constants as employee_constants
from .models import Business, Praxis, JobPosting
from . import strings, constan... | bsd-3-clause |
beatrizjesus/my-first-blog | pasta/Lib/site-packages/django/core/mail/backends/console.py | 696 | 1477 | """
Email backend that writes messages to console instead of sending them.
"""
import sys
import threading
from django.core.mail.backends.base import BaseEmailBackend
from django.utils import six
class EmailBackend(BaseEmailBackend):
def __init__(self, *args, **kwargs):
self.stream = kwargs.pop('stream',... | mit |
liu602348184/django | django/views/decorators/cache.py | 586 | 2304 | from functools import wraps
from django.middleware.cache import CacheMiddleware
from django.utils.cache import add_never_cache_headers, patch_cache_control
from django.utils.decorators import (
available_attrs, decorator_from_middleware_with_args,
)
def cache_page(*args, **kwargs):
"""
Decorator for view... | bsd-3-clause |
bop/foundation | lib/python2.7/site-packages/django/contrib/messages/storage/base.py | 399 | 6134 | 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... | gpl-2.0 |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/sympy/physics/mechanics/tests/test_rigidbody.py | 42 | 2393 | from sympy import symbols
from sympy.physics.mechanics import Point, ReferenceFrame, Dyadic, RigidBody
from sympy.physics.mechanics import dynamicsymbols, outer
from sympy.physics.mechanics import inertia_of_point_mass
def test_rigidbody():
m, m2, v1, v2, v3, omega = symbols('m m2 v1 v2 v3 omega')
A = Referen... | mit |
mfjb/scikit-learn | benchmarks/bench_sample_without_replacement.py | 397 | 8008 | """
Benchmarks for sampling without replacement of integer.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import operator
import matplotlib.pyplot as plt
import numpy as np
import random
from sklearn.externals.six.moves i... | bsd-3-clause |
proxysh/Safejumper-for-Desktop | buildlinux/env64/lib/python2.7/site-packages/cffi/vengine_cpy.py | 21 | 41373 | #
# DEPRECATED: implementation for ffi.verify()
#
import sys, imp
from . import model, ffiplatform
class VCPythonEngine(object):
_class_key = 'x'
_gen_python_module = True
def __init__(self, verifier):
self.verifier = verifier
self.ffi = verifier.ffi
self._struct_pending_verificat... | gpl-2.0 |
Laimiux/mydeatree | django/contrib/localflavor/ro/ro_counties.py | 428 | 1231 | # -*- coding: utf-8 -*-
"""
A list of Romanian counties as `choices` in a formfield.
This exists as a standalone file so that it's only imported into memory when
explicitly needed.
"""
COUNTIES_CHOICES = (
('AB', u'Alba'),
('AR', u'Arad'),
('AG', u'Argeş'),
('BC', u'Bacău'),
('BH', u'Bihor'),
... | bsd-3-clause |
linked67/p2pool-myrq | p2pool/util/fixargparse.py | 283 | 1630 | from __future__ import absolute_import
import argparse
import sys
class FixedArgumentParser(argparse.ArgumentParser):
'''
fixes argparse's handling of empty string arguments
and changes @filename behaviour to accept multiple arguments on each line
'''
def _read_args_from_files(self, arg_strings)... | gpl-3.0 |
weiawe/django | tests/template_tests/filter_tests/test_striptags.py | 324 | 1338 | from django.template.defaultfilters import striptags
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class StriptagsTests(SimpleTestCase):
@setup({'striptags01': '{{ a|striptags }} {{ b|striptags }}'})
def test_striptags01(self):
output ... | bsd-3-clause |
timopulkkinen/BubbleFish | chrome/common/extensions/docs/server2/url_constants.py | 5 | 1070 | # 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.
GITHUB_URL = 'https://api.github.com/repos/GoogleChrome/chrome-app-samples'
GITHUB_BASE = 'https://github.com/GoogleChrome/chrome-app-samples/tree/master... | bsd-3-clause |
Vishluck/sympy | sympy/series/tests/test_series.py | 58 | 5041 | from sympy import sin, cos, exp, E, series, oo, S, Derivative, O, Integral, \
Function, log, sqrt, Symbol, Subs, pi, symbols
from sympy.abc import x, y, n, k
from sympy.utilities.pytest import raises
from sympy.core.compatibility import range
from sympy.series.gruntz import calculate_series
def test_sin():
e1... | bsd-3-clause |
crichardson17/starburst_atlas | Low_resolution_sims/Dusty_LowRes/Padova_inst/padova_inst_2/fullgrid/Rest.py | 30 | 9192 | import csv
import matplotlib.pyplot as plt
from numpy import *
import scipy.interpolate
import math
from pylab import *
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
import matplotlib.patches as patches
from matplotlib.path import Path
import os
# --------------------------------------------------... | gpl-2.0 |
Lucifer-Kim/scrapy | tests/test_feedexport.py | 112 | 10658 | from __future__ import absolute_import
import os
import csv
import json
from io import BytesIO
import tempfile
import shutil
import six
from six.moves.urllib.parse import urlparse
from zope.interface.verify import verifyObject
from twisted.trial import unittest
from twisted.internet import defer
from scrapy.crawler im... | bsd-3-clause |
pudo/krauler | krauler/mf.py | 1 | 2609 | import os
import logging
from lxml import html
from dateutil.parser import parse
import metafolder
from krauler.threaded import ThreadedKrauler
from krauler.signals import on_meta
log = logging.getLogger(__name__)
class MetaFolderKrauler(ThreadedKrauler):
@property
def metafolder(self):
if not hasa... | mit |
OmegaDroid/django-jsx | tests/test_template_client.py | 2 | 2400 | from django.test import TestCase
from django_jsx.client import template_client
from django.conf import settings
from os.path import join
class MockSock():
def send(self, message):
pass
def recv(self, buffer_size):
return b''
def mock_connect():
return MockSock()
class TestTemplateClie... | bsd-3-clause |
andrewgiessel/folium | folium/utilities.py | 1 | 19979 | # -*- coding: utf-8 -*-
"""
Utilities
-------
Utility module for Folium helper functions.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import time
import math
import zlib
import struct
import json
import base64
from jinja2 import Environment, Packa... | mit |
pe-suke/ansible | contrib/inventory/ssh_config.py | 160 | 3979 | #!/usr/bin/env python
# (c) 2014, Tomas Karasek <tomas.karasek@digile.fi>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | gpl-3.0 |
ryuunosukeyoshi/PartnerPoi-Bot | lib/pip/_vendor/requests/packages/chardet/sbcharsetprober.py | 2927 | 4793 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
MicroTrustRepos/microkernel | src/l4/pkg/python/contrib/Lib/idlelib/textView.py | 72 | 3246 | """Simple text browser for IDLE
"""
from Tkinter import *
import tkMessageBox
class TextViewer(Toplevel):
"""A simple text viewer dialog for IDLE
"""
def __init__(self, parent, title, text):
"""Show the given text in a scrollable window with a 'close' button
"""
Toplevel.__init_... | gpl-2.0 |
mpe/powerpc | tools/testing/selftests/bpf/test_offload.py | 94 | 51437 | #!/usr/bin/python3
# Copyright (C) 2017 Netronome Systems, Inc.
# Copyright (c) 2019 Mellanox Technologies. All rights reserved
#
# This software is licensed under the GNU General License Version 2,
# June 1991 as shown in the file COPYING in the top-level directory of this
# source tree.
#
# THE COPYRIGHT HOLDERS AND... | gpl-2.0 |
asm666/sympy | sympy/functions/elementary/complexes.py | 4 | 35148 | from __future__ import print_function, division
from sympy.core import S, Add, Mul, sympify, Symbol, Dummy
from sympy.core.compatibility import u
from sympy.core.exprtools import factor_terms
from sympy.core.function import (Function, Derivative, ArgumentIndexError,
AppliedUndef)
from sympy.core.numbers import pi
... | bsd-3-clause |
tclose/PyPe9 | pype9/simulate/neuron/simulation.py | 2 | 5523 | from builtins import object
from nineml import units as un
import ctypes
from pyNN.neuron import (
setup as pyNN_setup, run as pyNN_run, end as pyNN_end, state as pyNN_state)
from pyNN.neuron.simulator import initializer as pyNN_initializer
from pype9.simulate.common.simulation import Simulation as BaseSimulation
f... | mit |
FDelporte/PiGameConsole | Main.py | 1 | 5104 | '''
Created on 22/09/2017
@author: Frank Delporte
'''
import thread
import Tkinter as tk
import tkFont
import time
from ButtonHandler import *
from KeyReader import *
from PongGui import *
from SlideShow import *
from ConsoleMenu import *
from Legend import *
try:
import keyboard # pip install keyboard
... | apache-2.0 |
xiiicyw/Data-Wrangling-with-MongoDB | Lesson_4_Problem_Set/03-Updating_Schema/update.py | 1 | 3482 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
In this problem set you work with another type of infobox data, audit it, clean it,
come up with a data model, insert it into a MongoDB and then run some queries against your database.
The set contains data about Arachnid class.
The data is already in the database. Bu... | agpl-3.0 |
Gentlemanlylad5/googlepersonfinder | tests/server_tests.py | 7 | 11704 | #!/usr/bin/python2.7
# Copyright 2012 Google 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 ... | apache-2.0 |
ajoaoff/django | tests/template_tests/filter_tests/test_linebreaks.py | 310 | 1920 | from django.template.defaultfilters import linebreaks_filter
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class LinebreaksTests(SimpleTestCase):
"""
The contents in "linebreaks" are escaped according to the current
autoescape setting.
... | bsd-3-clause |
GustavoRD78/78Kernel-Android-N-Developer-Preview-3 | 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 |
jalavik/plotextractor | plotextractor/version.py | 1 | 1233 | # -*- coding: utf-8 -*-
#
# This file is part of plotextractor.
# Copyright (C) 2015 CERN.
#
# plotextractor 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 optio... | gpl-2.0 |
xianjunzhengbackup/Cloud-Native-Python | env/lib/python3.5/site-packages/pip/download.py | 334 | 32171 | from __future__ import absolute_import
import cgi
import email.utils
import getpass
import json
import logging
import mimetypes
import os
import platform
import re
import shutil
import sys
import tempfile
try:
import ssl # noqa
HAS_TLS = True
except ImportError:
HAS_TLS = False
from pip._vendor.six.move... | mit |
lumenosys/lumenosys-adi-linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
ttm/oscEmRede | venv/lib/python2.7/site-packages/networkx/algorithms/centrality/katz.py | 20 | 9049 | """
Katz centrality.
"""
# Copyright (C) 2004-2013 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.utils import *
__author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov)',... | gpl-3.0 |
powerjg/gem5-ci-test | src/arch/x86/isa/insts/simd128/__init__.py | 91 | 2317 | # 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 |
farhaadila/django-cms | cms/migrations/0001_initial.py | 38 | 10402 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from cms.models import ACCESS_CHOICES, Page
from cms.utils.conf import get_cms_setting
from django.conf import settings
from django.db import models, migrations
import django.utils.timezone
from django.utils.translation import ugettext_lazy as _
template... | bsd-3-clause |
gustavooferreira/oandaApi | doc/conf.py | 2 | 10025 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Oanda REST API documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 7 16:16:07 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in th... | mit |
adammenges/statsmodels | statsmodels/tsa/statespace/representation.py | 16 | 32497 | """
State Space Representation
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from .tools import (
find_best_blas_type, prefix_dtype_map, prefix_statespace_map,
validate_matrix_shape, validate_vector_shape
)
class OptionWra... | bsd-3-clause |
jallohm/django | tests/custom_pk/fields.py | 379 | 1731 | import random
import string
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class MyWrapper(object):
def __init__(self, value):
self.value = value
def __repr__(self):
return "<%s: %s>" % (sel... | bsd-3-clause |
zhenzhai/edx-platform | common/djangoapps/student/helpers.py | 11 | 10582 | """Helpers for the student app. """
from datetime import datetime
import urllib
from pytz import UTC
from django.core.urlresolvers import reverse, NoReverseMatch
import third_party_auth
from lms.djangoapps.verify_student.models import VerificationDeadline, SoftwareSecurePhotoVerification
from course_modes.models impo... | agpl-3.0 |
lhilt/scipy | scipy/odr/__init__.py | 7 | 4232 | """
=================================================
Orthogonal distance regression (:mod:`scipy.odr`)
=================================================
.. currentmodule:: scipy.odr
Package Content
===============
.. autosummary::
:toctree: generated/
Data -- The data to fit.
RealData -- Dat... | bsd-3-clause |
direvus/ansible | lib/ansible/modules/cloud/ovirt/ovirt_vmpool.py | 50 | 8013 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 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
#... | gpl-3.0 |
dreamsxin/kbengine | kbe/res/scripts/common/Lib/email/mime/application.py | 414 | 1256 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Keith Dart
# Contact: email-sig@python.org
"""Class representing application/* type MIME documents."""
__all__ = ["MIMEApplication"]
from email import encoders
from email.mime.nonmultipart import MIMENonMultipart
class MIMEApplication(MIMENonMultipart)... | lgpl-3.0 |
karmix/anaconda | tests/dracut_tests/test_driver_updates.py | 2 | 27255 | # test_driver_updates.py - unittests for driver_updates.py
# Ignore any interruptible calls
# pylint: disable=interruptible-system-call
import unittest
try:
import unittest.mock as mock
except ImportError:
import mock
import os
import tempfile
import shutil
import sys
sys.path.append(os.path.normpath(os.pat... | gpl-2.0 |
elainenaomi/sciwonc-dataflow-examples | sbbd2016/experiments/1-postgres/3_workflow_full_10files_primary_nosh_nors_annot_with_proj_3s/pegasus.bDkvI/pegasus-4.6.0/lib/pegasus/externals/python/boto/glacier/layer1.py | 121 | 60796 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal ... | gpl-3.0 |
rogerscristo/BotFWD | env/lib/python3.6/site-packages/telegram/payment/labeledprice.py | 1 | 1817 | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as publish... | mit |
Khan/reviewboard | reviewboard/notifications/email.py | 2 | 13727 | import logging
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.mail import EmailMultiAlternatives
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.utils import timezone
from djblets.siteconfig.models import SiteC... | mit |
yunhaowang/IDP-APA | utilities/py_idpapa_assign_sr.py | 1 | 7753 | #!/usr/bin/env python
import sys,re,time,argparse
from multiprocessing import cpu_count,Pool
def main(args):
# print >>sys.stdout, "Start analysis: " + time.strftime("%a,%d %b %Y %H:%M:%S")
output_gpd = args.output
iso_list = get_iso_info(args.isoform)
p = Pool(processes=args.cpu)
csize = 100
results = p.imap(fun... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.