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
# Copyright 2018 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googlegenomics/gcp-variant-transforms
gcp_variant_transforms/testing/integration/run_preprocessor_tests.py
Python
apache-2.0
6,857
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'djfreeradmin.views.home', name='home'), # url(r'^djfreeradmin/', include('djfreeradmin.foo.urls...
alb-i986/django-freeradmin
djfreeradmin/urls.py
Python
mit
510
""" WSGI config for offenewahlen_nrw17 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from whitenoise.django im...
OKFNat/offenewahlen-nrw17
src/offenewahlen_api/wsgi.py
Python
mit
701
""" # TOP2049 Open Source programming suite # # Microchip PIC18F2320 DIP18 # # Copyright (c) 2013 Pavel Stemberk <stemberk@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 Found...
mbuesch/toprammer
libtoprammer/chips/microchip8/pic18f2321dip28.py
Python
gpl-2.0
5,349
from weppy import AppModule from weppy.tools import ServiceHandler from starter_weppy import app api = AppModule(app, 'api', __name__, url_prefix='api') api.common_handlers = [ServiceHandler('json')] @api.route() def version(): json = { 'version': 'v1' } return dict(status='OK', data=json)
mijdavis2/starter_weppy
starter_weppy/controllers/api/api.py
Python
mit
314
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
Mirantis/octane
octane/fuelclient/move_node.py
Python
apache-2.0
1,844
from socket import * import threading try: pairfamily = AF_UNIX except NameError: pairfamily = AF_INET def SocketPair(family=pairfamily, type_=SOCK_STREAM, proto=IPPROTO_IP): """Wraps socketpair() to support Windows using local ephemeral ports""" try: sock1, sock2 = socketpair(family, type_, p...
ActiveState/code
recipes/Python/525487_Extending_socketsocketpair_work/recipe-525487.py
Python
mit
970
from contextlib import contextmanager from fabric.context_managers import settings, hide from fabric.state import env from refabric.state import apply_role_definitions @contextmanager def sudo(user=None): with settings(sudo_user=user or env.sudo_user or env.user, use_sudo=True): yield @contextmanager d...
5monkeys/refabric
refabric/context_managers.py
Python
mit
591
from kex import * from ctypes import * from ctypes.wintypes import * import os if __name__ == '__main__': print "[*] WinDriver 12.40 and 12.50 pool overflow privilige escalation" print "[*] CVE-2017-14153" IOCTL_VULN = 0x953824b7 DEVICE_NAME = "\\\\.\\WinDrvr1240" dwReturn = c_ulong() print '[*] Trying Wi...
theevilbit/kex
usage_examples/CVE-2017-14153_windrvr1240-50_win7x86.py
Python
mit
2,678
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python2.7/dist-packages/PyKDE4/kdeui.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg from KPixmapCache import KPix...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/PyKDE4/kdeui/KIconCache.py
Python
gpl-2.0
1,404
#!/usr/bin/python3 # Employee API - v1.0 from opsapi import app from flask import jsonify from flask import request from flask import g """ I prefer the BREAD acryonm: Browse, Read, Edit, Add and Delete So to protect the scope of the entire application functions will be named passenger_[bread_keyword]. This...
roguefalcon/rpi_docker_images
hackmt_2018_code/opsapi/opsapi/employee.py
Python
gpl-3.0
4,177
# Copyright © 2020 Arm Ltd and Contributors. All rights reserved. # SPDX-License-Identifier: MIT """ Object detection demo that takes a video stream from a device, runs inference on each frame producing bounding boxes and labels around detected objects, and displays a window with the latest processed frame. """ impor...
ARM-software/armnn
python/pyarmnn/examples/object_detection/run_video_stream.py
Python
mit
4,016
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
jiahaoliang/group-based-policy
gbpservice/neutron/tests/unit/services/servicechain/ncp/test_traffic_stitching_plumber.py
Python
apache-2.0
4,728
from httmock import urlmatch free_proxy_expected = ['138.197.136.46:3128', '177.207.75.227:8080'] proxy_for_eu_expected = ['107.151.136.222:80', '37.187.253.39:8115'] rebro_weebly_expected = ['213.149.105.12:8080', '119.188.46.42:8080'] prem_expected = ['191.252.61.28:80', '167.114.203.141:8080', '152.251.141.93:8080...
pgaref/HTTP_Request_Randomizer
tests/mocks.py
Python
mit
9,201
class Popup(object): def __init__(self, message, icon=None, colour=None, lifespan=2): self._message = message self._icon = icon self._colour = colour self._lifespan = lifespan @property def message(self): return self._message @property def icon(self): ...
kfcpaladin/sze-the-game
game/models/popups/Popup.py
Python
mit
803
../../../../share/pyshared/orca/script_utilities.py
Alberto-Beralix/Beralix
i386-squashfs-root/usr/lib/python2.7/dist-packages/orca/script_utilities.py
Python
gpl-3.0
51
""" A simple numeric library for music computation. This module is good for teaching, demonstrations, and quick hacks. To generate actual music you should use the music module. """ from itertools import combinations, chain from fractions import Fraction def mod12(n): return n % 12 def interval(x, y): ret...
kroger/pyknon
pyknon/simplemusic.py
Python
mit
3,658
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2015-12-30 06:34 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0007_auto_20151229_18...
patrickspencer/compass-python
webapp/apps/core/migrations/0008_auto_20151230_0634.py
Python
apache-2.0
1,139
from kwue.DB_functions.tag_db_functions import * from django.views.decorators.csrf import csrf_exempt from django.views.decorators.csrf import requires_csrf_token from kwue.controllers.home import * def get_user(req): user_id = req.GET.dict()['user_id'] user = db_retrieve_user(user_id) user_dict = ingre...
bounswe/bounswe2016group4
kwueBackend/kwue/controllers/user.py
Python
apache-2.0
5,045
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('predict', '0010_predictdataset_delete_sources'), ] operations = [ migrations.RemoveField( model_name='predictdat...
IQSS/gentb-site
apps/predict/migrations/0011_remove_predictdataset_status.py
Python
agpl-3.0
371
""" ################################################################################ # # SOAPpy - Cayce Ullman (cayce@actzero.com) # Brian Matthews (blm@actzero.com) # Gregory Warnes (gregory_r_warnes@groton.pfizer.com) # Christopher Blunck (blunck@gst.com) # ###################...
intip/da-apps
plugins/da_centrallogin/modules/soappy/SOAPpy/NS.py
Python
gpl-2.0
3,735
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2010, 2011 CERN. # # Invenio 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...
CERNDocumentServer/invenio
modules/docextract/lib/refextract_api_regression_tests.py
Python
gpl-2.0
1,703
"""Setup data-structures module.""" from setuptools import setup setup( name="sorting-algorithms", description="Python implementations of classic sorting algorithms", version=0.2, author=["Ford Fowler", "Claire Gatenby"], author_email=["fordjfowler@gmail.com", "clairejgatenby@gmail.com"], lic...
fordf/sorting-algorithms
setup.py
Python
mit
515
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 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 ...
jacquerie/inspire-dojson
tests/test_jobs.py
Python
gpl-3.0
18,740
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time: 2017/6/7 下午9:50 # @Author: BlackMatrix # @Site: https://github.com/blackmatrix7 # @File: __init__.py.py # @Software: PyCharm __author__ = 'blackmatix' if __name__ == '__main__': pass
blackmatrix7/apizen
app/demo/__init__.py
Python
apache-2.0
248
# # 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...
powerlim2/python
Spark/pyspark/mllib/stat.py
Python
mit
11,597
from django.conf.urls import url from . import views urlpatterns = [ url(r'profile/(?P<user_pk>\d+)/$', views.view_profile, name='profile'), ]
Jaxkr/TruthBot.org
Truthbot/contributors/urls.py
Python
gpl-2.0
149
import ocl as cam import camvtk import time import vtk import math import datetime red= (1,0,0) green= (0,1,0) blue= (0,0,1) cyan= (0,1,1) yellow= (1,1,0) pink = ( float(255)/255,float(192)/255,float(203)/255) grey = ( float(127)/255,float(127)/255,float(127)/255) orange = ( float(255)/255,float(165)/255,float(0)/255...
AlanZatarain/opencamlib
src/attic/oct_test3.py
Python
gpl-3.0
9,669
import json import os import random import time from contextlib import contextmanager from datetime import datetime, timedelta from decimal import Decimal from functools import partial from urlparse import SplitResult, urlsplit, urlunsplit from django import forms, test from django.db import connections, transaction, ...
Hitechverma/zamboni
mkt/site/tests/__init__.py
Python
bsd-3-clause
34,049
# -*- 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): # Adding field 'Person.updated_at' db.add_column('core_person', 'updated_at', self.gf(...
m3brown/collab
core/migrations/0002_add_keycache.py
Python
cc0-1.0
11,941
from model import Configuration
baverman/taburet
taburet/config/__init__.py
Python
mit
32
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def StorageIORMConfigOption(vim, *args, **kwargs): '''Configuration setting ranges for IO...
xuru/pyvisdk
pyvisdk/do/storage_iorm_config_option.py
Python
mit
1,080
../../../../share/pyshared/gnome_sudoku/sudoku.py
Alberto-Beralix/Beralix
i386-squashfs-root/usr/lib/python2.7/dist-packages/gnome_sudoku/sudoku.py
Python
gpl-3.0
49
import os import numpy as np import random def load_training_data(folder, randomize_hands=False, randomize_players=False, group=False, training_ratio=0.75, is_preflop=True, max_files=None, min_hands=150, load_all=False): fields = ['input', 'output'] if not is_pref...
session-id/poker-predictor
loaders.py
Python
apache-2.0
1,952
from __future__ import print_function, unicode_literals, division, absolute_import import re import io import os import sys import logging try: from bs4 import BeautifulSoup except ImportError: logging.critical('You must install "beautifulsoup4" for this script to work. Try "pip install beautifulsoup4".') ...
hwkns/macguffin
image_hosts/imagebam.py
Python
gpl-3.0
3,640
_base_ = [ '../_base_/datasets/coco_detection.py', '../_base_/default_runtime.py' ] model = dict( type='DeformableDETR', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=False)...
open-mmlab/mmdetection
configs/deformable_detr/deformable_detr_r50_16x2_50e_coco.py
Python
apache-2.0
6,478
#coding:utf-8 import re # 将正则表达式编译成Pattern对象 pattern = re.compile(r'\d+') # 使用re.match匹配文本,获得匹配结果,无法匹配时将返回None result1 = re.search(pattern,'abc192edf') if result1: print result1.group() else: print '匹配失败1'
qiyeboy/SpiderBook
ch04/4.2.2.2.py
Python
mit
288
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library ...
FedoraScientific/salome-paravis
test/VisuPrs/MeshPresentation/F1.py
Python
lgpl-2.1
1,515
from grano.core import db, url_for from grano.model.common import UUIDBase from grano.model.property import Property, PropertyBase class Relation(db.Model, UUIDBase, PropertyBase): __tablename__ = 'grano_relation' #PropertyClass = RelationProperty schema_id = db.Column(db.Integer, db.ForeignKey('grano_sc...
granoproject/grano
grano/model/relation.py
Python
mit
2,276
# Tests: # trystmt ::= SETUP_EXCEPT suite_stmts_opt POP_BLOCK # try_middle COME_FROM # except_stmt ::= except try: x = 1 except: pass # Tests: # trystmt ::= SETUP_EXCEPT suite_stmts_opt POP_BLOCK # try_middle COME_FROM # except_stmt ::= except_cond1 except_suite # except_...
moagstar/python-uncompyle6
test/simple_source/exception/01_try_except.py
Python
mit
495
import numpy as np import tools, minimizers, montecarlo class FeatureSet: """ Basic class to input feature lists and perform basic operations on the lists. Can load data from a CSV file with a header row such as "candidate, list1, list2, ..." left-most column stores the names for candidates. Can perf...
aykol/PyRank
pyrank/rank.py
Python
mit
2,338
# -*- coding: utf-8 -*- """ 003_static_blit_pretty.py static blitting and drawing (pretty version) url: http://thepythongamebook.com/en:part2:pygame:step003 author: horst.jens@spielend-programmieren.at licence: gpl, see http://www.gnu.org/licenses/gpl.html works with pyhton3.4 and python2.7 Blitting a surface on a st...
paolo-perfahl/mini_rpg
minirpg001.py
Python
gpl-2.0
40,408
from __future__ import absolute_import, unicode_literals from celery.bin import celery from djcelery.app import app from djcelery.management.base import CeleryCommand base = celery.CeleryCommand(app=app) class Command(CeleryCommand): """The celery command.""" help = 'celery commands, see celery help' r...
HiveHQ/django-celery
djcelery/management/commands/celery.py
Python
bsd-3-clause
724
# Copyright (C) 2008-2009 Open Society Institute # Thomas Moroz: tmoroz@sorosny.org # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License Version 2 as published # by the Free Software Foundation. You may not use, modify or distribu...
boothead/karl
karl/content/views/references.py
Python
gpl-2.0
19,434
# Copyright (c) 2014-2016 Cedric Bellegarde <cedric.bellegarde@adishatz.org> # 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 option) any later vers...
kerimlcr/ab2017-dpyo
ornek/lollypop/lollypop-0.9.229/src/player_radio.py
Python
gpl-3.0
5,135
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('demo_models', '0002_bar_foos'), ] operations = [ migrations.CreateModel( name='Place', fields=[ ...
AbhiAgarwal/django-report-builder
report_builder_demo/demo_models/migrations/0003_auto_20150419_2110.py
Python
bsd-3-clause
1,395
# encoding: utf-8 # module PyKDE4.kio # from /usr/lib/python3/dist-packages/PyKDE4/kio.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import PyKDE4.kdeui as __PyKDE4_kdeui import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui class KMimeTypeChooserDialog(__PyKDE4_kdeui.KD...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247971765/PyKDE4/kio/KMimeTypeChooserDialog.py
Python
gpl-2.0
501
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009 Brad Ralph, Sydney, Australia # # This is free software. You may redistribute it under the terms # of the Apache license and the GNU General Public License Version # 2 or at your option any later version. # # This program is distributed in the ...
pacoqueen/odfpy
examples/ods-currency.py
Python
gpl-2.0
3,626
""" Views related to the video upload feature """ import csv import json import logging from contextlib import closing from datetime import datetime, timedelta from uuid import uuid4 import rfc6266 from boto import s3 from django.conf import settings from django.contrib.auth.decorators import login_required from djang...
hastexo/edx-platform
cms/djangoapps/contentstore/views/videos.py
Python
agpl-3.0
32,559
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-10-26 20:17 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('document', '0049_document_types'), ] operations = [ migrations.RemoveField( ...
openkamer/openkamer
document/migrations/0050_remove_dossier_is_active.py
Python
mit
394
from __future__ import absolute_import # Zulip's main markdown implementation. See docs/markdown.md for # detailed documentation on our markdown syntax. from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, TypeVar, Union, Text from typing.re import Match import markdown import logging import trace...
peguin40/zulip
zerver/lib/bugdown/__init__.py
Python
apache-2.0
54,643
# Copyright (C) 2003-2006 Rubens Ramos <rubensr@users.sourceforge.net> # Based on code by: # Copyright (C) 2003 Razvan Cojocaru <razvanco@gmx.net> # pychm 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; eit...
jelly/calibre
src/calibre/utils/chm/chm.py
Python
gpl-3.0
21,378
""" Doctests for NumPy-specific nose/doctest modifications """ #FIXME: None of these tests is run, because 'check' is not a recognized # testing prefix. # try the #random directive on the output line def check_random_directive(): ''' >>> 2+2 <BadExample object at 0x084D05AC> #random: may vary on your sys...
anntzer/numpy
numpy/testing/tests/test_doctesting.py
Python
bsd-3-clause
1,347
#!/usr/bin/env python # -*- coding: utf-8 -*- from google.appengine.ext import ndb import logging class Usuario(ndb.Model): autor = ndb.StringProperty() rol = ndb.StringProperty() area = ndb.StringProperty() date = ndb.DateTimeProperty(auto_now_add=True) def get_usuario(cls, keyusuario): ...
jrevatta/daleuncafe
dcmodel.py
Python
apache-2.0
3,541
"""Useful methods and constants""" import os import telnetlib import config GL_GENERAL = "420226" GL_MEETING_FOOD = "421000" WORKER_PORT = 45451 IGNORE_HEADER = "X-Rfpme-Ignore" def filename(id, ext): """ Identifies the file with the given receipt ID and extension. """ if isinstance(id, str):...
btidor/rfpme
util.py
Python
mit
1,793
def random_walk_2D(np, ns, plot_step): xpositions = numpy.zeros(np) ypositions = numpy.zeros(np) # extent of the axis in the plot: xymax = 3*numpy.sqrt(ns); xymin = -xymax NORTH = 1; SOUTH = 2; WEST = 3; EAST = 4 # constants for step in range(ns): for i in range(np): di...
qilicun/python
python3/src/random/walk2D.py
Python
gpl-3.0
1,296
import os import logging import subprocess from urllib.request import urlopen logger = logging.getLogger('vampire') class Umask(object): """ Change umask. """ def __init__(self, mask): self.mask = mask def __enter__(self): self.origin = os.umask(self.mask) def __exit__(self,...
joedborg/vampire
vampire/packages.py
Python
gpl-2.0
3,718
"""Unit tests for memory-based file-like objects. StringIO -- for unicode strings BytesIO -- for bytes """ from __future__ import unicode_literals from __future__ import print_function import unittest from test import test_support as support import io import _pyio as pyio import pickle class MemorySeekTestMixin: ...
NeuralEnsemble/neuroConstruct
lib/jython/Lib/test/test_memoryio.py
Python
gpl-2.0
28,397
from __future__ import absolute_import from django.conf.urls import patterns, url from django.contrib.comments.feeds import LatestCommentFeed from .custom_comments import views feeds = { 'comments': LatestCommentFeed, } urlpatterns = patterns('', url(r'^post/$', views.custom_submit_comment), url(r'^fl...
LethusTI/supportcenter
vendor/django/tests/regressiontests/comment_tests/urls.py
Python
gpl-3.0
559
""" Filename: neumann.py Generalized von Neumann growth model Author: Balint Szoke Date: 07/17/2015 Last update: 10/07/2016 """ import numpy as np from scipy.linalg import solve from scipy.optimize import fsolve, linprog from textwrap import dedent class neumann(object): """ This class describes the Gener...
QuantEcon/QuantEcon.notebooks
dependencies/neumann.py
Python
bsd-3-clause
8,926
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
sebrandon1/neutron
neutron/extensions/project_id.py
Python
apache-2.0
1,418
from pandac.PandaModules import * from direct.actor import Actor from direct.directnotify import DirectNotifyGlobal from otp.otpbase import OTPGlobals import random Props = ((5, 'partyBall', 'partyBall'), (5, 'feather', 'feather-mod', 'feather-chan'), (5, 'lips', 'lips'), (5, 'lipstick', 'lipstick'), (5, 'hat...
ksmit799/Toontown-Source
toontown/battle/BattleProps.py
Python
mit
13,029
""" Resource Registry defines the constants mapping among database types, drivers, datasources and adapters. All resources should be registered here in order to locate them by the resource type. The resource types are defined first. The registry should have this format: REGISTRY = { RESOURCE_TYPE1 => { ENTRY1 =>...
mattduan/proof
ProofRegistry.py
Python
bsd-3-clause
1,333
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2013-2014, 2018-2020 Laurent Monin # Copyright (C) 2017 Sambhav Kothari # Copyright (C) 2018 Wieland Hoffmann # Copyright (C) 2018-2020 Philipp Wolfer # # This program is free software; you can redistribute it and/or # modify i...
metabrainz/picard
test/test_versions.py
Python
gpl-2.0
7,014
# --coding: utf8-- import requests from django.contrib.gis.db import models from django.contrib.gis.geos import GEOSGeometry class Country(models.Model): """ Модель страны. """ title = models.CharField( u'название', max_length=255) class Meta: verbose_name = u'страна' ver...
minidron/django-geoaddress
django_geoaddress/models.py
Python
gpl-2.0
3,479
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020-2022 F4PGA 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 # # Unl...
SymbiFlow/prjuray
fuzzers/002-tilegrid/hdio_bot_right/top.py
Python
isc
845
#!/usr/bin/python # -*- coding: utf-8 -*- # pylint: disable=too-many-lines """ Custom filters for use in openshift-ansible """ import ast import json import os import pdb import random from base64 import b64encode from collections import Mapping # pylint no-name-in-module and import-error disabled here because pylint ...
ewolinetz/openshift-ansible
roles/lib_utils/filter_plugins/oo_filters.py
Python
apache-2.0
28,674
#!/usr/bin/python # # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
google/playhvz
web/tests/adminchat.py
Python
apache-2.0
5,502
__version__ = '0.2.0' from .common import TenX_Runs, Plates __all__ = TenX_Runs, Plates
czbiohub/singlecell-dash
singlecell_dash/__init__.py
Python
mit
89
# This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from decimal import Decimal import pytest from shuup.utils.numbers import parse_decimal_string @...
hrayr-artunyan/shuup
shuup_tests/utils/test_numbers.py
Python
agpl-3.0
745
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 # ...
vlegoff/tsunami
src/secondaires/magie/fonctions/element.py
Python
bsd-3-clause
2,224
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
yencarnacion/jaikuengine
.google_appengine/google/appengine/api/request_info.py
Python
apache-2.0
24,848
# Copyright 2016 NOKIA # # 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...
nuagenetworks/nuage-openstack-neutron
nuage_neutron/vsdclient/resources/dhcpoptions.py
Python
apache-2.0
17,366
from nose.exc import SkipTest def test_ok(): pass def test_err(): raise Exception("oh no") def test_fail(): assert False, "bye" def test_skip(): raise SkipTest("not me")
DESHRAJ/fjord
vendor/packages/nose/functional_tests/doc_tests/test_xunit_plugin/support/test_skip.py
Python
bsd-3-clause
190
""" Python 3 compatibility tools. """ __all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar', 'unicode', 'asunicode', 'asbytes_nested', 'asunicode_nested', 'asstr', 'open_latin1'] import sys if sys.version_info[0] >= 3: import io bytes = bytes unicode = str asuni...
pprett/statsmodels
statsmodels/compatnp/py3k.py
Python
bsd-3-clause
1,592
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Item', fields=[ ('id', models.AutoField(auto_cr...
williamHuang5468/LearningDjango
todoLists/lists/migrations/0001_initial.py
Python
mit
420
import unittest, time, sys, random sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_glm, h2o_kmeans, h2o_browse as h2b, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): # assume we're at ...
vbelakov/h2o
py/testdir_ec2_only/test_KMeans_cats_s3n_thru_hdfs.py
Python
apache-2.0
2,199
import time import webbrowser def fresh(): i=0 utube=r"https://www.youtube.com/watch?v=J3BpOKzEdMI" while i<2: print 'time:%s' %time.ctime() webbrowser.open(utube) time.sleep(2) i+=1 fresh()
lakshita-bhatia/python-scripts
say_hello.py
Python
mit
206
import functools import sys import types from nose import SkipTest from nose.tools import eq_ from .. import helper from ..helper import MockXPI from appvalidator.constants import SPIDERMONKEY_INSTALLATION from appvalidator.errorbundle import ErrorBundle from appvalidator.errorbundle.outputhandlers.shellcolors import...
diox/app-validator
tests/js/js_helper.py
Python
bsd-3-clause
4,452
#!/usr/bin/python import math limit = (1 << 32) - 1 for i in xrange(65536 + 10): if i == 0: continue temp = float(1 << 32) / float(i) approx1 = int(math.floor(temp) - 3) approx2 = int(math.floor(temp + 3)) for j in xrange(approx1, approx2 + 1): if i*j >= (1 << 32): exact = True else: exact = False ...
daimajia/duktape
misc/c_overflow_test.py
Python
mit
458
from ctypes import byref, c_uint32 import vk import ctypes import time ci = vk.InstanceCreateInfo(dict( applicationInfo = dict( applicationName = "vkstruct test", applicationVersion = 1, engineName = "hello engine", engineVersion = 1, apiVersion = (1 << 22 | 0 << 12 | 0) ...
cheery/vkstruct
example.py
Python
mit
3,670
import os, types, collections class EmptyLine(Exception) : """Raised when an empty or comment line is found (dealt with internally)""" def __init__(self, lineNumber) : message = "Empty line: #%d" % lineNumber Exception.__init__(self, message) self.message = message def __str__(self) : return self.message...
tariqdaouda/pyGeno
pyGeno/tools/parsers/CSVTools.py
Python
apache-2.0
10,715
#!/usr/bin/env python # -*- coding: utf-8 -*- """Contains expectations.""" import inquisition FISHY = inquisition.SPANISH FISHY = FISHY.replace('surprise', 'haddock') print FISHY
aedoler/is210-week-03-synthesizing
task_01.py
Python
mpl-2.0
183
from ANN_simulation import * import argparse parser = argparse.ArgumentParser() parser.add_argument("--starting_index", type=int, default=1, help="index of starting iteration") parser.add_argument("--num_of_iterations", type=int, default=10, help="number of iterations to run") parser.add_argument("--starting_network_f...
weiHelloWorld/accelerated_sampling_with_autoencoder
MD_simulation_on_alanine_dipeptide/current_work/src/main_work.py
Python
mit
934
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2014 VoltDB 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 limitati...
zheguang/voltdb
tools/gen_sp_from_catalog.py
Python
agpl-3.0
9,550
# # IPython magic functions to use with Pyspark and Spark SQL # The following code is intended as examples of shorcuts to simplify the use of SQL in pyspark # The defined functions are: # # %sql <statement> - return a Spark DataFrame for lazy evaluation of the SQL # %sql_show <statement> - run the SQL stat...
LucaCanali/Miscellaneous
Pyspark_SQL_Magic_Jupyter/IPython_Pyspark_SQL_Magic.py
Python
apache-2.0
2,061
from Parser.Parser import Parser from EmptyContext import EmptyContext class AbstractNumberParser(Parser): parser = None def __init__(self, text, context): super(AbstractNumberParser, self).__init__(text, context) def parser_default(self): return AbstractNumberParser.parser @staticm...
mathiasquintero/LlamaLang
Parser/Data/Numbers/AbstractNumberParser.py
Python
mit
545
########################################################################## #This file is part of WTFramework. # # WTFramework 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 L...
LeXuZZ/localway_tests
wtframework/wtf/testobjects/basetests.py
Python
gpl-3.0
2,805
#!/usr/bin/python # # Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
googleads/googleads-adxbuyer-examples
python/samples/v2_x/accept_proposal.py
Python
apache-2.0
2,543
import os.path from resource_management.core.resources.system import File, Execute import yaml # pylint: disable=unused-argument class Cassandra(object): def configure(self, env): import params File(os.path.join(params.cassandra_conf_dir, 'cassandra.yaml'), content=yaml.safe_dump(par...
jimbobhickville/ambari-cassandra-service
package/scripts/cassandra.py
Python
apache-2.0
644
# -*- coding: utf-8 -*- # # Amazon Distributed Runner documentation build configuration file, created by # sphinx-quickstart on Tue Jul 26 13:54:46 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogen...
openearth/amazon-distributed-runner
docs/conf.py
Python
gpl-3.0
9,513
__doc_format__ = "reStructuredText" ''' Shows info about netCDF on command line! :Author: kmu :Created: 18. jan. 2012 ''' ''' Imports ''' # Built-in import sys execfile("../themes/set_pysenorge_path.py") # Additional # Own from pysenorge.io.nc import NCreport if len(sys.argv) != 2: print "USAG...
kmunve/pysenorge
pysenorge/tools/NCreport.py
Python
gpl-3.0
401
from django.shortcuts import render, HttpResponse from django.http import JsonResponse import tweepy from .models import TwitterUser from os import environ config = { 'consumer_key': environ['consumer_key'], 'consumer_secret': environ['consumer_secret'], 'access_key': environ['access_key'], 'access_sec...
CuriousLearner/AngelHackDelhi2016
trendingtweeps/tweeps/views.py
Python
mit
6,463
#!/usr/bin/env python """ Example application views. Note that `render_template` is wrapped with `make_response` in all application routes. While not necessary for most Flask apps, it is required in the App Template for static publishing. """ import app_config import logging import oauth import os import parse_doc im...
nprapps/debates
app.py
Python
mit
5,127
# subsystemBonusCaldariPropulsion2WarpSpeed # # Used by: # Subsystem: Tengu Propulsion - Interdiction Nullifier type = "passive" def handler(fit, src, context): fit.ship.boostItemAttr("warpSpeedMultiplier", src.getModifiedItemAttr("subsystemBonusCaldariPropulsion2"), skill="Caldari Prop...
bsmr-eve/Pyfa
eos/effects/subsystembonuscaldaripropulsion2warpspeed.py
Python
gpl-3.0
337
# -*- coding: utf-8 -*- # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from . import mail_mail from . import mail_mass_mailing from . import mail_mass_mailing_list from . import mail_unsubscription
open-synergy/social
mass_mailing_custom_unsubscribe/models/__init__.py
Python
agpl-3.0
221
# -*- 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_featurestore_service_update_feature_async.py
Python
apache-2.0
1,617
#!/usr/bin/env python import pyslurm a = pyslurm.job() print pyslurm.slurm_job_cpus_allocated_on_node("shivling") jobs = a.get() print jobs
phantez/pyslurm
examples/job_test.py
Python
gpl-2.0
144
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/cdn/tests/latest/test_validators.py
Python
mit
1,899
# This file is part of DmpBbo, a set of libraries and programs for the # black-box optimization of dynamical movement primitives. # Copyright (C) 2014 Freek Stulp, ENSTA-ParisTech # # DmpBbo is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as publis...
stulp/dmpbbo
demos_python/dmp/demoDmpChangeInitial.py
Python
lgpl-2.1
5,839