hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f721b63438fa70ee2bdce28ac774d92f0929d8a6 | 5,826 | py | Python | openapi_to_fastapi/tests/test_ihan_standards.py | tbikeev/openapi-to-fastapi | 46cacb41fde2d178afd58466fb6080d79fef1b22 | [
"BSD-3-Clause"
] | null | null | null | openapi_to_fastapi/tests/test_ihan_standards.py | tbikeev/openapi-to-fastapi | 46cacb41fde2d178afd58466fb6080d79fef1b22 | [
"BSD-3-Clause"
] | null | null | null | openapi_to_fastapi/tests/test_ihan_standards.py | tbikeev/openapi-to-fastapi | 46cacb41fde2d178afd58466fb6080d79fef1b22 | [
"BSD-3-Clause"
] | null | null | null | import json
from copy import deepcopy
from pathlib import Path
import pytest
from ..routes import SpecRouter
from ..validator import InvalidJSON, UnsupportedVersion
from ..validator import ihan_standards as ihan
# Note: It's easier to get some 100% valid spec and corrupt it
# instead of having multiple incorrect spe... | 35.962963 | 87 | 0.730862 | import json
from copy import deepcopy
from pathlib import Path
import pytest
from ..routes import SpecRouter
from ..validator import InvalidJSON, UnsupportedVersion
from ..validator import ihan_standards as ihan
# instead of having multiple incorrect specs in the repo
SPECS_ROOT_DIR = Path(__file__).absolute().par... | true | true |
f721b681480bbcf350254eceb8ac0f83efa3bb75 | 147,382 | py | Python | scipy/stats/_distn_infrastructure.py | sntgl/scipy | 6660830eb7d7590d56f1377d27bf7ee97bb3adec | [
"BSD-3-Clause"
] | null | null | null | scipy/stats/_distn_infrastructure.py | sntgl/scipy | 6660830eb7d7590d56f1377d27bf7ee97bb3adec | [
"BSD-3-Clause"
] | null | null | null | scipy/stats/_distn_infrastructure.py | sntgl/scipy | 6660830eb7d7590d56f1377d27bf7ee97bb3adec | [
"BSD-3-Clause"
] | null | null | null | #
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
from scipy._lib._util import getfullargspec_no_self as _getfullargspec
import sys
import keyword
import re
import types
import warnings
import inspect
from itertools import zip_longest
from collections import namedt... | 36.516848 | 195 | 0.573347 |
from scipy._lib._util import getfullargspec_no_self as _getfullargspec
import sys
import keyword
import re
import types
import warnings
import inspect
from itertools import zip_longest
from collections import namedtuple
from scipy._lib import doccer
from scipy._lib._util import _lazywhere
from ._distr_params impo... | true | true |
f721b6c0725948384b13004e8039bea5c71d7ff9 | 14,338 | py | Python | example/ui/example_pyqt5_ui.py | blurstudio/QDarkStyleSheet | 68c9e3177742c47b158594260b57f591b5238e7a | [
"MIT"
] | 8 | 2016-08-28T18:28:05.000Z | 2020-09-09T15:41:52.000Z | example/ui/example_pyqt5_ui.py | blurstudio/QDarkStyleSheet | 68c9e3177742c47b158594260b57f591b5238e7a | [
"MIT"
] | null | null | null | example/ui/example_pyqt5_ui.py | blurstudio/QDarkStyleSheet | 68c9e3177742c47b158594260b57f591b5238e7a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'example.ui'
#
# Created: Sat May 17 20:31:42 2014
# by: PyQt5 UI code generator 5.2.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(sel... | 54.725191 | 104 | 0.707491 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(880, 600)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
... | true | true |
f721b6ccaaf918b21885f9b671dce1f756b4c4ca | 2,337 | py | Python | pipeline_utils.py | j-petit/mplus_model_pipeline | 4b837ad3cdcd337a842f9eac1b75f58ef477da7a | [
"MIT"
] | null | null | null | pipeline_utils.py | j-petit/mplus_model_pipeline | 4b837ad3cdcd337a842f9eac1b75f58ef477da7a | [
"MIT"
] | null | null | null | pipeline_utils.py | j-petit/mplus_model_pipeline | 4b837ad3cdcd337a842f9eac1b75f58ef477da7a | [
"MIT"
] | null | null | null | """
File: pipeline_utils.py
Author: Jens Petit
Email: petit.jens@gmail.com
Github: https://github.com/j-petit
Description: Utility functions for filtering models
"""
import re
def createDiffs(model1, model2, filename):
"""Takes two models and creates constraint variables out of their paths.
Parameters
-... | 23.846939 | 76 | 0.551562 |
import re
def createDiffs(model1, model2, filename):
if len(model1.model) != len(model2.model):
raise Exception("Models not the same")
no_lines = len(model1.model)
not_diffs = 0
for i in range(no_lines):
if model1.labels[i] == model2.labels[i]:
not_diffs = not_diffs + 1... | true | true |
f721b7a28e5ba3d40876a0ab5769b27adb80ab95 | 19,049 | py | Python | python/cudf/cudf/tests/test_duplicates.py | sperlingxx/cudf | c681211df6253e1ceee9203658108980e7e93e3c | [
"Apache-2.0"
] | 1 | 2021-12-17T19:28:00.000Z | 2021-12-17T19:28:00.000Z | python/cudf/cudf/tests/test_duplicates.py | sperlingxx/cudf | c681211df6253e1ceee9203658108980e7e93e3c | [
"Apache-2.0"
] | 1 | 2021-03-10T20:28:23.000Z | 2021-03-25T15:58:47.000Z | python/cudf/cudf/tests/test_duplicates.py | sperlingxx/cudf | c681211df6253e1ceee9203658108980e7e93e3c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020-2021, NVIDIA CORPORATION.
import itertools as it
import random
import numpy as np
import pytest
from pandas import DataFrame, MultiIndex, Series, date_range
import cudf
from cudf import concat
from cudf.tests.utils import assert_eq, assert_exceptions_equal
# TODO: PANDAS 1.0 support
# Revisit d... | 30.724194 | 79 | 0.596462 |
import itertools as it
import random
import numpy as np
import pytest
from pandas import DataFrame, MultiIndex, Series, date_range
import cudf
from cudf import concat
from cudf.tests.utils import assert_eq, assert_exceptions_equal
def assert_df(g, p):
g = g.sort_index()
p = p.sort_index()
retu... | true | true |
f721b7e1de7edb58c96d9d578d13892a84f8ff0c | 803 | py | Python | experiments/download.py | stasbel/Meme-Machinery-VKHack2018 | 5e15198d6bc8d350f2dc0158a34467f3415da0bc | [
"MIT"
] | 1 | 2018-11-15T08:30:34.000Z | 2018-11-15T08:30:34.000Z | experiments/download.py | stasbel/Meme-Machinery-VKHack2018 | 5e15198d6bc8d350f2dc0158a34467f3415da0bc | [
"MIT"
] | null | null | null | experiments/download.py | stasbel/Meme-Machinery-VKHack2018 | 5e15198d6bc8d350f2dc0158a34467f3415da0bc | [
"MIT"
] | null | null | null | """Downloads prescribed data from the Internet, embed and store it."""
import logging
import numpy as np
import torch
from experiments.scrap import META_PATH
from mem.gen.stages import Extractor
logger = logging.getLogger(__name__)
MATRIX_PATH = 'matrix.npy'
NEW_META_PATH = 'processed_reddit_data.pth'
def main(_... | 20.075 | 70 | 0.682441 |
import logging
import numpy as np
import torch
from experiments.scrap import META_PATH
from mem.gen.stages import Extractor
logger = logging.getLogger(__name__)
MATRIX_PATH = 'matrix.npy'
NEW_META_PATH = 'processed_reddit_data.pth'
def main(_):
meta = torch.load(META_PATH)
extractor = Extractor()
me... | true | true |
f721ba9b451bb59633ec0dcadf214c8d02e86015 | 1,447 | py | Python | Data Structures/Queues/QueueList.py | ayushkr459/Data-Structures-And-Algorithms | 050689a5e89a5afb0c907f16601d11706c04b614 | [
"MIT"
] | 4 | 2020-12-01T08:52:57.000Z | 2021-11-08T11:44:42.000Z | Data Structures/Queues/QueueList.py | ayushkr459/Data-Structures-And-Algorithms | 050689a5e89a5afb0c907f16601d11706c04b614 | [
"MIT"
] | 4 | 2020-09-30T19:54:10.000Z | 2020-10-17T05:04:04.000Z | Data Structures/Queues/QueueList.py | ayushkr459/Data-Structures-And-Algorithms | 050689a5e89a5afb0c907f16601d11706c04b614 | [
"MIT"
] | 12 | 2020-09-30T18:30:59.000Z | 2020-10-31T15:38:54.000Z |
# class node to create a node for the queue linked list
class Node :
def __init__(self, val) :
self.val = val
self.next = None
class Queue :
# contructor of the queue class
def __init__(self) :
self.front = None
self.rear = None
# method to insert an elem... | 22.609375 | 73 | 0.520387 |
class Node :
def __init__(self, val) :
self.val = val
self.next = None
class Queue :
def __init__(self) :
self.front = None
self.rear = None
def insert(self, val) :
new_node = Node(val)
if self.rear is None and self.front is No... | true | true |
f721bb48b8c008b5b87c1df753579d37ad8ec606 | 9,887 | py | Python | models.py | jiangyangby/DRDSC | 4b53e18626b9839578bea6c84bba47d15bc8d3d6 | [
"MIT"
] | 3 | 2020-10-12T02:30:11.000Z | 2021-07-09T07:04:12.000Z | models.py | jiangyangby/DRDSC | 4b53e18626b9839578bea6c84bba47d15bc8d3d6 | [
"MIT"
] | 1 | 2020-10-06T15:19:09.000Z | 2020-10-06T15:19:09.000Z | models.py | jiangyangby/DRDSC | 4b53e18626b9839578bea6c84bba47d15bc8d3d6 | [
"MIT"
] | 2 | 2020-04-09T15:46:59.000Z | 2021-08-13T16:39:31.000Z | from __future__ import print_function, absolute_import, division
import tensorflow as tf
from tensorflow.contrib import layers
mu = 1.0e-6
@tf.custom_gradient
def f_norm(x):
f2 = tf.square(tf.norm(x, ord='fro', axis=[-2, -1]))
f = tf.sqrt(f2 + mu ** 2) - mu
def grad(dy):
return dy * (x / tf.sqrt... | 42.986957 | 168 | 0.583392 | from __future__ import print_function, absolute_import, division
import tensorflow as tf
from tensorflow.contrib import layers
mu = 1.0e-6
@tf.custom_gradient
def f_norm(x):
f2 = tf.square(tf.norm(x, ord='fro', axis=[-2, -1]))
f = tf.sqrt(f2 + mu ** 2) - mu
def grad(dy):
return dy * (x / tf.sqrt... | true | true |
f721bbe3a503666d938fe4233b4619c044301e09 | 83,584 | py | Python | research/object_detection/metrics/coco_evaluation.py | raijin0704/models | 6906bfbdbf2ad628bb6aeca9989dc04f605b6a60 | [
"Apache-2.0"
] | 549 | 2020-01-02T05:14:57.000Z | 2022-03-29T18:34:12.000Z | research/object_detection/metrics/coco_evaluation.py | raijin0704/models | 6906bfbdbf2ad628bb6aeca9989dc04f605b6a60 | [
"Apache-2.0"
] | 98 | 2020-01-21T09:41:30.000Z | 2022-03-12T00:53:06.000Z | research/object_detection/metrics/coco_evaluation.py | raijin0704/models | 6906bfbdbf2ad628bb6aeca9989dc04f605b6a60 | [
"Apache-2.0"
] | 233 | 2020-01-18T03:46:27.000Z | 2022-03-19T03:17:47.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 46.6689 | 102 | 0.696964 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from six.moves import zip
import tensorflow.compat.v1 as tf
from object_detection.core import standard_fields
from object_detection.metrics import coco_tools
from object_detect... | true | true |
f721bc197ab237261a546eeac5adc901979a3a4e | 487 | py | Python | libs/external_libs/Genshi-0.5.1/examples/turbogears/genshitest/tests/test_controllers.py | google-code-export/django-hotclub | d783a5bbcc06816289565f3eae6d99461188ca4a | [
"MIT"
] | 3 | 2015-12-25T14:45:36.000Z | 2016-11-28T09:58:03.000Z | libs/external_libs/Genshi-0.5.1/examples/turbogears/genshitest/tests/test_controllers.py | indro/t2c | 56482ad4aed150f29353e054db2c97b567243bf8 | [
"MIT"
] | null | null | null | libs/external_libs/Genshi-0.5.1/examples/turbogears/genshitest/tests/test_controllers.py | indro/t2c | 56482ad4aed150f29353e054db2c97b567243bf8 | [
"MIT"
] | null | null | null | from turbogears import testutil
from genshitest.controllers import Root
import cherrypy
cherrypy.root = Root()
def test_method():
"the index method should return a string called now"
import types
result = testutil.call(cherrypy.root.index)
assert type(result["now"]) == types.StringType
def test_index... | 28.647059 | 78 | 0.73922 | from turbogears import testutil
from genshitest.controllers import Root
import cherrypy
cherrypy.root = Root()
def test_method():
import types
result = testutil.call(cherrypy.root.index)
assert type(result["now"]) == types.StringType
def test_indextitle():
testutil.createRequest("/")
assert "<TIT... | true | true |
f721bd50781f7bcc154d691ea0d6153c17a983a4 | 6,230 | py | Python | tools/parse_llvm_coverage.py | AsdMonio/rr-external_skia | 3839e72932bcef2f26a4f8826bb92b195f6cc396 | [
"Apache-2.0"
] | 5,964 | 2016-09-27T03:46:29.000Z | 2022-03-31T16:25:27.000Z | third_party/skia/tools/parse_llvm_coverage.py | w4454962/miniblink49 | b294b6eacb3333659bf7b94d670d96edeeba14c0 | [
"Apache-2.0"
] | 459 | 2016-09-29T00:51:38.000Z | 2022-03-07T14:37:46.000Z | third_party/skia/tools/parse_llvm_coverage.py | w4454962/miniblink49 | b294b6eacb3333659bf7b94d670d96edeeba14c0 | [
"Apache-2.0"
] | 1,006 | 2016-09-27T05:17:27.000Z | 2022-03-30T02:46:51.000Z | #!/usr/bin/env python
# Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Parse an LLVM coverage report to generate useable results."""
import argparse
import json
import os
import re
import subproce... | 30.390244 | 80 | 0.648957 |
import argparse
import json
import os
import re
import subprocess
import sys
def _fix_filename(filename):
return filename.split('..')[-1].lstrip('./')
def _file_in_repo(filename, all_files):
new_file = _fix_filename(filename)
matched = []
for f in all_files:
if f.endswith(new_file):
matche... | true | true |
f721bd62e54683913fbde95759866ef0c91bb0fc | 45,876 | py | Python | tests/test_url.py | Laerte/w3lib | d9763db408c474dd4872d788398db41e5c7773ae | [
"BSD-3-Clause"
] | 1 | 2020-07-15T19:41:36.000Z | 2020-07-15T19:41:36.000Z | tests/test_url.py | Laerte/w3lib | d9763db408c474dd4872d788398db41e5c7773ae | [
"BSD-3-Clause"
] | 4 | 2021-03-11T12:09:35.000Z | 2021-11-15T08:39:21.000Z | tests/test_url.py | zanachka/w3lib | d9763db408c474dd4872d788398db41e5c7773ae | [
"BSD-3-Clause"
] | null | null | null | import os
import unittest
from urllib.parse import urlparse
import pytest
from w3lib.url import (
add_or_replace_parameter,
add_or_replace_parameters,
any_to_uri,
canonicalize_url,
file_uri_to_path,
is_url,
parse_data_uri,
parse_url,
path_to_file_uri,
safe_download_url,
saf... | 41.629764 | 497 | 0.593884 | import os
import unittest
from urllib.parse import urlparse
import pytest
from w3lib.url import (
add_or_replace_parameter,
add_or_replace_parameters,
any_to_uri,
canonicalize_url,
file_uri_to_path,
is_url,
parse_data_uri,
parse_url,
path_to_file_uri,
safe_download_url,
saf... | true | true |
f721bde404ba19ca373a5664a9ea44c898ea8a20 | 5,264 | py | Python | python/readsPerGeneScript.sup4.edited.py | Asplund-Samuelsson/ribopipe | a27c09f990757116871345b0748015507dd3e8e8 | [
"MIT"
] | 2 | 2019-11-11T18:32:56.000Z | 2020-10-26T10:39:22.000Z | python/readsPerGeneScript.sup4.edited.py | Asplund-Samuelsson/ribopipe | a27c09f990757116871345b0748015507dd3e8e8 | [
"MIT"
] | null | null | null | python/readsPerGeneScript.sup4.edited.py | Asplund-Samuelsson/ribopipe | a27c09f990757116871345b0748015507dd3e8e8 | [
"MIT"
] | 1 | 2020-05-21T19:28:48.000Z | 2020-05-21T19:28:48.000Z | #!/usr/bin/python2.7
from Bio import SeqIO
"""
Supplementary Note 4: Read density per gene
Authors: Eugene Oh
Modified by: Johannes Asplund-Samuelsson (KTH)
inputFileP:
read density file for plus strand (Supplementary Note 2)
col0: position along genome
col1: read density at that position
inputFileM:
read... | 28.923077 | 100 | 0.612842 |
from Bio import SeqIO
def expression(inputFileP, inputFileM, inputListP, inputListM, outputFileP, \
outputFileM, inputFileG):
DictP = {}
DictM = {}
ref_lengths = {}
FastaFile = open(inputFileG, 'rU')
for rec in SeqIO.parse(FastaFile, 'fasta'):
ref_lengths[rec.id] ... | true | true |
f721beb5e7c054fc46f9b84585695379792bee59 | 426 | py | Python | tests/2017/test_22_sporifica_virus.py | wimglenn/advent-of-code-wim | 6308c3fa5d29b318680419f877fd5b8ac1359b5d | [
"WTFPL"
] | 20 | 2019-10-15T07:33:13.000Z | 2022-01-19T13:40:36.000Z | tests/2017/test_22_sporifica_virus.py | wimglenn/advent-of-code-wim | 6308c3fa5d29b318680419f877fd5b8ac1359b5d | [
"WTFPL"
] | 5 | 2019-02-01T23:31:27.000Z | 2021-12-03T06:55:58.000Z | tests/2017/test_22_sporifica_virus.py | wimglenn/advent-of-code-wim | 6308c3fa5d29b318680419f877fd5b8ac1359b5d | [
"WTFPL"
] | 8 | 2019-12-03T15:41:23.000Z | 2021-12-06T17:13:57.000Z | import pytest
from aoc_wim.aoc2017.q22 import mutate
test_data = """\
..#
#..
...
"""
@pytest.mark.parametrize("n,expected,part", [
(7, 5, "a"),
(70, 41, "a"),
(10000, 5587, "a"),
(100, 26, "b"),
(10000000, 2511944, "b")
], ids=["a_short", "a_medium", "a_long", "b_medium", "b_long_slow"])
def te... | 20.285714 | 68 | 0.600939 | import pytest
from aoc_wim.aoc2017.q22 import mutate
test_data = """\
..#
#..
...
"""
@pytest.mark.parametrize("n,expected,part", [
(7, 5, "a"),
(70, 41, "a"),
(10000, 5587, "a"),
(100, 26, "b"),
(10000000, 2511944, "b")
], ids=["a_short", "a_medium", "a_long", "b_medium", "b_long_slow"])
def te... | true | true |
f721c009fbb629ad735fa8472ac120fec2b6de3e | 7,073 | py | Python | menpo/math/linalg.py | yutiansut/menpo | 62af28606bc55985ab764f8ad38d239d1572bf1e | [
"BSD-3-Clause"
] | null | null | null | menpo/math/linalg.py | yutiansut/menpo | 62af28606bc55985ab764f8ad38d239d1572bf1e | [
"BSD-3-Clause"
] | 1 | 2019-03-09T16:01:46.000Z | 2019-03-09T16:01:46.000Z | menpo/math/linalg.py | yutiansut/menpo | 62af28606bc55985ab764f8ad38d239d1572bf1e | [
"BSD-3-Clause"
] | 1 | 2020-05-01T09:55:57.000Z | 2020-05-01T09:55:57.000Z | from itertools import islice
import numpy as np
from menpo.visualize import print_progress, bytes_str, print_dynamic
def dot_inplace_left(a, b, block_size=1000):
r"""
Inplace dot product for memory efficiency. It computes ``a * b = c``, where
``a`` will be replaced inplace with ``c``.
Parameters
... | 37.42328 | 80 | 0.61247 | from itertools import islice
import numpy as np
from menpo.visualize import print_progress, bytes_str, print_dynamic
def dot_inplace_left(a, b, block_size=1000):
(n_big, k_a), (k_b, n_small) = a.shape, b.shape
if k_a != k_b:
raise ValueError('Cannot dot {} * {}'.format(a.shape, b.shape))
if n_smal... | true | true |
f721c0352c2ce9e62a832ade6a760d74538547cf | 247 | py | Python | answers/Siddhant Saxena/Day 5/Question1.py | arc03/30-DaysOfCode-March-2021 | 6d6e11bf70280a578113f163352fa4fa8408baf6 | [
"MIT"
] | 22 | 2021-03-16T14:07:47.000Z | 2021-08-13T08:52:50.000Z | answers/Siddhant Saxena/Day 5/Question1.py | arc03/30-DaysOfCode-March-2021 | 6d6e11bf70280a578113f163352fa4fa8408baf6 | [
"MIT"
] | 174 | 2021-03-16T21:16:40.000Z | 2021-06-12T05:19:51.000Z | answers/Siddhant Saxena/Day 5/Question1.py | arc03/30-DaysOfCode-March-2021 | 6d6e11bf70280a578113f163352fa4fa8408baf6 | [
"MIT"
] | 135 | 2021-03-16T16:47:12.000Z | 2021-06-27T14:22:38.000Z | c=1
for i in range(5):
if i==1:
print("*",end="")
for j in range(i):
if c > 1:
for i in range(2,c):
if (c % i) == 0:
print("*",end="")
break
else:
print("#",end="")
c+=1
print()
| 13.722222 | 27 | 0.37247 | c=1
for i in range(5):
if i==1:
print("*",end="")
for j in range(i):
if c > 1:
for i in range(2,c):
if (c % i) == 0:
print("*",end="")
break
else:
print("#",end="")
c+=1
print()
| true | true |
f721c245101ff24635224c6a90a3a8df3d443626 | 5,281 | py | Python | src/olympia/amo/monitors.py | covariant/addons-server | 41e6ee9e426facb19a1e1ca8d40277cb6f94a7da | [
"BSD-3-Clause"
] | 843 | 2016-02-09T13:00:37.000Z | 2022-03-20T19:17:06.000Z | src/olympia/amo/monitors.py | covariant/addons-server | 41e6ee9e426facb19a1e1ca8d40277cb6f94a7da | [
"BSD-3-Clause"
] | 10,187 | 2016-02-05T23:51:05.000Z | 2022-03-31T15:24:44.000Z | src/olympia/amo/monitors.py | covariant/addons-server | 41e6ee9e426facb19a1e1ca8d40277cb6f94a7da | [
"BSD-3-Clause"
] | 551 | 2016-02-08T20:32:16.000Z | 2022-03-15T16:49:24.000Z | import os
import io
import socket
import traceback
from django.conf import settings
import requests
from kombu import Connection
from PIL import Image
import olympia.core.logger
from olympia.amo import search
from olympia.amo.templatetags.jinja_helpers import user_media_path
monitor_log = olympia.core.logger.get... | 29.338889 | 84 | 0.599508 | import os
import io
import socket
import traceback
from django.conf import settings
import requests
from kombu import Connection
from PIL import Image
import olympia.core.logger
from olympia.amo import search
from olympia.amo.templatetags.jinja_helpers import user_media_path
monitor_log = olympia.core.logger.get... | true | true |
f721c3109896f56431a1bd85112d79800d195b90 | 4,113 | py | Python | ironic/drivers/irmc.py | NaohiroTamura/ironic | 1fcb6c52a22c9c025dbf27931720ce2eda08704f | [
"Apache-2.0"
] | null | null | null | ironic/drivers/irmc.py | NaohiroTamura/ironic | 1fcb6c52a22c9c025dbf27931720ce2eda08704f | [
"Apache-2.0"
] | null | null | null | ironic/drivers/irmc.py | NaohiroTamura/ironic | 1fcb6c52a22c9c025dbf27931720ce2eda08704f | [
"Apache-2.0"
] | 1 | 2022-03-25T14:26:10.000Z | 2022-03-25T14:26:10.000Z | # Copyright 2015 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 35.153846 | 77 | 0.722587 |
from oslo_utils import importutils
from ironic.common import exception
from ironic.common.i18n import _
from ironic.drivers import base
from ironic.drivers import generic
from ironic.drivers.modules import agent
from ironic.drivers.modules import inspector
from ironic.drivers.modules import ipmitool
from... | true | true |
f721c578750ba0a7105c0bada589a4631a8b372e | 1,845 | py | Python | pili/email.py | pilosus/pili | 8eb51e79420b7a2e4148f3b819e787cf6711e8cd | [
"MIT"
] | 2 | 2019-12-22T13:05:08.000Z | 2020-02-02T13:05:31.000Z | pili/email.py | pilosus/pili | 8eb51e79420b7a2e4148f3b819e787cf6711e8cd | [
"MIT"
] | 71 | 2016-10-31T15:41:10.000Z | 2022-03-21T14:26:22.000Z | pili/email.py | pilosus/pili | 8eb51e79420b7a2e4148f3b819e787cf6711e8cd | [
"MIT"
] | null | null | null | from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from pili.app import celery, mail
def send_email(to, subject, template, **kwargs):
"""Send email using either Celery, or Thread.
Selection depends on CELERY_INSTEAD_THREADING config variable.
"""
... | 30.75 | 74 | 0.688347 | from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from pili.app import celery, mail
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_object()
if app.config['CELERY_INSTEAD_THREADING']:
send_email_celery(to, subje... | true | true |
f721c5dd97e769836ffa40231cf86c6f09797352 | 3,757 | py | Python | day1/kapua-python-client/swagger_client/models/kapua_data_payload.py | liang-faan/SmartIOT-Diec | 8336a4b558295295f10a82cf350d8b7ff3fb9f5c | [
"MIT"
] | 5 | 2019-05-30T02:55:16.000Z | 2020-03-03T14:18:23.000Z | day1/kapua-python-client/swagger_client/models/kapua_data_payload.py | liang-faan/SmartIOT-Diec | 8336a4b558295295f10a82cf350d8b7ff3fb9f5c | [
"MIT"
] | 3 | 2019-12-27T00:53:23.000Z | 2020-02-17T05:29:19.000Z | day1/kapua-python-client/swagger_client/models/kapua_data_payload.py | liang-faan/SmartIOT-Diec | 8336a4b558295295f10a82cf350d8b7ff3fb9f5c | [
"MIT"
] | 4 | 2019-06-04T06:26:14.000Z | 2021-01-07T04:25:32.000Z | # coding: utf-8
"""
Eclipse Kapua REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
i... | 26.457746 | 119 | 0.556029 |
import pprint
import re
import six
class KapuaDataPayload(object):
swagger_types = {
'metrics': 'dict(str, object)',
'body': 'str'
}
attribute_map = {
'metrics': 'metrics',
'body': 'body'
}
def __init__(self, metrics=None, body=None):
self._metr... | true | true |
f721c6532584cb15c212bf15c6507558686dc532 | 125 | py | Python | starlette_inertia/__init__.py | roganartu/fastapi-inertia | 2e0e902b9e0369d00dab628d23ba74bb3fccd3d5 | [
"MIT"
] | 2 | 2022-02-25T21:28:36.000Z | 2022-03-05T14:42:56.000Z | starlette_inertia/__init__.py | roganartu/starlette-inertia | 2e0e902b9e0369d00dab628d23ba74bb3fccd3d5 | [
"MIT"
] | null | null | null | starlette_inertia/__init__.py | roganartu/starlette-inertia | 2e0e902b9e0369d00dab628d23ba74bb3fccd3d5 | [
"MIT"
] | null | null | null | from starlette_inertia.inertia import InertiaMiddleware, InertiaResponse
__all__ = ["InertiaMiddleware", "InertiaResponse"]
| 31.25 | 72 | 0.84 | from starlette_inertia.inertia import InertiaMiddleware, InertiaResponse
__all__ = ["InertiaMiddleware", "InertiaResponse"]
| true | true |
f721c699cb9f49dec818c048ce6c2572c20ac6d0 | 4,179 | py | Python | src/python/pants/backend/jvm/subsystems/java.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/subsystems/java.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/subsystems/java.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.j... | 47.488636 | 99 | 0.718832 |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.jvm.subsystems.jvm_tool_mixin import JvmToolMixin
from pants.backend.jvm.subsystems.zinc_language_mixin import ZincLanguageMixin
from pants.back... | true | true |
f721c756563d3d333e7e005fc2811ca05bf35a8b | 1,131 | py | Python | taxdata/puf/preppuf.py | jdebacker/taxdata | c32d401a10a6c8f6e889d87c6cc72fd4338017b2 | [
"CC0-1.0"
] | 12 | 2019-02-07T14:06:28.000Z | 2021-12-04T19:19:50.000Z | taxdata/puf/preppuf.py | jdebacker/taxdata | c32d401a10a6c8f6e889d87c6cc72fd4338017b2 | [
"CC0-1.0"
] | 230 | 2015-10-20T18:38:10.000Z | 2018-12-05T16:04:04.000Z | taxdata/puf/preppuf.py | jdebacker/taxdata | c32d401a10a6c8f6e889d87c6cc72fd4338017b2 | [
"CC0-1.0"
] | 19 | 2015-12-21T18:25:11.000Z | 2018-11-10T16:53:38.000Z | """
Scripts to clean up the raw PUF before matching
"""
import numpy as np
# RECIDs for aggregate variables by PUF year
AGG_VARS = {
2009: [999999],
2010: [999998, 999999],
2011: [999996, 999997, 999998, 999999],
}
def preppuf(puf, year):
"""Prepares the PUF for mathcing
Args:
puf (DataF... | 22.62 | 74 | 0.531388 | import numpy as np
AGG_VARS = {
2009: [999999],
2010: [999998, 999999],
2011: [999996, 999997, 999998, 999999],
}
def preppuf(puf, year):
puf.columns = map(str.lower, puf.columns)
puf = puf[~puf["recid"].isin(AGG_VARS[year])].copy()
puf["filer"] = 1
puf["depne"] = puf[["xocah", "xoc... | true | true |
f721c76e15725be651a3bdc5d01f71ceb6748e0f | 3,046 | py | Python | nova/scheduler/filters/io_ops_filter.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | 5 | 2017-06-23T07:37:39.000Z | 2020-10-21T07:07:50.000Z | nova/scheduler/filters/io_ops_filter.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | null | null | null | nova/scheduler/filters/io_ops_filter.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | 4 | 2017-06-23T07:37:43.000Z | 2020-12-28T09:57:22.000Z | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 38.075 | 78 | 0.68155 |
from oslo_config import cfg
from nova.i18n import _LW
from nova.openstack.common import log as logging
from nova.scheduler import filters
from nova.scheduler.filters import utils
LOG = logging.getLogger(__name__)
max_io_ops_per_host_opt = cfg.IntOpt("max_io_ops_per_host",
default=8,
he... | true | true |
f721c81f71df81d9b3a0633b6dd15524b15378d2 | 511 | py | Python | src/web/toga_web/widgets/box.py | luizoti/toga | 3c49e685f325f1aba2ce048b253402d7e4519f97 | [
"BSD-3-Clause"
] | 1,261 | 2019-03-31T16:28:47.000Z | 2022-03-31T09:01:23.000Z | src/web/toga_web/widgets/box.py | luizoti/toga | 3c49e685f325f1aba2ce048b253402d7e4519f97 | [
"BSD-3-Clause"
] | 597 | 2019-04-02T20:02:42.000Z | 2022-03-30T10:28:47.000Z | src/web/toga_web/widgets/box.py | luizoti/toga | 3c49e685f325f1aba2ce048b253402d7e4519f97 | [
"BSD-3-Clause"
] | 318 | 2019-03-31T18:32:00.000Z | 2022-03-30T18:07:13.000Z | from .base import Widget
class Box(Widget):
def __html__(self):
return """
<div id="toga_{id}" class="toga box container" style="{style}">
{content}
</div>
""".format(
id=self.interface.id,
content="\n".join(
child._impl._... | 21.291667 | 75 | 0.46771 | from .base import Widget
class Box(Widget):
def __html__(self):
return """
<div id="toga_{id}" class="toga box container" style="{style}">
{content}
</div>
""".format(
id=self.interface.id,
content="\n".join(
child._impl._... | true | true |
f721c883b5846e17b7af1b266eb11d6fa07f59b0 | 1,769 | py | Python | tests/test_chop_chains_with_plotting.py | jorgellop/orbitize | 82826ac3ddf345198f58cfaaf0662d4e6f5bd135 | [
"BSD-3-Clause-Clear"
] | 60 | 2018-01-12T17:16:53.000Z | 2022-02-14T01:39:39.000Z | tests/test_chop_chains_with_plotting.py | jorgellop/orbitize | 82826ac3ddf345198f58cfaaf0662d4e6f5bd135 | [
"BSD-3-Clause-Clear"
] | 278 | 2018-01-12T17:25:47.000Z | 2022-03-31T21:28:27.000Z | tests/test_chop_chains_with_plotting.py | jorgellop/orbitize | 82826ac3ddf345198f58cfaaf0662d4e6f5bd135 | [
"BSD-3-Clause-Clear"
] | 49 | 2018-10-30T19:34:05.000Z | 2021-10-31T13:28:45.000Z | '''
Make sure orbit plotting can still occur after chopping chains.
'''
import orbitize
from orbitize import driver, DATADIR
import multiprocessing as mp
def verify_results_data(res, sys):
# Make data attribute from System is carried forward to Result class
assert res.data is not None
# Make sure the da... | 27.215385 | 96 | 0.726964 | import orbitize
from orbitize import driver, DATADIR
import multiprocessing as mp
def verify_results_data(res, sys):
assert res.data is not None
res_data = res.data.to_pandas()
sys_data = sys.data_table.to_pandas()
assert res_data.equals(sys_data) == True
try:
epochs = sys.data_table['epoch'... | true | true |
f721caa6d4640590b6074dd36aeb070aab2ffcff | 627 | py | Python | minoristaAPI/minorista/models.py | OttoOctavius/Mayorium | 3389b0950047a8b0ae9441f6c0c4c283c319f998 | [
"MIT"
] | null | null | null | minoristaAPI/minorista/models.py | OttoOctavius/Mayorium | 3389b0950047a8b0ae9441f6c0c4c283c319f998 | [
"MIT"
] | 4 | 2020-09-26T12:57:31.000Z | 2020-10-10T14:29:38.000Z | minoristaAPI/minorista/models.py | OttoOctavius/Mayorium | 3389b0950047a8b0ae9441f6c0c4c283c319f998 | [
"MIT"
] | null | null | null | from djongo import models
from django.contrib.auth.models import User
class Minorista(models.Model):
readonly_fields = ('id',)
user = models.OneToOneField(User)
#first_name = models.CharField(max_length=100, default="", editable=False)
#last_name = models.CharField(max_length=100, default="", editable=... | 52.25 | 78 | 0.735247 | from djongo import models
from django.contrib.auth.models import User
class Minorista(models.Model):
readonly_fields = ('id',)
user = models.OneToOneField(User)
contacto = models.CharField(max_length=30, default="", editable=False)
| true | true |
f721cae3818031e8891791ccb6fed599dead54df | 12,458 | py | Python | vectorbt/utils/decorators.py | RileyMShea/vectorbt | 92ce571ce9fd0667f2994a2c922fb4cfcde10c88 | [
"Apache-2.0"
] | 1 | 2021-01-15T00:02:11.000Z | 2021-01-15T00:02:11.000Z | vectorbt/utils/decorators.py | RileyMShea/vectorbt | 92ce571ce9fd0667f2994a2c922fb4cfcde10c88 | [
"Apache-2.0"
] | null | null | null | vectorbt/utils/decorators.py | RileyMShea/vectorbt | 92ce571ce9fd0667f2994a2c922fb4cfcde10c88 | [
"Apache-2.0"
] | null | null | null | """Class and function decorators."""
from functools import wraps, lru_cache, RLock
import inspect
from vectorbt.utils import checks
class class_or_instancemethod(classmethod):
"""Function decorator that binds `self` to a class if the function is called as class method,
otherwise to an instance."""
def ... | 34.70195 | 107 | 0.571922 |
from functools import wraps, lru_cache, RLock
import inspect
from vectorbt.utils import checks
class class_or_instancemethod(classmethod):
def __get__(self, instance, type_):
descr_get = super().__get__ if instance is None else self.__func__.__get__
return descr_get(instance, type_)
class cla... | true | true |
f721cbcde3d04a0838563d9e89acdaf3fa845e47 | 799 | py | Python | setup.py | alekslovesdata/lambdata | f9119b9d96a5d9c5f7b957471bf7c78553e07077 | [
"MIT"
] | null | null | null | setup.py | alekslovesdata/lambdata | f9119b9d96a5d9c5f7b957471bf7c78553e07077 | [
"MIT"
] | 4 | 2020-03-24T18:00:50.000Z | 2021-06-02T00:34:10.000Z | setup.py | alekslovesdata/lambdata | f9119b9d96a5d9c5f7b957471bf7c78553e07077 | [
"MIT"
] | null | null | null | """
lambdata - a collection of data science helper functions for lambda school
"""
import setuptools
REQUIRED = [
"numpy",
"pandas"
]
with open("README.md", "r") as fh:
LONG_DESCRIPTION = fh.read()
setuptools.setup(
name="lambdata-alekslovesdata",
version = "0.1.1",
author = "alekslovesdat... | 27.551724 | 74 | 0.675845 | import setuptools
REQUIRED = [
"numpy",
"pandas"
]
with open("README.md", "r") as fh:
LONG_DESCRIPTION = fh.read()
setuptools.setup(
name="lambdata-alekslovesdata",
version = "0.1.1",
author = "alekslovesdata",
description = "a collection of data science helper functions",
long_des... | true | true |
f721ce2ca5cb8a400ff09a032cf59c3f22ccb2ff | 718 | py | Python | ApiRest/__init__.py | daycrom/fiscalberry | 305248e720587753ad65db1aac0339aea30e9c0c | [
"Apache-2.0"
] | 43 | 2017-04-18T01:26:02.000Z | 2022-03-12T14:00:28.000Z | ApiRest/__init__.py | daycrom/fiscalberry | 305248e720587753ad65db1aac0339aea30e9c0c | [
"Apache-2.0"
] | 83 | 2017-04-07T14:38:26.000Z | 2022-03-31T22:45:56.000Z | ApiRest/__init__.py | daycrom/fiscalberry | 305248e720587753ad65db1aac0339aea30e9c0c | [
"Apache-2.0"
] | 40 | 2017-04-25T13:39:19.000Z | 2022-03-12T14:00:50.000Z | #!/usr/bin/python
# -*- coding: latin-1 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is d... | 42.235294 | 77 | 0.753482 |
__version__ = "1.0" | true | true |
f721cee47df093b0c0ba33adbec9679bb5d8c2de | 46,422 | py | Python | google/cloud/firestore_admin_v1/services/firestore_admin/client.py | MShaffar19/python-firestore | 1fb39140c26e06a3bc28e8304c56270b58a15b0b | [
"Apache-2.0"
] | null | null | null | google/cloud/firestore_admin_v1/services/firestore_admin/client.py | MShaffar19/python-firestore | 1fb39140c26e06a3bc28e8304c56270b58a15b0b | [
"Apache-2.0"
] | null | null | null | google/cloud/firestore_admin_v1/services/firestore_admin/client.py | MShaffar19/python-firestore | 1fb39140c26e06a3bc28e8304c56270b58a15b0b | [
"Apache-2.0"
] | 1 | 2020-10-04T12:11:36.000Z | 2020-10-04T12:11:36.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 42.588991 | 131 | 0.625652 |
from collections import OrderedDict
from distutils import util
import os
import re
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
from google.api_core import exceptions
from google.api_... | true | true |
f721cf98bf4bca78c58d38f387c8dd63e1aabe26 | 279 | py | Python | frontend/urls.py | 0b01/autobasstab-web | b5ad0cef3d160b80ef1c91632b119e83325572d3 | [
"MIT"
] | 4 | 2020-10-07T19:25:41.000Z | 2021-08-13T10:23:29.000Z | frontend/urls.py | 0b01/autobasstab-web | b5ad0cef3d160b80ef1c91632b119e83325572d3 | [
"MIT"
] | null | null | null | frontend/urls.py | 0b01/autobasstab-web | b5ad0cef3d160b80ef1c91632b119e83325572d3 | [
"MIT"
] | 1 | 2021-06-29T07:52:05.000Z | 2021-06-29T07:52:05.000Z | from django.urls import path
from django.views.generic import TemplateView, RedirectView
from . import views
urlpatterns = [
path('', views.index),
path('model.json', RedirectView.as_view(url='http://rickyhan.com/static/crepe_model_full/model.json', permanent=True)),
]
| 31 | 123 | 0.752688 | from django.urls import path
from django.views.generic import TemplateView, RedirectView
from . import views
urlpatterns = [
path('', views.index),
path('model.json', RedirectView.as_view(url='http://rickyhan.com/static/crepe_model_full/model.json', permanent=True)),
]
| true | true |
f721d092cf36ee241d38b77f0107815dfdfd9986 | 30,721 | py | Python | tests/__init__.py | ClementAcher/dd-trace-py | f36519313c64d912ab9010094205ec3a82f1e493 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/__init__.py | ClementAcher/dd-trace-py | f36519313c64d912ab9010094205ec3a82f1e493 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/__init__.py | ClementAcher/dd-trace-py | f36519313c64d912ab9010094205ec3a82f1e493 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | import contextlib
from contextlib import contextmanager
import inspect
import os
import sys
from typing import List
import pytest
import ddtrace
from ddtrace import Span
from ddtrace import Tracer
from ddtrace.compat import httplib
from ddtrace.compat import parse
from ddtrace.compat import to_unicode
from ddtrace.co... | 33.176026 | 111 | 0.603073 | import contextlib
from contextlib import contextmanager
import inspect
import os
import sys
from typing import List
import pytest
import ddtrace
from ddtrace import Span
from ddtrace import Tracer
from ddtrace.compat import httplib
from ddtrace.compat import parse
from ddtrace.compat import to_unicode
from ddtrace.co... | true | true |
f721d0c46749a5a74c06f1c993568537b6bb35d9 | 257 | py | Python | tests/falcon/app.py | neetjn/falcon-pagination-processor | 547f10b4577933af97bd692866a1776d9f582773 | [
"MIT"
] | 2 | 2019-05-17T09:40:46.000Z | 2020-02-25T03:16:10.000Z | tests/falcon/app.py | neetjn/falcon-pagination-processor | 547f10b4577933af97bd692866a1776d9f582773 | [
"MIT"
] | null | null | null | tests/falcon/app.py | neetjn/falcon-pagination-processor | 547f10b4577933af97bd692866a1776d9f582773 | [
"MIT"
] | null | null | null | import falcon
from falcon_pagination_processor import PaginationProcessor
from tests.falcon.resources import TestResourceCollection
api = falcon.API(middleware=[PaginationProcessor()])
api.add_route(TestResourceCollection.route, TestResourceCollection())
| 32.125 | 69 | 0.863813 | import falcon
from falcon_pagination_processor import PaginationProcessor
from tests.falcon.resources import TestResourceCollection
api = falcon.API(middleware=[PaginationProcessor()])
api.add_route(TestResourceCollection.route, TestResourceCollection())
| true | true |
f721d144b892e99706ae1d0f4f99bff00bf06970 | 926 | py | Python | ibllib/tests/extractors/test_ephys_passive.py | nbonacchi/ibllib | 9066c00a8e9a65a1d209144a2ac54d0b87bec0b3 | [
"MIT"
] | null | null | null | ibllib/tests/extractors/test_ephys_passive.py | nbonacchi/ibllib | 9066c00a8e9a65a1d209144a2ac54d0b87bec0b3 | [
"MIT"
] | null | null | null | ibllib/tests/extractors/test_ephys_passive.py | nbonacchi/ibllib | 9066c00a8e9a65a1d209144a2ac54d0b87bec0b3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Author: Niccolò Bonacchi
# @Date: Friday, October 30th 2020, 10:42:49 am
import unittest
import ibllib.io.extractors.ephys_passive as passive
import numpy as np
class TestsPassiveExtractor(unittest.TestCase):
def setUp(self):
pass
def test_load_passive... | 28.9375 | 77 | 0.646868 |
import unittest
import ibllib.io.extractors.ephys_passive as passive
import numpy as np
class TestsPassiveExtractor(unittest.TestCase):
def setUp(self):
pass
def test_load_passive_stim_meta(self):
meta = passive._load_passive_stim_meta()
self.assertTrue(isinstance(meta, dict))
... | true | true |
f721d14b099b4093262cf01e174d72143b14627d | 41,291 | py | Python | openff/evaluator/datasets/curation/components/filtering.py | lilyminium/openff-evaluator | 21da54363009d83110b54d57e4416ae31df3868b | [
"MIT"
] | null | null | null | openff/evaluator/datasets/curation/components/filtering.py | lilyminium/openff-evaluator | 21da54363009d83110b54d57e4416ae31df3868b | [
"MIT"
] | null | null | null | openff/evaluator/datasets/curation/components/filtering.py | lilyminium/openff-evaluator | 21da54363009d83110b54d57e4416ae31df3868b | [
"MIT"
] | null | null | null | import functools
import itertools
import logging
from collections import defaultdict
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
import numpy
import pandas
from pydantic import Field, root_validator, validator
from scipy.optimize import linear_sum_assignment
from typing_extensions import Liter... | 32.901195 | 88 | 0.636071 | import functools
import itertools
import logging
from collections import defaultdict
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
import numpy
import pandas
from pydantic import Field, root_validator, validator
from scipy.optimize import linear_sum_assignment
from typing_extensions import Liter... | true | true |
f721d1659e4a76de250c7e3aa60844e53d5b0b27 | 1,929 | py | Python | migrations/versions/9ede8d2d7089_initialize_migration.py | casio-ka/DailyBlog | 4668a977c540308b2f00fcc86e5e02cb3878edc8 | [
"MIT"
] | null | null | null | migrations/versions/9ede8d2d7089_initialize_migration.py | casio-ka/DailyBlog | 4668a977c540308b2f00fcc86e5e02cb3878edc8 | [
"MIT"
] | null | null | null | migrations/versions/9ede8d2d7089_initialize_migration.py | casio-ka/DailyBlog | 4668a977c540308b2f00fcc86e5e02cb3878edc8 | [
"MIT"
] | null | null | null | """Initialize Migration
Revision ID: 9ede8d2d7089
Revises:
Create Date: 2020-09-28 00:25:38.033227
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9ede8d2d7089'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands au... | 33.842105 | 83 | 0.671332 | from alembic import op
import sqlalchemy as sa
revision = '9ede8d2d7089'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
)
op.create_table('users',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('username', sa.String(length=255), nullable=True),
sa.Column('e... | true | true |
f721d2802ff021d2044c01d4e530003b8cd4e151 | 329 | py | Python | sparkdq/analytics/states/ModeState.py | PasaLab/SparkDQ | 16d50210747ef7de03cf36d689ce26ff7445f63a | [
"Apache-2.0"
] | 1 | 2021-02-08T07:49:54.000Z | 2021-02-08T07:49:54.000Z | sparkdq/analytics/states/ModeState.py | PasaLab/SparkDQ | 16d50210747ef7de03cf36d689ce26ff7445f63a | [
"Apache-2.0"
] | null | null | null | sparkdq/analytics/states/ModeState.py | PasaLab/SparkDQ | 16d50210747ef7de03cf36d689ce26ff7445f63a | [
"Apache-2.0"
] | null | null | null | from sparkdq.analytics.states.State import DoubleValuedState
class ModeState(DoubleValuedState):
def __init__(self, mode_value):
self.mode_value = mode_value
def metric_value(self):
return self.mode_value
# def sum(self, other):
# return ModeState(max(self.mode_value, other.mode... | 23.5 | 66 | 0.714286 | from sparkdq.analytics.states.State import DoubleValuedState
class ModeState(DoubleValuedState):
def __init__(self, mode_value):
self.mode_value = mode_value
def metric_value(self):
return self.mode_value
| true | true |
f721d29f05b3f1aa5d1ea37c61f38905f80ae65c | 6,502 | py | Python | otherCodeTaskSnippets/14.01.2022.py | s2812135/Data_Challenges_WiSe2122 | a55372f444e7344af4e2e1f04e4244fb8cefeefe | [
"MIT"
] | null | null | null | otherCodeTaskSnippets/14.01.2022.py | s2812135/Data_Challenges_WiSe2122 | a55372f444e7344af4e2e1f04e4244fb8cefeefe | [
"MIT"
] | null | null | null | otherCodeTaskSnippets/14.01.2022.py | s2812135/Data_Challenges_WiSe2122 | a55372f444e7344af4e2e1f04e4244fb8cefeefe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 14 16:03:32 2022
@author: dariu
"""
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 7 12:43:25 2021
@author: dariu
"""
import numpy as np
import pandas as pd
import os
from tqdm import tqdm
import pacmap
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE... | 21.529801 | 120 | 0.652261 |
import numpy as np
import pandas as pd
import os
from tqdm import tqdm
import pacmap
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE
import umap
from sklearn.cluster import KMeans
from sklearn.cluster import DBSCAN
from sklearn.decomposition import PCA
from sklearn import metrics
from sklearn.clu... | true | true |
f721d55c74656c111fb68f8f7273731a712814c3 | 8,851 | py | Python | archive/maketiles_old.py | arroqc/pandacancer_kaggle | a6945dcac041dac744570d61ee630ee6f32e7117 | [
"MIT"
] | 3 | 2020-07-23T02:02:19.000Z | 2020-07-23T02:58:08.000Z | archive/maketiles_old.py | arroqc/pandacancer_kaggle | a6945dcac041dac744570d61ee630ee6f32e7117 | [
"MIT"
] | null | null | null | archive/maketiles_old.py | arroqc/pandacancer_kaggle | a6945dcac041dac744570d61ee630ee6f32e7117 | [
"MIT"
] | 3 | 2020-07-23T02:02:45.000Z | 2020-11-16T02:58:51.000Z | import skimage.io
import numpy as np
import pandas as pd
import sys
from pathlib import Path
import pickle
import argparse
import cv2
parser = argparse.ArgumentParser()
parser.add_argument("--base_dir", default='G:/Datasets/panda', required=False)
parser.add_argument("--out_dir", default='D:/Datasets/panda', required... | 38.316017 | 104 | 0.600949 | import skimage.io
import numpy as np
import pandas as pd
import sys
from pathlib import Path
import pickle
import argparse
import cv2
parser = argparse.ArgumentParser()
parser.add_argument("--base_dir", default='G:/Datasets/panda', required=False)
parser.add_argument("--out_dir", default='D:/Datasets/panda', required... | true | true |
f721d6bf664d81374c648dd133a87502c3abb0e5 | 475 | py | Python | mooring/migrations/0040_admissionsbooking_expirytime.py | jawaidm/moorings | 22db3fa5917fb13cbee144e64529221ef862cb39 | [
"Apache-2.0"
] | null | null | null | mooring/migrations/0040_admissionsbooking_expirytime.py | jawaidm/moorings | 22db3fa5917fb13cbee144e64529221ef862cb39 | [
"Apache-2.0"
] | 2 | 2020-04-30T12:02:15.000Z | 2021-03-19T22:41:46.000Z | mooring/migrations/0040_admissionsbooking_expirytime.py | jawaidm/moorings | 22db3fa5917fb13cbee144e64529221ef862cb39 | [
"Apache-2.0"
] | 6 | 2020-01-13T08:45:09.000Z | 2021-02-24T03:31:02.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-08-21 06:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mooring', '0039_admissionsbooking'),
]
operations = [
migrations.AddField(
... | 22.619048 | 62 | 0.629474 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mooring', '0039_admissionsbooking'),
]
operations = [
migrations.AddField(
model_name='admissionsbooking',
name='expiryTim... | true | true |
f721d7d8b4c42f9662d809895e1a8f8424cec320 | 445 | py | Python | dexcom_reader/record_test.py | ijustlovemath/dexcom_reader | c7ee4cf0f5fa7f96f7186635513e7662fd845d16 | [
"MIT"
] | 1 | 2020-10-22T14:26:57.000Z | 2020-10-22T14:26:57.000Z | dexcom_reader/record_test.py | ijustlovemath/dexcom_reader | c7ee4cf0f5fa7f96f7186635513e7662fd845d16 | [
"MIT"
] | null | null | null | dexcom_reader/record_test.py | ijustlovemath/dexcom_reader | c7ee4cf0f5fa7f96f7186635513e7662fd845d16 | [
"MIT"
] | 1 | 2020-10-22T14:50:56.000Z | 2020-10-22T14:50:56.000Z | from future import print_function
import readdata
dd = readdata.Dexcom.FindDevice()
dr = readdata.Dexcom(dd)
meter_records = dr.ReadRecords('METER_DATA')
print('First Meter Record = ')
print(meter_records[0])
print('Last Meter Record =')
print(meter_records[-1])
insertion_records = dr.ReadRecords('INSERTION_TIME')
p... | 27.8125 | 52 | 0.768539 | from future import print_function
import readdata
dd = readdata.Dexcom.FindDevice()
dr = readdata.Dexcom(dd)
meter_records = dr.ReadRecords('METER_DATA')
print('First Meter Record = ')
print(meter_records[0])
print('Last Meter Record =')
print(meter_records[-1])
insertion_records = dr.ReadRecords('INSERTION_TIME')
p... | true | true |
f721d8be22e254b94549fbcd3026017e54e07cae | 444 | py | Python | microkg/releaser.py | goude/microkg | 2d4007bc2dcd6e240b6ba84991189ff66ff80969 | [
"MIT"
] | null | null | null | microkg/releaser.py | goude/microkg | 2d4007bc2dcd6e240b6ba84991189ff66ff80969 | [
"MIT"
] | 1 | 2021-06-02T00:43:28.000Z | 2021-06-02T00:43:28.000Z | microkg/releaser.py | goude/microkg | 2d4007bc2dcd6e240b6ba84991189ff66ff80969 | [
"MIT"
] | null | null | null | from pathlib import Path
def release(data: dict, outfile: Path) -> None:
with open(outfile, "w") as fh:
fls = [dd["flags"] for dd in data["data"]]
fh.write("|".join(fls))
def main() -> None:
from . import parser
infile = Path("sources/rout.txt")
outfile = Path("releases/latest/windo... | 21.142857 | 50 | 0.617117 | from pathlib import Path
def release(data: dict, outfile: Path) -> None:
with open(outfile, "w") as fh:
fls = [dd["flags"] for dd in data["data"]]
fh.write("|".join(fls))
def main() -> None:
from . import parser
infile = Path("sources/rout.txt")
outfile = Path("releases/latest/windo... | true | true |
f721d928941c5327cd287c478c3dc6357184dfb5 | 528 | py | Python | 278. First Bad Version.py | patrick-luo/Leet-Code | 989ec20c1069ce93e1d0e9ae4a4dfc59b1b1622a | [
"MIT"
] | null | null | null | 278. First Bad Version.py | patrick-luo/Leet-Code | 989ec20c1069ce93e1d0e9ae4a4dfc59b1b1622a | [
"MIT"
] | null | null | null | 278. First Bad Version.py | patrick-luo/Leet-Code | 989ec20c1069ce93e1d0e9ae4a4dfc59b1b1622a | [
"MIT"
] | null | null | null | # The isBadVersion API is already defined for you.
# @param version, an integer
# @return a bool
# def isBadVersion(version):
class Solution(object):
def firstBadVersion(self, n):
"""
:type n: int
:rtype: int
"""
low, high = 1, n
while True:
if isBadVersi... | 24 | 50 | 0.482955 |
class Solution(object):
def firstBadVersion(self, n):
low, high = 1, n
while True:
if isBadVersion(low):
return low
mid = low + (high-low)/2
isBad = isBadVersion(mid)
if isBad:
high = mid
else:
... | true | true |
f721d9b1288c7cad5f15bfa3c14c94e43bf2cc77 | 3,624 | py | Python | benchmarks/f3_wrong_hints/scaling_software_termination/2-2Nested_false-termination_21.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints/scaling_software_termination/2-2Nested_false-termination_21.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints/scaling_software_termination/2-2Nested_false-termination_21.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 28.761905 | 77 | 0.561258 | from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | true | true |
f721db3583a7683724f3bd4358f1cd3bd9a389f6 | 236 | py | Python | Python/Ex029.py | renato-rt/Python | ba033094e1da5b55cf9ce4c8a5cf2cd90247db36 | [
"MIT"
] | null | null | null | Python/Ex029.py | renato-rt/Python | ba033094e1da5b55cf9ce4c8a5cf2cd90247db36 | [
"MIT"
] | null | null | null | Python/Ex029.py | renato-rt/Python | ba033094e1da5b55cf9ce4c8a5cf2cd90247db36 | [
"MIT"
] | 1 | 2021-11-30T17:34:33.000Z | 2021-11-30T17:34:33.000Z | v = int(input('\033[4;33;42mDigite a velocidade do carro: \033[m'))
lim = 80
m = 7
km = (v-lim)
if v > lim:
print('\033[1;30;41mVocê será multado em R${:.2f}.\033[m'.format(km*m))
else:
print('Parabéns você dirige com atenção!') | 29.5 | 75 | 0.631356 | v = int(input('\033[4;33;42mDigite a velocidade do carro: \033[m'))
lim = 80
m = 7
km = (v-lim)
if v > lim:
print('\033[1;30;41mVocê será multado em R${:.2f}.\033[m'.format(km*m))
else:
print('Parabéns você dirige com atenção!') | true | true |
f721db77d83f00f40283fd23d4e3b37bc36d2b31 | 3,524 | py | Python | kiddytimer/src/KTglob.py | TwolDE2/enigma2-plugins | 06685a5ce6a65a8724d3b32c8f7906714650ca2c | [
"OLDAP-2.3"
] | 30 | 2015-05-08T22:10:00.000Z | 2022-03-13T22:09:31.000Z | kiddytimer/src/KTglob.py | TwolDE2/enigma2-plugins | 06685a5ce6a65a8724d3b32c8f7906714650ca2c | [
"OLDAP-2.3"
] | 124 | 2015-04-27T21:30:48.000Z | 2022-03-29T10:21:39.000Z | kiddytimer/src/KTglob.py | TwolDE2/enigma2-plugins | 06685a5ce6a65a8724d3b32c8f7906714650ca2c | [
"OLDAP-2.3"
] | 193 | 2015-01-10T09:21:26.000Z | 2022-03-21T08:19:33.000Z | from __future__ import absolute_import
from .__init__ import _
from Components.config import config
import time
PLUGIN_BASE = "KiddyTimer"
PLUGIN_VERSION = "1.3"
DAYNAMES = (_("Sunday"),
_("Monday"),
_("Tuesday"),
_("Wednesday"),
_("Thursday"),
_("Friday"),
... | 50.342857 | 539 | 0.628547 | from __future__ import absolute_import
from .__init__ import _
from Components.config import config
import time
PLUGIN_BASE = "KiddyTimer"
PLUGIN_VERSION = "1.3"
DAYNAMES = (_("Sunday"),
_("Monday"),
_("Tuesday"),
_("Wednesday"),
_("Thursday"),
_("Friday"),
... | true | true |
f721dc0f7b2a6690beba2a884bde66614f03a8de | 83,659 | py | Python | Tax-Calculator-3.0.0/taxcalc/calcfunctions.py | grantseiter/Biden-Tax-Proposals | c215ff845264f3fce9281c7fbb343ed10758a4b6 | [
"MIT"
] | null | null | null | Tax-Calculator-3.0.0/taxcalc/calcfunctions.py | grantseiter/Biden-Tax-Proposals | c215ff845264f3fce9281c7fbb343ed10758a4b6 | [
"MIT"
] | null | null | null | Tax-Calculator-3.0.0/taxcalc/calcfunctions.py | grantseiter/Biden-Tax-Proposals | c215ff845264f3fce9281c7fbb343ed10758a4b6 | [
"MIT"
] | null | null | null | """
Tax-Calculator functions that calculate payroll and individual income taxes.
These functions are imported into the Calculator class.
Note: the parameter_indexing_CPI_offset policy parameter is the only
policy parameter that does not appear here; it is used in the policy.py
file to possibly adjust the price inflat... | 39.276526 | 124 | 0.632843 |
import math
import copy
import numpy as np
from taxcalc.decorators import iterate_jit, JIT
def BenefitPrograms(calc):
zero = np.zeros(calc.array_len)
if calc.policy_param('BEN_housing_repeal'):
calc.array('housing_ben', zero)
if calc.policy_param('BEN_ssi_repeal'):
calc.array... | true | true |
f721ddd3d8923aa8e66f4d2cdeb1b7bb82dc9246 | 1,791 | py | Python | volttrontesting/services/test_pubsub_service.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | 406 | 2015-01-20T03:08:53.000Z | 2022-03-31T20:59:07.000Z | volttrontesting/services/test_pubsub_service.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | 2,031 | 2015-01-05T21:35:45.000Z | 2022-03-29T21:44:36.000Z | volttrontesting/services/test_pubsub_service.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | 219 | 2015-01-20T14:53:57.000Z | 2022-03-06T00:37:41.000Z | from volttron.platform.vip.pubsubservice import PubSubService, ProtectedPubSubTopics
from mock import Mock, MagicMock
import pytest
@pytest.fixture(params=[
dict(has_external_routing=True),
dict(has_external_routing=False)
])
def pubsub_service(request):
moc... | 31.982143 | 119 | 0.713009 | from volttron.platform.vip.pubsubservice import PubSubService, ProtectedPubSubTopics
from mock import Mock, MagicMock
import pytest
@pytest.fixture(params=[
dict(has_external_routing=True),
dict(has_external_routing=False)
])
def pubsub_service(request):
moc... | true | true |
f721de426c7c8a45eb5801626a616f226aca0644 | 108,032 | py | Python | dante/vendor/pkg_resources/__init__.py | sbg/dante | 104543c3ccb5e762d3e9cd6e8fa04c5fa91e2227 | [
"Apache-2.0"
] | 9 | 2017-11-03T15:53:01.000Z | 2019-10-01T14:09:56.000Z | dante/vendor/pkg_resources/__init__.py | sbg/dante | 104543c3ccb5e762d3e9cd6e8fa04c5fa91e2227 | [
"Apache-2.0"
] | 4 | 2019-10-01T12:53:58.000Z | 2021-04-26T15:39:16.000Z | dante/vendor/pkg_resources/__init__.py | sbg/dante | 104543c3ccb5e762d3e9cd6e8fa04c5fa91e2227 | [
"Apache-2.0"
] | 5 | 2017-11-03T15:50:40.000Z | 2021-09-13T08:50:45.000Z | # coding: utf-8
"""
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path opera... | 32.866444 | 92 | 0.620177 |
from __future__ import absolute_import
import sys
import os
import io
import time
import re
import types
import zipfile
import zipimport
import warnings
import stat
import functools
import pkgutil
import operator
import platform
import collections
import plistlib
import email.parser
import errno
import tempfile
impo... | true | true |
f721df51ffd92a86fa4f5ed499e8968701513d30 | 3,931 | py | Python | food_ke/scripts/candidate_edges.py | IBPA/FoodAtlas | 0a431f0a391adaa8984b380f3f6f7189f27b9311 | [
"Apache-2.0"
] | 1 | 2022-02-07T10:04:35.000Z | 2022-02-07T10:04:35.000Z | food_ke/scripts/candidate_edges.py | IBPA/FoodAtlas | 0a431f0a391adaa8984b380f3f6f7189f27b9311 | [
"Apache-2.0"
] | null | null | null | food_ke/scripts/candidate_edges.py | IBPA/FoodAtlas | 0a431f0a391adaa8984b380f3f6f7189f27b9311 | [
"Apache-2.0"
] | null | null | null | import uuid
from collections import defaultdict
from itertools import combinations
from typing import Any, Dict, List, Tuple
from dagster import OutputDefinition, pipeline, solid
from tinydb import Query
from food_ke.labelstudio import (
LSAnnotationResult,
LSAnnotationValue,
LSPreAnnotation,
LSPredic... | 31.198413 | 79 | 0.682524 | import uuid
from collections import defaultdict
from itertools import combinations
from typing import Any, Dict, List, Tuple
from dagster import OutputDefinition, pipeline, solid
from tinydb import Query
from food_ke.labelstudio import (
LSAnnotationResult,
LSAnnotationValue,
LSPreAnnotation,
LSPredic... | true | true |
f721df7c81e5b22b791a270c424bdef9a82993ec | 4,110 | py | Python | sdk/python/pulumi_azure_native/resources/v20201001/get_deployment_at_scope.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/resources/v20201001/get_deployment_at_scope.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/resources/v20201001/get_deployment_at_scope.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 31.136364 | 151 | 0.625061 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'GetDeploymentAtScopeResult',
'AwaitableGetDeploymentAtScopeResult',
'get_deployment_at_scope',
]
@pulumi.output_type
cl... | true | true |
f721e066c1aa8136fae4963f5e9d06ec258240a4 | 9,368 | py | Python | bin.src/generate_lensed_hosts_agn.py | mpwiesner/sims_GCRCatSimInterface | 831e78ec8eb610983768d4657fbff9744cb17249 | [
"BSD-3-Clause"
] | null | null | null | bin.src/generate_lensed_hosts_agn.py | mpwiesner/sims_GCRCatSimInterface | 831e78ec8eb610983768d4657fbff9744cb17249 | [
"BSD-3-Clause"
] | null | null | null | bin.src/generate_lensed_hosts_agn.py | mpwiesner/sims_GCRCatSimInterface | 831e78ec8eb610983768d4657fbff9744cb17249 | [
"BSD-3-Clause"
] | 2 | 2018-04-12T20:49:23.000Z | 2018-08-04T00:08:46.000Z | import numpy as np
import os
import argparse
import pylab as pl
import subprocess as sp
import astropy.io.fits as pyfits
import pandas as pd
import scipy.special as ss
import om10_lensing_equations as ole
data_dir = os.path.join(os.environ['SIMS_GCRCATSIMINTERFACE_DIR'], 'data')
twinkles_data_dir = os.path.... | 41.635556 | 129 | 0.516652 | import numpy as np
import os
import argparse
import pylab as pl
import subprocess as sp
import astropy.io.fits as pyfits
import pandas as pd
import scipy.special as ss
import om10_lensing_equations as ole
data_dir = os.path.join(os.environ['SIMS_GCRCATSIMINTERFACE_DIR'], 'data')
twinkles_data_dir = os.path.... | true | true |
f721e2171bf6d9f9e10e140e276f0503a8e3e20a | 3,112 | py | Python | spectramanipulator/dialogs/rename_dialog.py | dmadea/Spectra-Manipulator | ddc1b27cb4f4691096dfa7b2975df350d2eaf40e | [
"MIT"
] | 1 | 2020-07-18T17:46:01.000Z | 2020-07-18T17:46:01.000Z | spectramanipulator/dialogs/rename_dialog.py | dmadea/Spectra-Manipulator | ddc1b27cb4f4691096dfa7b2975df350d2eaf40e | [
"MIT"
] | null | null | null | spectramanipulator/dialogs/rename_dialog.py | dmadea/Spectra-Manipulator | ddc1b27cb4f4691096dfa7b2975df350d2eaf40e | [
"MIT"
] | null | null | null |
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
from .gui_rename_dialog import Ui_Dialog
class RenameDialog(QtWidgets.QDialog, Ui_Dialog):
# static variables
is_opened = False
_instance = None
int32_max = 2147483647
def __init__(self, expression='', offset=0, c_mult_facotr=1,
... | 30.811881 | 142 | 0.673843 |
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
from .gui_rename_dialog import Ui_Dialog
class RenameDialog(QtWidgets.QDialog, Ui_Dialog):
is_opened = False
_instance = None
int32_max = 2147483647
def __init__(self, expression='', offset=0, c_mult_facotr=1,
last_rena... | true | true |
f721e218fc789c3f8ef3a8e08522e4afa077fe67 | 3,728 | py | Python | Algorithm/BOJ/19238스타트택시.py | Nyapy/FMTG | dcf0a35dbbcd50d5bc861b04ac0db41d27e57b6e | [
"MIT"
] | null | null | null | Algorithm/BOJ/19238스타트택시.py | Nyapy/FMTG | dcf0a35dbbcd50d5bc861b04ac0db41d27e57b6e | [
"MIT"
] | null | null | null | Algorithm/BOJ/19238스타트택시.py | Nyapy/FMTG | dcf0a35dbbcd50d5bc861b04ac0db41d27e57b6e | [
"MIT"
] | null | null | null | import sys
sys.stdin = open("19238.txt")
from collections import deque
N,M,oil = map(int, input().split())
jido = [0]+[[0]+list(map(int, input().split())) for _ in range(N)]
tay, tax = map(int, input().split())
cst = [list(map(int, input().split())) for _ in range(M)]
dx = [0, -1,1,0]
dy = [-1, 0,0,1]
for i in r... | 30.809917 | 80 | 0.333691 | import sys
sys.stdin = open("19238.txt")
from collections import deque
N,M,oil = map(int, input().split())
jido = [0]+[[0]+list(map(int, input().split())) for _ in range(N)]
tay, tax = map(int, input().split())
cst = [list(map(int, input().split())) for _ in range(M)]
dx = [0, -1,1,0]
dy = [-1, 0,0,1]
for i in r... | true | true |
f721e6187906d39f9020e1cf5b0b2268c9f06476 | 1,986 | py | Python | verification/HMM/rtcf-h-table.py | thomasgibson/tabula-rasa | 85abf26d6604b5a9a4d356f07aeb90d5b6453f33 | [
"MIT"
] | 3 | 2018-08-24T02:11:46.000Z | 2021-06-15T12:53:36.000Z | verification/HMM/rtcf-h-table.py | thomasgibson/tabula-rasa | 85abf26d6604b5a9a4d356f07aeb90d5b6453f33 | [
"MIT"
] | null | null | null | verification/HMM/rtcf-h-table.py | thomasgibson/tabula-rasa | 85abf26d6604b5a9a4d356f07aeb90d5b6453f33 | [
"MIT"
] | 1 | 2019-08-21T15:02:21.000Z | 2019-08-21T15:02:21.000Z | import os
import sys
import pandas as pd
data_set = ["results/H-RTCF-degree-0.csv",
"results/H-RTCF-degree-1.csv",
"results/H-RTCF-degree-2.csv",
"results/H-RTCF-degree-3.csv"]
for data in data_set:
if not os.path.exists(data):
print("Cannot find data file '%s'" % data... | 31.52381 | 139 | 0.543303 | import os
import sys
import pandas as pd
data_set = ["results/H-RTCF-degree-0.csv",
"results/H-RTCF-degree-1.csv",
"results/H-RTCF-degree-2.csv",
"results/H-RTCF-degree-3.csv"]
for data in data_set:
if not os.path.exists(data):
print("Cannot find data file '%s'" % data... | true | true |
f721e6da40641349c02a4345af82f81e8183b4e8 | 5,620 | py | Python | docs/conf.py | husio/weave | 7c46c7dee60614c3812c9e29796f62687085b933 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | husio/weave | 7c46c7dee60614c3812c9e29796f62687085b933 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | husio/weave | 7c46c7dee60614c3812c9e29796f62687085b933 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | 29.424084 | 79 | 0.645018 |
def setup(app):
app.add_stylesheet('css/custom.css')
project = u'Weave'
copyright = u'2018 - 2019, IOV SAS'
author = u'Ethan Frey'
version = u'0.2'
release = u'0.2.1'
extensions = [
'sphinx.ext.todo',
'sphinx.ext.imgmath',
]
templates_path = ['_templates']
source_s... | true | true |
f721e85640e494bdebc1fb808b9ad090fa4b3d72 | 4,750 | py | Python | src/sentry/integrations/bitbucket/issues.py | xzkostyan/sentry | 21476700defcf0dddeadeec8471d3454cef6faa7 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/integrations/bitbucket/issues.py | xzkostyan/sentry | 21476700defcf0dddeadeec8471d3454cef6faa7 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/integrations/bitbucket/issues.py | xzkostyan/sentry | 21476700defcf0dddeadeec8471d3454cef6faa7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.integrations.issues import IssueBasicMixin
from sentry.integrations.exceptions import ApiError, IntegrationFormError
ISSUE_TYPES = (
('bug', 'Bug'), ('enhancement', 'Enhancement'), ('proposal', 'Proposal'), ('task', 'T... | 32.534247 | 97 | 0.521053 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.integrations.issues import IssueBasicMixin
from sentry.integrations.exceptions import ApiError, IntegrationFormError
ISSUE_TYPES = (
('bug', 'Bug'), ('enhancement', 'Enhancement'), ('proposal', 'Proposal'), ('task', 'T... | true | true |
f721e86e8c416b8778de1f5a4d429e740eea897d | 2,427 | py | Python | conftest.py | viaviare/PyRepository | 6520d558a76dab5bd36cf321c0a68298ff048f7a | [
"Apache-2.0"
] | null | null | null | conftest.py | viaviare/PyRepository | 6520d558a76dab5bd36cf321c0a68298ff048f7a | [
"Apache-2.0"
] | null | null | null | conftest.py | viaviare/PyRepository | 6520d558a76dab5bd36cf321c0a68298ff048f7a | [
"Apache-2.0"
] | null | null | null | import pytest
import json
import jsonpickle
import os.path
import importlib
from fixture.application import Application
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__fi... | 29.597561 | 145 | 0.694685 | import pytest
import json
import jsonpickle
import os.path
import importlib
from fixture.application import Application
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__fi... | true | true |
f721e98693635493da8f166ed44f9befba0e31b8 | 4,170 | py | Python | benchmark/startQiskit2925.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit2925.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit2925.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=42
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_... | 34.46281 | 140 | 0.64964 |
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_xor(s: str, t: str) -> str:
l... | true | true |
f721eada49d0d24dce621475587d2b8e069721ef | 23,626 | py | Python | ocs_ci/ocs/ui/acm_ui.py | MeridianExplorer/ocs-ci | a33d5116128b88f176f5eff68a3ef805125cdba1 | [
"MIT"
] | null | null | null | ocs_ci/ocs/ui/acm_ui.py | MeridianExplorer/ocs-ci | a33d5116128b88f176f5eff68a3ef805125cdba1 | [
"MIT"
] | null | null | null | ocs_ci/ocs/ui/acm_ui.py | MeridianExplorer/ocs-ci | a33d5116128b88f176f5eff68a3ef805125cdba1 | [
"MIT"
] | null | null | null | import os
import logging
import time
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.keys import Keys
from ocs_ci.ocs import constants
from ocs_ci.ocs.exceptions import ACMClusterDeployException
from ocs_ci.ocs.ui.base_ui import BaseUI
... | 37.561208 | 96 | 0.635698 | import os
import logging
import time
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.keys import Keys
from ocs_ci.ocs import constants
from ocs_ci.ocs.exceptions import ACMClusterDeployException
from ocs_ci.ocs.ui.base_ui import BaseUI
... | true | true |
f721ec4d816bbef5bb4d08a3d8d876e428dfc432 | 990 | py | Python | python/phonenumbers/shortdata/region_KG.py | ILMServices/python-phonenumbers | 317b0b128162b031e156b9de69ade9a5c8cf4844 | [
"Apache-2.0"
] | 1 | 2015-01-31T01:17:14.000Z | 2015-01-31T01:17:14.000Z | python/phonenumbers/shortdata/region_KG.py | ILMServices/python-phonenumbers | 317b0b128162b031e156b9de69ade9a5c8cf4844 | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/shortdata/region_KG.py | ILMServices/python-phonenumbers | 317b0b128162b031e156b9de69ade9a5c8cf4844 | [
"Apache-2.0"
] | null | null | null | """Auto-generated file, do not edit by hand. KG metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_KG = PhoneMetadata(id='KG', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[14]\\d{2,3}', possible_number_pattern=... | 76.153846 | 129 | 0.787879 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_KG = PhoneMetadata(id='KG', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[14]\\d{2,3}', possible_number_pattern='\\d{3,4}'),
toll_free=PhoneNumberDesc(national_number_p... | true | true |
f721ec59857ef6e3afbbf06a165c7b74088bc96e | 398 | py | Python | app/model/mail_agent.py | dwdraugr/YADS | c8036d8196a3158636aaa4f1910033e70ec8ecb4 | [
"Apache-2.0"
] | 3 | 2019-09-02T11:26:58.000Z | 2019-12-06T15:54:38.000Z | app/model/mail_agent.py | dwdraugr/YADS | c8036d8196a3158636aaa4f1910033e70ec8ecb4 | [
"Apache-2.0"
] | null | null | null | app/model/mail_agent.py | dwdraugr/YADS | c8036d8196a3158636aaa4f1910033e70ec8ecb4 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
from flask_mail import Message, Mail
from app.lazy import lazy_async
class MailAgent:
def __init__(self, app: Flask):
self.mail = Mail(app)
self.app = app
@lazy_async
def _async_mail(self, msg: Message):
with self.app.app_context():
self.mail.se... | 22.111111 | 40 | 0.650754 | from flask import Flask
from flask_mail import Message, Mail
from app.lazy import lazy_async
class MailAgent:
def __init__(self, app: Flask):
self.mail = Mail(app)
self.app = app
@lazy_async
def _async_mail(self, msg: Message):
with self.app.app_context():
self.mail.se... | true | true |
f721ec6e3ba1bb95049502e8c6e9d52d6173e217 | 1,059 | py | Python | data_ai/comp3035/finews/spiders/news_spider.py | lonelyhentai/workspace | 2a996af58d6b9be5d608ed040267398bcf72403b | [
"MIT"
] | 2 | 2021-04-26T16:37:38.000Z | 2022-03-15T01:26:19.000Z | data_ai/comp3035/finews/spiders/news_spider.py | lonelyhentai/workspace | 2a996af58d6b9be5d608ed040267398bcf72403b | [
"MIT"
] | null | null | null | data_ai/comp3035/finews/spiders/news_spider.py | lonelyhentai/workspace | 2a996af58d6b9be5d608ed040267398bcf72403b | [
"MIT"
] | 1 | 2022-03-15T01:26:23.000Z | 2022-03-15T01:26:23.000Z | import scrapy
from os import path
INDEX_PATH = './resources/index'
RECORD_PATH = './resources/record'
class NewsSpider(scrapy.Spider):
name = "index"
start_urls = ['http://fund.10jqka.com.cn/smxw_list/index_1.shtml']
def parse_record(self, response):
filename: str = response.url.split('/')[-1]
... | 36.517241 | 81 | 0.624174 | import scrapy
from os import path
INDEX_PATH = './resources/index'
RECORD_PATH = './resources/record'
class NewsSpider(scrapy.Spider):
name = "index"
start_urls = ['http://fund.10jqka.com.cn/smxw_list/index_1.shtml']
def parse_record(self, response):
filename: str = response.url.split('/')[-1]
... | true | true |
f721ec7ee08947d5e5c3b440d62ccc09e6d6cbce | 105,565 | py | Python | addon/pycThermopack/pyctp/thermo.py | morteham/thermopack | 67deaf74a2ae974e880be25026738cc32e3a6c1e | [
"MIT"
] | 28 | 2020-10-14T07:51:21.000Z | 2022-03-21T04:59:23.000Z | addon/pycThermopack/pyctp/thermo.py | morteham/thermopack | 67deaf74a2ae974e880be25026738cc32e3a6c1e | [
"MIT"
] | 20 | 2020-10-26T11:43:43.000Z | 2022-03-30T22:06:30.000Z | addon/pycThermopack/pyctp/thermo.py | morteham/thermopack | 67deaf74a2ae974e880be25026738cc32e3a6c1e | [
"MIT"
] | 13 | 2020-10-27T13:04:19.000Z | 2022-03-21T04:59:24.000Z | # Support for python2
from __future__ import print_function
import sys
from ctypes import *
from os import path
import numpy as np
from . import plotutils, utils, platform_specifics
if utils.gcc_major_version_greater_than(7):
c_len_type = c_size_t # c_size_t on GCC > 7
else:
c_len_type = c_int
class thermop... | 39.389925 | 182 | 0.491498 |
from __future__ import print_function
import sys
from ctypes import *
from os import path
import numpy as np
from . import plotutils, utils, platform_specifics
if utils.gcc_major_version_greater_than(7):
c_len_type = c_size_t
else:
c_len_type = c_int
class thermopack(object):
def __init__(self):
... | true | true |
f721ecf13fb9e94a63ae23e4f9196bc551a982b6 | 2,161 | py | Python | matterhook/incoming.py | bobtiki/DripBot | f0335811cbb42744989c48f056a93d86b2a1564f | [
"MIT"
] | null | null | null | matterhook/incoming.py | bobtiki/DripBot | f0335811cbb42744989c48f056a93d86b2a1564f | [
"MIT"
] | null | null | null | matterhook/incoming.py | bobtiki/DripBot | f0335811cbb42744989c48f056a93d86b2a1564f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Modified to ignore SSL verification, since I can't currently
# get it to accept proper SSL connections from the Omni CA
import os
import requests
import urllib3
# Silence the SubjectAltNameWarning that our self-signed CA gives
urllib3.disable_warnings(urllib3.exceptio... | 28.813333 | 93 | 0.613605 |
# get it to accept proper SSL connections from the Omni CA
import os
import requests
import urllib3
# Silence the SubjectAltNameWarning that our self-signed CA gives
urllib3.disable_warnings(urllib3.exceptions.SubjectAltNameWarning)
__all__ = ['Webhook']
class InvalidPayload(Exception):
pass
class HTTPEr... | true | true |
f721ed4bfdccbf6ff15d5c7d23d84ae97fcf886d | 3,214 | py | Python | expanded_checklist/checklist/tests/abstract_tests/classification_test.py | amazon-research/generalized-fairness-metrics | 69f4bb0a665b7d4d8f3967a5aa04e3a93d526d3c | [
"Apache-2.0"
] | 3 | 2021-10-30T12:34:32.000Z | 2022-02-24T10:27:23.000Z | expanded_checklist/checklist/tests/abstract_tests/classification_test.py | amazon-research/generalized-fairness-metrics | 69f4bb0a665b7d4d8f3967a5aa04e3a93d526d3c | [
"Apache-2.0"
] | 8 | 2021-08-18T19:13:53.000Z | 2022-02-02T16:06:08.000Z | expanded_checklist/checklist/tests/abstract_tests/classification_test.py | amazon-research/generalized-fairness-metrics | 69f4bb0a665b7d4d8f3967a5aa04e3a93d526d3c | [
"Apache-2.0"
] | 4 | 2021-08-13T15:28:28.000Z | 2022-03-29T05:25:00.000Z | from abc import abstractmethod
from typing import Any, Dict
import pandas as pd
from .metric_test import MetricTest
from overrides import overrides
from munch import Munch
from expanded_checklist.checklist.utils import \
DataShape, is_2d_list, ACCUMULATED_STR
pd.options.display.float_format = "{:,.2f}".format
cla... | 33.479167 | 79 | 0.57654 | from abc import abstractmethod
from typing import Any, Dict
import pandas as pd
from .metric_test import MetricTest
from overrides import overrides
from munch import Munch
from expanded_checklist.checklist.utils import \
DataShape, is_2d_list, ACCUMULATED_STR
pd.options.display.float_format = "{:,.2f}".format
cla... | true | true |
f721eead0cd1072ec828af4f83a7a3286c86ec53 | 2,631 | py | Python | tests/bm_interpolate_face_attributes.py | shubham-goel/pytorch3d | e5e6e90af6f81b3eccb35bbdfdc7e64ec6a4df21 | [
"BSD-3-Clause"
] | 6 | 2021-02-09T05:58:53.000Z | 2021-11-01T03:28:40.000Z | tests/bm_interpolate_face_attributes.py | shubham-goel/pytorch3d | e5e6e90af6f81b3eccb35bbdfdc7e64ec6a4df21 | [
"BSD-3-Clause"
] | null | null | null | tests/bm_interpolate_face_attributes.py | shubham-goel/pytorch3d | e5e6e90af6f81b3eccb35bbdfdc7e64ec6a4df21 | [
"BSD-3-Clause"
] | 2 | 2021-03-12T07:00:39.000Z | 2021-04-12T09:47:36.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
from itertools import product
import torch
from fvcore.common.benchmark import benchmark
from pytorch3d.ops.interp_face_attrs import (
interpolate_face_attributes,
interpolate_face_attributes_python,
)
def _generate_data(N, S, K, F, D, ... | 32.481481 | 84 | 0.662866 |
from itertools import product
import torch
from fvcore.common.benchmark import benchmark
from pytorch3d.ops.interp_face_attrs import (
interpolate_face_attributes,
interpolate_face_attributes_python,
)
def _generate_data(N, S, K, F, D, device, requires_grad=False):
pix_to_face = torch.randint(-10, F, (... | true | true |
f721eefbaefb6fb86fcd8f4b856fa798ccad73fe | 628 | py | Python | packt-social-media-mining/Chap02-03/twitter_hashtag_frequency.py | bitwhys/mining-social-web | 8d84c85a415d63bd53b8eb441a4258dc914f4d9f | [
"BSD-2-Clause"
] | null | null | null | packt-social-media-mining/Chap02-03/twitter_hashtag_frequency.py | bitwhys/mining-social-web | 8d84c85a415d63bd53b8eb441a4258dc914f4d9f | [
"BSD-2-Clause"
] | 7 | 2020-03-24T18:01:12.000Z | 2021-06-08T20:47:00.000Z | packt-social-media-mining/Chap02-03/twitter_hashtag_frequency.py | bitwhys/mining-social-web | 8d84c85a415d63bd53b8eb441a4258dc914f4d9f | [
"BSD-2-Clause"
] | null | null | null | # Chap02/twitter_hashtag_frequency.py
import sys
from collections import Counter
import json
def get_hashtags(tweet):
entities = tweet.get('entities', {})
hashtags = entities.get('hashtags', [])
return [tag['text'].lower() for tag in hashtags]
if __name__ == '__main__':
fname = sys.argv[1]
with op... | 29.904762 | 52 | 0.627389 |
import sys
from collections import Counter
import json
def get_hashtags(tweet):
entities = tweet.get('entities', {})
hashtags = entities.get('hashtags', [])
return [tag['text'].lower() for tag in hashtags]
if __name__ == '__main__':
fname = sys.argv[1]
with open(fname, 'r') as f:
hashtags... | true | true |
f721f0cb4d5df5a0d5895eb9316317e2aedfce7f | 1,750 | py | Python | apps/mail/tasks.py | magocod/djheavy | a7291edb6d2b406af73737c254be3bc3a66e44ae | [
"MIT"
] | 2 | 2020-02-24T00:29:21.000Z | 2021-01-13T02:41:01.000Z | apps/mail/tasks.py | magocod/djheavy | a7291edb6d2b406af73737c254be3bc3a66e44ae | [
"MIT"
] | 6 | 2020-10-08T15:16:34.000Z | 2021-09-22T18:37:58.000Z | apps/mail/tasks.py | magocod/djheavy | a7291edb6d2b406af73737c254be3bc3a66e44ae | [
"MIT"
] | 1 | 2020-08-05T10:12:41.000Z | 2020-08-05T10:12:41.000Z | from __future__ import absolute_import, unicode_literals
# from time import sleep
import binascii
import os
from celery import shared_task
from django.conf import settings
# Django
from django.core.cache import cache
from django.core.mail import send_mail
from django.template.loader import render_to_string
# local... | 22.435897 | 70 | 0.667429 | from __future__ import absolute_import, unicode_literals
import binascii
import os
from celery import shared_task
from django.conf import settings
from django.core.cache import cache
from django.core.mail import send_mail
from django.template.loader import render_to_string
from apps.mail.models import Mail
... | true | true |
f721f1c921e737b25562b868ababcc6997318950 | 5,161 | py | Python | wagtail_daterange/filter.py | michael-yin/wagtail-daterange | c56aba056b179cb46bfd70acf0dee9f65cc214c7 | [
"MIT"
] | 1 | 2022-03-18T09:15:01.000Z | 2022-03-18T09:15:01.000Z | wagtail_daterange/filter.py | ivanguy/wagtail-daterange | e7d07f62271f81f3a79733938f8d5dd78aa83959 | [
"MIT"
] | null | null | null | wagtail_daterange/filter.py | ivanguy/wagtail-daterange | e7d07f62271f81f3a79733938f8d5dd78aa83959 | [
"MIT"
] | 2 | 2018-07-26T23:39:57.000Z | 2020-05-20T12:24:46.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import django
try:
import pytz
except ImportError:
pytz = None
from collections import OrderedDict
from django import forms
from django.conf import settings
from django.contrib import admin
from django.utils import timezone
fro... | 33.083333 | 101 | 0.602596 |
from __future__ import unicode_literals
import datetime
import django
try:
import pytz
except ImportError:
pytz = None
from collections import OrderedDict
from django import forms
from django.conf import settings
from django.contrib import admin
from django.utils import timezone
from django.template.defau... | true | true |
f721f2d846051c7aa457b3b1b26f7643c7d67fa0 | 9,344 | py | Python | third_party/Paste/paste/urlmap.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | third_party/Paste/paste/urlmap.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 4,640 | 2015-07-08T16:19:08.000Z | 2019-12-02T15:01:27.000Z | third_party/Paste/paste/urlmap.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 698 | 2015-06-02T19:18:35.000Z | 2022-03-29T16:57:15.000Z | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Map URL prefixes to WSGI applications. See ``URLMap``
"""
import re
import os
import cgi
try:
# Python 3
from collections import MutableM... | 35.393939 | 84 | 0.585402 |
import re
import os
import cgi
try:
from collections import MutableMapping as DictMixin
except ImportError:
from UserDict import DictMixin
from paste import httpexceptions
__all__ = ['URLMap', 'PathProxyURLMap']
def urlmap_factory(loader, global_conf, **local_conf):
if 'not_found_app' in loc... | true | true |
f721f3ddf13fab1c1dd77ef776c52be317cf6e44 | 1,279 | py | Python | lib/rabbitmq-dotnet-client-rabbitmq_v3_4_4/docs/pyle2-fcfcf7e/spanhandlers/attachment.py | CymaticLabs/Unity3d.Amqp | 42ca5de66fcda21ef6a4040bade99118b2ad6374 | [
"MIT"
] | 83 | 2017-03-15T12:43:25.000Z | 2022-03-31T12:38:44.000Z | lib/rabbitmq-dotnet-client-rabbitmq_v3_4_4/docs/pyle2-fcfcf7e/spanhandlers/attachment.py | CymaticLabs/Unity3d.Amqp | 42ca5de66fcda21ef6a4040bade99118b2ad6374 | [
"MIT"
] | 18 | 2017-03-20T14:12:58.000Z | 2021-07-28T09:11:55.000Z | lib/rabbitmq-dotnet-client-rabbitmq_v3_4_4/docs/pyle2-fcfcf7e/spanhandlers/attachment.py | CymaticLabs/Unity3d.Amqp | 42ca5de66fcda21ef6a4040bade99118b2ad6374 | [
"MIT"
] | 25 | 2017-04-01T01:40:02.000Z | 2022-02-20T11:08:12.000Z | import Inline
import Core
import web
info = {
"friendly_name": "Attachment",
"example_template": "pagename:attachmentname",
"summary": "Links to an attachment of this (or another, named) page.",
"details": """
<p>If invoked as [attachment some.filename], it will either embed (if
the attachment... | 26.645833 | 74 | 0.634871 | import Inline
import Core
import web
info = {
"friendly_name": "Attachment",
"example_template": "pagename:attachmentname",
"summary": "Links to an attachment of this (or another, named) page.",
"details": """
<p>If invoked as [attachment some.filename], it will either embed (if
the attachment... | true | true |
f721f56cbde628047f9a4dc62bd67e702f776cbd | 4,788 | py | Python | Thesis@3.9.1/Lib/site-packages/mypyc/primitives/list_ops.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/mypyc/primitives/list_ops.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/mypyc/primitives/list_ops.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | """List primitive ops."""
from typing import List
from mypyc.ir.ops import ERR_MAGIC, ERR_NEVER, ERR_FALSE, EmitterInterface
from mypyc.ir.rtypes import (
int_rprimitive,
short_int_rprimitive,
list_rprimitive,
object_rprimitive,
bool_rprimitive,
)
from mypyc.primitives.registry import (
name_r... | 25.604278 | 82 | 0.701337 |
from typing import List
from mypyc.ir.ops import ERR_MAGIC, ERR_NEVER, ERR_FALSE, EmitterInterface
from mypyc.ir.rtypes import (
int_rprimitive,
short_int_rprimitive,
list_rprimitive,
object_rprimitive,
bool_rprimitive,
)
from mypyc.primitives.registry import (
name_ref_op,
binary_op,
... | true | true |
f721f80c825ad0a5b4d65ff002d6c6ca07631547 | 33,858 | py | Python | tests/unit/test_notifications.py | klmitch/heyu | 9bdc552115bb22d1d01910b0b851eb3cbc3b08d1 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_notifications.py | klmitch/heyu | 9bdc552115bb22d1d01910b0b851eb3cbc3b08d1 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_notifications.py | klmitch/heyu | 9bdc552115bb22d1d01910b0b851eb3cbc3b08d1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Rackspace
# 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... | 42.3225 | 79 | 0.647528 |
import io
import signal
import sys
import unittest
import mock
from heyu import notifications
from heyu import protocol
from heyu import util
class TestException(Exception):
pass
class NotificationServerTest(unittest.TestCase):
def _signal_test(self, notifier_server, mock_signal):
s... | true | true |
f721f976f94d622fc2a6a2309a5483d8547b33ec | 4,780 | py | Python | RecoLocalCalo/HcalRecAlgos/test/test_RecHitReflagger_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | RecoLocalCalo/HcalRecAlgos/test/test_RecHitReflagger_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | RecoLocalCalo/HcalRecAlgos/test/test_RecHitReflagger_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | from __future__ import print_function
import FWCore.ParameterSet.Config as cms
maxevents=10
isMC=False
#isMC=True
process = cms.Process('TEST')
#process.load('JetMETAnalysis.PromptAnalysis.ntuple_cff')
process.load('Configuration.StandardSequences.Services_cff')
process.load('Configuration/StandardSequences/Geomet... | 40.854701 | 124 | 0.730544 | from __future__ import print_function
import FWCore.ParameterSet.Config as cms
maxevents=10
isMC=False
process = cms.Process('TEST')
process.load('Configuration.StandardSequences.Services_cff')
process.load('Configuration/StandardSequences/GeometryExtended_cff')
process.load('Configuration/StandardSequences/Reco... | true | true |
f721f9a0a04d2003639f19899e390e586887dfde | 1,478 | py | Python | tests/test_ctc1.py | madhurkashyap/boundary_detection | f7fb98c8bcbc204b1fcd0eb34a8699f16a8725a3 | [
"MIT"
] | null | null | null | tests/test_ctc1.py | madhurkashyap/boundary_detection | f7fb98c8bcbc204b1fcd0eb34a8699f16a8725a3 | [
"MIT"
] | null | null | null | tests/test_ctc1.py | madhurkashyap/boundary_detection | f7fb98c8bcbc204b1fcd0eb34a8699f16a8725a3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 26 15:15:55 2018
@author: Madhur Kashyap 2016EEZ8350
"""
import os
import sys
import logging
from keras.optimizers import Adam
prog = os.path.basename(__file__)
codedir = os.path.join(os.path.dirname(__file__),"..","code")
sys.path.append(codedir)
from ... | 29.56 | 80 | 0.654263 |
import os
import sys
import logging
from keras.optimizers import Adam
prog = os.path.basename(__file__)
codedir = os.path.join(os.path.dirname(__file__),"..","code")
sys.path.append(codedir)
from Utils import initlog
from SpeechCorpus import Timit
from AcousticModels import bidi_ctc_lstm2
from TrainUti... | true | true |
f721f9a94d7bd0380939cb8f34a40ef3e45f8ffa | 2,106 | py | Python | tensorflow_federated/python/core/impl/computation_impl_test.py | iahsanujunda/federated | 109a5653a305dc9d4bcbafc259257add4dc70365 | [
"Apache-2.0"
] | 5 | 2020-06-04T20:10:25.000Z | 2020-07-22T02:15:38.000Z | tensorflow_federated/python/core/impl/computation_impl_test.py | iahsanujunda/federated | 109a5653a305dc9d4bcbafc259257add4dc70365 | [
"Apache-2.0"
] | 7 | 2020-04-03T05:32:28.000Z | 2020-05-15T01:28:25.000Z | tensorflow_federated/python/core/impl/computation_impl_test.py | iahsanujunda/federated | 109a5653a305dc9d4bcbafc259257add4dc70365 | [
"Apache-2.0"
] | 2 | 2020-04-28T17:46:13.000Z | 2022-02-10T02:40:40.000Z | # Copyright 2018, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 39 | 82 | 0.723172 |
from absl.testing import absltest
import tensorflow as tf
from tensorflow_federated.proto.v0 import computation_pb2 as pb
from tensorflow_federated.python.core.api import computation_types
from tensorflow_federated.python.core.impl import computation_impl
from tensorflow_federated.python.core.impl.contex... | true | true |
f721fa2c57691ec9594ce9f452796ed5cddcfa12 | 2,996 | py | Python | ui/sentiment.py | minminfly68/Song-recommendation-Project-CAPP-30122- | 9f97d6accdfd33c5bac267980b6c10d6d5b93bc7 | [
"MIT"
] | null | null | null | ui/sentiment.py | minminfly68/Song-recommendation-Project-CAPP-30122- | 9f97d6accdfd33c5bac267980b6c10d6d5b93bc7 | [
"MIT"
] | 6 | 2021-03-19T03:18:44.000Z | 2021-09-22T19:00:52.000Z | ui/sentiment.py | minminfly68/Song-recommendation-Project-CAPP-30122- | 9f97d6accdfd33c5bac267980b6c10d6d5b93bc7 | [
"MIT"
] | null | null | null | '''
Conduct Sentiment Analysis
Chun Hu, Yimin Li, Tianyue Niu
'''
import os
import json
import re
import pandas as pd
import nltk
nltk.download('punkt')
nltk.download('wordnet')
nltk.download('stopwords')
from nltk import word_tokenize, sent_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemma... | 25.176471 | 83 | 0.636515 |
import os
import json
import re
import pandas as pd
import nltk
nltk.download('punkt')
nltk.download('wordnet')
nltk.download('stopwords')
from nltk import word_tokenize, sent_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from textblob import TextBlob
pd.set_option('mode.chained_... | true | true |
f721fa58cff2f8d988c4fa6e76255de74891ffd2 | 2,117 | py | Python | libs/EXTERNAL/capnproto/doc/_plugins/capnp_lexer.py | brycejh/vtr-verilog-to-routing | f61da5eb2d4e008728a01def827d55a0e9f285d0 | [
"MIT"
] | 4,518 | 2017-06-06T15:33:15.000Z | 2022-03-31T16:43:23.000Z | doc/_plugins/capnp_lexer.py | seanwallawalla-forks/capnproto | 8009588ff84cbdf233f6d23d1d507462b050b427 | [
"MIT"
] | 1,399 | 2015-07-24T22:09:09.000Z | 2022-03-29T06:22:48.000Z | doc/_plugins/capnp_lexer.py | seanwallawalla-forks/capnproto | 8009588ff84cbdf233f6d23d1d507462b050b427 | [
"MIT"
] | 492 | 2017-06-07T08:40:53.000Z | 2022-03-30T20:57:05.000Z | #! /usr/bin/env python
from pygments.lexer import RegexLexer
from pygments.token import *
class CapnpLexer(RegexLexer):
name = "Cap'n Proto lexer"
aliases = ['capnp']
filenames = ['*.capnp']
tokens = {
'root': [
(r'#.*?$', Comment.Single),
(r'@[0-9a-zA-Z]*', Name.Decor... | 32.569231 | 128 | 0.421351 |
from pygments.lexer import RegexLexer
from pygments.token import *
class CapnpLexer(RegexLexer):
name = "Cap'n Proto lexer"
aliases = ['capnp']
filenames = ['*.capnp']
tokens = {
'root': [
(r'
(r'@[0-9a-zA-Z]*', Name.Decorator),
(r'=', Literal, 'expression... | true | true |
f721fc1798358232695a6e8277cd43f94a436dc0 | 875 | gyp | Python | tools/android/memconsumer/memconsumer.gyp | domenic/mojo | 53dda76fed90a47c35ed6e06baf833a0d44495b8 | [
"BSD-3-Clause"
] | 5 | 2015-04-30T00:13:21.000Z | 2019-07-10T02:17:24.000Z | tools/android/memconsumer/memconsumer.gyp | domenic/mojo | 53dda76fed90a47c35ed6e06baf833a0d44495b8 | [
"BSD-3-Clause"
] | null | null | null | tools/android/memconsumer/memconsumer.gyp | domenic/mojo | 53dda76fed90a47c35ed6e06baf833a0d44495b8 | [
"BSD-3-Clause"
] | 5 | 2016-12-23T04:21:10.000Z | 2020-06-18T13:52:33.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'memconsumer',
'type': 'none',
'dependencies': [
'memconsumer_apk',
],
},
{
... | 21.875 | 72 | 0.512 |
{
'targets': [
{
'target_name': 'memconsumer',
'type': 'none',
'dependencies': [
'memconsumer_apk',
],
},
{
'target_name': 'memconsumer_apk',
'type': 'none',
'variables': {
'apk_name': 'MemConsumer',
'java_in_dir': 'java',
'reso... | true | true |
f721fc81e52074ea25597094fc8f790020e21816 | 803 | py | Python | ros2_sub/setup.py | ipa-rar/ros2_practice_workspace | 6329085df960eb4e2cc849c7ee527b99be11571e | [
"MIT"
] | null | null | null | ros2_sub/setup.py | ipa-rar/ros2_practice_workspace | 6329085df960eb4e2cc849c7ee527b99be11571e | [
"MIT"
] | null | null | null | ros2_sub/setup.py | ipa-rar/ros2_practice_workspace | 6329085df960eb4e2cc849c7ee527b99be11571e | [
"MIT"
] | null | null | null | import os
from glob import glob
from setuptools import setup
package_name = 'ros2_sub'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['p... | 26.766667 | 67 | 0.638854 | import os
from glob import glob
from setuptools import setup
package_name = 'ros2_sub'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['p... | true | true |
f721fd69cb07522a89aac4665560e173501eb593 | 1,527 | py | Python | tests/h/oauth/tokens_test.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | null | null | null | tests/h/oauth/tokens_test.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | null | null | null | tests/h/oauth/tokens_test.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | null | null | null | from unittest import mock
import pytest
from oauthlib.common import Request as OAuthRequest
from h.oauth.tokens import BearerToken
class TestBearerToken:
@pytest.mark.parametrize(
"attr",
[
"request_validator",
"token_generator",
"expires_in",
"ref... | 31.163265 | 87 | 0.664702 | from unittest import mock
import pytest
from oauthlib.common import Request as OAuthRequest
from h.oauth.tokens import BearerToken
class TestBearerToken:
@pytest.mark.parametrize(
"attr",
[
"request_validator",
"token_generator",
"expires_in",
"ref... | true | true |
f721ff9b0aca2610a6cdf14f769fcdcfe21e1189 | 1,242 | py | Python | Python/flask/l10n/app.py | saneravi/ML_Stuff | 74e1ed7ba9f4dccb555792315a14ba6071150304 | [
"MIT"
] | 209 | 2015-01-02T03:47:12.000Z | 2022-03-06T16:54:47.000Z | Python/flask/l10n/app.py | Kerwin-Xie/algorithms | 4347a9b7bf54ef378d16d26ef9e357ddc710664b | [
"MIT"
] | 3 | 2015-12-06T14:40:34.000Z | 2021-03-22T17:40:24.000Z | Python/flask/l10n/app.py | Kerwin-Xie/algorithms | 4347a9b7bf54ef378d16d26ef9e357ddc710664b | [
"MIT"
] | 114 | 2015-01-31T08:37:10.000Z | 2022-02-23T04:42:28.000Z | #!/usr/bin/env python
# core modules
import datetime
import flask_babel
# 3rd party modules
from flask import Flask, flash, render_template
from flask_babel import Babel, _
def format_datetime(value, format="medium"):
import flask_babel
if format == "full":
format = "EEEE, d. MMMM y 'at' HH:mm"
... | 23 | 79 | 0.663446 |
import datetime
import flask_babel
from flask import Flask, flash, render_template
from flask_babel import Babel, _
def format_datetime(value, format="medium"):
import flask_babel
if format == "full":
format = "EEEE, d. MMMM y 'at' HH:mm"
elif format == "medium":
format = "EE dd.MM.y... | true | true |
f72200339a1f28f8cc91946cd3c16de8ee514ef5 | 1,306 | py | Python | test_models/data.py | OleguerCanal/transplanter | 854fa727747a484dedde9092eeee6884d7d1b44b | [
"MIT"
] | 1 | 2022-03-23T09:27:56.000Z | 2022-03-23T09:27:56.000Z | test_models/data.py | OleguerCanal/transplanter | 854fa727747a484dedde9092eeee6884d7d1b44b | [
"MIT"
] | null | null | null | test_models/data.py | OleguerCanal/transplanter | 854fa727747a484dedde9092eeee6884d7d1b44b | [
"MIT"
] | null | null | null | from typing import Optional
import pytorch_lightning as pl
import torchvision
import torchvision.transforms as transforms
from torchvision.datasets import CIFAR10
from torch.utils.data import DataLoader, random_split
class CIFARDataModule(pl.LightningDataModule):
def __init__(self, data_dir: str = "./data", batch... | 36.277778 | 96 | 0.69219 | from typing import Optional
import pytorch_lightning as pl
import torchvision
import torchvision.transforms as transforms
from torchvision.datasets import CIFAR10
from torch.utils.data import DataLoader, random_split
class CIFARDataModule(pl.LightningDataModule):
def __init__(self, data_dir: str = "./data", batch... | true | true |
f722004f53f62148f2709542630d070ec6adc442 | 560 | py | Python | outreach/migrations/0002_auto_20161020_1929.py | atish3/mig-website | 1bcf4c0b93078cccab6b4a25c93c29a2b5efa4be | [
"Apache-2.0"
] | 4 | 2017-10-02T17:44:14.000Z | 2020-02-14T17:13:57.000Z | outreach/migrations/0002_auto_20161020_1929.py | atish3/mig-website | 1bcf4c0b93078cccab6b4a25c93c29a2b5efa4be | [
"Apache-2.0"
] | 152 | 2015-01-04T00:08:44.000Z | 2022-01-13T00:43:03.000Z | outreach/migrations/0002_auto_20161020_1929.py | atish3/mig-website | 1bcf4c0b93078cccab6b4a25c93c29a2b5efa4be | [
"Apache-2.0"
] | 4 | 2015-04-16T04:27:05.000Z | 2021-03-21T20:45:24.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-20 23:29
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('outreach', '0001_initial'),
]
operations = [
... | 25.454545 | 117 | 0.664286 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('outreach', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='outreacheventtype',
... | true | true |
f722015ee354379fc8050d0825f9ed09fdd7e7d9 | 7,523 | py | Python | chainer/functions/pooling/max_pooling_nd_kernel.py | zaltoprofen/chainer | 3b03f9afc80fd67f65d5e0395ef199e9506b6ee1 | [
"MIT"
] | 3,705 | 2017-06-01T07:36:12.000Z | 2022-03-30T10:46:15.000Z | chainer/functions/pooling/max_pooling_nd_kernel.py | zaltoprofen/chainer | 3b03f9afc80fd67f65d5e0395ef199e9506b6ee1 | [
"MIT"
] | 5,998 | 2017-06-01T06:40:17.000Z | 2022-03-08T01:42:44.000Z | chainer/functions/pooling/max_pooling_nd_kernel.py | zaltoprofen/chainer | 3b03f9afc80fd67f65d5e0395ef199e9506b6ee1 | [
"MIT"
] | 1,150 | 2017-06-02T03:39:46.000Z | 2022-03-29T02:29:32.000Z | import six
from chainer.functions.pooling import pooling_nd_kernel
from chainer.utils import conv_nd_kernel
class MaxPoolingNDKernelForward(pooling_nd_kernel.PoolingNDKernelForward):
def name(self):
# max_pool_{N}d_fwd
return 'max'
def out_params(self):
# T out, S indexes
re... | 36.342995 | 79 | 0.541938 | import six
from chainer.functions.pooling import pooling_nd_kernel
from chainer.utils import conv_nd_kernel
class MaxPoolingNDKernelForward(pooling_nd_kernel.PoolingNDKernelForward):
def name(self):
return 'max'
def out_params(self):
return ['S indexes']
def before(se... | true | true |
f72201c4e1f81e14abadd52a79cbc75cada4ea22 | 870 | py | Python | setup.py | paluh/wrestler | f00b4956765d8897322f63310b2c3e6668e6725d | [
"BSD-3-Clause"
] | null | null | null | setup.py | paluh/wrestler | f00b4956765d8897322f63310b2c3e6668e6725d | [
"BSD-3-Clause"
] | null | null | null | setup.py | paluh/wrestler | f00b4956765d8897322f63310b2c3e6668e6725d | [
"BSD-3-Clause"
] | null | null | null | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
CLASSIFIERS = [
'Development Status :: 1 - Planning',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Prog... | 24.857143 | 62 | 0.662069 | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
CLASSIFIERS = [
'Development Status :: 1 - Planning',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Prog... | true | true |
f722029155968a27b82e4ff0a96fce5c6afb335d | 1,571 | py | Python | siliconcompiler/tools/openfpgaloader/openfpgaloader.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | 1 | 2022-03-10T03:56:49.000Z | 2022-03-10T03:56:49.000Z | siliconcompiler/tools/openfpgaloader/openfpgaloader.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | null | null | null | siliconcompiler/tools/openfpgaloader/openfpgaloader.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | null | null | null | import os
import subprocess
import re
import sys
import shutil
import siliconcompiler
####################################################################
# Make Docs
####################################################################
def make_docs():
'''
The OpenFPGALoader is a universal utility for program... | 27.086207 | 68 | 0.574793 | import os
import subprocess
import re
import sys
import shutil
import siliconcompiler
| true | true |
f72203fb31e7832dd9f7c4b06f45103f15916b3e | 6,617 | py | Python | chillapi/abc.py | andrescevp/chillapi | 1c5f07600748eb65f413ad19f5e67653cce8b787 | [
"Apache-2.0"
] | 2 | 2021-05-05T10:54:34.000Z | 2021-05-05T12:45:18.000Z | chillapi/abc.py | andrescevp/chillapi | 1c5f07600748eb65f413ad19f5e67653cce8b787 | [
"Apache-2.0"
] | null | null | null | chillapi/abc.py | andrescevp/chillapi | 1c5f07600748eb65f413ad19f5e67653cce8b787 | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
from typing import List
from sqlalchemy.engine import CursorResult, Inspector
from sqlalchemy.orm.scoping import ScopedSession
from .database import _ALLOWED_DRIVERS
from .exceptions.api_manager import ColumnNotExist, ConfigError
class Repository(ABC):
""" """
def __init... | 25.847656 | 138 | 0.569291 | from abc import ABC, abstractmethod
from typing import List
from sqlalchemy.engine import CursorResult, Inspector
from sqlalchemy.orm.scoping import ScopedSession
from .database import _ALLOWED_DRIVERS
from .exceptions.api_manager import ColumnNotExist, ConfigError
class Repository(ABC):
def __init__(self, db:... | true | true |
f72206e42403c11c1c1c1130d4e236efff455e1e | 5,448 | py | Python | pandas/tests/series/test_cumulative.py | mlline00/pandas | fd7db9819b8c7dba86b2887bee33f670b2715afc | [
"BSD-3-Clause"
] | 1 | 2021-04-01T11:19:53.000Z | 2021-04-01T11:19:53.000Z | pandas/tests/series/test_cumulative.py | ivan-vasilev/pandas | 4071dde86e33434e1bee8304fa62074949f813cc | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/series/test_cumulative.py | ivan-vasilev/pandas | 4071dde86e33434e1bee8304fa62074949f813cc | [
"BSD-3-Clause"
] | null | null | null | """
Tests for Series cumulative operations.
See also
--------
tests.frame.test_cumulative
"""
from itertools import product
import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
def _check_accum_op(name, series, check_dtype=True):
func = getattr(np, name)
tm.assert_numpy_arr... | 31.859649 | 88 | 0.558554 | from itertools import product
import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
def _check_accum_op(name, series, check_dtype=True):
func = getattr(np, name)
tm.assert_numpy_array_equal(
func(series).values, func(np.array(series)), check_dtype=check_dtype,
)
... | true | true |
f7220728cd8301f75d31c36ed0264f74be8b8b0f | 187 | py | Python | month02/day03/buffer.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | 1 | 2021-02-02T02:17:37.000Z | 2021-02-02T02:17:37.000Z | month02/day03/buffer.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null | month02/day03/buffer.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null |
#行缓冲打开
file=open("3.txt",'wb',buffering=10)
while True:
data=input("<<")
if not data:
break
file.write((data+"\n").encode())
# file.flush() #刷新缓冲
file.close() | 14.384615 | 36 | 0.55615 |
file=open("3.txt",'wb',buffering=10)
while True:
data=input("<<")
if not data:
break
file.write((data+"\n").encode())
.close() | true | true |
f7220870e4ac64ce035175f7d9e02ed043831af2 | 1,987 | py | Python | xknx/knxip/disconnect_request.py | marvin-w/xknx | 9f8b80fa0906a345c7def519ac3c92c955990a26 | [
"MIT"
] | null | null | null | xknx/knxip/disconnect_request.py | marvin-w/xknx | 9f8b80fa0906a345c7def519ac3c92c955990a26 | [
"MIT"
] | 1 | 2019-01-06T11:40:16.000Z | 2019-01-06T11:40:16.000Z | xknx/knxip/disconnect_request.py | marvin-w/xknx | 9f8b80fa0906a345c7def519ac3c92c955990a26 | [
"MIT"
] | null | null | null | """
Module for Serialization and Deserialization of a KNX Disconnect Request information.
Connect requests are used to disconnect a tunnel from a KNX/IP device.
"""
from xknx.exceptions import CouldNotParseKNXIP
from .body import KNXIPBody
from .hpai import HPAI
from .knxip_enum import KNXIPServiceType
class Discon... | 28.797101 | 85 | 0.617514 | from xknx.exceptions import CouldNotParseKNXIP
from .body import KNXIPBody
from .hpai import HPAI
from .knxip_enum import KNXIPServiceType
class DisconnectRequest(KNXIPBody):
service_type = KNXIPServiceType.DISCONNECT_REQUEST
def __init__(self, xknx):
super().__init__(xknx)
self.comm... | true | true |
f72209c4367259bfc0bdf1ad69eaae4ca6dd390a | 80,107 | py | Python | ibutsu_client/model_utils.py | rsnyman/ibutsu-client-python | 451bae383a8bd1a35c3cf917749614cfcbd94283 | [
"MIT"
] | null | null | null | ibutsu_client/model_utils.py | rsnyman/ibutsu-client-python | 451bae383a8bd1a35c3cf917749614cfcbd94283 | [
"MIT"
] | null | null | null | ibutsu_client/model_utils.py | rsnyman/ibutsu-client-python | 451bae383a8bd1a35c3cf917749614cfcbd94283 | [
"MIT"
] | null | null | null | """
Ibutsu API
A system to store and query test results # noqa: E501
The version of the OpenAPI document: 1.13.4
Generated by: https://openapi-generator.tech
"""
from datetime import date, datetime # noqa: F401
import inspect
import io
import os
import pprint
import re
import tempfile
from dateut... | 40.19418 | 115 | 0.628859 |
from datetime import date, datetime
import inspect
import io
import os
import pprint
import re
import tempfile
from dateutil.parser import parse
from ibutsu_client.exceptions import (
ApiKeyError,
ApiAttributeError,
ApiTypeError,
ApiValueError,
)
none_type = type(None)
file_type = io.IOBase
def... | true | true |
f7220aec41876620567ec4f5a2fa2a87f3c48aab | 4,306 | py | Python | server.py | jsagurton/homekit-neopixel-rpi | 0a0725bf5bb4b3c81c25d4909e2225b6c03411c0 | [
"MIT"
] | 2 | 2020-05-13T17:43:25.000Z | 2020-06-01T04:13:28.000Z | server.py | jsagurton/homekit-neopixel-rpi | 0a0725bf5bb4b3c81c25d4909e2225b6c03411c0 | [
"MIT"
] | null | null | null | server.py | jsagurton/homekit-neopixel-rpi | 0a0725bf5bb4b3c81c25d4909e2225b6c03411c0 | [
"MIT"
] | null | null | null | import time
import board
import neopixel
import threading
from flask import Flask
# Choose an open pin connected to the Data In of the NeoPixel strip, i.e. board.D18
# NeoPixels must be connected to D10, D12, D18 or D21 to work.
pixel_pin = board.D21
# The number of NeoPixels
num_pixels = 137
# The order of the pix... | 27.602564 | 159 | 0.657687 | import time
import board
import neopixel
import threading
from flask import Flask
pixel_pin = board.D21
num_pixels = 137
ORDER = neopixel.GRB
pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=1.0, auto_write=False,
pixel_order=ORDER)
app = Flask(__name__)
rgb=(255,255,25... | true | true |
f7220b27f22bbf7fe83a49aeb06fc164fc8a0b60 | 3,903 | py | Python | test/flags.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | test/flags.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | test/flags.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | 1 | 2020-07-26T03:57:45.000Z | 2020-07-26T03:57:45.000Z | '''
Several testcases around <Flags> and <Flag>.
'''
import sys
sys.path.append("c:/peach")
from Peach.Generators.dictionary import *
from Peach.Generators.static import *
import unittest
import utils
import struct
def suite():
suite = unittest.TestSuite()
suite.addTest(FlagsInputTestCase())
suite... | 27.878571 | 104 | 0.658724 |
import sys
sys.path.append("c:/peach")
from Peach.Generators.dictionary import *
from Peach.Generators.static import *
import unittest
import utils
import struct
def suite():
suite = unittest.TestSuite()
suite.addTest(FlagsInputTestCase())
suite.addTest(FlagsOutputTestCase())
suite.addT... | true | true |
f7220b6826ac6e6db12ecb47cf44face19cbbe4d | 644 | py | Python | src/python/pants/backend/experimental/docker/register.py | yoav-orca/pants | 995448e9add343975844c7a43d5d64618fc4e4d9 | [
"Apache-2.0"
] | 1,806 | 2015-01-05T07:31:00.000Z | 2022-03-31T11:35:41.000Z | src/python/pants/backend/experimental/docker/register.py | yoav-orca/pants | 995448e9add343975844c7a43d5d64618fc4e4d9 | [
"Apache-2.0"
] | 9,565 | 2015-01-02T19:01:59.000Z | 2022-03-31T23:25:16.000Z | src/python/pants/backend/experimental/docker/register.py | riisi/pants | b33327389fab67c47b919710ea32f20ca284b1a6 | [
"Apache-2.0"
] | 443 | 2015-01-06T20:17:57.000Z | 2022-03-31T05:28:17.000Z | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.codegen import export_codegen_goal
from pants.backend.docker.goals.tailor import rules as tailor_rules
from pants.backend.docker.rules import rules as docker_rules
from ... | 29.272727 | 67 | 0.75 |
from pants.backend.codegen import export_codegen_goal
from pants.backend.docker.goals.tailor import rules as tailor_rules
from pants.backend.docker.rules import rules as docker_rules
from pants.backend.docker.target_types import DockerImageTarget
from pants.backend.python.util_rules.pex import rules as pex_rules
d... | true | true |
f7220b72397b2f715a8c642f041b2601f7a9bea8 | 1,148 | py | Python | 15CSL76_Machine_Learning/lab/8-em-kmeans.py | Shivanisen16/vtulabs | 2bc41d856612840cf035b570e6256ffc5bcbab5d | [
"MIT"
] | 7 | 2019-04-30T13:25:01.000Z | 2021-01-04T13:02:20.000Z | 15CSL76_Machine_Learning/lab/8-em-kmeans.py | Shivanisen16/vtulabs | 2bc41d856612840cf035b570e6256ffc5bcbab5d | [
"MIT"
] | 4 | 2018-12-17T08:46:55.000Z | 2019-11-12T11:47:24.000Z | 15CSL76_Machine_Learning/lab/8-em-kmeans.py | cseas/vtulabs | 2bc41d856612840cf035b570e6256ffc5bcbab5d | [
"MIT"
] | 14 | 2018-12-03T06:55:18.000Z | 2021-01-04T02:49:12.000Z | import copy
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from sklearn.mixture import GaussianMixture
from sklearn.cluster import KMeans
# Importing the dataset
data = pd.read_csv("ex.csv")
print("Input Data and Shape:")
print(data.head(3))
print("Shape:", data.shape)
# Gett... | 26.697674 | 76 | 0.655052 | import copy
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from sklearn.mixture import GaussianMixture
from sklearn.cluster import KMeans
data = pd.read_csv("ex.csv")
print("Input Data and Shape:")
print(data.head(3))
print("Shape:", data.shape)
f1 = data['V1'].values
f2 = ... | true | true |
f7220c584b0c5c0a472d032b76d41c1b9f1c37f5 | 63,818 | py | Python | gunicorn/config.py | Alexa3001/gunicorn | c0d05dad3d759f8cbbc465ba4698e1e94ed67cd7 | [
"MIT"
] | null | null | null | gunicorn/config.py | Alexa3001/gunicorn | c0d05dad3d759f8cbbc465ba4698e1e94ed67cd7 | [
"MIT"
] | null | null | null | gunicorn/config.py | Alexa3001/gunicorn | c0d05dad3d759f8cbbc465ba4698e1e94ed67cd7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
# Please remember to run "make -C docs html" after update "desc" attributes.
import argparse
import copy
import grp
import inspect
import os
import pwd
import re
import shlex
import ssl
impor... | 28.225564 | 144 | 0.597684 |
import argparse
import copy
import grp
import inspect
import os
import pwd
import re
import shlex
import ssl
import sys
import textwrap
from gunicorn import __version__, util
from gunicorn.errors import ConfigError
from gunicorn.reloader import reloader_engines
KNOWN_SETTINGS = []
PLATFORM = sys.platform
def... | true | true |
f7220def58979cdc9b193f290962e4ce04a90b11 | 4,857 | py | Python | tests/functional/test_echeck_credit.py | isunnapud/vantiv-sdk-for-python | 85ea6ba160c2436a305b9326cbb7d6c8f127c57c | [
"MIT"
] | 4 | 2017-11-16T16:02:06.000Z | 2021-05-04T14:40:08.000Z | tests/functional/test_echeck_credit.py | isunnapud/vantiv-sdk-for-python | 85ea6ba160c2436a305b9326cbb7d6c8f127c57c | [
"MIT"
] | 7 | 2017-08-23T15:04:38.000Z | 2020-04-07T20:20:15.000Z | tests/functional/test_echeck_credit.py | isunnapud/vantiv-sdk-for-python | 85ea6ba160c2436a305b9326cbb7d6c8f127c57c | [
"MIT"
] | 13 | 2017-10-17T22:07:57.000Z | 2022-03-29T17:33:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Vantiv eCommerce
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the 'Software'), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, ... | 37.651163 | 91 | 0.690138 |
import os
import sys
import unittest
package_root = os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
sys.path.insert(0, package_root)
from vantivsdk import *
conf = utils.Configuration()
class TestEcheckCredit(unittest.TestCase):
def test_simple_echeck_credit... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.