repo_name stringlengths 6 103 | path stringlengths 5 191 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 986 970k | license stringclasses 15
values |
|---|---|---|---|---|---|
Nu3001/external_chromium_org | third_party/jinja2/visitor.py | 1402 | 3316 | # -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every... | bsd-3-clause |
anapaulagomes/dashboard | lib/jinja2/visitor.py | 1402 | 3316 | # -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every... | apache-2.0 |
AOSPU/external_chromium_org | third_party/jinja2/visitor.py | 1402 | 3316 | # -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every... | bsd-3-clause |
SaschaMester/delicium | third_party/jinja2/visitor.py | 1402 | 3316 | # -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every... | bsd-3-clause |
krisgiesing/sky_engine | tools/generate_package_files.py | 3 | 1316 | #!/usr/bin/env python
# Copyright 2018 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script generates .packages file for frontend_server and
# flutter_kernel_transformers from Dart SDKs .packages file located in
# ... | bsd-3-clause |
ageron/tensorflow | tensorflow/contrib/learn/python/learn/__init__.py | 40 | 2715 | # 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... | apache-2.0 |
pandegroup/vs-utils | vs_utils/scripts/datasets/parse_tox21_datasets.py | 3 | 2618 | #!/usr/bin/env python
"""
Get Tox21 challenge datasets.
Some SMILES strings are represented by multiple compounds, with some overlap of
assays. These compounds need to be condensed and their assay outcomes need to
be reconciled.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
_... | gpl-3.0 |
nick-monto/SpeechRecog_CNN | model_keras_16k.py | 1 | 5268 | import os
import fnmatch
import pandas as pd
import numpy as np
from PIL import Image
from sklearn.model_selection import train_test_split
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D
from keras.layers import Activation, Dropo... | mit |
mxjl620/scikit-learn | sklearn/linear_model/bayes.py | 219 | 15248 | """
Various bayesian regression
"""
from __future__ import print_function
# Authors: V. Michel, F. Pedregosa, A. Gramfort
# License: BSD 3 clause
from math import log
import numpy as np
from scipy import linalg
from .base import LinearModel
from ..base import RegressorMixin
from ..utils.extmath import fast_logdet, p... | bsd-3-clause |
pansapiens/mytardis | tardis/tardis_portal/south_migrations/0028_convert_replicas.py | 3 | 27093 | # -*- coding: utf-8 -*-
import datetime
import os
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Don't use "from appname.models import ModelName".
... | bsd-3-clause |
mxjl620/scikit-learn | sklearn/svm/tests/test_bounds.py | 277 | 2541 | import nose
from nose.tools import assert_equal, assert_true
from sklearn.utils.testing import clean_warning_registry
import warnings
import numpy as np
from scipy import sparse as sp
from sklearn.svm.bounds import l1_min_c
from sklearn.svm import LinearSVC
from sklearn.linear_model.logistic import LogisticRegression... | bsd-3-clause |
yonglehou/scikit-learn | doc/sphinxext/gen_rst.py | 141 | 40026 | """
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from __future__ import division, print_function
from time import time
import ast
import os
import re
import shutil
import traceback
i... | bsd-3-clause |
pkruskal/scikit-learn | sklearn/neighbors/unsupervised.py | 105 | 4461 | """Unsupervised nearest neighbors learner"""
from .base import NeighborsBase
from .base import KNeighborsMixin
from .base import RadiusNeighborsMixin
from .base import UnsupervisedMixin
class NearestNeighbors(NeighborsBase, KNeighborsMixin,
RadiusNeighborsMixin, UnsupervisedMixin):
"""Unsu... | bsd-3-clause |
pansapiens/mytardis | tardis/tardis_portal/download.py | 1 | 22005 | # -*- coding: utf-8 -*-
"""
download.py
.. moduleauthor:: Steve Androulakis <steve.androulakis@monash.edu>
.. moduleauthor:: Ulrich Felzmann <ulrich.felzmann@versi.edu.au>
.. moduleauthor:: Grischa Meyer <grischa.meyer@monash.edu>
"""
import logging
import urllib
import os
import cStringIO as StringIO
import time
... | bsd-3-clause |
dimkal/mne-python | examples/time_frequency/plot_source_label_time_frequency.py | 19 | 3767 | """
=========================================================
Compute power and phase lock in label of the source space
=========================================================
Compute time-frequency maps of power and phase lock in the source space.
The inverse method is linear based on dSPM inverse operator.
The ex... | bsd-3-clause |
ageron/tensorflow | tensorflow/tools/compatibility/tf_upgrade_v2.py | 1 | 78824 | # Copyright 2018 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... | apache-2.0 |
openaid-IATI/OIPA | OIPA/task_queue/utils.py | 1 | 7272 | import time
import requests
from celery.task.control import inspect
from iati_synchroniser.models import (
AsyncTasksFinished, Dataset, DatasetDownloadsStarted
)
from task_queue.validation import DatasetValidationTask
class Tasks:
"""
The logic: if only one task is running then the task will
be cont... | agpl-3.0 |
IONISx/edx-platform | setup.py | 11 | 3320 | """
Setup script for the Open edX package.
"""
from setuptools import setup
setup(
name="Open edX",
version="0.5",
install_requires=["setuptools"],
requires=[],
# NOTE: These are not the names we should be installing. This tree should
# be reorganized to be a more conventional Python tree.
... | agpl-3.0 |
yonglehou/scikit-learn | examples/linear_model/plot_polynomial_interpolation.py | 250 | 1895 | #!/usr/bin/env python
"""
========================
Polynomial interpolation
========================
This example demonstrates how to approximate a function with a polynomial of
degree n_degree by using ridge regression. Concretely, from n_samples 1d
points, it suffices to build the Vandermonde matrix, which is n_samp... | bsd-3-clause |
GoogleCloudPlatform/public-datasets-pipelines | datasets/scalable_open_source/pipelines/deps_dev/deps_dev_dag.py | 1 | 2740 | # Copyright 2021 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 agreed to in writing, ... | apache-2.0 |
mxjl620/scikit-learn | sklearn/feature_extraction/tests/test_dict_vectorizer.py | 274 | 3790 | # Authors: Lars Buitinck <L.J.Buitinck@uva.nl>
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from random import Random
import numpy as np
import scipy.sparse as sp
from numpy.testing import assert_array_equal
from sklearn.utils.testing import (assert_equal, assert_in,
... | bsd-3-clause |
yonglehou/scikit-learn | sklearn/utils/tests/test_shortest_path.py | 87 | 2828 | from collections import defaultdict
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.utils.graph import (graph_shortest_path,
single_source_shortest_path_length)
def floyd_warshall_slow(graph, directed=False):
N = graph.shape[0]
#set nonzer... | bsd-3-clause |
datalogai/recurrentshop | examples/recurrent_highway_networks.py | 1 | 5919 | '''
Recurrent Highway Networks
-------------------------------------------------------------------------------
Julian Georg Zilly | Rupesh Kumar Srivastava | Jan Koutnik | Jurgen Schmidhuber
https://arxiv.org/abs/1607.03474
This is an implementation of language modeling experiments
on text8 dataset as specified in the... | mit |
yonglehou/scikit-learn | examples/linear_model/plot_omp.py | 379 | 2263 | """
===========================
Orthogonal Matching Pursuit
===========================
Using orthogonal matching pursuit for recovering a sparse signal from a noisy
measurement encoded with a dictionary
"""
print(__doc__)
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import OrthogonalM... | bsd-3-clause |
markslwong/tensorflow | tensorflow/contrib/learn/python/learn/estimators/dnn_test.py | 22 | 57502 | # 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... | apache-2.0 |
markslwong/tensorflow | tensorflow/tools/docs/generate_1_0.py | 18 | 3157 | # 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... | apache-2.0 |
xuezhisd/DeepLearningTutorials | code/SdA.py | 30 | 18975 | """
This tutorial introduces stacked denoising auto-encoders (SdA) using Theano.
Denoising autoencoders are the building blocks for SdA.
They are based on auto-encoders as the ones used in Bengio et al. 2007.
An autoencoder takes an input x and first maps it to a hidden representation
y = f_{\theta}(x) = s(Wx+b),... | bsd-3-clause |
benoitsteiner/tensorflow-xsmm | tensorflow/contrib/factorization/python/ops/gmm_test.py | 39 | 8716 | # 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... | apache-2.0 |
ageron/tensorflow | tensorflow/contrib/learn/python/learn/datasets/base_test.py | 132 | 3072 | # 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... | apache-2.0 |
ageron/tensorflow | tensorflow/contrib/factorization/python/ops/gmm_test.py | 39 | 8716 | # 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... | apache-2.0 |
mxjl620/scikit-learn | sklearn/neighbors/regression.py | 100 | 11017 | """Nearest Neighbor Regression"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output support by Arna... | bsd-3-clause |
GoogleCloudPlatform/public-datasets-pipelines | datasets/cdc_places/pipelines/local_data_for_better_health_county_data/local_data_for_better_health_county_data_dag.py | 2 | 5538 | # Copyright 2021 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 agreed to in writing, ... | apache-2.0 |
IONISx/edx-platform | openedx/core/lib/block_cache/tests/test_block_structure_factory.py | 32 | 4070 | """
Tests for block_structure_factory.py
"""
# pylint: disable=protected-access
from mock import patch
from unittest import TestCase
from ..block_structure_factory import BlockStructureFactory
from .test_utils import (
MockCache, MockModulestoreFactory, MockTransformer, ChildrenMapTestMixin
)
class TestBlockStru... | agpl-3.0 |
IONISx/edx-platform | lms/djangoapps/course_blocks/usage_info.py | 89 | 1246 | """
Declares CourseUsageInfo class to be used by the transform method in
Transformers.
"""
from lms.djangoapps.courseware.access import _has_access_to_course
class CourseUsageInfo(object):
'''
A class object that encapsulates the course and user context to be
used as currency across block structure transf... | agpl-3.0 |
mwalton/artificial-olfaction | python/deepRegressor.py | 1 | 7005 | import climate
import theanets
import numpy as np
from sklearn.cross_validation import train_test_split
from os import path
from math import sqrt
import matplotlib.pyplot as plt
from sklearn.metrics import mean_squared_error
from sklearn.preprocessing import StandardScaler
import platform
def loadData(XPath, yPath):
... | mit |
markslwong/tensorflow | tensorflow/contrib/learn/python/learn/estimators/stability_test.py | 110 | 6455 | # 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... | apache-2.0 |
yonglehou/scikit-learn | sklearn/tests/test_learning_curve.py | 224 | 10791 | # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.learning_curve import learning_curve, validation_curve
from sklearn.u... | bsd-3-clause |
yonglehou/scikit-learn | sklearn/feature_selection/tests/test_feature_select.py | 142 | 22295 | """
Todo: cross-check the F-value with stats model
"""
from __future__ import division
import itertools
import warnings
import numpy as np
from scipy import stats, sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises... | bsd-3-clause |
kubernetes/test-infra | kettle/monitor.py | 6 | 2625 | #!/usr/bin/env python3
# Copyright 2018 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
davidam/python-examples | scikit/plot_color_quantization.py | 31 | 3356 | # -*- coding: utf-8 -*-
"""
==================================
Color Quantization using K-Means
==================================
Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace
(China), reducing the number of colors required to show the image from 96,615
unique colors to 64, while pre... | gpl-3.0 |
yonglehou/scikit-learn | examples/neighbors/plot_classification.py | 285 | 1790 | """
================================
Nearest Neighbors Classification
================================
Sample usage of Nearest Neighbors classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColorm... | bsd-3-clause |
markslwong/tensorflow | tensorflow/contrib/learn/python/learn/datasets/base.py | 123 | 6584 | # 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... | apache-2.0 |
blackye/luscan-devel | thirdparty_libs/nltk/corpus/reader/rte.py | 17 | 4586 | # Natural Language Toolkit: RTE Corpus Reader
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Ewan Klein <ewan@inf.ed.ac.uk>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
Corpus reader for the Recognizing Textual Entailment (RTE) Challenge Corpora.
The files were taken from the RTE1... | gpl-2.0 |
dimkal/mne-python | examples/forward/plot_make_forward.py | 20 | 2669 | """
======================================================
Create a forward operator and display sensitivity maps
======================================================
Sensitivity maps can be produced from forward operators that
indicate how well different sensor types will be able to detect
neural currents from diff... | bsd-3-clause |
Cyber-Neuron/inception_v3 | inception/inception/image_processing.py | 1 | 20664 | # Copyright 2016 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... | apache-2.0 |
GoogleCloudPlatform/public-datasets-pipelines | datasets/fec/pipelines/committee_contributions_2020/committee_contributions_2020_dag.py | 1 | 7284 | # Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
davidam/python-examples | scikit/classify/document_clustering.py | 20 | 8531 | """
=======================================
Clustering text documents using k-means
=======================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store the features instead of ... | gpl-3.0 |
yonglehou/scikit-learn | sklearn/tests/test_isotonic.py | 228 | 11087 | import numpy as np
import pickle
from sklearn.isotonic import (check_increasing, isotonic_regression,
IsotonicRegression)
from sklearn.utils.testing import (assert_raises, assert_array_equal,
assert_true, assert_false, assert_equal,
... | bsd-3-clause |
ageron/tensorflow | tensorflow/python/distribute/input_lib.py | 3 | 19584 | # Copyright 2018 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... | apache-2.0 |
ResidentMario/geoplot | examples/plot_los_angeles_flights.py | 1 | 1907 | """
Sankey of Los Angeles flight volumes with Cartopy globes
========================================================
This example plots passenger volumes for commercial flights out of Los Angeles International
Airport. Some globe-modification options available in ``cartopy`` are demonstrated. Visit
`the cartopy docs ... | mit |
WMD-Bath/dvxc | rvo_stats.py | 3 | 36130 | #! /usr/bin/env python
# rvo_stats.py
# Copyright 2015 Adam J. Jackson and Jonathan M. Skelton
from __future__ import print_function
import csv
import math
import numpy as np
from collections import namedtuple
import matplotlib as mpl
import matplotlib.pyplot as plt
# from matplotlib.ticker import FuncFormatter
im... | gpl-3.0 |
pkruskal/scikit-learn | sklearn/covariance/graph_lasso_.py | 126 | 25626 | """GraphLasso: sparse inverse covariance estimation with an l1-penalized
estimator.
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
# Copyright: INRIA
import warnings
import operator
import sys
import time
import numpy as np
from scipy import linalg
from .empirical_covariance_ im... | bsd-3-clause |
AveRapina/DeepLearningTutorials | code/mlp.py | 39 | 14267 | """
This tutorial introduces the multilayer perceptron using Theano.
A multilayer perceptron is a logistic regressor where
instead of feeding the input to the logistic regression you insert a
intermediate layer, called the hidden layer, that has a nonlinear
activation function (usually tanh or sigmoid) . One can use ... | bsd-3-clause |
nightjean/Deep-Learning | tensorflow/examples/learn/resnet.py | 35 | 5962 | # 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 appl... | apache-2.0 |
4kula/EVA | docs/conf.py | 1 | 8667 | # -*- coding: utf-8 -*-
#
# 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 configuration values have a default; values that are commented out
# serve to show the default.
import sys
# ... | gpl-3.0 |
dimkal/mne-python | mne/io/tests/test_pick.py | 2 | 6571 | from nose.tools import assert_equal, assert_raises
from numpy.testing import assert_array_equal
import numpy as np
import os.path as op
from mne import (pick_channels_regexp, pick_types, Epochs,
read_forward_solution, rename_channels,
pick_info, pick_channels, __file__)
from mne.io.m... | bsd-3-clause |
nickgentoo/scikit-learn-graph | skgraph/kernel/WLOrthogonalizedGraphKernel.py | 1 | 16012 | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 3 12:04:44 2015
Copyright 2015 Nicolo' Navarin
This file is part of scikit-learn-graph.
scikit-learn-graph 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 ... | gpl-3.0 |
benoitsteiner/tensorflow-xsmm | tensorflow/contrib/learn/python/learn/datasets/synthetic.py | 40 | 7451 | # 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... | apache-2.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/pycparser/ply/ctokens.py | 206 | 3177 | # ----------------------------------------------------------------------
# ctokens.py
#
# Token specifications for symbols in ANSI C and C++. This file is
# meant to be used as a library in other tokenizers.
# ----------------------------------------------------------------------
# Reserved words
tokens = [
# Li... | mit |
jamesrobertlloyd/automl-phase-2 | sandpit.py | 1 | 4567 | __author__ = 'James Robert Lloyd'
__description__ = 'Scraps of code before module structure becomes apparent'
from util import callback_1d
import pybo
from pybo.functions.functions import _cleanup, GOModel
import numpy as np
from sklearn.datasets import load_iris
from sklearn.datasets import make_hastie_10_2
from s... | mit |
GoogleCloudPlatform/public-datasets-pipelines | datasets/bls/pipelines/c_cpi_u/c_cpi_u_dag.py | 2 | 3848 | # Copyright 2021 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 agreed to in writing, ... | apache-2.0 |
dimkal/mne-python | examples/decoding/plot_decoding_time_generalization.py | 5 | 1947 | """
==========================================================
Decoding sensor space data with Generalization Across Time
==========================================================
This example runs the analysis computed in:
Jean-Remi King, Alexandre Gramfort, Aaron Schurger, Lionel Naccache
and Stanislas Dehaene, "T... | bsd-3-clause |
DinoCow/airflow | tests/providers/google/cloud/hooks/test_automl.py | 3 | 9839 | #
# 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... | apache-2.0 |
midnightradio/gensim | docs/src/auto_examples/tutorials/run_doc2vec_lee.py | 8 | 16167 | r"""
Doc2Vec Model
=============
Introduces Gensim's Doc2Vec model and demonstrates its use on the
`Lee Corpus <https://hekyll.services.adelaide.edu.au/dspace/bitstream/2440/28910/1/hdl_28910.pdf>`__.
"""
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
####... | gpl-3.0 |
cajohnst/Optimized_FX_Portfolio | Pull_Data.py | 1 | 12619 | ''' Pull all data to be used in Optimize_FX_Portfolio, RSI_sample, MACD_sample, and futures_vs_spot (eventually pull fred economic reports) '''
import settings as sv
import pandas as pd
import quandl as qdl
import numpy as np
from pandas import Series, DataFrame
import datetime
from datetime import timedelta, date
... | mit |
yonglehou/scikit-learn | sklearn/feature_extraction/dict_vectorizer.py | 232 | 12267 | # Authors: Lars Buitinck
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from array import array
from collections import Mapping
from operator import itemgetter
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator, TransformerMixin
from ..externals import six
from ..ext... | bsd-3-clause |
mxjl620/scikit-learn | sklearn/metrics/cluster/tests/test_unsupervised.py | 228 | 2823 | import numpy as np
from scipy.sparse import csr_matrix
from sklearn import datasets
from sklearn.metrics.cluster.unsupervised import silhouette_score
from sklearn.metrics import pairwise_distances
from sklearn.utils.testing import assert_false, assert_almost_equal
from sklearn.utils.testing import assert_raises_regexp... | bsd-3-clause |
yonglehou/scikit-learn | examples/linear_model/plot_lasso_model_selection.py | 308 | 5431 | """
===================================================
Lasso model selection: Cross-Validation / AIC / BIC
===================================================
Use the Akaike information criterion (AIC), the Bayes Information
criterion (BIC) and cross-validation to select an optimal value
of the regularization paramet... | bsd-3-clause |
pkruskal/scikit-learn | examples/linear_model/plot_lasso_model_selection.py | 308 | 5431 | """
===================================================
Lasso model selection: Cross-Validation / AIC / BIC
===================================================
Use the Akaike information criterion (AIC), the Bayes Information
criterion (BIC) and cross-validation to select an optimal value
of the regularization paramet... | bsd-3-clause |
benoitsteiner/tensorflow-xsmm | tensorflow/python/training/distribute.py | 4 | 49880 | # Copyright 2018 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... | apache-2.0 |
mxjl620/scikit-learn | examples/linear_model/plot_sgd_iris.py | 284 | 2202 | """
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print(__doc__)
... | bsd-3-clause |
CI-WATER/tethys | tethys_services/migrations/0001_initial_20.py | 1 | 6102 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-17 14:04
from django.conf import settings
from django.db import migrations, models
import tethys_services.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_M... | bsd-2-clause |
lihuanghai/neon | neon/datasets/mnist.py | 7 | 6530 | # ----------------------------------------------------------------------------
# Copyright 2014 Nervana 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.o... | apache-2.0 |
slrbl/Intrusion-and-anomaly-detection-with-machine-learning | train.py | 1 | 2043 |
# About: Use supervised learning logistic regression classifier to predict intrusion/suspicious activities in http logs
# Author: walid.daboubi@gmail.com
# Version: 2.0 - 2022/08/14
import argparse
import sys
from sklearn import linear_model, tree
from helpers import *
def get_args():
parser = argparse.Argume... | mit |
GoogleCloudPlatform/ml-on-gcp | example_zoo/tensorflow/models/keras_imagenet_main/official/resnet/resnet_run_loop.py | 2 | 27886 | # 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... | apache-2.0 |
pkruskal/scikit-learn | examples/cluster/plot_cluster_iris.py | 347 | 2593 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
K-means Clustering
=========================================================
The plots display firstly what a K-means algorithm would yield
using three clusters. It is then shown what the effect of a bad
initializa... | bsd-3-clause |
mxjl620/scikit-learn | examples/cluster/plot_cluster_iris.py | 347 | 2593 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
K-means Clustering
=========================================================
The plots display firstly what a K-means algorithm would yield
using three clusters. It is then shown what the effect of a bad
initializa... | bsd-3-clause |
jmouriz/sanaviron | sanaviron/src/3rd/pycha/tests/chart.py | 3 | 9618 | # Copyright(c) 2007-2009 by Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# This file is part of PyCha.
#
# PyCha is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License,... | apache-2.0 |
mxjl620/scikit-learn | sklearn/__check_build/__init__.py | 342 | 1671 | """ Module to give helpful messages to the user that did not
compile the scikit properly.
"""
import os
INPLACE_MSG = """
It appears that you are importing a local scikit-learn source tree. For
this, you need to have an inplace install. Maybe you are in the source
directory and you need to try from another location.""... | bsd-3-clause |
mxjl620/scikit-learn | sklearn/metrics/cluster/unsupervised.py | 228 | 8281 | """ Unsupervised evaluation metrics. """
# Authors: Robert Layton <robertlayton@gmail.com>
#
# License: BSD 3 clause
import numpy as np
from ...utils import check_random_state
from ..pairwise import pairwise_distances
def silhouette_score(X, labels, metric='euclidean', sample_size=None,
random... | bsd-3-clause |
andrewcmyers/tensorflow | tensorflow/examples/learn/mnist.py | 28 | 4770 | # 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 appl... | apache-2.0 |
yonglehou/scikit-learn | sklearn/cluster/tests/test_hierarchical.py | 228 | 19795 | """
Several basic tests for hierarchical clustering procedures
"""
# Authors: Vincent Michel, 2010, Gael Varoquaux 2012,
# Matteo Visconti di Oleggio Castello 2014
# License: BSD 3 clause
from tempfile import mkdtemp
import shutil
from functools import partial
import numpy as np
from scipy import sparse
from... | bsd-3-clause |
mxjl620/scikit-learn | doc/tutorial/text_analytics/skeletons/exercise_02_sentiment.py | 255 | 2406 | """Build a sentiment analysis / polarity model
Sentiment analysis can be casted as a binary text classification problem,
that is fitting a linear classifier on features extracted from the text
of the user messages so as to guess wether the opinion of the author is
positive or negative.
In this examples we will use a ... | bsd-3-clause |
FakeNewsChallenge/fnc-1-baseline | feature_engineering.py | 4 | 6253 | import os
import re
import nltk
import numpy as np
from sklearn import feature_extraction
from tqdm import tqdm
_wnl = nltk.WordNetLemmatizer()
def normalize_word(w):
return _wnl.lemmatize(w).lower()
def get_tokenized_lemmas(s):
return [normalize_word(t) for t in nltk.word_tokenize(s)]
def clean(s):
... | apache-2.0 |
yonglehou/scikit-learn | examples/svm/plot_svm_scale_c.py | 222 | 5375 | """
==============================================
Scaling the regularization parameter for SVCs
==============================================
The following example illustrates the effect of scaling the
regularization parameter when using :ref:`svm` for
:ref:`classification <svm_classification>`.
For SVC classificati... | bsd-3-clause |
pkruskal/scikit-learn | examples/svm/plot_svm_scale_c.py | 222 | 5375 | """
==============================================
Scaling the regularization parameter for SVCs
==============================================
The following example illustrates the effect of scaling the
regularization parameter when using :ref:`svm` for
:ref:`classification <svm_classification>`.
For SVC classificati... | bsd-3-clause |
GoogleCloudPlatform/public-datasets-pipelines | datasets/new_york_trees/pipelines/tree_census_2005/tree_census_2005_dag.py | 1 | 15071 | # Copyright 2021 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 agreed to in writing, ... | apache-2.0 |
dimkal/mne-python | examples/visualization/plot_evoked_topomap.py | 18 | 1498 | """
========================================
Plotting topographic maps of evoked data
========================================
Load evoked data and plot topomaps for selected time points.
"""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
# Tal Linzen <linzen@nyu.edu>
# Denis A. Engeman <... | bsd-3-clause |
tbullmann/heuhaufen | tools/evaluate.py | 1 | 7259 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import Counter
import os
import argparse
import glob
from sklearn.metrics.cluster import adjusted_rand_score, adjusted_mutual_info_score
import pandas as pd
import numpy as np
from skimage.io ... | mit |
davidam/python-examples | scikit/plot_cluster_comparison.py | 45 | 6620 | """
=========================================================
Comparing different clustering algorithms on toy datasets
=========================================================
This example shows characteristics of different
clustering algorithms on datasets that are "interesting"
but still in 2D. With the exception ... | gpl-3.0 |
GoogleCloudPlatform/public-datasets-pipelines | datasets/idc/pipelines/_images/generate_bq_views/script.py | 1 | 4037 | # Copyright 2021 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 agreed to in writing, ... | apache-2.0 |
laserson/eggo | eggo/cli/datasets.py | 3 | 2199 | # Licensed to Big Data Genomics (BDG) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The BDG licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ... | apache-2.0 |
Hellybean/SaberMod_ROM_Toolchain | libstdc++-v3/scripts/make_graph.py | 172 | 9251 | #!/usr/bin/python
import string
import sys
import re
from Numeric import *
from pychart import *
from xml.dom import minidom
class exception:
pass
class res:
"""
A 'structure' representing the results of a test.
"""
def __init__(self, x_label, y_label, cntnr_list, cntnr_descs, res_sets):
self.x_label = x_lab... | gpl-2.0 |
yonglehou/scikit-learn | sklearn/utils/metaestimators.py | 281 | 2353 | """Utilities for meta-estimators"""
# Author: Joel Nothman
# Andreas Mueller
# Licence: BSD
from operator import attrgetter
from functools import update_wrapper
__all__ = ['if_delegate_has_method']
class _IffHasAttrDescriptor(object):
"""Implements a conditional property using the descriptor protocol.
... | bsd-3-clause |
dzimmerer/pytorchcodehelpers | pytorchcodehelpers/pytcodetool.py | 1 | 1291 | import sys
import linecache
from pytorchcodehelpers.pytorchsize import InspectNet
if __name__ == '__main__':
rel_path = sys.argv[1]
file_path = sys.argv[2]
line_start = int(sys.argv[3])
line_end = int(sys.argv[4])
file_name = rel_path.replace("/" , ".")[:-3]
import_str = "from " + file_name ... | apache-2.0 |
ageron/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/io_test.py | 133 | 5063 | # 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... | apache-2.0 |
yonglehou/scikit-learn | examples/ensemble/plot_ensemble_oob.py | 257 | 3265 | """
=============================
OOB Errors for Random Forests
=============================
The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where
each new tree is fit from a bootstrap sample of the training observations
:math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er... | bsd-3-clause |
mxjl620/scikit-learn | examples/ensemble/plot_ensemble_oob.py | 257 | 3265 | """
=============================
OOB Errors for Random Forests
=============================
The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where
each new tree is fit from a bootstrap sample of the training observations
:math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er... | bsd-3-clause |
benoitsteiner/tensorflow-xsmm | tensorflow/python/data/kernel_tests/map_dataset_op_test.py | 5 | 27469 | # 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... | apache-2.0 |
dimkal/mne-python | mne/viz/tests/test_decoding.py | 10 | 3823 | # Authors: Denis Engemann <denis.engemann@gmail.com>
# Jean-Remi King <jeanremi.king@gmail.com>
#
# License: Simplified BSD
import os.path as op
import warnings
from nose.tools import assert_raises, assert_equals
import numpy as np
from mne.epochs import equalize_epoch_counts, concatenate_epochs
from mne.d... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.