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 -*-
# 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 require... | pongem/python-bot-project | appengine/standard/botapp/chatbots/views.py | Python | apache-2.0 | 2,535 |
# ===============================================================================
# Copyright 2011 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | UManPychron/pychron | pychron/messaging/handlers/messaging_handler.py | Python | apache-2.0 | 3,181 |
from monkey_island.cc.services.config_schema.config_schema_per_attack_technique import (
ConfigSchemaPerAttackTechnique,
)
REVERSE_FAKE_SCHEMA = {
"T0000": {
"Definition Type 1": ["Config Option 1", "Config Option 2"],
"Definition Type 2": ["Config Option 5", "Config Option 6"],
"Proper... | guardicore/monkey | monkey/tests/unit_tests/monkey_island/cc/services/config_schema/test_config_schema_per_attack_technique.py | Python | gpl-3.0 | 1,051 |
# coding=utf-8
import re
import time
import datetime
import requests
import logging
import base64
from urllib import parse
from lib.mp.base import Base
class QuTouTiao(Base):
mp_id = 13
zh_name = '趣头条'
@staticmethod
def login(user, pswd, **kw):
session = requests.session()
resp = ses... | Svolcano/python_exercise | spiders/qutoutiao.py | Python | mit | 6,694 |
import os
import argparse
import datetime
import yaml
import api.src.common.initial_environment_config
from ..models.dense import create_model
from ..data_processing.data_generator import DataGenerator
from ..common.config import TrainingConfig, DataConfig, Config
from ..common.utils import print_info, ensure_dir
from... | kacper1095/asl-translator | api/src/scripts/train_simple_network.py | Python | gpl-3.0 | 3,211 |
"""
cryptography.py
Author: Roger Danilek
Credit: Nils
Assignment:
Write and submit a program that encrypts and decrypts user data.
See the detailed requirements at https://github.com/HHS-IntroProgramming/Cryptography/blob/master/README.md
"""
associations = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234... | RDanilek/Cryptography | cryptography.py | Python | mit | 1,838 |
# -*- 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 model 'UserData'
db.create_table(u'dingos_userdata', (
(u'id', self.gf('django.db.model... | siemens/django-dingos | dingos/migrations/0007_auto__add_userdata__add_unique_userdata_user_data_kind.py | Python | gpl-2.0 | 16,414 |
from PyQt4.QtCore import Qt
from nodebox.graphics.qt import *
from nodebox.graphics import qt
from nodebox.util import _copy_attr, _copy_attrs
__all__ = list(qt.__all__)
__all__.extend(['Context'])
class Context(object):
KEY_UP = Qt.Key_Up
KEY_DOWN = Qt.Key_Down
KEY_LEFT = Qt.Key_Left
KEY_RIGHT ... | gt-ros-pkg/rcommander-core | nodebox_qt/src/nodebox/graphics/__init__.py | Python | bsd-3-clause | 14,849 |
from bs4 import BeautifulSoup
from django.template import Context, Template
from ws.tests import TestCase, factories
class DiscountTagsTest(TestCase):
def test_no_discounts(self):
html_template = Template(
'{% load discount_tags %}{% active_discounts participant%}'
)
context =... | DavidCain/mitoc-trips | ws/tests/templatetags/test_discount_tags.py | Python | gpl-3.0 | 1,775 |
from . import empty
from serializers import groups
import aggregators
def create_recursive():
obj = groups.Group(RecursiveHeader(), RecursiveDescription(), RecursiveData())
return groups.Recursive(obj)
class RecursiveHeader(empty.StageVisitor):
def row_for(self, stage_class):
return stage_class.... | alepulver/my-thesis | results-tables/serializers/stage/time_flow.py | Python | mit | 2,501 |
#!/usr/bin/env python
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | redbo/swift | test/unit/proxy/controllers/test_obj.py | Python | apache-2.0 | 193,924 |
#
# This file is part of m.css.
#
# Copyright © 2017, 2018, 2019, 2020, 2021, 2022
# Vladimír Vondruš <mosra@centrum.cz>
#
# 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 Softwar... | mosra/m.css | documentation/test/__init__.py | Python | mit | 1,229 |
# Copyright (c) 2020 Dell Inc. or its subsidiaries.
# 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
#
# ... | openstack/cinder | cinder/volume/drivers/dell_emc/powermax/provision.py | Python | apache-2.0 | 32,178 |
# Call parse directory
import glob
import os
import subprocess
import time
import shutil
from utils.constants import Constants, PYTHON_CODE_FOLDER
PYTHON_COMMAND = 'python'
BASE_FOLDER = Constants.TOPIC_MODEL_FOLDER + 'base/'
CORPUS_FOLDER = Constants.TOPIC_MODEL_FOLDER + 'corpus/'
# TODO: Consider moving this t... | melqkiades/yelp | source/python/topicmodeling/topic_ensemble_caller.py | Python | lgpl-2.1 | 6,119 |
import argparse
import importlib
import inspect
import os
import sys
import traceback
from bokeh.plotting import output_file, show
from fabulous.color import bold, red
from app import create_app
def error(msg, stacktrace=None):
"""Print an error message and exit.
Params:
-------
msg: str
Er... | saltastro/salt-data-quality-site | test_bokeh_model.py | Python | mit | 2,995 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | didrocks/snapcraft | snapcraft/plugins/python3.py | Python | gpl-3.0 | 6,466 |
#!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['prev... | EvanK/ansible | lib/ansible/modules/cloud/docker/docker_container.py | Python | gpl-3.0 | 120,043 |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | aerwin3/swift | swift/common/wsgi.py | Python | apache-2.0 | 43,149 |
'''file: poly_voronoi.py
module: poly_voronoi
Contains classes for parsing .voronoi.* files into suitable list for
scenario polygon initialization.
'''
import os
import subprocess
try:
from siku import geocoords
from siku import element
from siku import geofiles
from siku import polygon
except ImportE... | Atoku/siku | python/siku/poly_voronoi.py | Python | gpl-2.0 | 10,087 |
#!/usr/bin/env python
#
# Copyright 2011, 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... | asajeffrey/servo | tests/wpt/web-platform-tests/tools/third_party/pywebsocket3/example/echo_client.py | Python | mpl-2.0 | 25,626 |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | Canpio/Paddle | python/paddle/fluid/tests/unittests/test_cumsum_op.py | Python | apache-2.0 | 3,630 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | Petr-Kovalev/nupic-win32 | py/nupic/swarming/HypersearchV2.py | Python | gpl-3.0 | 169,598 |
from fastapi.testclient import TestClient
from docs_src.request_files.tutorial001 import app
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/files/": {
"post": {
"responses": {
... | tiangolo/fastapi | tests/test_tutorial/test_request_files/test_tutorial001.py | Python | mit | 6,215 |
import os
import uuid
import zipfile
def addCFilepath(filename, fType = "HTML"):
actualFile = os.path.basename(filename)
if fType == "HTML":
return "Text/"+str(actualFile)
elif fType == "IMG":
return "Images/"+str(actualFile)
class Chapter:
def __init__(self):
self.id = ''
self.src = ''
self.directory... | flyingjam/epubmaker | epub.py | Python | mit | 6,149 |
from django.conf.urls.defaults import *
from django.conf import settings
from django.views.generic.simple import direct_to_template
from django.contrib import admin
admin.autodiscover()
from account.openid_consumer import PinaxConsumer
from menu.models import Menu_Item
if settings.ACCOUNT_OPEN_SIGNUP:
signup_v... | theju/confista | urls.py | Python | mit | 1,479 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Volume.project'
db.add_column('db_volume', 'project',
... | grnet/synnefo | snf-cyclades-app/synnefo/db/migrations/old/0110_auto__add_field_volume_project.py | Python | gpl-3.0 | 23,262 |
#!/usr/bin/python
# Look in ~/.boto for EC2Connection info (keys, region, etc.)
import boto
from boto import ec2
console = boto.ec2.EC2Connection()
snapshots = console.get_all_snapshots(owner='self')
for snapshot in snapshots:
print snapshot
print 'ID: %s' % snapshot.id # The unique ID of the volume.
p... | managedkaos/aws-scripts | get_snapshot_info.py | Python | mit | 607 |
class Stacker:
'''Allow stacking element creation with "with" statements
eg.
s = Stacker(self.rdoc.body)
with s.stack('div', cls='panel'):
s.stack('div', text='Hello', cls='panel-heading')
with s.stack('div', cls='panel-body'):
s.stack(p="this is text inside body")
... | skariel/webalchemy | webalchemy/Stacker.py | Python | mit | 31,131 |
# -*- coding: utf-8 -*-
#########################################################################
# #
# Copyright (C) 2015 Agile Business Group #
# #
... | Eficent/sale-workflow | sale_order_lot_selection/__openerp__.py | Python | agpl-3.0 | 1,890 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Zuza Software Foundation
#
# This file is part of Pootle.
#
# Pootle 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 Lic... | arky/pootle-dev | pootle/apps/pootle_tagging/views.py | Python | gpl-2.0 | 2,088 |
# Copyright 2007 by Tiago Antao. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""
PopGen: Population Genetics and Genomics library in Python
"""
| Ambuj-UF/ConCat-1.0 | src/Utils/Bio/PopGen/__init__.py | Python | gpl-2.0 | 293 |
import unittest
from TestBase import BaseClass
class Group:
def __init__(self, group_name, group_header, group_footer):
self.group_name = group_name
self.group_header = group_header
self.group_footer = group_footer
class GroupTestBase(BaseClass):
def create_group(self, wd, Group):
... | werbk/task---1.3 | tests_group/group_lib.py | Python | apache-2.0 | 1,510 |
from tornado.escape import url_escape, json_encode
from tornado.web import HTTPError
from moi import r_client
from qiita_pet.handlers.base_handlers import BaseHandler
from qiita_core.qiita_settings import qiita_config
from qiita_core.util import send_email, execute_as_transaction
from qiita_core.exceptions import (In... | squirrelo/qiita | qiita_pet/handlers/auth_handlers.py | Python | bsd-3-clause | 5,962 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import res_company
import res_company_ldap
import res_users
import auth_ldap_config_settings | chienlieu2017/it_management | odoo/addons/auth_ldap/models/__init__.py | Python | gpl-3.0 | 168 |
#!/usr/bin/python
#
# Copyright 2012 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 b... | donspaulding/adspygoogle | examples/adspygoogle/dfp/v201204/custom_field_service/set_line_item_custom_field_value.py | Python | apache-2.0 | 4,733 |
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*-
#
# Copyright (C) 2009 Hardy Beltran Monasterios
#
# 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, or ... | ruud-v-a/rhythmbox | plugins/lyrics/TerraParser.py | Python | gpl-2.0 | 3,488 |
from unimodel.backends.base import SchemaWriter
import copy
import json
from unimodel import types
from unimodel.backends.json.type_data import get_field_name
from unimodel.util import get_backend_type
"""
Useful: http://www.jsonschema.net/
Example: from http://json-schema.org/example2.html
"""
MAP_DEFINITION_TEMPLA... | neumark/unimodel | unimodel/backends/json/schema_writer.py | Python | apache-2.0 | 7,800 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ReadPreferences.mark_auto_read_hide_delay'
db.add_column(... | WillianPaiva/1flow | oneflow/core/migrations/0121_auto__add_field_readpreferences_mark_auto_read_hide_delay.py | Python | agpl-3.0 | 73,381 |
# -*- coding: utf-8 -*-
from scrapy.selector import Selector
import scrapy
from scrapy.contrib.loader import ItemLoader
from fun.items import CoserItem
class CoserSpider(scrapy.Spider):
name = "coser"
allowed_domains = ["bcy.net"]
start_urls = (
'http://bcy.net/cn125101',
'http://bcy.net/c... | lhbpping/climb-picture | fun_crawler/fun/spiders/coser.py | Python | apache-2.0 | 1,280 |
VERSION = "2.0.5"
| akesterson/dpath-python | dpath/version.py | Python | mit | 18 |
"""Identify windows with very high depth for potential filtering.
In non-targeted experiments, high depth regions are often due to collapsed repeats
or other structure which can create long run times and incorrect results in
small and structural variant calling.
"""
import os
import shutil
import subprocess
import sys... | Cyberbio-Lab/bcbio-nextgen | bcbio/bam/highdepth.py | Python | mit | 3,368 |
from bot import data as botData # noqa: F401
from .message import Message
from .permissions import ChatPermissionSet, WhisperPermissionSet
from .. import cache # noqa: F401
from .. import database as databaseM # noqa: F401
from bot.twitchmessage import IrcMessageTagsReadOnly
from datetime import datetime
from typing... | MeGotsThis/BotGotsThis | lib/data/_types.py | Python | gpl-3.0 | 2,364 |
import sys
from qt import *
from kuralib import kuraapp
from kuralib.lng_lex import *
from kuragui.guitabdialog import guiTabDialog
from kuragui.guilistview import guiListView
from kuragui.guidetaillist import guiDetailList
from kuragui.guicombobox import guiComboBox
from kuragui.constants import *
from k... | boudewijnrempt/kura | kuraclient/dlgelement.py | Python | bsd-2-clause | 10,478 |
# Copyright 2013 OpenStack Foundation
# Copyright 2013 Rackspace Hosting
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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 co... | changsimon/trove | trove/guestagent/datastore/mysql/manager.py | Python | apache-2.0 | 11,645 |
from time import sleep
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa
from copy import deepcopy
import requests
import traceback
from typing import Dict, Tuple
from datetime import timezone
# Disable insecure warnings
requests.packages.u... | demisto/content | Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline.py | Python | mit | 33,338 |
import tensorflow as tf
import tensorflow.contrib as tc
import numpy as np
import time
import os
from model import Generator, Discriminator
import progressbar as pb
import data_utils
class Improved_WGAN(object):
def __init__(self, data, vocab_processor, FLAGS):
config = tf.ConfigProto(allow_soft_placement = True)
... | m516825/Conditional-GAN | improved_WGAN.py | Python | mit | 6,459 |
import os
TREEHERDER_CONFIG = os.environ.get('TREEHERDER_CONFIG') or 'credentials.ignore'
config = {
"find_links": [
"http://pypi.pub.build.mozilla.org/pub",
],
"pip_index": False,
"treeherder_url": "https://treeherder.allizom.org",
# Paths are relative to 'base_work_dir'
"treeherde... | sydvicious/mozplatformqa-jenkins | external-media-tests/config/treeherder_submission.py | Python | mpl-2.0 | 926 |
#!/usr/bin/env python
import gzip
import os
import os.path
def main():
apt_log_path = '/var/log/apt'
dirlist = os.listdir(apt_log_path)
# somehow this dict will magically order all the numerical keys
history_files = {}
for filename in dirlist:
if filename.startswith('history.log'):
if filename[len('histor... | bmaupin/junkpile | python/graveyard/misc/get-apt-history.py | Python | mit | 2,627 |
#! /usr/bin/env python
from __future__ import print_function
from openturns import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
distribution = Geometric(0.7)
size = 10000
sample = distribution.getSample(size)
factory = GeometricFactory()
estimatedDistribution = factory.build(sample)
print... | aurelieladier/openturns | python/test/t_GeometricFactory_std.py | Python | lgpl-3.0 | 1,185 |
# encoding: utf-8
"""
Ow.ly url shortner api implementation
Located at: http://ow.ly/api-docs
Doesnt' need anything from the app
"""
from .base import BaseShortener
from ..exceptions import ShorteningErrorException, ExpandingErrorException
class OwlyShortener(BaseShortener):
api_url = 'http://ow.ly/api/1.1/url/'
... | YarnSeemannsgarn/pyshorteners | pyshorteners/shorteners/owly.py | Python | mit | 1,859 |
from twisted.internet.protocol import ClientFactory
from twisted.internet import reactor
from twisted.protocols.basic import LineReceiver
from twisted.conch.telnet import TelnetProtocol
from twisted.internet import stdio
class StdinProtocol(LineReceiver):
from os import linesep as delimiter
def __init__(self, net... | happz/viki | client.py | Python | mit | 1,171 |
# -*- coding: utf-8 -*-
"""scheduler for regular tasks"""
import atexit
import collections
import contextlib
import datetime
import functools
import hashlib
import logging
import os
import time
import threading
import psutil
import callable_ref
LOG = logging.getLogger(__name__)
Env = collections.namedtuple('Env',... | n8v-guy/slag | scheduler.py | Python | mit | 12,215 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
** (fr) **
Ce bot extrait l'infobox d'un article et effectue certaines modifications
dessus.
Support des modifications mineures et majeures (la page ne sera mise à jour
uniquement lorsqu'au moins une modification majeure aura été effectuée,
et, dans ce cas seulement, les ... | Toto-Azero/Wikipedia | pywikibot/basic4_refonte.py | Python | gpl-3.0 | 31,480 |
import win32com.client
import time
class jdi_win32:
@staticmethod
def paste_text(text):
shell = win32com.client.Dispatch("WScript.Shell")
time.sleep(3)
shell.Sendkeys(text)
shell.Sendkeys("~") | FunCat/JDI | Python/JDI/web/os_action/jdi_win32.py | Python | gpl-3.0 | 236 |
from . import actuate
import logging
if __name__ == '__main__':
d_a = 0.0
d_e = 0.0
d_r = 0.0
motor = 0.0
client = actuate.Client(logging)
while True:
line = input('> ').split()
cmd = line[0]
if cmd == 'exit':
break
if cmd == 'get':
pkt = ... | rbmj/pyflightcontrol | pyflightcontrol/aircraft/actuate_test.py | Python | apache-2.0 | 791 |
# -*- 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):
# Changing field 'UserPageView.url'
db.alter_column('website_userpageview', 'url', self.gf('django.db.model... | solarpermit/solarpermit | website/migrations/0096_auto__chg_field_userpageview_url.py | Python | bsd-3-clause | 53,218 |
# Copyright 2012-2015 Spotify AB
#
# 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, ... | mfcabrera/luigi | test/contrib/redshift_test.py | Python | apache-2.0 | 9,072 |
from django.apps import AppConfig
class SharedConfig(AppConfig):
name = 'shared'
| noahbkim/finances | shared/apps.py | Python | bsd-3-clause | 87 |
from django.db import models
class Host(models.Model):
ip = models.GenericIPAddressField(unpack_ipv4=True, primary_key=True)
name = models.CharField(max_length=30, editable=False, null=True)
last_up = models.DateTimeField(null=True, editable=False)
up_since = models.DateTimeField(null=True, editable=Fa... | kapsiry/vahti | hostmonitor/models.py | Python | mit | 1,411 |
#
# 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... | mxm/incubator-beam | sdks/python/apache_beam/testing/load_tests/co_group_by_key_test.py | Python | apache-2.0 | 7,004 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
import dhtmlparser
from harvester.autoparser import path_patterns
# Functions & objects =========================================================
def te... | edeposit/edeposit.amqp.harvester | src/edeposit/amqp/harvester/tests/unittests/autoparser/test_path_patterns.py | Python | mit | 5,559 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 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) a... | egabancho/invenio | invenio/modules/authors/__init__.py | Python | gpl-2.0 | 1,086 |
from django import forms
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.forms.utils import flatatt
from taggit.utils import edit_string_for_tags
from django.utils import six
class TagsInput(forms.TextInput):
class Med... | mi6gan/django-taggit-bootstrap | taggit_bootstrap/widgets.py | Python | mit | 993 |
from flask import Flask, redirect, url_for, render_template
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager, UserMixin, login_user, logout_user,\
current_user
from oauth import OAuthSignIn
app = Flask(__name__)
app.config['SECRET_KEY'] = 'top secret!'
app.config['SQLALCHEMY_DA... | zurez/reviews | app.py | Python | mit | 2,218 |
# #!/usr/bin/python
# If you use the Apple-built Python (/usr/bin/python), then it should
# automatically find PyObjC and related Python modules in its path.
# The PyObjC module isn't automatically found in the PYTHONPATH for my Python
# installation from Python.Org, so I will explicity add it to the python path:
i... | monash-merc/mytardis-desktop-sync-macosx | desktopSync.py | Python | gpl-3.0 | 36,559 |
'''Contains the Core classes of the PEATSA command line tool'''
import ProteinDesignTool, Data, Exceptions, PEATSAParallel
| dmnfarrell/peat | PEATSA/Core/__init__.py | Python | mit | 123 |
"""
:copyright: Copyright (C) 2013-2017 Gianluca Costa.
:license: LGPLv3, see LICENSE for details.
""" | giancosta86/Iris | info/gianlucacosta/iris/io/__init__.py | Python | lgpl-3.0 | 102 |
#!/usr/bin/python
import sys
import string
def howto_install_setuptools():
print """Error: You need setuptools Python package!"""
try:
from setuptools import setup
params = {
'zip_safe': True
}
except ImportError:
for arg in sys.argv:
if string.find(arg, 'egg') != -1:
howto_install_setuptools()
sys.e... | redcurrant/redcurrant | crawler/listener/setup.py | Python | lgpl-3.0 | 632 |
"""engine.SCons.Platform.darwin
Platform-specific initialization for Mac OS X systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008... | faarwa/EngSocP5 | zxing/cpp/scons/scons-local-2.0.0.final.0/SCons/Platform/darwin.py | Python | gpl-3.0 | 1,758 |
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields
class ResCountry(models.Model):
_inherit = 'res.country'
bc_code = fields.Char('Codigo BC', size=5)
ibge_code = fields.Char('Codigo IBG... | rvalyi/l10n-brazil | l10n_br_base/models/res_country.py | Python | agpl-3.0 | 517 |
# -*- coding: utf-8 -*-
import pytest
from enma.extensions import mail
@pytest.mark.skipif('False', reason='requires a working email configuration')
def test_reset_passwd_email_sent(user, testapp):
"""
Test if a send password email is to be send
"""
with mail.record_messages() as outbox:
from... | pixmeter/enma | tests/test_enma/user/test_mail.py | Python | bsd-3-clause | 473 |
# stdlib imports
import urllib
import urlparse
def replace_query_param(url, key, val):
"""
Given a URL and a key/val pair, set or replace an item in the query
parameters of the URL, and return the new URL.
"""
(scheme, netloc, path, query, fragment) = urlparse.urlsplit(url)
query_dict = dict(u... | paddycarey/beardo-control | app/app/utils/misc.py | Python | mit | 714 |
#!/usr/bin/env python
from distutils.core import setup
execfile('bittle/version.py')
kwargs = {
"name": "bittle",
"version": str(__version__),
"packages": ["bittle", "bittle.tests"],
"description": "Simple library to help with bit manipulations.",
# PyPi, despite not parsing markdown, will prefer... | gmjosack/bittle | setup.py | Python | mit | 995 |
# -*- coding: utf-8 -*-
from client import Client
from exc import RajaOngkirExc
| kalarau/rajaongkir-python | RajaOngkir/__init__.py | Python | bsd-2-clause | 80 |
from copy import copy
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.db.models import CharField, FloatField, IntegerField
from django.db.models.signals import post_delete, post_save
from mezzanine.utils.deprecatio... | stephenmcd/mezzanine | mezzanine/generic/fields.py | Python | bsd-2-clause | 10,992 |
"""
Copyright (C) 2014, 申瑞珉 (Ruimin Shen)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed i... | O-T-L/PyOptimization | importer.py | Python | lgpl-3.0 | 4,181 |
# Create a variable named db that is an SqliteDatabase with a filename of challenges.db.
from peewee import *
db = SqliteDatabase('challenges.db')
class Challenge(Model):
name = CharField(max_length=100)
language = CharField(max_length=100)
steps = IntegerField(default=1)
# Now add db as ... | CaseyNord/Treehouse | Using Databases in Python/initialize.py | Python | mit | 689 |
#Author Emily Keiser
def addition(x,y):
return int(x)+int(y)
def subtraction (x,y) :
return int(x) -int(y)
def multiplication (x,y) :
return int(x) *int(y)
def module (x,y) :
return int(x) %int(y)
a=raw_input("Enter variable a: ")
b=raw_input("Enter variable b: ")
print addition (a,b)
print subtrac... | davidvillaciscalderon/PythonLab | Session 3/basic_operations_with_function.py | Python | mit | 537 |
from bulbs.model import Node, Relationship
from bulbs.property import String, Integer, DateTime, Bool, Float, Null
from bulbs.utils import current_datetime
def uuidify():
from uuid import uuid4
return str(uuid4())
class NetworkDeviceType(Node):
element_type = "NetworkDeviceType"
uuid = String(default=uuidify)
... | sirmmo/mmonet | mmonet/inventory/models.py | Python | mit | 1,958 |
from __future__ import absolute_import
import os
import ast
import logging
import json
import requests
import base64
import pytz
from datetime import datetime, timedelta
from urlparse import urlparse
from OpenSSL import crypto
from .exceptions import InternalError
log = logging.getLogger(__name__)
ALEXA_APP_IDS = di... | rishikapadia/echoyumi | django_alexa/internal/validation.py | Python | gpl-3.0 | 3,833 |
def prepare_test_post_data(test, resource):
post_data = resource.get_test_post_data()
try:
post_data = resource._meta.testdata.setup_post(test, post_data) or post_data
except:
pass
return post_data
| mozilla/inventory | vendor-local/src/django-tastytools/tastytools/test/definitions/helpers.py | Python | bsd-3-clause | 232 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | rcbops/horizon-buildpackage | horizon/views/auth.py | Python | apache-2.0 | 3,134 |
from .base import Browser, ExecutorBrowser, require_arg
from .base import get_timeout_multiplier # noqa: F401
from ..webdriver_server import ChromeDriverServer
from ..executors import executor_kwargs as base_executor_kwargs
from ..executors.executorwebdriver import (WebDriverTestharnessExecutor, # noqa: F401
... | DominoTree/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/chrome.py | Python | mpl-2.0 | 5,222 |
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', TemplateView.as_view(template_name='base.html')),
# Examples:
#... | archen/django-project | project_name/project_name/urls.py | Python | mit | 698 |
'''
file clean_dvi.py
This file is part of LyX, the document processor.
Licence details can be found in the file COPYING
or at http://www.lyx.org/about/licence.php
author Angus Leeming
Full author contact details are available in the file CREDITS
or at http://www.lyx.org/about/credits.php
Usage:
python clean_dvi.... | bpiwowar/lyx | lib/scripts/clean_dvi.py | Python | gpl-2.0 | 3,211 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into individual test cases via subprocess. It will
f... | dashpay/dash | test/functional/test_runner.py | Python | mit | 26,250 |
# Copyright 2008 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | SebastianMerz/calalert | Server/venv/lib/python2.7/site-packages/whoosh/__init__.py | Python | gpl-2.0 | 2,059 |
# Copyright 2016-2017 Capital One Services, 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 ... | VeritasOS/cloud-custodian | tests/test_lambda.py | Python | apache-2.0 | 5,594 |
"""
Copyright (C) 2013 Matthew Woodruff
This script is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This script is distributed in th... | matthewjwoodruff/moeasensitivity | statistics/statistics.py | Python | lgpl-3.0 | 6,225 |
#
#
import sys, os
from pymongo import Connection
## -----------------------------
## FUNCTIONS -------------------
## -----------------------------
# Convert unicode2utf8 dicts
def convertUnicode2Utf8Dict(data):
import collections
if isinstance(data, basestring):
return str(data)
elif isinstance(data, collectio... | iblstudios/OpenBadgesXBlock-v1 | badges/edxappCourseData.py | Python | gpl-3.0 | 8,119 |
"""Support for MQTT message handling."""
from __future__ import annotations
from ast import literal_eval
import asyncio
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
import datetime as dt
from functools import lru_cache, partial, wraps
import inspect
from itertools import groupby
im... | rohitranjan1991/home-assistant | homeassistant/components/mqtt/__init__.py | Python | mit | 42,892 |
"""The harness interface
The interface between the client and the server when hosted.
"""
__author__ = """Copyright Andy Whitcroft 2006"""
import os, sys, logging
import common
class harness(object):
"""The NULL server harness
Properties:
job
The job object for this job
... | clebergnu/autotest | client/bin/harness.py | Python | gpl-2.0 | 2,418 |
#!/usr/bin/env python
import fnmatch
import os
import sys
import re
import math
import platform
import xml.etree.ElementTree as ET
################################################################################
# Config #
#########################... | FateAce/godot | doc/tools/doc_status.py | Python | mit | 16,238 |
from setuptools import setup
setup(
name='popo_attribute_tracker',
version='0.1',
description='Simple Attribute Tracker for POPOs',
url='https://github.com/farfanoide/popo_attribute_tracker',
author='Ivan Karl',
author_email='ivan6258@gmail.com',
license='MIT',
packages=['popo_attribute... | farfanoide/popo_attribute_tracker | setup.py | Python | mit | 353 |
import unittest
class TestLDAPSyncrepl(unittest.TestCase):
def test_001_import_syncrepl(self):
from ldap import syncrepl
| tpokorra/pykolab | tests/unit/test-007-ldap_syncrepl.py | Python | gpl-3.0 | 136 |
# coding=UTF-8
# Copyright (C) 2002-2006 Stephen Kennedy <stevek@gnome.org>
# Copyright (C) 2009-2013 Kai Willadsen <kai.willadsen@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, e... | albfan/PatienceMeld | meld/filediff.py | Python | gpl-2.0 | 90,854 |
r"""
Packaging setup file for Pypi and installation via pip.
Notes
-----
#. Written by David C. Stauffer in January 2019.
"""
#%% Import
import os
from setuptools import setup
#%% Support functions - readme
def readme():
r"""Opens the README.rst file for additional descriptions."""
filename = os.path.join(... | DStauffman/dstauffman2 | setup.py | Python | lgpl-3.0 | 1,638 |
# coding: utf-8
from __future__ import unicode_literals, absolute_import
from datetime import timedelta
from django.test import TestCase
from django.test.client import RequestFactory
from django.contrib.auth import get_user_model
from django.utils import timezone
from httmock import urlmatch, response, HTTMock
from co... | polyrabbit/WeCron | WeCron/remind/tests/test_serializers.py | Python | gpl-3.0 | 3,317 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2016 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 later... | nikpap/inspire-next | tests/unit/search/test_search_query.py | Python | gpl-2.0 | 25,098 |
from selenium import webdriver
from Tkinter import *
from PIL import Image
driver = webdriver.Chrome()
driver.set_window_size(500, 500)
driver.get('https://www.google.com')
while(1):
pass
driver.save_screenshot('temp.png')
driver.quit()
img = Image.open('temp.png')
img_tk = ImageTk.PhotoImage(Image.ope... | jbzdarkid/Random | webbrower.py | Python | apache-2.0 | 529 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.