gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import AppKit
from PyObjCTools import AppHelper
import sys
import os
from random import randint
from fontTools.misc.py23 import PY3
from drawBot.ui.drawBotController import DrawBotController
from drawBot.ui.preferencesController import PreferencesController
from drawBot.ui.debug import DebugWindowController
from dra... | |
# 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... | |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publis... | |
"""Unit tests for CRUD operations in hydrus.data.crud."""
import unittest
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
import hydrus.data.crud as crud
from hydrus.data.db_models import Base
from hydrus.data import doc_parse
from hydra_python_core import doc_maker
from h... | |
# Copyright 2016 Massachusetts Open Cloud
#
# 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... | |
"""Custom parser for EXECUTE attributes.
The values are parsed from SQL file given to EXECUTE.
Format rules:
* Only lines starting with meta-comment prefix will be parsed: --*--
* Empty or regular SQL comment lines are ignored.
* Parsing stops on first SQL statement.
* Meta-line format: "--*-- Key: va... | |
from __future__ import unicode_literals
import hashlib
import hmac
import json
import logging
import re
import uuid
from collections import defaultdict
from django import forms
from django.conf import settings
from django.conf.urls import patterns, url
from django.contrib.sites.models import Site
from django.core.cac... | |
#
# JoystickView.py
# GraphicsBindings
#
# Converted by u.fiedler on feb 2005
# with great help from Bob Ippolito - Thank you Bob!
#
# The original version was written in Objective-C by Malcolm Crawford
# http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
from Foundation import *
from AppKit import *
f... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | |
import os
import sys
import difflib
import __builtin__
import re
import pydoc
import contextlib
import inspect
import keyword
import pkgutil
import unittest
import xml.etree
import types
import test.test_support
from collections import namedtuple
from test.script_helper import assert_python_ok
from test.test_support im... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
"""
Created by James Dunlop
2016
Dependencies yaml
"""
import os, yaml, logging, sys
from functools import partial
try:
from PySide.QtGui import *
from PySide.QtCore import *
import shiboken
except ImportError:
from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2.QtWidgets impor... | |
import csv
import sys
import os
import logging
import random
from nltk.tokenize import wordpunct_tokenize
from enum import IntEnum
from io import open
from collections import defaultdict
from uuid import uuid4
_thismodule = sys.modules[__name__]
positive_emoticons_list = [":)", ":D", ")"]
negative_emoticons_list = [... | |
from __future__ import absolute_import, division, print_function
from concurrent.futures import ThreadPoolExecutor
import contextlib
import datetime
import functools
import socket
import subprocess
import sys
import threading
import time
import types
from tornado.escape import native_str
from tornado import gen
from ... | |
# 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 ... | |
import gtk
import gio
import odml
import odml.terminology as terminology
import odml.format as format
import commands
from TreeView import TerminologyPopupTreeView
from treemodel import PropertyModel
from DragProvider import DragProvider
from ChooserDialog import ChooserDialog
import TextEditor
COL_KEY = 0
COL_VALUE ... | |
from __future__ import unicode_literals
import logging
from django.apps import apps
from django.db import models, connection
from modularodm import Q
from psycopg2._psycopg import AsIs
from addons.base.models import BaseNodeSettings, BaseStorageAddon
from osf.exceptions import InvalidTagError, NodeStateError, TagNot... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2016 HashData Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | |
# 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 ... | |
#!/usr/bin/env python3
#
# Tests the error measure classes.
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import pints
import pints.toy
import unittest
import numpy ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
usage: acli [--version] [--help] [--install-completion]
acli [--region=<region>] [--access_key_id=<access_key_id>] [--secret_access_key=<secret_access_key>]
<command> [<args>...]
acli account [options]
acli ec2 (ls | list | summary) [opt... | |
#!/usr/bin/python
#
# Copyright 2018 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 ag... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | |
from django.core.files.base import File, ContentFile
from django.core.files.storage import get_storage_class, default_storage, \
Storage
from django.db.models.fields.files import ImageFieldFile, FieldFile
import os
from django.utils.safestring import mark_safe
from django.utils.html import escape
from django.utils... | |
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
import colander
from pyramid.view import view_config, view_defaults
from pyramid.httpexceptions import HTTPBadRequest, HTTPCreated, HTTPOk, HTTPNotFound
from sqlalchemy.exc import IntegrityError
from sqlal... | |
import mysql.connector
import json
import threading
class Database:
def __init__(self):
# print 'init data'
self.cn = mysql.connector.connect(user='root', password='Rvpooh123', database='sdc')
def insert(self, data):
sql = """insert into feature_model
(user_id, post_id, poster_name, rating, is_location, s... | |
# -*- coding: utf-8 -*-
"""
flaskext.mail
~~~~~~~~~~~~~
Flask extension for sending email.
:copyright: (c) 2010 by Dan Jacob.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
__version__ = '0.9.1'
import re
import blinker
import smtplib
import sys
import ti... | |
from django.core.exceptions import ValidationError
from django.forms import Form
from django.forms.fields import BooleanField, IntegerField
from django.forms.utils import ErrorList
from django.forms.widgets import HiddenInput
from django.utils.functional import cached_property
from django.utils.html import html_safe
fr... | |
#
# [The "BSD license"]
# Copyright (c) 2012 Terence Parr
# Copyright (c) 2012 Sam Harwell
# Copyright (c) 2014 Eric Vergnaud
# 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. Redis... | |
# Copyright 2015-2018 Capital One Services, 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 agreed ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Software License Agreement (BSD License)
#
# Copyright (c) 2010, Antons Rebguns, Cody Jorgensen, Cara Slutter
# 2010-2011, Antons Rebguns
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are perm... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
#!/usr/bin/env python
import commands, sys, os
from glob import glob
import nibabel
# Get path of the toolbox
status, path_sct = commands.getstatusoutput('echo $SCT_DIR')
# Append path that contains scripts, to be able to load modules
sys.path.append(path_sct + '/scripts')
sys.path.append(path_sct + '/dev/tamag')
f... | |
from __future__ import absolute_import
import sys
import warnings
from django.db import connection, transaction, IntegrityError
from django.test import TransactionTestCase, skipUnlessDBFeature
from django.test.utils import IgnorePendingDeprecationWarningsMixin
from django.utils import six
from django.utils.unittest i... | |
"""
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
from io import (
BytesIO,
StringIO,
)
import os
import platform
from urllib.error import URLError
import pytest
from pandas.errors import (
EmptyDataError,
ParserError,
)
imp... | |
# encoding: utf-8
import os
import re
import urllib
import urllib2
import uuid
import logging
import hashlib
import tempfile
import locale
import ConfigParser
import mimetypes
import contextlib
from datetime import datetime
from urlparse import urlparse, urljoin
import json
import ccnet
from django.core.urlresolver... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Syncs a database table to the `DocType` (metadata)
.. note:: This module is only used internally
"""
import re
import os
import frappe
from frappe import _
from frappe.utils... | |
"""Support for MQTT message handling."""
import asyncio
from functools import lru_cache, partial, wraps
import inspect
from itertools import groupby
import json
import logging
from operator import attrgetter
import os
import ssl
import time
from typing import Any, Callable, List, Optional, Union
import attr
import cer... | |
from __future__ import unicode_literals
import logging
import sys
import types
import warnings
from django import http
from django.conf import settings
from django.core import signals, urlresolvers
from django.core.exceptions import (
MiddlewareNotUsed, PermissionDenied, SuspiciousOperation,
)
from django.db impo... | |
from unittest import TestCase, main
from skbio.util import get_data_path
from microprot.scripts.split_search import parse_pdb_match
class ParsersTests(TestCase):
def setUp(self):
self.file_fused = get_data_path('test_split_search/fused_fields.out')
self.res_1 = {'Aligned_cols': 28,
... | |
# Copyright 2016 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.
"""Takes care of manipulating the chrome's HTTP cache.
"""
from datetime import datetime
import json
import os
import re
import shutil
import subprocess
imp... | |
import copy
import itertools as it
import numpy as np
import networkx as nx
from pgmpy.inference import Inference
from pgmpy.models import MarkovNetwork
from pgmpy.factors.discrete import DiscreteFactor
class Mplp(Inference):
"""
Class for performing approximate inference using Max-Product Linear Programmin... | |
"""Copyright 2008 Orbitz WorldWide
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... | |
# -*- coding: utf-8 -*-
"""
Author
------
Bo Zhang
Email
-----
bozhang@nao.cas.cn
Created on
----------
- Wed Feb 24 15:05:00 2016 spec_quick_view
Modifications
-------------
-
Aims
----
- method spec_quick_view: tool for quick view of spectra
"""
import numpy as np
import matplotlib.pyplot as plt
import as... | |
# Simple test suite for http/cookies.py
import copy
from test.support import run_unittest, run_doctest
import unittest
from http import cookies
import pickle
class CookieTests(unittest.TestCase):
def test_basic(self):
cases = [
{'data': 'chips=ahoy; vienna=finger',
'dict': {'chi... | |
#
# Kivy - Cross-platform UI framework
# https://kivy.org/
#
from __future__ import print_function
import sys
build_examples = False
if "--build_examples" in sys.argv:
build_examples = True
sys.argv.remove("--build_examples")
from copy import deepcopy
import os
from os.path import join, dirname, sep, exists, ... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
import sys
import os
import numpy as np
import tensorflow as tf
import csv
import pickle
import tarfile
import zipfile as z
import threading
from scipy import ndimage
from scipy.misc import imresize, imsave
from six.moves.urllib.request import urlretrieve
MB = 1024 ** 2
def download_hook_function(block, block_size... | |
#!/usr/bin/env python
USAGE = '''Usage: testasciidoc.py [OPTIONS] COMMAND
Run AsciiDoc conformance tests specified in configuration FILE.
Commands:
list List tests
run [NUMBER] [BACKEND] Execute tests
update [NUMBER] [BACKEND] Regenerate and update test data
Options:
-f, ... | |
#!/usr/bin/env python
import argparse
import os
import re
import shutil
import subprocess
import sys
import tarfile
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, NODE_VERSION, \
TARGET_PLATFORM, DIST_ARCH
from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \
... | |
# -*- coding: utf-8 -*-
import copy
import itertools
import collections
from importlib import import_module
from django.db.models import QuerySet
from django.core import exceptions
from django.utils.encoding import force_text
from django.utils.functional import lazy
from django.utils.translation import get_language a... | |
from django.test import TransactionTestCase
from reversion.models import Version
from waldur_core.core.utils import silent_call
from waldur_core.quotas.tests import models as test_models
class TestQuotaField(TransactionTestCase):
def test_quota_is_automatically_created_with_scope(self):
scope = test_mode... | |
# -*- coding: utf-8 -*-
"""
Filter functions for media and user lists.
"""
from . import delay
# filtering medias
def filter_medias(self, media_items, filtration=True, quiet=False):
if filtration:
if not quiet:
self.logger.info("Received %d medias." % len(media_items))
media_item... | |
#!/usr/bin/env python
#
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
#
# Copyright (c) SAS Institute Inc
#
from urlparse import urljoin
import hashlib
import json
import logging
import os
from conary.lib import util
from pymaven.client import MavenClient
import requests
from .errors import MissingArtifactError
from .pompackage import PomPackage
__all__ = ('Client', 'PomPackage')
... | |
from __future__ import print_function
import os.path as op
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_equal,
assert_allclose)
from scipy import sparse
from nose.tools import assert_true, assert_raises
import copy
import warnings
from mne.datasets import t... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import... | |
from __future__ import division, print_function, absolute_import
import os
import numpy as np
from numpy.testing import (assert_equal, assert_allclose, assert_,
TestCase, assert_raises, run_module_suite, assert_almost_equal,
assert_raises, assert_array_almost_equal)
from numpy import array, asarray, pi, sin, ... | |
from django.test import TestCase
from .. import admin # coverage FTW
from ..models import Calendar, Event, OccurringRule, RecurringRule
from ..utils import seconds_resolution
from django.contrib.auth import get_user_model
from django.utils import timezone
import datetime
from dateutil.rrule import rrule, WEEKLY
... | |
# -*- coding: utf-8 -*-
from gi import require_version
require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject
import sys
import fileChooser
from generateTrainTestInput import *
from generateFeaturesItems import *
class infoWindow(Gtk.Window):
def __init__(self, window):
builder = Gtk.Buil... | |
"""Hierarchical Agglomerative Clustering
These routines perform some hierarchical agglomerative clustering of some
input data.
Authors : Vincent Michel, Bertrand Thirion, Alexandre Gramfort,
Gael Varoquaux
License: BSD 3 clause
"""
import warnings
from heapq import heapify, heappop, heappush, heappushpop
i... | |
#!/usr/bin/env python
#
# 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.
"""Packages a user.bootfs for a Fuchsia boot image, pulling in the runtime
dependencies of a binary, and then uses either QEMU from ... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
# coding=utf-8
"""Provides a high-level interface for metadata media providers."""
import re
from abc import abstractmethod
from datetime import datetime as dt
from os import environ
from mapi import log
from mapi.compatibility import AbstractClass, ustr
from mapi.endpoints import *
from mapi.exceptions import (
... | |
import mock
import pytest
from rest_framework import exceptions
from django.utils import timezone
from waffle.testutils import override_switch
from osf import features
from api.base.settings.defaults import API_BASE
from api_tests import utils as test_utils
from framework.auth.core import Auth
from osf.models import ... | |
import os
from praatio import textgrid as tgio
from montreal_forced_aligner.alignment.pretrained import PretrainedAligner
from montreal_forced_aligner.command_line.align import run_align_corpus
from montreal_forced_aligner.command_line.mfa import parser
def assert_export_exist(old_directory, new_directory):
for... | |
"""Support for Vallox ventilation unit sensors."""
from __future__ import annotations
from dataclasses import dataclass
from datetime import datetime, timedelta
import logging
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
SensorEntity,
SensorEntityDescription,
)
from homeassistant... | |
# -*- coding: utf-8 -*-
import os
import sys
import threading
import requests
from requests.packages.urllib3.poolmanager import PoolManager
from .compat import iteritems, urlparse
from .. import exceptions, log
from ..doubleclick import click, ctx
logger = log.get(__name__)
_missing = object()
try:
import ke... | |
import math
import re
import unittest
import uuid
import redis
AVERAGE_PER_1K = {}
# <start id="tokenize-and-index"/>
STOP_WORDS = set('''able about across after all almost also am among
an and any are as at be because been but by can cannot could dear did
do does either else ever every for from get got had has hav... | |
# -*- coding: utf-8 -*-
"""
Copyright 2005 Spike^ekipS <spikeekips@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
(at your option) any later versi... | |
# Copyright (c) 2012-2013, Calxeda Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions a... | |
import urwid
import blinker
import textwrap
import pprint
from typing import Optional, Sequence
from mitmproxy import exceptions
from mitmproxy import optmanager
from mitmproxy.tools.console import layoutwidget
from mitmproxy.tools.console import signals
from mitmproxy.tools.console import overlay
HELP_HEIGHT = 5
d... | |
# Copyright 2015-2017 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | |
# 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 ... | |
#!/usr/bin/env python2
from sys import argv
import re
#filename = argv[1]
options = ['Ae', 'An', 'ACM', 'AM', 'APh', 'Art', 'Ay', 'BMB', 'BE', 'Bi',
'BEM', 'Ch', 'CHE', 'CDS', 'CNS', 'CS', 'CE', 'Ec', 'ESL', 'EE', 'E', 'EN',
'ESE', 'F', 'FS', 'Ge', 'H', 'HPS', 'Hum', 'L', 'Law', 'Ma', 'MS', 'ME',
'Mu', 'Pl', 'PE', '... | |
import email.utils
import re
import time
from typing import Tuple, List, Iterable
from mitmproxy.coretypes import multidict
"""
A flexible module for cookie parsing and manipulation.
This module differs from usual standards-compliant cookie modules in a number
of ways. We try to be as permissive as possible, and to ... | |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | |
"""The airvisual component."""
from __future__ import annotations
from collections.abc import Mapping
from datetime import timedelta
from math import ceil
from typing import Any, Dict, cast
from pyairvisual import CloudAPI, NodeSamba
from pyairvisual.errors import (
AirVisualError,
InvalidKeyError,
KeyExp... | |
"""
Cardiac image multi-atlas segmentation pipeline
Author: Wenjia Bai
First created: 2015.03.31
Last modified: 2016.11.21 by wbai
"""
import os
def segment_data(image_name, landmarks_name, output_dir, atlas_root, atlas_list, template_dir, par_dir, remove_temp=True):
# Check files
if not os.path.exists(imag... | |
#!/usr/bin/env python
import json
import os
import signal
import subprocess
import unittest
import sys
TEST_ROOT = os.path.abspath(os.path.dirname(__file__))
CASPERJS_ROOT = os.path.abspath(os.path.join(TEST_ROOT, '..', '..'))
CASPER_EXEC_FILE = sys.argv[1] if (len(sys.argv) == 2) else 'casperjs'
CASPER_EXEC = os.pat... | |
"""Support for dynamic COM client support.
Introduction
Dynamic COM client support is the ability to use a COM server without
prior knowledge of the server. This can be used to talk to almost all
COM servers, including much of MS Office.
In general, you should not use this module directly - see below.
Example... | |
#!/usr/bin/env python
# Copyright (C) 2011-2013 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 ... | |
# Copyright 2013 OpenStack Foundation
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
# Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
#!/usr/bin/python3
#
# Copyright 2019 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 a... | |
"""
$url ustream.tv
$url video.ibm.com
$type live, vod
"""
import logging
import re
from collections import deque
from datetime import datetime, timedelta
from random import randint
from threading import Event, RLock
from typing import Any, Callable, Deque, Dict, List, NamedTuple, Union
from urllib.parse import urljoi... | |
import os
import uuid
import sys
import re
import hashlib
import logging
def main(argv = sys.argv, pluginName = 'snappy-unity3d'):
unityRootProject = os.getcwd()
sys.stdout = Logger(unityRootProject + '/Snappy_XcodeUpdatePostBuild.log')
if argv is None or len(argv) < 3:
print 'Exiting: Incorrect nu... | |
"""Map Z-Wave nodes and values to Home Assistant entities."""
import openzwavemqtt.const as const_ozw
from openzwavemqtt.const import CommandClass, ValueGenre, ValueIndex, ValueType
from . import const
DISCOVERY_SCHEMAS = (
{ # Binary sensors
const.DISC_COMPONENT: "binary_sensor",
const.DISC_VALU... | |
# Copyright (c) 2014, Oracle and/or its affiliates. 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
#
# ... | |
# Copyright 2014 Dirk Pranke. 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 a... | |
# coding: utf-8
'''
This utilitary intends to monitor changes made in the SciELO Title Manager
catalog.
'''
import argparse
import os
import logging
import time
import hashlib
import random
import json
from io import BytesIO
from isis2json import isis2json
from xylose.scielodocument import Journal
from articlemetarpc... | |
from __future__ import annotations
import logging
import re
import libtbx
from libtbx.phil import parse
from dials.algorithms.refinement import DialsRefineConfigError
from dials.algorithms.refinement.constraints import phil_str as constr_phil_str
from dials.algorithms.refinement.parameterisation.autoreduce import (
... | |
#!/usr/bin/env python
"""Test ltigalerkinproj module"""
import unittest
import os
from os.path import join
from shutil import rmtree
import numpy as np
from modred import ltigalerkinproj as lgp, parallel, util
from modred import util
from modred.py2to3 import range
from modred.vectors import VecHandlePickle
#@unitt... | |
#!/usr/bin/env python
"""Test the webhistory flows."""
import os
from grr.client import client_utils_linux
from grr.client import client_utils_osx
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import flags
from grr.lib import flow
from grr.lib import test_lib
from grr.lib import utils
# pylin... | |
# coding: utf-8
# # Extracting Features from the Bike Sharing Dataset
# In[1]:
get_ipython().magic(u'pylab inline')
# In[2]:
# first remove the headers by using the 'sed' command:
# sed 1d hour.csv > hour_noheader.csv
path = "/PATH/hour_noheader.csv"
raw_data = sc.textFile(path)
num_data = raw_data.count()
recor... | |
import os
import platform
import textwrap
import unittest
import pytest
from conans.model.ref import ConanFileReference, PackageReference
from conans.test.utils.tools import NO_SETTINGS_PACKAGE_ID, TestClient, TestServer, TurboTestClient
from conans.util.files import load, mkdir, save
conanfile = """
from conans imp... | |
#!/usr/bin/python
#Forecast Parser Source
# Created By: Paul Gentemann and Mike Moss
# Modified On: 03/04/2014
#Date/Time Module
import datetime
#Date Utility Module
import date_util
#Kp Utility Module
import kp_util
#String Utility Module
import string_util
#Whitespace Lexer (Returns lexemes that are separated ... | |
from collections import defaultdict
from contextlib import closing
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.core.cache import cache
from django.db import connection
from django.db import models
from django.db import transaction
from django.db.models import Count, ... | |
#!/usr/bin/env python
"""
Copyright (c) 2014-2018 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify,... | |
# Copyright (c) 2015 Cloudbase Solutions SRL
# 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
#
# Unle... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.