code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
#... | MostlyOpen/odoo_addons | myo_patient/models/person.py | Python | agpl-3.0 | 1,237 |
from __future__ import unicode_literals
import djblets.extensions.views as djblets_ext_views
from django.views.decorators.csrf import csrf_protect
from reviewboard.extensions.base import get_extension_manager
@csrf_protect
def configure_extension(request, ext_class, form_class,
template_name... | chipx86/reviewboard | reviewboard/extensions/views.py | Python | mit | 629 |
import os
def test_generous_parse_uri():
from dtoolcore.utils import generous_parse_uri
s3_uri = "s3://my-bucket/path/to/files"
parse_result = generous_parse_uri(s3_uri)
assert parse_result.scheme == 's3'
assert parse_result.netloc == 'my-bucket'
assert parse_result.path == '/path/to/file... | JIC-CSB/dtoolcore | tests/test_uri_sanitisation.py | Python | mit | 1,925 |
from framework.dependency_management.dependency_resolver import ServiceLocator
DESCRIPTION = "Cookie Attributes Plugin to assist manual testing"
def run(PluginInfo):
resource = ServiceLocator.get_component("resource").GetResources('ExternalCookiesAttributes')
Content = ServiceLocator.get_component("plugin_h... | DarKnight24/owtf | plugins/web/external/Cookies_attributes@OWTF-SM-002.py | Python | bsd-3-clause | 408 |
from django import forms
from datetimewidget.widgets import DateWidget
class DateFilterForm(forms.Form):
"""
Very simple form responsible for specifying what dates to filter the system stats by.
"""
start_date = forms.DateField(widget=DateWidget(usel10n=True, bootstrap_version=3))
end_date = forms... | jimga150/HealthNet | HealthNet/sysstats/forms.py | Python | mit | 446 |
from utils.opengl import TextureManager
from utils import Vec2d
from OpenGL.GL import *
import random
from math import sin
class CloudManager(object):
def __init__(self, screen, maxClouds=5):
self.screen = Vec2d(screen)
self.offset = Vec2d(0, 0)
self.clouds = []
self.maxClouds = m... | markusd/rocket | rocket/clouds.py | Python | bsd-2-clause | 5,964 |
# -*- coding: utf-8 -*-
import threading
import sys
import logging
logger = logging.getLogger(__name__)
try:
import Queue as queue
except ImportError:
import queue
import traceback
class TaskQueue(object):
def __init__(self, producer, consumers):
self.__producer = producer
self.__consu... | aliyun/aliyun-oss-python-sdk | oss2/task_queue.py | Python | mit | 2,311 |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | overtherain/scriptfile | software/googleAppEngine/google/appengine/api/appinfo.py | Python | mit | 51,450 |
""" Our tests are defined in here """
import os
import sys
from operator import eq
import just
import pytest
TEST_FNAME = "testobj"
def get_result(m, extension, inp):
fname = TEST_FNAME + "." + extension
try:
m.write(inp, fname)
read_result = m.read(fname)
finally:
just.remove(fn... | kootenpv/just | tests/test_files.py | Python | agpl-3.0 | 2,748 |
import tempfile
import os, sys
import subprocess
import time
from . import walk_projects, rest_header
class Statistics:
def __init__(self, artefact_path, output_path, index_path):
# which directory to scan for repositories
self.artefact_path = artefact_path
# base directory for output
... | zerotired/manticore-ext | src/zt/manticore/ext/statistics.py | Python | bsd-2-clause | 7,029 |
# coding: utf-8
"""
This module defines a holder of Monosublocus instances. It is the last step
before the definition of real loci.
"""
from sys import version_info
from ..transcripts.transcript import Transcript
from .abstractlocus import Abstractlocus
from .locus import Locus
from .monosublocus import Monosublocus
... | lucventurini/mikado | Mikado/loci/monosublocusholder.py | Python | lgpl-3.0 | 12,512 |
#!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test wallet load on startup.
Verify that a syscoind node can maintain list of wallets loading on start... | syscoin/syscoin | test/functional/wallet_startup.py | Python | mit | 2,539 |
'''
Copyright (c) 2008 Georgios Giannoudovardis, <vardis.g@gmail.com>
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,... | vardis/pano | src/pano/actions/BaseAction.py | Python | mit | 1,446 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import time
## PhysicalParameters
Density=2400
frictionAngle=radians(35)
tc = 0.001
en = 0.3
es = 0.3
## Import wall's geometry
params=utils.getViscoelasticFromSpheresInteraction(tc,en,es)
facetMat=O.materials.append(ViscElMat(frictionAngle=frictionAngle,**params)) # **param... | woodem/woo | obsolete/examples/baraban/baraban.py | Python | gpl-2.0 | 2,018 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington
# See opus_core/LICENSE
from lxml.etree import Element
class AbstractManager(object):
'''
Handler for a group of UI elements with a XMLController as the center piece
... | apdjustino/DRCOG_Urbansim | src/opus_gui/abstract_manager/abstract_manager.py | Python | agpl-3.0 | 2,465 |
from copy import deepcopy
from robofab.pens.pointPen import AbstractPointPen
from robofab.pens.adapterPens import PointToSegmentPen
from mathFunctions import *
from mathGuideline import *
# ------------------
# UFO 3 branch notes
# ------------------
#
# to do:
# X anchors
# - try to preserve ordering?
# X component... | metapolator/mutatormathtools | python_modules/lib/python/fontMath/mathGlyph.py | Python | apache-2.0 | 45,362 |
# -*- coding: utf-8 -*-
__version__ = '0.15.0'
| jules185/IoT_Hackathon | .homeassistant/deps/fuzzywuzzy/__init__.py | Python | mit | 47 |
"""
Tools used by the `explore_ligpy_results.ipynb` notebook that help with
analysis and plotting.
"""
import os
import cPickle as pickle
import numpy as np
from constants import MW
def load_results(path):
"""
Load the results from the ODE solver, along with the program parameters
used to generate those... | houghb/ligpy | ligpy/analysis_tools.py | Python | bsd-2-clause | 22,978 |
import errno
import os
import shutil
import socket
import subprocess
import sys
import tempfile
import time
import urllib2
import pytest
from tools.wpt import wpt
here = os.path.abspath(os.path.dirname(__file__))
def is_port_8000_in_use():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
... | ecoal95/servo | tests/wpt/web-platform-tests/tools/wpt/tests/test_wpt.py | Python | mpl-2.0 | 16,794 |
def to_float(v, default=None):
try:
return float(v)
except ValueError:
return default
except TypeError:
return default
def to_int(v, default=None):
try:
return int(v)
except ValueError:
return default
except TypeError:
return default
def float_to_s... | plepe/pgmapcss | pgmapcss/eval/base.py | Python | agpl-3.0 | 2,479 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 15 12:14:08 2015
@author: Sam Thiele
"""
import os
import numpy as np
import scipy as sp
from pynoddy.experiment.MonteCarlo import MonteCarlo
from pynoddy.output import NoddyTopology
from pynoddy.history import NoddyHistory
class TopologyAnalysis:
'''
Performs ... | Leguark/pynoddy | pynoddy/experiment/TopologyAnalysis.py | Python | gpl-2.0 | 15,069 |
from django.conf.urls.defaults import *
urlpatterns = patterns('project.views',
url(r'^$', 'client_index', name='client_index'),
url(r'^(?P<client_id>\d+)/$', 'show_client', name='client_page'),
)
| bansalrajnikant/djime | project/client_urls.py | Python | bsd-3-clause | 207 |
import sys
import os
import unittest
from scrapy.item import Item, Field
from scrapy.utils.misc import arg_to_iter, create_instance, load_object, set_environ, walk_modules
from tests import mock
__doctests__ = ['scrapy.utils.misc']
class UtilsMiscTestCase(unittest.TestCase):
def test_load_object(self):
... | wujuguang/scrapy | tests/test_utils_misc/__init__.py | Python | bsd-3-clause | 6,145 |
# 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... | chemelnucfin/tensorflow | tensorflow/contrib/feature_column/python/feature_column/sequence_feature_column_integration_test.py | Python | apache-2.0 | 8,611 |
from crocs.regex import Pattern, ConsumeBack, X
e = ConsumeBack(ConsumeBack(Pattern('a', X(), 'b'), 'def'), 'def')
e.test()
e.hits()
| iogf/crocs | demo/nested_consume_back.py | Python | apache-2.0 | 135 |
from django.utils.http import parse_http_date_safe
from betty.cropper.utils import seconds_since_epoch
def check_not_modified(request, last_modified):
"""Handle 304/If-Modified-Since
With Django v1.9.5+ could just use "django.utils.cache.get_conditional_response", but v1.9 is
not supported by "logan" de... | theonion/betty-cropper | betty/cropper/utils/http.py | Python | mit | 567 |
# Generated by Django 2.0 on 2018-02-07 13:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
name='last_name',
field... | patcurry/WebGIS | core/migrations/0002_auto_20180207_1438.py | Python | mit | 410 |
import os
import os.path
import subprocess
from collections import namedtuple
import rpm
Pkg = namedtuple("Pkg", ["portname", "name", "version", "release", "arch"])
Reader = namedtuple("Reader", ["template"])
Paths = namedtuple("Paths", ["specdir", "rpmdir"])
class Template(object):
def __init__(self, content):
... | masom/Puck | flavour/pkg/registerports.py | Python | lgpl-3.0 | 4,699 |
#!/usr/bin/env python
# Copyright (C) 2009,2010 Junta de Andalucia
#
# Authors:
# Roberto Majadas <roberto.majadas at openshine.com>
# Cesar Garcia Tapia <cesar.garcia.tapia at openshine.com>
# Luis de Bethencourt <luibg at openshine.com>
# Pablo Vieytes <pvieytes at openshine.com>
#
# This program is free so... | hychen/gnome-nanny | daemon/src/FilterManager.py | Python | gpl-2.0 | 39,019 |
#!/usr/bin/env python
import getopt, sys
import optparse
import string
import re
import os
from optparse import OptionParser
def get_running_time(log_time):
# Watchout: we only expect time of the form MM:SS.SS
str_time = 'Notime'
with open(log_time, 'r') as l:
for timeline in l:
time_s... | DistributedMCS/dmcs | examples/test/collect-mcsie.py | Python | gpl-3.0 | 5,167 |
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | EugenePig/gcloud-python | gcloud/bigquery/test_job.py | Python | apache-2.0 | 50,613 |
# Copyright 2007 John Kasunich and Jeff Epler
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Th... | yishinli/emc2 | lib/python/vismach.py | Python | lgpl-2.1 | 27,917 |
## begin license ##
#
# "Weightless" is a High Performance Asynchronous Networking Library. See http://weightless.io
#
# Copyright (C) 2006-2011 Seek You Too (CQ2) http://www.cq2.nl
# Copyright (C) 2011-2012, 2018-2021 Seecr (Seek You Too B.V.) https://seecr.nl
#
# This file is part of "Weightless"
#
# "Weightless" is ... | seecr/weightless-core | test/_http/httpspectest.py | Python | gpl-2.0 | 3,316 |
""" JobRunningWaitingRatioPolicy
Policy that calculates the efficiency following the formula:
( running ) / ( running + waiting + staging )
if the denominator is smaller than 10, it does not take any decision.
"""
from DIRAC import S_OK
from DIRAC.ResourceStat... | Sbalbp/DIRAC | ResourceStatusSystem/Policy/JobRunningWaitingRatioPolicy.py | Python | gpl-3.0 | 2,447 |
#!/usr/bin/env python
#
# Copyright 2004,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your opt... | owaiskhan/Retransmission-Combining | gr-audio/examples/python/audio_to_file.py | Python | gpl-3.0 | 2,271 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | stackforge/python-senlinclient | senlinclient/tests/unit/test_format_utils.py | Python | apache-2.0 | 2,634 |
import tempfile, subprocess, getpass, os, signal, socket, psutil
def get_env():
'''Determines the type of job for the current environment.
Supported environments are Condor/Slurm/Local.
'''
if socket.getfqdn().endswith('tacc.utexas.edu'):
return SlurmJob()
if socket.getfqdn().endswith('cs.utexas.edu'):... | LARG/cluster | cluster/cluster.py | Python | mit | 10,431 |
# -*- coding: utf-8 -*-
# Copyright (c) 2007 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the Plugin installation dialog.
"""
from __future__ import unicode_literals
import os
import sys
import shutil
import zipfile
import compileall
import glob
try: # Py3
import urllib.parse as... | paulmadore/Eric-IDE | 6-6.0.9/eric/PluginManager/PluginInstallDialog.py | Python | gpl-3.0 | 23,823 |
from __future__ import print_function
import os
import sys
import subprocess as sp
import pytest
import yaml
import tempfile
import requests
import argparse
import json
import re
from argparse import Namespace
from argparse import ArgumentParser
import glob
import contextlib
import tarfile
from helpers import CreateRec... | gogetdata/ggd-cli | tests/test_make_meta_recipe.py | Python | mit | 47,025 |
"""Unit tests for physical_constraints.py."""
import copy
import unittest
import numpy
import pandas
from keras import backend as K
from gewittergefahr.gg_utils import physical_constraints
from gewittergefahr.gg_utils import radar_utils
from gewittergefahr.gg_utils import soundings
from gewittergefahr.deep_learning im... | thunderhoser/GewitterGefahr | gewittergefahr/gg_utils/physical_constraints_test.py | Python | mit | 25,777 |
from __future__ import absolute_import, unicode_literals
from . import abase
class Subscription(
abase.CreatableResource, abase.ListableResource, abase.DeletableResource
):
RESOURCE = "subscription"
RESOURCE_PATH = "subscriptions"
| reincubate/ricloud | ricloud/resources/subscriptions.py | Python | lgpl-3.0 | 246 |
# coding=utf-8
# -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Mercurial Contributors.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import os
i... | facebookexperimental/eden | eden/hg-server/tests/test-revset-t.py | Python | gpl-2.0 | 55,679 |
# coding:utf-8
import numpy as np
from chainer import cuda, Function, gradient_check, report, training, utils, Variable
from chainer import datasets, iterators, optimizers, serializers
import chainer.functions as F
import chainer.links as L
import sys
import argparse
import _pickle as pickle
import MeCab
from LSTM imp... | SPJ-AI/lesson | text_generator/sc_generate.py | Python | gpl-3.0 | 4,136 |
# -*- encoding: utf-8 -*-
import os
import os.path
from .common import BaseTest
import kids.file as kf
class OemConfigTest(BaseTest):
COMMAND = 'config'
def test_get_empty(self):
out, err, errlvl = self.cmd(
'$tprog get')
self.assertEqual(
errlvl, 0,
msg... | 0k/oem | src/oem/tests/test_oem_config.py | Python | bsd-2-clause | 10,898 |
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
# Standard imports
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import *
from past.utils import old_div
fr... | shankari/e-mission-server | emission/analysis/modelling/tour_model/trajectory_matching/DifferenceMetricPipeline.py | Python | bsd-3-clause | 5,060 |
class A:
def <weak_warning descr="Function name should be lowercase">fooBar</weak_warning>(self): pass
class B(A):
def fooBar(self): pass | kdwink/intellij-community | python/testData/inspections/PyPep8NamingInspection/overridden.py | Python | apache-2.0 | 142 |
"""test_django URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | sawardekar/django | test_django/urls.py | Python | mit | 1,660 |
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Dispatches the uiautomator tests."""
import logging
import os
from pylib import android_commands
from pylib.base import base_test_result
from pylib.... | plxaye/chromium | src/build/android/pylib/uiautomator/dispatch.py | Python | apache-2.0 | 1,621 |
import tempfile
import unittest
from hamcrest import *
from tests.functional import command
from tests.functional.http_stub import HttpStub
class TestErrorHandling(unittest.TestCase):
def setUp(self):
HttpStub.start()
def tearDown(self):
HttpStub.stop()
def test_it_fails_if_neither_file_... | alphagov/backdropsend | tests/functional/test_error_handling.py | Python | mit | 1,857 |
# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | JioCloud/oslo-incubator | openstack/common/middleware/debug.py | Python | apache-2.0 | 1,760 |
# -*- coding: utf-8 -*-
from openerp.osv import fields, osv
import openerp.addons.decimal_precision as dp
from openerp.tools.translate import _
import datetime
import time
from dateutil.relativedelta import relativedelta
class product_uom(osv.osv):
_inherit = "product.uom"
_columns = {
'min_qua... | tonygalmiche/is_plastigray | product_pricelist.py | Python | mit | 10,140 |
# Copyright (C) 2013 by Clearcode <http://clearcode.cc>
# and associates (see AUTHORS).
# This file is part of pytest-redis.
# pytest-redis 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 versi... | ClearcodeHQ/pytest-redis | src/pytest_redis/plugin.py | Python | lgpl-3.0 | 4,289 |
"""
The scramblesuit module implements the ScrambleSuit obfuscation protocol.
The paper discussing the design and evaluation of the ScrambleSuit pluggable
transport protocol is available here:
http://www.cs.kau.se/philwint/scramblesuit/
"""
from twisted.internet import error
from twisted.internet import reactor
impo... | isislovecruft/scramblesuit | scramblesuit.py | Python | bsd-3-clause | 25,113 |
#!/usr/bin/python
'''This utility prints out a mapping string that is syntactically correct
to be used in the schemas/spl_mapping.json file.
'''
import logging
import os
import simplejson as json
import sys
# TODO(hansnelsen): Added pretty printing for pleasant looking JSON
# TODO(hansnelsen): Add writing directly to... | HiTechIronMan/openfda | scripts/generate_mapping_from_sections.py | Python | cc0-1.0 | 10,264 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import pandas.testing as pdt
import pytest
from recordlinkage.preprocessing import clean
from recordlinkage.preprocessing import phonenumbers
from recordlinkage.preprocessing import phonetic
from recordlinkage.preprocessing import ph... | J535D165/recordlinkage | tests/test_preprocessing.py | Python | bsd-3-clause | 7,315 |
#!/usr/bin/env python
import json
import threading
import time
import Tkinter as tk
import ttk
import tkFileDialog as filedialog
import urllib
import urllib2
class JSONText(tk.Text):
def __init__(self, *args, **kwargs):
tk.Text.__init__(self, *args, **kwargs)
self.tag_configure('number', foregro... | shnergle/ShnergleDevClient | main.py | Python | mit | 12,831 |
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import testpy
def GetConfiguration(context, root):
return testpy.AsyncHooksTestConfiguration(context, root, 'async-hooks')
| MTASZTAKI/ApertusVR | plugins/languageAPI/jsAPI/3rdParty/nodejs/10.1.0/source/test/async-hooks/testcfg.py | Python | mit | 204 |
from django import forms
from django.core.exceptions import ValidationError
from cyder.models import Ctnr
from cyder.cydns.address_record.models import AddressRecord
from cyder.cydns.view.models import View
from cyder.cydns.forms import DNSForm
from cyder.cydns.nameserver.models import Nameserver
from cyder.cydhcp.int... | akeym/cyder | cyder/cydns/nameserver/forms.py | Python | bsd-3-clause | 4,749 |
# 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... | ankur-gupta91/horizon-net-ip | horizon/test/tests/middleware.py | Python | apache-2.0 | 2,862 |
# Copyright 2016-2021 Peppy Player peppy.player@gmail.com
#
# This file is part of Peppy Player.
#
# Peppy Player 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 you... | project-owner/Peppy | screensaver/peppyweather/weatherutil.py | Python | gpl-3.0 | 9,893 |
'''
=========================
Infusionsoft Experiment
=========================
[](https://travis-ci.org/BMJHayward/infusionsoft_xpmt)
DESCRIPTION
=============
API wrapper for Infusionsoft CRM. Infusionsoft a.k.a. 'IS' from here on... | BMJHayward/infusionsoft_xpmt | src/dataserv.py | Python | mit | 31,807 |
# -*- coding: utf-8 -*-
from . import test_export, test_import, test_load
| vileopratama/vitech | src/openerp/addons/test_impex/tests/__init__.py | Python | mit | 76 |
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
#
# Created by Martin J. Laubach on 2011-08-01
# Copyright (c) 2011 Martin J. Laubach. All rights reserved.
#
# --------------------------------------------------------... | feincms/feincms | feincms/signals.py | Python | bsd-3-clause | 709 |
# Copyright (c) 2010 Spotify AB
# Copyright (c) 2010-2011 Yelp
#
# 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, m... | harshilasu/LinkurApp | y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/emr/connection.py | Python | gpl-3.0 | 28,351 |
#! /usr/bin/python3
import json
from web3 import Web3, RPCProvider
from operator import itemgetter
import time
import sys
import datetime
import math
precision = 1000000000000000000
dust = 10000000000000
mkr_addr = "0xc66ea802717bfb9833400264dd12c2bceaa34a6d"
weth_addr = "0xecf8f87f810ecf450940c9f60066b4a7a501d6... | Riverhead/maker-trade-fixer | fix_books.py | Python | mit | 8,494 |
#!/usr/bin/python
from domain.client import Client
from filerepository import FileRepository
from repository import RepositoryException
class FileClientRepository(FileRepository):
def _validate_instance(self, client):
if not isinstance(client, Client):
raise RepositoryException("Not Client")
... | leyyin/university | fundamentals-of-programming/labs/lab_5-11/repository/fileclient.py | Python | mit | 392 |
dia=input("Digite seu dia de nascimento: ")
mes=input("Digite seu mês de nascimento: ")
ano=input("Digite seu ano de nascimento: ")
print("Você nasceu no dia", dia, "de", mes, "de", ano) | AlbertoAlfredo/exercicios-cursos | Curso-em-video/Python/aulas-python/Desafios/desafio002.py | Python | mit | 188 |
# 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():
tables = frappe.db.sql_list("show tables")
for old_dt, new_dt in [["Sales BOM Item", "Product Bundle Item"],
["Sales B... | mahabuber/erpnext | erpnext/patches/v5_1/sales_bom_rename.py | Python | agpl-3.0 | 440 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.exceptions import UserError, AccessError
from test_sale_common import TestSale
class TestSaleOrder(TestSale):
def test_sale_order(self):
""" Test the sale order flow (invoicing and quantity updat... | ayepezv/GAD_ERP | addons/sale/tests/test_sale_order.py | Python | gpl-3.0 | 8,136 |
# encoding: utf-8
# pylint: disable=missing-docstring,redefined-outer-name
import pytest
from flask_login import current_user, login_user, logout_user
from tests import utils
from app.modules.users import models
@pytest.yield_fixture()
def patch_User_password_scheme():
# pylint: disable=invalid-name,protected-... | frol/flask-restplus-server-example | tests/modules/users/conftest.py | Python | mit | 1,851 |
import pytest
import os
import shutil
import core
virtuallinks = core.import_package('virtuallinks')
def setup_function(function):
shutil.rmtree('temporary', ignore_errors=True)
os.mkdir('temporary')
os.chdir('temporary')
def teardown_function(function):
os.chdir('..')
shutil.rmtree('temporar... | ffunenga/virtuallinks | tests/core/test_installing.py | Python | mit | 2,693 |
#! flask/bin/python
from os.path import abspath
from flask import current_app
from flask.ext.script import Manager
from flask.ext.assets import ManageAssets
from flask.ext.migrate import Migrate, MigrateCommand
from bluespot import create_app
from bluespot.extensions import db
app = create_app(mode='development')
m... | unifispot/unifispot-free | manage.py | Python | mit | 510 |
from django.contrib import admin
from access.admin import *
from someapp.models import *
class ChildInline(AccessTabularInline):
model = SomeChild
# Register your models here.
class ObjectAdmin(AccessModelAdmin):
inlines = [
ChildInline,
]
# Register your models here.
admin.site.register(SomeObj... | nnseva/django-access | example/someapp/admin.py | Python | lgpl-3.0 | 426 |
#########################################################
# Generator for skeletons of .cmd USE file with graphs #
#########################################################
# Variables :
# USE Program
prog = 'rhododendrone.use'
# Size of grid :
x_size = 3
y_size = 3
nodes_num = x_size * y_size
# Drone :
drone_num ... | ToshRaka/Rhododendrone | utils_py/graph.py | Python | gpl-2.0 | 2,265 |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import geocoder
import psycopg2
def createTable(db_name, user, password, table_name, overwrite = False):
try:
con = psycopg2.connect("dbname={} user={} password={}".format(db_name, user, password))
cur = con.cursor(... | SatoshiNakamotoGeoscripting/SatoshiNakamotoGeoscripting | Tweets project/createTable.py | Python | mit | 1,465 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
This module is the Python connector for the peinjector patching service, it is part of the peinjector project.
https://github.com/JonDoNym/peinjector
Provides de-serialization and in-stream patch applying capabilities for PE Files
"""
__author__ = 'A.A.'... | Esser420/EvilTwinFramework | core/MITMCore/MITMPluginsAux/libPePatch.py | Python | gpl-2.0 | 4,758 |
from frappe import _
def get_data():
return {
'heatmap': True,
'heatmap_message': _('Memeber Activity'),
'fieldname': 'member',
'transactions': [
{
'label': _('Membership Details'),
'items': ['Membership']
}
]
} | indictranstech/erpnext | erpnext/non_profit/doctype/member/member_dashboard.py | Python | agpl-3.0 | 238 |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/__init__.py
__version__=''' $Id: __init__.py 3047 2007-02-23 17:45:16Z rgbecker $ '''
__doc__=''
from reportlab.platypus.flowables import Flow... | alexissmirnov/donomo | donomo_archive/lib/reportlab/platypus/__init__.py | Python | bsd-3-clause | 1,060 |
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard 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 3 of th... | thanatoskira/AndroGuard | build/lib.linux-x86_64-2.7/androguard/core/bytecodes/apk.py | Python | lgpl-3.0 | 55,407 |
# -*- coding: utf-8 -*-
################################################################################
# Module: utils.py
# Description: Test imports and network extraction
# License: GPL3, see full license in LICENSE.txt
# Web: https://github.com/DavidBreuer/CytoSeg
#################################################... | DavidBreuer/CytoSeg | CytoSeg/utils.py | Python | gpl-3.0 | 74,513 |
#! /usr/bin/env python
#
# blend.py
#
"""
Example usage of Conceptual Blending API.
Instantiates blender with a simple dataset stored in an AtomSpace
and learns a new concept.
For complete documentation on how to pass additional parameters to
blender, refer to the documentation at the following link:
https://github.com... | kim135797531/opencog | examples/python/conceptual_blending/2_blend_with_config.py | Python | agpl-3.0 | 1,929 |
from django.shortcuts import render, get_object_or_404 as go404, redirect
from django.views.decorators.http import require_POST
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django import forms
from .models import Problem, Code, Upvote, Hint, HintUpvote
from django.c... | afg984/happycoding | problem/views.py | Python | mit | 4,814 |
import tweepy
import sqlite3
import time
conn = sqlite3.connect("twitter_data.db")
consumer_key = "4kTL89hW5YqX4GPUUpzJ6lYbF"
consumer_secret = "uEAmYCALLO5CSKlm0Yql39RTeF8PeRByYt3G8kASM8JjVRzrS1"
def authenticate(access_token,access_token_secret):
try:
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)... | privatecaptain/twitterbot | main.py | Python | mit | 1,931 |
# -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2019 CERN.
#
# Zenodo is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later v... | slint/zenodo | tests/unit/deposit/test_extra_buckets_permissions.py | Python | gpl-2.0 | 4,275 |
## @package enhanced_grid
"""
Written by Daniel M. Aukes and CONTRIBUTORS
Email: danaukes<at>asu.edu.
Please see LICENSE for full license.
"""
## @brief Contains 2D and 3D Grid containers that supports extended slicing syntax.
##
# These classes are provided for rapid prototyping, the methods defined on t... | danaukes/popupcad | popupcad_gazebo/enhanced_grid.py | Python | mit | 40,856 |
import hashlib
import os.path
from contextlib import contextmanager
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.dispatch import Signal
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from taggi... | nealtodd/wagtail | wagtail/documents/models.py | Python | bsd-3-clause | 5,407 |
#!/usr/bin/python
import cv
import errno
import getopt
import math
import os
import sys
from PIL import Image
########################################################################
# CONFIG VARIABLES #
##############################################################... | ravikiranj/rkjanardhana-dot-com | mustachify/mustachify.py | Python | bsd-2-clause | 10,141 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
from openerp.tests.common import TransactionCase
class TestResPartnerBank(TransactionCase):
"""Tests acc_number
"""
def test_sanitized_acc_number(self... | vileopratama/vitech | src/openerp/addons/base/tests/test_res_partner_bank.py | Python | mit | 2,017 |
import zipfile
import imghdr
from django import forms
from .models import Image, ImageBatchUpload, Album
class AlbumAdminForm(forms.ModelForm):
class Meta:
model = Album
fields = '__all__'
def clean(self):
cleaned_data = self.cleaned_data
if cleaned_data.get('authorized_u... | dsimandl/teamsurmandl | gallery/forms.py | Python | mit | 1,431 |
import atexit
import os
import sqlite3
import LCEngine4 as LCEngine
from Code import AperturasStd
from Code import Books
from Code import ControlPosicion
from Code import PGNreader
from Code.QT import QTUtil2
from Code.QT import QTVarios
import Code.SQL.DBF as SQLDBF
from Code import Util
from Code import VarGen
cl... | lukasmonk/lucaschess | Code/OpeningGuide.py | Python | gpl-2.0 | 28,407 |
"""
Representing one movie.
.. module:: movie
:platform: Unix, Windows
:synopis: providing data for a movie
.. moduleauthor:: Thomas Lehmann <thomas.lehmann.private@googlemail.com>
=======
License
=======
Copyright (c) 2017 Thomas Lehmann
Permission is hereby granted, free of charge, to an... | Nachtfeuer/concept-py | concept/data/movies/movie.py | Python | mit | 5,329 |
from fastapi.testclient import TestClient
from docs_src.path_params.tutorial004 import app
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/files/{file_path}": {
"get": {
"responses": {
... | tiangolo/fastapi | tests/test_tutorial/test_path_params/test_tutorial004.py | Python | mit | 3,043 |
"""Class for `mapping' equilibrium coverages and rates through
descriptor space. This class acts as a base class to be inherited
by other mapper classes, but is not functional on its own.
get_rxn_parameter_map(descriptor_ranges,resolution): Uses a
scaler object to determine the reaction parameters as a function of... | mieand/catmap | catmap/mappers/mapper_base.py | Python | gpl-3.0 | 6,097 |
"""Defaults to call CP2K.
Index
-----
.. currentmodule:: nanoqm.workflows.templates
.. autosummary::
create_settings_from_template
"""
__all__ = ["create_settings_from_template"]
import json
import os
from os.path import join
import pkg_resources as pkg
import yaml
from scm.plams import Molecule
from qmflows.se... | SCM-NV/qmworks-namd | nanoqm/workflows/templates.py | Python | mit | 8,739 |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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... | tzpBingo/github-trending | codespace/python/tencentcloud/scf/v20180416/errorcodes.py | Python | mit | 27,390 |
#!/usr/bin/env python
import sys
try:
from RuntimeBuilder import *
from Sim import *
except ImportError, e:
print "Couldn't find project-utils modules."
sys.exit(1)
MAXFILES = ['Fragmenter.max']
sources = ['fragmenter.c']
target = 'fragmenter'
includes = []
my_cflags = []
my_ldflags = []
b = MaxRuntimeBuilder(... | maxeler/NetworkingCodeExamples | PacketProcessing/Fragmenter/runtime/build.py | Python | bsd-2-clause | 893 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apac... | ntt-sic/neutron | neutron/services/service_base.py | Python | apache-2.0 | 3,414 |
def extractEternalpath(item):
"""
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
return False
| fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractEternalpath.py | Python | bsd-3-clause | 212 |
import os
import math
import time
import numpy as np
import paddle
import paddle.fluid as fluid
from paddle.fluid.initializer import NormalInitializer
import reader
def load_reverse_dict(dict_path):
return dict((idx, line.strip().split("\t")[0])
for idx, line in enumerate(open(dict_path, "r").re... | qingqing01/models | fluid/chinese_ner/train.py | Python | apache-2.0 | 11,344 |
# -*- coding: utf-8 -*-
from navmazing import NavigateToAttribute
from widgetastic.widget import Text, Checkbox, Table, View
from widgetastic_patternfly import Tab, BootstrapSelect
from widgetastic_manageiq import TimelinesChart
from utils.update import Updateable
from utils.pretty import Pretty
from utils.appliance i... | dajohnso/cfme_tests | cfme/optimize/bottlenecks.py | Python | gpl-2.0 | 2,335 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.