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
from . import secret DATASOURCES = { 'instagram': dict( client_id= secret.INSTAGRAM_CLIENT_ID, client_secret= secret.INSTAGRAM_CLIENT_SECRET, ), 'clarifai': dict( app_id= secret.CLARIFAI_APP_ID, app_secret= secret.CLARIFAI_APP_SECRET, ), 'googlemaps': dict( k...
rybo449/tlc
tlc/settings/common.py
Python
mit
984
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from django.dispatch import Signal get_visibility_errors = Signa...
suutari-ai/shoop
shuup/core/signals.py
Python
agpl-3.0
1,075
import subprocess import select import signal import os import sys import threading import Queue import time """ The Py'd Piper of Hamelin """ class daemon: """ This is a template class to create a daemon. """ def __init__(self, args): """ Create a new daemon which runs `args` as a server. You should ...
zippynk/hamelin
hamelin-py/hamelin/hamelin.py
Python
mit
5,491
#!/usr/env/python import picamera from time import sleep camera = picamera.PiCamera() camera.vflip = False camera.hflip = False camera.brightness = 60 camera.start_preview() while True: sleep(1)
ninjaneering/raspberrypi-mirror
pi-mirror.py
Python
bsd-2-clause
205
#------------------------------------------------------------------------- # CxxTest: A lightweight C++ unit testing library. # Copyright (c) 2008 Sandia Corporation. # This software is distributed under the LGPL License v3 # For more information, see the COPYING file in the top CxxTest directory. # Under the terms of ...
chalmers-revere/opendlv.carolocup
thirdparty/cxxtest/python/python3/cxxtest/cxxtest_parser.py
Python
gpl-2.0
9,070
import pandas as pd import numpy as np import pyaf.ForecastEngine as autof import pyaf.Bench.TS_datasets as tsds import logging import logging.config #logging.config.fileConfig('logging.conf') logging.basicConfig(level=logging.INFO) #get_ipython().magic('matplotlib inline') b1 = tsds.load_airline_passengers() df ...
antoinecarme/pyaf
tests/xgb/test_air_passengers_xgb_only_with_custom_options.py
Python
bsd-3-clause
1,788
import urllib2 import wikipedia import json from bs4 import BeautifulSoup if __name__ == '__main__': wikipedia.set_rate_limiting(True) charity_list_url = 'List_of_charitable_foundations' wikipage_list = wikipedia.page(charity_list_url) charity_results = [] for charity_name in wikipage_list.links: ...
MrMallIronmaker/donatio
pullCharityData.py
Python
mit
1,208
#! /usr/bin/env python # Author: Franck Michea < franck.michea@gmail.com > # License: New BSD License (See LICENSE) ''' This is the main file of LPBM project. You can write it either uppercased or lowercased, I don't care. LPBM aims to provide a easy way to generate nice prosonnal blog based on markdown files. See REA...
fmichea/lpbm
lpbm/main.py
Python
bsd-3-clause
1,996
from distutils.core import setup setup( name='django-bacon-ipsum', version='0.1', author=u'Richard Fung', author_email='richard@yetihq.com', packages=find_packages(), url='http://github.com/YetiHQ/django-bacon-ipsum', license='MIT license, see LICENSE', description='An alternative to lo...
yeti/django-bacon-ipsum
setup.py
Python
mit
414
# -*- coding: utf-8 -*- """ Physical quantities. """ from __future__ import division import numbers from sympy import sympify, Expr, Number, Mul, Pow, Add from sympy.core.compatibility import reduce from .units import Unit #TODO: in operations, interpret a Unit as a quantity with factor 1 class Quantity(Expr): ...
chaffra/sympy
sympy/physics/unitsystems/quantities.py
Python
bsd-3-clause
6,864
#!/usr/bin/env python # -*- coding: utf-8 -*- # freeseer - vga/presentation capture software # # Copyright (C) 2011, 2013, 2014 Free and Open Source Software Learning Centre # http://fosslc.org # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public L...
Freeseer/freeseer
src/freeseer/tests/framework/config/options/test_folder.py
Python
gpl-3.0
3,387
#!/usr/bin/env python # # Copyright 2009, 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...
fvacek/freeopcua
tests/gtest/test/gtest_throw_on_failure_test.py
Python
lgpl-3.0
5,770
from argparse import ArgumentParser from utils import * """ Gets Posts (default) or Pages as python objects. """ # python get_posts.py # # OR # # posts = get_all_posts(verbose=True) # print posts[0].content # # (Pdb) dir(posts[0]) # [... 'comment_status', 'content', 'custom_fields', 'date', 'date_modified', 'definit...
gregdetre/wordpress-python-emacs
get_posts.py
Python
mit
2,783
#!/usr/bin/env python from nose.tools import * import mapnik, pickle # Tests that exercise map projections. # Trac Ticket #128 def test_wgs84_inverse_forward(): p = mapnik.Projection('+init=epsg:4326') c = mapnik.Coord(3.01331418311, 43.3333092669) e = mapnik.Envelope(-122.54345245, 45.12312553, 68.233...
semprebon/mapnik
tests/python_tests/projection_test.py
Python
lgpl-2.1
620
# coding: utf-8 """ kinto Kinto is a minimalist JSON storage service with synchronisation and sharing abilities. It is meant to be easy to use and easy to self-host. **Limitations of this OpenAPI specification:** 1. Validation on OR clauses is not supported (e.g. provide `data` or `permissions` in patch ...
gabisurita/kinto-codegen-tutorial
python-client/test/test_group.py
Python
mit
2,149
# -*- coding: utf-8 -*- """ /*************************************************************************** GeobricksQgisPluginWorldBank A QGIS plugin Plugin for Qgis 2.x. Creates thematic maps with World Bank data. ------------------- begin ...
geobricks/geobricks_qgis_plugin_world_bank
geobricks_qgis_plugin_world_bank.py
Python
gpl-2.0
16,696
# -*- encoding: utf-8 -*- # # Copyright © 2014-2016 eNovance # # 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...
gnocchixyz/gnocchi
gnocchi/tests/test_carbonara.py
Python
apache-2.0
38,695
#!/usr/bin/python # -*- coding: utf-8 -*- from lib.meos import MEoS from lib import unidades class Ethanol(MEoS): """Multiparameter equation of state for ethanol""" name = "ethanol" CASNumber = "64-17-5" formula = "C2H6O" synonym = "" rhoc = unidades.Density(273.1858492) Tc = unidades.Tem...
edusegzy/pychemqt
lib/mEoS/Ethanol.py
Python
gpl-3.0
14,427
#!/usr/bin/python #coding:utf8 __author__ = ['markshao'] from pagrant.test import test_context def test_ls(): machine = test_context.machines['test-server'] print machine.execute_command("whoami")
markshao/pagrant
test/sample_test.py
Python
mit
208
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __openerp__....
emgirardin/compassion-modules
sponsorship_compassion/wizards/migration_analytic.py
Python
agpl-3.0
2,686
#!/usr/bin/env python # Generate DITG script files from a pcap file # Copyright (C) 2016 Deven Bansod # # 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 # (a...
devenbansod/pcap_to_ditg
pcap_to_ditg/util.py
Python
gpl-3.0
1,620
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin from future.moves.urllib.parse import quote import re import logging from requests.exceptions import RequestException from flexget import plugin from flexget.config_schema imp...
oxc/Flexget
flexget/plugins/sites/torrentleech.py
Python
mit
6,593
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-aiplatform
samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_tensorboard_service_list_tensorboards_async.py
Python
apache-2.0
1,601
#!/usr/bin/python3 #prebuilt hastag_bot def prebuild(): prebuild = """ \n#passes the api keys twitter = Twython(CONSUMER_KEY,CONSUMER_SECRET,ACCESS_KEY,ACCESS_SECRET) #setting search results as a variable bad_words = [" -RT"] """You can add whatever blacklist words you would like""" good_words = ('%s') blacklist =...
hippykid88/skybot
prebuilt_hashtag.py
Python
mit
599
# coding=utf-8 """Test Hazard Metadata.""" from unittest import TestCase from safe.common.utilities import unique_filename from safe.metadata import HazardLayerMetadata __copyright__ = "Copyright 2016, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "info@inasafe.org" __revision__ = '$Format:%H$' cl...
AIFDR/inasafe
safe/metadata/test/test_hazard_metadata.py
Python
gpl-3.0
886
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
josenavas/QiiTa
qiita_pet/handlers/study_handlers/ebi_handlers.py
Python
bsd-3-clause
6,553
import datetime import exifread import logging import xmltodict as x2d from opensfm.sensors import sensor_data from opensfm import types logger = logging.getLogger(__name__) def eval_frac(value): return float(value.num) / float(value.den) def gps_to_decimal(values, reference): sign = 1 if reference in 'N...
kkkarthik6/Lol
opensfm/exif.py
Python
bsd-2-clause
11,492
# 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...
rabipanda/tensorflow
tensorflow/python/tools/inspect_checkpoint.py
Python
apache-2.0
5,525
import frappe def execute(): reports = frappe.get_all('Report', fields = ['name', 'json'], filters = { 'is_standard': 'No', 'report_type': ['!=', 'Report Builder'], }) for report in reports: columns = frappe.parse_json(report.json) if columns: for col in columns: if isinstance(col, dict) and ...
vjFaLk/frappe
frappe/patches/v12_0/scrub_custom_report_column_fieldnames.py
Python
mit
476
# Generate vdpau_template.c functions = """ # get_error_string should be first, because the function lookup loop should # have it available to print errors for other functions get_error_string bitmap_surface_create bitmap_surface_destroy bitmap_surface_put_bits_native bitmap_surface_query_capabilities decoder_create ...
ronin13/MplayerMt
TOOLS/vdpau_functions.py
Python
gpl-2.0
1,843
class check_information_banner(): """ check_information_banner: Get database banner information. """ # References: TITLE = 'Database Banner' CATEGORY = 'Information' TYPE = 'sql' SQL = "SHOW VARIABLES LIKE '%version%'" verbose = False skip = False resu...
foospidy/DbDat
plugins/mysql/check_information_banner.py
Python
gpl-2.0
702
"""Test the ``dtool name`` command.""" import os from . import chdir_fixture # NOQA from click.testing import CliRunner from dtoolcore import ProtoDataSet from dtoolcore.utils import sanitise_uri def test_dataset_readme_show_functional(chdir_fixture): # NOQA from dtool_create.dataset import create, show, fr...
jic-dtool/dtool-create
tests/test_dtool_dataset_readme_show.py
Python
mit
1,269
# Copyright 2014-2021 Scalyr 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 agreed to in writin...
imron/scalyr-agent-2
benchmarks/micro/time_utils.py
Python
apache-2.0
2,713
# -*- coding: utf-8 -*- """ rolabesti.validator ~~~~~~~~~~~~~~~~~~~ This module contains validation related functionality. """ import os from os.path import isdir import sys from .conf import settings from .player import MAXIMUM_OVERLAP_LENGTH, MINIMUM_OVERLAP_LENGTH, PLAYERS from .sorter import SORTINGS def get_v...
kinuax/rolabesti
rolabesti/validator.py
Python
gpl-2.0
2,818
# RABDAM # Copyright (C) 2020 Garman Group, University of Oxford # This file is part of RABDAM. # RABDAM 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 # the License, or (at your...
GarmanGroup/RABDAM
tests/test_bnet_calculation.py
Python
lgpl-3.0
8,856
import _plotly_utils.basevalidators class YValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="y", parent_name="scattergl", **kwargs): super(YValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_type=k...
plotly/python-api
packages/python/plotly/plotly/validators/scattergl/_y.py
Python
mit
443
from datetime import date class Vendor: def __init__(self, name, address, phone, email): self.name = name self.address = address self.phone = phone self.email = email self.inventory = {} def add_item(self, item, price, date=date.today()): self.inventory.setdefa...
masasin/recipes
main.py
Python
gpl-3.0
2,156
""" Copyright 2017-2018 yhenon (https://github.com/yhenon/) Copyright 2017-2018 Fizyr (https://fizyr.com) 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-...
delftrobotics/keras-retinanet
keras_retinanet/preprocessing/csv_generator.py
Python
apache-2.0
7,634
# Copyright 2014 Mirantis 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...
openstack/osprofiler
osprofiler/tests/unit/cmd/test_shell.py
Python
apache-2.0
6,136
#!/usr/bin/env python # -*- coding:utf-8 -*- import spider import tornado.web import tornado.httpserver import tornado.options import tornado.ioloop from datetime import * import pymongo from tornado.options import define,options define("port",default=8888,help="run on the given port",type=int) class BaseHandler(to...
sysussuml/deadlinekiller
main.py
Python
gpl-3.0
4,129
import http.server import urllib.parse import time import jcli.loggerator as loggerator from examples.commands import CliCommands HOST_NAME = "0.0.0.0" PORT_NUMBER = 5001 MODULE = 'CLI.server' LOGGER = loggerator.getLoggerator(MODULE) class CliHandler(http.server.BaseHTTPRequestHandler): def do_HEAD(self): ...
jrecuero/jc2li
server/main.py
Python
mit
1,835
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
chipaca/snapcraft
tests/unit/extractors/test_setuppy.py
Python
gpl-3.0
4,140
#!/usr/bin/env python # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. # # Bio.Wise contains modules for running and processing the output of # some of the models in the Wise2 package by Ewan Birney av...
Ambuj-UF/ConCat-1.0
src/Utils/Bio/Wise/__init__.py
Python
gpl-2.0
4,832
# Copyright (c) 2010, Mats Kindahl, Charles Bell, and Lars Thalmann # All rights reserved. # # Use of this source code is goverened by a BSD licence that can be # found in the LICENCE file. import sys, os.path here = os.path.dirname(os.path.abspath(__file__)) root = os.path.split(here)[0] sys.path.append(root) impor...
xujyan/mysql-replicant-python
lib/tests/test_config.py
Python
bsd-3-clause
2,449
save_traceback = False cleartarget = False spine_locations = {"top": 10, "right": 10, "left": 10, "bottom": 10} rounding_tolerance = 1e-4
FlyRanch/figurefirst
figurefirst/figurefirst_user_parameters.py
Python
mit
138
""" raven.scripts.runner ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from __future__ import print_function import logging import os import sys import time from optparse import Opti...
smarkets/raven-python
raven/scripts/runner.py
Python
bsd-3-clause
3,238
__version__ = '1.0.9' import bibcode_to_bibtex
ryanvarley/adsbibtex
adsbibtex/__init__.py
Python
mit
48
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from distutils.core import setup, Command # pylint: disable=no-name-in-module import dtree class TestCommand(Command): description = "Runs unittests." user_options = [] def initialize_options(self): pass def finalize_options(self): ...
chrisspen/dtree
setup.py
Python
lgpl-3.0
1,398
#!/usr/bin/env python #--------------------------------------------------------------------------- ## Copyright (C) 2010- Alexey Petrov ## Copyright (C) 2009-2010 Pebble Bed Modular Reactor (Pty) Limited (PBMR) ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU...
asimurzin/hybridFlu
hybridFlu/examples/test_unv2foam_standalone.py
Python
gpl-3.0
2,289
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 applicab...
google-research/google-research
gumbel_max_causal_gadgets/gadget_2.py
Python
apache-2.0
10,674
""" Gateway module - this module should be ignorant of Oscar and could be used in a non-Oscar project. All Oscar-related functionality should be in the facade. """ import logging from django.conf import settings from django.core import exceptions from paypal import gateway from paypal.payflow import models from payp...
embedded1/django-oscar-paypal
paypal/payflow/gateway.py
Python
bsd-3-clause
6,766
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-service-control
google/cloud/servicecontrol_v2/services/service_controller/async_client.py
Python
apache-2.0
16,407
from __future__ import print_function, division from itertools import permutations from sympy.combinatorics import Permutation from sympy.core import AtomicExpr, Basic, Expr, Dummy, Function, sympify, diff, Pow, Mul, Add, symbols, Tuple from sympy.core.compatibility import range, reduce from sympy.core.numbers import...
kaushik94/sympy
sympy/diffgeom/diffgeom.py
Python
bsd-3-clause
56,439
# -*- encoding: utf-8 -*- """Test class for Template CLI :Requirement: Template :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: CLI :TestType: Functional :CaseImportance: High :Upstream: No """ from fauxfactory import gen_string from robottelo.cli.base import CLIReturnCodeError from robottelo....
ares/robottelo
tests/foreman/cli/test_template.py
Python
gpl-3.0
8,063
# Copyright (c) 2013 Red Hat 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 agreed to in writi...
tellesnobrega/storm_plugin
sahara/tests/unit/service/validation/edp/test_job_executor_java.py
Python
apache-2.0
2,252
#!/usr/bin/env python #coding: utf-8 from licant.modules import submodule from licant.cxx_modules import application, doit from licant.scripter import scriptq scriptq.execute("../../gxx.g.py") application("target", sources = ["main.cpp"], include_paths = ["../.."], modules = [ submodule("gxx", "posix"), submo...
Mirmik/gxx
tests/HIDE/topo2/make.py
Python
mit
484
''' Bin assignment for WEST simulations. This module defines "bin mappers" which take vectors of coordinates (or rather, coordinate tuples), and assign each a definite integer value identifying a bin. Critical portions are implemented in a Cython extension module. A number of pre-defined bin mappers are available here...
ASinanSaglam/westpa
src/westpa/core/binning/assign.py
Python
gpl-3.0
17,754
# zeroconf.py - zeroconf support for Mercurial # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''discover and advertise repositories on the local network Zeroconf-enabled re...
iaddict/mercurial.rb
vendor/mercurial/hgext/zeroconf/__init__.py
Python
mit
6,100
import setuptools import os # Conditionally include additional modules for docs on_rtd = os.environ.get('READTHEDOCS', None) == 'True' requirements = list() if on_rtd: requirements.append('gevent') requirements.append('tornado') requirements.append('twisted') long_description = ('Pika is a pure-Python imp...
pika/pika
setup.py
Python
bsd-3-clause
2,355
from setuptools import find_packages, setup import os def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='renpass', version='0.3.1', author='Simon Hilpert, Cord Kaldemeyer, Martin Söthe, Stephan Günther', author_email='simon.hilpert@uni-flensburg.de', ...
znes/renpass_gis
setup.py
Python
gpl-3.0
800
#!/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. """ Output file objects for generator. """ import difflib import os import time import sys from idl_log import ErrOut, InfoOut, W...
plxaye/chromium
src/ppapi/generators/idl_outfile.py
Python
apache-2.0
5,313
def hoge(): print u"hogehoge" if __name__ == "__main__": print "aaaa" hoge()
nasdamin/matsuh5devops
test.py
Python
mit
83
#!/usr/bin/env python from __future__ import print_function import requests import sys import os import argparse import json import urlparse import logging from bs4 import BeautifulSoup logging.basicConfig( format='%(asctime)s %(levelname)s: %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p') logger = log...
willbarton/regulations-stub
send_to.py
Python
cc0-1.0
7,750
""" A management command which deletes expired accounts (e.g., accounts which signed up but never activated) from the database. Calls ``RegistrationProfile.objects.delete_expired_users()``, which contains the actual logic for determining which accounts are deleted. """ import re from optparse import make_option fro...
stefankoegl/django-couchdb-utils
django_couchdb_utils/registration/management/commands/cleanup-registrations.py
Python
bsd-3-clause
2,308
# encoding: utf-8 ''' @author: jeffzhengye @contact: yezheng@scuec.edu.cn @file: structured_data.py @time: 2020/12/23 11:27 origin: https://www.tensorflow.org/tutorials/structured_data/feature_columns?hl=zh-cn @desc: 样例: 如何使用tf.feature_column 来处理结构化数据, ''' import numpy as np import pandas as p...
jeffzhengye/pylearn
tensorflow_learning/tf2/structured_data.py
Python
unlicense
3,848
from django.db import models class Contact(models.Model): title = models.CharField(max_length=127) post = models.TextField() def __unicode__(self): return self.title
tdwyer/Django
coophcc/contact/models.py
Python
gpl-3.0
172
#!/usr/bin/env python """ @package @file test_parameter_values.py @author James D. Case @brief """ from nose.plugins.attrib import attr import unittest from coverage_model import * from coverage_model.parameter_types import RaggedArrayType import numpy as np import random # TODO: Revisit this test class and expand/e...
ooici/coverage-model
coverage_model/test/test_parameter_values.py
Python
bsd-2-clause
38,140
#! /usr/bin/env python from __future__ import generators """ Module difflib -- helpers for computing deltas between objects. Function get_close_matches(word, possibilities, n=3, cutoff=0.6): Use SequenceMatcher to return list of the best "good enough" matches. Function ndiff(a, b): Return a delta: the diffe...
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.2/Lib/difflib.py
Python
mit
39,926
#!/usr/bin/env python ''' mission editor module Michael Day June 2104 ''' from MAVProxy.modules.lib import mp_util from MAVProxy.modules.lib import multiproc from MAVProxy.modules.lib import win_layout from MAVProxy.modules.mavproxy_misseditor import me_event MissionEditorEvent = me_event.MissionEditorEvent from pym...
Dronecode/MAVProxy
MAVProxy/modules/mavproxy_misseditor/mission_editor.py
Python
gpl-3.0
15,325
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
pavelchristof/gomoku-ai
tensorflow/python/framework/constant_op.py
Python
apache-2.0
8,761
import requests from celery import shared_task from django.utils import timezone @shared_task def associate_conversations(post_pipeline_dto): requests.get('https://yahoo.com') # Fake IO request requests.get('https://yahoo.com') # Fake IO request requests.get('https://yahoo.com') # Fake IO request r...
Evzdrop/celery-2619-repro
celery_repro/repro/tasks/associate_conversations.py
Python
mit
344
import sys import subprocess import traceback import os def classpath(javac_command): if 'javac_switches' in javac_command: switches = javac_command['javac_switches'] if 'cp' in switches: return switches['cp'] if 'classpath' in switches: return switches['classpath'] return None def class_d...
jayhorn/DynSlicer
do_like_javac/tools/common.py
Python
apache-2.0
1,200
from operator import mul import heapq class Solution(object): def maximumProduct(self, nums): """ :type nums: List[int] :rtype: int """ largest3 = heapq.nlargest(3, nums) smallest3 = heapq.nsmallest(3, nums) if largest3[0] <= 0: if largest3[0] == 0...
ckclark/leetcode
py/maximum-product-of-three-numbers.py
Python
apache-2.0
978
import torch class Model: pass class TransformerModel(Model): def __init__(self, model): self._model = model def __call__(self, decoded_ids, metadata): model_inputs = { 'input_ids': metadata['input_ids'], 'past_key_values': metadata.get('past_key_values', None), ...
sameersingh/uci-statnlp
hw4/models.py
Python
apache-2.0
1,262
# Copyright 2012 OpenStack LLC # Copyright 2012-2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.or...
trunglq7/horizon
openstack_dashboard/openstack/common/version.py
Python
apache-2.0
3,286
from enum import Enum from bs4 import BeautifulSoup class PluginType(Enum): CRAWLER = 0 CHECKER = 1 FILTER = 2 HEADER = 3 POSTPROCESS = 4 class PluginTypeError(Exception): def __str__(self): return "Unknown plugin type" class ConfigurationError(Exception): def __init__(self, ms...
eghuro/crawlcheck
src/checker/common.py
Python
mit
612
import dcmp.auth.models
deckmon/airflow-dag-creation-manager-plugin
plugins/dcmp/auth/__init__.py
Python
apache-2.0
23
#!/usr/bin/env python import sys from distutils.core import setup from distutils.core import Extension from distutils.command.build import build from distutils.command.install_data import install_data # Supress warning that distutils generates for the install_requires option import warnings warnings.simplefilter('ig...
go-bears/Final-Project
weblogo-3.4_rd/setup.py
Python
mit
2,217
""" ******************************************************************************** Learn Python the Hard Way Third Edition, by Zed A. Shaw ISBN: 978-0321884916 ******************************************************************************** """ def break_words(stuff): """This function will break up w...
msnorm/projects
zspy2/ex25/ex25.py
Python
mit
1,243
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('rango', '0002_auto_20150401_0132'), ] operations = [ migrations.AddField( model_name='category', nam...
matheuskiser/pdx_code_guild
django/tango_with_django_project/rango/migrations/0003_category_slug.py
Python
mit
444
#!/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...
rogerscristo/BotFWD
env/lib/python3.6/site-packages/telegram/files/video.py
Python
mit
2,958
#!/usr/bin/env python # # 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 # "...
michaelhkw/incubator-impala
shell/shell_output.py
Python
apache-2.0
4,684
# -*- coding: utf-8 -*- """ Reference --------- *Machine Design, an integrated approach*. Robert L. Norton, \ Prentice Hall. Fifth Edition, 2014. *Résistance des matériaux*. Bazergui, Bui-Quoc, Biron, McIntyre, Laberge, \ Presses internationales Polytechnique. Third Edition, 2002. General consideration -------------...
aurelienpierre/LibreMecaDesign
lib/geometry.py
Python
gpl-3.0
3,687
# Copyright (c) 2022 PaddlePaddle 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 appli...
PaddlePaddle/Paddle
python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_mish_op.py
Python
apache-2.0
2,538
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-11-11 18:27 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('dev_times', '0006_auto_20161012_1431'), ] operations...
diegojromerolopez/djanban
src/djanban/apps/dev_times/migrations/0007_auto_20161111_1927.py
Python
mit
834
# -*- 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...
Johnzero/erp
openerp/addons/document/std_index.py
Python
agpl-3.0
7,094
# Copyright 2019 The meson development team # # 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 ...
jpakkane/meson
mesonbuild/compilers/mixins/gnu.py
Python
apache-2.0
14,781
import gen_utils from module_base import ModuleBase from module_mixins import ScriptedConfigModuleMixin import module_utils import wx import vtk class myTubeFilter(ScriptedConfigModuleMixin, ModuleBase): """Simple demonstration of ScriptedConfigModuleMixin-based wrapping of a single VTK object. It would ...
chrisidefix/devide
modules/user/myTubeFilter.py
Python
bsd-3-clause
2,694
import requests import logging from pywb.utils.wbexception import AccessException, NotFoundException from pywb.utils.wbexception import BadRequestException, WbException from pywb.cdx.cdxobject import CDXObject from pywb.utils.canonicalize import canonicalize #=========================================================...
ikreymer/pywb-warcbase
warcbase/client.py
Python
mit
3,805
import argparse import os import shutil import time import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim import torch.utils.data import torchvision.transforms as transforms import torchvision.datasets as datasets import densenet as dn # used for logging ...
andreasveit/densenet-pytorch
train.py
Python
bsd-3-clause
10,601
#!/usr/bin/env python # Plotting different droplet size distributions used in Opendrift (see openoil3D.py script) import numpy as np import matplotlib.pyplot as plt from datetime import datetime, timedelta from opendrift.models.openoil3D import OpenOil3D #################################################### # Delvig...
knutfrode/opendrift
examples/example_droplet_distribution_plotting.py
Python
gpl-2.0
4,414
# Copyright 2014 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. import collections import page_sets import re from measurements import timeline_controller from metrics import speedindex from telemetry import benchmark fr...
markYoungH/chromium.src
tools/perf/benchmarks/service_worker.py
Python
bsd-3-clause
7,596
# 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 ...
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/upgrade_policy_py3.py
Python
mit
1,359
__version__ = 1.1 __copyright__ = "Copyright 2015 Samuel T. Denton, III" __author__ = "Samuel T. Denton, III <sam.denton@emc.com>" __contributors__ = [] __license__ = """ Copyright (c) 2015 Samuel T. Denton, III, <sam.denton@emc.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this ...
samwyse/AlertingConfig
src/htmltags.py
Python
mit
4,411
from django.contrib import admin from helios.shipping.models import * if settings.IS_MULTILINGUAL: import multilingual admin_info = { 'class': multilingual.ModelAdmin, 'suffix': '_en' } else: admin_info = { 'class': admin.ModelAdmin, 'suffix': '' } class ShipperAdmin(admin_info['class']): prepopulated_f...
panosl/helios
helios/shipping/admin.py
Python
bsd-3-clause
1,187
from django import forms class ParamForm(forms.Form): id = forms.CharField( max_length=20) value = forms.FloatField() text = forms.CharField( widget = forms.Textarea)
mlnstnjvc/nurses
parameters/forms.py
Python
gpl-2.0
202
# coding: utf-8 # DJANGO IMPORTS from django.template import Node from django.template import Library from django.utils.safestring import mark_safe register = Library() class CsrfTokenNode(Node): def render(self, context): csrf_token = context.get('csrf_token', None) if csrf_token: if...
josircg/raizcidadanista
raizcidadanista/filebrowser/templatetags/fb_csrf.py
Python
gpl-3.0
1,084
# shipBonusStasisWebSpeedFactorMB # # Used by: # Ship: Vindicator type = "passive" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Stasis Web", "speedFactor", ship.getModifiedItemAttr("shipBonusMB"), skill="Minmatar Battleship")
Ebag333/Pyfa
eos/effects/shipbonusstasiswebspeedfactormb.py
Python
gpl-3.0
320
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('defcdb', '0006_site_reference'), ] operations = [ migrations.AddField( model_name='dc_country', name...
acdh-oeaw/defc-app
defcdb/migrations/0007_auto_20151120_0807.py
Python
mit
2,178
#!/usr/bin/python import sys,os import csv import urllib import uuid def main(): # rcn;reference;acronym;status;programme;topics;frameworkProgramme;title;startDate;endDate;projectUrl;objective;totalCost;ecMaxContribution;call;fundingScheme;coordinator;coordinatorCountry;participants;participantCountries;subjects w...
JulianSchuette/secunity
tools/csv2rdf_fp7organizations.py
Python
mit
2,458