hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790733768ca253dfe6f8a855aeaf2d0d95c3593b | 4,057 | py | Python | tests/test_bibtexparser.py | goerz/bibdeskparser | 4f60f9960f6f0156c2f3c89033065c4e121800ab | [
"BSD-3-Clause"
] | null | null | null | tests/test_bibtexparser.py | goerz/bibdeskparser | 4f60f9960f6f0156c2f3c89033065c4e121800ab | [
"BSD-3-Clause"
] | null | null | null | tests/test_bibtexparser.py | goerz/bibdeskparser | 4f60f9960f6f0156c2f3c89033065c4e121800ab | [
"BSD-3-Clause"
] | null | null | null | import unittest
import bibdeskparser
from bibdeskparser.bparser import BibTexParser
from tempfile import TemporaryFile
class TestbibdeskparserParserMethods(unittest.TestCase):
input_file_path = 'tests/data/book.bib'
input_bom_file_path = 'tests/data/book_bom.bib'
entries_expected = [
{
... | 35.587719 | 72 | 0.676608 | import unittest
import bibdeskparser
from bibdeskparser.bparser import BibTexParser
from tempfile import TemporaryFile
class TestbibdeskparserParserMethods(unittest.TestCase):
input_file_path = 'tests/data/book.bib'
input_bom_file_path = 'tests/data/book_bom.bib'
entries_expected = [
{
... | true | true |
790733cbfdab68b44e4cda0ec3e6b492d9cf4166 | 6,208 | py | Python | virtual/lib/python3.8/site-packages/sqlalchemy/dialects/mysql/dml.py | Lenus254/personal_blog | aac38e4b5372c86efa8e24db2e051fef8e5feef8 | [
"Unlicense"
] | 5 | 2022-01-05T00:41:46.000Z | 2022-03-21T07:22:58.000Z | virtual/lib/python3.8/site-packages/sqlalchemy/dialects/mysql/dml.py | Lenus254/personal_blog | aac38e4b5372c86efa8e24db2e051fef8e5feef8 | [
"Unlicense"
] | 4 | 2020-04-23T19:00:28.000Z | 2021-09-28T18:14:58.000Z | virtual/lib/python3.8/site-packages/sqlalchemy/dialects/mysql/dml.py | Lenus254/personal_blog | aac38e4b5372c86efa8e24db2e051fef8e5feef8 | [
"Unlicense"
] | 2 | 2022-03-20T17:35:44.000Z | 2022-03-21T18:30:31.000Z | from ... import exc
from ... import util
from ...sql.base import _exclusive_against
from ...sql.base import _generative
from ...sql.base import ColumnCollection
from ...sql.dml import Insert as StandardInsert
from ...sql.elements import ClauseElement
from ...sql.expression import alias
from ...util.langhelpers import p... | 35.474286 | 84 | 0.632893 | from ... import exc
from ... import util
from ...sql.base import _exclusive_against
from ...sql.base import _generative
from ...sql.base import ColumnCollection
from ...sql.dml import Insert as StandardInsert
from ...sql.elements import ClauseElement
from ...sql.expression import alias
from ...util.langhelpers import p... | true | true |
790735b5a74b245acba8722d896c0d07a2e04020 | 1,543 | py | Python | deepcell/applications/multiplex_segmentation.py | jizhouh/deepcell-tf | 491ece59f5024d73429477ebdcb437a6e67d766b | [
"Apache-2.0"
] | 250 | 2018-09-19T23:55:06.000Z | 2022-03-30T02:20:52.000Z | deepcell/applications/multiplex_segmentation.py | jizhouh/deepcell-tf | 491ece59f5024d73429477ebdcb437a6e67d766b | [
"Apache-2.0"
] | 251 | 2018-09-21T17:09:43.000Z | 2022-02-28T19:04:50.000Z | deepcell/applications/multiplex_segmentation.py | jizhouh/deepcell-tf | 491ece59f5024d73429477ebdcb437a6e67d766b | [
"Apache-2.0"
] | 64 | 2018-11-29T15:22:15.000Z | 2022-03-21T03:37:43.000Z | # Copyright 2016-2021 The Van Valen Lab at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");... | 42.861111 | 80 | 0.747894 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from deepcell.applications.mesmer import Mesmer as MultiplexSegmentation
| true | true |
7907365d1d7dfdab7e99a00ac86d16b236ea1b0a | 16,564 | py | Python | tracpro/profiles/tests/test_views.py | rapidpro/tracpro | a68a782a7ff9bb0ccee85368132d8847c280fea3 | [
"BSD-3-Clause"
] | 5 | 2015-07-21T15:58:31.000Z | 2019-09-14T22:34:00.000Z | tracpro/profiles/tests/test_views.py | rapidpro/tracpro | a68a782a7ff9bb0ccee85368132d8847c280fea3 | [
"BSD-3-Clause"
] | 197 | 2015-03-24T15:26:04.000Z | 2017-11-28T19:24:37.000Z | tracpro/profiles/tests/test_views.py | rapidpro/tracpro | a68a782a7ff9bb0ccee85368132d8847c280fea3 | [
"BSD-3-Clause"
] | 10 | 2015-03-24T12:26:36.000Z | 2017-02-21T13:08:57.000Z | from __future__ import absolute_import, unicode_literals
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from tracpro.test.cases import TracProDataTest
class ManageUserCreateTest(TracProDataTest):
def test_create_as_non_superu... | 36.324561 | 94 | 0.594482 | from __future__ import absolute_import, unicode_literals
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from tracpro.test.cases import TracProDataTest
class ManageUserCreateTest(TracProDataTest):
def test_create_as_non_superu... | true | true |
7907371dca369689eba216a8a443d51a9ba2bc03 | 8,408 | py | Python | ml_editor/ml_editor.py | VestiDev/ml-powered-applications-2020-book | 4dcfdeb42cdce47406985dcbf8a0533cc086cd20 | [
"MIT"
] | 542 | 2019-06-11T20:15:11.000Z | 2022-03-30T00:30:05.000Z | ml_editor/ml_editor.py | VestiDev/ml-powered-applications-2020-book | 4dcfdeb42cdce47406985dcbf8a0533cc086cd20 | [
"MIT"
] | 84 | 2020-06-18T13:32:05.000Z | 2021-08-02T13:18:27.000Z | ml_editor/ml_editor.py | VestiDev/ml-powered-applications-2020-book | 4dcfdeb42cdce47406985dcbf8a0533cc086cd20 | [
"MIT"
] | 180 | 2019-04-15T01:47:32.000Z | 2022-03-13T13:58:04.000Z | import argparse
import logging
import sys
import pyphen
import nltk
pyphen.language_fallback("en_US")
logger = logging.getLogger()
logger.setLevel(logging.INFO)
console_out = logging.StreamHandler(sys.stdout)
console_out.setLevel(logging.DEBUG)
logger.addHandler(console_out)
def parse_arguments():
"""
Simp... | 30.244604 | 96 | 0.673525 | import argparse
import logging
import sys
import pyphen
import nltk
pyphen.language_fallback("en_US")
logger = logging.getLogger()
logger.setLevel(logging.INFO)
console_out = logging.StreamHandler(sys.stdout)
console_out.setLevel(logging.DEBUG)
logger.addHandler(console_out)
def parse_arguments():
parser = arg... | true | true |
790737c2a75aeb7a3a2829aa5090512eaf708739 | 21,588 | py | Python | pychron/dvc/meta_repo.py | WiscAr/pychron | 8d335d53ba7a5fc70760d9a7cb60540ad169ae84 | [
"Apache-2.0"
] | null | null | null | pychron/dvc/meta_repo.py | WiscAr/pychron | 8d335d53ba7a5fc70760d9a7cb60540ad169ae84 | [
"Apache-2.0"
] | 80 | 2018-07-17T20:10:20.000Z | 2021-08-17T15:38:24.000Z | pychron/dvc/meta_repo.py | UManPychron/pychron | b84c9fd70072f9cbda30abe2c471e64fe3dd75d8 | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | 34.158228 | 116 | 0.564712 |
import os
import shutil
from datetime import datetime
from traits.api import Bool
from uncertainties import ufloat
from pychron.core.helpers.datetime_tools import ISO_FORMAT_STR
from pychron.core.helpers.filetools import glob_list_directory, add_extension, \
list_directory
from pychron.dvc import d... | true | true |
790737db1381878cbc695a4d2c9de9929b8ed5ff | 16,969 | py | Python | tests/test_ec2/test_tags.py | monty16597/moto | cf2e6fc6dffedc34aa9b70d820f8f20908a52a8f | [
"Apache-2.0"
] | null | null | null | tests/test_ec2/test_tags.py | monty16597/moto | cf2e6fc6dffedc34aa9b70d820f8f20908a52a8f | [
"Apache-2.0"
] | null | null | null | tests/test_ec2/test_tags.py | monty16597/moto | cf2e6fc6dffedc34aa9b70d820f8f20908a52a8f | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import pytest
import itertools
import boto
import boto3
from botocore.exceptions import ClientError
from boto.exception import EC2ResponseError
from boto.ec2.instance import Reservation
import sure # noqa
from moto import mock_ec2_deprecated, mock_ec2
import pytest
from tests... | 33.60198 | 137 | 0.687194 | from __future__ import unicode_literals
import pytest
import itertools
import boto
import boto3
from botocore.exceptions import ClientError
from boto.exception import EC2ResponseError
from boto.ec2.instance import Reservation
import sure
from moto import mock_ec2_deprecated, mock_ec2
import pytest
from tests impor... | true | true |
7907380598336fc0f952cc45b3a88965a64e1ccd | 554 | py | Python | opwen_email_server/constants/azure.py | tezzytezzy/opwen-cloudserver | c3ebfe93d778cd789ab3df25c4580eedc0ae9b4a | [
"Apache-2.0"
] | null | null | null | opwen_email_server/constants/azure.py | tezzytezzy/opwen-cloudserver | c3ebfe93d778cd789ab3df25c4580eedc0ae9b4a | [
"Apache-2.0"
] | null | null | null | opwen_email_server/constants/azure.py | tezzytezzy/opwen-cloudserver | c3ebfe93d778cd789ab3df25c4580eedc0ae9b4a | [
"Apache-2.0"
] | null | null | null | from typing_extensions import Final # noqa: F401
CONTAINER_CLIENT_PACKAGES = 'compressedpackages' # type: Final
CONTAINER_EMAILS = 'emails' # type: Final
CONTAINER_MAILBOX = 'mailbox' # type: Final
CONTAINER_SENDGRID_MIME = 'sendgridinboundemails' # type: Final
TABLE_DOMAIN_X_DELIVERED = 'emaildomainxdelivered' ... | 46.166667 | 65 | 0.785199 | from typing_extensions import Final
CONTAINER_CLIENT_PACKAGES = 'compressedpackages'
CONTAINER_EMAILS = 'emails'
CONTAINER_MAILBOX = 'mailbox'
CONTAINER_SENDGRID_MIME = 'sendgridinboundemails'
TABLE_DOMAIN_X_DELIVERED = 'emaildomainxdelivered'
TABLE_AUTH = 'clientsauth'
QUEUE_CLIENT_PACKAGE = 'lokoleinbo... | true | true |
7907385213894c5913d607029267c1e7a291cd60 | 6,336 | py | Python | scripts/python/html2plaintext.py | suchowan/bookmarks | 77ef0399f8b3ead2356b86f8a5010a56d4b66f4d | [
"CC0-1.0"
] | 2 | 2019-05-04T04:35:07.000Z | 2019-10-24T03:55:00.000Z | scripts/python/html2plaintext.py | suchowan/bookmarks | 77ef0399f8b3ead2356b86f8a5010a56d4b66f4d | [
"CC0-1.0"
] | null | null | null | scripts/python/html2plaintext.py | suchowan/bookmarks | 77ef0399f8b3ead2356b86f8a5010a56d4b66f4d | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This script was written by Takashi SUGA on April-August 2017
# You may use and/or modify this file according to the license described in the MIT LICENSE.txt file https://raw.githubusercontent.com/suchowan/watson-api-client/master
"""『重要文抽出によるWebページ要約のためのHTMLテキスト分割』
http://harp.lib.hiroshim... | 36.413793 | 168 | 0.566288 |
import codecs
import re
class Article:
encodings = [
"utf-8",
"cp932",
"euc-jp",
"iso-2022-jp",
"latin_1"
]
block_level_tags = re.compile("(?i)</?(" + "|".join([
"address", "blockquote", "center", "dir", "div", "dl",
"fieldset", "form",... | true | true |
79073923e7c772300a11c4ca95af346837d8cd04 | 30,193 | py | Python | pandapower/converter/pypower/from_ppc.py | hmaschke/pandapower-1 | 2e93969050d3d468ce57f73d358e97fabc6e5141 | [
"BSD-3-Clause"
] | 2 | 2019-11-01T11:01:41.000Z | 2022-02-07T12:55:55.000Z | pandapower/converter/pypower/from_ppc.py | hmaschke/pandapower-1 | 2e93969050d3d468ce57f73d358e97fabc6e5141 | [
"BSD-3-Clause"
] | null | null | null | pandapower/converter/pypower/from_ppc.py | hmaschke/pandapower-1 | 2e93969050d3d468ce57f73d358e97fabc6e5141 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2022 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
from math import pi
from numpy import sign, nan, append, zeros, array, sqrt, where
from numpy import max as max_
from pandas impor... | 48.93517 | 103 | 0.568509 |
from math import pi
from numpy import sign, nan, append, zeros, array, sqrt, where
from numpy import max as max_
from pandas import Series, DataFrame, concat
from pandapower.pypower.idx_gen import GEN_BUS, PMIN, PMAX, QMIN, QMAX, GEN_STATUS
from pandapower.pypower.idx_cost import COST, NCOST
from pandapower.pypow... | true | true |
79073a669782801e093872305d757595730f469c | 1,278 | py | Python | src/stack-hci/azext_stack_hci/generated/commands.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/stack-hci/azext_stack_hci/generated/commands.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/stack-hci/azext_stack_hci/generated/commands.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incor... | 45.642857 | 122 | 0.676056 |
from azure.cli.core.commands import CliCommandType
def load_command_table(self, _):
from azext_stack_hci.generated._client_factory import cf_cluster
stack_hci_cluster = CliCommandType(
operations_tmpl='azext_stack_hci.vendored_sdks.azurestackhci.operations._cluster_operations#ClusterOperat... | true | true |
79073b2ef124ed61d465d23155f6a62b5a72fc2d | 2,074 | py | Python | setup.py | abcsFrederick/HistomicsUI | 335702b8e00e39cd733c212f894d4ef4c6a8b140 | [
"Apache-2.0"
] | null | null | null | setup.py | abcsFrederick/HistomicsUI | 335702b8e00e39cd733c212f894d4ef4c6a8b140 | [
"Apache-2.0"
] | null | null | null | setup.py | abcsFrederick/HistomicsUI | 335702b8e00e39cd733c212f894d4ef4c6a8b140 | [
"Apache-2.0"
] | null | null | null | import os
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
def prerelease_local_scheme(version):
"""
Return local scheme version unless building on master in CircleCI.
This function returns the local scheme version number
(e.g. 0.0.0... | 32.920635 | 70 | 0.653809 | import os
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
def prerelease_local_scheme(version):
from setuptools_scm.version import get_local_node_and_date
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
re... | true | true |
79073b63e912a29549a90c5cea1a691c5c4ac18f | 7,277 | py | Python | src/helpers/conversation.py | R-Mielamud/Telegram_BooksDelivery | 0745e60a4541f38fba8ac378185aff558ec95147 | [
"MIT"
] | 2 | 2020-12-27T18:04:58.000Z | 2021-06-18T13:47:37.000Z | src/helpers/conversation.py | R-Mielamud/Telegram_BooksDelivery | 0745e60a4541f38fba8ac378185aff558ec95147 | [
"MIT"
] | null | null | null | src/helpers/conversation.py | R-Mielamud/Telegram_BooksDelivery | 0745e60a4541f38fba8ac378185aff558ec95147 | [
"MIT"
] | 1 | 2021-12-13T02:58:19.000Z | 2021-12-13T02:58:19.000Z | from helpers.language import estr
ACTION_TEXT = "text"
ACTION_TEXT_QUESTION = "text_question"
ACTION_LIST_QUESTION = "list_question"
ACTION_YES_NO_QUESTION = "yesno_question"
ACTION_CHOICES_QUESTION = "choices_question"
ID = "id"
NO = "no"
YES = "yes"
TEXT = "text"
ON_NO = "on_no"
ON_YES = "on_yes"
ACTION = "action"
... | 32.342222 | 120 | 0.588292 | from helpers.language import estr
ACTION_TEXT = "text"
ACTION_TEXT_QUESTION = "text_question"
ACTION_LIST_QUESTION = "list_question"
ACTION_YES_NO_QUESTION = "yesno_question"
ACTION_CHOICES_QUESTION = "choices_question"
ID = "id"
NO = "no"
YES = "yes"
TEXT = "text"
ON_NO = "on_no"
ON_YES = "on_yes"
ACTION = "action"
... | true | true |
79073bd634d16949460f21e178b7a7148d81e4da | 11,320 | py | Python | tfx/dsl/components/common/importer.py | stjordanis/tfx | 4749388de03230361f2b7b733a657b3bc18b4152 | [
"Apache-2.0"
] | 1 | 2019-10-02T18:03:55.000Z | 2019-10-02T18:03:55.000Z | tfx/dsl/components/common/importer.py | stjordanis/tfx | 4749388de03230361f2b7b733a657b3bc18b4152 | [
"Apache-2.0"
] | null | null | null | tfx/dsl/components/common/importer.py | stjordanis/tfx | 4749388de03230361f2b7b733a657b3bc18b4152 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 37.607973 | 79 | 0.716343 |
from typing import Any, Dict, List, Optional, Type, Union
import absl
from tfx import types
from tfx.dsl.components.base import base_driver
from tfx.dsl.components.base import base_node
from tfx.orchestration import data_types
from tfx.orchestration import metadata
from tfx.types import channel_utils
fro... | true | true |
79073c21ec44a19981f5782d5aa2bbc772dd1e48 | 4,542 | py | Python | data/unaligned_dataset.py | sinhaharsh/pytorch-CycleGAN-and-pix2pix | 7a38c79f4344c954dd28d041c82c121c92465d3d | [
"BSD-3-Clause"
] | 1 | 2021-03-29T03:10:32.000Z | 2021-03-29T03:10:32.000Z | data/unaligned_dataset.py | sinhaharsh/pytorch-CycleGAN-and-pix2pix | 7a38c79f4344c954dd28d041c82c121c92465d3d | [
"BSD-3-Clause"
] | null | null | null | data/unaligned_dataset.py | sinhaharsh/pytorch-CycleGAN-and-pix2pix | 7a38c79f4344c954dd28d041c82c121c92465d3d | [
"BSD-3-Clause"
] | null | null | null | import os.path
from data.base_dataset import BaseDataset, get_transform
from data.image_folder import make_dataset
from PIL import Image
import random
import h5py
import numpy as np
from skimage.transform import resize as skResize
from util.util import normalize, adaptive_instance_normalization
class UnalignedDataset(... | 41.290909 | 122 | 0.625055 | import os.path
from data.base_dataset import BaseDataset, get_transform
from data.image_folder import make_dataset
from PIL import Image
import random
import h5py
import numpy as np
from skimage.transform import resize as skResize
from util.util import normalize, adaptive_instance_normalization
class UnalignedDataset(... | true | true |
79073c3b152de45bc8a13a44580f13646ff977c7 | 25,633 | py | Python | util/dvsim/SimCfg.py | courageheart/opentitan | 6d88a441d8f3aa9d948dd8fef66c6fb47527bf5a | [
"Apache-2.0"
] | null | null | null | util/dvsim/SimCfg.py | courageheart/opentitan | 6d88a441d8f3aa9d948dd8fef66c6fb47527bf5a | [
"Apache-2.0"
] | null | null | null | util/dvsim/SimCfg.py | courageheart/opentitan | 6d88a441d8f3aa9d948dd8fef66c6fb47527bf5a | [
"Apache-2.0"
] | null | null | null | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
r"""
Class describing simulation configuration object
"""
import os
import shutil
import subprocess
import sys
from collections import OrderedDict
import logging as log
fr... | 39.314417 | 91 | 0.576132 |
import os
import shutil
import subprocess
import sys
from collections import OrderedDict
import logging as log
from tabulate import tabulate
from Deploy import CompileSim, CovAnalyze, CovMerge, CovReport, RunTest, Deploy
from FlowCfg import FlowCfg
from Modes import BuildModes, Modes, Regressions, RunModes, Tests... | true | true |
79073d8868d789aecb12c3135ea15d4fafab4d85 | 7,610 | py | Python | rmgpy/molecule/converterTest.py | mbprend/RMG-Py | 29e111d683f2daa0b376417be60e76b32ce8a993 | [
"MIT"
] | null | null | null | rmgpy/molecule/converterTest.py | mbprend/RMG-Py | 29e111d683f2daa0b376417be60e76b32ce8a993 | [
"MIT"
] | null | null | null | rmgpy/molecule/converterTest.py | mbprend/RMG-Py | 29e111d683f2daa0b376417be60e76b32ce8a993 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | 48.782051 | 118 | 0.574376 | true | true | |
79073ec29185452124100779ea022dcfedd7983c | 3,624 | py | Python | Resources/books/deep_learning_time_series_forecasting/code/chapter_14/03_cnn_forecast_model.py | gdepalma93/bright-athlete-academy | 54ba0cc6633637c1bd6d90120153e04b981244bf | [
"MIT"
] | null | null | null | Resources/books/deep_learning_time_series_forecasting/code/chapter_14/03_cnn_forecast_model.py | gdepalma93/bright-athlete-academy | 54ba0cc6633637c1bd6d90120153e04b981244bf | [
"MIT"
] | null | null | null | Resources/books/deep_learning_time_series_forecasting/code/chapter_14/03_cnn_forecast_model.py | gdepalma93/bright-athlete-academy | 54ba0cc6633637c1bd6d90120153e04b981244bf | [
"MIT"
] | null | null | null | # evaluate cnn for monthly car sales dataset
from math import sqrt
from numpy import array
from numpy import mean
from numpy import std
from pandas import DataFrame
from pandas import concat
from pandas import read_csv
from sklearn.metrics import mean_squared_error
from keras.models import Sequential
from keras.layers... | 30.974359 | 84 | 0.74117 |
from math import sqrt
from numpy import array
from numpy import mean
from numpy import std
from pandas import DataFrame
from pandas import concat
from pandas import read_csv
from sklearn.metrics import mean_squared_error
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Flatte... | true | true |
79073eef787b92302619125fa418bcfd0045d283 | 2,947 | py | Python | UnityBuilder.py | christian-stockinger/UnityBuilder | d1a893eeb561c49475f3b2a0bde21c6d6b468153 | [
"MIT"
] | 4 | 2019-10-10T05:50:04.000Z | 2022-02-08T06:26:14.000Z | UnityBuilder.py | christian-stockinger/UnityBuilder | d1a893eeb561c49475f3b2a0bde21c6d6b468153 | [
"MIT"
] | 2 | 2018-11-21T12:52:41.000Z | 2018-11-21T12:55:46.000Z | UnityBuilder.py | christian-stockinger/UnityBuilder | d1a893eeb561c49475f3b2a0bde21c6d6b468153 | [
"MIT"
] | 3 | 2019-05-29T14:03:31.000Z | 2022-02-08T06:26:18.000Z | import platform
import subprocess
import sys
from optparse import OptionParser
from util import fileLogger
from util import logger
def parse_start_arguments():
parser = OptionParser()
parser.add_option("--unityPath", dest="UnityPath", default=True, help="Path to Unity application")
parser.add_option("--p... | 34.267442 | 141 | 0.657279 | import platform
import subprocess
import sys
from optparse import OptionParser
from util import fileLogger
from util import logger
def parse_start_arguments():
parser = OptionParser()
parser.add_option("--unityPath", dest="UnityPath", default=True, help="Path to Unity application")
parser.add_option("--p... | true | true |
79073ef939a5f6202ae68182d6333ac36ac8c3c0 | 3,298 | py | Python | mitmirror/presenters/controllers/users/update_user_controller.py | Claayton/mitmirror-api | a78ec3aa84aa3685a26bfaf5e1ba2a3f0f8405d1 | [
"MIT"
] | null | null | null | mitmirror/presenters/controllers/users/update_user_controller.py | Claayton/mitmirror-api | a78ec3aa84aa3685a26bfaf5e1ba2a3f0f8405d1 | [
"MIT"
] | 1 | 2021-10-09T20:42:03.000Z | 2021-10-09T20:42:03.000Z | mitmirror/presenters/controllers/users/update_user_controller.py | Claayton/mitmirror-api | a78ec3aa84aa3685a26bfaf5e1ba2a3f0f8405d1 | [
"MIT"
] | null | null | null | """Controller para UpdateUser"""
from typing import Type, Optional
from datetime import datetime
from mitmirror.domain.usecases import UpdateUserInterface
from mitmirror.domain.models import User
from mitmirror.presenters.interfaces import ControllerInterface
from mitmirror.presenters.helpers import HttpRequest, HttpRe... | 31.409524 | 91 | 0.604912 | from typing import Type, Optional
from datetime import datetime
from mitmirror.domain.usecases import UpdateUserInterface
from mitmirror.domain.models import User
from mitmirror.presenters.interfaces import ControllerInterface
from mitmirror.presenters.helpers import HttpRequest, HttpResponse
from mitmirror.errors impo... | true | true |
79073f3f97130d31fc71762545122d48683a6122 | 24,686 | py | Python | datacube/index/_datasets.py | cronosnull/agdc-v2 | 596923779d3650c47a6b43276b3369a5ec619158 | [
"Apache-2.0"
] | 1 | 2015-08-24T18:16:41.000Z | 2015-08-24T18:16:41.000Z | datacube/index/_datasets.py | cronosnull/agdc-v2 | 596923779d3650c47a6b43276b3369a5ec619158 | [
"Apache-2.0"
] | null | null | null | datacube/index/_datasets.py | cronosnull/agdc-v2 | 596923779d3650c47a6b43276b3369a5ec619158 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
"""
API for dataset indexing, access and search.
"""
from __future__ import absolute_import
import logging
from cachetools.func import lru_cache
from datacube import compat
from datacube.model import Dataset, DatasetType, MetadataType
from datacube.utils import InvalidDocException, check_doc_unchanged... | 36.196481 | 120 | 0.606741 |
from __future__ import absolute_import
import logging
from cachetools.func import lru_cache
from datacube import compat
from datacube.model import Dataset, DatasetType, MetadataType
from datacube.utils import InvalidDocException, check_doc_unchanged, jsonify_document, get_doc_changes, contains
from . import fields
... | true | true |
79073ff5636a8feb04f6bf806bc00fe2c9cb0254 | 2,507 | py | Python | xsdata/codegen/mixins.py | amal-khailtash/xsdata | f539ebf7ad9146ee5c0cad821c2ca5b2f4e8067e | [
"MIT"
] | null | null | null | xsdata/codegen/mixins.py | amal-khailtash/xsdata | f539ebf7ad9146ee5c0cad821c2ca5b2f4e8067e | [
"MIT"
] | null | null | null | xsdata/codegen/mixins.py | amal-khailtash/xsdata | f539ebf7ad9146ee5c0cad821c2ca5b2f4e8067e | [
"MIT"
] | null | null | null | import abc
from abc import ABCMeta
from typing import Callable
from typing import Iterator
from typing import List
from typing import Optional
from xsdata.codegen.models import Attr
from xsdata.codegen.models import Class
from xsdata.models.config import GeneratorConfig
from xsdata.utils.constants import return_true
... | 27.25 | 85 | 0.67491 | import abc
from abc import ABCMeta
from typing import Callable
from typing import Iterator
from typing import List
from typing import Optional
from xsdata.codegen.models import Attr
from xsdata.codegen.models import Class
from xsdata.models.config import GeneratorConfig
from xsdata.utils.constants import return_true
... | true | true |
79074077683610c76ebeae6e8822c97a1740001e | 3,640 | py | Python | pycoin/networks/legacy_networks.py | prahaladbelavadi/pycoin-trial | afffd068654497e00e5e39d144819bdeaf1f8a55 | [
"MIT"
] | 5 | 2017-12-15T13:40:50.000Z | 2021-12-18T13:18:54.000Z | pycoin/networks/legacy_networks.py | prahaladbelavadi/pycoin-trial | afffd068654497e00e5e39d144819bdeaf1f8a55 | [
"MIT"
] | 1 | 2018-08-06T03:48:14.000Z | 2018-09-03T03:01:03.000Z | pycoin/networks/legacy_networks.py | prahaladbelavadi/pycoin-trial | afffd068654497e00e5e39d144819bdeaf1f8a55 | [
"MIT"
] | 6 | 2018-08-24T18:49:47.000Z | 2021-01-19T10:04:08.000Z | # this file is deprecated and will soon be folded into all.py
from collections import namedtuple
from pycoin.serialize import h2b
NetworkValues = namedtuple('NetworkValues',
('network_name', 'subnet_name', 'code', 'wif', 'address',
'pay_to_script', 'prv32', 'pu... | 42.325581 | 120 | 0.58956 |
from collections import namedtuple
from pycoin.serialize import h2b
NetworkValues = namedtuple('NetworkValues',
('network_name', 'subnet_name', 'code', 'wif', 'address',
'pay_to_script', 'prv32', 'pub32'))
NETWORKS = (
NetworkValues("Viacoin", "mainn... | true | true |
790740fe9c5967cb2af78fbf75d463a80292047d | 23,446 | py | Python | torchvision/models/detection/faster_rcnn.py | brianjo/vision | a8bde78130fd8c956780d85693d0f51912013732 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T14:11:12.000Z | 2022-03-08T14:11:12.000Z | torchvision/models/detection/faster_rcnn.py | brianjo/vision | a8bde78130fd8c956780d85693d0f51912013732 | [
"BSD-3-Clause"
] | null | null | null | torchvision/models/detection/faster_rcnn.py | brianjo/vision | a8bde78130fd8c956780d85693d0f51912013732 | [
"BSD-3-Clause"
] | null | null | null | import torch.nn.functional as F
from torch import nn
from torchvision.ops import MultiScaleRoIAlign
from ..._internally_replaced_utils import load_state_dict_from_url
from ...ops import misc as misc_nn_ops
from ..mobilenetv3 import mobilenet_v3_large
from ..resnet import resnet50
from ._utils import overwrite_eps
from... | 44.154426 | 139 | 0.66425 | import torch.nn.functional as F
from torch import nn
from torchvision.ops import MultiScaleRoIAlign
from ..._internally_replaced_utils import load_state_dict_from_url
from ...ops import misc as misc_nn_ops
from ..mobilenetv3 import mobilenet_v3_large
from ..resnet import resnet50
from ._utils import overwrite_eps
from... | true | true |
79074153b6a661b8cb263aaead1be99aac462d24 | 601 | py | Python | src/js/components/Map/svg/makeimport.py | pdyxs/WhereTheHeartIs | 0a1267550cd0f0d06e84fd91f41ef097921ca048 | [
"MIT"
] | null | null | null | src/js/components/Map/svg/makeimport.py | pdyxs/WhereTheHeartIs | 0a1267550cd0f0d06e84fd91f41ef097921ca048 | [
"MIT"
] | null | null | null | src/js/components/Map/svg/makeimport.py | pdyxs/WhereTheHeartIs | 0a1267550cd0f0d06e84fd91f41ef097921ca048 | [
"MIT"
] | null | null | null | import sys
import os
if len(sys.argv) > 1:
folder = sys.argv[1]
jsfile = open("./" + folder + ".js", "w+")
images = [f[:len(f)-4] for f in os.listdir("./" + folder) if f.endswith(".svg")]
varnames = []
for i in images:
varname = "svg_" + i.replace('-', '_');
varnames.append(varname)... | 33.388889 | 87 | 0.515807 | import sys
import os
if len(sys.argv) > 1:
folder = sys.argv[1]
jsfile = open("./" + folder + ".js", "w+")
images = [f[:len(f)-4] for f in os.listdir("./" + folder) if f.endswith(".svg")]
varnames = []
for i in images:
varname = "svg_" + i.replace('-', '_');
varnames.append(varname)... | true | true |
790741977248c62a95430223435d1b1457462410 | 641 | py | Python | tracking/management/commands/harvest_dfes_feed.py | fahmidaward/resource_tracking | 8531a01e8b5c5fb20dcb8bef11ab17d7b68f4624 | [
"BSD-3-Clause"
] | null | null | null | tracking/management/commands/harvest_dfes_feed.py | fahmidaward/resource_tracking | 8531a01e8b5c5fb20dcb8bef11ab17d7b68f4624 | [
"BSD-3-Clause"
] | null | null | null | tracking/management/commands/harvest_dfes_feed.py | fahmidaward/resource_tracking | 8531a01e8b5c5fb20dcb8bef11ab17d7b68f4624 | [
"BSD-3-Clause"
] | null | null | null | from tracking.harvest import save_dfes_avl
from django.core.management.base import BaseCommand
import logging
LOGGER = logging.getLogger('tracking_points')
class Command(BaseCommand):
help = "Runs harvest_tracking_email to harvest points"
def handle(self, *args, **options):
LOGGER.info('Harvesting ... | 32.05 | 140 | 0.673947 | from tracking.harvest import save_dfes_avl
from django.core.management.base import BaseCommand
import logging
LOGGER = logging.getLogger('tracking_points')
class Command(BaseCommand):
help = "Runs harvest_tracking_email to harvest points"
def handle(self, *args, **options):
LOGGER.info('Harvesting ... | true | true |
790741cb1325bab36148da984a9533c55701a27d | 1,366 | py | Python | src/const.py | thales-ucas/wumpus | ac0f0e8520d367767eb15fd5e696ccc6b8e98098 | [
"Apache-2.0"
] | null | null | null | src/const.py | thales-ucas/wumpus | ac0f0e8520d367767eb15fd5e696ccc6b8e98098 | [
"Apache-2.0"
] | null | null | null | src/const.py | thales-ucas/wumpus | ac0f0e8520d367767eb15fd5e696ccc6b8e98098 | [
"Apache-2.0"
] | null | null | null | class Const:
"""
常量
"""
class ConstError(TypeError):pass
def __setattr__(self, name, value):
if name in self.__dict__:
raise self.ConstError("Can't rebind const (%s)" %name)
self.__dict__[name]=value
LAYOUT = Const()
"""
布局
"""
LAYOUT.SCREEN_WIDTH = 500
LAYOUT.SCREEN_HEIGHT = 600
LAYOUT.SIZE = ... | 20.088235 | 60 | 0.682284 | class Const:
class ConstError(TypeError):pass
def __setattr__(self, name, value):
if name in self.__dict__:
raise self.ConstError("Can't rebind const (%s)" %name)
self.__dict__[name]=value
LAYOUT = Const()
LAYOUT.SCREEN_WIDTH = 500
LAYOUT.SCREEN_HEIGHT = 600
LAYOUT.SIZE = 4
LAYOUT.TERRAIN_X = 50
LAYO... | true | true |
7907427be8f72396c3113eab88bebac73805bbb9 | 2,041 | py | Python | utils/backup.py | carolinscholl/SORN | 99f908c88265ecc26dad195b56bebfa12838591f | [
"MIT"
] | null | null | null | utils/backup.py | carolinscholl/SORN | 99f908c88265ecc26dad195b56bebfa12838591f | [
"MIT"
] | null | null | null | utils/backup.py | carolinscholl/SORN | 99f908c88265ecc26dad195b56bebfa12838591f | [
"MIT"
] | null | null | null | """Backup handler
This script is contains the backup handling functions.
"""
import os
import time
import pickle
import shutil
from shutil import ignore_patterns
import pypianoroll
import numpy as np
def backup_pickle(experiment, stats):
''''
Back up handling function.
Arguments:
experiment -- Expe... | 30.014706 | 73 | 0.622244 |
import os
import time
import pickle
import shutil
from shutil import ignore_patterns
import pypianoroll
import numpy as np
def backup_pickle(experiment, stats):
params = experiment.init_params
results_dir = experiment.results_dir
files_tosave = experiment.files_tosave
directory = ('backup/{}'.format... | true | true |
7907428d61716a5a24ac23ab8abac0f05f220c27 | 8,794 | py | Python | vmware_nsx/services/lbaas/nsx_v3/v2/lb_driver_v2.py | yebinama/vmware-nsx | 5f59ce8d4668c24e0f4f934898fb4b4e63f1c2f4 | [
"Apache-2.0"
] | null | null | null | vmware_nsx/services/lbaas/nsx_v3/v2/lb_driver_v2.py | yebinama/vmware-nsx | 5f59ce8d4668c24e0f4f934898fb4b4e63f1c2f4 | [
"Apache-2.0"
] | null | null | null | vmware_nsx/services/lbaas/nsx_v3/v2/lb_driver_v2.py | yebinama/vmware-nsx | 5f59ce8d4668c24e0f4f934898fb4b4e63f1c2f4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 VMware, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 44.190955 | 78 | 0.690243 |
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as n_consts
from neutron_lib import exceptions as n_exc
from oslo_log import helpers as log_helpers
from oslo_log import log as logging
from v... | true | true |
79074355b1847676439e6af59824fc3de8401d0f | 6,995 | py | Python | scripts/train_cd.py | monocilindro/torchsat | 5ac62e1aa9fee1d7a5a4a58914c128cf8e18cc09 | [
"MIT"
] | 316 | 2019-08-14T11:56:13.000Z | 2022-03-31T06:15:50.000Z | scripts/train_cd.py | monocilindro/torchsat | 5ac62e1aa9fee1d7a5a4a58914c128cf8e18cc09 | [
"MIT"
] | 8 | 2019-10-07T20:16:08.000Z | 2021-09-03T18:09:20.000Z | scripts/train_cd.py | monocilindro/torchsat | 5ac62e1aa9fee1d7a5a4a58914c128cf8e18cc09 | [
"MIT"
] | 49 | 2019-08-14T11:55:22.000Z | 2022-01-31T16:43:41.000Z | import argparse
import os
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from ignite.metrics import IoU, Precision, Recall
import torchsat.transforms.transforms_cd as T
from torchsat.datasets.f... | 42.393939 | 115 | 0.674482 | import argparse
import os
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from ignite.metrics import IoU, Precision, Recall
import torchsat.transforms.transforms_cd as T
from torchsat.datasets.f... | true | true |
7907441971f9015080aed7fa9f07895318277f60 | 694 | py | Python | Beijin-Tuiwen/Python/gen_data.py | Paradise02/Interviews | 5ac16a3e7b2a8335c9cdc9821773370ebdb42e41 | [
"MIT"
] | null | null | null | Beijin-Tuiwen/Python/gen_data.py | Paradise02/Interviews | 5ac16a3e7b2a8335c9cdc9821773370ebdb42e41 | [
"MIT"
] | null | null | null | Beijin-Tuiwen/Python/gen_data.py | Paradise02/Interviews | 5ac16a3e7b2a8335c9cdc9821773370ebdb42e41 | [
"MIT"
] | null | null | null | from __future__ import print_function
import sys
import datetime
import random
def main(n):
start = -86400 * 365 * 20
end = 86400 * 365
filename = 'testdata-' + str(n) + '.txt'
with open(filename, 'w') as fp:
now = datetime.datetime.now()
for i in range(n):
d = datetime.tim... | 26.692308 | 70 | 0.573487 | from __future__ import print_function
import sys
import datetime
import random
def main(n):
start = -86400 * 365 * 20
end = 86400 * 365
filename = 'testdata-' + str(n) + '.txt'
with open(filename, 'w') as fp:
now = datetime.datetime.now()
for i in range(n):
d = datetime.tim... | true | true |
790744d91f2dc3fb98ec2c16dca15372d174634c | 12,353 | py | Python | devito/ir/support/vector.py | rhodrin/devito | cd1ae745272eb0315aa1c36038a3174f1817e0d0 | [
"MIT"
] | null | null | null | devito/ir/support/vector.py | rhodrin/devito | cd1ae745272eb0315aa1c36038a3174f1817e0d0 | [
"MIT"
] | null | null | null | devito/ir/support/vector.py | rhodrin/devito | cd1ae745272eb0315aa1c36038a3174f1817e0d0 | [
"MIT"
] | null | null | null | from collections import OrderedDict
from sympy import Basic, true
from devito.tools import as_tuple, is_integer, memoized_meth
from devito.types import Dimension
__all__ = ['Vector', 'LabeledVector', 'vmin', 'vmax']
class Vector(tuple):
"""
A representation of an object in Z^n.
The elements of a Vect... | 34.409471 | 87 | 0.567393 | from collections import OrderedDict
from sympy import Basic, true
from devito.tools import as_tuple, is_integer, memoized_meth
from devito.types import Dimension
__all__ = ['Vector', 'LabeledVector', 'vmin', 'vmax']
class Vector(tuple):
def __new__(cls, *items, smart=False):
if not all(is_integer(i) ... | true | true |
790744f314f83ace6dfe1f19dfdd13e452a06bb7 | 105 | py | Python | models_jittor/utils/__init__.py | liuruiyang98/Jittor-MLP | b86656b65cf5f18ba9eb760d1f7565ed95e7e96e | [
"MIT"
] | 49 | 2021-10-06T11:22:19.000Z | 2022-03-25T03:01:10.000Z | models_jittor/utils/__init__.py | liuruiyang98/Jittor-MLP | b86656b65cf5f18ba9eb760d1f7565ed95e7e96e | [
"MIT"
] | 2 | 2021-11-08T08:06:35.000Z | 2022-02-18T09:23:07.000Z | models_jittor/utils/__init__.py | liuruiyang98/Jittor-MLP | b86656b65cf5f18ba9eb760d1f7565ed95e7e96e | [
"MIT"
] | 7 | 2021-10-10T03:25:27.000Z | 2022-03-08T10:44:15.000Z | from .tools import pair, check_sizes
from .dcn_v2 import deform_conv2d_jt
from .init import trunc_normal_ | 35 | 36 | 0.847619 | from .tools import pair, check_sizes
from .dcn_v2 import deform_conv2d_jt
from .init import trunc_normal_ | true | true |
790744f5e3959abab7371411b9cc5ea16cad805a | 643 | py | Python | test.py | gemasphi/alpha-zero-torch | ccaf23266c0cc61f4c84294681adc522609d0470 | [
"MIT"
] | 6 | 2019-11-14T19:16:57.000Z | 2020-11-08T13:53:30.000Z | test.py | gemasphi/alpha-zero-torch | ccaf23266c0cc61f4c84294681adc522609d0470 | [
"MIT"
] | 2 | 2020-02-14T20:10:09.000Z | 2021-12-20T03:43:43.000Z | test.py | gemasphi/alpha-zero-torch | ccaf23266c0cc61f4c84294681adc522609d0470 | [
"MIT"
] | 2 | 2020-09-02T11:39:01.000Z | 2021-12-02T22:05:50.000Z | from src.NN import NetWrapper
from src.games.Tictactoe import Tictactoe
from src.Player import *
from src.MCTS import MCTS
import yaml
with open("config.yaml", 'r') as f:
config = yaml.safe_load(f)
game = Tictactoe(**config['GAME'])
nn = NetWrapper(game, **config['NN'])
nn.load_model("models/the_bestest_of_model... | 30.619048 | 139 | 0.710731 | from src.NN import NetWrapper
from src.games.Tictactoe import Tictactoe
from src.Player import *
from src.MCTS import MCTS
import yaml
with open("config.yaml", 'r') as f:
config = yaml.safe_load(f)
game = Tictactoe(**config['GAME'])
nn = NetWrapper(game, **config['NN'])
nn.load_model("models/the_bestest_of_model... | true | true |
79074576a4397f66ed22d6acfecda5fe1de1ccf8 | 15,849 | py | Python | tensorflow/python/kernel_tests/signal/spectral_ops_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 190,993 | 2015-11-09T13:17:30.000Z | 2022-03-31T23:05:27.000Z | tensorflow/python/kernel_tests/signal/spectral_ops_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 48,461 | 2015-11-09T14:21:11.000Z | 2022-03-31T23:17:33.000Z | tensorflow/python/kernel_tests/signal/spectral_ops_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 104,981 | 2015-11-09T13:40:17.000Z | 2022-03-31T19:51:54.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... | 43.661157 | 80 | 0.678087 |
import itertools
from absl.testing import parameterized
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import gradient_... | true | true |
7907463be0399381dbb251da2399a40b35f47313 | 986 | py | Python | {{cookiecutter.app_name}}/{{cookiecutter.app_name}}/app.py | opatua/cookiecutter-flask-api | 67e5a37ee2b8ca32823ac2f8051bab6653b3b44e | [
"MIT"
] | 2 | 2019-04-06T05:08:15.000Z | 2019-04-06T19:23:44.000Z | {{cookiecutter.app_name}}/{{cookiecutter.app_name}}/app.py | opatua/cookiecutter-flask-api | 67e5a37ee2b8ca32823ac2f8051bab6653b3b44e | [
"MIT"
] | null | null | null | {{cookiecutter.app_name}}/{{cookiecutter.app_name}}/app.py | opatua/cookiecutter-flask-api | 67e5a37ee2b8ca32823ac2f8051bab6653b3b44e | [
"MIT"
] | null | null | null | from flask import Flask
from flask_restful import Api
from flask_cors import CORS
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from {{cookiecutter.app_name}}.config import app_config
from {{cookiecutter.app_name}}.models import db, bcrypt
from {{cookiecutter.app_name}}.resources i... | 22.930233 | 63 | 0.704868 | from flask import Flask
from flask_restful import Api
from flask_cors import CORS
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from {{cookiecutter.app_name}}.config import app_config
from {{cookiecutter.app_name}}.models import db, bcrypt
from {{cookiecutter.app_name}}.resources i... | false | true |
7907478bf8476f28d143ed5e90764ecaf0e5451f | 22,182 | py | Python | parlai/agents/seq2seq/seq2seq.py | lifelongeek/KBKAIST_Chatbot | 4766e6ee61a10e3719b7608c5777430ddfd277f9 | [
"BSD-3-Clause"
] | 2 | 2017-10-06T09:56:49.000Z | 2017-10-06T09:57:03.000Z | parlai/agents/seq2seq/seq2seq.py | gmkim90/KBKAIST_Chatbot | 4766e6ee61a10e3719b7608c5777430ddfd277f9 | [
"BSD-3-Clause"
] | null | null | null | parlai/agents/seq2seq/seq2seq.py | gmkim90/KBKAIST_Chatbot | 4766e6ee61a10e3719b7608c5777430ddfd277f9 | [
"BSD-3-Clause"
] | 2 | 2017-10-06T09:57:04.000Z | 2018-11-08T13:45:47.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from parlai.core.agents im... | 42.251429 | 105 | 0.552069 |
from parlai.core.agents import Agent
from parlai.core.dict import DictionaryAgent
from torch.autograd import Variable
from torch import optim
import torch.nn as nn
import torch
import os
import random
import pdb
class Seq2seqAgent(Agent):
"""Simple agent which uses an RNN to process incoming text observati... | false | true |
790747fa2be676727fad64cf03f3280c33d9e9f9 | 364 | py | Python | examples/get_channel_spline_coefficients.py | lento234/pyJHTDB | 9d525b790037456839ce82a88a086faabf034c67 | [
"Apache-2.0"
] | 55 | 2015-04-10T14:49:01.000Z | 2022-03-28T17:07:20.000Z | examples/get_channel_spline_coefficients.py | joelguerrero/pyJHTDB | 4050fb49010eb6b27776e5c2c0fe0cab765eefb1 | [
"Apache-2.0"
] | 26 | 2015-03-18T16:44:37.000Z | 2022-02-23T09:08:15.000Z | examples/get_channel_spline_coefficients.py | joelguerrero/pyJHTDB | 4050fb49010eb6b27776e5c2c0fe0cab765eefb1 | [
"Apache-2.0"
] | 36 | 2015-03-19T19:10:14.000Z | 2022-03-30T09:28:58.000Z | import pyJHTDB
# M1Q4
ii = pyJHTDB.interpolator.spline_interpolator(pyJHTDB.dbinfo.channel5200)
ii.write_coefficients()
# M2Q8
ii = pyJHTDB.interpolator.spline_interpolator(pyJHTDB.dbinfo.channel5200, m = 2, n = 3)
ii.write_coefficients()
# M2Q14
ii = pyJHTDB.interpolator.spline_interpolator(pyJHTDB.dbinfo.channel5... | 22.75 | 87 | 0.785714 | import pyJHTDB
ii = pyJHTDB.interpolator.spline_interpolator(pyJHTDB.dbinfo.channel5200)
ii.write_coefficients()
ii = pyJHTDB.interpolator.spline_interpolator(pyJHTDB.dbinfo.channel5200, m = 2, n = 3)
ii.write_coefficients()
ii = pyJHTDB.interpolator.spline_interpolator(pyJHTDB.dbinfo.channel5200, m = 2, n = 6)
... | true | true |
7907484ec8138862371c5292a11543726c194ffc | 538 | py | Python | Mesmer/manage.py | pythongiant/Mesmer | dcaafa49721d00893f9ca5eba1bfff94f6c7b96c | [
"Apache-2.0"
] | 1 | 2019-04-12T12:25:06.000Z | 2019-04-12T12:25:06.000Z | Mesmer/manage.py | pythongiant/Mesmer | dcaafa49721d00893f9ca5eba1bfff94f6c7b96c | [
"Apache-2.0"
] | 15 | 2018-11-27T13:56:16.000Z | 2018-11-30T17:35:41.000Z | Mesmer/manage.py | pythongiant/Mesmer | dcaafa49721d00893f9ca5eba1bfff94f6c7b96c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Mesmer.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are y... | 33.625 | 73 | 0.685874 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Mesmer.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installe... | true | true |
7907486c7c98dc36d5cc5fd939e4c95bfe2eb5b6 | 36,111 | py | Python | pandas/tests/frame/test_reshape.py | jess010/pandas | 9872d6757e5117dce070981141cee562f675694e | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/frame/test_reshape.py | jess010/pandas | 9872d6757e5117dce070981141cee562f675694e | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/frame/test_reshape.py | jess010/pandas | 9872d6757e5117dce070981141cee562f675694e | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2019-03-08T19:59:05.000Z | 2020-09-27T03:18:37.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
from warnings import catch_warnings
from datetime import datetime
import itertools
import pytest
from numpy.random import randn
from numpy import nan
import numpy as np
from pandas.compat import u
from pandas import (DataFrame, Index, Series, MultiIndex... | 40.52862 | 79 | 0.480131 |
from __future__ import print_function
from warnings import catch_warnings
from datetime import datetime
import itertools
import pytest
from numpy.random import randn
from numpy import nan
import numpy as np
from pandas.compat import u
from pandas import (DataFrame, Index, Series, MultiIndex, date_range,
... | true | true |
7907491c44db7e39d0ead454367e272b582c47bd | 4,545 | py | Python | WebKit/Admin/ServletCache.py | Cito/w4py | bba08f5974d49f5da7e88abe3eeda1037d0824a3 | [
"MIT"
] | 18 | 2016-08-01T20:15:59.000Z | 2019-12-24T16:00:03.000Z | WebKit/Admin/ServletCache.py | WebwareForPython/w4py | bba08f5974d49f5da7e88abe3eeda1037d0824a3 | [
"MIT"
] | 6 | 2016-09-13T05:48:45.000Z | 2020-01-09T18:29:12.000Z | WebKit/Admin/ServletCache.py | WebwareForPython/w4py | bba08f5974d49f5da7e88abe3eeda1037d0824a3 | [
"MIT"
] | 6 | 2016-09-16T14:32:29.000Z | 2020-01-03T18:52:16.000Z | import os
import time
from WebKit.URLParser import ServletFactoryManager
from WebUtils.Funcs import htmlEncode
from AdminSecurity import AdminSecurity
class ServletCache(AdminSecurity):
"""Display servlet cache.
This servlet displays, in a readable form, the internal data
structure of the cache of all s... | 37.254098 | 78 | 0.551155 | import os
import time
from WebKit.URLParser import ServletFactoryManager
from WebUtils.Funcs import htmlEncode
from AdminSecurity import AdminSecurity
class ServletCache(AdminSecurity):
def title(self):
return 'Servlet Cache'
def writeContent(self):
wr = self.writeln
factories = [fa... | true | true |
79074935d87c58a8e4e5cc0f35bd1e715da2edc1 | 1,857 | py | Python | docs/conf.py | keathmilligan/flask-quickstart | 9a5047135ab4d43c5046a892d4f677a7251f5c62 | [
"MIT"
] | 16 | 2016-11-23T15:36:41.000Z | 2021-11-04T07:01:50.000Z | docs/conf.py | keathmilligan/flask-jwt-refresh | 9a5047135ab4d43c5046a892d4f677a7251f5c62 | [
"MIT"
] | null | null | null | docs/conf.py | keathmilligan/flask-jwt-refresh | 9a5047135ab4d43c5046a892d4f677a7251f5c62 | [
"MIT"
] | 6 | 2016-12-08T23:23:38.000Z | 2021-04-20T16:35:57.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 35.711538 | 79 | 0.661282 |
project = 'sample'
copyright = '2020, Sample Author'
author = 'Sample Author'
extensions = [
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
html_theme = 'alabaster'
html_static_path = ['_static'] | true | true |
790749a95107925172b4974d5e2ee596c1881b1d | 2,854 | py | Python | airflow/operators/generic_transfer.py | findpace/incubator-airflow | f136c5b8f0054e9890b266adfe6624358cd610a2 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/operators/generic_transfer.py | findpace/incubator-airflow | f136c5b8f0054e9890b266adfe6624358cd610a2 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/operators/generic_transfer.py | findpace/incubator-airflow | f136c5b8f0054e9890b266adfe6624358cd610a2 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | 37.552632 | 80 | 0.700771 |
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
from airflow.hooks.base_hook import BaseHook
class GenericTransfer(BaseOperator):
template_fields = ('sql', 'destination_table', 'preoperator')
template_ext = ('.sql', '.hql',)
ui_color = '#b0f07c'
... | true | true |
790749b1fa46b50dddce602d374e171d84cf4597 | 35,929 | py | Python | tensorflow/python/kernel_tests/variables_test.py | jray319/tensorflow | 5cdf8f26c806e893e0773ad34e2b59008cc6f8ec | [
"Apache-2.0"
] | 4 | 2020-06-28T08:25:36.000Z | 2021-08-12T12:41:34.000Z | tensorflow/python/kernel_tests/variables_test.py | jray319/tensorflow | 5cdf8f26c806e893e0773ad34e2b59008cc6f8ec | [
"Apache-2.0"
] | 2 | 2021-08-25T16:12:24.000Z | 2022-02-10T02:04:13.000Z | tensorflow/python/kernel_tests/variables_test.py | jray319/tensorflow | 5cdf8f26c806e893e0773ad34e2b59008cc6f8ec | [
"Apache-2.0"
] | 4 | 2019-11-28T12:18:07.000Z | 2021-08-01T16:12:17.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.926327 | 94 | 0.676863 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import operator
from absl.testing import parameterized
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.eager import function
from tensorfl... | true | true |
79074b77a2532e7f874c5a246dbe006f99ef49ae | 3,727 | py | Python | tests/serverobjects/test_ban.py | matthew-robertson/banned-word-tracker | 32defe7936114258325ef8ba2f740648d43d4abf | [
"MIT"
] | 11 | 2019-03-10T18:31:59.000Z | 2021-02-13T12:42:44.000Z | tests/serverobjects/test_ban.py | matthew-robertson/banned-word-tracker | 32defe7936114258325ef8ba2f740648d43d4abf | [
"MIT"
] | 51 | 2019-02-21T21:21:59.000Z | 2022-03-09T01:29:55.000Z | tests/serverobjects/test_ban.py | matthew-robertson/vore-tracker | c35807612397ae7bc540cb0a1af6bf3ec1f98593 | [
"MIT"
] | 5 | 2018-07-12T06:36:29.000Z | 2019-01-09T04:11:19.000Z | import unittest
import datetime
from unittest.mock import Mock, patch
from types import MethodType
from serverobjects.ban import BanInstance
class TestCheckIfMessageInfringes(unittest.TestCase):
def test_check_if_message_infringes__exact_match(self):
test_ban = BanInstance(
{
'rowid': 1,
'banned_word':... | 28.450382 | 90 | 0.635632 | import unittest
import datetime
from unittest.mock import Mock, patch
from types import MethodType
from serverobjects.ban import BanInstance
class TestCheckIfMessageInfringes(unittest.TestCase):
def test_check_if_message_infringes__exact_match(self):
test_ban = BanInstance(
{
'rowid': 1,
'banned_word':... | true | true |
79074c329932ce8ea6558ed22dc07bea64855278 | 2,240 | py | Python | Python/Machine Learning/Indian AI Production/Feature Engineering/05-Categorical Missing value imputation.py | omkarsutar1255/Python-Data | 169d0c54b23d9dd5a7f1aea41ab385121c3b3c63 | [
"CC-BY-3.0"
] | null | null | null | Python/Machine Learning/Indian AI Production/Feature Engineering/05-Categorical Missing value imputation.py | omkarsutar1255/Python-Data | 169d0c54b23d9dd5a7f1aea41ab385121c3b3c63 | [
"CC-BY-3.0"
] | null | null | null | Python/Machine Learning/Indian AI Production/Feature Engineering/05-Categorical Missing value imputation.py | omkarsutar1255/Python-Data | 169d0c54b23d9dd5a7f1aea41ab385121c3b3c63 | [
"CC-BY-3.0"
] | null | null | null | # todo : Data Cleaning
# todo : Categorical Missing value imputation Part-5
# todo : Importing library
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# todo : import data
df = pd.read_csv(r"G:\DataSet\House Price Prediction\train.csv")
# todo : analysis data
df.head()
#... | 29.473684 | 89 | 0.738393 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df = pd.read_csv(r"G:\DataSet\House Price Prediction\train.csv")
df.head()
cat_vars = df.select_dtypes(include='object')
cat_vars.head()
cat_vars.isnull().sum()
miss_val_per = cat_vars.isnull().mean() * 100
print(mi... | true | true |
79074cff7dbe0708598dc85ac55e7666a74992a7 | 1,043 | py | Python | xlsxwriter/test/styles/test_write_fonts.py | sontek/XlsxWriter | 7f17a52f95be9ecfb9c7f213fc0a02e0f625c6ec | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2015-05-19T22:17:15.000Z | 2015-05-19T22:17:15.000Z | xlsxwriter/test/styles/test_write_fonts.py | sontek/XlsxWriter | 7f17a52f95be9ecfb9c7f213fc0a02e0f625c6ec | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/styles/test_write_fonts.py | sontek/XlsxWriter | 7f17a52f95be9ecfb9c7f213fc0a02e0f625c6ec | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2014, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...styles import Styles
from ...format import Format
class TestWriteFonts(unittest.Tes... | 24.255814 | 149 | 0.569511 | true | true | |
79074d348fba648bf6dcdf173c50845b268e2caa | 1,795 | py | Python | streamlit_terran_timeline/examples/youtube.py | cenkbircanoglu/streamlit-terran-timeline | 7c0f3b1c77ac0f79b159a50723b9fa72eb37ff53 | [
"MIT"
] | 56 | 2020-08-10T13:58:36.000Z | 2021-05-26T07:24:19.000Z | streamlit_terran_timeline/examples/youtube.py | cenkbircanoglu/streamlit-terran-timeline | 7c0f3b1c77ac0f79b159a50723b9fa72eb37ff53 | [
"MIT"
] | 1 | 2022-02-28T01:42:06.000Z | 2022-02-28T01:42:06.000Z | streamlit_terran_timeline/examples/youtube.py | cenkbircanoglu/streamlit-terran-timeline | 7c0f3b1c77ac0f79b159a50723b9fa72eb37ff53 | [
"MIT"
] | 8 | 2020-08-11T15:39:30.000Z | 2021-03-24T22:40:50.000Z | import streamlit as st
import warnings
try:
from streamlit_terran_timeline import terran_timeline, generate_timeline
except ImportError:
warnings.warn(
"Failed to load terran_timeline from streamlit_terran_timeline. "
"Please run 'pip install streamlit_terran_timeline' or "
"'pip insta... | 26.014493 | 81 | 0.71532 | import streamlit as st
import warnings
try:
from streamlit_terran_timeline import terran_timeline, generate_timeline
except ImportError:
warnings.warn(
"Failed to load terran_timeline from streamlit_terran_timeline. "
"Please run 'pip install streamlit_terran_timeline' or "
"'pip insta... | true | true |
79074d511a346e6151277a58a9bf4b1843df65f7 | 111 | py | Python | backend/app/crud/__init__.py | Infam852/IoT-project | 673d8a96676e046331550b9c16c0610de5733f73 | [
"MIT"
] | null | null | null | backend/app/crud/__init__.py | Infam852/IoT-project | 673d8a96676e046331550b9c16c0610de5733f73 | [
"MIT"
] | null | null | null | backend/app/crud/__init__.py | Infam852/IoT-project | 673d8a96676e046331550b9c16c0610de5733f73 | [
"MIT"
] | 1 | 2021-12-18T19:33:01.000Z | 2021-12-18T19:33:01.000Z | from app.crud.crud_crosswalk import *
from app.crud.crud_statistics import *
from app.crud.crud_users import *
| 27.75 | 38 | 0.810811 | from app.crud.crud_crosswalk import *
from app.crud.crud_statistics import *
from app.crud.crud_users import *
| true | true |
79074e63ba61112d1796829fb1e088a02aaab291 | 11,829 | py | Python | tools.py | billhhh/model-quantization-1 | e816c3ffd36426810e31de04dfdec1894a600c2d | [
"BSD-2-Clause"
] | null | null | null | tools.py | billhhh/model-quantization-1 | e816c3ffd36426810e31de04dfdec1894a600c2d | [
"BSD-2-Clause"
] | null | null | null | tools.py | billhhh/model-quantization-1 | e816c3ffd36426810e31de04dfdec1894a600c2d | [
"BSD-2-Clause"
] | null | null | null | import os, sys, glob, argparse
import logging
import types
from collections import OrderedDict
import torch
import torch.nn.functional as F
import utils
import models
import main as entry
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
def export_onnx(args):
model_name = args... | 40.234694 | 158 | 0.563108 | import os, sys, glob, argparse
import logging
import types
from collections import OrderedDict
import torch
import torch.nn.functional as F
import utils
import models
import main as entry
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
def export_onnx(args):
model_name = args... | true | true |
79074e66dfc8cc37abd88356f198faae39e4528c | 9,244 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/mellanox/onyx/plugins/modules/onyx_qos.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/mellanox/onyx/plugins/modules/onyx_qos.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/mellanox/onyx/plugins/modules/onyx_qos.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: onyx_qos
author: "Anas Badaha (@anasb)"
short_description:... | 39.844828 | 115 | 0.682172 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: onyx_qos
author: "Anas Badaha (@anasb)"
short_description: Configures QoS
description:
- This module provides declarative management of Onyx QoS configuration
on Mellanox ONYX network device... | true | true |
79074ed7087ce6b5d4aa4e4b91b5ef94dda18097 | 6,022 | py | Python | examples/hpgmg/hpgmgconf.py | kyushick/cdruntime | de08c79aad373c9715922294c67a7482c62ba9f2 | [
"Unlicense"
] | null | null | null | examples/hpgmg/hpgmgconf.py | kyushick/cdruntime | de08c79aad373c9715922294c67a7482c62ba9f2 | [
"Unlicense"
] | null | null | null | examples/hpgmg/hpgmgconf.py | kyushick/cdruntime | de08c79aad373c9715922294c67a7482c62ba9f2 | [
"Unlicense"
] | null | null | null | import sys,os
try:
import argparse
except ImportError:
print("""ERROR: Could not import argparse
Either use python2.7 or later (perhaps in a strange location such as
/bgsys/tools/python2.7.5-gnu-20130730/bin/hostpython) or install from
PyPI (https://pypi.python.org/pypi/argparse/).""")
sys.exit(1)
def mkd... | 48.176 | 185 | 0.622551 | import sys,os
try:
import argparse
except ImportError:
print("""ERROR: Could not import argparse
Either use python2.7 or later (perhaps in a strange location such as
/bgsys/tools/python2.7.5-gnu-20130730/bin/hostpython) or install from
PyPI (https://pypi.python.org/pypi/argparse/).""")
sys.exit(1)
def mkd... | true | true |
79074efba33bf2529139acec90f826375b3a98e3 | 8,449 | py | Python | kernel_image_puller.py | dummys/kernel-image-puller | c0154d5428215e120123530dbae1a01cb89631e6 | [
"BSD-3-Clause"
] | null | null | null | kernel_image_puller.py | dummys/kernel-image-puller | c0154d5428215e120123530dbae1a01cb89631e6 | [
"BSD-3-Clause"
] | null | null | null | kernel_image_puller.py | dummys/kernel-image-puller | c0154d5428215e120123530dbae1a01cb89631e6 | [
"BSD-3-Clause"
] | null | null | null | import logging
import os
import queue
import requests
import time
from threading import Thread
cri_sock = os.getenv("KIP_CRI_SOCK", "unix:///var/run/containerd/containerd.sock")
cri_client = os.getenv("KIP_CRI_CLI", False)
gateway_host = os.getenv("KIP_GATEWAY_HOST", "http://localhost:8888")
num_pullers = int(os.ge... | 37.057018 | 120 | 0.640549 | import logging
import os
import queue
import requests
import time
from threading import Thread
cri_sock = os.getenv("KIP_CRI_SOCK", "unix:///var/run/containerd/containerd.sock")
cri_client = os.getenv("KIP_CRI_CLI", False)
gateway_host = os.getenv("KIP_GATEWAY_HOST", "http://localhost:8888")
num_pullers = int(os.ge... | true | true |
7907502c72435035b8773b2e9d3de98a759ac87a | 17,141 | py | Python | evolution/diversity.py | narendasan/neural-mmo | 36a588db0021cccd7275cebef2cbdc5ee8eb40d5 | [
"MIT"
] | null | null | null | evolution/diversity.py | narendasan/neural-mmo | 36a588db0021cccd7275cebef2cbdc5ee8eb40d5 | [
"MIT"
] | null | null | null | evolution/diversity.py | narendasan/neural-mmo | 36a588db0021cccd7275cebef2cbdc5ee8eb40d5 | [
"MIT"
] | null | null | null | from pdb import set_trace as TT
import numpy as np
import scipy
from scipy.spatial import ConvexHull
import skimage
from skimage.morphology import disk
import skbio
global trg_image
trg_image = None
def diversity_calc(config):
div_calc_name = config.FITNESS_METRIC
return get_div_calc(div_calc_name)
def get_div... | 37.589912 | 225 | 0.687066 | from pdb import set_trace as TT
import numpy as np
import scipy
from scipy.spatial import ConvexHull
import skimage
from skimage.morphology import disk
import skbio
global trg_image
trg_image = None
def diversity_calc(config):
div_calc_name = config.FITNESS_METRIC
return get_div_calc(div_calc_name)
def get_div... | true | true |
7907503e02306ed1a233f84ffd3ba20e4f641627 | 5,052 | py | Python | dash_sql_client_ui.py | xiangjerryhe/sql-ui-dash | 857cab34332599550076fa01c385be1258e41fb2 | [
"MIT"
] | 1 | 2022-01-31T07:43:08.000Z | 2022-01-31T07:43:08.000Z | dash_sql_client_ui.py | xiangjerryhe/sql-ui-dash | 857cab34332599550076fa01c385be1258e41fb2 | [
"MIT"
] | null | null | null | dash_sql_client_ui.py | xiangjerryhe/sql-ui-dash | 857cab34332599550076fa01c385be1258e41fb2 | [
"MIT"
] | null | null | null | # coding: utf-8
__author__ = "Jerry He"
import dash_bootstrap_components as dbc
from dash import dcc, no_update
from dash_extensions.enrich import Dash, Output, Input, State, html
import flask
from flask import jsonify
from flask_cors import CORS
from dash import dash_table
import dash_ace
server = flask.Flask(__name_... | 31.575 | 147 | 0.582344 |
__author__ = "Jerry He"
import dash_bootstrap_components as dbc
from dash import dcc, no_update
from dash_extensions.enrich import Dash, Output, Input, State, html
import flask
from flask import jsonify
from flask_cors import CORS
from dash import dash_table
import dash_ace
server = flask.Flask(__name__)
CORS(server)... | true | true |
7907508e4670aeed6a99961267cd8c80b279bb7c | 737 | py | Python | king_libs/sort_val.py | jacktamin/king-tools | 87724ba8afaec6d5153b31377e63c0f7238b82c3 | [
"MIT"
] | null | null | null | king_libs/sort_val.py | jacktamin/king-tools | 87724ba8afaec6d5153b31377e63c0f7238b82c3 | [
"MIT"
] | null | null | null | king_libs/sort_val.py | jacktamin/king-tools | 87724ba8afaec6d5153b31377e63c0f7238b82c3 | [
"MIT"
] | null | null | null | class Sort_dic:
def __init__(self):
pass
@staticmethod
def sort_values(dic,rev=False,sort_by= 'values'):
if sort_by == 'values':
sv = sorted(dic.values(),reverse=rev)
new_dic = {}
for num in sv :
for k,v in d... | 26.321429 | 54 | 0.385346 | class Sort_dic:
def __init__(self):
pass
@staticmethod
def sort_values(dic,rev=False,sort_by= 'values'):
if sort_by == 'values':
sv = sorted(dic.values(),reverse=rev)
new_dic = {}
for num in sv :
for k,v in d... | true | true |
790750935a9164202629c5a890fd9cc46bd02342 | 4,116 | py | Python | tensorflow_model_optimization/__init__.py | ptesan777/model-optimization | 3fec5a74209e5a6a2b6ac603632b4a00ab523b36 | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/__init__.py | wangyifan778/Vitis-AI | f61061eef7550d98bf02a171604c9a9f283a7c47 | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/__init__.py | wangyifan778/Vitis-AI | f61061eef7550d98bf02a171604c9a9f283a7c47 | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.424779 | 84 | 0.744412 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def _ensure_tf_install():
try:
import tensorflow as tf
except ImportError:
print(
'\n\nFailed to import TensorFlow. Please note that TensorFlow is not '
... | true | true |
790750a59b605357e76747719703dbade1951824 | 35,842 | py | Python | sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_models.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_models.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_models.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: ... | 42.770883 | 117 | 0.685843 |
from enum import Enum
from azure.storage.blob import LeaseProperties as BlobLeaseProperties
from azure.storage.blob import AccountSasPermissions as BlobAccountSasPermissions
from azure.storage.blob import ResourceTypes as BlobResourceTypes
from azure.storage.blob import UserDelegationKey as BlobUserDelegationKe... | true | true |
79075282ff1af64fd6ff8b4851528927b9ed050a | 19,538 | py | Python | make_train_test_split.py | jnwei/deep-molecular-massspec | f82884a076a00fd45185dc303cd67efbc0c26bac | [
"Apache-2.0"
] | 79 | 2018-06-28T15:54:10.000Z | 2022-03-27T12:41:57.000Z | make_train_test_split.py | jingxual/deep-molecular-massspec | b82b40b57441b939da5899dfb575b284d20cea8e | [
"Apache-2.0"
] | 17 | 2018-08-20T17:44:05.000Z | 2021-02-25T15:48:02.000Z | make_train_test_split.py | jingxual/deep-molecular-massspec | b82b40b57441b939da5899dfb575b284d20cea8e | [
"Apache-2.0"
] | 32 | 2018-05-31T14:56:37.000Z | 2022-03-27T12:41:58.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 42.566449 | 80 | 0.749718 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import random
from absl import app
from absl import flags
import dataset_setup_constants as ds_constants
import mass_spec_constants as ms_constants
import parse_sdf_utils
im... | true | true |
790753d2a20891f5a1c30a760acc33fc3d5e20b7 | 1,151 | py | Python | apis/authentication.py | n-ryan/spotify-genius | 2b209ae30d5ec005bc7c616dc4a5297c996f9c0c | [
"MIT"
] | null | null | null | apis/authentication.py | n-ryan/spotify-genius | 2b209ae30d5ec005bc7c616dc4a5297c996f9c0c | [
"MIT"
] | null | null | null | apis/authentication.py | n-ryan/spotify-genius | 2b209ae30d5ec005bc7c616dc4a5297c996f9c0c | [
"MIT"
] | null | null | null | def path_hack():
import os, sys, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
# print('path added:', sys.path[0])
path_hack()
import traceback
import sys
import urllib.request
fr... | 30.289474 | 92 | 0.667246 | def path_hack():
import os, sys, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
path_hack()
import traceback
import sys
import urllib.request
from urllib.request import urlopen
im... | true | true |
790753ff87e4b849763a8b5830d1c2c2af71a7d8 | 157 | py | Python | src/car.py | TestowanieAutomatyczneUG/laboratorium-9-Sienkowski99 | d5167aaf4fe2af9771c65479b2dc3ea025f0cb97 | [
"MIT"
] | null | null | null | src/car.py | TestowanieAutomatyczneUG/laboratorium-9-Sienkowski99 | d5167aaf4fe2af9771c65479b2dc3ea025f0cb97 | [
"MIT"
] | null | null | null | src/car.py | TestowanieAutomatyczneUG/laboratorium-9-Sienkowski99 | d5167aaf4fe2af9771c65479b2dc3ea025f0cb97 | [
"MIT"
] | null | null | null | class Car:
def needFuel(self):
pass
def getEngineTemperature(self):
pass
def driveTo(self, destination):
pass | 15.7 | 36 | 0.55414 | class Car:
def needFuel(self):
pass
def getEngineTemperature(self):
pass
def driveTo(self, destination):
pass | true | true |
790754d59ff89f42e48d824a964cfb37783fd6de | 565 | py | Python | confab/generate.py | locationlabs/confab | a39c3d7aae11b2f373b8911b4f3caa75548a00c6 | [
"Apache-2.0"
] | 3 | 2015-01-23T09:39:25.000Z | 2022-02-25T15:47:26.000Z | confab/generate.py | locationlabs/confab | a39c3d7aae11b2f373b8911b4f3caa75548a00c6 | [
"Apache-2.0"
] | null | null | null | confab/generate.py | locationlabs/confab | a39c3d7aae11b2f373b8911b4f3caa75548a00c6 | [
"Apache-2.0"
] | 1 | 2021-09-08T09:52:11.000Z | 2021-09-08T09:52:11.000Z | """
Generate configuration files into :ref:`generated_dir<directories>`.
"""
from fabric.api import task
from gusset.output import status
from gusset.validation import with_validation
from confab.iter import iter_conffiles
@task
@with_validation
def generate(directory=None):
"""
Generate configuration files.... | 24.565217 | 71 | 0.707965 | from fabric.api import task
from gusset.output import status
from gusset.validation import with_validation
from confab.iter import iter_conffiles
@task
@with_validation
def generate(directory=None):
for conffiles in iter_conffiles(directory):
status("Generating templates for '{environment}' and '{role}'"... | true | true |
79075683e9254d743d0fbbc09e7d2e31b9cfca13 | 92,842 | py | Python | ibis/expr/operations.py | patcao/ibis | 661bbd20081285f3c29267793f3d070d0c8a0db8 | [
"Apache-2.0"
] | null | null | null | ibis/expr/operations.py | patcao/ibis | 661bbd20081285f3c29267793f3d070d0c8a0db8 | [
"Apache-2.0"
] | null | null | null | ibis/expr/operations.py | patcao/ibis | 661bbd20081285f3c29267793f3d070d0c8a0db8 | [
"Apache-2.0"
] | null | null | null | import collections
import functools
import itertools
import operator
from contextlib import suppress
from typing import Any, Dict, List
import numpy as np
import toolz
from cached_property import cached_property
import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
import ibis.expr.rules as rlz
import... | 24.984392 | 99 | 0.624954 | import collections
import functools
import itertools
import operator
from contextlib import suppress
from typing import Any, Dict, List
import numpy as np
import toolz
from cached_property import cached_property
import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
import ibis.expr.rules as rlz
import... | true | true |
79075800351ca9f9e53c3cd71af9d1e12f0995ef | 996 | py | Python | ex026.py | WesleyOlliver/CursoPython | 8decdc4f38c25429994c0f9cb8f206e167f161d6 | [
"MIT"
] | null | null | null | ex026.py | WesleyOlliver/CursoPython | 8decdc4f38c25429994c0f9cb8f206e167f161d6 | [
"MIT"
] | null | null | null | ex026.py | WesleyOlliver/CursoPython | 8decdc4f38c25429994c0f9cb8f206e167f161d6 | [
"MIT"
] | null | null | null | cor = {'traço': '\033[35m', 'ex': '\033[4;31m', 'título': '\033[1;34m', 'str': '\033[1;33m', 'reset': '\033[m'}
print('{}-=-{}'.format(cor['traço'], cor['reset'])*18, '{} Exercício 026 {}'.format(cor['ex'], cor['reset']),
'{}-=-{}'.format(cor['traço'], cor['reset'])*18)
print('{}Faça um programa que leia uma fra... | 76.615385 | 118 | 0.593373 | cor = {'traço': '\033[35m', 'ex': '\033[4;31m', 'título': '\033[1;34m', 'str': '\033[1;33m', 'reset': '\033[m'}
print('{}-=-{}'.format(cor['traço'], cor['reset'])*18, '{} Exercício 026 {}'.format(cor['ex'], cor['reset']),
'{}-=-{}'.format(cor['traço'], cor['reset'])*18)
print('{}Faça um programa que leia uma fra... | true | true |
790758766559dd3e8276554f9e97a158f5ec032d | 216 | py | Python | src/spaceone/repository/model/__init__.py | whdalsrnt/repository | 4d019c21508629faae7a7e2789bf540a3bab0e20 | [
"Apache-2.0"
] | 6 | 2020-06-04T23:00:33.000Z | 2020-08-10T02:45:43.000Z | src/spaceone/repository/model/__init__.py | whdalsrnt/repository | 4d019c21508629faae7a7e2789bf540a3bab0e20 | [
"Apache-2.0"
] | 4 | 2020-10-09T07:02:27.000Z | 2022-02-28T04:43:01.000Z | src/spaceone/repository/model/__init__.py | whdalsrnt/repository | 4d019c21508629faae7a7e2789bf540a3bab0e20 | [
"Apache-2.0"
] | 6 | 2020-06-01T10:10:57.000Z | 2021-10-05T03:03:00.000Z | from spaceone.repository.model.plugin_model import *
from spaceone.repository.model.schema_model import *
from spaceone.repository.model.policy_model import *
from spaceone.repository.model.repository_model import *
| 43.2 | 56 | 0.851852 | from spaceone.repository.model.plugin_model import *
from spaceone.repository.model.schema_model import *
from spaceone.repository.model.policy_model import *
from spaceone.repository.model.repository_model import *
| true | true |
790758cf4b935b5fb25f54292538f97f68e0b881 | 299 | py | Python | instagram/forms.py | cossie14/Slygram | 9df33f4c50b2b1fd35830637fb637c8c81d603c0 | [
"MIT"
] | null | null | null | instagram/forms.py | cossie14/Slygram | 9df33f4c50b2b1fd35830637fb637c8c81d603c0 | [
"MIT"
] | 4 | 2021-03-19T03:16:45.000Z | 2021-09-08T01:15:53.000Z | instagram/forms.py | sylviahjepkosgei/Slygram | 9df33f4c50b2b1fd35830637fb637c8c81d603c0 | [
"MIT"
] | 1 | 2020-11-04T08:42:08.000Z | 2020-11-04T08:42:08.000Z | from django import forms
from .models import Image, Comments
#......
class NewStoryForm(forms.ModelForm):
class Meta:
model = Image
fields = ('image', 'image_caption')
class NewCommentForm(forms.ModelForm):
class Meta:
model = Comments
fields = ('comment',)
| 23 | 43 | 0.64214 | from django import forms
from .models import Image, Comments
class NewStoryForm(forms.ModelForm):
class Meta:
model = Image
fields = ('image', 'image_caption')
class NewCommentForm(forms.ModelForm):
class Meta:
model = Comments
fields = ('comment',)
| true | true |
7907593c3d7e230e9d0a30def6478592c661d0da | 5,228 | py | Python | test/test_model_conversion.py | huggingface/neural-compressor | aaad4c357a86914ffa583753c9a26d949838a2a5 | [
"Apache-2.0"
] | 172 | 2021-09-14T18:34:17.000Z | 2022-03-30T06:49:53.000Z | test/test_model_conversion.py | intel/lp-opt-tool | 130eefa3586b38df6c0ff78cc8807ae273f6a63f | [
"Apache-2.0"
] | 40 | 2021-09-14T02:26:12.000Z | 2022-03-29T08:34:04.000Z | test/test_model_conversion.py | intel/neural-compressor | 16a4a12045fcb468da4d33769aff2c1a5e2ba6ba | [
"Apache-2.0"
] | 33 | 2021-09-15T07:27:25.000Z | 2022-03-25T08:30:57.000Z | #
# -*- coding: utf-8 -*-
#
import unittest
import os
import shutil
import yaml
import tensorflow as tf
from neural_compressor.experimental import model_conversion
tf.compat.v1.enable_eager_execution()
from tensorflow import keras
from tensorflow.python.framework import graph_util
from neural_compressor.adaptor.tf_u... | 35.808219 | 146 | 0.666985 |
import unittest
import os
import shutil
import yaml
import tensorflow as tf
from neural_compressor.experimental import model_conversion
tf.compat.v1.enable_eager_execution()
from tensorflow import keras
from tensorflow.python.framework import graph_util
from neural_compressor.adaptor.tf_utils.util import disable_r... | true | true |
79075957d9d4402065718b9f2cbe06ccf8dcc00a | 2,603 | py | Python | MNIST/mnist.py | VitorGDellino/Neural-Network | fb2ff335656145d385c0fbf6e68b0840efe51dd2 | [
"MIT"
] | null | null | null | MNIST/mnist.py | VitorGDellino/Neural-Network | fb2ff335656145d385c0fbf6e68b0840efe51dd2 | [
"MIT"
] | null | null | null | MNIST/mnist.py | VitorGDellino/Neural-Network | fb2ff335656145d385c0fbf6e68b0840efe51dd2 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plt
#print(tf.__version__)
def plot_image(i, predictions_array, true_label, img):
predictions_array, true_label, img = predictions_array[i], true_label[i], img[i]
plt.grid(False)
plt.xticks([])
plt.yticks([])
... | 26.292929 | 84 | 0.684211 | import tensorflow as tf
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plt
def plot_image(i, predictions_array, true_label, img):
predictions_array, true_label, img = predictions_array[i], true_label[i], img[i]
plt.grid(False)
plt.xticks([])
plt.yticks([])
plt.imshow(img, c... | true | true |
79075af075309d228e4ce168b304d83bcc1918c6 | 26,784 | py | Python | TensorMonitor/control_panel.py | octaviaguo/Tensorflow-Visualizing | f96356d5fea4c4394193ac098ae75026a3cfb714 | [
"MIT"
] | 15 | 2018-08-23T18:01:03.000Z | 2021-10-01T03:05:49.000Z | TensorMonitor/control_panel.py | octaviaguo/Tensorflow-Visualizing | f96356d5fea4c4394193ac098ae75026a3cfb714 | [
"MIT"
] | null | null | null | TensorMonitor/control_panel.py | octaviaguo/Tensorflow-Visualizing | f96356d5fea4c4394193ac098ae75026a3cfb714 | [
"MIT"
] | null | null | null | import os
import sys
import copy as copy
from tensor_view_1d import TensorView1D
from tensor_view_2d import TensorView2D
from tensor_view_act import TensorViewAct
from tensor_view_filter import TensorViewFilter
from tensor_data import TensorData
import inspect
from PyQt4 import QtGui, QtCore
from pyqt_env i... | 40.035874 | 144 | 0.614658 | import os
import sys
import copy as copy
from tensor_view_1d import TensorView1D
from tensor_view_2d import TensorView2D
from tensor_view_act import TensorViewAct
from tensor_view_filter import TensorViewFilter
from tensor_data import TensorData
import inspect
from PyQt4 import QtGui, QtCore
from pyqt_env i... | true | true |
79075d1fcc5d91a6a0519eb1345af627dcca21c1 | 17,062 | py | Python | src/gulpio2/fileio.py | kiyoon/GulpIO2 | 143d53dbb7091b0938832415e32e04992439faf6 | [
"MIT"
] | null | null | null | src/gulpio2/fileio.py | kiyoon/GulpIO2 | 143d53dbb7091b0938832415e32e04992439faf6 | [
"MIT"
] | null | null | null | src/gulpio2/fileio.py | kiyoon/GulpIO2 | 143d53dbb7091b0938832415e32e04992439faf6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import re
import pickle
import json
import glob
import numpy as np
from abc import ABC, abstractmethod
from concurrent.futures import ProcessPoolExecutor
from contextlib import contextmanager
from collections import namedtuple, OrderedDict
from tqdm import tqdm
from .utils import img... | 32.685824 | 143 | 0.614582 |
import os
import re
import pickle
import json
import glob
import numpy as np
from abc import ABC, abstractmethod
from concurrent.futures import ProcessPoolExecutor
from contextlib import contextmanager
from collections import namedtuple, OrderedDict
from tqdm import tqdm
from .utils import img_to_jpeg_bytes, jpeg_... | true | true |
79075d5041a1a9aee84461b99b34b935700b750d | 9,126 | py | Python | sdk/python/pulumi_aws/ecs/tag.py | rapzo/pulumi-aws | 390a098221315d98a54ba97d1559e750dc3053b7 | [
"ECL-2.0",
"Apache-2.0"
] | 260 | 2018-06-18T14:57:00.000Z | 2022-03-29T11:41:03.000Z | sdk/python/pulumi_aws/ecs/tag.py | rapzo/pulumi-aws | 390a098221315d98a54ba97d1559e750dc3053b7 | [
"ECL-2.0",
"Apache-2.0"
] | 1,154 | 2018-06-19T20:38:20.000Z | 2022-03-31T19:48:16.000Z | sdk/python/pulumi_aws/ecs/tag.py | rapzo/pulumi-aws | 390a098221315d98a54ba97d1559e750dc3053b7 | [
"ECL-2.0",
"Apache-2.0"
] | 115 | 2018-06-28T03:20:27.000Z | 2022-03-29T11:41:06.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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... | 35.509728 | 134 | 0.60103 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = ['TagArgs', 'Tag']
@pulumi.input_type
class TagArgs:
def __init__(__self__, *,
key: pulumi.Input[str],
resource_arn: pu... | true | true |
79075d735ff575058160ba7a5485b2050d0cf348 | 48,428 | py | Python | super_setup.py | brmscheiner/ibeis | 9bb93a6cd74ac47921e734c80917a38609dfe661 | [
"Apache-2.0"
] | null | null | null | super_setup.py | brmscheiner/ibeis | 9bb93a6cd74ac47921e734c80917a38609dfe661 | [
"Apache-2.0"
] | null | null | null | super_setup.py | brmscheiner/ibeis | 9bb93a6cd74ac47921e734c80917a38609dfe661 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TODO:
* needs to check if required modules are installed (or prefereably developed)
* needs to be able to ignore plugins that the user doesnt care about
Super Setup
PREREQ:
git config --global push.default current
export CODE_DIR=~/code
mkdir $CODE_DIR
cd $CODE... | 34.715412 | 166 | 0.604485 |
from __future__ import absolute_import, division, print_function, unicode_literals
from os.path import dirname, realpath
import platform
import sys
import os
USAGE = ('''
--- USAGE ---
IBEIS (IMAGE ANALYSIS) SUPER SETUP
This script is meant to help setup, install, and update the developer
enviroment for IBE... | true | true |
79075f4f56f8bc844adf569e2ae0dc947f97ad32 | 33,843 | py | Python | main.py | MartimChaves/ret_detect | 774521a079be4324d542a841c7b3be808c18356b | [
"MIT"
] | null | null | null | main.py | MartimChaves/ret_detect | 774521a079be4324d542a841c7b3be808c18356b | [
"MIT"
] | null | null | null | main.py | MartimChaves/ret_detect | 774521a079be4324d542a841c7b3be808c18356b | [
"MIT"
] | null | null | null | import cv2.cv2 as cv2
import skimage.io as io
from skimage.transform import downscale_local_mean
import numpy as np
from model import *
from sklearn.naive_bayes import GaussianNB
from sklearn.model_selection import train_test_split
import numpy as np
from sklearn.naive_bayes import GaussianNB
from sklear... | 40.098341 | 215 | 0.625476 | import cv2.cv2 as cv2
import skimage.io as io
from skimage.transform import downscale_local_mean
import numpy as np
from model import *
from sklearn.naive_bayes import GaussianNB
from sklearn.model_selection import train_test_split
import numpy as np
from sklearn.naive_bayes import GaussianNB
from sklear... | true | true |
79075f56d229c2d2a73820a398f773add23bebeb | 6,981 | py | Python | smacha_ros/doc/conf.py | ReconCell/smacha | 253215a35d2d091bf50c28c1ba876209b82d2400 | [
"BSD-3-Clause"
] | 16 | 2019-04-16T07:44:30.000Z | 2022-03-10T08:04:45.000Z | smacha_ros/doc/conf.py | ReconCell/smacha | 253215a35d2d091bf50c28c1ba876209b82d2400 | [
"BSD-3-Clause"
] | 2 | 2019-07-18T09:11:00.000Z | 2019-09-26T10:21:26.000Z | smacha_ros/doc/conf.py | ReconCell/smacha | 253215a35d2d091bf50c28c1ba876209b82d2400 | [
"BSD-3-Clause"
] | 2 | 2019-08-21T20:14:54.000Z | 2019-09-19T13:26:34.000Z | # -*- 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/master/config
# -- Path setup ------------------------------------------------------------... | 30.753304 | 147 | 0.655064 |
import os
import catkin_pkg.package
catkin_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
catkin_package = catkin_pkg.package.parse_package(os.path.join(catkin_dir, catkin_pkg.package.PACKAGE_MANIFEST_FILENAME))
project = 'SMACHA ROS'
copyright = '2019, ReconCell'
author = 'Ba... | true | true |
790760cb05951c001a9580530426442d4df1318a | 108 | py | Python | topics/05-data-wrangling/consume.py | ralec911/missing-course | a297768cf7e7162fabd6b8a1d3041c2d3faabc22 | [
"BSD-3-Clause"
] | 8 | 2021-02-10T15:58:28.000Z | 2022-01-09T01:55:41.000Z | topics/05-data-wrangling/consume.py | ralec911/missing-course | a297768cf7e7162fabd6b8a1d3041c2d3faabc22 | [
"BSD-3-Clause"
] | 2 | 2021-01-26T01:35:42.000Z | 2021-02-27T20:41:38.000Z | topics/05-data-wrangling/consume.py | ralec911/missing-course | a297768cf7e7162fabd6b8a1d3041c2d3faabc22 | [
"BSD-3-Clause"
] | 27 | 2021-01-11T16:23:24.000Z | 2022-01-09T02:04:03.000Z | #!/usr/bin/env python3 -u
import sys
for value in sys.stdin:
sys.stderr.write(f"consumed {value}\n")
| 13.5 | 43 | 0.675926 |
import sys
for value in sys.stdin:
sys.stderr.write(f"consumed {value}\n")
| true | true |
790761dc66f4e5f333d71022468cb222559c8e95 | 69,394 | py | Python | keras/preprocessing/image.py | mendesmiguel/keras | bf1378f39d02b7d0b53ece5458f9275ac8208046 | [
"MIT"
] | 2 | 2019-09-17T22:01:41.000Z | 2020-05-30T05:48:14.000Z | keras/preprocessing/image.py | HangJie720/keras | bf1378f39d02b7d0b53ece5458f9275ac8208046 | [
"MIT"
] | null | null | null | keras/preprocessing/image.py | HangJie720/keras | bf1378f39d02b7d0b53ece5458f9275ac8208046 | [
"MIT"
] | 3 | 2019-08-12T18:15:17.000Z | 2021-06-20T19:40:13.000Z | """Fairly basic set of tools for real-time data augmentation on image data.
Can easily be extended to include new transformations,
new preprocessing methods, etc...
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import re
from scipy ... | 41.678078 | 124 | 0.573119 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import re
from scipy import linalg
import scipy.ndimage as ndi
from six.moves import range
import os
import threading
import warnings
import multiprocessing.pool
from functools import partial... | true | true |
790761dda3807d309f2daf1ae9f05eede0666dc8 | 6,464 | py | Python | behave_tests/steps/create_question.py | Sindhuja-SRL/back-end | d84dae8ed212913339dec646b46a67fcc0b77f52 | [
"MIT"
] | null | null | null | behave_tests/steps/create_question.py | Sindhuja-SRL/back-end | d84dae8ed212913339dec646b46a67fcc0b77f52 | [
"MIT"
] | null | null | null | behave_tests/steps/create_question.py | Sindhuja-SRL/back-end | d84dae8ed212913339dec646b46a67fcc0b77f52 | [
"MIT"
] | 1 | 2022-03-11T01:45:39.000Z | 2022-03-11T01:45:39.000Z | from behave import *
import requests
from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
from host.models import Event
use_step_matcher("re")
# @given("that I am a registered host of privilege walk events and want to create questions and answer choices for the event")
# de... | 29.925926 | 126 | 0.591894 | from behave import *
import requests
from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
from host.models import Event
use_step_matcher("re")
# "choices": [
# {
# "description": "Pizza",
# ... | true | true |
7907638945757bf6b7e2a1ee40a201af1c82cc5f | 1,052 | py | Python | juno/subscription.py | leogregianin/juno-python | 0be2b70516b0dde713ff36cdb40888f06cc538f5 | [
"MIT"
] | 2 | 2022-03-25T21:08:46.000Z | 2022-03-31T21:10:17.000Z | juno/subscription.py | leogregianin/juno-python | 0be2b70516b0dde713ff36cdb40888f06cc538f5 | [
"MIT"
] | null | null | null | juno/subscription.py | leogregianin/juno-python | 0be2b70516b0dde713ff36cdb40888f06cc538f5 | [
"MIT"
] | null | null | null | from juno.resources import handler_request
from juno.resources.routes import subscription_routes
def create(dictionary):
return handler_request.post(subscription_routes.get_base_url(), dictionary)
def find_all():
return handler_request.get(subscription_routes.get_base_url())
def find_by_id(subscription_id... | 25.658537 | 80 | 0.794677 | from juno.resources import handler_request
from juno.resources.routes import subscription_routes
def create(dictionary):
return handler_request.post(subscription_routes.get_base_url(), dictionary)
def find_all():
return handler_request.get(subscription_routes.get_base_url())
def find_by_id(subscription_id... | true | true |
790763e76e04babab4a4fb2c61b512d111fae7a9 | 525 | py | Python | raritan/rpc/Time.py | daxm/raritan-pdu-json-rpc | 9593d165290e93db5676c884aac138aebb983cbd | [
"BSD-3-Clause"
] | null | null | null | raritan/rpc/Time.py | daxm/raritan-pdu-json-rpc | 9593d165290e93db5676c884aac138aebb983cbd | [
"BSD-3-Clause"
] | null | null | null | raritan/rpc/Time.py | daxm/raritan-pdu-json-rpc | 9593d165290e93db5676c884aac138aebb983cbd | [
"BSD-3-Clause"
] | 2 | 2021-02-24T00:45:25.000Z | 2021-11-29T17:27:19.000Z | import time, calendar
from datetime import datetime
#
# Decodes UNIX timestamp (UTC secs since epoch) to python datetime and vice versa.
#
class Time(datetime):
def __new__(cls, *x):
return datetime.__new__(cls, *x)
@staticmethod
def decode(json):
assert isinstance(json, int)
retur... | 23.863636 | 82 | 0.659048 | import time, calendar
from datetime import datetime
class Time(datetime):
def __new__(cls, *x):
return datetime.__new__(cls, *x)
@staticmethod
def decode(json):
assert isinstance(json, int)
return Time.utcfromtimestamp(json)
def encode(self):
timestamp = calendar.ti... | true | true |
790764e5b70291140639d8ff500555e96996eba0 | 75,990 | py | Python | src/pulp/pulp.py | ruxkor/pulp-or | 94f3cbe182e8adbd52bf996623f1f5e0ceb8e5ad | [
"MIT"
] | 2 | 2016-01-12T15:56:56.000Z | 2019-09-05T07:13:29.000Z | src/pulp/pulp.py | ruxkor/pulp-or | 94f3cbe182e8adbd52bf996623f1f5e0ceb8e5ad | [
"MIT"
] | null | null | null | src/pulp/pulp.py | ruxkor/pulp-or | 94f3cbe182e8adbd52bf996623f1f5e0ceb8e5ad | [
"MIT"
] | 7 | 2015-02-09T04:36:15.000Z | 2020-01-04T15:21:14.000Z | #! /usr/bin/env python
# PuLP : Python LP Modeler
# Version 1.5.1
# Copyright (c) 2002-2005, Jean-Sebastien Roy (js@jeannot.org)
# Modifications Copyright (c) 2007- Stuart Anthony Mitchell (s.mitchell@auckland.ac.nz)
# $Id: pulp.py 1791 2008-04-23 22:54:34Z smit023 $
# Permission is hereby granted, free of charge, to... | 33.75833 | 171 | 0.561311 |
"""
PuLP is an LP modeler written in python. PuLP can generate MPS or LP files
and call GLPK[1], COIN CLP/CBC[2], CPLEX[3], and GUROBI[4] to solve linear
problems.
See the examples directory for examples.
PuLP requires Python >= 2.5.
The examples require at least a solver in your PATH or a... | false | true |
79076564e8ffe360136a266074ef0aa351938b76 | 3,361 | py | Python | lnbits/extensions/lnurlp/lnurl.py | stepansnigirev/lnbits | 82731dc901780b959d6ebecc4f61be137c8d2884 | [
"MIT"
] | null | null | null | lnbits/extensions/lnurlp/lnurl.py | stepansnigirev/lnbits | 82731dc901780b959d6ebecc4f61be137c8d2884 | [
"MIT"
] | null | null | null | lnbits/extensions/lnurlp/lnurl.py | stepansnigirev/lnbits | 82731dc901780b959d6ebecc4f61be137c8d2884 | [
"MIT"
] | null | null | null | import hashlib
import math
from http import HTTPStatus
from quart import jsonify, url_for, request
from lnurl import LnurlPayResponse, LnurlPayActionResponse, LnurlErrorResponse # type: ignore
from lnbits.core.services import create_invoice
from lnbits.utils.exchange_rates import get_fiat_rate_satoshis
from . import... | 32.009524 | 116 | 0.61321 | import hashlib
import math
from http import HTTPStatus
from quart import jsonify, url_for, request
from lnurl import LnurlPayResponse, LnurlPayActionResponse, LnurlErrorResponse
from lnbits.core.services import create_invoice
from lnbits.utils.exchange_rates import get_fiat_rate_satoshis
from . import lnurlp_ext
fr... | true | true |
790765f7d394af7b8ea9033521908c3ce8929ca0 | 2,852 | py | Python | defoe/alto/queries/keyword_concordance_by_word.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 2 | 2022-02-14T12:10:54.000Z | 2022-02-14T12:35:44.000Z | defoe/alto/queries/keyword_concordance_by_word.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 17 | 2022-02-09T21:46:14.000Z | 2022-02-25T14:55:09.000Z | defoe/alto/queries/keyword_concordance_by_word.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 1 | 2022-02-14T13:19:08.000Z | 2022-02-14T13:19:08.000Z | """
Gets concordance for keywords and groups by word.
"""
from defoe import query_utils
from defoe.alto.query_utils import get_page_matches
def do_query(archives, config_file=None, logger=None, context=None):
"""
Gets concordance for keywords and groups by word.
config_file must be the path to a configu... | 31 | 75 | 0.547686 |
from defoe import query_utils
from defoe.alto.query_utils import get_page_matches
def do_query(archives, config_file=None, logger=None, context=None):
keywords = query_utils.get_normalized_keywords(config_file)
documents = archives.flatMap(
lambda archive: [document for document in list(archiv... | true | true |
790766a08780825704c1782b1118000d8a145bac | 2,668 | py | Python | chocs/http_request.py | gezpage/chocs | cf64a792989e3f23dc7f400045898761511a229a | [
"MIT"
] | null | null | null | chocs/http_request.py | gezpage/chocs | cf64a792989e3f23dc7f400045898761511a229a | [
"MIT"
] | null | null | null | chocs/http_request.py | gezpage/chocs | cf64a792989e3f23dc7f400045898761511a229a | [
"MIT"
] | null | null | null | from cgi import parse_header
from io import BytesIO
from typing import Dict
from typing import Optional
from typing import Tuple
from typing import Union
from .headers import Headers
from .http_method import HttpMethod
from .message.body import RequestBody
from .message.form_body import FormBody
from .message.json_bod... | 33.35 | 84 | 0.612444 | from cgi import parse_header
from io import BytesIO
from typing import Dict
from typing import Optional
from typing import Tuple
from typing import Union
from .headers import Headers
from .http_method import HttpMethod
from .message.body import RequestBody
from .message.form_body import FormBody
from .message.json_bod... | true | true |
79076703837acc7a26fa35bcc457666440e95048 | 5,389 | py | Python | selfdrive/locationd/models/car_kf.py | qiubit/openpilot | 013e49bf907539d119fbebcf02f4ce3749849065 | [
"MIT"
] | null | null | null | selfdrive/locationd/models/car_kf.py | qiubit/openpilot | 013e49bf907539d119fbebcf02f4ce3749849065 | [
"MIT"
] | null | null | null | selfdrive/locationd/models/car_kf.py | qiubit/openpilot | 013e49bf907539d119fbebcf02f4ce3749849065 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import math
import numpy as np
import sympy as sp
from selfdrive.locationd.models.constants import ObservationKind
from rednose.helpers.ekf_sym import EKF_sym, gen_code
i = 0
def _slice(n):
global i
s = slice(i, i + n)
i += n
return s
class States():
# Vehicle model p... | 27.494898 | 191 | 0.642234 |
import sys
import math
import numpy as np
import sympy as sp
from selfdrive.locationd.models.constants import ObservationKind
from rednose.helpers.ekf_sym import EKF_sym, gen_code
i = 0
def _slice(n):
global i
s = slice(i, i + n)
i += n
return s
class States():
STIFFNESS = _slice(1)
STEER_RATI... | true | true |
79076923568fabee83427836533b36fca23e5f6c | 795 | py | Python | set1/detectsb.py | elevenchars/cryptopals | d0cbe6dfcf7caf7f630b8867c38d1af2f42deb33 | [
"MIT"
] | null | null | null | set1/detectsb.py | elevenchars/cryptopals | d0cbe6dfcf7caf7f630b8867c38d1af2f42deb33 | [
"MIT"
] | null | null | null | set1/detectsb.py | elevenchars/cryptopals | d0cbe6dfcf7caf7f630b8867c38d1af2f42deb33 | [
"MIT"
] | null | null | null | import string
import sbxor
"""
Detect single-character XOR
One of the 60-character strings in this file (4.txt) has been encrypted by single-character XOR.
Find it.
"""
if __name__ == "__main__":
with open("data/4.txt", "r") as data_file:
data = data_file.read().split("\n")
candidates = []
for ... | 26.5 | 96 | 0.6 | import string
import sbxor
if __name__ == "__main__":
with open("data/4.txt", "r") as data_file:
data = data_file.read().split("\n")
candidates = []
for line in data[:]:
line_byte = bytearray.fromhex(line)
sb = sbxor.solve(line_byte)
if len(sb) != 0:
candidates... | true | true |
79076b9574986ce6cb14727d4a45b47fda3bc52a | 3,434 | py | Python | huaweicloud-sdk-kms/huaweicloudsdkkms/v1/model/key_status_info.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-kms/huaweicloudsdkkms/v1/model/key_status_info.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-kms/huaweicloudsdkkms/v1/model/key_status_info.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
class KeyStatusInfo:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is j... | 24.884058 | 74 | 0.534945 |
import pprint
import re
import six
class KeyStatusInfo:
sensitive_list = []
openapi_types = {
'key_id': 'str',
'key_state': 'str'
}
attribute_map = {
'key_id': 'key_id',
'key_state': 'key_state'
}
def __init__(self, key_id=None, key_state=None):
... | true | true |
79076b9ac6bcbac561556c30cc236bce2191838a | 7,627 | py | Python | Sea/adapter/connections/Connection.py | FRidh/Sea | b474e93a449570a9ba3b915c4d80f814feee2545 | [
"BSD-3-Clause"
] | 2 | 2015-07-02T13:34:09.000Z | 2015-09-28T09:07:52.000Z | Sea/adapter/connections/Connection.py | FRidh/Sea | b474e93a449570a9ba3b915c4d80f814feee2545 | [
"BSD-3-Clause"
] | null | null | null | Sea/adapter/connections/Connection.py | FRidh/Sea | b474e93a449570a9ba3b915c4d80f814feee2545 | [
"BSD-3-Clause"
] | 1 | 2022-01-22T03:01:54.000Z | 2022-01-22T03:01:54.000Z | import abc
import logging
import Sea
import numpy as np
import itertools
from ..base import Base
class Connection(Base, Sea.model.connections.Connection):
"""
Abstract base class for all :mod:`Sea.adapter.connections` classes.
"""
__metaclass__ = abc.ABCMeta
def __init__(self, obj, system, co... | 42.848315 | 168 | 0.629343 | import abc
import logging
import Sea
import numpy as np
import itertools
from ..base import Base
class Connection(Base, Sea.model.connections.Connection):
__metaclass__ = abc.ABCMeta
def __init__(self, obj, system, components):
Base.__init__(self, obj)
obj.addProperty("App::PropertyLink",... | true | true |
79076c669e78b6357ffc874149409ad05a4d6fd5 | 1,188 | py | Python | jetbot/motor.py | vstoneofficial/jetbot-mecanum | cc161b888b3e6cccfde4ff9b653c97af66adb5c8 | [
"MIT"
] | null | null | null | jetbot/motor.py | vstoneofficial/jetbot-mecanum | cc161b888b3e6cccfde4ff9b653c97af66adb5c8 | [
"MIT"
] | null | null | null | jetbot/motor.py | vstoneofficial/jetbot-mecanum | cc161b888b3e6cccfde4ff9b653c97af66adb5c8 | [
"MIT"
] | null | null | null | import atexit
from .MecanumRover_MotorDriver import MecanumRover_MotorDriver
import traitlets
from traitlets.config.configurable import Configurable
class Motor(Configurable):
value = traitlets.Float()
# config
alpha = traitlets.Float(default_value=1.0).tag(config=True)
beta = traitlets.Float(defaul... | 29.7 | 77 | 0.655724 | import atexit
from .MecanumRover_MotorDriver import MecanumRover_MotorDriver
import traitlets
from traitlets.config.configurable import Configurable
class Motor(Configurable):
value = traitlets.Float()
alpha = traitlets.Float(default_value=1.0).tag(config=True)
beta = traitlets.Float(default_value=... | true | true |
79076cafd810b7f65fffd21ff597d388ea804694 | 13,227 | py | Python | tools/third_party/pytest/testing/test_parseopt.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 9 | 2019-04-01T10:57:10.000Z | 2021-12-02T11:12:06.000Z | tools/third_party/pytest/testing/test_parseopt.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 33 | 2019-03-21T10:18:37.000Z | 2022-03-23T13:21:40.000Z | tools/third_party/pytest/testing/test_parseopt.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 11 | 2019-04-12T01:20:16.000Z | 2021-11-23T17:25:02.000Z | from __future__ import absolute_import, division, print_function
import argparse
import sys
import os
import py
import pytest
from _pytest.config import argparsing as parseopt
@pytest.fixture
def parser():
return parseopt.Parser()
class TestParser(object):
def test_no_help_by_default(self, capsys):
... | 39.249258 | 86 | 0.597112 | from __future__ import absolute_import, division, print_function
import argparse
import sys
import os
import py
import pytest
from _pytest.config import argparsing as parseopt
@pytest.fixture
def parser():
return parseopt.Parser()
class TestParser(object):
def test_no_help_by_default(self, capsys):
... | true | true |
79076d00240283dc304d55e6d32db1b60327fbb9 | 734 | py | Python | icarus_nmr/scripts/digital_controller_terminal_client.py | vstadnytskyi/icarus-nmr | 9f86ebb66256482023df4c15e552a5dd5573d3ba | [
"BSD-3-Clause"
] | 1 | 2022-02-07T22:05:17.000Z | 2022-02-07T22:05:17.000Z | icarus_nmr/scripts/digital_controller_terminal_client.py | vstadnytskyi/icarus-nmr | 9f86ebb66256482023df4c15e552a5dd5573d3ba | [
"BSD-3-Clause"
] | 25 | 2019-10-16T13:58:09.000Z | 2022-02-08T21:34:24.000Z | icarus_nmr/scripts/digital_controller_terminal_client.py | vstadnytskyi/icarus-nmr | 9f86ebb66256482023df4c15e552a5dd5573d3ba | [
"BSD-3-Clause"
] | 1 | 2022-02-07T22:05:27.000Z | 2022-02-07T22:05:27.000Z | #!/usr/bin/env python3
"""
"""
import socket
device_ca_server_prefix = f'{socket.gethostname()}_dio_controller:'
from caproto.threading.client import Context
ctx = Context()
ca_name = device_ca_server_prefix
pv_names = ['dio',
'bit0_indicator',
'bit0',
'b... | 23.677419 | 68 | 0.491826 |
import socket
device_ca_server_prefix = f'{socket.gethostname()}_dio_controller:'
from caproto.threading.client import Context
ctx = Context()
ca_name = device_ca_server_prefix
pv_names = ['dio',
'bit0_indicator',
'bit0',
'bit0_enable',
'bit1... | true | true |
79076f0dbe5eb29198394088ef9ac12dce4860fa | 7,565 | py | Python | rbtools/testing/testcase.py | pombredanne/rbtools | b4838a640b458641ffd233093ae65971d0b4d529 | [
"MIT"
] | 113 | 2015-01-01T15:26:22.000Z | 2022-01-02T11:37:46.000Z | rbtools/testing/testcase.py | pombredanne/rbtools | b4838a640b458641ffd233093ae65971d0b4d529 | [
"MIT"
] | 29 | 2015-01-06T21:31:50.000Z | 2022-01-12T05:37:26.000Z | rbtools/testing/testcase.py | pombredanne/rbtools | b4838a640b458641ffd233093ae65971d0b4d529 | [
"MIT"
] | 109 | 2015-01-03T20:55:05.000Z | 2022-02-15T13:18:44.000Z | """Base test cases for RBTools unit tests."""
from __future__ import unicode_literals
import os
import re
import shutil
import sys
import tempfile
import unittest
from contextlib import contextmanager
import six
from rbtools.utils.filesystem import cleanup_tempfiles, make_tempdir
import kgb
from rbtools.utils.file... | 28.655303 | 79 | 0.59458 |
from __future__ import unicode_literals
import os
import re
import shutil
import sys
import tempfile
import unittest
from contextlib import contextmanager
import six
from rbtools.utils.filesystem import cleanup_tempfiles, make_tempdir
import kgb
from rbtools.utils.filesystem import make_tempfile
class TestCase(u... | true | true |
79076fc838d5a53d885fce2b85738d7a10c638c3 | 1,340 | py | Python | RRDGraphs/rrd_1month.py | SelectLOL1/BeagleBoneBlack_PRU_PowerMeter | ee027e2713e1649ca7c4b68a737cd611695a6855 | [
"MIT"
] | null | null | null | RRDGraphs/rrd_1month.py | SelectLOL1/BeagleBoneBlack_PRU_PowerMeter | ee027e2713e1649ca7c4b68a737cd611695a6855 | [
"MIT"
] | null | null | null | RRDGraphs/rrd_1month.py | SelectLOL1/BeagleBoneBlack_PRU_PowerMeter | ee027e2713e1649ca7c4b68a737cd611695a6855 | [
"MIT"
] | null | null | null | import time
import matplotlib.pyplot as plt
import matplotlib.dates as mdate
import numpy as np
import rrdtool
start = 2628000
end = 0
if int(end) <= 0:
end = 2
if int(start) <= 0:
start = 600
epochTimeNow = int(time.time()-1)
data = rrdtool.fetch('/home/bca/rrdtoolfilesave/powerCapturenew.rrd', 'AVERAGE',
... | 29.130435 | 84 | 0.680597 | import time
import matplotlib.pyplot as plt
import matplotlib.dates as mdate
import numpy as np
import rrdtool
start = 2628000
end = 0
if int(end) <= 0:
end = 2
if int(start) <= 0:
start = 600
epochTimeNow = int(time.time()-1)
data = rrdtool.fetch('/home/bca/rrdtoolfilesave/powerCapturenew.rrd', 'AVERAGE',
... | true | true |
79076fc8ab25045625ad856ab2bf8bfbdff1e38d | 28,127 | py | Python | gsfpy3_09/gsfSensorSpecific.py | irewolepeter/gsfpy_USM_Implementation | c4614ac3f7d833eb86ea38c7708108b130f96612 | [
"MIT"
] | 7 | 2020-07-01T07:12:19.000Z | 2022-01-20T20:39:57.000Z | gsfpy3_09/gsfSensorSpecific.py | irewolepeter/gsfpy_USM_Implementation | c4614ac3f7d833eb86ea38c7708108b130f96612 | [
"MIT"
] | 36 | 2020-06-23T09:10:15.000Z | 2022-03-22T10:27:58.000Z | gsfpy3_09/gsfSensorSpecific.py | irewolepeter/gsfpy_USM_Implementation | c4614ac3f7d833eb86ea38c7708108b130f96612 | [
"MIT"
] | 2 | 2021-02-07T13:21:52.000Z | 2021-06-24T19:16:16.000Z | from ctypes import (
Structure,
Union,
c_char,
c_double,
c_int,
c_long,
c_short,
c_ubyte,
c_uint,
c_ulong,
c_ushort,
)
from . import timespec
class c_gsfSeaBeamSpecific(Structure):
_fields_ = [("EclipseTime", c_ushort)]
class c_gsfEM100Specific(Structure):
_field... | 30.908791 | 76 | 0.598606 | from ctypes import (
Structure,
Union,
c_char,
c_double,
c_int,
c_long,
c_short,
c_ubyte,
c_uint,
c_ulong,
c_ushort,
)
from . import timespec
class c_gsfSeaBeamSpecific(Structure):
_fields_ = [("EclipseTime", c_ushort)]
class c_gsfEM100Specific(Structure):
_field... | true | true |
7907702807ec663bdaf71f3b4d3f16e5b1ba333b | 846 | py | Python | 3rdparty/meshlab-master/src/external/openkinect/wrappers/python/setup.py | HoEmpire/slambook2 | 96d360f32aa5d8b5c5dcbbf9ee7ba865e84409f4 | [
"MIT"
] | 1 | 2020-02-02T13:40:22.000Z | 2020-02-02T13:40:22.000Z | ext/libfreenect/wrappers/python/setup.py | captdeaf/CarBoundary | 35e5cb9a87ac4e693f8abdb79de4e97973a3329a | [
"BSD-3-Clause"
] | null | null | null | ext/libfreenect/wrappers/python/setup.py | captdeaf/CarBoundary | 35e5cb9a87ac4e693f8abdb79de4e97973a3329a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [Extension("freenect", ["freenect.pyx"],
libraries=['usb-1.0', 'freenect', 'freenect_sync'],
runtime_library_dirs=['/us... | 44.526316 | 98 | 0.471631 |
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [Extension("freenect", ["freenect.pyx"],
libraries=['usb-1.0', 'freenect', 'freenect_sync'],
runtime_library_dirs=['/usr/local/lib', '/usr/l... | true | true |
790770ce1fb2b1ddb9ad4ee1cd21bca3681fc4cf | 182,295 | py | Python | core/domain/wipeout_service_test.py | luccasparoni/oppia | 988f7c1e818faf774ec424e33b5dd0267c40237b | [
"Apache-2.0"
] | null | null | null | core/domain/wipeout_service_test.py | luccasparoni/oppia | 988f7c1e818faf774ec424e33b5dd0267c40237b | [
"Apache-2.0"
] | null | null | null | core/domain/wipeout_service_test.py | luccasparoni/oppia | 988f7c1e818faf774ec424e33b5dd0267c40237b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 41.629367 | 80 | 0.676327 |
from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import logging
from constants import constants
from core.domain import auth_services
from core.domain import collection_services
from core.domain import email_manager
from core.domain import exp_services
... | true | true |
790770e901bb26f50dd54f9075e5f71496273ebc | 483 | py | Python | market_place/users/migrations/0003_auto_20160708_0036.py | otherland8/market-place | ebf21a77cf9b3998e270ebd2d4422d7ce997e472 | [
"MIT"
] | null | null | null | market_place/users/migrations/0003_auto_20160708_0036.py | otherland8/market-place | ebf21a77cf9b3998e270ebd2d4422d7ce997e472 | [
"MIT"
] | null | null | null | market_place/users/migrations/0003_auto_20160708_0036.py | otherland8/market-place | ebf21a77cf9b3998e270ebd2d4422d7ce997e472 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-07-07 21:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0002_auto_20160706_2232'),
]
operations = [
migrations.AlterField(
... | 23 | 74 | 0.6294 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0002_auto_20160706_2232'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='picture_path',... | true | true |
7907712acf0f4f60945654d9a3fc61cc31231794 | 3,502 | py | Python | workstation-backend/workstation/settings.py | cindy21td/WorkStation | fd8cfd86d7538f55cfbeee8e17c273546691f5a8 | [
"MIT"
] | null | null | null | workstation-backend/workstation/settings.py | cindy21td/WorkStation | fd8cfd86d7538f55cfbeee8e17c273546691f5a8 | [
"MIT"
] | null | null | null | workstation-backend/workstation/settings.py | cindy21td/WorkStation | fd8cfd86d7538f55cfbeee8e17c273546691f5a8 | [
"MIT"
] | null | null | null | """
Django settings for workstation project.
Generated by 'django-admin startproject' using Django 4.0.1.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
from dote... | 25.75 | 91 | 0.705026 | from dotenv import load_dotenv
from pathlib import Path
import os
load_dotenv()
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = str(os.getenv("SECRET_KEY"))
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
... | true | true |
7907713a1697df73607a8f7af9e4231797bc9ceb | 6,830 | py | Python | venv/Lib/site-packages/pandas/tests/tslibs/test_parsing.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/tslibs/test_parsing.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/tslibs/test_parsing.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | """
Tests for Timestamp parsing, aimed at pandas/_libs/tslibs/parsing.pyx
"""
from datetime import datetime
import re
from dateutil.parser import parse
import numpy as np
import pytest
from pandas._libs.tslibs import parsing
from pandas._libs.tslibs.parsing import parse_time_string
import pandas.util._tes... | 29.825328 | 89 | 0.599122 | from datetime import datetime
import re
from dateutil.parser import parse
import numpy as np
import pytest
from pandas._libs.tslibs import parsing
from pandas._libs.tslibs.parsing import parse_time_string
import pandas.util._test_decorators as td
import pandas._testing as tm
def test_parse_time_strin... | true | true |
79077298425f95eefa6233036c8a6843840ee10f | 2,515 | py | Python | plot_conditionals_with_tis.py | samiemostafavi/conditional-latency-probability-prediction | a196f2db8c6f30f8613797b6a23bffd77a01e1e3 | [
"MIT"
] | null | null | null | plot_conditionals_with_tis.py | samiemostafavi/conditional-latency-probability-prediction | a196f2db8c6f30f8613797b6a23bffd77a01e1e3 | [
"MIT"
] | null | null | null | plot_conditionals_with_tis.py | samiemostafavi/conditional-latency-probability-prediction | a196f2db8c6f30f8613797b6a23bffd77a01e1e3 | [
"MIT"
] | null | null | null | import numpy as np
import pyarrow as pa
import pyarrow.parquet as pq
import pyarrow.compute as pc
import matplotlib.pyplot as plt
import seaborn as sns
from pr3d.nonbayesian import ConditionalGammaEVM
# load dataset first
file_addresses = ['dataset_onehop_processed.parquet']
table = pa.concat_tables(
pq.read_tabl... | 31.049383 | 99 | 0.662425 | import numpy as np
import pyarrow as pa
import pyarrow.parquet as pq
import pyarrow.compute as pc
import matplotlib.pyplot as plt
import seaborn as sns
from pr3d.nonbayesian import ConditionalGammaEVM
file_addresses = ['dataset_onehop_processed.parquet']
table = pa.concat_tables(
pq.read_table(
file_addr... | true | true |
790772e2333aaf3d9ac9b0a5be9f73acb7efcb30 | 353 | py | Python | wagtailstreamforms/utils/requests.py | LogicalAddress/wagtailstreamforms | d2e9519de643f18e2d879b2cd648f532c9673580 | [
"MIT"
] | null | null | null | wagtailstreamforms/utils/requests.py | LogicalAddress/wagtailstreamforms | d2e9519de643f18e2d879b2cd648f532c9673580 | [
"MIT"
] | null | null | null | wagtailstreamforms/utils/requests.py | LogicalAddress/wagtailstreamforms | d2e9519de643f18e2d879b2cd648f532c9673580 | [
"MIT"
] | 1 | 2020-05-13T16:26:38.000Z | 2020-05-13T16:26:38.000Z | from wagtailstreamforms.models import Form
def get_form_instance_from_request(request):
""" Get the form class from the request. """
form_id = request.POST.get("form_id")
if form_id and form_id.isdigit():
try:
return Form.objects.get(pk=int(form_id))
except Form.DoesNotExist:
... | 25.214286 | 52 | 0.657224 | from wagtailstreamforms.models import Form
def get_form_instance_from_request(request):
form_id = request.POST.get("form_id")
if form_id and form_id.isdigit():
try:
return Form.objects.get(pk=int(form_id))
except Form.DoesNotExist:
pass
return None
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.