repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 | prefix stringlengths 0 8.16k | middle stringlengths 3 512 | suffix stringlengths 0 8.17k |
|---|---|---|---|---|---|---|---|---|
oxyum/python-tlogger | tlogger/serializers.py | Python | mit | 668 | 0 | # -*- mode: python; coding: utf-8; -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
class KeyValueSerializer(object):
def __init__(se | lf, event, inline=()):
self.event = event
self.inline = inline
def format_string(self):
return ' '.join(
'{}=%s'.format(k)
if k not in self.inline
else '{}="{}"'.format(k, str(v).encode('unicode_escape').decode())
for k, v in | self.event.items()
)
def arguments(self):
return [v for k, v in self.event.items(omit=self.inline)]
|
Shopify/shopify_python_api | test/event_test.py | Python | mit | 509 | 0.005894 | import shopify
from test.test_helper import TestCase
class EventTest(TestCase):
def test_prefix_uses_resource(self):
prefix = shopify.Event._prefix(options={"resource": "orders", "reso | urce_id": 42})
self.assertEqual("https://this-is-my-test-show.myshopify.com/admin/api/unstable/orders/42", prefix)
def test_prefix_doesnt_need_resource(self):
| prefix = shopify.Event._prefix()
self.assertEqual("https://this-is-my-test-show.myshopify.com/admin/api/unstable", prefix)
|
DedMemez/ODS-August-2017 | chat/TTSCWhiteListTerminal.py | Python | apache-2.0 | 874 | 0.006865 | # Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.chat.TTSCWhiteListTerminal
from otp.speedchat.SCTerminal import SCTerminal
from otp.otpbase.OTPLocalizer import SpeedChatStaticText
SCStaticTextMsgEvent = 'SCStaticTextMsg'
class TTSCWhiteListTerminal(SCTerminal):
def __init__(self, textId... | % (self.textId, self.text)
def handleSelect(self):
SCTerminal.handleSelect(self)
if not self.parentClass.whisp | erAvatarId:
base.localAvatar.chatMgr.fsm.request('whiteListOpenChat')
else:
base.localAvatar.chatMgr.fsm.request('whiteListAvatarChat', [self.parentClass.whisperAvatarId]) |
anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_rebel_brigadier_general_sullustan_male.py | Python | mit | 475 | 0.046316 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_rebel_brigadier_gener | al_sullustan_male.iff"
result.attribute_template_id = 9
result.stfName("npc_name","sullustan_base_male")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ### | #
return result |
0x1306e6d/Baekjoon | baekjoon/9012.py | Python | gpl-2.0 | 694 | 0 | """
9012 : 괄호
URL : https://www.acmicpc.net/problem/9012
Input :
6
(())())
(((()())()
(()())((()))
((()()(()))(((())))()
()()()()(()()())()
(()((())()(
Output :
NO
NO
YES |
NO
YES
NO
"""
N = int(input())
for _ in range(N):
ps = input()
if ps[-1] is '(':
print("NO")
else:
count = 0
for c in ps:
if c is '(':
count += 1
elif c is ')':
count -= 1
if count < 0:
... | int("YES")
else:
print("NO")
|
jasonwee/asus-rt-n14uhp-mrtg | src/lesson_application_building_blocks/configparser_populate.py | Python | apache-2.0 | 408 | 0 | import configparser
parser = configparser.SafeConfigPa | rser()
parser.add_section('bug_tracker')
parser.set('bug_tracker', 'url', 'http://localho | st:8080/bugs')
parser.set('bug_tracker', 'username', 'dhellmann')
parser.set('bug_tracker', 'password', 'secret')
for section in parser.sections():
print(section)
for name, value in parser.items(section):
print(' {} = {!r}'.format(name, value))
|
meltmedia/bouncer | bouncer/tests/test_views.py | Python | mit | 153 | 0 | import unittest
from .. import views
class TestViews(u | nittest.TestCase):
def setUp(self):
pass |
def test_nothing(self):
views
|
sch3m4/intelmq | intelmq/bots/parsers/malwaregroup/parser_ips.py | Python | agpl-3.0 | 1,460 | 0.000685 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
f | rom intelmq.lib import utils
from intelmq.lib.bot import Bot
from intelmq.lib.message import Event
class MalwareGroupIPsParserB | ot(Bot):
def process(self):
report = self.receive_message()
if not report:
self.acknowledge_message()
return
if not report.contains("raw"):
self.acknowledge_message()
raw_report = utils.base64_decode(report.value("raw"))
raw_report = ra... |
hivam/l10n_co_doctor | report/doctor_disability_half.py | Python | agpl-3.0 | 3,267 | 0.027565 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | return age_unit
def select_diseases(self, status):
if status== 'presumptive':
return "Impresión Diagnóstica"
if status== 'confirm':
return "Confirmado"
if status== 'recurrent':
return "Recurrente"
return ""
def select_diseases_type(self, diseases_type):
if diseases_type== 'main':
return "Princ... | eturn ""
report_sxw.report_sxw('report.doctor_disability_half', 'doctor.attentions',
'addons/l10n_co_doctor/report/doctor_disability_half.rml',
parser=doctor_disability, header=False)
|
awest1339/multiscanner | storage/sql_driver.py | Python | mpl-2.0 | 11,174 | 0.002148 | #!/usr/bin/env python
from __future__ import print_function
import os
import json
import configparser
import codecs
import sys
from contextlib import contextmanager
from datetime import datetime
from sqlalchemy import and_, create_engine, Column, Integer, String, DateTime, func
from sqlalchemy.ext.declarati... | .url)
Base.metadata.bind = self.db_engine
Base.metadata.create_all()
# Bind the global Session to our DB engine
global Session
Session.configure(bind=self.db_engine)
@contextmanager
def db_session_scope(self):
"""
Taken from http://docs.sqlalche... | try:
yield ses
ses.commit()
except:
ses.rollback()
raise
finally:
ses.close()
def add_task(self, task_id=None, task_status='Pending', sample_id=None, timestamp=None):
with self.db_session_scope() as ses:
tas... |
napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/isis_neighbor_attribute/neighbors/__init__.py | Python | apache-2.0 | 14,460 | 0.001037 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | self.__neighbor = YANGDynClass(
base=YANGListType(
False,
neighbor.neighbor,
yang_name="neighbor",
parent=self,
is_container="list",
user_ordered=False,
path_helper=self._path_helper,
... | lper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
extensions=None,
namespace="http://openconfig.net/yang/network-instance",
defining_module="openconfig-network-instance",
yang_type="list",
is_config=False,
... |
aoakeson/home-assistant | homeassistant/components/binary_sensor/rest.py | Python | mit | 2,159 | 0 | """
Support for RESTful binary sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.rest/
"""
import logging
from | homeas | sistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.sensor.rest import RestData
from homeassistant.const import CONF_VALUE_TEMPLATE
from homeassistant.helpers import template
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'REST Binary Sensor'
DEFAULT_METHOD = 'GET'
# pylin... |
nicain/dipde_dev | setup.py | Python | gpl-3.0 | 2,931 | 0.005459 | # Copyright 2013 Allen Institute
# This file is part of dipde
# dipde 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.
#
# dipde is dis... | de_package_data=True,
package_data={'':['*.md', '*.txt', '*.cfg']},
platforms='an | y',
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'License :: Apache Software License :: 2.0',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
],
ex... |
googleapis/python-compute | google/cloud/compute_v1/services/region_notification_endpoints/pagers.py | Python | apache-2.0 | 3,203 | 0.000937 | # -*- coding: utf-8 -*-
# Copyright 2022 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... | ing import (
Any,
AsyncIterator,
Awaitable,
Callable,
Sequence,
Tuple,
Optional,
Iterator,
) |
from google.cloud.compute_v1.types import compute
class ListPager:
"""A pager for iterating through ``list`` requests.
This class thinly wraps an initial
:class:`google.cloud.compute_v1.types.NotificationEndpointList` object, and
provides an ``__iter__`` method to iterate through its
``items`` ... |
Per-Starke/Visualizer | src/__init__.py | Python | apache-2.0 | 19 | 0 | __author__ = | 'Per'
| |
sidnarayanan/TransferErrors | bin/write.py | Python | mit | 382 | 0.044503 | #!/usr/bin/ | env python
import TransferErrors as TE
import cPickle as pickle
with open('stuck.pkl','rb') a | s pklfile:
stuck = pickle.load(pklfile)
TE.makeBasicTable(stuck,TE.workdir+'html/table.html',TE.webdir+'table.html')
TE.makeCSV(stuck,TE.webdir+'data.csv')
for basis in [-6,-5,-4,-3,-1,1,2]:
TE.makeJson(stuck,TE.webdir+('stuck_%i'%basis).replace('-','m')+'.json',basis)
|
dhain/greennet | examples/certs/certgen.py | Python | mit | 2,547 | 0.002356 | """
Certificate generation module.
"""
from OpenSSL import crypto
TYPE_RSA = crypto.TYPE_RSA
TYPE_DSA = crypto.TYPE_DSA
def createKeyPair(type, bits):
"""
Create a public/private key pair.
Arguments: type - Key type, must be one of TYPE_RSA and TYPE_DSA
bits - Number of bits to use in the... | issuerKey | - The private key of the issuer
serial - Serial number for the certificate
notBefore - Timestamp (relative to now) when the certificate
starts being valid
notAfter - Timestamp (relative to now) when the certificate
... |
andredalton/bcc | 2014/MAC0242/miniep6/history.py | Python | apache-2.0 | 2,750 | 0.005091 | from threading import Thread
import pickle
import time
from pymouse import PyMouse
# from evdev import InputDevice, ecodes, UInput
from evdev import UInput, ecodes
class History(Thread):
def __init__(self):
Thread.__init__(self)
self.n = 0
self.st = True # Stop
self.sl = False... | while not self.stop:
self.send_event()
elif self.n > 0:
for i in range(self.n):
self.send_event()
self.st = True
# print self.history
print("\nEnd")
def exit(self):
... |
def sleep(self):
if self.sl:
print("Play")
else:
print("Pause")
self.sl = not self.sleep
def reset(self):
self.history = []
def append_event(self, event):
# if event.type == ecodes.EV_KEY:
self.history.append({"mouse": self.m.posit... |
acsone/bank-payment | account_payment_transfer_reconcile_batch/tests/__init__.py | Python | agpl-3.0 | 150 | 0 | # -*- coding: utf-8 -*-
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import tes | t_account_payment_transfer_r | econcile_batch
|
Castronova/EMIT | gui/controller/enums.py | Python | gpl-2.0 | 73 | 0.013699 | class PlotEnum():
point = 'POINT',
line = 'LIN | E',
b | ar = 'BAR' |
lauria/Samba4 | lib/testtools/testtools/testresult/real.py | Python | gpl-3.0 | 23,481 | 0.000596 | # Copyright (c) 2008 testtools developers. See LICENSE for details.
"""Test results and related things."""
__metaclass__ = type
__all__ = [
'ExtendedToOriginalDecorator',
'Mult | iTestResult',
'TestResult',
'ThreadsafeForwardingResult',
]
import datetime
import sys
import unittest
from testtools.compat import all, _format_exc_info, str_is_unicode, _u
# From http://docs.python.org/libr | ary/datetime.html
_ZERO = datetime.timedelta(0)
# A UTC class.
class UTC(datetime.tzinfo):
"""UTC"""
def utcoffset(self, dt):
return _ZERO
def tzname(self, dt):
return "UTC"
def dst(self, dt):
return _ZERO
utc = UTC()
class TestResult(unittest.TestResult):
"""Subclass... |
tejesh95/Zubio.in | zubio/allauth/socialaccount/providers/facebook/urls.py | Python | mit | 435 | 0.004598 | from django.conf.urls import patterns, url
from allauth.socialaccount.prov | iders.oauth2.urls import default_urlpatterns
from .provider import FacebookProvider
from . import views
urlpatterns = default_urlpatterns(FacebookProvid | er)
urlpatterns += patterns('',
url('^facebook/login/token/$', views.login_by_token,
name="facebook_login_by_token"),
url('^facebook/channel/$', views.channel, name='facebook_channel'),
)
|
idning/redis-rdb-tools | rdbtools/callbacks.py | Python | mit | 7,595 | 0.007637 | import re
from decimal import Decimal
import sys
import struct
from rdbtools.parser import RdbCallback, RdbParser
ESCAPE = re.compile(ur'[\x00-\x1f\\"\b\f\n\r\t\u2028\u2029]')
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')
HAS_UTF8 = re.compile(r'[\x80-\xff]')
ESCAPE_DCT = {
'\\': '\\\\',
'"': '\\"',
'\b': ... | has_databases = False
self._is_first_key_in_db = True
self._elements_in_key = 0
self._element_index = 0
def start_rdb(self):
self._out.write('[')
def start_database(self, db_number):
if not self._is_first_db:
self._out | .write('},')
self._out.write('{')
self._is_first_db = False
self._has_databases = True
self._is_first_key_in_db = True
def end_database(self, db_number):
pass
def end_rdb(self):
if self._has_databases:
self._out.write('}')
self._out.w... |
yavor-atanasov/hawkey | tests/python/tests/test_query.py | Python | lgpl-2.1 | 11,221 | 0.000446 | #
# Copyright (C) 2012-2014 Red Hat, Inc.
#
# Licensed under the GNU Lesser General Public License Version 2.1
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of th... | name="pilchard")
q.filterm(latest_per_arch=True)
self.assertEqual(len(q), 2)
q.filterm(latest=True)
self.assertEqual(len(q), 1)
def test_reldep(self):
flying = base.by_name(self.sack, "flying")
requires = flying.requires
q = hawkey.Query(self. | sack).filter(provides=requires[0])
self.assertEqual(len(q), 1)
self.assertEqual(str(q[0]), "penny-lib-4-1.x86_64")
self.assertRaises(hawkey.QueryException, q.filter,
provides__gt=requires[0])
def test_reldep_list(self):
self.sack.load_test_repo("updates", ... |
nikste/tensorflow | tensorflow/contrib/framework/python/ops/variables.py | Python | apache-2.0 | 27,377 | 0.005698 | # 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... | resource_loader.get_path_to_datafile("_variable_ops.so" | ))
return gen_variable_ops.zero_initializer(ref, name=name)
def assert_global_step(global_step_tensor):
training_util.assert_global_step(global_step_tensor)
def assert_or_get_global_step(graph=None, global_step_tensor=None):
"""Verifies that a global step tensor is valid or gets one if None is given.
If `g... |
aosingh/Regularization | LinfinityRegularization/LinfinityRegularizer.py | Python | mit | 2,373 | 0.006321 | import numpy as np
class LinfinityRegression:
def __init__(self, iterations, learning_rate, regularization_strength):
self.iterations = iterations
self.learning_rate = learning_rate
self.regularization_strength = regularization_strength
@staticmethod
def soft_thresholding_operator... | icted_output, actual_output):
"""
This method calculates the error and the MSE cost function given a predicted_value and the actual_value
:param predicted_output:
:param actual_output:
:return: Mean Square Error, Error.
"""
error = predicted_output - actual_out... | weights = np.random.rand(training_records.shape[1])
weights_table = [weights]
predicted_outputs = []
for i in range(self.iterations):
predicted_output = np.dot(training_records, weights)
predicted_outputs.append(predicted_output)
mse_cost, error = Linf... |
anhstudios/swganh | data/scripts/templates/object/tangible/loot/loot_schematic/shared_park_bench_schematic.py | Python | mit | 479 | 0.045929 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.templa | te = "object/tangible/loot/loot_schematic/shared_park_bench_schematic.iff"
result.attribute_template_id = -1
result.stfName("craft_item_ingredients_n","park_bench")
#### BEGIN | MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
vladikoff/fxa-mochitest | tests/venv/lib/python2.7/site-packages/mozprocess/wpk.py | Python | mpl-2.0 | 2,115 | 0.000946 | # 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/.
from | ctypes import sizeof, windll, addres | sof, create_unicode_buffer
from ctypes.wintypes import DWORD, HANDLE
PROCESS_TERMINATE = 0x0001
PROCESS_QUERY_INFORMATION = 0x0400
PROCESS_VM_READ = 0x0010
def get_pids(process_name):
BIG_ARRAY = DWORD * 4096
processes = BIG_ARRAY()
needed = DWORD()
pids = []
result = windll.psapi.EnumProcesses(p... |
mank319/elementaryPlus | scripts/elementaryplus-installer.py | Python | gpl-3.0 | 19,933 | 0.002057 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# elementaryplus-installer.py elementary+ Installer/Configurator
#
# Copyright (C) 2015 Stefan Ric (cybre)
#
# 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 ... | aserJets, and for scanning, sending faxes and for photo-card access on most HP MFP printers",
"HPmenu",
"standard"
],
[
| "MEGAsync",
"megasync",
"/usr/bin/megasync",
"MEGAsync is a free online storage service",
"mega",
"standard"
],
[
"Mumble",
"mumble",
"/usr/bin/mumble",
"Mumble is a low-latency, high quality voice chat program for gaming",
"mum... |
ladybug-analysis-tools/honeybee | honeybee_plus/radiance/command/epw2wea.py | Python | gpl-3.0 | 2,274 | 0 | # coding=utf-8
from ._commandbase import RadianceCommand
from ..datatype import RadiancePath
import os
class Epw2wea(RadianceCommand):
"""epw2wea transforms an EnergyPlus weather data (.epw) file into
the DAYSIM weather file format, for use with the RADIANCE gendaymtx
program.
Attributes:
ep... | descriptive_name='Epw weather data file',
relative_path=None, check_exists=False)
output_wea_file = RadiancePath('output_wea_file',
descriptive_name='Output wea file',
relative_path=None, check... | le
"""The path of the epw file that is to be converted to a wea file."""
self.output_wea_file = output_wea_file
"""The path of the output wea file. Note that this path will be created
if not specified by the user."""
@property
def epw_file(self):
return self._epw_file
... |
Times-0/Timeline | Timeline/Database/DB.py | Python | gpl-3.0 | 8,784 | 0.008311 | from Timeline.Server.Constants import TIMELINE_LOGGER
from twisted.internet.defer import Deferred, inlineCallbacks, returnValue
from twistar.dbobject import DBObject
from twistar.registry import Registry
from collections import deque
import logging, time, json
class Penguin(DBObject):
HASONE = ['avatar', 'curren... | .0
if fed_percent < 3 or total_percent < 6:
self.backyard = 1
self.food = 100
self.play = 100
self.clean = 100
self.save()
return
if fed_percent < 10:
pid = self.penguin_id
pname = self | .name
def sendMail(mail):
if mail is not None:
sent = mail.sent_on
delta = (time.time() - sent)/3600/12
if delta < 1:
return
Mail(penguin_id=pid, from_user=0, type=110, description=str(pname)... |
Grungnie/microsoftbotframework | microsoftbotframework/cache.py | Python | mit | 3,321 | 0.000602 | from abc import ABCMeta, abstractmethod
import json
import os
try:
import redis
except ImportError:
pass
from .config import Config
def get_cache(cache, config=None):
if isinstance(cache, str):
if cache == 'JsonCache':
return JsonCache()
elif cache == 'RedisCache':
... | file)
if key not in data:
r | eturn False
data.pop(key, None)
data_file.seek(0)
data_file.write(json.dumps(data))
data_file.truncate()
return True
class RedisCache(Cache):
# currently loading is only from config file
def __init__(self, config):
self.redis_uri = config.get_... |
sdrogers/ms2ldaviz | ms2ldaviz/decomposition/migrations/0001_initial.py | Python | mit | 4,500 | 0.004222 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-02-17 10:06
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('basicviz', '0049_auto_20170216_2228'),
... | Field(
model_name='documentglobalfeature',
name='feature',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='decomposition.GlobalFeature'),
),
migrations.AddField(
model_name='decompositionfeatureinstance',
name='feature'... | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='decomposition.GlobalFeature'),
),
]
|
rouxcode/django-filer-addons | filer_addons/tests/test_utils.py | Python | mit | 793 | 0 | # -*- coding: utf-8 -*-
import django
from django.contrib.auth.models import User
from django.test import TestCase, Client
# compat thing!
if django.VERSION[:2] < (1, 10):
from django.core.urlresolvers import reverse
else:
from django.urls import reverse
class FilerUtilsTests(TestCase):
def setUp(self):
... | rl = reverse('admin:filer_folder_changelist')
response = self.client.get(url, follow=True)
self.assertEqual(response.stat | us_code, 200)
|
b3j0f/schema | b3j0f/schema/base.py | Python | mit | 9,410 | 0.000106 | # -*- coding: utf-8 -*-
# --------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016 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... | obj._delvalue(self)
def _delvalue(self, schema):
"""Fired when inner schema delete its value.
:param Schema schema: inner schema.
"""
def _validate(self, data, owner=None):
"" | "Validate input data in returning an empty list if true.
:param data: data to validate with this schema.
:param Schema owner: schema owner.
:raises: Exception if the data is not validated.
"""
if isinstance(data, DynamicValue):
data = data()
if data is None ... |
mmcauliffe/python-acoustic-similarity | conch/analysis/mfcc/praat.py | Python | mit | 586 | 0.005119 | import os
from ..helper import freq_to_mel
from ..praat import Praat | AnalysisFunction
class PraatMfccFunction(PraatAnalysisFunction):
def __init__(self, praat_path=None, window_length=0.025, time_step=0.01, max_frequency=7800,
num_coefficients=13):
script_dir = os.path.dirname(os.path.abspath(__file__))
script = os.path.join(script_dir, 'mfcc.praat... | f).__init__(script, praat_path=praat_path, arguments=arguments)
|
AutorestCI/azure-sdk-for-python | azure-mgmt-datalake-store/azure/mgmt/datalake/store/models/operation_list_result.py | Python | mit | 1,314 | 0 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | ncorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class OperationListResult(Model):
"""The l | ist of available operations for Data Lake Store.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar value: the results of the list operation.
:vartype value: list[~azure.mgmt.datalake.store.models.Operation]
:ivar next_link: the link (url) to the next pag... |
ebrelsford/django-rsssync | rsssync/migrations/0001_initial.py | Python | bsd-3-clause | 2,776 | 0.008285 | # -*- 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 'RssFeed'
db.create_table(u'rsssync_rssfeed', (
(u'id', self.gf('django.db.models... | nField')(default=True)),
))
db.send_create_signal(u'rsssync', ['RssFeed'])
# Adding model 'RssEntry'
db.create_table(u'rsssync_rssentry', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('title', self.gf('django.db.models.fields.CharFie... | s.fields.URLField')(max_length=200, null=True, blank=True)),
('date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
('feed', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['rsssync.RssFeed'])),
))
db.send_create_signal(u'rsssync', ['RssEn... |
opendatateam/docker-udata | samples/theme/my-theme/setup.py | Python | mit | 3,719 | 0.002151 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import io
import re
from os.path import join, dirname
from setuptools import setup, find_packages
RE_MD_CODE_BLOCK = re.compile(r'```(?P<language>\w+)?\n(?P<lines>.*?)```', re.S)
RE_SELF_LINK = re.compile(r'\[(.*?)\]\[\]')
RE_LINK_... | text=match.group('text'),
url=refs[match.group('ref')]
))
for match in RE_TITLE.finditer(content):
underchar = RST_TITLE_LEVELS[len(match.group('level')) - 1]
title = match.group('title')
underline = | underchar * len(title)
full_title = '\n'.join((title, underline))
content = content.replace(match.group(0), full_title)
return content
long_description = '\n'.join((
md2pypi('README.md'),
md2pypi('CHANGELOG.md'),
''
))
setup(
name='my-theme',
version='0.1.0',
descriptio... |
minhphung171093/GreenERP | openerp/addons/base/tests/test_translate.py | Python | gpl-3.0 | 6,065 | 0.003462 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import unittest
from openerp.tools.translate import quote, unquote, xml_translate
class TranslationToolsTestCase(unittest.TestCase):
def test_quote_unquote(self):
def test_string(str):
quoted =... | />
stuff after
</t>"""
result = xml_translate( | terms.append, source)
self.assertEquals(result, source)
self.assertItemsEqual(terms,
['stuff before', 'stuff after'])
def test_translate_xml_off(self):
""" Test xml_translate() with attribute translate="off". """
terms = []
source = """<div>
... |
attakei/ansible | lib/ansible/executor/module_common.py | Python | gpl-3.0 | 8,252 | 0.003393 | # (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015 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
# the Free Software Foundation, either... | reter' % os.path.basename(interpreter)
if interpreter_config in task_vars:
interpreter = to_bytes(task_vars[interpreter_config], errors='strict')
lines[0] = shebang = b"#!{0} {1}".format(interpreter, b" ".join(args[1:]))
if os.path.basename(interpreter).startswi... | pass
module_data = |
kamwar/simLAB | sim/sim_router.py | Python | gpl-2.0 | 28,870 | 0.004434 | #!/usr/bin/python
# LICENSE: GPL2 |
# (c) 2013 Tom Schouten <tom@getbeep.com>
# (c) | 2014, Kamil Wartanowicz <k.wartanowicz@gmail.com>
import logging
import os
import threading
import time
import usb
import plac
import sim_shell
import sim_ctrl_2g
import sim_ctrl_3g
import sim_reader
import sim_card
from util import types_g
from util import types
from util import hextools
ROUTER_MODE_DISABLED = 0
... |
AndreasMadsen/tensorflow | tensorflow/python/layers/core.py | Python | apache-2.0 | 12,263 | 0.002609 | # 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... | ,
trainable=True,
name=None,
**kwargs):
super(Dense, self).__init__(trainable=trainable, name=name, **kwargs)
self.units = units
self.activation = activation
self.use_bias = use_bias
self.weights_initializer = weights_initializer
self.bias_initializer... | hts_regularizer
self.bias_regularizer = bias_regularizer
self.activity_regularizer = activity_regularizer
def build(self, input_shape):
input_shape = tensor_shape.TensorShape(input_shape)
if input_shape.ndims is None:
raise ValueError('Inputs to `Dense` should have known rank.')
if len(inpu... |
psychopy/psychopy | psychopy/hardware/emulator.py | Python | gpl-3.0 | 12,656 | 0.000237 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2022 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""Idea: Run or debug an experiment script using exactly the same code,
i.e., for both tes... | glet only; keyboard events only.
"""
import threading
from psychopy import visual, event, core, logging
from psychopy.sound import Sound # for SyncGenerator tone
__author__ = 'Jeremy Gray'
class ResponseEmulator(threading.Thread):
def __init__(self, simResponses=None):
"""Class to allow simulation of... | during a scan.
Given a list of response tuples (time, key), the thread will
simulate a user pressing a key at a specific time (relative to
the start of the run).
Author: Jeremy Gray; Idea: Mike MacAskill
"""
if not simResponses:
self.responses = []
... |
maxkoryukov/headphones | headphones/versioncheck.py | Python | gpl-3.0 | 9,322 | 0.002145 | # This file is part of Headphones.
#
# Headphones 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.
#
# Headphones is distributed i... | logger.debug('Git output: ' + output)
except OSError:
logger.debug('Command failed: %s', cmd)
continue
| if 'not found' in output or "not recognized as an internal or external command" in output:
logger.debug('Unable to find git with command ' + cmd)
output = None
elif 'fatal:' in output or err:
logger.error('Git returned bad info. Are you sure this is a git installation?')... |
yuewko/neutron | neutron/db/migration/alembic_migrations/versions/19180cf98af6_nsx_gw_devices.py | Python | apache-2.0 | 3,023 | 0.000992 | # Copyright 2014 OpenStack Foundation
#
# 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 ... | ema_has_table('networkgatewaydevices'):
# Assume that, in the database we are migrating from, the
# configured plugin did not create any nsx tables.
return
op.create_table(
'networkgatewaydevicereferences',
sa.Column('id', sa.String(length=36), nullable=False),
sa.Co... | y_id', sa.String(length=36), nullable=True),
sa.Column('interface_name', sa.String(length=64), nullable=True),
sa.ForeignKeyConstraint(['network_gateway_id'], ['networkgateways.id'],
ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id', 'network_gateway_id', 'interfa... |
benoitsteiner/tensorflow-opencl | tensorflow/contrib/eager/python/datasets.py | Python | apache-2.0 | 3,562 | 0.006176 | # 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... | counter += 1
return "eager_iterator_{}".format(uid)
class Iterator(object):
"""An iterator producing tf.Tensor objects from a tf.contrib.data.Dataset."""
def __init__(self, dataset):
"""Creates a new iterator over the given dataset.
For example:
```python
dataset = tf.contrib.data.Dataset.rang... | ```
Args:
dataset: A `tf.contrib.data.Dataset` object.
Raises:
RuntimeError: When invoked without eager execution enabled.
"""
if not context.in_eager_mode():
raise RuntimeError(
"{} objects only make sense when eager execution is enabled".format(
type(self))... |
shivekkhurana/learning | python/scripts/user_input/receiver.py | Python | mit | 590 | 0.018644 | ####################################
# Sample Rec | eiver Script
# [Usag | e]
# python receiver.py
# python receiver.py > data.csv
# [Data Format]
# id,time,x,y,z
# [Exaple]
# 1,118.533,-0.398,-0.199,-0.978
####################################
import sys
import os
import math
import time
import SocketServer
PORTNO = 10552
class handler(SocketServer.DatagramRequestHandler):
... |
ACS-Community/ACS | LGPL/CommonSoftware/acspy/src/Acspy/Servants/__init__.py | Python | lgpl-2.1 | 214 | 0 | '''
Servants is of | primary int | erest to Python component developers.
The module names should sufficiently described their intended uses.
'''
__revision__ = "$Id: __init__.py,v 1.4 2005/02/25 23:42:32 dfugate Exp $"
|
lambday/shogun | examples/undocumented/python/features_string_char.py | Python | bsd-3-clause | 792 | 0.050505 | #!/usr/bin/env python
strings=['hey','guys','i','am','a','string']
parameter_list=[[strings]]
def features_string_char (strings):
from shogun import StringCharFeatures, RAWBYTE
from numpy import array
#create string features
f=StringCharFeatures(strings, RAWBYTE)
#and output several stats
#print("max string l... | #print("strings", f.get_features())
return f.get_string_list(), f
if __name__=='__main__':
print('StringCharFeatures')
features_string_char(*parameter_l | ist[0])
|
BlogomaticProject/Blogomatic | opt/blog-o-matic/usr/lib/python/Bio/PDB/PSEA.py | Python | gpl-2.0 | 2,747 | 0.014197 | # Copyright (C) 2006, Thomas Hamelryck (thamelry@binf.ku.dk)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Wrappers for PSEA, a program for secondary structure assignment.
See this citation for... | Pothier J, Mornon J-P: P-SEA: a new efficient
assignment of secondary structure from C_alpha.
Comput Appl Biosci 1997 , 13:291-295
ftp://ftp.lmcp.jussieu.fr/pub/sincris/software/protein/p-sea/
"""
import os
from Bio.PDB.Polypeptide import is_aa
def run_psea(fname):
"""Run PSEA and return output filename.
... | the input filename with extension ".sea".
Note that P-SEA will write output to the terminal while run.
"""
os.system("psea "+fname)
last=fname.split("/")[-1]
base=last.split(".")[0]
return base+".sea"
def psea(pname):
"""Parse PSEA output file."""
fname=run_psea(pname)
star... |
eliasdesousa/indico | indico/modules/networks/fields.py | Python | gpl-3.0 | 2,522 | 0.001586 | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.
from __future__ import uni... | indico.web.forms.fields import MultiStringField
class MultiIPNetworkField(MultiStringField):
"""A field to enter multiple IPv4 or IPv6 networks.
The field data is a set of ``IPNetwork``s not bound to a DB session.
The ``unique`` and ``sortable`` parameters of the parent class cannot be used with this cla... |
mir-dataset-loaders/mirdata | scripts/legacy/make_maestro_index.py | Python | bsd-3-clause | 1,799 | 0.001112 | import argparse
import hashlib
import json
import csv
import os
MAESTRO_INDEX_PATH = '../mirdata/indexes/maestro_index.json'
def md5(file_path):
"""Get md5 hash of a file.
Parameters
----------
file_path: str
File path.
Returns
-------
md5_hash: str
md5 hash of data in ... | 'rb') as fhandle:
for chunk in iter(lambda: fhandle.read(4096), b''):
hash_md5.update(chunk)
return hash_md5.hexdigest()
def make_maestro_index(data_path):
metadata | _path = os.path.join(data_path, 'maestro-v2.0.0.json')
print(metadata_path)
maestro_index = {}
with open(metadata_path, 'r') as fhandle:
metadata = json.load(fhandle)
for i, row in enumerate(metadata):
print(i)
trackid = row['midi_filename'].split('.')[0]
... |
thmcmahon/wp2nb | wp2nb.py | Python | mit | 6,200 | 0.000645 | import simplejson as json
import xmltodict
import requests
import os
import re
import sys
import base64
from urlparse import urlparse
from os.path import splitext, basename
from BeautifulSoup import BeautifulSoup
nb_token = os.environ.get('NB_TOKEN')
site_slug = os.environ.get('SITE_SLUG')
api_url = "https://" + site_... | ct image URLs to be uploaded
image_urls = image_links(content)
# remove img tags as they will be brought in using liquid tags
content = remove_img_tags(content)
if content.find('youtube') > 0:
youtube_url = youtube_links(content)
if youtube_url is not None:
... | 'slug': input_xml['wp:post_id'],
'status': 'published',
'content_before_flip': content,
'published_at': input_xml['pubDate'],
'author_id': '2'}},
'images': image_urls}
return output_dict
def upload_blog_post(input_json):
''' U... |
ThunderGemios10/The-Super-Duper-Script-Editor | script_analytics.py | Python | gpl-3.0 | 11,293 | 0.027477 | ################################################################################
### Copyright © 2012-2013 BlackDragonHunt
###
### This file is part of the Super Duper Script Editor.
###
### The Super Duper Script Editor is free software: you can redistribute it
### and/or modify it under the terms of the GNU Genera... | ed = int(stats.st_mtime)
return (filesize != int(self.filesize) or last_edited != int(self.last_edited))
################################################################################
### @class ScriptAnalytics
################################################################################
class ScriptAnal... | #########################################################
### @fn __init__()
####################################################################
def __init__(self):
self.script_data = {}
self.load()
####################################################################
### @fn load()
#############... |
wolfstein9119/django-skel | project_name/settings/common.py | Python | bsd-2-clause | 3,448 | 0.00116 | """
Django settings for {{ project_name }} project.
"""
import os
import re
MAIN_APPLICATION_PATH = os.path.dirname(
os.path.dirname(os.path.abspath(__file__))
)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(MAIN_APPLICATION_PATH)
# Quick-start development s... | on
LANGUAGE_CODE = 'ru-ru'
TIME_ZONE = 'Asia/Krasnoyarsk'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'dj | ango.contrib.staticfiles.finders.AppDirectoriesFinder',
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static_files')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
LOCALE_PATHS = [
os.path.join(BASE_DIR, 'transl... |
rtoal/ple | python/powers_of_two.py | Python | mit | 409 | 0.002445 | def powers_of_two(limit):
value = 1
while value < limit:
yield value
value += value
# Use t | he generator
for i in powers_of_two(70):
print(i)
# Explore the mechanism
g = powers_of_two(100)
assert str(type(powers_of_two)) == "<class 'function'>"
assert str(type(g)) == "<class 'generator'>"
assert g.__next__() == 1
assert g.__next__() == 2 |
assert next(g) == 4
assert next(g) == 8
|
atruberg/django-custom | django/db/backends/oracle/base.py | Python | bsd-3-clause | 39,830 | 0.001456 | """
Oracle database backend for Django.
Requires cx_Oracle: http://cx-oracle.sourceforge.net/
"""
from __future__ import unicode_literals
import decimal
import re
import sys
import warnings
def _setup_environment(environ):
import platform
# Cygwin requires some special voodoo to set the environment variables... | TO SECOND(6))"
return fmt % (sql, connector, days, hours, minutes, seconds,
timedelta.microseconds, day_precision)
def date_trunc_sql(self, lookup_type, field_name):
# http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions230.htm#i1002084
if lookup_type in ('year',... | , lookup_type.upper())
else:
return "TRUNC(%s)" % field_name
# Oracle crashes with "ORA-03113: end-of-file on communication channel"
# if the time zone name is passed in parameter. Use interpolation instead.
# https://groups.google.com/forum/#!msg/django-developers/zwQju7hbG78/9l934yelw... |
ebmdatalab/openprescribing | openprescribing/matrixstore/build/import_prescribing.py | Python | mit | 7,057 | 0.00085 | """
Import prescribing data from CSV files into SQLite
"""
from collections import namedtuple
import csv
from itertools import groupby
import logging
import os
import sqlite3
import gzip
import heapq
from matrixstore.matrix_ops import sparse_matrix, finalise_matrix
from matrixstore.serializer import serialize_compress... | tuples of the
form:
bnf_code, items_matrix, quantity_matrix, actual_cost_matrix, net_cost_matrix
Where the matrices contain the prescribed values for that presentation for
eve | ry practice and date.
"""
max_row = max(practices.values())
max_col = max(dates.values())
shape = (max_row + 1, max_col + 1)
grouped_by_bnf_code = groupby(prescriptions, lambda row: row[0])
for bnf_code, row_group in grouped_by_bnf_code:
items_matrix = sparse_matrix(shape, integer=True)
... |
lambdal/envois | envois/terms.py | Python | mit | 396 | 0.005051 | #!/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': {
'string': self.s... | 'days': self.days
}
}
|
chrisfranklin/dinnertime | friends/managers.py | Python | gpl-3.0 | 2,411 | 0.001659 | from django.db import models
from django.db.models import Q
class FriendshipManager(models.Manager):
"""
Provides an interface to friends
"""
def friends_for_user(self, user):
"""
Returns friends for specific user
"""
friends = []
qs = self.filter(Q(from_user=... | , user2):
"""
Returns boolean value of whether user1 and user2 are currently friends.
"""
return self.filter(
Q(from_user=user1, to_user=user2) |
Q(from_user=user2, to_user=user1)
).count() > 0
def remove(self, user1, user2):
"""
Remov... | friendships = self.filter(from_user=user2, to_user=user1)
if friendships:
friendships.delete()
class FriendshipInvitationManager(models.Manager):
"""
Provides an interface to friendship invitations
"""
def is_invited(self, user1, user2):
"""
Returns boolean valu... |
mach327/chirp_fork | chirp/drivers/thuv1f.py | Python | gpl-3.0 | 14,900 | 0 | # Copyright 2012 Dan Smith <dsmith@danplanet.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is ... | opy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import struct
import logging
from chirp import chirp_common, errors, util, directory, memmap
from chirp import bitwise
from chirp.settings import RadioSetting, RadioSettingGroup, \
RadioSettingValueIntege... | , RadioSettingValueList, \
RadioSettingValueBoolean, RadioSettingValueString, \
RadioSettings
LOG = logging.getLogger(__name__)
def uvf1_identify(radio):
"""Do identify handshake with TYT TH-UVF1"""
radio.pipe.write("PROG333")
ack = radio.pipe.read(1)
if ack != "\x06":
raise errors.Ra... |
mzdaniel/oh-mainline | vendor/packages/Django/tests/modeltests/reverse_lookup/tests.py | Python | agpl-3.0 | 1,645 | 0.001216 | from django.test import TestCase
from django.core.exceptions import FieldError
from models import User, Poll, Choice
class ReverseLookupTests(TestCase):
def setUp(s | elf):
john = User.objects.cr | eate(name="John Doe")
jim = User.objects.create(name="Jim Bo")
first_poll = Poll.objects.create(
question="What's the first question?",
creator=john
)
second_poll = Poll.objects.create(
question="What's the second question?",
creator=jim
... |
gottesmm/swift | test/Driver/Dependencies/Inputs/update-dependencies-bad.py | Python | apache-2.0 | 1,560 | 0 | #!/usr/bi | n/env python
# update-dependencies-bad.py - Fails on bad.swift -*- python -*- |
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the lis... |
ResearchSoftwareInstitute/MyHPOM | myhpom/migrations/0013_auto_20180720_0942.py | Python | bsd-3-clause | 643 | 0 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
depen | dencies = [
('myhpom', '0012_auto_20180718_1140'),
]
operations = [
migrations.AlterModelOptions(
name='staterequirement',
options={'ordering': ['-state', 'id']},
),
migrations.AlterUniqueTogether(
name='staterequirement',
unique_t... | ='staterequirement',
name='position',
),
]
|
sampathweb/game-server | pybot_game_autobahn.py | Python | mit | 5,481 | 0.000182 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | opyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRIN... | HERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
###############################################################################
import json
import random
import sys
from multiprocessing import Process
# from autobahn.asyncio.websocket import WebSocket... |
dezelin/vbox-haiku | src/VBox/GuestHost/OpenGL/packer/packer.py | Python | gpl-2.0 | 8,980 | 0.010245 | # Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
# This script generates the packer.c file from the gl_header.parsed file.
import sys, string, re
import apiutil
def WriteData( offset, arg_type, arg_name, is_swapped ):
... | # Now emit the WRITE_() macros for all parameters
for index in range(0,len(params)):
(name, type, vecSize) = params[index]
# if we're converting a vector-valued function to a non-vector func:
if vecSize > 0 and func_name != orig_func_name:
| ptrType = apiutil.PointerType(type)
for i in range(0, vecSize):
print WriteData( counter + i * apiutil.sizeof(ptrType),
ptrType, "%s[%d]" % (name, i), is_swapped )
# XXX increment counter here?
else:
print WriteData( counter, t... |
diogocs1/comps | web/addons/mrp_byproduct/__init__.py | Python | apache-2.0 | 1,074 | 0.001862 | # | -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | ur option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have rece... |
SciLifeLab/genologics | genologics/lims.py | Python | mit | 29,765 | 0.001478 | """Python interface to GenoLogics LIMS via its REST API.
LIMS interface.
Per Kraulis, Science for Life Laboratory, Stockholm, Sweden.
Copyright (C) 2012 Per Kraulis
"""
__all__ = ['Lab', 'Researcher', 'Project', 'Sample',
'Containertype', 'Container', 'Processtype', 'Process',
'Artifact', 'Lims... | except ElementTree.ParseE | rror: # some error messages might not follow the xml standard
message = response.content
raise requests.exceptions.HTTPError(message)
return True
def |
fzimmermann89/pyload | module/plugins/hoster/FileStoreTo.py | Python | gpl-3.0 | 1,290 | 0.013953 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FileStoreTo(SimpleHoster):
__name__ = "FileStoreTo"
__type__ = "hos | ter"
__version__ = "0.07"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?filestore\.to/\?d=(?P<ID>\w+)'
__con | fig__ = [("activated" , "bool", "Activated" , True),
("use_premium", "bool", "Use premium account if available", True)]
__description__ = """FileStore.to hoster plugin"""
__license__ = "GPLv3"
__authors__ = [("Walter Purcaro", "vuolter@gmail.com"),
... |
iut-ibk/P8-WSC-GUI | 3dparty/Editra/src/ebmlib/fileutil.py | Python | gpl-2.0 | 12,224 | 0.003027 | ###############################################################################
# Name: fileutil.py #
# Purpose: File Management Utilities. #
# Author: Cody Precord <cprecord@editra.org> #
... | C:\\\\" + path
else:
path = u"/" + path
path = urllib2.unquote(path)
return path
@uri2path
def GetPathName(path):
"""Gets the path minus filename
@param path: full path to get base of
"""
return os.path.split(path)[0]
@uri2path
def IsLink(path):
"""Is the file a l... | i2path
def PathExists(path):
"""Does the path exist.
@param path: file path or uri
@return: bool
"""
return os.path.exists(path)
@uri2path
def IsExecutable(path):
"""Is the file at the given path an executable file
@param path: file path
@return: bool
"""
return os.path.isfile... |
ktsitsikas/odemis | src/odemis/acq/align/autofocus.py | Python | gpl-2.0 | 23,236 | 0.001679 | # -*- coding: utf-8 -*-
"""
Created on 11 Apr 2014
@author: Kimon Tsitsikas
Copyright © 2013-2016 Kimon Tsitsikas and Éric Piel, Delmic
This file is part of Odemis.
Odemis 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... | 2 ** 4
if st | ep_factor * min_step > max_step:
# |
jeffery9/mixprint_addons | project_long_term/wizard/project_compute_phases.py | Python | agpl-3.0 | 3,262 | 0.003372 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Manag | ement Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# 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 (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more deta... |
cevap/ion | test/functional/test_framework/util.py | Python | mit | 22,607 | 0.004336 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify,... | t('inf'), timeout=float(' | inf'), lock=None):
i |
harshilasu/GraphicMelon | y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/beanstalk/layer1.py | Python | gpl-3.0 | 56,243 | 0.000338 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | description=None, s3_bucket=None,
s3_key=None, auto_create_application=None):
"""Creates an appli | cation version for the specified application.
:type application_name: string
:param application_name: The name of the application. If no
application is found with this name, and AutoCreateApplication is
false, returns an InvalidParameterValue error.
:type version_label:... |
ccxt/ccxt | python/ccxt/coinbasepro.py | Python | mit | 53,861 | 0.00104 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestri... | rt_id}',
'transfers',
'transfers/{transfer_id}',
'users/self/exchange-limits',
'users/self/hold-balances',
'users/self/trailing-volume',
'withdrawals/fee-estimate',
... |
'conversions',
'deposits/coinbase-account',
'deposits/payment-method',
'coinbase-accounts/{id}/addresses',
'funding/repay',
'orders',
'position/close',... |
DylanMcCall/stuartmccall.ca | common/templatetags/json_tools.py | Python | mit | 482 | 0.004149 | from django.template import Library
from django.utils.functional import Promise
import json
register = Library()
@register.filter
def json_dumps(json_object):
if isinstance(json_object, Promise):
| json_object = dict(json_object)
return json.dumps(json_object)
@register.filter
def json_dumps_pretty(json_object):
if isinstance(json_object, Promise):
json_object = dict(json_object)
return json.dumps(json_object, indent=4, separators=(',' | , ': '))
|
cztomczak/boovix | boovix1/utils/static_types.py | Python | bsd-3-clause | 868 | 0 | # Copyright (c) 2014, The Boovix authors that are listed
# in the AUTHORS file. All rights reserved. Use of this
# source code is governed by the BSD 3-clause license that
# can be found in the LICENSE file.
"""
Funct | ion annotations in Python 3:
http://legacy.python.org/dev/peps/pep-3107/
Type checking in Python 3:
* http://code.activestate.com/recipes/578528
* http://stackoverflow.com/questions/1275646
mypy static type checking during compilation:
https://mail.python.org/pipermail/python-ideas/2014-August/028618.html
from t... | t(input: List[str]) -> Dict[str, int]:
result = {} #type: Dict[str, int]
for line in input:
for word in line.split():
result[word] = result.get(word, 0) + 1
return result
Note that the #type: comment is part of the mypy syntax
"""
|
stephrdev/brigitte | brigitte/backends/__init__.py | Python | bsd-3-clause | 680 | 0.001471 | # -*- coding: utf-8 -*-
REPO_BACKENDS = {}
REPO_TYPES = []
class RepositoryTypeNotAvailable(Exception):
pass
try:
from brigitte.backends import libgit
REPO_BACKENDS['git'] = libgit.Repo
REPO_TYPES.append(('git', 'GIT'))
except ImportError:
from brigitte.backends import git
REPO_BACKENDS['git... | hg
REPO_BACKENDS['hg'] = hg.Repo
REPO_TYPES.append(('hg', 'Mercurial'))
except ImportError:
pass
def get_backend(repo_type):
if not repo_type in REPO_BACKENDS:
raise RepositoryTypeNotAvailable(repo_type)
ret | urn REPO_BACKENDS[repo_type]
|
dmsimard/ansible | docs/docsite/sphinx_conf/2.10_conf.py | Python | gpl-3.0 | 10,553 | 0.001516 | # -*- coding: utf-8 -*-
#
# documentation build configuration file, created by
# sphinx-quickstart on Sat Sep 27 13:23:22 2008-2009.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleab... | rter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
# The name of an image file (within the static path) to place at the top of
# the sidebar.
# html_logo =
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows... | .
# html_favicon = 'favicon.ico'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['../_static']
# If not '', a 'Last ... |
jparicka/twitter-tools | twitter-tools/wsgi.py | Python | mit | 403 | 0 | """
WSGI config for twitter-tools project.
It expose | s the WSGI callable as a module-level variable named ``a | pplication``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "twitter-tools.settings")
application = get_wsgi_application()
|
ktan2020/legacy-automation | win/Lib/site-packages/robot/result/xmlelementhandlers.py | Python | mit | 6,002 | 0.000167 | # Copyright 2008-2013 Nokia Siemens Networks Oyj
#
# 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... | teHandler(), StatisticsHandler(), ErrorsHandler()]
class SuiteHandler(_Handler):
tag = 'suite'
def start(self, elem, result):
| return result.suites.create(name=elem.get('name'),
source=elem.get('source', ''))
def _children(self):
return [DocHandler(), MetadataHandler(), SuiteStatusHandler(),
KeywordHandler(), TestCaseHandler(), self]
class RootSuiteHandler(SuiteHandler)... |
peterrenshaw/socsim | socsim/misc/extract.py | Python | gpl-3.0 | 2,087 | 0.004792 | #!/usr/bin/env python
# ~*~ encoding: utf-8 ~*~
"""
This file is part of SOCSIM.
SOCSIM 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) an... | section by name"""
| print(dir(name))
return True
def sections(self):
"""extract all sections"""
for section in self.c.sections():
self.section(section)
return True
def all(self):
"""return all sections in store"""
return self.store
def main():
pass
if __name__... |
tjma12/pycbc | pycbc/psd/__init__.py | Python | gpl-3.0 | 26,178 | 0.00275 | #!/usr/bin/python
# Copyright (C) 2014 Alex Nitz, Andrew Miller, Tito Dal Canton
#
# 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 late... | gle_ifo(opt, length_dict[ifo], delta_f_dict[ifo],
low_frequency_cutoff_dict[ifo], ifo,
strain=strain, **kwargs)
return psd
def insert_psd_option_group(parser, output=True, include_data_options=True):
"""
Adds the options used to ... | want to use these options in your code.
Parameters
-----------
parser : object
OptionParser instance.
"""
psd_options = parser.add_argument_group(
"Options to select the method of PSD generation",
"The options --psd-model, --psd-file, ... |
pinax/pinax-forums | pinax/forums/compat.py | Python | mit | 292 | 0 | try:
from account.decorators import login_requir | ed
| except ImportError:
from django.contrib.auth.decorators import login_required # noqa
try:
from account.mixins import LoginRequiredMixin
except ImportError:
from django.contrib.auth.mixins import LoginRequiredMixin # noqa
|
patrickm/chromium.src | tools/json_schema_compiler/idl_schema.py | Python | bsd-3-clause | 16,913 | 0.008159 | #! /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.
import itertools
import json
import os.path
import re
import sys
from json_parse import OrderedDict
# This file is a peer to jso... | # beginning of the next parameter's introduction.
param_comment_start = cur_param.end()
param_comment_end = next_param.start() if next_param else len(comment)
params[param_name] = | (comment[param_comment_start:param_comment_end
].strip().replace('\n\n', '<br/><br/>')
.replace('\n', ''))
return (parent_comment, params)
class Callspec(object):
'''
Given a Callspec node representing an IDL function declaration, con... |
flypy/pykit | pykit/ir/tests/test_interp.py | Python | bsd-3-clause | 1,210 | 0.001653 | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import unittest
from pykit.parsing import cirparser
from pykit.ir import verify, interp
source = """
#include <pykit_ir.h>
Int32 myglobal = 10;
float simple(float x) {
return x * x;
}
Int32 loop() {
Int32 i, sum = 0;
... | sum;
}
Int32 raise() {
Exception exc = new_exc("TypeError", "");
exc_throw(exc);
return 0;
}
"""
mod = cirparser.from_c(source)
verify(mod)
class TestInterp(unittest.TestCase):
def test_simple(self):
f = mod.get_function('simple')
result = interp.run(f, args=[10.0])
assert r... | oop')
result = interp.run(loop)
assert result == 45, result
def test_exceptions(self):
f = mod.get_function('raise')
try:
result = interp.run(f)
except interp.UncaughtException as e:
exc, = e.args
assert isinstance(exc, TypeError), exc
... |
UFSCar-CS-011/graph-theory-2012-2 | tasks/task2/t2-random-walks.py | Python | mit | 6,342 | 0.001577 | """
Trabalho T2 da disciplina Teoria dos Grafos, ministrada em 2014/02
'All Hail Gabe Newell'
Alunos:
Daniel Nobusada 344443
Thales Eduardo Adair Menato 407976
Jorge Augusto Bernardo 407844
"""
import networkx as nx
import numpy as... | odos os dados obtidos
print "w_power5: "
w_power5_lista = []
for i in range(0, w_power5.size):
w_power5_lista.append('%.4f'%w_power5[0, i])
print w_power5_lista
print "w_power100: "
w_power100_lista = []
for i in range(0, w_power100.size):
w_power100_lista.append('%.4f'%w_power100[0, i])
print w_power100_lista... | _random10000a
print "w_random10000b:"
print w_random10000b
# Para plotar no link: https://plot.ly/~thamenato/2/t2-random-walk/
# basta descomentar e executar o codigo novamente
# Tem de instalar a biblioteca (https://plot.ly/python/getting-started/)
# no Windows eh soh abrir o menu do Python(x,y) e escolh... |
changsimon/trove | trove/tests/int_tests.py | Python | apache-2.0 | 3,057 | 0 | # Copyright 2014 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 required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, eithe... | the
# License for the specific language governing permissions and limitations
# under the License.
import proboscis
from trove.tests.api import backups
from trove.tests.api import configurations
from trove.tests.api import databases
from trove.tests.api import datastores
from trove.tests.api import flavors
from ... |
scheib/chromium | content/test/gpu/gpu_tests/hardware_accelerated_feature_integration_test.py | Python | bsd-3-clause | 2,830 | 0.007067 | # Copyright 2017 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.
from __future__ import print_function
import sys
import os
from gpu_tests import gpu_integration_test
test_harness_script = r"""
function VerifyHardware... | super(cls, HardwareAcceleratedFeatureIntegrationTest).SetUpProcess()
cls.CustomizeBrowserArgs([])
cls.StartBrowser()
cls.SetStaticServerDirs([])
def _Navigate(self, url):
# It | 's crucial to use the action_runner, rather than the tab's
# Navigate method directly. It waits for the document ready state
# to become interactive or better, avoiding critical race
# conditions.
self.tab.action_runner.Navigate(
url, script_to_evaluate_on_commit=test_harness_script)
@classme... |
AlmostBetterNetwork/podmaster-host | assets/fields.py | Python | apache-2.0 | 1,224 | 0.000817 | from django.db import models
class AssetField(models.ForeignKey):
description = 'A file asset'
def __init__(self, **kwa | rgs):
kwargs.setdefault('blank', True)
kwargs.setdefault('null', True)
kwargs.setdefault('default', None)
# Normally, Django creates a backwards relationship, so you can have
#
# class Student(models.Model):
# classroom = models.ForeignKey(Classroom)
... | eignKeys that point at the same
# model:
#
# class Student(models.Model):
# study_hall_room = models.ForeignKey(Classroom)
# homeroom = models.ForeignKey(Classroom)
#
# Because now the backwards relationship has the same name
# (`student_set`) o... |
wladiarce/PepperPresenter | Presenter app (computer side)/back_end/BackEnd.py | Python | mit | 11,402 | 0.029205 | import htmlPy
import os
import json
from naoqi import ALProxy
from pptx import Presentation
import time
import math
#linked class with front end
class PepperApp(htmlPy.Object):
#GUI callable functions need to be in a class, inherited from htmlPy.Object and binded to the GUI
def __init__(self, app):
super(PepperApp... | lates turn angle
def retrieve_pointing_da | ta():
self.width = float(form_data['screen-width'])
self.height = float(form_data['screen-height'])
self.x = float(form_data['x'])
self.y = float(form_data['y'])
self.z = float(form_data['z'])
self.near = self.x + self.width/4
self.far = self.x + 3*self.width/4
self.upper = self.z + 3*self.heigh... |
technige/cypy | test/test_encoding.py | Python | apache-2.0 | 8,939 | 0.000224 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2002-2018, Neo4j
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use | this file except in co | mpliance 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, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expre... |
sserrot/champion_relationships | venv/Lib/site-packages/isapi/samples/redirector_with_filter.py | Python | mit | 6,630 | 0.006184 | # This is a sample configuration file for an ISAPI filter and | extension
# written in Python.
#
# Please see README.txt in this directory, and specifically the
# information about the "loader" DLL - installing this sample will create
# "_redirector_wi | th_filter.dll" in the current directory. The readme explains
# this.
# Executing this script (or any server config script) will install the extension
# into your web server. As the server executes, the PyISAPI framework will load
# this module and create your Extension and Filter objects.
# This sample provides samp... |
CompassionCH/compassion-switzerland | muskathlon/forms/order_material_form.py | Python | agpl-3.0 | 6,229 | 0.002087 | ##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py
#
#########################################################################... | ef form_widgets(self):
# Hide fields
res = super(OrderMaterialForm, self).form_widgets
res.update(
{
"form_id": "cms_form_compassion.form.widget.hidden",
"partner_id": "cms_form_compassi | on.form.widget.hidden",
"event_id": "cms_form_compassion.form.widget.hidden",
"description": "cms_form_compassion.form.widget.hidden",
}
)
return res
@staticmethod
def create_description(material, values, languages=["french", "german"]):
lines... |
wtsi-hgi/serapis | serapis/controller/logic/serapis_models.py | Python | agpl-3.0 | 13,059 | 0.008423 | #################################################################################
#
# Copyright (c) 2013 Genome Research Ltd.
#
# Author: Irina Colgiu <ic4@sanger.ac.uk>
#
# 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 ... | me:
return self.name
return None
@staticmethod
def build_from_db_model(db_mode | l):
raise NotImplementedError("Any entity subclass should implement the build_from_db_model method!")
class StudyModel(EntityModel):
@staticmethod
def build_from_db_model(db_study):
study_model = StudyModel()
study_model = StudyModel.copy_fields(db_study, study_model)
... |
StimOMatic/StimOMatic | python/OpenGLPlotting/pomp/apps/deprecated/01.06.2012/pCtrlLFP_old.py | Python | bsd-2-clause | 41,129 | 0.011598 | '''
TODO (29.05.2012):
1) show 1x, 2x, 3x threshold (as line)
2) auto scale in y axis? (calc and save min & max values of buffer)
3) draw y axis?
4) 'max_nbr_buffers_transmitted' must be 1 and 'framesize' must be 512 otherwise we get in trouble in RT mode.
5) set 'SHIFT_VIEW' in update() and dequeue in 'do_draw'?... | AULT = 800
WIN_WIDTH_DEFAULT = 800
# 512 is neuralynx specific.
NBR_DATA_POINTS_PER_BUFFER = 1.0
NBR_DATA_POINTS_PER_BUFFER_INT = int(NBR_DATA_POINTS_PER_BUFFER)
SCANRATE = 1
SECONDS_TO_VISUALIZE_PER_PANEL = 1.0
# approximate number of data point per VB | O. will change and be adjusted so that
# this number is a multiple of NBR_DATA_POINTS_PER_BUFFER
NBR_DATA_POINTS_PER_VBO = 200
# how many times per second should we call the update function?
#CALL_UPDATE_X_TIMES_PER_SECOND = 67.0
# TODO: check what a reasonable value for 'CALL_UPDATE_X_TIMES_PER_SECOND' is.
# going f... |
karacos/karacos-wsgi | lib/wsgioauth/mock.py | Python | lgpl-3.0 | 2,042 | 0.003918 | # -*- coding: utf-8 -*-
import urllib
from oauth2 import Consumer
from webob import Request, Response
from wsgioauth import calls
from wsgioauth.provider import Application, Storage
from wsgioauth.utils import CALLS
from wsgioauth.provider import Storage, Token
ROUTES = {
u'getConsumers': calls.getCons... |
return echo | _app
STORAGE = None
def app_factory(*global_conf, **local_conf):
CALLS.update(ROUTES)
global STORAGE
if STORAGE is None:
storage_cls = getMockStorage()
STORAGE = storage_cls(local_conf)
def storage_lookup(environ, conf):
return STORAGE
return Application(storage... |
devshans/script.service.hdmipowersave | resources/lib/settings.py | Python | mit | 415 | 0.009639 | import uuid
im | port xbmc
import xbmcaddon
settings = {}
addon = xbmcaddon.Addon()
settings['debug'] = addon.getSetting('debug') == "true"
settings['powersave_minutes'] = int(addon.getSetting('powersave_minutes'))
settings['version'] = addon.getAddonInfo('version')
settings['uuid'] = str(addon.getS... | uid', settings['uuid'])
|
alexpark07/ARMSCGen | shellcodes/arm64/syscall.py | Python | gpl-2.0 | 9,178 | 0.032905 | syscall_table = {}
syscall_table[202]="accept"
syscall_table[242]="accept4"
syscall_table[1033]="access"
syscall_table[89]="acct"
syscall_table[217]="add_key"
syscall_table[171]="adjtimex"
syscall_table[1059]="alarm"
syscall_table[1075]="bdflush"
syscall_table[200]="bind"
syscall_table[214]="brk"
syscall_table[90]="cap... | "
syscall_table[18]="lookup_dcookie"
syscall_table[15]="lremovexattr"
syscall_table[62]="lseek"
syscall_table[6]="lsetxattr"
syscall_table[1039]=" | lstat"
syscall_table[1050]="lstat64"
syscall_table[233]="madvise"
syscall_table[235]="mbind"
syscall_table[238]="migrate_pages"
syscall_table[232]="mincore"
syscall_table[1030]="mkdir"
syscall_table[34]="mkdirat"
syscall_table[1027]="mknod"
syscall_table[33]="mknodat"
syscall_table[228]="mlock"
syscall_table[230]="mloc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.