code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class ChromiumMemoryFYI(Master.Master1):
project_name = 'Chromium Memory FYI'
master... | eunchong/build | masters/master.chromium.memory.fyi/master_site_config.py | Python | bsd-3-clause | 446 |
from django.http import HttpResponse
from django.template import loader
from django.views.generic import View
from django.core import serializers
from django.shortcuts import render
from .models import Statement
class Index(View):
'''
Returns an HTML page with an idex of mission.Statement objects.
URL:... | kidsfm/cms | mission/views.py | Python | gpl-3.0 | 2,817 |
# coding:utf-8
import os
import logging
import logging.config as log_conf
log_dir = os.path.dirname(os.path.dirname(__file__))+'/logs'
if not os.path.exists(log_dir):
os.mkdir(log_dir)
log_path = os.path.join(log_dir, 'run.log')
log_config = {
'version': 1.0,
'formatters': {
'detail': {
... | alexknight/jobscrawler | logger/log.py | Python | apache-2.0 | 1,451 |
# Copyright (c) 2010- The University of Notre Dame.
# This software is distributed under the GNU General Public License.
# See the file COPYING for details.
""" Weaver utility module """
from weaver.compat import compat_next, zip_longest
import functools
import itertools
import errno
import os
# Constants
D_UTIL ... | isanwong/cctools | weaver/src/weaver/util.py | Python | gpl-2.0 | 7,570 |
import quantities as pq
from neo import io
from neo import core
from pytz import timezone
from django.utils import timezone as tz
from django.core.management.base import BaseCommand, CommandError
from broab import models
def clean_annotations(annotations):
""" makes sure that keys & values of annotations are all ... | gentnerlab/django-broab | broab/management/commands/import_from_neo.py | Python | bsd-3-clause | 16,351 |
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | impowski/servo | python/servo/command_base.py | Python | mpl-2.0 | 22,996 |
# -*- coding: utf-8 -*-
from karlooper.config import get_global_conf
from karlooper.web.request import Request
__author__ = "karlvorndoenitz@gmail.com"
class ChatController(Request):
def get(self):
redis_manager = get_global_conf("redis")
user_list = redis_manager.get_user_list()
user_id... | karldoenitz/karlooper | demos/chat-group/handlers/controllers.py | Python | mit | 577 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from argparse import Namespace
import logging
from typing import Union, Tuple, Optional
import torch
import torch.nn as nn
import torch.nn.fu... | pytorch/fairseq | fairseq/models/speech_to_text/hub_interface.py | Python | mit | 4,716 |
#!/usr/bin/env python
'''
This example shows how to display a SimpleCV image in a QT window
the code was taken from the forum post here:
http://help.simplecv.org/question/1866/any-simple-pyqt-sample-regarding-ui-or-display/
Author: Rodrigo gomes
'''
import os
import sys
import signal
from PyQt4 import uic, QtGui, Qt... | beni55/SimpleCV | SimpleCV/examples/display/qt-example.py | Python | bsd-3-clause | 2,247 |
#!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
# Test the 'symlink' rule.
from __future__ import print_function
import os
import BoostBuild
... | davehorton/drachtio-server | deps/boost_1_77_0/tools/build/test/symlink.py | Python | mit | 904 |
# Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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... | chrislit/abydos | tests/distance/test_distance_clark.py | Python | gpl-3.0 | 2,001 |
"""
Small Modification of src/examples/Geometry/geometry_demos.py
"""
from OCC.gp import *
from OCC.Geom import *
from OCC.TColGeom import *
from OCC.TColgp import *
from OCC.GeomConvert import *
from OCC.BRepBuilderAPI import *
from OCC.TopoDS import *
from OCC.STEPControl import *
from OCC.Display.SimpleGui import... | GeoMop/PythonOCC_Examples | src/bspline_surface.py | Python | gpl-2.0 | 3,394 |
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
from pyasn1.type import base, tag, univ, char, useful, tagmap
from pyasn1.codec.ber import eoo
from pyasn1.compat.octets import oct2int, octs2ints, ints2octs, null
from ... | saurabhbajaj207/CarpeDiem | venv/Lib/site-packages/pyasn1/codec/ber/decoder.py | Python | mit | 47,384 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-06 15:02
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operation... | MTG/dunya | dashboard/migrations/0001_initial.py | Python | agpl-3.0 | 6,237 |
#
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... | ambikeshwar1991/gnuradio-3.7.4 | gnuradio-runtime/python/gnuradio/ctrlport/__init__.py | Python | gpl-3.0 | 1,023 |
# -*- coding: utf-8 -*-
"""
Create and modify labels on github to have same labels and same color
on all repo
"""
from .github_login import login
REPO_TO_IGNORE = [
'odoo-community.org',
'community-data-files',
'contribute-md-template',
'website',
]
# here is the list of labels we need in each rep... | savoirfairelinux/maintainer-tools | tools/set_repo_labels.py | Python | agpl-3.0 | 2,497 |
from __future__ import absolute_import
from sqlalchemy import *
from migrate import *
meta = MetaData()
itemversions = Table('itemversions', meta,
Column('id', Integer, primary_key=True),
Column('item_id', Integer, ForeignKey('items.id')),
Column('timestamp', Float, index=True),
Column... | inducer/synoptic | synoptic/schema_ver_repo/versions/002_Add_times_and_reminders.py | Python | mit | 825 |
"""
module to test the time conversion utilities
"""
from nose.tools import eq_, assert_almost_equal
import datetime as dt
from unittest import TestCase
from cis.time_util import convert_sec_since_to_std_time, convert_datetime_to_std_time, \
convert_julian_date_to_std_time
class TestTimeUtils(TestCase):
def... | zak-k/cis | cis/test/unit/test_time_util.py | Python | gpl-3.0 | 4,378 |
"""SCons.Tool.dvips
Tool-specific initialization for dvips.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Per... | cournape/numscons | numscons/scons-local/scons-local-1.2.0/SCons/Tool/dvips.py | Python | bsd-3-clause | 3,442 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dataset', '0041_referencepaper'),
]
operations = [
migrations.AddField(
model_name='dataset',
name='... | poldracklab/open_fmri | open_fmri/apps/dataset/migrations/0042_dataset_orientation_warning.py | Python | bsd-3-clause | 417 |
#coding:utf-8
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Block(models.Model):
title = models.CharField(u'名称',max_length = 40)
describe = models.CharField(u'描述',max_length = 1000)
ower = models.ForeignKey(User,verbose_name = u'管理员')
create_... | undefine1995/forumFarme | block/models.py | Python | gpl-3.0 | 597 |
# -*- coding: utf-8 -*-
import scipy.odr
from numpy import *
from PySide2.QtCore import QObject, Signal
class Fit(QObject):
finished = Signal()
def __init__(self, maxit=1000):
QObject.__init__(self)
self.maxit = maxit
self.ready = False
self.x, self.xerr = [], []
se... | wwmm/wwplot | WWplot/fit.py | Python | gpl-3.0 | 1,679 |
#!/usr/bin/env python
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# 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 t... | drbild/boto | setup.py | Python | mit | 4,832 |
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 0.5, s, t 1, s, t 1.5, s, t 2.1, s, q"
tags = "ShuffleTransition"
import summa
from summa.director import director
from summa.actions impor... | shackra/thomas-aquinas | tests/test_transition_shuffle.py | Python | bsd-3-clause | 1,178 |
# Copyright 2016 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... | jthurst3/MemeCaptcha | models_cnn_lstm/im2txt/im2txt/train.py | Python | mit | 4,271 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import copy
from pymatgen.core.structure import Molecule
from pymatgen.io.babel import BabelMolAdaptor
from pymatgen.analysis.graphs import MoleculeGraph
from pymatgen.analysis.local_env import OpenBabelNN
tr... | dongsenfo/pymatgen | pymatgen/analysis/functional_groups.py | Python | mit | 14,690 |
#!/usr/bin/env python
# Copyright 2015 IIX Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | Slezhuk/ansible | contrib/inventory/ovirt.py | Python | gpl-3.0 | 9,908 |
import json
import logging
from django.core.management.base import BaseCommand
from ngw.extensions.matrix import matrix
class Command(BaseCommand):
help = 'list matrix users'
def handle(self, **options):
logger = logging.getLogger('command')
verbosity = options.get('verbosity', None)
... | nirgal/ngw | extensions/matrix/management/commands/matrix_get_version.py | Python | bsd-2-clause | 729 |
# -*- coding: utf-8 -*-
#= DESCRIZIONE =================================================================
# C'è un grappolo di glicine in terra NO_LOOK_LIST suggerito dalle descrizoni
# della room.
# Se si cerca di raccoglierlo ogni tanto non va a buon fine (troppe api)
# Se il get va a buon fine viene rimossa la flag... | Onirik79/aaritmud | data/proto_items/torreelementi/torreelementi_item_grappolo-glicine-01.py | Python | gpl-2.0 | 3,136 |
#################################################################################
## _________ ____ ________ _______ __ _____ __ __ __________ __
## / ____/ | / __ \/_ __/ / / / ___// / / / | / //_// ____/ __ \/ /
## / __/ / /| | / /_/ / / / / /_/ /\__ \/ /_/ / /| | / ,< / __/ / /_/ / /
## ... | scottdanesi/earthshaker-aftershock | launcher.py | Python | gpl-3.0 | 2,657 |
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2015 Red Hat, 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 r... | walteryang47/ovirt-engine | packaging/setup/plugins/ovirt-engine-common/vmconsole_proxy_helper/__init__.py | Python | apache-2.0 | 841 |
#!/usr/bin/env python
"""
A utility to synchronize directories across a local network.
"""
def main():
"""
Main entry to the application.
"""
print("Hello World!")
if __name__ == '__main__':
main()
| ambauma/RemoteDirectorySync | rds/rds.py | Python | gpl-3.0 | 222 |
import math
import pandas as pd
import numpy as np
def root_sum_square(x, y, z):
sum = ((x**2)+(y**2)+(z**2))
rss = math.sqrt(sum)
return rss
def root_mean_square(x, y, z):
mean = ((x**2)+(y**2)+(z**2))/3
rss = math.sqrt(mean)
return rss
def tiltx(x, y, z):
try:
... | ChristopherGS/sensor_readings | ML_Sandbox/rolltec_features.py | Python | bsd-3-clause | 7,027 |
"""empty message
Revision ID: 066068bfab82
Revises: 7_add_scenario
Create Date: 2017-06-11 00:00:53.694730
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8_add_user_phone'
down_revision = '7_add_scenario'
branch_labels = None
depends_on = None
def upgrade()... | pablodiguerero/asterisk.api | migrations/versions/8_add_user_phone_.py | Python | mit | 836 |
class Solution:
# @return a list of strings, [s1, s2]
def letterCombinations(self, digits):
d = {
'2': 'abc',
'3': 'def',
'4': 'ghi',
'5': 'jkl',
'6': 'mno',
'7': 'pqrs',
'8': 'tuv',
'9': 'wxyz',
}
... | huanqi/leetcode-python | letter_combinations_of_a_phone_number/solution2.py | Python | bsd-2-clause | 842 |
import os
import subprocess
class eventLookupClientEI:
def __init__(self):
pass
def doLookup(self,runEvtList,stream=None,tokens=None,amitag=None,user=None):
command = 'java -jar ' + \
os.getenv('EIDIR', '/afs/cern.ch/sw/lcg/external/Java/TagConvertor/head/share') + \
... | fbarreir/panda-server | pandaserver/dataservice/eventLookupClientEI.py | Python | apache-2.0 | 2,177 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | zhiwehu/zhiwehu | zhiwehu/users/migrations/0001_initial.py | Python | apache-2.0 | 2,780 |
#!/usr/bin/python
#
# Copyright (C) 2006-2018 Wyplay, All Rights Reserved.
# This file is part of xbuilder.
#
# xbuilder 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
# (a... | frogbywyplay/genbox_xbuilder | xbuilder/consts.py | Python | gpl-2.0 | 1,713 |
#!/usr/bin/python3.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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 app... | kdart/pycopia3 | QA/pycopia/remote/windows_objects.py | Python | apache-2.0 | 1,942 |
from django.core.urlresolvers import reverse
from oscar.test import testcases, factories
from oscar.apps.offer import models
class TestAnAdmin(testcases.WebTestCase):
# New version of offer tests buy using WebTest
is_staff = True
def setUp(self):
super(TestAnAdmin, self).setUp()
self.ran... | marcoantoniooliveira/labweb | tests/functional/dashboard/offer_tests.py | Python | bsd-3-clause | 3,843 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Copyright (c) 2001-2004, MetaSlash Inc. All rights reserved.
# Portions Copyright (c) 2005, Google, Inc. All rights reserved.
"""
Warning Messages for PyChecker
"""
import UserString
class WarningClass:
level = 0
def __init__(self, msg, level_offset=None):
... | smspillaz/pychecker | pychecker/msgs.py | Python | bsd-3-clause | 9,062 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2018-2020 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | chipaca/snapcraft | snapcraft/project/_project.py | Python | gpl-3.0 | 5,430 |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='funfolding',
version... | mbrner/funfolding | setup.py | Python | mit | 1,277 |
# Imperialism remake
# Copyright (C) 2014-16 Trilarion
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progra... | Trilarion/imperialism-remake | examples/lib/browser_example.py | Python | gpl-3.0 | 1,411 |
# SPDX-License-Identifier: LGPL-3.0-or-later
# dlb - a Pythonic build tool
# Copyright (C) 2020 Daniel Lutz <dlu-ch@users.noreply.github.com>
"""Version of dlb.
This is an implementation detail - do not import it unless you know what you are doing."""
__version__ = '?' # is replaced when packaged
version_info = (0,... | dlu-ch/dlb | src/dlb/version.py | Python | lgpl-3.0 | 351 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import re
import logging
from flexget import plugin
from flexget.event import event
from flexget.plugins.internal.urlrewriting import UrlRewritingError
from flexget.utils.... | jawilson/Flexget | flexget/plugins/sites/frenchtorrentdb.py | Python | mit | 2,131 |
import argparse
import yaml
from jubatus.classifier.client import classifier
from jubatus.classifier.types import *
from jubaweather.version import get_version
def parse_options():
parser = argparse.ArgumentParser()
parser.add_argument(
'-a',
required = True,
help = 'analyze data file (YAML)',
... | kosugawala/jubatus-weather | python/jubaweather/main.py | Python | mit | 2,275 |
"""CUDA test function
testKNN_call_multiGPU.py
Created on: 15/03/2014, modified 06/03/2019
Authors: cgongut, pwollstadt
Test parallel knn- and range-searches on GPU using CUDA. Kernel handles
multiple problem instances (search spaces) in parallel, where each search
space is called a 'chunk'. Each chunk is... | pwollstadt/IDTxl | dev/search_GPU/deliverable1_1/test_cuda_search.py | Python | gpl-3.0 | 3,923 |
# -*- coding: utf-8 -*-
# pylint:disable=invalid-name, too-many-arguments
"""Transformed image jacobians
"""
from __future__ import division, print_function
import numpy as np
import scipy.ndimage as ndi
from .toolbox import image_jaco
def image_gradient(image, horv):
"""apply a sobel filter to the image to appro... | welch/rasl | rasl/jacobian.py | Python | mit | 4,163 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/storage/azure-mgmt-storageimportexport/azure/mgmt/storageimportexport/aio/__init__.py | Python | mit | 558 |
'''
Implementation of Bitcoin's p2p protocol
'''
import random
import sys
import time
from twisted.internet import protocol
import p2pool
from . import data as bitcoin_data
from p2pool.util import deferral, p2protocol, pack, variable
class Protocol(p2protocol.Protocol):
def __init__(self, net):
p2protoc... | trupa/p2pool-Extended | p2pool/bitcoin/p2p.py | Python | gpl-3.0 | 6,156 |
# -*- coding: utf-8 -*-
"""
scikit-MDR was primarily developed at the University of Pennsylvania by:
- Randal S. Olson (rso@randalolson.com)
- Tuan Nguyen (tnguyen4@swarthmore.edu)
- and many more generous open source contributors
Permission is hereby granted, free of charge, to any person obtaining a cop... | EpistasisLab/scikit-mdr | mdr/mdr_ensemble.py | Python | mit | 5,540 |
import os
import csv
def build_bots_filter():
"""
Build dictionary for fast-lookup of all Twitter userIDs determined to be of organizations
:return: dictionary of userID strings - presence in the dictionary = organization
"""
bot_users = {} # dict for quick lookup
bots_folders = ['../humanizr/... | joh12041/chi-2016-localness | rq1and3_localness/utils/bots.py | Python | mit | 961 |
# -*- coding: utf-8 -*-
# Copyright: Albertix <albertix@live.com>
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
from .collection import *
| albertix/csv2anki | csv2anki/__init__.py | Python | agpl-3.0 | 172 |
# 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 ... | v-iam/azure-sdk-for-python | azure-monitor/azure/monitor/monitor_client.py | Python | mit | 4,817 |
#!/usr/bin/env python3
#
# Copyright (c) 2018, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | lanyuwen/openthread | tests/toranj/test-018-child-supervision.py | Python | bsd-3-clause | 7,076 |
"""
Instructor Dashboard API views
JSON views which the instructor dashboard requests.
Many of these GETs may become PUTs in the future.
"""
import StringIO
import json
import logging
import re
import time
from django.conf import settings
from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.d... | TheMOOCAgency/edx-platform | lms/djangoapps/instructor/views/api.py | Python | agpl-3.0 | 137,842 |
import StringIO
import tokenize
INVALID_WKT_FMT = 'Invalid WKT: `%s`'
def dump(obj, dest_file):
"""
Dump GeoJSON-like `dict` to WKT and write it to the `dest_file`.
:param dict obj:
A GeoJSON-like dictionary. It must at least the keys 'type' and
'coordinates'.
:param dest_file:
... | schlos/OIPA-V2.1 | OIPA/geodata/geojson_to_wkt.py | Python | agpl-3.0 | 10,831 |
"""
StackState.
ServiceNow Topology Extraction
"""
# 3rd party
import requests
# project
from checks import AgentCheck, CheckException
EVENT_TYPE = SOURCE_TYPE_NAME = 'servicenow'
class InstanceInfo():
def __init__(self, instance_key, instance_tags, base_url, auth):
self.instance_key = instance_... | StackVista/sts-agent-integrations-core | servicenow/check.py | Python | bsd-3-clause | 7,272 |
#!/usr/bin/env python
#
# Copyright 2005-2007,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import time
import random
from argparse import ArgumentParser
from gnuradio import gr
from gnuradio import blocks, filter
from gnuradio.eng_arg import e... | dl1ksv/gnuradio | gr-filter/examples/benchmark_filters.py | Python | gpl-3.0 | 1,930 |
# -*- coding: utf-8 -*-
# Created by apple on 2017/2/21.
from datetime import datetime
from ..log import log
class Date:
@staticmethod
def time2datetime(t) -> datetime:
"""
时间戳转datetime
:param t: 1970开始的秒数
:return:
"""
if t:
try:
ret... | skytoup/AppServer | app/utils/date.py | Python | mit | 511 |
from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
users = User.objects.all()
for user in users:
token, created = Token.objects.get_or_create(user=user)
print (user.username, token.key)
| mmaguero/MII-SSBW16-17 | venvs/sitio_web/tokensGenerate.py | Python | mit | 239 |
# -*- coding: utf-8 -*-
#
# SelfTest/Cipher/test_pkcs1_15.py: Self-test for PKCS#1 v1.5 encryption
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone i... | mchristopher/PokemonGo-DesktopMap | app/pylibs/osx64/Cryptodome/SelfTest/Cipher/test_pkcs1_15.py | Python | mit | 7,415 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import functools
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QDesktopServices
contexts = {}
def registerContext(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
self = args[0]
if hasattr(self, '__contextName__'):
cont... | dragondjf/QMusic | src/controllers/utils.py | Python | lgpl-2.1 | 976 |
# Copyright (C) 2000-2012 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | terencehonles/mailman | src/mailman/runners/nntp.py | Python | gpl-3.0 | 8,267 |
# -*- coding: utf-8 -*-
#
# davos documentation build configuration file, created by
# sphinx-quickstart on Sat Jul 29 08:01:32 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | linuxserver/davos | docs/source/conf.py | Python | mit | 5,191 |
# Copyright (c) 2012-2019, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 3.3.0
from . import AWSObject
from . import AWSProperty
from troposphere import Tags
VALID_HOMEDIRECTORY_TYPE = ... | ikben/troposphere | troposphere/transfer.py | Python | bsd-2-clause | 2,096 |
# Gmail IMAP repository support
# Copyright (C) 2008 Riccardo Murri <riccardo.murri@gmail.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
# ... | dimpase/offlineimap | offlineimap/repository/Gmail.py | Python | gpl-2.0 | 3,106 |
# -*-coding:Utf-8 -*
# Copyright (c) 2013 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... | stormi/tsunami | src/secondaires/navigation/equipage/volontes/tenir_gouvernail.py | Python | bsd-3-clause | 3,986 |
from django.db import models
from django.contrib.auth.models import User
class TwitterInfo(models.Model):
user = models.OneToOneField(User)
name = models.CharField(max_length=15)
id = models.BigIntegerField(primary_key=True)
token = models.CharField(max_length=100)
secret = mo... | olupotd/news_feed | twitter_users/models.py | Python | bsd-3-clause | 351 |
# Author: Thomas Dimson [tdimson@gmail.com]
# Date: January 2011
# For distribution details, see LICENSE
"""Module containing abstract base class for standalone models."""
import os
import logging
import subprocess
from model_task import ModelTask
from config import config
class StandaloneError(RuntimeError): pass
c... | cosbynator/NPSGD | npsgd/standalone_task.py | Python | bsd-3-clause | 1,821 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
name = 'pimagizer'
version = "0.4.7"
license = 'GPL-3'
| vfrico/pimagizer | pimagizer/info.py | Python | gpl-3.0 | 97 |
# -*- coding: utf-8 -*-
from ccxt.async.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NotSupported
class bitstamp1 (Exchange):
def describe(self):
return self.deep_extend(super(bitstamp1, self).describe(), {
'id': 'bitstamp1',
... | tritoanst/ccxt | python/ccxt/async/bitstamp1.py | Python | mit | 10,415 |
# Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import configparser # For reading the legacy profile INI files.
import io
import json # For reading the Dictionary of Doom.
import math # For mathematical operations included in the Dictionary of Doom.
import os.path # ... | alephobjects/Cura2 | plugins/LegacyProfileReader/LegacyProfileReader.py | Python | lgpl-3.0 | 10,008 |
import string
from ometa.runtime import (InputStream, ParseError, EOFError, ArgInput,
joinErrors, expected, LeftRecursion)
def decomposeGrammar(grammar):
rules = {}
#XXX remove all these asserts once we have quasiterms
assert grammar.tag.name == 'Grammar'
for rule in grammar.... | pde/torbrowser-launcher | lib/Parsley-1.1/ometa/interp.py | Python | mit | 19,400 |
##########################################################################
#
# Copyright (c) 2011, John Haddon. All rights reserved.
# Copyright (c) 2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | hradec/gaffer | python/GafferTest/PathFilterTest.py | Python | bsd-3-clause | 4,847 |
# 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 t... | Shihta/python-novaclient | novaclient/tests/fixture_data/servers.py | Python | apache-2.0 | 24,055 |
"""The test for the threshold sensor platform."""
import unittest
from homeassistant.setup import setup_component
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT, STATE_UNKNOWN, TEMP_CELSIUS)
from tests.common import get_test_home_assistant
class TestThresholdSensor(unittest.TestCase):
"""Tes... | persandstrom/home-assistant | tests/components/binary_sensor/test_threshold.py | Python | apache-2.0 | 13,704 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# Copyright: (c) 2018, Christian Kotte <christian.kotte@gmx.de>
# 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_f... | Jorge-Rodriguez/ansible | lib/ansible/modules/cloud/vmware/vmware_host_vmnic_facts.py | Python | gpl-3.0 | 14,150 |
from ...error import GraphQLError
from ...utils.type_comparators import do_types_overlap
from ...utils.type_from_ast import type_from_ast
from .base import ValidationRule
class PossibleFragmentSpreads(ValidationRule):
def enter_InlineFragment(self, node, key, parent, path, ancestors):
frag_type = self.co... | wandb/client | wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/possible_fragment_spreads.py | Python | mit | 2,193 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2021-09-13 20:08
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import osf.models.base
import osf.utils.fields
class Migratio... | mfraezz/osf.io | osf/migrations/0236_auto_20210913_2008.py | Python | apache-2.0 | 6,721 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
############################################################################################
#
# Zoook. OpenERP e-sale, e-commerce Open Source Management Solution
# Copyright (C) 2011 Zikzakmedia S.L. (<http://www.zikzakmedia.com>). All Rights Reserved
#
# Source C... | eoconsulting/django-zoook | setup.py | Python | agpl-3.0 | 2,045 |
import _plotly_utils.basevalidators
class HoverformatValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="hoverformat", parent_name="layout.scene.xaxis", **kwargs
):
super(HoverformatValidator, self).__init__(
plotly_name=plotly_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/layout/scene/xaxis/_hoverformat.py | Python | mit | 433 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | mcgonagle/ansible_f5 | library_old/bigip_config.py | Python | apache-2.0 | 10,671 |
import collections
import copy
import itertools
import sys
import typing
import ply
import quicktions
from ply import lex
from ply.yacc import ( # type: ignore
YaccProduction,
YaccSymbol,
error_count,
format_result,
format_stack_entry,
)
from .. import bind as _bind
from .. import duration as _du... | Abjad/abjad | abjad/parsers/parser.py | Python | gpl-3.0 | 222,753 |
#!/usr/bin/env python
########################################################################
# FastGeneralizedSuffixArrays v0.1 #
# (c) 2011 Mark Mazumder #
# markmaz.com #
####... | pasilvagh/U | cloud2015-1/otherImplementations/FastGeneralizedSuffixArrays-master/sa.py | Python | mit | 5,638 |
# -*- coding: utf-8 -*-
"""
unit_conversion.py
==================
Functions for checking and sanitizing units that do not follow the FITS specification.
This uses functions from ``astropy.unit`` to parse and handle units.
"""
import warnings
from astropy.units import Unit, UnrecognizedUnit
from astropy.io.fits.verify... | telegraphic/fits2hdf | fits2hdf/unit_conversion.py | Python | mit | 2,314 |
# -*- coding: utf-8 -*-
from django.contrib.gis import forms
from shops.models import Shop
from utils.forms.widgets import PointWidget
class ShopAdminForm(forms.ModelForm):
point = forms.PointField(widget=PointWidget, label=u'Координаты')
class Meta:
model = Shop
| Lisaveta-K/lisaveta-k.github.io | _site/tomat/apps/shops/forms.py | Python | mit | 295 |
#!/bin/python3
import colorsys
import sys
# Color scheme formula:
# dictionary of all the keys found in the color.conf file, with as value
# a tuple of hue, saturation, and value adjustments
recipe1 = {
"dmenu color": {
"c_m_normal_bg": (0, -0.5, -0.7),
"c_m_normal_fg": (0, -0.8, 0),
"c_m... | michd/dotfiles | .config/i3/config.d/available/colorgen.py | Python | unlicense | 6,248 |
#!/usr/bin/env python
import os
import time
from eutester.euca.euca_ops import Eucaops
from eutester.utils.eutestcase import EutesterTestCase
from eutester.utils.machine import Machine
class SOSreport(EutesterTestCase):
def __init__(self):
self.setuptestcase()
self.setup_parser()
self.sta... | nephomaniac/eutester | eutester/testcases/admin/run_sos_report.py | Python | bsd-2-clause | 3,730 |
import os
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
# This application object is used by the development server
# as well as any WSGI server configured to use this file.
(head, path) = os.path.split(os.path.dirname(os.path.realpath(__file__)))
sys.path = [ head ] + sys.path
from django.... | rishabhsixfeet/Dock- | userInfo/wsgi.py | Python | mit | 395 |
# -*- coding: utf-8 -*-
"""
Tests for Degreed Learner Data exporters.
"""
import datetime
import unittest
import ddt
import mock
from freezegun import freeze_time
from mock.mock import MagicMock
from pytest import mark
from django.utils import timezone
from integrated_channels.degreed2.exporters.learner_data import... | edx/edx-enterprise | tests/test_integrated_channels/test_degreed2/test_exporters/test_learner_data.py | Python | agpl-3.0 | 5,117 |
import numpy as np
import os.path as op
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_true, assert_false, assert_equal, assert_raises
import mne
from mne import io, Epochs, read_events, pick_types, create_info, EpochsArray
from mne.utils import (_TempDir, run_tes... | alexandrebarachant/mne-python | mne/time_frequency/tests/test_tfr.py | Python | bsd-3-clause | 23,562 |
# -*- coding: utf-8 -
"""This module is designed to hold components with their classes and
associated individual constraints (blocks) and groupings. Therefore this
module holds the class definition and the block directly located by each other.
SPDX-FileCopyrightText: Uwe Krien <krien@uni-bremen.de>
SPDX-FileCopyright... | oemof/oemof_base | src/oemof/solph/components.py | Python | gpl-3.0 | 71,797 |
import unittest
from fam.tests.models.test01 import Monster, Weapons
class AnythingBaseTests:
class AnythingTests(unittest.TestCase):
db = None
def test_Object_field(self):
weapons = Weapons("large", "hot", ["2", "2"])
key = "a_monster"
monster = Monster(key... | paulharter/fam | src/fam/tests/common/anything_tests.py | Python | mit | 503 |
#!/usr/bin/env python
"""configscript_curses.py
Kind of like configscript.py, except written using urwid.
Also recycles a lot of configscript.py, too. :-)
"""
# Copyright (C) 2009 Andrew Psaltis
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU ... | dpaleino/wicd | curses/configscript_curses.py | Python | gpl-2.0 | 5,496 |
from joernInterface.JoernInterface import jutils
from joernInterface.nodes.Callee import Callee
class CalleeLookup:
@staticmethod
def calleesByName(code):
lucene_query = 'type:Callee AND code:"{}"'.format(code)
symbols = jutils.lookup(lucene_query)
return map(lambda x : Callee(x[0... | a0x77n/chucky-ng | chucky/joernInterface/indexLookup/CalleeLookup.py | Python | gpl-3.0 | 356 |
"""
WSGI config for django_qa project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`... | milin/django-qa | config/wsgi.py | Python | bsd-3-clause | 1,621 |
import wx.lib.ogl as ogl
from myhdl import Signal, always, always_comb, instances
from MyHDLSim.combinational import And
from MyHDLSim.Wrappers.GenericGateWrapper import GenericGateWrapper
class AndGateShape(ogl.PolygonShape):
""" This shape is used exclusively to contruct the AND Gate main shape.
The shap... | mattsnowboard/msu-myhdlsim | MyHDLSim/Wrappers/AndGateWrapper.py | Python | bsd-2-clause | 1,155 |
NICI_KeyDict = {
"key_camera":"INSTRUME",
"key_focal_plane_mask":"FPMW",
"key_pupil_mask":"PMW",
"key_filter_r":"FILTER_R",
"key_filter_b":"FILTER_B",
"key_exposure_time_r":"ITIME_R",
"key_exposure_time_b":"ITIME_B",
"key_coadds_r":"NCOADD_R",
"key_coadds_b":"NCOADD_B",
}
| pyrrho314/recipesystem | trunk/dontload-astrodata_Gemini/ADCONFIG_Gemini/descriptors/NICI/NICI_Keywords.py | Python | mpl-2.0 | 313 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.