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
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ from setuptools import setup import os import pwd import grp import json import shlex import shutil from subprocess import Popen, PIPE from jinja2 import Environment, FileSyste...
crisidev/lbdock
setup.py
Python
gpl-2.0
8,768
# -*- coding: utf-8 -*- from uuid import UUID import itsdangerous import mock import pytest from nose.tools import * # flake8: noqa import unittest import urlparse from modularodm import Q from tests.base import ApiTestCase from osf_tests.factories import AuthUserFactory, UserFactory, ProjectFactory, Auth from api...
cwisecarver/osf.io
api_tests/users/views/test_user_list.py
Python
apache-2.0
20,062
"""Robust apply mechanism Provides a function "call", which can sort out what arguments a given callable object can take, and subset the given arguments to match only those which are acceptable. """ import inspect def function(receiver): """Get function-like callable object for given receiver returns (funct...
ofanoyi/scrapy
scrapy/xlib/pydispatch/robustapply.py
Python
bsd-3-clause
1,967
""" File mapattrs.py (3.X + 2.X) Main tool: mapattrs() maps all attributes on or inherited by an instance to the instance or class from which they are inherited. Assumes dir() gives all attributes of an instance. To simulate inheritance, uses either the class's MRO tuple, which gives the search order for new-st...
dreadrel/UWF_2014_spring_COP3990C-2507
notebooks/scripts/book_code/code/mapattrs_noslots.py
Python
apache-2.0
3,338
{ 'name': 'Web', 'category': 'Hidden', 'version': '1.0', 'description': """ OpenERP Web core module. ======================== This module provides the core of the OpenERP Web Client. """, 'depends': ['base'], 'auto_install': True, 'data': [ 'views/webclient_templates...
mycodeday/crm-platform
web/__openerp__.py
Python
gpl-3.0
450
# -*- coding: utf-8 -*- from __future__ import print_function import datetime import logging import logging.handlers import os # logging # the logger glogger = None # init default root object logging logging.basicConfig(level=logging.DEBUG, format='%(name)s %(levelname)s %(message)s', filename=os.devnull) class F...
bnomis/pyf
pyf/logger.py
Python
mit
2,845
__author__ = "Johannes Köster" __copyright__ = "Copyright 2015, Johannes Köster" __email__ = "koester@jimmy.harvard.edu" __license__ = "MIT" import os import mimetypes import base64 import textwrap import datetime import io from docutils.parsers.rst.directives.images import Image, Figure from docutils.parsers.rst imp...
vangalamaheshh/snakemake
snakemake/report.py
Python
mit
3,806
# # peepdf is a tool to analyse and modify PDF files # http://peepdf.eternal-todo.com # By Jose Miguel Esparza <jesparza AT eternal-todo.com> # # Copyright (C) 2011-2014 Jose Miguel Esparza # # This file is part of peepdf. # # peepdf is free software: you can redistribute it and/or modify # ...
MeteorAdminz/viper
viper/modules/peepdf/PDFCore.py
Python
bsd-3-clause
332,692
#!/usr/bin/env python #encoding=utf8 RMSE_ACC = r"""<b>Stopping criteria</b>\n <b><i>Accuracy on training set</i></b> Accuracy on learning set must be bigger than specified real number from interval [0,1] (if equals to 0, this parameter is not used at all) and\n <b><i>Accuracy on validation set</i></b>...
MiraHead/mlmvn
src/gui/learning_descriptions.py
Python
gpl-2.0
2,693
#!/usr/bin/env python from signal import SIGINT, SIGKILL import os import re from servicemanager import subprocess def kill_pid(context, pid, force=False): if _is_system_or_smserver_or_test_process(pid): return "Not allowed to kill system, test or smserver process (pid = %d)" % pid try: if ...
lesjoneshmrc/service-manager
servicemanager/smprocess.py
Python
apache-2.0
6,014
''' The settings for OSMC are handled by the OSMC Settings Addon (OSA). In order to more easily accomodate future changes and enhancements, each OSMC settings bundle (module) is a separate addon. The module can take the form of an xbmc service, an xbmc script, or an xbmc module, but it must be installed into the u...
indie1982/osmc-fixes
package/mediacenter-addon-osmc/src/script.module.osmcsetting.logging/resources/osmc/OSMCSetting.py
Python
gpl-2.0
8,907
import logging import knuckle import ui log = logging.getLogger("test_window") logging.basicConfig(level=logging.INFO) class Sheet(ui.Widget): def __init__(self, ui): super(Sheet, self).__init__(ui, 0, 0, 120, 60) self.dirty = True def render(self): self.surface.clear() col...
chris-statzer/knuckle-python
tests/test_generate_ref_sheet.py
Python
mit
1,029
import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * generator = cms.EDFilter("Pythia8GeneratorFilter", maxEventsToPrint = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0)...
tuos/RpPb2015Analysis
omegaXi/genSim/Pythia8_OmegaXi_pp_TuneCUETP8M1_5020GeV_cff.py
Python
mit
1,535
import copy import logging import numpy import theano from theano import tensor from theano.gradient import disconnected_grad from blocks.bricks import ( Bias, Identity, Initializable, MLP, Tanh, Softmax, Random) from blocks.bricks.attention import SequenceContentAttention from blocks.bricks.base import applicati...
rizar/actor-critic-public
lvsr/bricks/recognizer.py
Python
mit
38,728
# 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 ...
rjschwei/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/models/usage.py
Python
mit
1,680
# Generated by Django 3.0.4 on 2020-10-12 14:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('salesforce', '0057_partner_instructional_level_k12'), ] operations = [ migrations.AddField( model_name='partner', na...
openstax/openstax-cms
salesforce/migrations/0058_auto_20201012_0946.py
Python
agpl-3.0
1,662
#----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this softwa...
NullScope/BorderlessStone
tests/basic/test_option_verbose.py
Python
lgpl-3.0
494
import collectd from numpy.random import poisson, normal, choice from collections import Counter, defaultdict, namedtuple """ This collectd plugin provides a crappy model of a busy-ish e-commerce site that attracts around 200k sessions a day, with a 0.5% conversion rate. To do that, they display around 1M web pages, ...
madedotcom/riemann_workshop
collectd/root/opt/python_plugins/made_web_traffic.py
Python
mit
4,525
from __future__ import print_function from keras.datasets import mnist from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D from keras.layers.advanced_activations import LeakyReLU from keras.layers.convolution...
sofiane87/lasagne-GAN
acgan/acgan.py
Python
mit
8,939
"""Inference in propositional logic""" from __future__ import print_function, division from sympy.logic.boolalg import And, Not, conjuncts, to_cnf from sympy.core.compatibility import ordered from sympy.core.sympify import sympify def literal_symbol(literal): """ The symbol in this literal (without the negat...
Arafatk/sympy
sympy/logic/inference.py
Python
bsd-3-clause
7,641
try: from StringIO import StringIO except ImportError: from io import StringIO from inspect import isgenerator class Element(object): tag = '' self_closing = False def __init__(self, *children, **attrs): if children and isinstance(children[0], dict): self.attrs = children[0] ...
russiancow/stag
stag/base.py
Python
mit
1,436
#!/usr/bin/python2.5 # # Copyright 2009 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
jamslevy/gsoc
app/soc/logic/helper/timeline.py
Python
apache-2.0
2,896
"""This module contains the general information for CommKvm ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class CommKvmConsts: pass class CommKvm(ManagedObject): """This is CommKvm class.""" consts = CommKvmCon...
ragupta-git/ImcSdk
imcsdk/mometa/comm/CommKvm.py
Python
apache-2.0
5,785
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
dayatz/taiga-back
taiga/projects/contact/services.py
Python
agpl-3.0
2,064
#!/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...
lociii/googleads-python-lib
examples/adspygoogle/adwords/v201309/optimization/estimate_keyword_traffic.py
Python
apache-2.0
4,217
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import from testutil.dott import feature, sh, testtmp # noqa: F401 feature.require(["symlink"...
facebookexperimental/eden
eden/scm/tests/test-dirstate-symlink-t.py
Python
gpl-2.0
791
import Tkinter as tk # Import style from . import theme style_statusbar_normal = {"height": 25, "bg": theme.color3} style_status_normal = {"fg": theme.font2["color"], "font": theme.font2["type"], "bg": theme.color3} style_taskstatus_normal = style...
karimbahgat/Tk2
tk2/_frompygis/statusbar.py
Python
mit
3,382
# -*- coding: utf-8 -*- # This is a Python open source project for migration of modules # and functions from GestionPyme and other ERP products from Sistemas # Ágiles. # # Copyright (C) 2012 Sistemas Ágiles. # # This program is free software: you can redistribute it and/or modify # it under the terms o...
reingart/gestionlibre.gui
controllers/default.py
Python
agpl-3.0
10,997
GROUPS_INDEX_URL = 'horizon:admin:groups:index' GROUPS_INDEX_VIEW_TEMPLATE = 'admin/groups/index.html' GROUPS_CREATE_URL = 'horizon:admin:groups:create' GROUPS_CREATE_VIEW_TEMPLATE = 'admin/groups/create.html' GROUPS_UPDATE_URL = 'horizon:admin:groups:update' GROUPS_UPDATE_VIEW_TEMPLATE = 'admin/groups/update.html' GRO...
Havate/havate-openstack
proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/admin/groups/constants.py
Python
apache-2.0
635
from flatland import String, signals from flatland.schema.base import NotEmpty from flatland.validation import ( Converted, NoLongerThan, Present, ) def test_validator_validated(): sentinel = [] def listener(sender, **kw): kw['sender'] = sender sentinel.append(kw) signals.val...
mbr/flatland0
tests/validation/test_signals.py
Python
mit
1,454
#! /usr/bin/env python # -*- coding: utf-8 -*- # S.D.G """ Test the resources module of the package """ # Imports import unittest from unittest.mock import mock_open, patch import nnet.resources as resources import os import pandas import numpy as np from collections import OrderedDict import random __author__ = 'Be...
benjohnston24/scaling-pancake
nnet/tests_unit/test_resources.py
Python
mpl-2.0
8,019
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
listyque/TACTIC-Handler
thlib/side/client/tactic_client_lib/application/common/node_data.py
Python
epl-1.0
3,360
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
kwminnick/rackspace-dns-cli
dnsclient/openstack/common/setup.py
Python
apache-2.0
12,670
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor class TumblrIE(InfoExtractor): _VALID_URL = r'http://(?P<blog_name>.*?)\.tumblr\.com/(?:post|video)/(?P<id>[0-9]+)(?:$|[/?#])' _TESTS = [{ 'url': 'http://tatianamaslanydaily.tumblr.com/post/54...
marxin/youtube-dl
youtube_dl/extractor/tumblr.py
Python
unlicense
2,338
#!/usr/bin/env python3 # The MIT License (MIT) # # Copyright (c) 2013-2016 Benedikt Schmitt <benedikt@benediktschmitt.de> # # 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 restrictio...
WhatsCS/TS3-Bot
lib/ts3/commands.py
Python
bsd-3-clause
128,545
import mock from tests.compat import unittest from tests.utils import APITestCase import evelink.eve as evelink_eve class EVETestCase(APITestCase): def setUp(self): super(EVETestCase, self).setUp() self.eve = evelink_eve.EVE(api=self.api) def test_character_names_from_ids(self): sel...
Morloth1274/EVE-Online-POCO-manager
tests/test_eve.py
Python
mit
20,398
""" ######################################################################### Author: Vijay Dhameliya Project: DNA Cloud Graduate Mentor: Dixita Limbachya Mentor: Prof. Manish K Gupta Date: 28 July 2013 Website: www.guptalab.org/dnacloud This file contains implementation of various compression techniques. #############...
guptalab/dnacloud
source/compression.py
Python
mit
4,208
#!/usr/bin/env python ''' sweety.util @author: Chris Chou <m2chrischou AT gmail.com> @description: ''' import datetime import getpass import os import random import shutil import sys #import traceback os_name = os.name if os_name == 'posix': import fcntl def column_name2index(columns, header): newcols = [] ...
mongmong/python-sweety
src/sweety/util.py
Python
bsd-2-clause
4,052
__version__ = "1.2.0" __version_info__ = tuple([int(num) for num in __version__.split('.')])
lama7/blogtool
blogtool/__version__.py
Python
mit
93
#!/usr/bin/env python ''' Created March, 2012 @author: Peter Heim r_shoulder.py - gateway to Arduino based arm controller Copyright (c) 2011 Peter Heim. All right reserved. Borrowed heavily from Mike Feguson's ArbotiX base_controller.py code. Redistribution and use in source and binary forms, with or withou...
peterheim1/robbie
bin/left_arm.py
Python
gpl-3.0
21,566
# Copyright 2013
vaderyang/aqichina
django/aqichina/__init__.py
Python
gpl-3.0
18
""" The API basically only provides one class. You can create a :class:`Script` and use its methods. Additionally you can add a debug function with :func:`set_debug_function` and catch :exc:`NotFoundError` which is being raised if your completion is not possible. """ from __future__ import with_statement import re im...
stevenbaker/dotfiles
.vim/bundle/jedi-vim/jedi/jedi/api.py
Python
mit
25,679
from __future__ import absolute_import, division, print_function import collections import tempfile import os import logging import sys import string import time as ttime import uuid from datetime import date, timedelta import itertools from databroker import (wrap_in_doct, wrap_in_deprecated_doct, ...
ericdill/databroker
databroker/tests/test_broker.py
Python
bsd-3-clause
37,806
# Cryptomath Module # http://inventwithpython.com/hacking (BSD Licensed) from random import randrange def gcd(a, b): # Return the GCD of a and b using Euclid's Algorithm while a != 0: a, b = b % a, a return b def find_mod_inverse(a, m): # Returns the modular inverse of a % m, which is #...
shakirjames/crypto
ciphers/cryptolib/cryptomath.py
Python
bsd-2-clause
2,008
""" sentry.utils ~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from django.utils.encoding import force_unicode import six def to_unicode(value): try: value = six.text_type(...
wujuguang/sentry
src/sentry/utils/__init__.py
Python
bsd-3-clause
770
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2013 Zuza Software Foundation # Copyright 2014 Evernote Corporation # # This file is part of Pootle. # # Pootle is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # F...
evernote/pootle
pootle/settings.py
Python
gpl-2.0
1,208
# Copyright (c) 2014, the GREAT3 executive committee (http://www.great3challenge.info/?q=contacts) # 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...
barnabytprowe/great3-public
inputs/optical-psfs/ground_optical_psf_example.py
Python
bsd-3-clause
2,931
import pytest from cdisutilstest.code.indexd_fixture import ( create_random_index, create_random_index_version, ) from requests import HTTPError def test_instantiate(index_client): baseid = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" urls = ["s3://url/bucket/key"] urls_metadata = {url: {"state": "doing...
LabAdvComp/indexclient
tests/test_client.py
Python
apache-2.0
6,494
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2014-2015 Bitergia # # 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 la...
pombredanne/sortinghat
tests/test_cmd_unify.py
Python
gpl-3.0
8,483
""" Package for navigation classes """ from components import ( STDMAction, STDMListWidgetItem, DEPARTMENT, MUNICIPALITY, MUNICIPALITY_SECTION, LOCALITY ) from .container_loader import QtContainerLoader from signals import STDMContentSignal from treeloader import TreeSummaryLoader ...
olivierdalang/stdm
navigation/__init__.py
Python
gpl-2.0
563
# Copyright 2019 DeepMind Technologies Limited. # # 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 agre...
deepmind/labmaze
labmaze/assets/assets_test.py
Python
apache-2.0
2,022
#!/bin/python from . import halt, Settings, interface from time import sleep import random from threading import Thread from .evolution_generations import Generations import datetime import os import waitress import promoterz from version import VERSION def launchWebEvolutionaryInfo(): print("WEBSERVER MOD...
Gab0/gekkoJaponicus
japonicus/japonicus.py
Python
mit
5,398
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
Endika/account-invoice-reporting
invoice_report_assemble/res_config.py
Python
agpl-3.0
1,813
# --input_dir=/home/torch/cleverhans/toolkit/dataset/images --output_dir=output --max_epsilon=16 from os.path import join import numpy as np from os import listdir import argparse import pandas as pd from time import time from custom_nets import InceptionV3, preprocess_input from keras.layers import Input, ...
alexander-rakhlin/NIPS-2017-Adversarial-contests
Targeted Adversarial Attack/attack_tgt.py
Python
mit
8,899
import Tkinter from time import sleep from time import strftime import heatmap import os SAMPLE_INTERVAL = 0.05 # How often, in seconds, to poll the cursor position # Thanks rectangletangle cursor = Tkinter.Tk() # Thanks mouad screenWidth = cursor.winfo_screenwidth() screenHeight = cursor.winfo_screen...
kittsville/Charsor
charsor.py
Python
gpl-2.0
1,802
#!/usr/bin/env python import time import logging from evento import Event from py2030.base_component import BaseComponent try: from rtmidi.midiutil import open_midiport except ImportError as err: logging.getLogger(__name__).warning("Importing of rtmidi.midiutil failed, MidiInput component will not work.") ...
markkorput/py2030
py2030/components/midi_input.py
Python
mit
3,942
# Copyright 2020 Google # # 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, soft...
quantumlib/ReCirq
recirq/hfvqe/analysis_test.py
Python
apache-2.0
6,819
#!/usr/bin/env python #-*- coding: utf-8 -*- ########################################################################### ## ## ## Copyrights Frédéric Rodrigo 2012 ## ## ...
naoliv/osmose-backend
analysers/analyser_osmosis_useless.py
Python
gpl-3.0
4,414
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com from pyvows import Vows, expect from tornado_pyvows.context import To...
wking/thumbor
vows/healthcheck_vows.py
Python
mit
1,666
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'UserProfile' db.create_table(u'techpong_userprofile', ( (u'id', self.gf('django....
collingreen/startuppong
techpong/apps/techpong/migrations/0001_initial.py
Python
mit
10,155
# -*- coding: utf-8 -*- ############################################################################## # 2013 E2OpenPlugins # # # # This file is open source software; you can redistribute...
svox1/e2openplugin-OpenWebif
plugin/controllers/AT.py
Python
gpl-2.0
2,252
#!/usr/bin/env python # -*- coding: utf-8 -*- ##This file is part of pySequence ############################################################################# ############################################################################# ## ## ## ...
codedude/pySequence
src/Referentiel.py
Python
gpl-3.0
81,736
import pytest class TestSetquota: @pytest.mark.complete("setquota ") def test_1(self, completion): assert completion @pytest.mark.complete("setquota -", require_cmd=True) def test_2(self, completion): assert completion
algorythmic/bash-completion
test/t/test_setquota.py
Python
gpl-2.0
254
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'ActionItem', fields ['name', 'object_id', 'user'] db.delete_unique(u'dashbo...
chirilo/remo
remo/dashboard/migrations/0003_auto__del_unique_actionitem_name_object_id_user.py
Python
bsd-3-clause
5,007
# The plot server must be running # Go to http://localhost:5006/bokeh to view this plot from collections import OrderedDict from math import log, sqrt import numpy as np import pandas as pd from six.moves import cStringIO as StringIO from bokeh.plotting import figure, show, output_server antibiotics = """ bacteria,...
akloster/bokeh
examples/plotting/server/burtin.py
Python
bsd-3-clause
4,826
from random import randint from dictutil import * def movie_review(name): """ Input: the name of a movie Output: a string (one of the review options), selected at random using randint """ review_options = ["See it!", "A gem!", "Ideological claptrap!"] return ... def makeInverseIndex(strlist)...
ahmetus/coding-the-matrix-docs
Code-The-Matrix/labs/inverse_index_lab.py
Python
mit
1,198
# -*- coding: utf-8 -*- # -------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2014 Jonathan Labéjof <jonathan.labejof@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation fi...
b3j0f/stap
b3j0f/__init__.py
Python
mit
1,444
#!/usr/bin/python from __future__ import print_function import argparse import gzip import os import radix import re import sys from bz2 import BZ2File from datetime import datetime, timedelta from multiprocessing import Process, Queue, cpu_count from netaddr import IPSet, IPNetwork # own imports import mrtx verbo...
smlng/bgp-stats
src/python/bgp-rib-diffs.py
Python
mit
10,243
# -*- coding: utf-8 -*- from django.db import models from django import forms from bellum.register.models import Account
piotrmaslanka/bellum
uprofile/models.py
Python
agpl-3.0
120
# Copyright 2020 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...
keras-team/keras
keras/layers/preprocessing/integer_lookup.py
Python
apache-2.0
20,088
# coding=utf-8 from atlassian import Jira # This example shoes how to copy custom field value from on issue to another # define custom field id, in notation customfield_id custom_field_id = "customfield_102589" source_issue_key = "TST-1" destination_issue_key = "TST-2" jira = Jira(url="http://localhost:8080", userna...
AstroTech/atlassian-python-api
examples/jira/jira_custom_field_value_swaper.py
Python
apache-2.0
750
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-06-16 15:24 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('market', '0001_initial'), ] operations = [ migrations.AlterField( ...
manongbang/btc-hedge
web/btc_hedge/market/migrations/0002_auto_20170616_1524.py
Python
mit
1,051
# Copyright 2014, Jeff Buttars, A10 Networks. # # 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 appli...
sasukeh/acos-client
acos_client/v30/slb/virtual_port.py
Python
apache-2.0
3,458
"""Tests for the Google Assistant integration.""" DEMO_DEVICES = [{ 'id': 'light.kitchen_lights', 'name': { 'name': 'Kitchen Lights' }, 'traits': [ 'action.devices.traits.OnOff', 'action.devices.traits.Brightness', 'action.devices.traits.ColorSetting', ], 'type': ...
jnewland/home-assistant
tests/components/google_assistant/__init__.py
Python
apache-2.0
6,319
from com.puffinware.pistat.models import Category from com.puffinware.pistat.helpers import NavHelper from flask import render_template, request, redirect, url_for from logging import getLogger log = getLogger(__name__) def setup_routes(app, **kwargs): @app.route('/config/category', methods=['POST', 'GET']) def ...
PuffinWare/pistat
com/puffinware/pistat/category.py
Python
gpl-3.0
1,350
# Copyright (C) 2012-2015 Codethink Limited # # 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 hope that it will be useful, # but...
nuxeh/morph
morphlib/buildsystem.py
Python
gpl-2.0
7,520
# -*- 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 model 'Pending' db.create_table(u'usrman_pending', ( ...
katsuya94/CollegeCareerPlanner
usrman/migrations/0001_initial.py
Python
mit
4,373
from __future__ import division import numpy as np # Author: Dan Roth # E-mail: Daniel.Edward.Roth@gmail.com # Date: Nov 2013 def minimize(func, T, a, c, npart, i): """Find the minimum of a function in the range [a,c]; return a tuple (abscissa, ordinate). func is grand free energy, a function of T, n and s...
droundy/deft
papers/thesis-roth/figs/minmax_RG.py
Python
gpl-2.0
2,166
# # Copyright (C) 2003,2004 Norwegian University of Science and Technology # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License version 2 as published by the Free # Software Foundation. # ...
sigmunau/nav
python/nav/statemon/checker/OracleChecker.py
Python
gpl-2.0
3,132
from .context import CorpusContext from .audio import AudioContext from .importable import ImportContext from .lexical import LexicalContext from .pause import PauseContext from .utterance import UtteranceContext from .structured import StructuredContext from .syllabic import SyllabicContext from .spoken import Spoken...
samihuc/PolyglotDB
polyglotdb/corpus/__init__.py
Python
mit
328
import random import clsmath class Spawnpoint(object): def __init__(self, data): # not needed but useful for debugging self.spawnpoint_id = data.get('spawnpoint_id') or data.get('sid') self.position = (float(data['lat']), float(data['lng'])) self.time = data['time'] def ser...
pretsell/PokemonGo-Map
pogom/cluster.py
Python
agpl-3.0
4,302
from yowsup.layers.protocol_acks.protocolentities.ack import AckProtocolEntity from yowsup.structs import ProtocolTreeNode from yowsup.structs.protocolentity import ProtocolEntityTest class AckProtocolEntityTest(ProtocolEntityTest): def setUp(self): self.ProtocolEntity = AckProtocolEntity self.node...
felix-dumit/campusbot
yowsup2/yowsup/layers/protocol_acks/protocolentities/test_ack.py
Python
mit
400
from djangoautoconf.auto_conf_admin_tools.admin_feature_base import AdminFeatureBase __author__ = 'weijia' class FilterHorizontalFeature(AdminFeatureBase): """ Use horizontal filter for foreign key attributes instead of multiple select box """ def __init__(self, fields): """ Init the ...
weijia/djangoautoconf
djangoautoconf/auto_conf_admin_tools/filter_horizontal_feature.py
Python
bsd-3-clause
739
# System imports import os from os.path import join import pytest from git import * from PyGitUp.git_wrapper import UnstashError from PyGitUp.tests import basepath, write_file, init_master, testfile_name test_name = 'unstash_error' repo_path = join(basepath, test_name + os.sep) def setup(): master_path, master ...
msiemens/PyGitUp
PyGitUp/tests/test_unstash_error.py
Python
mit
1,118
import bluetooth bd_addr = "01:23:45:67:89:AB" port = 1 sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM ) sock.connect((bd_addr, port)) sock.send("hello!!") sock.close()
janague/MSWL_Development_Tools
examples/ApplicationMobility/rfcomm-client.py
Python
bsd-2-clause
176
from bears.c_languages.CPPCleanBear import CPPCleanBear from coalib.testing.LocalBearTestHelper import verify_local_bear good_file = """ int main() { return 0; } """ bad_file = """ int global_var = 3; int main() { return 0; } """ CPPCleanBearTest = verify_local_bear(CPPCleanBear, ...
horczech/coala-bears
tests/c_languages/CPPCleanBearTest.py
Python
agpl-3.0
422
#!/usr/bin/env python ## Copyright (C) 2005-2006 Graham I Cummins ## 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 option) any later version. ##...
gic888/MIEN
parsers/matfile.py
Python
gpl-2.0
5,270
# -*- coding: utf-8 -*- __all__ = ['client', 'queue', 'server', 'utils', 'log'] __version__ = '0.5.2' # Try to import SimpleJSON from a couple of different sources. try: import simplejson as json except ImportError: try: import json except ImportError: raise ImportError('Looks like you nee...
zacharyvoase/zenqueue
zenqueue/__init__.py
Python
mit
346
# Copyright (C) 2012 Alex Nitz # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the h...
tjma12/pycbc
pycbc/events/threshold_cuda.py
Python
gpl-3.0
8,578
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
cprov/snapcraft
tests/integration/lifecycle/test_snap.py
Python
gpl-3.0
9,850
# -*- coding: utf-8 -*- # Copyright(C) 2010 Nicolas Duhamel # # 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 of the License. # # This program is distributed in the hope that it will...
jocelynj/weboob
weboob/backends/canalplus/backend.py
Python
gpl-3.0
2,271
import asyncio import datetime import logging from asyncio import ( AbstractEventLoop, StreamReader, StreamWriter, FIRST_COMPLETED, ) from collections import defaultdict from typing import List, Dict, Optional, Sequence from jsonget import JsonValue from evtstrd.config import Config from evtstrd.filte...
srittau/eventstreamd
evtstrd/dispatcher.py
Python
mit
3,551
from devp2p.peermanager import PeerManager from devp2p.discovery import NodeDiscovery from devp2p.app import BaseApp from pyethapp.eth_service import ChainService from pyethapp.jsonrpc import JSONRPCServer from pyethapp.db_service import DBService from pyethapp import config import tempfile import copy import pytest ...
changwu-tw/pyethapp
pyethapp/tests/test_config.py
Python
mit
2,862
# # Copyright (c) 2013-2018 Quarkslab. # This file is part of IRMA project. # # 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 in the top-level directory # of this distribution and at: # # http:...
quarkslab/irma
probe/modules/antivirus/sophos/sophos.py
Python
apache-2.0
4,084
import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name = "isotoma-cmsplugin-filer", version = "0.1.0", url = 'http://github.com/isotoma/cmsplugin-filer', license = 'BSD', description = "django-cms pl...
isotoma/cmsplugin-filer
setup.py
Python
bsd-3-clause
1,081
#!/usr/bin/env python import json, io, re class Country(object): def __init__(self, name, population, gdp, censusYear, perimeter): self.name = name self.parent = "Earth" self.impl = "gaiasky.scenegraph.Area" self.ct = [ "Countries" ] self.population = population sel...
langurmonkey/gaiasky
core/scripts/other/countries-conv.py
Python
mpl-2.0
2,521
import inspect import json from django import forms from django.forms import widgets from django.utils.module_loading import import_string from django.utils.translation import ugettext_lazy as _ from eth_utils import add_0x_prefix, event_abi_to_log_topic, is_hex_address from web3 import Web3 from .chainevents impor...
artemistomaras/django-ethereum-events
django_ethereum_events/forms.py
Python
mit
3,011
__version__ = '0.4'
acrosby/pyoos
pyoos/__init__.py
Python
gpl-3.0
19
#!/usr/bin/python # ex:set fileencoding=utf-8: from __future__ import unicode_literals from djangobmf.serializers import ModuleSerializer from rest_framework import serializers class WarehouseSerializer(ModuleSerializer): class Meta: fields = ( 'name', ) class LocationSerializer(...
django-bmf/django-bmf
djangobmf/contrib/location/serializers.py
Python
bsd-3-clause
507
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
Southpaw-TACTIC/TACTIC
src/pyasm/web/web_state.py
Python
epl-1.0
2,617