hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f7ffce6617f4d71c3dacf5bee7fc9021e90a49 | 1,456 | py | Python | scibeam/tests/test_common.py | SuperYuLu/SciBeam | 80601adda9288fd32efeedf5b1de015761c1f8e5 | [
"MIT"
] | 3 | 2020-07-31T09:24:46.000Z | 2021-03-01T23:59:51.000Z | scibeam/tests/test_common.py | SuperYuLu/SciBeam | 80601adda9288fd32efeedf5b1de015761c1f8e5 | [
"MIT"
] | 12 | 2018-05-14T18:40:14.000Z | 2019-02-06T22:51:33.000Z | scibeam/tests/test_common.py | SuperYuLu/SciBeam | 80601adda9288fd32efeedf5b1de015761c1f8e5 | [
"MIT"
] | null | null | null | # test_core_common.py ---
#
# Filename: test_core_common.py
# Description:
#
# Author: Yu Lu
# Email: yulu@utexas.edu
# Github: https://github.com/SuperYuLu
#
# Created: Fri May 4 11:33:37 2018 (-0500)
# Version:
# Last-Updated: Sat Jul 28 15:00:42 2018 (-0500)
# By: yulu
# Update #: 24
... | 28 | 143 | 0.68544 |
port unittest
import os
import numpy as np
from scibeam.core.common import winPathHandler, loadFile
import pkg_resources
DATA_FILE = pkg_resources.resource_filename('scibeam', 'data/test/time_series_1D/single_time_series.lvm')
class TestFunctions(unittest.TestCase):
def test_winPathHandler... | true | true |
f7f800ac106a265213147c82ffe9cc092bebed51 | 2,886 | py | Python | source/datamanager.py | YeongHyeon/CVAE | 5db95ea6a1a01475cd0356e31bf593f09b5479c2 | [
"MIT"
] | 1 | 2021-07-21T11:47:52.000Z | 2021-07-21T11:47:52.000Z | source/datamanager.py | YeongHyeon/CVAE | 5db95ea6a1a01475cd0356e31bf593f09b5479c2 | [
"MIT"
] | null | null | null | source/datamanager.py | YeongHyeon/CVAE | 5db95ea6a1a01475cd0356e31bf593f09b5479c2 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from sklearn.utils import shuffle
class Dataset(object):
def __init__(self, normalize=True):
print("\nInitializing Dataset...")
self.normalize = normalize
(x_tr, y_tr), (x_te, y_te) = tf.keras.datasets.mnist.load_data()
self.x_tr, self... | 33.172414 | 102 | 0.586625 | import numpy as np
import tensorflow as tf
from sklearn.utils import shuffle
class Dataset(object):
def __init__(self, normalize=True):
print("\nInitializing Dataset...")
self.normalize = normalize
(x_tr, y_tr), (x_te, y_te) = tf.keras.datasets.mnist.load_data()
self.x_tr, self... | true | true |
f7f800d72b7136be59be7a488a23e84fc16dde0e | 758 | py | Python | pyschematron/elementpath_extensions/xslt1_parser.py | Ionite/pyschematron | f535f8f5a580ff91b601bc56ac35d0e916e7ea7c | [
"MIT"
] | null | null | null | pyschematron/elementpath_extensions/xslt1_parser.py | Ionite/pyschematron | f535f8f5a580ff91b601bc56ac35d0e916e7ea7c | [
"MIT"
] | 2 | 2021-03-31T19:50:13.000Z | 2021-12-13T20:38:36.000Z | pyschematron/elementpath_extensions/xslt1_parser.py | Ionite/pyschematron | f535f8f5a580ff91b601bc56ac35d0e916e7ea7c | [
"MIT"
] | null | null | null | from elementpath.xpath1_parser import XPath1Parser, is_document_node
class XSLT1Parser(XPath1Parser):
SYMBOLS = XPath1Parser.SYMBOLS | {
'current'
}
register = XSLT1Parser.register
unregister = XSLT1Parser.unregister
literal = XSLT1Parser.literal
prefix = XSLT1Parser.prefix
infix = XSLT1Parser.infix... | 22.969697 | 89 | 0.742744 | from elementpath.xpath1_parser import XPath1Parser, is_document_node
class XSLT1Parser(XPath1Parser):
SYMBOLS = XPath1Parser.SYMBOLS | {
'current'
}
register = XSLT1Parser.register
unregister = XSLT1Parser.unregister
literal = XSLT1Parser.literal
prefix = XSLT1Parser.prefix
infix = XSLT1Parser.infix... | true | true |
f7f80142682ee2eaa2d12695e92cc59eb4d8a700 | 486 | py | Python | IMU/VTK-6.2.0/ThirdParty/Twisted/twisted/runner/__init__.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | 4 | 2016-03-30T14:31:52.000Z | 2019-02-02T05:01:32.000Z | IMU/VTK-6.2.0/ThirdParty/Twisted/twisted/runner/__init__.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | 1 | 2020-03-06T04:49:42.000Z | 2020-03-06T04:49:42.000Z | IMU/VTK-6.2.0/ThirdParty/Twisted/twisted/runner/__init__.py | timkrentz/SunTracker | 9a189cc38f45e5fbc4e4c700d7295a871d022795 | [
"MIT"
] | 2 | 2019-08-30T23:36:13.000Z | 2019-11-08T16:52:01.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Twisted runner: run and monitor processes
Maintainer: Andrew Bennetts
classic inetd(8) support:
Future Plans: The basic design should be final. There are some bugs that need
fixing regarding UDP and Sun-RPC support. Perhaps some ... | 25.578947 | 79 | 0.757202 |
from twisted.runner._version import version
__version__ = version.short()
| true | true |
f7f8015bd437d58dde37a5c2655524e3b43eaa47 | 19 | py | Python | permafrost/forms.py | jared-hardy/django-permafrost | 588c0783791ec10f683da0235162a90f6936110a | [
"MIT"
] | null | null | null | permafrost/forms.py | jared-hardy/django-permafrost | 588c0783791ec10f683da0235162a90f6936110a | [
"MIT"
] | null | null | null | permafrost/forms.py | jared-hardy/django-permafrost | 588c0783791ec10f683da0235162a90f6936110a | [
"MIT"
] | null | null | null | # Permafrost Forms
| 9.5 | 18 | 0.789474 | true | true | |
f7f801e0f6e63198c93660a6e99628bc9c66d514 | 332 | py | Python | tests/test_utils.py | bdpedigo/molesq | 297c08dc0a41390dda5e8e5fc1bda612d7c417c0 | [
"MIT"
] | 4 | 2021-04-08T20:35:32.000Z | 2021-12-29T12:08:28.000Z | tests/test_utils.py | bdpedigo/molesq | 297c08dc0a41390dda5e8e5fc1bda612d7c417c0 | [
"MIT"
] | 7 | 2021-04-08T15:04:31.000Z | 2021-09-10T08:50:49.000Z | tests/test_utils.py | bdpedigo/molesq | 297c08dc0a41390dda5e8e5fc1bda612d7c417c0 | [
"MIT"
] | 1 | 2021-04-12T13:56:08.000Z | 2021-04-12T13:56:08.000Z | import numpy as np
from molesq.utils import grid_field
def test_grid_field():
test, shape = grid_field([0, 0], [2, 2])
ref = np.array(
[
[0, 0],
[0, 1],
[1, 0],
[1, 1],
]
).astype(test.dtype)
assert np.allclose(test, ref)
assert shap... | 18.444444 | 44 | 0.46988 | import numpy as np
from molesq.utils import grid_field
def test_grid_field():
test, shape = grid_field([0, 0], [2, 2])
ref = np.array(
[
[0, 0],
[0, 1],
[1, 0],
[1, 1],
]
).astype(test.dtype)
assert np.allclose(test, ref)
assert shap... | true | true |
f7f8024a32b0c75b5cb62b92ce0fa6a17fea3976 | 4,792 | py | Python | misc/acrn-config/kconfig/silentoldconfig.py | stanleyintel/acrn-hypervisor | 0461ac209f5f265c269b6d77415043b6f028598b | [
"BSD-3-Clause"
] | 1 | 2021-05-27T09:39:48.000Z | 2021-05-27T09:39:48.000Z | misc/acrn-config/kconfig/silentoldconfig.py | stanleyintel/acrn-hypervisor | 0461ac209f5f265c269b6d77415043b6f028598b | [
"BSD-3-Clause"
] | 1 | 2021-07-26T22:16:18.000Z | 2021-07-26T22:16:18.000Z | misc/acrn-config/kconfig/silentoldconfig.py | stanleyintel/acrn-hypervisor | 0461ac209f5f265c269b6d77415043b6f028598b | [
"BSD-3-Clause"
] | 1 | 2020-05-22T04:48:20.000Z | 2020-05-22T04:48:20.000Z | # Copyright (C) 2018 Intel Corporation.
# SPDX-License-Identifier: BSD-3-Clause
# This script
#
# 1. takes a Kconfig and a .config and an optional list of symbol-value pairs,
# 2. checks whether the specified symbols have the specified values in the
# given .config, and
# 3. reconstruct .config with... | 37.732283 | 111 | 0.643573 |
import sys
import os
import kconfiglib
def usage():
sys.stdout.write("%s: <Kconfig file> <.config file> [<symbol1>=<value1> ...]\n" % sys.argv[0])
def main():
if len(sys.argv) < 3:
usage()
sys.exit(1)
kconfig_path = sys.argv[1]
if not os.path.isfile(kconfig_path):
... | true | true |
f7f8031de972c097f7ceec05150b7ba2550e9682 | 5,404 | py | Python | lapps-grid/tools/stats/grouping.py | CDCgov/DCPC | c3fadef1bd6345e01a58afef051491d8ef6a7f93 | [
"Apache-2.0"
] | 6 | 2018-11-03T22:43:35.000Z | 2022-02-15T17:51:33.000Z | lapps-grid/tools/stats/grouping.py | CDCgov/DCPC | c3fadef1bd6345e01a58afef051491d8ef6a7f93 | [
"Apache-2.0"
] | 3 | 2015-06-06T22:16:03.000Z | 2015-11-12T00:22:45.000Z | lapps-grid/tools/stats/grouping.py | CDCgov/DCPC | c3fadef1bd6345e01a58afef051491d8ef6a7f93 | [
"Apache-2.0"
] | 10 | 2017-04-10T21:40:22.000Z | 2022-02-21T16:50:10.000Z | #!/usr/bin/env python
# Guruprasad Ananda
# Refactored 2011 to use numpy instead of rpy, Kanwei Li
"""
This tool provides the SQL "group by" functionality.
"""
import commands
import random
import sys
import tempfile
from itertools import groupby
import numpy
def stop_err(msg):
sys.stderr.write(msg)
sys.exit... | 30.531073 | 150 | 0.511288 |
"""
This tool provides the SQL "group by" functionality.
"""
import commands
import random
import sys
import tempfile
from itertools import groupby
import numpy
def stop_err(msg):
sys.stderr.write(msg)
sys.exit()
def mode(data):
counts = {}
for x in data:
counts[x] = counts.get(x, 0) + 1... | false | true |
f7f80538003027deb13f8bdc9fb62edef9688a8c | 1,879 | py | Python | 3rdparty/openmm/wrappers/python/tests/TestElement.py | merkys/MMB | 0531385b8367405e1188e31c3eef7aa4cc50170b | [
"MIT"
] | 5 | 2020-07-31T17:33:03.000Z | 2022-01-01T19:24:37.000Z | 3rdparty/openmm/wrappers/python/tests/TestElement.py | merkys/MMB | 0531385b8367405e1188e31c3eef7aa4cc50170b | [
"MIT"
] | 11 | 2020-06-16T05:05:42.000Z | 2022-03-30T09:59:14.000Z | 3rdparty/openmm/wrappers/python/tests/TestElement.py | merkys/MMB | 0531385b8367405e1188e31c3eef7aa4cc50170b | [
"MIT"
] | 9 | 2020-01-24T12:02:37.000Z | 2020-10-16T06:23:56.000Z | import pickle
import random
from simtk.unit import dalton, is_quantity
from simtk.openmm.app import element
import unittest
class TestElement(unittest.TestCase):
def test_immutable(self):
def modifyElement():
# this should not be allowed
element.sulfur.mass = 100*dalton
self... | 35.45283 | 79 | 0.619478 | import pickle
import random
from simtk.unit import dalton, is_quantity
from simtk.openmm.app import element
import unittest
class TestElement(unittest.TestCase):
def test_immutable(self):
def modifyElement():
element.sulfur.mass = 100*dalton
self.assertRaises(AttributeError... | true | true |
f7f8054ffbb949d6a816f432ca63fe411102b096 | 5,278 | py | Python | qlib/contrib/data/highfreq_handler.py | SunsetWolf/qlib | 89972f6c6f9fa629b4f74093d4ba1e93c9f7a5e5 | [
"MIT"
] | 1 | 2021-12-14T13:48:38.000Z | 2021-12-14T13:48:38.000Z | qlib/contrib/data/highfreq_handler.py | SunsetWolf/qlib | 89972f6c6f9fa629b4f74093d4ba1e93c9f7a5e5 | [
"MIT"
] | null | null | null | qlib/contrib/data/highfreq_handler.py | SunsetWolf/qlib | 89972f6c6f9fa629b4f74093d4ba1e93c9f7a5e5 | [
"MIT"
] | null | null | null | from qlib.data.dataset.handler import DataHandler, DataHandlerLP
EPSILON = 1e-4
class HighFreqHandler(DataHandlerLP):
def __init__(
self,
instruments="csi300",
start_time=None,
end_time=None,
infer_processors=[],
learn_processors=[],
fit_start_time=None,
... | 31.987879 | 118 | 0.504737 | from qlib.data.dataset.handler import DataHandler, DataHandlerLP
EPSILON = 1e-4
class HighFreqHandler(DataHandlerLP):
def __init__(
self,
instruments="csi300",
start_time=None,
end_time=None,
infer_processors=[],
learn_processors=[],
fit_start_time=None,
... | true | true |
f7f8061269ba51737ab58c9ec598582dd02691c2 | 124,434 | py | Python | tensorflow/python/ops/ragged/ragged_tensor.py | Saduf2019/tensorflow-1 | d36aab4a474da352accfca38edb5d0f1c584ed9b | [
"Apache-2.0"
] | 7 | 2022-03-04T21:14:47.000Z | 2022-03-22T23:07:39.000Z | tensorflow/python/ops/ragged/ragged_tensor.py | Martaw-code/tensorflow | f210b2b2f8489ffe97edac886238242288950439 | [
"Apache-2.0"
] | 1 | 2022-03-08T18:28:46.000Z | 2022-03-08T18:37:20.000Z | tensorflow/python/ops/ragged/ragged_tensor.py | Martaw-code/tensorflow | f210b2b2f8489ffe97edac886238242288950439 | [
"Apache-2.0"
] | null | null | null | # 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... | 40.243855 | 82 | 0.650184 |
import functools
import operator
import typing
import numpy as np
from tensorflow.python import tf2
from tensorflow.python.client import session
from tensorflow.python.framework import composite_tensor
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
fr... | true | true |
f7f80656cbe77cd51aa948310feab649c559e78c | 5,548 | py | Python | tests/runtimes/test_base.py | jillnogold/mlrun | beff7da359b697156890e4eb45cb9a1bc9f16631 | [
"Apache-2.0"
] | null | null | null | tests/runtimes/test_base.py | jillnogold/mlrun | beff7da359b697156890e4eb45cb9a1bc9f16631 | [
"Apache-2.0"
] | null | null | null | tests/runtimes/test_base.py | jillnogold/mlrun | beff7da359b697156890e4eb45cb9a1bc9f16631 | [
"Apache-2.0"
] | null | null | null | import base64
import json
import os
import pytest
import mlrun.errors
from mlrun.config import config as mlconf
from mlrun.runtimes import KubejobRuntime
from mlrun.runtimes.pod import AutoMountType
class TestAutoMount:
def setup_method(self, method):
# set auto-mount to work as if this is an Iguazio sy... | 34.893082 | 107 | 0.665826 | import base64
import json
import os
import pytest
import mlrun.errors
from mlrun.config import config as mlconf
from mlrun.runtimes import KubejobRuntime
from mlrun.runtimes.pod import AutoMountType
class TestAutoMount:
def setup_method(self, method):
mlconf.igz_version = "1.1.1"
mlconf... | true | true |
f7f806f6320e69b58b10203ee8f6c15991f14131 | 1,032 | py | Python | src/lambda_codebase/account/handler.py | ottokruse/aws-deployment-framework | b8fa70f792ee36af137edd23c35c86db53999497 | [
"Apache-2.0"
] | null | null | null | src/lambda_codebase/account/handler.py | ottokruse/aws-deployment-framework | b8fa70f792ee36af137edd23c35c86db53999497 | [
"Apache-2.0"
] | null | null | null | src/lambda_codebase/account/handler.py | ottokruse/aws-deployment-framework | b8fa70f792ee36af137edd23c35c86db53999497 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""
The Account handler that is called when ADF is installed to initially create the deployment account if required
"""
try:
from main import lambda_handler # pylint: disable=unused-import
except Exception a... | 33.290323 | 111 | 0.61531 |
try:
from main import lambda_handler
except Exception as err:
from urllib.request import Request, urlopen
import json
def lambda_handler(event, _context, prior_error=err):
response = dict(
LogicalResourceId=event["LogicalResourceId"],
PhysicalResourceId=event.get(... | true | true |
f7f807b5891545a7d194856b5f69bf83b6db5cbb | 949 | py | Python | nb_third_party/jinja2/_ipysupport.py | djprmf/namebench | ffbd716edf957d3788390444d2ef475d8828391a | [
"Apache-2.0"
] | 460 | 2016-01-13T12:49:34.000Z | 2022-02-20T04:10:40.000Z | nb_third_party/jinja2/_ipysupport.py | djprmf/namebench | ffbd716edf957d3788390444d2ef475d8828391a | [
"Apache-2.0"
] | 24 | 2016-11-07T04:59:49.000Z | 2022-03-14T06:34:12.000Z | nb_third_party/jinja2/_ipysupport.py | djprmf/namebench | ffbd716edf957d3788390444d2ef475d8828391a | [
"Apache-2.0"
] | 148 | 2016-01-17T03:16:43.000Z | 2022-03-17T12:20:36.000Z | # -*- coding: utf-8 -*-
"""
jinja2._ipysupport
~~~~~~~~~~~~~~~~~~
IronPython support library. This library exports functionality from
the CLR to Python that is normally available in the standard library.
:copyright: (c) 2009 by the Jinja Team.
:license: BSD.
"""
from System import DateTime
fr... | 23.146341 | 73 | 0.633298 |
from System import DateTime
from System.IO import Path, File, FileInfo
epoch = DateTime(1970, 1, 1)
class _PathModule(object):
sep = str(Path.DirectorySeparatorChar)
altsep = str(Path.AltDirectorySeparatorChar)
pardir = '..'
def join(self, path, *args):
args = list(args[::-1])
whi... | true | true |
f7f809f35afb3f02db78e329db8de0b62d5678e0 | 910 | py | Python | seam_erasure/points_in_triangle.py | zfergus2/Seam-Minimization-Service | 2cfce0e4e29d3b40b0b8626994a6e6b89d5303cd | [
"MIT"
] | 98 | 2017-08-09T01:10:33.000Z | 2022-02-25T14:31:06.000Z | seam_erasure/points_in_triangle.py | zfergus2/Seam-Minimization-Service | 2cfce0e4e29d3b40b0b8626994a6e6b89d5303cd | [
"MIT"
] | 2 | 2019-10-10T17:50:12.000Z | 2020-01-26T11:30:33.000Z | seam_erasure/points_in_triangle.py | zfergus2/Seam-Minimization-Service | 2cfce0e4e29d3b40b0b8626994a6e6b89d5303cd | [
"MIT"
] | 16 | 2017-09-15T09:08:37.000Z | 2021-02-07T22:44:58.000Z | """
Utility file for testing if points are in a given triangle.
Written by Zachary Ferguson
"""
import numpy
def points_in_triangle(tri, points, tol=1e-8):
"""
Test if the points are inside the triangle.
Input:
tri - the triangle as a matrix where the rows are the xy points.
points - th... | 28.4375 | 73 | 0.672527 |
import numpy
def points_in_triangle(tri, points, tol=1e-8):
B = numpy.vstack([tri.T, numpy.ones(3)])
vecs = numpy.vstack([points.T, numpy.ones((1, points.shape[0]))])
try:
coords = numpy.linalg.solve(B, vecs)
except Exception:
return numpy.zeros(points.shape[0]).astyp... | true | true |
f7f80a29f3606c4eea4afc31cd571abf27025986 | 860 | py | Python | tests/big_map_diff/ooP8uoN2eMv1dcC8wdMgKvgHJBuQYARFXH4KMURfJdGgMZofC79/test_big_map_ooP8uo.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2021-05-20T16:52:08.000Z | 2021-05-20T16:52:08.000Z | tests/big_map_diff/ooP8uoN2eMv1dcC8wdMgKvgHJBuQYARFXH4KMURfJdGgMZofC79/test_big_map_ooP8uo.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2020-12-30T16:44:56.000Z | 2020-12-30T16:44:56.000Z | tests/big_map_diff/ooP8uoN2eMv1dcC8wdMgKvgHJBuQYARFXH4KMURfJdGgMZofC79/test_big_map_ooP8uo.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2022-03-20T19:01:00.000Z | 2022-03-20T19:01:00.000Z | from unittest import TestCase
from tests import get_data
from pytezos.michelson.contract import ContractStorage
class BigMapCodingTestooP8uo(TestCase):
def setUp(self):
self.maxDiff = None
def test_big_map_ooP8uo(self):
section = get_data(
path='big_map_diff/ooP8uoN2eMv1dcC8... | 31.851852 | 105 | 0.683721 | from unittest import TestCase
from tests import get_data
from pytezos.michelson.contract import ContractStorage
class BigMapCodingTestooP8uo(TestCase):
def setUp(self):
self.maxDiff = None
def test_big_map_ooP8uo(self):
section = get_data(
path='big_map_diff/ooP8uoN2eMv1dcC8... | true | true |
f7f80aa49a5b169520d0cefb8838f618904c93d2 | 8,607 | py | Python | preprocessing/her2_split_and_imbalance.py | minotm/NTA | cc8aba4ea46fe40ce621f1314d9798f54de41d5b | [
"MIT"
] | 1 | 2022-03-24T08:30:30.000Z | 2022-03-24T08:30:30.000Z | preprocessing/her2_split_and_imbalance.py | minotm/NTA | cc8aba4ea46fe40ce621f1314d9798f54de41d5b | [
"MIT"
] | null | null | null | preprocessing/her2_split_and_imbalance.py | minotm/NTA | cc8aba4ea46fe40ce621f1314d9798f54de41d5b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created 2022
@author: Mason Minot
"""
from Levenshtein import distance as levenshtein_distance
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
print('Now Executing Trastuzumab Train/Val/Test Splitting...')
"""
This script... | 37.585153 | 162 | 0.694551 |
from Levenshtein import distance as levenshtein_distance
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
print('Now Executing Trastuzumab Train/Val/Test Splitting...')
def add_LD_to_df(antigen_ID, data_frame):
if antigen_ID == 'her2':
wt_str = 'WGGDGFYA... | true | true |
f7f80ad4ff5d6463387ea412e948855ae4b5eeef | 27,337 | py | Python | ingestion/tests/unit/test_source_connection.py | ShaileshParmar11/OpenMetadata | 994a83bb9598facd9b9a4575f42b5a3c4a212f8f | [
"Apache-2.0"
] | null | null | null | ingestion/tests/unit/test_source_connection.py | ShaileshParmar11/OpenMetadata | 994a83bb9598facd9b9a4575f42b5a3c4a212f8f | [
"Apache-2.0"
] | null | null | null | ingestion/tests/unit/test_source_connection.py | ShaileshParmar11/OpenMetadata | 994a83bb9598facd9b9a4575f42b5a3c4a212f8f | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Collate
# 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... | 38.502817 | 148 | 0.64934 |
from unittest import TestCase
from metadata.generated.schema.entity.services.connections.database.athenaConnection import (
AthenaConnection,
AthenaScheme,
)
from metadata.generated.schema.entity.services.connections.database.clickhouseConnection import (
ClickhouseConnection,
ClickhouseSch... | true | true |
f7f80aec02b08289770e63c9425a37283bb4fbab | 2,044 | py | Python | ThirdParty/pybluez2-macos_fix/examples/simple/asynchronous-inquiry.py | zhaocy14/SmartWalker | b025a7b4a2b305838a22fe4e6116ddb951c4d7bf | [
"MIT"
] | 2 | 2021-11-13T14:16:06.000Z | 2022-01-12T06:07:32.000Z | ThirdParty/pybluez-master/examples/simple/asynchronous-inquiry.py | zhaocy14/SmartWalker | b025a7b4a2b305838a22fe4e6116ddb951c4d7bf | [
"MIT"
] | null | null | null | ThirdParty/pybluez-master/examples/simple/asynchronous-inquiry.py | zhaocy14/SmartWalker | b025a7b4a2b305838a22fe4e6116ddb951c4d7bf | [
"MIT"
] | 3 | 2021-08-30T04:40:39.000Z | 2022-01-09T11:34:04.000Z | #!/usr/bin/env python3
"""PyBluez simple example asyncronous-inquiry.py
Demonstration of how to do asynchronous device discovery by subclassing
the DeviceDiscoverer class
Linux only (5/5/2006)
Author: Albert Huang <albert@csail.mit.edu>
$Id: asynchronous-inquiry.py 405 2006-05-06 00:39:50Z albert $
"""
import select... | 28 | 72 | 0.526908 |
import select
import bluetooth
class MyDiscoverer(bluetooth.DeviceDiscoverer):
def pre_inquiry(self):
self.done = False
def device_discovered(self, address, device_class, rssi, name):
print("{} - {}".format(address, name))
major_classes = ("Miscellaneou... | true | true |
f7f80b7f66713349e306f8d26cffecfe7c33203c | 341 | py | Python | test_utils/__init__.py | nedbat-test-external/api-doc-tools | 54a0c81a676b075d372e15705b6d0a133b098e1c | [
"Apache-2.0"
] | 4 | 2020-04-10T03:07:41.000Z | 2021-12-02T04:47:19.000Z | test_utils/__init__.py | nedbat-test-external/api-doc-tools | 54a0c81a676b075d372e15705b6d0a133b098e1c | [
"Apache-2.0"
] | 68 | 2019-10-29T20:22:28.000Z | 2021-12-09T08:07:44.000Z | test_utils/__init__.py | openedx/api-doc-tools | 65e2989324f079dc9b9c652042730cd01d7b3709 | [
"Apache-2.0"
] | 6 | 2020-04-30T19:04:26.000Z | 2021-06-08T08:25:25.000Z | """
Test utilities.
Since pytest discourages putting __init__.py into test directory (i.e. making tests a
package) one cannot import from anywhere under tests folder.
However, some utility classes/methods might be useful in multiple test modules
(i.e. factoryboy factories, base test classes).
So this package is the pl... | 34.1 | 85 | 0.782991 | true | true | |
f7f80c2ebf3335ee369f21e6a5be40468a97f63a | 6,328 | py | Python | tests/components/knx/test_select.py | EuleMitKeule/core | 3af54d96c7dcc3f7087d1196e6ab0db029301ee7 | [
"Apache-2.0"
] | 6 | 2017-11-15T09:56:41.000Z | 2021-01-24T15:12:09.000Z | tests/components/knx/test_select.py | EuleMitKeule/core | 3af54d96c7dcc3f7087d1196e6ab0db029301ee7 | [
"Apache-2.0"
] | 87 | 2020-07-15T13:43:35.000Z | 2022-03-23T07:43:10.000Z | tests/components/knx/test_select.py | EuleMitKeule/core | 3af54d96c7dcc3f7087d1196e6ab0db029301ee7 | [
"Apache-2.0"
] | 2 | 2020-06-06T21:55:32.000Z | 2022-03-06T04:18:21.000Z | """Test KNX select."""
from unittest.mock import patch
import pytest
from homeassistant.components.knx.const import (
CONF_PAYLOAD,
CONF_PAYLOAD_LENGTH,
CONF_RESPOND_TO_READ,
CONF_STATE_ADDRESS,
CONF_SYNC_STATE,
KNX_ADDRESS,
)
from homeassistant.components.knx.schema import SelectSchema
from h... | 33.305263 | 83 | 0.645702 | from unittest.mock import patch
import pytest
from homeassistant.components.knx.const import (
CONF_PAYLOAD,
CONF_PAYLOAD_LENGTH,
CONF_RESPOND_TO_READ,
CONF_STATE_ADDRESS,
CONF_SYNC_STATE,
KNX_ADDRESS,
)
from homeassistant.components.knx.schema import SelectSchema
from homeassistant.const impo... | true | true |
f7f80d337861a1cd114f639b31d30d328e3a00e8 | 319 | py | Python | shopyo/modules/box__default/settings/helpers.py | Attakay78/shopyo | a9f6e4a56e36edc9f5588323ebb5f9103c343b1f | [
"MIT"
] | 235 | 2019-06-30T22:21:29.000Z | 2022-03-31T06:12:12.000Z | shopyo/modules/box__default/settings/helpers.py | Attakay78/shopyo | a9f6e4a56e36edc9f5588323ebb5f9103c343b1f | [
"MIT"
] | 441 | 2019-06-26T20:07:58.000Z | 2021-05-05T17:44:23.000Z | shopyo/modules/box__default/settings/helpers.py | Attakay78/shopyo | a9f6e4a56e36edc9f5588323ebb5f9103c343b1f | [
"MIT"
] | 157 | 2019-06-26T22:30:39.000Z | 2022-03-22T09:06:24.000Z | from modules.box__default.settings.models import Settings
def get_setting(name):
"""
Used as key-value lookup from Settings table
Parameters
----------
name: str
name of key
Returns
-------
str
value of key
"""
s = Settings.query.get(name)
return s.value
| 15.95 | 57 | 0.579937 | from modules.box__default.settings.models import Settings
def get_setting(name):
s = Settings.query.get(name)
return s.value
| true | true |
f7f80d43df1289d0b16648e52eebd8018d919380 | 4,657 | py | Python | techminer2/slope_chart.py | jdvelasq/techminer-api | d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da | [
"MIT"
] | null | null | null | techminer2/slope_chart.py | jdvelasq/techminer-api | d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da | [
"MIT"
] | null | null | null | techminer2/slope_chart.py | jdvelasq/techminer-api | d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da | [
"MIT"
] | null | null | null | """
Slope Chart
===============================================================================
"""
import textwrap
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# from .plots.multiindex2text import multindex2text
TEXTLEN = 35
def slope_chart(
matrix,
figsize=(6, ... | 23.760204 | 80 | 0.49388 | import textwrap
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
TEXTLEN = 35
def slope_chart(
matrix,
figsize=(6, 6),
cmap="Greys",
cmap_by="Reds",
fontsize=9,
):
matrix = matrix.copy()
if isinstance(matrix.columns, pd.MultiIndex):
matr... | true | true |
f7f80d7b69236ed01043222376908325e591ac85 | 2,761 | py | Python | src/math_py/imo_shl/imo_shl_2015_n2.py | kapsitis/math | f21b172d4a58ec8ba25003626de02bfdda946cdc | [
"BSD-3-Clause"
] | null | null | null | src/math_py/imo_shl/imo_shl_2015_n2.py | kapsitis/math | f21b172d4a58ec8ba25003626de02bfdda946cdc | [
"BSD-3-Clause"
] | 3 | 2020-07-20T03:40:52.000Z | 2022-02-10T21:50:18.000Z | src/math_py/imo_shl/imo_shl_2015_n2.py | kapsitis/math | f21b172d4a58ec8ba25003626de02bfdda946cdc | [
"BSD-3-Clause"
] | null | null | null | '''
Creative Commons, CC-BY 4.0
@author: kalvis
'''
import math
from imo_shl import numtheory_utils
# Return the product of all the numbers [m+1,n]
def prod_all(m,n):
result = 1
for k in list(range(m+1,n+1)):
result = result*k
return result
# Return factorial n! factorization as prime powers
def... | 24.433628 | 77 | 0.505614 |
import math
from imo_shl import numtheory_utils
def prod_all(m,n):
result = 1
for k in list(range(m+1,n+1)):
result = result*k
return result
def fact_factorial(n):
if n == 2:
return [(2,1)]
plist = list()
result = list()
for p in range(2,n+1):
if numtheory_utils... | true | true |
f7f80d82fc95e7673867310865f45088387388fa | 1,841 | py | Python | nucypher/tests/crypto/test_api.py | kanzeparov/NuCypher | 0d7e349872909d0cacfd66583d018d722587b2e7 | [
"FTL",
"CNRI-Python"
] | null | null | null | nucypher/tests/crypto/test_api.py | kanzeparov/NuCypher | 0d7e349872909d0cacfd66583d018d722587b2e7 | [
"FTL",
"CNRI-Python"
] | null | null | null | nucypher/tests/crypto/test_api.py | kanzeparov/NuCypher | 0d7e349872909d0cacfd66583d018d722587b2e7 | [
"FTL",
"CNRI-Python"
] | null | null | null | """
This file is part of nucypher.
nucypher is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
nucypher is distributed in the hope that it wil... | 29.222222 | 68 | 0.688213 |
import unittest
import sha3
from nucypher.crypto import api
class TestCrypto(unittest.TestCase):
def test_secure_random(self):
rand1 = api.secure_random(10)
rand2 = api.secure_random(10)
self.assertNotEqual(rand1, rand2)
self.assertEqual(bytes, type(rand1))
self.assert... | true | true |
f7f80e0618a4abd812854dc0db8f17851032284c | 16,057 | py | Python | programmes_python/CommandeEnTension.py | 3sigma/T-Quad-Commande-Moteurs-en-Tension | 4d302f2a4a0a1a12264b967a991b1824830c5556 | [
"MIT"
] | null | null | null | programmes_python/CommandeEnTension.py | 3sigma/T-Quad-Commande-Moteurs-en-Tension | 4d302f2a4a0a1a12264b967a991b1824830c5556 | [
"MIT"
] | null | null | null | programmes_python/CommandeEnTension.py | 3sigma/T-Quad-Commande-Moteurs-en-Tension | 4d302f2a4a0a1a12264b967a991b1824830c5556 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
##################################################################################
# Programme de commande en tension des moteurs du robot T-Quad,
# disponible à l'adresse:
# http://boutique.3sigma.fr/12-robots
#
# Auteur: 3Sigma
# Version 1.1.2 - 30/01/2017
##################... | 34.982571 | 304 | 0.668058 |
GaucheDeltaPos = codeursDeltaPos[1]
codeurAvantDroitDeltaPos = codeursDeltaPos[2]
codeurAvantGaucheDeltaPos = codeursDeltaPos[3]
# Suppression de mesures aberrantes
if (abs(codeurArriereDroitDeltaPos - codeurArriereDroitDeltaPosPrec) > 20) or (abs(codeurArriereGaucheDeltaPos ... | false | true |
f7f80e998b2c4664f87931467c1aa6bc136bb29a | 4,019 | py | Python | storm_control/sc_hardware/yokogawa/w1SpinningDisk.py | BoettigerLab/microscope-control | 6cfa570d52ad1f14871bef94721dd51d14f61671 | [
"MIT"
] | 1 | 2021-03-17T20:25:59.000Z | 2021-03-17T20:25:59.000Z | storm_control/sc_hardware/yokogawa/w1SpinningDisk.py | BoettigerLab/microscope-control | 6cfa570d52ad1f14871bef94721dd51d14f61671 | [
"MIT"
] | null | null | null | storm_control/sc_hardware/yokogawa/w1SpinningDisk.py | BoettigerLab/microscope-control | 6cfa570d52ad1f14871bef94721dd51d14f61671 | [
"MIT"
] | 1 | 2021-03-17T21:24:35.000Z | 2021-03-17T21:24:35.000Z | #!/usr/bin/env python
"""
A serial interface to the W1 Spinning Disk from Yokogawa/Andor.
Jeffrey Moffitt 5/16
Hazen Babcock 5/17
"""
import storm_control.sc_hardware.serial.RS232 as RS232
class W1SpinningDisk(RS232.RS232):
def __init__(self, **kwds):
super().__init__(**kwds)
# Define error co... | 39.792079 | 83 | 0.55362 |
import storm_control.sc_hardware.serial.RS232 as RS232
class W1SpinningDisk(RS232.RS232):
def __init__(self, **kwds):
super().__init__(**kwds)
self.error_codes = {"30005": "Command name error",
"30006": "Command argument number error",
... | true | true |
f7f810c613e8337ac0f0288efca9ad1b3807e795 | 1,627 | py | Python | saleor/graphql/api.py | ballon3/PlanB | 890735d0c09f68e7dd603f577e3d5bcbf818a2ab | [
"CC-BY-4.0"
] | 2 | 2019-10-16T13:41:57.000Z | 2020-03-07T07:34:05.000Z | saleor/graphql/api.py | ysaakpr/saleor | 8060fa88b9f8e0f78db4adb69396a835e3fd03d8 | [
"CC-BY-4.0"
] | 14 | 2020-03-24T17:54:18.000Z | 2022-02-10T19:43:59.000Z | saleor/graphql/api.py | ysaakpr/saleor | 8060fa88b9f8e0f78db4adb69396a835e3fd03d8 | [
"CC-BY-4.0"
] | 2 | 2019-10-12T09:35:02.000Z | 2019-10-15T07:18:25.000Z | import graphene
from .account.schema import AccountMutations, AccountQueries
from .checkout.schema import CheckoutMutations, CheckoutQueries
from .core.schema import CoreMutations, CoreQueries
from .discount.schema import DiscountMutations, DiscountQueries
from .extensions.schema import ExtensionsMutations, Extensions... | 27.116667 | 69 | 0.791641 | import graphene
from .account.schema import AccountMutations, AccountQueries
from .checkout.schema import CheckoutMutations, CheckoutQueries
from .core.schema import CoreMutations, CoreQueries
from .discount.schema import DiscountMutations, DiscountQueries
from .extensions.schema import ExtensionsMutations, Extensions... | true | true |
f7f81101600db7bb9121ab36da21e5ca8e166a41 | 7,812 | py | Python | tbx/log.py | ronhanson/python-tbx | 7f5015bcc231b42617bdc3537fb39e5b05d4f7af | [
"MIT"
] | 2 | 2016-05-27T06:21:27.000Z | 2018-12-01T15:02:42.000Z | tbx/log.py | ronhanson/python-tbx | 7f5015bcc231b42617bdc3537fb39e5b05d4f7af | [
"MIT"
] | null | null | null | tbx/log.py | ronhanson/python-tbx | 7f5015bcc231b42617bdc3537fb39e5b05d4f7af | [
"MIT"
] | 2 | 2018-12-01T15:02:43.000Z | 2020-11-23T07:57:09.000Z | # coding: utf-8
from __future__ import print_function
"""
(c) 2013 - Ronan Delacroix
Logging Utils
:author: Ronan Delacroix
"""
import sys
import os
import socket
import logging
import logging.handlers
from . import code
def configure_logging_to_screen(debug=False):
level = 'INFO'
if debug:
level = 'D... | 38.673267 | 144 | 0.684588 |
from __future__ import print_function
import sys
import os
import socket
import logging
import logging.handlers
from . import code
def configure_logging_to_screen(debug=False):
level = 'INFO'
if debug:
level = 'DEBUG'
(script_folder, app_name) = code.get_app_name()
settings = {'LOGGING_SCREEN... | true | true |
f7f8111b364f25e2d551da6532929bb85b43b524 | 4,831 | py | Python | tests/_ntlm_raw/test_security.py | dhirschfeld/pyspnego | 5ce9494e7f582fbcc533c8bf6c3dce4a946c8138 | [
"MIT"
] | null | null | null | tests/_ntlm_raw/test_security.py | dhirschfeld/pyspnego | 5ce9494e7f582fbcc533c8bf6c3dce4a946c8138 | [
"MIT"
] | 1 | 2020-08-27T03:48:49.000Z | 2020-08-27T03:48:49.000Z | tests/_ntlm_raw/test_security.py | dhirschfeld/pyspnego | 5ce9494e7f582fbcc533c8bf6c3dce4a946c8138 | [
"MIT"
] | null | null | null | # Copyright: (c) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type # noqa (fixes E402 for the imports below)
import re
import pytest
from spnego._ntlm_raw.... | 38.959677 | 116 | 0.723867 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
import pytest
from spnego._ntlm_raw.crypto import (
compute_response_v1,
lmowfv1,
ntowfv1,
rc4init,
sealkey,
signkey,
)
from spnego._ntlm_raw.messages import (
NegotiateFlags,
)
from s... | true | true |
f7f8129e746e63705f1dee8a105616c1e0b1cb4d | 15,100 | py | Python | train/tasks/semantic/dataset/kitti/parser.py | andrewkouri/lidar-bonnetal | a0b5c6aba530701084ac66a02532689ed580f934 | [
"MIT"
] | null | null | null | train/tasks/semantic/dataset/kitti/parser.py | andrewkouri/lidar-bonnetal | a0b5c6aba530701084ac66a02532689ed580f934 | [
"MIT"
] | null | null | null | train/tasks/semantic/dataset/kitti/parser.py | andrewkouri/lidar-bonnetal | a0b5c6aba530701084ac66a02532689ed580f934 | [
"MIT"
] | 2 | 2020-08-29T06:24:13.000Z | 2021-06-25T22:13:22.000Z | import os
import numpy as np
import torch
from torch.utils.data import Dataset
from common.laserscan import LaserScan, SemLaserScan
EXTENSIONS_SCAN = ['.bin']
EXTENSIONS_LABEL = ['.label']
def is_scan(filename):
return any(filename.endswith(ext) for ext in EXTENSIONS_SCAN)
def is_label(filename):
return an... | 41.369863 | 195 | 0.536358 | import os
import numpy as np
import torch
from torch.utils.data import Dataset
from common.laserscan import LaserScan, SemLaserScan
EXTENSIONS_SCAN = ['.bin']
EXTENSIONS_LABEL = ['.label']
def is_scan(filename):
return any(filename.endswith(ext) for ext in EXTENSIONS_SCAN)
def is_label(filename):
return an... | true | true |
f7f8133e4f86d23d1c2ffa7cf3cc69596e7c8612 | 506 | py | Python | setup.py | tylerhether/Flip2BeRAD | f16ee1873f4e58cb1fc516ccd6d6a6ff2b90cc4c | [
"MIT"
] | 6 | 2016-05-04T21:32:01.000Z | 2022-02-26T22:33:28.000Z | setup.py | tylerhether/Flip2BeRAD | f16ee1873f4e58cb1fc516ccd6d6a6ff2b90cc4c | [
"MIT"
] | null | null | null | setup.py | tylerhether/Flip2BeRAD | f16ee1873f4e58cb1fc516ccd6d6a6ff2b90cc4c | [
"MIT"
] | 1 | 2019-06-18T04:06:28.000Z | 2019-06-18T04:06:28.000Z | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Flip2BeRAD',
'author': 'Tyler Hether',
'url': 'https://github.com/tylerhether/Flip2BeRAD',
'download_url': 'https://github.com/tylerhether/Flip2BeRAD',
'author_email': 'tyler [d... | 25.3 | 64 | 0.626482 | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Flip2BeRAD',
'author': 'Tyler Hether',
'url': 'https://github.com/tylerhether/Flip2BeRAD',
'download_url': 'https://github.com/tylerhether/Flip2BeRAD',
'author_email': 'tyler [d... | true | true |
f7f813c493976cfdfc39651e3c3851a2bae9bcfb | 2,244 | py | Python | tutorials/mechanisms/tutorial_convenience.py | AQ18/skimpy | 435fc50244f2ca815bbb39d525a82a4692f5c0ac | [
"Apache-2.0"
] | 13 | 2020-11-05T10:59:13.000Z | 2022-03-21T01:38:31.000Z | tutorials/mechanisms/tutorial_convenience.py | AQ18/skimpy | 435fc50244f2ca815bbb39d525a82a4692f5c0ac | [
"Apache-2.0"
] | 4 | 2022-01-27T10:23:40.000Z | 2022-03-10T18:16:06.000Z | tutorials/mechanisms/tutorial_convenience.py | AQ18/skimpy | 435fc50244f2ca815bbb39d525a82a4692f5c0ac | [
"Apache-2.0"
] | 6 | 2020-08-04T17:01:33.000Z | 2022-03-21T01:38:32.000Z | # -*- coding: utf-8 -*-
"""
.. module:: skimpy
:platform: Unix, Windows
:synopsis: Simple Kinetic Models in Python
.. moduleauthor:: SKiMPy team
[---------]
Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB),
Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland
Licensed under the ... | 30.739726 | 87 | 0.61943 |
import numpy as np
from skimpy.core import *
from skimpy.mechanisms import *
name = 'pfk'
SpecificConvenience = make_convenience([-2, -1, 3])
metabolites = SpecificConvenience.Reactants(substrate1 = 'A',
substrate2 = 'B',
produ... | true | true |
f7f8144b656a6265d8951bf78bd6667ebc8314e4 | 939 | py | Python | thevoid/urls.py | CBR0MS/telematicEnvironment | 6b3130347cad06c6b3aa453010c91d9990bc9cb8 | [
"MIT"
] | null | null | null | thevoid/urls.py | CBR0MS/telematicEnvironment | 6b3130347cad06c6b3aa453010c91d9990bc9cb8 | [
"MIT"
] | 2 | 2020-06-05T19:00:38.000Z | 2021-06-10T20:51:00.000Z | thevoid/urls.py | cbroms/telematicEnvironment | 6b3130347cad06c6b3aa453010c91d9990bc9cb8 | [
"MIT"
] | null | null | null | """thevoid URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 37.56 | 77 | 0.72524 | from django.contrib import admin
from django.urls import include, path
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('', include('whispers.urls')),
path('admin/', admin.site.urls),
]+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
| true | true |
f7f814d2708edec9c91c5aec436d7420ee06b70a | 7,436 | py | Python | src/teacher_school_allocation.py | sarahsester/q_hackathon | 963dcfbe8e3fa8bda954f4fc6db8a238f1d8a720 | [
"MIT"
] | null | null | null | src/teacher_school_allocation.py | sarahsester/q_hackathon | 963dcfbe8e3fa8bda954f4fc6db8a238f1d8a720 | [
"MIT"
] | null | null | null | src/teacher_school_allocation.py | sarahsester/q_hackathon | 963dcfbe8e3fa8bda954f4fc6db8a238f1d8a720 | [
"MIT"
] | 1 | 2021-11-30T18:27:56.000Z | 2021-11-30T18:27:56.000Z | from ortools.linear_solver import pywraplp
import pandas as pd
import numpy as np
def create_cost_matrix(distances, pref_big_school, pref_rural):
cost_matrix = distances + 10 * pref_big_school + 10 * pref_rural
return cost_matrix
def find_optimal_allocation(df_schools, distances, pref_big_school, pref_rural... | 44 | 121 | 0.630312 | from ortools.linear_solver import pywraplp
import pandas as pd
import numpy as np
def create_cost_matrix(distances, pref_big_school, pref_rural):
cost_matrix = distances + 10 * pref_big_school + 10 * pref_rural
return cost_matrix
def find_optimal_allocation(df_schools, distances, pref_big_school, pref_rural... | true | true |
f7f814e911f204789aaf98d602ae5abf2de91353 | 41 | py | Python | cf_xarray/__init__.py | Ouranosinc/cf-xarray | 713d60e366fd3ad31a1f2f2169f02662f3b7a6f4 | [
"Apache-2.0"
] | 1 | 2020-06-01T16:24:10.000Z | 2020-06-01T16:24:10.000Z | cf_xarray/__init__.py | jthielen/cf-xarray | d3b45ae578fc1510f276eb4d549a18b0b5c503ec | [
"Apache-2.0"
] | null | null | null | cf_xarray/__init__.py | jthielen/cf-xarray | d3b45ae578fc1510f276eb4d549a18b0b5c503ec | [
"Apache-2.0"
] | null | null | null | from .accessor import CFAccessor # noqa
| 20.5 | 40 | 0.780488 | from .accessor import CFAccessor
| true | true |
f7f814eac8b81f6a44fcb690cad4b38ce10cbc07 | 1,068 | py | Python | rrtstar/sampling.py | rdesarz/rrtstar | 0e2737fbb7bb7e45789d606e6c6c2b7ce5824f65 | [
"MIT"
] | null | null | null | rrtstar/sampling.py | rdesarz/rrtstar | 0e2737fbb7bb7e45789d606e6c6c2b7ce5824f65 | [
"MIT"
] | null | null | null | rrtstar/sampling.py | rdesarz/rrtstar | 0e2737fbb7bb7e45789d606e6c6c2b7ce5824f65 | [
"MIT"
] | null | null | null | import random
import numpy as np
from rrtstar.geometry import Zone2d, Point2d
def generate_new_sample_uniform(planification_zone: Zone2d) -> Point2d:
x = np.random.uniform(planification_zone.x_min, planification_zone.x_max, 1)
y = np.random.uniform(planification_zone.y_min, planification_zone.y_max, 1)
... | 35.6 | 80 | 0.719101 | import random
import numpy as np
from rrtstar.geometry import Zone2d, Point2d
def generate_new_sample_uniform(planification_zone: Zone2d) -> Point2d:
x = np.random.uniform(planification_zone.x_min, planification_zone.x_max, 1)
y = np.random.uniform(planification_zone.y_min, planification_zone.y_max, 1)
... | true | true |
f7f814ef63dded3155369a2ac9ae0d9fba906316 | 9,012 | py | Python | usaspending_api/transactions/agnostic_transaction_loader.py | g4brielvs/usaspending-api | bae7da2c204937ec1cdf75c052405b13145728d5 | [
"CC0-1.0"
] | 1 | 2020-06-15T19:59:52.000Z | 2020-06-15T19:59:52.000Z | usaspending_api/transactions/agnostic_transaction_loader.py | g4brielvs/usaspending-api | bae7da2c204937ec1cdf75c052405b13145728d5 | [
"CC0-1.0"
] | null | null | null | usaspending_api/transactions/agnostic_transaction_loader.py | g4brielvs/usaspending-api | bae7da2c204937ec1cdf75c052405b13145728d5 | [
"CC0-1.0"
] | null | null | null | import logging
import psycopg2
from datetime import datetime, timezone
from django.conf import settings
from django.core.management import call_command
from pathlib import Path
from typing import Tuple
from usaspending_api.broker.helpers.last_load_date import get_last_load_date, update_last_load_date
from usaspending... | 44.176471 | 120 | 0.649467 | import logging
import psycopg2
from datetime import datetime, timezone
from django.conf import settings
from django.core.management import call_command
from pathlib import Path
from typing import Tuple
from usaspending_api.broker.helpers.last_load_date import get_last_load_date, update_last_load_date
from usaspending... | true | true |
f7f81506c3e92f8523861a133ba6f7a86ac1c5e1 | 8,233 | py | Python | avalon/maya/compat.py | kstrandli/avalon-core | 6e1fe862484983adf9e4c8b14cb229d56b9ed465 | [
"MIT"
] | 168 | 2017-06-23T15:50:43.000Z | 2022-02-27T10:48:45.000Z | avalon/maya/compat.py | kstrandli/avalon-core | 6e1fe862484983adf9e4c8b14cb229d56b9ed465 | [
"MIT"
] | 366 | 2017-06-22T08:38:45.000Z | 2021-06-19T07:29:06.000Z | avalon/maya/compat.py | kstrandli/avalon-core | 6e1fe862484983adf9e4c8b14cb229d56b9ed465 | [
"MIT"
] | 42 | 2017-06-23T15:27:26.000Z | 2021-09-29T17:28:18.000Z | """Compatibility
This module is to ensure the compatibility between Maya, Avalon and Pyblish
is maintained.
"""
import maya.cmds as cmds
import os
import logging
import avalon.pipeline
log = logging.getLogger(__name__)
create = avalon.pipeline.create
def remove_googleapiclient():
"""Check if the compatibility... | 29.508961 | 79 | 0.631362 | import maya.cmds as cmds
import os
import logging
import avalon.pipeline
log = logging.getLogger(__name__)
create = avalon.pipeline.create
def remove_googleapiclient():
keyword = "googleapiclient"
python_paths = os.environ["PYTHONPATH"].split(os.pathsep)
paths = [path for path in python_paths if... | true | true |
f7f815caa4c519f8000a5e2987255de17afbfd62 | 3,956 | py | Python | helper/webSearchCloseWords.py | Bobyuan1015/KDA | ce442922deb93b1bfe2ad7c418f1c63f5c40e000 | [
"MIT"
] | 1 | 2020-05-14T08:31:17.000Z | 2020-05-14T08:31:17.000Z | helper/webSearchCloseWords.py | Bobyuan1015/KDA | ce442922deb93b1bfe2ad7c418f1c63f5c40e000 | [
"MIT"
] | null | null | null | helper/webSearchCloseWords.py | Bobyuan1015/KDA | ce442922deb93b1bfe2ad7c418f1c63f5c40e000 | [
"MIT"
] | 1 | 2020-05-14T08:31:45.000Z | 2020-05-14T08:31:45.000Z | # -*- coding: utf-8 -*-
"""
File Name: url_content.py
Description : the main detail logic of auditing url sms
Author : yuanfang
date: 2019/12/13
"""
from lxml import html
import pandas as pd
import sys
import os
import pathlib
import re
import requests
from helper.cut import func_timer
... | 31.396825 | 133 | 0.598332 |
from lxml import html
import pandas as pd
import sys
import os
import pathlib
import re
import requests
from helper.cut import func_timer
project_path = str(pathlib.Path(os.path.abspath(os.curdir)))
sys.path.append(project_path)
print(sys.path)
headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/... | true | true |
f7f8163cad5fa84180ece9307309b7c564c1b104 | 289 | py | Python | example/sj.py | tinashime/Python27 | b632918c7368a9bcfc5af8353e136247d954fb5e | [
"bzip2-1.0.6"
] | null | null | null | example/sj.py | tinashime/Python27 | b632918c7368a9bcfc5af8353e136247d954fb5e | [
"bzip2-1.0.6"
] | null | null | null | example/sj.py | tinashime/Python27 | b632918c7368a9bcfc5af8353e136247d954fb5e | [
"bzip2-1.0.6"
] | null | null | null | number=23
guess=int(raw_input('Enter an integer : '))
if guess==number:
print 'Congratulations, you guessed it.'
print "(but you do not win any prizes!)"
elif guess<number:
print 'No, it is a little higher than that'
else:
print 'No, it is a little lower than that'
print 'Done'
| 22.230769 | 45 | 0.702422 | number=23
guess=int(raw_input('Enter an integer : '))
if guess==number:
print 'Congratulations, you guessed it.'
print "(but you do not win any prizes!)"
elif guess<number:
print 'No, it is a little higher than that'
else:
print 'No, it is a little lower than that'
print 'Done'
| false | true |
f7f817a1e11fd3feffb256fc63b5f3d1548683d2 | 5,007 | py | Python | pptx/shapes/graphfrm.py | iroin/python-pptx | 5d1012d8c0df104025d9565dafc411077039c66f | [
"MIT"
] | null | null | null | pptx/shapes/graphfrm.py | iroin/python-pptx | 5d1012d8c0df104025d9565dafc411077039c66f | [
"MIT"
] | null | null | null | pptx/shapes/graphfrm.py | iroin/python-pptx | 5d1012d8c0df104025d9565dafc411077039c66f | [
"MIT"
] | 1 | 2020-02-17T20:46:02.000Z | 2020-02-17T20:46:02.000Z | # encoding: utf-8
"""Graphic Frame shape and related objects.
A graphic frame is a common container for table, chart, smart art, and media
objects.
"""
from pptx.enum.shapes import MSO_SHAPE_TYPE
from pptx.shapes.base import BaseShape
from pptx.shared import ParentedElementProxy
from pptx.spec import (
GRAPHIC_D... | 34.294521 | 88 | 0.666267 |
from pptx.enum.shapes import MSO_SHAPE_TYPE
from pptx.shapes.base import BaseShape
from pptx.shared import ParentedElementProxy
from pptx.spec import (
GRAPHIC_DATA_URI_CHART,
GRAPHIC_DATA_URI_OLEOBJ,
GRAPHIC_DATA_URI_TABLE,
)
from pptx.table import Table
class GraphicFrame(BaseShape):
@property
... | true | true |
f7f8182cbda9c79f34c6f56d8907bde981842cd9 | 937 | py | Python | world_tour_app/urls.py | mathildebadoual/world_tour_app | 7b02697fdced48fec3a9a59d70313a3efef9edfa | [
"MIT"
] | null | null | null | world_tour_app/urls.py | mathildebadoual/world_tour_app | 7b02697fdced48fec3a9a59d70313a3efef9edfa | [
"MIT"
] | null | null | null | world_tour_app/urls.py | mathildebadoual/world_tour_app | 7b02697fdced48fec3a9a59d70313a3efef9edfa | [
"MIT"
] | null | null | null | """hw URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views... | 36.038462 | 77 | 0.723586 | from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
]+static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
| true | true |
f7f8183be75b9e905369489752679ce63c9e777c | 483 | py | Python | jbank/migrations/0053_wsediconnection_target_identifier.py | bachvtuan/django-jbank | 1b384936d93b802d92442167efca292d2aaa2f47 | [
"MIT"
] | null | null | null | jbank/migrations/0053_wsediconnection_target_identifier.py | bachvtuan/django-jbank | 1b384936d93b802d92442167efca292d2aaa2f47 | [
"MIT"
] | 2 | 2020-11-05T17:30:12.000Z | 2021-02-24T23:54:35.000Z | jbank/migrations/0053_wsediconnection_target_identifier.py | bachvtuan/django-jbank | 1b384936d93b802d92442167efca292d2aaa2f47 | [
"MIT"
] | 1 | 2021-12-16T09:27:04.000Z | 2021-12-16T09:27:04.000Z | # Generated by Django 2.2.3 on 2019-11-30 20:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("jbank", "0052_auto_20191130_1927"),
]
operations = [
migrations.AddField(
model_name="wsediconnection",
name="target... | 24.15 | 95 | 0.6294 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("jbank", "0052_auto_20191130_1927"),
]
operations = [
migrations.AddField(
model_name="wsediconnection",
name="target_identifier",
field=models.CharFiel... | true | true |
f7f8188212715bcb74f1edf4502c82045327c4e8 | 4,726 | py | Python | stem_cell_hypothesis/en_albert_base/joint/pos_srl.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | 4 | 2021-09-17T15:23:31.000Z | 2022-02-28T10:18:04.000Z | stem_cell_hypothesis/en_albert_base/joint/pos_srl.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | null | null | null | stem_cell_hypothesis/en_albert_base/joint/pos_srl.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2021-01-06 16:12
from typing import List
from elit.common.dataset import SortingSamplerBuilder
from elit.common.transform import NormalizeToken
from elit.components.mtl.loss_balancer import MovingAverageBalancer
from elit.components.mtl.multi_task_learning import MultiTa... | 40.393162 | 121 | 0.63796 |
from typing import List
from elit.common.dataset import SortingSamplerBuilder
from elit.common.transform import NormalizeToken
from elit.components.mtl.loss_balancer import MovingAverageBalancer
from elit.components.mtl.multi_task_learning import MultiTaskLearning
from elit.components.mtl.tasks.constituency import ... | true | true |
f7f81915b09cd99f6bdee1fda40dc4ef276d8e35 | 2,032 | py | Python | tree/test_.py | technolingo/AlgoStructuresPy | 4ac95542dec48b61dab3a0f33c5bacbe5a3cb3f1 | [
"MIT"
] | null | null | null | tree/test_.py | technolingo/AlgoStructuresPy | 4ac95542dec48b61dab3a0f33c5bacbe5a3cb3f1 | [
"MIT"
] | null | null | null | tree/test_.py | technolingo/AlgoStructuresPy | 4ac95542dec48b61dab3a0f33c5bacbe5a3cb3f1 | [
"MIT"
] | null | null | null | import gc
import pytest
from .index import Tree, Node
class TestTree():
def setup_method(self):
self.node = Node('a')
self.tree = Tree()
def teardown_method(self):
''' tearDown doesn't seem to be able to delete lists created in
each test, thus resulting errors if each te... | 28.619718 | 80 | 0.584154 | import gc
import pytest
from .index import Tree, Node
class TestTree():
def setup_method(self):
self.node = Node('a')
self.tree = Tree()
def teardown_method(self):
self.node.children = []
self.node = None
del self.node
gc.collect()
def test_node_properti... | true | true |
f7f8199dd726f68f1029a8124bd906d3e5bddbb9 | 19,478 | py | Python | src/main/python/systemds/context/systemds_context.py | shiruke/systemds | cdd7b9ca15c3f17ec15045e85b107e26a4d7e7a7 | [
"Apache-2.0"
] | null | null | null | src/main/python/systemds/context/systemds_context.py | shiruke/systemds | cdd7b9ca15c3f17ec15045e85b107e26a4d7e7a7 | [
"Apache-2.0"
] | null | null | null | src/main/python/systemds/context/systemds_context.py | shiruke/systemds | cdd7b9ca15c3f17ec15045e85b107e26a4d7e7a7 | [
"Apache-2.0"
] | 1 | 2021-02-24T22:50:06.000Z | 2021-02-24T22:50:06.000Z | # -------------------------------------------------------------
#
# 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 unde... | 42.251627 | 124 | 0.607352 |
__all__ = ["SystemDSContext"]
import copy
import json
import os
import socket
import threading
import time
from glob import glob
from queue import Empty, Queue
from subprocess import PIPE, Popen
from threading import Thread
from time import sleep
from typing import Dict, Iterable, Sequence, Tuple,... | true | true |
f7f81a7d72172441ce2851b5c74d2ec312c4106e | 230 | py | Python | code/python/echomesh/util/Call.py | rec/echomesh | be668971a687b141660fd2e5635d2fd598992a01 | [
"MIT"
] | 30 | 2015-02-18T14:07:00.000Z | 2021-12-11T15:19:01.000Z | code/python/echomesh/util/Call.py | rec/echomesh | be668971a687b141660fd2e5635d2fd598992a01 | [
"MIT"
] | 16 | 2015-01-01T23:17:24.000Z | 2015-04-18T23:49:27.000Z | code/python/echomesh/util/Call.py | rec/echomesh | be668971a687b141660fd2e5635d2fd598992a01 | [
"MIT"
] | 31 | 2015-03-11T20:04:07.000Z | 2020-11-02T13:56:59.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
import six
def call(f):
return f() if six.callable(f) else f
def call_recursive(f):
while six.callable(f):
f = f()
return f
| 19.166667 | 82 | 0.695652 | from __future__ import absolute_import, division, print_function, unicode_literals
import six
def call(f):
return f() if six.callable(f) else f
def call_recursive(f):
while six.callable(f):
f = f()
return f
| true | true |
f7f81b93166963ec5549a4f9cfa1d386990afbc9 | 4,309 | py | Python | ai4good/webapp/tests/dev_web_tests_v2.py | AIforGoodSimulator/model-server | 17662dc2a18b3e12e5c8ee51731e288088a51cf5 | [
"MIT"
] | 11 | 2020-06-12T11:46:26.000Z | 2022-02-09T23:10:34.000Z | ai4good/webapp/tests/dev_web_tests_v2.py | AIforGoodSimulator/model-server | 17662dc2a18b3e12e5c8ee51731e288088a51cf5 | [
"MIT"
] | 54 | 2020-07-17T10:13:33.000Z | 2021-03-08T16:38:29.000Z | ai4good/webapp/tests/dev_web_tests_v2.py | AIforGoodSimulator/model-server | 17662dc2a18b3e12e5c8ee51731e288088a51cf5 | [
"MIT"
] | 10 | 2020-07-03T16:12:50.000Z | 2021-02-06T15:51:16.000Z | from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait impor... | 53.197531 | 132 | 0.773265 | from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait impor... | true | true |
f7f81c8164baa526a6efe106e0f1fea736cb09bb | 1,543 | py | Python | nginx-parser/app.py | fly304625/nginx-geo-metricsreporter | e6d66da02e9677f090d2c1b2a059e7509d638dc7 | [
"MIT"
] | 16 | 2020-08-02T07:59:14.000Z | 2022-03-19T18:12:35.000Z | nginx-parser/app.py | fly304625/nginx-geo-metricsreporter | e6d66da02e9677f090d2c1b2a059e7509d638dc7 | [
"MIT"
] | null | null | null | nginx-parser/app.py | fly304625/nginx-geo-metricsreporter | e6d66da02e9677f090d2c1b2a059e7509d638dc7 | [
"MIT"
] | 4 | 2021-06-01T10:42:48.000Z | 2022-03-19T18:11:53.000Z | import os
import sys
import re
import requests
import json
import time
import logging
root = logging.getLogger()
root.setLevel(logging.DEBUG)
handler = logging.StreamHandler(sys.stdout)
handler.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(message)s')
handler.setFormatter(formatter)
root.addHa... | 31.489796 | 306 | 0.600778 | import os
import sys
import re
import requests
import json
import time
import logging
root = logging.getLogger()
root.setLevel(logging.DEBUG)
handler = logging.StreamHandler(sys.stdout)
handler.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(message)s')
handler.setFormatter(formatter)
root.addHa... | true | true |
f7f81d8cd61fe619520c40f6ecbd1e6c384b3f00 | 1,846 | py | Python | python_legacy/others_src/pgu/examples/layout1.py | garred/only_fighters | 55c3cc06884f3226d75a800e1ee79afd2c23aa8b | [
"CC-BY-3.0",
"CC0-1.0"
] | null | null | null | python_legacy/others_src/pgu/examples/layout1.py | garred/only_fighters | 55c3cc06884f3226d75a800e1ee79afd2c23aa8b | [
"CC-BY-3.0",
"CC0-1.0"
] | null | null | null | python_legacy/others_src/pgu/examples/layout1.py | garred/only_fighters | 55c3cc06884f3226d75a800e1ee79afd2c23aa8b | [
"CC-BY-3.0",
"CC0-1.0"
] | null | null | null | """<title>an example of layout usage</title>"""
import pygame
from pygame.locals import *
# the following line is not needed if pgu is installed
import sys; sys.path.insert(0, "..")
from pgu import layout
pygame.font.init()
screen = pygame.display.set_mode((320,320),SWSURFACE)
bg = (255,255,255)
fg = (0,0,0)
screen... | 28.84375 | 271 | 0.66468 | import pygame
from pygame.locals import *
import sys; sys.path.insert(0, "..")
from pgu import layout
pygame.font.init()
screen = pygame.display.set_mode((320,320),SWSURFACE)
bg = (255,255,255)
fg = (0,0,0)
screen.fill(bg)
class Obj: pass
l = layout.Layout(pygame.Rect(0,0,320,320))
e = Obj()
e.image = pygame.im... | true | true |
f7f81f4af340c307828c508fe8aa2aab7be33787 | 1,684 | py | Python | zarc/models_2017-08-13-03:28:46.py | nyimbi/caseke | ce4a0fa44cd383bc23900e42f81656f089c8fdd9 | [
"MIT"
] | 1 | 2019-06-03T16:20:35.000Z | 2019-06-03T16:20:35.000Z | zarc/models_2017-08-13-03:28:46.py | nyimbi/caseke | ce4a0fa44cd383bc23900e42f81656f089c8fdd9 | [
"MIT"
] | 20 | 2020-01-28T22:02:29.000Z | 2022-03-29T22:28:34.000Z | zarc/models_2017-08-13-03:28:46.py | nyimbi/caseke | ce4a0fa44cd383bc23900e42f81656f089c8fdd9 | [
"MIT"
] | 1 | 2019-06-10T17:20:48.000Z | 2019-06-10T17:20:48.000Z | # coding: utf-8
# AUTOGENERATED BY gen_script.sh from kp4.py
# Copyright (C) Nyimbi Odero, Sun Aug 13 03:28:10 EAT 2017
from sqlalchemy import func
from flask_appbuilder import Model
from flask_appbuilder.models.mixins import AuditMixin, FileColumn, ImageColumn, UserExtensionMixin
from flask_appbuilder.models.decora... | 39.162791 | 99 | 0.787411 |
from sqlalchemy import func
from flask_appbuilder import Model
from flask_appbuilder.models.mixins import AuditMixin, FileColumn, ImageColumn, UserExtensionMixin
from flask_appbuilder.models.decorators import renders
from flask_appbuilder.filemanager import ImageManager
from sqlalchemy_utils import aggregated, fo... | true | true |
f7f81f928ea9655dd41ec2147f98e3861799e8fb | 823 | py | Python | Python/miscellaneous/plt.py | N-Lambin/TFE-EEG | 0308e790a8f1045c85cbc1ec9e054e6136af58a3 | [
"MIT"
] | 1 | 2018-05-23T12:42:47.000Z | 2018-05-23T12:42:47.000Z | Python/miscellaneous/plt.py | N-Lambin/TFE-EEG | 0308e790a8f1045c85cbc1ec9e054e6136af58a3 | [
"MIT"
] | null | null | null | Python/miscellaneous/plt.py | N-Lambin/TFE-EEG | 0308e790a8f1045c85cbc1ec9e054e6136af58a3 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import csv
import numpy as np
from scipy import signal
fileDir = 'winkLeft\\winkLeft10Data\\'
fileName = 'AF3.csv'
fs = 128
x = []
with open(".\\csv\\csvCleanData\\" + fileDir + fileName, "r") as csvfile:
csv_reader = csv.reader(csvfile, delimiter = '\r')
for row in csv_reader... | 23.514286 | 73 | 0.623329 | import matplotlib.pyplot as plt
import csv
import numpy as np
from scipy import signal
fileDir = 'winkLeft\\winkLeft10Data\\'
fileName = 'AF3.csv'
fs = 128
x = []
with open(".\\csv\\csvCleanData\\" + fileDir + fileName, "r") as csvfile:
csv_reader = csv.reader(csvfile, delimiter = '\r')
for row in csv_reader... | true | true |
f7f82130439a3bcb0140725355c1c08def86ad18 | 4,403 | py | Python | leasing/management/commands/add_default_collection_letter_templates.py | hkotkanen/mvj | a22d40869ef1b13924da428f3026d248acef81a7 | [
"MIT"
] | null | null | null | leasing/management/commands/add_default_collection_letter_templates.py | hkotkanen/mvj | a22d40869ef1b13924da428f3026d248acef81a7 | [
"MIT"
] | null | null | null | leasing/management/commands/add_default_collection_letter_templates.py | hkotkanen/mvj | a22d40869ef1b13924da428f3026d248acef81a7 | [
"MIT"
] | null | null | null | import argparse
import os
import tempfile
from pathlib import Path
from shutil import copyfile
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from leasing.models import CollectionLetterTemplate
TEMPLATE_NAMES = {
'Irtisanomis- ja oikeudenkäyntiuhalla, tilapäi... | 39.3125 | 115 | 0.70452 | import argparse
import os
import tempfile
from pathlib import Path
from shutil import copyfile
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from leasing.models import CollectionLetterTemplate
TEMPLATE_NAMES = {
'Irtisanomis- ja oikeudenkäyntiuhalla, tilapäi... | true | true |
f7f821f70f7d04958ca243c546dea9c2411c92e4 | 14,518 | py | Python | pace/encryption/acc_encrypt_test.py | LaudateCorpus1/PACE-python | eb61250886e51647bd1edb6d8f4fa7f83eb0bc81 | [
"BSD-2-Clause"
] | 7 | 2016-11-01T17:36:17.000Z | 2021-03-12T08:54:36.000Z | pace/encryption/acc_encrypt_test.py | LaudateCorpus1/PACE-python | eb61250886e51647bd1edb6d8f4fa7f83eb0bc81 | [
"BSD-2-Clause"
] | 1 | 2016-11-29T00:38:28.000Z | 2016-12-06T14:10:24.000Z | pace/encryption/acc_encrypt_test.py | LaudateCorpus1/PACE-python | eb61250886e51647bd1edb6d8f4fa7f83eb0bc81 | [
"BSD-2-Clause"
] | 6 | 2020-09-09T08:33:17.000Z | 2022-01-06T07:02:40.000Z | ## **************
## Copyright 2014 MIT Lincoln Laboratory
## Project: PACE
## Authors: ATLH
## Description: Unit tests for acc_encrypt
## Modifications:
## Date Name Modification
## ---- ---- ------------
## 23 Dec 2014 ATLH Original file
## **************
import os
import sys
this_dir = ... | 38.922252 | 104 | 0.464802 | l, Range
from pace.encryption.encryption_exceptions import EncryptionException, DecryptionException
from pace.encryption.acc_encrypt import AccumuloEncrypt, ConfigurationException
from pace.encryption.encryption_pki import DummyEncryptionPKI
from pace.pki.accumulo_keystore import AccumuloKeyStore
from pace.encryption.A... | true | true |
f7f82203fd775e0f4ec80f88938f8325c3cc504e | 7,445 | py | Python | tests/unit/test_simulator.py | dkucsc/mavas | db3f7bd35944b7d0f510c62760eaa071bf53d7d8 | [
"Apache-2.0"
] | 1 | 2016-12-14T21:05:47.000Z | 2016-12-14T21:05:47.000Z | tests/unit/test_simulator.py | dkucsc/mavas | db3f7bd35944b7d0f510c62760eaa071bf53d7d8 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_simulator.py | dkucsc/mavas | db3f7bd35944b7d0f510c62760eaa071bf53d7d8 | [
"Apache-2.0"
] | null | null | null | """
Tests for simulated data
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import datetime
import ga4gh.datamodel as datamodel
import ga4gh.datamodel.datasets as datasets
import ga4gh.datamodel.reads as reads
import ga4gh.datamodel.re... | 43.284884 | 79 | 0.678308 | from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import datetime
import ga4gh.datamodel as datamodel
import ga4gh.datamodel.datasets as datasets
import ga4gh.datamodel.reads as reads
import ga4gh.datamodel.references as references
import ga4... | true | true |
f7f8220aca745baa4e07e83b72ced29f641c64eb | 16,318 | py | Python | clients/client/python/ory_client/model/plugin_config.py | tobbbles/sdk | 017ca2fd46019bafd1853913b6c0f2b0fe687621 | [
"Apache-2.0"
] | null | null | null | clients/client/python/ory_client/model/plugin_config.py | tobbbles/sdk | 017ca2fd46019bafd1853913b6c0f2b0fe687621 | [
"Apache-2.0"
] | null | null | null | clients/client/python/ory_client/model/plugin_config.py | tobbbles/sdk | 017ca2fd46019bafd1853913b6c0f2b0fe687621 | [
"Apache-2.0"
] | null | null | null | """
Ory APIs
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501
The version of the OpenAPI document: v0.0.1-alpha.19
Contact: support@ory.sh
Generated by: htt... | 44.463215 | 197 | 0.586101 |
import re
import sys
from ory_client.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
from ..... | true | true |
f7f823c3da1af9166c219ff99cae57d0bc609267 | 10,074 | py | Python | python/paddle/fluid/tests/unittests/test_dist_fleet_base.py | Jie-Fang/Paddle | 7a9bd0c5d8eff2f4fd6b58ee786c556a07aa23d6 | [
"Apache-2.0"
] | 1 | 2020-11-03T04:57:40.000Z | 2020-11-03T04:57:40.000Z | python/paddle/fluid/tests/unittests/test_dist_fleet_base.py | Jie-Fang/Paddle | 7a9bd0c5d8eff2f4fd6b58ee786c556a07aa23d6 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_dist_fleet_base.py | Jie-Fang/Paddle | 7a9bd0c5d8eff2f4fd6b58ee786c556a07aa23d6 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle 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 app... | 33.468439 | 98 | 0.609986 |
from __future__ import print_function
import argparse
import os
import pickle
import subprocess
import sys
import time
import traceback
import math
import collections
import socket
from contextlib import closing
import six
import unittest
import numpy as np
import tempfile
import paddle.fluid as fluid
i... | true | true |
f7f824352e09942c4e85df299fe28abd9fed10a4 | 18,424 | py | Python | pandaf/002/data.py | cpausmit/Kraken | 54a5b69d274f928a5e53475b9c281815fadfc139 | [
"MIT"
] | null | null | null | pandaf/002/data.py | cpausmit/Kraken | 54a5b69d274f928a5e53475b9c281815fadfc139 | [
"MIT"
] | null | null | null | pandaf/002/data.py | cpausmit/Kraken | 54a5b69d274f928a5e53475b9c281815fadfc139 | [
"MIT"
] | 2 | 2017-03-22T17:33:38.000Z | 2017-09-29T02:38:24.000Z | from FWCore.ParameterSet.VarParsing import VarParsing
options =VarParsing('analysis')
options.register('config', default = '', mult = VarParsing.multiplicity.singleton, mytype = VarParsing.varType.string, info = 'Single-switch config. Values: 03Feb2017, 23Sep2016, Spring16, Summer16')
options.register('globaltag', def... | 37.676892 | 238 | 0.753419 | from FWCore.ParameterSet.VarParsing import VarParsing
options =VarParsing('analysis')
options.register('config', default = '', mult = VarParsing.multiplicity.singleton, mytype = VarParsing.varType.string, info = 'Single-switch config. Values: 03Feb2017, 23Sep2016, Spring16, Summer16')
options.register('globaltag', def... | true | true |
f7f8246f648f6f813aff23fe3c9f8c23832e677e | 248 | py | Python | checker.py | yhzmiao/Data-Aquisition | 6c14e6b5684d3d91a96e4f16ed22c920d0fa1424 | [
"MIT"
] | null | null | null | checker.py | yhzmiao/Data-Aquisition | 6c14e6b5684d3d91a96e4f16ed22c920d0fa1424 | [
"MIT"
] | null | null | null | checker.py | yhzmiao/Data-Aquisition | 6c14e6b5684d3d91a96e4f16ed22c920d0fa1424 | [
"MIT"
] | null | null | null | fin = open("date.txt", 'r')
dates = fin.readlines()
for i in range(0, len(dates) - 1):
print 'Now for ' + dates[i][:-1] + '!'
filename = dates[i][2:-1] + '.csv'
fp = open(filename, "r")
filetext = fp.readlines()
print filetext[len(filetext)]
| 24.8 | 39 | 0.596774 | fin = open("date.txt", 'r')
dates = fin.readlines()
for i in range(0, len(dates) - 1):
print 'Now for ' + dates[i][:-1] + '!'
filename = dates[i][2:-1] + '.csv'
fp = open(filename, "r")
filetext = fp.readlines()
print filetext[len(filetext)]
| false | true |
f7f8253f19638d2aa58e8aab67e0259916465f64 | 6,549 | py | Python | emerge/tests/metrics/test_tfidf.py | vianding/test_emerge_win | 51a72acc8e96172f8edd3fb0b664d7bbc145bff3 | [
"MIT"
] | null | null | null | emerge/tests/metrics/test_tfidf.py | vianding/test_emerge_win | 51a72acc8e96172f8edd3fb0b664d7bbc145bff3 | [
"MIT"
] | null | null | null | emerge/tests/metrics/test_tfidf.py | vianding/test_emerge_win | 51a72acc8e96172f8edd3fb0b664d7bbc145bff3 | [
"MIT"
] | null | null | null | """
All unit tests that are related to the tfidf metric.
"""
# Authors: Grzegorz Lato <grzegorz.lato@gmail.com>
# License: MIT
import unittest
from typing import Dict
import logging
import coloredlogs
from emerge.languages.cparser import CParser
from emerge.languages.cppparser import CPPParser
from emerge.languages.... | 42.251613 | 177 | 0.722095 |
import unittest
from typing import Dict
import logging
import coloredlogs
from emerge.languages.cparser import CParser
from emerge.languages.cppparser import CPPParser
from emerge.languages.groovyparser import GroovyParser
from emerge.languages.javaparser import JavaParser
from emerge.languages.javascriptparser im... | true | true |
f7f825ef30c12850299746baea53e43841af515f | 5,925 | py | Python | src/models/convlstm/convlstm.py | TUM-LMF/MTLCC-pytorch | 894a470be2fb4b9e2e0b9e20e8684131ffdb5577 | [
"MIT"
] | 39 | 2018-08-27T11:33:28.000Z | 2021-12-13T11:17:31.000Z | src/models/convlstm/convlstm.py | TUM-LMF/MTLCC-pytorch | 894a470be2fb4b9e2e0b9e20e8684131ffdb5577 | [
"MIT"
] | 2 | 2019-02-16T11:40:54.000Z | 2020-04-23T08:01:53.000Z | src/models/convlstm/convlstm.py | TUM-LMF/MTLCC-pytorch | 894a470be2fb4b9e2e0b9e20e8684131ffdb5577 | [
"MIT"
] | 16 | 2018-08-29T02:03:31.000Z | 2022-03-12T09:41:06.000Z | import torch.nn as nn
from torch.autograd import Variable
import torch
class ConvLSTMCell(nn.Module):
def __init__(self, input_size, input_dim, hidden_dim, kernel_size, bias):
"""
Initialize ConvLSTM cell.
Parameters
----------
input_size: (int, int)
H... | 34.852941 | 112 | 0.579578 | import torch.nn as nn
from torch.autograd import Variable
import torch
class ConvLSTMCell(nn.Module):
def __init__(self, input_size, input_dim, hidden_dim, kernel_size, bias):
super(ConvLSTMCell, self).__init__()
self.height, self.width = input_size
self.input_dim = input_dim
s... | true | true |
f7f827b8ebed2e23607097109bc6373d882a304a | 2,956 | py | Python | tests/tick_test.py | chrjxj/ibclient | c1a4c82e1f0d7f65eb649869ecd1082d50117eb7 | [
"BSD-2-Clause"
] | 1 | 2021-12-15T09:28:16.000Z | 2021-12-15T09:28:16.000Z | tests/tick_test.py | chrjxj/ibclient | c1a4c82e1f0d7f65eb649869ecd1082d50117eb7 | [
"BSD-2-Clause"
] | null | null | null | tests/tick_test.py | chrjxj/ibclient | c1a4c82e1f0d7f65eb649869ecd1082d50117eb7 | [
"BSD-2-Clause"
] | 3 | 2020-05-19T19:28:55.000Z | 2021-05-18T12:06:08.000Z | # -*- coding:utf-8 -*-
'''
Created on 11/08/2016
@author: Jin Xu
'''
import sys
from os import path
import unittest
import datetime
import time
from pprint import pprint
import random
from ibclient import (IBClient,
MarketOrder, LimitOrder,
new_stock_contract, new_futures_c... | 30.163265 | 94 | 0.546685 |
import sys
from os import path
import unittest
import datetime
import time
from pprint import pprint
import random
from ibclient import (IBClient,
MarketOrder, LimitOrder,
new_stock_contract, new_futures_contract)
sys.path.insert(0, path.abspath(path.join(path.dirname(__f... | true | true |
f7f828489e8c96204219fb682bfbd97fe5e69a61 | 693 | py | Python | thing/migrations/0021_auto_20170824_1953.py | skyride/evething-2 | e0778a539b7f8a56667b2508293ca7e9f515283f | [
"BSD-2-Clause"
] | 21 | 2017-05-24T00:06:07.000Z | 2019-08-06T04:31:18.000Z | thing/migrations/0021_auto_20170824_1953.py | skyride/evething-2 | e0778a539b7f8a56667b2508293ca7e9f515283f | [
"BSD-2-Clause"
] | 11 | 2017-05-23T23:58:57.000Z | 2018-05-27T03:21:30.000Z | thing/migrations/0021_auto_20170824_1953.py | skyride/evething-2 | e0778a539b7f8a56667b2508293ca7e9f515283f | [
"BSD-2-Clause"
] | 10 | 2017-06-08T18:23:51.000Z | 2021-09-05T06:03:59.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('thing', '0020_auto_20170707_0010'),
]
operations = [
migrations.AddField(
model_name='characterdetails',
... | 25.666667 | 64 | 0.61039 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('thing', '0020_auto_20170707_0010'),
]
operations = [
migrations.AddField(
model_name='characterdetails',
name='jump_fatigue... | true | true |
f7f828687dcec133fb81e88915fcaee542ded6a4 | 1,028 | py | Python | project/app/urls.py | dbinetti/brookwood | e3c89e4ab16f07519258f1ced5f20e64b482e47e | [
"BSD-3-Clause"
] | null | null | null | project/app/urls.py | dbinetti/brookwood | e3c89e4ab16f07519258f1ced5f20e64b482e47e | [
"BSD-3-Clause"
] | null | null | null | project/app/urls.py | dbinetti/brookwood | e3c89e4ab16f07519258f1ced5f20e64b482e47e | [
"BSD-3-Clause"
] | null | null | null | # Django
from django.urls import path
from django.views.generic import TemplateView
# Local
from . import views
urlpatterns = [
# Root
path('', views.index, name='index',),
# Footer
path('about/', TemplateView.as_view(template_name='app/pages/about.html'), name='about',),
path('faq/', TemplateVie... | 32.125 | 100 | 0.669261 |
from django.urls import path
from django.views.generic import TemplateView
from . import views
urlpatterns = [
path('', views.index, name='index',),
path('about/', TemplateView.as_view(template_name='app/pages/about.html'), name='about',),
path('faq/', TemplateView.as_view(template_name='app/... | true | true |
f7f828ea2ca425ce42e041e122131fc649176981 | 2,260 | py | Python | projexbackend/consumers.py | juliolugo96/projex-api | 4bf12ce3ab228e43e7aa1b3d2d8972c1e4733a89 | [
"MIT"
] | 1 | 2019-05-31T04:40:09.000Z | 2019-05-31T04:40:09.000Z | projexbackend/consumers.py | juliolugo96/projex-api | 4bf12ce3ab228e43e7aa1b3d2d8972c1e4733a89 | [
"MIT"
] | 4 | 2020-06-05T20:41:34.000Z | 2021-09-08T00:58:10.000Z | projexbackend/consumers.py | juliolugo96/projex-api | 4bf12ce3ab228e43e7aa1b3d2d8972c1e4733a89 | [
"MIT"
] | 3 | 2019-05-31T04:40:04.000Z | 2020-02-08T21:54:23.000Z | from channels.generic.websocket import JsonWebsocketConsumer
from rest_framework import serializers
from api.serializers import *
from asgiref.sync import async_to_sync
import json
class NotificationConsumer(JsonWebsocketConsumer):
def connect(self):
# We're always going to accept the connection, though w... | 33.235294 | 68 | 0.633186 | from channels.generic.websocket import JsonWebsocketConsumer
from rest_framework import serializers
from api.serializers import *
from asgiref.sync import async_to_sync
import json
class NotificationConsumer(JsonWebsocketConsumer):
def connect(self):
# close it later based on other factors.
... | true | true |
f7f829fc9c7881d0f66d7797fc0c258b2afa16ef | 5,291 | py | Python | naoqi-sdk-2.5.5.5-linux64/doc/_downloads/almotion_collisionDetection.py | applejenny66/docker_pepper | 2469cc4db6585161a31ac44c8fcf2605d71318b1 | [
"MIT"
] | null | null | null | naoqi-sdk-2.5.5.5-linux64/doc/_downloads/almotion_collisionDetection.py | applejenny66/docker_pepper | 2469cc4db6585161a31ac44c8fcf2605d71318b1 | [
"MIT"
] | null | null | null | naoqi-sdk-2.5.5.5-linux64/doc/_downloads/almotion_collisionDetection.py | applejenny66/docker_pepper | 2469cc4db6585161a31ac44c8fcf2605d71318b1 | [
"MIT"
] | 1 | 2020-10-06T07:44:12.000Z | 2020-10-06T07:44:12.000Z | #! /usr/bin/env python
# -*- encoding: UTF-8 -*-
''' Example :Collision detection - Arm Collision Detection '''
import qi
import argparse
import sys
import almath
import time
def moveArm(motion_service, target, has_hands, chain_name):
''' Function to make NAO bump on his Torso or Head with his arm '''
# Se... | 31.873494 | 98 | 0.629371 |
''' Example :Collision detection - Arm Collision Detection '''
import qi
import argparse
import sys
import almath
import time
def moveArm(motion_service, target, has_hands, chain_name):
''' Function to make NAO bump on his Torso or Head with his arm '''
pMaxSpeedFraction = 0.5
if target ==... | false | true |
f7f82a970a907273a0de9e90dd224f5e53592565 | 3,340 | py | Python | search_engine/search_engine_with_rank.py | huakeda1/Basic-algorithm-and-framework-study-for-AI | 8776dc500772a6c1f28be9c4a426ed9eca2ec775 | [
"MIT"
] | 2 | 2020-11-24T02:58:24.000Z | 2021-08-18T06:50:28.000Z | search_engine/search_engine_with_rank.py | huakeda1/Basic-algorithm-and-framework-study-for-AI | 8776dc500772a6c1f28be9c4a426ed9eca2ec775 | [
"MIT"
] | null | null | null | search_engine/search_engine_with_rank.py | huakeda1/Basic-algorithm-and-framework-study-for-AI | 8776dc500772a6c1f28be9c4a426ed9eca2ec775 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import jieba
from sklearn.feature_extraction.text import TfidfVectorizer
from functools import reduce
import numpy as np
import os
import re
from scipy.spatial.distance import cosine
# In[2]:
csv_file='dataset/news.csv'
if os.path.exists(csv_file... | 33.069307 | 139 | 0.706287 |
import pandas as pd
import jieba
from sklearn.feature_extraction.text import TfidfVectorizer
from functools import reduce
import numpy as np
import os
import re
from scipy.spatial.distance import cosine
csv_file='dataset/news.csv'
if os.path.exists(csv_file):
news=pd.read_csv(csv_file,encoding='gb18030',... | true | true |
f7f82b8d25d7a01f34414de2c1291de2b1051d39 | 1,135 | py | Python | song_dl.py | dodobardo/SongDW | 834733a131f4a7584184c96402d8fea6ac76cb81 | [
"MIT"
] | null | null | null | song_dl.py | dodobardo/SongDW | 834733a131f4a7584184c96402d8fea6ac76cb81 | [
"MIT"
] | null | null | null | song_dl.py | dodobardo/SongDW | 834733a131f4a7584184c96402d8fea6ac76cb81 | [
"MIT"
] | null | null | null | import youtube_dl
import sys
from youtubesearchpython import VideosSearch
ydl_opts = {
'format': 'bestaudio/best',
'outtmpl': '/Users/edoardo/Desktop/songDW/songs/%(title)s.%(ext)s',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '320'... | 24.673913 | 71 | 0.580617 | import youtube_dl
import sys
from youtubesearchpython import VideosSearch
ydl_opts = {
'format': 'bestaudio/best',
'outtmpl': '/Users/edoardo/Desktop/songDW/songs/%(title)s.%(ext)s',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '320'... | true | true |
f7f82bee14747cf9f27b484dadc7d6bfb56f2df1 | 6,547 | py | Python | lib/galaxy/tools/toolbox/integrated_panel.py | uio-bmi/galaxy-graph-peak-caller | 0e0e8e9bd6d461a4e25b49cea2e6753043f747e0 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/tools/toolbox/integrated_panel.py | uio-bmi/galaxy-graph-peak-caller | 0e0e8e9bd6d461a4e25b49cea2e6753043f747e0 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/tools/toolbox/integrated_panel.py | uio-bmi/galaxy-graph-peak-caller | 0e0e8e9bd6d461a4e25b49cea2e6753043f747e0 | [
"CC-BY-3.0"
] | null | null | null | import os
import shutil
import string
import tempfile
import time
import traceback
from xml.sax.saxutils import escape
from .panel import (
panel_item_types,
ToolPanelElements
)
INTEGRATED_TOOL_PANEL_DESCRIPTION = """
This is Galaxy's integrated tool panel and should be modified directly only for
reordering t... | 55.483051 | 168 | 0.651749 | import os
import shutil
import string
import tempfile
import time
import traceback
from xml.sax.saxutils import escape
from .panel import (
panel_item_types,
ToolPanelElements
)
INTEGRATED_TOOL_PANEL_DESCRIPTION = """
This is Galaxy's integrated tool panel and should be modified directly only for
reordering t... | true | true |
f7f82c281a354ba5cc662d74fc1042b9031d964c | 79 | py | Python | exercises/exercise104.py | djangojeng-e/TIL | bdbe1dfb6ebc48b89067fddda195227cca64b8dc | [
"MIT"
] | null | null | null | exercises/exercise104.py | djangojeng-e/TIL | bdbe1dfb6ebc48b89067fddda195227cca64b8dc | [
"MIT"
] | null | null | null | exercises/exercise104.py | djangojeng-e/TIL | bdbe1dfb6ebc48b89067fddda195227cca64b8dc | [
"MIT"
] | null | null | null | li = [12, 24, 35, 24, 88, 120, 155]
li = [x for x in li if x != 24]
print(li) | 15.8 | 35 | 0.518987 | li = [12, 24, 35, 24, 88, 120, 155]
li = [x for x in li if x != 24]
print(li) | true | true |
f7f82d964b4bebf25084727d0e956e3ef67ba3bd | 4,438 | py | Python | pip/commands/search.py | slacy/pip | 3b2b2ce49e1e894ef24247a3af2ea5993ccdc085 | [
"MIT"
] | null | null | null | pip/commands/search.py | slacy/pip | 3b2b2ce49e1e894ef24247a3af2ea5993ccdc085 | [
"MIT"
] | null | null | null | pip/commands/search.py | slacy/pip | 3b2b2ce49e1e894ef24247a3af2ea5993ccdc085 | [
"MIT"
] | 1 | 2020-01-09T23:05:18.000Z | 2020-01-09T23:05:18.000Z | import sys
import textwrap
import pkg_resources
import pip.download
from pip.basecommand import Command
from pip.util import get_terminal_size
from pip.log import logger
from pip.backwardcompat import xmlrpclib, reduce, cmp
from pip.exceptions import CommandError
from distutils.version import StrictVersion, LooseVersio... | 34.671875 | 102 | 0.620099 | import sys
import textwrap
import pkg_resources
import pip.download
from pip.basecommand import Command
from pip.util import get_terminal_size
from pip.log import logger
from pip.backwardcompat import xmlrpclib, reduce, cmp
from pip.exceptions import CommandError
from distutils.version import StrictVersion, LooseVersio... | true | true |
f7f82ec2ce2f14ec84d71cc500ba7080bfd780f3 | 679 | py | Python | plugins/dbnd-qubole/src/dbnd_qubole/errors.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 224 | 2020-01-02T10:46:37.000Z | 2022-03-02T13:54:08.000Z | plugins/dbnd-qubole/src/dbnd_qubole/errors.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 16 | 2020-03-11T09:37:58.000Z | 2022-01-26T10:22:08.000Z | plugins/dbnd-qubole/src/dbnd_qubole/errors.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 24 | 2020-03-24T13:53:50.000Z | 2022-03-22T11:55:18.000Z | from dbnd._core.errors import DatabandRuntimeError
def failed_to_submit_qubole_job(nested_exception):
return DatabandRuntimeError(
"Qubole submit request failed with code %s." % nested_exception.status_code,
show_exc_info=False,
nested_exceptions=nested_exception,
help_msg="Check y... | 33.95 | 85 | 0.723122 | from dbnd._core.errors import DatabandRuntimeError
def failed_to_submit_qubole_job(nested_exception):
return DatabandRuntimeError(
"Qubole submit request failed with code %s." % nested_exception.status_code,
show_exc_info=False,
nested_exceptions=nested_exception,
help_msg="Check y... | true | true |
f7f82fc995df5ffe0bb2b37c628bd8926c03879c | 54,752 | py | Python | numpy/f2py/rules.py | serge-sans-paille/numpy | 596795bf697b6be29e21c23d7680e2d476c23436 | [
"BSD-3-Clause"
] | 4 | 2020-01-28T08:48:27.000Z | 2022-02-09T18:45:34.000Z | numpy/f2py/rules.py | serge-sans-paille/numpy | 596795bf697b6be29e21c23d7680e2d476c23436 | [
"BSD-3-Clause"
] | null | null | null | numpy/f2py/rules.py | serge-sans-paille/numpy | 596795bf697b6be29e21c23d7680e2d476c23436 | [
"BSD-3-Clause"
] | 1 | 2015-10-08T10:27:03.000Z | 2015-10-08T10:27:03.000Z | #!/usr/bin/env python
"""
Rules for building C/API module with f2py2e.
Here is a skeleton of a new wrapper function (13Dec2001):
wrapper_function(args)
declarations
get_python_arguments, say, `a' and `b'
get_a_from_python
if (successful) {
get_b_from_python
if (successful) {
callfortran
... | 37.786059 | 204 | 0.590006 |
from __future__ import division, absolute_import, print_function
__version__ = "$Revision: 1.129 $"[10:-1]
from . import __version__
f2py_version = __version__.version
import pprint
import sys
import time
import copy
from .auxfuncs import *
from . import capi_maps
from .capi_maps import *
from . import cfuncs
from... | true | true |
f7f830813343306606469414ca4c304bea049852 | 584 | py | Python | redly/redweb/migrations/0003_chat.py | redlytcc/redlysite | ae1f2476bf58e7bbf3b91baaf7bf1d16777ca939 | [
"Apache-2.0"
] | null | null | null | redly/redweb/migrations/0003_chat.py | redlytcc/redlysite | ae1f2476bf58e7bbf3b91baaf7bf1d16777ca939 | [
"Apache-2.0"
] | 6 | 2020-02-11T23:30:28.000Z | 2022-03-11T23:34:45.000Z | redly/redweb/migrations/0003_chat.py | redlytcc/redlysite | ae1f2476bf58e7bbf3b91baaf7bf1d16777ca939 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.1.1 on 2018-11-03 13:12
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('redweb', '0002_delete_chat'),
]
operations = [
migrations.CreateModel(
name='Chat',
fields=[
... | 24.333333 | 114 | 0.566781 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('redweb', '0002_delete_chat'),
]
operations = [
migrations.CreateModel(
name='Chat',
fields=[
('id', models.AutoField(auto_creat... | true | true |
f7f830f97cb51afdd87d98bd361c6bea5f467b17 | 4,275 | py | Python | csrank/dataset_reader/objectranking/util.py | hytsang/cs-ranking | 241626a6a100a27b96990b4f199087a6dc50dcc0 | [
"Apache-2.0"
] | null | null | null | csrank/dataset_reader/objectranking/util.py | hytsang/cs-ranking | 241626a6a100a27b96990b4f199087a6dc50dcc0 | [
"Apache-2.0"
] | null | null | null | csrank/dataset_reader/objectranking/util.py | hytsang/cs-ranking | 241626a6a100a27b96990b4f199087a6dc50dcc0 | [
"Apache-2.0"
] | 1 | 2018-10-30T08:57:14.000Z | 2018-10-30T08:57:14.000Z | import logging
from itertools import combinations
import numpy as np
import pandas as pd
from sklearn.metrics import f1_score
from csrank.util import ranking_ordering_conversion
__all__ = ['generate_complete_pairwise_dataset', 'complete_linear_regression_dataset',
'complete_linear_regression_dataset', "we... | 33.928571 | 107 | 0.634152 | import logging
from itertools import combinations
import numpy as np
import pandas as pd
from sklearn.metrics import f1_score
from csrank.util import ranking_ordering_conversion
__all__ = ['generate_complete_pairwise_dataset', 'complete_linear_regression_dataset',
'complete_linear_regression_dataset', "we... | true | true |
f7f8315b6d1dad24c372b0500d589b4ba6d0ecf7 | 336 | py | Python | src/routing/setup.py | rubengomex/python-rest-api | 4143b5c86658409fd8dc6eb9f2bc71f8de18815f | [
"MIT"
] | null | null | null | src/routing/setup.py | rubengomex/python-rest-api | 4143b5c86658409fd8dc6eb9f2bc71f8de18815f | [
"MIT"
] | null | null | null | src/routing/setup.py | rubengomex/python-rest-api | 4143b5c86658409fd8dc6eb9f2bc71f8de18815f | [
"MIT"
] | null | null | null | from flask_restful import Resource, Api, request
from ..api.users.controller import User, UserList
from ..auth.setup import configure_auth
def init_routes(app):
api = Api(app)
# auth routes /auth
configure_auth(app)
# users routes /users
api.add_resource(UserList, '/users/')
api.add_resource(User, '/users... | 25.846154 | 49 | 0.735119 | from flask_restful import Resource, Api, request
from ..api.users.controller import User, UserList
from ..auth.setup import configure_auth
def init_routes(app):
api = Api(app)
configure_auth(app)
api.add_resource(UserList, '/users/')
api.add_resource(User, '/users/<string:id>/')
| true | true |
f7f8337eb29ffe91086c2bd6edbeb60c8e16ba10 | 7,729 | py | Python | spectrum/django/spectrum.py | SpectrumApp/spectrum-python | 773516af1f89547b4a7afe555615247d7e44a393 | [
"BSD-3-Clause"
] | 6 | 2015-11-06T14:46:12.000Z | 2020-01-25T10:28:42.000Z | spectrum/django/spectrum.py | SpectrumApp/spectrum-python | 773516af1f89547b4a7afe555615247d7e44a393 | [
"BSD-3-Clause"
] | 7 | 2015-11-04T23:40:56.000Z | 2018-12-07T11:31:43.000Z | spectrum/django/spectrum.py | SpectrumApp/spectrum-python | 773516af1f89547b4a7afe555615247d7e44a393 | [
"BSD-3-Clause"
] | 2 | 2015-11-04T16:56:38.000Z | 2016-04-17T23:10:26.000Z | FIRE_HOSE = {
'version': 1,
'disable_existing_loggers': False,
'root': {
'level': 'DEBUG',
'handlers': ['console', 'root']
},
'filters': {
'request_id': {
'()': 'spectrum.filters.RequestIdFilter'
}
},
'formatters': {
'verbose': {
... | 27.310954 | 149 | 0.464743 | FIRE_HOSE = {
'version': 1,
'disable_existing_loggers': False,
'root': {
'level': 'DEBUG',
'handlers': ['console', 'root']
},
'filters': {
'request_id': {
'()': 'spectrum.filters.RequestIdFilter'
}
},
'formatters': {
'verbose': {
... | true | true |
f7f833bb823dfdbe69dd4f6aca9ad56df615e799 | 946 | py | Python | test/test_label_install.py | moengage/neomodel | 8d039f47c9578402dd974a216117d5c54377b78f | [
"MIT"
] | null | null | null | test/test_label_install.py | moengage/neomodel | 8d039f47c9578402dd974a216117d5c54377b78f | [
"MIT"
] | null | null | null | test/test_label_install.py | moengage/neomodel | 8d039f47c9578402dd974a216117d5c54377b78f | [
"MIT"
] | null | null | null | from neomodel import config, StructuredNode, StringProperty, install_all_labels, install_labels
from neomodel.core import get_database_from_cls
db = get_database_from_cls(None)
config.AUTO_INSTALL_LABELS = False
class NoConstraintsSetup(StructuredNode):
name = StringProperty(unique_index=True)
class TestAbstra... | 26.277778 | 95 | 0.761099 | from neomodel import config, StructuredNode, StringProperty, install_all_labels, install_labels
from neomodel.core import get_database_from_cls
db = get_database_from_cls(None)
config.AUTO_INSTALL_LABELS = False
class NoConstraintsSetup(StructuredNode):
name = StringProperty(unique_index=True)
class TestAbstra... | true | true |
f7f8343284b90779924b86ee9400c35d89381292 | 104,329 | py | Python | contrib/.venv/lib/python3.8/site-packages/bitcoinlib/transactions.py | jtatman/katersltc-client | 7ea88bfa32e9bdce9bf8d434a8909a07b65412f7 | [
"MIT"
] | null | null | null | contrib/.venv/lib/python3.8/site-packages/bitcoinlib/transactions.py | jtatman/katersltc-client | 7ea88bfa32e9bdce9bf8d434a8909a07b65412f7 | [
"MIT"
] | null | null | null | contrib/.venv/lib/python3.8/site-packages/bitcoinlib/transactions.py | jtatman/katersltc-client | 7ea88bfa32e9bdce9bf8d434a8909a07b65412f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# BitcoinLib - Python Cryptocurrency Library
# TRANSACTION class to create, verify and sign Transactions
# © 2017 - 2021 March - 1200 Web Development <http://1200wd.com/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Aff... | 45.578419 | 244 | 0.60107 |
from datetime import datetime
import json
import pickle
import random
from bitcoinlib.encoding import *
from bitcoinlib.config.opcodes import *
from bitcoinlib.keys import HDKey, Key, deserialize_address, Address, sign, verify, Signature
from bitcoinlib.networks import Network
from bitcoinlib.values... | true | true |
f7f8352ab0a6fa4f33a391619562915ba18b491b | 23 | py | Python | recipe_scrapers/__version__.py | oncleben31/recipe-scrapers | 3e2f80776f8e4267817bd7002fc299d79a80e112 | [
"MIT"
] | null | null | null | recipe_scrapers/__version__.py | oncleben31/recipe-scrapers | 3e2f80776f8e4267817bd7002fc299d79a80e112 | [
"MIT"
] | null | null | null | recipe_scrapers/__version__.py | oncleben31/recipe-scrapers | 3e2f80776f8e4267817bd7002fc299d79a80e112 | [
"MIT"
] | null | null | null | __version__ = "13.4.0"
| 11.5 | 22 | 0.652174 | __version__ = "13.4.0"
| true | true |
f7f8357aea533891c5ce13fb840b931c50006e7e | 435 | py | Python | 07.Redirect/main.py | sarincr/Introduction-to-Flask-Web-framework | 69a703b3533b6b12f07712a5473b31176c25c9c7 | [
"MIT"
] | null | null | null | 07.Redirect/main.py | sarincr/Introduction-to-Flask-Web-framework | 69a703b3533b6b12f07712a5473b31176c25c9c7 | [
"MIT"
] | null | null | null | 07.Redirect/main.py | sarincr/Introduction-to-Flask-Web-framework | 69a703b3533b6b12f07712a5473b31176c25c9c7 | [
"MIT"
] | null | null | null | from flask import Flask
test = Flask(__name__)
@test.route("/")
def start():
return "Hello Start Page"
@test.route("/home")
def home_page():
return "Welcome Home page"
@test.route("/blog")
def blog():
return "Welcome Author"
@test.route('/<name>')
def base():
if name =='home':
return redirec... | 14.5 | 43 | 0.627586 | from flask import Flask
test = Flask(__name__)
@test.route("/")
def start():
return "Hello Start Page"
@test.route("/home")
def home_page():
return "Welcome Home page"
@test.route("/blog")
def blog():
return "Welcome Author"
@test.route('/<name>')
def base():
if name =='home':
return redirec... | true | true |
f7f835b089350f9adf5c8a561460d8ef48e5daeb | 4,658 | py | Python | examples/comment_by_file.py | linneudm/Instagram-API | 7949cee0ddfe037841e4226a3038a4751b7a7854 | [
"MIT"
] | null | null | null | examples/comment_by_file.py | linneudm/Instagram-API | 7949cee0ddfe037841e4226a3038a4751b7a7854 | [
"MIT"
] | null | null | null | examples/comment_by_file.py | linneudm/Instagram-API | 7949cee0ddfe037841e4226a3038a4751b7a7854 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Use text editor to edit the script and type in valid Instagram username/password
from InstagramAPI import InstagramAPI
from random import randint
import time
import getpass
import os
def getIdByUsername(API, targetname):
API.searchUsername(targetna... | 31.472973 | 90 | 0.548089 |
from InstagramAPI import InstagramAPI
from random import randint
import time
import getpass
import os
def getIdByUsername(API, targetname):
API.searchUsername(targetname)
return API.LastJson['user']['pk']
def getTotalFollowers(api, user_id):
followers = []
next_max_id = True
... | true | true |
f7f836e4775957861360b6b9862eff5ec23845c6 | 906 | py | Python | fobi_custom/plugins/form_elements/fields/intercept/transportation/fobi_form_elements.py | jeancochrane/just-spaces | f7e8f710c3ab2db5f8a87a533547c5176a2d1e83 | [
"MIT"
] | null | null | null | fobi_custom/plugins/form_elements/fields/intercept/transportation/fobi_form_elements.py | jeancochrane/just-spaces | f7e8f710c3ab2db5f8a87a533547c5176a2d1e83 | [
"MIT"
] | null | null | null | fobi_custom/plugins/form_elements/fields/intercept/transportation/fobi_form_elements.py | jeancochrane/just-spaces | f7e8f710c3ab2db5f8a87a533547c5176a2d1e83 | [
"MIT"
] | null | null | null | from django import forms
from fobi.base import FormFieldPlugin, form_element_plugin_registry
from ..forms import TRANSPORTATION_CHOICES
from .forms import TransportationForm
class TransportationPlugin(FormFieldPlugin):
"""TransportationPlugin."""
uid = "transportation"
name = "How did you travel here?"... | 29.225806 | 70 | 0.682119 | from django import forms
from fobi.base import FormFieldPlugin, form_element_plugin_registry
from ..forms import TRANSPORTATION_CHOICES
from .forms import TransportationForm
class TransportationPlugin(FormFieldPlugin):
uid = "transportation"
name = "How did you travel here?"
form = TransportationForm
... | true | true |
f7f83903c83772674143d3573e348cac3917f922 | 6,473 | py | Python | assignments/2019/assignment2/cs231n/classifiers/cnn.py | SudoHead/cs231n.github.io | 652285518ff5ed8c02503bac6cb24aaea0d6ff75 | [
"MIT"
] | 2 | 2021-03-03T02:49:00.000Z | 2021-09-17T06:53:13.000Z | assignments/2019/assignment2/cs231n/classifiers/cnn.py | SudoHead/cs231n.github.io | 652285518ff5ed8c02503bac6cb24aaea0d6ff75 | [
"MIT"
] | 32 | 2020-09-17T19:43:53.000Z | 2022-03-12T00:55:26.000Z | assignment2/cs231n/classifiers/cnn.py | AI-Huang/cs231n | 7887bd52e01dec87a33db7b5ac122dc702a2c3df | [
"MIT"
] | 1 | 2020-09-24T19:57:47.000Z | 2020-09-24T19:57:47.000Z | from builtins import object
import numpy as np
from cs231n.layers import *
from cs231n.fast_layers import *
from cs231n.layer_utils import *
class ThreeLayerConvNet(object):
"""
A three-layer convolutional network with the following architecture:
conv - relu - 2x2 max pool - affine - relu - affine - sof... | 50.178295 | 111 | 0.467326 | from builtins import object
import numpy as np
from cs231n.layers import *
from cs231n.fast_layers import *
from cs231n.layer_utils import *
class ThreeLayerConvNet(object):
def __init__(self, input_dim=(3, 32, 32), num_filters=32, filter_size=7,
hidden_dim=100, num_classes=10, weight_scale=1e-... | true | true |
f7f8398d48622f2c288a4b0b875b93a5b54c1208 | 683 | py | Python | app/core/migrations/0002_tag.py | oussema-azzebi/recipe-app-api | 1aeedd7f79caa055d6b57f08363032abff28df91 | [
"MIT"
] | null | null | null | app/core/migrations/0002_tag.py | oussema-azzebi/recipe-app-api | 1aeedd7f79caa055d6b57f08363032abff28df91 | [
"MIT"
] | null | null | null | app/core/migrations/0002_tag.py | oussema-azzebi/recipe-app-api | 1aeedd7f79caa055d6b57f08363032abff28df91 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2021-08-31 13:48
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 28.458333 | 118 | 0.616398 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Tag',
fields=[
... | true | true |
f7f83bf7facb087cc7224f0ce420b2972d7b800a | 577 | py | Python | examples/sample-signals/generator/generate_events.py | denist-huma/prometheus_flask_exporter | 2cb218d2001c1edb678bd8169c5ca4190b2d2f96 | [
"MIT"
] | null | null | null | examples/sample-signals/generator/generate_events.py | denist-huma/prometheus_flask_exporter | 2cb218d2001c1edb678bd8169c5ca4190b2d2f96 | [
"MIT"
] | null | null | null | examples/sample-signals/generator/generate_events.py | denist-huma/prometheus_flask_exporter | 2cb218d2001c1edb678bd8169c5ca4190b2d2f96 | [
"MIT"
] | null | null | null | import time
import random
import threading
import requests
endpoints = ("one", "two", "three", "four", "error")
HOST = "http://app:5000/"
def run():
while True:
try:
target = random.choice(endpoints)
requests.get(HOST + target, timeout=1)
except requests.RequestException:
... | 20.607143 | 52 | 0.584055 | import time
import random
import threading
import requests
endpoints = ("one", "two", "three", "four", "error")
HOST = "http://app:5000/"
def run():
while True:
try:
target = random.choice(endpoints)
requests.get(HOST + target, timeout=1)
except requests.RequestException:
... | true | true |
f7f83c52f10f355c8f1ff71421b774fe9c4400de | 2,516 | py | Python | test/IECore/BINParticleWriterTest.py | gcodebackups/cortex-vfx | 72fa6c6eb3327fce4faf01361c8fcc2e1e892672 | [
"BSD-3-Clause"
] | 5 | 2016-07-26T06:09:28.000Z | 2022-03-07T03:58:51.000Z | test/IECore/BINParticleWriterTest.py | turbosun/cortex | 4bdc01a692652cd562f3bfa85f3dae99d07c0b15 | [
"BSD-3-Clause"
] | null | null | null | test/IECore/BINParticleWriterTest.py | turbosun/cortex | 4bdc01a692652cd562f3bfa85f3dae99d07c0b15 | [
"BSD-3-Clause"
] | 3 | 2015-03-25T18:45:24.000Z | 2020-02-15T15:37:18.000Z | ##########################################################################
#
# Copyright (c) 2009, Image Engine Design 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:
#
# * Redistribu... | 36.463768 | 76 | 0.68124 | true | true | |
f7f83d067d0364d32e7f9b053f64c29ad2ce128c | 73 | py | Python | app/modules/backend/modules/file/__init__.py | joostsijm/ssg | c2da0d7274aa76dc2d565e20d1b4c3f0ef5241a1 | [
"Apache-2.0"
] | null | null | null | app/modules/backend/modules/file/__init__.py | joostsijm/ssg | c2da0d7274aa76dc2d565e20d1b4c3f0ef5241a1 | [
"Apache-2.0"
] | null | null | null | app/modules/backend/modules/file/__init__.py | joostsijm/ssg | c2da0d7274aa76dc2d565e20d1b4c3f0ef5241a1 | [
"Apache-2.0"
] | null | null | null |
"""
Server static pages
"""
from .app import BLUEPRINT as Backend_File
| 10.428571 | 42 | 0.726027 |
from .app import BLUEPRINT as Backend_File
| true | true |
f7f83da1c20e77875ca5a940174bcd7ffde60d10 | 4,661 | py | Python | tests/system/fixtures/__init__.py | tgockel/marathon | 90619da70d79a2ecf19368a21c6a695ea981bd74 | [
"Apache-2.0"
] | 3,556 | 2015-01-01T00:18:02.000Z | 2022-03-30T01:58:26.000Z | tests/system/fixtures/__init__.py | tgockel/marathon | 90619da70d79a2ecf19368a21c6a695ea981bd74 | [
"Apache-2.0"
] | 5,128 | 2015-01-01T12:46:00.000Z | 2021-08-25T14:56:05.000Z | tests/system/fixtures/__init__.py | tgockel/marathon | 90619da70d79a2ecf19368a21c6a695ea981bd74 | [
"Apache-2.0"
] | 988 | 2015-01-04T18:40:44.000Z | 2022-02-23T21:04:47.000Z | import aiohttp
import common
import json
import os.path
import pytest
import logging
from datetime import timedelta
from shakedown.clients import dcos_url_path
from shakedown.clients.authentication import dcos_acs_token
from shakedown.clients.rpcclient import get_ssl_context
from shakedown.dcos.agent import get_agent... | 38.204918 | 111 | 0.732675 | import aiohttp
import common
import json
import os.path
import pytest
import logging
from datetime import timedelta
from shakedown.clients import dcos_url_path
from shakedown.clients.authentication import dcos_acs_token
from shakedown.clients.rpcclient import get_ssl_context
from shakedown.dcos.agent import get_agent... | true | true |
f7f83de67031c546f5c3dbfca02aeca0dc2ac473 | 280 | py | Python | backend/urls.py | FranBisquerra/django-vue | fe58bbbeef766bc99f34c8e3d30fd0910a34a741 | [
"MIT"
] | null | null | null | backend/urls.py | FranBisquerra/django-vue | fe58bbbeef766bc99f34c8e3d30fd0910a34a741 | [
"MIT"
] | null | null | null | backend/urls.py | FranBisquerra/django-vue | fe58bbbeef766bc99f34c8e3d30fd0910a34a741 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.conf.urls import url, include
from django.urls import path
from .api.views import index_view
urlpatterns = [
path('', index_view, name='index'),
url('', include('backend.api.urls')),
path('admin/', admin.site.urls),
]
| 18.666667 | 41 | 0.692857 | from django.contrib import admin
from django.conf.urls import url, include
from django.urls import path
from .api.views import index_view
urlpatterns = [
path('', index_view, name='index'),
url('', include('backend.api.urls')),
path('admin/', admin.site.urls),
]
| true | true |
f7f83fb5760e68fce1f6ad015c1890655cc2a2d3 | 6,936 | py | Python | test/expression/test_logical.py | LordDarkula/eva | 93433bc88f361c277690c9e31f1b8de657f25823 | [
"Apache-2.0"
] | null | null | null | test/expression/test_logical.py | LordDarkula/eva | 93433bc88f361c277690c9e31f1b8de657f25823 | [
"Apache-2.0"
] | null | null | null | test/expression/test_logical.py | LordDarkula/eva | 93433bc88f361c277690c9e31f1b8de657f25823 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018-2020 EVA
#
# 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 ... | 33.669903 | 79 | 0.63985 |
import unittest
import pandas as pd
from mock import Mock
from eva.expression.abstract_expression import ExpressionType
from eva.expression.comparison_expression import ComparisonExpression
from eva.expression.logical_expression import LogicalExpression
from eva.expression.constant_value_expression impor... | true | true |
f7f84019a158f52e8dd458a60900bac31893f555 | 4,981 | py | Python | imcsdk/mometa/ip/IpBlocking.py | ecoen66/imcsdk | b10eaa926a5ee57cea7182ae0adc8dd1c818b0ab | [
"Apache-2.0"
] | 31 | 2016-06-14T07:23:59.000Z | 2021-09-12T17:17:26.000Z | imcsdk/mometa/ip/IpBlocking.py | sthagen/imcsdk | 1831eaecb5960ca03a8624b1579521749762b932 | [
"Apache-2.0"
] | 109 | 2016-05-25T03:56:56.000Z | 2021-10-18T02:58:12.000Z | imcsdk/mometa/ip/IpBlocking.py | sthagen/imcsdk | 1831eaecb5960ca03a8624b1579521749762b932 | [
"Apache-2.0"
] | 67 | 2016-05-17T05:53:56.000Z | 2022-03-24T15:52:53.000Z | """This module contains the general information for IpBlocking ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class IpBlockingConsts:
pass
class IpBlocking(ManagedObject):
"""This is IpBlocking class."""
consts ... | 54.141304 | 199 | 0.609115 |
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class IpBlockingConsts:
pass
class IpBlocking(ManagedObject):
consts = IpBlockingConsts()
naming_props = set([])
mo_meta = {
"classic": MoMeta("IpBlocking", "ipBlocking"... | true | true |
f7f840cfae2866dfd800ad567aecc9dd4d8e3e3b | 1,014 | py | Python | test.py | bosichong/17python.com | 378754e1288b444ab3657093aa18b7e3f03b5145 | [
"Apache-2.0"
] | 9 | 2017-09-02T05:54:06.000Z | 2019-04-11T02:34:41.000Z | test.py | bosichong/17python.com | 378754e1288b444ab3657093aa18b7e3f03b5145 | [
"Apache-2.0"
] | null | null | null | test.py | bosichong/17python.com | 378754e1288b444ab3657093aa18b7e3f03b5145 | [
"Apache-2.0"
] | 6 | 2017-10-25T02:47:45.000Z | 2019-12-21T06:35:01.000Z |
'''
环境配置
IDE vscode pycharm
代码仓库 github gitee
python 官方文档中文
https://docs.python.org/zh-cn/3.8/
程序的基本编写方法 IPO
I:Input 输入,程序的输入,数据机构。
P:Process 处理 程序的主要逻辑,算法。
O:Output 输出,程序的输出。
print([n*n for n in range(1,9)]) 列表推导
(n*n for n in range(9)) 生成器表达式
函数的复用
'''
# def getadd():
# return
# def add():
# ... | 11.522727 | 56 | 0.559172 |
a, b = 0, 1
while b < 20:
print(b)
a, b = b, a+b
import threading
import time
def pp(key):
while True:
print(key)
time.sleep(1)
t1 = threading.Thread(target=pp,args=("haha",))
t1.start()
t2 = threading.Thread(target=pp,args=("lailai",))
t2.start()
... | true | true |
f7f84149287f46989ac5f40c3d40329158fba3cb | 3,757 | py | Python | mongosync/config_file.py | caosiyang/py-mongo-sync | 980a37c6f2b012025d43878a315e2869af397dd5 | [
"MIT"
] | 98 | 2016-05-26T07:45:08.000Z | 2022-03-15T03:52:22.000Z | mongosync/config_file.py | caosiyang/py-mongo-sync | 980a37c6f2b012025d43878a315e2869af397dd5 | [
"MIT"
] | 31 | 2016-08-27T06:46:20.000Z | 2021-07-27T11:52:58.000Z | mongosync/config_file.py | caosiyang/py-mongo-sync | 980a37c6f2b012025d43878a315e2869af397dd5 | [
"MIT"
] | 51 | 2016-05-05T05:47:41.000Z | 2021-09-09T10:53:11.000Z | import toml
from bson.timestamp import Timestamp
from mongosync.config import Config, MongoConfig, EsConfig
from mongosync.mongo_utils import gen_namespace
class ConfigFile(object):
@staticmethod
def load(filepath):
""" Load config file and generate conf.
"""
conf = Config()
tm... | 46.382716 | 121 | 0.46633 | import toml
from bson.timestamp import Timestamp
from mongosync.config import Config, MongoConfig, EsConfig
from mongosync.mongo_utils import gen_namespace
class ConfigFile(object):
@staticmethod
def load(filepath):
conf = Config()
tml = toml.load(filepath)
conf.src_conf = MongoConfig(... | true | true |
f7f841c63e49029ce223634f7e52cf56ef76b22b | 627 | py | Python | prog_praxis/harvey.py | genos/online_problems | 324597e8b64d74ad96dbece551a8220a1b61e615 | [
"MIT"
] | 1 | 2020-07-17T13:15:21.000Z | 2020-07-17T13:15:21.000Z | prog_praxis/harvey.py | genos/online_problems | 324597e8b64d74ad96dbece551a8220a1b61e615 | [
"MIT"
] | null | null | null | prog_praxis/harvey.py | genos/online_problems | 324597e8b64d74ad96dbece551a8220a1b61e615 | [
"MIT"
] | null | null | null | from itertools import combinations, ifilter, imap, izip
def sums(n):
return [n * (n + 1) / 2,
n * (n + 1) * (2 * n + 1) / 6,
(n * (n + 1) / 2) ** 2]
def prop(sub):
return all(0 == a - b for (a, b) in
izip(sums(16), map(lambda x: 2 * x,
... | 33 | 69 | 0.460925 | from itertools import combinations, ifilter, imap, izip
def sums(n):
return [n * (n + 1) / 2,
n * (n + 1) * (2 * n + 1) / 6,
(n * (n + 1) / 2) ** 2]
def prop(sub):
return all(0 == a - b for (a, b) in
izip(sums(16), map(lambda x: 2 * x,
... | false | true |
f7f8430f045f30bfee6b9a7b0eb642ec66a7a4fe | 10,526 | py | Python | tests/test_integration.py | kotnik/nikola | d08ed98b1b9bf7cbdabf06a18b51a3acdb745625 | [
"MIT"
] | null | null | null | tests/test_integration.py | kotnik/nikola | d08ed98b1b9bf7cbdabf06a18b51a3acdb745625 | [
"MIT"
] | null | null | null | tests/test_integration.py | kotnik/nikola | d08ed98b1b9bf7cbdabf06a18b51a3acdb745625 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import codecs
from contextlib import contextmanager
import locale
import os
import shutil
import subprocess
import sys
import tempfile
import unittest
import lxml.html
from nose.plugins.skip import SkipTest
from context import nikola
fro... | 38.416058 | 102 | 0.590348 |
from __future__ import unicode_literals, print_function
import codecs
from contextlib import contextmanager
import locale
import os
import shutil
import subprocess
import sys
import tempfile
import unittest
import lxml.html
from nose.plugins.skip import SkipTest
from context import nikola
from nikola import main
... | true | true |
f7f8435f06cde9475c6292a87525217f83a015a4 | 1,288 | py | Python | 2018/Q1.py | s-cork/BIO | 7f3b3e1e7b47da5ea5f96569836946c4d28277fe | [
"MIT"
] | null | null | null | 2018/Q1.py | s-cork/BIO | 7f3b3e1e7b47da5ea5f96569836946c4d28277fe | [
"MIT"
] | null | null | null | 2018/Q1.py | s-cork/BIO | 7f3b3e1e7b47da5ea5f96569836946c4d28277fe | [
"MIT"
] | null | null | null | from math import ceil
def round_up(num):
''' expects a number
shifts the the number by 8 dp, discards the decimal places
shifts the number down by 6 place
takes the ceiling of this number
divides it by 100 and returns it.
So 43.000657543332 --> 4300065754.3332 --> 4300065754 --> 43.00065754
... | 25.76 | 73 | 0.592391 | from math import ceil
def round_up(num):
num = int(num*10**8)/10**6
num = ceil(num)/100
return num
def repay_program(interest, repay):
debt = 100
while debt > 0:
debt = round_up(debt * interest)
if debt < debt * repay:
yield debt
debt = 0
elif debt... | true | true |
f7f843a5599aa5aacb8040c092d4f1aa27edf5f9 | 10,829 | py | Python | lib/python3.8/site-packages/ansible_collections/community/general/plugins/lookup/manifold.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | 5 | 2020-12-16T21:42:09.000Z | 2022-03-28T16:04:32.000Z | .ansible/collections/ansible_collections/community/general/plugins/lookup/manifold.py | chronicc/proving-ground | 3e392122a05fb8383a3700954baebb0df330e9e3 | [
"MIT"
] | null | null | null | .ansible/collections/ansible_collections/community/general/plugins/lookup/manifold.py | chronicc/proving-ground | 3e392122a05fb8383a3700954baebb0df330e9e3 | [
"MIT"
] | null | null | null | # (c) 2018, Arigato Machine Inc.
# (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
author:
- Kyrylo Galanov (!UNKNOWN) <galanoff... | 38.81362 | 119 | 0.593499 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
author:
- Kyrylo Galanov (!UNKNOWN) <galanoff@gmail.com>
lookup: manifold
short_description: get credentials from Manifold.co
description:
- Retrieves resources' credentials fr... | true | true |
f7f8440a7194c0f23a86001844e4201ef7e04b76 | 973 | py | Python | tests/api/conftest.py | oarepo/oarepo-micro-api | 313d928c5c588635b300cf51272c7cae4aff1645 | [
"MIT"
] | null | null | null | tests/api/conftest.py | oarepo/oarepo-micro-api | 313d928c5c588635b300cf51272c7cae4aff1645 | [
"MIT"
] | 9 | 2020-06-02T15:04:45.000Z | 2021-04-08T11:47:51.000Z | tests/api/conftest.py | oarepo/oarepo-micro-api | 313d928c5c588635b300cf51272c7cae4aff1645 | [
"MIT"
] | 2 | 2020-05-13T07:42:40.000Z | 2020-05-18T15:25:37.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CESNET.
#
# OARepo Micro API is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Pytest fixtures and plugins for the API application."""
from __future__ import absolute_import, print_funct... | 24.325 | 77 | 0.725591 |
from __future__ import absolute_import, print_function
import pytest
import oarepo_micro_api
from invenio_app.factory import create_api
from webtest import TestApp
from oarepo_micro_api.wsgi import application
@pytest.fixture(scope='module')
def app_config(app_config):
app_config['SERVER_NAME'] = 'loc... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.