repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
oskar456/youtube-dl
refs/heads/master
youtube_dl/extractor/vrak.py
61
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from .brightcove import BrightcoveNewIE from ..utils import ( int_or_none, parse_age_limit, smuggle_url, unescapeHTML, ) class VrakIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?vrak\.tv/vid...
ingadhoc/odoo
refs/heads/8.0
addons/l10n_do/__openerp__.py
309
# -*- coding: utf-8 -*- # ############################################################################# # # First author: Jose Ernesto Mendez <tecnologia@obsdr.com> (Open Business Solutions SRL.) # Copyright (c) 2012 -TODAY Open Business Solutions, SRL. (http://obsdr.com). All rights reserved. # # This is a fork to upg...
The-Compiler/pytest
refs/heads/master
testing/io/test_wcwidth.py
15
import pytest from _pytest._io.wcwidth import wcswidth from _pytest._io.wcwidth import wcwidth @pytest.mark.parametrize( ("c", "expected"), [ ("\0", 0), ("\n", -1), ("a", 1), ("1", 1), ("א", 1), ("\u200B", 0), ("\u1ABE", 0), ("\u0591", 0), ...
wdwvt1/qiime
refs/heads/master
qiime/split_libraries.py
12
#!/usr/bin/env python # file split_libraries.py """Performs preprocessing steps for barcoded library analysis, e.g. 454. Specifically, does the quality-filtering step (using several criteria) and renames each read with the appropriate library id. This module reads the linker+primer sequence from the input mapping fi...
welex91/ansible-modules-core
refs/heads/devel
cloud/rackspace/rax_queue.py
157
#!/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...
erdinc-me/GmailURLParser
refs/heads/master
sub/extractors.py
1
# -*- coding: utf-8 -*- __project_name__ = 'GmailURLParser' __author__ = 'Erdinç Yılmaz' __date__ = '10/22/14' # import lxml.html from lxml.html import fromstring import re # from bs4 import BeautifulSoup # #-------------------------------------------------------------------------- # def extract_links_bs4(message...
mpasternak/dojango-datable
refs/heads/master
test_project/test_app/tests.py
1
# from django.test import TestCase from django.core.urlresolvers import reverse from django.test.client import Client from datable.testutil import TestPageWithDatableMixin class TestBooks(TestPageWithDatableMixin, TestCase): tableName = 'first_table' urlName = 'books_demo' def setUp(self...
ivanyu/rosalind
refs/heads/master
algorithmic_heights/sc/sc.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def main(argv): from sc_logic import check_semi_connectedness graphs = [] if len(argv) < 2: print('k = 2') k = 2 print('Graph 1:') print('n = 3') n = 3 print('m = 2') m = 2 g = [[0 for i in ran...
dati91/servo
refs/heads/master
tests/wpt/web-platform-tests/fetch/api/resources/method.py
161
def main(request, response): headers = [] if "cors" in request.GET: headers.append(("Access-Control-Allow-Origin", "*")) headers.append(("Access-Control-Allow-Credentials", "true")) headers.append(("Access-Control-Allow-Methods", "GET, POST, PUT, FOO")) headers.append(("Access-Co...
kindersung/servo
refs/heads/master
tests/wpt/web-platform-tests/fetch/nosniff/resources/worker.py
219
def main(request, response): type = request.GET.first("type", None) content = "// nothing to see here" content += "\n" content += "this.postMessage('hi')" response.add_required_headers = False response.writer.write_status(200) response.writer.write_header("x-content-type-options", "nosniff...
PXke/invenio
refs/heads/dev-pu
invenio/celery/registry.py
4
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) a...
davgibbs/django
refs/heads/master
tests/validation/test_validators.py
320
from __future__ import unicode_literals from . import ValidationTestCase from .models import ModelToValidate class TestModelsWithValidators(ValidationTestCase): def test_custom_validator_passes_for_correct_value(self): mtv = ModelToValidate(number=10, name='Some Name', f_with_custom_validator=42) ...
uppsaladatavetare/foobar-api
refs/heads/develop
src/foobar/migrations/0020_auto_20170302_1359.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-02 13:59 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('foobar', '0019_auto_20170221_1547'), ] operations = [ migrations.AlterField...
FabianKnapp/nexmon
refs/heads/master
buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/arm-none-eabi/lib/armv7e-m/softfp/libstdc++.a-gdb.py
6
# -*- python -*- # Copyright (C) 2009-2015 Free Software Foundation, Inc. # 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 versio...
Validus-Kernel/kernel_oneplus2
refs/heads/cm-13.0
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
wuhengzhi/chromium-crosswalk
refs/heads/master
third_party/WebKit/Source/devtools/scripts/generate_protocol_externs.py
15
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list ...
fmaschler/networkit
refs/heads/SCD-weighted
networkit/algebraic.py
2
""" This module deals with the conversion of graphs into matrices and linear algebra operations on graphs """ __author__ = "Christian Staudt" # local imports # external imports try: import scipy.sparse except ImportError: print("module 'scipy' not available -- some functionality will be restricted") try: import ...
jgeskens/django
refs/heads/master
django/contrib/gis/admin/__init__.py
637
# Getting the normal admin routines, classes, and `site` instance. from django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin, StackedInline, TabularInline, HORIZONTAL, VERTICAL # Geographic admin options classes and widgets. from django.contrib.gis.admin.options import GeoModelAdmin from django.contri...
t794104/ansible
refs/heads/devel
lib/ansible/modules/identity/ipa/ipa_sudocmd.py
74
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # 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', ...
josepedro/acidentes_em_rodovias_refatoracao
refs/heads/master
acidentes_em_rodovias/manage.py
1
#!/usr/bin/env python import os import sys """ ./menage.py makemessages --all After setting LOCALE_PATHS, in settings.py, this command generates one django.po for each language in the locale path. """ if __name__ == "__main__": os.environ.setdefault( "DJANGO_SETTINGS_MODULE", "acidente...
fusetools/Fuse.SublimePlugin
refs/heads/master
building.py
1
import subprocess import threading import os import sublime from .settings import getFusePathFromSettings, getSetting from .log import log class BuildManager: def __init__(self, fuseNotFoundHandler): self.builds = {} self.fuseNotFoundHandler = fuseNotFoundHandler self.previousBuildCommand = None self._closeO...
Imaginashion/cloud-vision
refs/heads/master
.fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/site-packages/requests/packages/chardet/constants.py
3007
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
piMoll/SEILAPLAN
refs/heads/master
lib/reportlab/pdfbase/pdfutils.py
1
#Copyright ReportLab Europe Ltd. 2000-2017 #see license.txt for license details #history https://hg.reportlab.com/hg-public/reportlab/log/tip/src/reportlab/pdfbase/pdfutils.py __version__='3.3.0' __doc__='' # pdfutils.py - everything to do with images, streams, # compression, and some constants import sys import os im...
Yas3r/OWASP-ZSC
refs/heads/master
lib/generator/linux_arm/exc.py
20
#!/usr/bin/env python ''' OWASP ZSC | ZCR Shellcoder ZeroDay Cyber Research Z3r0D4y.Com Ali Razmjoo ''' def run(filename): return 'N'
liamgh/liamgreenhughes-sl4a-tf101
refs/heads/master
python/src/Demo/sockets/broadcast.py
47
# Send UDP broadcast packets MYPORT = 50000 import sys, time from socket import * s = socket(AF_INET, SOCK_DGRAM) s.bind(('', 0)) s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1) while 1: data = repr(time.time()) + '\n' s.sendto(data, ('<broadcast>', MYPORT)) time.sleep(2)
arahuja/scikit-learn
refs/heads/master
sklearn/neural_network/tests/test_rbm.py
142
import sys import re import numpy as np from scipy.sparse import csc_matrix, csr_matrix, lil_matrix from sklearn.utils.testing import (assert_almost_equal, assert_array_equal, assert_true) from sklearn.datasets import load_digits from sklearn.externals.six.moves import cStringIO as ...
kadubarbosa/hydra1
refs/heads/master
mcmc_flush.py
1
# -*- coding: utf-8 -*- """ Created on Fri Oct 25 17:39:22 2013 @author: cbarbosa Delete models of MCMC """ import os import shutil from config import * if __name__ == "__main__": os.chdir(os.path.join(home, "single2")) folders = [x for x in os.listdir(".") if os.path.isdir(x)] for folder in folders: ...
hynnet/openwrt-mt7620
refs/heads/master
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_asynchat.py
94
# test asynchat import asyncore, asynchat, socket, time import unittest import sys from test import test_support try: import threading except ImportError: threading = None HOST = test_support.HOST SERVER_QUIT = 'QUIT\n' if threading: class echo_server(threading.Thread): # parameter to determine t...
dsfsdgsbngfggb/odoo
refs/heads/8.0
openerp/addons/test_converter/tests/__init__.py
259
# -*- coding: utf-8 -*- from . import test_html, test_gbf # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
erkrishna9/odoo
refs/heads/master
addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py
90
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
odooindia/odoo
refs/heads/master
addons/gamification/__openerp__.py
62
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
IsCoolEntertainment/debpkg_python-boto
refs/heads/master
boto/gs/connection.py
2
# Copyright 2010 Google Inc. # # 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 limitation the rights to use, copy, modify, merge, publish, dis- # trib...
protocol7/python-koans
refs/heads/master
python 2/koans/about_lambdas.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Based slightly on the lambdas section of AboutBlocks in the Ruby Koans # from runner.koan import * class AboutLambdas(Koan): def test_lambdas_can_be_assigned_to_variables_and_called_explicitly(self): add_one = lambda n: n + 1 self.assertEqual(11, ...
RichardLeeK/MachineLearning
refs/heads/master
img_process/tester.py
1
import sys sys.path.insert(0, 'D:/Sources/Python Source Code') import img_process.signal_to_img as si file = open('D:/Richard/CBFV/Auto-encoder/001040SE_interpolated.csv') lines = file.readlines() file.close() singal_map = {} for line in lines: sl = line.split(',') cur_sig = [] for v in sl[1:]: cur_sig.a...
nadley/Sick-Beard
refs/heads/development
bs4/builder/_htmlparser.py
120
"""Use the HTMLParser library to parse HTML files that aren't too bad.""" __all__ = [ 'HTMLParserTreeBuilder', ] from HTMLParser import ( HTMLParser, HTMLParseError, ) import sys import warnings # Starting in Python 3.2, the HTMLParser constructor takes a 'strict' # argument, which we'd like to s...
wimnat/ansible
refs/heads/devel
test/integration/targets/module_precedence/multiple_roles/bar/library/ping.py
35
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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...
TeachAtTUM/edx-platform
refs/heads/master
common/test/acceptance/tests/lms/test_lms_user_preview.py
11
# -*- coding: utf-8 -*- """ Tests the "preview" selector in the LMS that allows changing between Staff, Learner, and Content Groups. """ from textwrap import dedent from nose.plugins.attrib import attr from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc from common.test.acceptance.pa...
Schibum/sndlatr
refs/heads/master
gae/pytz/tests/test_pytz_appengine.py
1
""" Test the appengine-specific components """ import pytz import logging import unittest class pytzAppengineTest(unittest.TestCase): """ Check that loading works as expected and we see the appropriate model instances """ def test_pytz_appengine(self): "ensure we are using pytz-appengine" ...
levigross/pyscanner
refs/heads/master
mytests/django/conf/locale/cy/formats.py
433
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'g:i:s A' # DATETIME_FORMAT = # YEAR_MONTH_FORMAT =...
kevinaangstadt/rapid
refs/heads/master
test/batchSim.py
1
# Minor changes by Kevin Angstadt # to conform with rapidsim output from argparse import ArgumentParser from collections import defaultdict from os import popen from re import compile from pprint import PrettyPrinter pp = PrettyPrinter(indent=4).pprint def batchSim(ANML_file, stimulus_file, args='-e'): """Python bi...
Jorge-Rodriguez/ansible
refs/heads/devel
lib/ansible/modules/packaging/os/openbsd_pkg.py
79
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Patrik Lundin <patrik@sigterm.se> # # 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', ...
lepricon49/headphones
refs/heads/master
lib/unidecode/x063.py
252
data = ( 'Bo ', # 0x00 'Chi ', # 0x01 'Gua ', # 0x02 'Zhi ', # 0x03 'Kuo ', # 0x04 'Duo ', # 0x05 'Duo ', # 0x06 'Zhi ', # 0x07 'Qie ', # 0x08 'An ', # 0x09 'Nong ', # 0x0a 'Zhen ', # 0x0b 'Ge ', # 0x0c 'Jiao ', # 0x0d 'Ku ', # 0x0e 'Dong ', # 0x0f 'Ru ', # 0x10 'Tiao ...
huguesv/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Lib/asyncio/queues.py
11
__all__ = ('Queue', 'PriorityQueue', 'LifoQueue', 'QueueFull', 'QueueEmpty') import collections import heapq from . import events from . import locks class QueueEmpty(Exception): """Raised when Queue.get_nowait() is called on an empty Queue.""" pass class QueueFull(Exception): """Raised when the Queue...
rimbalinux/MSISDNArea
refs/heads/master
django/conf/locale/sk/formats.py
3
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'G:i:s' DATETIME_FORMAT = 'j. F Y G:i:s' Y...
makokal/funzo
refs/heads/master
docs/conf.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import sphinx_rtd_theme # sys.path.insert(0, os.path.abspath('../sphinxext')) # sys.path.insert(0, os.path.abspath('../funzo')) # sys.path.append(os.path.abspath('sphinxext')) # -- General configuration ----------------------------------------------...
affansyed/bcc
refs/heads/master
tools/execsnoop.py
1
#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports # # execsnoop Trace new processes via exec() syscalls. # For Linux, uses BCC, eBPF. Embedded C. # # USAGE: execsnoop [-h] [-t] [-x] [-n NAME] # # This currently will print up to a maximum of 19 arguments, plus the process # name, so 20 fields in t...
dfdx2/django
refs/heads/master
tests/postgres_tests/fields.py
61
""" Indirection layer for PostgreSQL-specific fields, so the tests don't fail when run with a backend other than PostgreSQL. """ from django.db import models try: from django.contrib.postgres.fields import ( ArrayField, BigIntegerRangeField, CICharField, CIEmailField, CITextField, DateRangeField, D...
DrMeers/django
refs/heads/master
django/contrib/gis/management/commands/ogrinspect.py
17
import inspect from optparse import make_option from django.contrib.gis import gdal from django.core.management.base import LabelCommand, CommandError def layer_option(option, opt, value, parser): """ Callback for `make_option` for the `ogrinspect` `layer_key` keyword option which may be an integer or a ...
YeelerG/scrapy
refs/heads/master
scrapy/contrib/linkextractors/regex.py
144
import warnings from scrapy.exceptions import ScrapyDeprecationWarning warnings.warn("Module `scrapy.contrib.linkextractors.regex` is deprecated, " "use `scrapy.linkextractors.regex` instead", ScrapyDeprecationWarning, stacklevel=2) from scrapy.linkextractors.regex import *
acarmel/CouchPotatoServer
refs/heads/master
libs/html5lib/treewalkers/pulldom.py
1729
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
poeks/twitterbelle
refs/heads/master
appengine_django/tests/core_test.py
13
#!/usr/bin/python2.4 # # Copyright 2008 Google 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...
p2pu/learning-circles
refs/heads/master
studygroups/migrations/0052_course_created_by.py
1
# -*- coding: utf-8 -*- from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('studygroups', '0051_auto_20160115_0737'), ] operations = [ migr...
Thor77/youtube-dl
refs/heads/master
youtube_dl/extractor/tunein.py
26
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ExtractorError from ..compat import compat_urlparse class TuneInBaseIE(InfoExtractor): _API_BASE_URL = 'http://tunein.com/tuner/tune/' def _real_extract(self, url): content_id = s...
googleapis/googleapis-gen
refs/heads/master
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/feed_service/transports/__init__.py
5
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Mazecreator/tensorflow
refs/heads/master
tensorflow/contrib/tensor_forest/python/ops/stats_ops.py
68
# Copyright 2017 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...
yawnosnorous/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/symtable.py
55
"""Interface to the compiler's internal symbol tables""" import _symtable from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, DEF_IMPORT, DEF_BOUND, OPT_IMPORT_STAR, SCOPE_OFF, SCOPE_MASK, FREE, LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL) import weakref __all__ = ["symtable", "SymbolTable", "C...
jsirois/pants
refs/heads/master
src/python/pants/testutil/rule_runner.py
1
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import multiprocessing import os from contextlib import contextmanager from dataclasses import dataclass from io import StringIO from pathlib import Pat...
nian0114/AGNi-pureCM-SC03E
refs/heads/pureCM-smdk4412-I930x-CM11
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
40223145c2g18/40223145
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/VFS_import.py
738
import os from browser import doc #_scripts=doc.createElement('script') #_scripts.src="/src/py_VFS.js" #_scripts.type="text/javascript" #doc.get(tag='head')[0].appendChild(_scripts) VFS=dict(JSObject(__BRYTHON__.py_VFS)) class VFSModuleFinder: def __init__(self, path_entry): print("in VFSModuleFinder") ...
guoyu07/metagoofil
refs/heads/master
hachoir_core/field/vector.py
95
from hachoir_core.field import Field, FieldSet, ParserError class GenericVector(FieldSet): def __init__(self, parent, name, nb_items, item_class, item_name="item", description=None): # Sanity checks assert issubclass(item_class, Field) assert isinstance(item_class.static_size, (int, long)) ...
ReganBell/QReview
refs/heads/master
networkx/exception.py
41
# -*- coding: utf-8 -*- """ ********** Exceptions ********** Base exceptions and errors for NetworkX. """ __author__ = """Aric Hagberg (hagberg@lanl.gov)\nPieter Swart (swart@lanl.gov)\nDan Schult(dschult@colgate.edu)\nLoïc Séguin-C. <loicseguin@gmail.com>""" # Copyright (C) 2004-2011 by # Aric Hagberg <hagberg...
wolfram74/numerical_methods_iserles_notes
refs/heads/master
venv/lib/python2.7/site-packages/IPython/utils/zmqrelated.py
4
"""Utilities for checking zmq versions.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from IPython.utils.version import check_version def check_for_zmq(minimum_version, required_by='Someone'): try: import zmq except ImportError: raise ...
bobrock/eden
refs/heads/master
modules/tests/member/__init__.py
27
from create_member import * from member_search import *
cyberark-bizdev/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/ecs_service_facts.py
7
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
Cinntax/home-assistant
refs/heads/dev
homeassistant/config_entries.py
1
"""Manage config entries in Home Assistant.""" import asyncio import logging import functools import uuid from typing import Any, Callable, List, Optional, Set import weakref import attr from homeassistant import data_entry_flow, loader from homeassistant.core import callback, HomeAssistant from homeassistant.excepti...
tillahoffmann/tensorflow
refs/heads/master
tensorflow/contrib/gan/python/features/python/clip_weights.py
74
# Copyright 2017 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...
tqtran7/horizon
refs/heads/master
openstack_dashboard/dashboards/project/firewalls/tabs.py
48
# Copyright 2013, Big Switch Networks, 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 applic...
sbidoul/pip
refs/heads/main
src/pip/_vendor/pep517/colorlog.py
56
"""Nicer log formatting with colours. Code copied from Tornado, Apache licensed. """ # Copyright 2012 Facebook # # 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/licen...
superberny70/pelisalacarta
refs/heads/develop
python/main-classic/lib/sambatools/pyasn1/codec/ber/decoder.py
10
# BER decoder from pyasn1 import debug, error from pyasn1.codec.ber import eoo from pyasn1.compat.octets import oct2int, isOctetsType from pyasn1.type import tag, univ, char, useful, tagmap class AbstractDecoder: protoComponent = None def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet, ...
enkimute/ganja.js
refs/heads/master
codegen/python/mink.py
1
"""3D Projective Geometric Algebra. Written by a generator written by enki. """ __author__ = 'Enki' import math class MINK: def __init__(self, value=0, index=0): """Initiate a new MINK. Optional, the component index can be set with value. """ self.mvec = [0] * 4 ...
xpertsavenue/WiringOP-Zero-Python
refs/heads/master
examples/two-mcp23017.py
3
# Turns on each pin of an mcp23017 on address 0x20 ( quick2wire IO expander ) import wiringpi pin_base = 65 i2c_addr = 0x20 i2c_addr_2 = 0x21 #pins = [65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80] wiringpi.wiringPiSetup() wiringpi.mcp23017Setup(pin_base,i2c_addr) wiringpi.mcp23017Setup(pin_base+16,i2c_addr_2) #fo...
bovenyan/hsa
refs/heads/master
hsa-python/examples/example_utils/network_loader.py
4
''' Copyright 2012, Stanford University. This file is licensed under GPL v2 plus a special exception, as described in included LICENSE_EXCEPTION.txt. Created on Jul 25, 2012 @author: Peyman Kazemian ''' from examples.example_utils.emulated_tf import emulated_tf from headerspace.tf import TF import json d...
javierri/Metodo-Ordenamiento-de-Arreglos
refs/heads/master
MetodoInsercion.py
1
# Metodo de Ordenamiento por Inserción en Python # Observación: Ninguna # Autor: Javier Rivera (UNEFA Mérida) def OrdInsercion(arreglo): i = 1 for elem in arreglo[1:]: # Recorre los elementos del arreglo la pos 1 hasta el fin j = i - 1 while (j >= 0): # Recorre los elementos del arreglo desde p...
xindaya/bosen
refs/heads/release_1.1
app/sparsecoding/script/kill.py
14
#!/usr/bin/env python import os, sys if len(sys.argv) != 2: print "usage: %s <hostfile>" % sys.argv[0] sys.exit(1) host_file = sys.argv[1] prog_name = "sparsecoding_main" # Get host IPs with open(host_file, "r") as f: hostlines = f.read().splitlines() host_ips = [line.split()[1] for line in hostlines] ssh_cm...
sanghinitin/golismero
refs/heads/master
golismero/api/data/information/dns.py
8
#!/usr/bin/python # -*- coding: utf-8 -*- """ This package contains the classes that represent the different types of DNS queries and responses. """ # Required since "dns" is both an external module and the name of this file. from __future__ import absolute_import __license__ = """ GoLismero 2.0 - The web knife - Co...
912/M-new
refs/heads/master
virtualenvironment/tourism_industry/lib/python2.7/site-packages/pip/_vendor/requests/certs.py
961
#!/usr/bin/env python # -*- coding: utf-8 -*- """ certs.py ~~~~~~~~ This module returns the preferred default CA certificate bundle. If you are packaging Requests, e.g., for a Linux distribution or a managed environment, you can change the definition of where() to return a separately packaged CA bundle. """ import ...
smarinac/root
refs/heads/master
math/vc/makeTest.py
25
#!/usr/bin/env python # # scripts to replace a string in a set of a files # import sys, re, os with open("out.txt", "wt") as out: for line in open("arithmetics.cpp"): out.write(line.replace('main', 'arithmetics'))
Pavlos1/SensoringJMSS
refs/heads/master
read_arduino_data.py
1
#!/usr/local/bin/python # Written by Pavel # License: BSD #import mraa import serial import sqlite3 import time import os import re import sys import traceback error_count = 0 #uart = mraa.Uart(0) #os.system("/sbin/modprobe cdc-acm") devices = [f for f in os.listdir("/dev") if re.match(r"^ttyUSB[0-9]$", f)] + [f for...
Pingmin/linux
refs/heads/master
tools/testing/selftests/tc-testing/tdc_config.py
132
""" # SPDX-License-Identifier: GPL-2.0 tdc_config.py - tdc user-specified values Copyright (C) 2017 Lucas Bates <lucasb@mojatatu.com> """ # Dictionary containing all values that can be substituted in executable # commands. NAMES = { # Substitute your own tc path here 'TC': '/sbin/tc', # ...
FluffySurvivor/yogstation
refs/heads/dev
bot/requests/packages/chardet/utf8prober.py
2918
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
wistoch/meego-app-browser
refs/heads/master
tools/python/google/process_utils.py
186
# Copyright (c) 2006-2008 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. """Shared process-related utility functions.""" import errno import os import subprocess import sys class CommandNotFound(Exception): pass TASKKI...
chubbymaggie/pwndbg
refs/heads/master
pwndbg/compat.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Compatibility functionality, for determining whether we are running under Python2 or Python3, and resolving any inconsistencies which arise from this. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from _...
vovojh/gem5
refs/heads/master
tests/configs/realview-switcheroo-atomic.py
64
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
googleapis/googleapis-gen
refs/heads/master
google/cloud/dataproc/v1/dataproc-v1-py/google/cloud/dataproc_v1/services/workflow_template_service/transports/grpc.py
1
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
maemori/accon
refs/heads/master
docker/taiga/conf/local.py
1
from .common import * from .celery import * MEDIA_URL = "http://127.0.0.1/media/" STATIC_URL = "http://127.0.0.1/static/" ADMIN_MEDIA_PREFIX = "http://127.0.0.1/static/admin/" SITES["front"]["scheme"] = "http" SITES["front"]["domain"] = "127.0.0.1" SECRET_KEY = "mysecret" DEBUG = False TEMPLATE_DEBUG = False PUBLIC_...
iedparis8/django-helpdesk
refs/heads/master
views/feeds.py
6
""" django-helpdesk - A Django powered ticket tracker for small enterprise. (c) Copyright 2008 Jutda. All Rights Reserved. See LICENSE for details. views/feeds.py - A handful of staff-only RSS feeds to provide ticket details to feed readers or similar software. """ try: from django.contrib.auth ...
benghaem/py-senmolib
refs/heads/master
examples/bpm/example_ecg_worker.py
2
#! /home/ben/programming/senmo/env/bin/python from senmolib.components.worker import Worker import numpy as np class exampleEcgWorker(Worker): def process(self, data_arr): x_vals =[item[0] for item in data_arr] y_vals =[item[1] for item in data_arr] print(self.identity,"have x,y",x_vals[0],y_vals[0]) #thre...
CentOS-PaaS-SIG/linch-pin
refs/heads/develop
linchpin/provision/roles/azure/action_plugins/azure_rm_availabilityset.py
6
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.action import ActionBase import linchpin.MockUtils.MockUtils as mock_utils class ActionModule(ActionBase): def run(self, tmp=None, task_vars=None): """ Simple action plugin that returns th...
ustudio/ustudio-hmac-tornado
refs/heads/master
tests/client/test_authenticated_request.py
1
from tests.example_server import BaseHMACTestCase from tornado.testing import gen_test from hmacauth.client import authenticated_request class TestAuthenticatedRequest(BaseHMACTestCase): @gen_test def test_signs_post_with_bytestring_body(self): response = yield self.http_client.fetch(authenticated_r...
micadeyeye/Blongo
refs/heads/master
django/http/multipartparser.py
22
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ import cgi from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.utils.datastructures import MultiValueDict fro...
ychen820/microblog
refs/heads/master
y/google-cloud-sdk/.install/.backup/lib/requests/packages/urllib3/packages/six.py
2374
"""Utilities for writing code that runs on Python 2 and 3""" #Copyright (c) 2010-2011 Benjamin Peterson #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 l...
ibinti/intellij-community
refs/heads/master
plugins/hg4idea/testData/bin/hgext/convert/cvsps.py
91
# Mercurial built-in replacement for cvsps. # # Copyright 2008, Frank Kingswood <frank@kingswood-consulting.co.uk> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. import os import re import cPickle as pickle from mercurial import ...
wavesaudio/instl
refs/heads/master
pyinstl/instl_main.py
1
import sys import os import string import appdirs import tempfile import random import sqlite3 import datetime import logging import platform from pathlib import Path from functools import lru_cache import json from configVar import config_vars from pybatch import PythonBatchRuntime from pyinstl.cmdOptions import Comma...
drocco007/pyatl-english-numerals
refs/heads/master
test_english.py
1
from english_number import english_number import pytest def test_zero(): assert 'zero' == english_number(0) def test_one(): assert 'one' == english_number(1) @pytest.mark.parametrize('n, english', [(2, 'two'), (3, 'three'), (4, 'four'), (5, 'five'), (6, 'six'), (7, 'seven'), ...
petertodd/bitcoin
refs/heads/master
qa/rpc-tests/skeleton.py
148
#!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Skeleton for python-based regression tests using # JSON-RPC # Add python-bitcoinrpc to module search pa...
XiaodunServerGroup/xiaodun-platform
refs/heads/master
docs/en_us/data/source/conf.py
10
# -*- coding: utf-8 -*- # import sys, os # on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally import sphinx_rtd_theme html_theme ...
benspaulding/django
refs/heads/master
django/db/models/sql/constants.py
16
from collections import namedtuple import re # Valid query types (a dictionary is used for speedy lookups). QUERY_TERMS = set([ 'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in', 'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year', 'month', 'day', 'week_day', 'isn...
igel-kun/pyload
refs/heads/stable
module/plugins/hoster/PorntrexCom.py
1
# -*- coding: utf-8 -*- import re from ..internal.SimpleHoster import SimpleHoster class PorntrexCom(SimpleHoster): __name__ = "PorntrexCom" __type__ = "hoster" __version__ = "0.01" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?porntrex\.com/video/.+' __config__ = [("activated"...
blackzw/openwrt_sdk_dev1
refs/heads/master
staging_dir/host/lib/python2.7/Cookie.py
65
#!/usr/bin/env python # #### # Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in ...
adit-chandra/tensorflow
refs/heads/master
tensorflow/python/util/module_wrapper_test.py
8
# Copyright 2019 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...