code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-PsExec', 'Author': ['@harmj0y'], 'Description': ('Executes a stager on remote hosts using PsExec type functionality.'), 'Background' : Tru...
thebarbershopper/Empire
lib/modules/lateral_movement/invoke_psexec.py
Python
bsd-3-clause
5,198
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # # Copyright (c) 2008-2011 University of Dundee. # # 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 Free Software Foundation, either version 3 of the # License, or...
tp81/openmicroscopy
components/tools/OmeroWeb/omeroweb/webclient/controller/__init__.py
Python
gpl-2.0
2,099
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import frappe.share from frappe import _ from frappe.utils import cstr, now_datetime, cint, flt from erpnext.controllers.status_updater im...
manqala/erpnext
erpnext/utilities/transaction_base.py
Python
gpl-3.0
5,360
# Copyright 2014 Sardar Yumatov # # 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,...
baverman/apns-client
apnsclient/transport.py
Python
apache-2.0
27,323
#!/usr/bin/env python # Copyright 2017 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # for py2/py3 compatibility from __future__ import print_function import os import pipes import shutil import stat import subprocess...
weolar/miniblink49
v8_7_5/tools/node/node_common.py
Python
apache-2.0
1,696
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os.path import sys import types import unittest from contextlib import contextmanager from django.template import Context, TemplateDoesNotExist from django.template.engine import Engine from django.test import SimpleTestCase, override_settings fro...
abhattad4/Digi-Menu
tests/template_tests/test_loaders.py
Python
bsd-3-clause
8,433
from mock import * from gp_unittest import * from gpconfig_modules.database_segment_guc import DatabaseSegmentGuc from gpconfig_modules.file_segment_guc import FileSegmentGuc from gpconfig_modules.guc_collection import GucCollection class GucCollectionTest(GpTestCase): def setUp(self): self.subject = GucC...
cjcjameson/gpdb
gpMgmt/bin/gppylib/test/unit/test_unit_guccollection.py
Python
apache-2.0
12,742
from django.db.models import Q, Sum from django.db.utils import IntegrityError from django.test import TestCase, skipIfDBFeature from django.forms.models import modelform_factory from django.db.models.deletion import ProtectedError from .models import ( Address, Place, Restaurant, Link, CharLink, TextLink, Per...
oscaro/django
tests/generic_relations_regress/tests.py
Python
bsd-3-clause
10,718
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012 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...
jmacmahon/invenio
modules/bibformat/lib/elements/bfe_oai_identifier.py
Python
gpl-2.0
1,610
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class ExchangeRateRevaluationAccount(Document): pass
Zlash65/erpnext
erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.py
Python
gpl-3.0
296
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.reload_doc("regional", "doctype", "gst_settings") frappe.reload_doc("accounts", "doctype", "gst_account") gst...
Zlash65/erpnext
erpnext/patches/v10_0/set_b2c_limit.py
Python
gpl-3.0
417
from __future__ import absolute_import import logging import os import subprocess from pip._vendor.six.moves import shlex_quote from pip._internal.cli.spinners import SpinnerInterface, open_spinner from pip._internal.exceptions import InstallationError from pip._internal.utils.compat import console_to_str, str_to_di...
RalfBarkow/Zettelkasten
venv/lib/python3.9/site-packages/pip/_internal/utils/subprocess.py
Python
gpl-3.0
9,924
""" Support for BME280 temperature, humidity and pressure sensor. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.bme280/ """ import asyncio from datetime import timedelta from functools import partial import logging import voluptuous as vol from...
MungoRae/home-assistant
homeassistant/components/sensor/bme280.py
Python
apache-2.0
6,473
def f(x): return x + 1 raise ValueError("I do not want to be imported")
endlessm/chromium-browser
third_party/llvm/lldb/test/API/commands/command/script/import/rdar-12586188/fail212586188.py
Python
bsd-3-clause
77
from chainer.dataset import dataset_mixin class ConcatenatedDataset(dataset_mixin.DatasetMixin): """Dataset which concatenates some base datasets. This dataset wraps some base datasets and works as a concatenated dataset. For example, if a base dataset with 10 samples and another base dataset with 2...
rezoo/chainer
chainer/datasets/concatenated_dataset.py
Python
mit
939
"""The main API for the v2 notebook format. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distribute...
unnikrishnankgs/va
venv/lib/python3.5/site-packages/nbformat/v2/__init__.py
Python
bsd-2-clause
2,577
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # # Copyright (c) 2011-2015 Regents of the University of California. # # This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and # contributors. # # ndnSIM is free software: you can redistribute it and/or modif...
srene/ndnSIM-inrpp
src/ndnSIM/examples/ndn-simple.py
Python
gpl-2.0
3,286
#!/usr/bin/env python from numpy import array, dtype, int32 traindat = '../data/fm_train_real.dat' testdat = '../data/fm_test_real.dat' label_traindat = '../data/label_train_multiclass.dat' # set both input attributes as continuous i.e. 2 feattypes = array([2, 2],dtype=int32) parameter_list = [[traindat,testdat,labe...
AzamYahya/shogun
examples/undocumented/python_modular/multiclass_chaidtree_modular.py
Python
gpl-3.0
1,100
"""Base and mixin classes for nearest neighbors""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck # Multi-output support by Arnaud Jol...
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/sklearn/neighbors/base.py
Python
mit
30,908
from nose.tools import eq_ from mkt.api.renderers import SuccinctJSONRenderer from mkt.site.tests import TestCase class TestSuccinctJSONRenderer(TestCase): def setUp(self): self.renderer = SuccinctJSONRenderer() self.input = {'foo': 'bar'} def test_no_spaces(self): output = self.rend...
mozilla/zamboni
mkt/api/tests/test_renderers.py
Python
bsd-3-clause
790
import re #from gobject import GObject, SIGNAL_RUN_FIRST from gi.repository import GObject from pychess.Utils.const import * from pychess.Utils.Offer import Offer from pychess.System.Log import log from pychess.ic import * from pychess.ic.FICSObjects import * names = "\w+(?:\([A-Z\*]+\))*" rated = "(rated|unrated)" ...
Aleks31/pychess
lib/pychess/ic/managers/OfferManager.py
Python
gpl-3.0
10,580
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # with...
houzhenggang/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib64/scons-2.1.0/SCons/Tool/MSCommon/__init__.py
Python
gpl-2.0
2,107
# implement samba_tool drs commands # # Copyright Andrew Tridgell 2010 # # based on C implementation by Kamen Mazdrashki <kamen.mazdrashki@postpath.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 Fou...
Zentyal/samba
python/samba/netcmd/drs.py
Python
gpl-3.0
21,714
# Copyright 2015 The TensorFlow 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 applica...
nburn42/tensorflow
tensorflow/python/training/session_manager_test.py
Python
apache-2.0
32,764
#!/usr/bin/env python # # Copyright 2010 The Closure Library 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 ...
marcelohg/NasajonWebTeamplateProject
web/js/google-closure/closure/bin/build/source_test.py
Python
mit
1,422
#!/usr/bin/python # Copyright: (c) 2017, Giovanni Sciortino (@giovannisciortino) # 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', ...
hryamzik/ansible
lib/ansible/modules/packaging/os/rhsm_repository.py
Python
gpl-3.0
7,912
# -*- coding: utf-8 -*- """ Math Render Plugin for Pelican ============================== This plugin allows your site to render Math. It uses the MathJax JavaScript engine. For markdown, the plugin works by creating a Markdown extension which is used during the markdown compilation stage. Math therefore gets treated...
lindzey/pelican-plugins
render_math/math.py
Python
agpl-3.0
14,090
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati di un JOIN ', '%Y-%m-%d': '%d/%m/%Y', '%Y-%m-%d %H:%M:%S': '%d/%m/%...
house4hack/openSHAC
web2py_shac/applications/enter/languages/it.py
Python
mit
4,775
# Copyright 2013 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. import sys from measurements import media from telemetry import test class Media(test.Test): """Obtains media metrics for key user scenarios.""" test =...
DirtyUnicorns/android_external_chromium-org
tools/perf/benchmarks/media.py
Python
bsd-3-clause
1,514
# Copyright 2015 The TensorFlow 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 applica...
ghchinoy/tensorflow
tensorflow/contrib/ffmpeg/__init__.py
Python
apache-2.0
1,369
my_dict = { "one": example_list[0], "two": example_list[1], "three": example_list[2:3], "some really long element name that takes a lot of space": "fo...
siosio/intellij-community
python/testData/formatter/alightDictLiteralOnValueSubscriptionsAndSlices_after.py
Python
apache-2.0
326
#!/usr/bin/env python # 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. '''python %prog [options] platform chromium_os_flag template platform specifies which platform source is being generated for and...
GeyerA/android_external_chromium_org
chrome/tools/build/generate_policy_source.py
Python
bsd-3-clause
19,950
#!/usr/bin/python2.4 # # Copyright 2010 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...
wonderful4228/qualitybots
src/appengine/handlers/statistics_handler.py
Python
apache-2.0
4,705
''' ================== RBF SVM parameters ================== This example illustrates the effect of the parameters ``gamma`` and ``C`` of the Radial Basis Function (RBF) kernel SVM. Intuitively, the ``gamma`` parameter defines how far the influence of a single training example reaches, with low values meaning 'far' a...
RPGOne/Skynet
scikit-learn-0.18.1/examples/svm/plot_rbf_parameters.py
Python
bsd-3-clause
8,016
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: 2017, Dag Wieers (@dagwieers) <dag@wieers.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by...
hryamzik/ansible
lib/ansible/modules/windows/win_defrag.py
Python
gpl-3.0
2,682
import collections.abc import inspect import warnings from math import ceil from django.utils.deprecation import RemovedInDjango31Warning from django.utils.functional import cached_property from django.utils.inspect import method_has_no_args from django.utils.translation import gettext_lazy as _ class UnorderedObjec...
sametmax/Django--an-app-at-a-time
ignore_this_directory/django/core/paginator.py
Python
mit
6,204
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsTextBlock. Run with: ctest -V -R QgsTextBlock .. note:: 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 of the License, or (at your...
pblottiere/QGIS
tests/src/python/test_qgstextblock.py
Python
gpl-2.0
2,937
"""Azure plugin for integration tests.""" from __future__ import absolute_import, print_function import os from lib.util import ( ApplicationError, display, is_shippable, ) from lib.cloud import ( CloudProvider, CloudEnvironment, ) from lib.http import ( HttpClient, urlparse, urlunpa...
tsdmgz/ansible
test/runner/lib/cloud/azure.py
Python
gpl-3.0
6,070
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from __future__ import division, absolute_import import sys import traceback from zope.interface import implementer from twisted.python.compat import _PY3 from twisted.python.failure import Failure from twisted.trial.unittest import Synchronous...
skycucumber/Messaging-Gateway
webapp/venv/lib/python2.7/site-packages/twisted/trial/test/test_pyunitcompat.py
Python
gpl-2.0
8,688
# Copyright 2011 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...
scripnichenko/nova
nova/api/openstack/compute/quota_sets.py
Python
apache-2.0
8,030
# 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. """Chromium presubmit script for src/net. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details on the presubmit ...
7kbird/chrome
net/PRESUBMIT.py
Python
bsd-3-clause
1,034
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import hashlib import json import os import traceback import urlparse from abc import ABCMeta, abstractmethod from ..te...
akumar21NCSU/servo
tests/wpt/harness/wptrunner/executors/base.py
Python
mpl-2.0
10,114
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # # This file is part of Ansible # # Ansible 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 Lice...
hryamzik/ansible
lib/ansible/modules/cloud/cloudstack/cs_router.py
Python
gpl-3.0
10,470
# -*- coding:utf-8 -*- """ 上海银行间同业拆放利率(Shibor)数据接口 Created on 2014/07/31 @author: Jimmy Liu @group : waditu @contact: jimmysoa@sina.cn """ import pandas as pd import numpy as np from tushare.stock import cons as ct from tushare.util import dateu as du def shibor_data(year=None): """ 获取上海银行间同业拆放利率(Shibor) P...
shiguol/tushare
tushare/stock/shibor.py
Python
bsd-3-clause
5,010
from oscar.test.testcases import WebTestCase from oscar.test.factories import create_product, UserFactory from oscar.core.compat import get_user_model from oscar.apps.catalogue.reviews.signals import review_added from oscar.test.contextmanagers import mock_signal_receiver class TestACustomer(WebTestCase): def se...
itbabu/django-oscar
tests/functional/catalogue/review_tests.py
Python
bsd-3-clause
2,113
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # # This module 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 ...
stianvi/ansible-modules-core
cloud/openstack/_quantum_router.py
Python
gpl-3.0
7,042
import unittest, string from test import support class ModuleTest(unittest.TestCase): def test_attrs(self): string.whitespace string.ascii_lowercase string.ascii_uppercase string.ascii_letters string.digits string.hexdigits string.octdigits string.p...
invisiblek/python-for-android
python3-alpha/python3-src/Lib/test/test_string.py
Python
apache-2.0
5,578
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import requests import sys import tempfile import zipfile from . import Command class Deploy(Command): """Deploy a module on an Odoo instance""" def __init__(self): super(Deploy, self).__init__() self.session = requests.se...
vileopratama/vitech
src/openerp/cli/deploy.py
Python
mit
4,038
#!/usr/bin/python # This file is part of Ansible # # Ansible 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. # # Ansible is distributed...
andreaso/ansible
lib/ansible/modules/cloud/amazon/cloudfront_facts.py
Python
gpl-3.0
31,932
# Copyright (C) 2001-2006 Python Software Foundation # Author: Ben Gertzfield, Barry Warsaw # Contact: email-sig@python.org __all__ = [ 'Charset', 'add_alias', 'add_charset', 'add_codec', ] import codecs import email.base64mime import email.quoprimime from email import errors from...
ktan2020/legacy-automation
win/Lib/email/charset.py
Python
mit
16,440
""" A small templating language This implements a small templating language. This language implements if/elif/else, for/continue/break, expressions, and blocks of Python code. The syntax is:: {{any expression (function calls etc)}} {{any expression | filter}} {{for x in y}}...{{endfor}} {{if x}}x{{elif y}}y...
SohKai/ChronoLogger
web/flask/lib/python2.7/site-packages/tempita/__init__.py
Python
mit
39,809
from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver import libcloud.security # This assumes you don't have SSL set up. # Note: Code like this poses a security risk (MITM attack) and # that's the reason why you should never use it for anything else # besides testing. You have ...
dcorbacho/libcloud
docs/examples/compute/openstack/custom_service_catalog_selection_args.py
Python
apache-2.0
768
#!/usr/bin/env python # # Copyright 2014 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. """ Invokes concatenate_application_code for applications specified on the command line. """ from os import path import concatenate_...
hujiajie/chromium-crosswalk
third_party/WebKit/Source/devtools/scripts/build_applications.py
Python
bsd-3-clause
1,259
""" The Spatial Reference class, represents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print(srs) GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY...
sametmax/Django--an-app-at-a-time
ignore_this_directory/django/contrib/gis/gdal/srs.py
Python
mit
11,540
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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...
tedder/ansible-modules-core
utilities/helper/_fireball.py
Python
gpl-3.0
1,209
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
scripnichenko/nova
nova/tests/unit/keymgr/test_single_key_mgr.py
Python
apache-2.0
2,448
#!/usr/bin/env python command += testshade("-g 256 256 --center -od uint8 -o Cout out.tif test") outputs = [ "out.txt", "out.tif" ]
svenstaro/OpenShadingLanguage
testsuite/texture-withderivs/run.py
Python
bsd-3-clause
133
from django.conf import settings from django.core.cache import caches from django.core.cache.backends.db import BaseDatabaseCache from django.core.management.base import BaseCommand, CommandError from django.db import ( DEFAULT_DB_ALIAS, connections, models, router, transaction, ) from django.db.utils import Databa...
Vvucinic/Wander
venv_2_7/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/core/management/commands/createcachetable.py
Python
artistic-2.0
4,389
#!/usr/bin/env python """ Python Character Mapping Codec for ROT13. See http://ucsub.colorado.edu/~kominek/rot13/ for details. Written by Marc-Andre Lemburg (mal@lemburg.com). """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): ...
ktan2020/legacy-automation
win/Lib/encodings/rot_13.py
Python
mit
2,697
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013 Matt Coddington <coddington@gmail.com> # # This file is part of Ansible # # Ansible 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 ...
yfauser/ansible-modules-extras
notification/flowdock.py
Python
gpl-3.0
6,028
"""Tests for util.request module.""" import unittest from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.test.client import RequestFactory from util.request import course_id_from_url, safe_get_host class ResponseTestCase(unittest.TestCase): """ Tests for response...
ahmadiga/min_edx
common/djangoapps/util/tests/test_request.py
Python
agpl-3.0
2,390
# Copyright (C) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
klim-iv/phantomjs-qt5
src/webkit/Tools/Scripts/webkitpy/tool/steps/suggestreviewers_unittest.py
Python
bsd-3-clause
2,415
# Copyright 2015 The TensorFlow 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 applica...
unnikrishnankgs/va
venv/lib/python3.5/site-packages/tensorflow/contrib/quantization/python/array_ops.py
Python
bsd-2-clause
1,156
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals
thecut/thecut-emailfield
thecut/emailfield/tests/__init__.py
Python
apache-2.0
81
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible 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. # # Ansible is d...
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/terminal/vyos.py
Python
bsd-3-clause
1,700
# (c) 2012, Zettar Inc. # Written by Chin Fang <fangchin@zettar.com> # # This file is part of Ansible # # This module 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 y...
goozbach/ansible
lib/ansible/inventory/expand_hosts.py
Python
gpl-3.0
4,357
# Project : Dlab-Finance # W251 Nital Patwa and Ritesh Soni # Desc : This program counts for each exchange, the #of times it produced best bid (or ask) and average size of bid (or ask) # The purpose is to understand what roles exchanges such as BATS play. # Usage Instructions # Change inputDir for daily quote file and ...
rdhyee/dlab-finance
crossings/nbboex.py
Python
isc
5,138
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' Sequential modeling =================== Sequence alignment ------------------ .. autosummary:: :toctree: generated/ dtw rqa Viterbi decoding ---------------- .. autosummary:: :toctree: generated/ viterbi viterbi_discriminative viterbi_b...
carlthome/librosa
librosa/sequence.py
Python
isc
55,756
from subprocess import Popen import os import time from marmot.representations.representation_generator import RepresentationGenerator from marmot.experiment.import_utils import mk_tmp_dir class POSRepresentationGenerator(RepresentationGenerator): def _get_random_name(self, suffix=''): return 'tmp_'+suf...
qe-team/marmot
marmot/representations/pos_representation_generator.py
Python
isc
2,447
from flower.core.sync import * def test_increment(): i = 0 i = increment(i) assert i == 1 i = increment(i) assert i == 2 def test_decrement(): i = 0 i = decrement(i) assert i == -1 i = decrement(i) assert i == -2 def test_combine(): i = 1 i = decrement(i) asser...
benoitc/flower
test/test_sync.py
Python
mit
601
import json import logging from community_csdt.src.models import database class Page(object): def __init__(self, parent, name): self.__parent__ = parent self.__name__ = name def __getitem__(self, key): log = logging.getLogger('csdt') log.info("Page.__getitem__()") log....
electricity345/community.csdt
src/community_csdt/community_csdt/src/models/pages/page.py
Python
mit
374
import webapp2 import json from collections import defaultdict from generic_handler import GenericHandler from google.appengine.api import users from google.appengine.ext import ndb from handler_utils import is_int from handler_utils import GetPairIdFromRequest from handler_utils import GetTourneyWithIdAndMaybeReturnS...
aragos/tichu-tournament
api/src/movement_handler.py
Python
mit
5,763
from raiden.messages import Processed from raiden.tests.utils import factories from raiden.transfer.events import ( EventPaymentReceivedSuccess, EventPaymentSentFailed, EventPaymentSentSuccess, ) from raiden.transfer.state_change import ActionCancelPayment, Block from raiden.utils import sha3 ADDRESS = sha...
hackaugusto/raiden
raiden/tests/unit/test_operators.py
Python
mit
2,554
import string,nltk from nltk.corpus import stopwords from nltk.stem.porter import * def tokenizeAndStemStrings(text): # turn text to tokens tokens = nltk.word_tokenize(text) # remove stop words tokens_no_sw = [word for word in tokens if not word in stopwords.words('english')] # stem ...
ryanmdavis/BioTechTopics
BTT_functions.py
Python
mit
997
#!/usr/bin/env python # -*- coding: utf-8 -*- from .km_backend.km_plugin_manager import KMBaseController from .km_exception import log __author__ = 'hiroki' class KMEngine(KMBaseController): def get_name(self): return 'engine' def get_route_list(self): list = ( {'rule': '/engi...
hiroki8080/Kokemomo
kokemomo/plugins/engine/controller/km_engine.py
Python
mit
1,820
#!/usr/bin/env python # -*- coding: utf-8 -*- from contextable import Contextable class Terms(Contextable): """ An address in the invoice """ def __init__(self, days, string): self.days = days self.string = string def context(self): return { 'terms': { '...
lambdal/envois
envois/terms.py
Python
mit
396
#!/usr/bin/env python3 import argparse from mygrations.mygrate import mygrate # argument parsing parser = argparse.ArgumentParser() parser.add_argument( 'command', nargs='?', default='version', choices=['version', 'apply', 'check', 'import', 'plan', 'plan_export'], help='Action to execute (default...
cmancone/mygrations
mygrate.py
Python
mit
795
#!/usr/local/bin/ python3 ''' Functions for releasing GENIE consortium releases ''' import logging import math import os import re import subprocess import time import pandas as pd import synapseclient import synapseutils from . import process_functions logging.basicConfig(level=logging.INFO) logger = logging.getLog...
thomasyu888/Genie
genie/database_to_staging.py
Python
mit
65,496
CONFIG_SCREEN = 'config' RUNNING_SCREEN = 'running' SUCCESS_SCREEN = 'success' ERROR_SCREEN = 'error'
lrq3000/pyFileFixity
pyFileFixity/lib/gooey/gui/windows/views.py
Python
mit
111
import socket import os import subprocess from subprocess import Popen, PIPE, STDOUT import time import RPi.GPIO as GPIO # timer triggers webcam to take image time.sleep (60) os.system('fswebcam --no-banner haikucam.jpg') # save record of image #time2 = time.time() #filename = "/Users/rollasoul/denseca...
rollasoul/toku
toku_pi_client.py
Python
mit
1,443
import pytest from app.utils import user_has_permissions from app.main.views.index import index from werkzeug.exceptions import Forbidden, Unauthorized from flask import request def _test_permissions( client, usr, permissions, service_id, will_succeed, any_=False, admin_override=False, ): ...
gov-cjwaszczuk/notifications-admin
tests/app/main/test_permissions.py
Python
mit
3,760
import matplotlib, numpy import CoolProp Props = CoolProp.CoolProp.Props from scipy.optimize import newton def SimpleCycle(Ref,Te,Tc,DTsh,DTsc,eta_a,Ts_Ph='Ph',skipPlot=False,axis=None): """ This function plots a simple four-component cycle, on the current axis, or that given by the optional parameter *axis* ...
ibell/coolprop
wrappers/Python/CoolProp/Plots/SimpleCycles.py
Python
mit
13,341
#Euclidean path planning control with Kalman filter for localization import time import cv2 from ev3control.rpc import Robot from rick.controllers import * from rick.A_star_planning import * from rick.core import State from rick.core import main_loop from rick.async import AsyncCamera from rick.utils import TrackerWra...
TheCamusean/DLRCev3
scripts/benchmarks/demo3.py
Python
mit
27,312
import os import unittest import mutagen import shutil import audio_pipeline.test.References as ref from . import TestUtil from ..util import format vorbis_files = dict(t1=os.path.join(ref.format_testing_audio, "t1.flac"), picard=os.path.join(ref.format_testing_audio, "picard.flac"), ...
hidat/audio_pipeline
audio_pipeline/test/TagFormatTest.py
Python
mit
12,551
#!/usr/bin/python3 """uploader.py: upload WARC files toward the Internet Archive rsync mode (RSYNC_URL set): upload everything to an rsync endpoint such as fos. s3 mode (S3_URL set): upload everything directly to the Internet Archive """ from __future__ import print_function import os import time import subproces...
Asparagirl/ArchiveBot
uploader/uploader.py
Python
mit
9,855
#!/usr/bin/python import numpy from random import random from keras.models import Sequential from keras.layers import Dense from keras.layers import Dropout from keras.layers import LSTM from keras.callbacks import ModelCheckpoint from keras.utils import np_utils from sys import argv from sys import stdout from sys imp...
k3170makan/PyMLProjects
payloads/promethea.py
Python
mit
4,704
# /usr/bin/env python ''' Written by Kong Xiaolu and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md ''' import os import numpy as np import torch import CBIG_pMFM_basic_functions as fc def CBIG_mfm_validation_desikan_main(gpu_index=0, subject=1): ''' This function is to v...
ThomasYeoLab/CBIG
stable_projects/fMRI_dynamics/Kong2021_pMFM/part2_pMFM_control_analysis/Individual_analysis/scripts/CBIG_pMFM_step5_validation_IndividualGrad.py
Python
mit
3,061
import logging from pprint import pprint from flask_wtf import Form from wtforms import IntegerField, BooleanField from flask import Blueprint, send_from_directory from flask import Flask, redirect, url_for, session, request, jsonify, g,\ make_response, Response, render_template from werkzeug.utils ...
RealTimeWeb/Blockpy-Server
controllers/services.py
Python
mit
2,386
""" Copyright (c) 2014 Brian Muller Copyright (c) 2015 OpenBazaar """ import heapq from operator import itemgetter from protos import objects class Node: def __init__(self, id, ip=None, port=None, signed_pubkey=None, vendor=False): self.id = id self.ip = ip self.port = p...
jorik041/Network
dht/node.py
Python
mit
3,684
from __future__ import print_function __author__ = "Alaleh Azhir,Peter Kerpedjiev" import collections as col import sys import argparse class GeneInfo: def __init__(self): pass def merge_gene_info(gene_infos, gene_info): """ Add a new gene_info. If it's txStart and txEnd overlap with a previou...
hms-dbmi/clodius
scripts/exonU.py
Python
mit
4,383
# -*- coding: UTF-8 -*- from base import TestCase from jinja2_maps.base import _normalize_location class Location(object): def __init__(self, **kw): for k, v in kw.items(): setattr(self, k, v) class TestBase(TestCase): def test_normalize_location_dict(self): d = {"latitude": 42....
bfontaine/jinja2_maps
tests/test_base.py
Python
mit
718
from .resource import Resource """ contentful.locale ~~~~~~~~~~~~~~~~~ This module implements the Locale class. API Reference: https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/localization :copyright: (c) 2016 by Contentful GmbH. :license: MIT, see LICENSE for more details. """ ...
contentful/contentful.py
contentful/locale.py
Python
mit
1,165
import ast class ExpressionVisitor(ast.NodeVisitor): def __init__(self, document, locals): super(ExpressionVisitor, self).__init__() self.locals = locals self.document = document self.feature_name = None self.doc = None @property def result(self): if self.f...
JohnVinyard/zounds
zounds/ui/featureparser.py
Python
mit
1,790
import numpy as np from scipy.sparse import * from sklearn.metrics.pairwise import pairwise_distances def construct_W(X, **kwargs): """ Construct the affinity matrix W through different ways Notes ----- if kwargs is null, use the default parameter settings; if kwargs is not null, ...
UltronAI/Deep-Learning
Pattern-Recognition/hw2-Feature-Selection/skfeature/utility/construct_W.py
Python
mit
17,730
from django.conf import settings import factory from pgallery.models import Gallery, Photo class UserFactory(factory.django.DjangoModelFactory): username = factory.Sequence(lambda n: "user_%d" % n) email = factory.Sequence(lambda n: "user_%d@example.com" % n) class Meta: model = settings.AUTH_U...
zsiciarz/django-pgallery
tests/factories.py
Python
mit
805
# 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-batch/azure/batch/models/pool_upgrade_os_options.py
Python
mit
3,129
from spotdl.version import __version__ from spotdl.command_line.core import Spotdl
Ritiek/Spotify-Downloader
spotdl/__init__.py
Python
mit
84
# import sys def check(answer, guess): bulls = 0 cows = 0 answer = str(answer) guess = str(guess) for x in range(0, len(answer)): # foundX = false; for y in range(0, len(guess)): if answer[x] == guess[y]: if x == y: bulls += 1 else: cows += 1 retVal = {'bulls': bulls, 'cows': cows} retu...
aninoy/cowsnbulls
checker.py
Python
mit
432
#!/usr/bin/env python3 # Copyright (c) 2020-2021 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. '''Test generateblock rpc. ''' from test_framework.test_framework import BitcoinTestFramework from test_f...
prusnak/bitcoin
test/functional/rpc_generateblock.py
Python
mit
5,595
# -*- coding: utf-8 -*- ### # (C) Copyright (2012-2017) Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limi...
HewlettPackard/python-hpOneView
examples/ethernet_networks.py
Python
mit
5,900