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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7cc93ae466f3cb5e70de61c95c7d9e873671b1a | 939 | py | Python | medium/Binary Tree Zigzag Level Order Traversal/solution.py | ashutosh1919/leetcode-problems | 65f99a3694549af88c7702b598de1a8ccb7db5fb | [
"MIT"
] | 8 | 2021-08-21T19:10:04.000Z | 2022-03-11T14:30:02.000Z | medium/Binary Tree Zigzag Level Order Traversal/solution.py | ashutosh1919/leetcode-problems | 65f99a3694549af88c7702b598de1a8ccb7db5fb | [
"MIT"
] | null | null | null | medium/Binary Tree Zigzag Level Order Traversal/solution.py | ashutosh1919/leetcode-problems | 65f99a3694549af88c7702b598de1a8ccb7db5fb | [
"MIT"
] | 1 | 2021-08-24T06:29:02.000Z | 2021-08-24T06:29:02.000Z | # Time complexity: O(n)
# Approach: Save level order traversal and reverse the needed.
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def traverse(self, r... | 31.3 | 76 | 0.532481 |
f7cc955a59a7cc7fd2b524542bb71a2d799fbfe6 | 6,001 | py | Python | tools/perf/benchmarks/page_cycler.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | tools/perf/benchmarks/page_cycler.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/perf/benchmarks/page_cycler.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from core import perf_benchmark
from measurements import page_cycler
import page_sets
from telemetry import benchmark
class _PageCycler(perf_benchmark.Per... | 29.707921 | 78 | 0.736211 |
f7ccac8b37cbf0ef9814ea5f38971fa81af2d62c | 1,308 | py | Python | marqeta/response_models/clearing_retry_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 21 | 2019-04-12T09:02:17.000Z | 2022-02-18T11:39:06.000Z | marqeta/response_models/clearing_retry_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 1 | 2020-07-22T21:27:40.000Z | 2020-07-23T17:38:43.000Z | marqeta/response_models/clearing_retry_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 10 | 2019-05-08T14:20:37.000Z | 2021-09-20T18:09:26.000Z | from datetime import datetime, date
from marqeta.response_models import datetime_object
import json
import re
class ClearingRetryModel(object):
def __init__(self, json_response):
self.json_response = json_response
def __str__(self):
return json.dumps(self.json_response, default=self.json_seri... | 26.16 | 100 | 0.716361 |
f7ccb15f7e691c388c00f3213f6328d92579d767 | 4,326 | py | Python | akkadian_bert/data_collators_bert.py | SLAB-NLP/Akk | baa07b0fdf8c7d8623fbd78508867c30a8a7ff6d | [
"MIT"
] | 5 | 2021-09-14T07:09:07.000Z | 2021-11-15T19:43:13.000Z | akkadian_bert/data_collators_bert.py | SLAB-NLP/Akk | baa07b0fdf8c7d8623fbd78508867c30a8a7ff6d | [
"MIT"
] | null | null | null | akkadian_bert/data_collators_bert.py | SLAB-NLP/Akk | baa07b0fdf8c7d8623fbd78508867c30a8a7ff6d | [
"MIT"
] | 1 | 2021-11-15T19:43:19.000Z | 2021-11-15T19:43:19.000Z | from typing import List, Union, Dict, Tuple
import torch
from torch.nn.utils.rnn import pad_sequence
from preprocessing.main_preprocess import MISSING_SIGN_CHAR
class DataCollatorForLanguageModelingAkkadian:
"""
Data collator used for language modeling.
- collates batches of tensors, honoring their token... | 52.756098 | 165 | 0.690014 |
f7ccd19f9d487827e8a05f1d77f344f5065c2e1e | 18,892 | py | Python | Class/DevAdf5904.py | carterjgreen/undergrad-thesis | b6cd0270ab06eb889bd409f585f44953b1994887 | [
"BSD-3-Clause"
] | 2 | 2020-06-19T16:35:21.000Z | 2021-05-20T06:15:21.000Z | Class/DevAdf5904.py | carterjgreen/undergrad-thesis | b6cd0270ab06eb889bd409f585f44953b1994887 | [
"BSD-3-Clause"
] | null | null | null | Class/DevAdf5904.py | carterjgreen/undergrad-thesis | b6cd0270ab06eb889bd409f585f44953b1994887 | [
"BSD-3-Clause"
] | 2 | 2020-11-10T16:50:06.000Z | 2020-12-02T23:16:59.000Z | #< @file DevAdf5904.pyh
#< @author Haderer Andreas (HaAn)
#< @date 2016-06-13
#< @brief Class for configuration of Adf5904 receiver
#< @version 1.0.1
import Class.DevDriver as DevDriver
from numpy import *
class DevAdf5904(DevDriver.DevDriver):
# DOXYGEN ------------------------... | 39.195021 | 182 | 0.455801 |
f7cce9d07599e0250640a8e08143992863f835d2 | 23,406 | py | Python | src/bot.py | neelkamath/hack.chat-bot | 2081a507ef4d955b0f4ebd9325f1815650fc9560 | [
"MIT"
] | 6 | 2017-05-18T14:22:24.000Z | 2018-04-28T10:08:19.000Z | src/bot.py | neelkamath/hack.chat-bot | 2081a507ef4d955b0f4ebd9325f1815650fc9560 | [
"MIT"
] | 35 | 2017-05-31T13:34:24.000Z | 2018-06-04T10:32:18.000Z | src/bot.py | neelkamath/hack.chat-bot | 2081a507ef4d955b0f4ebd9325f1815650fc9560 | [
"MIT"
] | 1 | 2017-07-07T11:21:27.000Z | 2017-07-07T11:21:27.000Z | #!/usr/bin/env python3
"""Connects the bot."""
import os
import os.path
import random
import re
import sys
import threading
import time
import hclib
import pymongo
from commands import currency
from commands import dictionary
from commands import jokes
from commands import katex
from commands import password
from c... | 38.81592 | 79 | 0.476416 |
f7ccfb7be0d3aa36d510a968331d253a09f207be | 2,196 | py | Python | tests/strategies.py | chris-tng/minitorch | f5facd366aac6a4d3a437796c43ac02a9b7069ff | [
"MIT"
] | null | null | null | tests/strategies.py | chris-tng/minitorch | f5facd366aac6a4d3a437796c43ac02a9b7069ff | [
"MIT"
] | null | null | null | tests/strategies.py | chris-tng/minitorch | f5facd366aac6a4d3a437796c43ac02a9b7069ff | [
"MIT"
] | null | null | null | # +
import sys
sys.path.append("..")
import minitorch
from hypothesis import settings
from hypothesis.strategies import composite, floats, integers, lists
import numpy as np
# -
settings.register_profile("ci", deadline=None)
settings.load_profile("ci")
small_ints = integers(min_value=1, max_value=3)
small_floats = ... | 25.241379 | 86 | 0.701275 |
f7cd10f5ff401fd2c2214e3ee96d348f7cb5222b | 2,943 | py | Python | setup.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | 1 | 2021-08-30T20:18:38.000Z | 2021-08-30T20:18:38.000Z | setup.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | null | null | null | setup.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | 1 | 2021-08-30T20:18:40.000Z | 2021-08-30T20:18:40.000Z | #!/usr/bin/env python
#
# Copyright 2012 - 2017-2019 BigML, 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 appli... | 36.333333 | 75 | 0.697927 |
f7cd144b917e06b746307732f06f8ea1ca9b2048 | 777 | py | Python | gaphor/misc/colorbutton.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | null | null | null | gaphor/misc/colorbutton.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | null | null | null | gaphor/misc/colorbutton.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | null | null | null | """
A version of the standard Gtk.ColorButton tweaked towards Gaphor.
Gaphor is using color values from 0 to 1 (cairo standard), so that required some tweaks
on the color widget. The standard format is `(red, green, blue, alpha)`.
"""
from gi.repository import Gtk
class ColorButton(Gtk.ColorButton):
__gtype_na... | 29.884615 | 87 | 0.679537 |
f7cd3010ba3f856e27c193c18671932db2d7a9b8 | 2,762 | py | Python | flash/vision/classification/model.py | billy-horn/lightning-flash | 16d01f74332bc76717f11cf348ca318485acb720 | [
"Apache-2.0"
] | 1 | 2021-02-03T05:10:29.000Z | 2021-02-03T05:10:29.000Z | flash/vision/classification/model.py | tchaton/lightning-flash | 61c741d37182d137f39b771879254db8fd20308f | [
"Apache-2.0"
] | null | null | null | flash/vision/classification/model.py | tchaton/lightning-flash | 61c741d37182d137f39b771879254db8fd20308f | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# 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 i... | 35.87013 | 101 | 0.704562 |
f7cdad77232ac2ea95f7cc8a671937965722ce26 | 1,847 | py | Python | tests/transforms/test_conv1x1ortho.py | alexhepburn/rbig_jax | 706dd60d2049071be0fb3d311c83719121854678 | [
"MIT"
] | null | null | null | tests/transforms/test_conv1x1ortho.py | alexhepburn/rbig_jax | 706dd60d2049071be0fb3d311c83719121854678 | [
"MIT"
] | null | null | null | tests/transforms/test_conv1x1ortho.py | alexhepburn/rbig_jax | 706dd60d2049071be0fb3d311c83719121854678 | [
"MIT"
] | null | null | null | import chex
import jax
import jax.numpy as np
import numpy as onp
import objax
import pytest
from rbig_jax.transforms.conv import Conv1x1Householder
seed = 123
rng = onp.random.RandomState(123)
generator = objax.random.Generator(123)
@pytest.mark.parametrize("n_channels", [1, 3, 12])
@pytest.mark.parametrize("hw", ... | 27.567164 | 87 | 0.703303 |
f7cddccd08f067c0bc637d4538d9a0da0a534468 | 970 | py | Python | ads/opctl/backend/base.py | oracle/accelerated-data-science | d594ed0c8c1365daf4cf9e860daebc760fa9a24b | [
"UPL-1.0",
"Apache-2.0"
] | 20 | 2022-02-22T19:07:09.000Z | 2022-03-16T17:21:42.000Z | ads/opctl/backend/base.py | oracle/accelerated-data-science | d594ed0c8c1365daf4cf9e860daebc760fa9a24b | [
"UPL-1.0",
"Apache-2.0"
] | null | null | null | ads/opctl/backend/base.py | oracle/accelerated-data-science | d594ed0c8c1365daf4cf9e860daebc760fa9a24b | [
"UPL-1.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8; -*-
# Copyright (c) 2022 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
from abc import abstractmethod
from typing import Dict
class Backend:
"""Interface for backend"""
@abstr... | 17.962963 | 104 | 0.491753 |
f7ce2bdb3f45dafc4141e4fbc4416442d19d0e76 | 6,104 | py | Python | NLPCC_2018_TASK2_GEC/CS2S+BPE+Emb/software/nbest-reranker/candidatesreader.py | DCMMC/chineseocr | 0b8772615239ea7f212b1ab5bc75183e7e9f16b0 | [
"MIT"
] | null | null | null | NLPCC_2018_TASK2_GEC/CS2S+BPE+Emb/software/nbest-reranker/candidatesreader.py | DCMMC/chineseocr | 0b8772615239ea7f212b1ab5bc75183e7e9f16b0 | [
"MIT"
] | null | null | null | NLPCC_2018_TASK2_GEC/CS2S+BPE+Emb/software/nbest-reranker/candidatesreader.py | DCMMC/chineseocr | 0b8772615239ea7f212b1ab5bc75183e7e9f16b0 | [
"MIT"
] | null | null | null | import sys
#import dlm.utils as U
#import dlm.io.logging as L
import codecs
class NBestList():
def __init__(self, nbest_path, mode='r', reference_list=None):
assert mode == 'r' or mode == 'w', "Invalid mode: " + mode
self.mode = mode
self.nbest_file = codecs.open(nbest_path, mode=mode, enco... | 30.217822 | 121 | 0.586173 |
f7ce34bb4f564f8222fb658f7ecd242f47c13549 | 2,077 | py | Python | packstack/version.py | fr34k8/packstack | 0dc24dc5dd0e41ae9f4c430e6ae2ff5cda0e9212 | [
"Apache-2.0"
] | 1 | 2015-11-06T10:12:19.000Z | 2015-11-06T10:12:19.000Z | packstack/version.py | fr34k8/packstack | 0dc24dc5dd0e41ae9f4c430e6ae2ff5cda0e9212 | [
"Apache-2.0"
] | null | null | null | packstack/version.py | fr34k8/packstack | 0dc24dc5dd0e41ae9f4c430e6ae2ff5cda0e9212 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import pkg_resources
from .installer.utils import execute
VERSION = ['2014', '2']
OS_RELEASE = 'Juno'
RESERVE_STR = None
def vr_from_git():
"""Returns VR string calculated from GIT repo."""
proj_dir = os.path.dirname(os.path.dirname(__file__))
rc, tag = execute(
... | 25.329268 | 71 | 0.584015 |
f7ce39409bbb8bebfcfc1044a5cf810af0d2cc78 | 5,472 | py | Python | test/vanilla/low-level/Expected/AcceptanceTests/BodyFormUrlEncodedDataLowLevel/bodyformurlencodeddatalowlevel/rest/formdataurlencoded/_request_builders.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/low-level/Expected/AcceptanceTests/BodyFormUrlEncodedDataLowLevel/bodyformurlencodeddatalowlevel/rest/formdataurlencoded/_request_builders.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/low-level/Expected/AcceptanceTests/BodyFormUrlEncodedDataLowLevel/bodyformurlencodeddatalowlevel/rest/formdataurlencoded/_request_builders.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 1 | 2022-03-28T08:58:03.000Z | 2022-03-28T08:58:03.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 ... | 40.235294 | 228 | 0.653326 |
f7ce4e3db4d73800ff84ce63509bfd81aa897eac | 11,230 | py | Python | dl/imagedetectionV3.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | 3 | 2018-10-16T09:36:12.000Z | 2019-04-15T03:12:49.000Z | dl/imagedetectionV3.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | dl/imagedetectionV3.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import os
from PIL import Image
import numpy as np
import logging
import time
from goods.models import ProblemGoods
from dl.step1_cnn import Step1CNN
from dl.step2_cnn import Step2CNN
from dl.step3_cnn import Step3CNN
from dl.tradition_match import TraditionMatch
from dl.util import visualize_bo... | 44.387352 | 178 | 0.583972 |
f7ce528ae14a125e42ef7dafe1f344583a7f8408 | 4,814 | py | Python | quimb/tensor/__init__.py | cbwang2016/quimb | 633ae4117e6fc5518f9b1bc07a0ae734f058072c | [
"Apache-2.0"
] | null | null | null | quimb/tensor/__init__.py | cbwang2016/quimb | 633ae4117e6fc5518f9b1bc07a0ae734f058072c | [
"Apache-2.0"
] | null | null | null | quimb/tensor/__init__.py | cbwang2016/quimb | 633ae4117e6fc5518f9b1bc07a0ae734f058072c | [
"Apache-2.0"
] | null | null | null | from .tensor_core import (
set_contract_path_cache,
get_contract_strategy,
set_contract_strategy,
contract_strategy,
get_contract_backend,
set_contract_backend,
contract_backend,
get_tensor_linop_backend,
set_tensor_linop_backend,
tensor_linop_backend,
tensor_contract,
te... | 20.058333 | 47 | 0.668882 |
f7ce75c3c18a3e08734cffa26420f8bc9660a647 | 7,063 | py | Python | src/function.py | JHaller27/des-sim | e5d648d10233826c5b4acbd82be108dfec007b53 | [
"MIT"
] | null | null | null | src/function.py | JHaller27/des-sim | e5d648d10233826c5b4acbd82be108dfec007b53 | [
"MIT"
] | null | null | null | src/function.py | JHaller27/des-sim | e5d648d10233826c5b4acbd82be108dfec007b53 | [
"MIT"
] | null | null | null | # Author: James Haller
from mybin import Bin
import logging
log = logging.getLogger('des-sim')
E = \
[32, 1, 2, 3, 4, 5,
4, 5, 6, 7, 8, 9,
8, 9, 10, 11, 12, 13,
12, 13, 14, 15, 16, 17,
16, 17, 18, 19, 20, 21,
20, 21, 22, 23, 24, 25,
24, 25, 26, 27, 28, 29,
28, 29, 30, 31, ... | 29.676471 | 106 | 0.466657 |
f7ce8618a86104e66ffd342c82a20e785da19d7b | 3,244 | py | Python | obsolete/reports/pipeline_peakcalling_obsolete/trackers/Status.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 49 | 2015-04-13T16:49:25.000Z | 2022-03-29T10:29:14.000Z | obsolete/reports/pipeline_peakcalling_obsolete/trackers/Status.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 252 | 2015-04-08T13:23:34.000Z | 2019-03-18T21:51:29.000Z | obsolete/reports/pipeline_peakcalling_obsolete/trackers/Status.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 22 | 2015-05-21T00:37:52.000Z | 2019-09-25T05:04:27.000Z | import os
import sys
import re
import types
import itertools
import math
import numpy
from PeakcallingReport import *
class PeakCallingStatus(DefaultTracker, Status):
'''status information for mapping stage.'''
def testCalling(self, track):
'''number of peaks called. The number of peaks expected in... | 23.852941 | 84 | 0.571208 |
f7cea656717fd63fc1f1f51441b57370f9923ec3 | 8,809 | py | Python | tests/unittests/test_git_cache_command_execution.py | shinh/gitcache | 930c8374cc028c985e72291a7e1f52acf137c776 | [
"BSD-3-Clause"
] | null | null | null | tests/unittests/test_git_cache_command_execution.py | shinh/gitcache | 930c8374cc028c985e72291a7e1f52acf137c776 | [
"BSD-3-Clause"
] | null | null | null | tests/unittests/test_git_cache_command_execution.py | shinh/gitcache | 930c8374cc028c985e72291a7e1f52acf137c776 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2020 by Clemens Rabe <clemens.rabe@clemensrabe.de>
# All rights reserved.
# This file is part of gitcache (https://github.com/seeraven/gitcache)
# and is released under the "BSD 3-Clause License". Please see the LICENSE file
# that is included as part of this package.
#
"""Unit... | 46.363158 | 100 | 0.638211 |
f7cec38eff8359d8543659e64b7473e707fcdf38 | 1,428 | py | Python | capstoneproject/tests/test_rating/test_content_rating.py | athrun22/content-rating | 25ccdb02edd18d0118d60fce609b60baadef257b | [
"Apache-2.0"
] | 1 | 2018-02-08T01:50:37.000Z | 2018-02-08T01:50:37.000Z | capstoneproject/tests/test_rating/test_content_rating.py | jwillikers/content-rating | 25ccdb02edd18d0118d60fce609b60baadef257b | [
"Apache-2.0"
] | null | null | null | capstoneproject/tests/test_rating/test_content_rating.py | jwillikers/content-rating | 25ccdb02edd18d0118d60fce609b60baadef257b | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
from capstoneproject.content_rating.algorithm.content_rating import isalphanum
from capstoneproject.content_rating.algorithm.content_rating import ContentRatingAlgorithm
from django.contrib.auth.models import AnonymousUser, User
from django.test import RequestFactory
class TestIsalphanum(... | 35.7 | 90 | 0.676471 |
f7cef468700338a2adeb1eaddffed78b2c85a516 | 2,514 | py | Python | processor.py | StoryScriptorg/SSLLVM | c5e8a47697dc900bc9153425626a3587cf83efc9 | [
"MIT"
] | 3 | 2021-06-28T10:57:23.000Z | 2021-12-10T00:28:38.000Z | processor.py | StoryScriptorg/SSLLVM | c5e8a47697dc900bc9153425626a3587cf83efc9 | [
"MIT"
] | null | null | null | processor.py | StoryScriptorg/SSLLVM | c5e8a47697dc900bc9153425626a3587cf83efc9 | [
"MIT"
] | null | null | null | from builder import buildIRFromCache
import llvmlite.binding as llvm
from ctypes import CFUNCTYPE, c_int
from argparse import ArgumentParser
def create_execution_engine():
"""
Create an ExecutionEngine suitable for JIT code generation on
the host CPU. The engine is reusable for an arbitrary number of
modules.
"""... | 32.230769 | 93 | 0.724344 |
f7cf291451188b6dc6b50beaaa50db2cc0e72e0d | 6,216 | py | Python | deep_translator/constants.py | ECE444-2021Fall/deep-translator | ffa7560252eede65fea696186b293316ee28e5da | [
"MIT"
] | null | null | null | deep_translator/constants.py | ECE444-2021Fall/deep-translator | ffa7560252eede65fea696186b293316ee28e5da | [
"MIT"
] | null | null | null | deep_translator/constants.py | ECE444-2021Fall/deep-translator | ffa7560252eede65fea696186b293316ee28e5da | [
"MIT"
] | null | null | null | import requests
BASE_URLS = {
"GOOGLE_TRANSLATE": "https://translate.google.com/m",
"PONS": "https://en.pons.com/translate/",
"YANDEX": "https://translate.yandex.net/api/{version}/tr.json/{endpoint}",
"LINGUEE": "https://www.linguee.com/",
"MYMEMORY": "http://api.mymemory.translated.net/get",
"... | 23.816092 | 121 | 0.532979 |
f7cf2b97bccc3e8bd8dadbf5f7f0106ac0805d68 | 1,376 | py | Python | setup.py | mitchellharvey97/aws_logging_handlers | f04e67a4cdc7c07f1df31e4cd914ac8ce9a9bbd0 | [
"MIT"
] | null | null | null | setup.py | mitchellharvey97/aws_logging_handlers | f04e67a4cdc7c07f1df31e4cd914ac8ce9a9bbd0 | [
"MIT"
] | null | null | null | setup.py | mitchellharvey97/aws_logging_handlers | f04e67a4cdc7c07f1df31e4cd914ac8ce9a9bbd0 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
import os
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname), 'r').read()
except:
return ""
setup(
name='aws-logging-handlers',
packages=find_packages(),
version='2.0.4',
description='Logging aws_loggin... | 32.761905 | 128 | 0.62936 |
f7cf7bc09420ee5388d5dedd027e6fdee278842a | 5,629 | py | Python | asposewordscloud/models/range_document.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 14 | 2018-07-15T17:01:52.000Z | 2018-11-29T06:15:33.000Z | asposewordscloud/models/range_document.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 1 | 2018-09-28T12:59:34.000Z | 2019-10-08T08:42:59.000Z | asposewordscloud/models/range_document.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 2 | 2020-12-21T07:59:17.000Z | 2022-02-16T21:41:25.000Z | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="range_document.py">
# Copyright (c) 2021 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of th... | 36.083333 | 85 | 0.582697 |
f7cf934489d92b00107ba44bc15decc0b759d641 | 11,245 | py | Python | trio/_core/_traps.py | StephenSchroeder/trio | b117c019a5c20e604c8429ea0b8fa1d395b50e36 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-11-18T03:40:44.000Z | 2020-11-18T03:40:44.000Z | trio/_core/_traps.py | smurfix/trio | 4c255f0ed7ab6c7574ce23c67fd3a41ab1c5ff0b | [
"Apache-2.0",
"MIT"
] | null | null | null | trio/_core/_traps.py | smurfix/trio | 4c255f0ed7ab6c7574ce23c67fd3a41ab1c5ff0b | [
"Apache-2.0",
"MIT"
] | null | null | null | # These are the only functions that ever yield back to the task runner.
import types
import enum
from functools import wraps
import attr
import outcome
from . import _run
# Helper for the bottommost 'yield'. You can't use 'yield' inside an async
# function, but you can inside a generator, and if you decorate your ... | 41.494465 | 80 | 0.712583 |
f7cf9e178ebff3a183163a2a6ec7fec977bca17c | 1,420 | py | Python | tests/conftest.py | RMeli/gnina-torch | eb57e2a62628d39f2a66e7fa1748e80705366761 | [
"MIT"
] | 5 | 2021-11-10T20:29:29.000Z | 2022-02-25T15:50:09.000Z | tests/conftest.py | RMeli/gnina-torch | eb57e2a62628d39f2a66e7fa1748e80705366761 | [
"MIT"
] | 25 | 2021-10-19T21:48:16.000Z | 2022-03-04T22:38:11.000Z | tests/conftest.py | RMeli/gnina-torch | eb57e2a62628d39f2a66e7fa1748e80705366761 | [
"MIT"
] | null | null | null | import os
import molgrid
import pytest
import torch
def pytest_addoption(parser):
# Allows user to force tests to run on the CPU (useful to get performance on CI)
parser.addoption(
"--nogpu",
action="store_false",
help="Force tests to run on CPU",
)
@pytest.fixture(scope="sessio... | 21.19403 | 88 | 0.61831 |
f7cfa25d771b89b7aa4a0adae506f22356bf22cc | 8,380 | py | Python | transformers/image/image_url_transformer.py | h2oai/driverlessai-recipes | 508663ed6bd1961925fcb29fde268493fe40e9e8 | [
"Apache-2.0"
] | 194 | 2019-04-23T10:25:13.000Z | 2022-03-29T04:19:28.000Z | transformers/image/image_url_transformer.py | h2oai/driverlessai-recipes | 508663ed6bd1961925fcb29fde268493fe40e9e8 | [
"Apache-2.0"
] | 50 | 2019-06-24T20:17:51.000Z | 2022-03-16T20:05:37.000Z | transformers/image/image_url_transformer.py | h2oai/driverlessai-recipes | 508663ed6bd1961925fcb29fde268493fe40e9e8 | [
"Apache-2.0"
] | 85 | 2019-03-27T12:26:43.000Z | 2022-01-27T13:15:37.000Z | """Convert a path to an image (JPG/JPEG/PNG) to a vector of class probabilities created by a pretrained ImageNet deeplearning model (Keras, TensorFlow)."""
import importlib
from h2oaicore.transformer_utils import CustomTransformer
from h2oaicore.models import TensorFlowModel
import datatable as dt
import numpy as np
fr... | 41.9 | 155 | 0.589857 |
f7cfb9a6e0092c9974accfa7087a18a5a67fc422 | 8,342 | py | Python | mmvmm/vm.py | marcsello/mmvmm | 01a29946865c1e1eeb2c9b88bbb546ccc8abda01 | [
"MIT"
] | null | null | null | mmvmm/vm.py | marcsello/mmvmm | 01a29946865c1e1eeb2c9b88bbb546ccc8abda01 | [
"MIT"
] | null | null | null | mmvmm/vm.py | marcsello/mmvmm | 01a29946865c1e1eeb2c9b88bbb546ccc8abda01 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import subprocess
import logging
import copy
import os
import time
from schema import VMDescriptionSchema, VMNameSchema
from expose import ExposedClass, exposed, transformational
from exception import VMRunningError, VMNotRunningError
from threading import RLock
from tap_device import TAPDevice... | 33.502008 | 173 | 0.574443 |
f7cfbe3fbdd32d6c5b67d01ae2af87c293ef553d | 54,478 | py | Python | tests/api/v1_3_0/test_pnp.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | tests/api/v1_3_0/test_pnp.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | tests/api/v1_3_0/test_pnp.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""DNACenterAPI pnp API fixtures and tests.
Copyright (c) 2019-2020 Cisco and/or its affiliates.
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, inclu... | 37.009511 | 5,192 | 0.666012 |
f7cfe5a5c53b93c32b42bbc0f62559632ee2c4e9 | 4,390 | py | Python | test/test_v1_wechatpay_callback_response.py | justapnet/justap-server-sdk-python | 2d3110c6447833334fa2f7e93ffa63e06913df17 | [
"Apache-2.0"
] | null | null | null | test/test_v1_wechatpay_callback_response.py | justapnet/justap-server-sdk-python | 2d3110c6447833334fa2f7e93ffa63e06913df17 | [
"Apache-2.0"
] | null | null | null | test/test_v1_wechatpay_callback_response.py | justapnet/justap-server-sdk-python | 2d3110c6447833334fa2f7e93ffa63e06913df17 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Justap API
欢迎阅读 Justap Api 文档 Justap 是为移动端应用和PC端应用打造的下一代聚合支付SAAS服务平台,通过一个 SDK 即可快速的支持各种形式的应用,并且一次接口完成多个不同支付渠道的接入。平台除了支持服务商子商户模式,同时还对商家自有商户(即自己前往微信、支付宝等机构开户)提供了完整的支持。 感谢您的支持,我们将不断探索,为您提供更优质的服务!如需技术支持可前往商户中心提交工单,支持工程师会尽快与您取得联系! # 文档说明 采用 REST 风格设计。所有接口请求地址都是可预期的以及面向资源的。使用规范的 HTTP 响应代码来表示请... | 107.073171 | 3,404 | 0.772665 |
f7d00d7341ac0edff4cff14c2f8cf7c7b122cb0d | 2,867 | py | Python | test/test_dag_number_input_alias.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 2 | 2020-01-30T23:28:59.000Z | 2020-05-06T16:43:47.000Z | test/test_dag_number_input_alias.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 1 | 2020-10-02T18:00:25.000Z | 2020-10-02T18:00:25.000Z | test/test_dag_number_input_alias.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
pollination-server
Pollination Server OpenAPI Definition # noqa: E501
The version of the OpenAPI document: 0.16.0
Contact: info@pollination.cloud
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import... | 31.505495 | 99 | 0.492501 |
f7d00de8ba2ff7ee8cfa413b823c36b92c981386 | 1,456 | py | Python | tests/conftest.py | gitter-badger/vcspull | 9584c6d40fca8e9f36970894ce620a891723d9b5 | [
"MIT"
] | null | null | null | tests/conftest.py | gitter-badger/vcspull | 9584c6d40fca8e9f36970894ce620a891723d9b5 | [
"MIT"
] | null | null | null | tests/conftest.py | gitter-badger/vcspull | 9584c6d40fca8e9f36970894ce620a891723d9b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import pytest
from libvcs.shortcuts import create_repo_from_pip_url
from libvcs.util import run
@pytest.fixture
def tmpdir_repoparent(tmpdir_factory, scope='function'):
"""Return temporary directory for repository c... | 28.54902 | 79 | 0.706731 |
f7d02d17d88056592e19b1037a3a1b5cbb30fe2c | 10,258 | py | Python | cla-backend/cla/tests/unit/test_github_models.py | dealako/easycla | ba7c6e481361ee1f416f0a58df77d79745f07761 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | cla-backend/cla/tests/unit/test_github_models.py | dealako/easycla | ba7c6e481361ee1f416f0a58df77d79745f07761 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 11 | 2020-10-19T22:54:29.000Z | 2021-01-11T03:46:27.000Z | cla-backend/cla/tests/unit/test_github_models.py | dealako/easycla | ba7c6e481361ee1f416f0a58df77d79745f07761 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | # Copyright The Linux Foundation and each contributor to CommunityBridge.
# SPDX-License-Identifier: MIT
import logging
import unittest
from unittest.mock import Mock, patch, MagicMock
from github import Github
import cla
from cla.models.github_models import get_pull_request_commit_authors, handle_commit_from_user, M... | 42.213992 | 115 | 0.605089 |
f7d04b5875f66873baa1b9afdd2bdeefdd6f5921 | 4,688 | py | Python | src/firmware/scripts/dfu-convert.py | BHFaction/Tribot | 38d8caaa73775654125db3091b8de2aadb3dba99 | [
"MIT"
] | 3 | 2017-04-04T04:03:28.000Z | 2021-05-29T08:08:48.000Z | src/firmware/scripts/dfu-convert.py | BHFaction/Tribot | 38d8caaa73775654125db3091b8de2aadb3dba99 | [
"MIT"
] | null | null | null | src/firmware/scripts/dfu-convert.py | BHFaction/Tribot | 38d8caaa73775654125db3091b8de2aadb3dba99 | [
"MIT"
] | 2 | 2018-02-28T14:16:11.000Z | 2019-05-07T18:02:16.000Z | #!/usr/bin/python2
# Written by Antonio Galea - 2010/11/18
# Distributed under Gnu LGPL 3.0
# see http://www.gnu.org/licenses/lgpl-3.0.txt
#
# Removed ihex functionality and dependency, Bitcraze - 2014-12-11
import sys,struct,zlib,os
from optparse import OptionParser
DEFAULT_DEVICE="0x0483:0xdf11"
def named(tuple,n... | 36.341085 | 130 | 0.62564 |
f7d05cd3fb739e2ba93cd1c6d90c67d55d6b77a7 | 3,801 | py | Python | nn_analysis/acts/utils.py | hchau630/nn-analysis | 0fbe7ad7b2b4566b9f88d8f21413a6d405f96bdc | [
"MIT"
] | null | null | null | nn_analysis/acts/utils.py | hchau630/nn-analysis | 0fbe7ad7b2b4566b9f88d8f21413a6d405f96bdc | [
"MIT"
] | null | null | null | nn_analysis/acts/utils.py | hchau630/nn-analysis | 0fbe7ad7b2b4566b9f88d8f21413a6d405f96bdc | [
"MIT"
] | null | null | null | import pathlib
import os
import numpy as np
from nn_analysis import utils, exceptions
from nn_analysis.constants import ENV_CONFIG_PATH, ACTS_CONFIGS_PATH
env_config = utils.load_config(ENV_CONFIG_PATH)
acts_configs = utils.load_config(ACTS_CONFIGS_PATH)
DEFAULT_SAVE_LOC = 'save_acts_path' # If you change this, mak... | 46.353659 | 232 | 0.638253 |
f7d061dff90d75b204f5b9de9820d51490b208c5 | 2,561 | py | Python | experiments/ashvin/icml2020/hand/pen/offpolicy/awr_data6.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/pen/offpolicy/awr_data6.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/pen/offpolicy/awr_data6.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
AWR + SAC from demo experiment
"""
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
if __name__ == "__main__":
variant = dict(... | 27.537634 | 74 | 0.563452 |
f7d06e636776c55af5d61b596be041c8d8797ef8 | 1,139 | py | Python | test/unit/test_base.py | ehossack/b2-sdk-python | 034bec38671c0862b6956915993061359dbd51f6 | [
"MIT"
] | 475 | 2015-11-17T04:56:23.000Z | 2022-03-10T17:55:28.000Z | test/unit/test_base.py | ehossack/b2-sdk-python | 034bec38671c0862b6956915993061359dbd51f6 | [
"MIT"
] | 615 | 2015-11-26T23:36:59.000Z | 2022-03-29T19:41:40.000Z | test/unit/test_base.py | ehossack/b2-sdk-python | 034bec38671c0862b6956915993061359dbd51f6 | [
"MIT"
] | 122 | 2015-11-19T20:28:50.000Z | 2022-01-06T18:55:42.000Z | ######################################################################
#
# File: test/unit/test_base.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
from contextlib import context... | 30.783784 | 95 | 0.525022 |
f7d081df8228dd5d1ebfacd9852f88cfbfff96cb | 10,346 | py | Python | sliced_art/main_window.py | donkirkby/sliced_art | f462ba1fdb0959c7db4de1e3e9dadc368b1df206 | [
"MIT"
] | null | null | null | sliced_art/main_window.py | donkirkby/sliced_art | f462ba1fdb0959c7db4de1e3e9dadc368b1df206 | [
"MIT"
] | 5 | 2020-02-08T17:23:40.000Z | 2021-03-27T19:27:05.000Z | sliced_art/main_window.py | donkirkby/sliced_art | f462ba1fdb0959c7db4de1e3e9dadc368b1df206 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'main_window.ui'
##
## Created by: Qt User Interface Compiler version 6.0.3
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
###############... | 47.458716 | 187 | 0.701237 |
f7d0a5f7f0fecb1ef72d1297381a45299e65de07 | 7,615 | py | Python | model_runner/validator/validator_utils.py | kevinyamauchi/model-runner | 77261bcd293de87533776291f44a09bf28a3c845 | [
"BSD-3-Clause"
] | null | null | null | model_runner/validator/validator_utils.py | kevinyamauchi/model-runner | 77261bcd293de87533776291f44a09bf28a3c845 | [
"BSD-3-Clause"
] | 5 | 2021-09-27T14:43:39.000Z | 2022-02-23T14:18:00.000Z | model_runner/validator/validator_utils.py | kevinyamauchi/model-runner | 77261bcd293de87533776291f44a09bf28a3c845 | [
"BSD-3-Clause"
] | null | null | null | import json
import os
from typing import Any, Dict, List, Optional, Union
from pydantic import BaseModel, validator
def which(program: str) -> Optional[str]:
"""
Test if program is a file or an executable.
"""
def is_exe(fpath):
return os.path.isfile(
fpath
) # and os.ac... | 34.457014 | 154 | 0.586999 |
f7d0ae9fdf92d807631a18ed03ae5c57e73c0417 | 523 | py | Python | testing_ideas/scraping_with_selenium/scrape_jstor.py | hschilling/data-collection-and-prep | b70ab54fd887592bad05d5748f492fc2f9ef0f6f | [
"Unlicense"
] | null | null | null | testing_ideas/scraping_with_selenium/scrape_jstor.py | hschilling/data-collection-and-prep | b70ab54fd887592bad05d5748f492fc2f9ef0f6f | [
"Unlicense"
] | 41 | 2021-01-01T14:01:30.000Z | 2021-01-27T20:17:21.000Z | testing_ideas/scraping_with_selenium/scrape_jstor.py | hschilling/data-collection-and-prep | b70ab54fd887592bad05d5748f492fc2f9ef0f6f | [
"Unlicense"
] | 5 | 2021-02-08T14:19:35.000Z | 2021-10-19T12:10:55.000Z | from selenium import webdriver
# checking to see if using Selenium can get past JSTOR blocking. It can't
options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument('--incognito')
options.add_argument('--headless')
path_to_driver = '/Users/hschilli/anaconda/envs/petal_... | 29.055556 | 75 | 0.791587 |
f7d0c4058187af22aa64717a6d8fbddebd8b9ea4 | 4,744 | py | Python | sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/aio/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/aio/operations/_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/aio/operations/_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.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 ... | 41.982301 | 133 | 0.666948 |
f7d0cd1d190a0204c1992489b35fe9a0c4773608 | 3,483 | py | Python | leads/leads/settings.py | jasonrhaas/sbb-scrapers | 15c4085206e9b4139cb843065db34d019530cade | [
"MIT"
] | null | null | null | leads/leads/settings.py | jasonrhaas/sbb-scrapers | 15c4085206e9b4139cb843065db34d019530cade | [
"MIT"
] | 3 | 2021-03-31T18:47:39.000Z | 2022-03-02T14:54:49.000Z | leads/leads/settings.py | jasonrhaas/sbb-scrapers | 15c4085206e9b4139cb843065db34d019530cade | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Scrapy settings for leads project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/t... | 33.815534 | 109 | 0.777778 |
f7d0cf3433463ebe11e1321f390df105edc59429 | 2,725 | py | Python | func_tests/tests/dataextractionapitests/data_extraction_api_auth.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | 1 | 2015-11-02T09:11:12.000Z | 2015-11-02T09:11:12.000Z | func_tests/tests/dataextractionapitests/data_extraction_api_auth.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | func_tests/tests/dataextractionapitests/data_extraction_api_auth.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | import unittest
import requests
from requests.auth import HTTPDigestAuth
from testdata.test_data import url
class DataExtractionAPITestCase(unittest.TestCase):
def setUp(self):
self.DIGEST_CREDENTIALS = HTTPDigestAuth('tester150411@gmail.com', 'tester150411')
self.WRONG_DIGEST_CREDENTIALS = HTTP... | 47.807018 | 117 | 0.782018 |
f7d0e27c1478d1e1f656cb1b2c0dba2dcacccceb | 5,390 | py | Python | web/app/app/settings.py | n1kko777/moneycontrol-app-api | 8db7a999747c3eaed7157abc836af603a5638c0f | [
"MIT"
] | null | null | null | web/app/app/settings.py | n1kko777/moneycontrol-app-api | 8db7a999747c3eaed7157abc836af603a5638c0f | [
"MIT"
] | 1 | 2020-08-13T19:19:58.000Z | 2020-08-13T19:19:58.000Z | web/app/app/settings.py | n1kko777/moneycontrol-app-api | 8db7a999747c3eaed7157abc836af603a5638c0f | [
"MIT"
] | null | null | null | import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
# SECURITY WARNING: keep the... | 27.085427 | 91 | 0.699443 |
f7d108f8c7c8d08a9401961acaa91d6012d7ea2f | 2,242 | py | Python | plots.py | JRhodes95/big-data-cw | 874d517ebe4efd0704592df1d2815f102f3012d7 | [
"MIT"
] | null | null | null | plots.py | JRhodes95/big-data-cw | 874d517ebe4efd0704592df1d2815f102f3012d7 | [
"MIT"
] | null | null | null | plots.py | JRhodes95/big-data-cw | 874d517ebe4efd0704592df1d2815f102f3012d7 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import pandas as pd
def plot_grid_search(file_name, title):
"""Function to plot the results of the grid search optimisation process."""
data = pd.read_csv(file_name) # Read the data to a pandas DataFrame
data_acc = data.pivot(... | 32.970588 | 82 | 0.693131 |
f7d1139c480191fa37c5e9b9a68bf1ba80400f6d | 4,071 | py | Python | topsides/benthicSpecies4.py | EasternEdgeRobotics/2019 | 19f833262e7bdd026fffc0ac894327369d6bb66f | [
"MIT"
] | 1 | 2020-07-24T20:40:49.000Z | 2020-07-24T20:40:49.000Z | topsides/benthicSpecies4.py | EasternEdgeRobotics/2019 | 19f833262e7bdd026fffc0ac894327369d6bb66f | [
"MIT"
] | 9 | 2019-08-23T01:39:53.000Z | 2019-08-23T01:42:48.000Z | topsides/benthicSpecies4.py | EasternEdgeRobotics/2019 | 19f833262e7bdd026fffc0ac894327369d6bb66f | [
"MIT"
] | null | null | null | import numpy as np
import cv2 as cv
import cmath
#cap = cv.VideoCapture(0)
cap = cv.VideoCapture('udpsrc port=5004 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! videoconvert ! appsink', cv.CAP_GSTREAMER)
PI = 3.14159
while(1):
# read the video capture frame
_, frame... | 42.40625 | 162 | 0.459347 |
f7d1147f6e10bb99e42546234d0b9588498eb999 | 1,941 | py | Python | binary_search/34_find_first_and_last_position_of_element_in_sorted_array.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | binary_search/34_find_first_and_last_position_of_element_in_sorted_array.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | binary_search/34_find_first_and_last_position_of_element_in_sorted_array.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | 2 | 2020-02-07T20:49:02.000Z | 2020-02-11T06:01:55.000Z | class Solution(object):
def searchLeftMost(self, nums, target):
# init with len, instead of len - 1, to handle corner case or one-element array
l, r = 0, len(nums)
while l != r:
m = (l + r) // 2
if nums[m] >= target:
r = m
else:
... | 30.809524 | 90 | 0.475013 |
f7d12118e5458800ec79d7692a7302d4575a9d28 | 545 | py | Python | Common/Measures/TradingDateTimes/PyDateTimes.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 2 | 2020-03-04T11:18:38.000Z | 2020-05-10T15:36:42.000Z | Common/Measures/TradingDateTimes/PyDateTimes.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 6 | 2020-03-30T16:42:47.000Z | 2021-12-13T20:37:21.000Z | Common/Measures/TradingDateTimes/PyDateTimes.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 1 | 2020-04-14T11:26:16.000Z | 2020-04-14T11:26:16.000Z | import datetime
def DateTimeNow():
return datetime.date.today()
def DateTime1WeekAgo():
return DateTimeNow() - datetime.timedelta(7+1)
def DateTime2WeekAgo():
return DateTimeNow() - datetime.timedelta(14+1)
def DateTime4WeekAgo():
return DateTimeNow() - datetime.timedelta(28+1)
def DateTime26W... | 18.166667 | 52 | 0.719266 |
f7d13e0c64eadc163c5a68f21922cd62e20342f0 | 61,394 | py | Python | networking_ovn/tests/unit/l3/test_l3_ovn.py | numansiddique/networking-ovn | 9357ddcb6c427486e6a1b3f012f87b9c4fab43a2 | [
"Apache-2.0"
] | null | null | null | networking_ovn/tests/unit/l3/test_l3_ovn.py | numansiddique/networking-ovn | 9357ddcb6c427486e6a1b3f012f87b9c4fab43a2 | [
"Apache-2.0"
] | null | null | null | networking_ovn/tests/unit/l3/test_l3_ovn.py | numansiddique/networking-ovn | 9357ddcb6c427486e6a1b3f012f87b9c4fab43a2 | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 51.461861 | 79 | 0.641757 |
f7d1472a9ccd9db7b1325f5791df0eea11cb072f | 2,647 | py | Python | pic/bsplines.py | ratnania/mhd | 89f383695075aa26fc805ffbf6ba458f0cdd6f4e | [
"MIT"
] | 5 | 2018-04-13T15:35:21.000Z | 2019-10-29T09:39:13.000Z | pic/bsplines.py | ratnania/mhd | 89f383695075aa26fc805ffbf6ba458f0cdd6f4e | [
"MIT"
] | null | null | null | pic/bsplines.py | ratnania/mhd | 89f383695075aa26fc805ffbf6ba458f0cdd6f4e | [
"MIT"
] | 1 | 2018-10-19T10:53:15.000Z | 2018-10-19T10:53:15.000Z | from pyccel.decorators import types
#==============================================================================
@types('double[:]','int','double')
def find_span( knots, degree, x ):
"""
Determine the knot span index at location x, given the
B-Splines' knot sequence and polynomial degree. See
Algori... | 26.207921 | 79 | 0.527389 |
f7d1539884e792bfdb31242482fc62898b191560 | 4,898 | py | Python | app_config.py | isabella232/lookatthis | fe9ccc896f50ede13f9c469d38d90c8a732f9a71 | [
"FSFAP"
] | 15 | 2015-02-21T13:56:25.000Z | 2019-08-14T21:19:09.000Z | app_config.py | nprapps/lookatthis | fe9ccc896f50ede13f9c469d38d90c8a732f9a71 | [
"FSFAP"
] | 444 | 2015-01-06T16:54:13.000Z | 2021-09-22T11:46:33.000Z | app_config.py | isabella232/lookatthis | fe9ccc896f50ede13f9c469d38d90c8a732f9a71 | [
"FSFAP"
] | 13 | 2015-01-05T14:33:15.000Z | 2021-02-23T10:45:32.000Z | #!/usr/bin/env python
"""
Project-wide application configuration.
DO NOT STORE SECRETS, PASSWORDS, ETC. IN THIS FILE.
They will be exposed to users. Use environment variables instead.
See get_secrets() below for a fast way to access them.
"""
import os
from authomatic.providers import oauth2
from authomatic import ... | 23.892683 | 109 | 0.670478 |
f7d188932b80b9f39300bc12a13db9a98560e7e7 | 9,961 | py | Python | var/spack/repos/builtin/packages/hpctoolkit/package.py | BenWibking/spack | 49b3b43a4a9375210b578635d9240875a5f3106b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/hpctoolkit/package.py | BenWibking/spack | 49b3b43a4a9375210b578635d9240875a5f3106b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/hpctoolkit/package.py | flatironinstitute/spack | 71a7b1b5fadbe16bcdb36fb679aa828cd7d83b02 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import llnl.util.tty as tty
from spack import *
class Hpctoolkit(AutotoolsPackage):
"""HPCToolkit is an integrated ... | 41.161157 | 107 | 0.624636 |
f7d192320a53e0575b1bbc8eac90aeafff54d2f1 | 1,487 | py | Python | migrations/versions/0204_service_data_retention.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | migrations/versions/0204_service_data_retention.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | migrations/versions/0204_service_data_retention.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | """
Revision ID: 0204_service_data_retention
Revises: 0203_fix_old_incomplete_jobs
Create Date: 2018-07-10 11:22:01.761829
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
revision = "0204_service_data_retention"
down_revision = "0203_fix_old_incomplete_jobs"
def upgrad... | 29.74 | 98 | 0.664425 |
f7d19eb3a540b978b6a2f15cb1c17fb18410d76e | 2,768 | py | Python | main.py | jonasrothfuss/DeepEpisodicMemory | 1095315a5d75a4840ef4017af70432e2dd535e4c | [
"MIT"
] | 13 | 2017-02-03T17:17:04.000Z | 2021-01-27T09:29:53.000Z | main.py | jonasrothfuss/DeepEpisodicMemory | 1095315a5d75a4840ef4017af70432e2dd535e4c | [
"MIT"
] | 1 | 2019-01-07T23:53:51.000Z | 2019-01-07T23:53:51.000Z | main.py | jonasrothfuss/DeepEpisodicMemory | 1095315a5d75a4840ef4017af70432e2dd535e4c | [
"MIT"
] | 8 | 2017-02-03T17:17:41.000Z | 2021-01-13T10:53:39.000Z | import tensorflow as tf
import pandas as pd
import numpy as np
from tensorflow.python.platform import app
from core.Initializer import Initializer
from core.Model import create_model
from core.development_op import train, validate
from core.production_op import feed, create_batch_and_feed
from settings import FLAGS
fr... | 37.405405 | 114 | 0.723627 |
f7d1c1cf06cfe3dd106ca174b5bfdfdaba3e7ae7 | 4,976 | py | Python | script.py | andrewdyates/geo_api | 3c60afcdeab8af472e0c03587ee52c39101bfcef | [
"Unlicense"
] | 1 | 2020-04-29T18:55:56.000Z | 2020-04-29T18:55:56.000Z | script.py | andrewdyates/geo_api | 3c60afcdeab8af472e0c03587ee52c39101bfcef | [
"Unlicense"
] | null | null | null | script.py | andrewdyates/geo_api | 3c60afcdeab8af472e0c03587ee52c39101bfcef | [
"Unlicense"
] | null | null | null | #!/usr/bin/python
"""Download a GSE Study in a clean format. Writes to local directory by default.
Packaged as an easy script wrapper that doesn't require the local environment
variables to be set and intelligently handles substudies.
Downloads each substudy as a separate file. Writes log about results.
SAMPLE USE:
$... | 34.317241 | 86 | 0.666801 |
f7d1ef2c51ee609663899e979591e196bae1639f | 38,944 | py | Python | mtgjson5/set_builder.py | kodabb/mtgjson | e81dcdac4aa1191152dfa95eaa89c85921a48bdc | [
"MIT"
] | null | null | null | mtgjson5/set_builder.py | kodabb/mtgjson | e81dcdac4aa1191152dfa95eaa89c85921a48bdc | [
"MIT"
] | null | null | null | mtgjson5/set_builder.py | kodabb/mtgjson | e81dcdac4aa1191152dfa95eaa89c85921a48bdc | [
"MIT"
] | null | null | null | """
MTGJSON Set Builder
"""
import json
import logging
import pathlib
import re
import unicodedata
import uuid
from typing import Any, Dict, List, Optional, Set, Tuple
from . import consts
from .classes import (
MtgjsonCardObject,
MtgjsonForeignDataObject,
MtgjsonGameFormatsObject,
MtgjsonLeadershipSki... | 36.983856 | 95 | 0.651936 |
f7d1fa0146f21e64ddf85c3628168ef04f7a8017 | 156 | py | Python | setup.py | Masamerc/easy-beam-pipeline | fb501e87eb379be5cfd7d35caab9682b8c3c30ae | [
"MIT"
] | null | null | null | setup.py | Masamerc/easy-beam-pipeline | fb501e87eb379be5cfd7d35caab9682b8c3c30ae | [
"MIT"
] | 1 | 2021-05-04T03:53:28.000Z | 2021-05-05T10:54:06.000Z | setup.py | Masamerc/easy-beam-pipeline | fb501e87eb379be5cfd7d35caab9682b8c3c30ae | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name='easy-beam-pipeline',
version='0.1.0',
install_requires=[],
packages=setuptools.find_packages(),
) | 19.5 | 40 | 0.692308 |
f7d23e83a59c7cf18fac1695df62199ff0fed18e | 17,742 | py | Python | S1_NRB/validation/validate_cog.py | SAR-ARD/S1_NRB | c43bff1c693a357c90d40d8dd547b6f208884542 | [
"MIT"
] | 2 | 2022-03-03T12:18:29.000Z | 2022-03-10T12:43:54.000Z | S1_NRB/validation/validate_cog.py | SAR-ARD/S1_NRB | c43bff1c693a357c90d40d8dd547b6f208884542 | [
"MIT"
] | 2 | 2022-03-09T11:49:54.000Z | 2022-03-18T08:55:46.000Z | S1_NRB/validation/validate_cog.py | SAR-ARD/S1_NRB | c43bff1c693a357c90d40d8dd547b6f208884542 | [
"MIT"
] | 1 | 2022-03-01T15:39:56.000Z | 2022-03-01T15:39:56.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# *****************************************************************************
# $Id$
#
# Project: GDAL
# Purpose: Validate Cloud Optimized GeoTIFF file structure
# Author: Even Rouault, <even dot rouault at spatialys dot com>
#
# *********************************... | 43.167883 | 156 | 0.576429 |
f7d26cd2206484d3f7cbaef37db2a78087bbd8b2 | 3,275 | py | Python | hs_labels/migrations/0001_initial.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_labels/migrations/0001_initial.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_labels/migrations/0001_initial.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | # -*- coding: utf-8 -*-
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('hs_core', '0014_auto_20151123_1451'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migratio... | 44.256757 | 160 | 0.578931 |
f7d2727bb5140ec12f941b74e7c8485105f93188 | 6,407 | py | Python | tests/app/v2/inbound_sms/test_get_inbound_sms.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | tests/app/v2/inbound_sms/test_get_inbound_sms.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | tests/app/v2/inbound_sms/test_get_inbound_sms.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | from flask import json, url_for
from tests import create_authorization_header
from tests.app.db import create_inbound_sms
def test_get_inbound_sms_returns_200(client, sample_service):
all_inbound_sms = [
create_inbound_sms(service=sample_service, user_number="447700900111", content="Hi"),
create_... | 42.713333 | 120 | 0.73685 |
f7d274a4cb2f566a90020c07e97664c7326fbc98 | 2,738 | py | Python | brainbox/examples/docs_load_video.py | int-brain-lab/ibllib | 93be6b98848758e05cdc9398caaf19e6a68f7386 | [
"MIT"
] | 38 | 2018-08-07T21:55:29.000Z | 2022-03-21T14:49:03.000Z | brainbox/examples/docs_load_video.py | int-brain-lab/ibllib | 93be6b98848758e05cdc9398caaf19e6a68f7386 | [
"MIT"
] | 207 | 2018-07-25T15:10:48.000Z | 2022-03-08T13:23:08.000Z | brainbox/examples/docs_load_video.py | int-brain-lab/ibllib | 93be6b98848758e05cdc9398caaf19e6a68f7386 | [
"MIT"
] | 35 | 2018-09-04T14:49:56.000Z | 2022-01-06T21:17:51.000Z | """
Get video frames and metadata
===================================
Video frames and meta data can be loaded using the ibllib.io.video module, which contains
functions for loading individual or groups of frames efficiently. The video may be streamed
remotely or loaded from a local file. In these examples a remote U... | 42.123077 | 96 | 0.739591 |
f7d294d19fa818d23af669b521d4dd04af921a23 | 1,844 | py | Python | test_projects/SkewYInterface/main.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 16 | 2021-04-16T02:01:29.000Z | 2022-01-01T08:53:49.000Z | test_projects/SkewYInterface/main.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 613 | 2021-03-24T03:37:38.000Z | 2022-03-26T10:58:37.000Z | test_projects/SkewYInterface/main.py | simon-ritchie/apyscript | c319f8ab2f1f5f7fad8d2a8b4fc06e7195476279 | [
"MIT"
] | 2 | 2021-06-20T07:32:58.000Z | 2021-12-26T08:22:11.000Z | """The test project for the SkewYInterface class.
Command examples:
$ python test_projects/SkewYInterface/main.py
"""
import sys
sys.path.append('./')
import os
from types import ModuleType
from typing_extensions import TypedDict
import apysc as ap
from apysc._file import file_util
this_module:... | 23.948052 | 67 | 0.642082 |
f7d2b094562a4f02ba4e12d1f150e61308034774 | 494 | py | Python | adminrestrict/test_urls.py | primal100/django-adminrestrict | f019bb076fcec9d5d949d3cd0014079a3f5ae0b3 | [
"MIT"
] | 29 | 2015-04-17T04:11:25.000Z | 2022-01-12T07:32:47.000Z | adminrestrict/test_urls.py | primal100/django-adminrestrict | f019bb076fcec9d5d949d3cd0014079a3f5ae0b3 | [
"MIT"
] | 20 | 2016-01-21T14:16:35.000Z | 2022-03-29T20:45:26.000Z | adminrestrict/test_urls.py | primal100/django-adminrestrict | f019bb076fcec9d5d949d3cd0014079a3f5ae0b3 | [
"MIT"
] | 24 | 2015-08-29T11:14:46.000Z | 2021-09-26T14:19:53.000Z | from django.conf.urls import url, include
from django.contrib import admin
from django import VERSION
if VERSION[0] < 2:
try:
from django.conf.urls import patterns
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
)
except ImportError:
urlpatterns... | 24.7 | 54 | 0.601215 |
f7d2d19e64069525ab512be9dd9df0e5190692eb | 1,781 | py | Python | rest_api/api/video/business.py | ushaesel/youtubeFlaskAPI | 6edc5d110136e307c1c0334397c3958ef71dc057 | [
"Apache-2.0"
] | null | null | null | rest_api/api/video/business.py | ushaesel/youtubeFlaskAPI | 6edc5d110136e307c1c0334397c3958ef71dc057 | [
"Apache-2.0"
] | null | null | null | rest_api/api/video/business.py | ushaesel/youtubeFlaskAPI | 6edc5d110136e307c1c0334397c3958ef71dc057 | [
"Apache-2.0"
] | null | null | null | from rest_api.database import db
from rest_api.database.models import Video
from sqlalchemy.orm.exc import NoResultFound
def create_url(data):
url = data.get('url')
video = Video(url)
db.session.add(video)
db.session.commit()
def find_by_url(url):
try:
youtube = Video.query.filter(Video.... | 24.39726 | 60 | 0.659742 |
f7d2db21008c223504a3c50086d57be6223cdd86 | 2,286 | py | Python | QuadKey/tests/quadkey_tests.py | leidix/images-to-osm | 5375d69c0f78aba9c153b0ada7ef7d6b8fb87b13 | [
"MIT"
] | 487 | 2017-12-21T09:23:42.000Z | 2022-03-27T09:10:12.000Z | QuadKey/tests/quadkey_tests.py | leidix/images-to-osm | 5375d69c0f78aba9c153b0ada7ef7d6b8fb87b13 | [
"MIT"
] | 23 | 2018-01-02T17:07:17.000Z | 2022-03-11T23:19:28.000Z | QuadKey/tests/quadkey_tests.py | leidix/images-to-osm | 5375d69c0f78aba9c153b0ada7ef7d6b8fb87b13 | [
"MIT"
] | 89 | 2018-01-02T17:59:56.000Z | 2021-12-10T09:00:50.000Z | from __future__ import division
try:
xrange
except NameError:
xrange = range
import unittest
from unittest import TestCase
import quadkey
class QuadkeyTest(TestCase):
def testInit(self):
qk = quadkey.from_str('0321201120')
with self.assertRaises(AssertionError):
qk = quadkey.... | 31.315068 | 102 | 0.587489 |
f7d30bcedbfc90c0affcdcc0c2fc6601d326c04a | 5,120 | py | Python | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/operations/_workspace_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/operations/_workspace_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/operations/_workspace_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 38.208955 | 133 | 0.658398 |
f7d313cef5a31bf8fb1fc79bbe06d18e4c0afad8 | 240 | py | Python | libpython/gary/french.py | longnow/panlex-tools | 1b10fa140af96078c7c909cd10f3f3c05f641671 | [
"MIT"
] | 8 | 2015-11-02T22:55:24.000Z | 2018-05-27T22:11:40.000Z | libpython/gary/french.py | longnow/panlex-tools | 1b10fa140af96078c7c909cd10f3f3c05f641671 | [
"MIT"
] | 3 | 2021-03-31T19:12:43.000Z | 2021-12-13T20:03:51.000Z | libpython/gary/french.py | longnow/panlex-tools | 1b10fa140af96078c7c909cd10f3f3c05f641671 | [
"MIT"
] | 2 | 2016-07-11T18:00:18.000Z | 2019-04-23T14:41:52.000Z |
import regex as re
def remove_article(text):
return re.sub('^l[ea] ', '', text)
def remove_feminine_infl(text):
text = re.sub('(?<=\w+)\(e\)(?!\w)', '', text)
text = re.sub('(?<=\w+)\(ne\)(?!\w)', '', text)
return text
| 18.461538 | 51 | 0.516667 |
f7d3157d48429f5aa0223231e0557bed81722676 | 2,510 | py | Python | Soccer-7701/SoccerSerialParserCOM.py | MSOInfinite/DaktronicsCGSerialParser | 6df702fe429822eceab42a1a3ab2dd66176b38e1 | [
"MIT"
] | 2 | 2020-11-24T01:08:56.000Z | 2021-09-25T16:15:53.000Z | Soccer-7701/SoccerSerialParserCOM.py | Bristol-Tennessee-City-Schools/DaktronicsCGSerialParser | 6df702fe429822eceab42a1a3ab2dd66176b38e1 | [
"MIT"
] | null | null | null | Soccer-7701/SoccerSerialParserCOM.py | Bristol-Tennessee-City-Schools/DaktronicsCGSerialParser | 6df702fe429822eceab42a1a3ab2dd66176b38e1 | [
"MIT"
] | 1 | 2021-02-21T19:11:42.000Z | 2021-02-21T19:11:42.000Z | #!/usr/bin/env python
"""SoccerSerialParserCOM.py: Collects data from a Daktronics All Sport 5000 connected via port J2 to a
Daktronics All Sport CG connected to a computer on COM port (defined on line 47), then parses data to
a .csv readable by broadcasting programs. This file has only been tested using game co... | 30.987654 | 125 | 0.703984 |
f7d33369ab8b54c3571184fa60cbfc95c19ee041 | 868 | py | Python | hashicorp_vault_client/test/test_body68.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | null | null | null | hashicorp_vault_client/test/test_body68.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | 2 | 2019-09-30T20:56:41.000Z | 2019-10-02T00:22:07.000Z | hashicorp_vault_client/test/test_body68.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
HashiCorp Vault API
HTTP API that gives you full access to Vault. All API routes are prefixed with `/v1/`. # noqa: E501
OpenAPI spec version: 1.2.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
... | 21.7 | 104 | 0.68318 |
f7d37f6b33b74568bc5cad780acd52cd2a01cd55 | 282 | py | Python | examples/memoized_development/memoized_development/solids/tree.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/memoized_development/memoized_development/solids/tree.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/memoized_development/memoized_development/solids/tree.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | from memoized_development.solids.solid_utils import get_hash_for_file
from dagster import solid
@solid(version=get_hash_for_file(__file__), config_schema={"tree_species": str})
def emit_tree(context):
species = context.solid_config["tree_species"]
return "tree", species
| 28.2 | 80 | 0.797872 |
f7d3a126b8060ce97eea6e7844fd92541b852b0d | 526 | py | Python | src/advance_modules/datetime_t.py | sachithdickwella/python-tute | 42583d04db0ab907288b9bef0b022730eec0aa7d | [
"Apache-2.0"
] | null | null | null | src/advance_modules/datetime_t.py | sachithdickwella/python-tute | 42583d04db0ab907288b9bef0b022730eec0aa7d | [
"Apache-2.0"
] | null | null | null | src/advance_modules/datetime_t.py | sachithdickwella/python-tute | 42583d04db0ab907288b9bef0b022730eec0aa7d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import datetime
# Time
t = datetime.time(5, 25, 5, 200)
print(t)
print(datetime.time.min)
print(datetime.time.max)
print(datetime.time.resolution)
# Date
today = datetime.date.today()
print(today)
print(today.timetuple())
print(f'{today.year}/{today.month}/{today.day}'... | 15.939394 | 48 | 0.701521 |
f7d3ab2962807cbc506fea5a20287bff0ebdbda0 | 20 | py | Python | btd6_memory_info/generated/System/Linq/Lookup/Grouping/grouping.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/System/Linq/Lookup/Grouping/grouping.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/System/Linq/Lookup/Grouping/grouping.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class Grouping: pass | 20 | 20 | 0.85 |
f7d3ab4b0819fbf4127ca72eb42cf0bf7744ad21 | 125 | py | Python | snm/specialities/apps.py | sparesnmechs/sparesnmechs | 44a7178fcfd0c89004d9f31734405c8d0fd5cd97 | [
"MIT"
] | null | null | null | snm/specialities/apps.py | sparesnmechs/sparesnmechs | 44a7178fcfd0c89004d9f31734405c8d0fd5cd97 | [
"MIT"
] | 9 | 2021-02-27T13:13:38.000Z | 2021-06-04T11:57:12.000Z | snm/specialities/apps.py | sparesnmechs/sparesnmechs | 44a7178fcfd0c89004d9f31734405c8d0fd5cd97 | [
"MIT"
] | null | null | null | """Speciality app."""
from django.apps import AppConfig
class SpecialitiesConfig(AppConfig):
name = "snm.specialities"
| 17.857143 | 36 | 0.744 |
f7d3b88bab5d4bb13959fd550cf394289f39b3ae | 11,682 | py | Python | python-scripts/gt_generate_inbetween.py | freemanpro/gt-tools | d24c81b047f680fe8d35ae99cd0effcbb21b73bc | [
"MIT"
] | null | null | null | python-scripts/gt_generate_inbetween.py | freemanpro/gt-tools | d24c81b047f680fe8d35ae99cd0effcbb21b73bc | [
"MIT"
] | null | null | null | python-scripts/gt_generate_inbetween.py | freemanpro/gt-tools | d24c81b047f680fe8d35ae99cd0effcbb21b73bc | [
"MIT"
] | null | null | null | """
Inbetween Generator -> Simple script used to create Inbetween Transforms
@Guilherme Trevisan - TrevisanGMW@gmail.com - 2020-02-04
1.1 - 2020-02-18
Added Color Picker
1.2 - 2020-06-07
Updated naming convention to make it clearer. (PEP8)
Changed Script Name. (Previously rigLayer Generator)
Fixed ran... | 46.728 | 182 | 0.609827 |
f7d3e4645aa69cb67288da78f8e86ff71199c98a | 11,498 | py | Python | rlkit/launchers/experiments/ashvin/bear_launcher.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | rlkit/launchers/experiments/ashvin/bear_launcher.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | rlkit/launchers/experiments/ashvin/bear_launcher.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | """
Example usage from command line
python railrl/launchers/experiments/ashvin/bear_launcher.py --demo_data=/home/ashvin/data/s3doodad/demos/icml2020/hand/pen2_sparse.npy --eval_freq=1000 --algo_name=BEAR --env_name=pen-v0 --log_dir=data_walker_BEAR/ --lagrange_thresh=10.0 --distance_type=MMD --mode=auto --num_samples_... | 41.21147 | 387 | 0.630631 |
f7d42218187072b15ace0f15a14ca8fedd1a8564 | 58,390 | py | Python | ThirdParty/Twisted/twisted/names/dns.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 1 | 2021-10-13T01:57:14.000Z | 2021-10-13T01:57:14.000Z | ThirdParty/Twisted/twisted/names/dns.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | null | null | null | ThirdParty/Twisted/twisted/names/dns.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 5 | 2015-10-09T04:12:29.000Z | 2021-12-15T16:57:11.000Z | # -*- test-case-name: twisted.names.test.test_dns -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
DNS protocol implementation.
Future Plans:
- Get rid of some toplevels, maybe.
"""
from __future__ import division, absolute_import
__all__ = [
'IEncodable', 'IRecord',
'A',... | 28.482927 | 131 | 0.597174 |
f7d427ce26e6a73be96df731eba5f07006380df5 | 39,111 | py | Python | pandas/core/arrays/base.py | MaxVanDeursen/pandas | 9821b77de692716d7c2b62db1a68cac9ffc456c3 | [
"BSD-3-Clause"
] | 12 | 2015-02-13T06:55:58.000Z | 2020-06-22T19:02:52.000Z | pandas/core/arrays/base.py | MaxVanDeursen/pandas | 9821b77de692716d7c2b62db1a68cac9ffc456c3 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/arrays/base.py | MaxVanDeursen/pandas | 9821b77de692716d7c2b62db1a68cac9ffc456c3 | [
"BSD-3-Clause"
] | 16 | 2015-01-24T07:42:41.000Z | 2021-07-06T21:13:39.000Z | """An interface for extending pandas with custom arrays.
.. warning::
This is an experimental API and subject to breaking changes
without warning.
"""
import operator
from typing import Any, Callable, Optional, Sequence, Tuple, Union
import numpy as np
from pandas.compat import PY3, set_function_name
from pan... | 34.827248 | 79 | 0.580502 |
f7d42da481583e7977a5860f69d5b026effecaa9 | 10,010 | py | Python | google-cloud-sdk/.install/.backup/lib/surface/compute/url_maps/edit.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/surface/compute/url_maps/edit.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/surface/compute/url_maps/edit.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2014 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 by applicable law or ag... | 38.5 | 79 | 0.570729 |
f7d46efdd53100c683d1c2119bd8206e1a60d297 | 8,332 | py | Python | improver_tests/psychrometric_calculations/precip_phase_probability/test_PrecipPhaseProbability.py | VictoriaLouiseS/improver | 86470bff973e21fbd5f24e26047871ad3bc2f3db | [
"BSD-3-Clause"
] | null | null | null | improver_tests/psychrometric_calculations/precip_phase_probability/test_PrecipPhaseProbability.py | VictoriaLouiseS/improver | 86470bff973e21fbd5f24e26047871ad3bc2f3db | [
"BSD-3-Clause"
] | 3 | 2020-04-25T12:55:42.000Z | 2020-07-23T11:50:46.000Z | improver_tests/psychrometric_calculations/precip_phase_probability/test_PrecipPhaseProbability.py | Kat-90/improver | a5c31be3430df429ae38e7c16e267fcbc2af1858 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2020 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 41.452736 | 79 | 0.665386 |
f7d4709dac9718ba677254e4101c7c3a0d63d260 | 13,108 | py | Python | {{cookiecutter.project_slug}}/config/settings/base.py | camlog/django-naqsh | 1e55fae417b877b9017acf54d534c8c8e9c3d9cb | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/config/settings/base.py | camlog/django-naqsh | 1e55fae417b877b9017acf54d534c8c8e9c3d9cb | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/config/settings/base.py | camlog/django-naqsh | 1e55fae417b877b9017acf54d534c8c8e9c3d9cb | [
"BSD-3-Clause"
] | null | null | null | """
Base settings to build other settings files upon.
"""
from django.utils.translation import ugettext_lazy as _
import environ
ROOT_DIR = (
environ.Path(__file__) - 3
) # ({{ cookiecutter.project_slug }}/config/settings/base.py - 3 = {{ cookiecutter.project_slug }}/)
APPS_DIR = ROOT_DIR.path("{{ cookiecutter.... | 42.558442 | 142 | 0.632667 |
f7d483a6923c10a2e0452640fff45def29451b39 | 802 | py | Python | tests/test_cli.py | simonski/pycommon | 805b36a11b647a7e3b08921c7966a93ebecf02fe | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | simonski/pycommon | 805b36a11b647a7e3b08921c7966a93ebecf02fe | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | simonski/pycommon | 805b36a11b647a7e3b08921c7966a93ebecf02fe | [
"Apache-2.0"
] | null | null | null | import os
from unittest import TestCase
class TestCLI(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_get_command(self):
pass
def test_index_of(self):
pass
def test_contains(self):
pass
def test_get_or_die(self):
pass
... | 14.581818 | 47 | 0.598504 |
f7d485be047cb6c2c5e1ec5c82de261197ba85ce | 2,467 | py | Python | google-cloud-sdk/lib/surface/deployment_manager/runtime_configs/waiters/delete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/surface/deployment_manager/runtime_configs/waiters/delete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/surface/deployment_manager/runtime_configs/waiters/delete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2016 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 by applicable law or ag... | 30.085366 | 79 | 0.704905 |
f7d4878ee456322927310c783c76bac2d1e8a83f | 1,021 | py | Python | onadata/apps/main/tests/test_user_settings.py | ubpd/kobocat | 45906e07e8f05c30e3e26bab5570a8ab1ee264db | [
"BSD-2-Clause"
] | null | null | null | onadata/apps/main/tests/test_user_settings.py | ubpd/kobocat | 45906e07e8f05c30e3e26bab5570a8ab1ee264db | [
"BSD-2-Clause"
] | null | null | null | onadata/apps/main/tests/test_user_settings.py | ubpd/kobocat | 45906e07e8f05c30e3e26bab5570a8ab1ee264db | [
"BSD-2-Clause"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals, print_function, division, absolute_import
import unittest
from django.core.urlresolvers import reverse
from onadata.apps.main.models import UserProfile
from onadata.apps.main.views import profile_settings
from .test_base import TestBase
class TestUserSettings(... | 32.935484 | 82 | 0.722821 |
f7d4938b763e088fefea090da9a633a364eaaad4 | 175 | py | Python | graph_plot/tester.py | kousokujin/keras-resnet | 9b94f423ec3325ecbb76fa7af31688089b8c3332 | [
"MIT"
] | null | null | null | graph_plot/tester.py | kousokujin/keras-resnet | 9b94f423ec3325ecbb76fa7af31688089b8c3332 | [
"MIT"
] | null | null | null | graph_plot/tester.py | kousokujin/keras-resnet | 9b94f423ec3325ecbb76fa7af31688089b8c3332 | [
"MIT"
] | null | null | null | from json_graph import json_plot_data
from plot import plot_drawer
d = json_plot_data(path="cifer-10_accuacy.json")
graph = plot_drawer(plot_data=d)
graph.show()
graph.save() | 25 | 48 | 0.805714 |
f7d51152358f6cb704ef311d798e43e953845b7a | 20,115 | py | Python | experimental/tests/scalar_reverse.py | arthus701/algopy | 1e2430f803289bbaed6bbdff6c28f98d7767835c | [
"Unlicense"
] | 54 | 2015-03-05T13:38:08.000Z | 2021-11-29T11:54:48.000Z | experimental/tests/scalar_reverse.py | arthus701/algopy | 1e2430f803289bbaed6bbdff6c28f98d7767835c | [
"Unlicense"
] | 7 | 2016-04-06T11:25:00.000Z | 2020-11-09T13:53:20.000Z | experimental/tests/scalar_reverse.py | arthus701/algopy | 1e2430f803289bbaed6bbdff6c28f98d7767835c | [
"Unlicense"
] | 13 | 2015-01-17T17:05:56.000Z | 2021-08-05T01:13:16.000Z | #!/usr/bin/env python
try:
from reverse_mode import *
except:
import sys
sys.path = ['..'] + sys.path
from reverse_mode import *
#############################################################
# TESTING CLASS TC
#############################################################
# TESTING ALL FUNCTIONS FOR BASIC FUNCTI... | 24.205776 | 207 | 0.589063 |
f7d533c26923a3107ff376e24d325f8e2580a404 | 19,838 | py | Python | appengine/predator/analysis/test/callstack_filters_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/predator/analysis/test/callstack_filters_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/predator/analysis/test/callstack_filters_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
from analysis import callstack_filters
from analysis.analysis_testcase import AnalysisTestCase
from analysis.stacktrace import StackFrame
from a... | 38.003831 | 80 | 0.630003 |
f7d533f26945a2f38e05f3ea23d476eea2af5b8c | 3,313 | py | Python | deep_rl/utils/misc.py | SharathRaparthy/DeepRL | 96cc5d586c63681b469eca38fcf20f988b7f1ced | [
"MIT"
] | null | null | null | deep_rl/utils/misc.py | SharathRaparthy/DeepRL | 96cc5d586c63681b469eca38fcf20f988b7f1ced | [
"MIT"
] | null | null | null | deep_rl/utils/misc.py | SharathRaparthy/DeepRL | 96cc5d586c63681b469eca38fcf20f988b7f1ced | [
"MIT"
] | null | null | null | #######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
################################... | 33.464646 | 119 | 0.562934 |
f7d53ba0bf4f137529abcabdc77b254a46ec1284 | 9,860 | py | Python | data_steward/test/unit_test/data_steward/admin/test_key_rotation.py | amcgrenera-vumc/curation | f30aa8cb3b8de4e5dfdc3c95a0d98ca21de7df08 | [
"MIT"
] | null | null | null | data_steward/test/unit_test/data_steward/admin/test_key_rotation.py | amcgrenera-vumc/curation | f30aa8cb3b8de4e5dfdc3c95a0d98ca21de7df08 | [
"MIT"
] | null | null | null | data_steward/test/unit_test/data_steward/admin/test_key_rotation.py | amcgrenera-vumc/curation | f30aa8cb3b8de4e5dfdc3c95a0d98ca21de7df08 | [
"MIT"
] | null | null | null | import unittest
import datetime
from mock import mock
from admin import key_rotation
from googleapiclient.errors import HttpError
class KeyRotationTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
print('**************************************************************')
print(cls.__nam... | 55.393258 | 121 | 0.665822 |
f7d55c7caa872a88596754a0b5c067198ab5a524 | 14,332 | py | Python | zerver/tests/webhooks/test_gitlab.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | null | null | null | zerver/tests/webhooks/test_gitlab.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | null | null | null | zerver/tests/webhooks/test_gitlab.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from zerver.lib.webhooks.git import COMMITS_LIMIT
from zerver.lib.test_classes import WebhookTestCase
class GitlabHookTests(WebhookTestCase):
STREAM_NAME = 'gitlab'
URL_TEMPLATE = "/api/v1/external/gitlab?&api_key={api_key}"
FIXTURE_DIR_NAME = 'gitlab'
def test_push_event_messa... | 43.695122 | 445 | 0.662992 |
f7d5afd64a38c6fa33d7a67ce1929c4dc74e57ea | 775 | py | Python | CourseraMOOCdbTranslate/program/piping_scripts/queries/openedx/content_sections.py | rcmurray/WorkflowComponents | 368f8132ce5bef3ac3fb9d8e1a13a08f91764cfa | [
"BSD-4-Clause-UC"
] | 26 | 2016-09-14T18:15:29.000Z | 2021-12-01T20:01:29.000Z | CourseraMOOCdbTranslate/program/piping_scripts/queries/openedx/content_sections.py | rcmurray/WorkflowComponents | 368f8132ce5bef3ac3fb9d8e1a13a08f91764cfa | [
"BSD-4-Clause-UC"
] | 122 | 2017-09-12T15:22:03.000Z | 2021-09-27T17:25:08.000Z | CourseraMOOCdbTranslate/program/piping_scripts/queries/openedx/content_sections.py | rcmurray/WorkflowComponents | 368f8132ce5bef3ac3fb9d8e1a13a08f91764cfa | [
"BSD-4-Clause-UC"
] | 17 | 2017-02-16T16:04:41.000Z | 2021-02-06T05:36:44.000Z | from ...utilities import db, moocdb_utils
from common import *
def GetContentSections(vars):
resource_type_id = moocdb_utils.GetResourceTypeMap(vars)['content_section']
src_sections = [x for x in vars["resource_list"] if x["_id"]["category"] == 'chapter']
section_index = 1
output_items = []
... | 32.291667 | 90 | 0.632258 |
f7d5ef5206498aba78882f93eaac2ce07f9f635c | 22,793 | py | Python | LR/lr/tests/functional/test_obtain.py | LearningRegistry/LearningRegistry | d9f0a8117a4adb8fcf6bf101d3d58d799463a2e2 | [
"Apache-2.0"
] | 26 | 2015-04-14T03:11:58.000Z | 2022-01-06T14:31:07.000Z | LR/lr/tests/functional/test_obtain.py | LearningRegistry/LearningRegistry | d9f0a8117a4adb8fcf6bf101d3d58d799463a2e2 | [
"Apache-2.0"
] | 11 | 2015-04-03T21:54:03.000Z | 2017-05-02T17:20:03.000Z | LR/lr/tests/functional/test_obtain.py | LearningRegistry/LearningRegistry | d9f0a8117a4adb8fcf6bf101d3d58d799463a2e2 | [
"Apache-2.0"
] | 16 | 2015-02-11T09:30:18.000Z | 2020-11-20T02:06:24.000Z | from lr.lib.harvest import harvest
from lr.lib.schema_helper import TombstoneValidator, ResourceDataModelValidator
from lr.tests import *
from lr.util.decorators import ForceCouchDBIndexing, PublishTestDocs, SetFlowControl, ModifiedServiceDoc, update_authz, make_gpg_keys
from lr.util.testdata import getTestDataForRepla... | 46.706967 | 166 | 0.639758 |
f7d602cbb651e4b6272c3515c6f7c94313eb7d41 | 13,626 | py | Python | tasks.py | jdrew82/nautobot-plugin-device-lifecycle-mgmt | 7ac9a479f7912b7c082f61cccc4b48e6aad16e46 | [
"Apache-2.0"
] | 21 | 2021-11-05T18:20:09.000Z | 2022-03-19T16:41:27.000Z | tasks.py | jdrew82/nautobot-plugin-device-lifecycle-mgmt | 7ac9a479f7912b7c082f61cccc4b48e6aad16e46 | [
"Apache-2.0"
] | 34 | 2021-11-05T16:52:35.000Z | 2022-03-22T21:02:14.000Z | tasks.py | jdrew82/nautobot-plugin-device-lifecycle-mgmt | 7ac9a479f7912b7c082f61cccc4b48e6aad16e46 | [
"Apache-2.0"
] | 8 | 2021-11-05T22:04:43.000Z | 2022-03-28T15:15:31.000Z | """Tasks for use with Invoke.
(c) 2020-2021 Network To Code
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 t... | 31.038724 | 120 | 0.647732 |
f7d60c49f465a8618046f582408c314c8869aedb | 2,216 | py | Python | src/api/bkuser_core/categories/management/commands/create_pluggable_category.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/api/bkuser_core/categories/management/commands/create_pluggable_category.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/api/bkuser_core/categories/management/commands/create_pluggable_category.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic... | 42.615385 | 115 | 0.720217 |
f7d60f27d443a4b81a050746c23d1a4d985e4801 | 2,229 | py | Python | src/mod_stats_by_aircraft/reservoir_sampling.py | FGlazov/IL2Stats_ByAircraftMod | acf66eb3f31a7e789d61a5c60d32fd30dbcedf4b | [
"MIT"
] | null | null | null | src/mod_stats_by_aircraft/reservoir_sampling.py | FGlazov/IL2Stats_ByAircraftMod | acf66eb3f31a7e789d61a5c60d32fd30dbcedf4b | [
"MIT"
] | null | null | null | src/mod_stats_by_aircraft/reservoir_sampling.py | FGlazov/IL2Stats_ByAircraftMod | acf66eb3f31a7e789d61a5c60d32fd30dbcedf4b | [
"MIT"
] | null | null | null | import json
import random
import numpy as np
SAMPLE = 'SAMPLE' # A sample of ammo breakdowns. Holds up to SAMPLE_SIZE many elements.
SAMPLE_SIZE = 50
RESERVOIR_COUNTER = 'RESERVOIR_COUNTER' # Helper int that is used for "reservoir sampling", single pass fair sampling.
# https://stackoverflow.com/a/47626762
class ... | 36.540984 | 120 | 0.712427 |
f7d6380b4e372a8d5e9fbf40f17b946079bbec2e | 28,552 | py | Python | python/ray/tests/test_usage_stats.py | naijoaix/ray | 5a43b075bcc346fb95f1d30c85dbcb79a7fa5769 | [
"Apache-2.0"
] | 1 | 2021-12-13T20:43:30.000Z | 2021-12-13T20:43:30.000Z | python/ray/tests/test_usage_stats.py | thetwotravelers/ray | d6096df7428e6b2f5f371b7bafa67d998dd81e13 | [
"Apache-2.0"
] | null | null | null | python/ray/tests/test_usage_stats.py | thetwotravelers/ray | d6096df7428e6b2f5f371b7bafa67d998dd81e13 | [
"Apache-2.0"
] | null | null | null | import os
import pytest
import sys
import ray
import pathlib
import json
import time
from dataclasses import asdict
from pathlib import Path
from jsonschema import validate
import ray._private.usage.usage_lib as ray_usage_lib
import ray._private.usage.usage_constants as usage_constants
from ray._private.usage.usage_l... | 36.652118 | 88 | 0.655856 |
f7d6453136b0ccb8147c89cb0edbd4c656e7c4ad | 3,124 | py | Python | examples/plotting/simple_differential_rotation.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | examples/plotting/simple_differential_rotation.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | examples/plotting/simple_differential_rotation.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | """
============================
Simple Differential Rotation
============================
The Sun is known to rotate differentially, meaning that the rotation rate
near the poles (rotation period of approximately 35 days) is not the same as
the rotation rate near the equator (rotation period of approximately 25 days)... | 37.190476 | 83 | 0.629001 |
f7d64b331036f57d444dfb54c61866282e148909 | 1,231 | py | Python | ceacoest/modelling/symquat.py | dimasad/ceacoest | 4a5eb946e118145d054cac785cc8b4d834c28192 | [
"MIT"
] | 3 | 2018-12-12T21:11:30.000Z | 2020-08-03T02:26:03.000Z | ceacoest/modelling/symquat.py | dimasad/ceacoest | 4a5eb946e118145d054cac785cc8b4d834c28192 | [
"MIT"
] | null | null | null | ceacoest/modelling/symquat.py | dimasad/ceacoest | 4a5eb946e118145d054cac785cc8b4d834c28192 | [
"MIT"
] | 2 | 2018-12-03T14:34:10.000Z | 2021-08-17T17:04:12.000Z | """Symbolic quaterion operations, dynamics and rotations."""
import numpy as np
import sympy
def derivative(quat, omega, renorm_gain=0):
[q0, q1, q2, q3] = quat
[p, q, r] = omega
err = 1 - (q0**2 + q1**2 + q2**2 + q3**2)
q0dot = -0.5 * (p*q1 + q*q2 + r*q3) + renorm_gain*err*q0
q1dot = -0.5 * (-p... | 33.27027 | 79 | 0.527214 |
f7d66aaef5b16026e23898196c4b79dafb6ad9b9 | 211 | py | Python | onadata/libs/utils/string.py | ubpd/kobocat | 45906e07e8f05c30e3e26bab5570a8ab1ee264db | [
"BSD-2-Clause"
] | null | null | null | onadata/libs/utils/string.py | ubpd/kobocat | 45906e07e8f05c30e3e26bab5570a8ab1ee264db | [
"BSD-2-Clause"
] | null | null | null | onadata/libs/utils/string.py | ubpd/kobocat | 45906e07e8f05c30e3e26bab5570a8ab1ee264db | [
"BSD-2-Clause"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals, print_function, division, absolute_import
def str2bool(v):
return v.lower() in (
'yes', 'true', 't', '1') if isinstance(v, basestring) else v
| 35.166667 | 82 | 0.691943 |
f7d6aebc23b2fe13b46dc08f43ad48ff603a96e1 | 10,950 | py | Python | appengine/findit/util_scripts/remote_queries/flake_analyzer_report.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/findit/util_scripts/remote_queries/flake_analyzer_report.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/findit/util_scripts/remote_queries/flake_analyzer_report.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
# Append paths so that dependencies would work.
_FINDIT_DIR = os.path.join(
os.path.dirname(__file__), os.path.pardir, os.path.pardir)
_THIRD_PARTY_DIR = os.path.join(
os.path.dirname(__file__), os.path.pardir, os.path.pardir, 'third_party')
_FIRST_PARTY_DIR = os.path.join(
os.path.dir... | 39.963504 | 80 | 0.664384 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.