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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7900e39d54b01c16f8a60533eabc3552bdaf547d | 2,421 | py | Python | examples/fastformers/onnx_graph_optimizer/fusion_utils.py | kiminh/fastformers | 8f1aa4f719d7edfa4e77e03d518f7bad2d61004d | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:10.000Z | 2021-01-11T18:40:10.000Z | examples/fastformers/onnx_graph_optimizer/fusion_utils.py | kiminh/fastformers | 8f1aa4f719d7edfa4e77e03d518f7bad2d61004d | [
"Apache-2.0"
] | null | null | null | examples/fastformers/onnx_graph_optimizer/fusion_utils.py | kiminh/fastformers | 8f1aa4f719d7edfa4e77e03d518f7bad2d61004d | [
"Apache-2.0"
] | null | null | null | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
#--------------------------------------------------------------------------
from logging import getLogger
from .onnx_model import OnnxModel
from typin... | 41.741379 | 104 | 0.609252 |
from logging import getLogger
from .onnx_model import OnnxModel
from typing import Tuple
from onnx import helper, TensorProto
logger = getLogger(__name__)
class FusionUtils:
def __init__(self, model: OnnxModel):
self.model: OnnxModel = model
def cast_graph_input_to_int32(self, input_name: str) -... | true | true |
7900e41edb6cc1cb6c455bcc68c0910a3eb7bae2 | 4,101 | py | Python | cirq-core/cirq/protocols/equal_up_to_global_phase_protocol.py | LLcat1217/Cirq | b88069f7b01457e592ad69d6b413642ef11a56b8 | [
"Apache-2.0"
] | 3,326 | 2018-07-18T23:17:21.000Z | 2022-03-29T22:28:24.000Z | cirq-core/cirq/protocols/equal_up_to_global_phase_protocol.py | bradyb/Cirq | 610b0d4ea3a7862169610797266734c844ddcc1f | [
"Apache-2.0"
] | 3,443 | 2018-07-18T21:07:28.000Z | 2022-03-31T20:23:21.000Z | cirq-core/cirq/protocols/equal_up_to_global_phase_protocol.py | bradyb/Cirq | 610b0d4ea3a7862169610797266734c844ddcc1f | [
"Apache-2.0"
] | 865 | 2018-07-18T23:30:24.000Z | 2022-03-30T11:43:23.000Z | # Copyright 2019 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 40.60396 | 94 | 0.710802 |
import numbers
from collections.abc import Iterable
from typing import Any, Union
import numpy as np
from typing_extensions import Protocol
from cirq import linalg
from cirq._doc import doc_private
from cirq.protocols.approximate_equality_protocol import approx_eq
class SupportsEqualUpToGlobalPhase(Pr... | true | true |
7900e45308c582c70cfe30e4d99db5aad0f8850d | 1,569 | py | Python | test/augmenter/spectrogram/test_loudness_spec.py | lucidworks/nlpaug | 8e47fa39200db17f4dc1d61567af1419bc389071 | [
"MIT"
] | 1 | 2021-06-09T20:07:30.000Z | 2021-06-09T20:07:30.000Z | test/augmenter/spectrogram/test_loudness_spec.py | lucidworks/nlpaug | 8e47fa39200db17f4dc1d61567af1419bc389071 | [
"MIT"
] | null | null | null | test/augmenter/spectrogram/test_loudness_spec.py | lucidworks/nlpaug | 8e47fa39200db17f4dc1d61567af1419bc389071 | [
"MIT"
] | null | null | null | import unittest
import os
import numpy as np
from dotenv import load_dotenv
from nlpaug.util import AudioLoader
import nlpaug.augmenter.spectrogram as nas
class TestLoudnessSpec(unittest.TestCase):
@classmethod
def setUpClass(cls):
env_config_path = os.path.abspath(
os.path.join(os.path.d... | 33.382979 | 81 | 0.6297 | import unittest
import os
import numpy as np
from dotenv import load_dotenv
from nlpaug.util import AudioLoader
import nlpaug.augmenter.spectrogram as nas
class TestLoudnessSpec(unittest.TestCase):
@classmethod
def setUpClass(cls):
env_config_path = os.path.abspath(
os.path.join(os.path.d... | true | true |
7900e48be6a61e1b7b02212b8a36802a97f40208 | 9,861 | py | Python | docs/conf.py | JerryKwan/proxy.py | 57aa628920a34a7c67925911c333c0b744ed0303 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | JerryKwan/proxy.py | 57aa628920a34a7c67925911c333c0b744ed0303 | [
"BSD-3-Clause"
] | 9 | 2021-12-10T01:22:33.000Z | 2022-03-31T18:21:07.000Z | docs/conf.py | JerryKwan/proxy.py | 57aa628920a34a7c67925911c333c0b744ed0303 | [
"BSD-3-Clause"
] | null | null | null | # pylint: disable=invalid-name
# Requires Python 3.6+
# Ref: https://www.sphinx-doc.org/en/master/usage/configuration.html
"""Configuration for the Sphinx documentation generator."""
import sys
from functools import partial
from pathlib import Path
from setuptools_scm import get_version
# -- Path setup ------------... | 33.427119 | 96 | 0.673461 |
import sys
from functools import partial
from pathlib import Path
from setuptools_scm import get_version
PROJECT_ROOT_DIR = Path(__file__).parents[1].resolve()
get_scm_version = partial(get_version, root=PROJECT_ROOT_DIR)
sys.path.insert(0, str(PROJECT_ROOT_DIR))
sys.path.insert(0, str((Path(__fil... | true | true |
7900e4fba482c2349f7afd1bedc8ed327d0b15f8 | 4,326 | py | Python | GP/data_transformation.py | VirgiAgl/V_savigp | 310f31f789db34737313bf057ff1474e314d68fd | [
"Apache-2.0"
] | 7 | 2016-04-25T15:02:34.000Z | 2020-03-30T15:10:03.000Z | GP/data_transformation.py | VirgiAgl/V_savigp | 310f31f789db34737313bf057ff1474e314d68fd | [
"Apache-2.0"
] | null | null | null | GP/data_transformation.py | VirgiAgl/V_savigp | 310f31f789db34737313bf057ff1474e314d68fd | [
"Apache-2.0"
] | 5 | 2015-12-09T22:57:58.000Z | 2020-10-07T11:01:34.000Z | import numpy as np
from sklearn import preprocessing
class DataTransformation:
"""
A generic class for the transformation of data
"""
def __init__(self):
pass
def transform_X(self, X):
"""
transforms X
:param
X: Input X
:return
transform... | 21.63 | 103 | 0.596163 | import numpy as np
from sklearn import preprocessing
class DataTransformation:
def __init__(self):
pass
def transform_X(self, X):
raise NotImplementedError()
def transform_Y(self, Y):
raise NotImplementedError()
def untransform_X(self, X):
raise NotImplementedError(... | true | true |
7900e540ea8e51a95ef1f2f7243500e88e57633b | 2,518 | py | Python | blend.py | jscarlson/stylegan2-pytorch | b460a7378ff3e80ff56190b3225c65e42e37ad6e | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | blend.py | jscarlson/stylegan2-pytorch | b460a7378ff3e80ff56190b3225c65e42e37ad6e | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | blend.py | jscarlson/stylegan2-pytorch | b460a7378ff3e80ff56190b3225c65e42e37ad6e | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | import os
import copy
import numpy as np
import click
from typing import List, Optional
import torch
import pickle
def extract_conv_names(model):
model_names = list(name for name in model.keys())
return model_names
def blend_models(low, high, model_res, level):
levels = [x for x in range(level)]
... | 32.701299 | 131 | 0.603654 | import os
import copy
import numpy as np
import click
from typing import List, Optional
import torch
import pickle
def extract_conv_names(model):
model_names = list(name for name in model.keys())
return model_names
def blend_models(low, high, model_res, level):
levels = [x for x in range(level)]
... | true | true |
7900e5869d879e772ede2db438ad55df82aa36fa | 17,454 | py | Python | wfi/cw/wfi-cw5.py | traffic-analysis/gandalf | 7015cdde2765fadd0cb653adea1e2b5dc2a6145e | [
"MIT"
] | 2 | 2021-09-29T05:06:46.000Z | 2021-12-12T19:48:18.000Z | wfi/cw/wfi-cw5.py | traffic-analysis/gandalf | 7015cdde2765fadd0cb653adea1e2b5dc2a6145e | [
"MIT"
] | null | null | null | wfi/cw/wfi-cw5.py | traffic-analysis/gandalf | 7015cdde2765fadd0cb653adea1e2b5dc2a6145e | [
"MIT"
] | null | null | null | import tensorflow as tf
import tensorflow.contrib.distributions as tfd
import numpy as np
import os.path as opth
import tqdm
import os
from sklearn.utils import shuffle
import argparse
HOME = os.path.expanduser('~')
os.environ["CUDA_VISIBLE_DEVICES"] = "2";
layers = tf.keras.layers
parser = argparse.ArgumentParser()
... | 44.868895 | 129 | 0.641744 | import tensorflow as tf
import tensorflow.contrib.distributions as tfd
import numpy as np
import os.path as opth
import tqdm
import os
from sklearn.utils import shuffle
import argparse
HOME = os.path.expanduser('~')
os.environ["CUDA_VISIBLE_DEVICES"] = "2";
layers = tf.keras.layers
parser = argparse.ArgumentParser()
... | true | true |
7900e6e2df9688e62efaff5a46a81c06f7b852d3 | 1,359 | py | Python | 02_category_code.py | darkbright/TourAPI | 788d2973a964db073889c2a2443d6beaa8e38c87 | [
"MIT"
] | null | null | null | 02_category_code.py | darkbright/TourAPI | 788d2973a964db073889c2a2443d6beaa8e38c87 | [
"MIT"
] | null | null | null | 02_category_code.py | darkbright/TourAPI | 788d2973a964db073889c2a2443d6beaa8e38c87 | [
"MIT"
] | null | null | null | from tourapi.list import TourAPI
from tourapi.config import ServiceKey, MobileOS, MobileApp, Languages
from mysql_config import MysqlHost, MysqlUser, MysqlPass, MysqlDB
import pymysql
import json
def upload_category_codes(codes, language="Kor", level=0, cat1="", cat2="", cat3=""):
global conn, curs
query = """
... | 30.2 | 101 | 0.693893 | from tourapi.list import TourAPI
from tourapi.config import ServiceKey, MobileOS, MobileApp, Languages
from mysql_config import MysqlHost, MysqlUser, MysqlPass, MysqlDB
import pymysql
import json
def upload_category_codes(codes, language="Kor", level=0, cat1="", cat2="", cat3=""):
global conn, curs
query = """
... | true | true |
7900e764e5405f4daa5115b4afcb175efd0c2b01 | 13,465 | py | Python | sdk/python/pulumi_azure_native/synapse/v20200401preview/sql_pools_v3.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/synapse/v20200401preview/sql_pools_v3.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/synapse/v20200401preview/sql_pools_v3.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 41.303681 | 789 | 0.637653 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._inputs import *
__all__ = ['SqlPoolsV3Args', 'SqlPoolsV3']
@pulumi.input_type
class SqlPoolsV3Args:
def __init__(__self__, *,
... | true | true |
7900e8133f18db39491de69fa88236e8659bfe45 | 3,358 | py | Python | UW_Madison/UW_Madison/spiders/uw_madison_courses3.py | Nouldine/MyCrawlerSystem | 7bba8ba3ec76e10f70a35700602812ee6f039b63 | [
"MIT"
] | null | null | null | UW_Madison/UW_Madison/spiders/uw_madison_courses3.py | Nouldine/MyCrawlerSystem | 7bba8ba3ec76e10f70a35700602812ee6f039b63 | [
"MIT"
] | null | null | null | UW_Madison/UW_Madison/spiders/uw_madison_courses3.py | Nouldine/MyCrawlerSystem | 7bba8ba3ec76e10f70a35700602812ee6f039b63 | [
"MIT"
] | null | null | null | from scrapy import Spider
from scrapy.spiders import CrawlSpider, Rule
from scrapy.selector import Selector
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.linkextractors import LinkExtractor
import scrapy
from scrapy.spidermiddlewares.ht... | 29.2 | 133 | 0.638177 | from scrapy import Spider
from scrapy.spiders import CrawlSpider, Rule
from scrapy.selector import Selector
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.linkextractors import LinkExtractor
import scrapy
from scrapy.spidermiddlewares.ht... | true | true |
7900e89dbe75340382e3e287beed972b744c3dca | 857 | py | Python | hw/ip/otbn/dv/otbnsim/test/testutil.py | draperlaboratory/opentitan | 5802fd8fddff95a905671054b1554f87c9ca6b96 | [
"Apache-2.0"
] | null | null | null | hw/ip/otbn/dv/otbnsim/test/testutil.py | draperlaboratory/opentitan | 5802fd8fddff95a905671054b1554f87c9ca6b96 | [
"Apache-2.0"
] | null | null | null | hw/ip/otbn/dv/otbnsim/test/testutil.py | draperlaboratory/opentitan | 5802fd8fddff95a905671054b1554f87c9ca6b96 | [
"Apache-2.0"
] | null | null | null | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import os
import subprocess
OTBN_DIR = os.path.join(os.path.dirname(__file__), '../../..')
UTIL_DIR = os.path.join(OTBN_DIR, 'util')
SIM_DIR = os.path.join(os.path.dirnam... | 30.607143 | 74 | 0.690782 |
import os
import subprocess
OTBN_DIR = os.path.join(os.path.dirname(__file__), '../../..')
UTIL_DIR = os.path.join(OTBN_DIR, 'util')
SIM_DIR = os.path.join(os.path.dirname(__file__), '..')
def asm_and_link_one_file(asm_path: str, work_dir: str) -> str:
otbn_as = os.path.join(UTIL_DIR, 'otbn-as')
otbn_ld... | true | true |
7900e8d40d67998b5d9cf4a9cb039c3f7628ea62 | 1,171 | py | Python | django_project/user_profile/migrations/0003_auto_20210526_1731.py | zhumakova/Django | f162b23d53883d3b0c654f8e7790f4bf93e20693 | [
"MIT"
] | 1 | 2021-06-12T19:08:57.000Z | 2021-06-12T19:08:57.000Z | django_project/user_profile/migrations/0003_auto_20210526_1731.py | zhumakova/Django | f162b23d53883d3b0c654f8e7790f4bf93e20693 | [
"MIT"
] | null | null | null | django_project/user_profile/migrations/0003_auto_20210526_1731.py | zhumakova/Django | f162b23d53883d3b0c654f8e7790f4bf93e20693 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.3 on 2021-05-26 11:31
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('spa', '0003_alter_servic... | 35.484848 | 130 | 0.624253 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('spa', '0003_alter_service_master'),
('user_profile', '0002_auto... | true | true |
7900e978294db63f482b38c5b128fdc347b80a61 | 8,371 | py | Python | neat_local/reproduction.py | Osrip/Novelty_criticality_PyTorch-NEAT | ff37eede4aea2cbb4075414a960477c215219f73 | [
"Apache-2.0"
] | null | null | null | neat_local/reproduction.py | Osrip/Novelty_criticality_PyTorch-NEAT | ff37eede4aea2cbb4075414a960477c215219f73 | [
"Apache-2.0"
] | null | null | null | neat_local/reproduction.py | Osrip/Novelty_criticality_PyTorch-NEAT | ff37eede4aea2cbb4075414a960477c215219f73 | [
"Apache-2.0"
] | null | null | null | """
Handles creation of genomes, either from scratch or by sexual or
asexual reproduction from parents.
"""
from __future__ import division
import math
import random
from itertools import count
from neat.config import ConfigParameter, DefaultClassConfig
from neat.math_util import mean
from neat.six_util import iterit... | 43.598958 | 115 | 0.632899 | from __future__ import division
import math
import random
from itertools import count
from neat.config import ConfigParameter, DefaultClassConfig
from neat.math_util import mean
from neat.six_util import iteritems, itervalues
class DefaultReproduction(DefaultClassConfig):
@classmethod
def parse_config(... | true | true |
7900ea3e9c2dea2b931ed456e64ca581ba00efea | 1,325 | py | Python | Word2Vec/NearestNeighbor.py | bi3mer/Word2Vec | 55297c4f10c5dbfdcaf93b01282808efdd275956 | [
"MIT"
] | null | null | null | Word2Vec/NearestNeighbor.py | bi3mer/Word2Vec | 55297c4f10c5dbfdcaf93b01282808efdd275956 | [
"MIT"
] | null | null | null | Word2Vec/NearestNeighbor.py | bi3mer/Word2Vec | 55297c4f10c5dbfdcaf93b01282808efdd275956 | [
"MIT"
] | null | null | null | from heapq import heappush, nsmallest
import numpy as np
class NearestNeighbor():
def __init__(self, embeddings, encodings, config):
self.embeddings = embeddings
self.encodings = encodings
self.config = config
def euclidian_distance(self, e1, e2):
'''
https://stackoverf... | 34.868421 | 107 | 0.644528 | from heapq import heappush, nsmallest
import numpy as np
class NearestNeighbor():
def __init__(self, embeddings, encodings, config):
self.embeddings = embeddings
self.encodings = encodings
self.config = config
def euclidian_distance(self, e1, e2):
return np.linalg.norm(e1 - e2)... | true | true |
7900eb0e380c4e74be31902804ff4f3e26c91d4d | 732 | py | Python | channel_attention.py | ailabnjtech/B-CNN | 40b78f0fe81120248832609f897be5d04e8d8431 | [
"MIT"
] | null | null | null | channel_attention.py | ailabnjtech/B-CNN | 40b78f0fe81120248832609f897be5d04e8d8431 | [
"MIT"
] | null | null | null | channel_attention.py | ailabnjtech/B-CNN | 40b78f0fe81120248832609f897be5d04e8d8431 | [
"MIT"
] | null | null | null | from keras.layers import Activation, Reshape, Lambda, dot, add
from keras.layers import Conv1D, Conv2D, Conv3D
from keras.layers import MaxPool1D,GlobalAveragePooling2D,Dense,multiply,Activation,concatenate
from keras import backend as K
def squeeze_excitation_layer(x, out_dim, ratio = 4, concate = True):
squeez... | 33.272727 | 95 | 0.73224 | from keras.layers import Activation, Reshape, Lambda, dot, add
from keras.layers import Conv1D, Conv2D, Conv3D
from keras.layers import MaxPool1D,GlobalAveragePooling2D,Dense,multiply,Activation,concatenate
from keras import backend as K
def squeeze_excitation_layer(x, out_dim, ratio = 4, concate = True):
squeez... | true | true |
7900ec820b3c3959c1571e60fa82f639ad549104 | 3,089 | py | Python | api_tests/reviews/mixins/comment_settings.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | null | null | null | api_tests/reviews/mixins/comment_settings.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | null | null | null | api_tests/reviews/mixins/comment_settings.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | null | null | null | import pytest
from api.providers.permissions import GroupHelper
from osf_tests.factories import (
ReviewActionFactory,
AuthUserFactory,
PreprintFactory,
PreprintProviderFactory,
)
from osf.utils import permissions as osf_permissions
@pytest.mark.django_db
class ReviewActionCommentSettingsMixin(object... | 32.861702 | 75 | 0.620913 | import pytest
from api.providers.permissions import GroupHelper
from osf_tests.factories import (
ReviewActionFactory,
AuthUserFactory,
PreprintFactory,
PreprintProviderFactory,
)
from osf.utils import permissions as osf_permissions
@pytest.mark.django_db
class ReviewActionCommentSettingsMixin(object... | true | true |
7900eeb2cc19614f887b36c04f3ef1edcb977717 | 2,189 | py | Python | figures/fig3_baf_time_series/baf_TS_plot_lyso_hist.py | jlazzaridean/mScarlet_lifetime_reports_pH | 13b022b1dc1fff8ebd0a881248011923e378889b | [
"CC-BY-4.0"
] | null | null | null | figures/fig3_baf_time_series/baf_TS_plot_lyso_hist.py | jlazzaridean/mScarlet_lifetime_reports_pH | 13b022b1dc1fff8ebd0a881248011923e378889b | [
"CC-BY-4.0"
] | null | null | null | figures/fig3_baf_time_series/baf_TS_plot_lyso_hist.py | jlazzaridean/mScarlet_lifetime_reports_pH | 13b022b1dc1fff8ebd0a881248011923e378889b | [
"CC-BY-4.0"
] | null | null | null | from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import Divider, Size
import pandas as pd
# This script plots histograms of pHlys by lysosome from two particular
# recordings (DMSO 10/29 01, pos 5; Baf 10/29 01 pos 9) for use in main
# text figure 3.
current_dir... | 37.741379 | 108 | 0.67428 | from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import Divider, Size
import pandas as pd
current_dir = Path.cwd()
man_dir = current_dir.parents[1]
data_path = man_dir / 'source_data' / 'bafilomycin_time_series' / 'baf_time_series_individ_lyso_results.csv'
re... | true | true |
7900f081a429cddbd00caa87f27fe51153cc6f27 | 6,431 | py | Python | Q/questionnaire/q_urls.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | null | null | null | Q/questionnaire/q_urls.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | 477 | 2015-01-07T18:22:27.000Z | 2017-07-17T15:05:48.000Z | Q/questionnaire/q_urls.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | null | null | null | ####################
# ES-DOC CIM Questionnaire
# Copyright (c) 2017 ES-DOC. All rights reserved.
#
# University of Colorado, Boulder
# http://cires.colorado.edu/
#
# This project is distributed according to the terms of the MIT license [http://www.opensource.org/licenses/MIT].
####################
from djan... | 46.941606 | 195 | 0.664438 | , q_publication
api_urls = patterns('',
url(r'^projects_test/(?P<pk>[0-9]+)/$', QProjectTestDetail.as_view(), name="project-test-detail"),
url(r'^customizations_lite/$', QCustomizationLiteList.as_view(), name="customization_lite-list"),
url(r'^realizations_lite/$', QRealizationLiteList.as_view(... | true | true |
7900f26237b09df2759789b602213197fc0dc727 | 2,228 | py | Python | hik-brute.py | haka110/Cam-Brute | a5e9114caab9e6a0a031e07d7b26604bebd86151 | [
"MIT"
] | 2 | 2022-02-11T08:41:38.000Z | 2022-03-12T14:39:59.000Z | hik-brute.py | haka110/Cam-Brute | a5e9114caab9e6a0a031e07d7b26604bebd86151 | [
"MIT"
] | 1 | 2021-11-17T13:44:22.000Z | 2021-11-17T13:44:22.000Z | hik-brute.py | haka110/Cam-Brute | a5e9114caab9e6a0a031e07d7b26604bebd86151 | [
"MIT"
] | 1 | 2022-03-12T18:18:38.000Z | 2022-03-12T18:18:38.000Z | import os
import time
import datetime
import socket
import platform
import sys
from multiprocessing.dummy import Pool as ThreadPool
from colorama import Fore, Back, Style
def rtspbrute(ip1):
log=open("logs",'r')
if ip1 not in log:
flag=0
ip1 = ip1[:-1]
os.system("mkdir -p Hikvision/%s 2> /dev/null"%(str(ip1).... | 38.413793 | 287 | 0.658887 | import os
import time
import datetime
import socket
import platform
import sys
from multiprocessing.dummy import Pool as ThreadPool
from colorama import Fore, Back, Style
def rtspbrute(ip1):
log=open("logs",'r')
if ip1 not in log:
flag=0
ip1 = ip1[:-1]
os.system("mkdir -p Hikvision/%s 2> /dev/null"%(str(ip1).... | false | true |
7900f28d74575776b4d682f465ff816cbf5b004b | 8,220 | py | Python | hddcoin/cmds/configure.py | grayfallstown/hddcoin-blockchain | 39164acef655b51b83f40ff808df72fbaab9c0df | [
"Apache-2.0"
] | null | null | null | hddcoin/cmds/configure.py | grayfallstown/hddcoin-blockchain | 39164acef655b51b83f40ff808df72fbaab9c0df | [
"Apache-2.0"
] | null | null | null | hddcoin/cmds/configure.py | grayfallstown/hddcoin-blockchain | 39164acef655b51b83f40ff808df72fbaab9c0df | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from typing import Dict
import click
from hddcoin.util.config import load_config, save_config, str2bool
from hddcoin.util.default_root import DEFAULT_ROOT_PATH
def configure(
root_path: Path,
set_farmer_peer: str,
set_node_introducer: str,
set_fullnode_port: str,
set_log... | 40.895522 | 100 | 0.60292 | from pathlib import Path
from typing import Dict
import click
from hddcoin.util.config import load_config, save_config, str2bool
from hddcoin.util.default_root import DEFAULT_ROOT_PATH
def configure(
root_path: Path,
set_farmer_peer: str,
set_node_introducer: str,
set_fullnode_port: str,
set_log... | true | true |
7900f2f79f90808944e1a49645ea3d9271b5adc9 | 4,055 | py | Python | hiren/settings.py | pyprism/Hiren-Git-Commit-Reminder | 253ba078f63cc9bf3f39a5b735a783c4846b5ba7 | [
"MIT"
] | null | null | null | hiren/settings.py | pyprism/Hiren-Git-Commit-Reminder | 253ba078f63cc9bf3f39a5b735a783c4846b5ba7 | [
"MIT"
] | null | null | null | hiren/settings.py | pyprism/Hiren-Git-Commit-Reminder | 253ba078f63cc9bf3f39a5b735a783c4846b5ba7 | [
"MIT"
] | null | null | null | """
Django settings for hiren project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths ... | 26.16129 | 80 | 0.663132 |
import os
import json
from celery.schedules import crontab
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
try:
with open('config.json') as f:
JSON_DATA = json.load(f)
except FileNotFoundError:
with open('config.sample.json') as f:
JSON_DATA = json.load(f)
SECRET... | true | true |
7900f558ba3cb2a22f1e91d6aea1398154ad6999 | 227 | py | Python | encapsulation_exercise/wild_cat_zoo/project/cheetah.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | encapsulation_exercise/wild_cat_zoo/project/cheetah.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | encapsulation_exercise/wild_cat_zoo/project/cheetah.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | from encapsulation_exercise.wild_cat_zoo.project.animal import Animal
class Cheetah(Animal):
MONEY_FOR_CARE = 60
def __init__(self, name, gender, age):
super().__init__(name, gender, age, self.MONEY_FOR_CARE) | 28.375 | 69 | 0.744493 | from encapsulation_exercise.wild_cat_zoo.project.animal import Animal
class Cheetah(Animal):
MONEY_FOR_CARE = 60
def __init__(self, name, gender, age):
super().__init__(name, gender, age, self.MONEY_FOR_CARE) | true | true |
7900f75862ab17d020e9f97590f0c8a2e4e2eda3 | 690 | py | Python | checkov/terraform/checks/resource/alicloud/PasswordPolicyLowercaseLetter.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | checkov/terraform/checks/resource/alicloud/PasswordPolicyLowercaseLetter.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | checkov/terraform/checks/resource/alicloud/PasswordPolicyLowercaseLetter.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | from checkov.common.models.enums import CheckCategories
from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
class PasswordPolicyLowercaseLetter(BaseResourceValueCheck):
def __init__(self):
name = "Ensure RAM password policy requires at least one lowercase letter"... | 38.333333 | 106 | 0.778261 | from checkov.common.models.enums import CheckCategories
from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
class PasswordPolicyLowercaseLetter(BaseResourceValueCheck):
def __init__(self):
name = "Ensure RAM password policy requires at least one lowercase letter"... | true | true |
7900f7c8aad75edcf055538b87ce505314e70cce | 952 | py | Python | tarakania_rpg/commands/rpg/inventory/inventory.py | tarakania/discord-bot | 801d7004589800c6013f32a3289f4b8277b289b2 | [
"MIT"
] | 1 | 2021-06-04T16:50:42.000Z | 2021-06-04T16:50:42.000Z | tarakania_rpg/commands/rpg/inventory/inventory.py | tarakania/discord-bot | 801d7004589800c6013f32a3289f4b8277b289b2 | [
"MIT"
] | 3 | 2021-06-02T00:22:51.000Z | 2021-06-03T15:20:25.000Z | tarakania_rpg/commands/rpg/inventory/inventory.py | tarakania/discord-bot | 801d7004589800c6013f32a3289f4b8277b289b2 | [
"MIT"
] | 2 | 2019-08-22T07:30:12.000Z | 2021-06-04T16:49:42.000Z | from typing import Dict
from handler import Context, Arguments, CommandResult
from rpg.items import Item
from utils.formatting import codeblock
from utils.command_helpers import get_author_player
async def run(ctx: Context, args: Arguments) -> CommandResult:
player = await get_author_player(ctx)
if player.i... | 30.709677 | 87 | 0.652311 | from typing import Dict
from handler import Context, Arguments, CommandResult
from rpg.items import Item
from utils.formatting import codeblock
from utils.command_helpers import get_author_player
async def run(ctx: Context, args: Arguments) -> CommandResult:
player = await get_author_player(ctx)
if player.i... | true | true |
7900f903e7fd2f5bc298d18b28fd602f309238e9 | 5,990 | py | Python | python/paddle/nn/functional/extension.py | wangna11BD/Paddle | bc379ca3d5895eadbc1748bc5b71606011563ee1 | [
"Apache-2.0"
] | 1 | 2021-04-28T13:47:27.000Z | 2021-04-28T13:47:27.000Z | python/paddle/nn/functional/extension.py | wangna11BD/Paddle | bc379ca3d5895eadbc1748bc5b71606011563ee1 | [
"Apache-2.0"
] | null | null | null | python/paddle/nn/functional/extension.py | wangna11BD/Paddle | bc379ca3d5895eadbc1748bc5b71606011563ee1 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 42.785714 | 148 | 0.497663 |
import numpy as np
from ...fluid.data_feeder import check_dtype
from ...fluid.layer_helper import LayerHelper
from ...fluid.framework import Variable, in_dygraph_mode
from ...fluid.layers.tensor import assign
from ...fluid import core, dygraph_utils
from ...fluid.layers.layer_function_generator import t... | true | true |
7900f9757b2ab84c948d51c8026907843dc354ac | 5,805 | py | Python | vendors/rez-2.23.1-py2.7/rez/tests/test_suites.py | ColinKennedy/tk-config-default2-respawn | 855fb8033daa549b92615792442f19a7f9c4f55c | [
"Linux-OpenIB"
] | 4 | 2019-01-11T03:41:28.000Z | 2019-09-12T06:57:17.000Z | vendors/rez-2.23.1-py2.7/rez/tests/test_suites.py | ColinKennedy/tk-config-default2-respawn | 855fb8033daa549b92615792442f19a7f9c4f55c | [
"Linux-OpenIB"
] | null | null | null | vendors/rez-2.23.1-py2.7/rez/tests/test_suites.py | ColinKennedy/tk-config-default2-respawn | 855fb8033daa549b92615792442f19a7f9c4f55c | [
"Linux-OpenIB"
] | 2 | 2019-01-10T05:00:18.000Z | 2020-02-15T16:32:56.000Z | """
test suites
"""
from rez.tests.util import TestBase, TempdirMixin
from rez.resolved_context import ResolvedContext
from rez.suite import Suite
import rez.vendor.unittest2 as unittest
import uuid
import os.path
class TestRezSuites(TestBase, TempdirMixin):
@classmethod
def setUpClass(cls):
TempdirMi... | 36.974522 | 80 | 0.641171 | from rez.tests.util import TestBase, TempdirMixin
from rez.resolved_context import ResolvedContext
from rez.suite import Suite
import rez.vendor.unittest2 as unittest
import uuid
import os.path
class TestRezSuites(TestBase, TempdirMixin):
@classmethod
def setUpClass(cls):
TempdirMixin.setUpClass()
... | true | true |
7900fa4748b918b5153b94375a25c9bc355d756a | 2,466 | py | Python | pythonProject/ind.py | surai5a/laba_2_6 | dab2f35f3dca88620c08c438b85cfd64f9b2172b | [
"MIT"
] | null | null | null | pythonProject/ind.py | surai5a/laba_2_6 | dab2f35f3dca88620c08c438b85cfd64f9b2172b | [
"MIT"
] | null | null | null | pythonProject/ind.py | surai5a/laba_2_6 | dab2f35f3dca88620c08c438b85cfd64f9b2172b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
if __name__ == '__main__':
goods = []
while True:
command = input(">>> ").lower()
if command == 'exit':
break
elif command == 'add':
name = input("Название товара: ")
shop = input("Названи... | 29.011765 | 72 | 0.37794 |
import sys
if __name__ == '__main__':
goods = []
while True:
command = input(">>> ").lower()
if command == 'exit':
break
elif command == 'add':
name = input("Название товара: ")
shop = input("Название магазина: ")
price = float(inpu... | true | true |
7900fc68e356ecdd74f17c5a5d271da9a0f3d240 | 8,015 | py | Python | tensorflow_datasets/object_detection/open_images_challenge2019.py | shashwat9kumar/datasets | 99b055408025f8e934fcbb0fc054488aa087ebfb | [
"Apache-2.0"
] | 1 | 2019-07-19T15:01:45.000Z | 2019-07-19T15:01:45.000Z | tensorflow_datasets/object_detection/open_images_challenge2019.py | shashwat9kumar/datasets | 99b055408025f8e934fcbb0fc054488aa087ebfb | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/object_detection/open_images_challenge2019.py | shashwat9kumar/datasets | 99b055408025f8e934fcbb0fc054488aa087ebfb | [
"Apache-2.0"
] | 1 | 2021-08-02T22:12:40.000Z | 2021-08-02T22:12:40.000Z | # coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 38.533654 | 152 | 0.675234 |
import abc
import tensorflow.compat.v2 as tf
import tensorflow_datasets.public_api as tfds
_DESCRIPTION = """\
Open Images is a collaborative release of ~9 million images annotated with
image-level labels, object bounding boxes, object segmentation masks, and
visual relationships. This uniquely large ... | true | true |
7900fd070912f7dd0c815ddd24ef926641ec5983 | 31,863 | py | Python | astropy/coordinates/spectral_coordinate.py | ysBach/astropy | 10d27d8292bafb3ab502f4147dd707473e69af71 | [
"BSD-3-Clause"
] | 4 | 2021-03-25T15:49:56.000Z | 2021-12-15T09:10:04.000Z | astropy/coordinates/spectral_coordinate.py | ysBach/astropy | 10d27d8292bafb3ab502f4147dd707473e69af71 | [
"BSD-3-Clause"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/astropy/coordinates/spectral_coordinate.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 3 | 2021-03-28T16:13:00.000Z | 2021-07-16T10:27:25.000Z | import warnings
from textwrap import indent
import astropy.units as u
import numpy as np
from astropy.constants import c
from astropy.coordinates import (ICRS,
CartesianDifferential,
CartesianRepresentation, SkyCoord)
from astropy.coordinates.spectral_q... | 41.219922 | 111 | 0.638107 | import warnings
from textwrap import indent
import astropy.units as u
import numpy as np
from astropy.constants import c
from astropy.coordinates import (ICRS,
CartesianDifferential,
CartesianRepresentation, SkyCoord)
from astropy.coordinates.spectral_q... | true | true |
7900fd9108cca2e41cb7dd605cf195436c3aef24 | 10,134 | py | Python | froide/foirequest/tasks.py | MrKrisKrisu/froide | d4ae1daeab617bcb1b60630c437f6d5c2bfe3a70 | [
"MIT"
] | null | null | null | froide/foirequest/tasks.py | MrKrisKrisu/froide | d4ae1daeab617bcb1b60630c437f6d5c2bfe3a70 | [
"MIT"
] | null | null | null | froide/foirequest/tasks.py | MrKrisKrisu/froide | d4ae1daeab617bcb1b60630c437f6d5c2bfe3a70 | [
"MIT"
] | null | null | null | import os
import logging
from django.conf import settings
from django.utils import translation
from django.utils.translation import gettext_lazy as _
from django.db import transaction
from django.core.files.base import ContentFile
from celery.exceptions import SoftTimeLimitExceeded
from froide.celery import app as c... | 28.307263 | 87 | 0.677719 | import os
import logging
from django.conf import settings
from django.utils import translation
from django.utils.translation import gettext_lazy as _
from django.db import transaction
from django.core.files.base import ContentFile
from celery.exceptions import SoftTimeLimitExceeded
from froide.celery import app as c... | true | true |
7900fda1d54a3129f2b7595b084a6fd4e7ad0f06 | 1,092 | py | Python | LeetCode/318 Maximum Product of Word Lengths.py | gesuwen/Algorithms | 0c9cf4412d76f8b69ef68cc80636323f5a0e5786 | [
"MIT"
] | null | null | null | LeetCode/318 Maximum Product of Word Lengths.py | gesuwen/Algorithms | 0c9cf4412d76f8b69ef68cc80636323f5a0e5786 | [
"MIT"
] | null | null | null | LeetCode/318 Maximum Product of Word Lengths.py | gesuwen/Algorithms | 0c9cf4412d76f8b69ef68cc80636323f5a0e5786 | [
"MIT"
] | null | null | null | # Bit Manipulation
# Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case letters. If no such two words exist, return 0.
#
# Example 1:
#
# Input: ["abcw","baz","foo","bar","x... | 29.513514 | 244 | 0.581502 |
class Solution:
def maxProduct(self, words):
wordsDict = {}
for word in words:
wordsDict[word] = set(word)
output = 0
for i in range(len(words)):
for j in range(i+1, len(words)):
if not wordsDict[words[i]]&wordsDict[words[j... | true | true |
7900fde3b236c293a428fb7d8f1bd6f8f0e0fcee | 2,945 | py | Python | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_configuration.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_configuration.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 2 | 2020-03-03T23:11:13.000Z | 2020-03-30T18:50:55.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_configuration.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 45.307692 | 129 | 0.681834 |
from typing import TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
if TYPE_CHECKING:
from typing import Any
from azure.core.credentials import TokenCredential
VERSION = "unknown"
... | true | true |
7900fe6b4324af019ea50bf8ebbfcd7c728fc238 | 3,829 | py | Python | stock_trading_backend/agent/neural_network_model.py | iryzhkov/stock-trading-backend | 7161026b7b4deb78a934b66550c85a27c6b32933 | [
"MIT"
] | 1 | 2021-01-27T18:24:02.000Z | 2021-01-27T18:24:02.000Z | stock_trading_backend/agent/neural_network_model.py | iryzhkov/stock-trading-backend | 7161026b7b4deb78a934b66550c85a27c6b32933 | [
"MIT"
] | null | null | null | stock_trading_backend/agent/neural_network_model.py | iryzhkov/stock-trading-backend | 7161026b7b4deb78a934b66550c85a27c6b32933 | [
"MIT"
] | null | null | null | """Polynomial model class used by agents for building stuff.
"""
from torch import nn, optim
import torch
import torch.nn.functional as F
from stock_trading_backend.agent.model import Model
class NNModel(nn.Module):
"""Torch neural network model.
"""
def __init__(self, num_inputs, num_hidden_layers, num... | 34.495495 | 89 | 0.648211 | from torch import nn, optim
import torch
import torch.nn.functional as F
from stock_trading_backend.agent.model import Model
class NNModel(nn.Module):
def __init__(self, num_inputs, num_hidden_layers, num_inner_features):
super(NNModel, self).__init__()
self.input_layer = nn.Linear(num_inputs, n... | true | true |
7900fe9b95d5836ad1aeeb57c569a0de0caf1afb | 135 | py | Python | blog/admin.py | functioncall/rescue-habit | 98c9d3f2feff0ed100523f9822865a139f6f7648 | [
"MIT"
] | null | null | null | blog/admin.py | functioncall/rescue-habit | 98c9d3f2feff0ed100523f9822865a139f6f7648 | [
"MIT"
] | null | null | null | blog/admin.py | functioncall/rescue-habit | 98c9d3f2feff0ed100523f9822865a139f6f7648 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Post, SurveyHistory
admin.site.register(Post)
admin.site.register(SurveyHistory)
| 22.5 | 39 | 0.82963 | from django.contrib import admin
from .models import Post, SurveyHistory
admin.site.register(Post)
admin.site.register(SurveyHistory)
| true | true |
7900fe9f1d10228fcdf29352cc73507faa9c2888 | 7,244 | py | Python | PointCloudClass/renderer.py | 565353780/pointcloud-manage | 77f16671ec0b88f53cd9fde2538143721f9d3ab6 | [
"MIT"
] | 3 | 2022-01-16T12:43:29.000Z | 2022-01-22T05:21:40.000Z | PointCloudClass/renderer.py | 565353780/pointcloud-manage | 77f16671ec0b88f53cd9fde2538143721f9d3ab6 | [
"MIT"
] | null | null | null | PointCloudClass/renderer.py | 565353780/pointcloud-manage | 77f16671ec0b88f53cd9fde2538143721f9d3ab6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cv2
import numpy as np
from math import cos, sin, pi
from tqdm import tqdm
import open3d as o3d
def render(pointcloud_file_path, estimate_normals_radius, estimate_normals_max_nn):
pointcloud = o3d.io.read_point_cloud(pointcloud_file_path, print_progress=True)
... | 37.148718 | 99 | 0.633214 |
import cv2
import numpy as np
from math import cos, sin, pi
from tqdm import tqdm
import open3d as o3d
def render(pointcloud_file_path, estimate_normals_radius, estimate_normals_max_nn):
pointcloud = o3d.io.read_point_cloud(pointcloud_file_path, print_progress=True)
pointcloud.estimate_normals(
sear... | true | true |
7900febf603696941fe6da7ea7814f90b83bef77 | 2,585 | py | Python | setup.py | zurk/ml-core | 4a85c7cc773657bb6dacf47dd8852197f9bb93c1 | [
"Apache-2.0"
] | null | null | null | setup.py | zurk/ml-core | 4a85c7cc773657bb6dacf47dd8852197f9bb93c1 | [
"Apache-2.0"
] | null | null | null | setup.py | zurk/ml-core | 4a85c7cc773657bb6dacf47dd8852197f9bb93c1 | [
"Apache-2.0"
] | null | null | null | from importlib.machinery import SourceFileLoader
import io
import os.path
from setuptools import find_packages, setup
sourcedml = SourceFileLoader("sourced-ml-core", "./sourced/ml/core/__init__.py").load_module()
with io.open(os.path.join(os.path.dirname(__file__), "README.md"), encoding="utf-8") as f:
long_desc... | 35.410959 | 94 | 0.629014 | from importlib.machinery import SourceFileLoader
import io
import os.path
from setuptools import find_packages, setup
sourcedml = SourceFileLoader("sourced-ml-core", "./sourced/ml/core/__init__.py").load_module()
with io.open(os.path.join(os.path.dirname(__file__), "README.md"), encoding="utf-8") as f:
long_desc... | true | true |
790100c41c4e8118a8fa42a53463e0bcfccb4adf | 4,854 | py | Python | baseline/filter_hunalign_bitext.py | christianbuck/CorpusMining | f9248c3528a415a1e5af2c5a54a60c16cd79ff1d | [
"Apache-2.0"
] | 2 | 2017-02-08T14:37:01.000Z | 2017-02-08T17:25:39.000Z | baseline/filter_hunalign_bitext.py | christianbuck/CorpusMining | f9248c3528a415a1e5af2c5a54a60c16cd79ff1d | [
"Apache-2.0"
] | null | null | null | baseline/filter_hunalign_bitext.py | christianbuck/CorpusMining | f9248c3528a415a1e5af2c5a54a60c16cd79ff1d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import defaultdict
import argparse
import cld2
import langid
import sys
""" Removes some wrongly aligned pairs from hunalign output """
class LanguageIdentifier(object):
def __init__(self, use_cld2, valid_languages=None):
self.use_cld2 = u... | 37.921875 | 78 | 0.563865 |
from collections import defaultdict
import argparse
import cld2
import langid
import sys
class LanguageIdentifier(object):
def __init__(self, use_cld2, valid_languages=None):
self.use_cld2 = use_cld2
self.valid_languages = [l.lower() for l in valid_languages]
if not use_cld2 and vali... | true | true |
7901014cc741921cf33d5138f384c30d7875b39d | 5,686 | py | Python | stages/utils/utils.py | lif22/tmpm_pipeline | e255616e5f480f02bd0726798f2507316133ede0 | [
"Apache-2.0"
] | null | null | null | stages/utils/utils.py | lif22/tmpm_pipeline | e255616e5f480f02bd0726798f2507316133ede0 | [
"Apache-2.0"
] | null | null | null | stages/utils/utils.py | lif22/tmpm_pipeline | e255616e5f480f02bd0726798f2507316133ede0 | [
"Apache-2.0"
] | null | null | null | from argparse import ArgumentParser
import datetime
import dateutil
import sys, re
from os import path
def parseArgs():
parser = ArgumentParser(add_help=False)
parser.add_argument("-a", "--action", help="Please select an option out of <discover, manage, settings>", type=str, required=True)
parser.add_argum... | 49.877193 | 145 | 0.616426 | from argparse import ArgumentParser
import datetime
import dateutil
import sys, re
from os import path
def parseArgs():
parser = ArgumentParser(add_help=False)
parser.add_argument("-a", "--action", help="Please select an option out of <discover, manage, settings>", type=str, required=True)
parser.add_argum... | true | true |
7901016f4be671cdbe0ec7f89bdd3cd39d3243af | 12,384 | py | Python | python-scripts/convertMP4toJPG.py | gurkirt/actNet-inAct | 1930bcb41553e50ddd83985a497a9d5ce4f1fcf2 | [
"MIT"
] | 27 | 2016-05-04T07:13:05.000Z | 2021-12-05T04:45:45.000Z | python-scripts/convertMP4toJPG.py | gurkirt/actNet-inAct | 1930bcb41553e50ddd83985a497a9d5ce4f1fcf2 | [
"MIT"
] | 1 | 2017-12-28T08:29:00.000Z | 2017-12-28T08:29:00.000Z | python-scripts/convertMP4toJPG.py | gurkirt/actNet-inAct | 1930bcb41553e50ddd83985a497a9d5ce4f1fcf2 | [
"MIT"
] | 12 | 2016-05-15T21:40:06.000Z | 2019-11-27T09:43:55.000Z | '''
Autor: Gurkirt Singh
Start data: 2nd May 2016
purpose: of this file is to take all .mp4 videos and convert them to jpg images
'''
import numpy as np
import cv2 as cv2
import math,pickle,shutil,os
baseDir = "/mnt/sun-alpha/actnet/";
vidDir = "/mnt/earth-beta/actnet/videos/";
imgDir = "/mnt/sun-alpha/actnet/rgb-i... | 42.851211 | 120 | 0.505087 | '''
Autor: Gurkirt Singh
Start data: 2nd May 2016
purpose: of this file is to take all .mp4 videos and convert them to jpg images
'''
import numpy as np
import cv2 as cv2
import math,pickle,shutil,os
baseDir = "/mnt/sun-alpha/actnet/";
vidDir = "/mnt/earth-beta/actnet/videos/";
imgDir = "/mnt/sun-alpha/actnet/rgb-i... | false | true |
790102022efed7168bc92fc88fb475e451756dca | 896 | py | Python | packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/index.py | RichiCoder1/aws-cdk | 626e6aa1a27feffe7ce60a46a6fdcf26f317eaef | [
"Apache-2.0"
] | 6,159 | 2019-07-11T16:53:02.000Z | 2022-03-31T20:52:53.000Z | packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/index.py | RichiCoder1/aws-cdk | 626e6aa1a27feffe7ce60a46a6fdcf26f317eaef | [
"Apache-2.0"
] | 16,881 | 2019-07-11T18:58:07.000Z | 2022-03-31T23:59:47.000Z | packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/lambda/index.py | RichiCoder1/aws-cdk | 626e6aa1a27feffe7ce60a46a6fdcf26f317eaef | [
"Apache-2.0"
] | 2,504 | 2019-07-11T17:52:52.000Z | 2022-03-31T21:19:53.000Z | import logging
import os
import boto3
from lib.cleanup_resource_handler import CleanupResourceHandler
from lib.queue_handler import QueueHandler
logging.getLogger().setLevel(logging.INFO)
def queue_handler(event, context):
"""
Handler for the event queue lambda trigger
"""
ec2_client = boto3.clien... | 25.6 | 117 | 0.737723 | import logging
import os
import boto3
from lib.cleanup_resource_handler import CleanupResourceHandler
from lib.queue_handler import QueueHandler
logging.getLogger().setLevel(logging.INFO)
def queue_handler(event, context):
ec2_client = boto3.client('ec2')
dynamodb_resource = boto3.resource('dynamodb')
... | true | true |
79010271145bee87268177e76443c8d48acc66a9 | 2,781 | py | Python | src/Player.py | ForgedSnow/Frontiersman | c564238b120bd9a526a2ebd6b79ed5b021be2a6e | [
"MIT"
] | null | null | null | src/Player.py | ForgedSnow/Frontiersman | c564238b120bd9a526a2ebd6b79ed5b021be2a6e | [
"MIT"
] | null | null | null | src/Player.py | ForgedSnow/Frontiersman | c564238b120bd9a526a2ebd6b79ed5b021be2a6e | [
"MIT"
] | null | null | null | class PlayerResourceHand:
def __init__(self):
self.brick = 0
self.grain = 0
self.lumber = 0
self.ore = 0
self.wool = 0
self.totalResources = 0
def update(self):
self.totalResources = self.brick + self.grain + self.lumber + self.ore + self.wool
class Pla... | 32.337209 | 117 | 0.607695 | class PlayerResourceHand:
def __init__(self):
self.brick = 0
self.grain = 0
self.lumber = 0
self.ore = 0
self.wool = 0
self.totalResources = 0
def update(self):
self.totalResources = self.brick + self.grain + self.lumber + self.ore + self.wool
class Pla... | true | true |
790105945b5bef769bbf33300bcce00966e4713d | 711 | py | Python | example.py | ildoonet/remote-dataloader | 2d51ed883f57632fef08f1475221641f48a0adea | [
"MIT"
] | 64 | 2019-10-09T02:35:48.000Z | 2021-09-22T11:54:03.000Z | example.py | ildoonet/remote-dataloader | 2d51ed883f57632fef08f1475221641f48a0adea | [
"MIT"
] | null | null | null | example.py | ildoonet/remote-dataloader | 2d51ed883f57632fef08f1475221641f48a0adea | [
"MIT"
] | 2 | 2021-05-01T13:13:31.000Z | 2021-07-26T04:54:16.000Z | import torchvision as torchvision
from torchvision.transforms import transforms
from tqdm import tqdm
from remote_dataloader.loader import RemoteDataLoader
if __name__ == '__main__':
transform_train = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
... | 33.857143 | 118 | 0.708861 | import torchvision as torchvision
from torchvision.transforms import transforms
from tqdm import tqdm
from remote_dataloader.loader import RemoteDataLoader
if __name__ == '__main__':
transform_train = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
... | true | true |
790105aadf839cb9fdee284f67b7515e1f3e0deb | 1,191 | py | Python | google/ads/google_ads/v1/services/customer_feed_service_client_config.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | 1 | 2019-11-30T23:42:39.000Z | 2019-11-30T23:42:39.000Z | google/ads/google_ads/v1/services/customer_feed_service_client_config.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v1/services/customer_feed_service_client_config.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | 1 | 2020-03-13T00:14:31.000Z | 2020-03-13T00:14:31.000Z | config = {
"interfaces": {
"google.ads.googleads.v1.services.CustomerFeedService": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": []
},
"retry_params": {
"default": {
... | 35.029412 | 67 | 0.438287 | config = {
"interfaces": {
"google.ads.googleads.v1.services.CustomerFeedService": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": []
},
"retry_params": {
"default": {
... | true | true |
790106627f39c9d181898047c1ca44efdac4def0 | 3,906 | py | Python | tools/ttsdk_downloader.py | ahmetecevitli/TTMediaBot | 94297955156dedbba8ce385efcdd1d4c0a921ac4 | [
"MIT"
] | 30 | 2021-05-12T10:23:41.000Z | 2022-03-31T10:13:42.000Z | tools/ttsdk_downloader.py | ahmetecevitli/TTMediaBot | 94297955156dedbba8ce385efcdd1d4c0a921ac4 | [
"MIT"
] | 29 | 2021-05-12T17:47:09.000Z | 2022-02-19T11:45:23.000Z | tools/ttsdk_downloader.py | ahmetecevitli/TTMediaBot | 94297955156dedbba8ce385efcdd1d4c0a921ac4 | [
"MIT"
] | 36 | 2021-05-12T14:58:15.000Z | 2022-03-31T10:06:52.000Z | #!/usr/bin/env python3
import os
import platform
import shutil
import sys
from urllib import request
import bs4
import patoolib
url = "http://bearware.dk/teamtalksdk"
cd = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def get_url_suffix_from_platform() -> str:
machine = platform.machine()
i... | 28.933333 | 86 | 0.569636 |
import os
import platform
import shutil
import sys
from urllib import request
import bs4
import patoolib
url = "http://bearware.dk/teamtalksdk"
cd = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def get_url_suffix_from_platform() -> str:
machine = platform.machine()
if sys.platform == "win... | true | true |
79010884e27cc910e075ae5bea295557189b9232 | 73,566 | py | Python | src/sage/databases/oeis.py | tashakim/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | 4 | 2020-07-17T04:49:44.000Z | 2020-07-29T06:33:51.000Z | src/sage/databases/oeis.py | Ivo-Maffei/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | null | null | null | src/sage/databases/oeis.py | Ivo-Maffei/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
r"""
The On-Line Encyclopedia of Integer Sequences (OEIS)
You can query the OEIS (Online Database of Integer Sequences) through Sage in
order to:
- identify a sequence from its first terms.
- obtain more terms, formulae, references, etc. for a given sequence.
AUTHORS:
- Thierry Mont... | 34.898482 | 189 | 0.516652 |
from __future__ import print_function
from urllib.request import urlopen
from urllib.parse import urlencode
from sage.structure.sage_object import SageObject
from sage.structure.unique_representation import UniqueRepresentation
from sage.cpython.string import bytes_to_str
from sage.rings.integer import Integ... | true | true |
79010a6a64fb65b3c1d80fce8bbd1a73e90b8689 | 2,413 | py | Python | koans/koans/about_tuples.py | rhgraysonii/python_koan_solutions | 42ef060cfb7ab47cf539b4a4ea8f4b55063b9912 | [
"MIT"
] | null | null | null | koans/koans/about_tuples.py | rhgraysonii/python_koan_solutions | 42ef060cfb7ab47cf539b4a4ea8f4b55063b9912 | [
"MIT"
] | null | null | null | koans/koans/about_tuples.py | rhgraysonii/python_koan_solutions | 42ef060cfb7ab47cf539b4a4ea8f4b55063b9912 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutTuples(Koan):
def test_creating_a_tuple(self):
count_of_three = (1, 2, 5)
self.assertEqual(5, count_of_three[2])
def test_tuples_are_immutable_so_item_assignment_is_not_possible(self):
count_of_three =... | 33.985915 | 91 | 0.590137 |
from runner.koan import *
class AboutTuples(Koan):
def test_creating_a_tuple(self):
count_of_three = (1, 2, 5)
self.assertEqual(5, count_of_three[2])
def test_tuples_are_immutable_so_item_assignment_is_not_possible(self):
count_of_three = (1, 2, 5)
try:
count_of... | true | true |
79010bfa5dcddc4ff2329950b737d68fa1c649bb | 5,303 | py | Python | sa/profiles/Zyxel/ZyNOS/get_inventory.py | xUndero/noc | 9fb34627721149fcf7064860bd63887e38849131 | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | sa/profiles/Zyxel/ZyNOS/get_inventory.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | sa/profiles/Zyxel/ZyNOS/get_inventory.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Zyxel.ZyNOS.get_inventory
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ------------------------------------------------------... | 39.87218 | 100 | 0.456723 |
import re
from noc.core.script.base import BaseScript
from noc.sa.interfaces.igetinventory import IGetInventory
class Script(BaseScript):
name = "Zyxel.ZyNOS.get_inventory"
interface = IGetInventory
def remove_non_ascii(self, s, sub="?"):
return "".join([i if ord(i) < 128 else sub for ... | true | true |
79010c011c77fd4468e9ee2a11273d6bd3845d48 | 27,174 | py | Python | farc/__init__.py | SzeMengTan/farc | 26dfd85d6c888914c316c603f1ae3140d696ec84 | [
"MIT"
] | null | null | null | farc/__init__.py | SzeMengTan/farc | 26dfd85d6c888914c316c603f1ae3140d696ec84 | [
"MIT"
] | null | null | null | farc/__init__.py | SzeMengTan/farc | 26dfd85d6c888914c316c603f1ae3140d696ec84 | [
"MIT"
] | null | null | null | import asyncio
import collections
import math
import signal
import sys
from functools import wraps
class Spy(object):
"""Spy is the debugging system for farc.
farc contains a handful of Spy.on_*() methods
placed at useful locations in the framework.
It is up to a Spy driver (such as the included VcdSp... | 37.072306 | 101 | 0.614668 | import asyncio
import collections
import math
import signal
import sys
from functools import wraps
class Spy(object):
_actv_cls = None
@staticmethod
def enable_spy(spy_cls):
Spy._actv_cls = spy_cls
spy_cls.init()
def __getattr__(*args):
if args[1] == "enable_spy":
... | true | true |
79010c0207408da28515534c467c346ef64752c3 | 1,836 | py | Python | examples/bayesian.inference/reference/run-nested.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 43 | 2018-07-26T07:20:42.000Z | 2022-03-02T10:23:12.000Z | examples/bayesian.inference/reference/run-nested.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 212 | 2018-09-21T10:44:07.000Z | 2022-03-22T14:33:05.000Z | examples/bayesian.inference/reference/run-nested.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 16 | 2018-07-25T15:00:36.000Z | 2022-03-22T14:19:46.000Z | #!/usr/bin/env python3
# In this example, we demonstrate how Korali samples the posterior distribution
# in a bayesian problem where the likelihood is calculated by providing
# reference data points and their objective values.
# Importing the computational model
import sys
sys.path.append('./_model')
from model impor... | 33.381818 | 96 | 0.712418 |
import sys
sys.path.append('./_model')
from model import *
import korali
e = korali.Experiment()
e["Problem"]["Type"] = "Bayesian/Reference"
e["Problem"]["Likelihood Model"] = "Normal"
e["Problem"]["Reference Data"] = getReferenceData()
e["Problem"]["Computational Model"] = lambda sampleData: model(sampleDat... | true | true |
79010c959b42f908fa66615dfe288111925993ee | 402 | py | Python | bruges/util/__init__.py | EvanBianco/bruges | 344238775961369740d36ee9aea368be006ba7fe | [
"Apache-2.0"
] | 209 | 2015-07-16T18:23:42.000Z | 2022-02-27T02:59:46.000Z | bruges/util/__init__.py | EvanBianco/bruges | 344238775961369740d36ee9aea368be006ba7fe | [
"Apache-2.0"
] | 74 | 2015-07-12T16:12:01.000Z | 2022-02-22T14:27:26.000Z | bruges/util/__init__.py | agilescientific/bruges | a94ec307bac5e343680c63b315d43ef8b05ee4a1 | [
"Apache-2.0"
] | 112 | 2015-08-07T14:12:11.000Z | 2022-02-10T14:12:50.000Z | from .util import rms
from .util import moving_average
from .util import moving_avg_conv
from .util import moving_avg_fft
from .util import normalize
from .util import next_pow2
from .util import top_and_tail
from .util import extrapolate
from .util import nearest
from .util import deprecated
from .util import apply_al... | 26.8 | 34 | 0.825871 | from .util import rms
from .util import moving_average
from .util import moving_avg_conv
from .util import moving_avg_fft
from .util import normalize
from .util import next_pow2
from .util import top_and_tail
from .util import extrapolate
from .util import nearest
from .util import deprecated
from .util import apply_al... | true | true |
79010caebcd9e060069a269d44301af6d68bad2d | 911 | py | Python | xlsxwriter/test/comparison/test_default_row03.py | timgates42/XlsxWriter | 129044ed821de67895b4562c6b71f90eba5be6b4 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_default_row03.py | timgates42/XlsxWriter | 129044ed821de67895b4562c6b71f90eba5be6b4 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_default_row03.py | timgates42/XlsxWriter | 129044ed821de67895b4562c6b71f90eba5be6b4 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2020, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 22.775 | 79 | 0.593853 | true | true | |
79010cb1b045ae5add7ef48709cc5cd240c0a5a5 | 3,898 | py | Python | web/app.py | ikreymer/archivethiswebsite | 0c6a3da6d822ffbd979769c78c9bc7254510697d | [
"MIT"
] | 4 | 2015-06-03T20:18:39.000Z | 2015-06-12T16:12:12.000Z | web/app.py | n0ncetonic/browsertrix | a822cfe2be38ebd6a7e4b61904473600d21950bf | [
"MIT"
] | null | null | null | web/app.py | n0ncetonic/browsertrix | a822cfe2be38ebd6a7e4b61904473600d21950bf | [
"MIT"
] | null | null | null | from bottle import route, Route, request, default_app, view, HTTPError, response
from redis import StrictRedis
from redis.utils import pipeline
import json
import uwsgi
import os
import logging
import requests
from config import get_config
from worker import get_cache_key, get_wait_key, get_queue_key
from worker im... | 24.670886 | 108 | 0.611339 | from bottle import route, Route, request, default_app, view, HTTPError, response
from redis import StrictRedis
from redis.utils import pipeline
import json
import uwsgi
import os
import logging
import requests
from config import get_config
from worker import get_cache_key, get_wait_key, get_queue_key
from worker im... | true | true |
79010d0d278cd90214a5a220bbd49e8f62be8006 | 2,014 | py | Python | python/kata04/test_temp.py | notapresent/codekata | b5cd1ec1b858e4dfbf078df8a99c3209cb8313f3 | [
"MIT"
] | null | null | null | python/kata04/test_temp.py | notapresent/codekata | b5cd1ec1b858e4dfbf078df8a99c3209cb8313f3 | [
"MIT"
] | null | null | null | python/kata04/test_temp.py | notapresent/codekata | b5cd1ec1b858e4dfbf078df8a99c3209cb8313f3 | [
"MIT"
] | null | null | null | import pytest
from temp import (download_to_file, ensure_datafile, records_from_lines, make_record, make_value, min_spread_record,
min_spread_day_num, parse_header)
def test_download_to_file(tmpdir):
file = tmpdir.join('test.txt')
download_to_file(file.strpath, 'https://httpbin.org/get?testP... | 28.366197 | 116 | 0.619662 | import pytest
from temp import (download_to_file, ensure_datafile, records_from_lines, make_record, make_value, min_spread_record,
min_spread_day_num, parse_header)
def test_download_to_file(tmpdir):
file = tmpdir.join('test.txt')
download_to_file(file.strpath, 'https://httpbin.org/get?testP... | true | true |
79010d69056dd11c86b0becb5e9e2295e0808861 | 2,355 | py | Python | rl/env/multiagent_particle_envs/multiagent/multi_discrete.py | unkper/PedestrainSimulationModule | 039ed0903a0861130566d8d1d862594064b8e0db | [
"MIT"
] | null | null | null | rl/env/multiagent_particle_envs/multiagent/multi_discrete.py | unkper/PedestrainSimulationModule | 039ed0903a0861130566d8d1d862594064b8e0db | [
"MIT"
] | null | null | null | rl/env/multiagent_particle_envs/multiagent/multi_discrete.py | unkper/PedestrainSimulationModule | 039ed0903a0861130566d8d1d862594064b8e0db | [
"MIT"
] | null | null | null | # An old version of OpenAI Gym's multi_discrete.py. (Was getting affected by Gym updates)
# (https://github.com/openai/gym/blob/1fb81d4e3fb780ccf77fec731287ba07da35eb84/gym/spaces/multi_discrete.py)
import numpy as np
import gym
class MultiDiscrete(gym.Space):
"""
- The multi-discrete action space consists o... | 53.522727 | 122 | 0.675159 |
# (https://github.com/openai/gym/blob/1fb81d4e3fb780ccf77fec731287ba07da35eb84/gym/spaces/multi_discrete.py)
import numpy as np
import gym
class MultiDiscrete(gym.Space):
def __init__(self, array_of_param_array):
self.low = np.array([x[0] for x in array_of_param_array])
self.high = np.array([x[1... | true | true |
79010d9d3f788353d118f2ed0c14776fa1c23768 | 1,389 | py | Python | lowfat/migrations/0090_auto_20170307_1518.py | elena-kolomeets/lowfat | f7647f5cd12519f722e41808157a96cc3e37b6ce | [
"BSD-3-Clause"
] | 6 | 2017-02-23T16:44:36.000Z | 2019-03-18T11:39:03.000Z | lowfat/migrations/0090_auto_20170307_1518.py | elena-kolomeets/lowfat | f7647f5cd12519f722e41808157a96cc3e37b6ce | [
"BSD-3-Clause"
] | 286 | 2017-02-07T15:00:41.000Z | 2022-03-08T12:56:09.000Z | lowfat/migrations/0090_auto_20170307_1518.py | elena-kolomeets/lowfat | f7647f5cd12519f722e41808157a96cc3e37b6ce | [
"BSD-3-Clause"
] | 2 | 2018-06-19T12:38:08.000Z | 2020-11-23T12:15:08.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-07 15:18
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
def add_author_to_blog(apps, schema_editor): # pylint: disable=unused-argument
"""Author is the claimant"""
Blog = apps.ge... | 35.615385 | 168 | 0.645788 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
def add_author_to_blog(apps, schema_editor):
Blog = apps.get_model("lowfat", "Blog")
for blog in Blog.objects.all():
blog.author = blog.fund.claimant
blog.save()
class Migra... | true | true |
79010de06d633480247f5d160a4de1a7c3315b9f | 5,584 | py | Python | test/functional/mining_basic.py | elliottminns/livecoin | 0d9f12023e113c68501ddd3da5a7b7afebce9a3d | [
"MIT"
] | null | null | null | test/functional/mining_basic.py | elliottminns/livecoin | 0d9f12023e113c68501ddd3da5a7b7afebce9a3d | [
"MIT"
] | null | null | null | test/functional/mining_basic.py | elliottminns/livecoin | 0d9f12023e113c68501ddd3da5a7b7afebce9a3d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mining RPCs
- getmininginfo
- getblocktemplate proposal mode
- submitblock"""
import copy
from b... | 41.058824 | 141 | 0.681411 |
import copy
from binascii import b2a_hex
from decimal import Decimal
from test_framework.blocktools import create_coinbase
from test_framework.mininode import CBlock
from test_framework.test_framework import LivecoinTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error
def b2x(b):
... | true | true |
79010e1bdee63e2f2433d37394cdf133896e846e | 6,082 | py | Python | apscheduler/workers/async_.py | daya0576/apscheduler | 61b8b44c712c9a28e613044b12c553adbc6ca015 | [
"MIT"
] | 3 | 2021-04-02T14:44:13.000Z | 2022-01-27T08:41:28.000Z | apscheduler/workers/async_.py | zhenhua32/apscheduler | d10f20215d8c78e9e2d32d634f276bb89f86ca38 | [
"MIT"
] | null | null | null | apscheduler/workers/async_.py | zhenhua32/apscheduler | d10f20215d8c78e9e2d32d634f276bb89f86ca38 | [
"MIT"
] | null | null | null | import os
import platform
import threading
from asyncio import current_task, iscoroutinefunction
from collections.abc import Coroutine
from contextlib import AsyncExitStack
from datetime import datetime, timezone
from functools import partial
from logging import Logger, getLogger
from traceback import format_exc
from t... | 40.278146 | 95 | 0.65735 | import os
import platform
import threading
from asyncio import current_task, iscoroutinefunction
from collections.abc import Coroutine
from contextlib import AsyncExitStack
from datetime import datetime, timezone
from functools import partial
from logging import Logger, getLogger
from traceback import format_exc
from t... | true | true |
79010e42d0884bf73de8caa78804f0cf9c24b92a | 3,453 | py | Python | tess/utilities/image_process.py | tonthatnam/japanese_ocr | c78ed95d940fd979bbec1f33bca085e9977cafa4 | [
"MIT"
] | 3 | 2021-02-27T16:13:44.000Z | 2021-05-21T14:08:19.000Z | tess/utilities/image_process.py | tonthatnam/japanese_ocr | c78ed95d940fd979bbec1f33bca085e9977cafa4 | [
"MIT"
] | null | null | null | tess/utilities/image_process.py | tonthatnam/japanese_ocr | c78ed95d940fd979bbec1f33bca085e9977cafa4 | [
"MIT"
] | 1 | 2021-04-03T04:01:57.000Z | 2021-04-03T04:01:57.000Z | from PIL import Image
import tempfile
import cv2
import imutils
import numpy as np
def set_image_dpi_ppi(file_path):
im = Image.open(file_path)
length_x, width_y = im.size
factor = float(length_x/width_y)
size = int(600), int(600/factor)
im_resized = im.resize(size, Image.ANTIALIAS)
temp_file =... | 36.347368 | 93 | 0.663481 | from PIL import Image
import tempfile
import cv2
import imutils
import numpy as np
def set_image_dpi_ppi(file_path):
im = Image.open(file_path)
length_x, width_y = im.size
factor = float(length_x/width_y)
size = int(600), int(600/factor)
im_resized = im.resize(size, Image.ANTIALIAS)
temp_file =... | true | true |
79010e95ff3c3d69ff6163190fe385046a30dd10 | 8,628 | py | Python | couler/core/step_update_utils.py | javoweb/couler | 1531f31816a1505401c5326dc5fec5a8bb7bf7cd | [
"Apache-2.0"
] | null | null | null | couler/core/step_update_utils.py | javoweb/couler | 1531f31816a1505401c5326dc5fec5a8bb7bf7cd | [
"Apache-2.0"
] | null | null | null | couler/core/step_update_utils.py | javoweb/couler | 1531f31816a1505401c5326dc5fec5a8bb7bf7cd | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Couler 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 law or... | 35.506173 | 78 | 0.585883 |
from collections import OrderedDict
import couler.core.templates.output
from couler.core import states, utils
from couler.core.templates import OutputArtifact, Step
def update_step(func_name, args, step_name, caller_line):
if states.workflow.dag_mode_enabled():
step_name = _update_dag_tasks(... | true | true |
79010efc28d2a0d4cf031086c42489b79a2cf15b | 6,973 | py | Python | test/functional/wallet_txn_doublespend.py | zerohourcash/zerohourcash | 2e3be4876e1775e8532b71ecb29c502e6c02616a | [
"MIT"
] | 5 | 2021-04-26T01:15:43.000Z | 2022-02-28T19:48:24.000Z | test/functional/wallet_txn_doublespend.py | zerohourcash/zerohourcash | 2e3be4876e1775e8532b71ecb29c502e6c02616a | [
"MIT"
] | null | null | null | test/functional/wallet_txn_doublespend.py | zerohourcash/zerohourcash | 2e3be4876e1775e8532b71ecb29c502e6c02616a | [
"MIT"
] | 3 | 2021-04-26T00:57:46.000Z | 2022-01-13T07:37:51.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there is a double-spend conflict."""
from decimal import Decimal... | 46.178808 | 145 | 0.641761 |
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.zerohourconfig import INITIAL_BLOCK_REWARD
class TxnMallTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 4
def skip_test_if_missi... | true | true |
79010f186d2da99e9bc0099a880f3e7a056a1dbe | 6,308 | py | Python | tests/test_iqn_nstep_td_error.py | opendilab/DI-hpc | 8f001382cd1c0119013e1d0d0e98ff41c751d8a2 | [
"Apache-2.0"
] | 64 | 2021-07-08T02:18:08.000Z | 2022-02-28T09:52:57.000Z | tests/test_iqn_nstep_td_error.py | opendilab/DI-hpc | 8f001382cd1c0119013e1d0d0e98ff41c751d8a2 | [
"Apache-2.0"
] | null | null | null | tests/test_iqn_nstep_td_error.py | opendilab/DI-hpc | 8f001382cd1c0119013e1d0d0e98ff41c751d8a2 | [
"Apache-2.0"
] | 3 | 2021-07-14T08:58:45.000Z | 2022-03-30T12:36:46.000Z | import time
import torch
from hpc_rll.origin.td import iqn_nstep_td_error, iqn_nstep_td_data
from hpc_rll.rl_utils.td import IQNNStepTDError
from testbase import mean_relative_error, times
assert torch.cuda.is_available()
use_cuda = True
tau = 33
tauPrime = 34
T = 10
B = 64
N = 8
gamma = 0.95
kappa = 0.9
def iqn_val... | 39.425 | 191 | 0.656309 | import time
import torch
from hpc_rll.origin.td import iqn_nstep_td_error, iqn_nstep_td_data
from hpc_rll.rl_utils.td import IQNNStepTDError
from testbase import mean_relative_error, times
assert torch.cuda.is_available()
use_cuda = True
tau = 33
tauPrime = 34
T = 10
B = 64
N = 8
gamma = 0.95
kappa = 0.9
def iqn_val... | true | true |
79010f19134681f4a4139685bf23c998b96ba2ab | 4,488 | py | Python | lib/googlecloudsdk/api_lib/compute/zone_utils.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/api_lib/compute/zone_utils.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/googlecloudsdk/api_lib/compute/zone_utils.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | # -*- coding: utf-8 -*- #
# Copyright 2014 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 35.0625 | 80 | 0.679367 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.api_lib.compute import request_helper
from googlecloudsdk.api_lib.compute import utils
from googlecloudsdk.calliope import exceptions as calliope_exceptions
from googleclouds... | true | true |
79010f9ce34ee46f7f5afed5ce86db595bcde4be | 3,739 | py | Python | solutions/p287.py | xianlinfeng/project_euler_python3 | 77eca44eb2b1d13bc70d6dc0258b737449d43a23 | [
"MIT"
] | null | null | null | solutions/p287.py | xianlinfeng/project_euler_python3 | 77eca44eb2b1d13bc70d6dc0258b737449d43a23 | [
"MIT"
] | null | null | null | solutions/p287.py | xianlinfeng/project_euler_python3 | 77eca44eb2b1d13bc70d6dc0258b737449d43a23 | [
"MIT"
] | null | null | null | #
# Solution to Project Euler problem 287
# Copyright (c) Project Nayuki. All rights reserved.
#
# https://www.nayuki.io/page/project-euler-solutions
# https://github.com/nayuki/Project-Euler-solutions
#
# Let R = 2^(N-1) denote the radius of the circle (filled disk) being drawn.
#
# First, we can simplify the pr... | 47.935897 | 95 | 0.682268 |
def compute():
N = 24
RADIUS_SQUARED = 2**(2 * N - 2)
# requiring 0 <= xstart < xend and 0 <= ystart < yend.
def compressed_length(xstart, xend, ystart, yend):
if xstart * xstart + ystart * ystart > RADIUS_SQUARED: # All white
return 2
elif (xend - 1) * (x... | true | true |
790112e17cfb3b5d10e1f0b58ddb487cbd6dffba | 1,540 | py | Python | 07-programasDeAlgoritmo/1-programaDeAlgoritmoTipo1/0versoesAntigas/9-programa/algoritmo2.py | jonasht/Python | 2affe509ce9619f745ee645ff3a120485bf403bc | [
"MIT"
] | null | null | null | 07-programasDeAlgoritmo/1-programaDeAlgoritmoTipo1/0versoesAntigas/9-programa/algoritmo2.py | jonasht/Python | 2affe509ce9619f745ee645ff3a120485bf403bc | [
"MIT"
] | null | null | null | 07-programasDeAlgoritmo/1-programaDeAlgoritmoTipo1/0versoesAntigas/9-programa/algoritmo2.py | jonasht/Python | 2affe509ce9619f745ee645ff3a120485bf403bc | [
"MIT"
] | null | null | null | from interface import *
class M2:
interface = Interface()
def __init__(self, tamanhoDaLista, tempoDeAtraso, charPixel = ' '):
self.guardarNumero = 0
self.interface.set_tamanhoDaLista(tamanhoDaLista)
self.interface.set_tempoDeAtraso(tempoDeAtraso)
self.interface.set... | 37.560976 | 83 | 0.518831 | from interface import *
class M2:
interface = Interface()
def __init__(self, tamanhoDaLista, tempoDeAtraso, charPixel = ' '):
self.guardarNumero = 0
self.interface.set_tamanhoDaLista(tamanhoDaLista)
self.interface.set_tempoDeAtraso(tempoDeAtraso)
self.interface.set... | true | true |
790113315ce4aa4ae68f9d7785b54a2d40e710ea | 361 | py | Python | other/dingding/dingtalk/api/rest/OapiCateringUnfreezeRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiCateringUnfreezeRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiCateringUnfreezeRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | '''
Created by auto_sdk on 2021.03.10
'''
from dingtalk.api.base import RestApi
class OapiCateringUnfreezeRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.order_id = None
self.rule_code = None
self.userid = None
def getHttpMethod(self):
return 'POST'
def getapiname(self):
... | 21.235294 | 43 | 0.747922 | from dingtalk.api.base import RestApi
class OapiCateringUnfreezeRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.order_id = None
self.rule_code = None
self.userid = None
def getHttpMethod(self):
return 'POST'
def getapiname(self):
return 'dingtalk.oapi.catering.unfreeze'
| true | true |
790113e7815d2c7812f36d9d8f3b5e1d1896e669 | 2,341 | py | Python | data/cirq_new/cirq_program/startCirq_Class840.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_Class840.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_Class840.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=25
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
def make_circuit(n: int, input_qubit):
c = cirq.Ci... | 32.068493 | 80 | 0.668518 |
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
def make_circuit(n: int, input_qubit):
c = cirq.Circuit()
c.append(cirq.H.on(input_qubit[0]))
c.append(cirq.H.on(input_qubit[1]))
c.append(cirq.H.on(input_qubit[1]))
... | true | true |
7901144608dc0639a38b27d7fe8ce58d40d01b0a | 1,315 | py | Python | server/gestion/serializers/providerOrderSerializer.py | JetLightStudio/Jet-Gest-stock-management | 333cbc3dd1b379f53f67250fbd581cbce8e20ca8 | [
"MIT"
] | 1 | 2021-08-18T18:53:02.000Z | 2021-08-18T18:53:02.000Z | server/gestion/serializers/providerOrderSerializer.py | JetLightStudio/Jet-Gest-stock-management | 333cbc3dd1b379f53f67250fbd581cbce8e20ca8 | [
"MIT"
] | null | null | null | server/gestion/serializers/providerOrderSerializer.py | JetLightStudio/Jet-Gest-stock-management | 333cbc3dd1b379f53f67250fbd581cbce8e20ca8 | [
"MIT"
] | 1 | 2021-08-04T23:53:52.000Z | 2021-08-04T23:53:52.000Z | from rest_framework import serializers
from gestion.models.providerOrder import ProviderOrder
from auth_app.serializers.userSerializer import UserSerializer
from gestion.serializers.providerSerializer import ProviderSerializer
from auth_app.models.user import User
from gestion.models.provider import Provider... | 34.605263 | 88 | 0.742205 | from rest_framework import serializers
from gestion.models.providerOrder import ProviderOrder
from auth_app.serializers.userSerializer import UserSerializer
from gestion.serializers.providerSerializer import ProviderSerializer
from auth_app.models.user import User
from gestion.models.provider import Provider... | true | true |
790114aa0c0efff55f9d68a6bd2bd3434ece70e4 | 472 | py | Python | interpolate_example.py | anntzer/structured-docstrings | 1de0e3458d04723e6fdbca0367a82434b2843f3b | [
"MIT"
] | 1 | 2019-07-20T15:22:19.000Z | 2019-07-20T15:22:19.000Z | interpolate_example.py | anntzer/structured-docstrings | 1de0e3458d04723e6fdbca0367a82434b2843f3b | [
"MIT"
] | null | null | null | interpolate_example.py | anntzer/structured-docstrings | 1de0e3458d04723e6fdbca0367a82434b2843f3b | [
"MIT"
] | null | null | null | from interpolate import interpolate_doc
foo = """
hello
world
"""
bar = "foo bar\nbaz"
class Foo:
# cf matplotlib's kwdoc.
__kw__ = "the kw of foo"
@interpolate_doc
def func():
"""
this is a docstring
{interpolate_example.foo}
{bar}
{Foo!K}
"""
try:
@interpolat... | 12.756757 | 47 | 0.576271 | from interpolate import interpolate_doc
foo = """
hello
world
"""
bar = "foo bar\nbaz"
class Foo:
__kw__ = "the kw of foo"
@interpolate_doc
def func():
try:
@interpolate_doc
def bad_doc():
except ValueError:
print("error correctly caught")
| true | true |
790114b62661448156a89416653afbbad7a619d7 | 1,346 | py | Python | polling_stations/apps/data_importers/management/commands/import_epsom_and_ewell.py | smsmith97/UK-Polling-Stations | ecbd98cb99e89e97354da3960b0063aa36181b11 | [
"BSD-3-Clause"
] | 29 | 2015-03-10T08:41:34.000Z | 2022-01-12T08:51:38.000Z | polling_stations/apps/data_importers/management/commands/import_epsom_and_ewell.py | smsmith97/UK-Polling-Stations | ecbd98cb99e89e97354da3960b0063aa36181b11 | [
"BSD-3-Clause"
] | 4,112 | 2015-04-01T21:27:38.000Z | 2022-03-31T19:22:11.000Z | polling_stations/apps/data_importers/management/commands/import_epsom_and_ewell.py | smsmith97/UK-Polling-Stations | ecbd98cb99e89e97354da3960b0063aa36181b11 | [
"BSD-3-Clause"
] | 31 | 2015-03-18T14:52:50.000Z | 2022-02-24T10:31:07.000Z | from data_importers.github_importer import BaseGitHubImporter
class Command(BaseGitHubImporter):
srid = 27700
districts_srid = 27700
council_id = "EPS"
elections = ["2021-05-06"]
scraper_name = "wdiv-scrapers/DC-PollingStations-EpsomAndEwell"
geom_type = "gml"
seen = set()
def distri... | 30.590909 | 88 | 0.581724 | from data_importers.github_importer import BaseGitHubImporter
class Command(BaseGitHubImporter):
srid = 27700
districts_srid = 27700
council_id = "EPS"
elections = ["2021-05-06"]
scraper_name = "wdiv-scrapers/DC-PollingStations-EpsomAndEwell"
geom_type = "gml"
seen = set()
def distri... | true | true |
7901160068a3177560677e18df2d12b7cca78efa | 9,763 | py | Python | homekit/crypto/srp.py | kvaellning/homekit_python | 88e507541bbab7d662d7bf41e452f99540ac850e | [
"Apache-2.0"
] | 3 | 2017-08-01T17:45:58.000Z | 2017-08-12T07:41:53.000Z | homekit/crypto/srp.py | jlusiardi/homekit_client | b7d9fe730159ec90bf7a82010150d38112d4b1fc | [
"Apache-2.0"
] | null | null | null | homekit/crypto/srp.py | jlusiardi/homekit_client | b7d9fe730159ec90bf7a82010150d38112d4b1fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
#
# Copyright 2018 Joachim Lusiardi
#
# 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 applicabl... | 34.743772 | 95 | 0.651029 |
import math
import hashlib
import os
class Srp:
def __init__(self):
self.g = int(b'5', 16)
self.n = int(b'''\
FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08\
8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B\
302B0A6DF25F14374FE1356D6D51C245E485... | true | true |
7901167d2ca689ba70d52528428e33fd1272f67e | 974 | py | Python | tests/func/test_complete_habit.py | takavarasha-desire/habittracker1_1 | 392034a0d67f2be0e8e34648614fc90c851d9f51 | [
"MIT"
] | null | null | null | tests/func/test_complete_habit.py | takavarasha-desire/habittracker1_1 | 392034a0d67f2be0e8e34648614fc90c851d9f51 | [
"MIT"
] | null | null | null | tests/func/test_complete_habit.py | takavarasha-desire/habittracker1_1 | 392034a0d67f2be0e8e34648614fc90c851d9f51 | [
"MIT"
] | null | null | null | from habit.habit_model import HabitHistory
from habit.complete_habit import complete
def test_overdue_habit(datasett):
"""
please note the 'double tt' for datasett. This stands to differentiate
the functional test data from the data used for unit tests.
habit 1 is the overdue habit since its added fir... | 29.515152 | 75 | 0.687885 | from habit.habit_model import HabitHistory
from habit.complete_habit import complete
def test_overdue_habit(datasett):
session = datasett
complete(1, session)
result = session.query(HabitHistory.broken_count).\
filter(HabitHistory.habitid == 1).all()
assert result == [(1,)]
def test_a_habit_... | true | true |
7901180465af174a6f023be20b48204d2d1b8ffa | 501 | py | Python | web2py-appliances-master/HotelManagementExample/models/db_wizard_ondelete.py | wantsomechocolate/WantsomeBeanstalk | 8c8a0a80490d04ea52661a3114fd3db8de65a01e | [
"BSD-3-Clause"
] | null | null | null | web2py-appliances-master/HotelManagementExample/models/db_wizard_ondelete.py | wantsomechocolate/WantsomeBeanstalk | 8c8a0a80490d04ea52661a3114fd3db8de65a01e | [
"BSD-3-Clause"
] | null | null | null | web2py-appliances-master/HotelManagementExample/models/db_wizard_ondelete.py | wantsomechocolate/WantsomeBeanstalk | 8c8a0a80490d04ea52661a3114fd3db8de65a01e | [
"BSD-3-Clause"
] | null | null | null | db.blog_category.ondelete = 'CASCADE'
db.blog.ondelete = 'CASCADE'
db.branch_rating.ondelete = 'CASCADE'
db.branch.ondelete = 'CASCADE'
db.floor.ondelete = 'CASCADE'
db.guest.ondelete = 'CASCADE'
db.news_category.ondelete = 'CASCADE'
db.news.ondelete = 'CASCADE'
db.photo_album.ondelete = 'CASCADE'
db.photo.ondelete = '... | 31.3125 | 38 | 0.760479 | db.blog_category.ondelete = 'CASCADE'
db.blog.ondelete = 'CASCADE'
db.branch_rating.ondelete = 'CASCADE'
db.branch.ondelete = 'CASCADE'
db.floor.ondelete = 'CASCADE'
db.guest.ondelete = 'CASCADE'
db.news_category.ondelete = 'CASCADE'
db.news.ondelete = 'CASCADE'
db.photo_album.ondelete = 'CASCADE'
db.photo.ondelete = '... | true | true |
790118528e39ec848ce42b7e3d980e96710d9c87 | 4,047 | py | Python | google_cloud_compute/komand_google_cloud_compute/actions/get_firewall/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | google_cloud_compute/komand_google_cloud_compute/actions/get_firewall/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | google_cloud_compute/komand_google_cloud_compute/actions/get_firewall/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Input:
FIREWALL = "firewall"
class Output:
ALLOWED = "allowed"
CREATIONTIMESTAMP = "creationTimestamp"
DESCRIPTION = "description"
ID = "id"
KIND = "kind"
NAME = "name"
NETWORK = "network"
SELFLINK = "sel... | 25.613924 | 176 | 0.551767 |
import komand
import json
class Input:
FIREWALL = "firewall"
class Output:
ALLOWED = "allowed"
CREATIONTIMESTAMP = "creationTimestamp"
DESCRIPTION = "description"
ID = "id"
KIND = "kind"
NAME = "name"
NETWORK = "network"
SELFLINK = "selfLink"
SOURCERANGES = "sourceRanges... | true | true |
79011899d68bbfec0c449ad74ae5d06590f58e14 | 4,131 | py | Python | yaz/test/test_task_configuration.py | boudewijn-zicht/yaz | 48c842fe053bf9cd6446c4b33fb081c65339aa48 | [
"MIT"
] | 2 | 2017-03-09T15:44:10.000Z | 2017-03-15T17:51:24.000Z | yaz/test/test_task_configuration.py | yaz/yaz | 48c842fe053bf9cd6446c4b33fb081c65339aa48 | [
"MIT"
] | 9 | 2017-03-10T12:54:12.000Z | 2017-04-02T08:01:41.000Z | yaz/test/test_task_configuration.py | boudewijn-zicht/yaz | 48c842fe053bf9cd6446c4b33fb081c65339aa48 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import io
import unittest.mock
import yaz
class ConfigurationPlugin(yaz.Plugin):
"""This is the documentation string for the ConfigurationPlugin"""
choices = {
"yes": True,
"no": False,
"unknown": None,
}
@yaz.task(choice__choices=["yes", "no", "unknow... | 35.612069 | 117 | 0.661825 |
import io
import unittest.mock
import yaz
class ConfigurationPlugin(yaz.Plugin):
choices = {
"yes": True,
"no": False,
"unknown": None,
}
@yaz.task(choice__choices=["yes", "no", "unknown"])
def required_choice(self, choice):
return self.choices[choice]
@yaz.tas... | true | true |
790118e8bb809dc345959e6e808bc69e67393268 | 1,465 | py | Python | test/test_grid.py | gabrielbarker/snap | 14272297463d4a2272644dca0e7a33773cdb32d5 | [
"MIT"
] | null | null | null | test/test_grid.py | gabrielbarker/snap | 14272297463d4a2272644dca0e7a33773cdb32d5 | [
"MIT"
] | null | null | null | test/test_grid.py | gabrielbarker/snap | 14272297463d4a2272644dca0e7a33773cdb32d5 | [
"MIT"
] | null | null | null | import unittest
import io
import sys
import random
from unittest.mock import MagicMock, Mock, patch
from snap.grid import Grid
from snap.hand import Hand
from snap.card import Card
class TestGrid(unittest.TestCase):
def test__get__origin__returns_correct_cards(self):
random.seed(1)
expected_card =... | 31.170213 | 73 | 0.675085 | import unittest
import io
import sys
import random
from unittest.mock import MagicMock, Mock, patch
from snap.grid import Grid
from snap.hand import Hand
from snap.card import Card
class TestGrid(unittest.TestCase):
def test__get__origin__returns_correct_cards(self):
random.seed(1)
expected_card =... | true | true |
7901194eba875695bcdb1f6dc9753cda74759756 | 3,426 | py | Python | tools/render.py | fanbeatsman/interactive-viewer | b2561b394656fcfd125611553ab56efd3beae0f2 | [
"MIT"
] | 20 | 2019-06-22T17:02:48.000Z | 2022-03-10T05:29:45.000Z | tools/render.py | fanbeatsman/interactive-viewer | b2561b394656fcfd125611553ab56efd3beae0f2 | [
"MIT"
] | 2 | 2019-06-24T15:12:34.000Z | 2019-06-25T16:52:14.000Z | tools/render.py | fanbeatsman/interactive-viewer | b2561b394656fcfd125611553ab56efd3beae0f2 | [
"MIT"
] | 5 | 2019-07-01T20:15:49.000Z | 2021-04-08T13:58:00.000Z | from __future__ import print_function
"""
A script to batch render and update interactive viewer.
"""
import os
import sys
import argparse
import pyexr
import numpy as np
import json
import subprocess as sp
from analyze import update_stats, compute_stats, write_data
if __name__ == '__main__':
# Parse arguments
... | 38.931818 | 127 | 0.590193 | from __future__ import print_function
import os
import sys
import argparse
import pyexr
import numpy as np
import json
import subprocess as sp
from analyze import update_stats, compute_stats, write_data
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Batch analysis of rend... | true | true |
7901199bf253ffa0258b22098bef2a7b600f551f | 8,681 | py | Python | test/py/ganeti.tools.prepare_node_join_unittest.py | regnauld/ganeti | c1d88461a964a5d0d89cd1ba0571429e01f0a1b5 | [
"BSD-2-Clause"
] | 2 | 2018-09-26T10:09:23.000Z | 2018-09-27T07:27:06.000Z | test/py/ganeti.tools.prepare_node_join_unittest.py | regnauld/ganeti | c1d88461a964a5d0d89cd1ba0571429e01f0a1b5 | [
"BSD-2-Clause"
] | null | null | null | test/py/ganeti.tools.prepare_node_join_unittest.py | regnauld/ganeti | c1d88461a964a5d0d89cd1ba0571429e01f0a1b5 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of... | 34.177165 | 80 | 0.665592 |
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
import unittest
import shutil
import tempfile
import os.path
from ganeti import errors
from ganeti import constants
from ganeti import pathutils
from ganeti import compat
from ganeti import utils
from ganeti.tools imp... | true | true |
7901199d5463ed6267d0b721d5056abb66f44d76 | 442 | py | Python | tests/svgen/test_sieve.py | Risto97/pygears | 19393e85101a16762cb3bbbf3010946ef69217f2 | [
"MIT"
] | null | null | null | tests/svgen/test_sieve.py | Risto97/pygears | 19393e85101a16762cb3bbbf3010946ef69217f2 | [
"MIT"
] | null | null | null | tests/svgen/test_sieve.py | Risto97/pygears | 19393e85101a16762cb3bbbf3010946ef69217f2 | [
"MIT"
] | null | null | null | from nose import with_setup
from pygears import Intf, clear
from pygears.typing import Queue, Uint
from utils import svgen_check
@with_setup(clear)
@svgen_check(['sieve_0v2_7_8v10.sv'])
def test_uint():
iout = Intf(Uint[10])[:2, 7, 8:]
assert iout.dtype == Uint[5]
@with_setup(clear)
@svgen_check(['sieve_0... | 21.047619 | 45 | 0.690045 | from nose import with_setup
from pygears import Intf, clear
from pygears.typing import Queue, Uint
from utils import svgen_check
@with_setup(clear)
@svgen_check(['sieve_0v2_7_8v10.sv'])
def test_uint():
iout = Intf(Uint[10])[:2, 7, 8:]
assert iout.dtype == Uint[5]
@with_setup(clear)
@svgen_check(['sieve_0... | true | true |
79011ab78b18cfdf827a9175719865cd05515572 | 11,814 | py | Python | server/API.py | lucas-almeida-silva/gama-sports | c287680a645941bc16fc09a350167922171fa30d | [
"MIT"
] | null | null | null | server/API.py | lucas-almeida-silva/gama-sports | c287680a645941bc16fc09a350167922171fa30d | [
"MIT"
] | null | null | null | server/API.py | lucas-almeida-silva/gama-sports | c287680a645941bc16fc09a350167922171fa30d | [
"MIT"
] | 1 | 2020-11-28T13:44:45.000Z | 2020-11-28T13:44:45.000Z | from flask import Flask, request, jsonify, make_response
from flask_sqlalchemy import SQLAlchemy
import uuid
from werkzeug.security import generate_password_hash, check_password_hash
import jwt
import datetime
from functools import wraps
from flask_mail import Mail, Message
import bcrypt
import re
from validate_email i... | 34.849558 | 178 | 0.675047 | from flask import Flask, request, jsonify, make_response
from flask_sqlalchemy import SQLAlchemy
import uuid
from werkzeug.security import generate_password_hash, check_password_hash
import jwt
import datetime
from functools import wraps
from flask_mail import Mail, Message
import bcrypt
import re
from validate_email i... | true | true |
79011b2df9a3b23d72bdc7fb63a4b8022b92a715 | 2,238 | py | Python | custom_components/husqvarna_automower/device_tracker.py | kalhimeo/husqvarna_automower | de513b9ab3ef21fe0a934793aa472f90689b85ce | [
"MIT"
] | null | null | null | custom_components/husqvarna_automower/device_tracker.py | kalhimeo/husqvarna_automower | de513b9ab3ef21fe0a934793aa472f90689b85ce | [
"MIT"
] | null | null | null | custom_components/husqvarna_automower/device_tracker.py | kalhimeo/husqvarna_automower | de513b9ab3ef21fe0a934793aa472f90689b85ce | [
"MIT"
] | null | null | null | """Platform for Husqvarna Automower device tracker integration."""
from homeassistant.components.device_tracker import SOURCE_TYPE_GPS
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.helpers.entity import DeviceInfo
from .const import DOMAIN
async def async_s... | 33.402985 | 87 | 0.645666 | from homeassistant.components.device_tracker import SOURCE_TYPE_GPS
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.helpers.entity import DeviceInfo
from .const import DOMAIN
async def async_setup_entry(hass, entry, async_add_devices) -> None:
session = h... | true | true |
79011baab4598fa373dcd41d8b61c572c42d70f8 | 286 | py | Python | pubnub/models/consumer/channel_group.py | 17media/pubnub-python | ee372eec82f16d3a80a4cd027bca8976755b817f | [
"MIT"
] | null | null | null | pubnub/models/consumer/channel_group.py | 17media/pubnub-python | ee372eec82f16d3a80a4cd027bca8976755b817f | [
"MIT"
] | null | null | null | pubnub/models/consumer/channel_group.py | 17media/pubnub-python | ee372eec82f16d3a80a4cd027bca8976755b817f | [
"MIT"
] | null | null | null | class PNChannelGroupsAddChannelResult(object):
pass
class PNChannelGroupsRemoveChannelResult(object):
pass
class PNChannelGroupsRemoveGroupResult(object):
pass
class PNChannelGroupsListResult(object):
def __init__(self, channels):
self.channels = channels
| 17.875 | 49 | 0.772727 | class PNChannelGroupsAddChannelResult(object):
pass
class PNChannelGroupsRemoveChannelResult(object):
pass
class PNChannelGroupsRemoveGroupResult(object):
pass
class PNChannelGroupsListResult(object):
def __init__(self, channels):
self.channels = channels
| true | true |
79011c678e10d54b747fa9d433dcb10ce843865f | 831 | py | Python | migrations/versions/780c29109b25_.py | mutalisk999/Flog | 5d836e26967b39faebdf2d5a2c558316bf93221b | [
"MIT"
] | 1 | 2020-08-24T03:39:52.000Z | 2020-08-24T03:39:52.000Z | migrations/versions/780c29109b25_.py | mutalisk999/Flog | 5d836e26967b39faebdf2d5a2c558316bf93221b | [
"MIT"
] | null | null | null | migrations/versions/780c29109b25_.py | mutalisk999/Flog | 5d836e26967b39faebdf2d5a2c558316bf93221b | [
"MIT"
] | null | null | null | """empty message
Revision ID: 780c29109b25
Revises: 911cc5d772fc
Create Date: 2020-08-30 15:22:15.026266
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "780c29109b25"
down_revision = "911cc5d772fc"
branch_labels = None
depends_on = None
def... | 26.806452 | 89 | 0.665463 | from alembic import op
import sqlalchemy as sa
revision = "780c29109b25"
down_revision = "911cc5d772fc"
branch_labels = None
depends_on = None
def upgrade():
| true | true |
79011dd3e46a4da63a8123af05f9b59f0d676e6b | 91,264 | py | Python | kubernetes/client/apis/batch_v1_api.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/client/apis/batch_v1_api.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/client/apis/batch_v1_api.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | 1 | 2019-01-10T11:13:52.000Z | 2019-01-10T11:13:52.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
i... | 62.94069 | 1,390 | 0.645665 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..api_client import ApiClient
class BatchV1Api(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
d... | true | true |
79011ddbdaf445056b62825e0177f0699d9bc6ab | 670 | py | Python | armulator/armv6/opcodes/thumb_instruction_set/thumb_instruction_set_encoding_16_bit/thumb_shift_immediate_add_subtract_move_and_compare/mov_register_thumb_t2.py | matan1008/armulator | 04d24dcec6ab42326018f5e09331e5b4738d6b52 | [
"MIT"
] | 16 | 2018-01-22T14:36:49.000Z | 2021-12-17T15:39:52.000Z | armulator/armv6/opcodes/thumb_instruction_set/thumb_instruction_set_encoding_16_bit/thumb_shift_immediate_add_subtract_move_and_compare/mov_register_thumb_t2.py | AhmedMounir/armulator | 04d24dcec6ab42326018f5e09331e5b4738d6b52 | [
"MIT"
] | 3 | 2019-02-19T17:51:47.000Z | 2022-03-31T20:45:21.000Z | armulator/armv6/opcodes/thumb_instruction_set/thumb_instruction_set_encoding_16_bit/thumb_shift_immediate_add_subtract_move_and_compare/mov_register_thumb_t2.py | AhmedMounir/armulator | 04d24dcec6ab42326018f5e09331e5b4738d6b52 | [
"MIT"
] | 4 | 2020-06-18T23:51:03.000Z | 2022-02-09T17:43:13.000Z | from armulator.armv6.opcodes.abstract_opcodes.mov_register_thumb import MovRegisterThumb
from armulator.armv6.opcodes.opcode import Opcode
class MovRegisterThumbT2(MovRegisterThumb, Opcode):
def __init__(self, instruction, m, d):
Opcode.__init__(self, instruction)
MovRegisterThumb.__init__(self, T... | 31.904762 | 88 | 0.674627 | from armulator.armv6.opcodes.abstract_opcodes.mov_register_thumb import MovRegisterThumb
from armulator.armv6.opcodes.opcode import Opcode
class MovRegisterThumbT2(MovRegisterThumb, Opcode):
def __init__(self, instruction, m, d):
Opcode.__init__(self, instruction)
MovRegisterThumb.__init__(self, T... | false | true |
79011fb2cfd25f3f0f3e4a25c5718c2f3a077f8a | 1,126 | py | Python | DynamicProgramming/UnBoundedKnapSack/RodCutting.py | Saicharan67/Interview-Coding-Questions | b28cccd41e380f15b833039d687931570908adfb | [
"MIT"
] | 12 | 2021-06-18T16:24:27.000Z | 2021-11-04T03:30:00.000Z | DynamicProgramming/UnBoundedKnapSack/RodCutting.py | Saicharan67/Interview-Coding-Questions | b28cccd41e380f15b833039d687931570908adfb | [
"MIT"
] | 32 | 2021-10-01T07:15:00.000Z | 2021-11-05T15:35:53.000Z | DynamicProgramming/UnBoundedKnapSack/RodCutting.py | Saicharan67/Interview-Coding-Questions | b28cccd41e380f15b833039d687931570908adfb | [
"MIT"
] | 21 | 2021-09-29T09:16:31.000Z | 2021-10-30T10:06:21.000Z | """
Given a rod of length n inches and an array of prices
that includes prices of all pieces of size smaller than n.
Determine the maximum value obtainable by cutting up the rod and
selling the pieces. For example, if the length of the rod is 8
and the values of different pieces are given as the following,
then the... | 27.463415 | 86 | 0.55595 |
def RodCutting(larr, parr, L):
n = len(larr)
dp = [[0 for j in range(L+1)]for i in range(n+1)]
for i in range(1, n+1):
for j in range(1, L+1):
if larr[i-1] <= j:
dp[i][j] = max(parr[i-1]+dp[i][j-larr[i-1]], dp[i-1][j])
else:
dp[i][j] = dp[i-... | true | true |
7901200b85e3ad1e3f075a40d541414a1b210b81 | 10,122 | py | Python | testcases/FWTS.py | jk-ozlabs/op-test-framework | 363165fa274f86243e7b924918bebf2325a7a8b2 | [
"Apache-2.0"
] | null | null | null | testcases/FWTS.py | jk-ozlabs/op-test-framework | 363165fa274f86243e7b924918bebf2325a7a8b2 | [
"Apache-2.0"
] | null | null | null | testcases/FWTS.py | jk-ozlabs/op-test-framework | 363165fa274f86243e7b924918bebf2325a7a8b2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
# OpenPOWER Automated Test Project
#
# Contributors Listed Below - COPYRIGHT 2015,2017
# [+] International Business Machines Corp.
#
#
# 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 th... | 49.617647 | 330 | 0.625766 |
import time
import subprocess
import re
import sys
import os
import OpTestConfiguration
import unittest
from common.OpTestSystem import OpSystemState
from common.Exceptions import CommandFailed
import json
class FWTSCommandFailed(unittest.TestCase):
FAIL = None
def runTest(self):
... | false | true |
79012013f89f59e7c39e1a1aace848e091a2dc28 | 2,838 | py | Python | openGaussBase/testcase/SECURITY/PERMISSIONS/Opengauss_Function_Security_User_Case0010.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SECURITY/PERMISSIONS/Opengauss_Function_Security_User_Case0010.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SECURITY/PERMISSIONS/Opengauss_Function_Security_User_Case0010.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... | 36.384615 | 84 | 0.627555 | import unittest
from yat.test import Node
from yat.test import macro
from testcase.utils.CommonSH import CommonSH
from testcase.utils.Logger import Logger
from testcase.utils.Common import Common
class Privategrant(unittest.TestCase):
def setUp(self):
self.logger = Logger()
self.logger.info(
... | true | true |
79012027ec44685127fd95d1f66b85fa2b2fe231 | 1,053 | py | Python | ticketbyrd/schema.py | barrachri/ticketbyrd | 568d1a501d1c458d33ff9cacaae4c12e7decb4dd | [
"Apache-2.0"
] | null | null | null | ticketbyrd/schema.py | barrachri/ticketbyrd | 568d1a501d1c458d33ff9cacaae4c12e7decb4dd | [
"Apache-2.0"
] | 1 | 2017-12-01T11:02:29.000Z | 2017-12-01T11:02:29.000Z | ticketbyrd/schema.py | barrachri/ticketbyrd | 568d1a501d1c458d33ff9cacaae4c12e7decb4dd | [
"Apache-2.0"
] | null | null | null | from marshmallow import Schema, fields
from marshmallow.validate import OneOf
ticket_type = ("Bug", "Report", "Feature", "Request", "Other")
ticket_urgency = ("Low", "Mid", "High")
ticket_status = ("Open", "In Progress", "Completed", "Rejected")
class Ticket(Schema):
id = fields.Int(dump_only=True)
created_at... | 33.967742 | 71 | 0.705603 | from marshmallow import Schema, fields
from marshmallow.validate import OneOf
ticket_type = ("Bug", "Report", "Feature", "Request", "Other")
ticket_urgency = ("Low", "Mid", "High")
ticket_status = ("Open", "In Progress", "Completed", "Rejected")
class Ticket(Schema):
id = fields.Int(dump_only=True)
created_at... | true | true |
790120c2bf9860a37f6bc1148ad28ee57adb0362 | 942 | py | Python | plants_api/main_site/migrations/0015_auto_20191109_2046.py | Javen17/plants_api | 08e68aa6a1d350f00879b645bbfdc37b900e9464 | [
"MIT"
] | 2 | 2019-09-29T04:19:32.000Z | 2019-10-27T23:44:21.000Z | plants_api/main_site/migrations/0015_auto_20191109_2046.py | Javen17/plants_api | 08e68aa6a1d350f00879b645bbfdc37b900e9464 | [
"MIT"
] | 12 | 2020-03-28T00:13:21.000Z | 2022-02-10T08:33:33.000Z | plants_api/main_site/migrations/0015_auto_20191109_2046.py | Javen17/plants_api | 08e68aa6a1d350f00879b645bbfdc37b900e9464 | [
"MIT"
] | 1 | 2019-09-28T20:27:45.000Z | 2019-09-28T20:27:45.000Z | # Generated by Django 2.2.5 on 2019-11-10 02:46
from django.db import migrations
import django.db.models.deletion
import smart_selects.db_fields
class Migration(migrations.Migration):
dependencies = [
('main_site', '0014_auto_20191109_2038'),
]
operations = [
migrations.AlterField(
... | 36.230769 | 215 | 0.687898 |
from django.db import migrations
import django.db.models.deletion
import smart_selects.db_fields
class Migration(migrations.Migration):
dependencies = [
('main_site', '0014_auto_20191109_2038'),
]
operations = [
migrations.AlterField(
model_name='mushroomspecimen',
... | true | true |
79012104f95db52a63271c87390d80a9ef333446 | 4,453 | py | Python | dataproc/concat_and_split.py | franzbischoff/caml-mimic | 9ce53f4a5093e09f12ed408480af0804aba7d7ca | [
"MIT"
] | null | null | null | dataproc/concat_and_split.py | franzbischoff/caml-mimic | 9ce53f4a5093e09f12ed408480af0804aba7d7ca | [
"MIT"
] | null | null | null | dataproc/concat_and_split.py | franzbischoff/caml-mimic | 9ce53f4a5093e09f12ed408480af0804aba7d7ca | [
"MIT"
] | null | null | null | """
Concatenate the labels with the notes data and split using the saved splits
"""
import csv
from datetime import datetime
import random
from constants import DATA_DIR
from constants import MIMIC_3_DIR
import pandas as pd
DATETIME_FORMAT = "%Y-%m-%d %H-%M-%S"
def concat_data(labelsfile, notes_file):
"""
... | 28.544872 | 113 | 0.628116 | import csv
from datetime import datetime
import random
from constants import DATA_DIR
from constants import MIMIC_3_DIR
import pandas as pd
DATETIME_FORMAT = "%Y-%m-%d %H-%M-%S"
def concat_data(labelsfile, notes_file):
with open(labelsfile, 'r') as lf:
print("CONCATENATING")
with open(notes_file, 'r') as... | true | true |
7901219870ed42d9c90e5151521dfeebde965c41 | 1,563 | py | Python | tests/STDF/test_FAR.py | awinia-github/Semi-ATE-STDF | f9f4e6544928f56a9be150bdbc38971ac32dd9fc | [
"MIT"
] | null | null | null | tests/STDF/test_FAR.py | awinia-github/Semi-ATE-STDF | f9f4e6544928f56a9be150bdbc38971ac32dd9fc | [
"MIT"
] | null | null | null | tests/STDF/test_FAR.py | awinia-github/Semi-ATE-STDF | f9f4e6544928f56a9be150bdbc38971ac32dd9fc | [
"MIT"
] | null | null | null | import os
import tempfile
from tests.STDF.STDFRecordTest import STDFRecordTest
from STDF import FAR
# File Attributes Record
# Functuion:
# Contains the information necessary to determine
# how to decode the STDF datacontained in the file.
def test_FAR():
far('<')
far('>')
def far(end):
# STDF v4... | 25.209677 | 62 | 0.672425 | import os
import tempfile
from tests.STDF.STDFRecordTest import STDFRecordTest
from STDF import FAR
def test_FAR():
far('<')
far('>')
def far(end):
record = FAR(endian = end)
tf = tempfile.NamedTemporaryFile(delete=False)
f = open(tf.name, "wb")
w_data = record.__re... | true | true |
790121ddca1355464b2166c981c47760f734c1d7 | 3,982 | py | Python | tests/components/directv/__init__.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 7 | 2019-08-15T13:36:58.000Z | 2020-03-18T10:46:29.000Z | tests/components/directv/__init__.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 87 | 2020-07-15T13:43:35.000Z | 2022-03-23T07:43:10.000Z | tests/components/directv/__init__.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 7 | 2018-10-04T10:12:45.000Z | 2021-12-29T20:55:40.000Z | """Tests for the DirecTV component."""
from http import HTTPStatus
from homeassistant.components.directv.const import CONF_RECEIVER_ID, DOMAIN
from homeassistant.components.ssdp import ATTR_SSDP_LOCATION
from homeassistant.const import CONF_HOST, CONTENT_TYPE_JSON
from homeassistant.core import HomeAssistant
from tes... | 31.603175 | 75 | 0.668257 | from http import HTTPStatus
from homeassistant.components.directv.const import CONF_RECEIVER_ID, DOMAIN
from homeassistant.components.ssdp import ATTR_SSDP_LOCATION
from homeassistant.const import CONF_HOST, CONTENT_TYPE_JSON
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry, load_... | true | true |
79012277efcc80bf75bc48523cd2e8a4d97738ec | 2,422 | py | Python | Pinocchio/faculty/tests/test_forms.py | shreygoel7/Pinocchio | b08c6dde591f0de948ef67db7ad83bf8fc4bfa62 | [
"MIT"
] | null | null | null | Pinocchio/faculty/tests/test_forms.py | shreygoel7/Pinocchio | b08c6dde591f0de948ef67db7ad83bf8fc4bfa62 | [
"MIT"
] | null | null | null | Pinocchio/faculty/tests/test_forms.py | shreygoel7/Pinocchio | b08c6dde591f0de948ef67db7ad83bf8fc4bfa62 | [
"MIT"
] | 1 | 2021-11-27T09:23:20.000Z | 2021-11-27T09:23:20.000Z | from academicInfo.models import Department
from faculty.forms import FacultySignupForm
from faculty.models import Faculty
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils import timezone
class FacultySignupFormTest(TestCase):
def test_signup_form_label(self):
... | 32.293333 | 70 | 0.565648 | from academicInfo.models import Department
from faculty.forms import FacultySignupForm
from faculty.models import Faculty
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils import timezone
class FacultySignupFormTest(TestCase):
def test_signup_form_label(self):
... | true | true |
790122b3d487f06bf6368199e38049d67c197daf | 17,549 | py | Python | sdk/python/pulumi_azure_native/compute/get_virtual_machine_scale_set.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/compute/get_virtual_machine_scale_set.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/compute/get_virtual_machine_scale_set.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 45.819843 | 558 | 0.690182 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
__all__ = [
'GetVirtualMachineScaleSetResult',
'AwaitableGetVirtualMachineScaleSetResult',
'get_virtual_machine_scale_set',
]
@pulumi... | true | true |
790122bb8ebca2360dd6388ed475881db457f27e | 7,733 | py | Python | mayan/apps/common/classes.py | marumadang/mayan-edms | 2052caada456306ae29b46c4885e45d9a26baaaa | [
"Apache-2.0"
] | null | null | null | mayan/apps/common/classes.py | marumadang/mayan-edms | 2052caada456306ae29b46c4885e45d9a26baaaa | [
"Apache-2.0"
] | null | null | null | mayan/apps/common/classes.py | marumadang/mayan-edms | 2052caada456306ae29b46c4885e45d9a26baaaa | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.urls import reverse
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.translation import ugettext
@python_2_unicode_compatible
class Collection(object):
_registr... | 27.916968 | 100 | 0.604423 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.urls import reverse
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.translation import ugettext
@python_2_unicode_compatible
class Collection(object):
_registr... | true | true |
7901230dea21b8daba0a85ea609adab8279744ba | 7,091 | py | Python | lib/command/PythonScripts/prebuild_lib.py | qalandarov/cocoapods-binary-cache | bf1fadc3d9dbd8fb260a83e9ddbb6fd8a17ee0b8 | [
"MIT"
] | null | null | null | lib/command/PythonScripts/prebuild_lib.py | qalandarov/cocoapods-binary-cache | bf1fadc3d9dbd8fb260a83e9ddbb6fd8a17ee0b8 | [
"MIT"
] | null | null | null | lib/command/PythonScripts/prebuild_lib.py | qalandarov/cocoapods-binary-cache | bf1fadc3d9dbd8fb260a83e9ddbb6fd8a17ee0b8 | [
"MIT"
] | null | null | null | # Copyright 2019 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved.
# Use of this source code is governed by an MIT-style license that can be found in the LICENSE file
import subprocess
import re
import os
import glob
from utils.fileutils import FileUtils
from utils.ziputils import ZipUtils
from functools import w... | 41.711765 | 119 | 0.624313 |
import subprocess
import re
import os
import glob
from utils.fileutils import FileUtils
from utils.ziputils import ZipUtils
from functools import wraps
from utils.logger import logger
from utils.step import step
def print_func_name(func):
@wraps(func)
def echo_func(*func_args, **func_kwargs):
... | true | true |
79012342a58987c1a94702b57c773254489bb8ac | 8,527 | py | Python | utd/script.py | bmccary/utd | 0c21aea1136403279c80c0db041cb8107d96e781 | [
"MIT"
] | null | null | null | utd/script.py | bmccary/utd | 0c21aea1136403279c80c0db041cb8107d96e781 | [
"MIT"
] | null | null | null | utd/script.py | bmccary/utd | 0c21aea1136403279c80c0db041cb8107d96e781 | [
"MIT"
] | null | null | null |
from prettytable import PrettyTable
from collections import OrderedDict
def _fieldnames(rows):
def g():
for row in rows:
yield from row
d = OrderedDict((k, None) for k in g())
return list(d.keys())
def _echo_table(rows):
if not rows: return
fieldnames = _fieldnames(rows)
t... | 34.108 | 158 | 0.72546 |
from prettytable import PrettyTable
from collections import OrderedDict
def _fieldnames(rows):
def g():
for row in rows:
yield from row
d = OrderedDict((k, None) for k in g())
return list(d.keys())
def _echo_table(rows):
if not rows: return
fieldnames = _fieldnames(rows)
t... | true | true |
79012480958bbdebc69a16fb38f259e850c32a78 | 2,872 | py | Python | check_commit.py | Cocopyth/foodshare | 1e997522b90bc11749265b7d31bea32a2bc03878 | [
"Apache-2.0"
] | null | null | null | check_commit.py | Cocopyth/foodshare | 1e997522b90bc11749265b7d31bea32a2bc03878 | [
"Apache-2.0"
] | 10 | 2020-03-26T14:53:29.000Z | 2021-06-10T17:21:53.000Z | check_commit.py | Cocopyth/foodshare | 1e997522b90bc11749265b7d31bea32a2bc03878 | [
"Apache-2.0"
] | null | null | null | """This script runs code quality checks on given Python files.
Note: This script assumes you use Poetry as your dependency manager.
Run the following in your terminal to get help on how to use this script:
```shell
poetry run python check_commit.py -h
```
"""
import argparse
import subprocess
from colorama import ... | 27.09434 | 78 | 0.605153 |
import argparse
import subprocess
from colorama import Fore, Style, deinit, init
def blue_bold(message: str) -> str:
return f'{Fore.BLUE}{Style.BRIGHT}{message}{Style.RESET_ALL}'
def light(message: str) -> str:
return f'{Style.DIM}{message}{Style.RESET_ALL}'
def run_task(task_message: str, command: str... | true | true |
790124d3352f34e789b4be873b4a669f51d97eff | 140 | py | Python | gunicorn.conf.py | ShiZhuming/StyleTransfer | cba2a3ceb733a2d129d52d4a3cac07c7651bd928 | [
"MIT"
] | 10 | 2020-05-28T05:31:15.000Z | 2021-04-12T20:15:26.000Z | gunicorn.conf.py | ShiZhuming/StyleTransfer | cba2a3ceb733a2d129d52d4a3cac07c7651bd928 | [
"MIT"
] | 4 | 2021-06-08T21:40:48.000Z | 2022-03-12T00:32:15.000Z | gunicorn.conf.py | ShiZhuming/StyleTransfer | cba2a3ceb733a2d129d52d4a3cac07c7651bd928 | [
"MIT"
] | 1 | 2020-05-31T11:12:08.000Z | 2020-05-31T11:12:08.000Z | workers = 1 # 定义同时开启的处理请求的进程数量,根据网站流量适当调整
worker_class = "gevent" # 采用gevent库,支持异步处理请求,提高吞吐量
# bind = "0.0.0.0:80"
bind = "0.0.0.0:80"
| 28 | 52 | 0.671429 | workers = 1
worker_class = "gevent"
bind = "0.0.0.0:80"
| true | true |
790124d82caa5f08062819b100e64f56b6ee4ca7 | 648 | py | Python | spotify_setup.py | Nomad95/spotify-leds | 2774a4a66c6e2a38950875d48047d52f6c8403a9 | [
"MIT"
] | 93 | 2018-11-12T21:38:45.000Z | 2022-03-31T05:46:02.000Z | spotify_setup.py | Georgej5/Colorfy | 69e8573840df6ac9090f346256157015166620cb | [
"MIT"
] | 12 | 2019-01-28T19:17:47.000Z | 2022-03-11T23:34:50.000Z | spotify_setup.py | Georgej5/Colorfy | 69e8573840df6ac9090f346256157015166620cb | [
"MIT"
] | 9 | 2019-10-21T00:10:30.000Z | 2021-05-18T04:46:49.000Z | """Script that generates a refresh token for a specific user."""
import os
import sys
import spotipy.util as util
import json
if len(sys.argv) == 2:
username = str(sys.argv[1])
else:
print('Usage: {} username'.format(sys.argv[0]))
sys.exit(1)
scope = 'user-read-currently-playing user-read-playback-state... | 24.923077 | 77 | 0.699074 | import os
import sys
import spotipy.util as util
import json
if len(sys.argv) == 2:
username = str(sys.argv[1])
else:
print('Usage: {} username'.format(sys.argv[0]))
sys.exit(1)
scope = 'user-read-currently-playing user-read-playback-state'
try:
util.prompt_for_user_token(username, scope)
except:
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.