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 setuptools import setup, find_packages setup(name='BIOMD0000000175', version=20140916, description='BIOMD0000000175 from BioModels', url='http://www.ebi.ac.uk/biomodels-main/BIOMD0000000175', maintainer='Stanley Gu', maintainer_url='stanleygu@gmail.com', packages=find_packages(...
biomodels/BIOMD0000000175
setup.py
Python
cc0-1.0
377
#--------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. #--------------------------------------------------------------------...
BurtBiel/azure-cli
src/command_modules/azure-cli-resource/azure/cli/command_modules/resource/generated.py
Python
mit
6,131
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
philippjfr/bokeh
bokeh/sampledata/browsers.py
Python
bsd-3-clause
2,679
"""Add rtp_task_multiple_process_event table Revision ID: 5feda4ca9935 Revises: 9d9af47e64c8 Create Date: 2021-09-30 16:22:30.118641+00:00 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = "5feda4ca9935" down_revision = "...
HERA-Team/hera_mc
alembic/versions/5feda4ca9935_add_rtp_task_multiple_process_event_table.py
Python
bsd-2-clause
1,093
from __future__ import print_function from builtins import str from builtins import range import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.transforms.decomposition import H2OPCA from h2o.estimators.pca import H2OPrincipalComponentAnalysisEstimator def pca_arrests(): pri...
h2oai/h2o-3
h2o-py/tests/testdir_algos/pca/pyunit_arrestsPCA.py
Python
apache-2.0
1,153
#!/usr/bin/env python2 print 'sub process -2 started'
cloud-engineering/wifi
test1.py
Python
mit
53
import collections import json from unittest import mock from django.contrib.auth.models import Group from django.contrib.contenttypes.models import ContentType from django.test import TestCase from django.test.utils import override_settings from django.urls import reverse from rest_framework.test import APIClient f...
zerolab/wagtail
wagtail/api/v2/tests/test_pages.py
Python
bsd-3-clause
61,137
#!/usr/bin/env python # # Copyright (C) 2008 The Android Open Source Project # # 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...
GatorQue/git-repo-flow
main.py
Python
apache-2.0
16,219
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'MailFeedRule.recurse_mailbox' db.add_column(u'core_mailfe...
WillianPaiva/1flow
oneflow/core/migrations/0016_auto__add_field_mailfeedrule_recurse_mailbox.py
Python
agpl-3.0
9,391
# coding=utf-8 # Copyright 2016 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 app...
pombredanne/grumpy
grumpy-tools-src/grumpy_tools/compiler/block_test.py
Python
apache-2.0
10,264
__version__ = '0.2' __author__ = 'Darryl Ring' __author_email__ = 'ringda@uvic.ca' CARBON_PATHS = { 'cloud_other': 'grids.{}.clouds.{}.{}', 'cloud_slots': 'grids.{}.clouds.{}.slots.{}.{}', 'cloud_jobs': 'grids.{}.clouds.{}.jobs.{}.{}', 'cloud_idle': 'grids.{}.clouds.{}.idle.{}', 'cloud_lost': 'grids.{...
hep-gc/cloud-monitoring
cmon/__init__.py
Python
mit
616
import helium import unittest SMILES = helium.Smiles() class TestSmarts(unittest.TestCase): def test_valid_smarts(self): smarts = helium.Smarts() self.assertTrue(smarts.init('C')) self.assertFalse(smarts.error().__nonzero__()) self.assertEqual(0, len(str(smarts.error()))) def...
ahasgw/Helium
test/python/smarts.py
Python
bsd-3-clause
3,633
import functools import re import sys import types from django.conf import settings from django.http import HttpResponse, HttpResponseNotFound from django.template import Context, Engine, TemplateDoesNotExist from django.template.defaultfilters import force_escape, pprint from django.urls import Resolver404, resolve f...
mjtamlyn/django
django/views/debug.py
Python
bsd-3-clause
46,233
from unittest import TestCase from deps2dot.main import get_node, get_tree class MainTest(TestCase): def test_get_node_empty(self): root = {} self.assertIs( get_node(root, []), root ) def test_get_node_toplevel(self): one = {} root = {'a': one...
tartley/deps2dot
deps2dot/tests/main_tests.py
Python
bsd-3-clause
1,816
from django.conf.urls import patterns, url, include urlpatterns = patterns('proftpd.ftpadmin.views', url(r'^$', 'ftpusers.user_list', name="ftpuser_default"), url(r'^add/$', 'ftpusers.add_user', name="ftpuser_add_user"), url(r'^edit/(?P<user_id>\d+)/$', 'ftpusers.edit_user', name="ftpuser_edit_user"), ...
spunkmars/ProFTPD-Admin
src/proftpd/ftpadmin/urls/ftpusers.py
Python
bsd-3-clause
778
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals import sys from terminaltables import SingleTable def _to_utf8(message): try: return message.encode('utf-8') except UnicodeDecodeError: return message def _print_message(stream, *component...
ImageIntelligence/mimiron
mimiron/core/io.py
Python
mit
1,857
# 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...
ageron/tensorflow
tensorflow/python/keras/layers/core_test.py
Python
apache-2.0
11,584
# # 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 # ...
redhat-openstack/heat
heat/engine/stack_resource.py
Python
apache-2.0
14,958
class DeserializationError(Exception): pass
hal0x2328/neo-python
neo/Network/core/exceptions.py
Python
mit
48
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Encrypt a plain text using a repeating key "ICE" import sys import itertools import util def encrypt(text, key): """ XOR the plain text with a repeating key. Returns the encrypted text in hex string. """ charKey = itertools.cycle(key) cipher = "" ...
lttviet/randomPy
repeatingKeyXOR.py
Python
mit
748
"""The tests for the Conversation component.""" # pylint: disable=protected-access import pytest from homeassistant.core import DOMAIN as HASS_DOMAIN from homeassistant.setup import async_setup_component from homeassistant.components import conversation import homeassistant.components as component from homeassistant.c...
tinloaf/home-assistant
tests/components/test_conversation.py
Python
apache-2.0
10,861
import random from flask_bcrypt import generate_password_hash from flask_login import UserMixin from peewee import * from slugify import slugify DATABASE = SqliteDatabase("journal.db") class User(UserMixin, Model): email = CharField(unique=True) password = CharField() slug = CharField(unique=True) ...
n-zhang-hp/Treehouse-Python-Techdegree-Project05
models.py
Python
gpl-3.0
2,736
#!/usr/bin/env python from Crypto import Random from M2Crypto import EVP from io_helper import stream from padding import pad_pkcs5, unpad_pkcs5 from chunk_buffer import ChunkBuffer ALGORITHM = 'aes_256_cbc' # AES has a fixed block size of 16 bytes regardless of key size BLOCK_SIZE = 16 ENC=1 DEC=0 def encrypt(i...
zulu7/pylib
crypto/stream_crypto.py
Python
bsd-3-clause
1,198
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014, 2015 CERN. # # INSPIRE 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...
jalavik/inspire-next
inspire/modules/styleguide/views.py
Python
gpl-2.0
1,210
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup # fetch values from package.xml setup_args = generate_distutils_setup( packages=['parser_pkg'], package_dir={'parser_pkg': 'src/parser_pkg'}) setup(**set...
Leontes/ROS-ATP
parser_pkg/setup.py
Python
apache-2.0
329
import json from bs4 import BeautifulSoup import gluon.contrib.simplejson import os import xmltodict from bs4 import CData def call(): session.forget() return service() web2py_path = os.path.dirname(os.path.abspath('__file__')) @service.json def book_chapters(): tree = [] xml = open('{}/{}'.format(...
withanage/HEIDIEditor
controllers/editor.py
Python
gpl-3.0
3,315
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__(self, plotly_name="color", parent_name="contourcarpet.line", **kwargs): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
plotly/plotly.py
packages/python/plotly/plotly/validators/contourcarpet/line/_color.py
Python
mit
411
""" You've recently read "The Gold-Bug" by Edgar Allan Poe, and was so impressed by the cryptogram in it that decided to try and decipher an encrypted text yourself. You asked your friend to encode a piece of text using a substitution cipher, and now have an encryptedText that you'd like to decipher. The encryption ...
ntthuy11/CodeFights
Arcade/04_Python/07_CaravanOfCollections/frequencyAnalysis.py
Python
mit
1,131
class Mock(object): class _MockQuery(object): '''Access Mock internals''' def __init__(self, mock): self._mock = mock @property def attributes(self): return set(self._mock._attrs.keys()) @property def calls(self): return tuple(se...
pepincho/Python-Course-FMI
interesting/mock.py
Python
mit
1,571
import copy from string import Template from . import CWrapPlugin class GenericNN(CWrapPlugin): INPUT_TYPE_CHECK = Template("checkTypes(is_cuda, $type, $tensor_args);") HEADER_TEMPLATE = Template("void $name($args);") WRAPPER_TEMPLATE = Template("""\ void $name($args) { bool is_cuda = $input->isCuda()...
RPGOne/Skynet
pytorch-master/tools/cwrap/plugins/GenericNN.py
Python
bsd-3-clause
7,688
""" homeassistant.components.sensor.netatmo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NetAtmo Weather Service service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.netatmo/ """ import logging from datetime import timedelta from homeassistant.comp...
nnic/home-assistant
homeassistant/components/sensor/netatmo.py
Python
mit
5,202
from __future__ import print_function from .Manager import *
pbmanis/acq4
acq4/modules/Manager/__init__.py
Python
mit
61
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (c) 2016-2017 Matt Nordhoff <mnordhoff@mattnordhoff.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, incl...
mnordhoff/firefox-pin-data
tor-browser-changelog.py
Python
mit
2,483
import pytest from unittest.mock import patch from case import mock from kombu import Connection class test_get_manager: @mock.mask_modules('pyrabbit') def test_without_pyrabbit(self): with pytest.raises(ImportError): Connection('amqp://').get_manager() @mock.module_exists('pyrabbi...
ZoranPavlovic/kombu
t/unit/utils/test_amq_manager.py
Python
bsd-3-clause
1,196
import numpy as np from datetime import datetime from arcfile import readarc """ load_arc wrapper for readarc """ # Use for time conversions. SECONDS_PER_DAY = 86400. MJD_EPOCH = datetime.strptime('1858-Nov-17:00:00:00', '%Y-%b-%d:%H:%M:%S') # Supported time string formats: # 2009-Apr-29:14:32:01 (Walt format) #...
rwogburn/gcp-arcfile
py_ext/load_arc.py
Python
gpl-3.0
6,992
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class DhpmmF(MakefilePackage): """DHPMM_P:High-precision Matrix Multiplication with Faithful Rou...
LLNL/spack
var/spack/repos/builtin/packages/dhpmm-f/package.py
Python
lgpl-2.1
2,254
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Requests/Messages/UseItemCaptureMessage.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _me...
favll/pogom
pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/UseItemCaptureMessage_pb2.py
Python
mit
3,621
# -*- coding: utf-8 -*- # # Slave, (c) 2014, see AUTHORS. Licensed under the GNU GPL. from __future__ import (absolute_import, division, print_function, unicode_literals) from future.builtins import * import os import pytest from slave.misc import (index, ForwardSequence, range_to_numeric, Aut...
p3trus/slave
slave/test/test_misc.py
Python
gpl-3.0
6,193
from functools import partial import logging import os import pickle from unidecode import unidecode import yaml from blessings import Terminal import numpy as np import pandas as pd from .tm_utils import clean_string, split_alphabetise from .tango_search import TangoInfo pd.options.display.width = 180 TERM = Termi...
alexvicegrab/tango_master
organiser/track_review.py
Python
gpl-3.0
4,598
# Copyright 2016 PerfKitBenchmarker 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...
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/scripts/object_storage_api_test_scripts/s3.py
Python
apache-2.0
3,164
# Copyright (C) 2014-2016 Taiga Agile LLC <support@taiga.io> # 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 the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # ...
Rademade/taiga-back
taiga/stats/services.py
Python
agpl-3.0
6,962
# 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...
hfp/tensorflow-xsmm
tensorflow/contrib/tensorrt/test/quantization_test.py
Python
apache-2.0
5,378
import os import uuid from collections import Counter from django.test import SimpleTestCase from django.test.utils import override_settings from unittest.mock import MagicMock, patch from corehq.apps.userreports.models import ( DataSourceConfiguration, StaticDataSourceConfiguration, ) from corehq.apps.userr...
dimagi/commcare-hq
corehq/apps/userreports/tests/test_static_data_sources.py
Python
bsd-3-clause
3,544
# encoding: utf-8 # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import unicode_literals from __f...
klahnakoski/MySQL-to-S3
vendor/pyLibrary/env/pulse.py
Python
mpl-2.0
7,554
from django.conf.urls import url from django.http import HttpResponse from rest_framework import permissions from rest_framework.views import APIView try: from rest_framework_oauth.authentication import OAuth2Authentication except ImportError: try: from rest_framework.authentication import OAuth2Authent...
GetBlimp/django-rest-framework-jwt
tests/urls.py
Python
mit
1,304
#!/usr/bin/env python """ Inverts an image usage: <script> file_in file_out """ import sys from PIL import Image, ImageOps def main(): infile = sys.argv[1] outfile = sys.argv[2] i = Image.open(infile).convert('L') i2 = ImageOps.invert(i) i2.save(outfile) if __name__ == '__main__': main()
reverie/jotleaf.com
jotleaf/static/patterns/invert.py
Python
mit
316
# 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...
kevin-coder/tensorflow-fork
tensorflow/contrib/distributions/python/kernel_tests/mvn_diag_test.py
Python
apache-2.0
11,376
# encoding: utf-8 # module gtk._gtk # from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so # by generator 1.135 # no doc # imports import atk as __atk import gio as __gio import gobject as __gobject import gobject._gobject as __gobject__gobject from HBox import HBox from FileChooser import FileChooser class F...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/FileChooserButton.py
Python
gpl-2.0
8,073
#!/usr/bin/python #-*-coding: utf-8 -*- from flask import g, jsonify from flask.ext.httpauth import HTTPBasicAuth from ..models import User, AnonymousUser from . import api from .errors import unauthorized, forbidden auth = HTTPBasicAuth() @auth.verify_password def verify_password(email_or_token, password): if ...
singleyoungtao/myblog-flask
app/api_1_0/authentication.py
Python
mit
1,293
# # This file is part of the PyMeasure package. # # Copyright (c) 2013-2017 PyMeasure Developers # # 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 limit...
dvspirito/pymeasure
pymeasure/display/manager.py
Python
mit
9,679
#!/usr/bin/python3 ## Printing troubleshooter ## Copyright (C) 2008, 2009 Red Hat, Inc. ## Author: Tim Waugh <twaugh@redhat.com> ## 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 vers...
poolooloo/emind-cloud-printer
troubleshoot/Welcome.py
Python
gpl-2.0
2,758
import numpy as np import pytest import psi4 from psi4.driver.p4util.solvers import davidson_solver, hamiltonian_solver from .utils import compare_arrays def _diag_dom_sym_mat(size, sep, scale, sym=1.0): M = np.zeros((size, size)) # positive diag elements, sep factor determines how close v = 1.0 for ...
CDSherrill/psi4
tests/pytests/test_solvers.py
Python
lgpl-3.0
12,502
#!/usr/bin/env python # coding=utf-8 # ZoomEye_use_requests support python 2 and 3 import sys #from ZoomEye_use_requests import * from ZoomEye import * HostSearchFacets = "app,device,service,os,port,country,city" WebSearchFacets = "webapp,component,framework,frontend,server,waf,os,country,city" def main(username,pa...
felicitychou/ZoomEye
Demo.py
Python
gpl-3.0
1,632
### Repository for sequence processing functions (spf) for UOD, PSE and PPS algorithms ### Version 1.0.0: 06/28/2016 ### Authors: Felix Francis (felixfrancier@gmail.com); Randall J. Wisser (rjw@udel.edu) ### function to get reverse complement of an input sequence def rev_complement(seq): seq = seq.upper() ba...
drmaize/ThermoAlign
TA_codes/sequence_processing_functions.py
Python
gpl-3.0
2,420
# Copyright 2013 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...
akash1808/nova_test_latest
nova/tests/unit/virt/xenapi/test_vm_utils.py
Python
apache-2.0
99,491
# -*- coding: utf-8 -*- import collections import numpy as np import pytest from pandas.compat import lrange from pandas.core.dtypes.dtypes import CategoricalDtype from pandas import Categorical, Index, isna import pandas.util.testing as tm class TestCategoricalMissing(object): def test_na_flags_int_categori...
GuessWhoSamFoo/pandas
pandas/tests/arrays/categorical/test_missing.py
Python
bsd-3-clause
3,075
#!/usr/bin/env python from __future__ import print_function print("I'm a script with dashes in my name")
ericdorsey/DynamicREADMEcodeblocks
scripts/script-with-dashes.py
Python
mit
105
""" wchoice.py -- by bearophile, V.1.0 Oct 30 2006 Weighted choice: like the random.choice() when the probabilities of the single elements aren't the same. """ from random import random from bisect import bisect from itertools import izip def wchoice(objects, frequences, filter=True, normalize=True): """wchoice(...
dksr/REMIND
python/base/utils/wchoice.py
Python
mit
3,592
#!/usr/bin/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 l...
majetideepak/arrow
dev/release/check-rat-report.py
Python
apache-2.0
1,981
from billy.core import db STATES_TO_PURGE = [s['abbreviation'] for s in db.metadata.find()] for state in STATES_TO_PURGE: state = state.lower() empty_comms = db.committees.find({ 'state': state, 'members': {'$size': 0} }).count() if empty_comms == 0: print("No empty committe...
cliftonmcintosh/openstates
scripts/purge_empty_committees.py
Python
gpl-3.0
771
# -*- coding: utf-8 -*- # # django-timegraph - monitoring graphs for django # Copyright (c) 2011-2012, Wifirst # Copyright (c) 2013, Jeremy Lainé # All rights reserved. # # See AUTHORS file for a full list of contributors. # # Redistribution and use in source and binary forms, with or without modification, # are permit...
jlaine/django-timegraph
timegraph/admin.py
Python
bsd-2-clause
2,072
# -*- encoding: utf-8 -*- # Copyright (c) 2013 Hannes Körber <hannes.koerber@gmail.com> # # This file is part of autobackup. # # autobackup 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 t...
whatevsz/autobackup
autobackup/cron.py
Python
gpl-3.0
17,954
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from flask import Blueprint from . import views from app.main import errors auth = Blueprint('auth', __name__) auth.add_url_rule('/login/', 'login', views.login, methods=['GET', 'POST']) auth.add_url_rule('/logout/', 'logout', views.logout) auth.add_url_rule('/registrat...
knarfeh/HiaBlog
app/auth/urls.py
Python
gpl-2.0
1,156
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-06-13 19:05 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('volontulo', '0014_auto_20180610_1943'), ] operations = [ migrations.RemoveField( ...
w1stler/volontulo
backend/apps/volontulo/migrations/0015_remove_offer_action_status.py
Python
mit
401
# coding=utf-8 # Copyright 2022 The TensorFlow Datasets 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 appl...
tensorflow/datasets
tensorflow_datasets/scripts/documentation/build_api_docs.py
Python
apache-2.0
2,103
# Copyright 2014-2015 Canonical Limited. # # This file is part of charm-helpers. # # charm-helpers is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 as # published by the Free Software Foundation. # # charm-helpers is distributed in the hope ...
whitmo/charmhelpers
charmhelpers/contrib/benchmark/__init__.py
Python
gpl-3.0
3,796
# Copyright 2013 OpenStack Foundation # # 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 ...
Sazzadmasud/Keystone_hash_token
keystone/token/controllers.py
Python
apache-2.0
19,048
### -*- coding: utf-8 -*- ### ### Copyright (C) 2016 Peter Williams <pwil3058@gmail.com> ### ### 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; version 2 of the License only. ### ### This pr...
pwil3058/pysm_wsm
git/gui/__init__.py
Python
gpl-2.0
1,008
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-04-24 22:14 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('payment', '0001_initial'), ] operations = [ migrations.AlterField( ...
eeriks/velo.lv
velo/payment/migrations/0002_auto_20170424_2214.py
Python
gpl-3.0
441
#类定义 class people: #定义基本属性 name = '' age = 0 #定义私有属性,私有属性在类外部无法直接进行访问 __weight = 0 #定义构造方法 def __init__(self,n,a,w): self.name = n self.age = a self.__weight = w def speak(self): print("%s 说: 我 %d 岁。" %(self.name,self.age)) #单继承示例 class s...
wh20160213/WuhuaLearnToPython
python_study_level1/package1/study9_class.py
Python
lgpl-3.0
2,025
#-*- coding: utf-8 -*- # Creation Date : 2016-10-21 # Created by : Antoine LeBel import observer class WebsiteNotifier(observer.Observer): def __init__(self): self.sensor = None def update(self, HumidititySensor): self.sensor = HumidititySensor self._connect() self._update_hum...
Pobux/pattern_conception
observer/website_notifier.py
Python
mit
536
# Author: Jan Koscielniak, (c) 2020 # Released under Gnu GPL v2.0, see LICENSE file for details """Bleichenbacher attack reproducer with timing side-channel check""" from __future__ import print_function import traceback import sys import getopt from itertools import chain from random import sample from tlsfuzzer.runn...
tomato42/tlsfuzzer
scripts/test-bleichenbacher-timing.py
Python
gpl-2.0
48,694
#!/usr/bin/env python try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup import os import sys # Add /usr/local/include to the path for macs, fixes easy_install for several packages (like gevent and pyyaml) if sys.platform == 'darwin': os.environ['C_INCLU...
ooici/ooi-extern
setup.py
Python
bsd-2-clause
952
import json from coalib.bearlib import deprecate_settings from coalib.bearlib.abstractions.Linter import linter from coalib.bears.requirements.GemRequirement import GemRequirement from coalib.results.Result import Result from coalib.results.SourceRange import SourceRange from coala_utils.param_conversion import negate...
dosarudaniel/coala-bears
bears/ruby/RubySmellBear.py
Python
agpl-3.0
8,576
# # NEPI, a framework to manage network experiments # Copyright (C) 2014 INRIA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your ...
phiros/nepi
src/nepi/resources/ns3/classes/mesh_wifi_interface_mac.py
Python
gpl-3.0
8,698
from flask import Blueprint, render_template, jsonify from flask_website.utils import request_wants_json from flask_website.listings.projects import projects mod = Blueprint('community', __name__, url_prefix='/community') @mod.route('/') def index(): return render_template('community/index.html') @mod.route('/...
mitsuhiko/flask-website
flask_website/views/community.py
Python
bsd-3-clause
824
"""deCONZ climate platform tests.""" from copy import deepcopy from unittest.mock import Mock, patch import asynctest from homeassistant import config_entries from homeassistant.components import deconz from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.setup import async_setup_comp...
jabesq/home-assistant
tests/components/deconz/test_climate.py
Python
apache-2.0
6,401
from kivy.app import App from kivy.lang import Builder root = Builder.load_string(''' Label: text: ('[b]Hello[/b] [color=ff0099]World[/color]\\n' '[color=ff0099]Hello[/color] [b]World[/b]\\n' '[b]Hello[/b] [color=ff0099]World[/color]') markup: True font_size: '64pt' ''') class Lab...
Cheaterman/kivy
examples/widgets/label_with_markup.py
Python
mit
437
from django.db import models class Person(models.Model): first_name = models.CharField(max_length=128) last_name = models.CharField(max_length=128) twitter = models.CharField(max_length=64, blank=True) class Comment(models.Model): body = models.TextField(max_length=2048) author = models.ForeignK...
pombredanne/django-rest-framework-jsonapi
tests/models.py
Python
isc
586
r""" Transient Laplace equation with a localized power source and periodic boundary conditions. This example is using a mesh generated by gmsh. Both the .geo script used by gmsh to generate the file and the .mesh file can be found in meshes. The mesh is suitable for periodic boundary conditions. It consists of a cyli...
RexFuzzle/sfepy
examples/diffusion/poisson_periodic_boundary_condition.py
Python
bsd-3-clause
4,129
import datetime from django.core.cache import cache import cronjobs from airmozilla.cronlogger.decorators import capture from . import tweeter from . import pestering from . import event_hit_stats from . import archiver from . import videoinfo from . import vidly_synchronization from . import autocompeter @cronjob...
Nolski/airmozilla
airmozilla/manage/cron.py
Python
bsd-3-clause
1,892
__author__ = 'anass' def path_to_property(obj, props, id_tag='id'): """ Get the property value from a path""" if isinstance(obj, list): # If it is a list it means we need the id to return the value # add if value equal nan ==> no resource found if len(props) is 1: res = [o ...
neiyk/JSONMock.py
jsonmock/utils.py
Python
mit
925
from django.apps import AppConfig class DeptConfig(AppConfig): name = 'dept'
shen427/dept
code/DPSite/dept/apps.py
Python
mit
83
#!/usr/bin/env python from ncclient import manager from ncclient.xml_ import * def connect(host, port, user, password, source): conn = manager.connect(host=host, port=port, username=user, password=password, timeout=10, hostkey_verify=False) result ...
sysbot/ncclient
examples/juniper/unknown-rpc.py
Python
apache-2.0
569
from django.conf.urls import url from django.contrib.auth import views as auth_views from django.core.urlresolvers import reverse from rest_framework.urlpatterns import format_suffix_patterns from . import views urlpatterns =[ url(r'^$', views.index_page, name='index'), url(r'login/$', views.login_view...
Ricnewman2317/travelEye
travelEye/guides/urls.py
Python
gpl-3.0
706
#!/usr/bin/env python """Detect Python closures defined in loops. Closures defined in loops are error prone, since if they reference variables from the loop scope those variables are bound by name instead of being captured at the time of the function definition. For example: funcs = [] for i in range(5): fun...
0359xiaodong/viewfinder
scripts/find_closure_in_loop.py
Python
apache-2.0
1,740
import requests import json import resources class APIClient(): def __init__(self, auth=None, url='http://idiot-beta.herokuapp.com/api/'): self.url = url self.auth = auth if auth: self.me = self.login() def users(self, username=None): if username: # return a user object return resources.User(usern...
tenevdev/python-idiot
idiot/api.py
Python
mit
647
# Copyright (C) 2012 Jelmer Vernooij <jelmer@samba.org> # This program 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. # Thi...
kernevil/samba
buildtools/wafsamba/tests/test_bundled.py
Python
gpl-3.0
1,011
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Notice: This config file is a Python module file. import os import multiprocessing import gunicorn.glogging # [Gunicorn Setting Section] appname = "{APPNAME}" bind = "0.0.0.0:8000" pidfile = "/var/run/{appname}.pid".format(appname=appname) logfile = "/log/{appname}/{...
xgfone/snippet
snippet/example/python/gunicorn-conf.py
Python
mit
1,168
"""Provides a common base for configurator proxies""" import logging import os import shutil import tempfile import docker from certbot import constants from certbot_compatibility_test import errors from certbot_compatibility_test import util logger = logging.getLogger(__name__) class Proxy(object): # pylint:...
wteiken/letsencrypt
certbot-compatibility-test/certbot_compatibility_test/configurators/common.py
Python
apache-2.0
5,499
import os import sys root_path = os.path.abspath("../../../../") if root_path not in sys.path: sys.path.append(root_path) from _Dist.NeuralNetworks.c_BasicNN.NN import Basic from _Dist.NeuralNetworks.d_Traditional2NN.Toolbox import DT2NN from _Dist.NeuralNetworks._Tests.Madelon.MadelonUtil import get_madelon x, y...
carefree0910/MachineLearning
_Dist/NeuralNetworks/_Tests/Madelon/TestDT2NN.py
Python
mit
549
import os, sys import random from nltk import FreqDist from datetime import datetime, date import ipdb utils_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) WWW_DIR = os.path.join(os.path.dirname(utils_path), 'www') SETTINGS_DIR = os.path.join(WWW_DIR, 'project') sys.path.append(utils_path) sys.pat...
ronaldahmed/labor-market-demand-analysis
preprocessing/sample_db.py
Python
mit
3,745
# Copyright 2017 Ignacio Ibeas <ignacio@acysos.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import _, api, exceptions, fields, models class AeatSiiMap(models.Model): _name = "aeat.sii.map" _description = "Aeat SII Map" @api.constrains("date_from", "date_to") def _un...
OCA/l10n-spain
l10n_es_aeat_sii_oca/models/aeat_sii_map.py
Python
agpl-3.0
2,146
import mock from django_images.models import Thumbnail from taggit.models import Tag from tastypie.exceptions import Unauthorized from tastypie.test import ResourceTestCase from .helpers import ImageFactory, PinFactory, UserFactory from ..models import Pin, Image from ...users.models import User __all__ = ['ImageRe...
supervacuo/pinry
pinry/core/tests/api.py
Python
bsd-2-clause
10,976
# =============================================================================== # Copyright 2011 Jake Ross # # 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/licens...
USGSDenverPychron/pychron
pychron/hardware/newport/newport_axis.py
Python
apache-2.0
24,622
# 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...
Bulochkin/tensorflow_pack
tensorflow/contrib/keras/python/keras/layers/wrappers.py
Python
apache-2.0
12,834
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
iansf/sky_engine
sky/tools/webkitpy/layout_tests/models/test_expectations.py
Python
bsd-3-clause
51,022
# -*- coding: utf-8 -*- import copy import logging import os import re import shutil from subprocess import PIPE from subprocess import Popen from subprocess import STDOUT import maven_utils import web_utils from maven_utils import MavenArtifact git_version = None scm_status_cache = {} scm_info_path_cache = {} d...
thauser/pnc-cli
pnc_cli/tools/scm_utils.py
Python
apache-2.0
19,000
# 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 3 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be usefu...
obriencj/python-sibilant
sibilant/compiler/targets/cpython37.py
Python
lgpl-3.0
1,056
import gzip import cPickle import numpy as np import theano import theano.tensor as T from neuralmind import NeuralNetwork from layers import HiddenLayer from layers import ConvolutionLayer from layers import FlattenLayer import activations def load_data(dataset): print '... loading data' # Load the dataset f =...
miguelpedroso/neuralmind
examples/mnist_lenet2.py
Python
mit
1,475