code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
from Spiders import BaseSpider
class FlRu(BaseSpider):
#start_urls = 'https://www.fl.ru/users/i3qqq' #'https://www.fl.ru/freelancers/#34234'
start_urls = 'https://www.fl.ru/users/i3qqq/'
routes = [
{
'name': 'project',
're': '[^f]*?fl.ru/users/[^/]*/viewproj.php\?prjid\=.... | SaltusVita/ReoGrab | fl.ru.py | Python | bsd-3-clause | 1,192 |
# -----------------------------------------------------------
# compares the creation of sorted lists using the python
# bisect module, and the "usual" way
#o
# (C) 2015 Frank Hofmann, Berlin, Germany
# Released under GNU Public License (GPL)
# email [email protected]
# --------------------------------------------... | plasmashadow/training-python | time/sorted-list.py | Python | gpl-2.0 | 1,566 |
#! /usr/bin/env python
#
# Check the option usage.
# Make sure the union member matches the option type.
#
from os.path import dirname, join, abspath
from os import listdir, EX_OK, EX_DATAERR
from fnmatch import filter
# just use the first letter of the member name - should be unique
map_access_type = {
'b': 'AT_B... | nivekkagicom/uncrustify | scripts/check_options.py | Python | gpl-2.0 | 2,333 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... | skuda/client-python | kubernetes/test/test_v1beta1_network_policy_ingress_rule.py | Python | apache-2.0 | 991 |
##
# Copyright (c) 2012-2017 Apple 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 l... | macosforge/ccs-calendarserver | contrib/performance/loadtest/__init__.py | Python | apache-2.0 | 634 |
# -*- coding: utf-8 -*-
from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.HelpMenu import HelpableScreen
from Screens.TaskView import JobView
from Components.About import about... | digidudeofdw/enigma2 | lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py | Python | gpl-2.0 | 30,759 |
from artemis.Netarea import MAX
import time
import artemis.Utility as utility
#for human, https://stackoverflow.com/questions/1094841/reusable-library-to-get-human-readable-version-of-file-size
def sizeof_fmt(num, suffix='B'):
for unit in ['','Ki','Mi','Gi','Ti','Pi','Ei','Zi']:
if abs(num) < 1024.0:
... | athena-project/Artemis | src/network/Reports.py | Python | gpl-2.0 | 4,180 |
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'conf.settings.base')
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that th... | rafasis1986/deaths-dancing | endpoint/manage.py | Python | gpl-3.0 | 802 |
class AbstractComponent:
def get_regularization_term(self):
return 0
def prepare_tensorflow_variables(self, mode="train"):
pass
def handle_variable_assignment(self, batch, mode):
pass | MichSchli/QuestionAnsweringGCN | old_version/candidate_selection/tensorflow_models/components/abstract_component.py | Python | mit | 222 |
from .client_wrapper import CloudShellClient, create_cloudshell_client # noqa: F401
| QualiSystems/shellfoundry | shellfoundry/utilities/cloudshell_api/__init__.py | Python | apache-2.0 | 85 |
# 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 required by applicable law ... | google/checkers_classic | python/context.py | Python | apache-2.0 | 1,540 |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utilies and constants specific to Chromium C++ code.
"""
from code import Code
from datetime import datetime
from model import PropertyType
import os... | TeamEOS/external_chromium_org | tools/json_schema_compiler/cpp_util.py | Python | bsd-3-clause | 4,388 |
import os
import os.path
import osiris
class Page(osiris.IMainPage):
def __init__(self, session):
osiris.IMainPage.__init__(self, session)
def getPageName(self):
return "extensions.4A7F130B4A5C42CC5D928D157641596A89543C65.testsuite"
def onInit(self):
osiris.IMainPage.onInit(self)
self.pathway.add... | OsirisSPS/osiris-sps | client/data/extensions/4A7F130B4A5C42CC5D928D157641596A89543C65/scripts/testsuite.py | Python | gpl-3.0 | 798 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | cdrooom/odoo | addons/mail/mail_mail.py | Python | agpl-3.0 | 18,908 |
# Copyright (C) 2010-2015 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
"""Database migration from Cuckoo 0.6 to Cuckoo 1.1.
Revision ID: 263a45963c72
Revises: None
Create Date: 2014-03-23 23:30:36.756792
"""
# Revision ... | davidoren/CuckooSploit | utils/db_migration/versions/from_0_6_to_1_1.py | Python | gpl-3.0 | 14,422 |
from __future__ import unicode_literals
import errno
import os
import re
import socket
import sys
from datetime import datetime
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import get_internal_wsgi_applicati... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py | Python | agpl-3.0 | 7,307 |
# Definition for binary tree with next pointer.
# class TreeLinkNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# self.next = None
class Solution:
# @param root, a tree link node
# @return nothing
def connect(self, root):
def ... | YiqunPeng/Leetcode-pyq | solutions/117PopulatingNextRightPointersInEachNodeII.py | Python | gpl-3.0 | 1,205 |
from setuptools import setup
setup(
name='wjordpress',
# when bumping versions, also update __init__, sphinx config, and changelog
version='0.2.2',
author='Chris Chang',
author_email='[email protected]',
url='https://github.com/texastribune/wjordpress',
packages=['wjordpress'],
in... | texastribune/wjordpress | setup.py | Python | apache-2.0 | 1,086 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of IVRE.
# Copyright 2011 - 2022 Pierre LALET <[email protected]>
#
# IVRE 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 versio... | p-l-/ivre | ivre/db/sql/__init__.py | Python | gpl-3.0 | 124,119 |
# Copyright 2004-2011 Pexego Sistemas Informáticos. (http://pexego.es)
# Copyright 2012 NaN·Tic (http://www.nan-tic.com)
# Copyright 2013 Acysos (http://www.acysos.com)
# Copyright 2013 Joaquín Pedrosa Gutierrez (http://gutierrezweb.es)
# Copyright 2016 Tecnativa - Antonio Espinosa
# Copyright 2016 Tecnativa - Angel M... | factorlibre/l10n-spain | l10n_es_aeat_mod347/models/mod347.py | Python | agpl-3.0 | 29,423 |
# 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"); y... | lukecwik/incubator-beam | learning/katas/python/Common Transforms/Aggregation/Count/task.py | Python | apache-2.0 | 1,000 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Automatic provisioning of AWS KMS.
import boto
from boto import kms
import nixops.util
import nixops.resources
from nixops import kms_utils
class KmsKeyDefinition(nixops.resources.ResourceDefinition):
"""Definition of an AWS KMS encryption key."""
@classmet... | Bsami/nixops | nixops/resources/kms_keys.py | Python | lgpl-3.0 | 8,104 |
# -*- coding: utf-8 -*-
# Copyright 2018 Joan Marín <Github@JoanMarin>
# Copyright 2018 Guillermo Montoya <Github@guillermm>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Partner VAT Colombia",
"summary": "Module for Type of Identification Document and Colombian NIT Checking.",
... | odoo-colombia/l10n-colombia | l10n_co_partner_vat/__manifest__.py | Python | agpl-3.0 | 829 |
from __future__ import absolute_import, print_function, division
import urwid
from mitmproxy.console import common, searchable
from netlib import human
def maybe_timestamp(base, attr):
if base is not None and getattr(base, attr):
return human.format_timestamp_with_milli(getattr(base, attr))
... | x2Ident/x2Ident_test | mitmproxy/mitmproxy/console/flowdetailview.py | Python | gpl-3.0 | 4,821 |
# -*- 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 'StandSession.message_slug'
db.add_column(u'standbase_stan... | whatsthehubbub/stand-django | standbase/migrations/0005_auto__add_field_standsession_message_slug.py | Python | mit | 2,249 |
"""
Description:
Task:
This kata requires you to write an object that receives a file path and does operations on it. NOTE FOR PYTHON USERS: You cannot use modules os.path, glob, and re
The purpose of this kata is to use string parsing, so you're not supposed to import external libraries. I could only enforce this in... | bgarnaat/codewars_katas | src/python/6kyu/file_path_operations/file_path_ops.py | Python | mit | 951 |
from __future__ import print_function, division
from sympy.core.containers import Tuple
from sympy.core.core import C
from sympy.core.expr import Expr
from sympy.core.mul import Mul
from sympy.core.singleton import S
from sympy.core.sympify import sympify
from sympy.concrete.expr_with_intlimits import ExprWithIntLimit... | beni55/sympy | sympy/concrete/products.py | Python | bsd-3-clause | 13,558 |
# -*- coding: utf-8 -*-
"""
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Copyright (C) 2016 Alejandro F. Carrera <[email protected]>
This file is part of Librairy. <https://github.com/librairy>
Licensed under Apache License. See LICENSE for more info.
#-=-=-=-=-=-=-=-=-=-=-... | librairy/web | librairy_src/__init__.py | Python | apache-2.0 | 379 |
#!/usr/bin/env python3
"""Maximum values sampled from various controllers.
--Jacques Gagnon <[email protected]>
"""
from collections import namedtuple
Point = namedtuple('Point', 'x y')
Origin = namedtuple('Origin', 'up right down left')
Diagonal = namedtuple('Diagonal', 'up_right down_right down_left up_left')
... | darthcloud/cube64-dx | notes/controller_data.py | Python | gpl-2.0 | 7,661 |
"""add biobank version
Revision ID: e44e303ae759
Revises: 0e92151ebd4a
Create Date: 2018-08-20 10:08:20.904521
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "e44e303ae759"
down_revision = "0e92151ebd4a"
branch_labels = None
depends_on = None
def upgrade(engi... | all-of-us/raw-data-repository | rdr_service/alembic/versions/e44e303ae759_add_biobank_version.py | Python | bsd-3-clause | 1,102 |
import mock
from unittest2 import TestCase
from marimo.middleware import MarimoEventContainer, Marimo, context_processor
class TestMiddleware(TestCase):
def setUp(self):
self.middleware = Marimo()
def tearDown(self):
del self.middleware
def test_process_request_marimo_widgets_added(sel... | brandonivey/django-marimo | marimo/tests/test_middleware.py | Python | mit | 2,252 |
"""Base class for Acmeda Roller Blinds."""
import aiopulse
from homeassistant.core import callback
from homeassistant.helpers import entity
from homeassistant.helpers.device_registry import async_get_registry as get_dev_reg
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helper... | tchellomello/home-assistant | homeassistant/components/acmeda/base.py | Python | apache-2.0 | 2,925 |
from ..broker import Broker
class IprgBroker(Broker):
controller = "iprgs"
def show(self, **kwargs):
"""Shows the details for the specified iprg.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ... | infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_8_0/iprg_broker.py | Python | apache-2.0 | 54,667 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from models import User, Blog
from transwarp import db
db.create_engine(user='www-data', password='www-data', database='awesome')
#===============================================================================
# # 创建用户
# user = User(name='Test', email='[email protected]... | rushlee2016/awesome-python-webapp | www/test_db.py | Python | gpl-2.0 | 1,605 |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | queria/my-tempest | tempest/api/compute/floating_ips/test_list_floating_ips_negative.py | Python | apache-2.0 | 1,727 |
from dallinger.nodes import Source
import random
import base64
import os
import json
class DrawingSource(Source):
"""A Source that reads in a random image from a file and transmits it."""
__mapper_args__ = {
"polymorphic_identity": "drawing_source"
}
def _contents(self):
"""Define th... | jcpeterson/Dallinger | demos/dlgr/demos/iterated_drawing/models.py | Python | mit | 826 |
from components.component import Component
from components.messages import QueryType
from managers.echo import EchoService
from stats.enums import StatsEnum
from util.decorators import cached, invalidate_cache
class Equipment(Component):
NAME = "equipment"
"""
This component attaches itself to anything wi... | ChrisLR/Python-Roguelike-Template | components/equipment.py | Python | mit | 5,225 |
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the ... | Micronaet/micronaet-xmlrpc | xmlrpc_operation_invoice/__openerp__.py | Python | agpl-3.0 | 1,553 |
from rest_framework import serializers
from customers import choices as customers_choices
from customers.models import Customer
from readings.models import Reading, Condition
class ReadingListSerializer(serializers.ModelSerializer):
class Meta:
model = Reading
fields = (
'reading',
... | JacobSheehy/pressureNETAnalysis | readings/serializers.py | Python | gpl-3.0 | 1,723 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2012 Fabio Erculiani
Authors:
Fabio Erculiani
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 3.
This program is distributed in... | Enlik/entropy | rigo/rigo_app.py | Python | gpl-2.0 | 38,116 |
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns(
'dnd.mobile.spells.views',
# spells
url(
r'^$',
'spell_index_mobile',
name='spell_index_mobile',
),
# spells > by rulebooks
url(
r'^by-rulebooks/$',
'spell_list_... | FreezyExp/dndtools | dndtools/dnd/mobile/spells/urls.py | Python | mit | 2,243 |
'''
Created on Nov 18, 2013
@author: Scott
Used for resizing images. Simplistic. Only resizes to a constant factor.
'''
import numpy
import utils.Utils as utils
'''
Assumes factor is int
'''
def resize_image(filename, factor):
im_arr = utils.get_array(filename)
resized_arr = numpy.ndarray(shap... | scotchval/ImageTDA | src/utils/Resize.py | Python | mit | 1,042 |
# pylint: disable=missing-docstring
from __future__ import print_function
def func1():
return 1
print('unreachable') # [unreachable]
def func2():
while 1:
break
print('unreachable') # [unreachable]
def func3():
for i in (1, 2, 3):
print(i)
continue
print('unre... | PyCQA/pylint | tests/functional/u/unreachable.py | Python | gpl-2.0 | 693 |
#!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class libmng(test.test):
"""
Autotest module for testing basic functionality
of libmng
@author CSDL
"""
version = 1
nfail = 0
path = ''
def initialize(sel... | PoornimaNayak/autotest-client-tests | linux-tools/libmng/libmng.py | Python | gpl-2.0 | 1,418 |
"""
Benchmark scikit-learn's Ward implement compared to SciPy's
"""
import time
import numpy as np
from scipy.cluster import hierarchy
import pylab as pl
from sklearn.cluster import AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = n... | RPGOne/Skynet | scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/benchmarks/bench_plot_ward.py | Python | bsd-3-clause | 1,260 |
"""
Django settings for library project.
Generated by 'django-admin startproject' using Django 1.11.6.
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/
"""
import os... | escottgoodwin/djangolocallibrary | library/settings.py | Python | mit | 3,536 |
import mock
from mock import patch
import unittest
from cfgm_common.vnc_db import DBBase
from svc_monitor import config_db
from svc_monitor import loadbalancer_agent
from vnc_api.vnc_api import *
import argparse
import ConfigParser
class LoadbalancerAgentTest(unittest.TestCase):
def setUp(self):
self.vnc_l... | sajuptpm/contrail-controller | src/config/svc-monitor/svc_monitor/tests/test_loadbalancer_agent.py | Python | apache-2.0 | 27,474 |
# Copyright (C) 2016 Red Hat, Inc., Pep Turro Mauri <[email protected]>
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU Genera... | TurboTurtle/sos | sos/report/plugins/origin.py | Python | gpl-2.0 | 9,560 |
"""
{{ cookiecutter.project_module_name }}.exceptions
=================================================
Exceptions module used by the ``{{ cookiecutter.project_pkg_name }}`` package.
"""
| YetAnotherIgor/cookiecutter-barebones-py35 | {{ cookiecutter.project_pkg_name }}/{{ cookiecutter.project_module_name }}/exceptions.py | Python | bsd-3-clause | 188 |
# This file is part of Gajim.
#
# Gajim 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 only.
#
# Gajim is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... | gajim/gajim | gajim/common/events.py | Python | gpl-3.0 | 14,596 |
# -*- coding: utf-8 -*-
'''Twisted logging to Python loggin bridge.'''
'''
Kontalk Pyserver
Copyright (C) 2011 Kontalk Devteam <[email protected]>
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 Foundat... | cgvarela/pyserverlib | kontalklib/logging.py | Python | gpl-3.0 | 1,793 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Ver 18 - 15 November 2017 -
import time
import serial
import string
import sys
import mysql.connector
from mysql.connector import errorcode, pooling
from db import *
import datetime
#from threading import Thread
import multiprocessing as mp
from multiprocessing import Queue... | theflorianmaas/dh | Python/dhproc/p_serial.py | Python | mit | 15,394 |
# fmt: off
__all__ = ["ProgressCallback", "PrintCallback", "MonitorCallback", "EarlyStopCallback", "SaveCallback"] # noqa
# fmt: on
import operator
import os
import torch
from tqdm import tqdm
from utils.training.trainer import Callback # isort: skip
class ProgressCallback(Callback):
def __init__(self):
... | chantera/biaffineparser | src/utils/training/callbacks.py | Python | apache-2.0 | 4,715 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | subutai/htmresearch | projects/sequence_prediction/discrete_sequences/tm/suite.py | Python | agpl-3.0 | 12,331 |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import ti... | Azure/azure-sdk-for-python | sdk/servicebus/azure-servicebus/stress/scripts/stress_test_base.py | Python | mit | 20,244 |
def buildConnectionString(params):
"""Build a connection string from a dictionary of parameters.
Returns string."""
return ";".join(["%s=%s" % (k, v) for k, v in params.items()])
if __name__ == "__main__":
myParams = {"server":"mpilgrim",
"database":"master",
"uid":"s... | MassD/python | dive/odbchelper.py | Python | mit | 404 |
#
# This file is part of Checkbox.
#
# Copyright 2008 Canonical Ltd.
#
# Checkbox 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.
#
# C... | Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/checkbox/plugins/remote_suite.py | Python | gpl-3.0 | 1,664 |
import SqlReader
def main():
reader=SqlReader.SqlReader("SELECT p.objid,p.ra,p.dec,p.r,s.z as redshift FROM galaxy as p join specobj as s on s.bestobjid=p.objid WHERE p.ra BETWEEN 194.138787 AND 195.548787 AND p.dec BETWEEN 27.259389 AND 28.709389")
reader.dataCollect()
if __name__ =="__main__":
main() | chshibo/CosData_Tools | test_SqlReader.py | Python | gpl-3.0 | 316 |
#!/usr/bin/python2.4
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://w... | marcellodesales/svnedge-console | ext/windows/pkg-toolkit/pkg/vendor-packages/pkg/client/bootenv.py | Python | agpl-3.0 | 20,740 |
#
# 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... | spektom/incubator-airflow | tests/providers/microsoft/azure/hooks/test_azure_container_instance.py | Python | apache-2.0 | 4,590 |
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from hordak.models import Account
from swiftwind.settings.models import Settings
class Command(BaseCommand):
help = 'Create the initial chart of accounts'
def add_arguments(self, parser):
super(Comman... | adamcharnock/swiftwind | swiftwind/core/management/commands/swiftwind_create_accounts.py | Python | mit | 3,772 |
import ctypes
from .common import *
from . import functions
from .functions import p_cfg, p_db, p_pkg, p_elf
from .utils import *
SONAME = 'libpkgdepdb.so.1'
class LogLevel(object):
Debug = 0
Message = 1
Print = 2
Warn = 3
Error = 4
class PkgEntry(object):
Depends = 0
OptDe... | Blub/pkgdepdb | pypkgdepdb/__init__.py | Python | bsd-3-clause | 29,250 |
#!/usr/bin/env python
from geonode.settings import GEONODE_APPS
import geonode.settings as settings
import traceback
from geonode.layers.models import Layer
from pprint import pprint
from geonode.cephgeo.models import CephDataObject, LidarCoverageBlock
import subprocess
import ogr
import os
import shutil
import time... | PhilLidar-DAD/geonode | scripts/utils/geometadata/rename_laz.py | Python | gpl-3.0 | 4,534 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-12-03 11:12
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('sigad', '0018_auto_20171010_1424'),
]
operations = [... | cmjatai/cmj | cmj/sigad/migrations/0019_auto_20171203_0912.py | Python | gpl-3.0 | 619 |
# coding=utf-8
"""
The SNMPRawCollector is designed for collecting data from SNMP-enables devices,
using a set of specified OIDs
#### Configuration
Below is an example configuration for the SNMPRawCollector. The collector
can collect data any number of devices by adding configuration sections
under the *devices* hea... | disqus/Diamond | src/collectors/snmpraw/snmpraw.py | Python | mit | 6,089 |
##
# Copyright 2020 NVIDIA
#
# This file is triple-licensed under GPLv2 (see below), MIT, and
# BSD three-clause licenses.
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Superc... | boegel/easybuild-easyblocks | easybuild/easyblocks/x/xalt.py | Python | gpl-2.0 | 9,134 |
from six import iteritems
from six.moves import StringIO
from collections import defaultdict
#from itertools import count
import numpy as np
#from numpy import array
from pyNastran.bdf.field_writer_8 import print_card_8
from pyNastran.bdf.field_writer_16 import print_card_16
from pyNastran.bdf.cards.base_card import ... | saullocastro/pyNastran | pyNastran/bdf/dev_vectorized/cards/constraints/spc1.py | Python | lgpl-3.0 | 4,491 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-6 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | kaday/rose | lib/python/rose/gtk/choice.py | Python | gpl-3.0 | 19,160 |
# -*- coding: utf-8 -*-
import re
import urlparse
from pyload.plugin.Crypter import Crypter
class LixIn(Crypter):
__name = "LixIn"
__type = "crypter"
__version = "0.22"
__pattern = r'http://(?:www\.)?lix\.in/(?P<ID>.+)'
__config = [("use_subfolder" , "bool", "Save package to subfolde... | ardi69/pyload-0.4.10 | pyload/plugin/crypter/LixIn.py | Python | gpl-3.0 | 2,102 |
# -*- coding: utf-8 -*-
# This file is part of emesene.
#
# emesene 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.
#
#... | tiancj/emesene | emesene/gui/qt4ui/widgets/StatusButton.py | Python | gpl-3.0 | 2,828 |
from django.shortcuts import render
from django.template import loader
from django.http import HttpResponse, HttpResponseRedirect
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.contrib.auth import authenticate, logout
from django.contrib.auth import logout as auth_logout
from djan... | MDU-PHL/kelpie | website/kelpie/views.py | Python | gpl-3.0 | 3,501 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 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 later... | sourabhlal/cds | cds/modules/deposit/views.py | Python | gpl-2.0 | 1,197 |
"""
Grafana Bricks page abstraction
"""
from usmqe.web.grafana.auxiliary.pages import GenericChart, \
GenericDropDownList
import usmqe.web.grafana.bricks.models as m_bricks
location = ':3000/dashboard/db/tendrl-gluster-bricks'
class ClusterList(GenericDropDownList):
"""
DropDown list of clusters
"""... | fbalak/usmqe-tests | usmqe/web/grafana/bricks/pages.py | Python | gpl-3.0 | 1,485 |
import antlr3
import testbase
import unittest
class t040bug80(testbase.ANTLRTest):
def setUp(self):
self.compileGrammar()
def lexerClass(self, base):
class TLexer(base):
def recover(self, input, re):
# no error recovery yet, just crash!
rai... | ekcs/congress | thirdparty/antlr3-antlr-3.5/runtime/Python3/tests/t040bug80.py | Python | apache-2.0 | 659 |
"""This module provides the top level user-facing class ``Session``."""
import json
import importlib
import sys
from pybbix.api import Request
DEFAULT_USER = 'Admin'
DEFAULT_PASSWORD = 'zabbix'
PENDING = object()
WAITING = object()
class NotLoggedInError(Exception):
"""Raised when the user has not authentic... | modulus-sa/pybbix | pybbix/__init__.py | Python | mit | 2,757 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import json
import base64
import numpy as np
import pytest
from zarr.compat import binary_type, text_type, PY2
from zarr.meta import (decode_array_metadata, encode_dtype, decode_dtype, ZARR_FORMAT,
decode... | alimanfoo/zarr | zarr/tests/test_meta.py | Python | mit | 13,003 |
#!/usr/bin/env python
# encoding: utf-8
"""
crawler.py
~~~~~~~~~~~~~
主要模块,爬虫的具体实现。
"""
import re
import time
import logging
import threading
import traceback
from hashlib import md5
from bs4 import BeautifulSoup
from datetime import datetime
from collections import deque
from locale import getdefaultlocale
from urlpar... | zhkzyth/a-super-fast-crawler | crawler.py | Python | mit | 9,133 |
import logging
import mailchimp
from django.conf import settings
mailchimp_default_list_id = settings.MAILCHIMP_LIST_ID
def add_user(user, mailing_list_id=None):
try:
mailchimp_api = mailchimp.Mailchimp(apikey=settings.MAILCHIMP_API_KEY)
except mailchimp.Error:
logging.error("Missing or inva... | math-foo/cloudpebble | ide/utils/mailinglist.py | Python | mit | 1,306 |
# This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import numpy as np
from mathutil... | DolphinDream/sverchok | utils/field/rbf.py | Python | gpl-3.0 | 3,912 |
import datetime
import os
import re
import tempfile
from collections import OrderedDict, defaultdict, namedtuple
from itertools import chain
from django.utils.functional import cached_property
import polib
from memoized import memoized
from corehq.apps.app_manager.dbaccessors import (
get_current_app,
get_ve... | dimagi/commcare-hq | corehq/apps/translations/generators.py | Python | bsd-3-clause | 18,165 |
# coding: utf-8
#
# Copyright 2021 The Oppia 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 requi... | brianrodri/oppia | core/platform/bulk_email/dev_mode_bulk_email_services.py | Python | apache-2.0 | 1,785 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# athena.portfolio.risk_manager.py
'''
@since: 2014-11-20
@author: Javier Garcia
@contact: [email protected]
@summary: Handles the risk exposures for the portfolio, according
to a predefined criteria. i.e. VaR, Kelly Criterion, etc.
'''
# TODO: a... | JavierGarciaD/athena | athena/portfolio/risk_manager.py | Python | gpl-3.0 | 332 |
from __future__ import print_function, absolute_import, division
import re
from collections import defaultdict, deque
from numba.config import MACHINE_BITS
from numba import cgutils
from llvmlite import ir, binding as llvm
_word_type = ir.IntType(MACHINE_BITS)
_pointer_type = ir.PointerType(ir.IntType(8))
_meminfo... | ssarangi/numba | numba/runtime/atomicops.py | Python | bsd-2-clause | 8,104 |
import os
class SSHKey(object):
pvkey = None
pubkey = None
pubkey_path = None
pvkey_path = None
default_path = {
'pvkey': "~/.ssh/id_rsa",
'pubkey': "~/.ssh/id_rsa.pub"
}
def __init__(self, path=None):
self.set_pubkey(path)
def set_pubkey(se... | lee212/simpleazure | simpleazure/sshkey.py | Python | gpl-3.0 | 703 |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Test cmdline.py for coverage.py."""
import pprint
import re
import shlex
import sys
import textwrap
import mock
import coverage
import coverage.cmdline
from c... | 7WebPages/coveragepy | tests/test_cmdline.py | Python | apache-2.0 | 23,343 |
# -*- coding: utf-8 -*-
##########################################################################
# #
# Eddy: a graphical editor for the specification of Graphol ontologies #
# Copyright (C) 2015 Daniele Pantaleone <[email protected]> ... | danielepantaleone/eddy | eddy/core/diagram.py | Python | gpl-3.0 | 32,354 |
import logging
import ssl
import sys
import threading
from typing import List
import websocket
from homematicip.base.enums import *
from homematicip.base.helpers import bytes2str
from homematicip.class_maps import *
from homematicip.connection import Connection
from homematicip.device import *
from homem... | marcsowen/homematicip-rest-api | homematicip/home.py | Python | gpl-3.0 | 33,437 |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
import os
try:
import koji as koji
except ImportError:
import inspect
import sys
#... | maxamillion/atomic-reactor | tests/plugins/test_bump_release.py | Python | bsd-3-clause | 8,255 |
#!/usr/bin/env python
#ffmpeg -i vtest.avi -c:a aac -b:a 128k -c:v libx264 -crf 23 output.mp4
import numpy as np
import cv2
cap = cv2.VideoCapture('vtest.mp4')
# cap = cv2.VideoCapture(0)
def MOG(cap):
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(3,3))
print('kernel', kernel)
# fgbg = cv2.crea... | MarsUniversity/ece387 | website/block_3_vision/lsn21/bg.py | Python | mit | 1,894 |
#!/usr/bin/env python
# ESP32 efuse get/set utility
# https://github.com/themadinventor/esptool
#
# Copyright (C) 2016 Espressif Systems (Shanghai) PTE LTD
#
# 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
# ... | themadinventor/esptool | espefuse.py | Python | gpl-2.0 | 42,922 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.utils.requests import RequestException
from flexget.... | LynxyssCZ/Flexget | flexget/plugins/sites/limetorrents.py | Python | mit | 4,028 |
import py, pytest
def setup_module(mod):
mod.nose = py.test.importorskip("nose")
def test_nose_setup(testdir):
p = testdir.makepyfile("""
l = []
from nose.tools import with_setup
@with_setup(lambda: l.append(1), lambda: l.append(2))
def test_hello():
assert l == [1... | geraldoandradee/pytest | testing/test_nose.py | Python | mit | 8,735 |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... | kdart/pycopia | core/pycopia/guid.py | Python | apache-2.0 | 3,500 |
"""Show apps report."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import click
from treadmill import cli
from treadmill.cli.scheduler import fetch_report, print_report
from treadmill import restclient
def in... | Morgan-Stanley/treadmill | lib/python/treadmill/cli/scheduler/allocs.py | Python | apache-2.0 | 905 |
from __future__ import print_function
import os
import sys
import appdirs
import pkg_resources
import yaml
# The config is lazy-loaded
config = None
def load(key, required=True):
"""Return the value associated with the key"""
config_dir = appdirs.user_config_dir('jiradoc')
config_file = os.path.join(co... | lucianovdveekens/jiradoc | jiradoc/config.py | Python | mit | 1,356 |
import unittest
import os
import json
from processes.insert_movies2companies import Main
from processes.postgres import Postgres
try:
DB_SERVER = os.environ['DB_SERVER']
DB_PORT = os.environ['DB_PORT']
DB_DATABASE = os.environ['DB_DATABASE']
DB_USER = os.environ['DB_USER']
DB_PASSWORD = os.environ... | kinoreel/kino-gather | processes/tests/test_insert_movies2companies.py | Python | mit | 2,844 |
# -*- coding: utf-8 -*-
###############################################################################
#
# SetPhotoLocation
# Sets the geo data (including latitude and longitude) for a specified photo.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0... | jordanemedlock/psychtruths | temboo/core/Library/Flickr/Geo/SetPhotoLocation.py | Python | apache-2.0 | 5,835 |
"""
Django settings for angulardjango project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, .... | johnofkorea/tweeter | angulardjango/settings.py | Python | mit | 2,248 |
# -*- 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):
# Deleting field 'Invoice.invoice_ttitle'
db.delete_column(u'django_fastb... | phelmig/django-fastbill | django_fastbill/migrations/0002_auto__del_field_invoice_invoice_ttitle__add_field_invoice_invoice_titl.py | Python | mit | 12,299 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-11-28 08:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("users", "0005_personalnote_rework")]
operations = [
migrations.AddField(
mod... | CatoTH/OpenSlides | server/openslides/users/migrations/0006_user_email.py | Python | mit | 614 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.