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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2dd0147c17905ec6629eb5f5c85dc5683a9497a9 | 6,761 | py | Python | deepdoctection/mapper/prodigystruct.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 39 | 2021-12-14T11:05:25.000Z | 2022-03-31T18:50:58.000Z | deepdoctection/mapper/prodigystruct.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 17 | 2022-01-04T14:32:26.000Z | 2022-03-29T14:01:36.000Z | deepdoctection/mapper/prodigystruct.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 4 | 2022-01-11T16:40:17.000Z | 2022-03-30T02:09:55.000Z | # -*- coding: utf-8 -*-
# File: prodigystruct.py
# Copyright 2021 Dr. Janis Meyer. 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... | 35.962766 | 114 | 0.632155 |
2dd022dd7c0fb90fb6213eaa1b8b8999623390b1 | 19,076 | py | Python | colour/plotting/tm3018/components.py | timgates42/colour | cea486394e3925718a0f3dd427edc9dd5b674f0c | [
"BSD-3-Clause"
] | 6 | 2019-06-18T18:53:29.000Z | 2021-09-10T21:02:45.000Z | colour/plotting/tm3018/components.py | timgates42/colour | cea486394e3925718a0f3dd427edc9dd5b674f0c | [
"BSD-3-Clause"
] | null | null | null | colour/plotting/tm3018/components.py | timgates42/colour | cea486394e3925718a0f3dd427edc9dd5b674f0c | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
ANSI/IES TM-30-18 Colour Rendition Report Components
====================================================
Defines the *ANSI/IES TM-30-18 Colour Rendition Report* components plotting
objects:
- :func:`colour.plotting.tm3018.components.plot_spectra_ANSIIESTM3018`
- :func:`colour.plotting... | 32.332203 | 79 | 0.600178 |
2dd0957479d881f5bf56fa1833ced4612529817c | 4,139 | py | Python | src/scripts/run-all-scorings.py | trec-kba/kba-scorer | 6c45ba83b3dc890059b9a89b6598f47b1ced1061 | [
"MIT"
] | 2 | 2015-11-12T06:24:03.000Z | 2020-06-21T11:44:53.000Z | src/scripts/run-all-scorings.py | trec-kba/kba-scorer | 6c45ba83b3dc890059b9a89b6598f47b1ced1061 | [
"MIT"
] | null | null | null | src/scripts/run-all-scorings.py | trec-kba/kba-scorer | 6c45ba83b3dc890059b9a89b6598f47b1ced1061 | [
"MIT"
] | null | null | null | '''
run the CCR scorer on all the groups, including no restriction to a single group
'''
import os
import sys
import json
import subprocess
import multiprocessing
from collections import defaultdict
targets = json.load(open('../../trec-kba-ccr-and-ssf-query-topics-2013-07-16.json'))['targets']
groups = set()
for targ i... | 32.335938 | 275 | 0.661029 |
2dd09a7bf5ee07e2b53463e7a01ec40c6daca66a | 18,153 | py | Python | rowFiller.py | yoid2000/table_maker | de832939e71102f3a3685cde7de1c2e60274bfc2 | [
"MIT"
] | null | null | null | rowFiller.py | yoid2000/table_maker | de832939e71102f3a3685cde7de1c2e60274bfc2 | [
"MIT"
] | null | null | null | rowFiller.py | yoid2000/table_maker | de832939e71102f3a3685cde7de1c2e60274bfc2 | [
"MIT"
] | null | null | null | import sqlite3
import pprint
import os.path
import itertools
import random
import string
import pandas as pd
import numpy as np
import whereParser
class aidManager:
""" Assigns the next aid value """
def __init__(self,alg='distinctPerRow'):
self.alg = alg
if self.alg == 'distinctPerRow':
... | 42.413551 | 121 | 0.575332 |
2dd09bcfe8baac16c909014e375a3f77527083c7 | 863 | py | Python | djangocms_versioning/test_utils/polls/models.py | webbyfox/djangocms-versioning | a466ff0f8d109a22ec2f567cace6ef69d332180c | [
"BSD-3-Clause"
] | null | null | null | djangocms_versioning/test_utils/polls/models.py | webbyfox/djangocms-versioning | a466ff0f8d109a22ec2f567cace6ef69d332180c | [
"BSD-3-Clause"
] | null | null | null | djangocms_versioning/test_utils/polls/models.py | webbyfox/djangocms-versioning | a466ff0f8d109a22ec2f567cace6ef69d332180c | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.urls import reverse
from cms.models import CMSPlugin
class Poll(models.Model):
name = models.TextField()
def __str__(self):
return "{} ({})".format(self.name, self.pk)
class PollContent(models.Model):
poll = models.ForeignKey(Poll, on_delete=models.CASC... | 22.128205 | 75 | 0.696408 |
2dd0aaad6242969a95e57772b12e22d6e235edf8 | 7,379 | py | Python | aldryn_newsblog/cms_plugins.py | PeterW-LWL/aldryn-newsblog | 810609b2aa2f537376817fd4b279845f6ca6a71f | [
"BSD-3-Clause"
] | null | null | null | aldryn_newsblog/cms_plugins.py | PeterW-LWL/aldryn-newsblog | 810609b2aa2f537376817fd4b279845f6ca6a71f | [
"BSD-3-Clause"
] | null | null | null | aldryn_newsblog/cms_plugins.py | PeterW-LWL/aldryn-newsblog | 810609b2aa2f537376817fd4b279845f6ca6a71f | [
"BSD-3-Clause"
] | null | null | null | from distutils.version import LooseVersion
from aldryn_newsblog.cms_appconfig import NewsBlogConfig
from django.utils.translation import ugettext_lazy as _
from cms import __version__ as cms_version
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from . import forms, models
from .u... | 35.30622 | 86 | 0.695487 |
2dd0af4317773b271352a552e4d42611e405d15a | 5,667 | py | Python | tensorbay/opendataset/SegTrack2/loader.py | Hoteryoung/tensorbay-python-sdk | 53c34dd529c20ec69b34ddd348b5c8e74f4094d0 | [
"MIT"
] | null | null | null | tensorbay/opendataset/SegTrack2/loader.py | Hoteryoung/tensorbay-python-sdk | 53c34dd529c20ec69b34ddd348b5c8e74f4094d0 | [
"MIT"
] | null | null | null | tensorbay/opendataset/SegTrack2/loader.py | Hoteryoung/tensorbay-python-sdk | 53c34dd529c20ec69b34ddd348b5c8e74f4094d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copytright 2021 Graviti. Licensed under MIT License.
#
# pylint: disable=invalid-name
# pylint: disable=missing-module-docstring
import os
from typing import Callable, Dict
import numpy as np
from ...dataset import Data, Dataset
from ...label import InstanceMask
from .._utility import glob... | 32.757225 | 98 | 0.610905 |
2dd0b941077e91e12ac8ebd3db8f74e5a5b3900f | 142 | py | Python | serve.py | karlsimsBBC/feed-me | e2bc87aef4740c2899b332f1b4036c169b108b79 | [
"MIT"
] | null | null | null | serve.py | karlsimsBBC/feed-me | e2bc87aef4740c2899b332f1b4036c169b108b79 | [
"MIT"
] | 2 | 2020-02-28T16:52:05.000Z | 2020-02-28T16:52:11.000Z | serve.py | karlsimsBBC/feed-me | e2bc87aef4740c2899b332f1b4036c169b108b79 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
run.py
run the flask webserver for our app.
'''
from src.app import app
if __name__ == '__main__':
app.run() | 14.2 | 36 | 0.612676 |
2dd0c790d99ef1e052b099329f05d792ab14f139 | 3,810 | py | Python | qa/L0_custom_ops/cuda_op_test.py | areche/triton-inference-server | 98469161f8e8acd513af7c0dc12dabb7f033f76b | [
"BSD-3-Clause"
] | 1 | 2021-04-27T18:42:40.000Z | 2021-04-27T18:42:40.000Z | qa/L0_custom_ops/cuda_op_test.py | dhanainme/triton-inference-server | 880db08b8a3a54caa51ae76387cdcea303807faf | [
"BSD-3-Clause"
] | null | null | null | qa/L0_custom_ops/cuda_op_test.py | dhanainme/triton-inference-server | 880db08b8a3a54caa51ae76387cdcea303807faf | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, t... | 44.823529 | 96 | 0.699738 |
2dd10e5d59129f0dfba4a338a7e218cc33ec53f5 | 12,643 | py | Python | utils.py | Prabhat-IIT/Image-segmentation-utilities | fa1b2de7c9faa3132de94750fb4ba0b54dd30415 | [
"MIT"
] | 7 | 2020-11-17T09:14:33.000Z | 2022-01-06T15:47:57.000Z | utils.py | Prabhat-IIT/Image-segmentation-utilities | fa1b2de7c9faa3132de94750fb4ba0b54dd30415 | [
"MIT"
] | 1 | 2021-10-12T22:55:11.000Z | 2021-10-12T22:55:11.000Z | utils.py | CaptainDredge/Image-segmentation-utilities | fa1b2de7c9faa3132de94750fb4ba0b54dd30415 | [
"MIT"
] | 1 | 2019-12-13T12:31:44.000Z | 2019-12-13T12:31:44.000Z | import numpy as np
import pandas as pd
import skimage.io as io
import PIL as Image
import glob
import gflags
import sys
import os
import errno
import warnings
warnings.simplefilter("ignore", UserWarning)
def rgb_to_mask(img, class_to_idx):
"""
Parameters: img -> RGB segmentation mask
c... | 38.545732 | 113 | 0.542355 |
2dd1100de7d77107fb29f43e41a326aae99dd4e5 | 2,093 | py | Python | tests/unitary/LiquidityGaugeV5/test_approve.py | hedgx/ribbonomics | 84a212a82eaaa2824ebe3c072413e143eaca02a2 | [
"MIT"
] | 2 | 2022-01-13T21:11:30.000Z | 2022-03-10T08:20:42.000Z | tests/unitary/LiquidityGaugeV5/test_approve.py | hedgx/ribbonomics | 84a212a82eaaa2824ebe3c072413e143eaca02a2 | [
"MIT"
] | null | null | null | tests/unitary/LiquidityGaugeV5/test_approve.py | hedgx/ribbonomics | 84a212a82eaaa2824ebe3c072413e143eaca02a2 | [
"MIT"
] | 2 | 2022-01-30T20:54:55.000Z | 2022-03-05T17:49:19.000Z | import pytest
@pytest.mark.parametrize("idx", range(5))
def test_initial_approval_is_zero(gauge_v5, accounts, idx):
assert gauge_v5.allowance(accounts[0], accounts[idx]) == 0
def test_approve(gauge_v5, accounts):
gauge_v5.approve(accounts[1], 10 ** 19, {"from": accounts[0]})
assert gauge_v5.allowance(a... | 31.712121 | 81 | 0.689919 |
2dd1336d054181aa717e912e878829d509d1e09c | 27,966 | py | Python | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_snapshots_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_snapshots_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_snapshots_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... | 40.945827 | 202 | 0.662626 |
2dd13e504bf7fcfc8cc776bb4abea553bf58f4b3 | 2,687 | py | Python | onadata/apps/logger/tests/test_command_syncd_deleted_instances_fix.py | ubpd/kobocat | 45906e07e8f05c30e3e26bab5570a8ab1ee264db | [
"BSD-2-Clause"
] | null | null | null | onadata/apps/logger/tests/test_command_syncd_deleted_instances_fix.py | ubpd/kobocat | 45906e07e8f05c30e3e26bab5570a8ab1ee264db | [
"BSD-2-Clause"
] | null | null | null | onadata/apps/logger/tests/test_command_syncd_deleted_instances_fix.py | ubpd/kobocat | 45906e07e8f05c30e3e26bab5570a8ab1ee264db | [
"BSD-2-Clause"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals, print_function, division, absolute_import
from datetime import datetime
from django.utils import timezone
from django.core.management import call_command
from onadata.apps.main.tests.test_base import TestBase
from onadata.apps.logger.models import Instance
cl... | 35.355263 | 82 | 0.693338 |
2dd1411da8d2c67e53cde40a353dbff833f3ae9f | 332 | py | Python | army_ant/setup.py | feup-infolab/army-ant | 7b33120d5160f73d7a41a05e6336489c917fb75c | [
"BSD-3-Clause"
] | 5 | 2018-01-18T14:11:52.000Z | 2020-10-23T16:02:25.000Z | army_ant/setup.py | feup-infolab/army-ant | 7b33120d5160f73d7a41a05e6336489c917fb75c | [
"BSD-3-Clause"
] | 10 | 2018-02-02T20:19:36.000Z | 2020-10-05T08:46:36.000Z | army_ant/setup.py | feup-infolab/army-ant | 7b33120d5160f73d7a41a05e6336489c917fb75c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# logging
# José Devezas (joseluisdevezas@gmail.com)
# 2018-05-18
import logging
def config_logger(level=logging.INFO):
logging.basicConfig(
format='%(asctime)s army-ant: [%(name)s] %(levelname)s: %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
l... | 20.75 | 77 | 0.614458 |
2dd15af4cc2bae4c0420dca727ea2d78fcf6f836 | 4,370 | py | Python | tests/angr-examples/CSCI-4968-MBE/challenges/crackme0x02/solve.py | anrddh/memsight | 9e279ade02926543a34fce452e66a161f7fede7d | [
"BSD-2-Clause"
] | 1 | 2020-06-03T23:47:16.000Z | 2020-06-03T23:47:16.000Z | tests/angr-examples/CSCI-4968-MBE/challenges/crackme0x02/solve.py | anrddh/memsight | 9e279ade02926543a34fce452e66a161f7fede7d | [
"BSD-2-Clause"
] | null | null | null | tests/angr-examples/CSCI-4968-MBE/challenges/crackme0x02/solve.py | anrddh/memsight | 9e279ade02926543a34fce452e66a161f7fede7d | [
"BSD-2-Clause"
] | 1 | 2020-03-30T13:51:55.000Z | 2020-03-30T13:51:55.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Author: David Manouchehri <manouchehri@protonmail.com>
# Modern Binary Exploitation
# http://security.cs.rpi.edu/courses/binexp-spring2015/
import angr
import sys, os, time
sys.path.append(os.path.join(os.path.dirname(__file__), '../../../../../'))
from memory import... | 46.989247 | 188 | 0.580778 |
2dd179480e7667d0c789acdf17af62beb9796427 | 2,202 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/vault_certificate.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/vault_certificate.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/vault_certificate.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 45.875 | 83 | 0.661217 |
2dd182bf2c97a03d118d977d17b7f0af7353ec38 | 5,461 | py | Python | sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/healthcareapis/azure-mgmt-healthcareapis/azure/mgmt/healthcareapis/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 40.154412 | 133 | 0.663798 |
2dd192acb68f17e8eceff0877263375344a70fab | 1,599 | py | Python | var/spack/repos/builtin/packages/r-cdcfluview/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | var/spack/repos/builtin/packages/r-cdcfluview/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2021-01-08T22:23:53.000Z | 2022-03-30T11:08:17.000Z | var/spack/repos/builtin/packages/r-cdcfluview/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RCdcfluview(RPackage):
"""The 'U.S.' Centers for Disease Control ('CDC') maintains a porta... | 47.029412 | 95 | 0.697936 |
2dd19705015b488dbacb127c0814594d1221a684 | 7,090 | py | Python | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_oauth2.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 47 | 2021-02-15T23:02:36.000Z | 2022-03-04T21:30:03.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_oauth2.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 7 | 2021-02-19T20:00:08.000Z | 2022-01-14T10:51:12.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_oauth2.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 14 | 2021-02-20T17:40:56.000Z | 2022-01-01T19:53:38.000Z | # SPDX-FileCopyrightText: Copyright (c) 2021 Brent Rubell for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_oauth2`
================================================================================
CircuitPython helper for OAuth2.0 authorization to access Google APIs.
* Author(s): Brent Rubell
I... | 37.712766 | 91 | 0.637094 |
2dd1f96757ad9c5145f8b2222fc3aa82d1d545fe | 136 | py | Python | tests/test_cli.py | gliahq/Glia | 4951569f2759ea886bad165b6d74a569c14bbd2a | [
"Apache-2.0"
] | 1 | 2020-08-20T08:22:33.000Z | 2020-08-20T08:22:33.000Z | tests/test_cli.py | gliahq/Glia | 4951569f2759ea886bad165b6d74a569c14bbd2a | [
"Apache-2.0"
] | 3 | 2021-04-20T18:20:45.000Z | 2021-06-01T23:56:13.000Z | tests/test_cli.py | gliahq/Glia | 4951569f2759ea886bad165b6d74a569c14bbd2a | [
"Apache-2.0"
] | null | null | null | from tests.common import run_command
def test_glia_command():
"""
Ensure glia command exists.
"""
run_command("glia")
| 15.111111 | 36 | 0.661765 |
2dd2302bfd6fc06af01f59b54bcc3c5edcdff9db | 3,417 | py | Python | violas_client/libra_client/wallet_library.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/libra_client/wallet_library.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/libra_client/wallet_library.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | 1 | 2022-01-05T06:49:42.000Z | 2022-01-05T06:49:42.000Z | from mnemonic import Mnemonic
from violas_client.libra_client.key_factory import KeyFactory
from violas_client.lbrtypes.rustlib import ensure
from violas_client.libra_client.account import Account
from violas_client.lbrtypes.transaction import RawTransaction
from violas_client.lbrtypes.transaction import SignedTransact... | 39.275862 | 100 | 0.666667 |
2dd233fbd3e20cc3daba85f64e93ae523651ea5b | 2,335 | py | Python | test/core/test_crypto.py | goral09/stests | 4de26485535cadf1b708188a7133a976536ccba3 | [
"Apache-2.0"
] | 4 | 2020-03-10T15:28:17.000Z | 2021-10-02T11:41:17.000Z | test/core/test_crypto.py | goral09/stests | 4de26485535cadf1b708188a7133a976536ccba3 | [
"Apache-2.0"
] | 1 | 2020-03-25T11:31:44.000Z | 2020-03-25T11:31:44.000Z | test/core/test_crypto.py | goral09/stests | 4de26485535cadf1b708188a7133a976536ccba3 | [
"Apache-2.0"
] | 9 | 2020-02-25T18:43:42.000Z | 2021-08-10T17:08:42.000Z | import inspect
import os
import pathlib
import pytest
from stests.core import crypto
FIXTURES = {
'HashAlgorithm',
'HashEncoding',
'KeyAlgorithm',
'KeyEncoding',
'get_account_key',
'get_hash',
'get_key_pair',
'get_key_pair_from_pvk_pem_file',
'get_pvk_pem_file_from_bytes',
}
d... | 31.554054 | 123 | 0.716488 |
2dd234a1b8a7558eed715aa6ba10dc610f472fb7 | 16,325 | py | Python | electrumx/server/db.py | sean1000444/electrumx | 916a02b9b16c016c5a8c2ad83124dd98a5bd3fa5 | [
"MIT"
] | 1 | 2020-08-28T02:20:43.000Z | 2020-08-28T02:20:43.000Z | electrumx/server/db.py | 1stClassMovementCustomClassic/electrumx | 382fc5ed4472f1dc9eff5791c5d5ead88090b0f7 | [
"MIT"
] | null | null | null | electrumx/server/db.py | 1stClassMovementCustomClassic/electrumx | 382fc5ed4472f1dc9eff5791c5d5ead88090b0f7 | [
"MIT"
] | 1 | 2018-07-25T18:19:26.000Z | 2018-07-25T18:19:26.000Z | # Copyright (c) 2016, Neil Booth
# Copyright (c) 2017, the ElectrumX authors
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
'''Interface to the blockchain database.'''
import array
import ast
import os
from struct import pack, unpack
fr... | 40.408416 | 79 | 0.60098 |
2dd237a944b7ffe940b8f6bffa546bf7114b6307 | 5,521 | py | Python | examples/RDT.py | linpeisensh/dynaslam2py | 17306d4c52059c54f17f258a0f7c0e7b70a6baeb | [
"BSD-2-Clause",
"MIT"
] | null | null | null | examples/RDT.py | linpeisensh/dynaslam2py | 17306d4c52059c54f17f258a0f7c0e7b70a6baeb | [
"BSD-2-Clause",
"MIT"
] | null | null | null | examples/RDT.py | linpeisensh/dynaslam2py | 17306d4c52059c54f17f258a0f7c0e7b70a6baeb | [
"BSD-2-Clause",
"MIT"
] | null | null | null | from maskrcnn_benchmark.config import cfg
from demo.predictor import COCODemo
from RDTSeg import RDTSeg
from sptam.msptam import stereoCamera
import orbslam2
import sys
import cv2 as cv
import fcntl
import numpy as np
import os
import shutil
import time
def load_images(path_to_sequence):
res = [os.path.join(pat... | 35.850649 | 117 | 0.628872 |
2dd24fd46e501a4e9a4e23ec7eeed8d43a2fa16b | 2,814 | py | Python | tests/mapper/test_pagestruct.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 39 | 2021-12-14T11:05:25.000Z | 2022-03-31T18:50:58.000Z | tests/mapper/test_pagestruct.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 17 | 2022-01-04T14:32:26.000Z | 2022-03-29T14:01:36.000Z | tests/mapper/test_pagestruct.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 4 | 2022-01-11T16:40:17.000Z | 2022-03-30T02:09:55.000Z | # -*- coding: utf-8 -*-
# File: test_pagestruct.py
# Copyright 2021 Dr. Janis Meyer. 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/licens... | 35.620253 | 109 | 0.743426 |
2dd2519abdd58fd5d140fa7fba339b418dfb367a | 11,351 | py | Python | lib/analytics_orders.py | edward0rtiz/clustering-demand-scm | 0e7dd436b66eba29eebe4f540e51c89d40d7d897 | [
"MIT"
] | null | null | null | lib/analytics_orders.py | edward0rtiz/clustering-demand-scm | 0e7dd436b66eba29eebe4f540e51c89d40d7d897 | [
"MIT"
] | null | null | null | lib/analytics_orders.py | edward0rtiz/clustering-demand-scm | 0e7dd436b66eba29eebe4f540e51c89d40d7d897 | [
"MIT"
] | null | null | null | import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
import plotly.express as px
from lib.data_engine.preprocessor import (
bots_busiest_day,
boxplot_cost,
client_count_plot,
... | 27.484262 | 87 | 0.397146 |
2dd282dbab863579b45133923d299297341eb578 | 1,232 | py | Python | services/traction/acapy_wrapper/models/v20_cred_issue.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 12 | 2022-01-29T20:30:03.000Z | 2022-03-29T11:46:14.000Z | services/traction/acapy_wrapper/models/v20_cred_issue.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 38 | 2021-11-22T17:52:50.000Z | 2022-03-31T17:52:00.000Z | services/traction/acapy_wrapper/models/v20_cred_issue.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 9 | 2021-11-22T18:05:48.000Z | 2022-03-29T11:25:08.000Z | # coding: utf-8
from __future__ import annotations
from datetime import date, datetime # noqa: F401
import re # noqa: F401
from typing import Any, Dict, List, Optional # noqa: F401
from pydantic import AnyUrl, BaseModel, EmailStr, validator # noqa: F401
from acapy_wrapper.models.attach_decorator import AttachDec... | 32.421053 | 96 | 0.736201 |
2dd291d2b2957c2d57b1424248eeb03c4f7d4bee | 534 | py | Python | pydfs_lineup_optimizer/exceptions.py | hdtact/pydfs-lineup-optimizer | 08a713f781ee5c0f2c4c7330656230a668052345 | [
"MIT"
] | 4 | 2019-01-14T23:01:02.000Z | 2021-01-09T04:37:36.000Z | pydfs_lineup_optimizer/exceptions.py | hdtact/pydfs-lineup-optimizer | 08a713f781ee5c0f2c4c7330656230a668052345 | [
"MIT"
] | null | null | null | pydfs_lineup_optimizer/exceptions.py | hdtact/pydfs-lineup-optimizer | 08a713f781ee5c0f2c4c7330656230a668052345 | [
"MIT"
] | 1 | 2021-11-10T05:46:29.000Z | 2021-11-10T05:46:29.000Z | class LineupOptimizerException(Exception):
def __init__(self, message):
# type: (str) -> None
self.message = message
def __str__(self):
return self.message
class LineupOptimizerIncorrectTeamName(LineupOptimizerException):
pass
class LineupOptimizerIncorrectPositionName(LineupOpt... | 25.428571 | 69 | 0.750936 |
2dd2a513eb8b0eb0f46e8345afbe52e658efec87 | 2,153 | py | Python | scandeval/benchmarks/dalaj.py | NbAiLab/ScandEval | 59eb1902a1880d7483d48a4ee213bbec0e2eb71a | [
"MIT"
] | 10 | 2021-07-21T10:47:42.000Z | 2022-03-03T13:45:25.000Z | scandeval/benchmarks/dalaj.py | NbAiLab/ScandEval | 59eb1902a1880d7483d48a4ee213bbec0e2eb71a | [
"MIT"
] | 28 | 2021-07-29T12:21:15.000Z | 2022-03-09T12:46:49.000Z | scandeval/benchmarks/dalaj.py | NbAiLab/ScandEval | 59eb1902a1880d7483d48a4ee213bbec0e2eb71a | [
"MIT"
] | 4 | 2022-01-17T12:11:58.000Z | 2022-03-14T18:42:01.000Z | '''Correct spelling classification of a language model on the DaLaJ dataset'''
import logging
from .abstract import TextClassificationBenchmark
logger = logging.getLogger(__name__)
class DalajBenchmark(TextClassificationBenchmark):
'''Benchmark of language models on the DaLaJ dataset.
Args:
cach... | 39.87037 | 79 | 0.619136 |
2dd2b69637dc98dfdfeb1701912fb58edda72198 | 226 | py | Python | pytest_wiremock/client/_endpoints_near_misses.py | symonk/pytest-wiremock | 372956418174adafadcb33ad38db121a049f7f2b | [
"MIT"
] | null | null | null | pytest_wiremock/client/_endpoints_near_misses.py | symonk/pytest-wiremock | 372956418174adafadcb33ad38db121a049f7f2b | [
"MIT"
] | 7 | 2022-03-14T08:41:55.000Z | 2022-03-28T18:01:22.000Z | pytest_wiremock/client/_endpoints_near_misses.py | symonk/pytest-wiremock | 372956418174adafadcb33ad38db121a049f7f2b | [
"MIT"
] | null | null | null | from pytest_wiremock.client._protocols import Requestable
class NearMissesEndpoint:
"""
Facade into near misses.
"""
def __init__(self, dispatcher: Requestable) -> None:
self.dispatcher = dispatcher
| 20.545455 | 57 | 0.70354 |
2dd2cd9e717b7adf015ad2b694829db03bb5484c | 7,544 | py | Python | clients/kratos/python/ory_kratos_client/model/submit_self_service_settings_flow_with_password_method_body.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/model/submit_self_service_settings_flow_with_password_method_body.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/model/submit_self_service_settings_flow_with_password_method_body.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | """
Ory Kratos API
Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the admini... | 41.224044 | 446 | 0.595042 |
2dd2d879ec066145ee466b801a05eb54732fdf54 | 309 | py | Python | moto/compat.py | argos83/moto | d3df810065c9c453d40fcc971f9be6b7b2846061 | [
"Apache-2.0"
] | 1 | 2021-11-06T17:09:20.000Z | 2021-11-06T17:09:20.000Z | moto/compat.py | marciogh/moto | d3df810065c9c453d40fcc971f9be6b7b2846061 | [
"Apache-2.0"
] | null | null | null | moto/compat.py | marciogh/moto | d3df810065c9c453d40fcc971f9be6b7b2846061 | [
"Apache-2.0"
] | 1 | 2017-10-19T00:53:28.000Z | 2017-10-19T00:53:28.000Z | try:
from collections import OrderedDict # flake8: noqa
except ImportError:
# python 2.6 or earlier, use backport
from ordereddict import OrderedDict # flake8: noqa
try:
from urlparse import urlparse # flake8: noqa
except ImportError:
from urllib.parse import urlparse # flake8: noqa
| 28.090909 | 55 | 0.734628 |
2dd30fb504e69c895efbd698e5d873dc2eea86b0 | 569 | py | Python | fuyuzi/pygame_flip.py | godontop/python-work | ea22e0df8b0b17605f5a434e556a388d1f75aa47 | [
"MIT"
] | null | null | null | fuyuzi/pygame_flip.py | godontop/python-work | ea22e0df8b0b17605f5a434e556a388d1f75aa47 | [
"MIT"
] | null | null | null | fuyuzi/pygame_flip.py | godontop/python-work | ea22e0df8b0b17605f5a434e556a388d1f75aa47 | [
"MIT"
] | null | null | null | # coding=utf-8
import sys
import pygame
pygame.init()
screen = pygame.display.set_mode([640, 480])
screen.fill([255, 255, 255])
my_ball = pygame.image.load("beach_ball.png")
x = 50
y = 50
x_speed = 10
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
... | 18.966667 | 64 | 0.616872 |
2dd33112af6e5e83d352512e554247ee4e2b3cb7 | 4,250 | py | Python | BlockServer/config/ioc.py | GustavLero/EPICS-inst_servers | 4bcdd6a80f1d9e074de3f0f7c66968d506981988 | [
"BSD-3-Clause"
] | null | null | null | BlockServer/config/ioc.py | GustavLero/EPICS-inst_servers | 4bcdd6a80f1d9e074de3f0f7c66968d506981988 | [
"BSD-3-Clause"
] | null | null | null | BlockServer/config/ioc.py | GustavLero/EPICS-inst_servers | 4bcdd6a80f1d9e074de3f0f7c66968d506981988 | [
"BSD-3-Clause"
] | null | null | null | # This file is part of the ISIS IBEX application.
# Copyright (C) 2012-2016 Science & Technology Facilities Council.
# All rights reserved.
#
# This program is distributed in the hope that it will be useful.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License... | 35.416667 | 117 | 0.613882 |
2dd37b7bf86826638029099e7af8f8b2c8158234 | 2,136 | py | Python | heat/tests/functional/test_WordPress_Single_Instance.py | CiscoSystems/heat | 1b609f3c0621c44e4988a166a38f36c2b57eb4c6 | [
"Apache-2.0"
] | 1 | 2020-08-15T14:29:15.000Z | 2020-08-15T14:29:15.000Z | heat/tests/functional/test_WordPress_Single_Instance.py | CiscoSystems/heat | 1b609f3c0621c44e4988a166a38f36c2b57eb4c6 | [
"Apache-2.0"
] | null | null | null | heat/tests/functional/test_WordPress_Single_Instance.py | CiscoSystems/heat | 1b609f3c0621c44e4988a166a38f36c2b57eb4c6 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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... | 37.473684 | 78 | 0.671348 |
2dd383cb08f6c44eb527df42c49e74e41c0f7e34 | 736 | py | Python | tests/unit_tests/WorkloadChecker_test.py | hadisinaee/faas-profiler | 3ef350cc3072586815534f8332d0433af62b0e4c | [
"MIT"
] | 70 | 2019-10-07T17:07:08.000Z | 2022-03-10T18:23:10.000Z | tests/unit_tests/WorkloadChecker_test.py | hadisinaee/faas-profiler | 3ef350cc3072586815534f8332d0433af62b0e4c | [
"MIT"
] | 8 | 2019-11-20T04:40:53.000Z | 2022-03-15T07:15:39.000Z | tests/unit_tests/WorkloadChecker_test.py | hadisinaee/faas-profiler | 3ef350cc3072586815534f8332d0433af62b0e4c | [
"MIT"
] | 28 | 2019-10-22T18:16:34.000Z | 2022-02-09T00:10:12.000Z | # Copyright (c) 2021 Princeton University
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import sys
import unittest
sys.path.insert(1, '../..')
from commons.JSONConfigHelper import ReadJSONConfig
from synthetic_workload_invoker.WorkloadChec... | 29.44 | 78 | 0.759511 |
2dd396c2c5b1fef85eefee4e13514b288098d85c | 2,447 | py | Python | chaospy/distributions/operators/logarithm.py | lblonk/chaospy | 1759a4307c6134b74ce63ff44973195f1e185f94 | [
"MIT"
] | 1 | 2020-04-29T20:53:25.000Z | 2020-04-29T20:53:25.000Z | chaospy/distributions/operators/logarithm.py | agonzs11/Polinomio-del-caos | 5a415ece07e6535488174bac69a6c0fcc2ca272d | [
"MIT"
] | null | null | null | chaospy/distributions/operators/logarithm.py | agonzs11/Polinomio-del-caos | 5a415ece07e6535488174bac69a6c0fcc2ca272d | [
"MIT"
] | null | null | null | """Logarithm of another distribution."""
import numpy
from ..baseclass import Dist
from .unary import UnaryOperator
class Logn(UnaryOperator):
"""
Logarithm with base N.
Args:
dist (Dist):
Distribution to perform transformation on.
base (int, float):
the logarithm... | 26.311828 | 73 | 0.579894 |
2dd3978937335be52a7c69dd83f46419babd250d | 2,381 | py | Python | receiver/utils/schc_utils.py | schc-over-sigfox/schc-over-sigfox | d03e26cf5524ebd6bd64b4ca33a83149eec5e59f | [
"MIT"
] | null | null | null | receiver/utils/schc_utils.py | schc-over-sigfox/schc-over-sigfox | d03e26cf5524ebd6bd64b4ca33a83149eec5e59f | [
"MIT"
] | null | null | null | receiver/utils/schc_utils.py | schc-over-sigfox/schc-over-sigfox | d03e26cf5524ebd6bd64b4ca33a83149eec5e59f | [
"MIT"
] | 1 | 2022-03-19T12:36:30.000Z | 2022-03-19T12:36:30.000Z | import json
import logging as log
import os
import requests
def init_logging(logfile):
log.basicConfig(filename=logfile,
format='%(asctime)s - %(levelname)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
level=log.DEBUG)
def log_debug(text):
print(t... | 21.258929 | 84 | 0.558589 |
2dd3a8625341734989d50fbf0c65b4a4915b9db8 | 2,729 | py | Python | detectia/train.py | kartik4949/detectia | e62165372b2abac63239d540dfa8c3ee0eafd75c | [
"Apache-2.0"
] | 3 | 2021-02-02T10:59:26.000Z | 2021-11-20T07:56:29.000Z | detectia/train.py | kartik4949/detectia | e62165372b2abac63239d540dfa8c3ee0eafd75c | [
"Apache-2.0"
] | null | null | null | detectia/train.py | kartik4949/detectia | e62165372b2abac63239d540dfa8c3ee0eafd75c | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Kartik Sharma. 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 o... | 34.987179 | 88 | 0.676072 |
2dd3ccec4cb926be2378d84683644234c5a78a46 | 5,953 | py | Python | gemma/_surveyor.py | illuscio-dev/gemma-py | c12b2aae8438b69236cf8b1c76ac6dd1912f6207 | [
"MIT"
] | 1 | 2020-11-05T04:42:39.000Z | 2020-11-05T04:42:39.000Z | gemma/_surveyor.py | illuscio-dev/gemma-py | c12b2aae8438b69236cf8b1c76ac6dd1912f6207 | [
"MIT"
] | null | null | null | gemma/_surveyor.py | illuscio-dev/gemma-py | c12b2aae8438b69236cf8b1c76ac6dd1912f6207 | [
"MIT"
] | null | null | null | from typing import List, Any
from ._compass import Compass, Optional, Generator, Type, Tuple, Union
from ._course import Course
from ._exceptions import NonNavigableError, SuppressedErrors
DEFAULT_COMPASSES: List[Compass] = [Compass()]
DEFAULT_END_POINTS: Tuple[Type, ...] = (str, int, float, type)
class Surveyor:
... | 37.440252 | 86 | 0.622543 |
2dd3cd31fed4537a30510222bf73cf19535656b0 | 1,121 | py | Python | Examples/Infovis/Python/boost_centrality.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 1 | 2020-05-04T05:59:07.000Z | 2020-05-04T05:59:07.000Z | Examples/Infovis/Python/boost_centrality.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | null | null | null | Examples/Infovis/Python/boost_centrality.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 5 | 2015-10-09T04:12:29.000Z | 2021-12-15T16:57:11.000Z | from vtk import *
source = vtkRandomGraphSource()
source.DirectedOff()
source.SetNumberOfVertices(50)
source.SetEdgeProbability(0.01)
source.SetUseEdgeProbability(True)
source.AllowParallelEdgesOn()
source.AllowSelfLoopsOn()
source.SetStartWithTree(True)
# Connect to the Boost centrality filter.
centrality = vtkBoos... | 25.477273 | 69 | 0.831401 |
2dd4023c379acf21934215390bf6a1b5bffcfd3d | 1,237 | py | Python | conftest.py | Nicztin/spyder | 1c7b2232d2abbf1e101a1e2ab0552b32e8472bd6 | [
"MIT"
] | 1 | 2019-09-25T15:08:24.000Z | 2019-09-25T15:08:24.000Z | conftest.py | jorgeps86/spyder | 1c7b2232d2abbf1e101a1e2ab0552b32e8472bd6 | [
"MIT"
] | null | null | null | conftest.py | jorgeps86/spyder | 1c7b2232d2abbf1e101a1e2ab0552b32e8472bd6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
#
"""
Configuration file for Pytest
NOTE: DO NOT add fixtures here. It could generate problems with
QtAwesome being called before a QApplication is created.
"""
import os
import os.path as osp
impo... | 26.319149 | 72 | 0.698464 |
2dd40f41b75d4118ff120f382fba0cd8398336b5 | 3,140 | py | Python | Tools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 6 | 2021-07-05T16:09:39.000Z | 2022-03-06T22:44:42.000Z | Tools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | Tools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | null | null | null | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | 48.307692 | 92 | 0.727707 |
2dd41264561cd639f6bca9e5e79233e27656777a | 108 | py | Python | run.py | giantoak/OpenAds-Flask | ab51b3e44056accbc43bed4c568dcf41c9678a29 | [
"MIT"
] | null | null | null | run.py | giantoak/OpenAds-Flask | ab51b3e44056accbc43bed4c568dcf41c9678a29 | [
"MIT"
] | null | null | null | run.py | giantoak/OpenAds-Flask | ab51b3e44056accbc43bed4c568dcf41c9678a29 | [
"MIT"
] | null | null | null | from app import app
if __name__ == '__main__':
app.debug = True
app.run(host='0.0.0.0', port=8000)
| 18 | 38 | 0.62963 |
2dd442e3d405dc86e2fd7a770b9d7de9574341c2 | 5,774 | py | Python | finetune/saver.py | sungjunlee/finetune | 24d21e85f13efa69d7f57c91d0be79d21121caa1 | [
"MIT"
] | 1 | 2022-03-10T04:35:38.000Z | 2022-03-10T04:35:38.000Z | finetune/saver.py | sungjunlee/finetune | 24d21e85f13efa69d7f57c91d0be79d21121caa1 | [
"MIT"
] | null | null | null | finetune/saver.py | sungjunlee/finetune | 24d21e85f13efa69d7f57c91d0be79d21121caa1 | [
"MIT"
] | null | null | null | import re
import os
import warnings
import json
import joblib
import itertools
import numpy as np
from finetune.utils import find_trainable_variables
import tensorflow as tf
SHAPES_PATH = os.path.join(os.path.dirname(__file__), 'model', 'params_shapes.json')
PARAM_PATH = os.path.join(os.path.dirname(__file__), 'mod... | 43.089552 | 146 | 0.631971 |
2dd454adf15206879469658d5e18f5a062c96e25 | 2,826 | py | Python | py360/account.py | ValentiMS/py360 | c291b37773fbf5e4b459429fa95662533774183c | [
"BSD-2-Clause"
] | null | null | null | py360/account.py | ValentiMS/py360 | c291b37773fbf5e4b459429fa95662533774183c | [
"BSD-2-Clause"
] | null | null | null | py360/account.py | ValentiMS/py360 | c291b37773fbf5e4b459429fa95662533774183c | [
"BSD-2-Clause"
] | null | null | null | """
Module for processing encrypted Account blocks
From various xbox 360 forums and code examples (including DJ Shepherd's Le Fluffie)
Most of the offsets had to be adjusted which makes me wonder if there's a small problem in the decryption
Decrypted Data
0x00: Account flags? (5th bit is Live/Local Account (p... | 37.68 | 109 | 0.598726 |
2dd47645465e65e12bbc3c75380e7e0054e72852 | 3,047 | py | Python | matrix_extrapolation/bch_series_expansion/operator_test.py | ochsnerd/Hamiltonian_Extrapolation | a91e651a9515a22d6e279d567340182658bcd2f6 | [
"Apache-2.0"
] | null | null | null | matrix_extrapolation/bch_series_expansion/operator_test.py | ochsnerd/Hamiltonian_Extrapolation | a91e651a9515a22d6e279d567340182658bcd2f6 | [
"Apache-2.0"
] | null | null | null | matrix_extrapolation/bch_series_expansion/operator_test.py | ochsnerd/Hamiltonian_Extrapolation | a91e651a9515a22d6e279d567340182658bcd2f6 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from qiskit.quantum_info import Pauli
from .operator import PauliOperator
def test_PauliOperator():
XP = Pauli("X")
YP = Pauli("Y")
ZP = Pauli("Z")
XM = XP.to_matrix()
YM = YP.to_matrix()
ZM = ZP.to_matrix()
zeroM = XM - XM
# constructor
assert PauliOperator(... | 40.092105 | 227 | 0.57893 |
2dd47bfc50f1b08485186e7d816e86e416c741b7 | 509 | py | Python | examples/processing/compare_1d.py | genematx/nmrglue | 8a24cf6cbd18451e552fc0673b84c42d1dcb69a2 | [
"BSD-3-Clause"
] | 150 | 2015-01-16T12:24:13.000Z | 2022-03-03T18:01:18.000Z | examples/processing/compare_1d.py | genematx/nmrglue | 8a24cf6cbd18451e552fc0673b84c42d1dcb69a2 | [
"BSD-3-Clause"
] | 129 | 2015-01-13T04:58:56.000Z | 2022-03-02T13:39:16.000Z | examples/processing/compare_1d.py | genematx/nmrglue | 8a24cf6cbd18451e552fc0673b84c42d1dcb69a2 | [
"BSD-3-Clause"
] | 88 | 2015-02-16T20:04:12.000Z | 2022-03-10T06:50:30.000Z | #! /usr/bin/env python
import nmrglue as ng
# check against a file processed with NMRPipe
dic1, data1 = ng.pipe.read("nmrpipe_1d/test.ft")
dic2, data2 = ng.pipe.read("1d_pipe.ft")
r1, r2 = ng.misc.pair_similar(dic1, data1, dic2, data2, verb=True)
print "==================="
print "Summary:"
if r1:
print "Data a... | 23.136364 | 66 | 0.681729 |
2dd4af2257f2ea64e6a06b2fd2488ac570a72f44 | 1,850 | py | Python | bot/__init__.py | Savant-Dev/bot | cfc5720925b6bbc40c45507f8579145a0014a6eb | [
"MIT"
] | null | null | null | bot/__init__.py | Savant-Dev/bot | cfc5720925b6bbc40c45507f8579145a0014a6eb | [
"MIT"
] | null | null | null | bot/__init__.py | Savant-Dev/bot | cfc5720925b6bbc40c45507f8579145a0014a6eb | [
"MIT"
] | null | null | null | import logging
import os
import sys
from logging import Logger, handlers
from pathlib import Path
import coloredlogs
TRACE_LEVEL = logging.TRACE = 5
logging.addLevelName(TRACE_LEVEL, "TRACE")
def monkeypatch_trace(self: logging.Logger, msg: str, *args, **kwargs) -> None:
"""
Log 'msg % args' with severity '... | 29.83871 | 103 | 0.742703 |
2dd4af73a18d328f02dc9f32e4923af02b0123f5 | 29,045 | py | Python | rest-service/manager_rest/test/test_executions.py | acidburn0zzz/cloudify-manager | ee2224c52347f7461a95976179ab61aee74a49dd | [
"Apache-2.0"
] | 1 | 2015-11-03T14:27:11.000Z | 2015-11-03T14:27:11.000Z | rest-service/manager_rest/test/test_executions.py | acidburn0zzz/cloudify-manager | ee2224c52347f7461a95976179ab61aee74a49dd | [
"Apache-2.0"
] | 2 | 2021-03-20T05:33:19.000Z | 2021-03-26T00:38:21.000Z | rest-service/manager_rest/test/test_executions.py | acidburn0zzz/cloudify-manager | ee2224c52347f7461a95976179ab61aee74a49dd | [
"Apache-2.0"
] | null | null | null | #########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. 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... | 46.546474 | 79 | 0.653744 |
2dd4b230bccc94360fcb41cda78edcc603b086d2 | 992 | py | Python | qface/idl/profile.py | Gagi2k/qface | 5069fdc5f406495590a83a799ecbe30009436f1d | [
"MIT"
] | 38 | 2016-11-30T10:36:56.000Z | 2022-02-19T14:58:00.000Z | qface/idl/profile.py | Gagi2k/qface | 5069fdc5f406495590a83a799ecbe30009436f1d | [
"MIT"
] | 70 | 2016-11-30T09:12:58.000Z | 2022-01-27T12:52:41.000Z | qface/idl/profile.py | Gagi2k/qface | 5069fdc5f406495590a83a799ecbe30009436f1d | [
"MIT"
] | 23 | 2016-12-07T15:23:15.000Z | 2021-06-07T08:32:40.000Z | # Copyright (c) Pelagicore AB 2016
"""
A profile is a set of features describing a qface language profile.
The language profile tells the parser which language aspects are
supported for the particular choosen profile.
from profile import get_features, EProfile, EFeature
features = get_features(EProfile.ADVANCED)
if ... | 21.106383 | 67 | 0.703629 |
2dd4bf3a86c91df42ce6f953507eebb24ec5c807 | 1,069 | py | Python | smore/common/torchext/ext_ops.py | isabella232/smore | 02e5a89e84a805eed632eefbdecd957d95e202d4 | [
"Apache-2.0"
] | 78 | 2021-10-31T23:20:26.000Z | 2022-03-21T01:07:01.000Z | smore/common/torchext/ext_ops.py | google-research/smore | e4ba95a7466ef7d018987bce7688b77bf2ea7e4f | [
"Apache-2.0"
] | 4 | 2021-11-02T13:45:38.000Z | 2022-02-17T04:18:32.000Z | smore/common/torchext/ext_ops.py | pyg-team/smore | 02e5a89e84a805eed632eefbdecd957d95e202d4 | [
"Apache-2.0"
] | 15 | 2021-11-02T23:55:29.000Z | 2022-03-19T10:30:51.000Z | # Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 46.478261 | 78 | 0.812909 |
2dd4c2753e7c62d91838b7e962820e14dcdab9eb | 3,521 | py | Python | core/clients/tests/tests_handler.py | GEO-Protocol/gns_provider_centrifuge | ca8f88ef1fb121e68b2f7c7581e1b12e4a83cb78 | [
"MIT"
] | 5 | 2018-10-18T13:20:00.000Z | 2018-10-19T10:55:10.000Z | core/clients/tests/tests_handler.py | GEO-Protocol/gns-provider-centrifuge | ca8f88ef1fb121e68b2f7c7581e1b12e4a83cb78 | [
"MIT"
] | 2 | 2018-09-21T12:55:32.000Z | 2018-09-21T13:07:06.000Z | core/clients/tests/tests_handler.py | GEO-Protocol/gns-provider-centrifuge | ca8f88ef1fb121e68b2f7c7581e1b12e4a83cb78 | [
"MIT"
] | null | null | null | import unittest
from core.clients.clients import Client
from core.clients.handler import ClientsHandler
from core.settings import Settings
class TestsHandler(unittest.TestCase):
correctSecret = b'00000000000000000000000000000000'
def setUp(self):
self.settings = Settings.load_config('../../../conf.j... | 35.928571 | 118 | 0.663448 |
2dd4eb30df4efe4df5c5afb1eda24649316566eb | 1,498 | py | Python | server/server/termsofuse/migrations/0002_auto_20210909_1718.py | connectiveproject/connective | 8866082b2147feef0e5254ac4215987b9d881396 | [
"MIT"
] | 4 | 2021-07-05T10:49:26.000Z | 2021-11-24T11:34:43.000Z | server/server/termsofuse/migrations/0002_auto_20210909_1718.py | connectiveproject/connective | 8866082b2147feef0e5254ac4215987b9d881396 | [
"MIT"
] | 39 | 2021-06-21T15:02:37.000Z | 2022-02-28T15:07:42.000Z | server/server/termsofuse/migrations/0002_auto_20210909_1718.py | connectiveproject/connective | 8866082b2147feef0e5254ac4215987b9d881396 | [
"MIT"
] | 17 | 2021-06-16T08:59:45.000Z | 2021-09-29T11:35:38.000Z | # Generated by Django 3.1.11 on 2021-09-09 14:18
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('termsofuse', '0001_init... | 33.288889 | 156 | 0.618158 |
2dd4fa9435e789c965b80665cece4d1416373a8b | 11,156 | py | Python | admin/nodes/views.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 1 | 2015-10-02T18:35:53.000Z | 2015-10-02T18:35:53.000Z | admin/nodes/views.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 4 | 2016-05-13T14:24:16.000Z | 2017-03-30T15:28:31.000Z | admin/nodes/views.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from django.utils import timezone
from django.core.exceptions import PermissionDenied
from django.views.generic import ListView, DeleteView
from django.shortcuts import redirect
from django.views.defaults import page_not_found
from django.contrib.auth.mixins import PermissionReq... | 34.753894 | 98 | 0.60882 |
2dd501fbb91c37c5ce2a4428f0c569bdbfd0221e | 761 | py | Python | t/ehos/ehos_test.py | elixir-no-nels/ehos-python | bb0f7a539b0962afdcb237fb79d2f046542d8988 | [
"MIT"
] | 2 | 2019-01-17T12:10:03.000Z | 2019-05-10T10:08:26.000Z | t/ehos/ehos_test.py | elixir-no-nels/ehos-python | bb0f7a539b0962afdcb237fb79d2f046542d8988 | [
"MIT"
] | 30 | 2018-09-27T09:38:25.000Z | 2019-06-03T10:48:21.000Z | t/ehos/ehos_test.py | elixir-no-nels/ehos-python | bb0f7a539b0962afdcb237fb79d2f046542d8988 | [
"MIT"
] | 1 | 2021-02-08T08:17:12.000Z | 2021-02-08T08:17:12.000Z |
import sys
import re
import os
import tempfile
import pprint
import ehos.utils
pp = pprint.PrettyPrinter(indent=4)
import pytest
import ehos as E
db_name = 'ehos_testing'
url = "postgresql://ehos:ehos@127.0.0.1:5432/{db_name}".format( db_name=db_name )
def test_init():
E.init( condor_init=False)
E... | 16.911111 | 81 | 0.717477 |
2dd51c3945ebf2feb303c5ac39c7b355500a388d | 247 | py | Python | torchutils/param/__init__.py | lzcn/torchutils | 8dc78ddcde72f27758e9774f3d1f5f6172e1a5e9 | [
"MIT"
] | 2 | 2021-01-15T03:13:46.000Z | 2021-04-20T16:20:52.000Z | torchutils/param/__init__.py | lzcn/torchutils | 8dc78ddcde72f27758e9774f3d1f5f6172e1a5e9 | [
"MIT"
] | null | null | null | torchutils/param/__init__.py | lzcn/torchutils | 8dc78ddcde72f27758e9774f3d1f5f6172e1a5e9 | [
"MIT"
] | null | null | null | from .data_param import DataReaderParam
from .optim_param import OptimParam
from .param import Param, to_param
from .run_config import RunConfig
__all__ = [
"DataReaderParam",
"OptimParam",
"Param",
"RunConfig",
"to_param",
]
| 19 | 39 | 0.716599 |
2dd5282f51850b3bff2cee5a8605be7c11601c23 | 2,442 | py | Python | tensorflow_federated/python/core/impl/value_utils_test.py | xueyuuu/federated | ad617401324c133eb838e4e0af7442a4dfa71d6e | [
"Apache-2.0"
] | 2 | 2019-07-09T10:04:39.000Z | 2019-10-02T05:10:16.000Z | tensorflow_federated/python/core/impl/value_utils_test.py | xueyuuu/federated | ad617401324c133eb838e4e0af7442a4dfa71d6e | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/value_utils_test.py | xueyuuu/federated | ad617401324c133eb838e4e0af7442a4dfa71d6e | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2018, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 40.032787 | 80 | 0.788698 |
2dd53c454d4c628d6343b255e9719eb328aaa4ea | 6,017 | py | Python | pytorch_backend.py | codedecde/EmbedMap | bd128c190f3e75146d2e85df05904aaa72117bb0 | [
"MIT"
] | null | null | null | pytorch_backend.py | codedecde/EmbedMap | bd128c190f3e75146d2e85df05904aaa72117bb0 | [
"MIT"
] | null | null | null | pytorch_backend.py | codedecde/EmbedMap | bd128c190f3e75146d2e85df05904aaa72117bb0 | [
"MIT"
] | null | null | null | """
A module to combine pytorch functionality to
the pymanopt class, so that I can use pytorch
end to end
"""
import torch
import torch.nn as nn
import numpy as np
from torch.autograd import Variable
from utils import to_numpy
from pymanopt.manifolds import Product, Stiefel, PositiveDefinite
class OrthoManifold(objec... | 31.502618 | 80 | 0.588665 |
2dd54042651ad215d90e101d12973c1821a8e8d1 | 1,717 | py | Python | backend/app_api/models/task_model.py | defnngj/quick | 98031a0fddf325820ec135a62253468f46aa2ba6 | [
"Apache-2.0"
] | 1 | 2021-12-21T16:25:29.000Z | 2021-12-21T16:25:29.000Z | backend/app_api/models/task_model.py | defnngj/quick | 98031a0fddf325820ec135a62253468f46aa2ba6 | [
"Apache-2.0"
] | null | null | null | backend/app_api/models/task_model.py | defnngj/quick | 98031a0fddf325820ec135a62253468f46aa2ba6 | [
"Apache-2.0"
] | 1 | 2022-03-26T14:01:28.000Z | 2022-03-26T14:01:28.000Z | from django.db import models
from app_api.models.project_model import Project
from app_api.models.case_model import TestCase
class TestTask(models.Model):
"""
测试任务表
"""
project = models.ForeignKey(Project, on_delete=models.CASCADE)
name = models.CharField("名称", max_length=100, blank=False, default... | 33.019231 | 74 | 0.685498 |
2dd5604aed71346de11b28f5092b2c3a6322b3fa | 270 | py | Python | tacotron2/callbacks/_callback.py | DashaSerdyuk/tacotron2 | 1a88669670750f8b0e1aff76abc8b1b15300e1dc | [
"BSD-3-Clause"
] | 1 | 2020-03-03T23:04:05.000Z | 2020-03-03T23:04:05.000Z | tacotron2/callbacks/_callback.py | DashaSerdyuk/tacotron2 | 1a88669670750f8b0e1aff76abc8b1b15300e1dc | [
"BSD-3-Clause"
] | null | null | null | tacotron2/callbacks/_callback.py | DashaSerdyuk/tacotron2 | 1a88669670750f8b0e1aff76abc8b1b15300e1dc | [
"BSD-3-Clause"
] | 1 | 2020-03-26T19:37:46.000Z | 2020-03-26T19:37:46.000Z | class Callback:
def on_opt_step(self, learner):
pass
def on_train_end(self, learner):
pass
def on_epoch_end(self, learner):
pass
def on_train_start(self, learner):
pass
def on_eval_end(self, learner):
pass
| 16.875 | 38 | 0.603704 |
2dd587d90b23868469d13b45063abbcf773c58ca | 4,674 | py | Python | nicos_mlz/antares/setups/selector.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_mlz/antares/setups/selector.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_mlz/antares/setups/selector.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | description = 'setup for the velocity selector'
tango_base = 'tango://antareshw.antares.frm2:10000/antares/'
devices = dict(
# virtual for testing
# selector = device('nicos.devices.generic.VirtualMotor',
# unit = 'rpm',
# abslimits = (3100, 21000),
# speed = 1000,
# fmtstr = '... | 34.367647 | 87 | 0.57638 |
2dd58e08cab40dac902bc1a6eefac2baecd1a9e5 | 523 | py | Python | src/server/MhmServer/models/scientist.py | jbrr/mosquito_heat_map | 2cce46a5e26526bd04a83486a62733ab343376ba | [
"MIT"
] | null | null | null | src/server/MhmServer/models/scientist.py | jbrr/mosquito_heat_map | 2cce46a5e26526bd04a83486a62733ab343376ba | [
"MIT"
] | 2 | 2020-07-07T20:31:40.000Z | 2022-02-10T19:17:35.000Z | src/server/MhmServer/models/scientist.py | jbrr/mosquito_heat_map | 2cce46a5e26526bd04a83486a62733ab343376ba | [
"MIT"
] | null | null | null | from MhmServer.database import (Column, DateTime, func, Integer, Model, relationship, String)
import datetime
class Scientist(Model):
__tablename__ = 'scientist'
id = Column(Integer, primary_key=True)
name = Column(String())
created_at = Column(DateTime(), default=func.now())
updated_at = Column(... | 34.866667 | 93 | 0.707457 |
2dd59e315ff122d32f15d61f997fdc00dd3b8eb8 | 6,245 | py | Python | diff_toplists.py | yzemaze/bggguildreport2 | c78774c3ef1ee6eb7f7a4a5ab2aef347056caf04 | [
"MIT"
] | null | null | null | diff_toplists.py | yzemaze/bggguildreport2 | c78774c3ef1ee6eb7f7a4a5ab2aef347056caf04 | [
"MIT"
] | null | null | null | diff_toplists.py | yzemaze/bggguildreport2 | c78774c3ef1ee6eb7f7a4a5ab2aef347056caf04 | [
"MIT"
] | null | null | null | import argparse
import datetime
import gettext
import json
def print_list(old_file, new_file, style):
with open(old_file, "r") as oldf:
old_lists = json.load(oldf)
oldf.close()
with open(new_file, "r") as newf:
new_lists = json.load(newf)
newf.close()
... | 38.079268 | 73 | 0.403203 |
2dd5a0476347c8d52e50dc782fb9f82e8b8ae739 | 882 | py | Python | h5axeconfig/grism/sensitivity.py | Russell-Ryan/aXeConfig | ff52e1981b825a075372c682cb6034cfeec58213 | [
"MIT"
] | null | null | null | h5axeconfig/grism/sensitivity.py | Russell-Ryan/aXeConfig | ff52e1981b825a075372c682cb6034cfeec58213 | [
"MIT"
] | null | null | null | h5axeconfig/grism/sensitivity.py | Russell-Ryan/aXeConfig | ff52e1981b825a075372c682cb6034cfeec58213 | [
"MIT"
] | 1 | 2019-09-25T14:51:04.000Z | 2019-09-25T14:51:04.000Z | import numpy as np
#from astropy.io import fits
import os
from .base import Base
class Sensitivity(Base):
def __init__(self,h5):
Base.__init__(self,h5)
hf=h5['sensitivity']
self.wavelength=hf['wavelength']
self.sensitivity=hf['sensitivity']
self.error=hf['error']
... | 22.05 | 77 | 0.599773 |
2dd5a181aea2d8d592fc062323d74b601b3fa1a5 | 1,957 | py | Python | app/handlers/locale_handlers.py | RobertoPrevato/Flask-three-template | 00b7dd6dd299a1fd91f08f60007fe09235216096 | [
"MIT"
] | 7 | 2015-11-19T20:45:16.000Z | 2020-04-22T22:18:34.000Z | app/handlers/locale_handlers.py | RobertoPrevato/Flask-three-template | 00b7dd6dd299a1fd91f08f60007fe09235216096 | [
"MIT"
] | null | null | null | app/handlers/locale_handlers.py | RobertoPrevato/Flask-three-template | 00b7dd6dd299a1fd91f08f60007fe09235216096 | [
"MIT"
] | 2 | 2016-10-08T20:09:06.000Z | 2020-04-22T22:18:36.000Z | """
* Copyright 2015, Roberto Prevato roberto.prevato@gmail.com
* https://github.com/RobertoPrevato/Flask-three-template
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*
* Localization strategy.
*
"""
from flask import url_for, request
from flask.ext.babel import Babel
def locale_handlers... | 31.063492 | 117 | 0.668881 |
2dd5afa057113d95b20fbc3c3a5ba9a108a5a603 | 8,094 | py | Python | models.py | project-coswara/cloud-functions | 9a46f6941a40db47c692380474729b346f1261a2 | [
"MIT"
] | null | null | null | models.py | project-coswara/cloud-functions | 9a46f6941a40db47c692380474729b346f1261a2 | [
"MIT"
] | null | null | null | models.py | project-coswara/cloud-functions | 9a46f6941a40db47c692380474729b346f1261a2 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.nn.utils.rnn import pad_sequence, pad_packed_sequence, pack_padded_sequence
# %%
def getNet(arch):
''' getNet()
Function used to fetch an architecture
TODO: Update the dictionary for new architectures
Raises an error if the architecture is not found.
'... | 37.299539 | 119 | 0.619224 |
2dd5eef293b33ff9a73e145e4819566d92551cae | 6,117 | py | Python | doc/source/conf.py | theblackunknown-experiments/qarnot-sdk-python | d051b842cc531dda8b3da63a0fdfe131d24b05a8 | [
"Apache-2.0"
] | 11 | 2016-09-08T06:00:37.000Z | 2021-11-11T21:03:16.000Z | doc/source/conf.py | theblackunknown-experiments/qarnot-sdk-python | d051b842cc531dda8b3da63a0fdfe131d24b05a8 | [
"Apache-2.0"
] | 3 | 2020-01-20T23:00:32.000Z | 2021-04-26T08:09:05.000Z | doc/source/conf.py | theblackunknown-experiments/qarnot-sdk-python | d051b842cc531dda8b3da63a0fdfe131d24b05a8 | [
"Apache-2.0"
] | 5 | 2017-09-26T14:58:58.000Z | 2021-02-24T15:23:08.000Z | # -*- coding: utf-8 -*-
#
# Qarnot documentation build configuration file, created by
# sphinx-quickstart on Tue Jun 6 12:02:54 2017.
#
# 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.
#
# Al... | 31.694301 | 99 | 0.691188 |
2dd65116cae2f6670c168152d3f3c9aa04a9c0bf | 6,489 | py | Python | conpaas-services/src/conpaas/services/webservers/manager/client.py | bopopescu/conpaas | e0a2955ae3e7da7525d799bed411e9f76ecf0919 | [
"BSD-3-Clause"
] | 1 | 2015-09-20T18:20:01.000Z | 2015-09-20T18:20:01.000Z | conpaas-services/src/conpaas/services/webservers/manager/client.py | bopopescu/conpaas | e0a2955ae3e7da7525d799bed411e9f76ecf0919 | [
"BSD-3-Clause"
] | 1 | 2020-07-27T11:56:18.000Z | 2020-07-27T11:56:18.000Z | conpaas-services/src/conpaas/services/webservers/manager/client.py | bopopescu/conpaas | e0a2955ae3e7da7525d799bed411e9f76ecf0919 | [
"BSD-3-Clause"
] | 3 | 2018-09-14T16:54:14.000Z | 2020-07-26T03:14:56.000Z | '''
Copyright (c) 2010-2012, Contrail consortium.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided
that the following conditions are met:
1. Redistributions of source code must retain the
above copyright notice, this list of conditions
... | 37.08 | 122 | 0.720758 |
2dd66d3fa4b882368d7ebc216406741dc67b40aa | 8,772 | py | Python | layerID_test.py | islandlab-unlv/Universal-image-segementation | ed7bea29c5ba8d7f8a56b66f7137dd41969359a2 | [
"MIT"
] | null | null | null | layerID_test.py | islandlab-unlv/Universal-image-segementation | ed7bea29c5ba8d7f8a56b66f7137dd41969359a2 | [
"MIT"
] | 1 | 2022-02-24T13:25:42.000Z | 2022-02-26T19:05:47.000Z | layerID_test.py | islandlab-unlv/Universal-image-segementation | ed7bea29c5ba8d7f8a56b66f7137dd41969359a2 | [
"MIT"
] | null | null | null | """Process optical images of thin flakes to distinguish layer thicknesses.
Usage:
- Change img_file (line 18) to the file location of image.
- Adjust comp (line 64): higher value runs faster with less resolution."""
from mpl_toolkits.mplot3d import Axes3D
from scipy.optimize import curve_fi... | 37.974026 | 150 | 0.609439 |
2dd6790f183bf1a0b96b6b3ee72b59d0c43ba1b2 | 1,097 | py | Python | src/11/passing_a_socket_file_descriptor_between_processes/server.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 14 | 2017-05-20T04:06:46.000Z | 2022-01-23T06:48:45.000Z | src/11/passing_a_socket_file_descriptor_between_processes/server.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 1 | 2021-06-10T20:17:55.000Z | 2021-06-10T20:17:55.000Z | src/11/passing_a_socket_file_descriptor_between_processes/server.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 15 | 2017-03-29T17:57:33.000Z | 2021-08-24T02:20:08.000Z | # server.py
import socket
import struct
def send_fd(sock, fd):
'''
Send a single file descriptor.
'''
sock.sendmsg([b'x'],
[(socket.SOL_SOCKET, socket.SCM_RIGHTS, struct.pack('i', fd))])
ack = sock.recv(2)
assert ack == b'OK'
def server(work_address, port):
# Wait for the ... | 28.128205 | 80 | 0.633546 |
2dd67a703fd805760e32a7512134bbbf6cccbddc | 13,272 | py | Python | codegen_sources/preprocessing/tests/obfuscation/test_java_obfuscation.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | codegen_sources/preprocessing/tests/obfuscation/test_java_obfuscation.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | codegen_sources/preprocessing/tests/obfuscation/test_java_obfuscation.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from codegen_sources.preprocessing.tests.obfuscation.utils import diff_tester
from codegen_sources.preprocessing.lang_processor... | 24.174863 | 188 | 0.595313 |
2dd67fc2711a4e84101f4f098f1db4a9c0cfe712 | 1,431 | py | Python | .guides/secure/unit_tests/functions/exercise5_test.py | codio-content/cs-intro-python-fundamentals | 7b59810b6fb98089d3b725a3b898a6403a32c447 | [
"MIT"
] | null | null | null | .guides/secure/unit_tests/functions/exercise5_test.py | codio-content/cs-intro-python-fundamentals | 7b59810b6fb98089d3b725a3b898a6403a32c447 | [
"MIT"
] | null | null | null | .guides/secure/unit_tests/functions/exercise5_test.py | codio-content/cs-intro-python-fundamentals | 7b59810b6fb98089d3b725a3b898a6403a32c447 | [
"MIT"
] | null | null | null | # Import student function form the newly copied file
from exercise5 import is_palindrome
# Import system module
import sys
# Homemade unit test, call student function w/ instructor input & output
def test_student_code():
"""Homemade unit test for student work
Return True if all of the tests pass
Return Fa... | 26.018182 | 72 | 0.598882 |
2dd68b4abec512e6834f84504299693e801bd7a3 | 987 | py | Python | examples/plugin_examples/plugin_templates/general/plugin_template4_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | examples/plugin_examples/plugin_templates/general/plugin_template4_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | examples/plugin_examples/plugin_templates/general/plugin_template4_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | from savu.plugins.plugin_tools import PluginTools
class PluginTemplate4Tools(PluginTools):
"""
A template for a plugin that takes in two datasets and returns one dataset,
e.g. absorption correction.
"""
def define_parameters(self):
"""
example:
visibility: basic
... | 30.84375 | 79 | 0.572442 |
2dd6b20cc032743382bc8969bbf768a5fefa89ce | 190 | py | Python | problems/1051_height-checker.py | okuda-seminar/review_leetcode | 9774dbb85b836c3ebab4b24d77774ed05abb7a32 | [
"MIT"
] | null | null | null | problems/1051_height-checker.py | okuda-seminar/review_leetcode | 9774dbb85b836c3ebab4b24d77774ed05abb7a32 | [
"MIT"
] | 170 | 2021-05-11T14:03:05.000Z | 2021-11-30T14:22:52.000Z | problems/1051_height-checker.py | ryuji0123/review_leetcode | 9774dbb85b836c3ebab4b24d77774ed05abb7a32 | [
"MIT"
] | null | null | null | class Solution:
def heightChecker(self, heights: List[int]) -> int:
sorted_heights = sorted(heights)
return sum([int(sh != h) for sh, h in zip(sorted_heights, heights)])
| 38 | 76 | 0.652632 |
2dd6b2429f041e4ba6315d4ed449dbefe5f77bcf | 1,801 | py | Python | dl/step3/create_goods_data.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | 3 | 2018-10-16T09:36:12.000Z | 2019-04-15T03:12:49.000Z | dl/step3/create_goods_data.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | dl/step3/create_goods_data.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | import os
from dl.step2.cluster import ClusterSettings
from dl import common
import tensorflow as tf
import shutil
tf.app.flags.DEFINE_integer(
'traintype', 0,
'point traintype to create, if 0 then create all')
tf.app.flags.DEFINE_string(
'dir_serial', '',
'dir serial')
FLAGS = tf.app.flags.FLAGS
def ... | 40.931818 | 132 | 0.689617 |
2dd6cd24e729b23d4a6ba36485a4bded280cf6a6 | 413 | py | Python | sksound/tests/test_sksound.py | DominicD-823543/scikit-sound | be0429a1ebe98efc2bfc55bcaa0966421c937c0c | [
"BSD-3-Clause"
] | 6 | 2018-06-09T18:54:37.000Z | 2020-09-24T12:38:46.000Z | sksound/tests/test_sksound.py | DominicD-823543/scikit-sound | be0429a1ebe98efc2bfc55bcaa0966421c937c0c | [
"BSD-3-Clause"
] | 1 | 2020-05-28T17:41:44.000Z | 2020-07-03T13:17:47.000Z | sksound/tests/test_sksound.py | DominicD-823543/scikit-sound | be0429a1ebe98efc2bfc55bcaa0966421c937c0c | [
"BSD-3-Clause"
] | 3 | 2019-09-23T18:24:17.000Z | 2021-04-06T16:36:23.000Z | import sys
import os
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(myPath, '..'))
import unittest
class TestSequenceFunctions(unittest.TestCase):
def test_sksounds(self):
for module in ['sounds']:
print(dir(module))
def test_dummy(se... | 21.736842 | 51 | 0.615012 |
2dd709eb1ef8c63574a93eb1c17fc7d7f03f6bb5 | 12,187 | py | Python | wavetorch/viz/plot.py | NunoEdgarGFlowHub/wavetorch | e6171b69e66e16a2ba4c76869d4e0b15a3e9861f | [
"MIT"
] | 1 | 2019-09-17T06:15:16.000Z | 2019-09-17T06:15:16.000Z | wavetorch/viz/plot.py | NunoEdgarGFlowHub/wavetorch | e6171b69e66e16a2ba4c76869d4e0b15a3e9861f | [
"MIT"
] | null | null | null | wavetorch/viz/plot.py | NunoEdgarGFlowHub/wavetorch | e6171b69e66e16a2ba4c76869d4e0b15a3e9861f | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import matplotlib as mpl
import seaborn as sns
import librosa
import librosa.display
from string import ascii_lowercase, ascii_uppercase
from numpy import in1d
from matplotlib import rcParams
from mpl_toolkits.axes_grid1.axes_... | 37.847826 | 209 | 0.60343 |
2dd71c30a21bb81d3ee1eb5bbecae50b1c663215 | 5,986 | py | Python | tests/unit/test_utils.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | 3 | 2020-04-01T10:51:17.000Z | 2021-08-05T18:35:23.000Z | tests/unit/test_utils.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | null | null | null | tests/unit/test_utils.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | 1 | 2020-07-05T12:06:30.000Z | 2020-07-05T12:06:30.000Z |
import os
import tempfile
try:
import mock
except ImportError:
import unittest.mock as mock
import reveries
import reveries.utils
def test_stage_dir():
prefix = "test_temp"
dir_path = reveries.utils.stage_dir(prefix=prefix)
# It's a dir
assert os.path.isdir(dir_path)
# The dir is empty... | 27.84186 | 79 | 0.631975 |
2dd73bce8b40d23a972fb28bc3e452f942046e1e | 3,542 | py | Python | exome_slicer/quality_stats/management/commands/load_quality_stats.py | genomics-geek/exome_slicer | e1e69fac4ec634b07bab353a191ce783ec766c53 | [
"MIT"
] | 2 | 2018-04-09T14:09:59.000Z | 2019-09-24T08:27:23.000Z | exome_slicer/quality_stats/management/commands/load_quality_stats.py | genomics-geek/exome_slicer | e1e69fac4ec634b07bab353a191ce783ec766c53 | [
"MIT"
] | 4 | 2018-01-24T18:41:20.000Z | 2018-12-07T16:41:09.000Z | exome_slicer/quality_stats/management/commands/load_quality_stats.py | genomics-geek/exome_slicer | e1e69fac4ec634b07bab353a191ce783ec766c53 | [
"MIT"
] | 1 | 2018-01-17T23:56:52.000Z | 2018-01-17T23:56:52.000Z | # -*- coding: utf-8
import logging
from django.core.management import BaseCommand
from exome_slicer.quality_stats.models import QualityStat
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Load stats file to Exome Slicer'
def add_arguments(self, parser):
parser.add_argumen... | 40.25 | 92 | 0.597685 |
2dd74dadd0be67340363c975e15132332af5690e | 10,744 | py | Python | bioblend/galaxyclient.py | gregvonkuster/bioblend | c7556d3e7a9ee2f0a86e12306b97a6b123809c74 | [
"MIT"
] | null | null | null | bioblend/galaxyclient.py | gregvonkuster/bioblend | c7556d3e7a9ee2f0a86e12306b97a6b123809c74 | [
"MIT"
] | null | null | null | bioblend/galaxyclient.py | gregvonkuster/bioblend | c7556d3e7a9ee2f0a86e12306b97a6b123809c74 | [
"MIT"
] | null | null | null | """
Helper class for Galaxy and ToolShed Instance object
This class is primarily a helper for the library and user code
should not use it directly.
A base representation of an instance
"""
import base64
import json
import requests
import six
from requests_toolbelt import MultipartEncoder
from six.moves.urllib.parse i... | 40.69697 | 108 | 0.591958 |
2dd78adeca93dd6545e7fdaa2a19453dc16980e8 | 2,445 | py | Python | tests/test_convert.py | opendatacube/datacube-zarr | 1c05a0c92d81b4235d75bbb01adcb2da9ae8013b | [
"Apache-2.0"
] | null | null | null | tests/test_convert.py | opendatacube/datacube-zarr | 1c05a0c92d81b4235d75bbb01adcb2da9ae8013b | [
"Apache-2.0"
] | null | null | null | tests/test_convert.py | opendatacube/datacube-zarr | 1c05a0c92d81b4235d75bbb01adcb2da9ae8013b | [
"Apache-2.0"
] | null | null | null | import pytest
import rasterio
from datacube_zarr.utils.convert import convert_dir, convert_to_zarr, get_datasets
from datacube_zarr.utils.uris import uri_split
from .utils import _load_dataset, copytree, raster_and_zarr_are_equal
def test_find_datasets_geotif(tmp_dir_of_rasters):
"""Test finding geotif datasets... | 33.040541 | 88 | 0.689162 |
2dd78fa2accac81c6017c1694e542df1a0c174c4 | 8,740 | py | Python | src/samples/pymxs/notifications.py | RegionStormer/3dsMax-Python-HowTos | b86ef45ef4d8dff373bd1cbfe5c4d5b805687339 | [
"MIT"
] | 88 | 2020-03-19T20:24:08.000Z | 2022-03-23T23:13:54.000Z | src/samples/pymxs/notifications.py | RegionStormer/3dsMax-Python-HowTos | b86ef45ef4d8dff373bd1cbfe5c4d5b805687339 | [
"MIT"
] | 5 | 2020-04-09T19:56:47.000Z | 2021-11-12T20:02:18.000Z | src/samples/pymxs/notifications.py | RegionStormer/3dsMax-Python-HowTos | b86ef45ef4d8dff373bd1cbfe5c4d5b805687339 | [
"MIT"
] | 22 | 2020-03-19T19:24:36.000Z | 2022-03-18T21:55:19.000Z | '''
Lists all of the notification codes broadcast by 3ds Max,
and registers a callback function for each and every one.
'''
import os
from pymxs import runtime as rt # pylint: disable=import-error
# sadly, maxscript does not expose this list
NOTIFICATIONS = [
"unitsChange",
"timeunitsChange",
"view... | 28.75 | 113 | 0.693364 |
2dd7a119a34e20e02963d73706a8b1e12d830773 | 2,628 | py | Python | icecube/bin/labels_cube/labels_cube_generator.py | iceye-ltd/icecube | 9db3005f2ac2d6fb43d5562c0646527eb4ab6700 | [
"MIT"
] | 47 | 2021-08-25T09:40:29.000Z | 2022-02-16T06:52:01.000Z | icecube/bin/labels_cube/labels_cube_generator.py | iceye-ltd/icecube | 9db3005f2ac2d6fb43d5562c0646527eb4ab6700 | [
"MIT"
] | 7 | 2021-09-08T09:37:59.000Z | 2022-01-04T10:12:45.000Z | icecube/bin/labels_cube/labels_cube_generator.py | iceye-ltd/icecube | 9db3005f2ac2d6fb43d5562c0646527eb4ab6700 | [
"MIT"
] | 4 | 2021-09-01T12:40:23.000Z | 2021-12-07T11:00:19.000Z | #!/usr/bin/env python
"""
Description: The script provides functionality to ingest labels into datacube
"""
import os
from icecube.bin.labels_cube.vector_labels import VectorLabels
from icecube.bin.labels_cube.raster_labels import RasterLabels
from icecube.bin.config import CubeConfig
from icecube.bin.labels_cube.la... | 31.662651 | 100 | 0.696728 |
2dd7a96cc23b8dbeb6e051fd6e71a6ab340ac93a | 1,252 | py | Python | src/shorturls/templatetags/shorturl.py | tubaman/django-shorturls | 59b6e76c00190d6fb62a1db108555c57c27f369f | [
"BSD-3-Clause"
] | null | null | null | src/shorturls/templatetags/shorturl.py | tubaman/django-shorturls | 59b6e76c00190d6fb62a1db108555c57c27f369f | [
"BSD-3-Clause"
] | null | null | null | src/shorturls/templatetags/shorturl.py | tubaman/django-shorturls | 59b6e76c00190d6fb62a1db108555c57c27f369f | [
"BSD-3-Clause"
] | null | null | null | import urlparse
from django import template
from django.conf import settings
from django.core import urlresolvers
from django.utils.safestring import mark_safe
from shorturls.baseconv import base62
from shorturls.urlresolvers import get_shorturl
class ShortURL(template.Node):
@classmethod
def parse(cls, parser... | 30.536585 | 90 | 0.645367 |
2dd7ae3a3078483419f136ebc79093a1c6639dcc | 397 | py | Python | online_test/wsgi.py | patilnayan92/online | 0f9a8d8da5aa84a408a9a8e5825a045f6c86f481 | [
"Python-2.0"
] | 2 | 2019-03-06T02:17:25.000Z | 2019-10-03T17:43:26.000Z | online_test/wsgi.py | patilnayan92/online | 0f9a8d8da5aa84a408a9a8e5825a045f6c86f481 | [
"Python-2.0"
] | null | null | null | online_test/wsgi.py | patilnayan92/online | 0f9a8d8da5aa84a408a9a8e5825a045f6c86f481 | [
"Python-2.0"
] | 4 | 2019-02-01T16:10:40.000Z | 2020-08-30T02:44:39.000Z | """
WSGI config for online_test project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "online_test.settings")
from djang... | 26.466667 | 78 | 0.793451 |
2dd7b07044aca0ab14449ec702672f88a4a9814e | 546 | py | Python | src/oscar/apps/dashboard/promotions/formsets.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | src/oscar/apps/dashboard/promotions/formsets.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | src/oscar/apps/dashboard/promotions/formsets.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from django.forms.models import inlineformset_factory
from oscar.core.loading import get_class, get_classes
HandPickedProductList, OrderedProduct \
= get_classes('promotions.models',
['HandPickedProductList', 'OrderedProduct'])
ProductSelect = get_class('dashboard.catalogue.widgets', 'Pro... | 42 | 83 | 0.778388 |
2dd7b5a3d28eefad90ed7b6f8b4b66df7293b640 | 2,764 | py | Python | tests/integration/docusaurus/connecting_to_your_data/database/sqlite_yaml_example.py | UtahDave/great_expectations | 99a54370f7ebeea5d95bca726200db01c7326d68 | [
"Apache-2.0"
] | 2 | 2022-01-28T15:51:32.000Z | 2022-02-02T05:07:58.000Z | tests/integration/docusaurus/connecting_to_your_data/database/sqlite_yaml_example.py | UtahDave/great_expectations | 99a54370f7ebeea5d95bca726200db01c7326d68 | [
"Apache-2.0"
] | null | null | null | tests/integration/docusaurus/connecting_to_your_data/database/sqlite_yaml_example.py | UtahDave/great_expectations | 99a54370f7ebeea5d95bca726200db01c7326d68 | [
"Apache-2.0"
] | 1 | 2021-10-08T01:24:50.000Z | 2021-10-08T01:24:50.000Z | from ruamel import yaml
import great_expectations as ge
from great_expectations.core.batch import BatchRequest, RuntimeBatchRequest
CONNECTION_STRING = "sqlite:///data/yellow_tripdata.db"
context = ge.get_context()
datasource_yaml = f"""
name: my_sqlite_datasource
class_name: Datasource
execution_engine:
class_na... | 34.987342 | 107 | 0.791606 |
2dd7c843398f644413f116dd2adc2b8ef2b90ecd | 1,880 | py | Python | picatrix/lib/ipython.py | google/picatrix | 4e7f20f238c0f204e332a8a25dac1c0d529ed9ef | [
"Apache-2.0"
] | 27 | 2020-10-23T14:45:14.000Z | 2022-03-31T14:57:58.000Z | picatrix/lib/ipython.py | mariuszlitwin/picatrix | 4e7f20f238c0f204e332a8a25dac1c0d529ed9ef | [
"Apache-2.0"
] | 15 | 2020-10-20T04:10:26.000Z | 2021-11-01T16:57:37.000Z | picatrix/lib/ipython.py | mariuszlitwin/picatrix | 4e7f20f238c0f204e332a8a25dac1c0d529ed9ef | [
"Apache-2.0"
] | 12 | 2020-10-17T11:06:10.000Z | 2022-01-27T12:37:49.000Z | # Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.571429 | 75 | 0.735638 |
2dd7cac4cdfccf440f284df3916749ee2b4245ff | 130 | py | Python | site-packages/pyemd/emd.py | ProjectZeroDays/Pyto | d5d77f3541f329bbb28142d18606b22f115b7df6 | [
"MIT"
] | 2 | 2020-08-25T13:55:00.000Z | 2020-08-25T16:36:03.000Z | site-packages/pyemd/emd.py | ProjectZeroDays/Pyto | d5d77f3541f329bbb28142d18606b22f115b7df6 | [
"MIT"
] | null | null | null | site-packages/pyemd/emd.py | ProjectZeroDays/Pyto | d5d77f3541f329bbb28142d18606b22f115b7df6 | [
"MIT"
] | null | null | null | from extensionsimporter import c, update_mods
c.initialize_emd()
update_mods()
del c
del update_mods
from __pyemd_emd import *
| 13 | 45 | 0.807692 |
2dd7cb12fe840a9526cb5f72a8237b148c6849fd | 2,294 | py | Python | backend/test/test_viasp.py | glaserL/viasp | 740cb13c9d71c76b9a702597083b5b75b5a5eafb | [
"MIT"
] | null | null | null | backend/test/test_viasp.py | glaserL/viasp | 740cb13c9d71c76b9a702597083b5b75b5a5eafb | [
"MIT"
] | 9 | 2022-03-15T12:10:58.000Z | 2022-03-23T19:33:51.000Z | backend/test/test_viasp.py | glaserL/viasp | 740cb13c9d71c76b9a702597083b5b75b5a5eafb | [
"MIT"
] | null | null | null | import io
import pathlib
import sys
from inspect import Signature
from typing import Sequence, Any, Dict, Collection
from flask.testing import FlaskClient
from viasp import wrapper
from viasp.shared.model import ClingoMethodCall, StableModel
from viasp.shared.interfaces import ViaspClient
def test_instanciations():... | 32.309859 | 109 | 0.711421 |
2dd7d4df4de665fdbd4eb3d6024ea9b4fde8756f | 11,631 | py | Python | lhotse/dataset/collation.py | jimbozhang/lhotse | 85a5c8e9d9827f457ba33432bfe37f44ca28365a | [
"Apache-2.0"
] | 1 | 2020-10-02T02:42:25.000Z | 2020-10-02T02:42:25.000Z | lhotse/dataset/collation.py | jimbozhang/lhotse | 85a5c8e9d9827f457ba33432bfe37f44ca28365a | [
"Apache-2.0"
] | 2 | 2020-11-05T11:44:17.000Z | 2021-04-08T11:38:48.000Z | lhotse/dataset/collation.py | jimbozhang/lhotse | 85a5c8e9d9827f457ba33432bfe37f44ca28365a | [
"Apache-2.0"
] | null | null | null | from concurrent.futures import Executor
from typing import Iterable, List, Optional, Tuple, Union
import numpy as np
import torch
from torch.nn import CrossEntropyLoss
from lhotse import CutSet
from lhotse.cut import Cut, MixedCut
class TokenCollater:
"""Collate list of tokens
Map sentences to integers. Se... | 38.899666 | 109 | 0.656177 |
2dd7d5aa15c8155644482233ee86972eaad91cc2 | 2,117 | py | Python | theme/management/commands/report_quota_inconsistency.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | theme/management/commands/report_quota_inconsistency.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | theme/management/commands/report_quota_inconsistency.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z |
import csv
import math
from django.core.management.base import BaseCommand
from django.core.exceptions import ValidationError
from hs_core.hydroshare import convert_file_size_to_unit
from theme.models import UserQuota
from hs_core.hydroshare.resource import get_quota_usage_from_irods
class Command(BaseCommand):
... | 38.490909 | 109 | 0.571091 |
2dd7df298eef05a96cd449b97d76395cf71a5f92 | 8,328 | py | Python | pytreex/block/t2a/cs/movecliticstowackernagel.py | leotilli/pytreex | a40bfb9f33ffdb931993b30879830f1c898f1414 | [
"Apache-2.0"
] | null | null | null | pytreex/block/t2a/cs/movecliticstowackernagel.py | leotilli/pytreex | a40bfb9f33ffdb931993b30879830f1c898f1414 | [
"Apache-2.0"
] | null | null | null | pytreex/block/t2a/cs/movecliticstowackernagel.py | leotilli/pytreex | a40bfb9f33ffdb931993b30879830f1c898f1414 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
#
from __future__ import unicode_literals
from pytreex.core.block import Block
from pytreex.core.exception import LoadingException
from pytreex.core.util import first
__author__ = "Ondřej Dušek"
__date__ = "2012"
class MoveCliticsToWackernagel(Block):
"""\
Move clitics (... | 38.915888 | 79 | 0.582973 |
2dd7e2d067ccab2e1a38f4336b62273f84dca579 | 5,486 | py | Python | neural_sp/datasets/token_converter/word.py | Cescfangs/neural_sp | 2c12d25d2078d3dacdb80c5c367c2e90feba7b6c | [
"Apache-2.0"
] | null | null | null | neural_sp/datasets/token_converter/word.py | Cescfangs/neural_sp | 2c12d25d2078d3dacdb80c5c367c2e90feba7b6c | [
"Apache-2.0"
] | null | null | null | neural_sp/datasets/token_converter/word.py | Cescfangs/neural_sp | 2c12d25d2078d3dacdb80c5c367c2e90feba7b6c | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 Kyoto University (Hirofumi Inaguma)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Word-level token <-> index converter."""
import codecs
class Word2idx(object):
"""Class for converting word sequence into indices.
Args:
... | 30.309392 | 91 | 0.55031 |
2dd7fcebbc43ee521aa14982432e850a62efa42e | 5,459 | py | Python | src/onevision/nn/loss/grayscale_loss.py | phlong3105/onevision | 90552b64df7213e7fbe23c80ffd8a89583289433 | [
"MIT"
] | 2 | 2022-03-28T09:46:38.000Z | 2022-03-28T14:12:32.000Z | src/onevision/nn/loss/grayscale_loss.py | phlong3105/onevision | 90552b64df7213e7fbe23c80ffd8a89583289433 | [
"MIT"
] | null | null | null | src/onevision/nn/loss/grayscale_loss.py | phlong3105/onevision | 90552b64df7213e7fbe23c80ffd8a89583289433 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Grayscale Loss.
"""
from __future__ import annotations
from typing import Optional
import torch
from torch import Tensor
from torch.nn.modules.loss import _Loss
from onevision.factory import LOSSES
from onevision.nn.loss.mse_loss import elementwise_mse_loss
from one... | 32.885542 | 89 | 0.555596 |
2dd82229d801f628097a4b16c33615839c181b1a | 1,859 | py | Python | database.py | lllsavanlll/VirtualAssistant | b3065188d24baacff5b8df049dd3f4ae1c8935a2 | [
"MIT"
] | 1 | 2021-08-05T15:10:00.000Z | 2021-08-05T15:10:00.000Z | database.py | lllsavanlll/VirtualAssistant | b3065188d24baacff5b8df049dd3f4ae1c8935a2 | [
"MIT"
] | null | null | null | database.py | lllsavanlll/VirtualAssistant | b3065188d24baacff5b8df049dd3f4ae1c8935a2 | [
"MIT"
] | null | null | null | import sqlite3
def create_connection():
"""
Connects to the database
"""
connection = sqlite3.connect("memory.db")
return connection
def get_questions_and_answers():
con = create_connection()
cur = con.cursor()
cur.execute("select * from questionsAndAnswers")
return cur.fetchall()
... | 27.338235 | 81 | 0.629371 |
2dd824e97cad8e2327c7758e0d963527457d7513 | 1,326 | py | Python | tests/dataverk/connectors/test_elasticsearchconnector.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 3 | 2019-09-29T20:48:46.000Z | 2021-03-31T10:16:07.000Z | tests/dataverk/connectors/test_elasticsearchconnector.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 148 | 2019-02-08T12:30:58.000Z | 2021-03-11T15:31:55.000Z | tests/dataverk/connectors/test_elasticsearchconnector.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 1 | 2020-11-18T14:10:05.000Z | 2020-11-18T14:10:05.000Z | from unittest import TestCase
import requests
import os
from dataverk.connectors.elasticsearch import ElasticsearchConnector
from dataverk.exceptions import dataverk_exceptions
INDEX = "https://my.es.index.com"
HOST = "elastic_host"
SETTINGS = {
"index_connections": {
"elastic_host": INDEX,
"i... | 22.1 | 77 | 0.691554 |
2dd85a9b0c29fad9912f4c3b52fd7272826b538f | 1,147 | py | Python | credoscript/adaptors/xrefadaptor.py | tlb-lab/credoscript | 32bdf08d84703dc2062dae4df1a95587d36c3cf7 | [
"MIT"
] | null | null | null | credoscript/adaptors/xrefadaptor.py | tlb-lab/credoscript | 32bdf08d84703dc2062dae4df1a95587d36c3cf7 | [
"MIT"
] | null | null | null | credoscript/adaptors/xrefadaptor.py | tlb-lab/credoscript | 32bdf08d84703dc2062dae4df1a95587d36c3cf7 | [
"MIT"
] | null | null | null | from sqlalchemy.sql.expression import and_
class XRefAdaptor(object):
"""
"""
def __init__(self):
self.query = XRef.query
def fetch_by_xref_id(self, xref_id):
"""
"""
return self.query.get(xref_id)
def fetch_all_by_entity(self, entity_type, entity_id, *expressions)... | 28.675 | 79 | 0.552746 |
2dd85da1d51b16a615a12827e741fbab05ee0594 | 821 | py | Python | leetcode/287. Find the Duplicate Number/soln.py | saisankargochhayat/algo_quest | a24f9a22c019ab31d56bd5a7ca5ba790d54ce5dc | [
"Apache-2.0"
] | 3 | 2017-02-15T20:55:04.000Z | 2018-09-26T18:48:24.000Z | leetcode/287. Find the Duplicate Number/soln.py | saisankargochhayat/algo_quest | a24f9a22c019ab31d56bd5a7ca5ba790d54ce5dc | [
"Apache-2.0"
] | 4 | 2017-10-07T18:59:20.000Z | 2019-10-08T05:43:25.000Z | leetcode/287. Find the Duplicate Number/soln.py | saisankargochhayat/algo_quest | a24f9a22c019ab31d56bd5a7ca5ba790d54ce5dc | [
"Apache-2.0"
] | 1 | 2017-10-08T06:52:21.000Z | 2017-10-08T06:52:21.000Z | # Think like linked list cycle 2.
class Solution:
def findDuplicate(self, nums: List[int]) -> int:
slow = fast = nums[0]
# Finding intersection point inside cycle
while True:
slow = nums[slow]
fast = nums[nums[fast]]
if slow == fast:
break... | 35.695652 | 99 | 0.53106 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.