hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0f83065ce5b93109d1781c8e2fed90ab030f19 | 703 | py | Python | auth/AuthView.py | perrycharlton/forms | 4e2d18538a0b08ebdd88a4ddad8fb614f04b1a51 | [
"MIT"
] | null | null | null | auth/AuthView.py | perrycharlton/forms | 4e2d18538a0b08ebdd88a4ddad8fb614f04b1a51 | [
"MIT"
] | null | null | null | auth/AuthView.py | perrycharlton/forms | 4e2d18538a0b08ebdd88a4ddad8fb614f04b1a51 | [
"MIT"
] | null | null | null | from flask import Blueprint, request
from .AuthController import find_user, check_user, signup, check_token, get_home
auth = Blueprint('auth', __name__, template_folder='auth_templates', url_prefix='/auth')
@auth.route('/<path:path>', methods=["POST"])
def validate(path):
if path in ['username', 'email']:
... | 26.037037 | 88 | 0.674253 | from flask import Blueprint, request
from .AuthController import find_user, check_user, signup, check_token, get_home
auth = Blueprint('auth', __name__, template_folder='auth_templates', url_prefix='/auth')
@auth.route('/<path:path>', methods=["POST"])
def validate(path):
if path in ['username', 'email']:
... | true | true |
1c0f832fa8746ca4fa1f0582efc1762c5a623da2 | 779 | py | Python | pypy/lib/test2/test_itertools.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 1 | 2019-05-27T00:58:46.000Z | 2019-05-27T00:58:46.000Z | pypy/lib/test2/test_itertools.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | pypy/lib/test2/test_itertools.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | from pypy.conftest import gettestobjspace
class AppTestItertools:
def setup_class(cls):
cls.space = gettestobjspace()
cls.w_itertools = cls.space.appexec([], "(): import itertools; return itertools")
def test_chain(self):
it = self.itertools.chain([], [1, 2, 3])
lst = list(it)
... | 32.458333 | 89 | 0.616175 | from pypy.conftest import gettestobjspace
class AppTestItertools:
def setup_class(cls):
cls.space = gettestobjspace()
cls.w_itertools = cls.space.appexec([], "(): import itertools; return itertools")
def test_chain(self):
it = self.itertools.chain([], [1, 2, 3])
lst = list(it)
... | true | true |
1c0f856a0e3bb9dab9f6f12b43c9aaafd6a05535 | 6,909 | py | Python | tests/core/filtering/test_contract_topic_filters.py | y19818/web3.py | 32a85a287ab63220d1e0c06d77be74de595ff02f | [
"MIT"
] | null | null | null | tests/core/filtering/test_contract_topic_filters.py | y19818/web3.py | 32a85a287ab63220d1e0c06d77be74de595ff02f | [
"MIT"
] | null | null | null | tests/core/filtering/test_contract_topic_filters.py | y19818/web3.py | 32a85a287ab63220d1e0c06d77be74de595ff02f | [
"MIT"
] | null | null | null | import pytest
from hypothesis import (
given,
settings,
strategies as st,
)
def not_empty_string(x):
return x != ''
@st.composite
def dynamic_values(draw):
non_matching_1 = draw(st.text().filter(not_empty_string))
exclusions = (non_matching_1, '')
matching_value = draw(... | 33.538835 | 94 | 0.610219 | import pytest
from hypothesis import (
given,
settings,
strategies as st,
)
def not_empty_string(x):
return x != ''
@st.composite
def dynamic_values(draw):
non_matching_1 = draw(st.text().filter(not_empty_string))
exclusions = (non_matching_1, '')
matching_value = draw(... | true | true |
1c0f8599009e3f22ab86e20fddd081d0d4d15464 | 852 | py | Python | tests/rules/test_git_rm_recursive.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | tests/rules/test_git_rm_recursive.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | tests/rules/test_git_rm_recursive.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | import pytest
from theheck.rules.git_rm_recursive import match, get_new_command
from theheck.types import Command
@pytest.fixture
def output(target):
return "fatal: not removing '{}' recursively without -r".format(target)
@pytest.mark.parametrize('script, target', [
('git rm foo', 'foo'),
('git rm foo b... | 30.428571 | 75 | 0.697183 | import pytest
from theheck.rules.git_rm_recursive import match, get_new_command
from theheck.types import Command
@pytest.fixture
def output(target):
return "fatal: not removing '{}' recursively without -r".format(target)
@pytest.mark.parametrize('script, target', [
('git rm foo', 'foo'),
('git rm foo b... | true | true |
1c0f85b1db5adff723f3dcaf553a75e5ea7c590b | 562 | py | Python | src/yellowdog_client/model/all_workers_released_shutdown_condition.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | src/yellowdog_client/model/all_workers_released_shutdown_condition.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | src/yellowdog_client/model/all_workers_released_shutdown_condition.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass, field
from datetime import timedelta
from .worker_pool_shutdown_condition import WorkerPoolShutdownCondition
@dataclass
class AllWorkersReleasedShutdownCondition(WorkerPoolShutdownCondition):
"""Specifies that a worker pool should be automatically shut down when all its workers... | 43.230769 | 113 | 0.813167 | from dataclasses import dataclass, field
from datetime import timedelta
from .worker_pool_shutdown_condition import WorkerPoolShutdownCondition
@dataclass
class AllWorkersReleasedShutdownCondition(WorkerPoolShutdownCondition):
type: str = field(default="co.yellowdog.platform.model.AllWorkersReleasedShutdownCondi... | true | true |
1c0f85d48a3e67b1fa5ca270cbeb7e7572e555ed | 17,454 | py | Python | adapt/metrics.py | atiqm/adapt | af9833cb7e698bdcb722941622d67c06f04822f7 | [
"BSD-2-Clause"
] | null | null | null | adapt/metrics.py | atiqm/adapt | af9833cb7e698bdcb722941622d67c06f04822f7 | [
"BSD-2-Clause"
] | null | null | null | adapt/metrics.py | atiqm/adapt | af9833cb7e698bdcb722941622d67c06f04822f7 | [
"BSD-2-Clause"
] | null | null | null | import inspect
import copy
import numpy as np
import tensorflow as tf
from scipy import linalg
from sklearn.metrics import pairwise
from sklearn.base import clone
from sklearn.model_selection import train_test_split
from adapt.utils import get_default_discriminator, check_sample_weight
from tensorflow.keras.optimizers... | 28.75453 | 95 | 0.583878 | import inspect
import copy
import numpy as np
import tensorflow as tf
from scipy import linalg
from sklearn.metrics import pairwise
from sklearn.base import clone
from sklearn.model_selection import train_test_split
from adapt.utils import get_default_discriminator, check_sample_weight
from tensorflow.keras.optimizers... | true | true |
1c0f86d691069c4b85ffb77b975e5216d46ea784 | 5,731 | py | Python | scripts/run_performance_tests.py | zhongyang/detect-secrets | 39586321958028e0f4e5d3a574becc84393f1bdb | [
"Apache-2.0"
] | null | null | null | scripts/run_performance_tests.py | zhongyang/detect-secrets | 39586321958028e0f4e5d3a574becc84393f1bdb | [
"Apache-2.0"
] | null | null | null | scripts/run_performance_tests.py | zhongyang/detect-secrets | 39586321958028e0f4e5d3a574becc84393f1bdb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from __future__ import print_function
import argparse
import json
import os
import random
import subprocess
import sys
import tempfile
from enum import Enum
from detect_secrets.util import get_root_directory
class TestCase(Enum):
LONG_FILE = 1
LONG_LINES = 2
def main():
args = p... | 23.681818 | 94 | 0.563776 | from __future__ import print_function
import argparse
import json
import os
import random
import subprocess
import sys
import tempfile
from enum import Enum
from detect_secrets.util import get_root_directory
class TestCase(Enum):
LONG_FILE = 1
LONG_LINES = 2
def main():
args = parse_args()
if... | true | true |
1c0f874a540a30ef5127110ae87a0b5d508927b6 | 281 | py | Python | tests/test_client.py | kotyakov/chmg | dc10f54e0cccfe24bac41485ba270343394a74b1 | [
"MIT"
] | 1 | 2020-11-24T10:23:51.000Z | 2020-11-24T10:23:51.000Z | tests/test_client.py | kotyakov/chlocust | dc10f54e0cccfe24bac41485ba270343394a74b1 | [
"MIT"
] | null | null | null | tests/test_client.py | kotyakov/chlocust | dc10f54e0cccfe24bac41485ba270343394a74b1 | [
"MIT"
] | null | null | null | from chlocust.client import ClickhouseClient
from chlocust.types import ValuesIn
def test_escape_values_in():
c = ClickhouseClient('foo')
query_tmpl = '%(test_me)s'
query = c.substitute_params(query_tmpl, {'test_me': ValuesIn([1, 2, 3])})
assert query == '1,2,3'
| 28.1 | 77 | 0.704626 | from chlocust.client import ClickhouseClient
from chlocust.types import ValuesIn
def test_escape_values_in():
c = ClickhouseClient('foo')
query_tmpl = '%(test_me)s'
query = c.substitute_params(query_tmpl, {'test_me': ValuesIn([1, 2, 3])})
assert query == '1,2,3'
| true | true |
1c0f875ee44f11405d4d25bde883736bca71e285 | 2,590 | py | Python | model-optimizer/extensions/front/div.py | Andruxin52rus/openvino | d824e371fe7dffb90e6d3d58e4e34adecfce4606 | [
"Apache-2.0"
] | 1 | 2022-01-19T15:36:45.000Z | 2022-01-19T15:36:45.000Z | model-optimizer/extensions/front/div.py | Andruxin52rus/openvino | d824e371fe7dffb90e6d3d58e4e34adecfce4606 | [
"Apache-2.0"
] | 27 | 2020-12-29T14:38:34.000Z | 2022-02-21T13:04:03.000Z | model-optimizer/extensions/front/div.py | mmakridi/openvino | 769bb7709597c14debdaa356dd60c5a78bdfa97e | [
"Apache-2.0"
] | null | null | null | """
Copyright (C) 2018-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 41.774194 | 115 | 0.711197 |
import numpy as np
from extensions.ops.elementwise import Mul, Pow
from mo.front.common.replacement import FrontReplacementPattern
from mo.front.tf.graph_utils import create_op_with_const_inputs
from mo.graph.graph import Graph, Node, rename_node
class Div(FrontReplacementPattern):
enabled = False
@sta... | true | true |
1c0f889c03fca50c093e6828ef3f2fa6d8284bfc | 3,383 | py | Python | test/make_global_settings/ar/gyptest-make_global_settings_ar.py | kaadam/GYP | 86ab71caad4640dcc3ec572c2118a1ce3f24150f | [
"BSD-3-Clause"
] | null | null | null | test/make_global_settings/ar/gyptest-make_global_settings_ar.py | kaadam/GYP | 86ab71caad4640dcc3ec572c2118a1ce3f24150f | [
"BSD-3-Clause"
] | null | null | null | test/make_global_settings/ar/gyptest-make_global_settings_ar.py | kaadam/GYP | 86ab71caad4640dcc3ec572c2118a1ce3f24150f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies 'AR' in make_global_settings.
"""
import os
import sys
import TestGyp
def verify_ar(tst, ars=None, rel_path=False, is_cross=T... | 31.616822 | 113 | 0.684304 |
import os
import sys
import TestGyp
def verify_ar(tst, ars=None, rel_path=False, is_cross=True):
ars = ars or {}
rel_path = rel_path or set()
for toolset in ['host', 'target']:
ar = ars.get(toolset)
ar_expected = fix_ar(ar, toolset in rel_path, tst)
ar_suffix = '' if toolset == 'target' else 'host... | true | true |
1c0f89300920a01dd3d43f3f899b266fce28f3f2 | 913 | py | Python | occurrence/migrations/0036_auto_20190514_1543.py | ropable/wastd | 295c60760548d177859de9c0bebdae93342767d0 | [
"MIT"
] | 3 | 2020-07-23T06:37:43.000Z | 2022-01-27T09:40:40.000Z | occurrence/migrations/0036_auto_20190514_1543.py | ropable/wastd | 295c60760548d177859de9c0bebdae93342767d0 | [
"MIT"
] | 337 | 2018-07-12T05:56:29.000Z | 2022-03-30T02:40:41.000Z | occurrence/migrations/0036_auto_20190514_1543.py | ropable/wastd | 295c60760548d177859de9c0bebdae93342767d0 | [
"MIT"
] | 2 | 2020-02-24T00:05:46.000Z | 2020-07-15T07:02:29.000Z | # Generated by Django 2.1.7 on 2019-05-14 07:43
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('occurrence', '0035_auto_20190508_1542'),
]
operations = [
migrations.AlterField(
mo... | 35.115385 | 209 | 0.672508 |
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('occurrence', '0035_auto_20190508_1542'),
]
operations = [
migrations.AlterField(
model_name='areaencounter',
name='sour... | true | true |
1c0f89a8f1485413e4e434950e59f069cdfb7bf8 | 550 | py | Python | var/spack/repos/builtin/packages/perl-test-warnings/package.py | whitfin/spack | aabd2be31a511d0e00c1017f7311a421659319d9 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-06-27T13:26:50.000Z | 2019-07-01T16:24:54.000Z | var/spack/repos/builtin/packages/perl-test-warnings/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 75 | 2016-07-27T11:43:00.000Z | 2020-12-08T15:56:53.000Z | var/spack/repos/builtin/packages/perl-test-warnings/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 8 | 2015-10-16T13:51:49.000Z | 2021-10-18T13:58:03.000Z | # Copyright 2013-2019 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 PerlTestWarnings(PerlPackage):
"""Test for warnings and the lack of them"""
homepage ... | 34.375 | 93 | 0.738182 |
from spack import *
class PerlTestWarnings(PerlPackage):
homepage = "http://deps.cpantesters.org/?module=Test%3A%3ACleanNamespaces;perl=latest"
url = "http://search.cpan.org/CPAN/authors/id/E/ET/ETHER/Test-Warnings-0.026.tar.gz"
version('0.026', '1a379f7eac4c89155d98e652459593a7')
| true | true |
1c0f89bd855309a285bc073293075827d47aff1b | 2,359 | py | Python | data/p3BR/R1/benchmark/startCirq126.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startCirq126.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startCirq126.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=3
# total number=22
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 32.315068 | 77 | 0.690123 |
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
from cirq.contrib.svg import SVGCircuit
def make_circuit(n: int, input_qubit):
c = cirq.Circuit()
c.append(cirq.H.on(input_qubit[0])) c.append(cirq.rx(-0.09738937226128368).on(input_qu... | true | true |
1c0f8a2c7f7c7409a0fe9675ed962c85f85e9a4b | 7,337 | py | Python | test/geometry/calibration/test_undistort.py | seungjooshin/kornia | 5bfb8f2f23cc1d99647c36aa982132c5b7adbb6d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/geometry/calibration/test_undistort.py | seungjooshin/kornia | 5bfb8f2f23cc1d99647c36aa982132c5b7adbb6d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/geometry/calibration/test_undistort.py | seungjooshin/kornia | 5bfb8f2f23cc1d99647c36aa982132c5b7adbb6d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import pytest
import torch
from torch.autograd import gradcheck
from kornia.geometry.calibration.undistort import undistort_points
from kornia.testing import assert_close
class TestUndistortion:
def test_smoke(self, device, dtype):
points = torch.rand(1, 2, device=device, dtype=dtype)
K = torch.r... | 37.819588 | 118 | 0.501976 | import pytest
import torch
from torch.autograd import gradcheck
from kornia.geometry.calibration.undistort import undistort_points
from kornia.testing import assert_close
class TestUndistortion:
def test_smoke(self, device, dtype):
points = torch.rand(1, 2, device=device, dtype=dtype)
K = torch.r... | true | true |
1c0f8b080a88910ac7c0834af6a4c8e38db36033 | 1,462 | py | Python | setup.py | erbanku/starred | 570aaf43cd65036b44967ab44241229c46797cbc | [
"MIT"
] | 1,098 | 2016-06-30T06:06:28.000Z | 2022-03-31T13:10:16.000Z | setup.py | jseteny/starred | b1d2c5541495e548e33a8d618078db524375c865 | [
"MIT"
] | 59 | 2016-06-30T07:32:38.000Z | 2022-03-31T21:00:46.000Z | setup.py | jseteny/starred | b1d2c5541495e548e33a8d618078db524375c865 | [
"MIT"
] | 95 | 2016-06-30T06:06:31.000Z | 2022-03-23T03:44:00.000Z | from setuptools import setup, find_packages
from os import path
from starred import VERSION
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md')) as f:
long_description = f.read()
setup(
name='starred',
version=VERSION,
url='https://github.com/maguow... | 29.836735 | 68 | 0.625855 | from setuptools import setup, find_packages
from os import path
from starred import VERSION
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md')) as f:
long_description = f.read()
setup(
name='starred',
version=VERSION,
url='https://github.com/maguow... | true | true |
1c0f8b0c7269611294b622e5fa1b10eee16a5221 | 263 | py | Python | repetitive.py | Mushroom10/Dungeoneer | bf11f61cc6d428a2f9c7eb3278fa50601f0020b5 | [
"Apache-2.0"
] | null | null | null | repetitive.py | Mushroom10/Dungeoneer | bf11f61cc6d428a2f9c7eb3278fa50601f0020b5 | [
"Apache-2.0"
] | null | null | null | repetitive.py | Mushroom10/Dungeoneer | bf11f61cc6d428a2f9c7eb3278fa50601f0020b5 | [
"Apache-2.0"
] | null | null | null | def gold(gc):
print(("You now have "+str(gc)+" gold coins.").center(150))
def death():
dead = 1
print("Would you like to start over?")
while dead == 1:
again = input("")
if again == "y":
dead = 0
While_2 = 0 | 26.3 | 63 | 0.490494 | def gold(gc):
print(("You now have "+str(gc)+" gold coins.").center(150))
def death():
dead = 1
print("Would you like to start over?")
while dead == 1:
again = input("")
if again == "y":
dead = 0
While_2 = 0 | true | true |
1c0f8b839b00649f7d083fa23c5e77a152bc64d4 | 346 | py | Python | Script/TEinsertion_convert.py | ZhaoZhangZZlab/eccDNA_formation_2021 | 35bd3db1ab475bd440d7fe20c0856002f2cc73ba | [
"MIT"
] | null | null | null | Script/TEinsertion_convert.py | ZhaoZhangZZlab/eccDNA_formation_2021 | 35bd3db1ab475bd440d7fe20c0856002f2cc73ba | [
"MIT"
] | null | null | null | Script/TEinsertion_convert.py | ZhaoZhangZZlab/eccDNA_formation_2021 | 35bd3db1ab475bd440d7fe20c0856002f2cc73ba | [
"MIT"
] | null | null | null | import pandas as pd
import os
import argparse
import re
from Bio import SeqIO
import pysam
pd.set_option("display.max_columns",40)
parser=argparse.ArgumentParser()
parser.add_argument("-bam","--bamFile")
args=parser.parse_args()
bamFile=args.bamFile
from TEinsertion_bamConverter import bamConverter
bamConverter().... | 17.3 | 49 | 0.812139 | import pandas as pd
import os
import argparse
import re
from Bio import SeqIO
import pysam
pd.set_option("display.max_columns",40)
parser=argparse.ArgumentParser()
parser.add_argument("-bam","--bamFile")
args=parser.parse_args()
bamFile=args.bamFile
from TEinsertion_bamConverter import bamConverter
bamConverter().... | true | true |
1c0f8b853c954b56cf397f7396e874f0bb62295d | 124 | py | Python | 06.Printing_star_in_Right_angle_Triangle.py | Kushal997-das/Pattern_Printing | 313c7984209e54df8751a06143d0b10e0cd4b2be | [
"Apache-2.0"
] | 27 | 2020-10-16T03:55:24.000Z | 2022-02-02T13:47:06.000Z | 06.Printing_star_in_Right_angle_Triangle.py | https-github-com-Kushal997-das/Pattern_Printing | 313c7984209e54df8751a06143d0b10e0cd4b2be | [
"Apache-2.0"
] | null | null | null | 06.Printing_star_in_Right_angle_Triangle.py | https-github-com-Kushal997-das/Pattern_Printing | 313c7984209e54df8751a06143d0b10e0cd4b2be | [
"Apache-2.0"
] | 2 | 2020-11-27T04:51:29.000Z | 2021-06-04T03:34:37.000Z | #Printing 'Right_angle_Triangle_' Shape !
'''
*****
****
***
**
*
'''
n=int(input())
for i in range(n):
print('*'*(n-i)) | 11.272727 | 41 | 0.5 | n=int(input())
for i in range(n):
print('*'*(n-i)) | true | true |
1c0f8b94303e6a57e2323132cdd6b48dbe1d7ed7 | 20,579 | py | Python | test/unittests/skills/test_core.py | JuliaC29/mycroft-core | 1599452eb1d6a8c4ad5585101f30bc346bfe01d2 | [
"Apache-2.0"
] | 2 | 2019-05-04T23:38:07.000Z | 2019-07-14T15:25:25.000Z | test/unittests/skills/test_core.py | JuliaC29/mycroft-core | 1599452eb1d6a8c4ad5585101f30bc346bfe01d2 | [
"Apache-2.0"
] | null | null | null | test/unittests/skills/test_core.py | JuliaC29/mycroft-core | 1599452eb1d6a8c4ad5585101f30bc346bfe01d2 | [
"Apache-2.0"
] | 1 | 2020-07-08T11:10:51.000Z | 2020-07-08T11:10:51.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 37.213382 | 79 | 0.584528 | import sys
import unittest
import mock
from adapt.intent import IntentBuilder
from os.path import join, dirname, abspath
from re import error
from datetime import datetime
from mycroft.configuration import Configuration
from mycroft.messagebus.message import Message
from mycroft.skills.skill_data import load_regex_fr... | true | true |
1c0f8bd703b31606382bd55e5d267ebb750b3fa1 | 655 | py | Python | pairwise_macro_synteny_blocks/setup.py | alancleary/microservices | 6132a76aa063b749bada17fe98415cd8d5d4fb17 | [
"Apache-2.0"
] | 1 | 2021-11-22T20:52:37.000Z | 2021-11-22T20:52:37.000Z | pairwise_macro_synteny_blocks/setup.py | alancleary/microservices | 6132a76aa063b749bada17fe98415cd8d5d4fb17 | [
"Apache-2.0"
] | 34 | 2020-09-10T17:19:00.000Z | 2021-09-14T18:26:08.000Z | pairwise_macro_synteny_blocks/setup.py | legumeinfo/lis_gcv_microservices | 363310ed029f50c19ac4520371bb42e4d8b0454e | [
"Apache-2.0"
] | 5 | 2021-11-15T23:46:08.000Z | 2022-01-30T18:43:10.000Z | #!/usr/bin/env python
# Python
import setuptools
from setuptools.command.build_py import build_py
# package
from pairwise_macro_synteny_blocks import commands
PACKAGE_DIRECTORIES = {
'': '.',
}
COMMAND_CLASS = {}
build_proto_command = 'build_proto'
class BuildPy(build_py):
'''Custom build_py command class.'... | 16.375 | 50 | 0.748092 | import setuptools
from setuptools.command.build_py import build_py
from pairwise_macro_synteny_blocks import commands
PACKAGE_DIRECTORIES = {
'': '.',
}
COMMAND_CLASS = {}
build_proto_command = 'build_proto'
class BuildPy(build_py):
def run(self):
build_py.run(self)
self.run_command(build_proto_com... | true | true |
1c0f8bee42b383bb7a5fdc16af5bc9362e22062a | 1,940 | py | Python | npro/npro/report/leads_pipeline_analysis_by_source/leads_pipeline_analysis_by_source.py | VasuGoel-zz/npro | 68c9756954a4d393e1068a65f6466d1eee1e0644 | [
"MIT"
] | null | null | null | npro/npro/report/leads_pipeline_analysis_by_source/leads_pipeline_analysis_by_source.py | VasuGoel-zz/npro | 68c9756954a4d393e1068a65f6466d1eee1e0644 | [
"MIT"
] | null | null | null | npro/npro/report/leads_pipeline_analysis_by_source/leads_pipeline_analysis_by_source.py | VasuGoel-zz/npro | 68c9756954a4d393e1068a65f6466d1eee1e0644 | [
"MIT"
] | 1 | 2022-01-26T06:38:44.000Z | 2022-01-26T06:38:44.000Z | # Copyright (c) 2013, GreyCube Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import pandas
def execute(filters=None):
return get_data(filters)
def get_data(filters):
columns = [dict(label="Source", fieldname="source", f... | 26.575342 | 86 | 0.606701 |
from __future__ import unicode_literals
import frappe
import pandas
def execute(filters=None):
return get_data(filters)
def get_data(filters):
columns = [dict(label="Source", fieldname="source", fieldtype="Data", width=165)]
data = frappe.db.sql(
"""
select
coalesce(l.sourc... | true | true |
1c0f8c7e4cb01a3fca3bced6d0d7a160543c0984 | 3,627 | py | Python | tests/test_runners/test_gradle.py | Songmu/cli | f4814e30cedad3feb5e46fd4617238a44717d4bb | [
"Apache-2.0"
] | null | null | null | tests/test_runners/test_gradle.py | Songmu/cli | f4814e30cedad3feb5e46fd4617238a44717d4bb | [
"Apache-2.0"
] | null | null | null | tests/test_runners/test_gradle.py | Songmu/cli | f4814e30cedad3feb5e46fd4617238a44717d4bb | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from unittest import mock
import responses # type: ignore
import json
import gzip
from tests.cli_test_case import CliTestCase
from launchable.utils.http_client import get_base_url
import tempfile
import os
from tests.helper import ignore_warnings
class GradleTest(CliTestCase):
test_files... | 59.459016 | 309 | 0.6992 | from pathlib import Path
from unittest import mock
import responses import json
import gzip
from tests.cli_test_case import CliTestCase
from launchable.utils.http_client import get_base_url
import tempfile
import os
from tests.helper import ignore_warnings
class GradleTest(CliTestCase):
test_files_dir = Path(__f... | true | true |
1c0f8c88372e6d2b5dd879d61b6820d3ffaa9f1a | 460 | py | Python | blocks/managers.py | eneepo/django-blocks | f2f4e6831ab08c165844897086f96647a73b488d | [
"BSD-3-Clause"
] | null | null | null | blocks/managers.py | eneepo/django-blocks | f2f4e6831ab08c165844897086f96647a73b488d | [
"BSD-3-Clause"
] | null | null | null | blocks/managers.py | eneepo/django-blocks | f2f4e6831ab08c165844897086f96647a73b488d | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.db.models import Q
from django.utils import timezone
from . import constants
class PublishManager(models.Manager):
def get_queryset(self):
return super(PublishManager, self).get_queryset().filter(
(Q(expiry_date__gte=timezone.now()) | Q(expiry_date=Non... | 30.666667 | 74 | 0.68913 | from django.db import models
from django.db.models import Q
from django.utils import timezone
from . import constants
class PublishManager(models.Manager):
def get_queryset(self):
return super(PublishManager, self).get_queryset().filter(
(Q(expiry_date__gte=timezone.now()) | Q(expiry_date=Non... | true | true |
1c0f8ce81b4a2325f3e3d6ea4252bdae1496200d | 1,258 | py | Python | modules/player.py | relrix/simplegame | 68b8970b9eb7f463b0d5d00c1f0d86086d88e22c | [
"MIT"
] | null | null | null | modules/player.py | relrix/simplegame | 68b8970b9eb7f463b0d5d00c1f0d86086d88e22c | [
"MIT"
] | null | null | null | modules/player.py | relrix/simplegame | 68b8970b9eb7f463b0d5d00c1f0d86086d88e22c | [
"MIT"
] | 1 | 2020-05-02T16:27:36.000Z | 2020-05-02T16:27:36.000Z | from constants import *
from helper.spritesheet import *
class Player(pygame.sprite.Sprite):
""" This class represents the Player. """
def __init__(self, sprite_sheet_data):
""" Set up the player on creation. """
# Call the parent class (Sprite) constructor
pygame.sprite.Sprite.__init... | 35.942857 | 65 | 0.540541 | from constants import *
from helper.spritesheet import *
class Player(pygame.sprite.Sprite):
def __init__(self, sprite_sheet_data):
pygame.sprite.Sprite.__init__(self)
sprite_sheet = SpriteSheet(TANK)
self.image = sprite_sheet.get_image(sprite_sheet_data[0],
... | true | true |
1c0f8cf1f3cb567edb6657d92d6fdcb464fd2cca | 3,929 | py | Python | cauth/utils/userdetails.py | softwarefactory-project/cauth | ca3b10beff80daea41fdb3aee2af07ce122ea6fb | [
"Apache-2.0"
] | null | null | null | cauth/utils/userdetails.py | softwarefactory-project/cauth | ca3b10beff80daea41fdb3aee2af07ce122ea6fb | [
"Apache-2.0"
] | null | null | null | cauth/utils/userdetails.py | softwarefactory-project/cauth | ca3b10beff80daea41fdb3aee2af07ce122ea6fb | [
"Apache-2.0"
] | 1 | 2019-03-10T16:14:21.000Z | 2019-03-10T16:14:21.000Z | #!/usr/bin/env python
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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
#
# Unle... | 40.505155 | 75 | 0.546959 |
import hashlib
import logging
from stevedore import driver
from pecan import conf
from cauth.service import base
from cauth.model import db as auth_map
from cauth.utils import transaction
from cauth.utils import exceptions
def differentiate(login, domain, uid):
suffix = hashlib.sha1((domain + '/' + str(uid)).e... | true | true |
1c0f8d53f8833568d271899c8f0265cb0938b544 | 22,280 | py | Python | sdk/python/pulumi_gcp/networkconnectivity/hub.py | pjbizon/pulumi-gcp | 0d09cbc1dcf50093a177531f7596c27db11a2e58 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/networkconnectivity/hub.py | pjbizon/pulumi-gcp | 0d09cbc1dcf50093a177531f7596c27db11a2e58 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/networkconnectivity/hub.py | pjbizon/pulumi-gcp | 0d09cbc1dcf50093a177531f7596c27db11a2e58 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 44.118812 | 257 | 0.642908 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *
__all__ = ['HubArgs', 'Hub']
@pulumi.input_type
class HubArgs:
def __init__(__self__, *,
description: Op... | true | true |
1c0f8d9ad40655c80b8c4caf91c4369ccc015dc1 | 42,292 | py | Python | twisted/protocols/sip.py | Laharah/twisted | bf436c724c94268ef470699577356ea887c503cd | [
"MIT",
"Unlicense"
] | null | null | null | twisted/protocols/sip.py | Laharah/twisted | bf436c724c94268ef470699577356ea887c503cd | [
"MIT",
"Unlicense"
] | null | null | null | twisted/protocols/sip.py | Laharah/twisted | bf436c724c94268ef470699577356ea887c503cd | [
"MIT",
"Unlicense"
] | null | null | null | # -*- test-case-name: twisted.test.test_sip -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""Session Initialization Protocol.
Documented in RFC 2543.
[Superseded by 3261]
This module contains a deprecated implementation of HTTP Digest authentication.
See L{twisted.cred.credentials} a... | 31.373887 | 119 | 0.570746 |
"""Session Initialization Protocol.
Documented in RFC 2543.
[Superseded by 3261]
This module contains a deprecated implementation of HTTP Digest authentication.
See L{twisted.cred.credentials} and L{twisted.cred._digest} for its new home.
"""
import socket, time, sys, random, warnings
from hashlib import md5
fro... | false | true |
1c0f90100b61838235038bbc111bd1c2eb50dadb | 19,144 | py | Python | tests/test_compute_service.py | selshowk/cloudbridge | 5820f681c33d74c93ede22e56d8c7a5f7b9f54e7 | [
"MIT"
] | null | null | null | tests/test_compute_service.py | selshowk/cloudbridge | 5820f681c33d74c93ede22e56d8c7a5f7b9f54e7 | [
"MIT"
] | null | null | null | tests/test_compute_service.py | selshowk/cloudbridge | 5820f681c33d74c93ede22e56d8c7a5f7b9f54e7 | [
"MIT"
] | 1 | 2021-06-15T19:19:44.000Z | 2021-06-15T19:19:44.000Z | import ipaddress
import six
from cloudbridge.base import helpers as cb_helpers
from cloudbridge.base.resources import BaseNetwork
from cloudbridge.factory import ProviderList
from cloudbridge.interfaces import InstanceState
from cloudbridge.interfaces import InvalidConfigurationException
from cloudbridge.interfaces.e... | 45.908873 | 79 | 0.559288 | import ipaddress
import six
from cloudbridge.base import helpers as cb_helpers
from cloudbridge.base.resources import BaseNetwork
from cloudbridge.factory import ProviderList
from cloudbridge.interfaces import InstanceState
from cloudbridge.interfaces import InvalidConfigurationException
from cloudbridge.interfaces.e... | true | true |
1c0f901261842f7529c4524a7a1ae4e520869fcb | 5,529 | py | Python | modules/drivers/binocular_ws/src/mini_binocular/scripts/grub_image.py | EngineeringBoy/manipulator | 1e9ada4d890e60a94b3eddc277e13a6d75d40861 | [
"Apache-2.0"
] | null | null | null | modules/drivers/binocular_ws/src/mini_binocular/scripts/grub_image.py | EngineeringBoy/manipulator | 1e9ada4d890e60a94b3eddc277e13a6d75d40861 | [
"Apache-2.0"
] | null | null | null | modules/drivers/binocular_ws/src/mini_binocular/scripts/grub_image.py | EngineeringBoy/manipulator | 1e9ada4d890e60a94b3eddc277e13a6d75d40861 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
import numpy as np
import cv2
import shlex
import subprocess
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class MiniBinocularCamera:
'mini binocular camera driver'
def __init__(self, cam_id, calib_file):
... | 40.654412 | 105 | 0.56285 |
import rospy
from std_msgs.msg import String
import numpy as np
import cv2
import shlex
import subprocess
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class MiniBinocularCamera:
'mini binocular camera driver'
def __init__(self, cam_id, calib_file):
self.cam_id = cam... | false | true |
1c0f909bfe8a76eb6c9996c2cdbf1cf339e30a40 | 3,247 | py | Python | past development/python/tempcheck_v2.py | TemuIde/Temperature-sensor-side | 0911274d03a99c5519c63252120af1d8eb62781d | [
"MIT"
] | null | null | null | past development/python/tempcheck_v2.py | TemuIde/Temperature-sensor-side | 0911274d03a99c5519c63252120af1d8eb62781d | [
"MIT"
] | null | null | null | past development/python/tempcheck_v2.py | TemuIde/Temperature-sensor-side | 0911274d03a99c5519c63252120af1d8eb62781d | [
"MIT"
] | null | null | null | from numbers import Number
import math
from m5stack import *
from m5ui import *
from uiflow import *
import hat
import urequests
import time
import unit
import hat
from easyIO import *
'''
Setup values
'''
setScreenColor(0xffffff)
ncir0 = unit.get(unit.NCIR, unit.PORTA)
#ncir0 = hat.get(hat.NCIR)
hat_spk0 = hat.get(ha... | 22.239726 | 91 | 0.610102 | from numbers import Number
import math
from m5stack import *
from m5ui import *
from uiflow import *
import hat
import urequests
import time
import unit
import hat
from easyIO import *
'''
Setup values
'''
setScreenColor(0xffffff)
ncir0 = unit.get(unit.NCIR, unit.PORTA)
hat_spk0 = hat.get(hat.SPEAKER)
Record = None
Cu... | false | true |
1c0f91e5b4ba2e19b56b2169d0195ffa3d3487ea | 3,734 | py | Python | ngspy/SlidingBox.py | manuSrep/ngspy | fe5882f011ba801bfb225953a8233cb24b8baa50 | [
"BSD-2-Clause"
] | null | null | null | ngspy/SlidingBox.py | manuSrep/ngspy | fe5882f011ba801bfb225953a8233cb24b8baa50 | [
"BSD-2-Clause"
] | null | null | null | ngspy/SlidingBox.py | manuSrep/ngspy | fe5882f011ba801bfb225953a8233cb24b8baa50 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf8 -*-
"""
Functions and classes for handling next generation sequencing data.
:author: Manuel Tuschen
:license: FreeBSD
License
----------
Copyright (c) 2016, Manuel Tuschen
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are per... | 32.469565 | 82 | 0.668452 |
from __future__ import division, absolute_import, unicode_literals, print_function
from .Formats import BED, BEDEntry
def sliding_box(start, stop, size, step=1):
if (stop - start) / step != 0:
overhead = (stop-start) % step
if overhead % 2 == 0:
start += overhead // 2
... | true | true |
1c0f92fe5d909d916090e613bcd2dd7f117df7a2 | 402 | py | Python | need2fix/app/migrations/0004_task_phone_contact.py | scitu/need2fix | ff30212dbc76310eb41a7112f292928a4402c508 | [
"MIT"
] | null | null | null | need2fix/app/migrations/0004_task_phone_contact.py | scitu/need2fix | ff30212dbc76310eb41a7112f292928a4402c508 | [
"MIT"
] | 7 | 2020-06-05T19:11:48.000Z | 2022-03-11T23:31:15.000Z | need2fix/app/migrations/0004_task_phone_contact.py | scitu/need2fix | ff30212dbc76310eb41a7112f292928a4402c508 | [
"MIT"
] | 1 | 2018-10-09T11:46:06.000Z | 2018-10-09T11:46:06.000Z | # Generated by Django 2.0.6 on 2018-09-25 08:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0003_task_contact'),
]
operations = [
migrations.AddField(
model_name='task',
name='phone_contact',
... | 21.157895 | 73 | 0.599502 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0003_task_contact'),
]
operations = [
migrations.AddField(
model_name='task',
name='phone_contact',
field=models.CharField(blank=True, max_length... | true | true |
1c0f966a231d85e5fbb4931382628fb5f0d7d0f7 | 3,794 | py | Python | cogs/fun.py | xSOGIx/Seina | 5972992e11b7ce15513b1cfcd430e3a28b2a49e1 | [
"MIT"
] | 1 | 2021-11-10T10:41:51.000Z | 2021-11-10T10:41:51.000Z | cogs/fun.py | xSOGIx/Seina | 5972992e11b7ce15513b1cfcd430e3a28b2a49e1 | [
"MIT"
] | null | null | null | cogs/fun.py | xSOGIx/Seina | 5972992e11b7ce15513b1cfcd430e3a28b2a49e1 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
import random
import aiohttp
import secrets
import asyncio
class Fun(commands.Cog):
'''**Fun commands for fun **<:UV_esmile:792060488887566416>'''
def __init__(self, bot):
self.bot = bot
@command... | 37.94 | 178 | 0.599895 | import discord
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
import random
import aiohttp
import secrets
import asyncio
class Fun(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def dice(self, ctx, number=1):
if num... | true | true |
1c0f9719b24eee883815e6ef8e4d8bbbf4d177bc | 49 | py | Python | pybda/util/__init__.py | OxfordSKA/bda | 0f92bead29a26d18fddaf5eb2ecd6f6d92401c2d | [
"BSD-3-Clause"
] | 2 | 2019-11-22T18:39:49.000Z | 2020-03-13T04:03:50.000Z | pybda/util/__init__.py | OxfordSKA/bda | 0f92bead29a26d18fddaf5eb2ecd6f6d92401c2d | [
"BSD-3-Clause"
] | null | null | null | pybda/util/__init__.py | OxfordSKA/bda | 0f92bead29a26d18fddaf5eb2ecd6f6d92401c2d | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
__all__ = ["fits_diff"]
| 12.25 | 23 | 0.530612 |
__all__ = ["fits_diff"]
| true | true |
1c0f97783e7a336390324516f2ba8e89d1dcfaf1 | 23,741 | py | Python | glide_text2im/gaussian_diffusion.py | dbanys/glide-text2im | 5177545ec62f1fddc3075a8a69b63df3eb2256a5 | [
"MIT"
] | 2,139 | 2021-12-21T02:04:22.000Z | 2022-03-31T08:33:23.000Z | glide_text2im/gaussian_diffusion.py | Binxly/glide-text2im | 9cc8e563851bd38f5ddb3e305127192cb0f02f5c | [
"MIT"
] | 28 | 2021-12-21T02:22:26.000Z | 2022-03-31T09:39:26.000Z | glide_text2im/gaussian_diffusion.py | Binxly/glide-text2im | 9cc8e563851bd38f5ddb3e305127192cb0f02f5c | [
"MIT"
] | 291 | 2021-12-21T02:08:48.000Z | 2022-03-28T21:07:24.000Z | """
Simplified from https://github.com/openai/guided-diffusion/blob/main/guided_diffusion/gaussian_diffusion.py.
"""
import math
import numpy as np
import torch as th
def _warmup_beta(beta_start, beta_end, num_diffusion_timesteps, warmup_frac):
betas = beta_end * np.ones(num_diffusion_timesteps, dtype=np.float6... | 37.095313 | 129 | 0.59711 |
import math
import numpy as np
import torch as th
def _warmup_beta(beta_start, beta_end, num_diffusion_timesteps, warmup_frac):
betas = beta_end * np.ones(num_diffusion_timesteps, dtype=np.float64)
warmup_time = int(num_diffusion_timesteps * warmup_frac)
betas[:warmup_time] = np.linspace(beta_start, bet... | true | true |
1c0f97d4adfc33c3b2968c90c194decb121d8fbb | 12,459 | py | Python | tests/integration/goldens/logging/docs/conf.py | LaudateCorpus1/gapic-generator-python | 4f4ad394374326a74ceefd2c37c54e228d74ba8d | [
"Apache-2.0"
] | null | null | null | tests/integration/goldens/logging/docs/conf.py | LaudateCorpus1/gapic-generator-python | 4f4ad394374326a74ceefd2c37c54e228d74ba8d | [
"Apache-2.0"
] | null | null | null | tests/integration/goldens/logging/docs/conf.py | LaudateCorpus1/gapic-generator-python | 4f4ad394374326a74ceefd2c37c54e228d74ba8d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 33.047745 | 87 | 0.705514 |
import sys
import os
import shlex
sys.path.insert(0, os.path.abspath(".."))
__version__ = "0.1.0"
needs_sphinx = "4.0.1"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.coverage",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext... | true | true |
1c0f9839a959fd5e528da6f74bf80fd539a6107b | 7,414 | py | Python | fpn/core/rcnn.py | CosmosHua/Deformable-ConvNets | 6aeda878a95bcb55eadffbe125804e730574de8d | [
"MIT"
] | 3,976 | 2017-05-05T13:48:27.000Z | 2022-03-30T13:37:48.000Z | fpn/core/rcnn.py | sibinglong/Deformable-ConvNets | 6aeda878a95bcb55eadffbe125804e730574de8d | [
"MIT"
] | 259 | 2017-05-06T13:30:11.000Z | 2022-03-16T14:11:16.000Z | fpn/core/rcnn.py | sibinglong/Deformable-ConvNets | 6aeda878a95bcb55eadffbe125804e730574de8d | [
"MIT"
] | 1,051 | 2017-05-05T14:55:57.000Z | 2022-03-23T01:02:47.000Z | # --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Modified by Haozhi Qi
# --------------------------------------------------------
# Based on:
# MX-RCNN
# Copyright (c) 2016 by Contri... | 38.614583 | 113 | 0.664554 |
import numpy as np
import numpy.random as npr
from utils.image import get_image, tensor_vstack
from bbox.bbox_transform import bbox_overlaps, bbox_transform
from bbox.bbox_regression import expand_bbox_regression_targets
def get_rcnn_testbatch(roidb, cfg):
imgs, roidb = get_image(roidb, cfg)
im_array = ... | true | true |
1c0f9a9fc2cce077914d2e45ac046fa266435af4 | 3,660 | py | Python | problems/data/parsing.py | xcsp3team/pycsp3 | a11bc370e34cd3fe37faeae9a5df935fcbd7770d | [
"MIT"
] | 28 | 2019-12-14T09:25:52.000Z | 2022-03-24T08:15:13.000Z | problems/data/parsing.py | xcsp3team/pycsp3 | a11bc370e34cd3fe37faeae9a5df935fcbd7770d | [
"MIT"
] | 7 | 2020-04-15T11:02:07.000Z | 2022-01-20T12:48:54.000Z | problems/data/parsing.py | xcsp3team/pycsp3 | a11bc370e34cd3fe37faeae9a5df935fcbd7770d | [
"MIT"
] | 3 | 2020-04-15T08:23:45.000Z | 2021-12-07T14:02:28.000Z | import os.path
import re
from collections import OrderedDict
from pycsp3.dashboard import options
data = None
_dataParser = None
def register_fields(data_value):
global data, _dataParser
data = OrderedDict()
_dataParser = DataParser(data_value)
return data
class DataParser:
def __init__(self, ... | 27.938931 | 142 | 0.615574 | import os.path
import re
from collections import OrderedDict
from pycsp3.dashboard import options
data = None
_dataParser = None
def register_fields(data_value):
global data, _dataParser
data = OrderedDict()
_dataParser = DataParser(data_value)
return data
class DataParser:
def __init__(self, ... | true | true |
1c0f9b48c2a59de0a279edd5a976af1f63e2cf27 | 486 | py | Python | tests/test_fab.py | codema-dev/seai_deap | 52b67582beac8d8a2b46b5991970b6ad6695f7b3 | [
"MIT"
] | null | null | null | tests/test_fab.py | codema-dev/seai_deap | 52b67582beac8d8a2b46b5991970b6ad6695f7b3 | [
"MIT"
] | null | null | null | tests/test_fab.py | codema-dev/seai_deap | 52b67582beac8d8a2b46b5991970b6ad6695f7b3 | [
"MIT"
] | 1 | 2020-11-20T11:22:36.000Z | 2020-11-20T11:22:36.000Z | import numpy as np
from numpy.testing import assert_array_equal
from seai_deap import fab
def test_calculate_thermal_bridging() -> None:
expected_output = np.array(0.75)
output = fab.calculate_thermal_bridging(
wall_area=np.array(1),
roof_area=np.array(1),
floor_area=np.array(1),
... | 22.090909 | 47 | 0.6893 | import numpy as np
from numpy.testing import assert_array_equal
from seai_deap import fab
def test_calculate_thermal_bridging() -> None:
expected_output = np.array(0.75)
output = fab.calculate_thermal_bridging(
wall_area=np.array(1),
roof_area=np.array(1),
floor_area=np.array(1),
... | true | true |
1c0f9cd489195e4b58de9a39287215569854714c | 3,236 | py | Python | pretraining/setup.py | patrick-g-zhang/MPNet | dde76b7c833345a625dc4f21a1526080a084b9ed | [
"MIT"
] | 203 | 2020-04-21T01:47:06.000Z | 2022-03-26T15:57:57.000Z | pretraining/setup.py | michael-wzhu/mpnet_zh | 7788b5883c8d3037215d7c0b939b6e9b6e5f4bca | [
"MIT"
] | 15 | 2020-04-21T12:21:20.000Z | 2022-02-13T14:04:08.000Z | pretraining/setup.py | michael-wzhu/mpnet_zh | 7788b5883c8d3037215d7c0b939b6e9b6e5f4bca | [
"MIT"
] | 24 | 2020-04-21T10:33:39.000Z | 2022-03-22T08:06:49.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from setuptools import setup, find_packages, Extension
import sys
if sys.version_info < (3,):
sys.exit('Sorry, Py... | 27.65812 | 69 | 0.618356 |
from setuptools import setup, find_packages, Extension
import sys
if sys.version_info < (3,):
sys.exit('Sorry, Python3 is required for fairseq.')
with open('README.md') as f:
readme = f.read()
if sys.platform == 'darwin':
extra_compile_args = ['-stdlib=libc++', '-O3']
else:
extra_compile_args = [... | true | true |
1c0f9e7e47da05a0c7915873f4c808624bf86aad | 447 | py | Python | setup.py | lnijhawan/ipyradiant | d804e9031ef39c1ea75fedd52d110302c065ad84 | [
"BSD-3-Clause"
] | 5 | 2021-02-12T14:55:49.000Z | 2022-03-21T21:30:54.000Z | setup.py | lnijhawan/ipyradiant | d804e9031ef39c1ea75fedd52d110302c065ad84 | [
"BSD-3-Clause"
] | 92 | 2020-07-24T20:17:22.000Z | 2022-02-18T13:35:56.000Z | setup.py | lnijhawan/ipyradiant | d804e9031ef39c1ea75fedd52d110302c065ad84 | [
"BSD-3-Clause"
] | 6 | 2020-07-28T18:28:07.000Z | 2022-01-19T11:39:51.000Z | """ packaging information for ipyradiant
"""
# Copyright (c) 2021 ipyradiant contributors.
# Distributed under the terms of the Modified BSD License.
import re
import sys
from pathlib import Path
import setuptools
if __name__ == "__main__":
setuptools.setup(
version=re.findall(
r"""__version_... | 23.526316 | 87 | 0.630872 |
import re
import sys
from pathlib import Path
import setuptools
if __name__ == "__main__":
setuptools.setup(
version=re.findall(
r"""__version__ = "([^"]+)"$""",
(Path(__file__).parent / "src" / "ipyradiant" / "_version.py").read_text(),
)[0],
)
| true | true |
1c0f9f043281ab8a451a88f0768982f7cc9ea35b | 1,928 | py | Python | dataloader.py | alexacarlson/pggan-pytorch | 96600b13dbda732b7c2737ee0e15c47bc239d7ca | [
"MIT"
] | null | null | null | dataloader.py | alexacarlson/pggan-pytorch | 96600b13dbda732b7c2737ee0e15c47bc239d7ca | [
"MIT"
] | null | null | null | dataloader.py | alexacarlson/pggan-pytorch | 96600b13dbda732b7c2737ee0e15c47bc239d7ca | [
"MIT"
] | null | null | null | import os
import torch as torch
import numpy as np
from io import BytesIO
import scipy.misc
#import tensorflow as tf
import torchvision
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from torchvision.datasets import ImageFolder
from torch.autograd import Variable
#from matplotlib im... | 28.776119 | 140 | 0.585062 | import os
import torch as torch
import numpy as np
from io import BytesIO
import scipy.misc
import torchvision
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from torchvision.datasets import ImageFolder
from torch.autograd import Variable
from PIL import Image
class dataloader:
... | true | true |
1c0f9fc5bf34f765c402837daf2304453fed1dab | 9,055 | py | Python | knowledge_base/cnf.py | jakubro/knowledge_base | 07efafef728a70866ef2466f94876cca91088bf6 | [
"MIT"
] | null | null | null | knowledge_base/cnf.py | jakubro/knowledge_base | 07efafef728a70866ef2466f94876cca91088bf6 | [
"MIT"
] | null | null | null | knowledge_base/cnf.py | jakubro/knowledge_base | 07efafef728a70866ef2466f94876cca91088bf6 | [
"MIT"
] | null | null | null | import copy
import uuid
from typing import List, Tuple, Union
from knowledge_base import syntax, unification
T_Value = Union[str, syntax.Node]
T_Children = List[syntax.Node]
def convert_to_cnf(node: syntax.Node) -> Tuple[syntax.Node,
syntax.T_Substitution]:
"""Conv... | 27.691131 | 79 | 0.592269 | import copy
import uuid
from typing import List, Tuple, Union
from knowledge_base import syntax, unification
T_Value = Union[str, syntax.Node]
T_Children = List[syntax.Node]
def convert_to_cnf(node: syntax.Node) -> Tuple[syntax.Node,
syntax.T_Substitution]:
if not... | true | true |
1c0fa0a9f0292ff55008f8e701db56664f8336d8 | 5,904 | py | Python | examples/initialization.py | mcgibbon/marble | 801abdf65e112203d2b3c8983b0f73b0a4c821da | [
"BSD-3-Clause"
] | 3 | 2019-07-08T16:33:44.000Z | 2019-09-03T18:34:25.000Z | examples/initialization.py | mcgibbon/marble | 801abdf65e112203d2b3c8983b0f73b0a4c821da | [
"BSD-3-Clause"
] | null | null | null | examples/initialization.py | mcgibbon/marble | 801abdf65e112203d2b3c8983b0f73b0a4c821da | [
"BSD-3-Clause"
] | null | null | null | import xarray as xr
import sympl
import numpy as np
from marble import InputHeightToPrincipalComponents, convert_height_to_principal_components
import os
height_to_pc = InputHeightToPrincipalComponents()
data_path = os.path.join(
os.path.dirname(
os.path.realpath(__file__)
),
'data',
)
column_fil... | 46.125 | 117 | 0.680217 | import xarray as xr
import sympl
import numpy as np
from marble import InputHeightToPrincipalComponents, convert_height_to_principal_components
import os
height_to_pc = InputHeightToPrincipalComponents()
data_path = os.path.join(
os.path.dirname(
os.path.realpath(__file__)
),
'data',
)
column_fil... | true | true |
1c0fa0f3b405d64995c4ac011e54c4eabdf18de0 | 2,574 | py | Python | pysatdnn/smt_methods.py | neale/PySATDNN | 85ed9f416702dc9bcbaf3e0a2e93af2ad1fdeee9 | [
"MIT"
] | 1 | 2021-10-05T13:14:27.000Z | 2021-10-05T13:14:27.000Z | pysatdnn/smt_methods.py | neale/PySATDNN | 85ed9f416702dc9bcbaf3e0a2e93af2ad1fdeee9 | [
"MIT"
] | 1 | 2021-04-30T21:16:59.000Z | 2021-04-30T21:16:59.000Z | pysatdnn/smt_methods.py | neale/PySATDNN | 85ed9f416702dc9bcbaf3e0a2e93af2ad1fdeee9 | [
"MIT"
] | null | null | null | ######################################
# smt_methods.py
# main core for evaluting the 2 node neural network
# given training data, finds a satisfying assignment to the formula
# uses the Z3 solver to get weights from the formula
######################################
from pysmt.shortcuts import Symbol, LE, GE, And, Int... | 36.771429 | 87 | 0.632479 | from pysmt.shortcuts import Symbol, LE, GE, And, Int, Real, Equals, Plus, Bool
from pysmt.shortcuts import Solver, Not, is_sat, get_model, Iff, Times
from pysmt.typing import BOOL, REAL, INT
import numpy as np
import argparse
from utils import timed
def create_smt_formula(data, labels, dim, n_weights):
weights = [... | true | true |
1c0fa182b10071be3f979ae029dcef6c4d04e2c6 | 383 | py | Python | mysite/core/migrations/0002_auto_20210421_1533.py | ahesselgesser/TeamAAA | 0b92da706dbb7dcca39af20468edce084a65faa3 | [
"MIT"
] | null | null | null | mysite/core/migrations/0002_auto_20210421_1533.py | ahesselgesser/TeamAAA | 0b92da706dbb7dcca39af20468edce084a65faa3 | [
"MIT"
] | 1 | 2021-02-22T23:51:08.000Z | 2021-02-22T23:51:08.000Z | mysite/core/migrations/0002_auto_20210421_1533.py | ahesselgesser/TeamAAA | 0b92da706dbb7dcca39af20468edce084a65faa3 | [
"MIT"
] | 1 | 2021-02-04T00:20:54.000Z | 2021-02-04T00:20:54.000Z | # Generated by Django 2.1.3 on 2021-04-21 20:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='report',
name='year',
field=... | 20.157895 | 63 | 0.587467 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='report',
name='year',
field=models.CharField(blank=True, max_length=100),
... | true | true |
1c0fa300d8fef27f22fd72a4cbf7641f44f61197 | 15,491 | py | Python | multifil/aws/run.py | akschroer/multifil | 870201b3c759035e1df8689703412b4fabf548ee | [
"MIT"
] | 1 | 2019-04-17T20:09:27.000Z | 2019-04-17T20:09:27.000Z | multifil/aws/run.py | akschroer/multifil | 870201b3c759035e1df8689703412b4fabf548ee | [
"MIT"
] | 1 | 2021-11-24T16:05:31.000Z | 2021-11-24T16:05:31.000Z | multifil/aws/run.py | akschroer/multifil | 870201b3c759035e1df8689703412b4fabf548ee | [
"MIT"
] | 3 | 2017-01-20T23:58:40.000Z | 2019-04-19T15:55:10.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
run.py - control a run
run.manage controls a run, locally on laptop or locally on an aws node, in
either case without needing to know where it is running. It takes in a meta file
produced by setup_run.emit and uses it to configure a sarcomere
run.sarc_file manages recording... | 37.875306 | 80 | 0.59938 |
import sys
import os
import shutil
import subprocess
import time
import ujson as json
import multiprocessing as mp
import boto
import numpy as np
from .. import hs
class manage:
def __init__(self, metafile, unattended=True):
self.s3 = s3()
self.uuid = metafile.split('/')[-1].split('.')[0]
... | true | true |
1c0fa3c5ca28c458c1d5ba73fbdd6787f432b12f | 144,624 | py | Python | bottle.py | eric-wieser/bottle | aa2014673ab84bdad3fdcffc17d92a014dc5ff37 | [
"MIT"
] | null | null | null | bottle.py | eric-wieser/bottle | aa2014673ab84bdad3fdcffc17d92a014dc5ff37 | [
"MIT"
] | null | null | null | bottle.py | eric-wieser/bottle | aa2014673ab84bdad3fdcffc17d92a014dc5ff37 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bottle is a fast and simple micro-framework for small web applications. It
offers request dispatching (Routes) with url parameter support, templates,
a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and
template engines - all in a single file an... | 39.385621 | 122 | 0.59179 |
from __future__ import with_statement
__author__ = 'Marcel Hellkamp'
__version__ = '0.13-dev'
__license__ = 'MIT'
if __name__ == '__main__':
from optparse import OptionParser
_cmd_parser = OptionParser(usage="usage: %prog [options] package.module:app")
_opt = _cmd_parser.add_option
_opt("--version", ... | true | true |
1c0fa3d71f29a5e9ea85cc8109456c0500803b7d | 1,204 | py | Python | criteria/lpips/lpips.py | rahuls02/Image-Noise-Reduction | e2fecf2c84f83de812cc2b9cb391ccec1b4b3dc6 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | 1 | 2021-07-16T20:35:29.000Z | 2021-07-16T20:35:29.000Z | criteria/lpips/lpips.py | rahuls02/Image-Noise-Reduction | e2fecf2c84f83de812cc2b9cb391ccec1b4b3dc6 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | null | null | null | criteria/lpips/lpips.py | rahuls02/Image-Noise-Reduction | e2fecf2c84f83de812cc2b9cb391ccec1b4b3dc6 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | 1 | 2021-12-04T02:30:28.000Z | 2021-12-04T02:30:28.000Z | import torch
import torch.nn as nn
from criteria.lpips.networks import get_network, LinLayers
from criteria.lpips.utils import get_state_dict
class LPIPS(nn.Module):
r"""Creates a criterion that measures
Learned Perceptual Image Patch Similarity (LPIPS).
Arguments:
net_type (str): the network typ... | 32.540541 | 71 | 0.624585 | import torch
import torch.nn as nn
from criteria.lpips.networks import get_network, LinLayers
from criteria.lpips.utils import get_state_dict
class LPIPS(nn.Module):
def __init__(self, net_type: str = "alex", version: str = "0.1"):
assert version in ["0.1"], "v0.1 is only supported now"
super(... | true | true |
1c0fa44b2aba52482d795d3f5130f13e2e80e408 | 2,673 | py | Python | reproducer/entry.py | kingdido999/bugswarm | 8ff2b3e71ca2598c354e8481c6b887cd5988816a | [
"BSD-3-Clause"
] | null | null | null | reproducer/entry.py | kingdido999/bugswarm | 8ff2b3e71ca2598c354e8481c6b887cd5988816a | [
"BSD-3-Clause"
] | null | null | null | reproducer/entry.py | kingdido999/bugswarm | 8ff2b3e71ca2598c354e8481c6b887cd5988816a | [
"BSD-3-Clause"
] | null | null | null | import getopt
import logging
import os
import sys
from bugswarm.common import log
from bugswarm.common.utils import get_current_component_version_message
from job_reproducer import JobReproducer
from image_packager import ImagePackager
def main(argv=None):
argv = argv or sys.argv
# Configure logging.
l... | 32.204819 | 119 | 0.626637 | import getopt
import logging
import os
import sys
from bugswarm.common import log
from bugswarm.common.utils import get_current_component_version_message
from job_reproducer import JobReproducer
from image_packager import ImagePackager
def main(argv=None):
argv = argv or sys.argv
log.config_logging(get... | true | true |
1c0fa46db6149275c2420adfa2c6acadc01f27c1 | 31,054 | py | Python | dashboard/models.py | Firmicety/fomalhaut-panel | 3e662db65a7ca654f75a19e38cb0931be21f92e9 | [
"MIT"
] | null | null | null | dashboard/models.py | Firmicety/fomalhaut-panel | 3e662db65a7ca654f75a19e38cb0931be21f92e9 | [
"MIT"
] | null | null | null | dashboard/models.py | Firmicety/fomalhaut-panel | 3e662db65a7ca654f75a19e38cb0931be21f92e9 | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# created by restran on 2016/1/2
from __future__ import unicode_literals, absolute_import
from datetime import datetime, timedelta
from future.moves.urllib.parse import urlparse
from common.utils import text_type, BytesIO, utf8
from bson import ObjectId
from base64 impor... | 31.27291 | 106 | 0.581117 |
from __future__ import unicode_literals, absolute_import
from datetime import datetime, timedelta
from future.moves.urllib.parse import urlparse
from common.utils import text_type, BytesIO, utf8
from bson import ObjectId
from base64 import b64decode
from django.db import models
import gridfs
from django.core.validato... | true | true |
1c0fa696533ffa9356f96de6451ad369c0cc5bec | 37,870 | py | Python | src/webpy1/src/spider/ganji.py | ptphp/PyLib | 07ac99cf2deb725475f5771b123b9ea1375f5e65 | [
"Apache-2.0"
] | 1 | 2020-02-17T08:18:29.000Z | 2020-02-17T08:18:29.000Z | src/webpy1/src/spider/ganji.py | ptphp/PyLib | 07ac99cf2deb725475f5771b123b9ea1375f5e65 | [
"Apache-2.0"
] | null | null | null | src/webpy1/src/spider/ganji.py | ptphp/PyLib | 07ac99cf2deb725475f5771b123b9ea1375f5e65 | [
"Apache-2.0"
] | null | null | null | #coding=UTF-8
'''
Created on 2011-7-6
@author: Administrator
'''
from urlparse import urlparse
import cookielib
from pyquery.pyquery import PyQuery #@UnresolvedImport
import re
import datetime #@UnusedImport
import urllib2
from lxml import etree #@UnresolvedImport
from lxml.cssselect import CSSSelector #@Unresolv... | 40.287234 | 154 | 0.528439 | '''
Created on 2011-7-6
@author: Administrator
'''
from urlparse import urlparse
import cookielib
from pyquery.pyquery import PyQuery import re
import datetime import urllib2
from lxml import etree
from lxml.cssselect import CSSSelector
import simplejson as js
from config import housetype, checkPath, makePath,f... | false | true |
1c0fa7eefa7bd6136c5a6608bc2132bcedd3a06f | 16,116 | py | Python | examples/soce_python/sawtooth_soce/soce_cli.py | gsi-upm/sawtooth-soce | ff9a8e396d91d6ce5a35803dcf8a10826dc5f0ed | [
"Apache-2.0"
] | null | null | null | examples/soce_python/sawtooth_soce/soce_cli.py | gsi-upm/sawtooth-soce | ff9a8e396d91d6ce5a35803dcf8a10826dc5f0ed | [
"Apache-2.0"
] | null | null | null | examples/soce_python/sawtooth_soce/soce_cli.py | gsi-upm/sawtooth-soce | ff9a8e396d91d6ce5a35803dcf8a10826dc5f0ed | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 28.373239 | 93 | 0.649913 |
from __future__ import print_function
import argparse
import getpass
import logging
import os
import traceback
import sys
import pkg_resources
from colorlog import ColoredFormatter
from sawtooth_soce.soce_client import SoceClient
from sawtooth_soce.soce_exceptions import SoceException
DISTRIBUTION_NAME = 'sawtoot... | true | true |
1c0fa7f58e57bf621e86cfc89e956c1ebc0e9e49 | 1,105 | py | Python | python/akg/ms/gpu/squeeze.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | 1 | 2020-08-31T02:43:43.000Z | 2020-08-31T02:43:43.000Z | python/akg/ms/gpu/squeeze.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | null | null | null | python/akg/ms/gpu/squeeze.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 34.53125 | 102 | 0.723982 |
import akg.topi as topi
import akg
@akg.schedule(topi.cuda.schedule_injective)
def Squeeze(x, axis=None):
return topi.squeeze(x, axis)
| true | true |
1c0fa92a35d7f3e8daa5b1b529330a197de155ca | 341 | py | Python | drf_nested_forms/__init__.py | samitnuk/nested_formdata | bc5774aff0e5d3e51bdf7962492b018009723735 | [
"MIT"
] | null | null | null | drf_nested_forms/__init__.py | samitnuk/nested_formdata | bc5774aff0e5d3e51bdf7962492b018009723735 | [
"MIT"
] | null | null | null | drf_nested_forms/__init__.py | samitnuk/nested_formdata | bc5774aff0e5d3e51bdf7962492b018009723735 | [
"MIT"
] | null | null | null | __title__ = 'drf_nested_formdata'
__version__ = '1.1.1'
__author__ = 'Duke Effiom'
__license__ = 'MIT'
__copyright__ = 'Copyright 2021'
# Version synonym
from .exceptions import ParseException
from .parsers import NestedMultiPartParser, NestedJSONParser
from .mixins import UtilityMixin
from .utils import NestedForms
V... | 26.230769 | 60 | 0.809384 | __title__ = 'drf_nested_formdata'
__version__ = '1.1.1'
__author__ = 'Duke Effiom'
__license__ = 'MIT'
__copyright__ = 'Copyright 2021'
from .exceptions import ParseException
from .parsers import NestedMultiPartParser, NestedJSONParser
from .mixins import UtilityMixin
from .utils import NestedForms
VERSION = __version... | true | true |
1c0fa9f99563f671bc748c167bdc5e55b62040ad | 70 | py | Python | plugins/twitter/komand_twitter/triggers/messages/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/twitter/komand_twitter/triggers/messages/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/twitter/komand_twitter/triggers/messages/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
from .trigger import Messages
| 23.333333 | 39 | 0.771429 | from .trigger import Messages
| true | true |
1c0fab2f0d04660221850e04133cb4da7e9e9641 | 1,336 | py | Python | General Data Preprocessing/excel2csv.py | yuxiawang1992/Python-Code | d457a1fd61742dfac08a82a26b66703e5ff6f780 | [
"Apache-2.0"
] | null | null | null | General Data Preprocessing/excel2csv.py | yuxiawang1992/Python-Code | d457a1fd61742dfac08a82a26b66703e5ff6f780 | [
"Apache-2.0"
] | null | null | null | General Data Preprocessing/excel2csv.py | yuxiawang1992/Python-Code | d457a1fd61742dfac08a82a26b66703e5ff6f780 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 依赖openpyxl库:http://openpyxl.readthedocs.org/en/latest/
"""
Created on Tue Sep 20 23:50:54 2016
@author: wangyuxia
@function: convert the excel format(.xlsx) to the csv format
"""
from openpyxl import load_workbook
import csv
import os
def xlsx2csv(filename):
try:
xlsx_file_reader =... | 31.809524 | 69 | 0.601796 |
from openpyxl import load_workbook
import csv
import os
def xlsx2csv(filename):
try:
xlsx_file_reader = load_workbook(filename=filename)
for sheet in xlsx_file_reader.get_sheet_names():
csv_filename = '{xlsx}.csv'.format(
xlsx=os.path.splitext(filename.replace(' ', '_'))[0],
... | true | true |
1c0fac04111750c5c5343da25619a41218b35673 | 18,828 | py | Python | greybody.py | kevinlacaille/Intrinsic-Galaxy-Properties | 02705ef9862dff5abef1e2e26d2d9e1dc367cb7e | [
"MIT"
] | 1 | 2019-01-31T21:53:51.000Z | 2019-01-31T21:53:51.000Z | greybody.py | kevinlacaille/Intrinsic-Galaxy-Properties | 02705ef9862dff5abef1e2e26d2d9e1dc367cb7e | [
"MIT"
] | null | null | null | greybody.py | kevinlacaille/Intrinsic-Galaxy-Properties | 02705ef9862dff5abef1e2e26d2d9e1dc367cb7e | [
"MIT"
] | 1 | 2022-03-15T11:43:33.000Z | 2022-03-15T11:43:33.000Z | import matplotlib.pyplot as pl
import numpy as np
from scipy.optimize import curve_fit
from scipy.integrate import quad
from scipy.stats import chisquare
# -----------------------------------------------------------------
# universal constants and units
c = 2.99792458e8 # m/s
h = 6.62606957e-34 # J s
k = ... | 47.306533 | 280 | 0.639314 | import matplotlib.pyplot as pl
import numpy as np
from scipy.optimize import curve_fit
from scipy.integrate import quad
from scipy.stats import chisquare
c = 2.99792458e8 h = 6.62606957e-34 k = 1.3806488e-23 pc = 3.08567758e16 Msun = 1.9891e30
kappa350_Cortese = 0.192 kappa350_Zubko ... | false | true |
1c0fac37c723905042a6c46e609a3113b1f59cd6 | 12,097 | py | Python | tenable/sc/scan_instances.py | allenmichael/pyTenable | 8372cfdf3ced99de50227f6fbb37d6db2b26291e | [
"MIT"
] | null | null | null | tenable/sc/scan_instances.py | allenmichael/pyTenable | 8372cfdf3ced99de50227f6fbb37d6db2b26291e | [
"MIT"
] | 1 | 2021-08-18T17:26:30.000Z | 2021-08-18T17:26:30.000Z | tenable/sc/scan_instances.py | allenmichael/pyTenable | 8372cfdf3ced99de50227f6fbb37d6db2b26291e | [
"MIT"
] | null | null | null | '''
scan_instances
==============
The following methods allow for interaction into the Tenable.sc
:sc-api:`Scan Result <Scan-Result.html>` API. While the Tenable.sc API refers
to the model these endpoints interact with as *ScanResult*, were actually
interacting with an instance of a scan definition stored within the ... | 34.962428 | 108 | 0.569811 | from .base import SCEndpoint
from tenable.utils import dict_merge
from io import BytesIO
class ScanResultAPI(SCEndpoint):
def copy(self, id, *users):
payload = dict()
if users:
payload['users'] = [{'id': self._check('user:id', u, int)} for u in users]
return self._api.post('scan... | true | true |
1c0facd0c53bee1dd3808a3d5074e6fb5e092e3f | 4,227 | py | Python | pinax/apps/tasks/tests/test_models.py | peiwei/pinax | 34f95b1df4318655fe9bd90dcda8fe824e0c4117 | [
"MIT"
] | 1 | 2019-02-12T04:45:09.000Z | 2019-02-12T04:45:09.000Z | pinax/apps/tasks/tests/test_models.py | alex/pinax | 37e17ee2e2eb0e387d8809c12e55c20194a7118a | [
"MIT"
] | null | null | null | pinax/apps/tasks/tests/test_models.py | alex/pinax | 37e17ee2e2eb0e387d8809c12e55c20194a7118a | [
"MIT"
] | 1 | 2019-02-12T04:45:40.000Z | 2019-02-12T04:45:40.000Z | # coding: utf-8
from django.test import TestCase
from django.contrib.auth.models import User
from tasks.models import Task, TaskHistory, Nudge
class TestTask(TestCase):
fixtures = ["test_tasks.json"]
def setUp(self):
self.task = Task.objects.get(pk__exact=1)
self.other_task = Task.obje... | 33.547619 | 93 | 0.610125 | from django.test import TestCase
from django.contrib.auth.models import User
from tasks.models import Task, TaskHistory, Nudge
class TestTask(TestCase):
fixtures = ["test_tasks.json"]
def setUp(self):
self.task = Task.objects.get(pk__exact=1)
self.other_task = Task.objects.get(pk__exac... | true | true |
1c0fae896d4c989aaaa33c2404ead73e7ccc1df5 | 5,484 | py | Python | azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/express_route_circuit_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/express_route_circuit_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/express_route_circuit_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.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 ... | 50.777778 | 405 | 0.692378 |
from .resource_py3 import Resource
class ExpressRouteCircuit(Resource):
_validation = {
'name': {'readonly': True},
'type': {'readonly': True},
'etag': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 's... | true | true |
1c0faee2f39d4714e5a5e67b7019b04ca807f7c0 | 5,375 | py | Python | file-sorter.py | HP-97/file-sorter | f6c8ed61bdd852c038ef6f565cc8d80e66bf993f | [
"MIT"
] | null | null | null | file-sorter.py | HP-97/file-sorter | f6c8ed61bdd852c038ef6f565cc8d80e66bf993f | [
"MIT"
] | null | null | null | file-sorter.py | HP-97/file-sorter | f6c8ed61bdd852c038ef6f565cc8d80e66bf993f | [
"MIT"
] | null | null | null | import yaml
import time
import os
import logging
import argparse
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
# Create and configure logger
# TODO: Make log path configurable
log = logging.getLogger(__name__)
script_name = os.path.splitext(os.path.basename(__file__))[0]
di... | 47.991071 | 1,003 | 0.495628 | import yaml
import time
import os
import logging
import argparse
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
log = logging.getLogger(__name__)
script_name = os.path.splitext(os.path.basename(__file__))[0]
dirpath = os.path.dirname(__file__)
logging.basicConfig(filename="{... | true | true |
1c0faf839387c0d1b403467a05e815a69a86e9d8 | 1,127 | py | Python | src/richie/plugins/simple_text_ckeditor/validators.py | Verisage/richie | 8a78d3bc6cde74d6252cbfc51a2d195e26be64fc | [
"MIT"
] | null | null | null | src/richie/plugins/simple_text_ckeditor/validators.py | Verisage/richie | 8a78d3bc6cde74d6252cbfc51a2d195e26be64fc | [
"MIT"
] | null | null | null | src/richie/plugins/simple_text_ckeditor/validators.py | Verisage/richie | 8a78d3bc6cde74d6252cbfc51a2d195e26be64fc | [
"MIT"
] | null | null | null | """Custom validators for the simple text editor plugin."""
from django.core.validators import BaseValidator
from django.utils.deconstruct import deconstructible
from django.utils.html import strip_spaces_between_tags, strip_tags
from django.utils.translation import ngettext_lazy
@deconstructible
class HTMLMaxLengthVa... | 38.862069 | 94 | 0.710736 | from django.core.validators import BaseValidator
from django.utils.deconstruct import deconstructible
from django.utils.html import strip_spaces_between_tags, strip_tags
from django.utils.translation import ngettext_lazy
@deconstructible
class HTMLMaxLengthValidator(BaseValidator):
message = ngettext_lazy(
... | true | true |
1c0fb00c0f429489da7a3d6ebfbedf7c077d680e | 2,237 | py | Python | setup.py | mrakitin/circular_buffer | 5da8bd4d94324b2460d44ed11036747a885550a5 | [
"BSD-3-Clause"
] | null | null | null | setup.py | mrakitin/circular_buffer | 5da8bd4d94324b2460d44ed11036747a885550a5 | [
"BSD-3-Clause"
] | null | null | null | setup.py | mrakitin/circular_buffer | 5da8bd4d94324b2460d44ed11036747a885550a5 | [
"BSD-3-Clause"
] | null | null | null | from os import path
from setuptools import setup, find_packages
import sys
import versioneer
# NOTE: This file must remain Python 2 compatible for the foreseeable future,
# to ensure that we error out properly for people with outdated setuptools
# and/or pip.
min_version = (3, 6)
if sys.version_info < min_version:
... | 32.897059 | 112 | 0.677246 | from os import path
from setuptools import setup, find_packages
import sys
import versioneer
min_version = (3, 6)
if sys.version_info < min_version:
error = """
py_circular_buffer does not support Python {0}.{1}.
Python {2}.{3} and above is required. Check your Python version like so:
python3 --version
This may... | true | true |
1c0fb02eca1560721c65318acd0e32d911a7a161 | 2,572 | py | Python | chmap/coronal_holes/detection/correct_images.py | predsci/CHD | 35f29d1b62861f4ffed57b38d18689b282664bcf | [
"Apache-2.0"
] | 3 | 2021-06-29T00:23:47.000Z | 2021-09-17T18:29:05.000Z | chmap/coronal_holes/detection/correct_images.py | predsci/CHD | 35f29d1b62861f4ffed57b38d18689b282664bcf | [
"Apache-2.0"
] | null | null | null | chmap/coronal_holes/detection/correct_images.py | predsci/CHD | 35f29d1b62861f4ffed57b38d18689b282664bcf | [
"Apache-2.0"
] | 1 | 2021-12-08T06:26:18.000Z | 2021-12-08T06:26:18.000Z | """
overarching pipeline to correct images
input: dataframe of images
output: array of corrected images
This function takes a lot of memory and is therefore slow:(
"""
import time
import datetime
import chmap.database.db_funs as db_funcs
import chmap.data.corrections.lbcc.LBCC_theoretic_funcs as lbcc_funcs
import chma... | 47.62963 | 127 | 0.596423 |
import time
import datetime
import chmap.database.db_funs as db_funcs
import chmap.data.corrections.lbcc.LBCC_theoretic_funcs as lbcc_funcs
import chmap.data.corrections.iit.IIT_pipeline_funcs as iit_funcs
def correct_euv_images(db_session, query_time_min, query_time_max, image_pd, inst_list, hdf_data_dir, n_intensi... | true | true |
1c0fb07fdc44c31706447eed2cd011f9b040a3d5 | 796 | py | Python | dicionario/migrations/0004_auto_20211211_0936.py | magalilemes/portuguesismos | 6a8d37fde0c80076446ed8f1473659eff5be1c00 | [
"MIT"
] | null | null | null | dicionario/migrations/0004_auto_20211211_0936.py | magalilemes/portuguesismos | 6a8d37fde0c80076446ed8f1473659eff5be1c00 | [
"MIT"
] | null | null | null | dicionario/migrations/0004_auto_20211211_0936.py | magalilemes/portuguesismos | 6a8d37fde0c80076446ed8f1473659eff5be1c00 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2021-12-11 12:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dicionario', '0003_auto_20211210_1159'),
]
operations = [
migrations.CreateModel(
name='Categoria',
fields=[
... | 26.533333 | 114 | 0.560302 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dicionario', '0003_auto_20211210_1159'),
]
operations = [
migrations.CreateModel(
name='Categoria',
fields=[
('id', models.AutoField(auto_created=Tr... | true | true |
1c0fb17d713369d591a1535a2fad0bfad42fe2fd | 1,269 | py | Python | cloudrunner_server/db/versions/46f78b0312d3_added_meta_column_for_revision.py | ttrifonov/cloudrunner-server | 3b2426c8d9987e78425899010b534afc7734d8d4 | [
"Apache-2.0"
] | 2 | 2016-03-31T08:45:29.000Z | 2021-04-28T15:18:45.000Z | cloudrunner_server/db/versions/46f78b0312d3_added_meta_column_for_revision.py | ttrifonov/cloudrunner-server | 3b2426c8d9987e78425899010b534afc7734d8d4 | [
"Apache-2.0"
] | null | null | null | cloudrunner_server/db/versions/46f78b0312d3_added_meta_column_for_revision.py | ttrifonov/cloudrunner-server | 3b2426c8d9987e78425899010b534afc7734d8d4 | [
"Apache-2.0"
] | null | null | null | """Added meta column for Revision
Revision ID: 46f78b0312d3
Revises: 43003fc2f2f4
Create Date: 2015-06-02 13:37:13.201031
"""
# revision identifiers, used by Alembic.
revision = '46f78b0312d3'
down_revision = '43003fc2f2f4'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.orm import sessionmaker
from... | 24.882353 | 78 | 0.665879 |
revision = '46f78b0312d3'
down_revision = '43003fc2f2f4'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.orm import sessionmaker
from cloudrunner_server.api.model import Script
_Session = sessionmaker()
def upgrade():
op.add_column(
'revisions', sa.Column('meta', sa.String(length=400... | true | true |
1c0fb238c018d0f926bd37f2fba51736f58f5dd9 | 10,366 | py | Python | py_img_seg_eval/unit_tests.py | PloxKevin/Weak-Supervision | 79bd8690309ec161c5e0d0a5715dfa61f7baf786 | [
"MIT"
] | 10 | 2019-07-24T12:23:05.000Z | 2022-01-06T04:08:54.000Z | py_img_seg_eval/unit_tests.py | PloxKevin/Weak-Supervision | 79bd8690309ec161c5e0d0a5715dfa61f7baf786 | [
"MIT"
] | null | null | null | py_img_seg_eval/unit_tests.py | PloxKevin/Weak-Supervision | 79bd8690309ec161c5e0d0a5715dfa61f7baf786 | [
"MIT"
] | 7 | 2019-04-08T17:46:08.000Z | 2022-02-25T11:06:59.000Z | #!/usr/bin/python
'''
Martin Kersner, m.kersner@gmail.com
2015/11/30
Unit tests for eval_segm.py.
'''
import numpy as np
import eval_segm as es
import unittest
class pixel_accuracy_UnitTests(unittest.TestCase):
'''
Wrong inputs
'''
def test1dInput(self):
mat = np.array([0])
self.asse... | 30.85119 | 95 | 0.516882 |
import numpy as np
import eval_segm as es
import unittest
class pixel_accuracy_UnitTests(unittest.TestCase):
def test1dInput(self):
mat = np.array([0])
self.assertRaises(IndexError, es.pixel_accuracy, mat, mat)
def testDiffDim(self):
mat0 = np.array([[0,0], [0,0]])
mat1 = np.... | true | true |
1c0fb399201eaadb9b0b9f40fc256c25c1089af4 | 3,551 | py | Python | plot_figures/plot_Fig1_2.py | saturnaxis/CBP_stability | 435d5bdb3212d5696d5fbf7cc6737476a08c476c | [
"MIT"
] | 2 | 2018-04-10T18:52:39.000Z | 2018-06-27T21:48:59.000Z | plot_figures/plot_Fig1_2.py | saturnaxis/CBP_stability | 435d5bdb3212d5696d5fbf7cc6737476a08c476c | [
"MIT"
] | null | null | null | plot_figures/plot_Fig1_2.py | saturnaxis/CBP_stability | 435d5bdb3212d5696d5fbf7cc6737476a08c476c | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import os
from scipy.interpolate import griddata
import matplotlib.colors as colors
from matplotlib import ticker
import matplotlib.cm as cm
import sys
from matplotlib import rcParams
rcParams.update({'font.size': 22})
fig_num = int(sys.argv[1])
cmap = cm.gnuplot_r
... | 30.612069 | 155 | 0.667981 | import numpy as np
import matplotlib.pyplot as plt
import os
from scipy.interpolate import griddata
import matplotlib.colors as colors
from matplotlib import ticker
import matplotlib.cm as cm
import sys
from matplotlib import rcParams
rcParams.update({'font.size': 22})
fig_num = int(sys.argv[1])
cmap = cm.gnuplot_r
... | true | true |
1c0fb3f10f2efed3f9905391055416d4ff3b09e7 | 1,102 | py | Python | py/lvmmodel/test/test_top_level.py | sdss/lvmmodel | 1ab52f51a172500f8a10e762c88b9929898e1b20 | [
"BSD-3-Clause"
] | null | null | null | py/lvmmodel/test/test_top_level.py | sdss/lvmmodel | 1ab52f51a172500f8a10e762c88b9929898e1b20 | [
"BSD-3-Clause"
] | null | null | null | py/lvmmodel/test/test_top_level.py | sdss/lvmmodel | 1ab52f51a172500f8a10e762c88b9929898e1b20 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
test top-level lvmmodel functions
"""
import unittest
import re
from .. import __version__ as theVersion
class TestTopLevel(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.versionre = re.compile(r'''... | 28.25641 | 73 | 0.544465 | import unittest
import re
from .. import __version__ as theVersion
class TestTopLevel(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.versionre = re.compile(r'''([0-9]+!)? # Epoch
([0-9]+) # Major
(\.[0-9]+)... | true | true |
1c0fb55bb2b0145d80f2400c1fd4100888398331 | 1,839 | py | Python | python/tests/test_information.py | Sandbergo/ecole | 2bab4d6a66e5d1932870f4cecbdc989b8fd17546 | [
"BSD-3-Clause"
] | 4 | 2021-10-17T00:26:12.000Z | 2021-12-06T08:41:02.000Z | python/tests/test_information.py | Sandbergo/ecole | 2bab4d6a66e5d1932870f4cecbdc989b8fd17546 | [
"BSD-3-Clause"
] | null | null | null | python/tests/test_information.py | Sandbergo/ecole | 2bab4d6a66e5d1932870f4cecbdc989b8fd17546 | [
"BSD-3-Clause"
] | null | null | null | """Test Ecole information functions in Python.
Most information functions are written in Ecole C++ library.
This is where the logic should be tested.
Here,
- Some tests automatically run the same assertions on all functions;
- Other tests that information returned form information functions are bound to the correc... | 29.66129 | 100 | 0.754214 |
import numpy as np
import ecole
def pytest_generate_tests(metafunc):
if "information_function" in metafunc.fixturenames:
all_information_functions = (ecole.information.Nothing(),)
metafunc.parametrize("information_function", all_information_functions)
def advance_to_root_node(model):
dyn =... | true | true |
1c0fb5d0bfe109d93cb81b82e3f66b067472d429 | 17,927 | py | Python | src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py | r-stiller/transformers | d4bda065b9dcd5e00432a858ece6bb26cd22784e | [
"Apache-2.0"
] | null | null | null | src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py | r-stiller/transformers | d4bda065b9dcd5e00432a858ece6bb26cd22784e | [
"Apache-2.0"
] | null | null | null | src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py | r-stiller/transformers | d4bda065b9dcd5e00432a858ece6bb26cd22784e | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 44.264198 | 119 | 0.667206 | import os
from contextlib import contextmanager
from dataclasses import dataclass
from multiprocessing import get_context
from typing import TYPE_CHECKING, Iterable, List, Optional, Union
import numpy as np
from ...file_utils import ModelOutput, requires_backends
from ...processing_utils import ProcessorMixin
if TY... | true | true |
1c0fb65ad9edf4c8fe4d4e92c522b6cb26691674 | 7,618 | py | Python | udf/ext_age_check.py | drew026/xDD_Geodynamics | 79444d94017300a51f608a449e65854e854b3673 | [
"CC-BY-4.0"
] | null | null | null | udf/ext_age_check.py | drew026/xDD_Geodynamics | 79444d94017300a51f608a449e65854e854b3673 | [
"CC-BY-4.0"
] | null | null | null | udf/ext_age_check.py | drew026/xDD_Geodynamics | 79444d94017300a51f608a449e65854e854b3673 | [
"CC-BY-4.0"
] | null | null | null | #==============================================================================
#CHECKING AGE AGREEMENT BETWEEN DISCOVERED AND MATCHED STRATIGRAPHIC PHRASE
#==============================================================================
# ACQUIRE RELEVANT MODULES and DATA
#==============================================... | 30.230159 | 116 | 0.553426 |
import time, random, psycopg2, urllib2, csv, yaml
start_time = time.time()
def download_csv( url ):
dump_dict = {}
dump = urllib2.urlopen( url )
dump = csv.reader(dump)
cols = list(zip(*dump))
for field in cols:
dump_dict[field[0]]=field[1:... | true | true |
1c0fb679c972c6073e251f9921da0904d86a4857 | 3,537 | py | Python | lib/medzoo/__init__.py | utayao/MedicalZooPytorch | 34d0a735cec1bf554440423b52758d67334e64bf | [
"MIT"
] | 1 | 2021-07-04T14:37:21.000Z | 2021-07-04T14:37:21.000Z | lib/medzoo/__init__.py | utayao/MedicalZooPytorch | 34d0a735cec1bf554440423b52758d67334e64bf | [
"MIT"
] | null | null | null | lib/medzoo/__init__.py | utayao/MedicalZooPytorch | 34d0a735cec1bf554440423b52758d67334e64bf | [
"MIT"
] | 2 | 2020-12-09T06:55:17.000Z | 2021-07-04T14:37:26.000Z | import torch.optim as optim
from .COVIDNet import CovidNet, CNN
from .DenseVoxelNet import DenseVoxelNet
from .Densenet3D import DualPathDenseNet, DualSingleDenseNet, SinglePathDenseNet
from .HighResNet3D import HighResNet3D
from .HyperDensenet import HyperDenseNet, HyperDenseNet_2Mod
from .ResNet3DMedNet import gener... | 44.2125 | 110 | 0.703986 | import torch.optim as optim
from .COVIDNet import CovidNet, CNN
from .DenseVoxelNet import DenseVoxelNet
from .Densenet3D import DualPathDenseNet, DualSingleDenseNet, SinglePathDenseNet
from .HighResNet3D import HighResNet3D
from .HyperDensenet import HyperDenseNet, HyperDenseNet_2Mod
from .ResNet3DMedNet import gener... | true | true |
1c0fb7831bc13edb13d665c728bb2ba6c6134bde | 16,416 | py | Python | arelle/ViewFileRelationshipSet.py | derekgengenbacher-wf/Arelle-1 | 192c72b51997021fec9dbb8b0f0ab23622c174fa | [
"Apache-2.0"
] | null | null | null | arelle/ViewFileRelationshipSet.py | derekgengenbacher-wf/Arelle-1 | 192c72b51997021fec9dbb8b0f0ab23622c174fa | [
"Apache-2.0"
] | null | null | null | arelle/ViewFileRelationshipSet.py | derekgengenbacher-wf/Arelle-1 | 192c72b51997021fec9dbb8b0f0ab23622c174fa | [
"Apache-2.0"
] | null | null | null | '''
Created on Oct 6, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
from arelle import ModelObject, ModelDtsObject, XbrlConst, XmlUtil, ViewFile
from arelle.ModelDtsObject import ModelRelationship
from arelle.ViewFile import NOOUT, CSV, XLSX, HTML, XML, JSON
... | 57.802817 | 160 | 0.586379 | from arelle import ModelObject, ModelDtsObject, XbrlConst, XmlUtil, ViewFile
from arelle.ModelDtsObject import ModelRelationship
from arelle.ViewFile import NOOUT, CSV, XLSX, HTML, XML, JSON
from arelle.ViewUtil import viewReferences
from arelle.XbrlConst import conceptNameLabelRole, documentationLabel, widerNarrower
... | true | true |
1c0fb7874efb2773fa913ee203698909bce3c0c9 | 328 | py | Python | tests/urls.py | DotPodcast/django-blockstack-auth | 0210b6935ad9d7aa76a537a107a36733dda5bada | [
"MIT"
] | 4 | 2018-03-07T10:53:42.000Z | 2019-10-26T20:15:12.000Z | tests/urls.py | DotPodcast/django-blockstack-auth | 0210b6935ad9d7aa76a537a107a36733dda5bada | [
"MIT"
] | 1 | 2018-12-28T18:35:34.000Z | 2018-12-28T18:35:34.000Z | tests/urls.py | DotPodcast/django-blockstack-auth | 0210b6935ad9d7aa76a537a107a36733dda5bada | [
"MIT"
] | 1 | 2019-09-04T19:01:03.000Z | 2019-09-04T19:01:03.000Z | # -*- coding: utf-8 -*-
from django.conf.urls import url, include
from django_blockstack_auth.urls import urlpatterns as blockstack_urls
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
url(r'^blockstack/', include(blockstack_urls, namespace='blockstack'))
] + staticfiles_urlpat... | 32.8 | 74 | 0.786585 | from django.conf.urls import url, include
from django_blockstack_auth.urls import urlpatterns as blockstack_urls
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
url(r'^blockstack/', include(blockstack_urls, namespace='blockstack'))
] + staticfiles_urlpatterns()
| true | true |
1c0fb9135c374670894c86221c90abb6e51eda06 | 3,076 | py | Python | djangoapp/forum/management/commands/populate.py | bdabrowski/web-security-training | aaa8ba8f130e3fa2fbac474fdb59a2051cda463c | [
"MIT"
] | null | null | null | djangoapp/forum/management/commands/populate.py | bdabrowski/web-security-training | aaa8ba8f130e3fa2fbac474fdb59a2051cda463c | [
"MIT"
] | 14 | 2019-08-07T16:09:50.000Z | 2022-03-02T05:07:22.000Z | djangoapp/forum/management/commands/populate.py | bdabrowski/web-security-training | aaa8ba8f130e3fa2fbac474fdb59a2051cda463c | [
"MIT"
] | 1 | 2019-08-07T15:43:03.000Z | 2019-08-07T15:43:03.000Z | from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from faker import Faker
from crypto.crypto_message import encrypt
from forum.models import Question, Answer
def create_user(username=None, first_name=None, last_name=None):
... | 43.323944 | 114 | 0.620611 | from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from faker import Faker
from crypto.crypto_message import encrypt
from forum.models import Question, Answer
def create_user(username=None, first_name=None, last_name=None):
... | true | true |
1c0fb98069dd7e985b68594744b7bbc4f9f5d9f6 | 1,099 | py | Python | pdf_to_img.py | afaq-ahmad/Salary-Slip-data-extraction-v1 | 500c1d472075ee19ea04bd639f7bd670153c1939 | [
"Apache-2.0"
] | null | null | null | pdf_to_img.py | afaq-ahmad/Salary-Slip-data-extraction-v1 | 500c1d472075ee19ea04bd639f7bd670153c1939 | [
"Apache-2.0"
] | null | null | null | pdf_to_img.py | afaq-ahmad/Salary-Slip-data-extraction-v1 | 500c1d472075ee19ea04bd639f7bd670153c1939 | [
"Apache-2.0"
] | null | null | null | from pdf2image import convert_from_path
import os
def pdf_to_image(input_pdf_dir, image_output_dir):
if not os.path.isdir(image_output_dir):
os.mkdir(image_output_dir)
print("directory created\n", image_output_dir)
pdf_files = os.listdir(input_pdf_dir)
for pdf_file in pdf_files:
i... | 33.30303 | 132 | 0.641492 | from pdf2image import convert_from_path
import os
def pdf_to_image(input_pdf_dir, image_output_dir):
if not os.path.isdir(image_output_dir):
os.mkdir(image_output_dir)
print("directory created\n", image_output_dir)
pdf_files = os.listdir(input_pdf_dir)
for pdf_file in pdf_files:
i... | true | true |
1c0fbc498993d54fae1d9694a5065cdb51e1fb3e | 3,196 | py | Python | models/kp_comp.py | wengzehang/keypoint_humanoids | 0630037b2d8063146728670643a96b73632643e8 | [
"MIT"
] | null | null | null | models/kp_comp.py | wengzehang/keypoint_humanoids | 0630037b2d8063146728670643a96b73632643e8 | [
"MIT"
] | null | null | null | models/kp_comp.py | wengzehang/keypoint_humanoids | 0630037b2d8063146728670643a96b73632643e8 | [
"MIT"
] | null | null | null | # Ref: https://github.com/hansen7/OcCo
# TODO: Reimplement chamfer distance in Torch and add completion/topo loss back; decoder
from models.pcn_util import PCNEncoder
import torch, torch.nn as nn, torch.nn.functional as F
class View(nn.Module):
def __init__(self, shape):
super(View, self).__init__()
... | 30.438095 | 91 | 0.5801 |
from models.pcn_util import PCNEncoder
import torch, torch.nn as nn, torch.nn.functional as F
class View(nn.Module):
def __init__(self, shape):
super(View, self).__init__()
self.shape = shape
def forward(self, x):
return x.view(*self.shape)
class get_model(nn.Module):
def __ini... | true | true |
1c0fbc6190d677dff041335e2467900695612065 | 2,226 | py | Python | var/spack/repos/builtin/packages/libaec/package.py | QianJianhua1/spack | 363536fd929d2aee280e07780ff6c98498d7be46 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/libaec/package.py | QianJianhua1/spack | 363536fd929d2aee280e07780ff6c98498d7be46 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/libaec/package.py | QianJianhua1/spack | 363536fd929d2aee280e07780ff6c98498d7be46 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 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 Libaec(CMakePackage):
"""Libaec provides fast lossless compression of 1 up to 32 bit wide ... | 39.75 | 104 | 0.68823 |
from spack import *
class Libaec(CMakePackage):
homepage = 'https://gitlab.dkrz.de/k202009/libaec'
url = 'https://gitlab.dkrz.de/api/v4/projects/k202009%2Flibaec/repository/archive.tar.gz?sha=v1.0.2'
list_url = 'https://gitlab.dkrz.de/k202009/libaec/tags'
provides('szip')
version('1.0.5', sha2... | true | true |
1c0fbcb506bd9c9a6704300d26534ddf8f671370 | 2,562 | py | Python | embedding_net/losses_and_accuracies.py | kerteszg/EmbeddingNet | 9bff4711116e6a7f5b95c9ff5a5fc5c350d1fd86 | [
"MIT"
] | 2 | 2020-06-04T10:25:22.000Z | 2021-07-30T14:09:46.000Z | embedding_net/losses_and_accuracies.py | kerteszg/EmbeddingNet | 9bff4711116e6a7f5b95c9ff5a5fc5c350d1fd86 | [
"MIT"
] | null | null | null | embedding_net/losses_and_accuracies.py | kerteszg/EmbeddingNet | 9bff4711116e6a7f5b95c9ff5a5fc5c350d1fd86 | [
"MIT"
] | null | null | null | import keras.backend as K
import keras
def contrastive_loss(y_true, y_pred):
'''Contrastive loss from Hadsell-et-al.'06
http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf
'''
margin = 1
sqaure_pred = K.square(y_pred)
margin_square = K.square(K.maximum(margin - y_pred, 0))
re... | 31.62963 | 104 | 0.652615 | import keras.backend as K
import keras
def contrastive_loss(y_true, y_pred):
margin = 1
sqaure_pred = K.square(y_pred)
margin_square = K.square(K.maximum(margin - y_pred, 0))
return K.mean(y_true * sqaure_pred + (1 - y_true) * margin_square)
def triplet_loss(margin=0.5):
def loss_function(y_true... | true | true |
1c0fbda71dead9a007e37204bc101007fa0872ea | 1,453 | py | Python | upcfcardsearch/c65.py | ProfessorSean/Kasutamaiza | 7a69a69258f67bbb88bebbac6da4e6e1434947e6 | [
"MIT"
] | null | null | null | upcfcardsearch/c65.py | ProfessorSean/Kasutamaiza | 7a69a69258f67bbb88bebbac6da4e6e1434947e6 | [
"MIT"
] | null | null | null | upcfcardsearch/c65.py | ProfessorSean/Kasutamaiza | 7a69a69258f67bbb88bebbac6da4e6e1434947e6 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from discord.utils import get
class c65(commands.Cog, name="c65"):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name='The_True_Tyrant_of_the_Sea', aliases=['c65','True_Tryant_1'])
async def example_embed(self, ctx):
... | 60.541667 | 490 | 0.704061 | import discord
from discord.ext import commands
from discord.utils import get
class c65(commands.Cog, name="c65"):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name='The_True_Tyrant_of_the_Sea', aliases=['c65','True_Tryant_1'])
async def example_embed(self, ctx):
... | true | true |
1c0fbdeb163ea48f14ec6df45ff9c9ee10c49611 | 234 | py | Python | scripts/fasta.get_sequence_chunk.py | naumenko-sa/bioscripts | 0ade22f84670ad9cc79730775d33f05296aaec49 | [
"MIT"
] | 10 | 2016-11-03T01:59:36.000Z | 2022-02-04T15:13:55.000Z | scripts/fasta.get_sequence_chunk.py | naumenko-sa/bioscripts | 0ade22f84670ad9cc79730775d33f05296aaec49 | [
"MIT"
] | 2 | 2016-12-31T08:50:21.000Z | 2020-07-21T20:05:52.000Z | scripts/fasta.get_sequence_chunk.py | naumenko-sa/bioscripts | 0ade22f84670ad9cc79730775d33f05296aaec49 | [
"MIT"
] | 3 | 2016-12-29T20:34:56.000Z | 2021-02-08T13:36:34.000Z | #!/hpf/largeprojects/ccmbio/naumenko/tools/bcbio/anaconda/bin/python
from Bio import SeqIO
for record in SeqIO.parse("mm10.fa","fasta"):
if(record.id == 'chrX'):
print('>'+record.id)
print(record.seq[83729320:83927998])
| 29.25 | 68 | 0.700855 |
from Bio import SeqIO
for record in SeqIO.parse("mm10.fa","fasta"):
if(record.id == 'chrX'):
print('>'+record.id)
print(record.seq[83729320:83927998])
| false | true |
1c0fbe4e600cbfb0fa99416ac2dfce4f93a884cd | 3,357 | py | Python | test/functional/wallet_zapwallettxes.py | weicrypto/wei | 031b608636db4309ecc9d5e6d0512179fb50fd4e | [
"MIT"
] | null | null | null | test/functional/wallet_zapwallettxes.py | weicrypto/wei | 031b608636db4309ecc9d5e6d0512179fb50fd4e | [
"MIT"
] | null | null | null | test/functional/wallet_zapwallettxes.py | weicrypto/wei | 031b608636db4309ecc9d5e6d0512179fb50fd4e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the zapwallettxes functionality.
- start two weid nodes
- create two transactions on node 0 - one... | 41.9625 | 112 | 0.710456 | from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
)
from test_framework.mininode import wait_until
class ZapWalletTXesTest (BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
s... | true | true |
1c0fbe979bf8c5888bf697ffd5e5358c52270da5 | 11,156 | py | Python | tests/test_sender.py | mastak/fluent-logger-python | 268f577b425c46e7069c0bfafcec4e099fac8823 | [
"Apache-2.0"
] | 344 | 2015-01-05T22:50:20.000Z | 2022-03-29T03:59:54.000Z | tests/test_sender.py | mastak/fluent-logger-python | 268f577b425c46e7069c0bfafcec4e099fac8823 | [
"Apache-2.0"
] | 164 | 2015-01-29T15:32:25.000Z | 2022-02-15T19:13:55.000Z | tests/test_sender.py | mastak/fluent-logger-python | 268f577b425c46e7069c0bfafcec4e099fac8823 | [
"Apache-2.0"
] | 139 | 2015-01-31T00:15:23.000Z | 2022-03-24T08:53:38.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
import errno
import socket
import sys
import unittest
from shutil import rmtree
from tempfile import mkdtemp
import msgpack
import fluent.sender
from tests import mockserver
class TestSetup(unittest.TestCase):
def tearDown(self):
from fluen... | 34.971787 | 105 | 0.550466 |
from __future__ import print_function
import errno
import socket
import sys
import unittest
from shutil import rmtree
from tempfile import mkdtemp
import msgpack
import fluent.sender
from tests import mockserver
class TestSetup(unittest.TestCase):
def tearDown(self):
from fluent.sender import _set_glo... | true | true |
1c0fbfb718a1362387760c2644de85c2db251151 | 545 | py | Python | answers/leetcode/Unique Paths II/Unique Paths II.py | FeiZhan/Algo-Collection | 708c4a38112e0b381864809788b9e44ac5ae4d05 | [
"MIT"
] | 3 | 2015-09-04T21:32:31.000Z | 2020-12-06T00:37:32.000Z | answers/leetcode/Unique Paths II/Unique Paths II.py | FeiZhan/Algo-Collection | 708c4a38112e0b381864809788b9e44ac5ae4d05 | [
"MIT"
] | null | null | null | answers/leetcode/Unique Paths II/Unique Paths II.py | FeiZhan/Algo-Collection | 708c4a38112e0b381864809788b9e44ac5ae4d05 | [
"MIT"
] | null | null | null | class Solution(object):
def uniquePathsWithObstacles(self, obstacleGrid):
"""
:type obstacleGrid: List[List[int]]
:rtype: int
"""
dp = [[0 for i in range(len(obstacleGrid[0]))] for j in range(len(obstacleGrid))]
dp[0][0] = not obstacleGrid[0][0]
for i in rang... | 38.928571 | 126 | 0.537615 | class Solution(object):
def uniquePathsWithObstacles(self, obstacleGrid):
dp = [[0 for i in range(len(obstacleGrid[0]))] for j in range(len(obstacleGrid))]
dp[0][0] = not obstacleGrid[0][0]
for i in range(len(obstacleGrid)):
for j in range(len(obstacleGrid[i])):
... | true | true |
1c0fc09e6288b3601213de68bc68c3f91bae4a1a | 1,070 | py | Python | reader/urls.py | Kadantte/MangAdventure | 0646617cb6376eaeb3142cbd1f266267518a149f | [
"MIT"
] | 58 | 2019-03-04T09:22:42.000Z | 2022-02-18T09:11:57.000Z | reader/urls.py | Kadantte/MangAdventure | 0646617cb6376eaeb3142cbd1f266267518a149f | [
"MIT"
] | 21 | 2019-03-07T19:34:53.000Z | 2021-12-19T12:46:40.000Z | reader/urls.py | Kadantte/MangAdventure | 0646617cb6376eaeb3142cbd1f266267518a149f | [
"MIT"
] | 14 | 2019-06-06T09:53:13.000Z | 2021-12-17T14:34:13.000Z | """The URLconf of the reader app."""
from django.conf import settings
from django.urls import path, register_converter
from MangAdventure.converters import FloatConverter
from . import feeds, views
register_converter(FloatConverter, 'float')
#: The URL namespace of the reader app.
app_name = 'reader'
_slug = '<sl... | 29.722222 | 76 | 0.68972 |
from django.conf import settings
from django.urls import path, register_converter
from MangAdventure.converters import FloatConverter
from . import feeds, views
register_converter(FloatConverter, 'float')
app_name = 'reader'
_slug = '<slug:slug>/'
_chapter = f'{_slug}<int:vol>/<float:num>/'
_page = f'{_chapter}<i... | true | true |
1c0fc17735b0a936c741a8b15ebe7db9d6042de7 | 1,093 | py | Python | scraper/extract.py | lroellin/hsr-mensa-scraper | d4ebe61c85c32167fd777ff8eef96cf8b8cb9fed | [
"MIT"
] | null | null | null | scraper/extract.py | lroellin/hsr-mensa-scraper | d4ebe61c85c32167fd777ff8eef96cf8b8cb9fed | [
"MIT"
] | null | null | null | scraper/extract.py | lroellin/hsr-mensa-scraper | d4ebe61c85c32167fd777ff8eef96cf8b8cb9fed | [
"MIT"
] | null | null | null | def extract_menu_day_elements(day, parent_element):
return parent_element.find('div', {'id': 'menu-plan-tab' + str(day)})
def extract_menu_item(parent_element):
return parent_element.findAll('div', {'class': 'menu-item'})
def extract_menu_title(parent_element):
menu_title = parent_element.find('h2', {'c... | 31.228571 | 89 | 0.719122 | def extract_menu_day_elements(day, parent_element):
return parent_element.find('div', {'id': 'menu-plan-tab' + str(day)})
def extract_menu_item(parent_element):
return parent_element.findAll('div', {'class': 'menu-item'})
def extract_menu_title(parent_element):
menu_title = parent_element.find('h2', {'c... | true | true |
1c0fc220f7b03d6fee731dcc92be94938e1863fb | 1,999 | py | Python | src/Tests/FrontEnd/Scanner_Tokens/script_scanner_test.py | Typee-Language/Typee | adf61fee616bd798dae3bdc6710fd819e188e925 | [
"MIT"
] | 9 | 2018-07-07T23:07:20.000Z | 2021-06-26T19:37:54.000Z | src/Tests/FrontEnd/Scanner_Tokens/script_scanner_test.py | Typee-Language/Typee | adf61fee616bd798dae3bdc6710fd819e188e925 | [
"MIT"
] | 147 | 2018-07-07T23:05:58.000Z | 2021-07-26T14:02:45.000Z | src/Tests/FrontEnd/Scanner_Tokens/script_scanner_test.py | Typee-Language/Typee | adf61fee616bd798dae3bdc6710fd819e188e925 | [
"MIT"
] | 2 | 2018-07-08T16:30:50.000Z | 2018-07-08T22:32:03.000Z | # -*- coding: utf-8 -*-
"""
Copyright (c) 2018-2021 Philippe Schmouker, Typhon project, http://www.typee.ovh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including wit... | 46.488372 | 96 | 0.667834 |
from Tests.FrontEnd.Scanner_Tokens.test_compound_tokens import test_compound_tokens
from Tests.FrontEnd.Scanner_Tokens.test_names_and_nums_tokens import test_names_and_nums_tokens
from Tests.FrontEnd.Scanner_Tokens.test_simple_tokens import test_simple_tokens
if __name__ == '__main__':
test_... | true | true |
1c0fc5de3aa643c360c881fa944e64aed209828b | 2,654 | py | Python | probreg/transformation.py | KentaKawamata/probreg | ab29c01353f5ca490653172523d351cce26017c8 | [
"MIT"
] | null | null | null | probreg/transformation.py | KentaKawamata/probreg | ab29c01353f5ca490653172523d351cce26017c8 | [
"MIT"
] | null | null | null | probreg/transformation.py | KentaKawamata/probreg | ab29c01353f5ca490653172523d351cce26017c8 | [
"MIT"
] | 2 | 2020-02-18T17:56:02.000Z | 2020-05-30T12:07:41.000Z | import abc
import six
import numpy as np
import open3d as o3
from . import math_utils as mu
@six.add_metaclass(abc.ABCMeta)
class Transformation():
def __init__(self):
pass
def transform(self, points,
array_type=o3.Vector3dVector):
if isinstance(points, array_type):
... | 29.164835 | 75 | 0.605501 | import abc
import six
import numpy as np
import open3d as o3
from . import math_utils as mu
@six.add_metaclass(abc.ABCMeta)
class Transformation():
def __init__(self):
pass
def transform(self, points,
array_type=o3.Vector3dVector):
if isinstance(points, array_type):
... | true | true |
1c0fc687741bdac3877127ad2f6ce210e1e34355 | 16,963 | py | Python | src/Const.py | gr4ph0s/c4d_redshift_light_lister | f227caf32cfd4eb5ed0810b8aedc1dff38ba2262 | [
"MIT"
] | 7 | 2017-12-11T22:38:31.000Z | 2021-05-12T07:27:01.000Z | src/Const.py | gr4ph0s/c4d_redshift_light_lister | f227caf32cfd4eb5ed0810b8aedc1dff38ba2262 | [
"MIT"
] | 1 | 2020-10-23T16:55:06.000Z | 2020-10-27T16:52:04.000Z | src/Const.py | gr4ph0s/c4d_redshift_light_lister | f227caf32cfd4eb5ed0810b8aedc1dff38ba2262 | [
"MIT"
] | 2 | 2019-07-01T07:45:11.000Z | 2021-05-11T16:59:05.000Z | class Const(object):
PLUGIN_ID = 1039115
PLUGIN_ID_TAG = 1039117
VERSION = 1.51
#===========================================================================================================#
# ... | 78.897674 | 113 | 0.611036 | class Const(object):
PLUGIN_ID = 1039115
PLUGIN_ID_TAG = 1039117
VERSION = 1.51
TAG_ID_OCTANE = 1029526
TAG_ID_ARNOLD = 1029989
TAG_ID_VRAY = 1020441
LIGHT_C4D_ID = 5102
LIGHT_ID_REDSHIFT = 1036751
LIGHT_ID_ARNOLD = 1030424
LIGHT_I... | true | true |
1c0fc70dece22cf60b271867419c93b7066a6fdc | 4,387 | py | Python | contrib/seeds/generate-seeds.py | paymastercoinproject/paymastercoin | 8b1807fbff947bf67378376aa3c522db637157ba | [
"MIT"
] | 1 | 2022-03-05T14:50:58.000Z | 2022-03-05T14:50:58.000Z | contrib/seeds/generate-seeds.py | paymastercoinproject/paymastercoin | 8b1807fbff947bf67378376aa3c522db637157ba | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | paymastercoinproject/paymastercoin | 8b1807fbff947bf67378376aa3c522db637157ba | [
"MIT"
] | 2 | 2021-12-25T12:39:07.000Z | 2022-02-14T03:03:36.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.789855 | 99 | 0.584454 |
from base64 import b32decode
from binascii import a2b_hex
import sys
import os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith('.onion'):
vchAddr = b32decode(addr[0:... | true | true |
1c0fc893c927c354f533ea99953ba14edc08fc5d | 12,161 | py | Python | ayush/src/uav_city_4.py | Ayush8120/Improved-MR-DFS-PX4 | 1f64db7b801cb97a2ccb26a7de95d1c92b0666f4 | [
"MIT"
] | 6 | 2021-08-02T13:52:37.000Z | 2022-02-23T11:47:33.000Z | ayush/src/uav_city_4.py | Ayush8120/Improved-MR-DFS-PX4 | 1f64db7b801cb97a2ccb26a7de95d1c92b0666f4 | [
"MIT"
] | 1 | 2021-07-30T20:46:19.000Z | 2021-08-31T17:37:17.000Z | ayush/src/uav_city_4.py | Ayush8120/Improved-MR-DFS-PX4 | 1f64db7b801cb97a2ccb26a7de95d1c92b0666f4 | [
"MIT"
] | 1 | 2022-01-18T10:42:35.000Z | 2022-01-18T10:42:35.000Z | #!/usr/bin/env python3
import rospy
import mavros
from geometry_msgs.msg import PoseStamped
from mavros_msgs.msg import *
from mavros_msgs.srv import *
import pprint
import networkx as nx
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from mpl_toolkits.... | 45.376866 | 205 | 0.628731 |
import rospy
import mavros
from geometry_msgs.msg import PoseStamped
from mavros_msgs.msg import *
from mavros_msgs.srv import *
import pprint
import networkx as nx
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from mpl_toolkits.mplot3d import Axes3D
f... | true | true |
1c0fc92aefc4994fe0e4597a83f618f7706f8330 | 258 | py | Python | runtime/learn/ahri/ird/driver/handler.py | NetSys/dspace | c3e2942501288ae06b41d2daf1b81424c812b34d | [
"Apache-2.0"
] | 8 | 2021-05-28T13:17:34.000Z | 2021-11-16T07:55:52.000Z | runtime/learn/ahri/ird/driver/handler.py | digi-project/sosp21-artifact | 1b4a11c648e456c9ff9d74f16b09f4238d6694a0 | [
"BSD-3-Clause"
] | 15 | 2021-05-25T18:07:13.000Z | 2022-01-03T20:00:59.000Z | runtime/learn/ahri/ird/driver/handler.py | isabella232/dspace | c3e2942501288ae06b41d2daf1b81424c812b34d | [
"Apache-2.0"
] | 4 | 2021-05-23T21:40:45.000Z | 2021-05-31T12:27:44.000Z | import digi
import digi.on as on
# validation
@on.attr
def h():
...
# intent back-prop
@on.mount
def h():
...
# status
@on.mount
def h():
...
# intent
@on.mount
@on.control
def h():
...
if __name__ == '__main__':
digi.run()
| 8.0625 | 26 | 0.53876 | import digi
import digi.on as on
@on.attr
def h():
...
@on.mount
def h():
...
@on.mount
def h():
...
@on.mount
@on.control
def h():
...
if __name__ == '__main__':
digi.run()
| true | true |
1c0fca84da50dd7fe3b518ac949908f50a63a38d | 1,332 | py | Python | apps/discord_login/migrations/0001_initial.py | Evanaellio/melting-potlist | 0247a26c66c4ff43f02d827ee51fc48cc83d00bd | [
"MIT"
] | 9 | 2021-05-21T09:15:59.000Z | 2022-02-20T10:12:56.000Z | apps/discord_login/migrations/0001_initial.py | Evanaellio/melting-potlist | 0247a26c66c4ff43f02d827ee51fc48cc83d00bd | [
"MIT"
] | 58 | 2020-07-14T18:58:30.000Z | 2022-02-27T22:50:58.000Z | apps/discord_login/migrations/0001_initial.py | Evanaellio/melting-potlist | 0247a26c66c4ff43f02d827ee51fc48cc83d00bd | [
"MIT"
] | 1 | 2020-08-01T22:46:03.000Z | 2020-08-01T22:46:03.000Z | # Generated by Django 3.0.1 on 2020-02-08 16:37
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
oper... | 35.052632 | 114 | 0.563814 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
1c0fca892409426fd64962faa5d8552459fe4a61 | 504 | py | Python | 0x03p_datatypes_numbers/0x03pa_calculator.py | walleieve/Reverse-Engineering | c1d018c623e4ed71ea17583c296a1342376172a7 | [
"Apache-2.0"
] | 3,418 | 2020-02-21T11:21:35.000Z | 2021-03-24T19:23:12.000Z | 0x03p_datatypes_numbers/0x03pa_calculator.py | momed081/Reverse-Engineering | dc08977f55ea21d482963e9b1e2fb21454ed0c0d | [
"Apache-2.0"
] | 1 | 2021-03-23T11:43:12.000Z | 2021-03-23T18:33:08.000Z | 0x03p_datatypes_numbers/0x03pa_calculator.py | momed081/Reverse-Engineering | dc08977f55ea21d482963e9b1e2fb21454ed0c0d | [
"Apache-2.0"
] | 317 | 2021-03-25T01:29:35.000Z | 2022-03-29T07:08:44.000Z | first_number = int(input('Enter First Number: '))
second_number = int(input('Enter Second Number: '))
my_addition = first_number + second_number
my_subtraction = first_number - second_number
my_multiplication = first_number * second_number
my_division = first_number / second_number
print('Addition = {0}'.format(my_ad... | 36 | 55 | 0.771825 | first_number = int(input('Enter First Number: '))
second_number = int(input('Enter Second Number: '))
my_addition = first_number + second_number
my_subtraction = first_number - second_number
my_multiplication = first_number * second_number
my_division = first_number / second_number
print('Addition = {0}'.format(my_ad... | true | true |
1c0fcb44807a21fc2a7beeb5f17af3190b99a5ba | 4,303 | py | Python | tests/test_amazon_scrapper.py | cjoshmartin/product-details | 28daed2e4aaa20e0e570402be6d94d6bcfca374f | [
"Apache-2.0"
] | null | null | null | tests/test_amazon_scrapper.py | cjoshmartin/product-details | 28daed2e4aaa20e0e570402be6d94d6bcfca374f | [
"Apache-2.0"
] | null | null | null | tests/test_amazon_scrapper.py | cjoshmartin/product-details | 28daed2e4aaa20e0e570402be6d94d6bcfca374f | [
"Apache-2.0"
] | null | null | null | import os
from playwright.sync_api import sync_playwright
from main.amazon import get_meta_data
def test_work_on_book_link():
expected = {
'title': 'Living with Pattern: Color, Texture, and Print at Home (CLARKSON POTTER)',
'description': 'Description\nProduct Description\nA design book filled w... | 52.47561 | 1,462 | 0.706251 | import os
from playwright.sync_api import sync_playwright
from main.amazon import get_meta_data
def test_work_on_book_link():
expected = {
'title': 'Living with Pattern: Color, Texture, and Print at Home (CLARKSON POTTER)',
'description': 'Description\nProduct Description\nA design book filled w... | true | true |
1c0fcb979a475b5a0d773ffdb3cf868d99ded20c | 893 | py | Python | tests/test_repository.py | jayvdb/linguist | bac586366f1fc87eda72c90855a4eabb1f61922c | [
"BSD-3-Clause"
] | 75 | 2015-03-14T19:32:23.000Z | 2022-02-14T13:01:43.000Z | tests/test_repository.py | jayvdb/linguist | bac586366f1fc87eda72c90855a4eabb1f61922c | [
"BSD-3-Clause"
] | 16 | 2016-04-08T03:22:02.000Z | 2021-05-17T14:28:06.000Z | tests/test_repository.py | jayvdb/linguist | bac586366f1fc87eda72c90855a4eabb1f61922c | [
"BSD-3-Clause"
] | 22 | 2015-01-14T16:33:58.000Z | 2021-11-02T11:09:51.000Z | # -*- coding: utf-8 -*-
from pygments.lexers import find_lexer_class
from framework import LinguistTestBase, main, ROOT_DIR
from libs.repository import Repository
from libs.language import Language
class TestRepository(LinguistTestBase):
def repo(self, base_path):
return Repository.from_directory(base_pa... | 28.806452 | 98 | 0.726764 |
from pygments.lexers import find_lexer_class
from framework import LinguistTestBase, main, ROOT_DIR
from libs.repository import Repository
from libs.language import Language
class TestRepository(LinguistTestBase):
def repo(self, base_path):
return Repository.from_directory(base_path)
def linguist_re... | true | true |
1c0fcce94cd3fa234bf4945bed13a4ce6ffc9fb3 | 1,080 | py | Python | photogeneration.py | tgolubev/Drift-Diffusion_Python | 645650341c900410d59e61c150aab2516cabceba | [
"MIT"
] | 11 | 2019-01-21T12:11:48.000Z | 2022-03-19T03:09:13.000Z | photogeneration.py | tgolubev/Drift-Diffusion_Python | 645650341c900410d59e61c150aab2516cabceba | [
"MIT"
] | null | null | null | photogeneration.py | tgolubev/Drift-Diffusion_Python | 645650341c900410d59e61c150aab2516cabceba | [
"MIT"
] | 2 | 2020-12-28T10:18:54.000Z | 2021-01-19T19:33:51.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 19, 2018
@author: Timofey Golubev
This just contains the function for reading photogeneration rate from a generation rate data file.
"""
import numpy as np
def get_photogeneration(params):
'''
Reads photogeneration rate from an input file.
Inputs:
... | 29.189189 | 104 | 0.664815 |
import numpy as np
def get_photogeneration(params):
try:
gen_file = open(params.gen_rate_file_name, "r")
except:
print(f"Unable to open file{params.gen_rate_file_name}")
photogen_rate = np.loadtxt(params.gen_rate_file_name)
photogen_rate = params.Photogen_s... | true | true |
1c0fcd2d92d84b3943e387f8a848b3f95a4b9c88 | 38,200 | py | Python | avocado/model.py | sry002/avocado | d89f4161e3236b65e57f0d8c7f4454ee44501fa3 | [
"Apache-2.0"
] | 104 | 2017-01-31T17:12:45.000Z | 2022-03-30T00:19:37.000Z | avocado/model.py | sry002/avocado | d89f4161e3236b65e57f0d8c7f4454ee44501fa3 | [
"Apache-2.0"
] | 14 | 2019-02-23T06:30:14.000Z | 2022-03-21T17:37:51.000Z | avocado/model.py | sry002/avocado | d89f4161e3236b65e57f0d8c7f4454ee44501fa3 | [
"Apache-2.0"
] | 18 | 2018-11-06T19:53:05.000Z | 2022-01-26T08:16:29.000Z | # models.py
# Contact: Jacob Schreiber <jmschr@cs.washington.edu>
# William Noble <wnoble@uw.edu>
"""
Avocado is deep tensor factorization model for learning a latent representation
of the human epigenome. This file has functions for building a deep tensor
factorization model.
"""
from .io import data_gene... | 34.854015 | 80 | 0.728298 |
from .io import data_generator
from .io import permuted_data_generator
from .io import sequential_data_generator
import json
import numpy
import keras
from keras.layers import Input, Embedding, Dense
from keras.layers import Multiply, Dot, Flatten, concatenate
from keras.models import Model
from keras.optimizers i... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.