hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1ae3054f47c8c1db14bed1647e3e0aca454b22a9 | 1,101 | py | Python | toolbox_gui.py | Winand/audacity_toolbox | bb8614b0bff9bb9c1188ce4935080e22621d6a25 | [
"MIT"
] | 1 | 2021-08-02T00:52:41.000Z | 2021-08-02T00:52:41.000Z | toolbox_gui.py | Winand/audacity_toolbox | bb8614b0bff9bb9c1188ce4935080e22621d6a25 | [
"MIT"
] | null | null | null | toolbox_gui.py | Winand/audacity_toolbox | bb8614b0bff9bb9c1188ce4935080e22621d6a25 | [
"MIT"
] | null | null | null | import sys
from tkinter import Tk, Button, filedialog, messagebox
from audacity import get_label_tracks, save_label_track, get_tracks, init_pipe
from pathlib import Path
root = Tk()
root.title("Audacity Toolbox")
if sys.platform == 'win32':
root.attributes('-toolwindow', True)
root.minsize(150, 32)
# root.override... | 29.756757 | 92 | 0.687557 |
1ae307618579e4ebe0038bd6fe4262b7b396e3cf | 2,258 | py | Python | mlutils/data_split.py | DSciLab/mlutils | 352af36f2b34218b6551254f641427b7bbdd0f31 | [
"MIT"
] | null | null | null | mlutils/data_split.py | DSciLab/mlutils | 352af36f2b34218b6551254f641427b7bbdd0f31 | [
"MIT"
] | null | null | null | mlutils/data_split.py | DSciLab/mlutils | 352af36f2b34218b6551254f641427b7bbdd0f31 | [
"MIT"
] | null | null | null | from typing import List, Tuple, Any
import random
def split_by_proportion(
data_source: List[Any],
proportions: List[float]
) -> Tuple[List[Any]]:
if len(proportions) < 2:
raise ValueError(
f'length of proportions should be >= 2, '
f'len(proportions)={len(proportions)}')
... | 29.324675 | 72 | 0.576616 |
1ae31f9d33a23ada5489358d565d7ca400c12bb0 | 7,880 | py | Python | flags/generate_data.py | Prasad9/Detect-Flags-SSD | c0d662bde99ed8df33d72bd06d61d5eb869d31a5 | [
"MIT"
] | 13 | 2017-11-08T07:09:13.000Z | 2022-03-28T07:09:47.000Z | flags/generate_data.py | Prasad9/Detect-Flags-SSD | c0d662bde99ed8df33d72bd06d61d5eb869d31a5 | [
"MIT"
] | 3 | 2018-03-08T04:30:19.000Z | 2019-01-03T15:47:24.000Z | flags/generate_data.py | Prasad9/Detect-Flags-SSD | c0d662bde99ed8df33d72bd06d61d5eb869d31a5 | [
"MIT"
] | 5 | 2018-01-15T15:26:44.000Z | 2021-08-18T08:02:51.000Z | import argparse
from math import ceil, floor, pi, sqrt
from tqdm import tqdm
import numpy as np
import os
from sklearn.utils import shuffle
import shutil
import random
from data_utils.operations import tf_generate_images, write_label_file_entries, instantiate_global_variables
# Not doing import * but doing manually. I... | 53.605442 | 129 | 0.633376 |
1ae34d73da04b6cc0d2360561b03e3c11360e3ec | 7,068 | py | Python | tools/lintstack.py | deepanshhu/python-cinderclient | 2c0f74c708fd09c5ae813255aaa671073f2fe250 | [
"Apache-1.1"
] | null | null | null | tools/lintstack.py | deepanshhu/python-cinderclient | 2c0f74c708fd09c5ae813255aaa671073f2fe250 | [
"Apache-1.1"
] | null | null | null | tools/lintstack.py | deepanshhu/python-cinderclient | 2c0f74c708fd09c5ae813255aaa671073f2fe250 | [
"Apache-1.1"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2013, AT&T Labs, Yun Mao <yunmao@gmail.com>
# 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... | 31.695067 | 78 | 0.608234 |
1ae3624b0e37de5493ef2bfb6650f0ac59e39e5f | 4,615 | py | Python | rls/nn/represent_nets.py | StepNeverStop/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 371 | 2019-04-26T00:37:33.000Z | 2022-03-31T07:33:12.000Z | rls/nn/represent_nets.py | BlueFisher/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 47 | 2019-07-21T11:51:57.000Z | 2021-08-31T08:45:22.000Z | rls/nn/represent_nets.py | BlueFisher/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 102 | 2019-06-29T13:11:15.000Z | 2022-03-28T13:51:04.000Z | from typing import Dict, List
import torch as th
import torch.nn as nn
from rls.common.specs import SensorSpec
from rls.nn.networks import (EncoderNetwork, MemoryNetwork, MultiVectorNetwork,
MultiVisualNetwork)
from rls.utils.logging_utils import get_logger
logger = get_logger(__name__)
... | 36.054688 | 88 | 0.571831 |
1ae366a656e6dac81610ae629b74581ff836096a | 322 | py | Python | tbmodels/_ptools/__init__.py | henhans/TBmodels | 7424acaea8d91850d80bb48898af875430f25fa0 | [
"Apache-2.0"
] | 1 | 2021-01-18T13:55:40.000Z | 2021-01-18T13:55:40.000Z | tbmodels/_ptools/__init__.py | henhans/TBmodels | 7424acaea8d91850d80bb48898af875430f25fa0 | [
"Apache-2.0"
] | null | null | null | tbmodels/_ptools/__init__.py | henhans/TBmodels | 7424acaea8d91850d80bb48898af875430f25fa0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# (c) 2015-2018, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <greschd@gmx.ch>
import os
__all__ = [
f[:-3] for f in [os.path.basename(g) for g in os.listdir(os.path.dirname(os.path.abspath(__file__)))]
if (not f.startswith(('_', '.'))) and f.endswith('.py')
... | 29.272727 | 105 | 0.642857 |
1ae36c0d230c0929ecd1dac5c9eed5e8e3ae0269 | 36,177 | py | Python | integration_tests/src/main/python/cast_test.py | NVnavkumar/spark-rapids | ed7de6e27fc82dff06eea3fda9db30dd37635103 | [
"Apache-2.0"
] | null | null | null | integration_tests/src/main/python/cast_test.py | NVnavkumar/spark-rapids | ed7de6e27fc82dff06eea3fda9db30dd37635103 | [
"Apache-2.0"
] | null | null | null | integration_tests/src/main/python/cast_test.py | NVnavkumar/spark-rapids | ed7de6e27fc82dff06eea3fda9db30dd37635103 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021-2022, NVIDIA 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 law or agre... | 58.444265 | 199 | 0.695 |
1ae371b877c71a0274012039136095b74de1e8d1 | 7,865 | py | Python | coinmetrics/_data_collection.py | coinmetrics/api-client-python | 0649081013b87795f253269e3d7c0a19829b2e52 | [
"MIT"
] | 9 | 2021-08-31T17:16:38.000Z | 2022-03-25T01:44:26.000Z | coinmetrics/_data_collection.py | coinmetrics/api-client-python | 0649081013b87795f253269e3d7c0a19829b2e52 | [
"MIT"
] | 3 | 2021-09-15T17:36:04.000Z | 2022-02-14T22:49:59.000Z | coinmetrics/_data_collection.py | coinmetrics/api-client-python | 0649081013b87795f253269e3d7c0a19829b2e52 | [
"MIT"
] | 4 | 2021-12-28T04:24:50.000Z | 2022-03-22T21:10:42.000Z | from copy import deepcopy
from gzip import GzipFile
from io import BytesIO
from logging import getLogger
from time import sleep
from typing import Any, Dict, Iterable, Iterator, List, Optional, cast
from dateutil.parser import isoparse
import requests
from coinmetrics._typing import (
DataRetrievalFuncType,
D... | 31.971545 | 223 | 0.571774 |
1ae39c4676122a85dc6e0a1cf66546923e6814fe | 21,246 | py | Python | evaluate/amodalevalD2SA.py | zhixuanli/SLN-Amodal | 266c648f6838e37f3ada7223f212b21f730ffb64 | [
"MIT"
] | 25 | 2019-08-17T16:04:58.000Z | 2022-03-28T03:00:42.000Z | evaluate/amodalevalD2SA.py | zhixuanli/SLN-Amodal | 266c648f6838e37f3ada7223f212b21f730ffb64 | [
"MIT"
] | 6 | 2019-10-17T11:02:44.000Z | 2021-09-16T08:13:24.000Z | evaluate/amodalevalD2SA.py | zhixuanli/SLN-Amodal | 266c648f6838e37f3ada7223f212b21f730ffb64 | [
"MIT"
] | 6 | 2019-09-03T05:26:35.000Z | 2022-02-07T17:51:31.000Z | __author__ = 'yzhu'
import numpy as np
import datetime
import time
from collections import defaultdict
import json
from pycocotools import mask
import copy
import operator
import os.path
class AmodalEval:
def __init__(self, amodalGt=None, amodalDt=None,limit=-1):
'''
Initialize CocoEval using coc... | 42.071287 | 121 | 0.487151 |
1ae39c4c6a0b01ddb440e78180eb6cd57c9eeee0 | 3,596 | py | Python | rls/nn/networks.py | StepNeverStop/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 371 | 2019-04-26T00:37:33.000Z | 2022-03-31T07:33:12.000Z | rls/nn/networks.py | BlueFisher/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 47 | 2019-07-21T11:51:57.000Z | 2021-08-31T08:45:22.000Z | rls/nn/networks.py | BlueFisher/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 102 | 2019-06-29T13:11:15.000Z | 2022-03-28T13:51:04.000Z | #!/usr/bin/env python3
# encoding: utf-8
from typing import Dict, Optional
import torch as th
import torch.nn as nn
from rls.nn.activations import Act_REGISTER, default_act
from rls.nn.represents.encoders import End_REGISTER
from rls.nn.represents.memories import Rnn_REGISTER
from rls.nn.represents.vector... | 33.924528 | 90 | 0.537542 |
1ae3bc7f0e85532d33490023378ef3cd0daff74b | 957 | py | Python | Homework/Refactoring-Code/decompose_conditional.py | caocmai/SPD-2.31-Testing-and-Architecture | 5e9a86849dff795cc06c7a41af49c030df91eaa8 | [
"MIT"
] | null | null | null | Homework/Refactoring-Code/decompose_conditional.py | caocmai/SPD-2.31-Testing-and-Architecture | 5e9a86849dff795cc06c7a41af49c030df91eaa8 | [
"MIT"
] | null | null | null | Homework/Refactoring-Code/decompose_conditional.py | caocmai/SPD-2.31-Testing-and-Architecture | 5e9a86849dff795cc06c7a41af49c030df91eaa8 | [
"MIT"
] | null | null | null | # By Kami Bigdely
# Decompose conditional: You have a complicated conditional(if-then-else) statement. Extract
# methods from the condition, then part, and else part(s).
def sodium_nitrate_in(ingredients):
if "sodium nitrate" in ingredients:
return True
return False
def sodium_benzoate_in(ingredients)... | 25.864865 | 102 | 0.693835 |
1ae3c397af752827a7d06c6862a0a6ae3d67167a | 24,619 | py | Python | std/huggingface/run_speech_recognition_ctc.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | std/huggingface/run_speech_recognition_ctc.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | std/huggingface/run_speech_recognition_ctc.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | 40.227124 | 158 | 0.671717 |
1ae3e2adfa505f14cea8224954833677bd4479bd | 2,481 | py | Python | chapter5/python/p10.py | pinakm9/simulation | 6f19ec681005ef4112c03dcef80fa090da4102ff | [
"MIT"
] | 1 | 2020-04-23T11:19:20.000Z | 2020-04-23T11:19:20.000Z | chapter5/python/p10.py | pinakm9/simulation | 6f19ec681005ef4112c03dcef80fa090da4102ff | [
"MIT"
] | null | null | null | chapter5/python/p10.py | pinakm9/simulation | 6f19ec681005ef4112c03dcef80fa090da4102ff | [
"MIT"
] | null | null | null | # This script requires 1 command line argument: sample size
import sys
from simulate import RVContinuous, Simulation
from scipy.stats import binom, gamma
import numpy as np
# unpack command-line arguments
sample_size = int(sys.argv[1])
# raise all floating point errors
np.seterr(all = 'raise')
# problem parameters
n... | 38.765625 | 133 | 0.731157 |
1ae3eb06f6554bb9697de5a255760df12b25347f | 13,658 | py | Python | python/examples/core/transform.py | webmiche/iree-llvm-sandbox | 7511f8c210c586b44fc47a836a9cbfaa438acaf0 | [
"Apache-2.0"
] | null | null | null | python/examples/core/transform.py | webmiche/iree-llvm-sandbox | 7511f8c210c586b44fc47a836a9cbfaa438acaf0 | [
"Apache-2.0"
] | null | null | null | python/examples/core/transform.py | webmiche/iree-llvm-sandbox | 7511f8c210c586b44fc47a836a9cbfaa438acaf0 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import functools
from mlir.ir import Module
from mlir.passmanager import PassManager
import typing as tp
import mlir.dialects.iree_linalg_transform as tx
from copy import deepcopy
from .variables import Variable
class _TransformThenDescriptor:
"""Python descriptor dispatching `t... | 38.150838 | 97 | 0.682238 |
1ae3f4f8f9e1f4796df0f0729ab7e8d4bd571d9d | 600 | py | Python | scheduler/test/test_location_and_recordings.py | uw-it-aca/django-panopto-scheduler | cf92ad9541b634ad86e383949c9ac86d42bc785f | [
"Apache-2.0"
] | 1 | 2020-07-29T20:33:35.000Z | 2020-07-29T20:33:35.000Z | scheduler/test/test_location_and_recordings.py | uw-it-aca/django-panopto-scheduler | cf92ad9541b634ad86e383949c9ac86d42bc785f | [
"Apache-2.0"
] | 5 | 2015-11-09T23:42:09.000Z | 2020-11-10T23:11:35.000Z | scheduler/test/test_location_and_recordings.py | uw-it-aca/django-panopto-scheduler | cf92ad9541b634ad86e383949c9ac86d42bc785f | [
"Apache-2.0"
] | 1 | 2015-10-09T19:11:29.000Z | 2015-10-09T19:11:29.000Z | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.test import TestCase
from scheduler.utils import course_location_and_recordings
from scheduler.utils.validation import Validation
import logging
# silence suds debugging telemetry
logging.getLogger('suds').setLevel(log... | 30 | 66 | 0.79 |
1ae420f11f898d69daf1bd3401baab4b2bbc1c26 | 922 | py | Python | tests/test_clients/test_methods/test_errors/test_bot_not_found.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 13 | 2021-01-21T12:43:10.000Z | 2022-03-23T11:11:59.000Z | tests/test_clients/test_methods/test_errors/test_bot_not_found.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 259 | 2020-02-26T08:51:03.000Z | 2022-03-23T11:08:36.000Z | tests/test_clients/test_methods/test_errors/test_bot_not_found.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 5 | 2019-12-02T16:19:22.000Z | 2021-11-22T20:33:34.000Z | import uuid
from http import HTTPStatus
import pytest
from botx.clients.methods.errors.bot_not_found import BotNotFoundError
from botx.clients.methods.v2.bots.token import Token
from botx.concurrency import callable_to_coroutine
pytestmark = pytest.mark.asyncio
pytest_plugins = ("tests.test_clients.fixtures",)
asy... | 31.793103 | 82 | 0.729935 |
1ae441b23cfe3c995b2e6496247b7cc03c10b772 | 639 | py | Python | src/dataset/DatasetPackage.py | dhruvtapasvi/implementation | 964980f431517f4548a87172a05107cdf700fb84 | [
"MIT"
] | 1 | 2020-05-25T10:24:58.000Z | 2020-05-25T10:24:58.000Z | src/dataset/DatasetPackage.py | dhruvtapasvi/implementation | 964980f431517f4548a87172a05107cdf700fb84 | [
"MIT"
] | 1 | 2017-12-18T02:16:44.000Z | 2017-12-18T02:16:44.000Z | src/dataset/DatasetPackage.py | dhruvtapasvi/implementation | 964980f431517f4548a87172a05107cdf700fb84 | [
"MIT"
] | null | null | null | from dataset.interpolate import InterpolateDatasetLoader
from dataset.loader import DatasetLoader
class DatasetPackage:
def __init__(self, name: str, datasetLoader: DatasetLoader, interpolateLoader: InterpolateDatasetLoader):
self.__name = name
self.__datasetLoader = datasetLoader
self.__i... | 29.045455 | 109 | 0.737089 |
1ae4480d2d85b417524672c64fb5edb09e09a562 | 1,470 | py | Python | test.py | nikhilk/autocli | 0bee19d2687a8c87f28bc7ffa34a581ca999e896 | [
"BSD-3-Clause"
] | 2 | 2017-11-17T07:02:17.000Z | 2017-12-28T23:17:34.000Z | test.py | nikhilk/autocli | 0bee19d2687a8c87f28bc7ffa34a581ca999e896 | [
"BSD-3-Clause"
] | null | null | null | test.py | nikhilk/autocli | 0bee19d2687a8c87f28bc7ffa34a581ca999e896 | [
"BSD-3-Clause"
] | null | null | null | # test.py
# Demonstrates basic usage of autocli
import autocli
import enum
import json
class OS(enum.Enum):
Mac = 1
Linux = 2
Windows = 3
class Computer(object):
os = OS.Mac
version = '1.0'
count = 1
cpu = 3.75
ram = 16.0
disk = True
gpu = False
volumes = ['']
metadata = json.loads
user_tag... | 20.136986 | 85 | 0.594558 |
1ae44ad231e90aaf6f1604f14d96a2b51353856d | 2,971 | py | Python | back/matchmaker/models.py | HaeSe0ng/SWPP | 3bfc95edd2b341283d8d63d398b05e74605d54af | [
"Apache-2.0"
] | 2 | 2019-09-16T08:06:45.000Z | 2019-12-17T14:35:51.000Z | back/matchmaker/models.py | HaeSe0ng/SWPP | 3bfc95edd2b341283d8d63d398b05e74605d54af | [
"Apache-2.0"
] | 43 | 2019-10-05T02:45:23.000Z | 2020-07-18T11:15:00.000Z | back/matchmaker/models.py | eodmsabc/SNU-SWPP | 3a2453b6747e9e198fda5174a208ca1f2f3e6cd3 | [
"Apache-2.0"
] | 3 | 2019-12-16T05:48:11.000Z | 2019-12-17T14:43:09.000Z | '''
matchmaker models
'''
from django.db import models
from django.utils import timezone
from django.conf import settings
from django_mysql.models import ListCharField
class Category(models.Model):
'''
Category model
'''
name = models.CharField(max_length=45)
indexes = ListCharField(
max_l... | 28.028302 | 76 | 0.687311 |
1ae45e50f31ebe90c3252f247d2732e497c818ad | 33,615 | py | Python | python/lib/dcoscli/tests/integrations/test_package.py | isabella232/dcos-core-cli | 11f2a26fd568b5e1501057a62ad013eb79acfd92 | [
"Apache-2.0",
"MIT"
] | 3 | 2019-04-23T05:31:19.000Z | 2021-11-15T19:18:23.000Z | python/lib/dcoscli/tests/integrations/test_package.py | dcos/dcos-core-cli | 11f2a26fd568b5e1501057a62ad013eb79acfd92 | [
"Apache-2.0",
"MIT"
] | 356 | 2018-07-26T15:17:56.000Z | 2022-03-29T21:06:06.000Z | python/lib/dcoscli/tests/integrations/test_package.py | isabella232/dcos-core-cli | 11f2a26fd568b5e1501057a62ad013eb79acfd92 | [
"Apache-2.0",
"MIT"
] | 22 | 2018-07-24T13:20:51.000Z | 2021-11-15T19:18:26.000Z | import contextlib
import json
import os
import subprocess
import sys
import pytest
import six
from dcos import config, constants, errors, http, subcommand, util
from dcoscli.test.common import (assert_command, assert_lines, base64_to_dict,
delete_zk_nodes, exec_command,
... | 33.954545 | 104 | 0.605503 |
1ae46de580717a3b2e857ecda27064bdf36716de | 1,914 | py | Python | tempest/thirdparty/boto/test_s3_objects.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | tempest/thirdparty/boto/test_s3_objects.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | tempest/thirdparty/boto/test_s3_objects.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 36.807692 | 78 | 0.673459 |
1ae477fdd7e5bdb1aa95c7735b53199e6b295f0b | 24,391 | py | Python | ckan/logic/__init__.py | larrycameron80/ckan | fbab8f51b36a293206fdd998d71ece27d2565951 | [
"Apache-2.0"
] | null | null | null | ckan/logic/__init__.py | larrycameron80/ckan | fbab8f51b36a293206fdd998d71ece27d2565951 | [
"Apache-2.0"
] | 4 | 2020-03-24T17:53:23.000Z | 2021-03-31T19:19:03.000Z | ckan/logic/__init__.py | larrycameron80/ckan | fbab8f51b36a293206fdd998d71ece27d2565951 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import functools
import logging
import re
from collections import defaultdict
import six
from six import string_types, text_type
import ckan.model as model
import ckan.authz as authz
import ckan.lib.navl.dictization_functions as df
import ckan.plugins as p
from ckan.common import _, c
log = loggi... | 33.923505 | 79 | 0.62355 |
1ae4afb3b92564a3a532b3c2a7613999be2257cc | 3,416 | py | Python | src/excerpt_server.py | joy13975/covidprof_submission | b3c7bb0ebf6fa1557edb8d1ca5d3d41377508e7d | [
"MIT"
] | null | null | null | src/excerpt_server.py | joy13975/covidprof_submission | b3c7bb0ebf6fa1557edb8d1ca5d3d41377508e7d | [
"MIT"
] | null | null | null | src/excerpt_server.py | joy13975/covidprof_submission | b3c7bb0ebf6fa1557edb8d1ca5d3d41377508e7d | [
"MIT"
] | null | null | null | import logging
import json
import sys
from http.server import BaseHTTPRequestHandler, HTTPServer
from excerpt_gen import ExcerptGen
from base.config_loader import ConfigLoader
class ExcerptServer(ConfigLoader):
def run(self, **kwargs):
# allow command line arguments to overwrite config
for k, v i... | 37.955556 | 77 | 0.520492 |
1ae4b4dc06c0d145fecaf8777c74e1f47e4d8121 | 85,010 | py | Python | twisted/test/test_process.py | sxamit/twisted | 30f6966329c857c3631c60aeb420d84d7828e01e | [
"MIT",
"Unlicense"
] | 1 | 2017-08-07T14:52:02.000Z | 2017-08-07T14:52:02.000Z | Lib/site-packages/twisted/test/test_process.py | adzhou/Python27 | a7113b69d54a04cc780143241c2f1fe81939ad3a | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/twisted/test/test_process.py | adzhou/Python27 | a7113b69d54a04cc780143241c2f1fe81939ad3a | [
"bzip2-1.0.6"
] | 1 | 2018-11-07T12:52:07.000Z | 2018-11-07T12:52:07.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test running processes.
@var CONCURRENT_PROCESS_TEST_COUNT: The number of concurrent processes to use
to stress-test the spawnProcess API. This value is tuned to a number of
processes which has been determined to stay below various
... | 32.176382 | 94 | 0.582437 |
1ae4d018281d7bfba4170faa87e7a1659e949577 | 5,386 | py | Python | python_modules/dagster/dagster_tests/core_tests/snap_tests/test_old_execution_plan_snapshot.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/snap_tests/test_old_execution_plan_snapshot.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/snap_tests/test_old_execution_plan_snapshot.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import pytest
from dagster import pipeline
from dagster.core.errors import DagsterInvariantViolationError
from dagster.core.execution.plan.plan import ExecutionPlan
from dagster.serdes import deserialize_json_to_dagster_namedtuple
OLD_EXECUTION_PLAN_SNAPSHOT = """{
"__class_... | 26.93 | 162 | 0.534163 |
1ae4fd4b24fd21d9b482a4e2b41d83299cb3078b | 7,427 | py | Python | onadata/apps/logger/south_migrations/0005_auto__add_field_xform_xls__add_field_xform_json__add_field_xform_share.py | ubpd/kobocat | 45906e07e8f05c30e3e26bab5570a8ab1ee264db | [
"BSD-2-Clause"
] | null | null | null | onadata/apps/logger/south_migrations/0005_auto__add_field_xform_xls__add_field_xform_json__add_field_xform_share.py | ubpd/kobocat | 45906e07e8f05c30e3e26bab5570a8ab1ee264db | [
"BSD-2-Clause"
] | null | null | null | onadata/apps/logger/south_migrations/0005_auto__add_field_xform_xls__add_field_xform_json__add_field_xform_share.py | ubpd/kobocat | 45906e07e8f05c30e3e26bab5570a8ab1ee264db | [
"BSD-2-Clause"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals, print_function, division, absolute_import
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field ... | 65.725664 | 182 | 0.574121 |
1ae50ed7ab4357a53eeea976a2518e4068e59aee | 4,048 | py | Python | Parsing/island_parser.py | nicole-binder/CS322-NLP | 6ad0a78fe1cb11697484a822ca6975aa9af5f070 | [
"MIT"
] | null | null | null | Parsing/island_parser.py | nicole-binder/CS322-NLP | 6ad0a78fe1cb11697484a822ca6975aa9af5f070 | [
"MIT"
] | null | null | null | Parsing/island_parser.py | nicole-binder/CS322-NLP | 6ad0a78fe1cb11697484a822ca6975aa9af5f070 | [
"MIT"
] | null | null | null | from recursive_descent_parser import RecursiveDescentParser
from grammar_engine import GrammarEngine
class IslandParser:
def __init__(self, grammar, verbose = False):
self.parser = RecursiveDescentParser(grammar = grammar, verbose = verbose)
self.grammar = grammar
self.partial_parses = list()
def pars... | 39.300971 | 260 | 0.664032 |
1ae525580094c2bd971f9edaf46b1b3a06f17b4d | 8,925 | py | Python | srttools/monitor/webserver.py | TheDebbio/srt-single-dish-tools | a01059f888a55d4b3c9d0768d61c58ae005961ca | [
"BSD-3-Clause"
] | null | null | null | srttools/monitor/webserver.py | TheDebbio/srt-single-dish-tools | a01059f888a55d4b3c9d0768d61c58ae005961ca | [
"BSD-3-Clause"
] | 1 | 2020-03-02T17:10:19.000Z | 2020-03-02T17:10:19.000Z | srttools/monitor/webserver.py | TheDebbio/srt-single-dish-tools | a01059f888a55d4b3c9d0768d61c58ae005961ca | [
"BSD-3-Clause"
] | null | null | null | import threading
import asyncio
import json
import base64
try:
import tornado.web
import tornado.websocket
from tornado.log import access_log
except ImportError:
raise ImportError('To use SDTmonitor, you need to install tornado: \n'
'\n > pip install tornado')
from srttools.... | 34.593023 | 104 | 0.485826 |
1ae526a2b7407eda2dc54f02617db78dd955b45c | 1,217 | py | Python | docsim/embedding/fasttext.py | tarohi24/docsim | 4879bcc889c32470a27094eb183c2ce15ae2f1fb | [
"MIT"
] | 1 | 2020-04-29T13:52:29.000Z | 2020-04-29T13:52:29.000Z | docsim/embedding/fasttext.py | tarohi24/docsim | 4879bcc889c32470a27094eb183c2ce15ae2f1fb | [
"MIT"
] | 136 | 2019-09-19T03:36:21.000Z | 2019-11-28T08:50:45.000Z | docsim/embedding/fasttext.py | tarohi24/docsim | 4879bcc889c32470a27094eb183c2ce15ae2f1fb | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import Dict, List, Set, Optional
import fasttext
import numpy as np
from docsim.embedding.base import Model, return_matrix, return_vector
from docsim.settings import models_dir
@dataclass
class FastText(Model):
model: fasttext.FastText._FastText = field(init=... | 32.026316 | 81 | 0.618735 |
1ae52f48e99b043e58f5c1e6f102bb0eeb21950f | 11,168 | py | Python | docs/conf.py | michielbakker/infostop | 6d9b7c319bff07c347735cab77ea0b85e7ad4a99 | [
"MIT"
] | 1 | 2021-05-07T02:26:28.000Z | 2021-05-07T02:26:28.000Z | docs/conf.py | alexandradec/infostop2 | b5f45a50bb8722f200939d6ac44487fe046bffa2 | [
"MIT"
] | null | null | null | docs/conf.py | alexandradec/infostop2 | b5f45a50bb8722f200939d6ac44487fe046bffa2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# _infostop documentation build configuration file, created by
# sphinx-quickstart on Fri Feb 26 00:29:33 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | 31.817664 | 94 | 0.686336 |
1ae547e6ce9c539b3850bdbfc34d070a36e08dfe | 108 | py | Python | test/python/LIM2Metrics/py2/base/common/Python057/Python057.py | sagodiz/SonarQube-plug-in | 4f8e111baecc4c9f9eaa5cd3d7ebeb1e365ace2c | [
"BSD-4-Clause"
] | 20 | 2015-06-16T17:39:10.000Z | 2022-03-20T22:39:40.000Z | test/python/LIM2Metrics/py2/base/common/Python057/Python057.py | sagodiz/SonarQube-plug-in | 4f8e111baecc4c9f9eaa5cd3d7ebeb1e365ace2c | [
"BSD-4-Clause"
] | 29 | 2015-12-29T19:07:22.000Z | 2022-03-22T10:39:02.000Z | test/python/LIM2Metrics/py2/base/common/Python057/Python057.py | sagodiz/SonarQube-plug-in | 4f8e111baecc4c9f9eaa5cd3d7ebeb1e365ace2c | [
"BSD-4-Clause"
] | 12 | 2015-08-28T01:22:18.000Z | 2021-09-25T08:17:31.000Z | nums = range(2, 50)
for i in range(2, 8):
nums = filter(lambda x: x == i or x % i, nums)
print nums | 21.6 | 51 | 0.564815 |
1ae5745dd078425f3ca5c4bd0324ad17af880a23 | 18,488 | py | Python | test/test_format_it.py | joanisc/lingua-franca | 96fd7d82282f0ec9b1507385ac6be3d6b29ab23b | [
"Apache-2.0"
] | null | null | null | test/test_format_it.py | joanisc/lingua-franca | 96fd7d82282f0ec9b1507385ac6be3d6b29ab23b | [
"Apache-2.0"
] | null | null | null | test/test_format_it.py | joanisc/lingua-franca | 96fd7d82282f0ec9b1507385ac6be3d6b29ab23b | [
"Apache-2.0"
] | 1 | 2022-02-14T08:30:27.000Z | 2022-02-14T08:30:27.000Z | #
# Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 51.071823 | 79 | 0.549978 |
1ae59fd3f3b3249156fcfbccf0d8e1409dc05b77 | 5,619 | py | Python | lingvo/core/gpipe_test.py | tom-doerr/lingvo | 2441edc7fee78903502ebd528ab4dc309db0001d | [
"Apache-2.0"
] | 4 | 2019-06-08T00:19:06.000Z | 2020-08-03T16:28:53.000Z | lingvo/core/gpipe_test.py | tom-doerr/lingvo | 2441edc7fee78903502ebd528ab4dc309db0001d | [
"Apache-2.0"
] | null | null | null | lingvo/core/gpipe_test.py | tom-doerr/lingvo | 2441edc7fee78903502ebd528ab4dc309db0001d | [
"Apache-2.0"
] | 5 | 2018-12-11T08:05:16.000Z | 2020-05-30T03:40:13.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.052941 | 80 | 0.697099 |
1ae5c28ecc009ffa631de9b46e451c88aad7898e | 117,884 | py | Python | pyiron_atomistics/atomistics/structure/atoms.py | pyiron/pyiron_atomistic | 0cd4c910806f44dfc829ddd642e323efcf7e36d5 | [
"BSD-3-Clause"
] | 14 | 2021-01-18T10:03:56.000Z | 2022-03-01T20:59:35.000Z | pyiron_atomistics/atomistics/structure/atoms.py | pyiron/pyiron_atomistics | 0cd4c910806f44dfc829ddd642e323efcf7e36d5 | [
"BSD-3-Clause"
] | 569 | 2018-04-12T06:37:14.000Z | 2022-03-31T18:06:27.000Z | pyiron_atomistics/atomistics/structure/atoms.py | pyiron/pyiron_atomistic | 0cd4c910806f44dfc829ddd642e323efcf7e36d5 | [
"BSD-3-Clause"
] | 6 | 2018-10-23T09:48:48.000Z | 2022-02-13T12:13:00.000Z | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from __future__ import division, print_function
from ase.atoms import Atoms as ASEAtoms, Atom as ASEAtom
from ase.symbol... | 36.361505 | 120 | 0.565047 |
1ae5e62468a73344ab5b0ad747ab03c95a7de8ee | 15,161 | py | Python | ajp4py/ajp_types.py | argherna/ajp4py | afa6d55029774fc6e0c5d33f3733216288eb89a0 | [
"Apache-2.0"
] | 4 | 2020-02-09T05:47:10.000Z | 2022-02-28T07:54:51.000Z | ajp4py/ajp_types.py | argherna/ajp4py | afa6d55029774fc6e0c5d33f3733216288eb89a0 | [
"Apache-2.0"
] | 3 | 2020-02-09T05:42:09.000Z | 2020-03-10T22:21:50.000Z | ajp4py/ajp_types.py | argherna/ajp4py | afa6d55029774fc6e0c5d33f3733216288eb89a0 | [
"Apache-2.0"
] | 1 | 2020-02-12T15:39:06.000Z | 2020-02-12T15:39:06.000Z | '''
ajp_types.py
Types used by ajp4py. Provides enum types to avoid the use of magic
numbers in the code.
'''
from enum import Enum, IntEnum
# No magic numbers! I **HATE** them! Use these enums instead.
DEFAULT_AJP_SERVER_PORT = 8009
FORM_ENCODED = 'application/x-www-form-urlencoded'
APPLICATION_JSON = 'application... | 35.841608 | 100 | 0.717697 |
1ae6188ddb9f31d8fc75eafb1671f78864866b2a | 32,260 | py | Python | MSclassv2.py | mprakhar/BK_ATR | 0c0bc0d2ba30fe30b622601784d439ea8c8930c3 | [
"MIT"
] | null | null | null | MSclassv2.py | mprakhar/BK_ATR | 0c0bc0d2ba30fe30b622601784d439ea8c8930c3 | [
"MIT"
] | null | null | null | MSclassv2.py | mprakhar/BK_ATR | 0c0bc0d2ba30fe30b622601784d439ea8c8930c3 | [
"MIT"
] | null | null | null | # __author__ = 'Prakhar MISRA'
# Created 08/21/2017
# Last edit 09/5/2017
#Purpose:
#-----------------
# (a) To read pre-processed PolSAR iamge
# To create functions for:
# (b) watershed algo
# (c) textural features
# (c) Image Region Adjacency graph
# (d) H... | 36.247191 | 189 | 0.547334 |
1ae66d017c0c96b74ceafd8f92f265b05b0491c7 | 3,410 | py | Python | test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/_auto_rest_parameterized_host_test_paging_client.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/_auto_rest_parameterized_host_test_paging_client.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/_auto_rest_parameterized_host_test_paging_client.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.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 may ... | 43.717949 | 104 | 0.690029 |
1ae685f3461bffdd8acefe1849945695448b3e95 | 3,089 | py | Python | codes/MIGraph/GraphConv/FragmentateGraphs.py | KentaroKutsukake/Integrating-multiple-materials-science-projects | a6f09583718fc00431a3ce67d5fc6f026646f91c | [
"MIT"
] | 5 | 2020-07-31T01:35:49.000Z | 2021-07-30T13:05:48.000Z | codes/MIGraph/GraphConv/FragmentateGraphs.py | KentaroKutsukake/Integrating-multiple-materials-science-projects | a6f09583718fc00431a3ce67d5fc6f026646f91c | [
"MIT"
] | null | null | null | codes/MIGraph/GraphConv/FragmentateGraphs.py | KentaroKutsukake/Integrating-multiple-materials-science-projects | a6f09583718fc00431a3ce67d5fc6f026646f91c | [
"MIT"
] | 2 | 2020-10-21T19:17:06.000Z | 2021-05-17T10:38:41.000Z |
"""
INCOMPLETED
fragmentate graphs, to increase the number of training data (, but not done in the paper.)
"""
import networkx as nx
from tqdm import tqdm
import copy
import joblib
import itertools
from joblib import Parallel, delayed
import random
def prepFragmentatedGList(gList,targetNode):
"""
gList: ... | 25.528926 | 123 | 0.625769 |
1ae68b5739eea3ea5a721c647fb38f546adc3233 | 16,482 | py | Python | collections/ansible_collections/theforeman/foreman/plugins/modules/activation_key.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | null | null | null | collections/ansible_collections/theforeman/foreman/plugins/modules/activation_key.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | null | null | null | collections/ansible_collections/theforeman/foreman/plugins/modules/activation_key.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | 2 | 2021-03-30T14:26:02.000Z | 2021-04-01T18:17:29.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Andrew Kofink <ajkofink@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) ... | 41.726582 | 159 | 0.617886 |
1ae69dd9d7e9cad557d9f92381d439d535f9277e | 7,964 | py | Python | apps/peano_refinded_acoustic_3d_heterogeneous/verify_acoustics.py | arashb/pyclaw | dbe0bc28ed801b16c501bdff58012c30f7a90b9f | [
"BSD-3-Clause"
] | 1 | 2018-03-26T11:51:17.000Z | 2018-03-26T11:51:17.000Z | apps/peano_refinded_acoustic_3d_heterogeneous/verify_acoustics.py | arashb/pyclaw | dbe0bc28ed801b16c501bdff58012c30f7a90b9f | [
"BSD-3-Clause"
] | null | null | null | apps/peano_refinded_acoustic_3d_heterogeneous/verify_acoustics.py | arashb/pyclaw | dbe0bc28ed801b16c501bdff58012c30f7a90b9f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
import numpy as np
import clawpack.peanoclaw as peanoclaw
import wavefront as wf
from clawpack import pyclaw
XI = -1.0
XF = 1.0
LENGTH = XF - XI
SUBDIVISION_FACTOR = 30
CELLS = 1
INIT_MIN_MESH_WIDTH = LENGTH / CELLS / SUBDIVISION_FACTOR
NUM_OUTPUT_TIMES = 10
TEST_LEVEL = 15
NUM... | 30.868217 | 121 | 0.590532 |
1ae6cd33b5f012911af4f3964c6e5fb2a0b00df3 | 684 | py | Python | checkArmstrongNumberThreeDigits.py | trishahanlon/algorithms-review | 4e08938526020204d0a7f47982b46c05b0973636 | [
"Apache-2.0"
] | null | null | null | checkArmstrongNumberThreeDigits.py | trishahanlon/algorithms-review | 4e08938526020204d0a7f47982b46c05b0973636 | [
"Apache-2.0"
] | null | null | null | checkArmstrongNumberThreeDigits.py | trishahanlon/algorithms-review | 4e08938526020204d0a7f47982b46c05b0973636 | [
"Apache-2.0"
] | null | null | null | # check whether an n-digit integer is an Armstrong number or not
# in case of Armstrong number of 3 digits: the sum of the cubes of each digit is equal to the number itself
# 153 = 1*1*1 + 5*5*5 + 3*3*3
num = int(input("Enter a number: "))
sum = 0
temp = num
print("Temp before while:", temp)
while temp > 0:
# NO... | 26.307692 | 107 | 0.624269 |
1ae6f277a2ab596d94764eb63d26189f46c52644 | 3,128 | py | Python | loggers_control/scripts/agents/vpg.py | IRASatUC/two_loggers | c5c99868a9c896aa2fdb940f2f7b7173abed9e00 | [
"MIT"
] | null | null | null | loggers_control/scripts/agents/vpg.py | IRASatUC/two_loggers | c5c99868a9c896aa2fdb940f2f7b7173abed9e00 | [
"MIT"
] | null | null | null | loggers_control/scripts/agents/vpg.py | IRASatUC/two_loggers | c5c99868a9c896aa2fdb940f2f7b7173abed9e00 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
import sys
import os
import numpy as np
import random
import tensorflow as tf
import rospy
from utils import data_utils
from utils import solo_utils
from utils.data_utils import bcolors
from tensorflow.keras.layers import Dense
from tensorflow.keras imp... | 37.238095 | 99 | 0.675831 |
1ae70e0699ddefb6e26f5b483f16467403d123e8 | 272 | py | Python | pni_customization/pni_customization/doctype/pre_installation_check/pre_installation_check.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | pni_customization/pni_customization/doctype/pre_installation_check/pre_installation_check.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | pni_customization/pni_customization/doctype/pre_installation_check/pre_installation_check.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Jigar Tarpara and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class PreInstallationCheck(Document):
pass
| 24.727273 | 52 | 0.783088 |
1ae7159250c4863586de49adcbed9db23e32d327 | 1,438 | py | Python | tests/test_internals.py | Martin-HiPi/rpi-backlight | a7b4b619f5adf16502aa7b18571098814b0bbac0 | [
"MIT"
] | 243 | 2016-10-02T16:26:38.000Z | 2022-03-26T22:35:13.000Z | tests/test_internals.py | Martin-HiPi/rpi-backlight | a7b4b619f5adf16502aa7b18571098814b0bbac0 | [
"MIT"
] | 42 | 2016-11-01T14:22:33.000Z | 2022-03-27T19:54:27.000Z | tests/test_internals.py | Martin-HiPi/rpi-backlight | a7b4b619f5adf16502aa7b18571098814b0bbac0 | [
"MIT"
] | 39 | 2016-10-19T19:35:03.000Z | 2022-03-26T15:35:16.000Z | import pytest
from rpi_backlight import Backlight, _permission_denied
from rpi_backlight.utils import FakeBacklightSysfs
def test_permission_denied() -> None:
with pytest.raises(PermissionError):
_permission_denied()
def test_get_value() -> None:
with FakeBacklightSysfs() as backlight_sysfs:
... | 34.238095 | 96 | 0.742698 |
1ae7342399fd4f5b0e374d6d6318d747ea0f7cf4 | 14,726 | py | Python | canvas_course_site_wizard/tests/test_async_command.py | Harvard-University-iCommons/django-canvas-course-site-wizard | 0210849e959407e5a850188f50756eb69b9a4dc2 | [
"MIT"
] | null | null | null | canvas_course_site_wizard/tests/test_async_command.py | Harvard-University-iCommons/django-canvas-course-site-wizard | 0210849e959407e5a850188f50756eb69b9a4dc2 | [
"MIT"
] | 5 | 2018-05-10T19:49:43.000Z | 2021-01-29T19:39:34.000Z | canvas_course_site_wizard/tests/test_async_command.py | Harvard-University-iCommons/django-canvas-course-site-wizard | 0210849e959407e5a850188f50756eb69b9a4dc2 | [
"MIT"
] | null | null | null | from django.test import TestCase
from mock import patch, ANY, DEFAULT, Mock, MagicMock
from canvas_course_site_wizard.models import CanvasCourseGenerationJob
from canvas_course_site_wizard.management.commands import process_async_jobs
from canvas_course_site_wizard.exceptions import (CanvasCourseAlreadyExistsError, Cop... | 47.811688 | 127 | 0.730613 |
1ae7542f3bff14bbb3212ddacf011ae221d4e9c1 | 3,585 | py | Python | imodels/util/tree_interaction_utils.py | csinva/interpretability-implementations-demos | 0223114225d0e077007b1ad49f63b64f3ff5ee15 | [
"MIT"
] | 102 | 2019-07-16T13:45:35.000Z | 2020-09-14T19:12:49.000Z | imodels/util/tree_interaction_utils.py | csinva/interpretability-implementations-demos | 0223114225d0e077007b1ad49f63b64f3ff5ee15 | [
"MIT"
] | 2 | 2020-01-03T20:47:14.000Z | 2020-01-03T21:17:39.000Z | imodels/util/tree_interaction_utils.py | csinva/interpretability-implementations-demos | 0223114225d0e077007b1ad49f63b64f3ff5ee15 | [
"MIT"
] | 8 | 2019-08-09T08:40:34.000Z | 2020-09-06T17:51:10.000Z | import itertools
from typing import Set, Tuple
import numpy as np
import pandas as pd
def make_rj(n=300, p=50):
"""Generates data according to the model in Radchenko & James, 2010
X_i ~ Unif([0,1]^p)
y = sqrt(0.5)[sum_{i=1}^5 f_i(x) + f_1(x)f_2(x) + f_1(x)f_3(x)] + N(0,1)
f_1(x) = x1, f_2(x) = (1+x2)... | 29.385246 | 125 | 0.588563 |
1ae7df0386cb33fff3bbc5030ab29435e4837605 | 5,831 | py | Python | posthog/api/test/test_event_definition.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | null | null | null | posthog/api/test/test_event_definition.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | 1 | 2022-02-15T00:47:35.000Z | 2022-02-15T00:47:35.000Z | posthog/api/test/test_event_definition.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | 1 | 2021-09-08T19:45:03.000Z | 2021-09-08T19:45:03.000Z | import random
from typing import Dict
from rest_framework import status
from posthog.demo import create_demo_team
from posthog.models import EventDefinition, Organization, Team
from posthog.tasks.calculate_event_property_usage import calculate_event_property_usage_for_team
from posthog.test.base import APIBaseTest
... | 48.190083 | 120 | 0.671754 |
1ae7e8f8519d1834b1266dbbc5d5d89f6797ef0d | 386 | py | Python | ignite/contrib/metrics/__init__.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | null | null | null | ignite/contrib/metrics/__init__.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | null | null | null | ignite/contrib/metrics/__init__.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | null | null | null | from ignite.contrib.metrics.average_precision import AveragePrecision
from ignite.contrib.metrics.roc_auc import ROC_AUC, RocCurve
from ignite.contrib.metrics.precision_recall_curve import PrecisionRecallCurve
import ignite.contrib.metrics.regression
from ignite.contrib.metrics.gpu_info import GpuInfo
from ignite.contr... | 55.142857 | 82 | 0.88601 |
1ae7f62740cac107c01efd40954b02247d140997 | 1,052 | py | Python | examples/playground.py | Socian-Ltd/python-facebook-1 | e9a4f626b37541103c9534a29342ef6033c09c06 | [
"Apache-2.0"
] | null | null | null | examples/playground.py | Socian-Ltd/python-facebook-1 | e9a4f626b37541103c9534a29342ef6033c09c06 | [
"Apache-2.0"
] | null | null | null | examples/playground.py | Socian-Ltd/python-facebook-1 | e9a4f626b37541103c9534a29342ef6033c09c06 | [
"Apache-2.0"
] | 1 | 2021-08-25T05:34:14.000Z | 2021-08-25T05:34:14.000Z | import logging
import arrow
from pyfacebook import Api
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
FB_ACCESS_TOKEN = "1330160143827784|XNa7iu-8NuHjiHxta3PoFwD_05s"
graph_api = Api(long_term_token=FB_ACCESS_TOKEN, sleep_on_rate_limit=True)
def crawl_posts(page_id, since_timestamp, ... | 33.935484 | 155 | 0.719582 |
1ae815a3a4d8b6cfdf64ba002fc95dbc4975ace6 | 2,096 | py | Python | dataset/tfrecords/images_queue.py | AltumTek/deep-koalarization | b5a16751a40484ca4990e0b9c005fe31c3301812 | [
"MIT"
] | 23 | 2018-08-16T12:50:01.000Z | 2021-12-27T13:13:10.000Z | dataset/tfrecords/images_queue.py | Kriztoper/deep-koalarization | 7d45895272ac457cc2b4df836ff23598d889d49c | [
"MIT"
] | 22 | 2018-08-27T04:49:57.000Z | 2022-03-11T23:43:18.000Z | dataset/tfrecords/images_queue.py | Kriztoper/deep-koalarization | 7d45895272ac457cc2b4df836ff23598d889d49c | [
"MIT"
] | 7 | 2018-08-27T15:32:59.000Z | 2020-04-20T14:48:40.000Z | import multiprocessing
from os.path import join, expanduser
import tensorflow as tf
def queue_single_images_from_folder(folder):
# Normalize the path
folder = expanduser(folder)
# This queue will yield a filename every time it is polled
file_matcher = tf.train.match_filenames_once(join(folder, '*.jp... | 33.806452 | 80 | 0.700382 |
1ae817c80de1794831fecf68909d8ca3bbb81d3b | 12,598 | py | Python | addons/dataverse/tests/test_views.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 1 | 2015-10-02T18:35:53.000Z | 2015-10-02T18:35:53.000Z | addons/dataverse/tests/test_views.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 4 | 2016-05-13T14:24:16.000Z | 2017-03-30T15:28:31.000Z | addons/dataverse/tests/test_views.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from nose.tools import (assert_false, assert_equal, assert_in, assert_true)
import mock
import pytest
import unittest
import httplib as http
from addons.base.tests.views import OAuthAddonConfigViewsTestCaseMixin
from addons.dataverse.models import DataverseProvider
from addons.dataverse.tests... | 41.035831 | 102 | 0.686379 |
1ae81d9a5f0e82e7d8a0df580681c5cdfbd096ab | 624 | py | Python | examples/biased-coin-flip/prior-pdf.py | jedbrown/pakman | 16f605a2dd153f00829b596cce3cdd458b6cefb5 | [
"BSD-3-Clause"
] | 14 | 2019-11-09T15:07:47.000Z | 2021-04-06T14:46:20.000Z | examples/biased-coin-flip/prior-pdf.py | jedbrown/pakman | 16f605a2dd153f00829b596cce3cdd458b6cefb5 | [
"BSD-3-Clause"
] | 1 | 2020-09-16T18:12:52.000Z | 2020-10-31T19:00:09.000Z | examples/biased-coin-flip/prior-pdf.py | jedbrown/pakman | 16f605a2dd153f00829b596cce3cdd458b6cefb5 | [
"BSD-3-Clause"
] | 3 | 2019-12-25T06:11:06.000Z | 2020-03-12T19:02:32.000Z | from sys import argv, stdin, stdout, stderr
# Process arguments
if len(argv) != 3:
stderr.write("Usage: {} Q_LOW Q_HIGH\n"
"Return probability density of uniform distribution with \n"
"lower bound Q_LOW and upper bound Q_HIGH "
"for given parameter\n".format(argv[0]))
exit(... | 24.96 | 72 | 0.637821 |
1ae826f707be580d86589bd585d9ee4ef4324d7b | 1,030 | py | Python | src/leave.py | AvanindraC/Discord | c98ad97954ffe6caebaf0864374e379e996d079e | [
"MIT"
] | null | null | null | src/leave.py | AvanindraC/Discord | c98ad97954ffe6caebaf0864374e379e996d079e | [
"MIT"
] | null | null | null | src/leave.py | AvanindraC/Discord | c98ad97954ffe6caebaf0864374e379e996d079e | [
"MIT"
] | null | null | null | def requirements():
return "dev_users, re"
def main(client, dev_users, re):
import discord
@client.command()
async def leave_server(ctx, *, server_name):
if str(ctx.author.id) in dev_users:
guild = discord.utils.get(client.guilds, name=server_name)
if guild is None:
... | 44.782609 | 173 | 0.64466 |
1ae8599a8e162a63592897c1e4469e954ae62ac3 | 4,063 | py | Python | Python version/main.py | harrycrow/RDM | 23f746d63b1de9ec09d8ee3f7d07a3caa644d0a1 | [
"MIT"
] | null | null | null | Python version/main.py | harrycrow/RDM | 23f746d63b1de9ec09d8ee3f7d07a3caa644d0a1 | [
"MIT"
] | null | null | null | Python version/main.py | harrycrow/RDM | 23f746d63b1de9ec09d8ee3f7d07a3caa644d0a1 | [
"MIT"
] | null | null | null |
import tqdm
import time
import codecs
import math
from torch.utils.data import DataLoader, TensorDataset, RandomSampler, ConcatDataset
from optim import ProjAdagrad, Radagrad
from model import *
def train():
dim = 20
window_max = 3
batch_size = 128
n_epochs = 15
n_words = 75752
n_docs = 18846... | 37.62037 | 100 | 0.565346 |
1ae874d749fa9608099f3a1fae26824e0beac201 | 6,609 | py | Python | src/mldrift/tabular/_utils/constants.py | lostmygithubaccount/mldiff | 9c24724614dba676daba3d7d28c6faa264992596 | [
"MIT"
] | 1 | 2022-03-05T19:39:18.000Z | 2022-03-05T19:39:18.000Z | src/mldrift/tabular/_utils/constants.py | lostmygithubaccount/mldrift | 9c24724614dba676daba3d7d28c6faa264992596 | [
"MIT"
] | null | null | null | src/mldrift/tabular/_utils/constants.py | lostmygithubaccount/mldrift | 9c24724614dba676daba3d7d28c6faa264992596 | [
"MIT"
] | null | null | null | # ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
DATADRIFT_KEY = "_datadrift"
DATADRIFT_SERVICES = "_services"
DATADRIFT_VERSION = "_version"
DATADRIFT_VERSION_VALUE = 1.0
DATADRIFT_SCHEDU... | 34.602094 | 75 | 0.819035 |
1ae879bd7e4f34767e169ce91c892050a86f23ae | 1,188 | py | Python | pyfatfs/_exceptions.py | abrasive/pyfatfs | a35586bfa2b1d3f8d4638142407db68f9318b86d | [
"MIT"
] | null | null | null | pyfatfs/_exceptions.py | abrasive/pyfatfs | a35586bfa2b1d3f8d4638142407db68f9318b86d | [
"MIT"
] | null | null | null | pyfatfs/_exceptions.py | abrasive/pyfatfs | a35586bfa2b1d3f8d4638142407db68f9318b86d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Custom Exceptions for PyFAT."""
class PyFATException(Exception):
"""Generic PyFAT Exceptions."""
def __init__(self, msg: str, errno=None):
"""Construct base class for PyFAT exceptions.
:param msg: Exception message describing what happened
:param errno: Er... | 30.461538 | 78 | 0.679293 |
1ae8a3bd842ee7329323ac6a8888379deb6bcf2c | 18,144 | py | Python | trimesh/scene/viewer.py | nbraem/trimesh | 63b56b90cb764e1138d6c373fab58ddff3fcae75 | [
"MIT"
] | null | null | null | trimesh/scene/viewer.py | nbraem/trimesh | 63b56b90cb764e1138d6c373fab58ddff3fcae75 | [
"MIT"
] | null | null | null | trimesh/scene/viewer.py | nbraem/trimesh | 63b56b90cb764e1138d6c373fab58ddff3fcae75 | [
"MIT"
] | null | null | null | import pyglet
import pyglet.gl as gl
import numpy as np
import tempfile
import platform
import collections
from .. import rendering
from ..transformations import Arcball
from ..util import log
# smooth only when fewer faces than this
_SMOOTH_MAX_FACES = 100000
class SceneViewer(pyglet.window.Window):
def __i... | 34.892308 | 80 | 0.549824 |
1ae8b9377582a8cbe8e828fa48b0c5ae7c740c32 | 22 | py | Python | tests/data/test_splitter.py | PhoenixDL/PytorchLightningTools | 86185062d4792e6d5eae002a5594bb7b900106a1 | [
"MIT"
] | 3 | 2020-05-18T06:34:52.000Z | 2020-07-17T07:11:57.000Z | tests/data/test_splitter.py | PhoenixDL/PytorchLightningTools | 86185062d4792e6d5eae002a5594bb7b900106a1 | [
"MIT"
] | 6 | 2021-06-25T18:21:06.000Z | 2021-06-25T18:21:32.000Z | tests/data/test_splitter.py | PhoenixDL/PytorchLightningTools | 86185062d4792e6d5eae002a5594bb7b900106a1 | [
"MIT"
] | 1 | 2020-05-18T06:34:56.000Z | 2020-05-18T06:34:56.000Z | # TODO: test splitter
| 11 | 21 | 0.727273 |
1ae8d173328e922d2857ec952b594664034f904d | 5,329 | py | Python | main/convenience_redirect/redirector.py | mahkhaled/class2go | b32cb441e8d96c257f70cb61274812ebeed2649d | [
"Apache-2.0"
] | 1 | 2020-11-09T02:59:29.000Z | 2020-11-09T02:59:29.000Z | main/convenience_redirect/redirector.py | sunu/class2go | 653b1edd01d390ad387dd788e0fc2d89445fbcab | [
"Apache-2.0"
] | null | null | null | main/convenience_redirect/redirector.py | sunu/class2go | 653b1edd01d390ad387dd788e0fc2d89445fbcab | [
"Apache-2.0"
] | null | null | null | import re
from django.utils.log import getLogger
from django.http import HttpResponse, HttpResponseRedirect
from c2g.models import CurrentTermMap, Course
class convenience_redirector(object):
"""
This is a middleware class that forwards request coming in on convenience domains to the appropriate place.
Fo... | 48.009009 | 145 | 0.609308 |
1ae8d57a68e26b9662497e63aeafa6816d664ab5 | 3,409 | py | Python | clrs/_src/encoders.py | carolinssc/clrs-1 | bbd7230501a97e04b4ca687b5cffbf43e6569204 | [
"Apache-2.0"
] | null | null | null | clrs/_src/encoders.py | carolinssc/clrs-1 | bbd7230501a97e04b4ca687b5cffbf43e6569204 | [
"Apache-2.0"
] | null | null | null | clrs/_src/encoders.py | carolinssc/clrs-1 | bbd7230501a97e04b4ca687b5cffbf43e6569204 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 31.564815 | 80 | 0.682312 |
1ae92924226ea54d7d80376b9116d7202f5a069e | 1,518 | py | Python | deeppavlov/agents/filters/transparent_filter.py | ineersa/DeepPavlov | 8200bf9a0f0b378baad4ee0eb75b59453f516004 | [
"Apache-2.0"
] | 3 | 2020-04-16T04:25:10.000Z | 2021-05-07T23:04:43.000Z | deeppavlov/agents/filters/transparent_filter.py | ineersa/DeepPavlov | 8200bf9a0f0b378baad4ee0eb75b59453f516004 | [
"Apache-2.0"
] | 12 | 2020-01-28T22:14:04.000Z | 2022-02-10T00:10:17.000Z | deeppavlov/agents/filters/transparent_filter.py | ineersa/DeepPavlov | 8200bf9a0f0b378baad4ee0eb75b59453f516004 | [
"Apache-2.0"
] | 1 | 2022-02-08T14:41:28.000Z | 2022-02-08T14:41:28.000Z | # Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# 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 applicab... | 33.733333 | 76 | 0.6917 |
1ae93168774382133f0857449327a9cab251e7d9 | 11,249 | py | Python | fedopt_guide/training_loop.py | JYWa/federated | 8073bfa355f56db073349eefb0bcbafbf4e73733 | [
"Apache-2.0"
] | null | null | null | fedopt_guide/training_loop.py | JYWa/federated | 8073bfa355f56db073349eefb0bcbafbf4e73733 | [
"Apache-2.0"
] | null | null | null | fedopt_guide/training_loop.py | JYWa/federated | 8073bfa355f56db073349eefb0bcbafbf4e73733 | [
"Apache-2.0"
] | 1 | 2021-03-09T09:48:56.000Z | 2021-03-09T09:48:56.000Z | # Copyright 2020, Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 42.609848 | 80 | 0.749044 |
1ae94199492f88dd873ef17baf88a0453c4551c0 | 13,724 | py | Python | controller/preprocessing_controller.py | euxhenh/cellar | 679387216043f3d287ea29a15f78868f412d2948 | [
"MIT"
] | null | null | null | controller/preprocessing_controller.py | euxhenh/cellar | 679387216043f3d287ea29a15f78868f412d2948 | [
"MIT"
] | null | null | null | controller/preprocessing_controller.py | euxhenh/cellar | 679387216043f3d287ea29a15f78868f412d2948 | [
"MIT"
] | null | null | null | import gc
import os
import traceback
from ast import literal_eval
import dash
import numpy as np
import scanpy as sc
from BinToGene import BinToGene
from app import app, dbroot, logger
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from anndata import AnnData
from .cellar... | 34.139303 | 81 | 0.593704 |
1ae95db5c37975d9d6f77080923403a5808fc33e | 10,827 | py | Python | scripts/03-describedof.py | OlafHaag/NeuroPsyResearchAnalysis | 83d750310ee2467979d503d2fb4b6011ead9e9fc | [
"MIT"
] | null | null | null | scripts/03-describedof.py | OlafHaag/NeuroPsyResearchAnalysis | 83d750310ee2467979d503d2fb4b6011ead9e9fc | [
"MIT"
] | null | null | null | scripts/03-describedof.py | OlafHaag/NeuroPsyResearchAnalysis | 83d750310ee2467979d503d2fb4b6011ead9e9fc | [
"MIT"
] | null | null | null | # notebook source: 03-oh-describe_dof.ipynb
# %% [markdown]
# # Descriptive Statistics of Degrees of Freedom
#
# %%
# Basic imports and setup.
import sys
import logging
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pingouin as pg
import plotly.express as px
... | 43.657258 | 118 | 0.638958 |
1ae9698339cb62270d9d2252ab823ff6c2c0fe1c | 2,233 | py | Python | tests/test_auth.py | Muhammad-R/flaskr | 16f33963653fa758c9402b91f2f4723ba3d7a6db | [
"MIT"
] | 2 | 2021-03-04T08:23:20.000Z | 2021-12-19T16:41:54.000Z | tests/test_auth.py | Muhammad-R/flaskr | 16f33963653fa758c9402b91f2f4723ba3d7a6db | [
"MIT"
] | null | null | null | tests/test_auth.py | Muhammad-R/flaskr | 16f33963653fa758c9402b91f2f4723ba3d7a6db | [
"MIT"
] | 2 | 2021-09-14T20:57:35.000Z | 2021-12-19T15:26:58.000Z | import pytest
from flask import g, session
from flaskr.db import get_db
def test_register(client, app):
assert client.get("/auth/register").status_code == 200
response = client.post(
"/auth/register",
data={"username": "a", "password": "a"}
)
# When redirecting, then there will be a L... | 32.838235 | 77 | 0.650246 |
1ae96d3425c8473b39289e23693618d19ee5f4ff | 7,136 | py | Python | examples/common/async_tornado_client_serial.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | null | null | null | examples/common/async_tornado_client_serial.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | 1 | 2020-10-29T12:01:38.000Z | 2022-03-21T02:39:59.000Z | examples/common/async_tornado_client_serial.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
Pymodbus Asynchronous Client Examples
--------------------------------------------------------------------------
The following is an example of how to use the asynchronous serial modbus
client implementation from pymodbus using tornado.
"""
# -------------------------------------------------... | 38.994536 | 79 | 0.478559 |
1ae9ded9a5d548dac76872c1a456cd458c31ff1e | 2,138 | py | Python | tests/tasks/test_load_hacs_repository.py | Lucstricke/integration | 1543686f3d99c8f16ec4fc37b2edd70b2a3e29a5 | [
"MIT"
] | 1 | 2021-12-12T18:19:48.000Z | 2021-12-12T18:19:48.000Z | tests/tasks/test_load_hacs_repository.py | Lucstricke/integration | 1543686f3d99c8f16ec4fc37b2edd70b2a3e29a5 | [
"MIT"
] | null | null | null | tests/tasks/test_load_hacs_repository.py | Lucstricke/integration | 1543686f3d99c8f16ec4fc37b2edd70b2a3e29a5 | [
"MIT"
] | null | null | null | # pylint: disable=missing-function-docstring,missing-module-docstring, protected-access
from unittest.mock import AsyncMock, patch
import pytest
from custom_components.hacs.base import HacsBase, HacsRepositories
from custom_components.hacs.enums import HacsDisabledReason
from custom_components.hacs.exceptions import ... | 30.985507 | 96 | 0.753508 |
1ae9f98e7db686ceb714d2e68ef53969fad6a8f5 | 1,164 | py | Python | tests/test_binance_adapter.py | Privex/python-exchange | 858d5d2499bba0169fd58763aa3214b3d4e8dc80 | [
"X11"
] | null | null | null | tests/test_binance_adapter.py | Privex/python-exchange | 858d5d2499bba0169fd58763aa3214b3d4e8dc80 | [
"X11"
] | 5 | 2020-08-15T17:40:52.000Z | 2021-09-22T19:05:52.000Z | tests/test_binance_adapter.py | Privex/python-exchange | 858d5d2499bba0169fd58763aa3214b3d4e8dc80 | [
"X11"
] | 1 | 2021-02-28T18:02:04.000Z | 2021-02-28T18:02:04.000Z | from decimal import Decimal
from privex.exchange import Binance
import pytest
import nest_asyncio
from tests.base_rates import *
nest_asyncio.apply()
@pytest.fixture()
async def adapter():
adapter = Binance()
yield adapter
del adapter
@pytest.mark.asyncio
async def test_get_pair_btcusd(adapter: Binanc... | 21.962264 | 53 | 0.705326 |
1aea19efd216a17a3fa4888acd69a65248a325ad | 32,023 | py | Python | python_modules/dagster/dagster/core/definitions/events.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/definitions/events.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/definitions/events.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | import re
import warnings
from enum import Enum
from typing import (
TYPE_CHECKING,
AbstractSet,
Any,
Callable,
Dict,
List,
Mapping,
NamedTuple,
Optional,
Sequence,
Union,
cast,
)
from dagster import check, seven
from dagster.core.errors import DagsterInvalidAssetKey
fro... | 38.581928 | 117 | 0.64335 |
1aea4742dc128bf40fd34042c74657d3b63d71ab | 6,900 | py | Python | src/model/continual_learning/models/DistillationModel.py | tyler-hayes/Continual-Analogical-Reasoning | 5fed325259d7178aa4c21fa7ec3fd0ee24961049 | [
"MIT"
] | 5 | 2021-04-19T10:28:13.000Z | 2022-01-13T17:04:26.000Z | src/model/continual_learning/models/DistillationModel.py | tyler-hayes/Continual-Analogical-Reasoning | 5fed325259d7178aa4c21fa7ec3fd0ee24961049 | [
"MIT"
] | null | null | null | src/model/continual_learning/models/DistillationModel.py | tyler-hayes/Continual-Analogical-Reasoning | 5fed325259d7178aa4c21fa7ec3fd0ee24961049 | [
"MIT"
] | 2 | 2021-10-13T15:27:29.000Z | 2022-02-17T16:01:40.000Z | import time
import sys
from copy import deepcopy
import numpy as np
import math
import torch
import torch.optim as optim
import torch.nn as nn
import continual_learning.utils as utils
class DistillationModel(object):
def __init__(self, args, classifier='RPM_Solver', num_epochs=50, temperature=2, lamda=1, fine_... | 40.588235 | 124 | 0.584203 |
1aea60a9c8953c9ca1cc01eb9aa966434adf8436 | 3,133 | py | Python | src/spaceone/inventory/model/pool_model.py | choonho/inventory | cc89757490d28fecb7ffccdfd6f89d4c0aa40da5 | [
"Apache-2.0"
] | null | null | null | src/spaceone/inventory/model/pool_model.py | choonho/inventory | cc89757490d28fecb7ffccdfd6f89d4c0aa40da5 | [
"Apache-2.0"
] | null | null | null | src/spaceone/inventory/model/pool_model.py | choonho/inventory | cc89757490d28fecb7ffccdfd6f89d4c0aa40da5 | [
"Apache-2.0"
] | null | null | null | from mongoengine import *
from datetime import datetime
from spaceone.core.model.mongo_model import MongoModel
from spaceone.inventory.model.zone_model import Zone
from spaceone.inventory.model.region_model import Region
class Pool(MongoModel):
pool_id = StringField(max_length=40, generate_id='pool', unique=True... | 24.865079 | 73 | 0.470795 |
1aeab1dd744d72b3718b1cd2c293ed1d71c9a1c5 | 2,074 | py | Python | FlowGridViz/util/apitool.py | Bradnowak/Flowlytic | d5b0951901b97d5546f2ecd700eee5b78c689646 | [
"BSD-2-Clause"
] | 1 | 2019-05-02T15:51:55.000Z | 2019-05-02T15:51:55.000Z | FlowGridViz/util/apitool.py | Bradnowak/Flowlytic | d5b0951901b97d5546f2ecd700eee5b78c689646 | [
"BSD-2-Clause"
] | 62 | 2019-04-24T14:28:45.000Z | 2019-05-03T22:16:49.000Z | FlowGridViz/util/apitool.py | Bradnowak/Flowlytic | d5b0951901b97d5546f2ecd700eee5b78c689646 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import requests
from requests_http_signature import HTTPSignatureAuth
import sys
import warnings
from cryptography.utils import CryptographyDeprecationWarning
# the requests_http_signature module uses the old name for some functions
# the following line stops that warning from appearing on every ... | 33.451613 | 91 | 0.696721 |
1aeabb24ca1231ad4ea2be9e1d8033bfc3ff3f66 | 2,924 | py | Python | textrenderer/noiser.py | Sand0001/OCR_textrender_jap_chn_eng | 87a01946bb8cd5229d2babcdf42a18df5b3e561f | [
"MIT"
] | null | null | null | textrenderer/noiser.py | Sand0001/OCR_textrender_jap_chn_eng | 87a01946bb8cd5229d2babcdf42a18df5b3e561f | [
"MIT"
] | null | null | null | textrenderer/noiser.py | Sand0001/OCR_textrender_jap_chn_eng | 87a01946bb8cd5229d2babcdf42a18df5b3e561f | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import random
# https://stackoverflow.com/questions/22937589/how-to-add-noise-gaussian-salt-and-pepper-etc-to-image-in-python-with-opencv
class Noiser(object):
def __init__(self, cfg):
self.cfg = cfg
def apply(self, img):
"""
:param img: word image with ... | 28.38835 | 123 | 0.557798 |
1aeaca3c2240ffd0cc4cb2b29aaed6a01c4d63f4 | 4,657 | py | Python | update_google_fit.py | UoA-eResearch/fit_api | 0d451ea1f03cfc52d258572258c8ce026cbabfbc | [
"MIT"
] | 19 | 2017-07-03T13:51:42.000Z | 2021-10-31T11:30:07.000Z | update_google_fit.py | UoA-eResearch/fit_api | 0d451ea1f03cfc52d258572258c8ce026cbabfbc | [
"MIT"
] | 15 | 2017-07-17T23:41:35.000Z | 2019-02-12T23:11:40.000Z | update_google_fit.py | UoA-eResearch/fit_api | 0d451ea1f03cfc52d258572258c8ce026cbabfbc | [
"MIT"
] | 4 | 2018-04-03T08:14:42.000Z | 2021-05-27T09:51:14.000Z | #!/usr/bin/env python
import json
from datetime import datetime
import MySQLdb.cursors
import httplib2
import pytz
from googleapiclient.discovery import build
from oauth2client import client
import backend
def get_aggregate(fit_service, startTimeMillis, endTimeMillis, dataSourceId):
return fit_service.users().d... | 42.724771 | 112 | 0.598454 |
1aead9b3ec83b84b5ea07a3823387ddc20c92ee8 | 7,017 | py | Python | oscar/lib/python2.7/site-packages/sqlparse/formatter.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/sqlparse/formatter.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/sqlparse/formatter.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Andi Albrecht, albrecht.andi@gmail.com
#
# This module is part of python-sqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
"""SQL formatter"""
from sqlparse import filters
from sqlparse.exceptions import SQLParseErro... | 38.554945 | 79 | 0.61693 |
1aeafd8383ec7f89a138d5c87d83421e38475660 | 1,285 | py | Python | src/ralph_scrooge/settings-test-scrooge.py | kula1922/ralph_pricing | 3887ff7a900f10a7630f451dd39f86da829ce3da | [
"Apache-2.0"
] | null | null | null | src/ralph_scrooge/settings-test-scrooge.py | kula1922/ralph_pricing | 3887ff7a900f10a7630f451dd39f86da829ce3da | [
"Apache-2.0"
] | null | null | null | src/ralph_scrooge/settings-test-scrooge.py | kula1922/ralph_pricing | 3887ff7a900f10a7630f451dd39f86da829ce3da | [
"Apache-2.0"
] | 1 | 2021-11-15T21:21:17.000Z | 2021-11-15T21:21:17.000Z | #
# A testing profile.
#
import os
TEST_DATABASE_ENGINE = os.environ.get('TEST_DATABASE_ENGINE')
if TEST_DATABASE_ENGINE == 'mysql':
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'ralph_test',
'USER': 'root',
'HOST': 'localhost',
... | 23.363636 | 72 | 0.51751 |
1aeb04cc09687664595cc758ad5125fb5094e670 | 2,861 | py | Python | src/ipywidgets_toggle_buttons/multi_toggle_buttons.py | stas-prokopiev/ipywidgets_toggle_buttons | 84d1afde1d02c19fb6a41b20e17b9d2b1c7980e2 | [
"MIT"
] | null | null | null | src/ipywidgets_toggle_buttons/multi_toggle_buttons.py | stas-prokopiev/ipywidgets_toggle_buttons | 84d1afde1d02c19fb6a41b20e17b9d2b1c7980e2 | [
"MIT"
] | null | null | null | src/ipywidgets_toggle_buttons/multi_toggle_buttons.py | stas-prokopiev/ipywidgets_toggle_buttons | 84d1afde1d02c19fb6a41b20e17b9d2b1c7980e2 | [
"MIT"
] | null | null | null | """class MultiToggleButtons"""
# Standard library imports
import logging
from collections import OrderedDict
# Third party imports
import ipywidgets
# Local imports
from .layouts import DICT_LAYOUT_HBOX_ANY
from .abc_toggle_buttons import BaseToggleButtons
LOGGER = logging.getLogger(__name__)
class MultiToggleButt... | 37.155844 | 77 | 0.650821 |
1aeb152fd9feed775958d152e3ecda0654be2bfb | 27,723 | py | Python | SCRAPE/Lib/site-packages/twisted/web/iweb.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | null | null | null | SCRAPE/Lib/site-packages/twisted/web/iweb.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | null | null | null | SCRAPE/Lib/site-packages/twisted/web/iweb.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | null | null | null | # -*- test-case-name: twisted.web.test -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Interface definitions for L{twisted.web}.
@var UNKNOWN_LENGTH: An opaque object which may be used as the value of
L{IBodyProducer.length} to indicate that the length of the entity
body is not... | 33.361011 | 93 | 0.642247 |
1aeb20ec7dc7d60de00c83119698bf000dba912e | 250 | py | Python | configs/_base_/default_runtime.py | kazakh-shai/kaggle-global-wheat-detection | b26295ea257f73089f1a067b70b4a7ee638f6b83 | [
"Apache-2.0"
] | 136 | 2020-08-24T08:18:16.000Z | 2022-03-31T13:45:12.000Z | configs/_base_/default_runtime.py | kazakh-shai/kaggle-global-wheat-detection | b26295ea257f73089f1a067b70b4a7ee638f6b83 | [
"Apache-2.0"
] | 5 | 2020-10-07T08:44:36.000Z | 2021-12-17T06:00:57.000Z | configs/_base_/default_runtime.py | kazakh-shai/kaggle-global-wheat-detection | b26295ea257f73089f1a067b70b4a7ee638f6b83 | [
"Apache-2.0"
] | 28 | 2020-08-24T11:07:07.000Z | 2022-01-01T13:07:54.000Z | checkpoint_config = dict(interval=4)
# yapf:disable
log_config = dict(interval=10, hooks=[dict(type="TextLoggerHook")])
# yapf:enable
dist_params = dict(backend="nccl")
log_level = "INFO"
load_from = None
resume_from = None
workflow = [("train", 1)]
| 25 | 67 | 0.732 |
1aeb22de3894ca4e64ae3f978593e436c7d9b2fe | 382 | py | Python | problem_set_1/clique.py | Combatd/Intro_to_Algorithms_CS215 | 3c28bcfd0266bcfdb6b9d3be13bd17f07dcb6032 | [
"MIT"
] | null | null | null | problem_set_1/clique.py | Combatd/Intro_to_Algorithms_CS215 | 3c28bcfd0266bcfdb6b9d3be13bd17f07dcb6032 | [
"MIT"
] | null | null | null | problem_set_1/clique.py | Combatd/Intro_to_Algorithms_CS215 | 3c28bcfd0266bcfdb6b9d3be13bd17f07dcb6032 | [
"MIT"
] | null | null | null | def clique(n):
print("in a clique...")
for j in range(n):
for i in range(j):
print(i, "is friends with", j)
clique(4)
'''
print a string
second operation range of 4 (0, 1, 2, 3)
evaluate range 0
evaluate range 1
print a string
evaluate range 2
print
print
range of 3 evaluate
print
print... | 15.28 | 42 | 0.651832 |
1aeb2e7e9b92e8c51ec94afa6ef06d6a8850f297 | 818 | py | Python | petra/symbol.py | ritabt/petra | a7b391cdcd34f07ca201e2a396e141a3d2f12884 | [
"Apache-2.0"
] | null | null | null | petra/symbol.py | ritabt/petra | a7b391cdcd34f07ca201e2a396e141a3d2f12884 | [
"Apache-2.0"
] | null | null | null | petra/symbol.py | ritabt/petra | a7b391cdcd34f07ca201e2a396e141a3d2f12884 | [
"Apache-2.0"
] | 1 | 2020-04-13T20:12:26.000Z | 2020-04-13T20:12:26.000Z | """
This file defines Petra symbols.
"""
import re
from .type import Type
from .validate import ValidateError
_next_id = 0
class Symbol(object):
"""
A symbol.
"""
def __init__(self, type_: Type, name: str):
global _next_id
self.t = type_
self.name = name
self.id = _... | 19.95122 | 60 | 0.536675 |
1aeb34cc9b417e809dbe5fdd659af0330a2e3e83 | 1,162 | py | Python | backend/logistics/urls.py | StichtingIAPC/swipe | d1ea35a40813d2d5e9cf9edde33148c0a825efc4 | [
"BSD-3-Clause-Clear"
] | null | null | null | backend/logistics/urls.py | StichtingIAPC/swipe | d1ea35a40813d2d5e9cf9edde33148c0a825efc4 | [
"BSD-3-Clause-Clear"
] | null | null | null | backend/logistics/urls.py | StichtingIAPC/swipe | d1ea35a40813d2d5e9cf9edde33148c0a825efc4 | [
"BSD-3-Clause-Clear"
] | null | null | null | from django.conf.urls import url
from logistics import views
urlpatterns = [
# Standard page
url(r'^supplierorder/$', views.SupplierOrderListView.as_view()),
url(r'^supplierorder/(?P<pk>\d+)/$', views.SupplierOrderView.as_view()),
url(r'^supplierorderline/$', views.SupplierOrderLineListView.as_view())... | 58.1 | 143 | 0.730637 |
1aeb410a883d81742a352fde3acdafeeebee76be | 4,398 | py | Python | maro/simulator/utils/event_bind_binreader.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | maro/simulator/utils/event_bind_binreader.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | maro/simulator/utils/event_bind_binreader.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.s
from datetime import datetime
from maro.data_lib import BinaryReader
from maro.event_buffer import EventBuffer, Event
UNPROECESSED_EVENT = "item_not_bind_with_event"
class EventBindBinaryReader:
"""Binary reader that will generate and inse... | 33.830769 | 205 | 0.658026 |
1aeb50f197ebf1be873f14f3e58f7f3fd7cb86f2 | 45 | py | Python | portal/apps/core/choices.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 8 | 2020-12-15T17:11:08.000Z | 2021-12-13T22:08:33.000Z | portal/apps/core/choices.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 28 | 2020-12-15T17:34:03.000Z | 2022-02-01T04:09:10.000Z | portal/apps/core/choices.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 7 | 2020-12-15T19:59:17.000Z | 2021-11-24T16:47:06.000Z | NOTA_H1 = 'H1'
NOTA_H2 = 'H2'
NOTA_H3 = 'H3'
| 11.25 | 14 | 0.6 |
1aeb92fc093e4031d25077941b398c87157dd30b | 1,372 | py | Python | botorch-modes/rf/rf_func_eval.py | tu-dortmund-ls12-rt/MODES-public | 65fce061de6713bee6343c6514afa3760fe1c1d4 | [
"MIT"
] | null | null | null | botorch-modes/rf/rf_func_eval.py | tu-dortmund-ls12-rt/MODES-public | 65fce061de6713bee6343c6514afa3760fe1c1d4 | [
"MIT"
] | null | null | null | botorch-modes/rf/rf_func_eval.py | tu-dortmund-ls12-rt/MODES-public | 65fce061de6713bee6343c6514afa3760fe1c1d4 | [
"MIT"
] | 1 | 2022-02-11T12:21:01.000Z | 2022-02-11T12:21:01.000Z | # bj rf test
from sklearn.ensemble import RandomForestClassifier
import timeit
from dataloader import load_data_eval as load_data
#from dataloader import load_data
def rf_model_test(hyper_vector, machine_num, datasets_num):
# pool of hypers
trees = hyper_vector[0]+1
features = ['auto', 'sqrt', 'log2']
if (hyper_ve... | 28 | 64 | 0.709913 |
1aeba100f7894f5bb92509fa4298c36e2fea74c9 | 1,053 | py | Python | build.py | PirtleShell/rabbits-clocks | c7973138cc45eb5a7717c5706e578bb4d1c8fa26 | [
"MIT"
] | 1 | 2018-08-15T05:38:53.000Z | 2018-08-15T05:38:53.000Z | build.py | pirtleshell/rabbits-clocks | c7973138cc45eb5a7717c5706e578bb4d1c8fa26 | [
"MIT"
] | null | null | null | build.py | pirtleshell/rabbits-clocks | c7973138cc45eb5a7717c5706e578bb4d1c8fa26 | [
"MIT"
] | null | null | null | import json
import datetime as date
import md
class Post(object):
def __init__(self, item, template):
self.template = template;
self.name = item['name']
self.type = item['type'] if 'type' in dir(item) else 'clocks'
self.cover_image = item['cover_image']
self.content = item[... | 27.710526 | 73 | 0.566952 |
1aebbc490420616b519da1fd7f9da85aa51bc6dc | 3,621 | py | Python | tests/core/controller.py | PureMVC/puremvc-python-multicore-framework | a11c64717057bdf09d86546bc2ab1c692dbfd034 | [
"BSD-3-Clause"
] | 17 | 2015-01-26T03:47:58.000Z | 2021-12-13T05:37:36.000Z | tests/core/controller.py | PureMVC/puremvc-python-multicore-framework | a11c64717057bdf09d86546bc2ab1c692dbfd034 | [
"BSD-3-Clause"
] | null | null | null | tests/core/controller.py | PureMVC/puremvc-python-multicore-framework | a11c64717057bdf09d86546bc2ab1c692dbfd034 | [
"BSD-3-Clause"
] | 10 | 2015-11-21T16:38:28.000Z | 2021-03-12T06:11:38.000Z | # -*- coding: utf-8 -*-
from puremvc import MultitonError
from puremvc.core import Controller
from puremvc.interfaces import IController
from puremvc.patterns.observer import Notification
from utils.controller import TestDoubleCommand, TestVO, TestIncrementCommand
import unittest
import uuid
class ControllerTest(uni... | 33.841121 | 77 | 0.705606 |
1aebf1ffe84b6de75c8cbb5b2d140113b14eec19 | 7,229 | py | Python | utils/build_stig_control.py | maage/scap-security-guide | 06474db16e5de438902162a6f72c9db996c1b6b7 | [
"BSD-3-Clause"
] | null | null | null | utils/build_stig_control.py | maage/scap-security-guide | 06474db16e5de438902162a6f72c9db996c1b6b7 | [
"BSD-3-Clause"
] | null | null | null | utils/build_stig_control.py | maage/scap-security-guide | 06474db16e5de438902162a6f72c9db996c1b6b7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
from __future__ import print_function
import argparse
import json
import os
import re
from pathlib import Path
import sys
import xml.etree.ElementTree as ET
import yaml
import ssg.build_yaml
import ssg.environment
import ssg.rules
import ssg.yaml
SSG_ROOT = os.path.abspath(os.path.join(os.path.d... | 38.248677 | 96 | 0.615023 |
1aec0729926d0d508347c24f370226ab3651b8a2 | 1,169 | py | Python | examples/keras_example.py | deepchatterjeevns/streamlit | 631d42877bd16bdec14ee124c936917b430f6ce4 | [
"Apache-2.0"
] | 4 | 2019-11-10T13:50:56.000Z | 2020-01-07T21:02:29.000Z | examples/keras_example.py | IliaLarchenko/streamlit | 9cdf4851148a43e4e0431d7633c5a5d729e5b1e3 | [
"Apache-2.0"
] | 4 | 2021-05-09T11:42:18.000Z | 2022-02-27T10:59:36.000Z | examples/keras_example.py | IliaLarchenko/streamlit | 9cdf4851148a43e4e0431d7633c5a5d729e5b1e3 | [
"Apache-2.0"
] | 1 | 2019-11-26T09:37:57.000Z | 2019-11-26T09:37:57.000Z | # -*- coding: utf-8 -*-
# Copyright 2018-2019 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 33.4 | 79 | 0.745081 |
1aec0e6a10a42fa7a6d36645bb2df93309301d74 | 47 | py | Python | tests/__init__.py | tj-django/drf-restricted-fields | d1b712537c9b3896a1e9a25c65e1a74bc5e01712 | [
"MIT"
] | 2 | 2021-03-08T05:59:55.000Z | 2021-04-12T21:58:11.000Z | tests/__init__.py | tj-django/drf-restricted-fields | d1b712537c9b3896a1e9a25c65e1a74bc5e01712 | [
"MIT"
] | 100 | 2021-03-08T05:53:52.000Z | 2021-12-29T15:11:43.000Z | tests/__init__.py | tj-django/drf-restricted-fields | d1b712537c9b3896a1e9a25c65e1a74bc5e01712 | [
"MIT"
] | null | null | null | """Unit test package for restricted_fields."""
| 23.5 | 46 | 0.744681 |
1aec17d1012da30e5d144b8bbbd4f152dca1765a | 23,377 | py | Python | tornado/ioloop.py | ContextLogic/tornado | 715182e092e03dbefb141de0ad28ad8b9288427e | [
"Apache-2.0"
] | 1 | 2018-12-13T12:59:59.000Z | 2018-12-13T12:59:59.000Z | tornado/ioloop.py | ContextLogic/tornado | 715182e092e03dbefb141de0ad28ad8b9288427e | [
"Apache-2.0"
] | 1 | 2019-09-18T22:48:16.000Z | 2019-09-18T22:48:16.000Z | tornado/ioloop.py | ContextLogic/tornado | 715182e092e03dbefb141de0ad28ad8b9288427e | [
"Apache-2.0"
] | 1 | 2018-05-23T19:37:26.000Z | 2018-05-23T19:37:26.000Z | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 36.641066 | 92 | 0.608247 |
1aec44c2139f3ee239fb8c6d0db68f3f54e70d55 | 10,782 | py | Python | modoboa/core/tests/test_authentication.py | teicee/modoboa | e2492a08b0a7749fbebc3f161af17df20142d028 | [
"ISC"
] | null | null | null | modoboa/core/tests/test_authentication.py | teicee/modoboa | e2492a08b0a7749fbebc3f161af17df20142d028 | [
"ISC"
] | null | null | null | modoboa/core/tests/test_authentication.py | teicee/modoboa | e2492a08b0a7749fbebc3f161af17df20142d028 | [
"ISC"
] | null | null | null | """Tests for core application."""
import os
import smtplib
from unittest import mock, skipIf, skipUnless
from django.core import mail
from django.test import override_settings
from django.urls import reverse
try:
import argon2
except ImportError:
argon2 = None
from modoboa.core.password_hashers import (
... | 38.645161 | 74 | 0.606196 |
1aec5f61ce4385fdd0a41ef4f16dc4978822be70 | 1,537 | py | Python | examples/django_hx_chatserver/example_app/chat/models.py | mpasternak/hendrix | 1cc96b9edb3a6760306b80b50001e3dfbf57fceb | [
"MIT"
] | null | null | null | examples/django_hx_chatserver/example_app/chat/models.py | mpasternak/hendrix | 1cc96b9edb3a6760306b80b50001e3dfbf57fceb | [
"MIT"
] | null | null | null | examples/django_hx_chatserver/example_app/chat/models.py | mpasternak/hendrix | 1cc96b9edb3a6760306b80b50001e3dfbf57fceb | [
"MIT"
] | null | null | null | from django.db import models
from django.template import Context, loader
from django.utils import timezone
from hendrix.contrib.concurrency.signals import message_signal
# Create your models here.
class ChatMessage(models.Model):
"""
a model that stores chat history
"""
sender = models.CharFiel... | 28.462963 | 86 | 0.648016 |
1aec73d4663c2060ff94fee839c662a3910fce48 | 1,991 | py | Python | setup.py | oflaeschen/python-documentai | ea83083c315d4a97c29df35955f9547e2f869114 | [
"Apache-2.0"
] | 1 | 2020-06-24T19:28:16.000Z | 2020-06-24T19:28:16.000Z | setup.py | oflaeschen/python-documentai | ea83083c315d4a97c29df35955f9547e2f869114 | [
"Apache-2.0"
] | null | null | null | setup.py | oflaeschen/python-documentai | ea83083c315d4a97c29df35955f9547e2f869114 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2019 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 ... | 32.112903 | 74 | 0.675038 |
1aec85a66e7d595426acb0ce67bb7209af1c7587 | 6,228 | py | Python | det3d/models/backbones/scn.py | anonymous0522/RAAN | 1e9cb9cd50bf99106ae33e10310eafed5b5ffbba | [
"MIT"
] | 33 | 2021-11-19T02:02:41.000Z | 2022-03-15T03:10:28.000Z | det3d/models/backbones/scn.py | anonymous0522/RAAN | 1e9cb9cd50bf99106ae33e10310eafed5b5ffbba | [
"MIT"
] | null | null | null | det3d/models/backbones/scn.py | anonymous0522/RAAN | 1e9cb9cd50bf99106ae33e10310eafed5b5ffbba | [
"MIT"
] | 3 | 2021-12-22T07:35:20.000Z | 2022-03-04T03:17:21.000Z | import numpy as np
import spconv
from spconv import SparseConv3d, SubMConv3d
from torch import nn
from torch.nn import functional as F
from ..registry import BACKBONES
from ..utils import build_norm_layer
import pdb
def conv3x3(in_planes, out_planes, stride=1, indice_key=None, bias=True):
"""3x3 convolution with ... | 34.6 | 110 | 0.584136 |
1aecdef8089de3a4331292e710866ac9b77fb857 | 6,352 | py | Python | mtp_bank_admin/apps/bank_admin/disbursements.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-bank-admin | b210cfd947ecdc7f50fd77f5023076ad400446b6 | [
"MIT"
] | null | null | null | mtp_bank_admin/apps/bank_admin/disbursements.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-bank-admin | b210cfd947ecdc7f50fd77f5023076ad400446b6 | [
"MIT"
] | null | null | null | mtp_bank_admin/apps/bank_admin/disbursements.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-bank-admin | b210cfd947ecdc7f50fd77f5023076ad400446b6 | [
"MIT"
] | null | null | null | from decimal import Decimal
import logging
from django.conf import settings
from django.utils.dateparse import parse_date
from mtp_common.api import retrieve_all_pages_for_path
from . import disbursements_config as config, DISBURSEMENTS_LABEL
from .exceptions import EmptyFileError
from .utils import (
get_start_a... | 36.505747 | 120 | 0.663571 |
1aed066b25bef33bd67a7e762bce06a705945abe | 5,800 | py | Python | scripts/generateSS.py | NCEAS/metad | dcab3a79da9a9649714c09456c6231a4c417ffb4 | [
"Apache-2.0"
] | null | null | null | scripts/generateSS.py | NCEAS/metad | dcab3a79da9a9649714c09456c6231a4c417ffb4 | [
"Apache-2.0"
] | null | null | null | scripts/generateSS.py | NCEAS/metad | dcab3a79da9a9649714c09456c6231a4c417ffb4 | [
"Apache-2.0"
] | null | null | null | #!/Users/scgordon/anaconda/bin/python
import json
import xlsxwriter
import sys
import os
sys.path.append('./py')
from Counter import *
from ssutils import writeHeaders,add_summary_formulas, add_exists_formulas,add_named_ranges,load_summary_fields,add_field_summary,simplify,initialize_summary_formulas
## initial data ... | 26.126126 | 166 | 0.70069 |
1aed295bd2e4f2ac724c464b739de37ff5704dc4 | 2,150 | py | Python | ForgeActivity/forgeactivity/widgets/follow.py | shalithasuranga/allura | 4f7fba13415954d07f602a051ec697329dd3706b | [
"Apache-2.0"
] | 1 | 2017-07-31T23:13:58.000Z | 2017-07-31T23:13:58.000Z | ForgeActivity/forgeactivity/widgets/follow.py | DalavanCloud/allura | a25329caed9e6d136a1004c33372e0632a16e352 | [
"Apache-2.0"
] | null | null | null | ForgeActivity/forgeactivity/widgets/follow.py | DalavanCloud/allura | a25329caed9e6d136a1004c33372e0632a16e352 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | 37.068966 | 71 | 0.664186 |
1aed3b763832ad36ad43d046ab5634c50aa1a4f9 | 12,123 | py | Python | ml-agents/mlagents/trainers/tests/simple_test_envs.py | mattinjersey/ml-agents | 7dcf947f541d661cc4a94b0e7758e1b12c6be078 | [
"Apache-2.0"
] | 1 | 2020-12-23T06:38:13.000Z | 2020-12-23T06:38:13.000Z | ml-agents/mlagents/trainers/tests/simple_test_envs.py | mattinjersey/ml-agents | 7dcf947f541d661cc4a94b0e7758e1b12c6be078 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/tests/simple_test_envs.py | mattinjersey/ml-agents | 7dcf947f541d661cc4a94b0e7758e1b12c6be078 | [
"Apache-2.0"
] | null | null | null | import random
from typing import Dict, List, Any, Tuple
import numpy as np
from mlagents_envs.base_env import (
ActionSpec,
ActionTuple,
BaseEnv,
BehaviorSpec,
DecisionSteps,
TerminalSteps,
BehaviorMapping,
)
from mlagents_envs.tests.test_rpc_utils import proto_from_steps_and_action
from ml... | 36.405405 | 119 | 0.5935 |
1aed5acb123cfdeb2741af17fef203d6b9c9ab54 | 2,879 | py | Python | acme/agents/jax/impala/agent_test.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 1 | 2020-08-31T23:46:32.000Z | 2020-08-31T23:46:32.000Z | acme/agents/jax/impala/agent_test.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 1 | 2021-01-25T15:39:56.000Z | 2021-01-25T15:39:56.000Z | acme/agents/jax/impala/agent_test.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 2 | 2021-01-07T11:35:19.000Z | 2021-01-07T12:16:21.000Z | # python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 29.377551 | 78 | 0.709274 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.