text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
import numpy as nm
from sfepy.base.base import assert_
from sfepy.linalg import dot_sequences
from sfepy.terms.terms import Term, terms
class IntegrateVolumeTerm(Term):
r"""
Evaluate (weighted) variable in a volume region.
Depending on evaluation mode, integrate a variable over a volume region
('eval... | RexFuzzle/sfepy | sfepy/terms/terms_basic.py | Python | bsd-3-clause | 12,864 | 0.003887 |
"""
:codeauthor: Joao Mesquita <jmesquita@sangoma.com>
"""
import datetime
import os
import time
import salt.utils.files
from salt import fileserver
from tests.support.helpers import with_tempdir
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
class MapDiffTestCas... | saltstack/salt | tests/unit/test_fileserver.py | Python | apache-2.0 | 2,610 | 0.000766 |
class Solution:
"""
@param s: The first string
@param b: The second string
@return true or false
"""
# Time: is equal to sorted O(nlogn)
# Space: O(1)
def anagram(self, s, t):
# write your code here
s = sorted(s)
t = sorted(t)
return s == t
| rosegun38/LintCode | Two_Strings_Are_Anagrams/Solution.py | Python | gpl-3.0 | 307 | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
sql_template0 = """alter table _shadow_orders_{0}_ modify fingerprint text DEFAULT '' COMMENT '下单fingerprint';"""
if __name__ == '__main__':
for index in range(0, 50):
print(sql_template0.format(index))
print("------")
for index in range(50, 100):
... | yaolei313/python-study | base/test.py | Python | gpl-2.0 | 365 | 0.00554 |
import sublime
HOST_PLATFORM = sublime.platform()
WINDOWS = 'windows'
LINUX = 'linux'
OSX = 'osx'
| SublimeText/VintageEx | plat/__init__.py | Python | mit | 109 | 0 |
# -*- coding: utf-8 -*-
# (c) 2016, Hiroaki Nakamura <hnakamur@gmail.com>
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to th... | camradal/ansible | lib/ansible/module_utils/lxd.py | Python | gpl-3.0 | 6,180 | 0.004045 |
#!/usr/bin/env python
import matplotlib.pyplot as plt
import os
import math as m
import numpy as np
def Gaus(v,mu,sigma):
"Gaussian distribution"
return np.exp(-0.5*((v-mu)/sigma)**2)/(sigma*m.sqrt(2*m.pi))
mu = 0.5;
sigma = 1.5;
print "reading file..."
gausFile = open("gausRandom.out", 'r')
gausNums = map(... | htimko/ArcPIC | pic2d/tests/rngtestAna.py | Python | gpl-3.0 | 571 | 0.019264 |
from pivoteer import *
from pivotEngine import *
from pivotUtils import *
| BechtelCIRT/pivoteer | pivoteer/__init__.py | Python | mit | 74 | 0 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address_pool.py | Python | mit | 2,589 | 0.001545 |
#
# mjmud - The neverending MUD project
#
# Copyright (c) 2014, Matt Jordan
#
# See https://github.com/matt-jordan/mjmud for more information about the
# project. Please do not contact the maintainers of the project for information
# or assistance. The project uses Github for these purposes.
#
# This program is free so... | matt-jordan/mjmud | lib/transports/ws_receiver.py | Python | mit | 1,886 | 0 |
import datetime
from urlparse import urlparse
from utils import log as logging
from django.shortcuts import get_object_or_404, render_to_response
from django.views.decorators.http import condition
from django.http import HttpResponseForbidden, HttpResponseRedirect, HttpResponse, Http404
from django.conf import settings... | nriley/NewsBlur | apps/rss_feeds/views.py | Python | mit | 21,500 | 0.005302 |
import pypub.publishers.pub_resolve as pub_resolve
from pypub.paper_info import PaperInfo
def get_paper_info(doi=None, url=None):
"""
Parameters
----------
doi :
url :
Returns
-------
Errors
------
UnsupportedPublisherError : Retrieval of information from this pu... | ScholarTools/pypub | pypub/entry_functions.py | Python | mit | 1,300 | 0.009231 |
from collections import defaultdict
import numbers
import pkg_resources
import re
import sqlalchemy as sa
from sqlalchemy import schema, exc, inspect, Column
from sqlalchemy.dialects.postgresql.base import PGDDLCompiler, PGCompiler
from sqlalchemy.dialects.postgresql.psycopg2 import PGDialect_psycopg2
from sqlalchemy.... | bouk/redshift_sqlalchemy | redshift_sqlalchemy/dialect.py | Python | mit | 34,694 | 0.000461 |
# -*- coding: utf-8 -*-
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS 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 versio... | ppiotr/Bibedit-some-refactoring | modules/webjournal/lib/widgets/bfe_webjournal_widget_latestPhoto.py | Python | gpl-2.0 | 3,928 | 0.005855 |
import asyncio
import discord
import datetime
import pytz
from discord.ext import commands
from Cogs import FuzzySearch
from Cogs import Settings
from Cogs import DisplayName
from Cogs import Message
from Cogs import Nullify
class Time:
# Init with the bot reference, and a reference to the s... | TheMasterGhost/CorpBot | Cogs/Time.py | Python | mit | 8,457 | 0.03299 |
#!/usr/bin/python
#
# Copyright 2013 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/v201302/inventory_service/get_ad_unit_hierarchy.py | Python | apache-2.0 | 3,490 | 0.010029 |
#
# 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... | apache/incubator-airflow | tests/providers/google/cloud/hooks/test_vision.py | Python | apache-2.0 | 38,031 | 0.003523 |
import _metagam3d
from _metagam3d import AxisAlignment, AlignmentType
from metagam3d.channels import blocking
from metagam3d.scripts import m3d_expr
from concurrence import Tasklet
class LoadError(Exception):
pass
class Object(_metagam3d.Object):
def __init__(self, objid):
_metagam3d.Object.__init__(s... | JoyTeam/metagam3d | python/metagam3d/objects.py | Python | lgpl-3.0 | 3,360 | 0.004762 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import image_cropping.fields
class Migration(migrations.Migration):
dependencies = [
('crop', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='profile... | danithaca/berrypicking | django/advanced/crop/migrations/0002_auto_20150123_1831.py | Python | gpl-2.0 | 628 | 0.001592 |
# -*- coding: utf-8 -*-
import unittest
from clockwork import clockwork
from clockwork import clockwork_exceptions
class ApiTests(unittest.TestCase):
api_key = "YOUR_API_KEY_HERE"
def test_should_send_single_message(self):
"""Sending a single SMS with the minimum detail and no errors should work"""
... | mediaburst/clockwork-python | tests/clockwork_tests.py | Python | mit | 3,369 | 0.004808 |
from math import log
def make_logarithmic_function(base):
return lambda x: log(x, base)
My_LF = make_logarithmic_function(3)
print(My_LF(9))
| jinzekid/codehub | python/数据分析/func_lambda_test.py | Python | gpl-3.0 | 150 | 0.02 |
# -*- coding: utf-8 -*-
import spidev
import math
def reverse_bit_order(x):
x_reversed = 0x00
if (x & 0x80):
x_reversed |= 0x01
if (x & 0x40):
x_reversed |= 0x02
if (x & 0x20):
x_reversed |= 0x04
if (x & 0x10):
x_reversed |= 0x08
if (x & 0x08):
x_reversed |= 0x10
if (x & 0x04):
x_... | extsui/7SegFinger | test_8digit.py | Python | mit | 4,304 | 0.035431 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# ... | vlegoff/tsunami | src/secondaires/navigation/equipage/controle.py | Python | bsd-3-clause | 5,105 | 0.001191 |
# coding: utf-8
from deploy import app
if __name__ == '__main__':
app.run(debug = True) | TL4/deploy | run.py | Python | mit | 92 | 0.032609 |
import logging
import os
import sys
from tornado import ioloop
from tornado import web
from pyjobs import handlers
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logger = logging.getLogger(__name__)
STATIC_PATH = os.path.join(os.path.dirname(__file__), 'static/')
url_patterns = [
web.url('/', handle... | winstonf88/pyjobs | pyjobs/app.py | Python | gpl-2.0 | 750 | 0.001333 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/aio/operations/_network_interfaces_operations.py | Python | mit | 72,800 | 0.004973 |
# --------------------------------------------------------------------------
# Copyright (c) 2020-2022 Arm Limited (or its affiliates). All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the License); you may
# not use this file except in compliance with t... | ARM-software/CMSIS_5 | CMSIS/DSP/cmsisdsp/sdf/nodes/host/message.py | Python | apache-2.0 | 3,886 | 0.022131 |
# -*- coding: utf-8 -*-
"""
flask.views
~~~~~~~~~~~
This module provides class-based views inspired by the ones in Django.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from .globals import request
http_method_funcs = frozenset(['get', 'post', 'head', '... | darren-rogan/CouchPotatoServer | libs/flask/views.py | Python | gpl-3.0 | 5,629 | 0 |
# python -m unittest discover
import unittest
from datetime import datetime
from tasks import old_issues as c
class TestCloseOldIssue(unittest.TestCase):
def test_is_closed_issue(self):
self.assertEquals(c.is_closed({'closed_at': None}), False)
self.assertEquals(c.is_closed({'closed_at': "2014-1... | driftyco/ionitron-issues | tests/test_close_old_issue.py | Python | mit | 3,578 | 0.006149 |
# -*- coding: utf-8 -*-
from datetime import datetime
import numpy as np
import pandas as pd
try:
import pandas.tseries.holiday # noqa
except ImportError:
pass
hcal = pd.tseries.holiday.USFederalHolidayCalendar()
# These offests currently raise a NotImplimentedError with .apply_index()
non_apply = [pd.offset... | zfrenchee/pandas | asv_bench/benchmarks/offset.py | Python | bsd-3-clause | 3,276 | 0 |
import logging
from spacel.provision.app.base_decorator import BaseTemplateDecorator
logger = logging.getLogger('spacel.provision.app.db')
class BaseDbTemplateDecorator(BaseTemplateDecorator):
def __init__(self, ingress):
super(BaseDbTemplateDecorator, self).__init__()
self._ingress = ingress
... | pebble/spacel-provision | src/spacel/provision/app/db/base.py | Python | mit | 874 | 0 |
# -*- coding: utf-8 -*-
from djangocms_text_ckeditor.models import Text
from django.contrib.admin.sites import site
from django.contrib.admin.utils import unquote
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser, Group, Permission
from django.contrib.sites.models impor... | czpython/django-cms | cms/tests/test_permmod.py | Python | bsd-3-clause | 44,347 | 0.001804 |
import re
import numpy as np
def identify_templates(hfile):
"""
Parameters
----------
hfile : string
.h header file to be parsed
Returns
-------
tdict : dictionary
dictionary of lists
each dictionary is a function
each list identifies the arglist
Notes... | lukeolson/crappy | utils.py | Python | bsd-3-clause | 5,160 | 0.00155 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0010_product_design_format'),
]
operations = [
migrations.AlterField(
model_name='product',
... | GETLIMS/LIMS-Backend | lims/projects/migrations/0011_auto_20160822_1527.py | Python | mit | 415 | 0 |
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of ... | kratman/psi4public | psi4/header.py | Python | gpl-2.0 | 2,628 | 0.003425 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
from dateutil import relativedelta
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from django.db.models import Q, Count
from django_tables2 import RequestConfig
from osnovni.forms import PredmetForm,... | mbranko/kartonpmv | osnovni/views.py | Python | mit | 9,507 | 0.001367 |
import copy
from wpm.filelist import *
f = filelist()
f.load("/home/kman/bin/wpm")
f.get_list()
p = copy.copy(f)
p.sort()
f.randomize()
p.get_list()
f.get_list()
p.close()
f.close() | cristicalin/setwall | junk/test_copy.py | Python | gpl-3.0 | 181 | 0.005525 |
from distutils.core import setup, Extension
setup (name = "win32ver",
version = "1.0",
maintainer = "Jeong Wook Oh",
maintainer_email = "oh.jeongwook@gmail.com",
description = "Win32 Version Information Retriever",
ext_modules = [ Extension('win32ver',
sources = ['win32ver.cpp'],
libraries = ... | jenix21/DarunGrim | Src/Scripts/FileManagement/setup.py | Python | bsd-3-clause | 361 | 0.108033 |
"""Unit tests for contextlib.py, and other context managers."""
import sys
import tempfile
import unittest
from contextlib import * # Tests __all__
from test import support
try:
import threading
except ImportError:
threading = None
class ContextManagerTestCase(unittest.TestCase):
def test_contextmanage... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.2/Lib/test/test_contextlib.py | Python | mit | 10,109 | 0.002968 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | cloudera/hue | desktop/libs/notebook/src/notebook/management/commands/samples_setup.py | Python | apache-2.0 | 2,309 | 0.003465 |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | AMOboxTV/AMOBox.LegoBuild | plugin.video.salts/salts_lib/srt_scraper.py | Python | gpl-2.0 | 9,410 | 0.004145 |
#This script is built as a prototype during Mozilla HelloWeb Hackathon Kolkata 2016
#An Interactive Artificial Intelligence with a friendly personality to teach 5 year olds about HTML and WEB
#Copyright Protected Under GPL3 License | Follow the License | Send Pull Requests
import re
import py
import requests
imp... | ultimatepritam/HelloWeb | DoraTheExplorer.py | Python | gpl-3.0 | 7,919 | 0.011491 |
# -*- coding: utf-8 -*-
# Copyright 2017 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from __future__ import division, print_function, unicode_literals
TIPO_COBRANCA = (
('0', u'Carteira'),
('1', u'Cheque'),
('2', u'CNAB'),
)
TIPO_COBRANCA_SPED = (
('0', u'Duplicata'),
('... | odoo-brazil/l10n-brazil-wip | l10n_br_financial/constantes.py | Python | agpl-3.0 | 388 | 0 |
from yaml.composer import Composer
from yaml.nodes import MappingNode
class AnsibleComposer(Composer):
def __init__(self):
self.__mapping_starts = []
super(Composer, self).__init__()
def compose_node(self, parent, index):
# the line number where the previous token has ended (plus empty ... | gitterHQ/ansible | v2/ansible/parsing/yaml/composer.py | Python | gpl-3.0 | 1,212 | 0.00495 |
import os
from subprocess import call, Popen, PIPE
import sys
from . import Command
from . import utils
class OpenSequenceInRV(Command):
"""%prog [options] [paths]
Open the latest version for each given entity.
"""
def run(self, sgfs, opts, args):
# Parse them all.... | westernx/sgfs | sgfs/commands/rv.py | Python | bsd-3-clause | 2,458 | 0.004475 |
import requests
from hashlib import md5
from xml.etree import ElementTree
from django.core.cache import cache
from functools import cmp_to_key
# class Cache(object):
# params = {}
#
# def get(self,key):
# if key in self.params:
# return self.params[key]
# else:
# return N... | chadoneba/django-planfix | planfix/classes.py | Python | apache-2.0 | 6,136 | 0.009452 |
class LoggerSingleton:
_instance = None
@staticmethod
def get_instance(console_log=False):
if LoggerSingleton._instance is None:
LoggerSingleton._instance = LoggerSingleton._Logger()
if console_log:
LoggerSingleton._instance.set_next(LoggerSingleton._ConsoleL... | oknalv/piollo | loggersingleton.py | Python | gpl-2.0 | 1,004 | 0.001992 |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | ogazitt/stackalytics | tests/unit/test_mps.py | Python | apache-2.0 | 1,964 | 0 |
# Copyright 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 to in... | sixfeetup/cloud-custodian | tools/c7n_logexporter/c7n_logexporter/exporter.py | Python | apache-2.0 | 26,318 | 0.00057 |
"""
Support for MQTT Template lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.mqtt_template/
"""
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components import mqtt
from homeassistant.co... | tinloaf/home-assistant | homeassistant/components/light/mqtt/schema_template.py | Python | apache-2.0 | 16,276 | 0 |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | cee1/cerbero-mac | test/test_cerbero_packages_wix.py | Python | lgpl-2.1 | 8,020 | 0.006733 |
import os
from django.core.management.color import supports_color
from django.utils import termcolors
class VerboseCommandMixin(object):
def __init__(self, *args, **kwargs):
super(VerboseCommandMixin, self).__init__(*args, **kwargs)
self.dry_run = False
if supports_color():
o... | noslenfa/tdjangorest | uw/lib/python2.7/site-packages/generate_scaffold/management/verbosity.py | Python | apache-2.0 | 1,463 | 0 |
"""Dummy module to create rax security groups"""
#!/usr/bin/env python
import pyrax
from ansible.module_utils.basic import *
uri_sgs = 'https://dfw.networks.api.rackspacecloud.com/v2.0/security-groups'
def get_sg(cnw, name):
try:
result, sgs = cnw.identity.method_get(uri_sgs)
if result.status_co... | xroot88/rax_ansible | library/rax_security_group.py | Python | apache-2.0 | 3,554 | 0.002532 |
from __future__ import print_function, division, absolute_import
from llvmlite.llvmpy.core import Module, Type, Builder, InlineAsm
from llvmlite import binding as ll
from numba.cuda.cudadrv import nvvm
from numba.cuda.testing import unittest, CUDATestCase
from numba.cuda.testing import skip_on_cudasim
@skip_on_cudasi... | GaZ3ll3/numba | numba/cuda/tests/cudadrv/test_inline_ptx.py | Python | bsd-2-clause | 1,302 | 0 |
# -*- coding: utf-8 -*-
import os
"""Clock for VPython - Complex (cx@cx.hu) 2003. - Licence: Python
Usage:
from visual import *
from cxvp_clock import *
clk=Clock3D()
while 1:
rate(1)
clk.update()
See doc strings for more.
Run this module to test clocks.
TODO: More types of clocks, such as 3D digital,
ch... | NicovincX2/Python-3.5 | Divers/draw_a_clock_vpython.py | Python | gpl-3.0 | 6,444 | 0.001552 |
"""
Apply access on a harmonization dataset.
"""
import sys
import mica.core
import mica.access
def add_arguments(parser):
"""
Add command specific options
"""
mica.access.add_permission_arguments(parser, True)
parser.add_argument('id', help='Harmonization dataset ID')
def do_command(args):
"... | apruden/mica2 | mica-python-client/src/main/python/mica/access_harmonization_dataset.py | Python | gpl-3.0 | 1,215 | 0.004115 |
from cloudify.workflows import ctx, parameters
ctx.logger.info(parameters.node_id)
instance = [n for n in ctx.node_instances
if n.node_id == parameters.node_id][0]
for relationship in instance.relationships:
relationship.execute_source_operation('custom_lifecycle.custom_operation')
| cloudify-cosmo/cloudify-manager | tests/integration_tests/resources/dsl/deployment_update/modify_relationship_operation/modification/custom_workflow.py | Python | apache-2.0 | 304 | 0 |
import datetime
import json
from constance.test import override_config
from django.conf import settings
from django.core.files.base import ContentFile
from django.db import transaction
from django.utils.http import parse_http_date_safe
from kuma.core.urlresolvers import reverse
from kuma.users.tests import UserTestCa... | safwanrahman/kuma | kuma/attachments/tests/test_views.py | Python | mpl-2.0 | 9,771 | 0 |
"""
Script that trains graph-conv models on Tox21 dataset.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import json
np.random.seed(123)
import tensorflow as tf
tf.set_random_seed(123)
import deepchem as dc
from deepchem.molnet im... | Agent007/deepchem | examples/tox21/tox21_graphcnn.py | Python | mit | 1,211 | 0.003303 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | Azure/azure-sdk-for-python | sdk/graphrbac/azure-graphrbac/azure/graphrbac/models/domain_py3.py | Python | mit | 2,154 | 0.000464 |
# -*- coding: utf-8 -*-
"""
This module defines substantial HPACK integration tests. These can take a very
long time to run, so they're outside the main test suite, but they need to be
run before every change to HPACK.
"""
from hpack.hpack import Decoder, Encoder
from binascii import unhexlify
from pytest import skip
... | jimcarreer/hpack | test/test_hpack_integration.py | Python | mit | 2,084 | 0.001919 |
#!/usr/bin/env python
#
# Setup script for Review Board.
#
# A big thanks to Django project for some of the fixes used in here for
# MacOS X and data files installation.
import os
import shutil
import sys
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from setuptools... | asutherland/opc-reviewboard | setup.py | Python | mit | 4,082 | 0.002695 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
class FDragRowsTableWidget(QTableWidget):
def __init__(self, rows=0, cloumns=2, parent=None):
super(FDragRowsTableWidget, self).__init__(rows, cloumns, parent)
self.... | dragondjf/PFramer | qframer/ftablewidget.py | Python | gpl-3.0 | 7,960 | 0.000126 |
from Screen import Screen
from ServiceScan import ServiceScan
from Components.config import config, ConfigSubsection, ConfigSelection, ConfigYesNo, ConfigInteger, getConfigListEntry, ConfigSlider, ConfigEnableDisable
from Components.ActionMap import NumberActionMap, ActionMap
from Components.ConfigList import ConfigLis... | OpenLD/enigma2-wetek | lib/python/Screens/ScanSetup.py | Python | gpl-2.0 | 68,521 | 0.030093 |
import os
import re
import shutil
destination = 'C:/Software/Pimix/'
apps = [
'fileutil',
'jobutil'
]
include_patterns = [
r'\.exe',
r'\.exe\.config',
r'\.dll',
r'\.pdb'
]
exclude_patterns = [
'FSharp',
'vshost'
]
os.makedirs(destination, exist_ok=True)
for app in apps:
for e... | Kimi-Arthur/Pimix | deploy.py | Python | mit | 805 | 0 |
from typing import Union
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _, pgettext
from rules import predicate
from base.models.academic_year import current_academic_year
from base.models.education_group_year import EducationGroupYear... | uclouvain/osis | education_group/auth/predicates.py | Python | agpl-3.0 | 12,243 | 0.003921 |
import ctypes, ctypes.util, operator, sys
from . import model
if sys.version_info < (3,):
bytechr = chr
else:
unicode = str
long = int
xrange = range
bytechr = lambda num: bytes([num])
class CTypesType(type):
pass
class CTypesData(object):
__metaclass__ = CTypesType
__slots__ = ['__we... | Widiot/simpleblog | venv/lib/python3.5/site-packages/cffi/backend_ctypes.py | Python | mit | 42,086 | 0.001022 |
from __future__ import unicode_literals
from django.contrib import admin
from django.core import urlresolvers
from mezzanine.core.admin import TabularDynamicInlineAdmin, StackedDynamicInlineAdmin
from .models import Slider, SlideCaption, Slide
class SlideInline(TabularDynamicInlineAdmin):
template = "slider_rev... | restless/mezzanine-slider-revolution | slider_revolution/admin.py | Python | mit | 1,323 | 0.002268 |
"""
Django settings for ltc_huobi project.
Generated by 'django-admin startproject' using Django 1.11.2.
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 ... | yiplee/ltc-huobi | ltc_huobi/settings.py | Python | mit | 3,262 | 0.001226 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import render_template
from app.extensions import celery, mail
from app.data import db
from celery.signals import task_postrun
from flask_mail import Message
@celery.task
def send_registration_email(user, token):
msg = Message(
'User Registration',
... | Urumasi/Flask-Bones | app/tasks.py | Python | mit | 874 | 0 |
from implementation import *
from implementations import *
| drvinceknight/sklDj | sklDj/implementations/__init__.py | Python | mit | 59 | 0 |
import sys
import argparse
import time
sys.path.append('./bin/moabc')
import optimizer
#引数の処理
#parserの初期化
parser = argparse.ArgumentParser(description='This script optimizes bayesian network graph structure by MOABC')
#強化成功率表
parser.add_argument("infile_pt", type=str)
#一回の強化費用
parser.add_argument("-pg","--pricegri... | curiburn/pso2_grind_optimizer | py/main.py | Python | gpl-3.0 | 2,887 | 0.011304 |
#!/usr/bin/python
import serial
import RPi.GPIO as GPIO
import time
import math
from RPIO import PWM
import logging
from math import *
from hmc5883l import hmc5883l
import sys
import os
# -----------------------------------------
# ----- begin declare variables
# -----------------------------------------
# log file... | klinstifen/rpi.mar13 | mar13.py | Python | lgpl-3.0 | 6,451 | 0.014106 |
import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
import codecs
from pattern.vector import Document, PORTER, LEMMA
# A Document is a "bag-of-words" that splits a string into words and counts them.
# A list of words or dictionary of (word, count)-items can also be given.
# Words ... | krishna11888/ai | third_party/pattern/examples/05-vector/01-document.py | Python | gpl-2.0 | 3,205 | 0.007488 |
# -*- coding: utf-8 -*-
#
# Core documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 12 12:49:48 2015.
#
# 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
# autogenerated file.
#
# All ... | redvox/Eliza | docs/conf.py | Python | apache-2.0 | 9,460 | 0.006237 |
# Copyright (C) 2012 by Eka A. Kurniawan
# eka.a.kurniawan(ta)gmail(tod)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; version 2 of the License.
#
# This program is distributed in the hop... | ekaakurniawan/Bioinformatics-Tools | plot_conservation/plot_conservation.py | Python | gpl-2.0 | 2,539 | 0.002363 |
from sympy import (Matrix, Symbol, solve, exp, log, cos, acos, Rational, Eq,
sqrt, oo, LambertW, pi, I, sin, asin, Function, diff, Derivative, symbols,
S, sympify, var, simplify, Integral, sstr, Wild, solve_linear, Interval,
And, Or, Lt, Gt, Assume, Q, re, im, expand, zoo)
from sympy.solvers import solve_l... | pernici/sympy | sympy/solvers/tests/test_solvers.py | Python | bsd-3-clause | 13,913 | 0.016172 |
#!/usr/bin/env python
'''
Copyright (c) 2013-2015, Joshua Pitts
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 li... | shadghost/Auto-Backdoor | the-backdoor-factory/payloadtests.py | Python | gpl-3.0 | 6,022 | 0.001993 |
#!/usr/bin/python
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# Typical usage:
# dohtml -r docs/*
# - put all files and directories in docs into /usr/share/doc/${PF}/html
# dohtml foo.html
# - put foo.html into /usr/share/doc/${PF}/html
#
#
# Detailed ... | prometheanfire/portage | bin/dohtml.py | Python | gpl-2.0 | 6,987 | 0.025619 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | Jgarcia-IAS/Fidelizacion_odoo | openerp/addons/sale_stock/sale_stock.py | Python | agpl-3.0 | 24,595 | 0.005733 |
from celery.task import task
import time
@task
def sleep(duration=10):
time.sleep(duration)
| gmimano/commcaretest | corehq/apps/hqadmin/tasks.py | Python | bsd-3-clause | 98 | 0.020408 |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/objax | objax/util/check.py | Python | apache-2.0 | 2,313 | 0.003891 |
# -*- coding: utf-8 -*-
# This file is part of translate.
#
# translate 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.
#
# translate ... | erik/translate | translate/client/exceptions.py | Python | gpl-3.0 | 5,955 | 0 |
#!/usr/bin/env python3
# Copyright (C) 2012,2013,2014,2015,2016,2017,2018,2019,2020 Seven Watt <info@sevenwatt.com>
# <http://www.sevenwatt.com>
#
# This file is part of Plugwise-2-py.
#
# Plugwise-2-py is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | SevenW/Plugwise-2-py | devtools/Join-2.py | Python | gpl-3.0 | 58,244 | 0.009546 |
import SimpleHTTPServer
import sqlite3 as lite
import sys
import urlparse
import datetime
import json
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class TrackListHandler(BaseHTTPRequestHandler):
def do_OPTIONS(self):
self.send_response(200)
self.send_header('application/json; charset=utf... | paulburkinshaw/mopidy-radio-pi | mopidy_radio_pi/static/MyHandler.py | Python | apache-2.0 | 11,919 | 0.043544 |
'''python example of filtering through strings from a
streamcorpus.StreamItem to find names from a FilterName
'''
from __future__ import absolute_import
import logging
import os
import sys
from cStringIO import StringIO
## import the thrift library
from thrift import Thrift
from thrift.transport.TTransport import T... | streamcorpus/streamcorpus-filter | py/src/streamcorpus_filter/_filter.py | Python | mit | 8,706 | 0.005628 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 clowwindy
#
# 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 r... | plus1s/shadowsocks-py-mu | shadowsocks/asyncdns.py | Python | apache-2.0 | 17,651 | 0.00017 |
from django.dispatch import Signal
pre_save = Signal(providing_args=['instance', 'action', ])
post_save = Signal(providing_args=['instance', 'action', ])
pre_delete = Signal(providing_args=['instance', 'action', ])
post_delete = Signal(providing_args=['instance', 'action', ])
| thoas/django-sequere | sequere/contrib/timeline/signals.py | Python | mit | 279 | 0 |
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
class EmailNotification:
msg_from = 'OKFN team <noreply@okfn.org>'
def __init__(self, msg_to, msg_from=None):
self.msg_to = msg_to
if msg_from:
self.msg_from = msg_from
def send_mail(self, su... | okfn/brand-manager | manager/apps/brand/notifications.py | Python | mit | 1,306 | 0 |
import unittest
from django.dispatch.saferef import safeRef
from django.utils.six.moves import xrange
class Test1(object):
def x(self):
pass
def test2(obj):
pass
class Test2(object):
def __call__(self, obj):
pass
class SaferefTests(unittest.TestCase):
def setUp(self):
ts... | Beeblio/django | tests/dispatch/tests/test_saferef.py | Python | bsd-3-clause | 1,886 | 0 |
# Copyright 2018 German Aerospace Center (DLR)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | DLR-SC/F2x | src/F2x/template/ctypes_noerr/lib/glue.py | Python | apache-2.0 | 17,616 | 0.0021 |
# -*- coding: utf-8 -*-
"""
Creates a very basic one-page html file for reporting a test run.
"""
from __future__ import absolute_import
from behave.formatter.base import Formatter
from behave.formatter.css import BasicTheme
from behave.compat.collections import Counter
import xml.etree.ElementTree as ET
import base64... | kymbert/behave | behave/formatter/html.py | Python | bsd-2-clause | 15,092 | 0.001789 |
import socket, subprocess, re, tools, custom
#This file explains how sockets work for networking.
MAX_MESSAGE_SIZE = 60000
def kill_processes_using_ports(ports):
popen = subprocess.Popen(['netstat', '-lpn'],
shell=False,
stdout=subprocess.PIPE)
(data, er... | zack-bitcoin/forumcoin | networking.py | Python | gpl-3.0 | 1,788 | 0.009508 |
#!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | sosiouxme/openshift-ansible | roles/lib_openshift/library/oc_scale.py | Python | apache-2.0 | 66,630 | 0.001291 |
from unittest import TestLoader, TextTestRunner, TestSuite
from UnitTests.TableTest import TestTable
from UnitTests.DestinationTest import TestDestination
from UnitTests.CSVReaderTest import TestCSVReader
from UnitTests.ProxyExtractorTest import TestProxyExtractor
from UnitTests.NoProtocolTest import TestNoProtocol
fro... | Valentijn1995/Kn0ckKn0ck | Kn0ckKn0ckTestSuite.py | Python | mit | 1,092 | 0.000916 |
# Copyright (c) 2011 Zadara Storage Inc.
# Copyright (c) 2011 OpenStack Foundation
# Copyright 2011 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
#
... | rakeshmi/cinder | cinder/tests/unit/test_volume_types_extra_specs.py | Python | apache-2.0 | 5,074 | 0 |
import chainer
from chainer.backends import cuda
from chainer import distribution
from chainer.functions.array import where
from chainer.functions.math import exponential
from chainer import utils
class Pareto(distribution.Distribution):
"""Pareto Distribution.
.. math::
f(x) = \\alpha x_m^{\\alpha}... | ktnyt/chainer | chainer/distributions/pareto.py | Python | mit | 3,069 | 0 |
print('What is the password?')
password = input()
if password == 'rosebud':
print('Access granted.')
if password != 'rosebud':
print('Access denied.')
print('Done.') | SafeW3rd/Ciphers | password.py | Python | mit | 179 | 0.005587 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Ricardo Ribeiro"
__credits__ = ["Ricardo Ribeiro"]
__license__ = "MIT"
__version__ = "0.0"
__maintainer__ = "Ricardo Ribeiro"
__email__ = "ricardojvr@gmail.com"
__status__ = "Development"
import time
from datetime import datetime, ... | sunj1/my_pyforms | pyforms/Utils/timeit.py | Python | mit | 694 | 0.034582 |
import matplotlib.pyplot as plt
import numpy as np
from glob import glob
from scipy import stats
#p = 0.5
e = 0.1
qth = [25,50,75,90]
nomefile = './N*' + '_B*' + '_p=1su2L_e0.0.npy'
nomefile = glob(nomefile)
data = []
N = []
medie = []
mediane = []
massimi = []
perc = []
nomefile.sort(key=lambda x:int(x.split('_')... | clancia/TASEP | Sequential_TASEP/LinRegCTvsSize.py | Python | gpl-2.0 | 2,328 | 0.018041 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.