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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7fd52ba1635643bf559ba3d3d8a3f0330d80983 | 5,576 | py | Python | userbot/modules/animasi1.py | Wiki28/WikixCilik | a7e8d684e34174001af3e69d1f00de4e98243abe | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/animasi1.py | Wiki28/WikixCilik | a7e8d684e34174001af3e69d1f00de4e98243abe | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/animasi1.py | Wiki28/WikixCilik | a7e8d684e34174001af3e69d1f00de4e98243abe | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Ported by @Pocongonlen
# From Pocong-Userbot <https://github.com/poocong/Pocong-Userbot>
# Recode by @greyyvbss
from time import sleep
from userbot import CMD_HANDLER as cmd
from userbot import CMD_HELP
from userbot.utils import edit_or_reply, cilik_cmd
@cilik_cmd(pattern="hai(?: |$)(.*)")
async def _(event):
... | 27.60396 | 71 | 0.578551 |
from time import sleep
from userbot import CMD_HANDLER as cmd
from userbot import CMD_HELP
from userbot.utils import edit_or_reply, cilik_cmd
@cilik_cmd(pattern="hai(?: |$)(.*)")
async def _(event):
xx = await edit_or_reply(event, f"**Hai , Assalamualaikum**")
sleep(1)
await xx.edit("Kalian Nungguin... | true | true |
f7fd5350f744a4ed47ffca2551d7feba45a71b45 | 2,976 | py | Python | python/mxnet/kvstore/kvstore_server.py | mchoi8739/incubator-mxnet | cff583250479b31c394f568ffb835b720cb84dc4 | [
"Apache-2.0"
] | 211 | 2016-06-06T08:32:36.000Z | 2021-07-03T16:50:16.000Z | python/mxnet/kvstore/kvstore_server.py | mchoi8739/incubator-mxnet | cff583250479b31c394f568ffb835b720cb84dc4 | [
"Apache-2.0"
] | 82 | 2016-03-29T02:40:02.000Z | 2021-02-06T22:20:40.000Z | python/mxnet/kvstore/kvstore_server.py | mchoi8739/incubator-mxnet | cff583250479b31c394f568ffb835b720cb84dc4 | [
"Apache-2.0"
] | 58 | 2016-10-27T07:37:08.000Z | 2021-07-03T16:50:17.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.206897 | 95 | 0.629704 |
import ctypes
import sys
import pickle
import logging
from ..base import _LIB, check_call
from .base import create
__all__ = ['KVStoreServer']
class KVStoreServer(object):
def __init__(self, kvstore):
self.kvstore = kvstore
self.handle = kvstore.handle
self.init_logginig ... | true | true |
f7fd53dd051aa5265b5f35472858eecc129ca7ef | 2,968 | py | Python | src/openeo_grass_gis_driver/udf_lang_udf_type.py | metzm/openeo-grassgis-driver | 4831f1778921f78bf7fc7688393682a8dfe92a7a | [
"Apache-2.0"
] | null | null | null | src/openeo_grass_gis_driver/udf_lang_udf_type.py | metzm/openeo-grassgis-driver | 4831f1778921f78bf7fc7688393682a8dfe92a7a | [
"Apache-2.0"
] | null | null | null | src/openeo_grass_gis_driver/udf_lang_udf_type.py | metzm/openeo-grassgis-driver | 4831f1778921f78bf7fc7688393682a8dfe92a7a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from openeo_grass_gis_driver.actinia_processing.actinia_interface import ActiniaInterface
from flask import make_response, jsonify
from openeo_grass_gis_driver.process_graph_db import GraphDB
# from .actinia_processing import udf_reduce_time
# from flask_restful import Resource
from openeo_grass... | 38.051282 | 117 | 0.605458 |
from openeo_grass_gis_driver.actinia_processing.actinia_interface import ActiniaInterface
from flask import make_response, jsonify
from openeo_grass_gis_driver.process_graph_db import GraphDB
from openeo_grass_gis_driver.authentication import ResourceBase
__license__ = "Apache License, Version 2.0"
__author__ = "S... | true | true |
f7fd5459c1ffdbaf4ef78ac96d89c51a0d4808d6 | 19,222 | py | Python | ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py | Syndra/Ambari-source | 717526b2bf3636622212b14de0d3d298a20c7370 | [
"Apache-2.0"
] | 1 | 2021-06-24T07:59:25.000Z | 2021-06-24T07:59:25.000Z | ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py | Syndra/Ambari-source | 717526b2bf3636622212b14de0d3d298a20c7370 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py | Syndra/Ambari-source | 717526b2bf3636622212b14de0d3d298a20c7370 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... | 51.12234 | 157 | 0.79487 |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this... | false | true |
f7fd5478e7454ef964bb747ed6c016a4f2cd7b63 | 4,112 | py | Python | preprocessing/vcc2018/feature_reader.py | unilight/cdvae-vc | 6470b0e587d40f6d1d91712a0dacef5ff8d661ce | [
"MIT"
] | 55 | 2019-07-08T09:40:50.000Z | 2021-12-20T15:30:58.000Z | preprocessing/vcc2018/feature_reader.py | yu-tsao/cdvae-vc | 6470b0e587d40f6d1d91712a0dacef5ff8d661ce | [
"MIT"
] | 7 | 2020-01-28T22:12:32.000Z | 2021-08-25T14:47:40.000Z | preprocessing/vcc2018/feature_reader.py | yu-tsao/cdvae-vc | 6470b0e587d40f6d1d91712a0dacef5ff8d661ce | [
"MIT"
] | 13 | 2019-07-09T00:37:14.000Z | 2021-12-27T06:34:14.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
import argparse
import os
import sys
import numpy as np
import h5py
import logging
from scipy.io import wavfile
from sprocket.speech.synthesizer import Synthesizer
import tensorflow as tf
def Segment_feature_reader(
file_pattern,
... | 29.163121 | 84 | 0.57393 |
from __future__ import division
import argparse
import os
import sys
import numpy as np
import h5py
import logging
from scipy.io import wavfile
from sprocket.speech.synthesizer import Synthesizer
import tensorflow as tf
def Segment_feature_reader(
file_pattern,
feat_param,
batch_size,
crop_length,... | true | true |
f7fd54b9468d971a394bf3a23a022dda10d440ca | 130,636 | py | Python | src/transformers/models/big_bird/modeling_big_bird.py | theainerd/transformers | f7328de46dbeda4992a093a0501932bf0fc7b76f | [
"Apache-2.0"
] | 34 | 2021-07-05T02:44:31.000Z | 2022-03-28T14:39:57.000Z | src/transformers/models/big_bird/modeling_big_bird.py | theainerd/transformers | f7328de46dbeda4992a093a0501932bf0fc7b76f | [
"Apache-2.0"
] | 3 | 2021-07-22T15:49:44.000Z | 2022-03-19T08:46:27.000Z | src/transformers/models/big_bird/modeling_big_bird.py | theainerd/transformers | f7328de46dbeda4992a093a0501932bf0fc7b76f | [
"Apache-2.0"
] | 6 | 2021-07-05T02:44:32.000Z | 2022-02-14T10:10:13.000Z | # coding=utf-8
# Copyright 2021 Google Research and The HuggingFace Inc. team. 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/LICE... | 43.896505 | 213 | 0.635414 |
import math
import os
from dataclasses import dataclass
from typing import Optional, Tuple
import numpy as np
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from torch import nn
from torch.nn import CrossEntropyLoss, MSELoss
from ...activations import ACT2FN
from ...file_ut... | true | true |
f7fd55932dd9961e78482975451755e03c572f38 | 9,361 | py | Python | pavia_SdA.py | RichardScottOZ/deeplearn_hsi | f3c88e779d5a9a0afbdd3d41d3b08839c984bdf6 | [
"BSD-2-Clause"
] | 92 | 2016-03-05T23:33:13.000Z | 2022-01-12T11:44:16.000Z | pavia_SdA.py | RichardScottOZ/deeplearn_hsi | f3c88e779d5a9a0afbdd3d41d3b08839c984bdf6 | [
"BSD-2-Clause"
] | 4 | 2016-06-03T14:07:19.000Z | 2018-11-18T14:04:57.000Z | pavia_SdA.py | RichardScottOZ/deeplearn_hsi | f3c88e779d5a9a0afbdd3d41d3b08839c984bdf6 | [
"BSD-2-Clause"
] | 46 | 2016-05-25T13:59:30.000Z | 2022-02-08T12:10:33.000Z | import os
import sys
import time
import scipy.io as sio
import numpy
import scipy
import theano
import theano.tensor as T
from scipy.stats import t
from sklearn import svm
from theano.tensor.shared_randomstreams import RandomStreams
import PIL.Image
from SdA import SdA
from hsi_utils import *
cmap = numpy.asarray( [[... | 37.294821 | 82 | 0.590428 | import os
import sys
import time
import scipy.io as sio
import numpy
import scipy
import theano
import theano.tensor as T
from scipy.stats import t
from sklearn import svm
from theano.tensor.shared_randomstreams import RandomStreams
import PIL.Image
from SdA import SdA
from hsi_utils import *
cmap = numpy.asarray( [[... | false | true |
f7fd56537e30c96a86303d1da2f4016aec414c6a | 8,264 | py | Python | RESSPyLab/sqp_solver.py | ioannis-vm/RESSPyLab | 306fc24d5f8ece8f2f2de274b56b80ba2019f605 | [
"MIT"
] | 7 | 2019-10-15T09:16:41.000Z | 2021-09-24T11:28:45.000Z | RESSPyLab/sqp_solver.py | ioannis-vm/RESSPyLab | 306fc24d5f8ece8f2f2de274b56b80ba2019f605 | [
"MIT"
] | 3 | 2020-10-22T14:27:22.000Z | 2021-11-15T17:46:49.000Z | RESSPyLab/sqp_solver.py | ioannis-vm/RESSPyLab | 306fc24d5f8ece8f2f2de274b56b80ba2019f605 | [
"MIT"
] | 6 | 2019-07-22T05:47:10.000Z | 2021-10-24T02:06:26.000Z | """@package sqp_linsearch
Abstract class for RESSPyLab SQP solvers.
"""
import numpy as np
class SqpSolver:
def __init__(self, objective_function, constraint, dumper=None):
""" Abstract class to define SQP solvers given the objective function to minimize and the constraints to apply.
:param MatM... | 42.818653 | 119 | 0.639279 | import numpy as np
class SqpSolver:
def __init__(self, objective_function, constraint, dumper=None):
self.total_iterations = 0
self.maximum_iterations = 3000
self.precision = np.sqrt(np.finfo(float).eps)
self.constraint = constraint
self.objective_fun = objective_function
... | true | true |
f7fd580bab329ba69aca4bcbee258d64b2851965 | 19,086 | py | Python | src/request.py | piwaniuk/critic | 28ed20bb8032d7cc5aa23de98da51e619fd84164 | [
"Apache-2.0"
] | 216 | 2015-01-05T12:48:10.000Z | 2022-03-08T00:12:23.000Z | src/request.py | piwaniuk/critic | 28ed20bb8032d7cc5aa23de98da51e619fd84164 | [
"Apache-2.0"
] | 55 | 2015-02-28T12:10:26.000Z | 2020-11-18T17:45:16.000Z | src/request.py | piwaniuk/critic | 28ed20bb8032d7cc5aa23de98da51e619fd84164 | [
"Apache-2.0"
] | 34 | 2015-05-02T15:15:10.000Z | 2020-06-15T19:20:37.000Z | # -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2012 Jens Lindström, Opera Software ASA
#
# 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... | 35.214022 | 136 | 0.640889 |
import re
import urllib
import urlparse
import httplib
import wsgiref.util
import base
import auth
import configuration
import dbutils
INSECURE_PATHS = set(["login", "validatelogin",
"createuser", "registeruser"])
def decodeURIComponent(text):
return urllib.unquote_plus(t... | true | true |
f7fd5887998a3b7f5618cb537e4c36393bdfdad6 | 1,482 | py | Python | authentication/socialaccount/providers/mailru/tests.py | vo0doO/pydj-persweb | efcd6b7090230f7c0b9ec056008f6d1d9e876ed9 | [
"CC0-1.0"
] | null | null | null | authentication/socialaccount/providers/mailru/tests.py | vo0doO/pydj-persweb | efcd6b7090230f7c0b9ec056008f6d1d9e876ed9 | [
"CC0-1.0"
] | 4 | 2020-05-06T17:22:00.000Z | 2021-12-13T20:43:30.000Z | authentication/socialaccount/providers/mailru/tests.py | vo0doO/pydj-persweb | efcd6b7090230f7c0b9ec056008f6d1d9e876ed9 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from authentication.socialaccount.tests import OAuth2TestsMixin
from authentication.tests import MockedResponse, TestCase
from .provider import MailRuProvider
class MailRuTests(OAuth2TestsMixin, TestCase):
provider_id = MailRuProvi... | 67.363636 | 695 | 0.674089 |
from __future__ import absolute_import, unicode_literals
from authentication.socialaccount.tests import OAuth2TestsMixin
from authentication.tests import MockedResponse, TestCase
from .provider import MailRuProvider
class MailRuTests(OAuth2TestsMixin, TestCase):
provider_id = MailRuProvider.id
def get_moc... | true | true |
f7fd596d6ee052f5f626bc50b739bace5907c7c5 | 11,222 | py | Python | 1. Knowledge/minesweeper/minesweeper.py | smpace/IntroductionToArtificialIntelligence | 3afb40b6fd6926e2745c0252b80c35f838532079 | [
"MIT"
] | null | null | null | 1. Knowledge/minesweeper/minesweeper.py | smpace/IntroductionToArtificialIntelligence | 3afb40b6fd6926e2745c0252b80c35f838532079 | [
"MIT"
] | null | null | null | 1. Knowledge/minesweeper/minesweeper.py | smpace/IntroductionToArtificialIntelligence | 3afb40b6fd6926e2745c0252b80c35f838532079 | [
"MIT"
] | null | null | null | import itertools
import random
import copy
class Minesweeper():
"""
Minesweeper game representation
"""
def __init__(self, height=8, width=8, mines=8):
# Set initial width, height, and number of mines
self.height = height
self.width = width
self.mines = set()
... | 33.598802 | 100 | 0.536892 | import itertools
import random
import copy
class Minesweeper():
def __init__(self, height=8, width=8, mines=8):
self.height = height
self.width = width
self.mines = set()
self.board = []
for i in range(self.height):
row = []
for j... | true | true |
f7fd59b151bf404ec4bd98e86694b245df82dc00 | 74 | py | Python | riki/tests/test_import.py | afenyvesi/riki | dfd6579b3400e8ebcad1c4a610902124fad8f302 | [
"MIT"
] | null | null | null | riki/tests/test_import.py | afenyvesi/riki | dfd6579b3400e8ebcad1c4a610902124fad8f302 | [
"MIT"
] | 1 | 2020-01-25T23:07:00.000Z | 2020-01-25T23:07:00.000Z | riki/tests/test_import.py | afenyvesi/riki | dfd6579b3400e8ebcad1c4a610902124fad8f302 | [
"MIT"
] | 2 | 2020-01-25T22:21:33.000Z | 2020-07-15T20:59:18.000Z | def test_import_version():
from riki import _version
assert True
| 14.8 | 29 | 0.72973 | def test_import_version():
from riki import _version
assert True
| true | true |
f7fd5a57714a93ffdd64a6ee4500241cd4cf6541 | 2,072 | py | Python | python/example_code/emr/emrfs-boto-step.py | gabehollombe-aws/aws-doc-sdk-examples | dfc0e06ebe1762ab127f3ef5f425507644c6a99c | [
"Apache-2.0"
] | 12 | 2020-07-28T01:20:15.000Z | 2021-12-10T10:52:49.000Z | python/example_code/emr/emrfs-boto-step.py | gabehollombe-aws/aws-doc-sdk-examples | dfc0e06ebe1762ab127f3ef5f425507644c6a99c | [
"Apache-2.0"
] | 5 | 2021-12-10T01:52:47.000Z | 2022-01-04T16:47:45.000Z | python/example_code/emr/emrfs-boto-step.py | gabehollombe-aws/aws-doc-sdk-examples | dfc0e06ebe1762ab127f3ef5f425507644c6a99c | [
"Apache-2.0"
] | 1 | 2021-10-04T23:39:14.000Z | 2021-10-04T23:39:14.000Z | #
# Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# This file is licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# Thi... | 34.533333 | 176 | 0.685811 |
import boto3
from botocore.exceptions import ClientError
job_flow_id = 'CLUSTER_ID'
job_flow_step_01 = {
'Name': 'Example EMRFS Sync Step',
'ActionOnFailure': 'CONTINUE',
'HadoopJarStep': {
'Jar': 's3://elasticmapreduce/libs/script-runner/script-runner.jar',
... | true | true |
f7fd5baff69a7e75a3c06084b48491cb0e7072d4 | 686 | py | Python | src/uff/linear_array.py | davidbradway/uff.py | 118001211018a4fc95d1dd7304ae6335bdf805f9 | [
"MIT"
] | 7 | 2021-11-16T17:27:54.000Z | 2021-12-25T18:09:35.000Z | src/uff/linear_array.py | davidbradway/uff.py | 118001211018a4fc95d1dd7304ae6335bdf805f9 | [
"MIT"
] | 6 | 2021-11-16T17:27:33.000Z | 2022-02-04T08:51:06.000Z | src/uff/linear_array.py | davidbradway/uff.py | 118001211018a4fc95d1dd7304ae6335bdf805f9 | [
"MIT"
] | 1 | 2021-11-16T19:26:36.000Z | 2021-11-16T19:26:36.000Z | from dataclasses import dataclass
from uff.probe import Probe
@dataclass
class LinearArray(Probe):
"""
Describes a linear array, made of identical elements, uniformly distributed on a line.
Attributes:
number_elements (int): Number of elements in the array
pitch (float): Distance... | 27.44 | 92 | 0.685131 | from dataclasses import dataclass
from uff.probe import Probe
@dataclass
class LinearArray(Probe):
def str_name(self):
return 'probe.linear_array'
number_elements: int
pitch: float
element_width: float
element_height: float
| true | true |
f7fd5bec504e17993ed33a1ea47575eb33eb8afb | 79,085 | py | Python | scipy/stats/tests/test_mstats_basic.py | jcharlong/scipy | 153467a9174b0c6f4b90ffeed5871e5018658108 | [
"BSD-3-Clause"
] | null | null | null | scipy/stats/tests/test_mstats_basic.py | jcharlong/scipy | 153467a9174b0c6f4b90ffeed5871e5018658108 | [
"BSD-3-Clause"
] | null | null | null | scipy/stats/tests/test_mstats_basic.py | jcharlong/scipy | 153467a9174b0c6f4b90ffeed5871e5018658108 | [
"BSD-3-Clause"
] | null | null | null | """
Tests for the stats.mstats module (support for masked arrays)
"""
import warnings
import platform
import numpy as np
from numpy import nan
import numpy.ma as ma
from numpy.ma import masked, nomask
import scipy.stats.mstats as mstats
from scipy import stats
from .common_tests import check_named_results
import pyte... | 42.223705 | 108 | 0.551925 | import warnings
import platform
import numpy as np
from numpy import nan
import numpy.ma as ma
from numpy.ma import masked, nomask
import scipy.stats.mstats as mstats
from scipy import stats
from .common_tests import check_named_results
import pytest
from pytest import raises as assert_raises
from numpy.ma.testutils ... | true | true |
f7fd5c2b6fdd6bd9ae86f2c80b85dd2da201fb55 | 1,913 | py | Python | astroquery/utils/progressbar.py | wschoenell/astroquery | fe8a5e31035a1e9cdcf2603fb4da9e2fc5000d31 | [
"BSD-3-Clause"
] | 1 | 2015-05-10T00:58:21.000Z | 2015-05-10T00:58:21.000Z | astroquery/utils/progressbar.py | wschoenell/astroquery | fe8a5e31035a1e9cdcf2603fb4da9e2fc5000d31 | [
"BSD-3-Clause"
] | null | null | null | astroquery/utils/progressbar.py | wschoenell/astroquery | fe8a5e31035a1e9cdcf2603fb4da9e2fc5000d31 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import gzip
import sys
from astropy.extern.six import StringIO
from astropy.extern.six.moves import urllib
from astropy.io import fits
__all__ = ['chunk_report','chunk_read']
def chunk_report(bytes_so_far, chunk_size, total_size):
if total_size > ... | 25.506667 | 71 | 0.636696 |
import gzip
import sys
from astropy.extern.six import StringIO
from astropy.extern.six.moves import urllib
from astropy.io import fits
__all__ = ['chunk_report','chunk_read']
def chunk_report(bytes_so_far, chunk_size, total_size):
if total_size > 0:
percent = float(bytes_so_far) / total_size
p... | true | true |
f7fd5c9c66f2625fcbdc54656e71dd7e346dd0eb | 7,729 | py | Python | datageneration/dbmake_contour.py | utlive/VIDMAP | 60656d532ac497c1070f1c94c06807b2d57e2af4 | [
"Unlicense"
] | 1 | 2022-02-21T02:45:25.000Z | 2022-02-21T02:45:25.000Z | datageneration/dbmake_contour.py | utlive/VIDMAP | 60656d532ac497c1070f1c94c06807b2d57e2af4 | [
"Unlicense"
] | null | null | null | datageneration/dbmake_contour.py | utlive/VIDMAP | 60656d532ac497c1070f1c94c06807b2d57e2af4 | [
"Unlicense"
] | null | null | null | import skimage.io
import skvideo.io
import os
import h5py
from sklearn.externals import joblib
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import f1_score
import scipy.misc
import scipy.signal
import numpy as np
from sporco import util
import... | 28.105455 | 121 | 0.629706 | import skimage.io
import skvideo.io
import os
import h5py
from sklearn.externals import joblib
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import f1_score
import scipy.misc
import scipy.signal
import numpy as np
from sporco import util
import... | false | true |
f7fd5d0a98d5d7b6ed4a472562be817ce79fd403 | 5,609 | py | Python | routes.py | itsjatin135s/Ekchhat | 66d1d14314c75a2937350a467afa571ed4a32fe4 | [
"MIT"
] | null | null | null | routes.py | itsjatin135s/Ekchhat | 66d1d14314c75a2937350a467afa571ed4a32fe4 | [
"MIT"
] | null | null | null | routes.py | itsjatin135s/Ekchhat | 66d1d14314c75a2937350a467afa571ed4a32fe4 | [
"MIT"
] | null | null | null | from flask import render_template, redirect, url_for, flash,request
from forms import ContactUsForm,DonateForm,PartnerForm
from models import ContactUs,Donate,Partner
from __init__ import db, app
from selenium import webdriver
from bs4 import BeautifulSoup
import pandas as pd
from webdriver_manager.chrome import Ch... | 34.411043 | 328 | 0.617757 | from flask import render_template, redirect, url_for, flash,request
from forms import ContactUsForm,DonateForm,PartnerForm
from models import ContactUs,Donate,Partner
from __init__ import db, app
from selenium import webdriver
from bs4 import BeautifulSoup
import pandas as pd
from webdriver_manager.chrome import Ch... | true | true |
f7fd5d2765f642a996e1ea57f95263cadb792804 | 16,827 | py | Python | Tests/test_Crystal.py | erpeg/biopython | 296b6b451ce7161fdace2fd36d0817722491d733 | [
"BSD-3-Clause"
] | 2 | 2020-06-25T12:52:03.000Z | 2020-07-11T09:47:34.000Z | Tests/test_Crystal.py | cosign070128/biopython | 2f02e34ba76306e9c27eec9e051809bec2cece9b | [
"BSD-3-Clause"
] | 9 | 2020-05-05T00:54:23.000Z | 2020-06-09T17:10:45.000Z | Tests/test_Crystal.py | cosign070128/biopython | 2f02e34ba76306e9c27eec9e051809bec2cece9b | [
"BSD-3-Clause"
] | 3 | 2020-05-17T19:43:05.000Z | 2020-06-04T20:44:38.000Z | # Copyright 2002 by Katharine Lindner. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
# python unittest framework
"""Tests for Crystal module (OBSOLETE)."""
import unittest
im... | 32.737354 | 82 | 0.574493 |
import unittest
import copy
import warnings
from Bio import BiopythonDeprecationWarning
with warnings.catch_warnings():
warnings.simplefilter("ignore", BiopythonDeprecationWarning)
from Bio.Crystal import Hetero, Chain, Crystal, CrystalError
class ChainTestCase(unittest.TestCase):
def setUp(... | true | true |
f7fd5df126bc1afb609fc7078534d1b8c043c1b8 | 367 | py | Python | spiketools/tests/utils/test_base.py | claire98han/SpikeTools | f1cdffd50e2cbdb75961a716425c4665aa930f54 | [
"Apache-2.0"
] | 1 | 2022-03-09T19:40:37.000Z | 2022-03-09T19:40:37.000Z | spiketools/tests/utils/test_base.py | claire98han/SpikeTools | f1cdffd50e2cbdb75961a716425c4665aa930f54 | [
"Apache-2.0"
] | 35 | 2021-09-28T15:13:31.000Z | 2021-11-26T04:38:08.000Z | spiketools/tests/utils/test_base.py | claire98han/SpikeTools | f1cdffd50e2cbdb75961a716425c4665aa930f54 | [
"Apache-2.0"
] | 4 | 2021-09-28T14:56:24.000Z | 2022-03-09T21:00:31.000Z | """Tests for spiketools.utils.base"""
from spiketools.utils.base import *
###################################################################################################
###################################################################################################
def test_flatten():
lsts = [[1, 2], [3... | 30.583333 | 99 | 0.27248 |
from spiketools.utils.base import *
| true | true |
f7fd5e66626e04c24eeba472406b4b7174c9665b | 1,848 | py | Python | acme/jax/networks/rescaling.py | ostap-viniavskyi/acme | 8fbae90217557a35e1d773aa63ab80890e799765 | [
"Apache-2.0"
] | 2,650 | 2020-06-01T16:31:25.000Z | 2022-03-31T07:32:41.000Z | acme/jax/networks/rescaling.py | ostap-viniavskyi/acme | 8fbae90217557a35e1d773aa63ab80890e799765 | [
"Apache-2.0"
] | 199 | 2020-06-02T01:09:09.000Z | 2022-03-31T17:11:20.000Z | acme/jax/networks/rescaling.py | ostap-viniavskyi/acme | 8fbae90217557a35e1d773aa63ab80890e799765 | [
"Apache-2.0"
] | 344 | 2020-06-01T16:45:21.000Z | 2022-03-30T11:15:09.000Z | # python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | 31.322034 | 74 | 0.715368 |
import dataclasses
from acme import specs
from jax import lax
import jax.numpy as jnp
@dataclasses.dataclass
class ClipToSpec:
spec: specs.BoundedArray
def __call__(self, inputs: jnp.ndarray) -> jnp.ndarray:
return jnp.clip(inputs, self.spec.minimum, self.spec.maximum)
@dataclasses.datacla... | true | true |
f7fd5f530f5d2ba4fdc361b2b928df78c48f46a2 | 45,510 | py | Python | tensorflow/python/ipu/tests/keras/keras_functional_model_test.py | chenzhengda/tensorflow | 8debb698097670458b5f21d728bc6f734a7b5a53 | [
"Apache-2.0"
] | 74 | 2020-07-06T17:11:39.000Z | 2022-01-28T06:31:28.000Z | tensorflow/python/ipu/tests/keras/keras_functional_model_test.py | chenzhengda/tensorflow | 8debb698097670458b5f21d728bc6f734a7b5a53 | [
"Apache-2.0"
] | 9 | 2020-10-13T23:25:29.000Z | 2022-02-10T06:54:48.000Z | tensorflow/python/ipu/tests/keras/keras_functional_model_test.py | chenzhengda/tensorflow | 8debb698097670458b5f21d728bc6f734a7b5a53 | [
"Apache-2.0"
] | 12 | 2020-07-08T07:27:17.000Z | 2021-12-27T08:54:27.000Z | # Copyright 2020 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... | 34.846861 | 114 | 0.641266 |
import numpy as np
import pva
from tensorflow.python.ipu.config import IPUConfig
from tensorflow.compiler.plugin.poplar.driver.trace_pb2 import IpuTraceEvent
from tensorflow.compiler.plugin.poplar.tests import test_utils as tu
from tensorflow.python import ipu
from tensorflow.python import keras
from te... | true | true |
f7fd60b8107b557db3c0795c315dc838075afca8 | 3,036 | py | Python | eppy/function_helpers.py | lymereJ/eppy | beef781a61cc50b4567f11e3fa767c466a654e17 | [
"MIT"
] | 1 | 2019-01-06T14:16:24.000Z | 2019-01-06T14:16:24.000Z | eppy/function_helpers.py | samuelduchesne/eppy | beef781a61cc50b4567f11e3fa767c466a654e17 | [
"MIT"
] | null | null | null | eppy/function_helpers.py | samuelduchesne/eppy | beef781a61cc50b4567f11e3fa767c466a654e17 | [
"MIT"
] | null | null | null | # Copyright (c) 2012 Santosh Philip
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# =======================================================================
"""helper fun... | 29.764706 | 73 | 0.674572 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from six.moves import zip_longest
import itertools
from eppy.constructions import thermal_properties
from eppy.geometry import surface as g_surface
import eppy.fan... | true | true |
f7fd60c721ef6a9fb663b35e862869b1e6506048 | 13,799 | py | Python | pox/host_tracker/host_tracker.py | brenocg29/TP1RedesInteligentes | 3b73b3567089f9eb2e475ec8402113bf8803bb59 | [
"Apache-2.0"
] | 11 | 2019-03-02T20:39:34.000Z | 2021-09-02T19:47:38.000Z | pox/host_tracker/host_tracker.py | brenocg29/TP1RedesInteligentes | 3b73b3567089f9eb2e475ec8402113bf8803bb59 | [
"Apache-2.0"
] | 29 | 2019-01-17T15:44:48.000Z | 2021-06-02T00:19:40.000Z | OFCONTROLLERS/pox/pox/host_tracker/host_tracker.py | ViniGarcia/NIEP | 5cdf779795b9248e1bbc12195479083475f3edab | [
"MIT"
] | 11 | 2019-01-28T05:00:55.000Z | 2021-11-12T03:08:32.000Z | # Copyright 2011 Dorgival Guedes
# Copyright 2013 James McCauley
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 33.091127 | 78 | 0.675266 |
from pox.core import core
from pox.lib.addresses import EthAddr
from pox.lib.packet.ethernet import ethernet
from pox.lib.packet.ipv4 import ipv4
from pox.lib.packet.arp import arp
from pox.lib.recoco import Timer
from pox.lib.revent import Event, EventHalt
import pox.openflow.libopenflow_01 as of
i... | true | true |
f7fd62e52913383735ffd0f60d4a9c0ffae22c53 | 5,027 | py | Python | armageddon/ensemble.py | oahul14/MetTrack | dce04ad9bb61a0a1c4becafd25c932bb242d73c0 | [
"MIT"
] | null | null | null | armageddon/ensemble.py | oahul14/MetTrack | dce04ad9bb61a0a1c4becafd25c932bb242d73c0 | [
"MIT"
] | null | null | null | armageddon/ensemble.py | oahul14/MetTrack | dce04ad9bb61a0a1c4becafd25c932bb242d73c0 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import scipy.special as ssp
import scipy.optimize as sop
class Dist():
prob_val = 0.1
def __init__(self, prob_vals):
self.prob_vals = prob_vals
def velocity_dist(self,v):
return ssp.erf(v/(11*np.sqrt(2))) - (v/11)*(np.sqrt(2/np.pi)) * np.exp(-1... | 34.431507 | 117 | 0.623433 | import numpy as np
import pandas as pd
import scipy.special as ssp
import scipy.optimize as sop
class Dist():
prob_val = 0.1
def __init__(self, prob_vals):
self.prob_vals = prob_vals
def velocity_dist(self,v):
return ssp.erf(v/(11*np.sqrt(2))) - (v/11)*(np.sqrt(2/np.pi)) * np.exp(-1... | true | true |
f7fd6307284eeaddb5b346fffa0a61598bc293dd | 7,282 | py | Python | tests/cli/test_session_pool_manager.py | test-gh-org-workflow/probable-garbanzo | c6b8a0dbc573a2a0073b5ab7c8619c4d0baf7088 | [
"Apache-2.0"
] | 4 | 2017-01-31T14:05:19.000Z | 2019-04-10T16:35:44.000Z | tests/cli/test_session_pool_manager.py | test-gh-org-workflow/probable-garbanzo | c6b8a0dbc573a2a0073b5ab7c8619c4d0baf7088 | [
"Apache-2.0"
] | 89 | 2016-05-25T14:17:38.000Z | 2022-03-17T13:09:59.000Z | tests/cli/test_session_pool_manager.py | test-gh-org-workflow/probable-garbanzo | c6b8a0dbc573a2a0073b5ab7c8619c4d0baf7088 | [
"Apache-2.0"
] | 6 | 2016-07-21T12:24:10.000Z | 2022-02-21T06:33:18.000Z | from unittest import TestCase
from cloudshell.cli.service.session_pool_manager import (
SessionPoolException,
SessionPoolManager,
)
try:
from unittest.mock import MagicMock, Mock
except ImportError:
from mock import MagicMock, Mock
class TestSessionPoolManager(TestCase):
def setUp(self):
... | 38.734043 | 88 | 0.698297 | from unittest import TestCase
from cloudshell.cli.service.session_pool_manager import (
SessionPoolException,
SessionPoolManager,
)
try:
from unittest.mock import MagicMock, Mock
except ImportError:
from mock import MagicMock, Mock
class TestSessionPoolManager(TestCase):
def setUp(self):
... | true | true |
f7fd63910b11379d4d9bb02948cc429212eff5b7 | 7,926 | py | Python | tests/managers/loadbal_tests.py | acamacho82/softlayer-python | 8a755be00dcb86abc20fcc4b4f69e3155ba187e8 | [
"MIT"
] | 2 | 2016-07-06T15:31:48.000Z | 2016-07-06T15:40:25.000Z | tests/managers/loadbal_tests.py | acamacho82/softlayer-python | 8a755be00dcb86abc20fcc4b4f69e3155ba187e8 | [
"MIT"
] | 73 | 2016-07-05T15:17:51.000Z | 2016-08-18T18:16:29.000Z | tests/managers/loadbal_tests.py | kyubifire/softlayer-python | bee36eec73474a8b6a1813fbbcc0512f81bf1779 | [
"MIT"
] | 1 | 2019-07-22T05:20:39.000Z | 2019-07-22T05:20:39.000Z | """
SoftLayer.tests.managers.loadbal_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import SoftLayer
from SoftLayer import testing
VIRT_IP_SERVICE = ('SoftLayer_Network_Application_Delivery_Controller_'
'LoadBalancer_VirtualIpAddress')
c... | 37.563981 | 79 | 0.574565 | import SoftLayer
from SoftLayer import testing
VIRT_IP_SERVICE = ('SoftLayer_Network_Application_Delivery_Controller_'
'LoadBalancer_VirtualIpAddress')
class LoadBalancerTests(testing.TestCase):
def set_up(self):
self.lb_mgr = SoftLayer.LoadBalancerManager(self.client)
def test_g... | true | true |
f7fd63c86136ef2e97281bd55a42379e20c23025 | 12,560 | py | Python | nn_dataflow/LoopBlockingSolver.py | leesh6796/planaria.code | 67c9df95a5843281c4ad6d44673526e96eec3664 | [
"Apache-2.0"
] | 16 | 2021-10-29T19:26:27.000Z | 2022-03-31T03:21:16.000Z | nn_dataflow/LoopBlockingSolver.py | leesh6796/planaria.code | 67c9df95a5843281c4ad6d44673526e96eec3664 | [
"Apache-2.0"
] | 1 | 2021-11-02T19:50:05.000Z | 2021-11-08T21:12:59.000Z | nn_dataflow/LoopBlockingSolver.py | leesh6796/planaria.code | 67c9df95a5843281c4ad6d44673526e96eec3664 | [
"Apache-2.0"
] | 4 | 2021-11-18T06:46:32.000Z | 2022-03-30T22:55:17.000Z | """ $lic$
Copyright (C) 2016-2017 by The Board of Trustees of Stanford University
This program is free software: you can redistribute it and/or modify it under
the terms of the Modified BSD-3 License as published by the Open Source
Initiative.
If you use this program in your research, we request that you reference th... | 36.941176 | 79 | 0.619586 |
import math
import itertools
from . import DataCategoryEnum as de
from . import Util
def _solve_lpbl_iofmap_gbuf_reside(nested_loop_desc, resource, reside_dce):
dce_y = reside_dce
if dce_y == de.OFM:
dce_x = de.IFM
nfmaps_x = nested_loop_desc.loopcnt_ifm
nfmaps_y = nested_loop_desc.... | true | true |
f7fd63e5e478a6e63583c40e52a5b4d1352f0523 | 2,987 | py | Python | sayhello/test_sayhello.py | TyouSF/FlaskWebAC | da7bab8b35bcde34f844077c69099557d0f3cd32 | [
"MIT"
] | null | null | null | sayhello/test_sayhello.py | TyouSF/FlaskWebAC | da7bab8b35bcde34f844077c69099557d0f3cd32 | [
"MIT"
] | null | null | null | sayhello/test_sayhello.py | TyouSF/FlaskWebAC | da7bab8b35bcde34f844077c69099557d0f3cd32 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Author
"""
import unittest
from flask import abort
from sayhello import app, db
from sayhello.models import Message
from sayhello.commands import initdb, forge
class SayHelloTestCase(unittest.TestCase):
def setUp(self):
app.config.update(
TESTING=True,
WTF... | 30.171717 | 68 | 0.623703 |
import unittest
from flask import abort
from sayhello import app, db
from sayhello.models import Message
from sayhello.commands import initdb, forge
class SayHelloTestCase(unittest.TestCase):
def setUp(self):
app.config.update(
TESTING=True,
WTF_CSRF_ENABLED=False,
S... | true | true |
f7fd642bc98184b28bd45150f5576e5a64fb76b1 | 9,992 | py | Python | fsspec/tests/test_utils.py | dish59742/filesystem_spec | 87e5ca57fd8be7b636451d4237fe47f6e764fa79 | [
"BSD-3-Clause"
] | null | null | null | fsspec/tests/test_utils.py | dish59742/filesystem_spec | 87e5ca57fd8be7b636451d4237fe47f6e764fa79 | [
"BSD-3-Clause"
] | null | null | null | fsspec/tests/test_utils.py | dish59742/filesystem_spec | 87e5ca57fd8be7b636451d4237fe47f6e764fa79 | [
"BSD-3-Clause"
] | null | null | null | import io
import sys
import pytest
from fsspec.utils import (
can_be_local,
common_prefix,
infer_storage_options,
other_paths,
read_block,
seek_delimiter,
setup_logger,
)
WIN = sys.platform.startswith("win")
def test_read_block():
delimiter = b"\n"
data = delimiter.join([b"123",... | 31.923323 | 87 | 0.567854 | import io
import sys
import pytest
from fsspec.utils import (
can_be_local,
common_prefix,
infer_storage_options,
other_paths,
read_block,
seek_delimiter,
setup_logger,
)
WIN = sys.platform.startswith("win")
def test_read_block():
delimiter = b"\n"
data = delimiter.join([b"123",... | true | true |
f7fd649c3b9658c2a095f6addd34f415f5284097 | 2,743 | py | Python | configs/hpt-pretrain/bdd/finetune/all-labels/90-epoch-0_01-lr-finetune.py | Berkeley-Data/OpenSelfSup | 221191b88d891de57725b149caf237ffef72e529 | [
"Apache-2.0"
] | null | null | null | configs/hpt-pretrain/bdd/finetune/all-labels/90-epoch-0_01-lr-finetune.py | Berkeley-Data/OpenSelfSup | 221191b88d891de57725b149caf237ffef72e529 | [
"Apache-2.0"
] | 6 | 2021-03-11T05:35:54.000Z | 2021-04-03T22:25:11.000Z | configs/hpt-pretrain/bdd/finetune/all-labels/90-epoch-0_01-lr-finetune.py | Berkeley-Data/OpenSelfSup | 221191b88d891de57725b149caf237ffef72e529 | [
"Apache-2.0"
] | 1 | 2021-07-04T00:47:46.000Z | 2021-07-04T00:47:46.000Z | _base_ = "finetune-eval-base.py"
# dataset settings
data_source_cfg = dict(
type="ImageNet",
memcached=False,
mclient_path='/no/matter',
# this will be ignored if type != ImageListMultihead
)
data_train_list = "data/bdd/meta/train_weather_labeled.txt"
data_train_root = 'data/bdd'
data_val_list ... | 25.165138 | 80 | 0.645643 | _base_ = "finetune-eval-base.py"
data_source_cfg = dict(
type="ImageNet",
memcached=False,
mclient_path='/no/matter',
)
data_train_list = "data/bdd/meta/train_weather_labeled.txt"
data_train_root = 'data/bdd'
data_val_list = "data/bdd/meta/val_weather_labeled.txt"
data_val_root = 'data/bdd'
... | true | true |
f7fd64cff1bf17107c5f0241c8e0162f787485c1 | 634 | py | Python | setup.py | FrostMN/FlaskAuth | 9cfc274dfe927a254b005809e65c9a620214236e | [
"MIT"
] | null | null | null | setup.py | FrostMN/FlaskAuth | 9cfc274dfe927a254b005809e65c9a620214236e | [
"MIT"
] | null | null | null | setup.py | FrostMN/FlaskAuth | 9cfc274dfe927a254b005809e65c9a620214236e | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="FlaskAuth",
version="0.0.1",
author="Aaron Frost",
author_email="author@example.com",
description="A small example package",
long_description=long_description,
long_description_con... | 28.818182 | 50 | 0.660883 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="FlaskAuth",
version="0.0.1",
author="Aaron Frost",
author_email="author@example.com",
description="A small example package",
long_description=long_description,
long_description_con... | true | true |
f7fd6510d8aa7a6879e882b0d076f52ae4870293 | 42,456 | py | Python | Lib/test/test_time.py | shreya1312/cpython | cae1a1951b90f6f99a92ed0209169276c106c56d | [
"0BSD"
] | 2 | 2021-09-18T04:38:55.000Z | 2022-01-27T09:23:30.000Z | Lib/test/test_time.py | shreya1312/cpython | cae1a1951b90f6f99a92ed0209169276c106c56d | [
"0BSD"
] | 11 | 2020-12-01T05:39:22.000Z | 2022-03-01T07:01:05.000Z | Lib/test/test_time.py | shreya1312/cpython | cae1a1951b90f6f99a92ed0209169276c106c56d | [
"0BSD"
] | 1 | 2017-09-11T21:15:52.000Z | 2017-09-11T21:15:52.000Z | from test import support
from test.support import warnings_helper
import decimal
import enum
import locale
import math
import platform
import sys
import sysconfig
import time
import threading
import unittest
try:
import _testcapi
except ImportError:
_testcapi = None
from test.support import skip_if_buggy_ucrt_... | 37.772242 | 108 | 0.582085 | from test import support
from test.support import warnings_helper
import decimal
import enum
import locale
import math
import platform
import sys
import sysconfig
import time
import threading
import unittest
try:
import _testcapi
except ImportError:
_testcapi = None
from test.support import skip_if_buggy_ucrt_... | true | true |
f7fd652797704d9dee7b345306d913dfe42070c4 | 986 | py | Python | scheduler/account/migrations/0001_initial.py | NaskoVasilev/Scheduler | 02633e38e8bb803c04371ab3e1ee27e3d8997a53 | [
"MIT"
] | 1 | 2021-03-04T19:08:27.000Z | 2021-03-04T19:08:27.000Z | scheduler/account/migrations/0001_initial.py | NaskoVasilev/Scheduler | 02633e38e8bb803c04371ab3e1ee27e3d8997a53 | [
"MIT"
] | 23 | 2021-03-11T16:45:41.000Z | 2021-06-28T21:38:44.000Z | scheduler/account/migrations/0001_initial.py | NaskoVasilev/Scheduler | 02633e38e8bb803c04371ab3e1ee27e3d8997a53 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-05-28 16:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Client',
fields=[
... | 30.8125 | 191 | 0.586207 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Client',
fields=[
('id', models.AutoField(auto_created=Tr... | true | true |
f7fd652a1f5692001a77d19216eef56c7b7b0292 | 4,529 | py | Python | missingfact/nn/util.py | usc-isi-i2/missing-fact | 834a0b4531170b4a108f765e19d02bd7446e0563 | [
"Apache-2.0"
] | 17 | 2019-09-23T12:47:37.000Z | 2022-03-26T12:50:08.000Z | missingfact/nn/util.py | usc-isi-i2/missing-fact | 834a0b4531170b4a108f765e19d02bd7446e0563 | [
"Apache-2.0"
] | null | null | null | missingfact/nn/util.py | usc-isi-i2/missing-fact | 834a0b4531170b4a108f765e19d02bd7446e0563 | [
"Apache-2.0"
] | 4 | 2020-01-10T12:15:02.000Z | 2020-07-19T05:39:25.000Z | import torch
from allennlp.nn.util import replace_masked_values, masked_max
def seq2vec_seq_aggregate(seq_tensor, mask, aggregate, bidirectional, dim=1):
"""
Takes the aggregation of sequence tensor
:param seq_tensor: Batched sequence requires [batch, seq, hs]
:param mask: binary mask wit... | 48.698925 | 99 | 0.693972 | import torch
from allennlp.nn.util import replace_masked_values, masked_max
def seq2vec_seq_aggregate(seq_tensor, mask, aggregate, bidirectional, dim=1):
seq_tensor_masked = seq_tensor * mask.unsqueeze(-1)
aggr_func = None
if aggregate == "last":
if seq_tensor.dim() > 3:
seq = get_fin... | true | true |
f7fd66d33fc0c329db7daaf87373385156d84217 | 17,850 | py | Python | tensorflow/contrib/training/python/training/evaluation.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/training/python/training/evaluation.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/training/python/training/evaluation.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 38.804348 | 91 | 0.703417 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
from tensorflow.python.ops import state_ops
from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.summary import summary
from tensorflow.python.training... | true | true |
f7fd67a235541ec57a2246174a93721eec952813 | 3,672 | py | Python | tests/test_process.py | murilocamargos/pytvname | fa797980d9cbb88d1107019c60f70ec62e68a885 | [
"MIT"
] | null | null | null | tests/test_process.py | murilocamargos/pytvname | fa797980d9cbb88d1107019c60f70ec62e68a885 | [
"MIT"
] | null | null | null | tests/test_process.py | murilocamargos/pytvname | fa797980d9cbb88d1107019c60f70ec62e68a885 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os
test_root = os.path.dirname(os.path.abspath(__file__))
os.chdir(test_root)
sys.path.insert(0, os.path.dirname(test_root))
sys.path.insert(0, test_root)
import unittest
from pytvname import process
class NormalizeTest(unittest.TestCase):
"""Tests for n... | 36.72 | 108 | 0.651961 |
import sys, os
test_root = os.path.dirname(os.path.abspath(__file__))
os.chdir(test_root)
sys.path.insert(0, os.path.dirname(test_root))
sys.path.insert(0, test_root)
import unittest
from pytvname import process
class NormalizeTest(unittest.TestCase):
def test_scandal_2009(self):
self.assertEqual(proc... | true | true |
f7fd67bb5b4bfcbdd8f4154ce43a64cf21eae0ef | 2,777 | py | Python | tests/test_workers/worker_persistance/test_enrich_cntrb_id.py | k1nty/augur | 2160e1dffbc2ac082f83ffa910057717b15cbde4 | [
"MIT"
] | 26 | 2017-02-27T19:07:40.000Z | 2018-03-21T19:28:54.000Z | tests/test_workers/worker_persistance/test_enrich_cntrb_id.py | RylanChamberlin/augur | 47a8599e694677952a792dbe8783343e12f67d3a | [
"MIT"
] | 83 | 2017-01-20T14:56:01.000Z | 2018-04-11T21:40:43.000Z | tests/test_workers/worker_persistance/test_enrich_cntrb_id.py | RylanChamberlin/augur | 47a8599e694677952a792dbe8783343e12f67d3a | [
"MIT"
] | 51 | 2017-01-16T16:20:02.000Z | 2018-03-27T08:28:31.000Z | #SPDX-License-Identifier: MIT
from tests.test_workers.worker_persistance.util_persistance import *
#WIP
def test_enrich_cntrb_id_standard_input(database_connection, sample_source_data_standard_github_comments, sample_source_data_enriched, sample_source_data_unenriched):
#create class for testing
dummy = ... | 41.447761 | 166 | 0.64134 |
from tests.test_workers.worker_persistance.util_persistance import *
def test_enrich_cntrb_id_standard_input(database_connection, sample_source_data_standard_github_comments, sample_source_data_enriched, sample_source_data_unenriched):
dummy = DummyFullWorker(database_connection)
cntrb =... | true | true |
f7fd67d388f484d7e684f63f878ce69af3a9e8d2 | 2,769 | py | Python | Anti-Phish/antiphish.py | Kixiron/Anti-Phish | 513cbc16729bead0ba4c2e17ec705cdbe949b928 | [
"Apache-2.0"
] | null | null | null | Anti-Phish/antiphish.py | Kixiron/Anti-Phish | 513cbc16729bead0ba4c2e17ec705cdbe949b928 | [
"Apache-2.0"
] | 1 | 2020-07-31T15:48:21.000Z | 2020-07-31T15:48:21.000Z | Anti-Phish/antiphish.py | Kixiron/Anti-Phish | 513cbc16729bead0ba4c2e17ec705cdbe949b928 | [
"Apache-2.0"
] | null | null | null | import argparse
import json
import os
import random
import string
import sys
import requests
# Copyright 2019 Kixiron
#
# 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
#
# ... | 32.576471 | 118 | 0.661611 | import argparse
import json
import os
import random
import string
import sys
import requests
parser = argparse.ArgumentParser(description="Anti-Phish, an anti-phishing website script")
parser.add_argument('url', help="URL of the target site", type=str)
parser.add_argument('-u', '--username',... | true | true |
f7fd684d845d46ea25ad02474db4753890c2e3cc | 171 | py | Python | src/prefect/environments/storage/azure.py | vnsn/prefect | 972345597975155dba9e3232bcc430d0a6258a37 | [
"Apache-2.0"
] | 1 | 2021-05-12T12:47:12.000Z | 2021-05-12T12:47:12.000Z | src/prefect/environments/storage/azure.py | vnsn/prefect | 972345597975155dba9e3232bcc430d0a6258a37 | [
"Apache-2.0"
] | 7 | 2021-06-26T08:05:20.000Z | 2022-03-26T08:05:32.000Z | src/prefect/environments/storage/azure.py | vnsn/prefect | 972345597975155dba9e3232bcc430d0a6258a37 | [
"Apache-2.0"
] | 1 | 2021-10-16T08:33:56.000Z | 2021-10-16T08:33:56.000Z | from prefect.storage import Azure as _Azure
from prefect.environments.storage.base import _DeprecatedStorageMixin
class Azure(_Azure, _DeprecatedStorageMixin):
pass
| 24.428571 | 69 | 0.836257 | from prefect.storage import Azure as _Azure
from prefect.environments.storage.base import _DeprecatedStorageMixin
class Azure(_Azure, _DeprecatedStorageMixin):
pass
| true | true |
f7fd69d629599e31055b1c49074d2055aaf475d6 | 2,037 | py | Python | models/map_model.py | JannerM/spatial-reasoning | e163003a33177e41ca02d5feefee3fdfca5ba154 | [
"MIT"
] | 54 | 2017-07-14T01:08:57.000Z | 2021-07-09T12:46:57.000Z | models/map_model.py | jannerm/spatial-reasoning | e163003a33177e41ca02d5feefee3fdfca5ba154 | [
"MIT"
] | null | null | null | models/map_model.py | jannerm/spatial-reasoning | e163003a33177e41ca02d5feefee3fdfca5ba154 | [
"MIT"
] | 16 | 2017-07-16T03:18:19.000Z | 2021-05-28T13:04:12.000Z | import sys, math
import numpy as np
from tqdm import tqdm, trange
import torch, torch.nn as nn, torch.nn.functional as F
import torch.optim as optim
'''
State observations are two-channel images
with 0: puddle, 1: grass, 2: agent
'''
class MapModel(nn.Module):
def __init__(self, vocab_size, embed_dim, out_dim):
... | 24.841463 | 59 | 0.581247 | import sys, math
import numpy as np
from tqdm import tqdm, trange
import torch, torch.nn as nn, torch.nn.functional as F
import torch.optim as optim
'''
State observations are two-channel images
with 0: puddle, 1: grass, 2: agent
'''
class MapModel(nn.Module):
def __init__(self, vocab_size, embed_dim, out_dim):
... | false | true |
f7fd6b16610ed332a40ded054de3263b7b004974 | 2,217 | py | Python | core/views.py | Cauan2305/Blog | 2817b1b29c2cb8a859ac1d154a574b20cef187fe | [
"MIT"
] | null | null | null | core/views.py | Cauan2305/Blog | 2817b1b29c2cb8a859ac1d154a574b20cef187fe | [
"MIT"
] | null | null | null | core/views.py | Cauan2305/Blog | 2817b1b29c2cb8a859ac1d154a574b20cef187fe | [
"MIT"
] | null | null | null | from core.models import Comentarios, Publicação
from django.shortcuts import redirect, render,HttpResponse,get_object_or_404,HttpResponseRedirect
from django.views.generic.base import TemplateView
from django.views.generic.edit import FormView
from .forms import ComentariosForm
from django.contrib.auth.decorators impo... | 24.633333 | 97 | 0.670726 | from core.models import Comentarios, Publicação
from django.shortcuts import redirect, render,HttpResponse,get_object_or_404,HttpResponseRedirect
from django.views.generic.base import TemplateView
from django.views.generic.edit import FormView
from .forms import ComentariosForm
from django.contrib.auth.decorators impo... | true | true |
f7fd6be5f1e259da23392a17f44d60424f181f0a | 1,008 | py | Python | solutions/p034.py | xianlinfeng/project_euler_python3 | 77eca44eb2b1d13bc70d6dc0258b737449d43a23 | [
"MIT"
] | null | null | null | solutions/p034.py | xianlinfeng/project_euler_python3 | 77eca44eb2b1d13bc70d6dc0258b737449d43a23 | [
"MIT"
] | null | null | null | solutions/p034.py | xianlinfeng/project_euler_python3 | 77eca44eb2b1d13bc70d6dc0258b737449d43a23 | [
"MIT"
] | null | null | null | #
# Solution to Project Euler problem 34
# Copyright (c) Project Nayuki. All rights reserved.
#
# https://www.nayuki.io/page/project-euler-solutions
# https://github.com/nayuki/Project-Euler-solutions
#
import math
def compute():
# As stated in the problem, 1 = 1! and 2 = 2! are excluded.
# If a number has at l... | 30.545455 | 118 | 0.722222 |
import math
def compute():
ans = sum(i for i in range(3, 10000000) if i == factorial_digit_sum(i))
return str(ans)
def factorial_digit_sum(n):
result = 0
while n >= 10000:
result += FACTORIAL_DIGITS_SUM_WITH_LEADING_ZEROS[n % 10000]
n //= 10000
return result + FACTORIAL_DIGITS_SUM_WITHOUT_LEA... | true | true |
f7fd6c9517647c70d407dac0ca98e7795d15eacf | 2,768 | py | Python | sdk/python/tests/cli/test_online_retrieval.py | mrzzy/feast | 960f1ed8ba9cb76f1f82a6df54d8317cc7447a03 | [
"Apache-2.0"
] | null | null | null | sdk/python/tests/cli/test_online_retrieval.py | mrzzy/feast | 960f1ed8ba9cb76f1f82a6df54d8317cc7447a03 | [
"Apache-2.0"
] | null | null | null | sdk/python/tests/cli/test_online_retrieval.py | mrzzy/feast | 960f1ed8ba9cb76f1f82a6df54d8317cc7447a03 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
import pytest
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
from tests.cli.utils import CliRunner, get_example_repo
class TestOnlineRetrieval:
def test_basic(self) -> None:
r... | 35.948052 | 87 | 0.493497 | from datetime import datetime
import pytest
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
from tests.cli.utils import CliRunner, get_example_repo
class TestOnlineRetrieval:
def test_basic(self) -> None:
r... | true | true |
f7fd6d633a11d387307ac76fb81bd8d8ecdae2e7 | 439 | py | Python | WRA_and_wikipedia.py | crayzeerr/VirtualAssistant | d45f305f3ee418c8e3de04901285b08b141e97d6 | [
"MIT"
] | 1 | 2021-08-08T02:13:13.000Z | 2021-08-08T02:13:13.000Z | WRA_and_wikipedia.py | crayzeerr/VirtualAssistant | d45f305f3ee418c8e3de04901285b08b141e97d6 | [
"MIT"
] | null | null | null | WRA_and_wikipedia.py | crayzeerr/VirtualAssistant | d45f305f3ee418c8e3de04901285b08b141e97d6 | [
"MIT"
] | null | null | null | import wikipedia
import wolframalpha
while True:
input = raw_input("Q: ")
try:
#wolframalpha
app_id = "*******************"
client = wolframalpha.Client(app_id)
result = client.query(input)
answer = next(result.results).text
... | 25.823529 | 56 | 0.498861 | import wikipedia
import wolframalpha
while True:
input = raw_input("Q: ")
try:
app_id = "*******************"
client = wolframalpha.Client(app_id)
result = client.query(input)
answer = next(result.results).text
print a... | false | true |
f7fd6d8669fc5c556757d81114622cf3df76991e | 1,804 | py | Python | tests/test_postgres_discover_runner.py | wonkybream/django-rdtwt | 5bf5ad5f0927e177b2adc49a41681b99b6af397d | [
"MIT"
] | 2 | 2021-11-25T09:02:50.000Z | 2022-01-09T14:52:04.000Z | tests/test_postgres_discover_runner.py | wonkybream/django-rdtwt | 5bf5ad5f0927e177b2adc49a41681b99b6af397d | [
"MIT"
] | 1 | 2021-12-09T15:54:24.000Z | 2021-12-09T15:54:24.000Z | tests/test_postgres_discover_runner.py | wonkybream/django-rdtwt | 5bf5ad5f0927e177b2adc49a41681b99b6af397d | [
"MIT"
] | 2 | 2022-01-09T15:03:24.000Z | 2022-01-09T15:03:38.000Z | from unittest import TestCase
from unittest.mock import Mock, patch
from rdtwt.runner import PostgresDiscoverRunner
class SettingsStub:
DATABASES = {"default": {"HOST": "127.0.0.1", "PORT": "5432"}}
RDTWT_POSTGRESQL_IMAGE = "postgres:latest"
def get_host_ip(self):
return self.DATABASES["default... | 34.037736 | 74 | 0.727827 | from unittest import TestCase
from unittest.mock import Mock, patch
from rdtwt.runner import PostgresDiscoverRunner
class SettingsStub:
DATABASES = {"default": {"HOST": "127.0.0.1", "PORT": "5432"}}
RDTWT_POSTGRESQL_IMAGE = "postgres:latest"
def get_host_ip(self):
return self.DATABASES["default... | true | true |
f7fd6ddfe2e47cbbb1b6edbf42cb88736922ebf0 | 27,427 | py | Python | src/transformers/modeling_tf_ctrl.py | JonathanSum/transformers | 27b68f95e4585713b575603545cf520ab9621621 | [
"Apache-2.0"
] | 100 | 2020-01-30T08:14:25.000Z | 2022-03-30T08:59:33.000Z | src/transformers/modeling_tf_ctrl.py | JonathanSum/transformers | 27b68f95e4585713b575603545cf520ab9621621 | [
"Apache-2.0"
] | 4 | 2021-04-30T21:42:40.000Z | 2022-02-10T05:15:45.000Z | src/transformers/modeling_tf_ctrl.py | JonathanSum/transformers | 27b68f95e4585713b575603545cf520ab9621621 | [
"Apache-2.0"
] | 15 | 2020-04-13T22:56:27.000Z | 2022-03-10T02:44:26.000Z | # coding=utf-8
# Copyright 2018 Salesforce and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# h... | 45.864548 | 169 | 0.66059 |
import logging
import numpy as np
import tensorflow as tf
from .configuration_ctrl import CTRLConfig
from .file_utils import add_start_docstrings, add_start_docstrings_to_callable
from .modeling_tf_utils import TFPreTrainedModel, TFSharedEmbeddings, keras_serializable, shape_list
from .tokenization_u... | true | true |
f7fd6e586d7d67538fa6307c72be9af9ff13204f | 925 | py | Python | Polymorphism_and_Magic_Methods/wild_farm_04E/project/animals/animal.py | MNikov/Python-OOP-October-2020 | a53e4555758ec810605e31e7b2c71b65c49b2332 | [
"MIT"
] | null | null | null | Polymorphism_and_Magic_Methods/wild_farm_04E/project/animals/animal.py | MNikov/Python-OOP-October-2020 | a53e4555758ec810605e31e7b2c71b65c49b2332 | [
"MIT"
] | null | null | null | Polymorphism_and_Magic_Methods/wild_farm_04E/project/animals/animal.py | MNikov/Python-OOP-October-2020 | a53e4555758ec810605e31e7b2c71b65c49b2332 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
class Animal(ABC):
def __init__(self, name, weight):
self.name = name
self.weight = weight
self.food_eaten = 0
@abstractmethod
def make_sound(self):
pass
@abstractmethod
def feed(self, food):
pass
class Bird(Animal, AB... | 25 | 113 | 0.644324 | from abc import ABC, abstractmethod
class Animal(ABC):
def __init__(self, name, weight):
self.name = name
self.weight = weight
self.food_eaten = 0
@abstractmethod
def make_sound(self):
pass
@abstractmethod
def feed(self, food):
pass
class Bird(Animal, AB... | true | true |
f7fd6e99a75252c110b5bdcb99f74f5181f3e17b | 2,978 | py | Python | openGaussBase/testcase/GUC/CLIENTCONNECTION/Opengauss_Function_Guc_ClientConnection_Case0197.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/GUC/CLIENTCONNECTION/Opengauss_Function_Guc_ClientConnection_Case0197.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/GUC/CLIENTCONNECTION/Opengauss_Function_Guc_ClientConnection_Case0197.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 31.680851 | 84 | 0.635662 | import unittest
import time
from testcase.utils.CommonSH import CommonSH
from testcase.utils.Constant import Constant
from testcase.utils.Logger import Logger
from yat.test import Node
from yat.test import macro
LOG = Logger()
commonsh = CommonSH('dbuser')
class ClientConnection(unittest.TestCase):
def setUp(se... | true | true |
f7fd6f7a13e1ad1154a280d7322c5cee5763a17f | 5,777 | py | Python | pygame_menu/examples/scroll_menu.py | notrurs/pygame-menu | 159853d856d5b25e813389b8ebf541c79771c8ed | [
"MIT"
] | null | null | null | pygame_menu/examples/scroll_menu.py | notrurs/pygame-menu | 159853d856d5b25e813389b8ebf541c79771c8ed | [
"MIT"
] | null | null | null | pygame_menu/examples/scroll_menu.py | notrurs/pygame-menu | 159853d856d5b25e813389b8ebf541c79771c8ed | [
"MIT"
] | null | null | null | # coding=utf-8
"""
pygame-menu
https://github.com/ppizarror/pygame-menu
EXAMPLE - SCROLL MENU
Shows scrolling in menu.
License:
-------------------------------------------------------------------------------
The MIT License (MIT)
Copyright 2017-2020 Pablo Pizarro R. @ppizarror
Permission is hereby granted, free of c... | 30.566138 | 110 | 0.592349 |
import os
import pygame
import pygame_menu
from functools import partial
FPS = 30.0
H_SIZE = 600
W_SIZE = 800
def on_button_click(value=None, text=None):
if not text:
print('Hello from {}'.format(value))
else:
print('Hello from {} with {}'.format(text, value))
def paint_background(su... | true | true |
f7fd6f8cef2159b49f5d2d09aafbe7065291ef13 | 438 | py | Python | refugeedata/app/wsgi.py | ryanmrubin/refugeedata | d71bedb0895e8011f3b67245c17df3422553820c | [
"MIT"
] | null | null | null | refugeedata/app/wsgi.py | ryanmrubin/refugeedata | d71bedb0895e8011f3b67245c17df3422553820c | [
"MIT"
] | 1 | 2018-11-13T15:13:37.000Z | 2018-11-13T15:13:37.000Z | refugeedata/app/wsgi.py | ryanmrubin/refugeedata | d71bedb0895e8011f3b67245c17df3422553820c | [
"MIT"
] | null | null | null | """
WSGI config for refugeedata project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
os.... | 24.333333 | 78 | 0.792237 |
import os
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "refugeedata.app.settings")
application = Cling(get_wsgi_application())
| true | true |
f7fd705134f054dccecedc4cd0e57a61f3aa3cc6 | 1,253 | py | Python | bluebrain/repo-bluebrain/packages/py-neuror/package.py | BlueBrain/Spack | dc328512c70e182f3c24bb0ce64fa3586482bdf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | bluebrain/repo-bluebrain/packages/py-neuror/package.py | BlueBrain/Spack | dc328512c70e182f3c24bb0ce64fa3586482bdf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | bluebrain/repo-bluebrain/packages/py-neuror/package.py | BlueBrain/Spack | dc328512c70e182f3c24bb0ce64fa3586482bdf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyNeuror(PythonPackage):
"""A collection of tools to repair morphologies."""
homepag... | 39.15625 | 95 | 0.656824 |
from spack import *
class PyNeuror(PythonPackage):
homepage = "https://github.com/BlueBrain/NeuroR"
git = "https://github.com/BlueBrain/NeuroR.git"
pypi = "neuror/NeuroR-1.2.3.tar.gz"
version('develop', branch='master')
version('1.4.2', sha256='f5e18ebddf59a60ce650c24eb49042057cf97990d63ae... | true | true |
f7fd71d8613fa65357f5396f65536d8faa7196d2 | 6,888 | py | Python | service/omega365.py | sesam-community/omega365 | c0baaafa5fe3436356c1f7edcb264f27b183747d | [
"Apache-2.0"
] | null | null | null | service/omega365.py | sesam-community/omega365 | c0baaafa5fe3436356c1f7edcb264f27b183747d | [
"Apache-2.0"
] | null | null | null | service/omega365.py | sesam-community/omega365 | c0baaafa5fe3436356c1f7edcb264f27b183747d | [
"Apache-2.0"
] | null | null | null | import requests
from flask import Flask, Response, request
import os
import logger
import cherrypy
import json
from datetime import datetime
app = Flask(__name__)
logger = logger.Logger('Omega365 client service')
url = os.environ.get("base_url")
username = os.environ.get("username")
pw = os.environ.get("password")
re... | 30.75 | 131 | 0.598868 | import requests
from flask import Flask, Response, request
import os
import logger
import cherrypy
import json
from datetime import datetime
app = Flask(__name__)
logger = logger.Logger('Omega365 client service')
url = os.environ.get("base_url")
username = os.environ.get("username")
pw = os.environ.get("password")
re... | true | true |
f7fd7221f5d5e2245608435c4131abf611610f3e | 648 | py | Python | src/toil/test/docs/scripts/tutorial_multiplejobs.py | thiagogenez/toil | b25e7d0616fef3aa9085a7d7d7ae6bdc257f2d92 | [
"Apache-2.0"
] | 6 | 2018-05-27T05:09:11.000Z | 2020-07-01T17:02:40.000Z | src/toil/test/docs/scripts/tutorial_multiplejobs.py | thiagogenez/toil | b25e7d0616fef3aa9085a7d7d7ae6bdc257f2d92 | [
"Apache-2.0"
] | 20 | 2021-10-07T08:31:41.000Z | 2022-03-01T17:38:13.000Z | src/toil/test/docs/scripts/tutorial_multiplejobs.py | thiagogenez/toil | b25e7d0616fef3aa9085a7d7d7ae6bdc257f2d92 | [
"Apache-2.0"
] | 1 | 2020-04-06T15:04:44.000Z | 2020-04-06T15:04:44.000Z | from toil.common import Toil
from toil.job import Job
def helloWorld(job, message, memory="2G", cores=2, disk="3G"):
job.log("Hello world, I have a message: {}".format(message))
if __name__=="__main__":
options = Job.Runner.getDefaultOptions("./toilWorkflowRun")
options.logLevel = "INFO"
options.clea... | 28.173913 | 64 | 0.669753 | from toil.common import Toil
from toil.job import Job
def helloWorld(job, message, memory="2G", cores=2, disk="3G"):
job.log("Hello world, I have a message: {}".format(message))
if __name__=="__main__":
options = Job.Runner.getDefaultOptions("./toilWorkflowRun")
options.logLevel = "INFO"
options.clea... | true | true |
f7fd737df6aafffe228a493760504b52168af3dc | 1,061 | py | Python | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/domain_category_service/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/domain_category_service/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/domain_category_service/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 33.15625 | 92 | 0.779453 |
from collections import OrderedDict
from typing import Dict, Type
from .base import DomainCategoryServiceTransport
from .grpc import DomainCategoryServiceGrpcTransport
_transport_registry = OrderedDict()
_transport_registry['grpc'] = DomainCategoryServiceGrpcTransport
__all__ = (
'DomainCateg... | true | true |
f7fd739d690be03b7c3068d808b7aac7975af636 | 4,075 | py | Python | api_smartcondor/run_api.py | romanrdgz/smartcondor | c5419f8f3a402b441aec8a6fd38ddbc787f63e9e | [
"MIT"
] | 32 | 2016-08-01T12:20:34.000Z | 2022-03-16T16:33:35.000Z | api_smartcondor/run_api.py | ajmal017/smartcondor | c5419f8f3a402b441aec8a6fd38ddbc787f63e9e | [
"MIT"
] | null | null | null | api_smartcondor/run_api.py | ajmal017/smartcondor | c5419f8f3a402b441aec8a6fd38ddbc787f63e9e | [
"MIT"
] | 15 | 2017-02-25T16:35:44.000Z | 2021-08-31T14:34:11.000Z | # -*- coding: utf-8 -*-
from flask import Flask, jsonify
from flask_pymongo import PyMongo
from flask_restful import Api, Resource
from datetime import datetime
app = Flask(__name__)
app.config['MONGO_DBNAME'] = 'smartcondor'
mongo = PyMongo(app, config_prefix='MONGO')
APP_URL = 'http://127.0.0.1:5000'
class Underl... | 36.061947 | 75 | 0.470675 |
from flask import Flask, jsonify
from flask_pymongo import PyMongo
from flask_restful import Api, Resource
from datetime import datetime
app = Flask(__name__)
app.config['MONGO_DBNAME'] = 'smartcondor'
mongo = PyMongo(app, config_prefix='MONGO')
APP_URL = 'http://127.0.0.1:5000'
class Underlying(Resource):
def... | true | true |
f7fd75f55adda02c811649d715d877445fdfa5a3 | 3,434 | py | Python | ros/genpy/src/genpy/msg/_TestString.py | numberen/apollo-platform | 8f359c8d00dd4a98f56ec2276c5663cb6c100e47 | [
"Apache-2.0"
] | 742 | 2017-07-05T02:49:36.000Z | 2022-03-30T12:55:43.000Z | ros/genpy/src/genpy/msg/_TestString.py | numberen/apollo-platform | 8f359c8d00dd4a98f56ec2276c5663cb6c100e47 | [
"Apache-2.0"
] | 73 | 2017-07-06T12:50:51.000Z | 2022-03-07T08:07:07.000Z | ros/genpy/src/genpy/msg/_TestString.py | numberen/apollo-platform | 8f359c8d00dd4a98f56ec2276c5663cb6c100e47 | [
"Apache-2.0"
] | 425 | 2017-07-04T22:03:29.000Z | 2022-03-29T06:59:06.000Z | """autogenerated by genpy from genpy/TestString.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class TestString(genpy.Message):
_md5sum = "992ce8a1687cec8c8bd883ec73ca41d1"
_type = "genpy/TestString"
_has_header = False #flag to mark the prese... | 28.616667 | 91 | 0.638614 | import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class TestString(genpy.Message):
_md5sum = "992ce8a1687cec8c8bd883ec73ca41d1"
_type = "genpy/TestString"
_has_header = False
_full_text = """string data
"""
__slots__ = ['data']
_slot_types = ['string']
def... | true | true |
f7fd7664a6b04cec977f05e363ee860669c9ba0f | 5,622 | py | Python | detection/prepare_train_data.py | sunset768541/ctw-baseline | f303f9ae0477ef2aa1fe56426a28e0ed9a0a89f8 | [
"MIT"
] | 333 | 2018-03-09T12:50:49.000Z | 2022-02-10T04:02:50.000Z | detection/prepare_train_data.py | sunset768541/ctw-baseline | f303f9ae0477ef2aa1fe56426a28e0ed9a0a89f8 | [
"MIT"
] | 43 | 2018-03-19T08:11:28.000Z | 2021-03-03T08:19:35.000Z | detection/prepare_train_data.py | sunset768541/ctw-baseline | f303f9ae0477ef2aa1fe56426a28e0ed9a0a89f8 | [
"MIT"
] | 105 | 2018-03-15T10:17:50.000Z | 2021-11-08T02:46:26.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import cv2
import darknet_tools
import json
import numpy as np
import os
import settings
from jinja2 import Template
from pythonapi import anno_... | 35.808917 | 130 | 0.583422 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import cv2
import darknet_tools
import json
import numpy as np
import os
import settings
from jinja2 import Template
from pythonapi import anno_tools, common_tools
fro... | true | true |
f7fd76a81f5709a748b3dc6abfcd848bbf798ff9 | 5,334 | py | Python | inter_view/utils.py | fmi-basel/inter-view | e7ebf616ac15eddf1e0d222930750fb4b113d9fa | [
"MIT"
] | null | null | null | inter_view/utils.py | fmi-basel/inter-view | e7ebf616ac15eddf1e0d222930750fb4b113d9fa | [
"MIT"
] | null | null | null | inter_view/utils.py | fmi-basel/inter-view | e7ebf616ac15eddf1e0d222930750fb4b113d9fa | [
"MIT"
] | null | null | null | import numpy as np
import holoviews as hv
hv.extension('bokeh', logo=False)
import param
import panel as pn
import matplotlib.pyplot as plt
from holoviews.operation.datashader import rasterize
from bokeh.models import WheelZoomTool
from holoviews.core import Store
valid_rgb_options = [
k for group in ['style', 'p... | 32.327273 | 104 | 0.646419 | import numpy as np
import holoviews as hv
hv.extension('bokeh', logo=False)
import param
import panel as pn
import matplotlib.pyplot as plt
from holoviews.operation.datashader import rasterize
from bokeh.models import WheelZoomTool
from holoviews.core import Store
valid_rgb_options = [
k for group in ['style', 'p... | true | true |
f7fd76d82ae101a6cb068e44db53b457d191e583 | 44,328 | py | Python | lib/spack/spack/build_environment.py | klevzoff/spack | 396936d24173254ecf4148bc460702185e4c99e5 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-12-28T14:38:41.000Z | 2020-12-28T14:38:41.000Z | lib/spack/spack/build_environment.py | klevzoff/spack | 396936d24173254ecf4148bc460702185e4c99e5 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 17 | 2019-03-21T15:54:00.000Z | 2022-03-29T19:34:28.000Z | lib/spack/spack/build_environment.py | klevzoff/spack | 396936d24173254ecf4148bc460702185e4c99e5 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-04-07T18:27:09.000Z | 2022-03-31T22:52:38.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""
This module contains all routines related to setting up the package
build environment. All of this is set up by packa... | 36.84788 | 101 | 0.667434 |
import inspect
import re
import multiprocessing
import os
import shutil
import sys
import traceback
import types
from six import StringIO
import llnl.util.tty as tty
from llnl.util.tty.color import cescape, colorize
from llnl.util.filesystem import mkdirp, install, install_tree
from llnl.util.lang import dedupe
f... | true | true |
f7fd7766ddcd15151dd470e0d354238bb2e09129 | 121,133 | py | Python | atp_mens/data_2019_04.py | Tjorriemorrie/ufc | 46918c91e1ccf464d9d03dc8524dab91eca239d2 | [
"Apache-2.0"
] | 1 | 2019-11-10T14:14:42.000Z | 2019-11-10T14:14:42.000Z | atp_mens/data_2019_04.py | Tjorriemorrie/ufc | 46918c91e1ccf464d9d03dc8524dab91eca239d2 | [
"Apache-2.0"
] | 2 | 2020-09-25T23:55:31.000Z | 2022-02-10T00:20:20.000Z | atp_mens/data_2019_04.py | Tjorriemorrie/ufc | 46918c91e1ccf464d9d03dc8524dab91eca239d2 | [
"Apache-2.0"
] | null | null | null | from men import *
from location import *
DATA_2019_04 = [
{
'location': HOUSTON,
'date': '2019-04-14',
'matches': [
# 2019-04-06
{
'round': 512,
'players': [
SANTIAGO_GIRALDO,
JAMES_WARD
... | 28.663748 | 54 | 0.263413 | from men import *
from location import *
DATA_2019_04 = [
{
'location': HOUSTON,
'date': '2019-04-14',
'matches': [
{
'round': 512,
'players': [
SANTIAGO_GIRALDO,
JAMES_WARD
],
... | true | true |
f7fd7944bc0e85e2af633b688f4b3964ec5ccfb3 | 2,791 | py | Python | Nepali_nlp/Nepali_tokenizer.py | potamides/Nepali_nlp | d3d078ed50c8224f290d772f7b895354d0cb0266 | [
"MIT"
] | 123 | 2019-09-11T11:01:58.000Z | 2022-02-28T22:22:46.000Z | Nepali_nlp/Nepali_tokenizer.py | potamides/Nepali_nlp | d3d078ed50c8224f290d772f7b895354d0cb0266 | [
"MIT"
] | 6 | 2020-02-25T08:41:59.000Z | 2022-03-19T15:12:05.000Z | Nepali_nlp/Nepali_tokenizer.py | potamides/Nepali_nlp | d3d078ed50c8224f290d772f7b895354d0cb0266 | [
"MIT"
] | 30 | 2020-02-25T08:08:27.000Z | 2022-03-01T14:04:42.000Z | import os
import sys
sys.path.append('..')
import string
import tensorflow as tf
import sentencepiece as spm
class Tokenizer:
def __init__(self):
self.this_dir, self.this_file = os.path.split(__file__)
def sentence_tokenize(self, text):
"""This function tokenize the sentences
... | 30.67033 | 139 | 0.571121 | import os
import sys
sys.path.append('..')
import string
import tensorflow as tf
import sentencepiece as spm
class Tokenizer:
def __init__(self):
self.this_dir, self.this_file = os.path.split(__file__)
def sentence_tokenize(self, text):
sentences = text.strip().split(u"।")
sentences ... | true | true |
f7fd795d6fa81646651d587683db516589ffa49f | 16,432 | py | Python | greykite/framework/templates/base_template.py | briancpark/greykite | 2f484978a7ed206ebd9356e02fc1fb881cd25205 | [
"BSD-2-Clause"
] | null | null | null | greykite/framework/templates/base_template.py | briancpark/greykite | 2f484978a7ed206ebd9356e02fc1fb881cd25205 | [
"BSD-2-Clause"
] | null | null | null | greykite/framework/templates/base_template.py | briancpark/greykite | 2f484978a7ed206ebd9356e02fc1fb881cd25205 | [
"BSD-2-Clause"
] | null | null | null | # BSD 2-CLAUSE LICENSE
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions i... | 44.172043 | 110 | 0.683909 |
typing import Dict
from typing import Optional
import modin.pandas as pd
from greykite.common.evaluation import EvaluationMetricEnum
from greykite.common.time_properties_forecast import get_forecast_time_properties
from greykite.framework.pipeline.utils import get_basic_pipeline
from greykite.framework... | true | true |
f7fd7c10f311b68e9ad647397f97c4d32e016396 | 2,329 | py | Python | tests/localization/color/utils/test_color_converter.py | Lukasz1928/mobile-robots-control | 81820b35dab10b14f58d66079b0a8f82ef819bee | [
"MIT"
] | 2 | 2018-06-28T08:07:06.000Z | 2018-07-14T10:00:31.000Z | tests/localization/color/utils/test_color_converter.py | Lukasz1928/mobile-robots-control | 81820b35dab10b14f58d66079b0a8f82ef819bee | [
"MIT"
] | 6 | 2018-10-15T11:00:13.000Z | 2018-12-19T18:06:49.000Z | tests/localization/color/utils/test_color_converter.py | Lukasz1928/mobile-robots-control | 81820b35dab10b14f58d66079b0a8f82ef819bee | [
"MIT"
] | null | null | null | import cv2
from unittest import TestCase
import numpy as np
from parameterized import parameterized
from mrc.localization.color.utils.color_converter import ColorConverter
from tests.test_utils.read_image import read_image
class TestColorConverterGrayscale(TestCase):
def setUp(self):
self.converter = Colo... | 44.788462 | 129 | 0.729927 | import cv2
from unittest import TestCase
import numpy as np
from parameterized import parameterized
from mrc.localization.color.utils.color_converter import ColorConverter
from tests.test_utils.read_image import read_image
class TestColorConverterGrayscale(TestCase):
def setUp(self):
self.converter = Colo... | true | true |
f7fd7c279e69f2e85f1af5748cbfc5fd204662bc | 35,031 | py | Python | praw/reddit.py | NedJunk/praw | dd75d91e5574f1499cbef445dd68eb71445629df | [
"BSD-2-Clause"
] | null | null | null | praw/reddit.py | NedJunk/praw | dd75d91e5574f1499cbef445dd68eb71445629df | [
"BSD-2-Clause"
] | null | null | null | praw/reddit.py | NedJunk/praw | dd75d91e5574f1499cbef445dd68eb71445629df | [
"BSD-2-Clause"
] | null | null | null | """Provide the Reddit class."""
import asyncio
import configparser
import os
import re
import time
from itertools import islice
from logging import getLogger
from typing import (
IO,
TYPE_CHECKING,
Any,
Dict,
Generator,
Iterable,
Optional,
Type,
Union,
)
from warnings import warn
fr... | 36.114433 | 143 | 0.587851 | import asyncio
import configparser
import os
import re
import time
from itertools import islice
from logging import getLogger
from typing import (
IO,
TYPE_CHECKING,
Any,
Dict,
Generator,
Iterable,
Optional,
Type,
Union,
)
from warnings import warn
from prawcore import (
Authori... | true | true |
f7fd7c9c4713370a2d7d19701f523b768973eb7f | 1,483 | py | Python | venv/lib/python3.8/site-packages/vsts/work_item_tracking_process_definitions/v4_1/models/work_item_state_input_model.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/work_item_tracking_process_definitions/v4_1/models/work_item_state_input_model.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/work_item_tracking_process_definitions/v4_1/models/work_item_state_input_model.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... | 39.026316 | 95 | 0.513823 |
from msrest.serialization import Model
class WorkItemStateInputModel(Model):
_attribute_map = {
'color': {'key': 'color', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'order': {'key': 'order', 'type': 'int'},
'state_category': {'key': 'stateCategory', ... | true | true |
f7fd7ca8d0f5e73967a4f5b5743658a0a4422e31 | 186 | py | Python | lib/matplotlib/tri/__init__.py | pierre-haessig/matplotlib | 0d945044ca3fbf98cad55912584ef80911f330c6 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | 8 | 2021-12-14T21:30:01.000Z | 2022-02-14T11:30:03.000Z | lib/matplotlib/tri/__init__.py | pierre-haessig/matplotlib | 0d945044ca3fbf98cad55912584ef80911f330c6 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/tri/__init__.py | pierre-haessig/matplotlib | 0d945044ca3fbf98cad55912584ef80911f330c6 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | 3 | 2017-05-31T01:42:22.000Z | 2020-06-23T13:57:49.000Z | """
Unstructured triangular grid functions.
"""
from __future__ import print_function
from triangulation import *
from tricontour import *
from tripcolor import *
from triplot import *
| 18.6 | 39 | 0.795699 |
from __future__ import print_function
from triangulation import *
from tricontour import *
from tripcolor import *
from triplot import *
| true | true |
f7fd7cd4894f14adfd39d9d3acfd511035572d38 | 27,769 | py | Python | examples/inc/pytorch/multiple-choice/run_swag.py | michaelbenayoun/optimum | 21c5809577e2ef5687f293d31d1d3e28288e1bb7 | [
"Apache-2.0"
] | null | null | null | examples/inc/pytorch/multiple-choice/run_swag.py | michaelbenayoun/optimum | 21c5809577e2ef5687f293d31d1d3e28288e1bb7 | [
"Apache-2.0"
] | null | null | null | examples/inc/pytorch/multiple-choice/run_swag.py | michaelbenayoun/optimum | 21c5809577e2ef5687f293d31d1d3e28288e1bb7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Copyright The HuggingFace Team and The HuggingFace Inc. team. 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.ap... | 41.94713 | 132 | 0.674961 |
import logging
import os
import sys
from dataclasses import dataclass, field
from typing import Optional, Union
import datasets
import numpy as np
import torch
import transformers
from datasets import load_dataset
from transformers import (
AutoConfig,
AutoModelForMultipleChoice,
AutoToken... | true | true |
f7fd7cf4fb2362860c0f29984a3cc27dd564557e | 3,469 | py | Python | awx/main/dispatch/publish.py | sumit-21/awx | 966a62c6bf2ec0c672e076684341bc6bd75827af | [
"Apache-2.0"
] | 17 | 2021-04-03T01:40:17.000Z | 2022-03-03T11:45:20.000Z | awx/main/dispatch/publish.py | Saurabh-Thakre/awx | 8eb377a3ea8303c394ad4c958cc828c7239c1e11 | [
"Apache-2.0"
] | 24 | 2021-05-18T21:13:35.000Z | 2022-03-29T10:23:52.000Z | awx/main/dispatch/publish.py | hostinger/awx | dac01b14e2c04c201a162ea03ef8386d822e3923 | [
"Apache-2.0"
] | 24 | 2020-11-27T08:37:35.000Z | 2021-03-08T13:27:15.000Z | import inspect
import logging
import sys
import json
from uuid import uuid4
from django.conf import settings
from . import pg_bus_conn
logger = logging.getLogger('awx.main.dispatch')
def serialize_task(f):
return '.'.join([f.__module__, f.__name__])
class task:
"""
Used to decorate a function or clas... | 29.151261 | 101 | 0.533871 | import inspect
import logging
import sys
import json
from uuid import uuid4
from django.conf import settings
from . import pg_bus_conn
logger = logging.getLogger('awx.main.dispatch')
def serialize_task(f):
return '.'.join([f.__module__, f.__name__])
class task:
def __init__(self, queue=None):
se... | true | true |
f7fd7dbb7e204289f32cc1ccf0535d75693a45b0 | 3,186 | py | Python | spiral/core/extension.py | acdaniells/spiral | d78344007969d7c991216901b4a9d3ad7d768587 | [
"BSD-3-Clause"
] | null | null | null | spiral/core/extension.py | acdaniells/spiral | d78344007969d7c991216901b4a9d3ad7d768587 | [
"BSD-3-Clause"
] | 1 | 2020-04-01T18:39:48.000Z | 2020-04-01T18:39:48.000Z | spiral/core/extension.py | acdaniells/spiral | d78344007969d7c991216901b4a9d3ad7d768587 | [
"BSD-3-Clause"
] | 1 | 2020-04-01T18:36:44.000Z | 2020-04-01T18:36:44.000Z | """
Spiral core extensions module.
"""
import sys
from spiral.core.exc import SpiralError
from cement.core.extension import ExtensionInterface
from cement.core.handler import Handler
from cement.utils.misc import minimal_logger
LOG = minimal_logger(__name__)
class ExtensionHandler(ExtensionInterface, Handler):
... | 24.890625 | 79 | 0.592593 |
import sys
from spiral.core.exc import SpiralError
from cement.core.extension import ExtensionInterface
from cement.core.handler import Handler
from cement.utils.misc import minimal_logger
LOG = minimal_logger(__name__)
class ExtensionHandler(ExtensionInterface, Handler):
class Meta:
label = "spir... | true | true |
f7fd7eaf436bd3c969fa9c374a9d2bfdf03a940b | 1,446 | py | Python | assets/baekjoon/2667_building_site_number/python_2667.py | TakeaimK/TakeaimK.github.io | 13ef7dd7093fed5f60b16599b6b6d76190a2aaf8 | [
"MIT"
] | null | null | null | assets/baekjoon/2667_building_site_number/python_2667.py | TakeaimK/TakeaimK.github.io | 13ef7dd7093fed5f60b16599b6b6d76190a2aaf8 | [
"MIT"
] | null | null | null | assets/baekjoon/2667_building_site_number/python_2667.py | TakeaimK/TakeaimK.github.io | 13ef7dd7093fed5f60b16599b6b6d76190a2aaf8 | [
"MIT"
] | null | null | null |
def building_bfs(arr, point, n):
dx = [-1, 1, 0, 0]
dy = [0, 0, -1, 1]
site_total_count = 0
site_building = []
first_search = False
while point:
x, y = point.pop(0)
now = []
first_search = False
if arr[x][y] == 1:
now.append((x, y))
s... | 26.290909 | 77 | 0.45574 |
def building_bfs(arr, point, n):
dx = [-1, 1, 0, 0]
dy = [0, 0, -1, 1]
site_total_count = 0
site_building = []
first_search = False
while point:
x, y = point.pop(0)
now = []
first_search = False
if arr[x][y] == 1:
now.append((x, y))
s... | true | true |
f7fd7f9142e13c51d3e44fa7d50caa28928cd3a3 | 4,619 | py | Python | JapaneseTokenizer/common/sever_handler.py | fumankaitori/JapaneseTokenizers | 3bdfb6be73de0f78e5c08f3a51376ad3efa00b6c | [
"MIT"
] | 134 | 2015-12-14T05:05:41.000Z | 2022-03-27T15:52:30.000Z | JapaneseTokenizer/common/sever_handler.py | fumankaitori/JapaneseTokenizers | 3bdfb6be73de0f78e5c08f3a51376ad3efa00b6c | [
"MIT"
] | 40 | 2016-03-29T05:41:50.000Z | 2020-07-08T08:54:50.000Z | JapaneseTokenizer/common/sever_handler.py | fumankaitori/JapaneseTokenizers | 3bdfb6be73de0f78e5c08f3a51376ad3efa00b6c | [
"MIT"
] | 22 | 2016-01-27T01:17:59.000Z | 2022-02-15T13:46:39.000Z | #! -*- coding: utf-8 -*-
import subprocess
from subprocess import Popen, PIPE, STDOUT
import multiprocessing
# socket object
import socket
# logger
from JapaneseTokenizer import init_logger
import logging
# typing
from typing import Union
# else
from six import text_type
import six
import pexpect
import shutil
import s... | 33.715328 | 132 | 0.614852 |
import subprocess
from subprocess import Popen, PIPE, STDOUT
import multiprocessing
import socket
from JapaneseTokenizer import init_logger
import logging
from typing import Union
from six import text_type
import six
import pexpect
import shutil
import signal
import os
logger = init_logger.init_logger(logging.getL... | true | true |
f7fd808584f2cabbc9eb31d6906805c3b0d4d1f5 | 1,525 | py | Python | queue_/queue_.py | ashirka/programming-2021-19fpl | d4a233ac874a9e0397b6e61559b678da8b55b274 | [
"MIT"
] | null | null | null | queue_/queue_.py | ashirka/programming-2021-19fpl | d4a233ac874a9e0397b6e61559b678da8b55b274 | [
"MIT"
] | null | null | null | queue_/queue_.py | ashirka/programming-2021-19fpl | d4a233ac874a9e0397b6e61559b678da8b55b274 | [
"MIT"
] | null | null | null | """
Programming for linguists
Implementation of the data structure "Queue"
"""
from typing import Iterable
# pylint: disable=invalid-name
class Queue_:
"""
Queue Data Structure
"""
def __init__(self, data: Iterable = (), capacity: int = 50):
self.data = list(data)
self._capacity = ca... | 23.461538 | 64 | 0.552787 |
from typing import Iterable
class Queue_:
def __init__(self, data: Iterable = (), capacity: int = 50):
self.data = list(data)
self._capacity = capacity
def put(self, element):
if self.full():
raise IndexError
self.data.append(element)
def get(self):
... | true | true |
f7fd8131eb1abe4714e348a86b103cc2f4995887 | 12,251 | py | Python | marsyas-vamp/marsyas/src/marsyas_python/pitch_plots.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/pitch_plots.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/pitch_plots.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null |
#!/usr/bin/evn python
from pylab import *
from marsyas_util import *
import sys
import getopt
import os
# plot zerocrossings
def zerocrossings(frame_num, winSize, input_filename):
print "ZeroCrossings"
spec = ["Series/pitchExtract",
["SoundFileSource/src",
"Gain/gain",
... | 29.663438 | 130 | 0.605746 |
from pylab import *
from marsyas_util import *
import sys
import getopt
import os
def zerocrossings(frame_num, winSize, input_filename):
print "ZeroCrossings"
spec = ["Series/pitchExtract",
["SoundFileSource/src",
"Gain/gain",
]
]
net = creat... | false | true |
f7fd814c32684300b0fa5e5ddcf529bc340b8224 | 4,006 | py | Python | jackett-to-sonarr.py | marcus-crane/scripts | e349806d8494882d5cd45bc77b0445592c400d89 | [
"MIT"
] | 1 | 2021-06-30T06:19:37.000Z | 2021-06-30T06:19:37.000Z | jackett-to-sonarr.py | marcus-crane/scripts | e349806d8494882d5cd45bc77b0445592c400d89 | [
"MIT"
] | null | null | null | jackett-to-sonarr.py | marcus-crane/scripts | e349806d8494882d5cd45bc77b0445592c400d89 | [
"MIT"
] | null | null | null | """
Jackett to Sonarr
An extremely sloppy script for inserting Jackett indexes into Sonarr.
If you don't know what that is, you probably don't need it!
I've manually done this setup in the past and it's very tedious
so I decided to automate it once and for all
You can get a Sonarr API key by using the dev tools and c... | 33.107438 | 133 | 0.667 |
import json
import requests
sonarr_url = "http://192.168.1.xx:8989"
sonarr_api_key = "<api_key>"
jackett_url = "http://192.168.1.xx:9117"
jackett_api_key = "<api_key>"
jackett_api_url = f"{jackett_url}/api/v2.0/indexers"
test_url = f"{sonarr_url}/api/v3/indexer/test"
submit_url = f"{sonarr_url}/api/v3/indexer"
he... | true | true |
f7fd81b4a06a9d7940495a8813bfd7850d55d428 | 6,577 | py | Python | torchreid/engine/image/viewpoint_aware.py | iankuoli/OSNet-TopDrop | 3ab57ba507e9f8939762e27834137172375cd91c | [
"MIT"
] | null | null | null | torchreid/engine/image/viewpoint_aware.py | iankuoli/OSNet-TopDrop | 3ab57ba507e9f8939762e27834137172375cd91c | [
"MIT"
] | null | null | null | torchreid/engine/image/viewpoint_aware.py | iankuoli/OSNet-TopDrop | 3ab57ba507e9f8939762e27834137172375cd91c | [
"MIT"
] | null | null | null | from __future__ import division, print_function, absolute_import
from ... import metrics
from ...engine.engine import Engine
from ...losses import FocalLoss, CrossEntropyLoss, ALSRLoss
from .vat import VATLoss
import math
import torch
from torch.nn import Parameter
import torch.nn.functional as F
import torch.nn as n... | 38.238372 | 123 | 0.593432 | from __future__ import division, print_function, absolute_import
from ... import metrics
from ...engine.engine import Engine
from ...losses import FocalLoss, CrossEntropyLoss, ALSRLoss
from .vat import VATLoss
import math
import torch
from torch.nn import Parameter
import torch.nn.functional as F
import torch.nn as n... | true | true |
f7fd81c9a90a4731cceb83fc325a7b44197d0c7a | 613 | py | Python | ensconce/cli.py | netwrkr/ensconce | eda938c67eb0af8fb7d3ccf668e07d2f76485aa5 | [
"BSD-3-Clause"
] | 1 | 2021-05-05T13:52:44.000Z | 2021-05-05T13:52:44.000Z | ensconce/cli.py | netwrkr/ensconce | eda938c67eb0af8fb7d3ccf668e07d2f76485aa5 | [
"BSD-3-Clause"
] | null | null | null | ensconce/cli.py | netwrkr/ensconce | eda938c67eb0af8fb7d3ccf668e07d2f76485aa5 | [
"BSD-3-Clause"
] | null | null | null | import sys
import optparse
from ensconce.config import init_app, config
from ensconce import server
def run_server(argv=None):
if argv is None:
argv = sys.argv
parser = optparse.OptionParser(description='Run the ensconce cherrypy server.')
init_app()
parser.add_option('-d', '--de... | 26.652174 | 83 | 0.600326 | import sys
import optparse
from ensconce.config import init_app, config
from ensconce import server
def run_server(argv=None):
if argv is None:
argv = sys.argv
parser = optparse.OptionParser(description='Run the ensconce cherrypy server.')
init_app()
parser.add_option('-d', '--de... | true | true |
f7fd8222b161847ddcd7f5749f69a02e23c18396 | 30,040 | py | Python | src/onecontainer_api/routers/tests/test_media.py | intel/stacks-api | 904eeeb0eedee9d9b9cced32dcbf9d4b3871bc87 | [
"BSD-3-Clause"
] | 4 | 2020-12-08T19:06:41.000Z | 2021-08-13T09:32:21.000Z | src/onecontainer_api/routers/tests/test_media.py | intel/stacks-api | 904eeeb0eedee9d9b9cced32dcbf9d4b3871bc87 | [
"BSD-3-Clause"
] | 2 | 2020-12-15T20:35:39.000Z | 2021-01-05T17:37:12.000Z | src/onecontainer_api/routers/tests/test_media.py | intel/stacks-api | 904eeeb0eedee9d9b9cced32dcbf9d4b3871bc87 | [
"BSD-3-Clause"
] | 4 | 2020-12-04T20:39:23.000Z | 2021-01-04T10:26:33.000Z | # SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2020 Intel Corporation
import os
import time
from fastapi.testclient import TestClient
from onecontainer_api import models, schemas, config, startup_svc
from onecontainer_api.frontend import app
web_server_port = 80
rtmp_server_port = 1935
for svc in config.IN... | 43.854015 | 1,723 | 0.54737 |
import os
import time
from fastapi.testclient import TestClient
from onecontainer_api import models, schemas, config, startup_svc
from onecontainer_api.frontend import app
web_server_port = 80
rtmp_server_port = 1935
for svc in config.INITIAL_SERVICES:
if svc["image"] == "web-rtmp":
web_server_port = s... | true | true |
f7fd8351f039aea1f7dd655273f34851265e3b5c | 960 | py | Python | application/bus_exp/code/collect_metrics.py | UCY-LINC-LAB/5G-Slicer-demo | 0d2c7ddabb339a54591bc3f58769c88d2ff4c42a | [
"Apache-2.0"
] | null | null | null | application/bus_exp/code/collect_metrics.py | UCY-LINC-LAB/5G-Slicer-demo | 0d2c7ddabb339a54591bc3f58769c88d2ff4c42a | [
"Apache-2.0"
] | null | null | null | application/bus_exp/code/collect_metrics.py | UCY-LINC-LAB/5G-Slicer-demo | 0d2c7ddabb339a54591bc3f58769c88d2ff4c42a | [
"Apache-2.0"
] | null | null | null | import logging
from threading import Thread
from time import sleep
import requests
from cachetools import TTLCache
from utils.edge_fuctionality import get_random_metrics, propagate_to_edge, get_url_from_mobility
cache = TTLCache(maxsize=128, ttl=5)
# from utils.weather import Weather
# w = Weather()
# t = w.retrieve_a... | 29.090909 | 96 | 0.704167 | import logging
from threading import Thread
from time import sleep
import requests
from cachetools import TTLCache
from utils.edge_fuctionality import get_random_metrics, propagate_to_edge, get_url_from_mobility
cache = TTLCache(maxsize=128, ttl=5)
data_list = []
def helping_function(data_list = []):
url = cach... | true | true |
f7fd83f08e7be8ce6bb5f9396e3aeae3e22ccb1b | 11,431 | py | Python | stanza/models/parser.py | de9uch1/stanza | cafb7d5004842cd3c8a3ac334ce7649bac928830 | [
"Apache-2.0"
] | 1 | 2021-05-23T12:44:34.000Z | 2021-05-23T12:44:34.000Z | stanza/models/parser.py | de9uch1/stanza | cafb7d5004842cd3c8a3ac334ce7649bac928830 | [
"Apache-2.0"
] | null | null | null | stanza/models/parser.py | de9uch1/stanza | cafb7d5004842cd3c8a3ac334ce7649bac928830 | [
"Apache-2.0"
] | null | null | null | """
Entry point for training and evaluating a dependency parser.
This implementation combines a deep biaffine graph-based parser with linearization and distance features.
For details please refer to paper: https://nlp.stanford.edu/pubs/qi2018universal.pdf.
"""
"""
Training and evaluation for the parser.
"""
import s... | 43.965385 | 144 | 0.655148 |
import sys
import os
import shutil
import time
from datetime import datetime
import argparse
import numpy as np
import random
import torch
from torch import nn, optim
from stanza.models.depparse.data import DataLoader
from stanza.models.depparse.trainer import Trainer
from stanza.models.depparse import scorer
from s... | true | true |
f7fd8444f89d3b502461e65a9d2c65e3f0d16f50 | 4,481 | py | Python | cyllene/m_magics.py | 28left/psumathnotebooks | ec948216304e5f234a2f4d0f6bdcfaa1a10c435d | [
"MIT"
] | 1 | 2021-05-04T14:09:51.000Z | 2021-05-04T14:09:51.000Z | cyllene/m_magics.py | 28left/psumathnotebooks | ec948216304e5f234a2f4d0f6bdcfaa1a10c435d | [
"MIT"
] | null | null | null | cyllene/m_magics.py | 28left/psumathnotebooks | ec948216304e5f234a2f4d0f6bdcfaa1a10c435d | [
"MIT"
] | null | null | null | # problem and answer magics
from os import path
from IPython.core.magic import (register_line_magic, register_cell_magic,
register_line_cell_magic)
from IPython import get_ipython
from cyllene.p_problem import ProbStack
ip = get_ipython()
@register_line_magic
def initialize(line):
... | 34.736434 | 123 | 0.561928 |
from os import path
from IPython.core.magic import (register_line_magic, register_cell_magic,
register_line_cell_magic)
from IPython import get_ipython
from cyllene.p_problem import ProbStack
ip = get_ipython()
@register_line_magic
def initialize(line):
if line=='':
... | true | true |
f7fd8639164634212df3126522a346d82f6d902a | 2,420 | py | Python | backend/output/reports/MaturityAssessmentReport.py | alexafshar/config-assessment-tool | b8956f4de2aa4fa3ba80f98362fc397f6d195b1c | [
"Apache-2.0"
] | null | null | null | backend/output/reports/MaturityAssessmentReport.py | alexafshar/config-assessment-tool | b8956f4de2aa4fa3ba80f98362fc397f6d195b1c | [
"Apache-2.0"
] | null | null | null | backend/output/reports/MaturityAssessmentReport.py | alexafshar/config-assessment-tool | b8956f4de2aa4fa3ba80f98362fc397f6d195b1c | [
"Apache-2.0"
] | null | null | null | import logging
from openpyxl import Workbook
from output.ReportBase import ReportBase
from util.xcel_utils import addFilterAndFreeze, resizeColumnWidth, writeColoredRow, writeSummarySheet, writeUncoloredRow
class MaturityAssessmentReport(ReportBase):
def createWorkbook(self, jobs, controllerData, jobFileName):
... | 37.8125 | 130 | 0.551653 | import logging
from openpyxl import Workbook
from output.ReportBase import ReportBase
from util.xcel_utils import addFilterAndFreeze, resizeColumnWidth, writeColoredRow, writeSummarySheet, writeUncoloredRow
class MaturityAssessmentReport(ReportBase):
def createWorkbook(self, jobs, controllerData, jobFileName):
... | true | true |
f7fd863f1cedcc790d138ac7e4fa33f473c855df | 17,121 | py | Python | owtf/managers/poutput.py | Lonewolf-Information-systems/owtf | 65355ce8bf4a4ea0177e24ee106f77e2f87c17fa | [
"BSD-3-Clause"
] | 1 | 2018-02-05T12:10:28.000Z | 2018-02-05T12:10:28.000Z | owtf/managers/poutput.py | Lonewolf-Information-systems/owtf | 65355ce8bf4a4ea0177e24ee106f77e2f87c17fa | [
"BSD-3-Clause"
] | 2 | 2021-03-11T03:35:23.000Z | 2022-02-10T23:40:23.000Z | owtf/managers/poutput.py | Lonewolf-Information-systems/owtf | 65355ce8bf4a4ea0177e24ee106f77e2f87c17fa | [
"BSD-3-Clause"
] | null | null | null | """
owtf.db.poutput_manager
~~~~~~~~~~~~~~~~~~~~~~~
"""
import os
import json
from sqlalchemy.exc import SQLAlchemyError
from owtf.dependency_management.dependency_resolver import BaseComponent
from owtf.dependency_management.interfaces import PluginOutputInterface
from owtf.managers.target import target_required
f... | 40.764286 | 120 | 0.600899 |
import os
import json
from sqlalchemy.exc import SQLAlchemyError
from owtf.dependency_management.dependency_resolver import BaseComponent
from owtf.dependency_management.interfaces import PluginOutputInterface
from owtf.managers.target import target_required
from owtf.managers.session import session_required
from ow... | true | true |
f7fd865bee772808f0f9dc4cfad226b44038465f | 1,252 | py | Python | grr/core/grr_response_core/lib/parsers/cron_file_parser.py | magnologan/grr | 06eeb071e9a925b34f67caf776c3330b39154850 | [
"Apache-2.0"
] | null | null | null | grr/core/grr_response_core/lib/parsers/cron_file_parser.py | magnologan/grr | 06eeb071e9a925b34f67caf776c3330b39154850 | [
"Apache-2.0"
] | null | null | null | grr/core/grr_response_core/lib/parsers/cron_file_parser.py | magnologan/grr | 06eeb071e9a925b34f67caf776c3330b39154850 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Simple parsers for cron type files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import crontab
from future.builtins import str
from grr_response_core.lib import parser
from grr_response_core.lib.rdfvalues import cronjobs... | 26.083333 | 69 | 0.679712 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import crontab
from future.builtins import str
from grr_response_core.lib import parser
from grr_response_core.lib.rdfvalues import cronjobs as rdf_cronjobs
class CronTabParser(parser.FileParser):
o... | true | true |
f7fd8725e0a57737aa8294f7d1389060706697fe | 1,073 | py | Python | tensorflow/contrib/py2tf/__init__.py | harunpehlivan/tensorflow | 376e2cfdab31f4da251ea2e50992a9bf97fd171b | [
"Apache-2.0"
] | 2 | 2020-05-18T03:08:51.000Z | 2020-09-25T03:11:50.000Z | tensorflow/contrib/py2tf/__init__.py | hamzabekkouri/tensorflow | d87a9fbbc5f49ec5ae8eb52c62628f0b1a0bf67f | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/py2tf/__init__.py | hamzabekkouri/tensorflow | d87a9fbbc5f49ec5ae8eb52c62628f0b1a0bf67f | [
"Apache-2.0"
] | 1 | 2021-07-20T16:07:01.000Z | 2021-07-20T16:07:01.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.766667 | 80 | 0.732526 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.util.all_util import remove_undocumented
_allowed_symbols = []
remove_undocumented(__name__, _allowed_symbols)
| true | true |
f7fd881b232ce7cc66123714aacdd5e1a725e137 | 1,989 | py | Python | kornia/losses/psnr.py | pmeier/kornia | 57f5aeb605d0c69de88a0a1aa1563cee52d4bfaf | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2021-04-15T01:20:01.000Z | 2022-01-12T14:12:54.000Z | kornia/losses/psnr.py | pmeier/kornia | 57f5aeb605d0c69de88a0a1aa1563cee52d4bfaf | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | kornia/losses/psnr.py | pmeier/kornia | 57f5aeb605d0c69de88a0a1aa1563cee52d4bfaf | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-10-20T06:57:07.000Z | 2020-10-20T06:57:07.000Z | import torch
import torch.nn as nn
from torch.nn.functional import mse_loss
class PSNRLoss(nn.Module):
r"""Creates a criterion that calculates the PSNR between 2 images. Given an m x n image, the PSNR is:
.. math::
\text{PSNR} = 10 \log_{10} \bigg(\frac{\text{MAX}_I^2}{MSE(I,T)}\bigg)
where
... | 33.15 | 105 | 0.64002 | import torch
import torch.nn as nn
from torch.nn.functional import mse_loss
class PSNRLoss(nn.Module):
def __init__(self, max_val: float) -> None:
super(PSNRLoss, self).__init__()
self.max_val: float = max_val
def forward(self, input: torch.Tensor, target: torch.Tensor) -> torch.Tensor:
... | true | true |
f7fd8a82dbd8001e68bbadbbea1dcf53182a86fc | 4,131 | py | Python | Plots/Skew-T/NCL_skewt_3_2.py | learn2free/GeoCAT-examples | 3ac152a767e78a362a8ebb6f677005f3de320ca6 | [
"Apache-2.0"
] | 1 | 2021-05-09T02:54:10.000Z | 2021-05-09T02:54:10.000Z | Plots/Skew-T/NCL_skewt_3_2.py | learn2free/GeoCAT-examples | 3ac152a767e78a362a8ebb6f677005f3de320ca6 | [
"Apache-2.0"
] | null | null | null | Plots/Skew-T/NCL_skewt_3_2.py | learn2free/GeoCAT-examples | 3ac152a767e78a362a8ebb6f677005f3de320ca6 | [
"Apache-2.0"
] | null | null | null | """
NCL_skewt_3_2.py
=================
This script illustrates the following concepts:
- Drawing Skew-T plots
- Thinning the wind barbs in a Skew-T plot
- Customizing the background of a Skew_T plot
See following URLs to see the reproduced NCL plot & script:
- Original NCL script: https://www.ncl.ucar.... | 33.585366 | 86 | 0.597434 | true | true | |
f7fd8af0f84ec714ff8e6274f3c52715d339784f | 9,608 | py | Python | STL_Py/venv/Version_Extended/ExtendedOutputDemo.py | pb-10/Smart-Traffic-Light | 334ba878f42723b72ea2a23fe912e429763ba3af | [
"MIT"
] | 3 | 2021-05-19T04:59:08.000Z | 2021-08-23T20:35:54.000Z | STL_Py/venv/Version_Extended/ExtendedOutputDemo.py | pb-10/Smart-Traffic-Light | 334ba878f42723b72ea2a23fe912e429763ba3af | [
"MIT"
] | null | null | null | STL_Py/venv/Version_Extended/ExtendedOutputDemo.py | pb-10/Smart-Traffic-Light | 334ba878f42723b72ea2a23fe912e429763ba3af | [
"MIT"
] | 3 | 2022-02-16T04:56:58.000Z | 2022-02-25T09:51:38.000Z | from turtle import Turtle
import turtle
from turtle import Screen
def HeadText():
turtle.color('black')
style = ('Courier', 14,)
turtle.speed(1000)
turtle.penup()
turtle.setposition(-198, 285)
turtle.write('Side 1', font=style, align='center')
turtle.penup()
turtle.setposition(-48, 285... | 23.434146 | 62 | 0.583264 | from turtle import Turtle
import turtle
from turtle import Screen
def HeadText():
turtle.color('black')
style = ('Courier', 14,)
turtle.speed(1000)
turtle.penup()
turtle.setposition(-198, 285)
turtle.write('Side 1', font=style, align='center')
turtle.penup()
turtle.setposition(-48, 285... | true | true |
f7fd8b209317e2cf8c85b59d2fc7c232fc74fd93 | 322 | py | Python | cedar_settings/utils/datetime.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | null | null | null | cedar_settings/utils/datetime.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | 11 | 2020-03-24T15:29:46.000Z | 2022-03-11T23:14:48.000Z | cedar_settings/utils/datetime.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | null | null | null | import pytz
from django.conf import settings
def localize_datetime(dt):
""" Takes a datetime object and localizes it to the timezone saved in settings.TIME_ZONE
:param dt: datetime object
:return: Timezone aware datetime object
"""
tz = pytz.timezone(settings.TIME_ZONE)
return tz.localize(dt... | 23 | 92 | 0.726708 | import pytz
from django.conf import settings
def localize_datetime(dt):
tz = pytz.timezone(settings.TIME_ZONE)
return tz.localize(dt)
| true | true |
f7fd8bf9ca810018cfe75f333dbf3fcc7251274f | 2,306 | py | Python | setup.py | caseypw/m2g | be29587322ab1fafb96f6afb726efbdb39b64b66 | [
"Apache-2.0"
] | null | null | null | setup.py | caseypw/m2g | be29587322ab1fafb96f6afb726efbdb39b64b66 | [
"Apache-2.0"
] | null | null | null | setup.py | caseypw/m2g | be29587322ab1fafb96f6afb726efbdb39b64b66 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
setup.py
~~~~~~~~
on package install:
- generates metadata
- installs json files for use in m2g_cloud
- installs `m2g` script keywords to the command line
- ensures python version
- installs m2g dependencies
Use `pip install .` to install the package.
Use `pip install -e .` to install the pa... | 27.129412 | 113 | 0.582827 |
from setuptools import setup, find_packages
from m2g import __version__
kwargs = {}
kwargs.update(
dict(
name="m2g",
version=__version__,
description="Neuro Data MRI to Graphs Pipeline",
author="Derek Pisner, Alex Loftus, Greg Kiar, Eric Bridgeford, and Will Gray Roncal",
... | true | true |
f7fd8c191bd9b665e91705fe3371b26bde803c75 | 23,120 | py | Python | ddganAE/architectures/cae/D2/cae.py | Zeff020/Adversarial_ROM | 8c9e7ff86250e9370e5fdd2018f9ad04ded5f122 | [
"MIT"
] | 1 | 2021-12-27T06:14:32.000Z | 2021-12-27T06:14:32.000Z | ddganAE/architectures/cae/D2/cae.py | Zeff020/Adversarial_ROM | 8c9e7ff86250e9370e5fdd2018f9ad04ded5f122 | [
"MIT"
] | null | null | null | ddganAE/architectures/cae/D2/cae.py | Zeff020/Adversarial_ROM | 8c9e7ff86250e9370e5fdd2018f9ad04ded5f122 | [
"MIT"
] | 3 | 2021-08-05T11:17:37.000Z | 2021-09-02T02:37:44.000Z | """
Collection of encoders and decoders that can readily be imported
and used by the 2D adversarial and convolutional autoencoder and predictive
models.
Note that these models are currently adjusted to a 55 by 42 input shape.
"""
from keras.layers import Dense, Flatten, Reshape, Conv2D, UpSampling2D, \
... | 40.41958 | 79 | 0.611289 |
from keras.layers import Dense, Flatten, Reshape, Conv2D, UpSampling2D, \
Cropping2D, MaxPool2D
from keras.models import Sequential
__author__ = "Zef Wolffs"
__credits__ = []
__license__ = "MIT"
__version__ = "1.0.0"
__maintainer__ = "Zef Wolffs"
__email__ = "zefwolffs@gmail.com"
__status__ =... | true | true |
f7fd8d118cefc62e3e3570851035ec70d87acec4 | 6,400 | py | Python | cea/tests/create_unittest_data.py | justinfmccarty/CityEnergyAnalyst_bigmacc | a7f2d6085e83730bdc4bcb2321e1613070372027 | [
"MIT"
] | null | null | null | cea/tests/create_unittest_data.py | justinfmccarty/CityEnergyAnalyst_bigmacc | a7f2d6085e83730bdc4bcb2321e1613070372027 | [
"MIT"
] | null | null | null | cea/tests/create_unittest_data.py | justinfmccarty/CityEnergyAnalyst_bigmacc | a7f2d6085e83730bdc4bcb2321e1613070372027 | [
"MIT"
] | null | null | null | """
Create the data for cea/tests/test_calc_thermal_loads.py
Run this script when the core algorithms get updated and the unittests in ``test_calc_thermal_loads.py`` stop working.
The script overwrites the file ``cea/tests/test_calc_thermal_loads.config`` which contains the data used for the
unit tests. You can safely... | 44.755245 | 118 | 0.654688 |
import configparser
import json
import os
import tempfile
import zipfile
import pandas as pd
from cea.demand.building_properties import BuildingProperties
from cea.demand.schedule_maker.schedule_maker import schedule_maker_main
from cea.demand.thermal_loads import calc_thermal_loads
from cea.inputlocator import In... | true | true |
f7fd8e015e75b14ad1c05d0881e176eb9503c862 | 422 | py | Python | aliyun/api/rest/Ecs20140526DescribeEipMonitorDataRequest.py | snowyxx/aliyun-python-demo | ed40887ddff440b85b77f9b2a1fcda11cca55c8b | [
"Apache-2.0"
] | null | null | null | aliyun/api/rest/Ecs20140526DescribeEipMonitorDataRequest.py | snowyxx/aliyun-python-demo | ed40887ddff440b85b77f9b2a1fcda11cca55c8b | [
"Apache-2.0"
] | null | null | null | aliyun/api/rest/Ecs20140526DescribeEipMonitorDataRequest.py | snowyxx/aliyun-python-demo | ed40887ddff440b85b77f9b2a1fcda11cca55c8b | [
"Apache-2.0"
] | null | null | null | '''
Created by auto_sdk on 2015.02.10
'''
from aliyun.api.base import RestApi
class Ecs20140526DescribeEipMonitorDataRequest(RestApi):
def __init__(self,domain='ecs.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.AllocationId = None
self.EndTime = None
self.Period = None
self.Start... | 28.133333 | 62 | 0.739336 | from aliyun.api.base import RestApi
class Ecs20140526DescribeEipMonitorDataRequest(RestApi):
def __init__(self,domain='ecs.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.AllocationId = None
self.EndTime = None
self.Period = None
self.StartTime = None
def getapiname(self):
retu... | true | true |
f7fd8f9438f124c05d135be072ef0ebc0cd67ec4 | 5,007 | py | Python | models/cifar/resnet.py | awwong1/ml-research | 6f0bb585fef0c4567a5f02937fea62726b9c88dd | [
"MIT"
] | null | null | null | models/cifar/resnet.py | awwong1/ml-research | 6f0bb585fef0c4567a5f02937fea62726b9c88dd | [
"MIT"
] | null | null | null | models/cifar/resnet.py | awwong1/ml-research | 6f0bb585fef0c4567a5f02937fea62726b9c88dd | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import torch.nn as nn
import math
__all__ = ["resnet"]
class BasicBlock(nn.Module):
expansion = 1
def __init__(self, inplanes, planes, stride=1, downsample=None):
super(BasicBlock, self).__init__()
self.conv1 = nn.Conv2d(
inplanes, planes, ... | 29.982036 | 99 | 0.551628 | from __future__ import absolute_import
import torch.nn as nn
import math
__all__ = ["resnet"]
class BasicBlock(nn.Module):
expansion = 1
def __init__(self, inplanes, planes, stride=1, downsample=None):
super(BasicBlock, self).__init__()
self.conv1 = nn.Conv2d(
inplanes, planes, ... | true | true |
f7fd8fa543efd1a5b16d1377ea04cd2f6d555a6b | 34,003 | py | Python | greykite/tests/framework/output/test_univariate_forecast.py | goncaloperes/greykite | 160bb3ada71e3c778e1fb3d242676c42ff619e3a | [
"BSD-2-Clause"
] | 1 | 2021-11-17T03:02:24.000Z | 2021-11-17T03:02:24.000Z | greykite/tests/framework/output/test_univariate_forecast.py | goncaloperes/greykite | 160bb3ada71e3c778e1fb3d242676c42ff619e3a | [
"BSD-2-Clause"
] | null | null | null | greykite/tests/framework/output/test_univariate_forecast.py | goncaloperes/greykite | 160bb3ada71e3c778e1fb3d242676c42ff619e3a | [
"BSD-2-Clause"
] | null | null | null | import datetime
import math
import sys
from functools import partial
import numpy as np
import pandas as pd
import pytest
from pandas.util.testing import assert_frame_equal
from pandas.util.testing import assert_series_equal
from sklearn.pipeline import Pipeline
from greykite.common import constants as cst
from greyk... | 43.59359 | 140 | 0.678499 | import datetime
import math
import sys
from functools import partial
import numpy as np
import pandas as pd
import pytest
from pandas.util.testing import assert_frame_equal
from pandas.util.testing import assert_series_equal
from sklearn.pipeline import Pipeline
from greykite.common import constants as cst
from greyk... | true | true |
f7fd901458b45fdb785e1d676187053baa41ac7e | 254 | py | Python | Python3/1015-Smallest-Integer-Divisible-by-K/soln-1.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/1015-Smallest-Integer-Divisible-by-K/soln-1.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/1015-Smallest-Integer-Divisible-by-K/soln-1.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | class Solution:
def smallestRepunitDivByK(self, K: int) -> int:
if K % 2 == 0 or K % 5 == 0:
return -1
ans = num = 1
while num % K != 0:
num = (num * 10 + 1) % K
ans += 1
return ans
| 25.4 | 51 | 0.413386 | class Solution:
def smallestRepunitDivByK(self, K: int) -> int:
if K % 2 == 0 or K % 5 == 0:
return -1
ans = num = 1
while num % K != 0:
num = (num * 10 + 1) % K
ans += 1
return ans
| true | true |
f7fd90307a612d7bbc713c420af1fce102f45b32 | 2,004 | py | Python | cutplanner/planner.py | alanc10n/py-cutplanner | 66c90942c258f453df742cb7bcca43981bfd9af3 | [
"MIT"
] | null | null | null | cutplanner/planner.py | alanc10n/py-cutplanner | 66c90942c258f453df742cb7bcca43981bfd9af3 | [
"MIT"
] | 1 | 2015-02-27T02:26:22.000Z | 2015-02-27T02:26:22.000Z | cutplanner/planner.py | alanc10n/py-cutplanner | 66c90942c258f453df742cb7bcca43981bfd9af3 | [
"MIT"
] | null | null | null | """ Allows production of cutlists for a given set of required pieces, given
a set of available stock sizes.
"""
import collections
from .stock import Stock
# simple structure to keep track of a specific piece
Piece = collections.namedtuple('Piece', 'id, length')
class Planner(object):
""" Object that can produc... | 32.322581 | 75 | 0.64022 |
import collections
from .stock import Stock
Piece = collections.namedtuple('Piece', 'id, length')
class Planner(object):
def __init__(self, sizes, needed, loss=0.25):
self.stock = []
self.stock_sizes = sorted(sizes)
self.pieces_needed = [Piece(i, s) for i, s in enumerate(needed)]
... | true | true |
f7fd9043d5068529ede3f38b459a8c96b8805de2 | 15,224 | py | Python | tests/unit/local/docker/test_lambda_image.py | renanmontebelo/aws-sam-cli | b5cfc46aa9726b5cd006df8ecc08d1b4eedeb9ea | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2021-11-21T09:21:59.000Z | 2021-11-21T09:21:59.000Z | tests/unit/local/docker/test_lambda_image.py | renanmontebelo/aws-sam-cli | b5cfc46aa9726b5cd006df8ecc08d1b4eedeb9ea | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | tests/unit/local/docker/test_lambda_image.py | renanmontebelo/aws-sam-cli | b5cfc46aa9726b5cd006df8ecc08d1b4eedeb9ea | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | import io
import tempfile
from unittest import TestCase
from unittest.mock import patch, Mock, mock_open, ANY
from docker.errors import ImageNotFound, BuildError, APIError
from samcli.commands.local.lib.exceptions import InvalidIntermediateImageError
from samcli.lib.utils.packagetype import ZIP, IMAGE
from samcli.lo... | 44.776471 | 119 | 0.721821 | import io
import tempfile
from unittest import TestCase
from unittest.mock import patch, Mock, mock_open, ANY
from docker.errors import ImageNotFound, BuildError, APIError
from samcli.commands.local.lib.exceptions import InvalidIntermediateImageError
from samcli.lib.utils.packagetype import ZIP, IMAGE
from samcli.lo... | true | true |
f7fd90cf5e1c4635af96e61f23b0339f2737b2ca | 2,209 | py | Python | source/ogame_constant.py | Stegoo/ogame-caller | 29efcb36a503cae17110a52d3a4079a0a7103c80 | [
"MIT"
] | 1 | 2016-06-11T08:09:55.000Z | 2016-06-11T08:09:55.000Z | source/ogame_constant.py | Stegoo/ogame-caller | 29efcb36a503cae17110a52d3a4079a0a7103c80 | [
"MIT"
] | null | null | null | source/ogame_constant.py | Stegoo/ogame-caller | 29efcb36a503cae17110a52d3a4079a0a7103c80 | [
"MIT"
] | null | null | null | Buildings = {'MetalMine': 1,
'CrystalMine': 2,
'DeuteriumSynthesizer': 3,
'SolarPlant': 4,
'FusionReactor': 12,
'MetalStorage': 22,
'CrystalStorage': 23,
'DeuteriumTank': 24,
'ShieldedMetalDen': 25,
'Und... | 26.939024 | 48 | 0.463558 | Buildings = {'MetalMine': 1,
'CrystalMine': 2,
'DeuteriumSynthesizer': 3,
'SolarPlant': 4,
'FusionReactor': 12,
'MetalStorage': 22,
'CrystalStorage': 23,
'DeuteriumTank': 24,
'ShieldedMetalDen': 25,
'Und... | true | true |
f7fd91e957d2685596b23872ecc78b9282f85139 | 106 | py | Python | tests/test_zip2np.py | borjaeg/zip2np | e55f0e13b8807c086946c0411dbefae0a022f325 | [
"MIT"
] | null | null | null | tests/test_zip2np.py | borjaeg/zip2np | e55f0e13b8807c086946c0411dbefae0a022f325 | [
"MIT"
] | null | null | null | tests/test_zip2np.py | borjaeg/zip2np | e55f0e13b8807c086946c0411dbefae0a022f325 | [
"MIT"
] | null | null | null | from zip2np import zip2np
def test_positive_size():
assert zip2np.load_datasets(".", (64, -64)) == -1 | 26.5 | 53 | 0.688679 | from zip2np import zip2np
def test_positive_size():
assert zip2np.load_datasets(".", (64, -64)) == -1 | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.