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 -*- # Generated by Django 1.10.5 on 2017-02-28 02:47 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateMo...
julienawilson/news-project
news_project/articles/migrations/0001_initial.py
Python
mit
785
import nengo import nengo_pushbot import numpy as np import tankudp addr_cerebellum = '10.162.177.253' port_cerebellum = 8889 addr_hippocampus = '10.162.177.253' port_hippocampus = 5005 addr_planner = '10.162.177.253' port_planner = 9004 port_vision = 9005 model = nengo.Network() with model: tank = tankudp.Tan...
tcstewar/telluride2014
tank/reactive_minimal.py
Python
gpl-3.0
2,482
from a10sdk.common.A10BaseClass import A10BaseClass class PortReservation(A10BaseClass): """Class Description:: Set Port Reservations. Class port-reservation supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param inside_...
amwelch/a10sdk-python
a10sdk/core/cgnv6/cgnv6_lsn_port_reservation.py
Python
apache-2.0
2,356
import unittest try: from unittest.mock import Mock, patch, mock_open, MagicMock except ImportError: from mock import Mock, patch, mock_open, MagicMock class TestCase(unittest.TestCase): def __init__(self, *args, **kwargs): self.mock_open = mock_open self.Mock = Mock self.MagicMoc...
marcwebbie/mockie
mockie/test_case.py
Python
mit
1,710
import sublime import sublime_plugin ###---------------------------------------------------------------------------- def find_view(window, title, current_view=None): """ Attempt to find a view with the given title (name) in the given window """ if current_view is not None and current_view.name() == ...
OdatNurd/OverrideAudit
lib/output_view.py
Python
mit
4,032
#MenuTitle: Realign Handles in Current Glyph # -*- coding: utf-8 -*- __doc__=""" Realigns Handles in Current Glyph. Glyph must be opened in Edit View. """ def realignHandles(): moveForward = NSPoint( 1, 1 ) moveBackward = NSPoint( -1, -1 ) currentController = Glyphs.currentDocument.windowController().activeEditView...
weiweihuanghuang/Glyphs-Scripts
Paths/Realign Handles.py
Python
apache-2.0
786
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('bookmarks', '0001_initial'), ] operations = [ migrations.AddField( model_name='bookmark', name='vali...
RossBrunton/BMAT
bookmarks/migrations/0002_bookmark_valid_url.py
Python
mit
399
import os def verification(): # if we have a ca bundle in the current directory, use that as the certificate verification method, # otherwise don't do verification. get your own by curling https://curl.haxx.se/ca/cacert.pem certFile = os.path.join(os.path.dirname(__file__), os.path.pardir, 'cacert.pem') ...
SouthForkResearch/CHaMP_Metrics
lib/sslverify.py
Python
gpl-3.0
398
#-*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2015 One Click Software (http://oneclick.solutions) # and Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # This program is free software: you ca...
cartertech/odoo-hr-ng
hr_infraction/__openerp__.py
Python
agpl-3.0
1,858
from __future__ import absolute_import from __future__ import print_function from contextlib import contextmanager from typing import (cast, Any, Callable, Dict, Generator, Iterable, Iterator, List, Mapping, Optional, Set, Sized, Tuple, Union, IO) from django.core import signing from django.core.ur...
j831/zulip
zerver/lib/test_helpers.py
Python
apache-2.0
17,096
# -*- coding: utf-8 -*- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. """ bkr job-cancel: Cancel running Beaker jobs...
beaker-project/beaker
Client/src/bkr/client/commands/cmd_job_cancel.py
Python
gpl-2.0
2,402
# django imports from django import forms from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _ class LFSFileInput(forms.FileInput): """A custom file widget which displays the current file. """ def render(self, name, value, attrs=None): output = super(LFS...
pigletto/django-lfs
lfs/core/widgets/file.py
Python
bsd-3-clause
921
# Copyright 2014 Huawei Technologies Co. Ltd # # 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 ...
kidchang/compassv2-api
compass/db/api/metadata.py
Python
apache-2.0
8,071
# postgresql/hstore.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import re from .base import ischema_names from .array import ARRAY from ... im...
pcu4dros/pandora-core
workspace/lib/python3.5/site-packages/sqlalchemy/dialects/postgresql/hstore.py
Python
mit
12,411
# Copyright 2020 Red Hat, 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...
sundeep-co-in/transtats
dashboard/services/consume/decorators.py
Python
apache-2.0
3,602
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations def update_irina_demyanova(apps, schema_editor): JuryMember = apps.get_model('cpm_data.JuryMember') JuryMember.objects.filter(name_en='Irina Demyanova ').update( name_en='Irina Demyanova', country...
kinaklub/next.filmfest.by
cpm_data/migrations/0012_update_jury_irina_demyanova.py
Python
unlicense
602
from flask import Blueprint, make_response, request, jsonify, \ session as flask_session import json from sqlalchemy import Table, func, or_ from api.database import session, engine, Base from api.models import SourceDest endpoints = Blueprint('endpoints', __name__) @endpoints.route('/matrix/') def matrix(): ...
open-city/school-admissions
api/endpoints.py
Python
mit
3,229
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
uclouvain/osis_louvain
base/models/enums/offer_year_entity_type.py
Python
agpl-3.0
1,477
def sumPropDiv(n): """returns sum of proper divisors of n""" dSum = 0 for x in range(1, n/2 + 1): if n % x == 0: dSum += x return dSum def amicSum(number): """finds the sum of all amicable numbers less than number, with number greater than 4.""" answer = 0 for x in range...
paulmcquad/projecteuler
0-100/problem21.py
Python
gpl-3.0
571
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'AwardedBadge', fields ['badge', 'user'] db.delete_unique(u'pokeradio_awarde...
pokelondon/pokeradio
web/pokeradio/migrations/0011_auto__add_field_awardedbadge_expiry__del_unique_awardedbadge_badge_use.py
Python
gpl-3.0
7,024
""" Edit Toolbar middleware """ import urlparse from cms import settings as cms_settings from cms.utils import get_template_from_request from cms.utils.plugins import get_placeholders from django.conf import settings from django.contrib.auth import authenticate, login, logout from django.core.urlresolvers import revers...
dibaunaumh/tikal-corp-website
cms/middleware/toolbar.py
Python
bsd-3-clause
5,225
from Stimulant import * import pandas as pd class Cell(object): """docstring for Cell""" def __init__(self): self.stimulants = {} self.stimulant = Stimulant() self.p1 = Point() self.p2 = Point() self.p1.x = 0 self.p1.y = 0 self.p2.x = 0 self....
iamgp/pyCa
pyCa/Cell.py
Python
gpl-3.0
1,577
import re def extract_patterns(s_repr, pattern): #print s_repr #print pattern re_pat = re.compile(pattern) position = 0 matched_list = [] while position < len(s_repr): match = re_pat.search(s_repr, position) if not match: break matched_s = match.group(0) ...
gcvalderrama/Jarvis
Lincoln/05AMRParsing/Reader/re_utils.py
Python
apache-2.0
3,008
#!/usr/bin/env python # -*- coding: utf-8 -*- import tornado import tornado.autoreload import tornado.ioloop import tornado.web import tornado.httpclient import tornado.httputil import json import logging import os import tornado.options tornado.options.parse_command_line() redirects = { "localhost:8888"...
rgbkrk/301inabox
main.py
Python
apache-2.0
1,991
import h5py import argparse import random import re from progressbar import ProgressBar atoms = {'o': 0.13, 's': 0.03, 'n': 0.12, 'c': 0.72} branches = 0.19 rings = 0.14 atom_pattern = re.compile('[a-z]') ring_label = 1 def get_arguments(): parser = argparse.ArgumentParser(description='Generate SMILES like st...
patrick-winter-knime/deep-learning-on-molecules
smiles-vhts/generate_smiles.py
Python
gpl-3.0
2,551
''' the following import is only necessary because eip is not in this directory ''' import sys sys.path.append('..') ''' The simplest example of writing a tag from a PLC NOTE: You only need to call .Close() after you are done exchanging data with the PLC. If you were going to read/write in a loop or read/write more...
dmroeder/pylogix
examples/10_write_simple.py
Python
apache-2.0
491
import copy from django.conf import settings from django.core.exceptions import FieldError from django.utils.translation import ugettext_lazy as _ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cms.utils import get_language_from_request from cms.utils.moderator import get_cmspl...
Glasgow2015/team-10
env/lib/python2.7/site-packages/djangocms_inherit/cms_plugins.py
Python
apache-2.0
4,235
''' Created on May 31, 2010 @author: jnaous ''' class PermissionRegistrationConflict(Exception): """ Raised when a permission is registered with two different views. """ def __init__(self, perm_name, new_view, old_view): message = "Permission %s is already registered " % perm_name mess...
dana-i2cat/felix
optin_manager/src/python/openflow/common/permissions/exceptions.py
Python
apache-2.0
2,331
from marsyas import * from marsyas_util import create from collections import deque def main(): synth = Synth() msg = synth.get_midi_bytes last_note = 0 while(True): print msg() (noteon, note, _) = msg() if (last_note != note) and (noteon == 144): synth.noteon(note...
abramhindle/marsyas-fork
src/marsyas_python/polysynth.py
Python
gpl-2.0
3,632
#! /usr/bin/python import sys, re, os def generateFile(input_directory, file_name, output_directory, package_heirarchy=None, module_name=None): """Generate a rst file telling sphinx to just generate documentation for the public interface automatically. Output will be written to *file_nam...
akozumpl/yum
docs/sphinxdocs/rstgenerator.py
Python
gpl-2.0
7,752
import os from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.sites.models import Site from django.core.urlresolvers import reverse from django.test import TestCase from mock import patch, Mock import re import rdflib from rdflib import RDF from urllib import urlencode, u...
emory-libraries/readux
readux/books/tests/models.py
Python
apache-2.0
25,398
# 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 agreed t...
GoogleCloudPlatform/professional-services
tools/iam-permissions-copier/resources/resource_manager.py
Python
apache-2.0
2,770
# Dennis Verheijden 4455770 KI # Remco van der Heijden 4474139 KI # buyLotsOfFruit.py # ----------------- # Licensing Information: Please do not distribute or publish solutions to this # project. You are free to use and extend these projects for educational # purposes. The Pacman AI projects were developed at UC ...
ScaleRunner/PacmanAI
2- Projects/buyLotsOfFruit.py
Python
mit
2,033
# kalman_filter.py # Created by Ron Boger on 2016-09-18 # Email: rboger2@jhu.edu # Copyright (c) 2016. All rights reserved. # # An implementation of a univariate EM Kalman Filter algorithm. # # Inputs: # y[t] # - observed data # - univariate t time stpe # a, c, q, r, pi, v # - initial parameter values ...
Upward-Spiral-Science/ugrad-data-design-team-0
ron_weekly/sept19/kalman_EM.py
Python
apache-2.0
2,766
class FilterModule(object): ''' A Comment ''' def filters(self): return { 'to_list': self.to_list, } def to_list(self,input_value): import ansible if type(input_value) is list: return input_value elif type(input_value).__name__ in ['str', 'u...
serge-name/myansible
filter_plugins/to_list.py
Python
mit
539
from agol import featureservice if __name__ == "__main__": url = "http://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/World_Urban_Areas/FeatureServer" fs = featureservice.FeatureService(url=url) for serviceLayer in fs.layers: print serviceLayer.name
Esri/agol-helper
source/_list_AGOL_layer_names.py
Python
apache-2.0
288
# Copyright 2016 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( QDialog, QLin...
tuxlifan/moneyguru
qt/controller/panel.py
Python
gpl-3.0
5,750
from odoo import models, fields, api, _ from odoo.exceptions import UserError class CashBox(models.TransientModel): _register = False name = fields.Char(string='Reason', required=True) # Attention, we don't set a domain, because there is a journal_type key # in the context of the action amount = ...
chienlieu2017/it_management
odoo/addons/account/wizard/pos_box.py
Python
gpl-3.0
2,880
#!/usr/bin/env python # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of GNUHAWK. # # GNUHAWK is free software: you can redistribute it and/or modify is under the # terms of the GNU General Public License as published by ...
RedhawkSDR/integration-gnuhawk
components/stream_to_streams_bb_3o/tests/test_stream_to_streams_bb_3o.py
Python
gpl-3.0
4,089
__author__ = 'Marko Milutinovic' """ This class implements a binary data compressor. The base vocabulary for the compressor will be 256 symbols, 0-255 and a termination symbol whose value is 256. An Arithmetic Coding encoder will be used to encode the data into binary. This code is designed as a proof of concept and ...
markomilutin/kompressor
Kompressor.py
Python
gpl-2.0
11,837
# -*- coding: utf-8 -*- from ..request import Request from ..query import Entity from ..query import Entry import json class UserEntity(Entity): """UserEntity object used for upload user entities. Detail information about user entities you can see at our site https://docs.api.ai/docs/userentities""" ...
ChonchoFronto/sarah
lambda/apiai/requests/user_entities/user_entities_request.py
Python
mit
2,842
from datetime import datetime import subprocess path= str(datetime.now().date()) def copy2_path(): card="cp card %s"%(path) card_mode="cp card_mode %s"%(path) subprocess.Popen(card.split()) subprocess.Popen(card_mode.split()) def copy2_Nfile(NPfile): card="mv card %s"%(NPfile) card_mode="mv ca...
TheTrueH4cks0r/YeagerBomb
CoPy.py
Python
gpl-3.0
416
""" @brief test log(time=0s) """ import sys import os import unittest import shutil import urllib.request as URL if "temp_" in os.path.abspath(__file__): raise ImportError( "this file should not be imported in that location: " + os.path.abspath(__file__)) from pyquickhelper.pycode import ge...
sdpython/pyquickhelper
_unittests/ut_loghelper/test_flog_private.py
Python
mit
1,181
# Copyright (c) 2015-2021 Vector 35 Inc # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, ...
joshwatson/binaryninja-api
python/platform.py
Python
mit
17,374
""" This file contains a minimal set of tests for compliance with the extension array interface test suite, and should contain no other tests. The test suite for the full functionality of the array is located in `pandas/tests/arrays/`. The tests in this file are inherited from the BaseExtensionTests, and only minimal ...
GuessWhoSamFoo/pandas
pandas/tests/extension/test_categorical.py
Python
bsd-3-clause
7,289
# # Copyright 2015 Mirantis 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 writ...
pkilambi/ceilometer
ceilometer/dispatcher/resources/volume.py
Python
apache-2.0
1,203
""" ------ Demo code for noise correction algorithm for sCMOS camera (NCS algorithm) on simulated data------------ reference: Liu,Sheng,et al.,sCMOS noise-correction algorithm for microscopy images,Nature Methods 14,760-761(2017) software requirement: Python 3.6 (C) Copyright 2017 The Huang Lab Al...
HuanglabPurdue/NCS
python3-6/NCSdemo_simulation.py
Python
gpl-3.0
1,969
from django.contrib.auth.forms import UserCreationForm, UserChangeForm, AuthenticationForm from django import forms from django.utils.translation import ugettext_lazy as _ from django.contrib.auth import authenticate from captcha.fields import ReCaptchaField from crispy_forms.helper import FormHelper from crispy_forms....
tigeorgia/fixmystreet
apps/users/forms.py
Python
gpl-2.0
8,741
# © 2015-2020 Deltatech # See README.rst file on addons root folder for license details from odoo import fields, models from odoo.tools.misc import formatLang class AccountJournal(models.Model): _inherit = "account.journal" statement_sequence_id = fields.Many2one( "ir.sequence", string="Statement ...
OCA/l10n-romania
l10n_ro_payment_to_statement/models/account_journal.py
Python
agpl-3.0
1,954
# # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of REDHAWK code-generator. # # REDHAWK code-generator is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as pu...
RedhawkSDR/framework-codegen
redhawk/packagegen/resourcePackage.py
Python
lgpl-3.0
9,479
from setuptools import setup from django_rest_tools import get_version setup( name='django-rest-tools', version=get_version(), license='GPLv3', author='Quique Porta', author_email='quiqueporta@gmail.com', description='Tools for Django Rest Framework', long_description=open('README.rst').r...
pombredanne/django-rest-tools
setup.py
Python
gpl-3.0
1,063
import unittest import transaction from pyramid import testing from .models import DBSession class TestMyViewSuccessCondition(unittest.TestCase): def setUp(self): self.config = testing.setUp() from sqlalchemy import create_engine engine = create_engine('sqlite://') from .models i...
trmznt/rhombus
cookiecutter-scaffold/{{cookiecutter.package_name}}/{{cookiecutter.package_name}}/tests.py
Python
lgpl-3.0
1,520
# -*- coding: utf-8 -*- # # Basic testing script that creates a sample universe and world # with a predefined set of parameters and executes a simulation batch import numpy as np import matplotlib.pyplot as plt from simul.universe import Universe from simul.world import WonderfulWorld from simul.control import Simulat...
doct-rubens/predator-prey-beetle-wasp
tests/test_basic.py
Python
bsd-2-clause
2,731
from distutils.core import setup setup( name='Pi-Pin-Manager', version='3.1.0', author='Brian Hines', author_email='brian@projectweekend.net', packages=['pi_pin_manager'], url='http://projectweekend.github.io/Pi-Pin-Manager/', license='LICENSE.txt', description='Setup Raspberry Pi GPIO ...
projectweekend/Pi-Pin-Manager
setup.py
Python
mit
508
"""The tests for the Restore component.""" from datetime import datetime from homeassistant.const import EVENT_HOMEASSISTANT_START from homeassistant.core import CoreState, State from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.entity import Entity from homeassistant.helpers.restore_s...
tinloaf/home-assistant
tests/helpers/test_restore_state.py
Python
apache-2.0
7,485
# -*- coding: utf-8 -*- # Copyright 2016 Christoph Reiter # # 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. """Code for...
elbeardmorez/quodlibet
quodlibet/quodlibet/formats/_serialize.py
Python
gpl-2.0
6,347
# standard library import datetime # Django from django.db import models # Local Django from user.models import Patient # This class defines the fields necessary to invite a patient to register in # the system. class SendInvitationProfile(models.Model): patient = models.OneToOneField(Patient) activation_key...
fga-gpp-mds/2017.2-Receituario-Medico
medical_prescription/user/models/sendinvitationprofile.py
Python
mit
571
# Import signal dictionaries import dict # Import L1 reconstruction which uses cvxopt cvxoptOK = 1 try: import cvxopt except ImportError: print('RxCS DEPENDENCY WARNING !!! ') print('RxCS Warning: no \'cvxopt\' software found! Some reconstruction methods will...
JacekPierzchlewski/RxCS
rxcs/cs/__init__.py
Python
bsd-2-clause
636
# -*- coding: utf-8 -*- import os.path from ..decorators import linter from ..parsers.base import ParserBase @linter( name="eclint", install=[["npm", "install", "eclint"]], help_cmd=[os.path.normpath("./node_modules/.bin/eclint"), "--help"], run=[os.path.normpath("./node_modules/.bin/eclint"), "fix"...
guykisel/inline-plz
inlineplz/linters/eclint.py
Python
isc
669
#!/usr/bin/env python # Copyright 2010 Fluidinfo 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...
fluidinfo/Tickery
bin/print-caches.py
Python
apache-2.0
1,146
c = get_config() #Export all the notebooks in the current directory to the sphinx_howto format. c.NbConvertApp.notebooks = ['notebook2.ipynb'] c.NbConvertApp.export_format = 'python'
unnikrishnankgs/va
venv/lib/python3.5/site-packages/nbconvert/tests/files/override.py
Python
bsd-2-clause
185
def main(): print("loops.py") if __name__ == "__main__": main()
Safuya/python_3_essential_training
07 Loops/loops.py
Python
gpl-3.0
73
# from django.contrib.auth import logout, login, authenticate # from django.contrib.auth.models import User # from django.contrib.auth.decorators import login_required # from django.shortcuts import render # from django.views.decorators.csrf import csrf_exempt # from rest_framework.authtoken.models import Token # from ...
jessica-younker/I-Got-Bugs
api/Bugz/views/insect_view.py
Python
apache-2.0
732
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
rednaxelafx/apache-spark
python/pyspark/ml/tests/test_algorithms.py
Python
apache-2.0
15,028
import os import tempfile from contextlib import contextmanager path = os.path.dirname(__file__) testdir = os.path.join(path, "files") testfile = os.path.join(testdir, "test.ledger") sortedfile = os.path.join(testdir, "test-already-sorted.ledger") alpha_unsortedfile = os.path.join(testdir, "test-alpha-unsorted.ledger...
scarpent/ledgerbil
ledgerbil/tests/filetester.py
Python
gpl-3.0
1,203
#!/usr/bin/env python # -*- coding: utf-8 -*- # # mdfjr - hosts.py # # Created by PyCharm. # User: fajar # Date: 5/13/17 # Time: 4:48 PM # # from django.conf import settings from django_hosts import patterns, host host_patterns = patterns('', host(r'www', settings.ROOT_URLCONF, name='www...
heyost/django-skeleton
project/hosts.py
Python
gpl-2.0
432
# 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...
girving/tensorflow
tensorflow/contrib/feature_column/python/feature_column/sequence_feature_column_test.py
Python
apache-2.0
58,573
import os import base64 from collections import defaultdict from django.db.models import F, Q from xos.config import Config from synchronizers.base.openstacksyncstep import OpenStackSyncStep from synchronizers.base.syncstep import * from core.models.slice import Controller, SlicePrivilege from core.models.user import ...
xmaruto/mcord
xos/synchronizers/base/steps/sync_controller_slice_privileges.py
Python
apache-2.0
4,170
import re import sys import imaplib import datetime from collections import UserString from typing import AnyStr, Optional, List, Iterable, Sequence, Union, Tuple from .consts import UID_PATTERN from .message import MailMessage from .folder import MailBoxFolderManager from .idle import IdleManager from .utils import c...
ikvk/imap_tools
imap_tools/mailbox.py
Python
apache-2.0
15,079
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import urllib from urllib.request import Request import hmac import hashlib import base64 import datetime access_key = 'Z2ETKC4RQFTR4XBQ1A72' secret_key = 'vqdQGtmruGW855mduffA8lsLx+ot9iXIb9QTtT2I' content = None with open('./bigfile', 'r') as f: content = f.read()....
IvanJobs/play
ceph/s3/create_big_object.py
Python
mit
1,364
"""Tests for Oscapcontent :Requirement: Oscapcontent :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: UI :TestType: Functional :CaseImportance: High :Upstream: No """ import unittest2 from fauxfactory import gen_string from nailgun import entities from robottelo.config import settings from robo...
elyezer/robottelo
tests/foreman/ui/test_oscapcontent.py
Python
gpl-3.0
6,070
# Copyright 2016 Google LLC 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 ag...
dhermes/google-cloud-python
spanner/google/cloud/spanner_v1/client.py
Python
apache-2.0
11,355
# Copyright 2019 The Kubeflow 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 applicable law or agreed to in...
kubeflow/pipelines
sdk/python/tests/compiler/testdata/basic_no_decorator.py
Python
apache-2.0
3,468
# SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the Rez Project from Qt import QtWidgets from rezgui.widgets.ContextEnvironTable import ContextEnvironTable from rezgui.util import create_pane from rezgui.objects.App import app class ContextEnvironWidget(QtWidgets.QWidget): split_entries = [("...
instinct-vfx/rez
src/rezgui/widgets/ContextEnvironWidget.py
Python
apache-2.0
1,446
from molotov.api import pick_scenario, scenario, get_scenarios, setup from molotov.tests.support import TestLoop, async_test class TestUtil(TestLoop): def test_pick_scenario(self): @scenario(weight=10) async def _one(self): pass @scenario(weight=90) async def _two(self...
loads/molotov
molotov/tests/test_api.py
Python
apache-2.0
2,203
from django.conf.urls import include, url from django.contrib import admin from blog import views urlpatterns = [ url(r'^$', views.index), url(r'^blog/', include('blog.urls')), url(r'^admin/', admin.site.urls), ]
takdeerkaur/takdeer.ca
takdeerdjango/urls.py
Python
apache-2.0
227
# Rock-paper-scissors-lizard-Spock import math import random # helper functions def name_to_number(name): # convert name to number using if/elif/else if name == "rock": return 0 if name == "Spock": return 1 if name == "paper": return 2 if name == "lizard": ...
pouletalunizado/python
piedrapapeltijeraspocklagartija.py
Python
gpl-3.0
1,954
#!flask/bin/python from flask import Flask, jsonify, request app = Flask(__name__) from pprint import pprint import json import urllib2 @app.route('/', methods=['GET']) def hello(): try: greetings = urllib2.urlopen("http://188.130.155.37:8080/User").read() except (urllib2.HTTPError, urllib2.URLError) as e: ...
mrZizik/lab_reports
webServicesESLab5/main.py
Python
apache-2.0
1,487
from nose.tools import * def assert_instance_of(expected, actual, msg=None): """Verify that object is an instance of expected """ assert isinstance(actual, expected), msg def assert_not_instance_of(expected, actual, msg=None): """Verify that object is not an instance of expected """ assert not isinsta...
jgorset/facebook
tests/asserts.py
Python
mit
880
import sys import numpy as np import loading PATH_FLAT = '/Users/mj/Documents/NEST/' sys.path.append(PATH_FLAT+'/GIFFittingToolbox/src') sys.path.append(PATH_FLAT+'/GIFFittingToolbox/src/HBP') from Experiment import * from GIF import * from AEC_Badel import * from AEC_Dummy import * from Filter_Rect_LinSpaced impo...
cigani/NEST
gif_model/25sFit.py
Python
mit
3,516
# -*- coding: utf-8 -*- ''' Print a stacktrace when sent a SIGUSR1 for debugging ''' # Import python libs import os import sys import time import signal import tempfile import traceback import inspect # Import salt libs import salt.utils def _makepretty(printout, stack): ''' Pretty print the stack trace and...
victorywang80/Maintenance
saltstack/src/salt/utils/debug.py
Python
apache-2.0
1,699
"""Manage, delete, order compute instances.""" # :license: MIT, see LICENSE for more details. import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers from SoftLayer.CLI import template from SoftLayer.CLI import v...
cloudify-cosmo/softlayer-python
SoftLayer/CLI/virt/create.py
Python
mit
10,420
from flask import Flask, render_template, request, session, redirect, url_for from models import db, User, Place from forms import SignupForm, LoginForm, AddressForm app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = # add your Heroku Postgres database URL here db.init_app(app) app.secret_key = "developme...
BartGo/flask-drafts
app/examples/lynda-learningflask/routes.py
Python
mit
2,691
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2017-11-14 14:31 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('opensubmit', '0025_remove_assignment_attachment_test_support'), ] operations = [ mi...
troeger/opensubmit
web/opensubmit/migrations/0026_remove_assignment_attachment_test_compile.py
Python
agpl-3.0
440
# -*- coding: utf-8 -*- # ------------------------------------------------- # Analizador Lexicográfico: # Creación: 29 de Abril de 2016 # Última modificación: 5 de Mayo 2016 # # Autor: # - Daniel Marin # -------------------------------------------------- from __future__ import print_function import re import ply...
danmt/NEO
Codigo_Fuente/etapa3/entrega/Analizador_Lexico.py
Python
gpl-3.0
8,276
from __future__ import division, print_function import unittest from BDProjects.Client import Connector, Installer, Client from BDProjects.EntityManagers.EntityManager import EntityManager class TestEntityManager(unittest.TestCase): def setUp(self): self.config_file_name = 'tests/config.ini' con...
bond-anton/ScientificProjects
tests/test_entity_manager.py
Python
apache-2.0
1,249
from bs4 import BeautifulSoup infile = '' outfile = '' with open(infile, 'r', encoding = 'utf-8') as inputs, open(outfile, 'a', encoding = 'utf-8') as outfile: for line in inputs.read().splitlines(): j = line.split('```') head = j[0] mean = j[1] soup = BeautifulSoup(mean, "html.parser", from_encoding = 'utf-...
821/Daily
div.py
Python
gpl-3.0
611
import importlib import os from PyQt5.QtCore import QSettings class Continue(BaseException): pass class PluginLoader: loadedPlugins = [] loaded = False settings = QSettings("plugins.ini", QSettings.IniFormat) @staticmethod def getLoadedPlugins(): """ This returns instance...
smclt30p/PCS
core/plugins/PluginLoader.py
Python
bsd-2-clause
1,237
from advscript import * import sys from multiprocessing import Process from pynput import keyboard from basev import readimgs import pdb p_list=[] def killer(): print "Kill All..." for p in p_list: p.terminate() def press_f12(key): if key == keyboard.Key["f12"]: killer() return...
dkluffy/dkluff-code
code/opencv/ai_yys/gmain.py
Python
apache-2.0
944
"""empty message Revision ID: 1961d1f70175 Revises: 295087fb3159 Create Date: 2014-05-02 16:15:05.251992 """ # revision identifiers, used by Alembic. revision = '1961d1f70175' down_revision = '295087fb3159' from alembic import op from socorrolib.lib import citexttype, jsontype, buildtype from socorrolib.lib.migrati...
KaiRo-at/socorro
alembic/versions/1961d1f70175_.py
Python
mpl-2.0
897
""" This simple Python script can be run to generate store_pixel_code.h and store_pixel_table.h, which are a poor man's form of generated code to cover the explosion of different blending options when storing a pixel into the framebuffer. Each different combination of options is compiled to a different inner-loop stor...
tobspr/panda3d
panda/src/tinydisplay/store_pixel.py
Python
bsd-3-clause
3,875
# Copyright 2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import os import shutil import tempfile try: from portage.util.file_copy.reflink_linux import file_copy as _file_copy except ImportError: _file_copy = None def _optimized_copyfile(src, dst): """ Copy the conten...
dol-sen/portage
pym/portage/util/file_copy/__init__.py
Python
gpl-2.0
871
"""Support for the Automatic platform.""" import asyncio from datetime import timedelta import json import logging import os import aioautomatic from aiohttp import web import voluptuous as vol from homeassistant.components.device_tracker import ( ATTR_ATTRIBUTES, ATTR_DEV_ID, ATTR_GPS, ATTR_GPS_ACCUR...
Teagan42/home-assistant
homeassistant/components/automatic/device_tracker.py
Python
apache-2.0
12,587
# Copyright 2017 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...
shakamunyi/tensorflow
tensorflow/python/eager/context.py
Python
apache-2.0
15,792
from openflow.optin_manager.sfa.rspecs.elements.element import Element class Channel(Element): fields = [ 'reservation_id', 'channel_num', 'frequency', 'standard', 'slice_id', 'start_time', 'duration', ]
dana-i2cat/felix
optin_manager/src/python/openflow/optin_manager/sfa/rspecs/elements/channel.py
Python
apache-2.0
275
# Django settings for idlebook project. import os import django.conf.global_settings as DEFAULT_SETTINGS import config_reader config = config_reader.get_config('settings.py') DEBUG = config['debug'] TEMPLATE_DEBUG = DEBUG ADMINS = ( (config['admin_name'], config['admin_email']), ) MANAGERS = ADMINS PROJECT_ROO...
shawiz/idlebook
idlebook/settings.py
Python
mit
8,933
from gensim import corpora, models, similarities import json import os # from cpython cimport PyCObject_AsVoidPtr # from scipy.linalg.blas import cblasfrom scipy.linalg.blas import cblas # ctypedef void (*saxpy_ptr) (const int *N, const float *alpha, const float *X, const int *incX, float *Y, const int *incY) nogil ...
cesc-park/CRCN
doc2vec_training.py
Python
mit
1,588
import json import random import re import uuid from requests.auth import HTTPBasicAuth from . import BaseLoadTest def build_task(): suffix = unicode(uuid.uuid4()) data = { "description": "Task description {0}".format(suffix), "status": random.choice(("todo", "doing")), } return data ...
monikagrabowska/osf.io
kinto/loadtests/loadtest/tutorial.py
Python
apache-2.0
12,028
# flake8: noqa from pygls.lsp.types.basic_structures import * from pygls.lsp.types.client import * from pygls.lsp.types.diagnostics import * from pygls.lsp.types.general_messages import * from pygls.lsp.types.language_features import * from pygls.lsp.types.text_synchronization import * from pygls.lsp.types.window impor...
glenngillen/dotfiles
.vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/jedilsp/pygls/lsp/types/__init__.py
Python
mit
364
import re import sys from rez.vendor.six import six from contextlib import contextmanager @contextmanager def with_noop(): yield def reraise(exc, new_exc_cls): traceback = sys.exc_info()[2] six.reraise(new_exc_cls, exc, traceback) # Copyright 2013-2016 Allan Johns. # # This library is free software: y...
fnaum/rez
src/rez/utils/__init__.py
Python
lgpl-3.0
941