hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70e4c2fe29ebf2e576c03a8585bad704902efc7 | 311 | py | Python | data/multilingual/Latn.DYU/Sun-ExtA_16/pdf_to_json_test_Latn.DYU_Sun-ExtA_16.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | 1 | 2021-09-19T19:47:35.000Z | 2021-09-19T19:47:35.000Z | data/multilingual/Latn.DYU/Sun-ExtA_16/pdf_to_json_test_Latn.DYU_Sun-ExtA_16.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | data/multilingual/Latn.DYU/Sun-ExtA_16/pdf_to_json_test_Latn.DYU_Sun-ExtA_16.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.DYU/Sun-ExtA_16/udhr_Latn.DYU_Sun-ExtA_16.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
| 31.1 | 81 | 0.810289 | import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.DYU/Sun-ExtA_16/udhr_Latn.DYU_Sun-ExtA_16.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
| true | true |
f70e4c34d702049e3912b90cf891e82d10d12876 | 10,527 | py | Python | apps/feedback/migrations/0001_initial.py | kharann/onlineweb4 | 1130128c6233b623780779a25934ea73ef62c264 | [
"MIT"
] | null | null | null | apps/feedback/migrations/0001_initial.py | kharann/onlineweb4 | 1130128c6233b623780779a25934ea73ef62c264 | [
"MIT"
] | null | null | null | apps/feedback/migrations/0001_initial.py | kharann/onlineweb4 | 1130128c6233b623780779a25934ea73ef62c264 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0001_initial'),
]
operations = [
migrations.Cre... | 50.855072 | 439 | 0.579082 |
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
n... | true | true |
f70e4c453bbc7c0990c154a50ba6951fff775a6c | 6,838 | py | Python | src/compas_tna/equilibrium/vertical_alglib.py | tkmmark/compas_tna | 1bf5eaf6d036ee56f5ea220f853a7c2cf5669a23 | [
"MIT"
] | null | null | null | src/compas_tna/equilibrium/vertical_alglib.py | tkmmark/compas_tna | 1bf5eaf6d036ee56f5ea220f853a7c2cf5669a23 | [
"MIT"
] | null | null | null | src/compas_tna/equilibrium/vertical_alglib.py | tkmmark/compas_tna | 1bf5eaf6d036ee56f5ea220f853a7c2cf5669a23 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from copy import deepcopy
from compas.geometry import cross_vectors
from compas.geometry import length_vector
from compas.geometry import centroid_points
from compas.geometry import norm_vector
from compas_tn... | 36.179894 | 124 | 0.569465 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from copy import deepcopy
from compas.geometry import cross_vectors
from compas.geometry import length_vector
from compas.geometry import centroid_points
from compas.geometry import norm_vector
from compas_tn... | true | true |
f70e4d3387f2085dc142f9ce4e01a1a6be716c23 | 726 | py | Python | mmdet/datasets/__init__.py | zehuichen123/mmdet1.0 | 6475512521fd2122dc5f26f5894b5444418d2b34 | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/__init__.py | zehuichen123/mmdet1.0 | 6475512521fd2122dc5f26f5894b5444418d2b34 | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/__init__.py | zehuichen123/mmdet1.0 | 6475512521fd2122dc5f26f5894b5444418d2b34 | [
"Apache-2.0"
] | null | null | null | from .builder import build_dataset
from .cityscapes import CityscapesDataset
from .coco import CocoDataset
from .custom import CustomDataset
from .dataset_wrappers import ConcatDataset, RepeatDataset
from .loader import DistributedGroupSampler, GroupSampler, build_dataloader
from .registry import DATASETS
from .voc imp... | 38.210526 | 77 | 0.807163 | from .builder import build_dataset
from .cityscapes import CityscapesDataset
from .coco import CocoDataset
from .custom import CustomDataset
from .dataset_wrappers import ConcatDataset, RepeatDataset
from .loader import DistributedGroupSampler, GroupSampler, build_dataloader
from .registry import DATASETS
from .voc imp... | true | true |
f70e5077767723b2b537b2820a3738772a0a8fef | 407 | py | Python | anuvaad-nmt-inference/src/utilities/logs_book.py | ManavTriesStuff/anuvaad | 6993e3ac78818c171c173ccf8acf962ff57856a4 | [
"MIT"
] | 15 | 2021-01-08T08:42:30.000Z | 2022-03-12T17:52:15.000Z | anuvaad-nmt-inference/src/utilities/logs_book.py | ManavTriesStuff/anuvaad | 6993e3ac78818c171c173ccf8acf962ff57856a4 | [
"MIT"
] | 16 | 2021-01-21T01:38:51.000Z | 2022-01-20T08:59:52.000Z | anuvaad-nmt-inference/src/utilities/logs_book.py | ManavTriesStuff/anuvaad | 6993e3ac78818c171c173ccf8acf962ff57856a4 | [
"MIT"
] | 25 | 2020-08-26T11:25:38.000Z | 2022-03-29T04:40:21.000Z | from anuvaad_auditor.loghandler import log_info, log_exception
from utilities import MODULE_CONTEXT
def logs_book(entity,value,message):
'''
Captures specific entity to keep track of logs at various level
'''
try:
log_info("{} || {} || {}".format(entity,value,message),MODULE_CONTEXT)
except Exception a... | 37 | 82 | 0.737101 | from anuvaad_auditor.loghandler import log_info, log_exception
from utilities import MODULE_CONTEXT
def logs_book(entity,value,message):
try:
log_info("{} || {} || {}".format(entity,value,message),MODULE_CONTEXT)
except Exception as e:
log_exception("Exception caught in logs_book {}".format(e),MODULE_C... | true | true |
f70e51374623076f0efdafbb77b9961fa7b81209 | 18,395 | py | Python | src/tests/ftest/util/job_manager_utils.py | marcelarosalesj/daos | a7f093db2fc96aa1dc20cc8c293d44274474ef62 | [
"Apache-2.0"
] | null | null | null | src/tests/ftest/util/job_manager_utils.py | marcelarosalesj/daos | a7f093db2fc96aa1dc20cc8c293d44274474ef62 | [
"Apache-2.0"
] | null | null | null | src/tests/ftest/util/job_manager_utils.py | marcelarosalesj/daos | a7f093db2fc96aa1dc20cc8c293d44274474ef62 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""
(C) Copyright 2020 Intel Corporation.
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... | 39.730022 | 80 | 0.623702 |
from distutils.spawn import find_executable
import os
from command_utils import ExecutableCommand
from command_utils_base import FormattedParameter, EnvironmentVariables
from env_modules import load_mpi
from write_host_file import write_host_file
class JobManager(ExecutableCommand):
def __init__(self, namespac... | true | true |
f70e529bae01351aa863b6a159b0cc7758a1f7e1 | 350 | py | Python | python/test/file/test_delete.py | takashiharano/util | 0f730475386a77415545de3f9763e5bdeaab0e94 | [
"MIT"
] | null | null | null | python/test/file/test_delete.py | takashiharano/util | 0f730475386a77415545de3f9763e5bdeaab0e94 | [
"MIT"
] | null | null | null | python/test/file/test_delete.py | takashiharano/util | 0f730475386a77415545de3f9763e5bdeaab0e94 | [
"MIT"
] | null | null | null | #!python
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
import util
def test_delete():
util.copy_file('a.txt', 'a.txt.bak')
util.copy_dir('d1', 'd1_bak')
util.delete('a.txt')
util.delete('d1', force=True)
return 'delete OK'
def main():
s = test_delete()
util.sen... | 16.666667 | 65 | 0.654286 |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
import util
def test_delete():
util.copy_file('a.txt', 'a.txt.bak')
util.copy_dir('d1', 'd1_bak')
util.delete('a.txt')
util.delete('d1', force=True)
return 'delete OK'
def main():
s = test_delete()
util.send_respon... | true | true |
f70e52e33e8eb656002dc0e41c237e79b192f927 | 3,176 | py | Python | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/version_mediatypes.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/version_mediatypes.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-iam/huaweicloudsdkiam/v3/model/version_mediatypes.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
class VersionMediatypes:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value ... | 23.352941 | 74 | 0.517317 |
import pprint
import re
import six
class VersionMediatypes:
sensitive_list = []
openapi_types = {
'type': 'str',
'base': 'str'
}
attribute_map = {
'type': 'type',
'base': 'base'
}
def __init__(self, type=None, base=None):
s... | true | true |
f70e531a27d48bac76c6ddf427824cdbb8af64aa | 1,069 | py | Python | mask.py | rpuntaie/tensorflow_examples | 1958f7f0de9d96859dc3961a1695e1543fec9fd3 | [
"MIT"
] | null | null | null | mask.py | rpuntaie/tensorflow_examples | 1958f7f0de9d96859dc3961a1695e1543fec9fd3 | [
"MIT"
] | null | null | null | mask.py | rpuntaie/tensorflow_examples | 1958f7f0de9d96859dc3961a1695e1543fec9fd3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Chain models.
Masking.
Show output of layer.
"""
import numpy as np
from tensorflow.keras import Input
from tensorflow.keras.layers import Masking, Dense
from tensorflow.keras.regularizers import l2
from tensorflow.keras.models import Sequential, Model
X_train = np.random.rand(4,3,2)
Den... | 29.694444 | 99 | 0.767072 |
import numpy as np
from tensorflow.keras import Input
from tensorflow.keras.layers import Masking, Dense
from tensorflow.keras.regularizers import l2
from tensorflow.keras.models import Sequential, Model
X_train = np.random.rand(4,3,2)
Dense_unit = 1
dense_reg = 0.01
mdl = Sequential()
mdl.add(Input(shape=(X_train.... | true | true |
f70e537d50a453e614d0bc400a333a26b7c92c3c | 921 | py | Python | abvdoceanic_commands/coverage.py | tihomirrangelov/abvdoceanic | a9c8415cd9c057768ded1c5a84c1aeafa3f28800 | [
"CC-BY-4.0"
] | 3 | 2021-11-23T14:29:13.000Z | 2022-01-20T13:54:07.000Z | abvdoceanic_commands/coverage.py | tihomirrangelov/abvdoceanic | a9c8415cd9c057768ded1c5a84c1aeafa3f28800 | [
"CC-BY-4.0"
] | 28 | 2021-08-24T09:14:01.000Z | 2022-02-08T00:27:21.000Z | abvdoceanic_commands/coverage.py | tihomirrangelov/abvdoceanic | a9c8415cd9c057768ded1c5a84c1aeafa3f28800 | [
"CC-BY-4.0"
] | 1 | 2021-11-23T14:45:50.000Z | 2021-11-23T14:45:50.000Z | """
Calculate coverage statistics, cf. https://github.com/lexibank/abvdoceanic/issues/3
"""
from pathlib import Path
from cltoolkit import Wordlist
from pycldf import Dataset
from pyclts import CLTS
from tabulate import tabulate
from cldfbench.cli_util import with_dataset, get_dataset
def run(args):
path = (Path... | 31.758621 | 106 | 0.695983 | from pathlib import Path
from cltoolkit import Wordlist
from pycldf import Dataset
from pyclts import CLTS
from tabulate import tabulate
from cldfbench.cli_util import with_dataset, get_dataset
def run(args):
path = (Path(__file__).parents[1]).joinpath("cldf/cldf-metadata.json")
bipa = CLTS().bipa
w... | true | true |
f70e53d513e07954b78f5a27628af49a2e2e4970 | 3,024 | py | Python | hail/python/hail/experimental/pca.py | MaxGreil/hail | 4e0605b6bfd24a885a8194e8c0984b20994d3407 | [
"MIT"
] | 789 | 2016-09-05T04:14:25.000Z | 2022-03-30T09:51:54.000Z | hail/python/hail/experimental/pca.py | MaxGreil/hail | 4e0605b6bfd24a885a8194e8c0984b20994d3407 | [
"MIT"
] | 5,724 | 2016-08-29T18:58:40.000Z | 2022-03-31T23:49:42.000Z | hail/python/hail/experimental/pca.py | MaxGreil/hail | 4e0605b6bfd24a885a8194e8c0984b20994d3407 | [
"MIT"
] | 233 | 2016-08-31T20:42:38.000Z | 2022-02-17T16:42:39.000Z | import hail as hl
from hail.typecheck import typecheck
from hail.expr.expressions import expr_call, expr_numeric, expr_array, \
check_entry_indexed, check_row_indexed
@typecheck(call_expr=expr_call,
loadings_expr=expr_array(expr_numeric),
af_expr=expr_numeric)
def pc_project(call_expr, loadi... | 40.864865 | 106 | 0.680886 | import hail as hl
from hail.typecheck import typecheck
from hail.expr.expressions import expr_call, expr_numeric, expr_array, \
check_entry_indexed, check_row_indexed
@typecheck(call_expr=expr_call,
loadings_expr=expr_array(expr_numeric),
af_expr=expr_numeric)
def pc_project(call_expr, loadi... | true | true |
f70e54dd341ecebf741e7b114aa11375cfce46e5 | 1,764 | py | Python | examples/demo_visdom_experiment.py | amitibo/experiment | bc8a7e854cd9be034572ea8ff0c259586a5422c2 | [
"MIT"
] | 1 | 2019-09-11T10:10:32.000Z | 2019-09-11T10:10:32.000Z | examples/demo_visdom_experiment.py | amitibo/experiment | bc8a7e854cd9be034572ea8ff0c259586a5422c2 | [
"MIT"
] | null | null | null | examples/demo_visdom_experiment.py | amitibo/experiment | bc8a7e854cd9be034572ea8ff0c259586a5422c2 | [
"MIT"
] | null | null | null | """
This demo shows how to use the `experiment` package to log both to `Visdom` and `mlflow`.
"""
from experiment import MLflowExperiment
from experiment import VisdomExperiment
from experiment.visdom import create_parameters_windows, Line, Window
import logging
import mlflow
from traitlets import Enum, Float, Int, Uni... | 27.5625 | 97 | 0.640023 | from experiment import MLflowExperiment
from experiment import VisdomExperiment
from experiment.visdom import create_parameters_windows, Line, Window
import logging
import mlflow
from traitlets import Enum, Float, Int, Unicode
import time
try:
from tqdm import trange
except ImportError:
trange = range
class ... | true | true |
f70e55dbe89c962de9cc4354da7961e013fd34fc | 30,518 | py | Python | bioptim/limits/penalty_option.py | pyomeca/BiorbdOptim | f07094668788d3e1b5e8cd1c65fbf0c7dc7cc978 | [
"Apache-2.0"
] | 10 | 2020-04-17T14:49:47.000Z | 2020-09-14T13:05:26.000Z | bioptim/limits/penalty_option.py | pyomeca/BiorbdOptim | f07094668788d3e1b5e8cd1c65fbf0c7dc7cc978 | [
"Apache-2.0"
] | 142 | 2020-04-08T14:41:43.000Z | 2020-09-30T00:55:00.000Z | bioptim/limits/penalty_option.py | pyomeca/BiorbdOptim | f07094668788d3e1b5e8cd1c65fbf0c7dc7cc978 | [
"Apache-2.0"
] | 14 | 2020-03-31T13:46:29.000Z | 2020-09-17T17:14:56.000Z | from typing import Any, Union, Callable
import biorbd_casadi as biorbd
from casadi import horzcat, vertcat, Function, MX, SX
import numpy as np
from .penalty_node import PenaltyNodeList
from ..misc.enums import Node, PlotType, ControlType, ConstraintType, IntegralApproximation
from ..misc.mapping import Mapping, BiMa... | 41.240541 | 121 | 0.587194 | from typing import Any, Union, Callable
import biorbd_casadi as biorbd
from casadi import horzcat, vertcat, Function, MX, SX
import numpy as np
from .penalty_node import PenaltyNodeList
from ..misc.enums import Node, PlotType, ControlType, ConstraintType, IntegralApproximation
from ..misc.mapping import Mapping, BiMa... | true | true |
f70e560b27463fa09c6fefb33e31c2f6bb6828e4 | 835 | py | Python | scripts/readwrite_uvfits.py | r-xue/pyuvdata | 667abc1a8a8a4fefd91f68a1cb15d4f62cd9fb60 | [
"BSD-2-Clause"
] | null | null | null | scripts/readwrite_uvfits.py | r-xue/pyuvdata | 667abc1a8a8a4fefd91f68a1cb15d4f62cd9fb60 | [
"BSD-2-Clause"
] | null | null | null | scripts/readwrite_uvfits.py | r-xue/pyuvdata | 667abc1a8a8a4fefd91f68a1cb15d4f62cd9fb60 | [
"BSD-2-Clause"
] | null | null | null | #! /usr/bin/env python
# -*- mode: python; coding: utf-8 -*
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
from __future__ import absolute_import, division, print_function
import argparse
import os.path as op
from pyuvdata import UVData
parser = argparse.ArgumentParser(... | 26.09375 | 74 | 0.738922 |
from __future__ import absolute_import, division, print_function
import argparse
import os.path as op
from pyuvdata import UVData
parser = argparse.ArgumentParser()
parser.add_argument('uvfits_read',
help='name of a uvfits file to read in')
parser.add_argument('uvfits_write',
... | true | true |
f70e56830340c81d7fe97d6bf66a3f2415082d1e | 4,378 | py | Python | vae_kits/classification.py | nerdslab/SwapVAE | f43e59c93d0b9f7f1de51a63e25b17b7be1da2d9 | [
"MIT"
] | 4 | 2021-11-08T14:16:24.000Z | 2021-11-16T02:45:22.000Z | vae_kits/classification.py | nerdslab/SwapVAE | f43e59c93d0b9f7f1de51a63e25b17b7be1da2d9 | [
"MIT"
] | null | null | null | vae_kits/classification.py | nerdslab/SwapVAE | f43e59c93d0b9f7f1de51a63e25b17b7be1da2d9 | [
"MIT"
] | null | null | null | import torch
from torch.utils.data import DataLoader, Dataset
from tqdm import tqdm
class Simple_Trans(Dataset):
def __init__(self, data, transform=None):
# [reps, labels]
self.reps = data[0]
self.labels = data[1]
# print(self.reps.shape, self.labels.shape) # torch.Size([60... | 37.741379 | 119 | 0.577661 | import torch
from torch.utils.data import DataLoader, Dataset
from tqdm import tqdm
class Simple_Trans(Dataset):
def __init__(self, data, transform=None):
self.reps = data[0]
self.labels = data[1]
.labels.shape[0]
def __getitem__(self, idx):
return self.reps... | true | true |
f70e58256eb73604bbd71fc2bd618101313f8262 | 911 | py | Python | py2map.py | bcgov/arcgis_hackers | 2895111c983f5dcb8f396053ef149f6afb59ff22 | [
"Apache-2.0"
] | 2 | 2019-11-28T22:25:29.000Z | 2019-11-29T16:59:37.000Z | py2map.py | bcgov/arcgis_hackers | 2895111c983f5dcb8f396053ef149f6afb59ff22 | [
"Apache-2.0"
] | 5 | 2020-04-06T18:11:26.000Z | 2021-06-14T22:07:16.000Z | py2map.py | bcgov/arcgis_hackers | 2895111c983f5dcb8f396053ef149f6afb59ff22 | [
"Apache-2.0"
] | 3 | 2019-11-28T21:48:39.000Z | 2019-11-29T17:30:21.000Z | # Import libraries
from arcgis import gis
import logging
import json
#carole was here again
#Kerry test
secrets = r"H:\secrets\maphub_config.json"
# this is one method to
def readConfig(configFile):
# returns list of parameters
# with key 'name'
"""
reads the config file to dictionary
"""
log... | 26.028571 | 68 | 0.63337 |
from arcgis import gis
import logging
import json
secrets = r"H:\secrets\maphub_config.json"
def readConfig(configFile):
logging.debug("Loading config")
with open(configFile) as json_file:
try:
d = json.load(json_file)
except:
print ("failed to parse con... | true | true |
f70e584084ec4a4dd15482b60eea56a3dc361679 | 701 | py | Python | test/test.py | nileshbhadana/bus_pass_qr | 0f0d6a4b90046f78bcb9dcfb3ba4aae4d2a639e3 | [
"MIT"
] | null | null | null | test/test.py | nileshbhadana/bus_pass_qr | 0f0d6a4b90046f78bcb9dcfb3ba4aae4d2a639e3 | [
"MIT"
] | null | null | null | test/test.py | nileshbhadana/bus_pass_qr | 0f0d6a4b90046f78bcb9dcfb3ba4aae4d2a639e3 | [
"MIT"
] | null | null | null | from datetime import datetime
from datetime import date
date_format = "%m/%d/%Y"
def comparedate(start,end,now):
a = datetime.strptime(start, date_format)
b = datetime.strptime(now, date_format)
c = datetime.strptime(end, date_format)
delta1 = b - a
delta2 = c - b
delta3 = a - a
days=c-a
... | 23.366667 | 68 | 0.634807 | from datetime import datetime
from datetime import date
date_format = "%m/%d/%Y"
def comparedate(start,end,now):
a = datetime.strptime(start, date_format)
b = datetime.strptime(now, date_format)
c = datetime.strptime(end, date_format)
delta1 = b - a
delta2 = c - b
delta3 = a - a
days=c-a
... | true | true |
f70e5876841994a9f7d8b28c2e998553ee7cb6b7 | 1,142 | py | Python | interpretation/instance_explanation.py | opennlp/Large-Scale-Text-Classification | a803c8d89357e5ec897031a41dda807d91f00431 | [
"Apache-2.0"
] | 6 | 2019-08-22T17:53:46.000Z | 2021-10-03T22:31:55.000Z | interpretation/instance_explanation.py | opennlp/Large-Scale-Text-Classification | a803c8d89357e5ec897031a41dda807d91f00431 | [
"Apache-2.0"
] | 5 | 2020-01-28T22:46:36.000Z | 2022-02-10T00:10:46.000Z | interpretation/instance_explanation.py | opennlp/Large-Scale-Text-Classification | a803c8d89357e5ec897031a41dda807d91f00431 | [
"Apache-2.0"
] | 1 | 2019-10-31T01:52:58.000Z | 2019-10-31T01:52:58.000Z | from factory import vectorizer_factory
from sklearn.base import TransformerMixin
from sklearn.pipeline import make_pipeline
from lime.lime_text import LimeTextExplainer
class VectorTransformer(TransformerMixin):
def __init__(self, vectorizer_name):
self.vectorizer_name = vectorizer_name
def fit(self,... | 40.785714 | 136 | 0.785464 | from factory import vectorizer_factory
from sklearn.base import TransformerMixin
from sklearn.pipeline import make_pipeline
from lime.lime_text import LimeTextExplainer
class VectorTransformer(TransformerMixin):
def __init__(self, vectorizer_name):
self.vectorizer_name = vectorizer_name
def fit(self,... | true | true |
f70e58d4595684e15f45a263614e1334d8fd661a | 618 | py | Python | tests.py | sd-personal/python-fsapi | 95625f6e72c705562bdda8dc0a3f6fbe62491091 | [
"Apache-2.0"
] | 13 | 2017-03-05T20:06:21.000Z | 2022-01-10T18:17:02.000Z | tests.py | sd-personal/python-fsapi | 95625f6e72c705562bdda8dc0a3f6fbe62491091 | [
"Apache-2.0"
] | 1 | 2021-05-31T11:23:46.000Z | 2021-05-31T11:23:46.000Z | tests.py | sd-personal/python-fsapi | 95625f6e72c705562bdda8dc0a3f6fbe62491091 | [
"Apache-2.0"
] | 5 | 2018-11-01T09:49:54.000Z | 2021-04-07T16:48:26.000Z | from fsapi import FSAPI
URL = 'http://192.168.1.39:80/device'
PIN = 1234
TIMEOUT = 1 # in seconds
fs = FSAPI(URL, PIN, TIMEOUT)
print('Name: %s' % fs.friendly_name)
print('Mute: %s' % fs.mute)
print('Mode: %s' % fs.mode)
print('Modes: %s' % fs.modes)
print('Power: %s' % fs.power)
print('Volume steps: %s' % fs.volume_... | 28.090909 | 45 | 0.671521 | from fsapi import FSAPI
URL = 'http://192.168.1.39:80/device'
PIN = 1234
TIMEOUT = 1
fs = FSAPI(URL, PIN, TIMEOUT)
print('Name: %s' % fs.friendly_name)
print('Mute: %s' % fs.mute)
print('Mode: %s' % fs.mode)
print('Modes: %s' % fs.modes)
print('Power: %s' % fs.power)
print('Volume steps: %s' % fs.volume_steps)
print... | true | true |
f70e5a005de147f99b04ea70b532322881ca88e9 | 1,645 | py | Python | apps/scheduler/migrations/0004_automatic.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | 1 | 2019-12-12T15:38:42.000Z | 2019-12-12T15:38:42.000Z | apps/scheduler/migrations/0004_automatic.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | null | null | null | apps/scheduler/migrations/0004_automatic.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.16 on 2020-10-27 09:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('organizations', '0017_add_organizationaltname'),
('scheduler', '0003_harvest'),
]
operations = [
m... | 31.634615 | 99 | 0.482675 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('organizations', '0017_add_organizationaltname'),
('scheduler', '0003_harvest'),
]
operations = [
migrations.CreateModel(
name='Automat... | true | true |
f70e5a0283b58b028f5a6e9cba0c104b321460e6 | 5,502 | py | Python | conda_tools/validate_ambertools_build.py | Amber-MD/ambertools-binary-build | 257f25cfbe829ee080807c6086d6edf8ec78c534 | [
"MIT"
] | 4 | 2018-12-02T19:43:52.000Z | 2019-12-14T01:15:50.000Z | conda_tools/validate_ambertools_build.py | Amber-MD/ambertools-binary-build | 257f25cfbe829ee080807c6086d6edf8ec78c534 | [
"MIT"
] | 15 | 2017-09-03T03:37:27.000Z | 2020-10-07T15:19:56.000Z | conda_tools/validate_ambertools_build.py | Amber-MD/ambertools-binary-build | 257f25cfbe829ee080807c6086d6edf8ec78c534 | [
"MIT"
] | 1 | 2021-06-01T19:18:54.000Z | 2021-06-01T19:18:54.000Z | import os
import sys
import subprocess
from contextlib import contextmanager
import argparse
import glob
ENV_ROOT = 'test_ambertools'
AMBER_VERSION = 'amber17'
def is_conda_package(package_dir):
basename = os.path.basename(package_dir)
return not (basename.startswith('osx') or basename.startswith('linux'))
... | 31.62069 | 88 | 0.60687 | import os
import sys
import subprocess
from contextlib import contextmanager
import argparse
import glob
ENV_ROOT = 'test_ambertools'
AMBER_VERSION = 'amber17'
def is_conda_package(package_dir):
basename = os.path.basename(package_dir)
return not (basename.startswith('osx') or basename.startswith('linux'))
... | true | true |
f70e5a9c959c949defa803e18501ce8ea7ae40db | 4,852 | py | Python | inspectors/inspections/models.py | codeforamerica/mdc-inspectors | d98b0adbcc2a036dbd205e8352ea82c2b4f70ead | [
"BSD-3-Clause"
] | null | null | null | inspectors/inspections/models.py | codeforamerica/mdc-inspectors | d98b0adbcc2a036dbd205e8352ea82c2b4f70ead | [
"BSD-3-Clause"
] | 11 | 2015-03-18T21:09:54.000Z | 2015-11-13T23:55:56.000Z | inspectors/inspections/models.py | codeforamerica/mdc-inspectors | d98b0adbcc2a036dbd205e8352ea82c2b4f70ead | [
"BSD-3-Clause"
] | 2 | 2016-09-28T20:11:13.000Z | 2021-04-16T09:48:40.000Z | # -*- coding: utf-8 -*-
import datetime as dt
from flask import json, render_template
from inspectors.database import (
Column,
db,
Model,
ReferenceCol,
relationship,
SurrogatePK,
)
REPR_DATE_FMT = "%Y/%m/%d"
class Supervisor(Model):
"""A person who supervises building inspectors"""
... | 35.15942 | 118 | 0.666117 |
import datetime as dt
from flask import json, render_template
from inspectors.database import (
Column,
db,
Model,
ReferenceCol,
relationship,
SurrogatePK,
)
REPR_DATE_FMT = "%Y/%m/%d"
class Supervisor(Model):
__tablename__ = 'supervisor'
id = Column(db.Integer, primary_key=True, i... | true | true |
f70e5b1893e09927587b51f59987d0be519b56bc | 69,337 | py | Python | pynput/_util/xorg_keysyms.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | pynput/_util/xorg_keysyms.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | pynput/_util/xorg_keysyms.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # coding: utf-8
# pynput
# Copyright (C) 2015-2017 Moses Palmér
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.... | 40.406177 | 79 | 0.590637 |
SYMBOLS = {
'0': (0x0030, u'\u0030'),
'1': (0x0031, u'\u0031'),
'2': (0x0032, u'\u0032'),
'3': (0x0033, u'\u0033'),
'4': (0x0034, u'\u0034'),
'5': (0x0035, u'\u0035'),
'6': (0x0036, u'\u0036'),
'7': (0x0037, u'\u0037'),
'8': (0x0038, u'\u0038'),
'9': (0x0039, u... | true | true |
f70e5c1fc57725b972d4c70aa38471da0feada9d | 7,663 | py | Python | contrib/devtools/update-translations.py | RulaiCoinOfficial/RulaiCoin | a9827e9a60398fd6b0dc2a4c2b9156822dda4b82 | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | RulaiCoinOfficial/RulaiCoin | a9827e9a60398fd6b0dc2a4c2b9156822dda4b82 | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | RulaiCoinOfficial/RulaiCoin | a9827e9a60398fd6b0dc2a4c2b9156822dda4b82 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the following... | 37.563725 | 124 | 0.629518 |
from __future__ import division, print_function
import subprocess
import re
import sys
import os
import io
import xml.etree.ElementTree as ET
TX = 'tx'
SOURCE_LANG = 'rulaicoin_en.ts'
LOCALE_DIR = 'src/qt/locale'
MIN_NUM_MESSAGES = 10
def check_at_repository_root():
if not os.path.exists('.git'):
... | true | true |
f70e5ee81cb8ebc95618de99cbe756d5130ddd42 | 1,084 | py | Python | backend/server/server/urls.py | vaastav/eTone | a544605c5d23d1d984385bb9c52a65d63f4bdd41 | [
"BSD-3-Clause"
] | null | null | null | backend/server/server/urls.py | vaastav/eTone | a544605c5d23d1d984385bb9c52a65d63f4bdd41 | [
"BSD-3-Clause"
] | null | null | null | backend/server/server/urls.py | vaastav/eTone | a544605c5d23d1d984385bb9c52a65d63f4bdd41 | [
"BSD-3-Clause"
] | null | null | null | from django.urls import re_path
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.views.generic.base import TemplateView
from eTone import views as eTone_views
urlpatterns = [
re_path(r'^admin... | 49.272727 | 108 | 0.723247 | from django.urls import re_path
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.views.generic.base import TemplateView
from eTone import views as eTone_views
urlpatterns = [
re_path(r'^admin... | true | true |
f70e6001c6e8bbc2822f4fade335783edc291c94 | 81,042 | py | Python | bin/Python27/Lib/site-packages/numpy/core/tests/test_regression.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/numpy/core/tests/test_regression.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/numpy/core/tests/test_regression.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | 1 | 2020-08-08T12:44:48.000Z | 2020-08-08T12:44:48.000Z | from __future__ import division, absolute_import, print_function
import copy
import pickle
import sys
import platform
import gc
import warnings
import tempfile
from os import path
from io import BytesIO
from itertools import chain
import numpy as np
from numpy.testing import (
run_module_suite,... | 37.039305 | 100 | 0.534229 | from __future__ import division, absolute_import, print_function
import copy
import pickle
import sys
import platform
import gc
import warnings
import tempfile
from os import path
from io import BytesIO
from itertools import chain
import numpy as np
from numpy.testing import (
run_module_suite,... | true | true |
f70e6024b2dca359c6fc19e8fcf99220204f8ff0 | 4,789 | py | Python | iam/api-client/service_accounts.py | spitfire55/python-docs-samples | b8fe0d1c5c9f7f5d27965fa3367117af7b1f0aed | [
"Apache-2.0"
] | 2 | 2021-08-04T19:13:44.000Z | 2021-10-04T02:47:49.000Z | iam/api-client/service_accounts.py | spitfire55/python-docs-samples | b8fe0d1c5c9f7f5d27965fa3367117af7b1f0aed | [
"Apache-2.0"
] | 16 | 2019-06-15T00:02:56.000Z | 2021-03-25T23:22:38.000Z | iam/api-client/service_accounts.py | spitfire55/python-docs-samples | b8fe0d1c5c9f7f5d27965fa3367117af7b1f0aed | [
"Apache-2.0"
] | 3 | 2019-02-11T16:16:11.000Z | 2019-04-19T21:34:37.000Z | #!/usr/bin/env python
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 32.358108 | 77 | 0.714763 |
import argparse
import os
from google.oauth2 import service_account
import googleapiclient.discovery
credentials = service_account.Credentials.from_service_account_file(
filename=os.environ['GOOGLE_APPLICATION_CREDENTIALS'],
scopes=['https://www.googleapis.com/auth/cloud-platform'])
service =... | true | true |
f70e605a9b7b1d4f556bebfdbfcfab62eff3b350 | 13,942 | py | Python | google/cloud/aiplatform_v1/types/model_monitoring.py | nayaknishant/python-aiplatform | 309b3b9d1688a62b0c60aada1e7de1d131fb163e | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | google/cloud/aiplatform_v1/types/model_monitoring.py | xxxtrillionarie/GCP_MLOps_VertexAI_Workshop | d0d719c0bf557b908eb63f3a245db2f47b136eb3 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/types/model_monitoring.py | xxxtrillionarie/GCP_MLOps_VertexAI_Workshop | d0d719c0bf557b908eb63f3a245db2f47b136eb3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 41.494048 | 196 | 0.650194 |
import proto
from google.cloud.aiplatform_v1.types import io
__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1",
manifest={
"ModelMonitoringObjectiveConfig",
"ModelMonitoringAlertConfig",
"ThresholdConfig",
"SamplingStrategy",
},
)
class M... | true | true |
f70e626b197d9671f25dc95c8c5f3139f5a71216 | 1,892 | py | Python | APIs/management/management/models/price_policies.py | matteyeux/MyBookingServices | ce6ec906b3a58da16e1f066b9af290fb7e8b82d3 | [
"MIT"
] | null | null | null | APIs/management/management/models/price_policies.py | matteyeux/MyBookingServices | ce6ec906b3a58da16e1f066b9af290fb7e8b82d3 | [
"MIT"
] | 3 | 2022-02-26T16:50:12.000Z | 2022-02-26T16:50:12.000Z | APIs/management/management/models/price_policies.py | matteyeux/MyBookingServices | ce6ec906b3a58da16e1f066b9af290fb7e8b82d3 | [
"MIT"
] | null | null | null | from management.config import config_api_setup
from management.database import Database
class Price_Policies:
"""price_policies class model."""
def __init__(self):
config, config_file = config_api_setup()
config.read(config_file)
self.db = Database(
connector=config['datab... | 32.067797 | 77 | 0.615751 | from management.config import config_api_setup
from management.database import Database
class Price_Policies:
def __init__(self):
config, config_file = config_api_setup()
config.read(config_file)
self.db = Database(
connector=config['database']['connector'],
user=c... | true | true |
f70e629e0338f11ac63f50cf68a8876bd76eb254 | 33,502 | py | Python | BootloaderCorePkg/Tools/IfwiUtility.py | elCaxper/slimbootloader | 558719ed4185d71af358723cd2c53f4fde59200b | [
"BSD-2-Clause-NetBSD",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"MIT",
"BSD-2-Clause-Patent"
] | 1 | 2020-03-06T18:45:06.000Z | 2020-03-06T18:45:06.000Z | BootloaderCorePkg/Tools/IfwiUtility.py | pchand20/slimbootloader | e5f2a61227f5ebb0cb7e2fb54c939521a95185be | [
"BSD-2-Clause-NetBSD",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"MIT",
"BSD-2-Clause-Patent"
] | null | null | null | BootloaderCorePkg/Tools/IfwiUtility.py | pchand20/slimbootloader | e5f2a61227f5ebb0cb7e2fb54c939521a95185be | [
"BSD-2-Clause-NetBSD",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"MIT",
"BSD-2-Clause-Patent"
] | null | null | null | ## @ ifwi_utility.py
#
# copyright (c) 2019, intel corporation. all rights reserved.<BR>
# SPDX-license-identifier: BSD-2-clause-patent
#
##
import sys
import os
import argparse
from ctypes import Structure, c_char, c_uint32, c_uint8, c_uint64, c_uint16, sizeof, ARRAY
sys.dont_write_bytecode = True
from ... | 37.558296 | 150 | 0.537371 | rt os
import argparse
from ctypes import Structure, c_char, c_uint32, c_uint8, c_uint64, c_uint16, sizeof, ARRAY
sys.dont_write_bytecode = True
from CommonUtility import *
class UCODE_HEADER (Structure):
_pack_ = 1
_fields_ = [
('header_version', c_uint32),
('update_revision', ... | true | true |
f70e636cc93d0ba8add8606221d87d0f1f3b434d | 158,825 | py | Python | core/domain/exp_domain.py | tjinjoy/oppia | ed5ccbd95e42078457d40dde1dda02f1ae6a4354 | [
"Apache-2.0"
] | 1 | 2020-03-09T20:25:20.000Z | 2020-03-09T20:25:20.000Z | core/domain/exp_domain.py | tjinjoy/oppia | ed5ccbd95e42078457d40dde1dda02f1ae6a4354 | [
"Apache-2.0"
] | null | null | null | core/domain/exp_domain.py | tjinjoy/oppia | ed5ccbd95e42078457d40dde1dda02f1ae6a4354 | [
"Apache-2.0"
] | 1 | 2021-07-05T08:27:31.000Z | 2021-07-05T08:27:31.000Z | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 40.423772 | 101 | 0.62159 |
from __future__ import absolute_import
from __future__ import unicode_literals
import collections
import copy
import functools
import re
import string
from constants import constants
from core.domain import change_domain
from core.domain import html_validation_service
from core.domain import inte... | true | true |
f70e640ff57f2e199fac15fbee0fe2c1a0c1d44c | 2,362 | py | Python | src/api/infrastructure/utils/TypeChecker.py | PythonDataIntegrator/pythondataintegrator | 6167778c36c2295e36199ac0d4d256a4a0c28d7a | [
"MIT"
] | 14 | 2020-12-19T15:06:13.000Z | 2022-01-12T19:52:17.000Z | src/process/infrastructure/utils/TypeChecker.py | PythonDataIntegrator/pythondataintegrator | 6167778c36c2295e36199ac0d4d256a4a0c28d7a | [
"MIT"
] | 43 | 2021-01-06T22:05:22.000Z | 2022-03-10T10:30:30.000Z | src/api/infrastructure/utils/TypeChecker.py | PythonDataIntegrator/pythondataintegrator | 6167778c36c2295e36199ac0d4d256a4a0c28d7a | [
"MIT"
] | 4 | 2020-12-18T23:10:09.000Z | 2021-04-02T13:03:12.000Z | import inspect
import typing
from abc import ABC
import builtins
def get_builtins():
return list(filter(lambda x: not x.startswith('_'), dir(builtins)))
class ITypeChecker(ABC):
def is_class(self, obj):
if inspect.isclass(obj) and not self.is_primitive(obj):
return True
return Fals... | 31.493333 | 104 | 0.6105 | import inspect
import typing
from abc import ABC
import builtins
def get_builtins():
return list(filter(lambda x: not x.startswith('_'), dir(builtins)))
class ITypeChecker(ABC):
def is_class(self, obj):
if inspect.isclass(obj) and not self.is_primitive(obj):
return True
return Fals... | true | true |
f70e6504b34ede4431d9f6dba0a2d13af19fdc1f | 4,111 | py | Python | torchbearer/callbacks/weight_decay.py | NunoEdgarGFlowHub/torchbearer | d2b21b8ffcabde5b505cb1c736e05af6ee4276ca | [
"MIT"
] | 358 | 2018-07-23T13:30:38.000Z | 2019-06-02T07:18:35.000Z | torchbearer/callbacks/weight_decay.py | Jayaudaykmar26589/torchbearer | 940e75ec88acd59d5a97aa8c721f7cfa30a5c4d0 | [
"MIT"
] | 307 | 2018-07-18T12:07:23.000Z | 2019-06-03T18:00:27.000Z | torchbearer/callbacks/weight_decay.py | Jayaudaykmar26589/torchbearer | 940e75ec88acd59d5a97aa8c721f7cfa30a5c4d0 | [
"MIT"
] | 42 | 2018-07-23T22:49:23.000Z | 2019-05-20T07:22:55.000Z | import torchbearer
from torchbearer.callbacks import Callback
import torch
class WeightDecay(Callback):
"""Create a WeightDecay callback which uses the given norm on the given parameters and with the given decay rate.
If params is None (default) then the parameters will be retrieved from the model.
Exa... | 38.420561 | 118 | 0.660667 | import torchbearer
from torchbearer.callbacks import Callback
import torch
class WeightDecay(Callback):
def __init__(self, rate=5e-4, p=2, params=None):
super(WeightDecay, self).__init__()
self.p = p
self.params = params
self.rate = rate
def on_start(self, state):
i... | true | true |
f70e66436004fe64956beafef93e490f825f93b5 | 620 | py | Python | pycuber/formula/__init__.py | GProulx/PyCuber | e44b5ba48c831b964ce73d046fb813222771853f | [
"MIT"
] | 199 | 2015-01-16T15:28:37.000Z | 2022-03-19T10:59:59.000Z | pycuber/formula/__init__.py | user4194304/PyCuber | e44b5ba48c831b964ce73d046fb813222771853f | [
"MIT"
] | 15 | 2015-04-27T09:03:41.000Z | 2020-06-25T05:43:58.000Z | pycuber/formula/__init__.py | user4194304/PyCuber | e44b5ba48c831b964ce73d046fb813222771853f | [
"MIT"
] | 63 | 2015-01-16T15:28:39.000Z | 2022-02-06T15:17:37.000Z | """
This module implements the Rubik's Cube formulae.
You can deal with Rubik's Cube formulae easily with Step and Formula.
Usage:
>>> a = Formula("R U R' U'")
>>> a
R U R' U'
>>> a.reverse()
>>> a
U R U' R'
>>> a.mirror()
>>> a
U' L' U L
>>> a *= 3
>>> a
U' L' U L U... | 16.315789 | 72 | 0.596774 |
from .move import GenericCubicMove, Move
from .formula import BaseFormula
class GenericCubicFormula(BaseFormula):
_move = GenericCubicMove
class Formula(GenericCubicFormula):
_move = Move
__all__ = ["GenericCubicMove", "Move", "GenericCubicFormula", "Formula"]
| true | true |
f70e6750b3bd4232985e5be14230f71621be3548 | 4,614 | py | Python | docs/conf.py | musevlt/muse-psfr | 9d3073eb03958ef0d034024bda006d7923fe25d1 | [
"MIT"
] | 7 | 2020-04-03T03:35:34.000Z | 2022-01-28T08:36:26.000Z | docs/conf.py | musevlt/muse-psfr | 9d3073eb03958ef0d034024bda006d7923fe25d1 | [
"MIT"
] | 5 | 2019-07-10T10:35:16.000Z | 2022-01-28T08:55:58.000Z | docs/conf.py | musevlt/muse-psfr | 9d3073eb03958ef0d034024bda006d7923fe25d1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative t... | 33.926471 | 79 | 0.676853 |
import os
from pkg_resources import get_distribution
project = 'muse-psfr'
copyright = '2019, Simon Conseil, Thierry Fusco'
author = 'Simon Conseil, Thierry Fusco'
release = get_distribution('muse_psfr').version
version = '.'.join(release.split('.')[:2])
extensions = [
'sphinx.ext.autodo... | true | true |
f70e677c49324c16eaba56141008b055793a83f9 | 2,747 | py | Python | azure-mgmt-iothub/azure/mgmt/iothub/models/fallback_route_properties_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-iothub/azure/mgmt/iothub/models/fallback_route_properties_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-iothub/azure/mgmt/iothub/models/fallback_route_properties_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # 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 ... | 41 | 115 | 0.642883 |
from msrest.serialization import Model
class FallbackRouteProperties(Model):
_validation = {
'source': {'required': True, 'constant': True},
'endpoint_names': {'required': True, 'max_items': 1, 'min_items': 1},
'is_enabled': {'required': True},
}
_attribute_map = {
... | true | true |
f70e6c23df226e4dd5d608ce618be8bfbb651b5a | 15,838 | py | Python | scrapbook/models.py | datalayer-externals/papermill-scrapbook | 911220a26c7f6606f6370a75a4cdac4284675bdc | [
"BSD-3-Clause"
] | null | null | null | scrapbook/models.py | datalayer-externals/papermill-scrapbook | 911220a26c7f6606f6370a75a4cdac4284675bdc | [
"BSD-3-Clause"
] | null | null | null | scrapbook/models.py | datalayer-externals/papermill-scrapbook | 911220a26c7f6606f6370a75a4cdac4284675bdc | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
models.py
Provides the various model wrapper objects for scrapbook
"""
from __future__ import unicode_literals
import os
import copy
import nbformat
import collections
import pandas as pd
from six import string_types
from collections import OrderedDict
from IPython.display import display a... | 34.962472 | 91 | 0.585364 |
from __future__ import unicode_literals
import os
import copy
import nbformat
import collections
import pandas as pd
from six import string_types
from collections import OrderedDict
from IPython.display import display as ip_display, Markdown
from papermill.iorw import papermill_io
from .scraps import Scrap, Scraps... | true | true |
f70e6ce034084b406d80a86d7d684a4fc9a35da2 | 3,021 | py | Python | labellab-flask/api/config.py | darkshredder/LabelLab | fc762e6eea52b9023e38ba5f32bbcaa7cbc17dbe | [
"Apache-2.0"
] | null | null | null | labellab-flask/api/config.py | darkshredder/LabelLab | fc762e6eea52b9023e38ba5f32bbcaa7cbc17dbe | [
"Apache-2.0"
] | null | null | null | labellab-flask/api/config.py | darkshredder/LabelLab | fc762e6eea52b9023e38ba5f32bbcaa7cbc17dbe | [
"Apache-2.0"
] | null | null | null | import os
basedir = os.path.abspath(os.path.dirname(__file__))
imagesdir = os.path.join(os.path.dirname(basedir),'uploads')
"""Constants used throughout the application.
All hard coded settings/data that are not actual/official configuration
options for Flask and their extensions goes here.
"""
class Confi... | 28.5 | 79 | 0.689507 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
imagesdir = os.path.join(os.path.dirname(basedir),'uploads')
class Config:
SECRET_KEY = os.environ.get("SECRET_KEY") or "big secret"
JWT_SECRET_KEY = os.environ.get("SECRET_KEY") or "very big secret"
JWT_BLACKLIST_ENABLED = True
JWT_BLA... | true | true |
f70e6cea1508fd9cd1189f9bc8b0a18aa1932be1 | 30,400 | py | Python | haruhi_dl/extractor/soundcloud.py | haruhi-dl/haruhi-dl | 0526e2add4c263209cad55347efa9a2dfe6c3fa6 | [
"Unlicense"
] | 32 | 2021-01-18T03:52:17.000Z | 2022-02-17T20:43:39.000Z | haruhi_dl/extractor/soundcloud.py | haruhi-dl/haruhi-dl | 0526e2add4c263209cad55347efa9a2dfe6c3fa6 | [
"Unlicense"
] | 12 | 2021-02-06T08:12:08.000Z | 2021-12-11T23:17:41.000Z | haruhi_dl/extractor/soundcloud.py | haruhi-dl/haruhi-dl | 0526e2add4c263209cad55347efa9a2dfe6c3fa6 | [
"Unlicense"
] | 6 | 2021-01-29T16:46:31.000Z | 2022-01-20T18:40:03.000Z | # coding: utf-8
from __future__ import unicode_literals
import itertools
import re
from .common import (
InfoExtractor,
SearchInfoExtractor
)
from ..compat import (
compat_HTTPError,
compat_kwargs,
compat_str,
compat_urlparse,
)
from ..utils import (
error_to_compat_str,
ExtractorError... | 36.848485 | 195 | 0.512895 |
from __future__ import unicode_literals
import itertools
import re
from .common import (
InfoExtractor,
SearchInfoExtractor
)
from ..compat import (
compat_HTTPError,
compat_kwargs,
compat_str,
compat_urlparse,
)
from ..utils import (
error_to_compat_str,
ExtractorError,
float_or_... | true | true |
f70e6d17b312d21daf3dc51a3cf5d18c7569db1b | 2,716 | py | Python | pyvizio/api/input.py | jezzab/pyvizio | 8086f9e5aac49d1d99ade02684ca35c05e03a7eb | [
"MIT"
] | 72 | 2017-08-08T19:32:12.000Z | 2022-03-18T03:18:41.000Z | pyvizio/api/input.py | raman325/pyvizio | 9cf45fcc9b409caf223a38d8f79c775742ab4127 | [
"MIT"
] | 48 | 2017-09-16T16:37:54.000Z | 2022-01-23T20:43:42.000Z | pyvizio/api/input.py | ConnectionMaster/pyvizio | 0fe4558557917509d3da3bb24f9221f15ba901ce | [
"MIT"
] | 42 | 2017-09-04T22:59:21.000Z | 2022-03-18T03:18:30.000Z | """Vizio SmartCast API commands and class for device inputs."""
from typing import Any, Dict, List, Optional
from pyvizio.api._protocol import ResponseKey
from pyvizio.api.item import Item, ItemCommandBase, ItemInfoCommandBase
from pyvizio.helpers import dict_get_case_insensitive
class InputItem(Item):
"""Input... | 34.820513 | 88 | 0.66863 |
from typing import Any, Dict, List, Optional
from pyvizio.api._protocol import ResponseKey
from pyvizio.api.item import Item, ItemCommandBase, ItemInfoCommandBase
from pyvizio.helpers import dict_get_case_insensitive
class InputItem(Item):
def __init__(self, json_item: Dict[str, Any], is_extended_metadata: boo... | true | true |
f70e6d3b54d5729214ad78d9c6c264c66426fed5 | 7,433 | py | Python | pretrained_yolo_video_nms.py | PacktPublishing/Computer-Vision-YOLO-Custom-Object-Detection-with-Colab-GPU | f90db3c5f3326d89282f249ede92234812c824a5 | [
"MIT"
] | 13 | 2020-11-22T04:27:12.000Z | 2022-03-18T12:40:24.000Z | pretrained_yolo_video_nms.py | PacktPublishing/Computer-Vision-YOLO-Custom-Object-Detection-with-Colab-GPU | f90db3c5f3326d89282f249ede92234812c824a5 | [
"MIT"
] | null | null | null | pretrained_yolo_video_nms.py | PacktPublishing/Computer-Vision-YOLO-Custom-Object-Detection-with-Colab-GPU | f90db3c5f3326d89282f249ede92234812c824a5 | [
"MIT"
] | 4 | 2020-11-28T00:59:11.000Z | 2021-04-15T13:07:05.000Z | # -*- coding: utf-8 -*-
"""
@author: abhilash
"""
import numpy as np
import cv2
#get the webcam video stream
file_video_stream = cv2.VideoCapture('images/testing/video_sample2.mp4')
#create a while loop
while (file_video_stream.isOpened):
#get the current frame from video stream
ret,current_frame = file_v... | 49.885906 | 140 | 0.643213 |
import numpy as np
import cv2
file_video_stream = cv2.VideoCapture('images/testing/video_sample2.mp4')
while (file_video_stream.isOpened):
ret,current_frame = file_video_stream.read()
img_to_detect = current_frame
img_height = img_to_detect.shape[0]
img_width = img_to_detect.shape[1]
... | true | true |
f70e6e19cad25931f27d370c5040ea4e220d6c1f | 4,110 | py | Python | test/SWIG/build-dir.py | edobez/scons | 722228995b223b4507ebb686b48f94b9f7a8380c | [
"MIT"
] | 1 | 2020-03-21T05:24:47.000Z | 2020-03-21T05:24:47.000Z | test/SWIG/build-dir.py | edobez/scons | 722228995b223b4507ebb686b48f94b9f7a8380c | [
"MIT"
] | null | null | null | test/SWIG/build-dir.py | edobez/scons | 722228995b223b4507ebb686b48f94b9f7a8380c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | 23.485714 | 73 | 0.620925 |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import sys
import TestSCons
test = TestSCons.TestSCons()
swig = test.where_is('swig')
if not swig:
test.skip_test('Can not find installed "swig", skipping test.\n')
if sys.platform == 'win32':
_dll = '.dll'
else:
_d... | true | true |
f70e6ffe4bd6a7cab1de31500ffcd8a96aa8619d | 3,670 | py | Python | app.py | ishaiqbal/sqlalchemy-challenge- | 5b2b7bbb954e371bd1777b5cb04bfb22d7a5a25c | [
"ADSL"
] | null | null | null | app.py | ishaiqbal/sqlalchemy-challenge- | 5b2b7bbb954e371bd1777b5cb04bfb22d7a5a25c | [
"ADSL"
] | null | null | null | app.py | ishaiqbal/sqlalchemy-challenge- | 5b2b7bbb954e371bd1777b5cb04bfb22d7a5a25c | [
"ADSL"
] | null | null | null | import numpy as np
import datetime as dt
import pandas as pd
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func, inspect
from flask import Flask, jsonify
#################################################
# Database Setup
##... | 25.310345 | 105 | 0.607629 | import numpy as np
import datetime as dt
import pandas as pd
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func, inspect
from flask import Flask, jsonify
| true | true |
f70e706b1c94a862f081f20ddd99856f7b574201 | 5,532 | py | Python | scripts/combine_ne_terms.py | sarapapi/FBK-fairseq-ST | 33f381937c1589602944da8cf39e533802d283ca | [
"MIT"
] | 11 | 2021-02-28T23:33:18.000Z | 2022-02-11T20:42:18.000Z | scripts/combine_ne_terms.py | sarapapi/FBK-fairseq-ST | 33f381937c1589602944da8cf39e533802d283ca | [
"MIT"
] | 1 | 2021-05-21T08:08:19.000Z | 2021-06-30T12:28:55.000Z | scripts/combine_ne_terms.py | sarapapi/FBK-fairseq-ST | 33f381937c1589602944da8cf39e533802d283ca | [
"MIT"
] | 5 | 2021-03-15T02:05:38.000Z | 2022-02-14T09:20:20.000Z | #!/usr/bin/python3
# Copyright 2021 FBK
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in w... | 43.904762 | 112 | 0.534526 |
import sys
ner_detected_fn = sys.argv[1]
term_detected_fn = sys.argv[2]
def select_type(types):
if types[-1] != "O":
return types[-1]
return sorted(types, key=types.count, reverse=True)[0]
NER_BUFFER = []
NER_TYPES_BUFFER = []
term_line = None
prev_type = None
l_idx... | true | true |
f70e710cea24b57d7df19d030b342a41f91bdc2a | 5,400 | py | Python | oemof_examples/tespy/heat_pump/heat_pump_water.py | ekatef/oemof-examples | f16511d20008c30889a6e75a788a3a1a0bc632c2 | [
"MIT"
] | 28 | 2018-11-10T12:14:04.000Z | 2022-01-14T00:01:09.000Z | oemof_examples/tespy/heat_pump/heat_pump_water.py | ekatef/oemof-examples | f16511d20008c30889a6e75a788a3a1a0bc632c2 | [
"MIT"
] | 28 | 2018-11-08T06:58:06.000Z | 2022-02-22T18:58:17.000Z | oemof_examples/tespy/heat_pump/heat_pump_water.py | oemof/examples | 4805d5cef03141a917fd8a9e1141acfa8cc9d781 | [
"MIT"
] | 55 | 2018-11-09T09:50:36.000Z | 2022-03-08T10:31:02.000Z | # -*- coding: utf-8 -*-
from tespy.networks import Network
from tespy.components import (
Sink, Source, Splitter, Compressor, Condenser, Pump, HeatExchangerSimple,
Valve, Drum, HeatExchanger, CycleCloser
)
from tespy.connections import Connection, Ref
from tespy.tools.characteristics import CharLine
from tespy.... | 26.470588 | 79 | 0.67037 |
from tespy.networks import Network
from tespy.components import (
Sink, Source, Splitter, Compressor, Condenser, Pump, HeatExchangerSimple,
Valve, Drum, HeatExchanger, CycleCloser
)
from tespy.connections import Connection, Ref
from tespy.tools.characteristics import CharLine
from tespy.tools.characteristics i... | true | true |
f70e718a2ce8586a91edef27443aaaf40816e0fb | 910 | py | Python | scripts/list_tests.py | hbmartin/pex | a4c5d96e16dac892a6d84b02bdb3c0b8e14e9e1b | [
"Apache-2.0"
] | null | null | null | scripts/list_tests.py | hbmartin/pex | a4c5d96e16dac892a6d84b02bdb3c0b8e14e9e1b | [
"Apache-2.0"
] | 1 | 2020-03-02T14:52:32.000Z | 2020-03-02T14:52:32.000Z | scripts/list_tests.py | hbmartin/pex | a4c5d96e16dac892a6d84b02bdb3c0b8e14e9e1b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import absolute_import, print_function
import sys
import pytest
class Collector(object):
RUN_INDIVIDUALLY = ['tests/test_pex.py']
def __init__(self):
self._collected = set()
def iter_collected(self):
for collected in sorted(self._collected):
yield collect... | 22.75 | 72 | 0.70989 |
from __future__ import absolute_import, print_function
import sys
import pytest
class Collector(object):
RUN_INDIVIDUALLY = ['tests/test_pex.py']
def __init__(self):
self._collected = set()
def iter_collected(self):
for collected in sorted(self._collected):
yield collected
def pytest_coll... | true | true |
f70e727f4e717264e86bbe1a91c9c30f9e0495d9 | 126 | py | Python | testwebsite/music/views.py | omar2535/Django | 9faf368deee5324593ab87f9960e2e72433e2fae | [
"Unlicense"
] | null | null | null | testwebsite/music/views.py | omar2535/Django | 9faf368deee5324593ab87f9960e2e72433e2fae | [
"Unlicense"
] | null | null | null | testwebsite/music/views.py | omar2535/Django | 9faf368deee5324593ab87f9960e2e72433e2fae | [
"Unlicense"
] | null | null | null | from django.http import HttpResponse
def index(request):
return HttpResponse("<h1> This is the music app homepage </h1>") | 31.5 | 68 | 0.746032 | from django.http import HttpResponse
def index(request):
return HttpResponse("<h1> This is the music app homepage </h1>") | true | true |
f70e72a5746bda4d7bb7acc83ae166af7c7d441f | 461 | py | Python | nlp_tasks/bert_keras/tokenizer.py | l294265421/AC-MIMLLN | f62e71a1d7f3f6a6d2c3ec469570a171db4300a4 | [
"MIT"
] | 21 | 2020-12-12T01:54:56.000Z | 2021-12-14T12:26:51.000Z | nlp_tasks/bert_keras/tokenizer.py | l294265421/AC-MIMLLN | f62e71a1d7f3f6a6d2c3ec469570a171db4300a4 | [
"MIT"
] | 1 | 2021-09-27T03:07:22.000Z | 2021-09-28T08:22:59.000Z | nlp_tasks/bert_keras/tokenizer.py | l294265421/AC-MIMLLN | f62e71a1d7f3f6a6d2c3ec469570a171db4300a4 | [
"MIT"
] | 4 | 2020-12-30T13:40:37.000Z | 2021-12-05T09:30:50.000Z | # -*- coding: utf-8 -*-
from keras_bert import Tokenizer
class TokenizerReturningSpace(Tokenizer):
"""
"""
def _tokenize(self, text):
R = []
for c in text:
if c in self._token_dict:
R.append(c)
elif self._is_space(c):
R.append('[un... | 16.464286 | 41 | 0.481562 |
from keras_bert import Tokenizer
class TokenizerReturningSpace(Tokenizer):
def _tokenize(self, text):
R = []
for c in text:
if c in self._token_dict:
R.append(c)
elif self._is_space(c):
R.append('[unused1]')
else:
... | true | true |
f70e72a99e7f795d6d8542bc5c90c038e0e7a260 | 2,287 | py | Python | python/app/plugins/http/Spring/CVE_2017_8046.py | taomujian/linbing | fe772a58f41e3b046b51a866bdb7e4655abaf51a | [
"MIT"
] | 351 | 2020-02-26T05:23:26.000Z | 2022-03-26T12:39:19.000Z | python/app/plugins/http/Spring/CVE_2017_8046.py | taomujian/linbing | fe772a58f41e3b046b51a866bdb7e4655abaf51a | [
"MIT"
] | 15 | 2020-03-26T07:31:49.000Z | 2022-03-09T02:12:17.000Z | python/app/plugins/http/Spring/CVE_2017_8046.py | taomujian/linbing | fe772a58f41e3b046b51a866bdb7e4655abaf51a | [
"MIT"
] | 99 | 2020-02-28T07:30:46.000Z | 2022-03-16T16:41:09.000Z | #!/usr/bin/env python3
import json
from app.lib.utils.request import request
from app.lib.utils.common import get_useragent
class CVE_2017_8046_BaseVerify:
def __init__(self, url):
self.info = {
'name': 'CVE-2017-8046漏洞',
'description': 'CVE-2017-8046漏洞可执行任意命令,执行的命令:/usr/bin/touch ... | 37.491803 | 285 | 0.561434 |
import json
from app.lib.utils.request import request
from app.lib.utils.common import get_useragent
class CVE_2017_8046_BaseVerify:
def __init__(self, url):
self.info = {
'name': 'CVE-2017-8046漏洞',
'description': 'CVE-2017-8046漏洞可执行任意命令,执行的命令:/usr/bin/touch ./test.jsp,利用小葵转ascii转... | true | true |
f70e731275152330c9d2b4e3db53efa6815f1418 | 2,289 | py | Python | examples/benchmark_problems/scripts/generate_simulated_mantid.py | fitbenchmarking/fitbenchmarking | ea398efa61f071dc64fe7c3b484d5bb4e1897856 | [
"BSD-3-Clause"
] | 6 | 2019-07-22T01:56:10.000Z | 2021-12-10T05:29:30.000Z | examples/benchmark_problems/scripts/generate_simulated_mantid.py | fitbenchmarking/fitbenchmarking | ea398efa61f071dc64fe7c3b484d5bb4e1897856 | [
"BSD-3-Clause"
] | 677 | 2019-04-29T10:23:49.000Z | 2022-03-22T12:01:30.000Z | examples/benchmark_problems/scripts/generate_simulated_mantid.py | fitbenchmarking/fitbenchmarking | ea398efa61f071dc64fe7c3b484d5bb4e1897856 | [
"BSD-3-Clause"
] | 8 | 2019-06-13T10:32:17.000Z | 2020-12-09T15:08:40.000Z | """
This script is used to generate simulated count data based on a Mantid
script.
"""
import os
import numpy
def VariableStatsData(N, A0, omega, phi, sigma, bg):
x = numpy.linspace(start=0.0, stop=32.0, num=2001)
y = (1+A0*numpy.cos(omega*x+phi)*numpy.exp(-(sigma*x)**2)) * \
numpy.exp(-x/2.197)+bg
... | 33.661765 | 77 | 0.512888 |
import os
import numpy
def VariableStatsData(N, A0, omega, phi, sigma, bg):
x = numpy.linspace(start=0.0, stop=32.0, num=2001)
y = (1+A0*numpy.cos(omega*x+phi)*numpy.exp(-(sigma*x)**2)) * \
numpy.exp(-x/2.197)+bg
NN = N/numpy.sum(y)
return (x, numpy.random.poisson(y*NN))
def write_data(x... | true | true |
f70e74264283e09e3f11bea619c26fb9865ea253 | 6,944 | py | Python | uamqp/__init__.py | sthagen/azure-uamqp-python | 35debb612abaec5564280562bdb6f661d711db42 | [
"MIT"
] | 1 | 2021-09-25T07:28:09.000Z | 2021-09-25T07:28:09.000Z | uamqp/__init__.py | sthagen/azure-uamqp-python | 35debb612abaec5564280562bdb6f661d711db42 | [
"MIT"
] | null | null | null | uamqp/__init__.py | sthagen/azure-uamqp-python | 35debb612abaec5564280562bdb6f661d711db42 | [
"MIT"
] | null | null | null | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
# pylint: d... | 40.138728 | 134 | 0.702189 |
import logging
import sys
from uamqp import c_uamqp
from uamqp.message import Message, BatchMessage
from uamqp.address import Source, Target
from uamqp.connection import Connection
from uamqp.session import Session
from uamqp.client import AMQPClient, SendClient, ReceiveClient
from uamqp.sender import Mess... | true | true |
f70e75f618d88cb86c6c17e04154c4ea87680242 | 3,941 | py | Python | datasets/spider/spider.py | rpatil524/datasets | 6382607ee210d7cc3075e3006cbba1ad437858f0 | [
"Apache-2.0"
] | 3,395 | 2020-05-13T21:16:50.000Z | 2020-09-10T14:36:50.000Z | datasets/spider/spider.py | rpatil524/datasets | 6382607ee210d7cc3075e3006cbba1ad437858f0 | [
"Apache-2.0"
] | 370 | 2020-05-13T21:28:57.000Z | 2020-09-10T11:03:38.000Z | datasets/spider/spider.py | rpatil524/datasets | 6382607ee210d7cc3075e3006cbba1ad437858f0 | [
"Apache-2.0"
] | 258 | 2020-05-15T01:17:09.000Z | 2020-09-10T12:41:43.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | 35.827273 | 180 | 0.623446 |
import json
import os
import datasets
logger = datasets.logging.get_logger(__name__)
_CITATION = """\
@article{yu2018spider,
title={Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql task},
author={Yu, Tao and Zhang, Rui and Yang, Kai and Y... | true | true |
f70e7618c19151c831685b139fcbd48dc2ea0b46 | 5,931 | py | Python | tests/graphql/test_graphql.py | mwilliamson/python-graphlayer | d71d99c314aca07816ce6a1a7329d0d7fecdfb2f | [
"BSD-2-Clause"
] | 25 | 2019-03-11T16:48:52.000Z | 2021-05-02T03:23:20.000Z | tests/graphql/test_graphql.py | mwilliamson/python-graphlayer | d71d99c314aca07816ce6a1a7329d0d7fecdfb2f | [
"BSD-2-Clause"
] | 9 | 2019-03-24T10:43:44.000Z | 2021-11-09T23:02:20.000Z | tests/graphql/test_graphql.py | mwilliamson/python-graphlayer | d71d99c314aca07816ce6a1a7329d0d7fecdfb2f | [
"BSD-2-Clause"
] | 7 | 2018-12-30T17:52:07.000Z | 2021-05-02T03:23:35.000Z | from precisely import all_of, assert_that, contains_exactly, equal_to, has_attrs, has_feature, is_instance
import graphlayer as g
from graphlayer import graphql
from graphql import GraphQLError
def test_execute():
Root = g.ObjectType("Root", fields=(
g.field("value", g.String),
))
root_resolver ... | 24.407407 | 115 | 0.600573 | from precisely import all_of, assert_that, contains_exactly, equal_to, has_attrs, has_feature, is_instance
import graphlayer as g
from graphlayer import graphql
from graphql import GraphQLError
def test_execute():
Root = g.ObjectType("Root", fields=(
g.field("value", g.String),
))
root_resolver ... | true | true |
f70e766ed95d656a241aaa80d9ae077d53562853 | 440 | py | Python | tests/conftest.py | davidesarra/jupyter_spaces | 3152b226e14f5c9b21ae9e997efca50ff10b7757 | [
"MIT"
] | 24 | 2018-05-24T16:50:43.000Z | 2021-09-07T00:34:33.000Z | tests/conftest.py | davidesarra/jupyter_spaces | 3152b226e14f5c9b21ae9e997efca50ff10b7757 | [
"MIT"
] | 15 | 2020-04-20T08:45:04.000Z | 2021-03-26T07:14:53.000Z | tests/conftest.py | davidesarra/jupyter_spaces | 3152b226e14f5c9b21ae9e997efca50ff10b7757 | [
"MIT"
] | 2 | 2018-07-02T16:03:07.000Z | 2022-03-30T22:40:45.000Z | import pytest
from IPython.testing.globalipapp import start_ipython
@pytest.fixture(scope="session")
def session_ip():
return start_ipython()
@pytest.fixture(scope="function")
def ip(session_ip):
session_ip.run_line_magic(magic_name="load_ext", line="jupyter_spaces")
yield session_ip
session_ip.run_... | 27.5 | 77 | 0.770455 | import pytest
from IPython.testing.globalipapp import start_ipython
@pytest.fixture(scope="session")
def session_ip():
return start_ipython()
@pytest.fixture(scope="function")
def ip(session_ip):
session_ip.run_line_magic(magic_name="load_ext", line="jupyter_spaces")
yield session_ip
session_ip.run_... | true | true |
f70e769600ac98d381318d291bfc0c7f04dc77a9 | 6,823 | py | Python | python/onshape_client/oas/models/bt_translation_request_info.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 14 | 2019-06-23T08:47:41.000Z | 2021-11-29T16:28:45.000Z | python/onshape_client/oas/models/bt_translation_request_info.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 40 | 2019-05-22T14:39:46.000Z | 2022-03-10T10:36:17.000Z | python/onshape_client/oas/models/bt_translation_request_info.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 24 | 2019-06-02T01:03:41.000Z | 2022-03-29T13:25:36.000Z | # coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | 36.881081 | 92 | 0.57995 |
from __future__ import absolute_import
import re
import sys
import six
import nulltype
from onshape_client.oas.model_utils import (
ModelComposed,
ModelNormal,
ModelSimple,
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
class BTTra... | true | true |
f70e7842a8c325c304a9cd402d45af7d96b68fb6 | 2,227 | py | Python | camera.py | SiemGHM/Login_with_Facial_Recognition | d13ab809fa5fbc29c5cebd2f0f95266cc55d8659 | [
"MIT"
] | null | null | null | camera.py | SiemGHM/Login_with_Facial_Recognition | d13ab809fa5fbc29c5cebd2f0f95266cc55d8659 | [
"MIT"
] | null | null | null | camera.py | SiemGHM/Login_with_Facial_Recognition | d13ab809fa5fbc29c5cebd2f0f95266cc55d8659 | [
"MIT"
] | null | null | null | import threading
import binascii
from time import sleep
from utils import *
############################################################################
import base64
import io
from PIL import Image
def img_to_txt(filename):
msg = b"<plain_txt_msg:img>"
with open(filename, "rb") as ima... | 25.022472 | 77 | 0.549618 | import threading
import binascii
from time import sleep
from utils import *
| true | true |
f70e7a6753947674bb79910dc86388a3b0b8adb6 | 49,210 | py | Python | sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_management_client_async.py | jmonty42/azure-sdk-for-python | 20eb242aec5d449ce9642f96798a718d9731b2fb | [
"MIT"
] | null | null | null | sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_management_client_async.py | jmonty42/azure-sdk-for-python | 20eb242aec5d449ce9642f96798a718d9731b2fb | [
"MIT"
] | null | null | null | sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_management_client_async.py | jmonty42/azure-sdk-for-python | 20eb242aec5d449ce9642f96798a718d9731b2fb | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 49.062812 | 120 | 0.681325 |
import functools
from typing import TYPE_CHECKING, Any, Union, cast
from xml.etree.ElementTree import ElementTree
from azure.core.async_paging import AsyncItemPaged
from azure.core.exceptions import ResourceNotFoundError
from azure.core.pipeline import AsyncPipeline
from azure.core.pipeline.policies import Http... | true | true |
f70e7b2fd31c10ed4ac7f45303e3be05af258ca9 | 912 | py | Python | setup.py | meta-scraper/facebook-scraper-python | 1eff9b6d2eaf9872cfab67ed7d4265d00a3bf103 | [
"MIT"
] | null | null | null | setup.py | meta-scraper/facebook-scraper-python | 1eff9b6d2eaf9872cfab67ed7d4265d00a3bf103 | [
"MIT"
] | null | null | null | setup.py | meta-scraper/facebook-scraper-python | 1eff9b6d2eaf9872cfab67ed7d4265d00a3bf103 | [
"MIT"
] | null | null | null | from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='meta-scraper',
version='0.0.1',
description='Facebook (Meta) Scraper',
long_description=readme(),
classifiers = ['Programming Language :: Python',
'License :: OSI... | 29.419355 | 76 | 0.622807 | from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='meta-scraper',
version='0.0.1',
description='Facebook (Meta) Scraper',
long_description=readme(),
classifiers = ['Programming Language :: Python',
'License :: OSI... | true | true |
f70e7b4854fc71f3dac56c807a13610f98b9cbf4 | 17,780 | py | Python | umap/layouts.py | blasern/umap | 8f2ef23ec835cc5071fe6351a0da8313d8e75706 | [
"BSD-3-Clause"
] | null | null | null | umap/layouts.py | blasern/umap | 8f2ef23ec835cc5071fe6351a0da8313d8e75706 | [
"BSD-3-Clause"
] | null | null | null | umap/layouts.py | blasern/umap | 8f2ef23ec835cc5071fe6351a0da8313d8e75706 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import numba
import umap.distances as dist
from umap.utils import tau_rand_int
@numba.njit()
def clip(val):
"""Standard clamping of a value into a fixed range (in this case -4.0 to
4.0)
Parameters
----------
val: float
The value to be clamped.
Returns
-------
... | 32.151899 | 88 | 0.597919 | import numpy as np
import numba
import umap.distances as dist
from umap.utils import tau_rand_int
@numba.njit()
def clip(val):
if val > 4.0:
return 4.0
elif val < -4.0:
return -4.0
else:
return val
@numba.njit(
"f4(f4[::1],f4[::1])",
fastmath=True,
cache=True,
loc... | true | true |
f70e7dac8b323ebc8d7911e4c00ceba304d939c1 | 88,149 | py | Python | tests/test_per.py | cromulencellc/asn1tools | 30eb88e287cc1616903858aa96ee8791a4d7bf1c | [
"MIT"
] | 198 | 2017-08-04T21:49:15.000Z | 2022-03-26T10:11:21.000Z | tests/test_per.py | cromulencellc/asn1tools | 30eb88e287cc1616903858aa96ee8791a4d7bf1c | [
"MIT"
] | 144 | 2017-09-29T12:06:51.000Z | 2022-03-29T13:04:44.000Z | tests/test_per.py | cromulencellc/asn1tools | 30eb88e287cc1616903858aa96ee8791a4d7bf1c | [
"MIT"
] | 73 | 2017-10-09T13:33:28.000Z | 2022-03-11T01:35:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from .utils import Asn1ToolsBaseTest
import asn1tools
import sys
from copy import deepcopy
sys.path.append('tests/files')
sys.path.append('tests/files/3gpp')
sys.path.append('tests/files/oma')
from rrc_8_6_0 import EXPECTED as RRC_8_6_0
from s1ap_14_4_0 i... | 39.671017 | 103 | 0.3479 |
import unittest
from .utils import Asn1ToolsBaseTest
import asn1tools
import sys
from copy import deepcopy
sys.path.append('tests/files')
sys.path.append('tests/files/3gpp')
sys.path.append('tests/files/oma')
from rrc_8_6_0 import EXPECTED as RRC_8_6_0
from s1ap_14_4_0 import EXPECTED as S1AP_14_4_0
from x691_a4 i... | true | true |
f70e7f71f796e8a3120b279866ce3511323f6f9a | 3,949 | py | Python | mlrun/api/utils/projects/member.py | Hedingber/mlrun | e2269718fcc7caa7e1aa379ac28495830b45f9da | [
"Apache-2.0"
] | null | null | null | mlrun/api/utils/projects/member.py | Hedingber/mlrun | e2269718fcc7caa7e1aa379ac28495830b45f9da | [
"Apache-2.0"
] | null | null | null | mlrun/api/utils/projects/member.py | Hedingber/mlrun | e2269718fcc7caa7e1aa379ac28495830b45f9da | [
"Apache-2.0"
] | null | null | null | import abc
import typing
import sqlalchemy.orm
import mlrun.api.db.session
import mlrun.api.schemas
import mlrun.utils.singleton
from mlrun.utils import logger
class Member(abc.ABC):
@abc.abstractmethod
def initialize(self):
pass
@abc.abstractmethod
def shutdown(self):
pass
def... | 31.592 | 109 | 0.641428 | import abc
import typing
import sqlalchemy.orm
import mlrun.api.db.session
import mlrun.api.schemas
import mlrun.utils.singleton
from mlrun.utils import logger
class Member(abc.ABC):
@abc.abstractmethod
def initialize(self):
pass
@abc.abstractmethod
def shutdown(self):
pass
def... | true | true |
f70e7fc93c9c86085ca9ae2bcb9d966330c34483 | 112 | py | Python | tests/disjoint_set/context.py | niemmi/algolib | 81a013af5ae1ca1e8cf8d3f2e2f1b4a9bce6ead8 | [
"BSD-3-Clause"
] | null | null | null | tests/disjoint_set/context.py | niemmi/algolib | 81a013af5ae1ca1e8cf8d3f2e2f1b4a9bce6ead8 | [
"BSD-3-Clause"
] | null | null | null | tests/disjoint_set/context.py | niemmi/algolib | 81a013af5ae1ca1e8cf8d3f2e2f1b4a9bce6ead8 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
from algolib.disjoint_set import DisjointSet
| 18.666667 | 44 | 0.75 | import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
from algolib.disjoint_set import DisjointSet
| true | true |
f70e7fe6693e9626b74411764e8a23bf2633b79c | 22,010 | py | Python | tests/unit/spanner_dbapi/test_connection.py | thiagotnunes/python-spanner | 1343656ad43dbc41c119b652d8fe9360fa2b0e78 | [
"Apache-2.0"
] | null | null | null | tests/unit/spanner_dbapi/test_connection.py | thiagotnunes/python-spanner | 1343656ad43dbc41c119b652d8fe9360fa2b0e78 | [
"Apache-2.0"
] | null | null | null | tests/unit/spanner_dbapi/test_connection.py | thiagotnunes/python-spanner | 1343656ad43dbc41c119b652d8fe9360fa2b0e78 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 37.623932 | 86 | 0.66129 |
import mock
import unittest
import warnings
def _make_credentials():
from google.auth import credentials
class _CredentialsWithScopes(credentials.Credentials, credentials.Scoped):
pass
return mock.Mock(spec=_CredentialsWithScopes)
class TestConnection(unittest.TestCase):
PR... | true | true |
f70e8018dba0957cbcb16fb6e1c2be72e2cc6ec5 | 2,910 | py | Python | src/bindings/python/DocStrings/ColorSpace.py | jmertic/OpenColorIO | 9b18fd69f981288a6a3640e283b8d9968a15423e | [
"BSD-3-Clause"
] | 1 | 2019-11-18T21:49:25.000Z | 2019-11-18T21:49:25.000Z | src/bindings/python/DocStrings/ColorSpace.py | KevinJW/OpenColorIO | 412aa7ba273616867e607de646e4975791198812 | [
"BSD-3-Clause"
] | 1 | 2020-06-12T19:10:09.000Z | 2020-06-12T19:10:09.000Z | src/bindings/python/DocStrings/ColorSpace.py | KevinJW/OpenColorIO | 412aa7ba273616867e607de646e4975791198812 | [
"BSD-3-Clause"
] | null | null | null | # SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenColorIO Project.
class ColorSpace:
"""
A color space is the state of an image in terms of colorimetry and color
encoding. I.e., it defines how an image's color information needs to be
interpreted.
Transforming images b... | 27.45283 | 77 | 0.60756 |
class ColorSpace:
def __init__(self):
pass
def isEditable(self):
pass
def createEditableCopy(self):
pass
def getName(self):
pass
def setName(self, name):
pass
def getFamily(self):
pass
de... | true | true |
f70e816fccb477b6940b5655ee9033f16fa00dde | 9,158 | py | Python | cms/admin/change_list.py | 360youlun/django-cms | bc1240fd46de4c04f3b5402be99a81728a4a324c | [
"BSD-3-Clause"
] | 1 | 2015-06-11T19:25:26.000Z | 2015-06-11T19:25:26.000Z | cms/admin/change_list.py | damianmoore/django-cms | 2d3e10a01e792ec7da5c1418811c1be5ac84e5e2 | [
"BSD-3-Clause"
] | 5 | 2021-03-19T15:39:27.000Z | 2021-09-08T02:47:21.000Z | cms/admin/change_list.py | Acidburn0zzz/django-cms | 5a105a1c75eeb4c8a4c1c34301d93855e6724407 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import bisect
from cms.models import Title, Page, EmptyTitle
from cms.utils import get_language_list
from cms.utils.compat import DJANGO_1_5
from cms.utils.conf import get_cms_setting
from cms.utils.permissions import get_user_sites_queryset
from django.contrib.admin.views.main import ChangeList... | 42.995305 | 155 | 0.631033 |
import bisect
from cms.models import Title, Page, EmptyTitle
from cms.utils import get_language_list
from cms.utils.compat import DJANGO_1_5
from cms.utils.conf import get_cms_setting
from cms.utils.permissions import get_user_sites_queryset
from django.contrib.admin.views.main import ChangeList, ALL_VAR, IS_POPUP_VAR... | true | true |
f70e831488e0cb508db605c85134ad88f0269f75 | 3,887 | py | Python | torch_deploy/app.py | mochangheng/pytorch-deploy | 76da7fe03da7dd40633b36ce1567fe54bb2aa6d4 | [
"MIT"
] | 2 | 2020-08-20T22:27:09.000Z | 2021-06-22T01:54:29.000Z | torch_deploy/app.py | mochangheng/pytorch-deploy | 76da7fe03da7dd40633b36ce1567fe54bb2aa6d4 | [
"MIT"
] | null | null | null | torch_deploy/app.py | mochangheng/pytorch-deploy | 76da7fe03da7dd40633b36ce1567fe54bb2aa6d4 | [
"MIT"
] | null | null | null | from typing import Callable, List, Dict, Union
import atexit
from collections.abc import Sequence
from copy import deepcopy
import os
from PIL import Image
from fastapi import FastAPI, UploadFile, File, Request
from fastapi.templating import Jinja2Templates
from pydantic import BaseModel
from datetime import datetime
... | 28.166667 | 100 | 0.668125 | from typing import Callable, List, Dict, Union
import atexit
from collections.abc import Sequence
from copy import deepcopy
import os
from PIL import Image
from fastapi import FastAPI, UploadFile, File, Request
from fastapi.templating import Jinja2Templates
from pydantic import BaseModel
from datetime import datetime
... | true | true |
f70e83d838338511569bd98d4500eb9670f97f05 | 1,586 | py | Python | data/live_predict.py | Zerwer/EEGMachineLearning | d0dfcf617b22317a88018a86545c4f7e37a290b9 | [
"MIT"
] | 3 | 2018-11-14T14:09:26.000Z | 2018-11-21T13:32:18.000Z | data/live_predict.py | Zerwer/PythonEEG | d0dfcf617b22317a88018a86545c4f7e37a290b9 | [
"MIT"
] | null | null | null | data/live_predict.py | Zerwer/PythonEEG | d0dfcf617b22317a88018a86545c4f7e37a290b9 | [
"MIT"
] | null | null | null | # Unsure majority of time but more correct then wrong when thinking of
# Requires more data for training
from data import *
from tkinter import *
from keras.models import load_model
import numpy as np
import threading
import time
# Time variables
start_wait = 10000
wait = 2100
# Set dimensions
w = 900
h = 556
root =... | 26.433333 | 118 | 0.692938 |
from data import *
from tkinter import *
from keras.models import load_model
import numpy as np
import threading
import time
start_wait = 10000
wait = 2100
w = 900
h = 556
root = Tk()
root.geometry(str(w)+'x'+str(h))
root.title('Predictor')
graphing_area = Canvas(root, width=w, height=h)
graphing_area.pack()
... | true | true |
f70e84792cf5a59a3be8c3aee16c44c180d1ae2c | 2,269 | py | Python | JsonReplace_MainFunction.py | SmallSky7/JsonReplace | c5867f08f1d0b5d92f68428d8ae7c5b96a589a62 | [
"MIT"
] | null | null | null | JsonReplace_MainFunction.py | SmallSky7/JsonReplace | c5867f08f1d0b5d92f68428d8ae7c5b96a589a62 | [
"MIT"
] | null | null | null | JsonReplace_MainFunction.py | SmallSky7/JsonReplace | c5867f08f1d0b5d92f68428d8ae7c5b96a589a62 | [
"MIT"
] | null | null | null | import json
from Function.Symbol_ReplaceController import *
from Function.Position_strController import *
from Function.initdate_ReplaceController import *
from Function.Date_ReplaceController import *
from JsonReplace import JsonReplace
def get_new_json(file_path):
# 打开json文件
file = open(file_path, encoding='... | 37.816667 | 90 | 0.694138 | import json
from Function.Symbol_ReplaceController import *
from Function.Position_strController import *
from Function.initdate_ReplaceController import *
from Function.Date_ReplaceController import *
from JsonReplace import JsonReplace
def get_new_json(file_path):
file = open(file_path, encoding='gbk')
... | true | true |
f70e84f755f740db195c8d6aa4b521630bc274fc | 15,135 | py | Python | code/python/DocumentsDistributorCallStreetEvents/v1/fds/sdk/DocumentsDistributorCallStreetEvents/rest.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/DocumentsDistributorCallStreetEvents/v1/fds/sdk/DocumentsDistributorCallStreetEvents/rest.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/DocumentsDistributorCallStreetEvents/v1/fds/sdk/DocumentsDistributorCallStreetEvents/rest.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
Documents Distributor - CallStreet Events
CallStreet Events contains all the Documents Distributor APIs that provide events data such as Events Audio and Near Real-Time Transcripts The Events Audio API provides access to all audio recordings to various company events covered by FactSet. The events includ... | 43.616715 | 983 | 0.573902 |
import io
import json
import logging
import re
import ssl
from urllib.parse import urlencode
from urllib.parse import urlparse
from urllib.request import proxy_bypass_environment
import urllib3
import ipaddress
from fds.sdk.DocumentsDistributorCallStreetEvents.exceptions import ApiException, UnauthorizedException, F... | true | true |
f70e8528ba0887786c01a545f64f8733b9db19e5 | 1,184 | py | Python | tests/garage/sampler/test_sampler.py | st2yang/garage | 50186a9630df038aeba36d6b06b006ab32ed48f5 | [
"MIT"
] | null | null | null | tests/garage/sampler/test_sampler.py | st2yang/garage | 50186a9630df038aeba36d6b06b006ab32ed48f5 | [
"MIT"
] | null | null | null | tests/garage/sampler/test_sampler.py | st2yang/garage | 50186a9630df038aeba36d6b06b006ab32ed48f5 | [
"MIT"
] | null | null | null | from dowel import logger
import numpy as np
from garage.sampler.utils import truncate_paths
from tests.fixtures.logger import NullOutput
class TestSampler:
def setup_method(self):
logger.add_output(NullOutput())
def teardown_method(self):
logger.remove_all()
def test_truncate_paths(se... | 28.190476 | 55 | 0.544764 | from dowel import logger
import numpy as np
from garage.sampler.utils import truncate_paths
from tests.fixtures.logger import NullOutput
class TestSampler:
def setup_method(self):
logger.add_output(NullOutput())
def teardown_method(self):
logger.remove_all()
def test_truncate_paths(se... | true | true |
f70e85c196b51a44322d93fedde96c66b0698a16 | 9,071 | py | Python | almacen_api/companies/tag.py | xyla-io/almacen_api | 07497c64e6d1d52296a20dde106bc1af36f27114 | [
"MIT"
] | null | null | null | almacen_api/companies/tag.py | xyla-io/almacen_api | 07497c64e6d1d52296a20dde106bc1af36f27114 | [
"MIT"
] | null | null | null | almacen_api/companies/tag.py | xyla-io/almacen_api | 07497c64e6d1d52296a20dde106bc1af36f27114 | [
"MIT"
] | null | null | null | import flask
import itertools
from . import tag_validation
from .entities import Entity, entities_blueprint
from ..api import AlmacenAPI, api
from datetime import datetime
from data_layer import Redshift as SQL
from typing import List, Dict, Optional
from subir import Tagger
time_format = '%Y-%m-%d %H:%M:%S'
tags_blu... | 38.93133 | 151 | 0.755044 | import flask
import itertools
from . import tag_validation
from .entities import Entity, entities_blueprint
from ..api import AlmacenAPI, api
from datetime import datetime
from data_layer import Redshift as SQL
from typing import List, Dict, Optional
from subir import Tagger
time_format = '%Y-%m-%d %H:%M:%S'
tags_blu... | true | true |
f70e87f2b7fdb0b7211f6e6661de6dd6da1041e2 | 11,185 | py | Python | bot/bot.py | chrisbog/ccwsparkbot | 67a539c2b3c537aac6337b4d709e4a5dadd1f52b | [
"MIT"
] | null | null | null | bot/bot.py | chrisbog/ccwsparkbot | 67a539c2b3c537aac6337b4d709e4a5dadd1f52b | [
"MIT"
] | null | null | null | bot/bot.py | chrisbog/ccwsparkbot | 67a539c2b3c537aac6337b4d709e4a5dadd1f52b | [
"MIT"
] | null | null | null | #! /usr/bin/python
"""
boilerplate_sparkbot
This is a sample boilerplate application that provides the framework to quickly
build and deploy an interactive Spark Bot.
There are different strategies for building a Spark Bot. You can either create
a new dedicated Spark Account for the bot, or creat... | 35.283912 | 109 | 0.677515 |
from flask import Flask, request
from ciscosparkapi import CiscoSparkAPI
import os
import sys
import json
from ccw.ccwparser import *
from ccw.ccwquery import *
app = Flask(__name__)
commands = {
"/echo": "Reply back with the same message sent.",
"/showconfig": "Shows current configuration.",
"/h... | true | true |
f70e8833bbae890bd174e2505a4cc93410cb380d | 4,868 | py | Python | builder/widgets/py_window/py_window.py | ufopilot/QT-App-Builder | af9c455b4122669d5f200728d467f5afe4f3ee87 | [
"MIT"
] | null | null | null | builder/widgets/py_window/py_window.py | ufopilot/QT-App-Builder | af9c455b4122669d5f200728d467f5afe4f3ee87 | [
"MIT"
] | null | null | null | builder/widgets/py_window/py_window.py | ufopilot/QT-App-Builder | af9c455b4122669d5f200728d467f5afe4f3ee87 | [
"MIT"
] | null | null | null | # ///////////////////////////////////////////////////////////////
#
# BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0
#
# This project can be used freely for all uses, as long as they maintain the
# respective credits only in the Python scripts, any information in the visual
# interface ... | 34.28169 | 78 | 0.500411 |
from qt_core import *
from app.gui.core.json_settings import Settings
from . styles import Styles
class PyWindow(QFrame):
def __init__(
self,
parent,
layout = Qt.Vertical,
margin = 0,
spacing = 2,
bg_color = "#2c313c",
text_color ... | true | true |
f70e88d108c06e43243dd9b3a024a9637589bf97 | 686 | py | Python | constants.py | Mychecksdead/KelRot-2022-Rapid-React-Code | 18d02ec9100bdac2efb120d4e40176f737771c01 | [
"BSD-3-Clause"
] | 3 | 2022-02-24T11:22:24.000Z | 2022-03-08T07:07:30.000Z | constants.py | Mychecksdead/KelRot-2022-Rapid-React-Code | 18d02ec9100bdac2efb120d4e40176f737771c01 | [
"BSD-3-Clause"
] | null | null | null | constants.py | Mychecksdead/KelRot-2022-Rapid-React-Code | 18d02ec9100bdac2efb120d4e40176f737771c01 | [
"BSD-3-Clause"
] | 4 | 2022-02-09T09:11:09.000Z | 2022-02-25T07:36:55.000Z | # ============ FIRST ALGORITHM ============
class Circles(object):
test_img = "cargo1.jpeg"
rescale_size = 0.4
circles_dp = 2.2
circles_minDist = 180
circles_param1 = 75
circles_param2 = 90
circles_minRadius = 10
circles_maxRadius = 500
circle_color = (150, 55, 0)
rect... | 25.407407 | 44 | 0.580175 |
class Circles(object):
test_img = "cargo1.jpeg"
rescale_size = 0.4
circles_dp = 2.2
circles_minDist = 180
circles_param1 = 75
circles_param2 = 90
circles_minRadius = 10
circles_maxRadius = 500
circle_color = (150, 55, 0)
rectangle_color = (150, 55, 0)
green = (77,... | true | true |
f70e89748fc45d96124611c6b75f48f926a264d7 | 290 | py | Python | Code/crypto.py | Tim-eyes/Beamer-Template-LaTex | 194d46a98205d89fe018a71030f8d6a2fc57ea52 | [
"MIT"
] | 1 | 2022-01-30T14:48:46.000Z | 2022-01-30T14:48:46.000Z | Code/crypto.py | Tim-eyes/Beamer-Template-LaTex | 194d46a98205d89fe018a71030f8d6a2fc57ea52 | [
"MIT"
] | null | null | null | Code/crypto.py | Tim-eyes/Beamer-Template-LaTex | 194d46a98205d89fe018a71030f8d6a2fc57ea52 | [
"MIT"
] | null | null | null | import cryptops
class Crypto:
def __init__(self, key):
self.key = key
def apply(self, msg, func):
return func(self.key, msg)
crp=Crypto('secretkey')
encrypted=crp.apply('hello world', cryptops.encrypt)
decrypted=crp.apply(encrypted, cryptops.decrypt)
| 22.307692 | 60 | 0.665517 | import cryptops
class Crypto:
def __init__(self, key):
self.key = key
def apply(self, msg, func):
return func(self.key, msg)
crp=Crypto('secretkey')
encrypted=crp.apply('hello world', cryptops.encrypt)
decrypted=crp.apply(encrypted, cryptops.decrypt)
| true | true |
f70e8a484790cc787eba8fef88a1af8f2abaa8cb | 11,316 | py | Python | plugin.py | zenz/kicad_freerouting-plugin | 6d20c456741c34725f00762cf08c5eec7182481b | [
"Apache-2.0"
] | null | null | null | plugin.py | zenz/kicad_freerouting-plugin | 6d20c456741c34725f00762cf08c5eec7182481b | [
"Apache-2.0"
] | null | null | null | plugin.py | zenz/kicad_freerouting-plugin | 6d20c456741c34725f00762cf08c5eec7182481b | [
"Apache-2.0"
] | 1 | 2022-03-13T14:15:15.000Z | 2022-03-13T14:15:15.000Z | import os
import wx
import wx.aui
import time
import pcbnew
import textwrap
import threading
import subprocess
import configparser
import re
# Remove java offending characters
def search_n_strip(s):
s = re.sub('[Ωµ]', '', s)
return s
#
# FreeRouting round trip invocation:
# * export board.dsn file from pcbnew... | 31.608939 | 137 | 0.57052 | import os
import wx
import wx.aui
import time
import pcbnew
import textwrap
import threading
import subprocess
import configparser
import re
def search_n_strip(s):
s = re.sub('[Ωµ]', '', s)
return s
class FreeRoutingPlugin(pcbnew.ActionPlugin):
def defaults(self):
self.here_path = os.... | true | true |
f70e8a56ae4ee5112ef5c9e38f7ff1661ccc200d | 977 | py | Python | apps/team/views.py | othmbela/fifa-21-api | 5ed75b60a8c302ad7d4fde04a07312de18c10b1e | [
"MIT"
] | 3 | 2021-03-14T19:54:13.000Z | 2021-10-01T20:53:37.000Z | apps/team/views.py | othmbela/fifa-21-api | 5ed75b60a8c302ad7d4fde04a07312de18c10b1e | [
"MIT"
] | 1 | 2021-09-11T15:48:30.000Z | 2021-09-11T18:31:52.000Z | apps/team/views.py | othmbela/fifa-21-api | 5ed75b60a8c302ad7d4fde04a07312de18c10b1e | [
"MIT"
] | null | null | null | from rest_framework.viewsets import ModelViewSet
from rest_framework.generics import (
ListAPIView,
CreateAPIView,
UpdateAPIView,
DestroyAPIView,
)
from .models import Team
from .serializers import TeamSerializer
from utils.pagination import PaginationPageNumberPagination
class TeamListAPIView(ListA... | 19.54 | 59 | 0.718526 | from rest_framework.viewsets import ModelViewSet
from rest_framework.generics import (
ListAPIView,
CreateAPIView,
UpdateAPIView,
DestroyAPIView,
)
from .models import Team
from .serializers import TeamSerializer
from utils.pagination import PaginationPageNumberPagination
class TeamListAPIView(ListA... | true | true |
f70e8cd41c5fd362bf83d9dd780128a941f45280 | 4,210 | py | Python | pyrosim/pyrosim.py | kawseribn/SimoBot | 2d91077eb152635b50fa215a077f0871788c7cda | [
"MIT"
] | null | null | null | pyrosim/pyrosim.py | kawseribn/SimoBot | 2d91077eb152635b50fa215a077f0871788c7cda | [
"MIT"
] | null | null | null | pyrosim/pyrosim.py | kawseribn/SimoBot | 2d91077eb152635b50fa215a077f0871788c7cda | [
"MIT"
] | null | null | null | import pybullet as p
from pyrosim.nndf import NNDF
from pyrosim.linksdf import LINK_SDF
from pyrosim.linkurdf import LINK_URDF
from pyrosim.model import MODEL
from pyrosim.sdf import SDF
from pyrosim.urdf import URDF
from pyrosim.joint import JOINT
SDF_FILETYPE = 0
URDF_FILETYPE = 1
NNDF_FILETYPE = 2
... | 17.325103 | 165 | 0.648931 | import pybullet as p
from pyrosim.nndf import NNDF
from pyrosim.linksdf import LINK_SDF
from pyrosim.linkurdf import LINK_URDF
from pyrosim.model import MODEL
from pyrosim.sdf import SDF
from pyrosim.urdf import URDF
from pyrosim.joint import JOINT
SDF_FILETYPE = 0
URDF_FILETYPE = 1
NNDF_FILETYPE = 2
... | true | true |
f70e8cdc0559287a1d50efe21c802f57097c6775 | 4,638 | py | Python | synergine/core/CycleCalculator.py | buxx/synergine | da05d762cdbc993362807d4851e1ca74784438ae | [
"Apache-2.0"
] | 6 | 2015-04-03T08:04:22.000Z | 2016-11-13T22:47:11.000Z | synergine/core/CycleCalculator.py | buxx/synergine | da05d762cdbc993362807d4851e1ca74784438ae | [
"Apache-2.0"
] | 2 | 2019-10-21T15:41:39.000Z | 2021-06-10T14:15:27.000Z | synergine/core/CycleCalculator.py | buxx/synergine | da05d762cdbc993362807d4851e1ca74784438ae | [
"Apache-2.0"
] | 2 | 2015-02-27T12:05:51.000Z | 2016-05-11T07:25:20.000Z | from synergine.lib.process.processmanager import KeepedAliveProcessManager
from synergine.core.cycle.PipePackage import PipePackage
from synergine.core.simulation.EventManager import EventManager
from synergine.core.Signals import Signals
from synergine.synergy.event.exception.ActionAborted import ActionAborted
class... | 37.707317 | 122 | 0.661708 | from synergine.lib.process.processmanager import KeepedAliveProcessManager
from synergine.core.cycle.PipePackage import PipePackage
from synergine.core.simulation.EventManager import EventManager
from synergine.core.Signals import Signals
from synergine.synergy.event.exception.ActionAborted import ActionAborted
class... | true | true |
f70e8cf7ca2f0d29069186cc00c0e728a600f9da | 11,712 | py | Python | scipy/signal/tests/test_savitzky_golay.py | lorentzenchr/scipy | 393a05ee927883ad6316b7092c851afea8f16816 | [
"BSD-3-Clause"
] | 9,095 | 2015-01-02T18:24:23.000Z | 2022-03-31T20:35:31.000Z | scipy/signal/tests/test_savitzky_golay.py | lorentzenchr/scipy | 393a05ee927883ad6316b7092c851afea8f16816 | [
"BSD-3-Clause"
] | 11,500 | 2015-01-01T01:15:30.000Z | 2022-03-31T23:07:35.000Z | scipy/signal/tests/test_savitzky_golay.py | lorentzenchr/scipy | 393a05ee927883ad6316b7092c851afea8f16816 | [
"BSD-3-Clause"
] | 5,838 | 2015-01-05T11:56:42.000Z | 2022-03-31T23:21:19.000Z | import numpy as np
from numpy.testing import (assert_allclose, assert_equal,
assert_almost_equal, assert_array_equal,
assert_array_almost_equal)
from scipy.ndimage import convolve1d
from scipy.signal import savgol_coeffs, savgol_filter
from scipy.signal._savitzky_... | 34.447059 | 77 | 0.57138 | import numpy as np
from numpy.testing import (assert_allclose, assert_equal,
assert_almost_equal, assert_array_equal,
assert_array_almost_equal)
from scipy.ndimage import convolve1d
from scipy.signal import savgol_coeffs, savgol_filter
from scipy.signal._savitzky_... | true | true |
f70e8e9eb28049205ecca0c73a1f22ab0774e5f8 | 619 | py | Python | lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py | mkinsner/llvm | 589d48844edb12cd357b3024248b93d64b6760bf | [
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py | mkinsner/llvm | 589d48844edb12cd357b3024248b93d64b6760bf | [
"Apache-2.0"
] | 3,740 | 2019-01-23T15:36:48.000Z | 2022-03-31T22:01:13.000Z | lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py | mkinsner/llvm | 589d48844edb12cd357b3024248b93d64b6760bf | [
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z |
import unittest2
from lldbsuite.test.decorators import *
from lldbsuite.test.concurrent_base import ConcurrentEventsBase
from lldbsuite.test.lldbtest import TestBase
@skipIfWindows
class ConcurrentCrashWithSignal(ConcurrentEventsBase):
mydir = ConcurrentEventsBase.compute_mydir(__file__)
# Atomic sequence... | 30.95 | 82 | 0.770598 |
import unittest2
from lldbsuite.test.decorators import *
from lldbsuite.test.concurrent_base import ConcurrentEventsBase
from lldbsuite.test.lldbtest import TestBase
@skipIfWindows
class ConcurrentCrashWithSignal(ConcurrentEventsBase):
mydir = ConcurrentEventsBase.compute_mydir(__file__)
@skipIf(trip... | true | true |
f70e8f1ee71b250ea1a1671298c70cbb6c8b9589 | 2,981 | py | Python | rovers/fastdownward/experiments/issue717/v2.py | mehrdadzakershahrak/Online-Explanation-Generation | e41ad9b5a390abdaf271562a56105c191e33b74d | [
"MIT"
] | 1 | 2021-09-09T13:03:02.000Z | 2021-09-09T13:03:02.000Z | rovers/fastdownward/experiments/issue717/v2.py | mehrdadzakershahrak/Online-Explanation-Generation | e41ad9b5a390abdaf271562a56105c191e33b74d | [
"MIT"
] | null | null | null | rovers/fastdownward/experiments/issue717/v2.py | mehrdadzakershahrak/Online-Explanation-Generation | e41ad9b5a390abdaf271562a56105c191e33b74d | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
from lab.environments import LocalEnvironment, MaiaEnvironment
from downward.reports.compare import ComparativeReport
from common_setup import IssueConfig, IssueExperiment, is_test_run
BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"]
REVISIONS = ["issue717... | 37.734177 | 89 | 0.696746 |
import os
from lab.environments import LocalEnvironment, MaiaEnvironment
from downward.reports.compare import ComparativeReport
from common_setup import IssueConfig, IssueExperiment, is_test_run
BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"]
REVISIONS = ["issue717-v2"]
CONFIGS = [
IssueConfig(
"l... | true | true |
f70e8f84b014e650bd66970655feeddf1ff280c7 | 13,220 | py | Python | pyqmc/dmc.py | gcassella/pyqmc | f7a6e1f656c8eab7ebd72132ee980f77275e3876 | [
"MIT"
] | null | null | null | pyqmc/dmc.py | gcassella/pyqmc | f7a6e1f656c8eab7ebd72132ee980f77275e3876 | [
"MIT"
] | null | null | null | pyqmc/dmc.py | gcassella/pyqmc | f7a6e1f656c8eab7ebd72132ee980f77275e3876 | [
"MIT"
] | null | null | null | import os
#import numpy as np
import pyqmc.mc as mc
import sys
import h5py
import jax
import jax.numpy as jnp
import numpy as np
from functools import partial
def limdrift(g, tau, acyrus=0.25):
"""
Use Cyrus Umrigar's algorithm to limit the drift near nodes.
Args:
g: a [nconf,ndim] vector
t... | 31.327014 | 252 | 0.596747 | import os
import pyqmc.mc as mc
import sys
import h5py
import jax
import jax.numpy as jnp
import numpy as np
from functools import partial
def limdrift(g, tau, acyrus=0.25):
tot = jnp.linalg.norm(g, axis=1) * acyrus
mask = tot > 1e-8
taueff = jnp.ones(tot.shape) * tau
taueff = jnp.where(
mask,... | true | true |
f70e8f8ebf9d810a241e46766340eba377a1d983 | 2,203 | py | Python | kata_solutions/programming_101/_5/seach_string.py | jrj92280/python-katas | 74cbe1ca110006c99600ddba6e887f5675c76667 | [
"Beerware"
] | 2 | 2019-03-29T02:42:21.000Z | 2019-08-06T15:01:19.000Z | kata_solutions/programming_101/_5/seach_string.py | jrj92280/python-katas | 74cbe1ca110006c99600ddba6e887f5675c76667 | [
"Beerware"
] | null | null | null | kata_solutions/programming_101/_5/seach_string.py | jrj92280/python-katas | 74cbe1ca110006c99600ddba6e887f5675c76667 | [
"Beerware"
] | 1 | 2019-07-17T15:11:13.000Z | 2019-07-17T15:11:13.000Z | # PRIMITIVE DATA TYPES
# str - string
# bool - boolean
# int - integer
# float
# COMPLEX DATA TYPES
# list
# dict
attendees = ['sara', 'alex', 'justin', 'ryan']
for attendee in attendees:
# print(attendee)
pass
# print(attendees[0])
# key = value
employees = {
'sara': 'csa',
'alex': 'it stupport t... | 16.946154 | 57 | 0.63005 |
attendees = ['sara', 'alex', 'justin', 'ryan']
for attendee in attendees:
pass
employees = {
'sara': 'csa',
'alex': 'it stupport tech',
'justin': 'software ninja',
'ryan': 'numbers nerd',
'robot': str(1)
}
name ... | true | true |
f70e910ed88c79aa27e0e316c3f8283ce1ca89cc | 332 | py | Python | VTK/vtk_7.1.1_x64_Release/lib/python2.7/site-packages/vtk/vtkIOParallelXML.py | jiaguobing/FastCAE | 2348ab87e83fe5c704e4c998cf391229c25ac5d5 | [
"BSD-3-Clause"
] | 2 | 2020-02-21T01:04:35.000Z | 2020-02-21T03:35:37.000Z | VTK/vtk_7.1.1_x64_Release/lib/python2.7/site-packages/vtk/vtkIOParallelXML.py | Sunqia/FastCAE | cbc023fe07b6e306ceefae8b8bd7c12bc1562acb | [
"BSD-3-Clause"
] | 1 | 2020-03-06T04:49:42.000Z | 2020-03-06T04:49:42.000Z | VTK/vtk_7.1.1_x64_Release/lib/python2.7/site-packages/vtk/vtkIOParallelXML.py | Sunqia/FastCAE | cbc023fe07b6e306ceefae8b8bd7c12bc1562acb | [
"BSD-3-Clause"
] | 1 | 2021-11-21T13:03:26.000Z | 2021-11-21T13:03:26.000Z | from __future__ import absolute_import
try:
# use relative import for installed modules
from .vtkIOParallelXMLPython import *
except ImportError:
# during build and testing, the modules will be elsewhere,
# e.g. in lib directory or Release/Debug config directories
from vtkIOParallelXMLPytho... | 33.2 | 64 | 0.746988 | from __future__ import absolute_import
try:
from .vtkIOParallelXMLPython import *
except ImportError:
from vtkIOParallelXMLPython import *
| true | true |
f70e920f44195f22e9f47b7ea1e5c90c3fce06cf | 6,854 | py | Python | cement/cli/contrib/yaml/reader.py | tomekr/cement | fece8629c48bcd598fd61d8aa7457a5df4c4f831 | [
"BSD-3-Clause"
] | 5,421 | 2018-09-24T08:04:06.000Z | 2022-03-31T20:02:37.000Z | cement/cli/contrib/yaml/reader.py | tomekr/cement | fece8629c48bcd598fd61d8aa7457a5df4c4f831 | [
"BSD-3-Clause"
] | 3,243 | 2017-02-07T15:30:01.000Z | 2022-03-31T16:42:19.000Z | cement/cli/contrib/yaml/reader.py | tomekr/cement | fece8629c48bcd598fd61d8aa7457a5df4c4f831 | [
"BSD-3-Clause"
] | 429 | 2015-06-27T19:34:21.000Z | 2022-03-23T11:02:51.000Z | # This module contains abstractions for the input stream. You don't have to
# looks further, there are no pretty code.
#
# We define two classes here.
#
# Mark(source, line, column)
# It's just a record and its only use is producing nice error messages.
# Parser does not use it for any other purposes.
#
# Reader(so... | 35.512953 | 86 | 0.556026 |
# looks further, there are no pretty code.
#
# We define two classes here.
#
# Mark(source, line, column)
# It's just a record and its only use is producing nice error messages.
__all__ = ['Reader', 'ReaderError']
from .error import YAMLError, Mark
import codecs, re
class ReaderError(YAMLError):
de... | true | true |
f70e9236da0f5a31f9d5918d8f43bff0313a10a6 | 8,037 | py | Python | posthog/api/paths.py | almog27/posthog | 705d12f78b73c680b3ebc125cbc5b46c53e24102 | [
"MIT"
] | 1 | 2020-07-02T12:25:41.000Z | 2020-07-02T12:25:41.000Z | posthog/api/paths.py | almog27/posthog | 705d12f78b73c680b3ebc125cbc5b46c53e24102 | [
"MIT"
] | null | null | null | posthog/api/paths.py | almog27/posthog | 705d12f78b73c680b3ebc125cbc5b46c53e24102 | [
"MIT"
] | 1 | 2020-06-24T07:59:41.000Z | 2020-06-24T07:59:41.000Z | from rest_framework import viewsets, request
from rest_framework.response import Response
from rest_framework.decorators import action
from posthog.models import Event, Filter
from posthog.utils import request_to_date_query, dict_from_cursor_fetchall
from django.db.models import OuterRef
from django.db import connectio... | 45.925714 | 295 | 0.616026 | from rest_framework import viewsets, request
from rest_framework.response import Response
from rest_framework.decorators import action
from posthog.models import Event, Filter
from posthog.utils import request_to_date_query, dict_from_cursor_fetchall
from django.db.models import OuterRef
from django.db import connectio... | true | true |
f70e9242f485b280107689f59ae366e11677da84 | 366 | py | Python | maldi-learn/maldi_learn/preprocessing/__init__.py | sebastianbalzer/maldi_PIKE | 032bfcf1cd9b482ff851d68faaa2cf967aaf62a8 | [
"BSD-3-Clause"
] | 4 | 2021-01-05T20:26:32.000Z | 2022-02-18T16:31:01.000Z | maldi-learn/maldi_learn/preprocessing/__init__.py | sebastianbalzer/maldi_PIKE | 032bfcf1cd9b482ff851d68faaa2cf967aaf62a8 | [
"BSD-3-Clause"
] | null | null | null | maldi-learn/maldi_learn/preprocessing/__init__.py | sebastianbalzer/maldi_PIKE | 032bfcf1cd9b482ff851d68faaa2cf967aaf62a8 | [
"BSD-3-Clause"
] | 3 | 2020-04-23T15:56:50.000Z | 2021-07-15T00:43:35.000Z | """Preprocessing of MALDI-TOF spectra."""
from .generic import SubsetPeaksTransformer
from .normalization import TotalIonCurrentNormalizer
from .normalization import ScaleNormalizer
from .topological import TopologicalPeakFiltering
__all__ = [
'ScaleNormalizer',
'SubsetPeaksTransformer',
'TopologicalPeak... | 24.4 | 52 | 0.800546 |
from .generic import SubsetPeaksTransformer
from .normalization import TotalIonCurrentNormalizer
from .normalization import ScaleNormalizer
from .topological import TopologicalPeakFiltering
__all__ = [
'ScaleNormalizer',
'SubsetPeaksTransformer',
'TopologicalPeakFiltering',
'TotalIonCurrentNormalizer... | true | true |
f70e92de59d7f2269db39f2876140d100f76b4fc | 1,794 | py | Python | aiida_quantumespresso/cli/calculations/q2r.py | lin-cp/aiida-quantumespresso | 55f2bc8c137a69be24709a119bc285c700997907 | [
"MIT"
] | null | null | null | aiida_quantumespresso/cli/calculations/q2r.py | lin-cp/aiida-quantumespresso | 55f2bc8c137a69be24709a119bc285c700997907 | [
"MIT"
] | null | null | null | aiida_quantumespresso/cli/calculations/q2r.py | lin-cp/aiida-quantumespresso | 55f2bc8c137a69be24709a119bc285c700997907 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Command line scripts to launch a `Q2rCalculation` for testing and demonstration purposes."""
from aiida.cmdline.params import options as options_core
from aiida.cmdline.params import types
from aiida.cmdline.utils import decorators
import click
from . import cmd_launch
from ..utils import la... | 40.772727 | 117 | 0.756968 |
from aiida.cmdline.params import options as options_core
from aiida.cmdline.params import types
from aiida.cmdline.utils import decorators
import click
from . import cmd_launch
from ..utils import launch, options
@cmd_launch.command('q2r')
@options_core.CODE(required=True, type=types.CodeParamType(entry_point='quan... | true | true |
f70e93de17fb2ce6b4647d52aec3b4fba78bd341 | 13,265 | py | Python | test_tracetools/test/test_pub_sub.py | Henrycious/ros2_tracing | d201ce4b4720ad71c922d5dfa30183631d6f3597 | [
"Apache-2.0"
] | null | null | null | test_tracetools/test/test_pub_sub.py | Henrycious/ros2_tracing | d201ce4b4720ad71c922d5dfa30183631d6f3597 | [
"Apache-2.0"
] | null | null | null | test_tracetools/test/test_pub_sub.py | Henrycious/ros2_tracing | d201ce4b4720ad71c922d5dfa30183631d6f3597 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Christophe Bedard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 42.380192 | 98 | 0.684357 |
import unittest
from launch.actions import SetEnvironmentVariable
from tracetools_test.case import TraceTestCase
from tracetools_trace.tools import tracepoints as tp
class TestPubSub(TraceTestCase):
def __init__(self, *args) -> None:
super().__init__(
*args,
session... | true | true |
f70e941ad501593c69646c1d51172a53cac84224 | 3,438 | py | Python | IPython/utils/tests/test_jsonutil.py | flexlee/ipython | 7528fbd76073c90262b9ac127de57c4c59b23a5c | [
"BSD-3-Clause-Clear"
] | 1 | 2018-09-24T13:45:40.000Z | 2018-09-24T13:45:40.000Z | IPython/utils/tests/test_jsonutil.py | andreasjansson/ipython | 09b4311726f46945b936c699f7a6489d74d7397f | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/utils/tests/test_jsonutil.py | andreasjansson/ipython | 09b4311726f46945b936c699f7a6489d74d7397f | [
"BSD-3-Clause-Clear"
] | 1 | 2020-05-03T10:25:12.000Z | 2020-05-03T10:25:12.000Z | """Test suite for our JSON utilities.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distributed as part of this software.
#-... | 32.742857 | 78 | 0.506981 |
import json
from base64 import decodestring
import nose.tools as nt
from IPython.testing import decorators as dec
from ..jsonutil import json_clean, encode_images
from ..py3compat import unicode_to_str, str_to_bytes
def test():
pairs = [(1, None),
(1.0, None),
... | true | true |
f70e941e15a39ccab967128409f18a00fc06093a | 2,673 | py | Python | SpotifyDownloader/SpotifyWebAPI.py | Hugo4400/Spotify-Downloader | a128a401d39b16df397f56e07802bd6e65e1710e | [
"MIT"
] | 9 | 2021-06-16T08:44:07.000Z | 2022-02-11T17:19:05.000Z | SpotifyDownloader/SpotifyWebAPI.py | Hugo4400/Spotify-Downloader | a128a401d39b16df397f56e07802bd6e65e1710e | [
"MIT"
] | 3 | 2021-06-16T08:21:18.000Z | 2021-12-12T14:49:15.000Z | SpotifyDownloader/SpotifyWebAPI.py | Hugo4400/Spotify-Downloader | a128a401d39b16df397f56e07802bd6e65e1710e | [
"MIT"
] | 2 | 2021-06-17T22:08:22.000Z | 2021-07-08T21:45:47.000Z | import requests
from urllib.parse import urlencode
from urllib.request import urlopen
from urllib.error import HTTPError
import re
import json
from base64 import b64encode
def get_playlists(spotify_url):
with open('MY_SECRETS.json', 'r') as f:
spotify_key = json.load(f)['SPOTIFY_KEY']
pl... | 33 | 135 | 0.616162 | import requests
from urllib.parse import urlencode
from urllib.request import urlopen
from urllib.error import HTTPError
import re
import json
from base64 import b64encode
def get_playlists(spotify_url):
with open('MY_SECRETS.json', 'r') as f:
spotify_key = json.load(f)['SPOTIFY_KEY']
pl... | true | true |
f70e94b149473aa9ed65477fe96bca78b862bbc6 | 5,033 | py | Python | src/collective/solr/manager.py | adrianschulz/collective.solr | 2d76fe01a02174d383fdc335d38ee52afa8bfa27 | [
"ZPL-1.1"
] | null | null | null | src/collective/solr/manager.py | adrianschulz/collective.solr | 2d76fe01a02174d383fdc335d38ee52afa8bfa27 | [
"ZPL-1.1"
] | 1 | 2020-05-20T06:02:00.000Z | 2020-07-14T13:36:58.000Z | src/collective/solr/manager.py | adrianschulz/collective.solr | 2d76fe01a02174d383fdc335d38ee52afa8bfa27 | [
"ZPL-1.1"
] | null | null | null | # -*- coding: utf-8 -*-
from collective.solr.interfaces import ISolrConnectionManager
from collective.solr.interfaces import IZCMLSolrConnectionConfig
from collective.solr.local import getLocal
from collective.solr.local import setLocal
from collective.solr.solr import SolrConnection
from collective.solr.utils import g... | 38.419847 | 85 | 0.642956 |
from collective.solr.interfaces import ISolrConnectionManager
from collective.solr.interfaces import IZCMLSolrConnectionConfig
from collective.solr.local import getLocal
from collective.solr.local import setLocal
from collective.solr.solr import SolrConnection
from collective.solr.utils import getConfig
from collectiv... | true | true |
f70e95585af52e0b03e70818b18ac47fb4f46f63 | 26,001 | py | Python | evaluation/macrobenchmark/workload/models/classification.py | DelphianCalamity/PrivateKube | 14f575e77021ab7baca30f4061140ec83bdc96a7 | [
"Apache-2.0"
] | 9 | 2021-06-16T00:22:45.000Z | 2021-11-25T07:19:11.000Z | evaluation/macrobenchmark/workload/models/classification.py | DelphianCalamity/PrivateKube | 14f575e77021ab7baca30f4061140ec83bdc96a7 | [
"Apache-2.0"
] | 2 | 2021-11-14T10:42:43.000Z | 2022-03-16T03:43:22.000Z | evaluation/macrobenchmark/workload/models/classification.py | DelphianCalamity/PrivateKube | 14f575e77021ab7baca30f4061140ec83bdc96a7 | [
"Apache-2.0"
] | 3 | 2021-04-08T08:08:48.000Z | 2021-12-24T01:42:20.000Z | import sys, os, shutil
import h5py
import time
import io
import random
import tempfile
from tqdm import tqdm
from absl import app, flags, logging
from ray.util.multiprocessing import Pool
import gcsfs
import numpy as np
from pathlib import Path
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble ... | 32.379826 | 121 | 0.614323 | import sys, os, shutil
import h5py
import time
import io
import random
import tempfile
from tqdm import tqdm
from absl import app, flags, logging
from ray.util.multiprocessing import Pool
import gcsfs
import numpy as np
from pathlib import Path
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble ... | true | true |
f70e95956c365ef8a6f6d6a43deb9ae598d92d2e | 8,683 | py | Python | xonsh/xoreutils/uptime.py | halloleo/xonsh | 3a34d9f2e347d5b4518d42a25a8b4080001ec748 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-10-30T15:13:54.000Z | 2020-10-30T15:13:54.000Z | xonsh/xoreutils/uptime.py | halloleo/xonsh | 3a34d9f2e347d5b4518d42a25a8b4080001ec748 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xonsh/xoreutils/uptime.py | halloleo/xonsh | 3a34d9f2e347d5b4518d42a25a8b4080001ec748 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | """
Provides a cross-platform way to figure out the system uptime.
Should work on damned near any operating system you can realistically expect
to be asked to write Python code for.
If this module is invoked as a stand-alone script, it will print the current
uptime in a human-readable format, or display an error messa... | 30.466667 | 83 | 0.625014 | import os
import sys
import time
import ctypes
import struct
import typing as tp
import xonsh.platform as xp
import xonsh.lazyimps as xlimps
import xonsh.lazyasd as xl
_BOOTTIME: tp.Optional[float] = None
def _uptime_osx():
global _BOOTTIME
bt = xlimps.macutils.sysctlbyname(b"kern.boottime", return_str=Fals... | true | true |
f70e96217e805d497d912559b61045f8ea83f841 | 6,295 | py | Python | xarray/core/nanops.py | LEGOS-CTOH/xarray | d543d09aaa7fdfc4f5f92edcd4e3c0af1207c95b | [
"Apache-2.0"
] | 1 | 2021-02-12T02:15:33.000Z | 2021-02-12T02:15:33.000Z | xarray/core/nanops.py | LEGOS-CTOH/xarray | d543d09aaa7fdfc4f5f92edcd4e3c0af1207c95b | [
"Apache-2.0"
] | null | null | null | xarray/core/nanops.py | LEGOS-CTOH/xarray | d543d09aaa7fdfc4f5f92edcd4e3c0af1207c95b | [
"Apache-2.0"
] | null | null | null | import numpy as np
from . import dtypes, nputils, utils
from .duck_array_ops import _dask_or_eager_func, count, fillna, isnull, where_method
from .pycompat import dask_array_type
try:
import dask.array as dask_array
except ImportError:
dask_array = None
def _replace_nan(a, val):
"""
replace nan in a... | 33.306878 | 86 | 0.678793 | import numpy as np
from . import dtypes, nputils, utils
from .duck_array_ops import _dask_or_eager_func, count, fillna, isnull, where_method
from .pycompat import dask_array_type
try:
import dask.array as dask_array
except ImportError:
dask_array = None
def _replace_nan(a, val):
mask = isnull(a)
ret... | true | true |
f70e963b0297a39ae5a52c25d46cbe5293ab6756 | 911 | py | Python | mover.py | ritiek/shapes-classifier | 1dab7ce174bae2cd95d603ada5bfc9a59911c8e6 | [
"MIT"
] | 5 | 2018-09-17T18:27:21.000Z | 2020-06-01T14:12:33.000Z | mover.py | ritiek/shapes-classifier | 1dab7ce174bae2cd95d603ada5bfc9a59911c8e6 | [
"MIT"
] | null | null | null | mover.py | ritiek/shapes-classifier | 1dab7ce174bae2cd95d603ada5bfc9a59911c8e6 | [
"MIT"
] | 1 | 2020-08-11T02:43:19.000Z | 2020-08-11T02:43:19.000Z | import random
import os
def move_all(data_type, shape):
dirpath = os.path.join(data_type, shape)
os.makedirs(dirpath, exist_ok=True)
for filename in os.listdir(shape):
if filename.endswith('.png'):
os.rename(os.path.join(shape, filename),
os.path.join(data_type, sh... | 30.366667 | 63 | 0.646542 | import random
import os
def move_all(data_type, shape):
dirpath = os.path.join(data_type, shape)
os.makedirs(dirpath, exist_ok=True)
for filename in os.listdir(shape):
if filename.endswith('.png'):
os.rename(os.path.join(shape, filename),
os.path.join(data_type, sh... | true | true |
f70e96c8cec0e377e59eeeec0b0401e2ea4cd129 | 15,679 | py | Python | main_verbq_working.py | thilinicooray/mac-network-pytorch | 0e4bf3f7f301570b652490f697758361c866f3c1 | [
"MIT"
] | null | null | null | main_verbq_working.py | thilinicooray/mac-network-pytorch | 0e4bf3f7f301570b652490f697758361c866f3c1 | [
"MIT"
] | null | null | null | main_verbq_working.py | thilinicooray/mac-network-pytorch | 0e4bf3f7f301570b652490f697758361c866f3c1 | [
"MIT"
] | null | null | null | import torch
#from imsitu_encoder_verbq import imsitu_encoder
from imsitu_encoder_roleqverbq_embdhz import imsitu_encoder
from imsitu_loader import imsitu_loader_roleq_updated
from imsitu_scorer_log import imsitu_scorer
import json
import model_verbq_working
import os
import utils
import time
import random
#from torchv... | 39.794416 | 177 | 0.586389 | import torch
from imsitu_encoder_roleqverbq_embdhz import imsitu_encoder
from imsitu_loader import imsitu_loader_roleq_updated
from imsitu_scorer_log import imsitu_scorer
import json
import model_verbq_working
import os
import utils
import time
import random
def train(model, train_loader, dev_loader, traindev_load... | true | true |
f70e97783eb7a110103eaab5ec9a5c9b120dce42 | 3,177 | py | Python | tests/test_app.py | Divjyot/SentimentAnalysis | f2ad46a3ac18a2c048ffc6b838fa68a2bb8febed | [
"MIT"
] | null | null | null | tests/test_app.py | Divjyot/SentimentAnalysis | f2ad46a3ac18a2c048ffc6b838fa68a2bb8febed | [
"MIT"
] | null | null | null | tests/test_app.py | Divjyot/SentimentAnalysis | f2ad46a3ac18a2c048ffc6b838fa68a2bb8febed | [
"MIT"
] | null | null | null | import pytest
from app import create_app
@pytest.fixture
def request_header_secret():
return "dev"
@pytest.fixture
def request_body_positive():
return {"query": "I am having a great day!"}
@pytest.fixture
def request_body_negative():
return {"query": "I am feeling sad today"}
@pytest.fixture
def htt... | 28.881818 | 118 | 0.745672 | import pytest
from app import create_app
@pytest.fixture
def request_header_secret():
return "dev"
@pytest.fixture
def request_body_positive():
return {"query": "I am having a great day!"}
@pytest.fixture
def request_body_negative():
return {"query": "I am feeling sad today"}
@pytest.fixture
def htt... | true | true |
f70e97c43309e5287f3d18538ed116d9df87ad0f | 6,451 | py | Python | virt/ansible-latest/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_s3user.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2020-03-29T18:41:01.000Z | 2020-03-29T18:41:01.000Z | ansible/ansible/modules/storage/purestorage/purefb_s3user.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 7 | 2020-09-07T17:27:56.000Z | 2022-03-02T06:25:46.000Z | ansible/ansible/modules/storage/purestorage/purefb_s3user.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 1 | 2020-10-30T12:48:24.000Z | 2020-10-30T12:48:24.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',... | 32.094527 | 133 | 0.656952 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: purefb_s3user
version_added: '2.8'
short_description: ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.