code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
from django.db import connection
from django.db.backends.ddl_references import (
Columns, Expressions, ForeignKeyName, IndexName, Statement, Table,
)
from django.db.models import ExpressionList, F
from django.db.models.functions import Upper
from django.db.models.indexes import IndexExpression
from django.test impo... | wkschwartz/django | tests/backends/test_ddl_references.py | Python | bsd-3-clause | 11,306 |
###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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
##
## ht... | frivoal/presto-testo | wpt/websockets/autobahn/oberstet-Autobahn-643d2ee/lib/python/autobahn/case/case9_3_9.py | Python | bsd-3-clause | 1,251 |
###
# Copyright (c) 2005, Jeremiah Fincher
# 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 conditi... | tecan/xchat-rt | plugins/scripts/encryption/supybot-code-6361b1e856ebbc8e14d399019e2c53a35f4e0063/plugins/Alias/config.py | Python | gpl-2.0 | 2,179 |
# -*- 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... | BorgERP/borg-erp-6of3 | server/openerp/report/render/simple.py | Python | agpl-3.0 | 3,164 |
"""
This config file runs the simplest dev environment"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
from .common import *
from logsettings import get_logger_config
# import settings from LMS for consistent ... | c0710204/edx-platform | cms/envs/dev.py | Python | agpl-3.0 | 6,206 |
# (c) 2014 Michael DeHaan, <michael@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | M0ses/ansible | v2/ansible/parsing/mod_args.py | Python | gpl-3.0 | 10,166 |
# coding: utf-8
from __future__ import absolute_import, division, print_function, with_statement
import re
import sys
import datetime
import tornado.escape
from tornado.escape import utf8
from tornado.util import raise_exc_info, Configurable, exec_in, ArgReplacer, timedelta_to_seconds, import_object, re_unescape, PY3
... | KILLER-CHIEF/uqcs-hackathon-2016 | tornado/test/util_test.py | Python | gpl-3.0 | 7,283 |
# 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
# d... | takeshineshiro/nova | nova/tests/unit/virt/libvirt/volume/test_glusterfs.py | Python | apache-2.0 | 6,687 |
#!/usr/bin/env python
__all__ = ['facebook_download']
from ..common import *
import json
def facebook_download(url, output_dir='.', merge=True, info_only=False):
html = get_html(url)
title = r1(r'<title id="pageTitle">(.+) \| Facebook</title>', html)
s2 = parse.unquote(unicodize(r1(r'\["params","([^"]*... | rain1988/you-get | src/you_get/extractors/facebook.py | Python | mit | 796 |
# Copyright 2009 Matt Chaput. All rights reserved.
#
# 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 the... | cscott/wikiserver | whoosh/filedb/filestore.py | Python | gpl-2.0 | 6,771 |
from django.utils.translation import ugettext_lazy as _
#: http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska
DISTRICT_CHOICES = (
('BB', _('Banska Bystrica')),
('BS', _('Banska Stiavnica')),
('BJ', _('Bardejov')),
('BN', _('Banovce nad Bebravou')),
('BR', _('Brezno')),
(... | rodrigolucianocosta/ControleEstoque | rOne/Storage101/django-localflavor/django-localflavor-1.3/localflavor/sk/sk_districts.py | Python | gpl-3.0 | 2,417 |
# Copyright 2012,2013 Christoph Reiter
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
VERSION = (0, 0, 11, ... | jackkiej/SickRage | lib/pgi/const.py | Python | gpl-3.0 | 355 |
import warnings
from pymysql.tests import base
import pymysql.cursors
class CursorTest(base.PyMySQLTestCase):
def setUp(self):
super(CursorTest, self).setUp()
conn = self.connections[0]
self.safe_create_table(
conn,
"test", "create table test (data varchar(10))",
... | zwChan/VATEC | ~/eb-virt/Lib/site-packages/pymysql/tests/test_cursor.py | Python | apache-2.0 | 4,013 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | pgandhi999/spark | python/pyspark/mllib/tests/test_stat.py | Python | apache-2.0 | 8,008 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Check Point 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 o... | anryko/ansible | lib/ansible/modules/network/check_point/cp_mgmt_service_rpc_facts.py | Python | gpl-3.0 | 4,158 |
from typing import NamedTuple
MyTuple = NamedTuple('MyTuple', [('foo', int)])
def func():
return MyTuple(foo=42)
| smmribeiro/intellij-community | python/testData/intentions/PyAnnotateVariableTypeIntentionTest/AnnotationTypingNamedTupleInOtherFile/lib.py | Python | apache-2.0 | 120 |
"""SCons.Scanner.RC
This module implements the depenency scanner for RC (Interface
Definition Language) files.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this softwar... | houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib64/scons-2.1.0/SCons/Scanner/RC.py | Python | gpl-2.0 | 2,075 |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import AuthIdentity, AuthProvider, OrganizationMember
from sentry.testutils import AuthProviderTestCase, PermissionTestCase
class OrganizationAuthSettingsPermissionTest(PermissionTestCase):
def setUp(self):
... | jokey2k/sentry | tests/sentry/web/frontend/test_organization_auth_settings.py | Python | bsd-3-clause | 3,466 |
# -*- coding: utf-8 -*-
"""
pygments.lexers._lasso_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Built-in Lasso types, traits, methods, and members.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
BUILTINS = {
'Types': (
'array... | GarySparrow/mFlaskWeb | venv/Lib/site-packages/pygments/lexers/_lasso_builtins.py | Python | mit | 134,321 |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
lastchange.py -- Chromium revision fetching utility.
"""
import re
import optparse
import os
import subprocess
import sys
_GI... | s20121035/rk3288_android5.1_repo | external/chromium_org/build/util/lastchange.py | Python | gpl-3.0 | 8,872 |
#!/usr/bin/python
# (c) 2016, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | hryamzik/ansible | lib/ansible/modules/storage/netapp/netapp_e_volume.py | Python | gpl-3.0 | 22,936 |
# -*- coding: utf-8 -*-
"""
E2E tests for the LMS.
"""
from .helpers import UniqueCourseTest
from ..pages.studio.auto_auth import AutoAuthPage
from ..pages.lms.courseware import CoursewarePage
from ..pages.lms.annotation_component import AnnotationComponentPage
from ..fixtures.course import CourseFixture, XBlockFixtur... | ahmadiga/min_edx | common/test/acceptance/tests/test_annotatable.py | Python | agpl-3.0 | 5,304 |
# -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | adieu/zerorpc-python | tests/test_heartbeat.py | Python | mit | 10,552 |
"""
TODO: add a docstring.
"""
from pystache import TemplateSpec
class UnicodeInput(TemplateSpec):
template_encoding = 'utf8'
def age(self):
return 156
| zzeleznick/zDjango | venv/lib/python2.7/site-packages/pystache/tests/examples/unicode_input.py | Python | mit | 174 |
def foo():
a = 1
b = 2
<caret>
x = 42 | asedunov/intellij-community | python/testData/copyPaste/UseExistingIndentWhenCaretAtFirstColumn.dst.py | Python | apache-2.0 | 45 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes, os
import webnotes.model.doc
from webnotes.modules import scrub, get_module_path, lower_case_files_for, scrub_dt_dn
from webnotes.plugins import get_plugin_p... | gangadhar-kadam/nassimlib | webnotes/modules/export_file.py | Python | mit | 3,110 |
from mongoengine.common import _import_class
from mongoengine.connection import DEFAULT_CONNECTION_NAME, get_db
__all__ = ("switch_db", "switch_collection", "no_dereference",
"no_sub_classes", "query_counter")
class switch_db(object):
""" switch_db alias context manager.
Example ::
# Re... | elioth010/lugama | venv/lib/python2.7/site-packages/mongoengine/context_managers.py | Python | gpl-2.0 | 6,871 |
class MyClass(object):
def method(se<caret>lf):
pass
| jwren/intellij-community | python/testData/intentions/paramTypeInDocstringNotSuggestedForSelf.py | Python | apache-2.0 | 65 |
# test for-else statement
# test optimised range with simple else
for i in range(2):
print(i)
else:
print('else')
# test optimised range with break over else
for i in range(2):
print(i)
break
else:
print('else')
# test nested optimised range with continue in the else
for i in range(4):
print(... | AriZuu/micropython | tests/basics/for_else.py | Python | mit | 716 |
# Copyright 2012 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | joostvdg/jenkins-job-builder | setup.py | Python | apache-2.0 | 686 |
import pytest
from utils import TestEnvironment, http, HTTP_OK, COLOR, CRLF
from httpie import ExitStatus
from httpie.output.formatters.colors import get_lexer
class TestVerboseFlag:
def test_verbose(self, httpbin):
r = http('--verbose',
'GET', httpbin.url + '/get', 'test-header:__test__... | alfcrisci/httpie | tests/test_output.py | Python | bsd-3-clause | 4,568 |
# 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():
if frappe.db.exists('Module Def', 'Fleet Management'):
frappe.db.sql("""delete from `tabModule Def`
where module_nam... | manassolanki/erpnext | erpnext/patches/v7_2/delete_fleet_management_module_def.py | Python | gpl-3.0 | 346 |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
#-------------------------------------------------------------------
# tarfile.py
#-------------------------------------------------------------------
# Copyright (C) 2002 Lars Gustäbel <lars@gustaebel.de>
# All rights reserved.
#
# Permission is hereby granted, fre... | leighpauls/k2cro4 | third_party/python_26/Lib/tarfile.py | Python | bsd-3-clause | 86,614 |
#!/usr/bin/env python
#
# Convert image to Javascript compatible base64 Data URI
# Copyright 2011 Joel Martin
# Licensed under MPL 2.0 (see docs/LICENSE.MPL-2.0)
#
import sys, base64
try:
from PIL import Image
except:
print "python PIL module required (python-imaging package)"
sys.exit(1)
if len(sys.ar... | SoftwareKing/zstack-dashboard | zstack_dashboard/static/templates/console/utils/img2js.py | Python | apache-2.0 | 908 |
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for L{jelly} object serialization.
"""
import datetime
try:
import decimal
except ImportError:
decimal = None
from twisted.spread import jelly, pb
from twisted.python.compat import set, frozenset
from twisted.t... | eunchong/build | third_party/twisted_10_2/twisted/test/test_jelly.py | Python | bsd-3-clause | 18,738 |
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Vincent Michel <vincent.michel@inria.fr>
# Gilles Louppe <g.louppe@gmail.com>
#
# License: BSD 3 clause
"""Recursive feature elimination for feature ranking"""
import warnings
import numpy as np
from ..utils import check_X_y, safe_sqr
fro... | beepee14/scikit-learn | sklearn/feature_selection/rfe.py | Python | bsd-3-clause | 17,509 |
[foo, bar] = (1, 2)
print(foo)
# <ref>
| asedunov/intellij-community | python/testData/resolve/ListAssignment.py | Python | apache-2.0 | 44 |
# -*- 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... | diogocs1/comps | web/addons/crm_partner_assign/crm_lead.py | Python | apache-2.0 | 2,985 |
#!/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.
"""
mass-rename: update source files (gyp lists, #includes) to reflect
a rename. Expects "git diff --cached -M" to list a bunch of ren... | GeyerA/android_external_chromium_org | tools/git/mass-rename.py | Python | bsd-3-clause | 1,344 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-11-24 14:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('relaydomains', '0006_auto_20170215_0948'),
]
operations = [
migrations.Crea... | tonioo/modoboa | modoboa/relaydomains/migrations/0007_recipientaccess.py | Python | isc | 670 |
keys = [email, person1, person2]
mylist = []
for k in keys:
mylist.append(k)
for i in traits:
mylist.append(i)
with open('traitify.csv', 'wb') as myfile:
w = csv.writer(myfile, quoting=csv.QUOTE_ALL)
w.writerow(mylist)
| meyhelm/traitify_consolidator | printCsv.py | Python | isc | 244 |
import requests
import json
import re
import warnings
from .filterhandler import filter_handler
from .habanero_utils import (
switch_classes,
check_json,
is_json,
parse_json_err,
make_ua,
filter_dict,
rename_query_filters,
ifelsestr,
)
from .exceptions import *
from .request_class impor... | sckott/habanero | habanero/request.py | Python | mit | 4,866 |
#!/usr/bin/env python
from __future__ import print_function
"""
branching.py
test branching dependencies
"""
import os
import sys
# add grandparent to search path for testing
grandparent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
sys.path.insert(0, grandparent_dir)
# mo... | pombreda/ruffus | ruffus/test/test_filesre_combine.py | Python | mit | 4,198 |
import Pyro4
class PyroAdapter(object):
_nameserver = False
def __init__(self):
self._daemon = None
def setup_pyro(self):
import config as _c
_k = [x if x.startswith('__') is False else None for x in dir(_c)]
keys = filter(None, _k)
for name in keys:
... | Strangemother/python-state-machine | scratch/machine_4/adapters.py | Python | mit | 971 |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2017 Dean Jackson <deanishe@deanishe.net>
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2017-11-14
#
"""Common workflow variables and functions."""
from __future__ import print_function, absolute_import
from collections import Ordered... | nekonok/dotfiles | app/alfred/Alfred.alfredpreferences/workflows/user.workflow.125AE956-75D0-4ABD-BA83-AB8EB38B9531/common.py | Python | mit | 4,088 |
import sys, os, time
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
from acq4.drivers.PatchStar import PatchStar
if len(sys.argv) < 2:
print("Usage: test.py com4")
sys.exit(-1)
ps = PatchStar(sys.argv[1])
ps.reset()
print("Firmware version: %s" % ps.getFirmwareVersion())
print("Max spe... | tropp/acq4 | acq4/drivers/PatchStar/test.py | Python | mit | 1,043 |
import plusfw
from datetime import datetime
from requests import get, post, codes, exceptions
import json
class Html:
"""
"""
base_uris = {
plusfw.LABEL_PFW: "https://www.plusforward.net",
plusfw.LABEL_QLIVE: "https://www.plusforward.net",
plusfw.LABEL_QIV: "https://www.plusforwa... | mariusor/tlcal | plusfw/scraper/html.py | Python | mit | 5,805 |
"""
The MIT License (MIT)
Copyright (c) 2014 Trustly Group AB
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, me... | trustly/trustly-client-python | trustly/exceptions.py | Python | mit | 1,583 |
# Django settings for SHTP project.
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '... | zypgithub/SHTPforQDU | SHTP/settings.py | Python | mit | 6,528 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import mechanize
import cookielib
import sys
import urllib
def getTokenMechanize():
br = mechanize.Browser()
cj = cookielib.LWPCookieJar()
br.set_cookiejar(cj)
br.set_handle_equiv(True)
br.set_handle_redirect(True)
br.set_handle_referer(True)
... | itirabasso/asciicam-sdc | lalala.py | Python | mit | 1,553 |
import numpy as np
import sys
sys.path.append("..")
import data_tools as dt
in_path = sys.argv[1]
out_path = sys.argv[2]
contactMat = dt.matFromBed(in_path)
np.savetxt(out_path, contactMat, delimiter="\t")
| seqcode/miniMDS | scripts/chromosome3d_input.py | Python | mit | 208 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
r"""Minimal Flask application example for development with CERN handler.
SPHINX-STAR... | inveniosoftware/invenio-oauthclient | examples/cern_app.py | Python | mit | 4,432 |
__all__ = ["checkInputArguments", "generateTemplate", "relations"] | MichaelPHStumpf/Peitho | peitho/errors_and_parsers/abc_sysbio/abcsysbio/__init__.py | Python | mit | 66 |
# -*- coding: utf-8 -*-
from datetime import datetime
from datetime import timedelta
import os
import json
import telegram
from pokemongo_bot.base_task import BaseTask
from pokemongo_bot.base_dir import _base_dir
from pokemongo_bot.event_handlers import TelegramHandler
class FileIOException(Exception):
pass
clas... | pengzhangdev/PokemonGo-Bot | pokemongo_bot/cell_workers/telegram_task.py | Python | mit | 608 |
# https://leetcode.com/problems/unique-binary-search-trees/
class Solution(object):
def numTrees(self, n):
dp = [1] * (n+1)
for i in range(1,n+1):
ways = 0
for j in range(1,i+1):
ways += dp[j - 1] * dp[i-j]
dp[i] = ways
return dp[-1] | menghanY/LeetCode-Python | Tree/UniqueBinarySearchTrees.py | Python | mit | 316 |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2014 Alex Forencich
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 righ... | lude-ma/python-ivi | ivi/extra/dcpwr.py | Python | mit | 4,414 |
__author__ = 'rcj1492'
__created__ = '2016.03'
__license__ = 'MIT'
try:
import pytest
except:
print('pytest module required to perform unittests. try: pip install pytest')
exit()
from labpack.storage.appdata import appdataClient
from labpack.performance import performlab
from jsonmodel.excepti... | collectiveacuity/labPack | tests/test_storage_appdata.py | Python | mit | 5,903 |
# -*- coding: utf-8 -*-
import pickle
from _thread import start_new_thread
from threading import Timer
from time import sleep
import traceback
from pysimplelog import Logger
from werkzeug.wrappers import Request, Response
from werkzeug.serving import run_simple
from FoodScan.ShopSync.metaShop import MetaShop
class S... | danielBreitlauch/FoodScan | FoodScan/ShopSync/shopSync.py | Python | mit | 6,886 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Find the sum of all pandigital numbers
with an unusual sub-string divisibility property.
"""
from itertools import permutations
from utils import list_num
def pe43():
"""
>>> pe43()
[1406357289, 1430952867, 1460357289, 4106357289, 4130952867, 4160357289]
... | kittttttan/pe | py/pe/pe43.py | Python | mit | 946 |
# Module:
# Submodules:
# Created:
# Copyright (C) <date> <fullname>
#
# This module is part of the <project name> project and is released under
# the MIT License: http://opensource.org/licenses/MIT
"""
"""
# ============================================================================
# Imports
# =====================... | arielmakestuff/selweb | test/unit/driver/test_unit_driver_browserdriver.py | Python | mit | 1,464 |
""" Generates Figure 1 of the the paper
Sascha Spors, Frank Schultz, and Hagen Wierstorf. Non-smooth secondary
source distributions in wave
field synthesis. In German Annual Conference
on Acoustics (DAGA), March 2015.
Sound field synthesized by an infitely long vs. semi-infintely long
linear/recta... | spatialaudio/non-smooth-secondary-source-distributions | figure1.py | Python | mit | 4,146 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def maior_sequencia(texto):
texto = texto.lower()
lista_resultante = []
lista_intermediaria = []
for i in range(len(texto)):
if i == 0 or (ord(texto[i]) == (ord(texto[i - 1]) + 1)):
lista_intermediaria.append(texto[i])
else:
... | Rivefount/estudos | strings/sequencia_alafabetica_em_string.py | Python | mit | 809 |
# -*- coding: UTF-8 -*-
import unittest
from pandasticsearch.operators import *
from pandasticsearch.types import Row, Column
class TestSchema(unittest.TestCase):
def test_row(self):
row = Row(a=1, b='你好,世界')
print(repr(row))
self.assertEqual(row['a'], 1)
self.assertEqual(row['b'... | onesuper/pandasticsearch | tests/test_types.py | Python | mit | 1,478 |
import uuid
class GenericFile:
# Core type -> lookup_function, returning the coreid
__relations = {
}
type_name = "dataset"
type_xml = "http://purl.org/dc/dcmitype/Dataset"
def __init__(self,core=True,core_type=None):
if core_type is None or core:
self.id_field = "... | iDigBio/idigbio-dwca | dwca/writer.py | Python | mit | 2,150 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'My Project',
'author': 'Mighty Cohadar',
'url': 'URL to get it at.',
'download_url': 'Where to download it.',
'author_email': 'My email.',
'version': '0.1',
'install_req... | cohadar/learn-python-the-hard-way | setup.py | Python | mit | 428 |
import pytest
from dotmailer.campaigns import Campaign
from dotmailer.exceptions import ErrorCampaignInvalid
from tests import manually_delete_campaign
from tests.campaigns import sample_campaign_data
def test_copy_valid(request, connection, sample_campaign):
copy = Campaign.copy(sample_campaign.id)
def cl... | Mr-F/dotmailer | tests/campaigns/test_copy.py | Python | mit | 959 |
import venusian
class repository_config(object):
""" Configure repository objects.
"""
venusian = venusian
def __init__(self, name, namespace, shard='default'):
"""
:param name: unique repository name
:type name: str
:param namespace: namespace name according to Pacif... | avanov/Pacific | pacific/db/repository.py | Python | mit | 2,019 |
from typing import Pattern, Dict
from recognizers_text.utilities import RegExpUtility
from ...resources.french_date_time import FrenchDateTime
from ..base_datetimeperiod import DateTimePeriodParserConfiguration, MatchedTimeRange
from ..extractors import DateTimeExtractor
from ..parsers import DateTimeParser
from ..bas... | matthewshim-ms/Recognizers-Text | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/datetimeperiod_parser_config.py | Python | mit | 6,921 |
import numpy as np
import matplotlib.pyplot as plt
plt.rc('font',**{'family':'serif','sans-serif':['Computer Modern Roman']})
plt.rc('text', usetex=True)
def k(x,xp, l=1.0):
d = (x-xp)**2
return np.exp(-d/(l**2))
xp = 0
x = np.linspace(0,3,101)
fk = k(x,xp)
hf,ha = plt.subplots()
ha.plot(x, fk)
ha.set_... | nrjl/GPN | covariance_plot.py | Python | mit | 381 |
import uuid
class AutomotiveComponent(object):
''' component of the Automotive Environment holding
common properties'''
def __init__(self, sim_env, comp_id=uuid.uuid4()):
''' Constructor
Input: sim_env simpy.Environment environment of this componen... | PhilippMundhenk/IVNS | ECUSimulation/components/base/automotive_component.py | Python | mit | 721 |
import math
import time
t1 = time.time()
N = 100000
exp = N//10
prime = []
def primeSieve(n):
global prime
n = (n+1)//2
p = [True]*(n)
i = 1
prime.append(2)
while i < n:
if p[i]:
t = 2*i+1
prime.append(t)
j = i
while j < n:
... | Adamssss/projectEuler | Problem 001-150 Python/pb124.py | Python | mit | 1,230 |
from evolacc.evolacc.evolacc import *
| Aluriak/EvolAcc | evolacc/evolacc/__init__.py | Python | mit | 38 |
# -*- encoding: utf-8
import datetime
import decimal
from sqlalchemy import Column
from sqlalchemy import DDL
from sqlalchemy import event
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import ForeignKeyConstraint
from sqlalchemy import Identity
from sqlalchemy import Index
from sqlalchem... | zzzeek/sqlalchemy | test/dialect/mssql/test_reflection.py | Python | mit | 27,474 |
# coding: utf-8
import datetime
from bs4 import BeautifulSoup
from bson.objectid import ObjectId
from tornado.web import RequestHandler
from processor.page_analytic import PageAnalytic
from processor.processor import TagProcessor
from libra import settings
from libra.handlers.base import authenticated
from libra.handle... | pitomba/libra | libra/handlers/page.py | Python | mit | 1,803 |
n = input('Digite um valor: ')
print(n.isnumeric())
print(n.isalpha())
print(n.isalnum())
print(n.isupper())
print(n.isspace()) | AlbertoAlfredo/exercicios-cursos | Curso-em-video/Python/aulas-python/Testes/aula06b.py | Python | mit | 127 |
import unittest
from Content.JsonContent import JsonContent
# JSON validator test case.
class TestClass(unittest.TestCase):
def test_validation_passed(self):
validator = JsonContent('{ "test" : "simple JSON" }')
result = validator.validate()
assert result == True, 'Validation not passed - broken validation'... | afronski/grammar-generator | grammar-generator/Tests/JsonContentTest.py | Python | mit | 1,372 |
# python standard library
import unittest
# third-party
from mock import MagicMock
# the ape
from theape.infrastructure.arguments.fetcharguments import Fetch, FetchStrategy
from theape.infrastructure.arguments.basestrategy import BaseStrategy
import theape.infrastructure.arguments.fetcharguments
fetch_usage = theap... | rsnakamura/theape | theape/infrastructure/arguments/tests/test_fetcharguments.py | Python | mit | 4,312 |
from django.db import models
class Configuration(models.Model):
fb_share_token = models.TextField(max_length=250)
fb_share_app_id = models.TextField(max_length=20)
fb_share_app_secret = models.TextField(max_length=35)
fb_share_link = models.TextField(max_length=50)
| dirtycoder/pets | pets/common/models.py | Python | mit | 284 |
from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_object()
msg = Mess... | mainulhossain/phenoproc | app/email.py | Python | mit | 675 |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'example_project.settings')
try:
from django.core.management import execute_from_command_line
exc... | cordery/django-countries-plus | example_project/manage.py | Python | mit | 671 |
"""
Created on 25 Feb 2020
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
an empty catalogue of particulate exegesis models, to be implemented elsewhere
"""
# --------------------------------------------------------------------------------------------------------------------
class ExegeteCatalogue(obje... | south-coast-science/scs_core | src/scs_core/exegesis/particulate/exegete_catalogue.py | Python | mit | 696 |
#!/usr/bin/env python2.7
# Copyright (c) 2012 by David Schulz (ds@ironwhale.com)
# All rights reserved.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A P... | overrider/pollution-aqi | raspberrypi/rrd_create_dylos.py | Python | mit | 1,438 |
# -*- coding: utf8 -*-
import time
from datetime import datetime
import feedparser
import requests
import sqlalchemy.orm.exc
from sqlalchemy.orm.exc import NoResultFound
import zeeguu_core
from zeeguu_core.constants import JSON_TIME_FORMAT, SIMPLE_TIME_FORMAT
from zeeguu_core.model.language import Language
from zeeg... | mircealungu/Zeeguu-Core | zeeguu_core/model/feed.py | Python | mit | 8,067 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_connected_kubernetes_client.py | Python | mit | 4,207 |
#!/usr/bin/env python2
import sys, os, json, traceback, decimal
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../../python-bitcoinrpc"))
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from rotating_consensus import RotatingConsensus
from threading import Lock, curren... | droark/elements | contrib/fedpeg/withdrawwatch.py | Python | mit | 25,372 |
images_above = widget_inputs["check1"]
flipping = widget_inputs["check2"]
async = widget_inputs["check3"]
images_below = widget_inputs["check4"]
is_correct = False
comments = []
def commentizer(new):
if new not in comments:
comments.append(new)
if images_above:
commentizer("Check the images above-the... | udacity/60fps | grading-scripts/2-rails2.py | Python | mit | 1,281 |
import os
from unittest import TestCase
from mock import MagicMock, patch, call
from slap import cli
mock_arcpy = MagicMock()
module_patcher = patch.dict('sys.modules', {'arcpy': mock_arcpy})
module_patcher.start()
class TestInitCli(TestCase):
def test_default_args(self):
with patch('slap.cli.config_buil... | gisinc/slap | tests/test_cli.py | Python | mit | 4,431 |
#!/usr/bin/env python3
# Copyright (c) 2016 The nealcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test segwit transactions and blocks on P2P network."""
from test_framework.mininode import *
from test_fra... | appop/bitcoin | qa/rpc-tests/p2p-segwit.py | Python | mit | 92,763 |
import os, json, shutil
import subprocess as sp, sys, shutil
import hashlib
import bibtexparser
import six
from six.moves import input as raw_input
from papers import logger
# GIT = False
DRYRUN = False
# config directory location
HOME = os.environ.get('HOME',os.path.expanduser('~'))
CONFIG_HOME = os.environ.get('XDG... | perrette/myref | papers/config.py | Python | mit | 8,951 |
import os
import sys
from numerapi.numerapi import NumerAPI
import luigi
class FetchAndExtractData(luigi.Task):
"""
Fetches the most recent dataset and extracts the contents to the given
path if not yet done (default path is ``./data``).
:param: output_path:
(relative) path where the data sho... | ChristianSch/numerflow | tasks/numerai_fetch_training_data.py | Python | mit | 3,019 |
from pipeline import Pipeline
from phase import simpleAsyncPhase
from component import CountComponent, PassComponent
source = CountComponent(conf={'n':20})
dest = PassComponent()
ph1 = simpleAsyncPhase(source)
ph2 = simpleAsyncPhase(dest)
ph1.set_children([ph2])
pipeline = Pipeline(ph1)
pipeline.run()
import ipdb; ip... | sreedom/rabbit-pipeline | test_driver.py | Python | mit | 573 |
"""
Extract LIWC counts from sliced dialogue file.
"""
from clean_extracted_text import clean_text
from get_LIWC_counts import get_LIWC_counts
from nltk.tokenize import WordPunctTokenizer
import os, re
import pandas as pd
import argparse
from stopwords import get_stopwords
N_SLICES=60
if __name__ == '__main__':
pa... | fredhohman/a-viz-of-ice-and-fire | scripts/extract_LIWC_from_slices_general.py | Python | mit | 4,435 |
from setuptools import setup, find_packages
setup(
name = "pymuxinator",
version = "0.0.6",
author = "Caleb Mingle",
author_email = "caleb@mingle.cm",
description = "Tmux session manager",
url = "http://mingle.cm",
packages = find_packages(),
include_package_data=True,
entry_points=... | dentafrice/pymuxinator | setup.py | Python | mit | 643 |
import re
rex = re.compile('(\w+)(\d+)\((\w+)\)')
rex_commit = re.compile('c(\d+)')
| saraivaufc/TS-Basico | expressions.py | Python | mit | 85 |
"""
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
import qy
import qy.llvm as llvm
class Function(qy.Value):
"""
Function in the wrapper language.
"""
def __call__(self, *arguments):
"""
Emit IR for a function call.
"""
# sanity
if len(arguments) != len(... | bsilverthorn/qy | src/qy/values/function.py | Python | mit | 5,308 |
# coding: utf-8
# data fixtures for functional tests
from datetime import date, time
import pytest
import marcotti.models.common.enums as enums
import marcotti.models.common.overview as mco
import marcotti.models.common.personnel as mcp
import marcotti.models.club as mc
@pytest.fixture
def comp_data():
return ... | soccermetrics/marcotti | tests/conftest.py | Python | mit | 8,790 |
import sys
import recipes
from ui.qt.init import start_application
if __name__ == "__main__":
recipes.read()
start_application()
| zachcheatham/Minecraft-Resource-Calculator | python/MRC_QT.py | Python | mit | 147 |
# package
#-*- coding: UTF-8 -*-
from sqlalchemy.orm import (
scoped_session,
sessionmaker,
)
from zope.sqlalchemy import ZopeTransactionExtension
DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension()))
import infosys.models.base
#import .fias
import infosys.models.organization... | StasMerzlyakov/InfoSys | infosys/models/__init__.py | Python | mit | 347 |
# -------------------------------------------------------------
# Panoptes Marking Export Script
#
# This script extracts individual markings from Zooniverse
# Panoptes classification data export CSV. This script is
# configured to export circular marker info for classifications
# collected only for the latest workfl... | lcjohnso/Panoptes_MarkingExport | zoomarks_csvextract_planet9.py | Python | mit | 3,537 |
import unittest
from biokbase.narrative.exception_util import (
NarrativeException,
transform_job_exception,
)
from biokbase.execution_engine2.baseclient import ServerError as EEServerError
from biokbase.userandjobstate.baseclient import ServerError as UJSServerError
from requests.exceptions import HTTPError
im... | briehl/narrative | src/biokbase/narrative/tests/test_exception_util.py | Python | mit | 3,400 |