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 The TensorFlow Probability 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 o...
tensorflow/probability
tensorflow_probability/python/internal/tensorshape_util.py
Python
apache-2.0
11,935
# From: https://gist.github.com/nathan-hoad/8966377 import os import asyncio import sys from asyncio.streams import StreamWriter, FlowControlMixin reader, writer = None, None @asyncio.coroutine def stdio(loop=None): if loop is None: loop = asyncio.get_event_loop() reader = asyncio.StreamReader() ...
dpdani/tBB
tBB/async_stdio.py
Python
gpl-3.0
1,064
"""PEP 366 ("Main module explicit relative imports") specifies the semantics for the __package__ attribute on modules. This attribute is used, when available, to detect which package a module belongs to (instead of using the typical __path__/__name__ test). """ import unittest import warnings from .. import util cla...
yotchang4s/cafebabepy
src/main/python/test/test_importlib/import_/test___package__.py
Python
bsd-3-clause
5,630
from .healthcheck_handler import HealthCheck from .tt_handler import TTworker from .graph_handler import GraphHandler from .real_data_handler import RealDataHandler __all__ = [HealthCheck, TTworker, GraphHandler, RealDataHandler]
evemorgen/GdzieJestTenCholernyTramwajProject
backend/schedule_worker/handlers/__init__.py
Python
mit
231
# Copyright (c) 2015 Sebastian Kral # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the MIT License included in this # distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the MIT License. All rights not expressly gra...
skral/tk-syntheyes
python/startup/userSetup.py
Python
mit
2,196
# -*- coding: utf-8 -*- import fauxfactory import pytest from cfme.configure.configuration.region_settings import Category from cfme.rest.gen_data import categories as _categories from cfme.utils import error from cfme.utils.rest import assert_response, delete_resources_from_collection from cfme.utils.update import up...
mfalesni/cfme_tests
cfme/tests/configure/test_tag_category.py
Python
gpl-2.0
3,784
# -*- coding:utf-8 -*- import unittest import mock import datetime from ..utils import MembershipExpirationDateAdapter from .. import constants class MembershipExpirationDateAdapterTestCase(unittest.TestCase): def setUp(self): plan_type = mock.Mock() plan_type.duration_magnitude = 3 plan_...
hellhovnd/dentexchange
dentexchange/apps/membership/tests/test_membership_expiration_date_adapter.py
Python
bsd-3-clause
4,440
# Photovoltaics performance metrics # # Ladybug: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari # # This file is part of Ladybug. # # Copyright (c) 2013-2015, Djordje Spasic <djordjedspasic@gmail.com> # Ladybug is free software; you can redistribute it and/or modify # it under th...
boris-p/ladybug
src/Ladybug_Photovoltaics Performance Metrics.py
Python
gpl-3.0
33,750
#! /usr/bin/python # Joe Deller 2014 # A Minecraft fortune teller. # Level : Intermediate # Uses : Libraries, variables, operators, loops, files # We have a list of fortunes stored in a text tile # This program reads all of the fortunes and picks one of them import mcpi.minecraft as minecraft import mcpi.block as b...
joedeller/pymine
fortune.py
Python
mit
2,873
# Based on Caesar Cipher Hacker # http://inventwithpython.com/hacking (BSD Licensed) from ..utils import LETTERS, hacker_main CIPHERTEXT = 'GUVF VF ZL FRPERG ZRFFNTR.' def hack(message=CIPHERTEXT): for key in range(len(LETTERS)): translated = '' for symbol in message: if symbol in L...
shakirjames/crypto
ciphers/caesar/hacker.py
Python
bsd-2-clause
601
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import Permission class Migration(DataMigration): depends_on = ( ("guardian", "0005_auto...
makinacorpus/formhub
odk_logger/migrations/0012_add_permission_view_xform.py
Python
bsd-2-clause
7,685
def itemTemplate(): return ['/object/tangible/loot/creature_loot/collections/shared_aurebesh_tile_enth.iff'] def STFparams(): return ['static_item_n','col_aurebesh_tile_enth','static_item_d','col_aurebesh_tile_enth'] def AddToCollection(): return 'col_aurebesh_tiles' def CollectionItemName(): return 'enth...
agry/NGECore2
scripts/loot/lootItems/collections/aurebesh_tiles/enth.py
Python
lgpl-3.0
350
# -*- coding: utf-8 -*- ############################################################################### # # GetServiceStatus # This is the standard method following MWS API GetServiceStatus standard. It can return a GREEN, GREEN_I, YELLOW or RED status. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc....
MrNuggles/HeyBoet-Telegram-Bot
temboo/Library/Amazon/Marketplace/Products/GetServiceStatus.py
Python
gpl-3.0
5,109
#!/usr/bin/python """ makePdsGraph.py Ce programme trouve le parcour des fichiers dans le reseau. Pour ce faire, j'utilise les quatres bases de donnees construitent avec le programme 'makePdsInfo' (pxFreq). Quatre clusters sont donc observes pour trouver les chemins mais la mise en place d'autres...
khosrow/metpx
sundew/pxFreq/bin/makePdsGraph.py
Python
gpl-2.0
7,386
#coding=utf8 from gevent import monkey monkey.patch_all() from flask import Flask, render_template, session, request from flask.ext.socketio import SocketIO, emit, join_room, leave_room, \ close_room, disconnect def create_socketio(app): app.debug = True app.config['SECRET_KEY'] = 'secret!' socketio ...
OSorce/writeboard
writeboard/remote.py
Python
mit
1,175
# Copyright 2013 IBM Corp. # 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...
Mirantis/tempest
tempest/services/orchestration/json/orchestration_client.py
Python
apache-2.0
15,875
""" Django settings for DjangoTaskManager project. Generated by 'django-admin startproject' using Django 1.11. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ i...
MaxwellCoriell/DjangoTaskManager
DjangoTaskManager/settings.py
Python
mit
3,319
#! /usr/bin/python3 if __name__ == "__main__": import os import sys import unittest search_path = os.path.join(os.getcwd(), os.path.dirname(__file__)) sys.path.append(os.path.realpath(os.path.join(search_path, ".."))) test_suite = unittest.TestLoader().discover(search_path) unittest.main(de...
talshorer/sliding
tests/autotest.py
Python
gpl-3.0
357
from __future__ import absolute_import # Copyright (c) 2010-2019 openpyxl from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, Sequence, String, Float, Integer, Bool, NoneSet, Set, ) from openpyxl.descriptors.excel import ( ExtensionLi...
cloudera/hue
desktop/core/ext-py/openpyxl-2.6.4/openpyxl/workbook/views.py
Python
apache-2.0
5,253
import os import xmlrunner import all_tests def run_tests(): output = 'test-reports/githubtools' suites = [ all_tests ] for suite in suites: xmlrunner.XMLTestRunner(output=output).run(suite.get_suite()) os.system('cls' if os.name == 'nt' else 'clear')
nricklin/githubtools
tests/__init__.py
Python
mit
298
#!/usr/bin/python3 import string import sys """ -mak This simply takes the ldif generated by newyear_ldif.py and builds it into an ldapmodify formatted ldif. To be used with the ldap modify query below ldapmodify -x -D cn=root,ou=ldap,o=redbrick -y /etc/ldap.secret \ -f [LDIF_FROM_THIS_SCRIPT] """ years_paid...
gruunday/useradm
scripts/newyear_ldapmodify_ldif.py
Python
unlicense
1,513
import SpaceScript import multiprocessing from multiprocessing import Process, Queue, Pipe, Lock from SpaceScript import frontEnd from SpaceScript import utility from SpaceScript.frontEnd import terminal from SpaceScript.utility import terminalUtility from SpaceScript.terminal import terminal as terminal from SpaceScri...
Sauron754/SpaceScript
old/testEnvironments/SpaceScript/threadingFunctions.py
Python
gpl-3.0
1,480
# # Copyright (C) 2002-2008 greg Landrum and Rational Discovery LLC # """ unit testing code for molecular descriptor calculators """ import unittest,os.path import io from rdkit.six.moves import cPickle from rdkit import RDConfig from rdkit.ML.Descriptors import MoleculeDescriptors import numpy from rdkit import Ch...
soerendip42/rdkit
rdkit/ML/Descriptors/UnitTestMolDescriptors.py
Python
bsd-3-clause
1,633
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ''' >>> from bienstman3_ext import * >>> try: ... V() ... except RuntimeError, x: ... print x ... else: ... print 'expected an...
NixaSoftware/CVis
venv/bin/libs/python/test/bienstman3.py
Python
apache-2.0
696
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('voting', '0002_userprofile_user_has_voted'), ] operations = [ migrations.RemoveField( model_name='userprofile', ...
seanballais/SAElections
SAElections/voting/migrations/0003_auto_20150613_1109.py
Python
mit
486
#!/usr/bin/env python2.7 # # Generated Thu Jun 11 18:43:54 2009 by generateDS.py. # import sys import getopt from string import lower as str_lower from xml.dom import minidom from xml.dom import Node # # User methods # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these me...
daniestevez/gr-ao40
docs/doxygen/doxyxml/generated/indexsuper.py
Python
gpl-3.0
19,289
#from __future__ import absolute_import # default_app_config = 'node.apps.NodeConfig'
Baymaxteam/SmartHomeDjango
SmartHome/node/__init__.py
Python
bsd-3-clause
86
def compute_file_hash(hash_type, filename): """Simple helper to compute the digest of a file. @param hash_type: A class like hashlib.sha256. @param filename: File path to compute the digest from. """ hash = hash_type() with open(filename) as file: # Chunk the digest extraction to avoi...
anbangr/trusted-juju
juju/lib/filehash.py
Python
agpl-3.0
541
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import warnings import unittest from ee import _cloud_api_utils from ee import ee_exception class CloudApiUtilsTest(unittest.TestCase): def setUp(self): super(Cloud...
tylere/earthengine-api
python/ee/tests/_cloud_api_utils_test.py
Python
apache-2.0
13,942
from webfs import WebDirParser testDoc = """ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <title>Index of /ubuntu</title> </head> <body> <h1>Index of /ubuntu</h1> <pre><img src="/icons/blank.gif" alt="Icon "> <a href="?C=N;O=D">Name</a> <a href="?C=M;O=A">Last modified<...
harun-emektar/webfs
tests/Test_WebDirParser.py
Python
apache-2.0
1,416
# Copyright Daniel Dunn 2019 # This file is part of Kaithem Automation. # Kaithem Automation 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 3. # Kaithem Automation is distributed in the hope that it...
EternityForest/KaithemAutomation
kaithem/src/jackmanager.py
Python
gpl-3.0
5,439
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
openstack/manila
manila/api/middleware/fault.py
Python
apache-2.0
3,063
#!/usr/bin/env python # -*- coding: utf-8 -*- from plasta.gui import BaseGUI from entrada.add import AddEntrada from PyQt4 import QtCore, QtGui class EntradaGUI(BaseGUI): def __init__(self, parent, manager, managers = []): BaseGUI.__init__(self, parent, manager, managers) self.DialogAddClass ...
informaticameg/Posta
entrada/gui.py
Python
gpl-3.0
372
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- """Test the fileview interface.""" from grr.gui import runtests_test from grr.lib import access_control from grr.lib import action_mocks from grr.lib import aff4 from grr.lib import flags from grr.lib import rdfvalue from grr.lib import test_lib from gr...
pchaigno/grreat
gui/plugins/fileview_test.py
Python
apache-2.0
19,633
#!/bin/env python # -*- coding: utf-8 -*- # Author: Laurent Pointal <laurent.pointal@limsi.fr> <laurent.pointal@laposte.net> from distutils.core import setup import sys setup(name='treetaggerwrapper', version='1.0', author='Laurent Pointal', author_email='laurent.pointal@limsi.fr', url='http://perso....
muyarchi/nn
treeTaggerPython/ttpw/trunk/setup.py
Python
gpl-2.0
1,319
# -*- coding: utf-8 -*- import os.path import re import sys from mod_pbxproj import XcodeProject class PBXModifier (object): XCODE_SUPPORT_FOLDER = u".XcodeSupport" SLASH_REPLACEMENT = u"∕" # DIVISION SLASH Unicode U+2215 FRAMEWORKS_RE = re.compile(ur"^(.+/Frameworks/(?:Debug|Source)/([^/]+))/.+$") ...
deltaprojects/cappuccino
Tools/XcodeCapp/XcodeCapp/Scripts/pbxprojModifier.py
Python
lgpl-2.1
9,866
# -*- coding: utf-8; -*- from __future__ import print_function import os import sys import time import subprocess ## Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill! if 'check_output' not in dir(subprocess): def check_output(cmd_args, *args, **kwargs): proc = subprocess.Popen( ...
ryanmoyer/runescape-price-watch
pavement.py
Python
gpl-3.0
10,818
from __future__ import print_function import six from ..nodes.attributes import NodeAttr # I am still not sure how to resolve many of the things in here, so just leaving # it the way it is. class ntype: DIV = 'div' EXP = 'exp' LOG = 'log' MUL = 'mul' NEG = 'neg' NUM = 'num' POW = 'pow' ...
baharev/SDOPT
sdopt/nodes/types.py
Python
bsd-3-clause
707
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by Xavier Grangier for Recrutae Gravity.co...
goose3/goose3
goose3/video.py
Python
apache-2.0
2,260
#!/usr/bin/env python # # DNATool - A program for DNA sequence manipulation # Copyright (C) 2012- Damien Farrell & Jens Erik Nielsen # # 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...
dmnfarrell/peat
DNATool2/Prefs.py
Python
mit
11,106
#!D:\Seiji\Documentos\fatec-script\tekton-master\backend\venv\Scripts\python.exe # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # based off the tap2deb code # tap2rpm built by Sean Reifschneider, <jafo@tummy.com> """ tap2rpm """ import sys try: import _preamble except ImportError: ...
seijiakiyama/fatec-script
tekton-master/backend/venv/Scripts/tap2rpm.py
Python
mit
387
from typing import Any, Dict, Optional from flask import g, render_template, url_for from flask_babel import format_number, lazy_gettext as _ from flask_wtf import FlaskForm from wtforms import ( BooleanField, IntegerField, SelectMultipleField, StringField, SubmitField, widgets) from wtforms.validators import ...
craws/OpenAtlas-Python
openatlas/views/model.py
Python
gpl-2.0
9,096
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2014 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...
Lilykos/invenio
invenio/modules/classifier/__init__.py
Python
gpl-2.0
898
import difflib import json import os import re import sys from copy import copy from functools import wraps from urlparse import urlsplit, urlunsplit from xml.dom.minidom import parseString, Node import select import socket import threading import errno from django.conf import settings from django.contrib.staticfiles....
adrianholovaty/django
django/test/testcases.py
Python
bsd-3-clause
44,803
import unittest import os import logging logging.basicConfig(level=logging.ERROR) logger = logging.getLogger(__name__) from container.docker.utils import which_docker, config_to_compose from container.config import AnsibleContainerConfig def get_base_path(project): return os.path.normpath(os.path.join(os.path.di...
chouseknecht/ansible-container
test/unit/container/docker/test_utils.py
Python
lgpl-3.0
1,435
""" Support for Worx Landroid mower. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.worxlandroid/ """ import logging import asyncio import aiohttp import async_timeout import voluptuous as vol import homeassistant.helpers.config_validation as c...
persandstrom/home-assistant
homeassistant/components/sensor/worxlandroid.py
Python
apache-2.0
4,963
from neo.SmartContract.Iterable import Enumerator from neo.VM.InteropService import StackItem class ConcatenatedEnumerator(Enumerator): def __init__(self, first, second): # returns a (key,value) tuple per iteration self.first = first.enumerator self.second = second.enumerator self...
hal0x2328/neo-python
neo/SmartContract/Iterable/ConcatenatedEnumerator.py
Python
mit
1,111
# -*- coding: utf-8 -*- # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging from odoo import api, fields, models _logger = logging.getLogger(__name__) class FamilyAux(models.Model): _inherit = 'clv.family_aux' person_...
CLVsol/clvsol_odoo_addons
clv_person_aux/models/family_aux.py
Python
agpl-3.0
1,909
''' Created on 1.12.2016 @author: Darren ''' ''' Design and implement a TwoSum class. It should support the following operations: add and find. add - Add the number to an internal data structure. find - Find if there exists any pair of numbers which sum is equal to the value. For example, add(1); add(3); add(5); fin...
darrencheng0817/AlgorithmLearning
Python/leetcode/TwoSumIiiDataStructureDesign.py
Python
mit
354
myStr = "Why couldn't we get along?"
asedunov/intellij-community
python/testData/intentions/escapedQuotedString_after.py
Python
apache-2.0
36
''' This file is part of TSLoad. Copyright 2013, Sergey Klyaus, ITMO University TSLoad 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 3. TSLoad is distributed in the hope that it...
myaut/tsload
server/tsload/jsonts/api/load.py
Python
gpl-3.0
3,007
mask = masker.mask_img_.get_data() print(mask.shape) plt.matshow(mask[20]) from nilearn.plotting import plot_roi plot_roi(masker.mask_img_, bg_img=None)
NeuroStat/Python-scripts
python_scripts_day1/show_naive_mask.py
Python
gpl-3.0
155
""" This file contains the abstract page implementation. """ # standard import abc import Tkinter as Tk # project from pyvault import shared class AbstractPage(object): """Abstract page implementation.""" __metaclass__ = abc.ABCMeta def __init__(self, root): self.root = root self.main ...
MattCCS/PyVault
pyvault/pages/page.py
Python
mit
870
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import os, tempfile, shutil, subprocess, glob, re, time, textwrap, cPickle, shlex, js...
sharad/calibre
setup/translations.py
Python
gpl-3.0
20,161
################################################################################ # Copyright (c) 2015-2018 Skymind, Inc. # # This program and the accompanying materials are made available under the # terms of the Apache License, Version 2.0 which is available at # https://www.apache.org/licenses/LICENSE-2.0. # # Unless...
RobAltena/deeplearning4j
jumpy/jumpy/memory_manager.py
Python
apache-2.0
1,031
# coding: utf-8 """ :mod:`lib` --- public functions ------------------------------- """ from django.utils.translation import ugettext as _ from modoboa.lib.exceptions import ModoboaException from .models import LimitsPool class LimitReached(ModoboaException): http_code = 403 def __init__(self, limit): ...
disko/modoboa-admin-limits
modoboa_admin_limits/lib.py
Python
mit
1,030
import time from director import segmentationroutines from director import segmentation from director.timercallback import TimerCallback from director.visualization import * class TrackDrillOnTable(object): def __init__(self): self.tableCentroid = None def updateFit(self): # get and display: ...
patmarion/director
src/python/director/trackers.py
Python
bsd-3-clause
2,738
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apa...
phonnz/azure-storage-python
azure/storage/queue/models.py
Python
apache-2.0
2,435
# -*- coding: utf-8 -*- from .. import server, utils class Memcached(server.Server): binary = 'memcached' def init(self, **kwargs): self.binary = utils.find_binary(kwargs.get('memcached_bin', self.binary)) assert 'ip' in kwargs, "memcached servers requires <ip> option" self.ip = kwa...
mialinx/testenv
testenv/contrib/memcached.py
Python
mit
510
# 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...
queria/my-tempest
tempest/api/volume/test_volumes_snapshots.py
Python
apache-2.0
8,340
# Copyright (C) 2012 - 2014 EMC Corporation. # 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 # # Unle...
JioCloud/cinder
cinder/tests/unit/api/contrib/test_cgsnapshots.py
Python
apache-2.0
22,206
""" Django settings for equal_read project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build p...
dlab-projects/equal-read-interface
equal_read/equal_read/settings.py
Python
bsd-2-clause
3,166
#!/usr/bin/env python #export CC=mpicc #export CXX=mpic++ from distutils.core import setup, Extension from distutils import sysconfig import sys print "Remember to set your preferred MPI C++ compiler in the CC and CXX environment variables. For example, in Bash:" print "export CC=mpicxx" print "export CXX=mpicxx" pr...
harperj/KDTSpecializer
setup.py
Python
bsd-3-clause
6,192
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Cliente', fields=[ ('id', models.AutoField(verb...
alissonbf/blog-teste
api/migrations/0001_initial.py
Python
gpl-2.0
892
#-*- encoding:utf-8 -*- import re import time import psycopg2 from scrapy.spiders import CrawlSpider from scrapy.selector import Selector from scrapy.loader import ItemLoader from scrapy.http import Request from LjSpider.items import * from LjSpider.Db.Postgresql import * class ResidenceSHSpider(CrawlSpider): n...
Justyer/LianjiaSpider
LjSpider/LjSpider/spiders/residence_sh_spider.py
Python
mit
4,673
# 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 u...
TuSimple/mxnet
python/mxnet/contrib/onnx/_import/import_onnx.py
Python
apache-2.0
6,849
"""Manager for the extension.""" from django.db.models import Manager from django.core.exceptions import PermissionDenied class SapelliProjectManager(Manager): """Custom manager for geokey_sapelli.SapelliProject.""" def get_list_for_administration(self, user): """ Return all Sapelli projects...
ExCiteS/geokey-sapelli
geokey_sapelli/manager.py
Python
mit
4,507
#!/usr/bin/env python # # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
Aloomaio/googleads-python-lib
examples/ad_manager/v201808/product_service/update_products.py
Python
apache-2.0
2,253
from functools import reduce from operator import add from pygame.math import Vector2 as V2 import pygame as pg, os from src.display.tkinter_windows import create_menu from src.core import constants def init_display(): pg.init() info = pg.display.Info() dims = (int(info.current_w * 0.6), int(info.current_...
StardustGogeta/Physics-2.0
Physics 2.0.py
Python
mit
7,824
#!/usr/bin/env python # # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # David GUENAULT, dguenault@monitoring-fr.org # # This file is part of Shinken. # # Shinken is free software: you can redistribute it and/or modify # it under the terms of the GNU Af...
xorpaul/shinken
windows/Tools/Charp_Services/Shinken_Services/install.d/tools/checkmodule.py
Python
agpl-3.0
1,300
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('candid...
mysociety/yournextrepresentative
candidates/migrations/0032_sitesettings.py
Python
agpl-3.0
3,418
# -*- coding: utf-8 -*- ## ## ## This file is part of Indico ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN) ## ## Indico 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...
pferreir/indico-backup
indico/ext/search/base/__init__.py
Python
gpl-3.0
922
class Solution: def removeElement(self, nums: List[int], val: int) -> int: while val in nums: nums.remove(val) return len(nums)
AHJenin/acm-type-problems
leetcode/AC/Easy/remove-element.py
Python
mit
148
from unittest import mock from django.conf.urls import url from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.db import connections from django.test import TestCase, override_settings from django.urls import reverse class Router: ...
mattseymour/django
tests/auth_tests/test_admin_multidb.py
Python
bsd-3-clause
1,509
__version__ = "1.2.1a"
pseudonumos/easywebdav
easywebdav/__version__.py
Python
isc
23
# Copyright (C) 2016 Red Hat, Inc # # 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 version. # # This program is distributed in ...
projectatomic/commissaire-http
test/test_handlers.py
Python
gpl-3.0
2,696
# 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 f...
axinging/chromium-crosswalk
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py
Python
bsd-3-clause
20,801
import tempfile import os import sys import shutil import contextlib def set_search_paths(topdir): """Set search paths so that we can run binaries and import Python modules""" os.environ['PATH'] = os.path.join(topdir, 'bin') + ':' + os.environ['PATH'] os.environ['PYTHONPATH'] = \ os.path.jo...
salilab/allosmod-lib
test/utils.py
Python
lgpl-2.1
1,764
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
CMUSV-VisTrails/WorkflowRecommendation
vistrails/packages/vtk/__init__.py
Python
bsd-3-clause
2,833
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import json ...
superdesk/superdesk-content-api
features/environment.py
Python
agpl-3.0
2,766
#!/usr/bin/python from base import Persistence class DocumentRev(Persistence): def __getattr__(self, attribute): if attribute=='document': return self.dms.document.get_by_id(self.doc_id) else: raise AttributeError('No such attribute %s' % attribute)
tLDP/lampadas
pylib/persistence/document_rev.py
Python
gpl-2.0
297
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Intel Corporation # 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.o...
sacharya/nova
nova/pci/pci_request.py
Python
apache-2.0
7,771
from models import * from django.contrib import admin admin.site.register(Thread, ThreadAdmin) admin.site.register(ForumPost, PostAdmin) # admin.site.register(UserProfile, ProfileAdmin)
ubgarbage/gae-blog
forum/admin.py
Python
bsd-3-clause
188
# 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 Eagle(MakefilePackage): """EAGLE: Explicit Alternative Genome Likelihood Evaluator""" ...
LLNL/spack
var/spack/repos/builtin/packages/eagle/package.py
Python
lgpl-2.1
1,584
# # Copyright (C) 2012-2013 Designture # # 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, d...
gil0mendes/Infinity-OS
utilities/build/toolchain.py
Python
mit
16,667
# flake8: noqa """ Expose public exceptions & warnings """ from pandas._config.config import OptionError from pandas._libs.tslibs import OutOfBoundsDatetime class NullFrequencyError(ValueError): """ Error raised when a null `freq` attribute is used in an operation that needs a non-null frequency, parti...
TomAugspurger/pandas
pandas/errors/__init__.py
Python
bsd-3-clause
5,913
import pyzmail from kombu import Connection from mailflow.storage import fs from mailflow.front import celery, models, app from messaging import mail_exchange, get_routing_key @celery.task def save_email(inbox_login, mail_from, rcpt_to, raw_message_file): raw_message = fs.getcontents(raw_message_file) inbo...
zzzombat/mailflow
src/mailflow/tasks.py
Python
apache-2.0
1,324
# -*- coding: utf-8 -*- from logging import getLogger from threading import Thread from zmq import REQ, REP, Poller, POLLIN, Context, ROUTER, DEALER, proxy import config from translations_server.db import get_translation from translations_server.lib import db _LOG = getLogger(__name__) _ENCODING = "utf-8" _REQUES...
GreenelyAB/TranslationsServer
src/translations_server/server.py
Python
mit
6,743
# inigo.utils.timez # Time utilities for timestamps with timezones and more! # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Sun Aug 09 17:48:50 2015 -0400 # # Copyright (C) 2015 Bengfort.com # For license information, see LICENSE.txt # # ID: inigo.utils.timez.py [] benjamin@bengfort.com $ """ Time...
bbengfort/inigo
inigo/utils/timez.py
Python
mit
4,263
#!/usr/bin/python import random import urllib import urllib.request import re import os def main(): with open("keywords.txt") as kw: keywords = kw.read().splitlines() id = view_limit(50, keywords) url = 'https://www.youtube.com/watch?v=' + str(id) playable_url = 'mpv ' + url + ' --fs' os.system(playable_url) ...
metalgeek/mpv-random
main.py
Python
mit
1,606
#!/usr/bin/env python import django import os import sys if django.VERSION < (1, 5): sys.stderr.write("ERROR: guardian's example project must be run with " "Django 1.5 or later!\n") sys.exit(1) if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") ...
eventup/django-guardian
example_project/manage.py
Python
bsd-2-clause
424
""" .. module:: admin :platform: Windows, Linux :synopsis: Class to help managing Tiled Services .. moduleauthor:: Esri """ import json from .._abstract.abstract import BaseAGOLClass, BaseSecurityHandler import urlparse import urllib import os import types from ..security import security from ..common.general...
jgravois/ArcREST
src/arcrest/agol/tiledservice.py
Python
apache-2.0
11,979
import functools import time def clock(func): @functools.wraps(func) def clocked(*args, **kwargs): t0 = time.time() result = func(*args, **kwargs) elapsed = time.time() - t0 name = func.__name__ arg_lst = [] if args: arg_lst.append(', '.join(repr(arg)...
stephenl6705/fluentPy
clockdeco.py
Python
mit
628
# coding: utf-8 from flask_wtf import FlaskForm from wtforms import StringField, BooleanField, PasswordField, SubmitField, SelectField from wtforms.validators import DataRequired, Required, Length, Regexp, EqualTo, IPAddress from wtforms import ValidationError from ..models import User # 简单的Web表单 class NameForm(Flask...
rechie1995/me
python/flask/video-server/app/main/forms.py
Python
gpl-3.0
2,019
#!/usr/bin/env python # -*- coding: utf-8 -*- # # sketchtml documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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 # a...
redapple/sketchtml
docs/conf.py
Python
mit
8,423
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import add_days, cint, cstr, flt, getdate, nowdate, rounded, date_diff, money_in_words from frappe.model.naming import ...
indautgrp/erpnext
erpnext/hr/doctype/salary_slip/salary_slip.py
Python
gpl-3.0
14,797
"""Tests for the flux_led integration.""" from __future__ import annotations import asyncio from contextlib import contextmanager import datetime from typing import Callable from unittest.mock import AsyncMock, MagicMock, patch from flux_led import DeviceType from flux_led.aio import AIOWifiLedBulb from flux_led.cons...
mezz64/home-assistant
tests/components/flux_led/__init__.py
Python
apache-2.0
6,747
# # # Copyright 2007-2014 University Of Southern California # # 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...
pegasus-isi/pegasus-gtfar
pegasus/gtfar/dax/AutoADAG.py
Python
apache-2.0
2,970
########################################################################## # # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # Copyright (c) 2011-2012, John Haddon. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
hradec/gaffer
python/GafferCortexUI/OpDialogue.py
Python
bsd-3-clause
18,403
from operator import itemgetter import xbmcgui import mapper from addon.gmusic_wrapper import GMusic from addon import utils from addon import listing from addon import thumbs from addon import URL MPR = mapper.Mapper.get() GMUSIC = GMusic.get(debug_logging=False) @MPR.s_url('/browse/artist/<artist_id>/') def a...
linuxwhatelse/plugin.audio.linuxwhatelse.gmusic
addon/routes/generic.py
Python
gpl-3.0
3,960