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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1a652a0fc20c53ecf36567cd0f405f407342bb0b | 218 | py | Python | preprocessing/sampling.py | omartrinidad/challenge | 5e6ea3c7c488c43ade33823c41a7297bea83dbc4 | [
"MIT"
] | null | null | null | preprocessing/sampling.py | omartrinidad/challenge | 5e6ea3c7c488c43ade33823c41a7297bea83dbc4 | [
"MIT"
] | null | null | null | preprocessing/sampling.py | omartrinidad/challenge | 5e6ea3c7c488c43ade33823c41a7297bea83dbc4 | [
"MIT"
] | null | null | null | import pandas as pd
df = pd.read_csv("data/train.csv")
for i in range(0, 10):
train_sample = df.sample(250000)
filename = "data/train_sample_" + str(i) + ".csv"
train_sample.to_csv(filename, index=False)
| 24.222222 | 53 | 0.678899 |
1a6547dca555d587236d6f78c407da3ed90c7781 | 35,004 | py | Python | mogp_emulator/Kernel.py | alan-turing-institute/mogp-emulator | 41c3615dd2b51222b00f1e85c48f82d128c99003 | [
"MIT"
] | 21 | 2021-01-20T07:02:12.000Z | 2022-03-30T21:09:04.000Z | mogp_emulator/Kernel.py | alan-turing-institute/mogp_emulator | 41c3615dd2b51222b00f1e85c48f82d128c99003 | [
"MIT"
] | 114 | 2019-04-25T14:53:11.000Z | 2021-01-06T17:07:41.000Z | mogp_emulator/Kernel.py | alan-turing-institute/mogp-emulator | 41c3615dd2b51222b00f1e85c48f82d128c99003 | [
"MIT"
] | 8 | 2021-02-02T08:56:12.000Z | 2022-02-15T10:03:15.000Z | r"""
Kernel module, implements a few standard stationary kernels for use with the
``GaussianProcess`` class. At present, kernels can only be selected manually by setting
the ``kernel`` attribute of the GP. The default is to use the ``SquaredExponential``
kernel, but this can be changed once the ``GaussianProcess`` inst... | 48.082418 | 102 | 0.605102 |
1a654eeedfe685d807bfc9f2e7363e40bc51a9b0 | 1,579 | py | Python | tests/test_hyper_block.py | HanxiaoLyu/autokeras | 2f1f42eeb68c64ff991c0ae2e8253a9305e90f74 | [
"MIT"
] | null | null | null | tests/test_hyper_block.py | HanxiaoLyu/autokeras | 2f1f42eeb68c64ff991c0ae2e8253a9305e90f74 | [
"MIT"
] | null | null | null | tests/test_hyper_block.py | HanxiaoLyu/autokeras | 2f1f42eeb68c64ff991c0ae2e8253a9305e90f74 | [
"MIT"
] | null | null | null | import autokeras as ak
import kerastuner
import pytest
import numpy as np
import tensorflow as tf
@pytest.fixture(scope='module')
def tmp_dir(tmpdir_factory):
return tmpdir_factory.mktemp('test_hyper_block')
def test_xception_block(tmp_dir):
x_train = np.random.rand(100, 32, 32, 3)
y_train = np.random.... | 29.240741 | 73 | 0.711843 |
1a65725ac9cf436965f61a04d32dc937811b0a44 | 7,134 | py | Python | django_extensions/management/commands/reset_db.py | KolibriDev/django-extensions | 60010e29dd7b7778fff4eb01acdd80a40e925a42 | [
"MIT"
] | 285 | 2019-12-23T09:50:21.000Z | 2021-12-08T09:08:49.000Z | django_extensions/management/commands/reset_db.py | KolibriDev/django-extensions | 60010e29dd7b7778fff4eb01acdd80a40e925a42 | [
"MIT"
] | null | null | null | django_extensions/management/commands/reset_db.py | KolibriDev/django-extensions | 60010e29dd7b7778fff4eb01acdd80a40e925a42 | [
"MIT"
] | 9 | 2019-12-23T12:59:25.000Z | 2022-03-15T05:12:11.000Z | """
originally from http://www.djangosnippets.org/snippets/828/ by dnordberg
"""
import logging
from optparse import make_option
from django.conf import settings
from django.core.management.base import CommandError, BaseCommand
from six.moves import input, configparser
class Command(BaseCommand):
option_list = B... | 40.534091 | 120 | 0.565882 |
1a658b5c914cf733f26a1af77d1161ea85403e2e | 1,539 | py | Python | SMLProject_G3/LRP/sequential.py | pourmand1376/statistical-machine-learning-projects | c1ff4057beb4256c4d0a4743bb0e7a9ce44c938f | [
"MIT"
] | 1 | 2021-10-10T23:55:37.000Z | 2021-10-10T23:55:37.000Z | SMLProject_G3/LRP/sequential.py | pourmand1376/statistical-machine-learning-projects | c1ff4057beb4256c4d0a4743bb0e7a9ce44c938f | [
"MIT"
] | null | null | null | SMLProject_G3/LRP/sequential.py | pourmand1376/statistical-machine-learning-projects | c1ff4057beb4256c4d0a4743bb0e7a9ce44c938f | [
"MIT"
] | null | null | null | import torch
from lrp import Linear, Conv2d
from maxpool import MaxPool2d
from functional.utils import normalize
def grad_decorator_fn(module):
def fn(x):
return normalize(x)
return fn
avoid_normalization_on = ['relu', 'maxp']
def do_normalization(rule, module):
if "pattern" not in rule.lower()... | 28.5 | 81 | 0.640676 |
1a65b60563f4acd463d3b26274ac0aa3661867a0 | 2,594 | py | Python | demo-remote-database/views.py | Sunxy88/KeepYourDataUnderControl | fe466c2bc9d13c702b3e687a21a346898d04adef | [
"Apache-2.0"
] | null | null | null | demo-remote-database/views.py | Sunxy88/KeepYourDataUnderControl | fe466c2bc9d13c702b3e687a21a346898d04adef | [
"Apache-2.0"
] | null | null | null | demo-remote-database/views.py | Sunxy88/KeepYourDataUnderControl | fe466c2bc9d13c702b3e687a21a346898d04adef | [
"Apache-2.0"
] | null | null | null | import os
import os.path
from datetime import datetime
from flask import (
abort,
Blueprint,
jsonify,
request,
Response,
)
from werkzeug.utils import secure_filename
from model import db, TextResource, ImageResource
from config import BASE_HOST, UPLOAD_FOLDER
api = Blueprint('api', __name__, url_... | 25.94 | 59 | 0.604857 |
1a65c4eed9f4faf7eb6a8e9d6e25e2a68d16f610 | 494 | py | Python | setup.py | awcchungster/mlsriracha | 63768f138d91b2b0e028a599827ff98ff2a44c8c | [
"Apache-2.0"
] | null | null | null | setup.py | awcchungster/mlsriracha | 63768f138d91b2b0e028a599827ff98ff2a44c8c | [
"Apache-2.0"
] | 1 | 2021-08-18T21:37:20.000Z | 2021-08-18T21:37:20.000Z | setup.py | awcchungster/mlsriracha | 63768f138d91b2b0e028a599827ff98ff2a44c8c | [
"Apache-2.0"
] | 1 | 2021-08-16T22:28:06.000Z | 2021-08-16T22:28:06.000Z | from setuptools import find_packages, setup
setup(
name='mlsriracha',
version='0.0.4',
description='A project to abstract the boilerplate required to deploy jobs in MLOps systems',
author='Alex Chung',
author_email='alex@socialg.tech',
url='https://github.com/awcchungster/mlsriracha',
packag... | 30.875 | 97 | 0.643725 |
1a65d21c5de08802950b75ee83523ecaf4773f20 | 176 | py | Python | chirun/plastex/comment.py | sthagen/chirun-ncl-chirun | 45897319d5203b9867b5d6e00b2db1aa90a6580c | [
"Apache-2.0"
] | 5 | 2021-12-06T15:57:24.000Z | 2022-01-24T20:34:00.000Z | chirun/plastex/comment.py | sthagen/chirun-ncl-chirun | 45897319d5203b9867b5d6e00b2db1aa90a6580c | [
"Apache-2.0"
] | 38 | 2021-12-09T13:16:46.000Z | 2022-03-30T11:42:13.000Z | chirun/plastex/comment.py | sthagen/chirun-ncl-chirun | 45897319d5203b9867b5d6e00b2db1aa90a6580c | [
"Apache-2.0"
] | 1 | 2022-01-17T17:41:35.000Z | 2022-01-17T17:41:35.000Z | from chirun.plastex import VerbatimEnvironment
class comment(VerbatimEnvironment):
def invoke(self, tex):
VerbatimEnvironment.invoke(self, tex)
return []
| 22 | 46 | 0.721591 |
1a65df1ec98ef4d908432c4c11121f275edc4851 | 11,621 | py | Python | bonneville/utils/odict.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | null | null | null | bonneville/utils/odict.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | null | null | null | bonneville/utils/odict.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | 3 | 2020-05-10T02:08:44.000Z | 2020-11-06T11:01:57.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
bonneville.utils.odict
~~~~~~~~~~~~~~~~
This is a compatibility/"importability" laye... | 40.775439 | 95 | 0.490491 |
1a6603a46420cd2da6f12b36892c2b704d8ef736 | 148,773 | py | Python | Lib/test/test_xml_etree.py | masamitsu-murase/stackless | 677b36ffe5cb5a0f4b8d3abfa20982c8d82ffb92 | [
"CNRI-Python-GPL-Compatible"
] | 854 | 2017-09-11T16:42:28.000Z | 2022-03-27T14:17:09.000Z | Lib/test/test_xml_etree.py | masamitsu-murase/stackless | 677b36ffe5cb5a0f4b8d3abfa20982c8d82ffb92 | [
"CNRI-Python-GPL-Compatible"
] | 164 | 2017-09-24T20:40:32.000Z | 2021-10-30T01:35:05.000Z | Lib/test/test_xml_etree.py | masamitsu-murase/stackless | 677b36ffe5cb5a0f4b8d3abfa20982c8d82ffb92 | [
"CNRI-Python-GPL-Compatible"
] | 73 | 2017-09-13T18:07:48.000Z | 2022-03-17T13:02:29.000Z | # IMPORTANT: the same tests are run from "test_xml_etree_c" in order
# to ensure consistency between the C implementation and the Python
# implementation.
#
# For this purpose, the module-level "ET" symbol is temporarily
# monkey-patched when running the "test_xml_etree_c" test suite.
import copy
import functools
impo... | 38.146923 | 217 | 0.547566 |
1a6619c13fde6cf04d3d331e9dd4ecd951057d59 | 21,171 | py | Python | windscribe/windscribe.py | BergLucas/Python-Windscribe | 001e82ad1bbc7a5ba9222ef026563903183429d7 | [
"MIT"
] | null | null | null | windscribe/windscribe.py | BergLucas/Python-Windscribe | 001e82ad1bbc7a5ba9222ef026563903183429d7 | [
"MIT"
] | null | null | null | windscribe/windscribe.py | BergLucas/Python-Windscribe | 001e82ad1bbc7a5ba9222ef026563903183429d7 | [
"MIT"
] | 1 | 2021-05-13T03:36:43.000Z | 2021-05-13T03:36:43.000Z | import os
import random
import re
import attr
import pexpect
from loguru import logger
from typing import List, Union
from pexpect.exceptions import EOF, ExceptionPexpect
from .exceptions import (
UnknownVersionException,
WindscribeNotRunningException,
WindscribeNotFoundException,
UnsupportedVersionEx... | 29.041152 | 124 | 0.625053 |
1a66284023ad1a1b31353c473145a4870603e5ee | 4,831 | py | Python | neural_sp/models/seq2seq/decoders/fwd_bwd_attention.py | Cescfangs/neural_sp | 2c12d25d2078d3dacdb80c5c367c2e90feba7b6c | [
"Apache-2.0"
] | null | null | null | neural_sp/models/seq2seq/decoders/fwd_bwd_attention.py | Cescfangs/neural_sp | 2c12d25d2078d3dacdb80c5c367c2e90feba7b6c | [
"Apache-2.0"
] | null | null | null | neural_sp/models/seq2seq/decoders/fwd_bwd_attention.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)
"""Forward-backward attention decoding."""
import logging
logger = logging.getLogger(__name__)
def fwd_bwd_attention(nbest_hyps_fwd, aws_fwd, scores_fwd,... | 44.731481 | 128 | 0.479611 |
1a6635820fb9daeb95abe90c8d5ecfc5e928555f | 14,182 | py | Python | web/tf_serve_pack.py | DeepWTO/deepwto-draft | c61dc02e4ce3e72e8423c712ddc5483f851443f5 | [
"Apache-2.0"
] | 34 | 2019-02-04T14:57:08.000Z | 2022-02-07T13:32:35.000Z | web/tf_serve_pack.py | syyunn/DeepWTO | 0e9f206ec2ce24b1afdf895bc81509dd84235b82 | [
"Apache-2.0"
] | 3 | 2020-03-02T05:06:24.000Z | 2020-03-06T08:39:18.000Z | web/tf_serve_pack.py | DeepWTO/deepwto-draft | c61dc02e4ce3e72e8423c712ddc5483f851443f5 | [
"Apache-2.0"
] | 4 | 2020-02-17T04:17:12.000Z | 2022-02-07T14:27:01.000Z | # -*- coding:utf-8 -*-
__author__ = 'Randolph'
__modify__ = 'Zachary'
import os
import sys
import time
import numpy as np
import tensorflow as tf
from utils import checkpoints
from utils import feed
from sklearn.metrics import precision_score, recall_score, f1_score, \
roc_auc_score, average_precision_score
def... | 41.95858 | 83 | 0.536878 |
1a66668a6e24cdc8dfd9bcff5669c21c1925fe4f | 947 | py | Python | suspicious_urls_ips/feeds/proxyspy.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | suspicious_urls_ips/feeds/proxyspy.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | suspicious_urls_ips/feeds/proxyspy.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Copyright (c) 2014-2019 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
from antivirus.lists_based_engine.update import retrieve_content
from antivirus.lists_based_engine.settings import IP_TYPE
from antivirus.lists_based_engine.s... | 29.59375 | 95 | 0.718057 |
1a66bea0eff2d6160ec87b44cad87bdc146480ff | 2,751 | py | Python | tests/cryptography/test_simple_cipher.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | tests/cryptography/test_simple_cipher.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | tests/cryptography/test_simple_cipher.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | import unittest
from cryptography.simple_cipher import Caesar, Cipher
class CipherTest(unittest.TestCase):
def test_caesar_encode1(self):
self.assertEqual('lwlvdzhvrphsurjudpplqjlqsbwkrq',
Caesar().encode('itisawesomeprogramminginpython'))
def test_caesar_encode2(self):
... | 36.68 | 79 | 0.665576 |
1a66c9154578a5a744b7125a6a8761e89fda10d0 | 1,153 | py | Python | supriya/commands/BufferCloseRequest.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | supriya/commands/BufferCloseRequest.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | supriya/commands/BufferCloseRequest.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | import supriya.osc
from supriya.commands.Request import Request
from supriya.enums import RequestId
class BufferCloseRequest(Request):
"""
A /b_close request.
::
>>> import supriya.commands
>>> request = supriya.commands.BufferCloseRequest(
... buffer_id=23,
... )... | 20.963636 | 63 | 0.593235 |
1a66f27bb9f5bdee213255432265bc6d982d1591 | 1,160 | py | Python | config.py | js-mit/liquidmovies | 3e5f82e2e20bf532e055715e58c3361a4f4c487b | [
"MIT"
] | null | null | null | config.py | js-mit/liquidmovies | 3e5f82e2e20bf532e055715e58c3361a4f4c487b | [
"MIT"
] | 2 | 2022-01-11T23:41:25.000Z | 2022-02-01T02:25:02.000Z | config.py | js-mit/liquidmovies | 3e5f82e2e20bf532e055715e58c3361a4f4c487b | [
"MIT"
] | null | null | null | """Flask configuration."""
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, ".env"))
class Config:
SECRET_KEY = os.environ.get("SECRET_KEY")
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
AWS_SECRET_ACCESS_KEY = os.... | 29 | 87 | 0.726724 |
1a67237c44054d04d9d52fd0031b79936f575f49 | 11,627 | py | Python | tests/validation/tests/v3_api/test_create_ha.py | sharkymcdongles/rancher | e7e059a51776a592d7f7e641db5918aa962d5c1f | [
"Apache-2.0"
] | 1 | 2020-04-10T01:18:28.000Z | 2020-04-10T01:18:28.000Z | tests/validation/tests/v3_api/test_create_ha.py | sharkymcdongles/rancher | e7e059a51776a592d7f7e641db5918aa962d5c1f | [
"Apache-2.0"
] | null | null | null | tests/validation/tests/v3_api/test_create_ha.py | sharkymcdongles/rancher | e7e059a51776a592d7f7e641db5918aa962d5c1f | [
"Apache-2.0"
] | null | null | null | import base64
import os
import pytest
import rancher
import time
from .common import create_config_file
from .common import create_user
from .common import random_test_name
from .common import readDataFile
from .common import run_command_with_stderr
from .common import set_url_password_token
from lib.aws import Amazo... | 40.231834 | 142 | 0.685904 |
1a6737d12e1a237731f1a7cef797371cdb1a520c | 2,489 | py | Python | switch_model/hawaii/unserved_load.py | ashutosh-pande/switch3 | 769d25a42c8323f24740567aa15c980f905a03e2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | switch_model/hawaii/unserved_load.py | ashutosh-pande/switch3 | 769d25a42c8323f24740567aa15c980f905a03e2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | switch_model/hawaii/unserved_load.py | ashutosh-pande/switch3 | 769d25a42c8323f24740567aa15c980f905a03e2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """Add an UnservedLoad component, which ensures the model is always feasible.
This is often useful when the model is constrained to the edge of infeasibility,
(e.g., when evaluating a pre-defined, just-feasible construction plan) to avoid
spurious reports of infeasibility."""
from pyomo.environ import *
def define_arg... | 51.854167 | 140 | 0.738449 |
1a673a81a0913999b68ce04421331151db1bfeab | 550 | py | Python | tests/__init__.py | Privex/python-coinhandlers | b24c0c3f7d81cedefd52a5837a371cfef2f83e97 | [
"X11"
] | 2 | 2019-10-25T13:58:10.000Z | 2020-02-13T16:34:05.000Z | tests/__init__.py | Privex/python-coinhandlers | b24c0c3f7d81cedefd52a5837a371cfef2f83e97 | [
"X11"
] | null | null | null | tests/__init__.py | Privex/python-coinhandlers | b24c0c3f7d81cedefd52a5837a371cfef2f83e97 | [
"X11"
] | null | null | null | import logging
import unittest
from privex.loghelper import LogHelper
from privex.helpers import env_bool
from privex.rpcemulator.base import Emulator
from tests.test_bitcoin import *
from tests.test_main import *
if env_bool('DEBUG', False) is True:
LogHelper('privex.coin_handlers', level=logging.DEBUG).add_cons... | 30.555556 | 98 | 0.781818 |
1a674514871cd0d141f55a5ab4cfe6b38974fc22 | 9,008 | py | Python | ibllib/qc/task_extractors.py | int-brain-lab/ibllib | 93be6b98848758e05cdc9398caaf19e6a68f7386 | [
"MIT"
] | 38 | 2018-08-07T21:55:29.000Z | 2022-03-21T14:49:03.000Z | ibllib/qc/task_extractors.py | int-brain-lab/ibllib | 93be6b98848758e05cdc9398caaf19e6a68f7386 | [
"MIT"
] | 207 | 2018-07-25T15:10:48.000Z | 2022-03-08T13:23:08.000Z | ibllib/qc/task_extractors.py | int-brain-lab/ibllib | 93be6b98848758e05cdc9398caaf19e6a68f7386 | [
"MIT"
] | 35 | 2018-09-04T14:49:56.000Z | 2022-01-06T21:17:51.000Z | import logging
import numpy as np
from scipy.interpolate import interp1d
from ibllib.io.extractors import bpod_trials
from ibllib.io.extractors.base import get_session_extractor_type
from ibllib.io.extractors.training_wheel import get_wheel_position
from ibllib.io.extractors import ephys_fpga
import ibllib.io.raw_dat... | 46.43299 | 97 | 0.609791 |
1a675bc6861b1cf8f04886a7a9e23ce4c1a4045c | 5,607 | py | Python | alphastarmini/core/arch/core.py | liuruoze/mini-AlphaStar | cf9de2507d526a5fb8ef67676aab2ffb92738640 | [
"Apache-2.0"
] | 108 | 2021-02-10T13:24:56.000Z | 2022-03-21T09:58:28.000Z | alphastarmini/core/arch/core.py | liuruoze/mini-AlphaStar | cf9de2507d526a5fb8ef67676aab2ffb92738640 | [
"Apache-2.0"
] | 21 | 2021-04-09T18:46:05.000Z | 2022-03-29T02:44:15.000Z | alphastarmini/core/arch/core.py | liuruoze/mini-AlphaStar | cf9de2507d526a5fb8ef67676aab2ffb92738640 | [
"Apache-2.0"
] | 19 | 2021-08-03T01:49:02.000Z | 2022-03-30T10:21:13.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
" Core."
import torch
import torch.nn as nn
import torch.nn.functional as F
from alphastarmini.lib.hyper_parameters import Arch_Hyper_Parameters as AHP
__author__ = "Ruo-Ze Liu"
debug = False
class Core(nn.Module):
'''
Inputs: prev_state, em... | 41.533333 | 112 | 0.652042 |
1a677a0cb37e50738239d1885344c837644d9bfb | 1,100 | py | Python | DailyCodingProblem/149_GoldmanSachs_Sum_Sublist.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | 5 | 2019-09-07T17:31:17.000Z | 2022-03-05T09:59:46.000Z | DailyCodingProblem/149_GoldmanSachs_Sum_Sublist.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | null | null | null | DailyCodingProblem/149_GoldmanSachs_Sum_Sublist.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | 2 | 2019-09-07T17:31:24.000Z | 2019-10-28T16:10:52.000Z | """
This problem was asked by Goldman Sachs.
Given a list of numbers L, implement a method sum(i, j) which returns the sum from the sublist L[i:j]
(including i, excluding j).
For example, given L = [1, 2, 3, 4, 5], sum(1, 3) should return sum([2, 3]), which is 5.
You can assume that you can do some pre-processing. s... | 23.404255 | 107 | 0.575455 |
1a678e887dfb74ac9c1aa414a0d8812d89c88225 | 3,261 | py | Python | theseus/utilities/analysis/analyzer.py | kaylode/shrec22-pothole | 700d1632de686214e42a2f56aeaceab30c8b9a3f | [
"MIT"
] | 1 | 2022-03-19T11:52:53.000Z | 2022-03-19T11:52:53.000Z | theseus/utilities/analysis/analyzer.py | kaylode/shrec22-pothole | 700d1632de686214e42a2f56aeaceab30c8b9a3f | [
"MIT"
] | null | null | null | theseus/utilities/analysis/analyzer.py | kaylode/shrec22-pothole | 700d1632de686214e42a2f56aeaceab30c8b9a3f | [
"MIT"
] | 1 | 2022-03-19T11:53:10.000Z | 2022-03-19T11:53:10.000Z | import pandas as pd
import seaborn as sns
from tqdm import tqdm
import matplotlib.pyplot as plt
import numpy as np
class Analyzer:
def __init__(self):
self.instance_dict = {}
self.sample_dict = {}
self.init_dict()
def init_dict(self):
raise NotImplementedError
def update_i... | 29.378378 | 80 | 0.590616 |
1a67a758ac352456a80ca050fc3d9528602cd0c7 | 260 | py | Python | tolqc-api/app/main/swagger/role.py | sanger-tol/tolqc | 6ef535a0eb0028c5d9270ff18d95d38c6656cbdd | [
"MIT"
] | null | null | null | tolqc-api/app/main/swagger/role.py | sanger-tol/tolqc | 6ef535a0eb0028c5d9270ff18d95d38c6656cbdd | [
"MIT"
] | null | null | null | tolqc-api/app/main/swagger/role.py | sanger-tol/tolqc | 6ef535a0eb0028c5d9270ff18d95d38c6656cbdd | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2021 Genome Research Ltd.
#
# SPDX-License-Identifier: MIT
from main.schema import RoleSchema
from .base import BaseSwagger, setup_swagger
@setup_swagger
class RoleSwagger(BaseSwagger):
class Meta:
schema = RoleSchema
| 18.571429 | 51 | 0.765385 |
1a67b2b361d235080853103eb4404d0b7b044696 | 2,008 | py | Python | web/app/core/migrations/0002_auto_20200704_0956.py | n1kko777/moneycontrol-app-api | 8db7a999747c3eaed7157abc836af603a5638c0f | [
"MIT"
] | null | null | null | web/app/core/migrations/0002_auto_20200704_0956.py | n1kko777/moneycontrol-app-api | 8db7a999747c3eaed7157abc836af603a5638c0f | [
"MIT"
] | 1 | 2020-08-13T19:19:58.000Z | 2020-08-13T19:19:58.000Z | web/app/core/migrations/0002_auto_20200704_0956.py | n1kko777/moneycontrol-app-api | 8db7a999747c3eaed7157abc836af603a5638c0f | [
"MIT"
] | null | null | null | # Generated by Django 2.2.12 on 2020-07-04 04:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('core', '0001_initial'),
migrations.swappable_dependency(settin... | 34.033898 | 128 | 0.605578 |
1a67c9fac43fdd864fe982da2835848b8a5e675f | 4,505 | py | Python | backend/utils/serializers.py | lybbn/django-vue3-lyadmin | df8ed48971eb3e3da977e1fd0467b1230b56afe4 | [
"MIT"
] | 1 | 2022-03-01T07:20:36.000Z | 2022-03-01T07:20:36.000Z | backend/utils/serializers.py | lybbn/django-vue3-lyadmin | df8ed48971eb3e3da977e1fd0467b1230b56afe4 | [
"MIT"
] | null | null | null | backend/utils/serializers.py | lybbn/django-vue3-lyadmin | df8ed48971eb3e3da977e1fd0467b1230b56afe4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@Remark: 自定义序列化器
"""
from rest_framework import serializers
from rest_framework.fields import empty
from rest_framework.request import Request
from rest_framework.serializers import ModelSerializer
from django.utils.functional import cached_property
from rest_framework.utils.serializer_help... | 35.753968 | 129 | 0.646837 |
1a67de7108176dbb38e2ee6b624dfcb94d65634f | 1,623 | py | Python | ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/package/scripts/status_params.py | wbear2/ambari | a1891193984da47015cd5483b5b95e040677d7df | [
"Apache-2.0"
] | 5 | 2018-06-03T05:19:40.000Z | 2021-04-16T17:10:49.000Z | ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/package/scripts/status_params.py | wbear2/ambari | a1891193984da47015cd5483b5b95e040677d7df | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/package/scripts/status_params.py | wbear2/ambari | a1891193984da47015cd5483b5b95e040677d7df | [
"Apache-2.0"
] | 6 | 2019-05-07T13:24:39.000Z | 2021-02-15T14:12:37.000Z | #!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... | 46.371429 | 97 | 0.794208 |
1a67ec50aad9ab1d4bede109aa7c54682303bce6 | 3,850 | py | Python | swagger_client/models/execution.py | radon-h2020/radon-ctt-cli | 3120b748c73e99d81d0cac5037e393229577d640 | [
"Apache-2.0"
] | null | null | null | swagger_client/models/execution.py | radon-h2020/radon-ctt-cli | 3120b748c73e99d81d0cac5037e393229577d640 | [
"Apache-2.0"
] | null | null | null | swagger_client/models/execution.py | radon-h2020/radon-ctt-cli | 3120b748c73e99d81d0cac5037e393229577d640 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
RADON CTT Server API
This is API of the RADON Continuous Testing Tool (CTT) Server: <a href=\"https://github.com/radon-h2020/radon-ctt\">https://github.com/radon-h2020/radon-ctt<a/> # noqa: E501
OpenAPI spec version: 1.0.0-oas3
Generated by: https://github.com/swagger-api/sw... | 28.10219 | 178 | 0.564416 |
1a682b248689594653785db1d130b050639202fd | 818 | py | Python | tests/test_stripe_model.py | trag-stripe/dj-stripe | 31fac752ab6540a917a554907d799e41ac3eba9c | [
"MIT"
] | null | null | null | tests/test_stripe_model.py | trag-stripe/dj-stripe | 31fac752ab6540a917a554907d799e41ac3eba9c | [
"MIT"
] | null | null | null | tests/test_stripe_model.py | trag-stripe/dj-stripe | 31fac752ab6540a917a554907d799e41ac3eba9c | [
"MIT"
] | null | null | null | """
dj-stripe StripeModel Model Tests.
"""
from django.test import TestCase
from djstripe.models import Customer, StripeModel
class StripeModelExceptionsTest(TestCase):
def test_no_object_value(self):
# Instantiate a stripeobject model class
class BasicModel(StripeModel):
pass
... | 30.296296 | 86 | 0.641809 |
1a68439241cc314a9097caaf670df09d48b2531a | 439 | py | Python | stla_lite/users/migrations/0009_auto_20171004_0940.py | 401ode/stla-lite | 6355b477e729ba8c378285f08cc01410224341b7 | [
"MIT"
] | null | null | null | stla_lite/users/migrations/0009_auto_20171004_0940.py | 401ode/stla-lite | 6355b477e729ba8c378285f08cc01410224341b7 | [
"MIT"
] | 1 | 2017-10-04T18:34:26.000Z | 2017-10-04T18:34:26.000Z | stla_lite/users/migrations/0009_auto_20171004_0940.py | 401ode/stla-lite | 6355b477e729ba8c378285f08cc01410224341b7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-10-04 13:40
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0008_auto_20171003_1422'),
]
operations = [
migrations.RenameField(
... | 20.904762 | 48 | 0.615034 |
1a688a888b252b4e1650a9d34f666c2cf2b20e42 | 2,311 | py | Python | test/test_project_recipe_filter_list.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 2 | 2020-01-30T23:28:59.000Z | 2020-05-06T16:43:47.000Z | test/test_project_recipe_filter_list.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 1 | 2020-10-02T18:00:25.000Z | 2020-10-02T18:00:25.000Z | test/test_project_recipe_filter_list.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.22973 | 107 | 0.58373 |
1a6894c0bb81d8f0f1470eb973c97b6ea290b184 | 6,288 | py | Python | src/pyxer/recaptcha/__init__.py | tml/pyxer | 4e3677b3f2c7f23ebf039a9ba9733f68a8460189 | [
"MIT"
] | 2 | 2016-01-25T06:01:14.000Z | 2016-02-07T20:30:25.000Z | src/pyxer/recaptcha/__init__.py | tml/pyxer | 4e3677b3f2c7f23ebf039a9ba9733f68a8460189 | [
"MIT"
] | 2 | 2018-03-21T06:27:50.000Z | 2018-03-22T12:57:58.000Z | src/pyxer/recaptcha/__init__.py | tml/pyxer | 4e3677b3f2c7f23ebf039a9ba9733f68a8460189 | [
"MIT"
] | null | null | null | from pyxer.base import *
if GAE:
import urllib
from google.appengine.api import urlfetch
else:
import urllib2, urllib
"""
Adapted from http://pypi.python.org/pypi/recaptcha-client
to use with Google App Engine
by Joscha Feth <joscha@feth.com>
Version 0.1
"""
API_SSL_SERVER ="https://api-... | 32.75 | 125 | 0.650445 |
1a689a16ef8db5864196b6f8ac5c044baa4b09d1 | 212 | py | Python | Python/test_algos.py | Suraj-Rajesh/code | 3d554c4d1d5cf4bd9d084b8034641c1f6c2a47c9 | [
"MIT"
] | null | null | null | Python/test_algos.py | Suraj-Rajesh/code | 3d554c4d1d5cf4bd9d084b8034641c1f6c2a47c9 | [
"MIT"
] | null | null | null | Python/test_algos.py | Suraj-Rajesh/code | 3d554c4d1d5cf4bd9d084b8034641c1f6c2a47c9 | [
"MIT"
] | null | null | null | from sort_algos import bubble_sort
def test_bubble_sort():
assert([1, 2, 3, 4, 5] == bubble_sort([4, 3, 5, 1, 2]))
def test_bubble_sort_sorted():
assert([1, 2, 3, 4, 5] == bubble_sort([1, 2, 3, 4, 5]))
| 26.5 | 59 | 0.613208 |
1a68a0cd50788cfef80ed2a8f251da4e479760c7 | 1,782 | py | Python | chess/controller.py | trewjames/tdd-chess | 7aa5c1942627cc93886ffede8e84b65726e44946 | [
"MIT"
] | null | null | null | chess/controller.py | trewjames/tdd-chess | 7aa5c1942627cc93886ffede8e84b65726e44946 | [
"MIT"
] | 3 | 2020-08-19T18:07:16.000Z | 2020-08-24T20:57:13.000Z | chess/controller.py | trewjames/tdd-chess | 7aa5c1942627cc93886ffede8e84b65726e44946 | [
"MIT"
] | null | null | null | """ Controller module (adapter for UIs) """
from chess import engine
from chess.pieces import *
from chess.constants import *
class Select:
""" Select piece, shows suggestions and prepares piece for move """
def __init__(self):
self.pos_1 = None
self.moves = []
def make_selection(self, s... | 26.597015 | 77 | 0.589787 |
1a68a85919956aa08afc69ddb2651083cf84eecb | 1,370 | py | Python | Homepage/urls.py | zouyapeng/Homepage | 6e2b13ef2003fda5a74840b6627e7e0cb0f0c08c | [
"Apache-2.0"
] | null | null | null | Homepage/urls.py | zouyapeng/Homepage | 6e2b13ef2003fda5a74840b6627e7e0cb0f0c08c | [
"Apache-2.0"
] | null | null | null | Homepage/urls.py | zouyapeng/Homepage | 6e2b13ef2003fda5a74840b6627e7e0cb0f0c08c | [
"Apache-2.0"
] | null | null | null | """Homepage URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | 41.515152 | 99 | 0.721898 |
1a68c0a92f0e03f5b5c22e1b16bdedcf05ec12fd | 7,663 | py | Python | sdk/identity/azure-identity/tests/test_auth_code_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/identity/azure-identity/tests/test_auth_code_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/identity/azure-identity/tests/test_auth_code_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from unittest.mock import Mock, patch
from urllib.parse import urlparse
from azure.core.exceptions import ClientAuthenticationError
from azure.core.pipeline.policies im... | 35.64186 | 112 | 0.684197 |
1a68e082a04ca75a33c1cd42268b30d58443de8a | 4,871 | py | Python | code/user_settings.py | seanyeh/talon_configs | 142e402bb18f532d6f65c622174a6bbbf99aad91 | [
"Unlicense"
] | null | null | null | code/user_settings.py | seanyeh/talon_configs | 142e402bb18f532d6f65c622174a6bbbf99aad91 | [
"Unlicense"
] | null | null | null | code/user_settings.py | seanyeh/talon_configs | 142e402bb18f532d6f65c622174a6bbbf99aad91 | [
"Unlicense"
] | null | null | null | from talon import Module, fs, Context
import os
import csv
from pathlib import Path
from typing import Dict, List, Tuple
import threading
# NOTE: This method requires this module to be one folder below the top-level
# knausj folder.
SETTINGS_DIR = Path(__file__).parents[1] / "settings"
PRIVATE_SETTINGS_DIR = Path(_... | 31.836601 | 84 | 0.626976 |
1a68eee93d71f4fd1913bb399851c26d7a581f59 | 1,698 | py | Python | python/odml/WIP/validation.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/WIP/validation.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/WIP/validation.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | import odml
def print_val(rank, curr):
# Cleanup the odml object print strings
print_str = str(curr).split()[0].split("[")[0].split(":")[0]
# Document has no name attribute and should not print id or name info
if hasattr(curr, "name"):
if curr.name and curr.name != curr.id:
print_s... | 26.952381 | 87 | 0.634276 |
1a69233b266f6dae304641a611fa4ed69df7368e | 27,271 | py | Python | ufora/FORA/python/PurePython/ClassTestCases.py | ufora/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 571 | 2015-11-05T20:07:07.000Z | 2022-01-24T22:31:09.000Z | ufora/FORA/python/PurePython/ClassTestCases.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 218 | 2015-11-05T20:37:55.000Z | 2021-05-30T03:53:50.000Z | ufora/FORA/python/PurePython/ClassTestCases.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 40 | 2015-11-07T21:42:19.000Z | 2021-05-23T03:48:19.000Z | # Copyright 2015 Ufora Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 25.391993 | 98 | 0.522423 |
1a693821f0e164bb7f32c25d697e52972be210ee | 1,701 | py | Python | examples/tf_profiler_test.py | jamesj-jiao/aim | 452380368f76ff441b2ff3a51029f4ad43a9d902 | [
"MIT"
] | null | null | null | examples/tf_profiler_test.py | jamesj-jiao/aim | 452380368f76ff441b2ff3a51029f4ad43a9d902 | [
"MIT"
] | null | null | null | examples/tf_profiler_test.py | jamesj-jiao/aim | 452380368f76ff441b2ff3a51029f4ad43a9d902 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
from examples.tf_profiler_model import neural_net
tf.reset_default_graph()
learning_rate = 0.1
num_steps = 500
batch_size = 128
display_step = 100
# Network Parameters
n_... | 30.927273 | 67 | 0.675485 |
1a698426301398601a99da9cdba6171a3b2d0c36 | 252 | py | Python | catalyst/dl/utils/__init__.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/dl/utils/__init__.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/dl/utils/__init__.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | 1 | 2018-12-21T15:56:21.000Z | 2018-12-21T15:56:21.000Z | # flake8: noqa
from catalyst.contrib.utils import *
from catalyst.core.utils import *
from catalyst.utils import *
from .torch import get_loader
from .trace import get_trace_name, load_traced_model, trace_model
from .wizard import run_wizard, Wizard
| 25.2 | 65 | 0.809524 |
1a69b5764821d79cd9a78a08794b318dc2747c60 | 381 | py | Python | tests/test_exception_handling/test_dump_frames_on.py | piotrmaslanka/satella | bf4ba7a21ad2ac93a366442a2b4574dc5568b87e | [
"MIT"
] | 12 | 2019-12-13T10:17:38.000Z | 2022-01-05T09:01:36.000Z | tests/test_exception_handling/test_dump_frames_on.py | piotrmaslanka/satella | bf4ba7a21ad2ac93a366442a2b4574dc5568b87e | [
"MIT"
] | 26 | 2016-04-01T11:55:26.000Z | 2021-12-30T17:03:59.000Z | tests/test_exception_handling/test_dump_frames_on.py | piotrmaslanka/satella | bf4ba7a21ad2ac93a366442a2b4574dc5568b87e | [
"MIT"
] | 1 | 2021-05-31T08:45:22.000Z | 2021-05-31T08:45:22.000Z | import io
import logging
import unittest
from satella.instrumentation.dump_frames_on import dump_frames_on
logger = logging.getLogger(__name__)
class TestDumpFramesOn(unittest.TestCase):
def test_dump_frames_on(self):
io_out = io.StringIO()
dump_frames_on(0, None, io_out)
data = io_out.g... | 23.8125 | 65 | 0.740157 |
1a69c123f39c58afc253d1def29fc7c6b09c758b | 6,408 | py | Python | python/hostconfig/machines/arcus.py | AvciRecep/chaste_2019 | 1d46cdac647820d5c5030f8a9ea3a1019f6651c1 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-04-05T12:11:54.000Z | 2020-04-05T12:11:54.000Z | python/hostconfig/machines/arcus.py | AvciRecep/chaste_2019 | 1d46cdac647820d5c5030f8a9ea3a1019f6651c1 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | python/hostconfig/machines/arcus.py | AvciRecep/chaste_2019 | 1d46cdac647820d5c5030f8a9ea3a1019f6651c1 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2020-04-05T14:26:13.000Z | 2021-03-09T08:18:17.000Z | # Configuration for arcus.arc.ox.ac.uk
"""Copyright (c) 2005-2019, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribu... | 45.771429 | 229 | 0.691011 |
1a69cc21af683770af144e887fe0076f009ecdc5 | 1,848 | py | Python | seamo/support/query_dynamodb.py | amandalynne/Seattle-Mobility-Index | f21d2fa6913ce9474aedc298e9e4a6e7c9390e64 | [
"MIT"
] | 3 | 2018-08-20T18:34:03.000Z | 2018-10-02T23:41:52.000Z | seamo/support/query_dynamodb.py | amandalynne/Seattle-Mobility-Index | f21d2fa6913ce9474aedc298e9e4a6e7c9390e64 | [
"MIT"
] | null | null | null | seamo/support/query_dynamodb.py | amandalynne/Seattle-Mobility-Index | f21d2fa6913ce9474aedc298e9e4a6e7c9390e64 | [
"MIT"
] | 1 | 2018-10-02T23:42:24.000Z | 2018-10-02T23:42:24.000Z | # coding: utf-8
# In[3]:
import json
import os
import os.path
import boto3
import decimal
from pandas.io.json import json_normalize
import constants as cn
# In[4]:
# Helper class to convert a DynamoDB item to JSON.
class DecimalEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, decimal... | 25.666667 | 147 | 0.632035 |
1a69d9f1239dd2658b7b99e946f03ab07fe18bc3 | 1,111 | py | Python | print_results.py | jzhao004/UniTrack | e7a12721a6edac056ec54a781d522227347fdc08 | [
"MIT"
] | null | null | null | print_results.py | jzhao004/UniTrack | e7a12721a6edac056ec54a781d522227347fdc08 | [
"MIT"
] | null | null | null | print_results.py | jzhao004/UniTrack | e7a12721a6edac056ec54a781d522227347fdc08 | [
"MIT"
] | null | null | null | import os
weights = [
'weights/1650524901-epoch30.pth.tar',
'weights/1650524906-epoch29.pth.tar',
'weights/1650268119-epoch29.pth.tar',
]
results = 'results/mot'
#postfix = ['_encoder_rm_last', '_encoder', '_encoder_dec_last_stride', '_encoder_agg', '_encoder... | 37.033333 | 135 | 0.567057 |
1a69f5c32735e9e7b4e324a230a9c43da69b7c4a | 25,100 | py | Python | galpy/potential/SpiralArmsPotential.py | turnergarrow/galpy | 7132eddbf2dab491fe137790e31eacdc604b0534 | [
"BSD-3-Clause"
] | null | null | null | galpy/potential/SpiralArmsPotential.py | turnergarrow/galpy | 7132eddbf2dab491fe137790e31eacdc604b0534 | [
"BSD-3-Clause"
] | null | null | null | galpy/potential/SpiralArmsPotential.py | turnergarrow/galpy | 7132eddbf2dab491fe137790e31eacdc604b0534 | [
"BSD-3-Clause"
] | null | null | null | ###############################################################################
# SpiralArmsPotential.py: class that implements the spiral arms potential
# from Cox and Gomez (2002)
#
# https://arxiv.org/abs/astro-ph/0207635
#
# Phi(r, phi, z) = -4*pi*G*H*rho0*exp(-(r-r0)/Rs)*sum(Cn/(Kn*Dn)... | 43.652174 | 299 | 0.472908 |
1a69f898561b3703af516f3797926676b4e41f6d | 1,618 | py | Python | examples/2D/flight_conditions/pdf_airfoils.py | leal26/pyXFOIL | 88ff224be25cdb51eb821315f6e094f68fb13247 | [
"MIT"
] | 50 | 2016-03-15T17:24:55.000Z | 2021-12-28T07:32:45.000Z | examples/2D/flight_conditions/pdf_airfoils.py | SzymonSzyszko/AeroPy | b061c690e5926fdd834b7c50837c25108e908156 | [
"MIT"
] | 22 | 2017-04-20T11:27:28.000Z | 2022-02-09T05:57:06.000Z | examples/2D/flight_conditions/pdf_airfoils.py | SzymonSzyszko/AeroPy | b061c690e5926fdd834b7c50837c25108e908156 | [
"MIT"
] | 34 | 2016-03-04T15:57:37.000Z | 2022-02-15T20:06:54.000Z | import pickle
import scipy.io
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import simps
from weather.scraper.flight_conditions import properties, Airframe
# Define object
fuel = 56*6.01*0.4535
initial_mass = 1111
final_mass = initial_mass-fuel
C172_props = properties({'Cl_alpha': 5.143, 'Cl... | 28.385965 | 84 | 0.642769 |
1a6a091631368e88667d6180e40ab0f38000c71b | 747 | py | Python | pni_customization/pni_customization/doctype/workstation_price_update_tool/workstation_price_update_tool.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | pni_customization/pni_customization/doctype/workstation_price_update_tool/workstation_price_update_tool.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | pni_customization/pni_customization/doctype/workstation_price_update_tool/workstation_price_update_tool.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Jigar Tarpara and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class WorkstationPriceUpdateTool(Document):
def get_workstation_list(self):
filter = {}
i... | 28.730769 | 66 | 0.746988 |
1a6a18b0bb34abf576ced8d99f753f8965d598b2 | 23,028 | py | Python | bench/stock.py | mlcgp/bench | c2f2fb31db4c76f98037e3e3e5be952547c00141 | [
"MIT"
] | null | null | null | bench/stock.py | mlcgp/bench | c2f2fb31db4c76f98037e3e3e5be952547c00141 | [
"MIT"
] | null | null | null | bench/stock.py | mlcgp/bench | c2f2fb31db4c76f98037e3e3e5be952547c00141 | [
"MIT"
] | null | null | null | import requests
import json
import numpy as np
import pandas as pd
from requests import Session
from requests_futures.sessions import FuturesSession
from concurrent.futures import ThreadPoolExecutor
from datetime import date
class Stock:
def __init__(self, token, version, ticker, period, num_periods):
"""... | 33.814978 | 138 | 0.495657 |
1a6a668ed76c08436084163aa41365159cb84bb6 | 3,150 | py | Python | rally/plugins/common/sla/max_average_duration_per_atomic.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | 263 | 2015-04-26T16:05:34.000Z | 2022-02-28T11:17:07.000Z | rally/plugins/common/sla/max_average_duration_per_atomic.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | 19 | 2015-04-23T11:53:10.000Z | 2019-02-20T11:23:09.000Z | rally/plugins/common/sla/max_average_duration_per_atomic.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | 287 | 2015-04-23T11:28:03.000Z | 2021-09-16T13:05:53.000Z | # Copyright 2016: Mirantis 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 b... | 42.567568 | 79 | 0.639365 |
1a6a6c7ad54ec9babd8c5e8f81ab753bcea49704 | 1,123 | py | Python | eth/vm/forks/frontier/validation.py | jin10086/py-evm | da04e8de42fdbf3bc5ca596f5f6b3d810c1afea8 | [
"MIT"
] | 5 | 2018-09-28T20:01:42.000Z | 2022-02-22T19:54:46.000Z | eth/vm/forks/frontier/validation.py | jin10086/py-evm | da04e8de42fdbf3bc5ca596f5f6b3d810c1afea8 | [
"MIT"
] | null | null | null | eth/vm/forks/frontier/validation.py | jin10086/py-evm | da04e8de42fdbf3bc5ca596f5f6b3d810c1afea8 | [
"MIT"
] | 1 | 2019-01-29T21:09:31.000Z | 2019-01-29T21:09:31.000Z | from eth_utils import (
ValidationError,
)
def validate_frontier_transaction(account_db, transaction):
gas_cost = transaction.gas * transaction.gas_price
sender_balance = account_db.get_balance(transaction.sender)
if sender_balance < gas_cost:
raise ValidationError(
"Sender accoun... | 34.030303 | 100 | 0.690116 |
1a6abd0e9bf3b921383231830c36a9c60ec8d117 | 18,315 | py | Python | xblock/test/test_mixins.py | cclauss/XBlock | 3e5341015e8f8b4a203ac4a41471bac5549182b0 | [
"Apache-2.0"
] | null | null | null | xblock/test/test_mixins.py | cclauss/XBlock | 3e5341015e8f8b4a203ac4a41471bac5549182b0 | [
"Apache-2.0"
] | null | null | null | xblock/test/test_mixins.py | cclauss/XBlock | 3e5341015e8f8b4a203ac4a41471bac5549182b0 | [
"Apache-2.0"
] | null | null | null | """
Tests of the XBlock-family functionality mixins
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from datetime import datetime
from unittest import TestCase
import ddt as ddt
from lxml import etree
import mock
import pytz
import six
from xblock.core import XBlock, XBlockAsi... | 38.476891 | 116 | 0.653672 |
1a6abd2318ca2b7b8728dba0052ed065ad92e8c0 | 575 | py | Python | Code/08/ds_using_list.py | nolongerwait/Python_Tutorial | 3961d6ee9c371fa7666a26b7a114e276170724dd | [
"MIT"
] | null | null | null | Code/08/ds_using_list.py | nolongerwait/Python_Tutorial | 3961d6ee9c371fa7666a26b7a114e276170724dd | [
"MIT"
] | null | null | null | Code/08/ds_using_list.py | nolongerwait/Python_Tutorial | 3961d6ee9c371fa7666a26b7a114e276170724dd | [
"MIT"
] | null | null | null | # This is one shopping list
shoplist = ['apple', 'mango', 'carrot', 'banana']
print('I have', len(shoplist), 'items to purchase.')
print('These items are:', end=' ')
for item in shoplist:
print(item, end=' ')
print('\nI also have to buy rice.')
shoplist.append('rice')
print('My shopping list is now', shoplist)
... | 26.136364 | 52 | 0.690435 |
1a6ad2a5d22140479d186ac82b1ae11d58903d9b | 1,899 | py | Python | sanity/twitter.py | TIBHannover/arxiv_preserver | aefdacaa9d1c4c13b51e1812e6218c0025ab0a11 | [
"MIT"
] | null | null | null | sanity/twitter.py | TIBHannover/arxiv_preserver | aefdacaa9d1c4c13b51e1812e6218c0025ab0a11 | [
"MIT"
] | null | null | null | sanity/twitter.py | TIBHannover/arxiv_preserver | aefdacaa9d1c4c13b51e1812e6218c0025ab0a11 | [
"MIT"
] | null | null | null | #django imports
from django.shortcuts import render
from django.template.loader import render_to_string
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse, Http404
from django.template import loader, RequestContext
from django.contrib import auth
from django.core.paginator import Paginator, Empty... | 30.629032 | 110 | 0.687204 |
1a6adcfbd0639ecdb6c5ba5fb39f3ced9688d4d0 | 2,208 | py | Python | rllib/agent/model_based/bptt_agent.py | SamueleMeta/optimal_IS | 7d8e0041825acfa003874cd1ad2aec0581f6a9e1 | [
"MIT"
] | null | null | null | rllib/agent/model_based/bptt_agent.py | SamueleMeta/optimal_IS | 7d8e0041825acfa003874cd1ad2aec0581f6a9e1 | [
"MIT"
] | null | null | null | rllib/agent/model_based/bptt_agent.py | SamueleMeta/optimal_IS | 7d8e0041825acfa003874cd1ad2aec0581f6a9e1 | [
"MIT"
] | null | null | null | """Model-Based BPTT Agent."""
from itertools import chain
import torch.nn.modules.loss as loss
from torch.optim import Adam
from rllib.algorithms.bptt import BPTT
from rllib.policy import NNPolicy
from rllib.value_function import NNEnsembleQFunction
from .model_based_agent import ModelBasedAgent
class BPTTAgent(Mo... | 28.307692 | 86 | 0.583786 |
1a6ae508b501d4bd94c085511137146b93283589 | 3,168 | py | Python | experiments/vitchyr/nips2018/train_vae/generic.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | experiments/vitchyr/nips2018/train_vae/generic.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/vitchyr/nips2018/train_vae/generic.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z |
import rlkit.misc.hyperparameter as hyp
from rlkit.images.camera import (
sawyer_init_camera_zoomed_in,
sawyer_init_camera,
)
from rlkit.launchers.launcher_util import run_experiment
from rlkit.misc.ml_util import PiecewiseLinearSchedule
from rlkit.torch.vae.conv_vae import ConvVAE
from rlkit.torch.vae.vae_tra... | 32.659794 | 87 | 0.620265 |
1a6b03ba8e27953b51e47d89132f63ddef20c0eb | 194,749 | py | Python | impacket/smb.py | kanzure/impacket | 88c7536ca24bc8f47718764f76cc38cdc8cf1879 | [
"Apache-1.1"
] | null | null | null | impacket/smb.py | kanzure/impacket | 88c7536ca24bc8f47718764f76cc38cdc8cf1879 | [
"Apache-1.1"
] | null | null | null | impacket/smb.py | kanzure/impacket | 88c7536ca24bc8f47718764f76cc38cdc8cf1879 | [
"Apache-1.1"
] | 4 | 2015-02-25T20:08:18.000Z | 2021-07-06T12:31:29.000Z | # Copyright (c) 2003-2012 CORE Security Technologies)
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# $Id$
#
# Copyright (C) 2001 Michael Teo <michaelteo@bigfoot.com>
# smb.py - SMB/CIFS library
#
# Thi... | 43.862387 | 319 | 0.60752 |
1a6b1be0f9b1d9f6adc9578bb3a6ffaca102f6b5 | 24,936 | py | Python | NBA Project/venv/Lib/site-packages/plotly/graph_objs/histogram2d/colorbar/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 1 | 2020-08-08T21:56:11.000Z | 2020-08-08T21:56:11.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/histogram2d/colorbar/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 2 | 2021-03-31T19:54:17.000Z | 2021-06-02T02:33:56.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/histogram2d/colorbar/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
# font
# ----
@property
def font(self):
"""
Sets this color bar's title font. Note that the title's font
used to be set by the now depr... | 34.537396 | 82 | 0.565568 |
1a6b267ac15c63176834387732a36090d9c62d67 | 3,941 | py | Python | feincms3/templatetags/feincms3.py | fabiangermann/feincms3 | 568ffd1fa939071a4d6dfae0a70568d1522aaa9e | [
"BSD-3-Clause"
] | null | null | null | feincms3/templatetags/feincms3.py | fabiangermann/feincms3 | 568ffd1fa939071a4d6dfae0a70568d1522aaa9e | [
"BSD-3-Clause"
] | null | null | null | feincms3/templatetags/feincms3.py | fabiangermann/feincms3 | 568ffd1fa939071a4d6dfae0a70568d1522aaa9e | [
"BSD-3-Clause"
] | null | null | null | from django import template
from django.template.base import Node, TemplateSyntaxError, kwarg_re
from django.utils.html import conditional_escape
from feincms3 import apps
register = template.Library()
@register.simple_tag(takes_context=True)
def render_region(context, regions, region, **kwargs):
"""
Rende... | 31.277778 | 83 | 0.592997 |
1a6b29b950bc79939203a8726e71a06963422e3e | 4,017 | py | Python | KSFD/ksfdtsmaker.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | KSFD/ksfdtsmaker.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | KSFD/ksfdtsmaker.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | """Factory functions to make KSFD Teim steppers."""
import petsc4py
from mpi4py import MPI
from importlib import import_module
def ksfdTS(
derivs,
t0 = 0.0,
dt = 0.001,
tmax = 20,
maxsteps = 100,
rtol = 1e-5,
atol = 1e-5,
restart=True,
tstype=None,
finaltime=None,
rollback_f... | 27.703448 | 66 | 0.640777 |
1a6b44b90e8d4d4c3faf9f0ac596942a7ff3d09f | 1,605 | py | Python | tensorflow/python/training/server_lib_sparse_job_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 522 | 2016-06-08T02:15:50.000Z | 2022-03-02T05:30:36.000Z | tensorflow/python/training/server_lib_sparse_job_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/python/training/server_lib_sparse_job_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 108 | 2016-06-16T15:34:05.000Z | 2022-03-12T13:23:11.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.477273 | 80 | 0.723988 |
1a6b4b31567b9e5d2348a1ae987c6bfb7a9c665c | 1,667 | py | Python | lib/list_uavcan_dsdl.py | greck2908/robot-software | 2e1e8177148a089e8883967375dde7f8ed3d878b | [
"MIT"
] | 40 | 2016-10-04T19:59:22.000Z | 2020-12-25T18:11:35.000Z | lib/list_uavcan_dsdl.py | greck2908/robot-software | 2e1e8177148a089e8883967375dde7f8ed3d878b | [
"MIT"
] | 209 | 2016-09-21T21:54:28.000Z | 2022-01-26T07:42:37.000Z | lib/list_uavcan_dsdl.py | greck2908/robot-software | 2e1e8177148a089e8883967375dde7f8ed3d878b | [
"MIT"
] | 21 | 2016-11-07T14:40:16.000Z | 2021-11-02T09:53:37.000Z | #!/usr/bin/env python3
"""
Lists all the UAVCAN files in a format compatible with CMake (column separated
data).
It is intended to be handled as part of the build, not be used interactively.
"""
import argparse
import glob
import os.path
import re
def parse_args():
parser = argparse.ArgumentParser(description=_... | 25.257576 | 118 | 0.644871 |
1a6b54d3aff67731cc6bc7743c706f02454048af | 19,377 | py | Python | joulescope/view.py | tadodotcom/pyjoulescope | ab9645a2774cf5d5355dee4c1e60a566419b0e00 | [
"Apache-2.0"
] | 29 | 2018-12-19T22:42:09.000Z | 2022-01-31T12:26:52.000Z | joulescope/view.py | tadodotcom/pyjoulescope | ab9645a2774cf5d5355dee4c1e60a566419b0e00 | [
"Apache-2.0"
] | 23 | 2019-07-21T23:44:46.000Z | 2022-03-11T13:29:11.000Z | joulescope/view.py | tadodotcom/pyjoulescope | ab9645a2774cf5d5355dee4c1e60a566419b0e00 | [
"Apache-2.0"
] | 9 | 2019-07-22T00:07:53.000Z | 2021-11-26T11:46:19.000Z | # Copyright 2018-2019 Jetperch LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 39.544898 | 122 | 0.596842 |
1a6b6e161c046905920b095777359ab8e3b716cd | 3,015 | py | Python | medical/interpolate_transformer/position_encoding.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | 1 | 2018-06-18T12:09:33.000Z | 2018-06-18T12:09:33.000Z | medical/interpolate_transformer/position_encoding.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | null | null | null | medical/interpolate_transformer/position_encoding.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | 1 | 2018-06-18T12:13:21.000Z | 2018-06-18T12:13:21.000Z | # coding: utf-8
import math
import torch
from torch import nn
# from util.misc import NestedTensor
# class PositionEmbeddingSine(nn.Module):
# """
# This is a more standard version of the position embedding, very similar to the one
# used by the Attention is all you need paper, generalized to work on image... | 37.6875 | 105 | 0.585406 |
1a6b81359e4845f63ce7586511adb3c74070c593 | 3,722 | py | Python | var/spack/repos/builtin/packages/openjpeg/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/openjpeg/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/openjpeg/package.py | joequant/spack | e028ee0d5903045e1cdeb57550cbff61f2ffb2fa | [
"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)
from spack import *
class Openjpeg(CMakePackage):
"""OpenJPEG is an open-source JPEG 2000 codec written in C languag... | 47.113924 | 106 | 0.707953 |
1a6bbf1f0167f20e94c876d36892202bd961d5b5 | 332 | py | Python | foxtail/clinics/migrations/0018_remove_clinic_time_slots.py | scottbarnes/foxtail | b9faf95ad622d7aa967288698018202cc22b4893 | [
"MIT"
] | 5 | 2021-01-17T22:55:24.000Z | 2021-01-18T21:05:18.000Z | foxtail/clinics/migrations/0018_remove_clinic_time_slots.py | scottbarnes/foxtail | b9faf95ad622d7aa967288698018202cc22b4893 | [
"MIT"
] | null | null | null | foxtail/clinics/migrations/0018_remove_clinic_time_slots.py | scottbarnes/foxtail | b9faf95ad622d7aa967288698018202cc22b4893 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-05-10 16:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('clinics', '0017_auto_20200510_1553'),
]
operations = [
migrations.RemoveField(
model_name='clinic',
name='time_slots',
... | 18.444444 | 47 | 0.596386 |
1a6bfa1e4730c34513b5078df9f3333d5a85ad65 | 788 | py | Python | personal/clh137/CameronTests/login/forms.py | gentsk77/EECS341-Final | 6a050e1d2718996af2cb672af6b9ea41d0da04d4 | [
"MIT"
] | 1 | 2019-03-26T22:02:38.000Z | 2019-03-26T22:02:38.000Z | personal/clh137/CameronTests/login/forms.py | Susanou/FitHub | 6a050e1d2718996af2cb672af6b9ea41d0da04d4 | [
"MIT"
] | 4 | 2019-04-29T07:35:37.000Z | 2019-05-05T12:12:52.000Z | personal/clh137/CameronTests/login/forms.py | Susanou/FitHub | 6a050e1d2718996af2cb672af6b9ea41d0da04d4 | [
"MIT"
] | 2 | 2019-05-06T04:56:13.000Z | 2020-02-03T20:00:21.000Z | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.db import transaction
from django.forms.utils import ValidationError
from .models import User, Student
class TeacherSignUpForm(UserCreationForm):
class Meta(UserCreationForm.Meta):
model = User
def save(self... | 23.878788 | 54 | 0.672589 |
1a6c2348b00b16faa37d81749fd74cbbacacf14e | 980 | py | Python | src/main/python/programmingtheiot/cda/sim/TemperatureSensorSimTask.py | Nitinsd96/Air-Pollution-Monitoring-System | 4870223ce7b40b4ea465620a4c3d39cf617c6eff | [
"MIT"
] | null | null | null | src/main/python/programmingtheiot/cda/sim/TemperatureSensorSimTask.py | Nitinsd96/Air-Pollution-Monitoring-System | 4870223ce7b40b4ea465620a4c3d39cf617c6eff | [
"MIT"
] | null | null | null | src/main/python/programmingtheiot/cda/sim/TemperatureSensorSimTask.py | Nitinsd96/Air-Pollution-Monitoring-System | 4870223ce7b40b4ea465620a4c3d39cf617c6eff | [
"MIT"
] | null | null | null | #####
#
# This class is part of the Programming the Internet of Things project.
#
# It is provided as a simple shell to guide the student and assist with
# implementation for the Programming the Internet of Things exercises,
# and designed to be modified by the student as needed.
#
import logging
from programmingth... | 31.612903 | 201 | 0.8 |
1a6c516d9f296f7903c943f6c418661b2ab8d2d2 | 2,682 | py | Python | zhusuan/distributions/gamma.py | thuwzy/ZhuSuan-PyTorch | 471e4d401a6edce07312b01b2b76fa2c56b15c0f | [
"MIT"
] | 12 | 2021-08-11T10:28:21.000Z | 2022-03-12T14:20:02.000Z | zhusuan/distributions/gamma.py | thuwzy/ZhuSuan-PyTorch | 471e4d401a6edce07312b01b2b76fa2c56b15c0f | [
"MIT"
] | null | null | null | zhusuan/distributions/gamma.py | thuwzy/ZhuSuan-PyTorch | 471e4d401a6edce07312b01b2b76fa2c56b15c0f | [
"MIT"
] | 2 | 2021-08-17T12:05:15.000Z | 2022-01-12T09:47:49.000Z | import torch
from zhusuan.distributions import Distribution
class Gamma(Distribution):
"""
The class of univariate Gamma distribution
See :class:`~zhusuan.distributions.base.Distribution` for details.
:param alpha: A 'float' Var. Shape parameter of the Gamma distribution.
:param beta: A 'float' Va... | 40.636364 | 159 | 0.578673 |
1a6c61433436cd2e1b057d5b6878fa401e426967 | 751 | py | Python | cifar/utils/cifar_new.py | Meng-Lingjun-xjtu/ttt-plus-plus | 0f26c689fcaa666fa3524e7c5b6de0c1cb510e89 | [
"MIT"
] | 23 | 2021-11-21T10:50:49.000Z | 2022-03-14T09:34:10.000Z | cifar/utils/cifar_new.py | Meng-Lingjun-xjtu/ttt-plus-plus | 0f26c689fcaa666fa3524e7c5b6de0c1cb510e89 | [
"MIT"
] | 2 | 2022-01-06T01:19:24.000Z | 2022-03-03T15:39:23.000Z | cifar/utils/cifar_new.py | Meng-Lingjun-xjtu/ttt-plus-plus | 0f26c689fcaa666fa3524e7c5b6de0c1cb510e89 | [
"MIT"
] | 2 | 2021-12-14T22:34:55.000Z | 2022-01-23T10:49:14.000Z | import torch
import torch.utils.data as data
import numpy as np
from PIL import Image
class CIFAR_New(data.Dataset):
def __init__(self, root, transform=None, target_transform=None, version='v6'):
self.data = np.load('%s/cifar10.1_%s_data.npy' %(root, version))
self.targets = np.load('%s/cifar10.1_%s_labels.npy' %... | 32.652174 | 86 | 0.736352 |
1a6c6c0d034708c028518c64371668b439c5ff6a | 148 | py | Python | sunpy/tests/setup_package.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | sunpy/tests/setup_package.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | sunpy/tests/setup_package.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | def get_package_data():
return {
_ASTROPY_PACKAGE_NAME_ + '.tests': ['coveragerc', 'figure_hashes_py2.json', 'figure_hashes_py3.json']}
| 37 | 110 | 0.702703 |
1a6c774473a57ba44cf5df42c0c664e746c43753 | 476 | py | Python | Farmacia/apps/factura/admin.py | cluco91/Django_Farmacia | 10d787533bcebac8ba35cf8a7feb10ffb14ca45f | [
"MIT"
] | 2 | 2018-11-06T04:05:20.000Z | 2020-05-28T23:19:23.000Z | Farmacia/apps/factura/admin.py | cluco91/Django_Farmacia | 10d787533bcebac8ba35cf8a7feb10ffb14ca45f | [
"MIT"
] | null | null | null | Farmacia/apps/factura/admin.py | cluco91/Django_Farmacia | 10d787533bcebac8ba35cf8a7feb10ffb14ca45f | [
"MIT"
] | 2 | 2018-11-06T04:12:17.000Z | 2019-11-21T18:34:26.000Z | from django.contrib import admin
from .models import DetalleFactura, Factura
class DetalleFacturaInline(admin.TabularInline):
model = DetalleFactura
class FacturaAdmin(admin.ModelAdmin):
raw_id_fields = ('cliente',)
inlines = (DetalleFacturaInline,)
exclude = ['vendedor', ]
def save_model(sel... | 23.8 | 53 | 0.69958 |
1a6c8d3f66481efbd3a688ff258f23106a124229 | 267 | py | Python | pgmpy/factors/__init__.py | jaidevd/pgmpy | 0a7f371f4b39ded45e48d637fa1a44b4518162da | [
"MIT"
] | null | null | null | pgmpy/factors/__init__.py | jaidevd/pgmpy | 0a7f371f4b39ded45e48d637fa1a44b4518162da | [
"MIT"
] | null | null | null | pgmpy/factors/__init__.py | jaidevd/pgmpy | 0a7f371f4b39ded45e48d637fa1a44b4518162da | [
"MIT"
] | null | null | null | from .Factor import *
from .FactorSet import *
from .CPD import *
from .JointProbabilityDistribution import *
__all__ = ['Factor',
'TabularCPD',
'TreeCPD',
'RuleCPD'
'JointProbabilityDistribution',
'FactorSet']
| 22.25 | 43 | 0.599251 |
1a6c9f8e4d09a6c834b0afd48081d049823a6705 | 7,891 | py | Python | ivy_tests/test_core/test_linalg.py | ashok-arjun/ivy | 274c03f667cda10e09b75e90e7a3a46b358e0358 | [
"Apache-2.0"
] | null | null | null | ivy_tests/test_core/test_linalg.py | ashok-arjun/ivy | 274c03f667cda10e09b75e90e7a3a46b358e0358 | [
"Apache-2.0"
] | null | null | null | ivy_tests/test_core/test_linalg.py | ashok-arjun/ivy | 274c03f667cda10e09b75e90e7a3a46b358e0358 | [
"Apache-2.0"
] | null | null | null | """
Collection of tests for unified linear algebra functions
"""
# global
import pytest
import numpy as np
# local
import ivy
import ivy.backends.numpy
import ivy_tests.helpers as helpers
# svd
@pytest.mark.parametrize(
"x", [[[[1., 0.], [0., 1.]]], [[[[1., 0.], [0., 1.]]]]])
@pytest.mark.parametrize(
"dtyp... | 36.197248 | 108 | 0.587505 |
1a6cd83e769adbc20c09324ea1fd0e2ae4b3c467 | 6,830 | py | Python | cadnano/strandset/mergecmd.py | sherwoodyao/cadnano2.5 | ce6ff019b88ee7728de947bd86b35861cf57848d | [
"BSD-3-Clause"
] | 69 | 2015-01-13T02:54:40.000Z | 2022-03-27T14:25:51.000Z | cadnano/strandset/mergecmd.py | scholer/cadnano2.5 | ce6ff019b88ee7728de947bd86b35861cf57848d | [
"BSD-3-Clause"
] | 127 | 2015-01-01T06:26:34.000Z | 2022-03-02T12:48:05.000Z | cadnano/strandset/mergecmd.py | scholer/cadnano2.5 | ce6ff019b88ee7728de947bd86b35861cf57848d | [
"BSD-3-Clause"
] | 48 | 2015-01-22T19:57:49.000Z | 2022-03-27T14:27:53.000Z | # -*- coding: utf-8 -*-
from cadnano.proxies.cnproxy import UndoCommand
from cadnano.strand import Strand
class MergeCommand(UndoCommand):
"""
This class takes two Strands and merges them. This Class should be
private to StrandSet as knowledge of a strandsetIndex outside of this
of the StrandSet clas... | 40.414201 | 104 | 0.643631 |
1a6ce53edbc141070ad494a6ee8a85de6285b5a3 | 1,375 | py | Python | stanCode Projects/my_photoshop/mirror_lake.py | hsuenchichiu/sc-projects | 136c6a92af6495704f81c0ffb39f58890a0349c2 | [
"MIT"
] | null | null | null | stanCode Projects/my_photoshop/mirror_lake.py | hsuenchichiu/sc-projects | 136c6a92af6495704f81c0ffb39f58890a0349c2 | [
"MIT"
] | null | null | null | stanCode Projects/my_photoshop/mirror_lake.py | hsuenchichiu/sc-projects | 136c6a92af6495704f81c0ffb39f58890a0349c2 | [
"MIT"
] | null | null | null | """
File: mirror_lake.py
name: HsuenChi Chiu
----------------------------------
This file reads in mt-rainier.jpg and
makes a new image that creates a mirror
lake vibe by placing the inverse image of
mt-rainier.jpg below the original one
"""
from simpleimage import SimpleImage
def reflect(filename):
"""
:par... | 26.442308 | 64 | 0.638545 |
1a6d0b9a9b725c0f3288a486124200c8718c07a5 | 4,024 | py | Python | src/multiple_dispatch/multiple_dispatch.py | goerz-testing/multiple_dispatch_test | a518e1132c6f8d79a5829e01594e87769e87a3d8 | [
"BSD-3-Clause"
] | null | null | null | src/multiple_dispatch/multiple_dispatch.py | goerz-testing/multiple_dispatch_test | a518e1132c6f8d79a5829e01594e87769e87a3d8 | [
"BSD-3-Clause"
] | null | null | null | src/multiple_dispatch/multiple_dispatch.py | goerz-testing/multiple_dispatch_test | a518e1132c6f8d79a5829e01594e87769e87a3d8 | [
"BSD-3-Clause"
] | null | null | null | import functools
import inspect
import types
from typing import Callable
from multimethod import (
signature,
subtype,
get_type,
groupby,
DispatchError,
get_types,
overload,
multimethod,
)
class multiple_dispatch(multimethod):
"""A callable directed acyclic graph of methods."""
... | 32.451613 | 77 | 0.593936 |
1a6d1367b2d26a56b6b1b72589e02cb1ebd4c804 | 3,778 | py | Python | intersight/models/hyperflex_managed_object_reference_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/hyperflex_managed_object_reference_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/hyperflex_managed_object_reference_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class HyperflexManagedObjectReferenceRef(object):
"""
... | 25.186667 | 87 | 0.561938 |
1a6d52975ea7c8ab688d11f375707c445f4dc2e6 | 9,589 | py | Python | tests/unit/modules/win_iis_test.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/win_iis_test.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/win_iis_test.py | cbosdo/salt-1 | 9084d662781f9c0944804ba087e652c2ddb730bf | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:synopsis: Unit Tests for Windows IIS Module 'module.win_iis'
:platform: Windows
:maturity: develop
versionadded:: 2016.11.0
'''
# Import Python Libs
from __future__ import absolute_import
import json
# Import Salt Libs
from salt.exceptions import SaltInvocationError
from s... | 33.065517 | 84 | 0.599437 |
1a6d71a961b2b52f3e7fe184f60dc4bb4963becd | 2,254 | py | Python | openpype/modules/default_modules/idle_manager/idle_module.py | yosuperdope/OpenPype | 0c90df97ddb8cda291a4f66d35da58b3deb94a71 | [
"MIT"
] | null | null | null | openpype/modules/default_modules/idle_manager/idle_module.py | yosuperdope/OpenPype | 0c90df97ddb8cda291a4f66d35da58b3deb94a71 | [
"MIT"
] | null | null | null | openpype/modules/default_modules/idle_manager/idle_module.py | yosuperdope/OpenPype | 0c90df97ddb8cda291a4f66d35da58b3deb94a71 | [
"MIT"
] | null | null | null | import platform
import collections
from openpype.modules import OpenPypeModule
from openpype_interfaces import (
ITrayService,
IIdleManager
)
class IdleManager(OpenPypeModule, ITrayService):
""" Measure user's idle time in seconds.
Idle time resets on keyboard/mouse input.
Is able to emit signals... | 28.175 | 75 | 0.631322 |
1a6db0c9a231a8bffcabb6804b91b83fcee75098 | 1,455 | py | Python | gpubin/makestructure.py | avishek-r-kumar/AMBERGPU_Tutorial_Saguaro | 424fde05d424afca400d361c93de73b31ddbda81 | [
"MIT"
] | 1 | 2019-09-29T20:50:24.000Z | 2019-09-29T20:50:24.000Z | gpubin/makestructure.py | avishek-r-kumar/AMBERGPU_Tutorial_Saguaro | 424fde05d424afca400d361c93de73b31ddbda81 | [
"MIT"
] | null | null | null | gpubin/makestructure.py | avishek-r-kumar/AMBERGPU_Tutorial_Saguaro | 424fde05d424afca400d361c93de73b31ddbda81 | [
"MIT"
] | 1 | 2016-11-30T08:08:48.000Z | 2016-11-30T08:08:48.000Z | #!/usr/bin/env python
"""
MakeStructure
==============
Description
------------
Make a tleapin file for a simulation that is neutralized and solaved with
8 Angstroms Boundaries.
Example
--------
makestructure.py 1btl.pdb
"""
import sys
import os
def maketleapscript(pdbfile,waterbound="14.0"):
"""makes t... | 24.661017 | 74 | 0.668729 |
1a6dd3d8bc015fecec587046a26b4261e43952d4 | 890 | py | Python | 2.Functions_Loops/7.set_and_dict_comprehension.py | jkuatdsc/Python101 | b724606c920fb0e563a6a6df34c97ec30b77aa98 | [
"MIT"
] | 2 | 2020-02-11T10:19:23.000Z | 2020-02-18T08:25:51.000Z | 2.Functions_Loops/7.set_and_dict_comprehension.py | jkuatdsc/Python101 | b724606c920fb0e563a6a6df34c97ec30b77aa98 | [
"MIT"
] | null | null | null | 2.Functions_Loops/7.set_and_dict_comprehension.py | jkuatdsc/Python101 | b724606c920fb0e563a6a6df34c97ec30b77aa98 | [
"MIT"
] | 1 | 2020-02-08T19:08:04.000Z | 2020-02-08T19:08:04.000Z | """
Using set operations to check who went to the party
"""
# Present guests using Intersection of sets
friends = {'alice', 'lucy', 'braiden', 'kim'}
guests = {'jane', 'lucy', 'paula', 'alice', 'mary'}
present = friends.intersection(guests) # | (friends & guests)
print(present)
# Absent friends using difference of s... | 27.8125 | 69 | 0.705618 |
1a6e06dc15017ce08f1beb000c2ea376420c0d4e | 1,483 | py | Python | oeml-sdk/python/test/test_severity.py | oskaralfons/coinapi-sdk | 2c79b6d91d0f702040dd865e79f0774a4bba9bb3 | [
"MIT"
] | 1 | 2020-07-23T05:47:52.000Z | 2020-07-23T05:47:52.000Z | oeml-sdk/python/test/test_severity.py | oskaralfons/coinapi-sdk | 2c79b6d91d0f702040dd865e79f0774a4bba9bb3 | [
"MIT"
] | null | null | null | oeml-sdk/python/test/test_severity.py | oskaralfons/coinapi-sdk | 2c79b6d91d0f702040dd865e79f0774a4bba9bb3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
OEML - REST API
This section will provide necessary information about the `CoinAPI OEML REST API` protocol. This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a> # noqa: E501
The version... | 27.981132 | 261 | 0.670263 |
1a6e10765552cad321b626fa40ac0b4263f45718 | 259 | py | Python | aim/web/configs.py | admariner/aim | 4c143ea40acf3531abfa69f66503428d73d9fedc | [
"Apache-2.0"
] | null | null | null | aim/web/configs.py | admariner/aim | 4c143ea40acf3531abfa69f66503428d73d9fedc | [
"Apache-2.0"
] | null | null | null | aim/web/configs.py | admariner/aim | 4c143ea40acf3531abfa69f66503428d73d9fedc | [
"Apache-2.0"
] | null | null | null | # Aim UI
AIM_UI_DEFAULT_PORT = 43800
AIM_UI_DEFAULT_HOST = '127.0.0.1'
AIM_TF_LOGS_PATH_KEY = '__AIM_TF_LOGS_PATH__'
AIM_WEB_ENV_KEY = '__AIM_WEB_ENV__'
AIM_UI_MOUNTED_REPO_PATH = '__AIM_UI_MOUNT_REPO_PATH__'
AIM_UI_TELEMETRY_KEY = 'AIM_UI_TELEMETRY_ENABLED'
| 32.375 | 55 | 0.841699 |
1a6e148b71ac0db2006e0c84ab61bdbd007bb772 | 11,046 | py | Python | utilities/demux/bcl2fastq.py | riemannzetagambit/utilities | ed31949b8d7468584ef262388434d21e42ffa039 | [
"MIT"
] | null | null | null | utilities/demux/bcl2fastq.py | riemannzetagambit/utilities | ed31949b8d7468584ef262388434d21e42ffa039 | [
"MIT"
] | null | null | null | utilities/demux/bcl2fastq.py | riemannzetagambit/utilities | ed31949b8d7468584ef262388434d21e42ffa039 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
import glob
import os
import re
import subprocess
import sys
import pandas as pd
from utilities.log_util import get_logger, log_command
BCL2FASTQ = 'bcl2fastq'
S3_RETRY = 5
S3_LOG_DIR = 's3://trace-genomics/TraceGenomics/logs'
ROOT_DIR_PATH = '/tmp'
def get_default_requirem... | 42.321839 | 146 | 0.583741 |
1a6e17c870ef89b0dadcd2db314e44888641c98f | 304 | py | Python | oscar/lib/python2.7/site-packages/IPython/terminal/ptshell.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/IPython/terminal/ptshell.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/IPython/terminal/ptshell.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | raise DeprecationWarning("""DEPRECATED:
After Popular request and decision from the BDFL:
`IPython.terminal.ptshell` has been moved back to `IPython.terminal.interactiveshell`
during the beta cycle (after IPython 5.0.beta3) Sorry about that.
This file will be removed in 5.0 rc or final.
""")
| 33.777778 | 86 | 0.756579 |
1a6e5baa89f2f48df3485a7d32bbf899ec1df5bb | 19,390 | py | Python | tests/test_shell.py | alexpilotti/python-glanceclient | 3b6754a8cc8932cd9645d54acc8d02826993a546 | [
"Apache-2.0"
] | null | null | null | tests/test_shell.py | alexpilotti/python-glanceclient | 3b6754a8cc8932cd9645d54acc8d02826993a546 | [
"Apache-2.0"
] | null | null | null | tests/test_shell.py | alexpilotti/python-glanceclient | 3b6754a8cc8932cd9645d54acc8d02826993a546 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
# Copyright (C) 2013 Yahoo! 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/licens... | 43.573034 | 79 | 0.632027 |
1a6e5fec3293e8998e7ab797388fbaf0d28f3a67 | 4,341 | py | Python | Aula16/faixa.py | diegocolombo1989/Trabalho-Python | 4603117bebfb6e801c3289e108b4e8f29442ab6f | [
"MIT"
] | null | null | null | Aula16/faixa.py | diegocolombo1989/Trabalho-Python | 4603117bebfb6e801c3289e108b4e8f29442ab6f | [
"MIT"
] | null | null | null | Aula16/faixa.py | diegocolombo1989/Trabalho-Python | 4603117bebfb6e801c3289e108b4e8f29442ab6f | [
"MIT"
] | null | null | null | #--- Arquivo contendo as funções para a manipulação de faixas de uma playlist
#--- Toda a manipulação de dados relacionadas as faixas estará contida em funções neste arquivo
#--- Função que cria uma estrutura para agrupar os dados de uma faixa musical
#--- A estrutura de dados utilizada para agrupar os dados é um dici... | 77.517857 | 162 | 0.745911 |
1a6e7f7218680b75c8b56fbb85929308f7b20588 | 709 | py | Python | problems/two_sum.py | mdu-alt/coding_challenges_python | 171876129b17b5eccd8dd20c7f5b61b3e0e6ef90 | [
"MIT"
] | null | null | null | problems/two_sum.py | mdu-alt/coding_challenges_python | 171876129b17b5eccd8dd20c7f5b61b3e0e6ef90 | [
"MIT"
] | null | null | null | problems/two_sum.py | mdu-alt/coding_challenges_python | 171876129b17b5eccd8dd20c7f5b61b3e0e6ef90 | [
"MIT"
] | null | null | null | from typing import List, Dict
class TwoSum:
"""
Given an array of integers ``nums`` and an integer ``target``, return the indices of the two numbers such that they
add up to ``target``.
Constraints:
* ``2 <= len(nums) <= 10e4``
* ``-10e9 <= nums[i] <= 10e9``
* ``-10e9 <= target <= 1... | 24.448276 | 119 | 0.545839 |
1a6e83943cb4e7c42c17e067ced448180c4fb646 | 5,182 | py | Python | next/api/resources/participants.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | next/api/resources/participants.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | next/api/resources/participants.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | 2 | 2017-06-07T16:03:16.000Z | 2021-03-01T08:48:27.000Z | """
next_backend Participant Resource
author: Christopher Fernandez, Lalit Jain
Resource for accessing all participant data related to a resource
"""
'''
example use:
get a tripletMDS query:
curl -X GET http://localhost:8001/api/experiment/[exp_uid]/participants
'''
from StringIO import StringIO
import pandas as pd
f... | 32.3875 | 100 | 0.630645 |
1a6ed2f1506bd31b15320dfd2de4715d94f80288 | 2,002 | py | Python | app/utils_file_loads.py | FZJ-JSC/jupyter-jsc-orchestrator-image | d9203a202d79d001faf8df50e84fba90df7fcca3 | [
"BSD-3-Clause"
] | null | null | null | app/utils_file_loads.py | FZJ-JSC/jupyter-jsc-orchestrator-image | d9203a202d79d001faf8df50e84fba90df7fcca3 | [
"BSD-3-Clause"
] | null | null | null | app/utils_file_loads.py | FZJ-JSC/jupyter-jsc-orchestrator-image | d9203a202d79d001faf8df50e84fba90df7fcca3 | [
"BSD-3-Clause"
] | null | null | null | '''
Created on May 13, 2019
@author: Tim Kreuzer
'''
import json
def image_name_to_image(imagename):
with open('/etc/j4j/j4j_mount/j4j_orchestrator/image_name_to_image.json', 'r') as f:
images = json.load(f)
return images.get(imagename, imagename)
def get_j4j_orchestrator_token():
with open('/et... | 26.693333 | 88 | 0.654845 |
1a6ef136752d093417393e98a1d5d240300be2f9 | 1,943 | py | Python | datastructures/arrays/problems/sort_colors_dutch_national_flag_problem.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | 10 | 2020-09-21T22:23:09.000Z | 2022-01-25T16:58:44.000Z | datastructures/arrays/problems/sort_colors_dutch_national_flag_problem.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | null | null | null | datastructures/arrays/problems/sort_colors_dutch_national_flag_problem.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | null | null | null | """
The question is to group all same integers together - Sort colors in place
The challenge is: - They can give a pivot index
They can also to do this in-place
Generic version of the problem:
- Given an I/P array - rearrange the elements such that all elements less than pivot appear first,
... | 30.84127 | 110 | 0.601647 |
1a6f205287457ebd40508fdfdf45095c57f07bca | 844 | py | Python | src/python/pants/option/option_util.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | 1 | 2021-05-05T18:58:28.000Z | 2021-05-05T18:58:28.000Z | src/python/pants/option/option_util.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | null | null | null | src/python/pants/option/option_util.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | 3 | 2020-06-30T08:28:13.000Z | 2021-07-28T09:35:57.000Z | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import shlex
from typing import List, Sequence, cast
from pants.option.custom_types import dict_with_files_option, list_option
def is_list_option(kwargs) -> bool:
return cast(bool, ... | 35.166667 | 100 | 0.728673 |
1a6f2ccc8cb9f0e28ba28d4655bb81b3adae7244 | 15,459 | py | Python | ginga/web/jupyterw/ImageViewJpw.py | SimonKrughoff/ginga | abcd284228400092b2d7b73bb51d30632e90ee03 | [
"BSD-3-Clause"
] | null | null | null | ginga/web/jupyterw/ImageViewJpw.py | SimonKrughoff/ginga | abcd284228400092b2d7b73bb51d30632e90ee03 | [
"BSD-3-Clause"
] | null | null | null | ginga/web/jupyterw/ImageViewJpw.py | SimonKrughoff/ginga | abcd284228400092b2d7b73bb51d30632e90ee03 | [
"BSD-3-Clause"
] | null | null | null | #
# ImageViewJpw.py -- Module for a Ginga FITS viewer in a Jupyter web notebook.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
This example illustrates using a Ginga as the driver of a Jupyter web widget.
REQUIREMENTS:
To use this code you will ne... | 31.613497 | 79 | 0.601915 |
1a6f75b567db03c6300179dedeef1bc311197b8c | 25 | py | Python | threading/source/__init__.py | vb64/test.tasks | 799fd01e1b3a9ebb1357e79168cb33aa236a3e88 | [
"MIT"
] | null | null | null | threading/source/__init__.py | vb64/test.tasks | 799fd01e1b3a9ebb1357e79168cb33aa236a3e88 | [
"MIT"
] | null | null | null | threading/source/__init__.py | vb64/test.tasks | 799fd01e1b3a9ebb1357e79168cb33aa236a3e88 | [
"MIT"
] | null | null | null | """For Python2 pylint"""
| 12.5 | 24 | 0.64 |
1a6fb47fecaa2f0888dc55e9824d2f881e28947c | 4,258 | py | Python | src/pathme/reactome/cli.py | brucetony/PathMe | c7d758ff76f6787a4eb349b95f9c06bf1afb0754 | [
"Apache-2.0"
] | null | null | null | src/pathme/reactome/cli.py | brucetony/PathMe | c7d758ff76f6787a4eb349b95f9c06bf1afb0754 | [
"Apache-2.0"
] | null | null | null | src/pathme/reactome/cli.py | brucetony/PathMe | c7d758ff76f6787a4eb349b95f9c06bf1afb0754 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Command line interface."""
import logging
import os
import time
import click
from bio2bel_chebi import Manager as ChebiManager
from bio2bel_hgnc import Manager as HgncManager
from pybel import from_pickle
from tqdm import tqdm
from pathme.constants import DATA_DIR, DEFAULT_CACHE_CONNECTIO... | 34.33871 | 116 | 0.713715 |
1a6fc3fea205b1089c45bf4b00c4dcb74e67c996 | 1,456 | py | Python | appengine/cr-buildbucket/fix_builds.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | appengine/cr-buildbucket/fix_builds.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | appengine/cr-buildbucket/fix_builds.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2018 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.
"""Fixes builds in the datastore.
This code changes each time something needs to be migrated once.
"""
from google.appengine.ext import ndb
from component... | 24.677966 | 78 | 0.730082 |
1a6fc86801ede847b624bd044de4dd6a74aa1e08 | 2,556 | py | Python | recyclus_gateway/security/auth.py | yarden-livnat/cyclus_gateway | 211410817a7d0c7cff98dc678624640fd54f92cd | [
"BSD-3-Clause"
] | null | null | null | recyclus_gateway/security/auth.py | yarden-livnat/cyclus_gateway | 211410817a7d0c7cff98dc678624640fd54f92cd | [
"BSD-3-Clause"
] | null | null | null | recyclus_gateway/security/auth.py | yarden-livnat/cyclus_gateway | 211410817a7d0c7cff98dc678624640fd54f92cd | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
from flask import current_app
from flask_jwt_extended import (JWTManager,
create_access_token, create_refresh_token, decode_token)
from ..db import db
from .models import User, Token
from .exceptions import TokenNotFound
jwt = JWTManager()
def epoch_utc_... | 26.625 | 88 | 0.727308 |
1a6fd22a5294891c93f1c38ca23730d796ca7d69 | 7,328 | py | Python | test/AdjacencyCheck.py | abidalrekab/blocksWorldv1.0 | fe4a44fd30e4280de5d1d5737d58d757be70eb77 | [
"MIT"
] | 1 | 2020-07-02T20:05:48.000Z | 2020-07-02T20:05:48.000Z | test/AdjacencyCheck.py | abidalrekab/blocksWorldv1.0 | fe4a44fd30e4280de5d1d5737d58d757be70eb77 | [
"MIT"
] | null | null | null | test/AdjacencyCheck.py | abidalrekab/blocksWorldv1.0 | fe4a44fd30e4280de5d1d5737d58d757be70eb77 | [
"MIT"
] | 1 | 2020-01-29T20:11:14.000Z | 2020-01-29T20:11:14.000Z | import Distance
def test(p1 ,p2, p):
if p1[0] == p2[0] and p1[1] != p2[1]:
'''
conducting testing
'''
if p[0] == p1[0] :
#print("----------------")
vy = sorted([p1[1], p2[1]])
r2 = range(vy[0] - 1, vy[1] + 1)
if (p[1] in r2):
... | 34.083721 | 122 | 0.496316 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.