gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import json
import math
import optparse
import os
import os.path
import re
import sys
from PIL import Image, ImageDraw
from itertools import izip_longest
parser = optparse.OptionParser(usage='%(prog)s [options] output_dir')
parser.add_option("-i", "--input",
... | |
# -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... | |
import json
import yaml
from .conditions import LogicEvaluator
from .dictobj import DictObject
from .language import Translator
class Rule(object):
"""
Base rule
"""
name = None
def should_trigger(self, context):
return True
def perform(self, context):
raise NotImplement... | |
#------------------------------------------------------------------------------
#
# GLOBAL SETTINGS
#
# Defines: gateway_schema, dataset_schema, pod_schema, user_schema,
#
#------------------------------------------------------------------------------
import os
# FIGURE OUT WHERE WE ARE RUNNING... ON HEROKU, OR LOCAL... | |
import logging
from collections import Counter
from django.contrib.auth.models import User
from django.db import connection, transaction
from django.template.loader import render_to_string
from django.utils import timezone
from pontoon.administration.vcs import CommitToRepositoryException
from pontoon.base.models im... | |
import json
import logging
import os
import shutil
import sys
import time
import urllib2
import warnings
# Dropping a table inexplicably produces a warning despite
# the 'IF EXISTS' clause. Squelch these warnings.
warnings.simplefilter('ignore')
import MySQLdb
import environment
import utils
from mysql_flavor import ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2010 Citrix Systems, 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/... | |
# encoding: utf-8
"""
validation.py
Created by Thomas Mangin on 2013-03-18.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
__all__ = ["validation", "ValidationError"]
FORMAT = 3
DEBUG = False
from collections import deque
from collections import OrderedDict
from exabgp.data import check
TYPE=check... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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.apac... | |
########
# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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 requir... | |
"""
This module provides a large set of colormaps, functions for
registering new colormaps and for getting a colormap by name,
and a mixin class for adding color mapping functionality.
"""
from __future__ import print_function, division
import os
import numpy as np
from numpy import ma
import matplotlib as mpl
impor... | |
from itertools import chain
import os
import socket
import sys
from ledis._compat import (b, xrange, imap, byte_to_chr, unicode, bytes, long,
BytesIO, nativestr, basestring, iteritems,
LifoQueue, Empty, Full, urlparse, parse_qs)
from ledis.exceptions import (
L... | |
'''
Translates a source file using a translation model.
'''
import argparse
import numpy
import cPickle as pkl
from nmt import (build_sampler, init_params)
from mixer import *
from multiprocessing import Process, Queue
def gen_sample(tparams, f_inits, f_nexts, x, options, trng=None,
k=1, maxlen=500,... | |
import numpy as np
from keras.models import Sequential, Model, model_from_json
from keras.layers import Input
from keras.layers.core import Dense, Activation, Dropout, Merge, RepeatVector
from keras.layers.recurrent import LSTM
from keras.layers.embeddings import Embedding
from keras.preprocessing import sequence
from ... | |
"""
Data Grouper custom gui functions
============================
Created by: Chris Cadonic
For: Utility in Dr. Mandana Modirrousta's Lab
----------------------------
This file contains code for :
Implementing custom GUI modules for specific purposes in the general-use
grouper.py function.
=========================... | |
import maya.OpenMaya as om
import pymel.core as pm
from pymel.core import Callback
import logging
MAPTO_IGNORE = 'ignore'
MAPTO_NONE = 'none'
kColor = 999
kEnum = 1000
kMessage=10000
MAP_API_ATTRIDS = {
kEnum : "kEnum",
kColor : "MFnNumericData::k3Float",
kMessage: "kMe... | |
import copy
from hashlib import md5
nodes = {}
pairs = {}
for line in open("input/dec22").readlines()[2:]:
node, _, used, avail, _ = line.split()
nn = node.split('-')
x = int(nn[1][1:])
y = int(nn[2][1:])
used = int(used[:-1])
avail = int(avail[:-1])
if y not in nodes:
... | |
"""Provides functionality to interact with image processing services."""
import asyncio
from datetime import timedelta
import logging
from typing import final
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_NAME,
CONF_ENTITY_ID,
CONF_NAME,
CONF_SOURCE,
)
from homeas... | |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 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
#
# ... | |
from sympy import sin, cos, atan2, log, exp, gamma, conjugate, sqrt, \
factorial, Integral, Piecewise, Add, diff, symbols, S, Float, Dummy, Eq
from sympy import Catalan, EulerGamma, E, GoldenRatio, I, pi
from sympy import Function, Rational, Integer, Lambda
from sympy.core.relational import Relational
from sympy.l... | |
"""Polynomial division algorithms for use with class Polynomial"""
from sympy.polynomials.base import *
def div(f, g, var=None, order=None, coeff=None):
"""Division with remainder.
Usage:
======
The input consists of a polynomial f and either one or a list
of polynomials g. When these are... | |
#!/usr/bin/python
# coding=utf-8
# Copyright 2012-2014 MongoDB, 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 appl... | |
# -*- coding: utf-8 -*-
""" S3 Charting Toolkit
@copyright: 2011-15 (c) Sahana Software Foundation
@license: MIT
@requires: U{B{I{NumPy}} <http://www.numpy.org>}
@requires: U{B{I{MatPlotLib}} <http://matplotlib.sourceforge.net>}
Permission is hereby granted, free of charge, to any person
obt... | |
import datetime
import json
from google.appengine.ext import ndb
from backend.common.consts.event_type import CMP_EVENT_TYPES, EventType
from backend.common.sitevars.cmp_registration_hacks import ChampsRegistrationHacks
from backend.tasks_io.datafeeds.parsers.fms_api.fms_api_event_list_parser import (
FMSAPIEven... | |
#!/usr/bin/env python
import re,logging,random
from automata import NFA
class dotini(list):
'''the worst .ini file "parser" ever'''
# ripping
section = re.compile('^\[(.*)\]')
item = re.compile('\s*(\w+)\s*=\s*(.*)$')
# cleaning up
comment = re.compile(';.*$')
def __init__(self):
... | |
# coding: utf-8
import ui, console, time, motion
import threading, queue
from contextlib import closing
from datetime import datetime
import re, urllib.request, socket
import urllib
import os
from flask import Flask, request, Response, abort
from flask import send_from_directory
import mimetypes
import wkwebview... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Interfaces to deal with the various types of fieldmap sources
.. testsetup::
>>> tmpdir = getfixture('tmpdir')
>>> tmp = tmpdir.chdir(... | |
#!/usr/bin/env python
#
# Copyright 2007 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... | |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2010,2011,2013,2014,2015,2016 Contributor
#
# 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... | |
# Copyright 2013 Canonical Ltd.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | |
from bamboo_boy.utils import with_canopy
import random
from unittest.case import expectedFailure
from django.contrib.auth.decorators import login_required
from django.test import TestCase
from django.test.client import RequestFactory
from django.utils.decorators import method_decorator
from rest_framework.test import ... | |
# -*- coding: latin-1 -*-
"""Defines the HTML colour names along with their values"""
class InvalidColorException(Exception):
pass
class HTMLColors(object):
htmlcolors = {
'aliceblue': '#F0F8FF',
'antiquewhite': '#FAEBD7',
'aqua': '#00FFFF',
'aquamarine': '#7FFFD4',
'azure': '#F0FFFF',
'b... | |
"""
DeCliff filter contributed by Minecraft Forums user "DrRomz"
Originally posted here:
http://www.minecraftforum.net/topic/13807-mcedit-minecraft-world-editor-compatible-with-mc-beta-18/page__st__3940__p__7648793#entry7648793
"""
from numpy import zeros, array
import itertools
from pymclevel import alphaMaterials
a... | |
# -*- encoding: utf-8 -*-
# Copyright (c) 2015 b<>com
#
# 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... | |
#
# 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... | |
#
# Copyright (C) 2016 Intel Corp. Isaku Yamahata <isaku.yamahata@gmail com>
# 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... | |
# Copyright 2013 IBM Corp.
#
# 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 agree... | |
from uuid import uuid4
import warnings
from cqlengine.query import QueryException, ModelQuerySet, DMLQuery
from cqlengine.tests.base import BaseCassEngTestCase
from cqlengine.exceptions import ModelException, CQLEngineException
from cqlengine.models import Model, ModelDefinitionException, ColumnQueryEvaluator, Undefin... | |
# -*- coding: utf-8 -*-
import uuid
import datetime
from sqlalchemy import Column, ForeignKey, func
from sqlalchemy.types import Unicode, Boolean, DateTime, Integer, Float, Binary
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from shapely import wkb
from shapely.geom... | |
from __future__ import absolute_import
from sentry.api.bases.project import ProjectPermission
from sentry.models import ApiKey
from sentry.testutils import TestCase
class ProjectPermissionBase(TestCase):
def setUp(self):
self.org = self.create_organization()
self.team = self.create_team(organizat... | |
#!/usr/bin/env python
# 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.
"""Traverses the source tree, parses all found DEPS files, and constructs
a dependency rule table to be used by subclasses.
The format... | |
import os
import pytest
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from imagesoup import ImageSoup, ImageResult
from imagesoup.utils import Blacklist
from imagesoup.reverse_search import *
def test_creating_soup():
soup = ImageSoup()
assert isinstance(soup, ImageS... | |
#!/usr/bin/env python
# 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... | |
"""
Read graphs in GML format.
See http://www.infosun.fim.uni-passau.de/Graphlet/GML/gml-tr.html
for format specification.
Example graphs in GML format:
http://www-personal.umich.edu/~mejn/netdata/
Requires pyparsing: http://pyparsing.wikispaces.com/
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
# Copyr... | |
__author__ = 'olga'
rbps = set(['ENSG00000003756',
'ENSG00000005075',
'ENSG00000011304',
'ENSG00000023734',
'ENSG00000047315',
'ENSG00000048740',
'ENSG00000049883',
'ENSG00000051596',
'ENSG00000054118',
'ENSG000... | |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
import logging
import math
from collections import defaultdict
from typing import Dict, Generic, List, Optional, TypeVar
import numpy as np
from scipy.special import loggamma
from scipy.stats import norm
logger = logging.getLogger(__name__)
... | |
from __future__ import with_statement
from numpy import linspace, zeros
# Enthought library imports
from kiva.constants import STROKE
from traits.api import (Any, Bool, Enum, Float, Int, Property,
on_trait_change, Trait)
from traitsui.api import EnumEditor
# Local, relative imports... | |
#
# 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... | |
import datetime
import math
import os
from collections import namedtuple
from urllib.parse import urlparse
from django.conf import settings
from django.core import paginator
from django.core.exceptions import ImproperlyConfigured
from django.db.models import Count, Max, Q
from django.template import loader
from django... | |
# 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... | |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from distantbes.proto.proto import bazel_config_pb2 as proto_dot_bazel__config__pb2
from distantbes.proto.proto import invocation_pb2 as proto_dot_invocation__pb2
from distantbes.proto.proto import user_pb2 as proto_dot_user__pb2
class... | |
"""chain module.
This module contains information about a depletion chain. A depletion chain is
loaded from an .xml file and all the nuclides are linked together.
"""
from io import StringIO
from itertools import chain
import math
import re
from collections import OrderedDict, defaultdict, namedtuple
from collection... | |
# 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
# distribu... | |
#!/usr/bin/env python
from rospy import init_node, get_param, loginfo, logerr, on_shutdown
from rosbridge_server import RosbridgeTcpSocket
from rosbridge_library.capabilities.advertise import Advertise
from rosbridge_library.capabilities.publish import Publish
from rosbridge_library.capabilities.subscribe import Subs... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is almost entirely borrowed from
# https://github.com/Yelp/Testify/blob/master/testify/assertions.py
# The only modfifications are for py3k support
from __future__ import absolute_import, with_statement
import contextlib
import re
import sys
from . import ut... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
DOCUMENTATION = """
---
module: kube
short_description: Manage Kubernetes Cluster
description:
- Create, replace, remove, and stop resources within a Kubernetes Cluster
version_added: "2.0"
options:
name:
required: false
default: null
description:
- The n... | |
#
# 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... | |
import argparse
import json
import shlex
import sys
import textwrap
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
from pip._internal.network.session import PipSession
from pip._internal.req import constructors
from pip._internal.req.req_file import (
RequirementsFileParser,
get_f... | |
"""A pure Python implementation of binascii.
Rather slow and buggy in corner cases.
PyPy provides an RPython version too.
"""
class Error(Exception):
pass
class Done(Exception):
pass
class Incomplete(Exception):
pass
def a2b_uu(s):
if not s:
return ''
length = (ord(s[0]) - 0x20) % 64
... | |
from __future__ import with_statement
from datetime import datetime, timedelta
import shutil
import tempfile
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DatabaseSession
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.cont... | |
# 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 (t... | |
#!/usr/bin/env python
import unittest
import xml.etree.cElementTree as eTree
from latex2mathml import converter
__author__ = "Ronie Martinez"
__copyright__ = "Copyright 2016-2017, Ronie Martinez"
__credits__ = ["Ronie Martinez"]
__license__ = "MIT"
__maintainer__ = "Ronie Martinez"
__email__ = "ronmarti18@gmail.com"
_... | |
#
# Copyright 2013 Rackspace Hosting.
#
# 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... | |
import sys
import os
import glob
import string
import logging
import yaml
#logging.basicConfig(filename=os.path.join(os.getcwd(), 'extract_data_logs.log'), filemode='w', level=logging.DEBUG,\
# format="%(levelname)s %(asctime)s %(lineno)d %(message)s")
def extract_data(c, param_map):
"""
M... | |
#!/usr/bin/env python3
# Copyright 2014-present Facebook, 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,
# th... | |
"""SPSSINC SPLIT DATASET extension command"""
#Licensed Materials - Property of IBM
#IBM SPSS Products: Statistics General
#(c) Copyright IBM Corp. 2010, 2020
#US Government Users Restricted Rights - Use, duplication or disclosure
#restricted by GSA ADP Schedule Contract with IBM Corp.
__author__ = 'spss, JKP'
__ve... | |
# 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 ... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions for supernova light curve I/O"""
import math
import os
import sys
import re
import json
from collections import OrderedDict
import numpy as np
from astropy.table import Table
from astropy.io import fits
from astropy import wcs
from .utils i... | |
# -*- coding: utf-8 -*-
"""
zask.ext.zerorpc
~~~~~~~~~~~~~~~~
Add zerorpc support to zask.
:copyright: (c) 2015 by the J5.
:license: BSD, see LICENSE for more details.
"""
import inspect
import gevent
import time
import uuid
import zerorpc
from zerorpc.heartbeat import HeartBeatOnChannel
from zer... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
The Index class can use several implementations as its
engine. Any implementation should implement the following:
__init__(data, row_index) : initialize index based on key/row list pairs
add(key, row) -> None : add (key, row) to existing data
remove(... | |
# Copyright 2015 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... | |
__doc__ = """Code by Benjamin S. Murphy
bscott.murphy@gmail.com
Dependencies:
numpy
Callable Methods:
write_asc_grid(X, Y, Z, filename='output.asc', style=1): Writes an MxN data grid
to an ASCII grid file (.*asc).
Inputs:
X (array-like, dim Nx1): X-coordinates of grid points at cen... | |
# Copyright (c) 2012 - 2014 EMC Corporation.
# 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... | |
"""
Common narrative logging functions.
To log an event with proper metadata and formatting use 'log_event':
You can also do free-form logs, but these will be ignored by
most upstream consumers.
"""
import collections
import logging
from logging import handlers
import os
import threading
import time
# Local
from .u... | |
# 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... | |
"""
This file is part of PUQ
Copyright (c) 2013 PUQ Authors
See LICENSE file for terms.
"""
from __future__ import absolute_import, division, print_function
import os, time, sys
from .monitor import TextMonitor
from subprocess import Popen, PIPE
import numpy as np
from logging import debug
from .hosts import Host
from... | |
################################################################################
#
# Copyright 2015 Crown copyright (c)
# Land Information New Zealand and the New Zealand Government.
# All rights reserved
#
# This program is released under the terms of the 3 clause BSD license. See the
# LICENSE file for more informat... | |
# This file is part of the MapProxy project.
# Copyright (C) 2010-2012 Omniscale <http://omniscale.de>
#
# 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/LI... | |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | |
# -*- coding: utf-8 -*
from __future__ import unicode_literals
import os
import gc
import django
from django.db import transaction
django.setup()
from basics.models import *
from commons import pos_freq_dic
def create_file_of_general_word_freqs():
l_columns = ['str_adjectives', 'str_nouns', 'str_verbs', 'str_p... | |
# Copyright 2016 Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from drawsettings import DrawSettings
class ROIDialog(QDialog, DrawSettings):
"""
ROI toolset.
"""
last_target_name = "New Volume"
... | |
import urllib2
import os.path
import sys
import re
default_encoding = sys.getfilesystemencoding()
if default_encoding.lower() == 'ascii':
default_encoding = 'utf-8'
def to_native_string(s):
if type(s) == unicode:
return s.encode(default_encoding)
else:
return s
def r1(pattern, text):
m = re.search(pattern, ... | |
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Hoverlabel(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "table"
_path_str = "table.hoverlabel"
_valid_props = {
"align",
"alignsr... | |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Converters for Quantity."""
import numpy as np
from astropy.units.core import (UnitsError, UnitConversionError, UnitTypeError,
dimensionless_unscaled)
__all__ = ['can_have_arbitrary_unit', 'conv... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] ta... | |
from __future__ import absolute_import
import re
import posixpath
from sentry.grouping.component import GroupingComponent
from sentry.grouping.strategies.base import strategy
from sentry.grouping.strategies.utils import remove_non_stacktrace_variants, has_url_origin
from sentry.grouping.strategies.similarity_encoders... | |
from setuptools import setup, find_packages
from mfr import __version__
def parse_requirements(requirements):
with open(requirements) as f:
return [l.strip('\n') for l in f if l.strip('\n') and not l.startswith('#')]
requirements = parse_requirements('requirements.txt')
setup(
name='mfr',
vers... | |
#!/usr/bin/env python
"""Doxygen XML to SWIG docstring converter.
Converts Doxygen generated XML files into a file containing docstrings
that can be used by SWIG-1.3.x. Note that you need to get SWIG
version > 1.3.23 or use Robin Dunn's docstring patch to be able to use
the resulting output.
Usage:
doxy2swig.py i... | |
# Copyright (c) 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 ... | |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-02-11 10:11
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import geotrek.authent.models
class Migration(migrations.Migration):
dependencies = [
('signage', '0009_auto_2019102... | |
import cupy
import cupyx.scipy.fft
from cupy import _core
from cupy._core import _routines_math as _math
from cupy._core import fusion
from cupy.lib import stride_tricks
import numpy
_dot_kernel = _core.ReductionKernel(
'T x1, T x2',
'T y',
'x1 * x2',
'a + b',
'y = a',
'0',
'dot_product'... | |
# Copyright (c) 2011, Enthought, Ltd.
# Authors: Pietro Berkes <pberkes@enthought.com>, Andrey Rzhetsky
# License: Modified BSD license (2-clause)
"""This module defines model B-with-theta, optimized for a loop design.
The implementation assumes that there are a total or 8 annotators. Each item is
annotated by a trip... | |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import o... | |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. Yo... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | |
# -*- coding: utf-8 -*-
"""ProgressBar class."""
import sys
import time
import string
import progress
import progress.eta
class ProgressBar(object):
"""A flexible progress bar for Python 2.6+."""
# Valid format strings
_PROGRESS = 'progress'
_PERCENTAGE = 'percentage'
_NOMINATOR = 'nominator'... | |
import collections
import random
import aging
import lifetables
from agent import MakeAgents, MaleState, FemaleState
from dispersal import HamadryasDispersal
from seedgroups import HamadryasSeed
import relatedness
def main():
hamadryas = HamadryasSim()
hamadryas.run_simulation()
class Population(object):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.