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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71874ea181c3b592a78cc7466c520b1e6d8934c | 352 | py | Python | code/examples/MotionTrackingAccelerometer.py | SaschaMzH/hucon | 830b6c5e21c2c7316c61e8afdf708066374b9b62 | [
"BSD-3-Clause"
] | 2 | 2019-09-25T13:39:22.000Z | 2019-09-26T10:06:13.000Z | code/examples/MotionTrackingAccelerometer.py | SaschaMzH/hucon | 830b6c5e21c2c7316c61e8afdf708066374b9b62 | [
"BSD-3-Clause"
] | 44 | 2019-09-25T14:35:48.000Z | 2021-08-20T17:26:12.000Z | code/examples/MotionTrackingAccelerometer.py | SaschaMzH/hucon | 830b6c5e21c2c7316c61e8afdf708066374b9b62 | [
"BSD-3-Clause"
] | 8 | 2019-09-25T13:53:07.000Z | 2022-02-24T19:23:44.000Z | """ Print the gyro sensor data.
Copyright (C) 2019 Basler AG
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from hucon import Mpu6050
mpu = None
print('Get the data from the accelerometer.')
mpu = Mpu605... | 19.555556 | 65 | 0.713068 |
from hucon import Mpu6050
mpu = None
print('Get the data from the accelerometer.')
mpu = Mpu6050()
print(mpu.get_accel_data())
| true | true |
f71874ed83499c32090bfa730a8893ccd3cb1572 | 4,292 | py | Python | extract_feats/opensmile.py | ImmortalSdm/Speech-Emotion-Recognition-1 | c5f766a0f66c77df30c6d75e86d97c27c2bbb240 | [
"MIT"
] | 1 | 2021-03-13T09:35:54.000Z | 2021-03-13T09:35:54.000Z | extract_feats/opensmile.py | Ulrica-ren/Speech-Emotion-Recognition-1 | c5f766a0f66c77df30c6d75e86d97c27c2bbb240 | [
"MIT"
] | null | null | null | extract_feats/opensmile.py | Ulrica-ren/Speech-Emotion-Recognition-1 | c5f766a0f66c77df30c6d75e86d97c27c2bbb240 | [
"MIT"
] | 1 | 2021-03-17T10:52:26.000Z | 2021-03-17T10:52:26.000Z | import os
import csv
import sys
import time
import pandas as pd
from sklearn.preprocessing import StandardScaler
from typing import Tuple
from sklearn.externals import joblib
from sklearn.model_selection import train_test_split
# 每个特征集的特征数量
FEATURE_NUM = {
'IS09_emotion': 384,
'IS10_paraling': 1582,
'IS11_... | 27.164557 | 137 | 0.635368 | import os
import csv
import sys
import time
import pandas as pd
from sklearn.preprocessing import StandardScaler
from typing import Tuple
from sklearn.externals import joblib
from sklearn.model_selection import train_test_split
FEATURE_NUM = {
'IS09_emotion': 384,
'IS10_paraling': 1582,
'IS11_speaker_state... | true | true |
f7187653a74f7b01dca4f137c868aa88c9f636ab | 20,547 | py | Python | elasticapm/base.py | mvas/apm-agent-python | f4582e90eb5308b915ca51e2e98620fc22af09ec | [
"BSD-3-Clause"
] | null | null | null | elasticapm/base.py | mvas/apm-agent-python | f4582e90eb5308b915ca51e2e98620fc22af09ec | [
"BSD-3-Clause"
] | null | null | null | elasticapm/base.py | mvas/apm-agent-python | f4582e90eb5308b915ca51e2e98620fc22af09ec | [
"BSD-3-Clause"
] | null | null | null | """
elasticapm.base
~~~~~~~~~~
:copyright: (c) 2011-2017 Elasticsearch
Large portions are
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import datetime
import logging
import os
import platform
import soc... | 36.174296 | 119 | 0.609627 |
from __future__ import absolute_import
import datetime
import logging
import os
import platform
import socket
import sys
import threading
import time
import zlib
from copy import deepcopy
import elasticapm
from elasticapm.conf import Config, constants
from elasticapm.traces import TransactionsStore, get_transaction
... | true | true |
f7187739be7c1360375442537af54f3bec58e630 | 7,993 | py | Python | YoloV3_ezhirko/detect.py | eva5covergence/EVA5_AI_Projects | 7052373c52b6b9901cd0bc05a4758dd4b63f7480 | [
"MIT"
] | null | null | null | YoloV3_ezhirko/detect.py | eva5covergence/EVA5_AI_Projects | 7052373c52b6b9901cd0bc05a4758dd4b63f7480 | [
"MIT"
] | null | null | null | YoloV3_ezhirko/detect.py | eva5covergence/EVA5_AI_Projects | 7052373c52b6b9901cd0bc05a4758dd4b63f7480 | [
"MIT"
] | 2 | 2021-07-25T10:24:11.000Z | 2021-08-13T09:23:30.000Z | import argparse
from sys import platform
from models import * # set ONNX_EXPORT in models.py
from utils.datasets import *
from utils.utils import *
def detect(save_img=False):
img_size = (320, 192) if ONNX_EXPORT else opt.img_size # (320, 192) or (416, 256) or (608, 352) for (height, width)
out, source, we... | 42.743316 | 129 | 0.588515 | import argparse
from sys import platform
from models import * from utils.datasets import *
from utils.utils import *
def detect(save_img=False):
img_size = (320, 192) if ONNX_EXPORT else opt.img_size out, source, weights, half, view_img, save_txt = opt.output, opt.source, opt.weights, opt.half, opt.view_im... | true | true |
f71877dabf3bdc4389a088d6b5ff9767e469ea5b | 11,246 | py | Python | pandas/tests/series/test_replace.py | kpflugshaupt/pandas | c9e3883c630c48b17218e6bcc5593720c1402bf1 | [
"BSD-3-Clause"
] | 1 | 2019-05-19T13:44:03.000Z | 2019-05-19T13:44:03.000Z | pandas/tests/series/test_replace.py | sanjusci/pandas | a1fee9199eba7ebf423880243936b9f1501d3d3a | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/series/test_replace.py | sanjusci/pandas | a1fee9199eba7ebf423880243936b9f1501d3d3a | [
"BSD-3-Clause"
] | 3 | 2018-01-08T08:40:55.000Z | 2019-10-07T02:02:40.000Z | # coding=utf-8
# pylint: disable-msg=E1101,W0612
import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
from .common import TestData
class TestSeriesReplace(TestData):
def test_replace(self):
N = 100
ser = pd.Series(np.random.randn(N))
ser[0:4] = np.nan
... | 36.160772 | 79 | 0.55273 |
import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
from .common import TestData
class TestSeriesReplace(TestData):
def test_replace(self):
N = 100
ser = pd.Series(np.random.randn(N))
ser[0:4] = np.nan
ser[6:10] = 0
ser.replace(... | true | true |
f71878ecaeeecc9487d63ee73a12842ed9ee5b34 | 73,406 | py | Python | src/transformers/models/pegasus/modeling_tf_pegasus.py | Shashi456/transformers | 0f43e742d908772733870730dbddd8e00e0253ef | [
"Apache-2.0"
] | 17 | 2020-10-13T06:53:25.000Z | 2022-02-22T06:12:17.000Z | src/transformers/models/pegasus/modeling_tf_pegasus.py | Shashi456/transformers | 0f43e742d908772733870730dbddd8e00e0253ef | [
"Apache-2.0"
] | 13 | 2020-10-13T11:41:11.000Z | 2022-02-16T14:13:31.000Z | src/transformers/models/pegasus/modeling_tf_pegasus.py | Shashi456/transformers | 0f43e742d908772733870730dbddd8e00e0253ef | [
"Apache-2.0"
] | 13 | 2020-10-04T05:06:00.000Z | 2022-02-09T01:14:59.000Z | # coding=utf-8
# Copyright 2021, Google Inc. and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | 47.328175 | 236 | 0.660682 |
import random
from typing import Dict, Optional, Tuple, Union
import numpy as np
import tensorflow as tf
from ...activations_tf import get_tf_activation
from ...file_utils import (
add_code_sample_docstrings,
add_end_docstrings,
add_start_docstrings,
add_start_docstrings_to_model_forward,
replac... | true | true |
f7187934ae933740a1f4b6303e02e4e7822c4691 | 9,491 | py | Python | scripts/compile_prosivic_results.py | mrksbrg/adas-pro-sivic | fb4bbd4f39b58e42c3d47494fb4116a3e7fced0d | [
"BSD-2-Clause"
] | 4 | 2020-04-05T01:49:24.000Z | 2021-11-15T03:01:55.000Z | scripts/compile_prosivic_results.py | sukhvir-chauhan-1999/adas-pro-sivic | fb4bbd4f39b58e42c3d47494fb4116a3e7fced0d | [
"BSD-2-Clause"
] | null | null | null | scripts/compile_prosivic_results.py | sukhvir-chauhan-1999/adas-pro-sivic | fb4bbd4f39b58e42c3d47494fb4116a3e7fced0d | [
"BSD-2-Clause"
] | 3 | 2020-04-05T01:49:26.000Z | 2021-09-28T07:09:41.000Z | import os
import statistics
import csv
from collections import Counter
import pandas as pd
import numpy as np
class ExpSetup:
def __init__(self, ped_x, ped_y, ped_orient, ped_speed, car_speed, min_dist, min_ttc, min_dist_awa, det, col):
self.ped_x = ped_x
self.ped_y = ped_y
self.ped_orient... | 40.909483 | 615 | 0.640185 | import os
import statistics
import csv
from collections import Counter
import pandas as pd
import numpy as np
class ExpSetup:
def __init__(self, ped_x, ped_y, ped_orient, ped_speed, car_speed, min_dist, min_ttc, min_dist_awa, det, col):
self.ped_x = ped_x
self.ped_y = ped_y
self.ped_orient... | true | true |
f7187a6e99e39c6f2ebf4e337d526183e1dbb006 | 521 | py | Python | alveo/neptune/service.py | asirasa-xilinx/Vitis-AI | 2ea756d2946d66266c111b09b85f4bcf7fc60764 | [
"Apache-2.0"
] | null | null | null | alveo/neptune/service.py | asirasa-xilinx/Vitis-AI | 2ea756d2946d66266c111b09b85f4bcf7fc60764 | [
"Apache-2.0"
] | null | null | null | alveo/neptune/service.py | asirasa-xilinx/Vitis-AI | 2ea756d2946d66266c111b09b85f4bcf7fc60764 | [
"Apache-2.0"
] | null | null | null | import os
class Service(object):
"""
The base class for all services. All services inherit from this class
"""
def __init__(self, prefix, artifacts, graph):
self._artifacts = artifacts
self._prefix = prefix
self._proc = None
self._graph = graph
def start(self, arg... | 22.652174 | 73 | 0.608445 | import os
class Service(object):
def __init__(self, prefix, artifacts, graph):
self._artifacts = artifacts
self._prefix = prefix
self._proc = None
self._graph = graph
def start(self, args):
self._graph.serve(args, background=True)
def stop(self):... | true | true |
f7187a7d00539bb05c8029543eca7c0694b8593d | 1,063 | py | Python | ExecutingEntryCallingScriptHash/contractB_compiler2.0.py | ONT-Avocados/python-template | 0acb5032adf8f4968c5d46cf53681f31ac917650 | [
"Apache-2.0"
] | 17 | 2018-09-26T07:09:16.000Z | 2020-05-28T06:16:47.000Z | ExecutingEntryCallingScriptHash/contractB_compiler2.0.py | zhangxiaocong/python-template | 0acb5032adf8f4968c5d46cf53681f31ac917650 | [
"Apache-2.0"
] | 8 | 2018-09-26T02:08:04.000Z | 2021-12-14T02:53:26.000Z | ExecutingEntryCallingScriptHash/contractB_compiler2.0.py | zhangxiaocong/python-template | 0acb5032adf8f4968c5d46cf53681f31ac917650 | [
"Apache-2.0"
] | 30 | 2018-09-25T08:27:42.000Z | 2020-12-08T09:02:33.000Z | OntCversion = '2.0.0'
from ontology.interop.System.ExecutionEngine import GetExecutingScriptHash, GetCallingScriptHash, GetEntryScriptHash
from ontology.interop.System.Runtime import CheckWitness, GetTime, Notify, Serialize, Deserialize
ContractAddress = GetExecutingScriptHash()
def Main(opration, args):
if opra... | 33.21875 | 116 | 0.728128 | OntCversion = '2.0.0'
from ontology.interop.System.ExecutionEngine import GetExecutingScriptHash, GetCallingScriptHash, GetEntryScriptHash
from ontology.interop.System.Runtime import CheckWitness, GetTime, Notify, Serialize, Deserialize
ContractAddress = GetExecutingScriptHash()
def Main(opration, args):
if opra... | true | true |
f7187bb4fead8b89d8048f1b523ec3b567c0a9ea | 25,260 | py | Python | src/rosdep2/sources_list.py | tianbot/rosdep | 24c8c76a8cb99b08285192013a165f30af0f5232 | [
"BSD-3-Clause"
] | 2 | 2021-11-16T10:49:18.000Z | 2021-11-16T23:38:11.000Z | src/rosdep2/sources_list.py | tianbot/rosdep | 24c8c76a8cb99b08285192013a165f30af0f5232 | [
"BSD-3-Clause"
] | null | null | null | src/rosdep2/sources_list.py | tianbot/rosdep | 24c8c76a8cb99b08285192013a165f30af0f5232 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of cond... | 37.422222 | 121 | 0.662074 |
from __future__ import print_function
import os
import sys
import yaml
from rosdep2.shell_utils import FakeURLOpener as urlopen
try:
from urllib.error import URLError
import urllib.request as request
except ImportError:
from urllib2 import URLError
import urllib2 as request
try:
import cPickle as... | true | true |
f7187bd033077653af8175fd412b56d5fba443ce | 30 | py | Python | snakeai/gui/__init__.py | thankthemaker/snake-ai-reinforcement | e74964faf7eb893e35dc85ede10f5d794b740fff | [
"MIT"
] | 145 | 2017-04-08T17:48:50.000Z | 2022-03-21T15:14:12.000Z | snakeai/gui/__init__.py | thankthemaker/snake-ai-reinforcement | e74964faf7eb893e35dc85ede10f5d794b740fff | [
"MIT"
] | 7 | 2017-08-10T04:43:30.000Z | 2020-11-18T07:21:16.000Z | snakeai/gui/__init__.py | thankthemaker/snake-ai-reinforcement | e74964faf7eb893e35dc85ede10f5d794b740fff | [
"MIT"
] | 48 | 2017-06-01T07:29:01.000Z | 2021-09-18T09:05:16.000Z | from .pygame import PyGameGUI
| 15 | 29 | 0.833333 | from .pygame import PyGameGUI
| true | true |
f7187c1a413767abebf5c8ea371b99345ec2aceb | 1,532 | py | Python | web/forms.py | tusharbohara/simple-user-registration-and-functionality-webapp-using-django | f3ad7aef110f4f637955f39b93c066f54ebab231 | [
"MIT"
] | null | null | null | web/forms.py | tusharbohara/simple-user-registration-and-functionality-webapp-using-django | f3ad7aef110f4f637955f39b93c066f54ebab231 | [
"MIT"
] | null | null | null | web/forms.py | tusharbohara/simple-user-registration-and-functionality-webapp-using-django | f3ad7aef110f4f637955f39b93c066f54ebab231 | [
"MIT"
] | null | null | null | from django import forms
from tempus_dominus.widgets import DatePicker
class ConsumerRegistrationForm(forms.Form):
GENDER = [
('Male', 'Male'),
('Female', 'Female'),
('Transgender', 'Transgender'),
('Not to Specify', 'Not to Specify'),
]
BLOOD_TYPE = [
('A+', 'A+'),... | 30.64 | 73 | 0.555483 | from django import forms
from tempus_dominus.widgets import DatePicker
class ConsumerRegistrationForm(forms.Form):
GENDER = [
('Male', 'Male'),
('Female', 'Female'),
('Transgender', 'Transgender'),
('Not to Specify', 'Not to Specify'),
]
BLOOD_TYPE = [
('A+', 'A+'),... | true | true |
f7187cef3a6d64b15e1d52f337b3a219d8d5f4ed | 7,702 | py | Python | tests/cli/commands/test_celery_command.py | gtossou/airflow | 0314a3a218f864f78ec260cc66134e7acae34bc5 | [
"Apache-2.0"
] | 2 | 2020-10-23T18:55:03.000Z | 2021-07-13T04:45:49.000Z | tests/cli/commands/test_celery_command.py | gtossou/airflow | 0314a3a218f864f78ec260cc66134e7acae34bc5 | [
"Apache-2.0"
] | 10 | 2021-09-08T21:27:07.000Z | 2022-03-30T17:54:45.000Z | tests/cli/commands/test_celery_command.py | gtossou/airflow | 0314a3a218f864f78ec260cc66134e7acae34bc5 | [
"Apache-2.0"
] | 2 | 2020-10-23T18:55:05.000Z | 2022-02-16T21:53:10.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 39.497436 | 106 | 0.675019 | import unittest
from argparse import Namespace
from tempfile import NamedTemporaryFile
from unittest import mock
import pytest
import sqlalchemy
import airflow
from airflow.cli import cli_parser
from airflow.cli.commands import celery_command
from airflow.configuration import conf
from tests.test_utils.config import ... | true | true |
f7187e1c7404425320737222caf5e588e2f3c608 | 2,883 | py | Python | subgroups/gamma_zero.py | kalinkinisaac/modular | 301d26ad222a5ef3278aaf251908e0a8537bb58f | [
"MIT"
] | null | null | null | subgroups/gamma_zero.py | kalinkinisaac/modular | 301d26ad222a5ef3278aaf251908e0a8537bb58f | [
"MIT"
] | null | null | null | subgroups/gamma_zero.py | kalinkinisaac/modular | 301d26ad222a5ef3278aaf251908e0a8537bb58f | [
"MIT"
] | null | null | null | from .base_gamma import BaseGamma
from .isomorphism import (one2many, many2one)
from .algo import (factor, get_xy, gcd, inv_element)
from math import log
from fimath import Matrix
import itertools
class GammaZero(BaseGamma):
def __init__(self, *args, **kwargs):
super(__class__, self).__init__(*args, **kw... | 28.83 | 75 | 0.541797 | from .base_gamma import BaseGamma
from .isomorphism import (one2many, many2one)
from .algo import (factor, get_xy, gcd, inv_element)
from math import log
from fimath import Matrix
import itertools
class GammaZero(BaseGamma):
def __init__(self, *args, **kwargs):
super(__class__, self).__init__(*args, **kw... | true | true |
f7187e6897bff9206930e55c479aeb8c17fd6cb9 | 11,160 | py | Python | KGEAttack/ConvE/l2_del.py | PeruBhardwaj/AttributionAttack | 0d5ca334c611c5e067029a3f8907f2d91255ddde | [
"MIT"
] | 5 | 2021-11-08T07:18:10.000Z | 2022-03-10T09:06:11.000Z | KGEAttack/ConvE/l2_del.py | PeruBhardwaj/AttributionAttack | 0d5ca334c611c5e067029a3f8907f2d91255ddde | [
"MIT"
] | null | null | null | KGEAttack/ConvE/l2_del.py | PeruBhardwaj/AttributionAttack | 0d5ca334c611c5e067029a3f8907f2d91255ddde | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In this notebook, I delete a triple from the neighbourhood of the target triple based on the **L2 metric = euclidean distance** between the candidate triple's embedding and the target triple's embedding
#
# - 'triple' embedding is computed by applying the model's scoring functi... | 37.2 | 204 | 0.63629 |
# - neighbourhood refers to the triples that share the entities with target's entities
import pickle
from typing import Dict, Tuple, List
import os
import numpy as np
import pandas as pd
from collections import defaultdict
import operator
import json
import logging
import argparse
import math
from pprint import p... | true | true |
f7187f1fc12ea1ed1b0c5a0ce33d00d4b8ac79c3 | 7,229 | py | Python | blocklogic.py | rroctavian/blockchain_wdss | 2d25cb83fac91404da8b7e2404b5668a5877318f | [
"MIT"
] | null | null | null | blocklogic.py | rroctavian/blockchain_wdss | 2d25cb83fac91404da8b7e2404b5668a5877318f | [
"MIT"
] | null | null | null | blocklogic.py | rroctavian/blockchain_wdss | 2d25cb83fac91404da8b7e2404b5668a5877318f | [
"MIT"
] | null | null | null | from hashlib import sha256
import json
import time
import multiprocessing
import time
import numpy as np
class Block:
def __init__(
self, depth, transactions, timestamp,
previous_hash, nonce=0
):
self.depth = depth
self.transactions = transactions
self.time... | 35.787129 | 98 | 0.580302 | from hashlib import sha256
import json
import time
import multiprocessing
import time
import numpy as np
class Block:
def __init__(
self, depth, transactions, timestamp,
previous_hash, nonce=0
):
self.depth = depth
self.transactions = transactions
self.time... | true | true |
f7187f5b5ab4da7e46565bfd415acf79f33f3db2 | 25,583 | py | Python | test/with_dummyserver/test_poolmanager.py | pquentin/hip | 89c766d0782f016baeda236149f29477f7237eed | [
"MIT"
] | null | null | null | test/with_dummyserver/test_poolmanager.py | pquentin/hip | 89c766d0782f016baeda236149f29477f7237eed | [
"MIT"
] | 1 | 2020-01-21T06:48:37.000Z | 2020-01-21T06:48:37.000Z | test/with_dummyserver/test_poolmanager.py | pquentin/hip | 89c766d0782f016baeda236149f29477f7237eed | [
"MIT"
] | null | null | null | import io
import json
import time
import pytest
from dummyserver.server import HAS_IPV6
from dummyserver.testcase import HTTPDummyServerTestCase, IPv6HTTPDummyServerTestCase
from hip.base import DEFAULT_PORTS
from hip.poolmanager import PoolManager
from hip.exceptions import MaxRetryError, NewConnectionError, Unrewin... | 35.581363 | 88 | 0.517883 | import io
import json
import time
import pytest
from dummyserver.server import HAS_IPV6
from dummyserver.testcase import HTTPDummyServerTestCase, IPv6HTTPDummyServerTestCase
from hip.base import DEFAULT_PORTS
from hip.poolmanager import PoolManager
from hip.exceptions import MaxRetryError, NewConnectionError, Unrewin... | true | true |
f7187fe8f56ad4cf2d4f4dd6df4dd33406b5cf84 | 13,872 | py | Python | tools/my_runner.py | ydiller/NoMoreNMS | 1c1557357e5312c287f0971c840060deb1bcd039 | [
"Apache-2.0"
] | null | null | null | tools/my_runner.py | ydiller/NoMoreNMS | 1c1557357e5312c287f0971c840060deb1bcd039 | [
"Apache-2.0"
] | null | null | null | tools/my_runner.py | ydiller/NoMoreNMS | 1c1557357e5312c287f0971c840060deb1bcd039 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp
import platform
import shutil
import time
import warnings
import torch
import mmcv
import wandb
from mmcv.runner.hooks import HOOKS, Hook
from mmcv.runner.base_runner import BaseRunner
from mmcv.runner.builder import RUNNERS
from mmcv.runner.checkpoi... | 42.292683 | 140 | 0.575115 | import os.path as osp
import platform
import shutil
import time
import warnings
import torch
import mmcv
import wandb
from mmcv.runner.hooks import HOOKS, Hook
from mmcv.runner.base_runner import BaseRunner
from mmcv.runner.builder import RUNNERS
from mmcv.runner.checkpoint import save_checkpoint
from mmcv.runner.utils... | true | true |
f7187ff435949165d6ffa9b6741462e446524819 | 6,374 | py | Python | data_process/kdtree.py | MortonWang/geo_IF | 4e27aeb9e005cdfb151777bc730de6d8372d1b7f | [
"MIT"
] | 5 | 2020-06-19T13:39:59.000Z | 2022-03-04T13:05:58.000Z | data_process/kdtree.py | MortonWang/geo_IF | 4e27aeb9e005cdfb151777bc730de6d8372d1b7f | [
"MIT"
] | null | null | null | data_process/kdtree.py | MortonWang/geo_IF | 4e27aeb9e005cdfb151777bc730de6d8372d1b7f | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import copy
import numpy as np
from scipy._lib.six import xrange
class KDTree:
def __init__(self, bucket_size, dimensions, parent=None):
self.bucket_size = bucket_size
self.parent = None
self.left = None
self.right = None
self.split_dimension = None
... | 39.8375 | 136 | 0.623784 | import copy
import numpy as np
from scipy._lib.six import xrange
class KDTree:
def __init__(self, bucket_size, dimensions, parent=None):
self.bucket_size = bucket_size
self.parent = None
self.left = None
self.right = None
self.split_dimension = None
self.split_valu... | true | true |
f7188051fe659ac1411c3c3c3d773672836caf24 | 13,881 | py | Python | tensorflow_probability/python/distributions/student_t_process_regression_model_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 3,670 | 2018-02-14T03:29:40.000Z | 2022-03-30T01:19:52.000Z | tensorflow_probability/python/distributions/student_t_process_regression_model_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 1,395 | 2018-02-24T02:28:49.000Z | 2022-03-31T16:12:06.000Z | tensorflow_probability/python/distributions/student_t_process_regression_model_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 1,135 | 2018-02-14T01:51:10.000Z | 2022-03-28T02:24:11.000Z | # Copyright 2021 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 40.469388 | 119 | 0.680931 | import numpy as np
import tensorflow.compat.v2 as tf
from tensorflow_probability.python import distributions as tfd
from tensorflow_probability.python.internal import test_util
from tensorflow_probability.python.math import psd_kernels
@test_util.test_all_tf_execution_regimes
class StudentTProcessRegressionModelTest(... | true | true |
f718815b2922106732719f8c9367ef276f71008f | 24,159 | py | Python | contents/tts/content/TensorflowTTS/tensorflow_tts/utils/group_conv.py | PIN-devel/inside-kids | 554e4a0a5654c9a0f5237b904bb2ca6db88a55cb | [
"MIT"
] | 2 | 2020-07-03T05:47:47.000Z | 2020-07-03T19:59:09.000Z | contents/tts/content/TensorflowTTS/tensorflow_tts/utils/group_conv.py | PIN-devel/inside-kids | 554e4a0a5654c9a0f5237b904bb2ca6db88a55cb | [
"MIT"
] | 1 | 2021-02-26T04:10:19.000Z | 2021-02-26T04:10:19.000Z | contents/tts/content/TensorflowTTS/tensorflow_tts/utils/group_conv.py | PIN-devel/inside-kids | 554e4a0a5654c9a0f5237b904bb2ca6db88a55cb | [
"MIT"
] | 4 | 2021-02-23T13:05:59.000Z | 2021-04-23T05:15:32.000Z | # -*- coding: utf-8 -*-
# This code is copy from https://github.com/tensorflow/tensorflow/pull/36773.
"""Group Convolution Modules."""
from tensorflow.python.framework import tensor_shape
from tensorflow.python.keras import activations
from tensorflow.python.keras import constraints
from tensorflow.python.keras import... | 42.759292 | 88 | 0.633263 |
from tensorflow.python.framework import tensor_shape
from tensorflow.python.keras import activations
from tensorflow.python.keras import constraints
from tensorflow.python.keras import initializers
from tensorflow.python.keras import regularizers
from tensorflow.python.keras.engine.base_layer import Layer
from tensorf... | true | true |
f71882478dfe74c0a4592f297f1ac49bf7457bb9 | 531 | py | Python | tests/test_stuff.py | alexanderrichards/ProductionSystem | ea9b80f13d76be293c8e2a3387d4cb3abc56e314 | [
"MIT"
] | null | null | null | tests/test_stuff.py | alexanderrichards/ProductionSystem | ea9b80f13d76be293c8e2a3387d4cb3abc56e314 | [
"MIT"
] | 43 | 2018-04-23T08:39:17.000Z | 2019-11-26T12:17:14.000Z | tests/test_stuff.py | alexanderrichards/ProductionSystem | ea9b80f13d76be293c8e2a3387d4cb3abc56e314 | [
"MIT"
] | 1 | 2019-02-05T04:17:07.000Z | 2019-02-05T04:17:07.000Z | """Test Stuff."""
from unittest import TestCase
import pkg_resources
from productionsystem.config import ConfigSystem
# def setup_module(module):
# """ setup any state specific to the execution of the given module."""
# config_instance = ConfigSystem.setup(None) # pylint: disable=no-member
# config_insta... | 26.55 | 87 | 0.708098 | from unittest import TestCase
import pkg_resources
from productionsystem.config import ConfigSystem
class TestStuff(TestCase):
def test_bob(self):
pass
| true | true |
f718825de43905bfc5be6bacd294d07ee49fda2d | 10,286 | py | Python | src/python/zquantum/core/utils.py | FredericSauv/z-quantum-core | f285b292159fe272d7401ba05baac7bab28475d7 | [
"Apache-2.0"
] | null | null | null | src/python/zquantum/core/utils.py | FredericSauv/z-quantum-core | f285b292159fe272d7401ba05baac7bab28475d7 | [
"Apache-2.0"
] | null | null | null | src/python/zquantum/core/utils.py | FredericSauv/z-quantum-core | f285b292159fe272d7401ba05baac7bab28475d7 | [
"Apache-2.0"
] | null | null | null | """General-purpose utilities."""
import numpy as np
from scipy.linalg import expm
import random
import math
import operator
import sys
import json
import openfermion
from openfermion import hermitian_conjugated
from openfermion.ops import SymbolicOperator
from networkx.readwrite import json_graph
import lea
import col... | 28.258242 | 112 | 0.637857 |
import numpy as np
from scipy.linalg import expm
import random
import math
import operator
import sys
import json
import openfermion
from openfermion import hermitian_conjugated
from openfermion.ops import SymbolicOperator
from networkx.readwrite import json_graph
import lea
import collections
import scipy
from typing... | true | true |
f71882825d3f22da41da2d51951295858305f25f | 128 | py | Python | cactus/types/coin_solution.py | grayfallstown/cactus-blockchain | 680d68d0bb7694bd4b99e4906b356e014bca7734 | [
"Apache-2.0"
] | 11,902 | 2019-12-05T00:14:29.000Z | 2022-03-31T23:25:37.000Z | chia/types/coin_solution.py | jcteng/ext9-blockchain | 46506bc5778e14cbc373de39438b0c6f794a49c5 | [
"Apache-2.0"
] | 5,246 | 2019-12-05T04:00:03.000Z | 2022-03-31T21:33:30.000Z | chia/types/coin_solution.py | jcteng/ext9-blockchain | 46506bc5778e14cbc373de39438b0c6f794a49c5 | [
"Apache-2.0"
] | 2,149 | 2019-12-05T11:12:53.000Z | 2022-03-31T06:08:34.000Z | import warnings
from .coin_spend import CoinSpend as CoinSolution # noqa
warnings.warn("`CoinSolution` is now `CoinSpend`")
| 18.285714 | 57 | 0.773438 | import warnings
from .coin_spend import CoinSpend as CoinSolution
warnings.warn("`CoinSolution` is now `CoinSpend`")
| true | true |
f71882b27108d3771cc3ddae3f362ee0e8b76a4b | 6,457 | py | Python | examples/ale/train_nsq_ale.py | yuishihara/chainerrl | 74901712a8ed8207b9d526d3f45b04bf22996b8d | [
"MIT"
] | 18 | 2018-08-07T07:27:41.000Z | 2018-08-20T01:51:21.000Z | examples/ale/train_nsq_ale.py | yuishihara/chainerrl | 74901712a8ed8207b9d526d3f45b04bf22996b8d | [
"MIT"
] | null | null | null | examples/ale/train_nsq_ale.py | yuishihara/chainerrl | 74901712a8ed8207b9d526d3f45b04bf22996b8d | [
"MIT"
] | 2 | 2018-08-16T06:47:26.000Z | 2018-08-20T01:51:22.000Z | from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import argparse
import os
import random
# This prevents num... | 37.760234 | 77 | 0.641474 | from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import * from future import standard_library
standard_library.install_aliases()
import argparse
import os
import random
os.environ['OMP_NUM_THREADS'] = '... | true | true |
f71882cab39cf5d57a226bf9a24b1aec3387c49a | 1,466 | py | Python | aliyun-python-sdk-ons/aliyunsdkons/request/v20190214/OnsTopicListRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-ons/aliyunsdkons/request/v20190214/OnsTopicListRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-ons/aliyunsdkons/request/v20190214/OnsTopicListRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.904762 | 71 | 0.761255 |
from aliyunsdkcore.request import RpcRequest
class OnsTopicListRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Ons', '2019-02-14', 'OnsTopicList','ons')
def get_PreventCache(self):
return self.get_query_params().get('PreventCache')
def set_PreventCache(self,PreventCache):
self.add... | true | true |
f7188338fbe6feb8c2970ca81bf60c30b86db76c | 1,709 | py | Python | landmark.py | gavincangan/alvin | 4e1945a3f5bb061842f0e35633f254863f8923c8 | [
"MIT"
] | null | null | null | landmark.py | gavincangan/alvin | 4e1945a3f5bb061842f0e35633f254863f8923c8 | [
"MIT"
] | null | null | null | landmark.py | gavincangan/alvin | 4e1945a3f5bb061842f0e35633f254863f8923c8 | [
"MIT"
] | null | null | null | import sys
from pymunk import Body, Circle, ShapeFilter
from configsingleton import ConfigSingleton
from common import *
from common.drawing import draw_circle
class Landmark(object):
def __init__(self, mask, radius):
self.body = Body(0, 0, Body.STATIC)
self.body.position = 0, 0
self.body.a... | 37.152174 | 80 | 0.622586 | import sys
from pymunk import Body, Circle, ShapeFilter
from configsingleton import ConfigSingleton
from common import *
from common.drawing import draw_circle
class Landmark(object):
def __init__(self, mask, radius):
self.body = Body(0, 0, Body.STATIC)
self.body.position = 0, 0
self.body.a... | true | true |
f71883436f0b25e5b91c4b47d39b55ee34c3a2ba | 353 | py | Python | Chapter 02/scape_v1.py | mujib2953/Python_Practice | 39da23190196f050ea5834358907db723053da27 | [
"MIT"
] | null | null | null | Chapter 02/scape_v1.py | mujib2953/Python_Practice | 39da23190196f050ea5834358907db723053da27 | [
"MIT"
] | null | null | null | Chapter 02/scape_v1.py | mujib2953/Python_Practice | 39da23190196f050ea5834358907db723053da27 | [
"MIT"
] | null | null | null | import urllib.request
# http://beans-r-us.appspot.com/prices.html
# http://www.beans-r-us.biz/prices.html
# http://www.moneycontrol.com/india/stockpricequote/computers-software/tataconsultancyservices/TCS
baseUrl = 'http://beans-r-us.appspot.com/prices.html'
page = urllib.request.urlopen( baseUrl )
text = page.read()... | 29.416667 | 98 | 0.750708 | import urllib.request
baseUrl = 'http://beans-r-us.appspot.com/prices.html'
page = urllib.request.urlopen( baseUrl )
text = page.read().decode( 'utf8' )
print( text )
| true | true |
f71883577f39ef70d1dc2c52c00b5ff024d4497c | 1,400 | py | Python | likes/urls.py | CMPUT404-stev-sand-pant-ashw-mehr/CMPUT404-stev-sand-pant-ashw-mehr-repo | 0f96d938e9e3ec51103f2b20cb9673bd0b145343 | [
"MIT"
] | null | null | null | likes/urls.py | CMPUT404-stev-sand-pant-ashw-mehr/CMPUT404-stev-sand-pant-ashw-mehr-repo | 0f96d938e9e3ec51103f2b20cb9673bd0b145343 | [
"MIT"
] | 50 | 2021-10-08T00:01:43.000Z | 2021-12-06T06:34:29.000Z | likes/urls.py | CMPUT404-stev-sand-pant-ashw-mehr/CMPUT404-stev-sand-pant-ashw-mehr-repo | 0f96d938e9e3ec51103f2b20cb9673bd0b145343 | [
"MIT"
] | null | null | null | from django.urls import re_path
from .api import PostLikeViewSet, CommentLikeViewSet, AuthorLikeViewSet
urlpatterns = [
re_path(r'^author/(?P<author_id>[a-z0-9-\.-]+)/post/(?P<post_id>[a-z0-9-:\.-]+)/likes/?$', PostLikeViewSet.as_view({
"get": "get_post_likes",
"post": "add_post_like",
... | 46.666667 | 166 | 0.531429 | from django.urls import re_path
from .api import PostLikeViewSet, CommentLikeViewSet, AuthorLikeViewSet
urlpatterns = [
re_path(r'^author/(?P<author_id>[a-z0-9-\.-]+)/post/(?P<post_id>[a-z0-9-:\.-]+)/likes/?$', PostLikeViewSet.as_view({
"get": "get_post_likes",
"post": "add_post_like",
... | true | true |
f7188362b6c3cf336bbf4135433d127a1a5e5491 | 469 | py | Python | search/selectionsort.py | jsz1/algorithms-and-data-structures | fbf71f290d55c4f3f7b2123c4bd6df6396e3ede4 | [
"MIT"
] | null | null | null | search/selectionsort.py | jsz1/algorithms-and-data-structures | fbf71f290d55c4f3f7b2123c4bd6df6396e3ede4 | [
"MIT"
] | null | null | null | search/selectionsort.py | jsz1/algorithms-and-data-structures | fbf71f290d55c4f3f7b2123c4bd6df6396e3ede4 | [
"MIT"
] | null | null | null | def selection_sort(alist):
for fill_slot in range(len(alist) - 1,0,-1):
position_of_max = 0
for location in range(1, fill_slot + 1):
if alist[location] > alist[position_of_max]:
position_of_max = location
temp = alist[fill_slot]
alist[fill_slot] = alist[p... | 33.5 | 60 | 0.635394 | def selection_sort(alist):
for fill_slot in range(len(alist) - 1,0,-1):
position_of_max = 0
for location in range(1, fill_slot + 1):
if alist[location] > alist[position_of_max]:
position_of_max = location
temp = alist[fill_slot]
alist[fill_slot] = alist[p... | false | true |
f718836b8c0b46908cdf57f0144d22ccc800514c | 363,980 | py | Python | pynos/versions/ver_6/ver_6_0_1/yang/brocade_interface_ext.py | bdeetz/pynos | bd8a34e98f322de3fc06750827d8bbc3a0c00380 | [
"Apache-2.0"
] | 12 | 2015-09-21T23:56:09.000Z | 2018-03-30T04:35:32.000Z | pynos/versions/ver_6/ver_6_0_1/yang/brocade_interface_ext.py | bdeetz/pynos | bd8a34e98f322de3fc06750827d8bbc3a0c00380 | [
"Apache-2.0"
] | 10 | 2016-09-15T19:03:27.000Z | 2017-07-17T23:38:01.000Z | pynos/versions/ver_6/ver_6_0_1/yang/brocade_interface_ext.py | bdeetz/pynos | bd8a34e98f322de3fc06750827d8bbc3a0c00380 | [
"Apache-2.0"
] | 6 | 2015-08-14T08:05:23.000Z | 2022-02-03T15:33:54.000Z | #!/usr/bin/env python
import xml.etree.ElementTree as ET
class brocade_interface_ext(object):
"""Auto generated class.
"""
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback')
def get_vlan_brief_input_request_type_get_request_vlan_id(self, **kwargs):
"""A... | 48.640919 | 116 | 0.675903 | import xml.etree.ElementTree as ET
class brocade_interface_ext(object):
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback')
def get_vlan_brief_input_request_type_get_request_vlan_id(self, **kwargs):
config = ET.Element("config")
get_vlan_brief = ET.Eleme... | true | true |
f71884bbf144038a727debbf7cccc7fa2cfb1499 | 720 | py | Python | qa/rpc-tests/create_cache.py | jtoomim/BitcoinUnlimited | b7b9b59a8440f720c5e0c3d5aeb1bcc4e48f1b9c | [
"MIT"
] | 535 | 2015-09-04T15:10:08.000Z | 2022-03-17T20:51:05.000Z | qa/rpc-tests/create_cache.py | jtoomim/BitcoinUnlimited | b7b9b59a8440f720c5e0c3d5aeb1bcc4e48f1b9c | [
"MIT"
] | 1,269 | 2016-01-31T20:21:24.000Z | 2022-03-16T01:20:08.000Z | qa/rpc-tests/create_cache.py | jtoomim/BitcoinUnlimited | b7b9b59a8440f720c5e0c3d5aeb1bcc4e48f1b9c | [
"MIT"
] | 295 | 2015-10-19T16:12:29.000Z | 2021-08-02T20:05:17.000Z | #!/usr/bin/env python3
# Copyright (c) 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.
import test_framework.loginit
#
# Helper script to create the cache
# (see BitcoinTestFramework.setup_chain)
#
... | 24 | 69 | 0.708333 | import test_framework.loginit
from test_framework.test_framework import BitcoinTestFramework
class CreateCache(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 0
self.nodes = []
def setup_network(self):
pass
def run_test(self):
... | true | true |
f71885021d239ae2002c7b0633f54ec994ea9bdc | 255 | py | Python | app/validators/answers/answer_validator.py | ajmaddaford/eq-questionnaire-validator | f1f2540533e01e476ffc0a558f36f8f822a7362c | [
"MIT"
] | 1 | 2021-09-10T12:03:02.000Z | 2021-09-10T12:03:02.000Z | app/validators/answers/answer_validator.py | ajmaddaford/eq-questionnaire-validator | f1f2540533e01e476ffc0a558f36f8f822a7362c | [
"MIT"
] | 67 | 2020-02-05T11:54:27.000Z | 2022-03-03T12:55:25.000Z | app/validators/answers/answer_validator.py | ajmaddaford/eq-questionnaire-validator | f1f2540533e01e476ffc0a558f36f8f822a7362c | [
"MIT"
] | 2 | 2021-04-11T07:45:45.000Z | 2021-04-19T14:52:07.000Z | from app.validators.validator import Validator
class AnswerValidator(Validator):
def __init__(self, schema_element):
super().__init__(schema_element)
self.answer = schema_element
self.context["answer_id"] = self.answer["id"]
| 28.333333 | 53 | 0.713725 | from app.validators.validator import Validator
class AnswerValidator(Validator):
def __init__(self, schema_element):
super().__init__(schema_element)
self.answer = schema_element
self.context["answer_id"] = self.answer["id"]
| true | true |
f718868cd1db2d24c9fc9a8d1fbfa74f3af35d37 | 22,294 | py | Python | airtest/core/api.py | Aracoix/Airtest | d41737944738e651dd29564c29b88cc4c2e71e2e | [
"Apache-2.0"
] | 6,140 | 2018-01-24T03:27:48.000Z | 2022-03-31T14:37:54.000Z | airtest/core/api.py | Aracoix/Airtest | d41737944738e651dd29564c29b88cc4c2e71e2e | [
"Apache-2.0"
] | 993 | 2018-02-02T11:21:40.000Z | 2022-03-31T20:41:41.000Z | airtest/core/api.py | Aracoix/Airtest | d41737944738e651dd29564c29b88cc4c2e71e2e | [
"Apache-2.0"
] | 1,022 | 2018-03-05T07:45:22.000Z | 2022-03-31T04:29:57.000Z | # -*- coding: utf-8 -*-
"""
This module contains the Airtest Core APIs.
"""
import os
import time
from six.moves.urllib.parse import parse_qsl, urlparse
from airtest.core.cv import Template, loop_find, try_log_screen
from airtest.core.error import TargetNotFoundError
from airtest.core.settings import Settings as ST
f... | 30.581619 | 127 | 0.632906 | import os
import time
from six.moves.urllib.parse import parse_qsl, urlparse
from airtest.core.cv import Template, loop_find, try_log_screen
from airtest.core.error import TargetNotFoundError
from airtest.core.settings import Settings as ST
from airtest.utils.compat import script_log_dir
from airtest.core.helper impo... | true | true |
f71886a55daf56e9ad908610ff29c7fc570805ef | 3,988 | py | Python | model_zoo/official/recommend/wide_and_deep_multitable/train_and_eval.py | huxian123/mindspore | ec5ba10c82bbd6eccafe32d3a1149add90105bc8 | [
"Apache-2.0"
] | 1 | 2021-04-23T06:35:18.000Z | 2021-04-23T06:35:18.000Z | model_zoo/official/recommend/wide_and_deep_multitable/train_and_eval.py | nudt-eddie/mindspore | 55372b41fdfae6d2b88d7078971e06d537f6c558 | [
"Apache-2.0"
] | null | null | null | model_zoo/official/recommend/wide_and_deep_multitable/train_and_eval.py | nudt-eddie/mindspore | 55372b41fdfae6d2b88d7078971e06d537f6c558 | [
"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 a... | 36.254545 | 107 | 0.675527 |
import os
import sys
from mindspore import Model, context
from mindspore.train.callback import ModelCheckpoint, CheckpointConfig
from mindspore.train.callback import TimeMonitor
from src.wide_and_deep import PredictWithSigmoid, TrainStepWrap, NetWithLossClass, WideDeepModel
from src.callbacks import LossCallB... | true | true |
f71887a83f72a2a2fe70f9569cd374a4db495fcc | 242 | py | Python | easilyb/file_ops/_file_ops.py | xaled/easilyb | cdb5f738205f700b37e03c50d04061a2d1e730cc | [
"MIT"
] | null | null | null | easilyb/file_ops/_file_ops.py | xaled/easilyb | cdb5f738205f700b37e03c50d04061a2d1e730cc | [
"MIT"
] | null | null | null | easilyb/file_ops/_file_ops.py | xaled/easilyb | cdb5f738205f700b37e03c50d04061a2d1e730cc | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
def read_all(sock):
sock.settimeout(5.0)
data = ""
while True:
part = sock.recv(4096)
data += part
if len(part) < 4096:
break
return data | 20.166667 | 36 | 0.57438 | import logging
logger = logging.getLogger(__name__)
def read_all(sock):
sock.settimeout(5.0)
data = ""
while True:
part = sock.recv(4096)
data += part
if len(part) < 4096:
break
return data | true | true |
f71887d368f45f3ec2e13e47d2be1ae91cb6c737 | 4,803 | py | Python | python_anon/PlotLetterROC.py | MaviccPRP/Anonymizer | 3d75ed3e97e260b6ded7e188eb3d58d749844e36 | [
"MIT"
] | null | null | null | python_anon/PlotLetterROC.py | MaviccPRP/Anonymizer | 3d75ed3e97e260b6ded7e188eb3d58d749844e36 | [
"MIT"
] | 2 | 2019-06-14T19:55:39.000Z | 2019-06-14T20:16:11.000Z | python_anon/PlotLetterROC.py | MaviccPRP/Anonymizer | 3d75ed3e97e260b6ded7e188eb3d58d749844e36 | [
"MIT"
] | 1 | 2020-03-13T14:32:31.000Z | 2020-03-13T14:32:31.000Z | #!/usr/env/python
"""
Author: Ralf Hauenschild
E-Mail: ralf_hauenschild@gmx.de
"""
import sys
import os
import numpy
import matplotlib
import matplotlib as mpl
import matplotlib.pyplot as plt
import pylab as py
import matplotlib.cm as cm
import math
c = []
sens = [] # sens (recall)
senserror = []
specloss = [] # 1... | 32.452703 | 193 | 0.609827 |
"""
Author: Ralf Hauenschild
E-Mail: ralf_hauenschild@gmx.de
"""
import sys
import os
import numpy
import matplotlib
import matplotlib as mpl
import matplotlib.pyplot as plt
import pylab as py
import matplotlib.cm as cm
import math
c = []
sens = [] senserror = []
specloss = [] specerror = []
p = [] perror = []
... | false | true |
f718889a61bd413f4f9ce078cd48cee4a7b368ac | 36,429 | py | Python | tests/keras/test_callbacks.py | mdand2000/keras-team-keras | 5eecd55a6f1d6d149b42f9b76aa53d4c5ab8d3eb | [
"MIT"
] | 2 | 2019-09-17T22:01:41.000Z | 2020-05-30T05:48:14.000Z | tests/keras/test_callbacks.py | mdand2000/keras-team-keras | 5eecd55a6f1d6d149b42f9b76aa53d4c5ab8d3eb | [
"MIT"
] | null | null | null | tests/keras/test_callbacks.py | mdand2000/keras-team-keras | 5eecd55a6f1d6d149b42f9b76aa53d4c5ab8d3eb | [
"MIT"
] | 3 | 2019-08-12T18:15:17.000Z | 2021-06-20T19:40:13.000Z | import os
import multiprocessing
import numpy as np
import pytest
from csv import reader
from csv import Sniffer
import shutil
from keras import optimizers
from keras import initializers
from keras import callbacks
from keras.models import Sequential, Model
from keras.layers import Input, Dense, Dropout, add, dot, Lam... | 40.342193 | 118 | 0.588322 | import os
import multiprocessing
import numpy as np
import pytest
from csv import reader
from csv import Sniffer
import shutil
from keras import optimizers
from keras import initializers
from keras import callbacks
from keras.models import Sequential, Model
from keras.layers import Input, Dense, Dropout, add, dot, Lam... | true | true |
f718891f5d70f5bc34c238ce47c933a0dbeff2c0 | 27,465 | py | Python | twisted/conch/scripts/cftp.py | twonds/twisted | d6e270a465d371c3bed01bf369af497b77eb9f1e | [
"Unlicense",
"MIT"
] | 1 | 2021-01-27T19:11:21.000Z | 2021-01-27T19:11:21.000Z | twisted/conch/scripts/cftp.py | twonds/twisted | d6e270a465d371c3bed01bf369af497b77eb9f1e | [
"Unlicense",
"MIT"
] | null | null | null | twisted/conch/scripts/cftp.py | twonds/twisted | d6e270a465d371c3bed01bf369af497b77eb9f1e | [
"Unlicense",
"MIT"
] | 3 | 2017-01-04T01:24:15.000Z | 2020-06-18T16:14:56.000Z | # -*- test-case-name: twisted.conch.test.test_cftp -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation module for the I{cftp} command.
"""
import os, sys, getpass, struct, tty, fcntl, stat
import fnmatch, pwd, time, glob
from twisted.conch.client import connect, d... | 33.907407 | 99 | 0.548189 |
"""
Implementation module for the I{cftp} command.
"""
import os, sys, getpass, struct, tty, fcntl, stat
import fnmatch, pwd, time, glob
from twisted.conch.client import connect, default, options
from twisted.conch.ssh import connection, common
from twisted.conch.ssh import channel, filetransfer
from twisted.protoco... | false | true |
f7188a38996cf7c598da7499b124f3d25c63ff64 | 24 | py | Python | trimesh/version.py | hroncok/trimesh | 85c6af12f8bfdf7d3e6c0b8fa553142a9d4219fe | [
"MIT"
] | null | null | null | trimesh/version.py | hroncok/trimesh | 85c6af12f8bfdf7d3e6c0b8fa553142a9d4219fe | [
"MIT"
] | null | null | null | trimesh/version.py | hroncok/trimesh | 85c6af12f8bfdf7d3e6c0b8fa553142a9d4219fe | [
"MIT"
] | null | null | null | __version__ = '2.35.24'
| 12 | 23 | 0.666667 | __version__ = '2.35.24'
| true | true |
f7188a5d6697e456a89894a7330aa0af3fad00a2 | 146 | py | Python | tests/filetwo.py | alexandrevicenzi/lazyconfig | a03aa0b92cf8f810a8652728d80dd0d792dd66ed | [
"MIT"
] | null | null | null | tests/filetwo.py | alexandrevicenzi/lazyconfig | a03aa0b92cf8f810a8652728d80dd0d792dd66ed | [
"MIT"
] | null | null | null | tests/filetwo.py | alexandrevicenzi/lazyconfig | a03aa0b92cf8f810a8652728d80dd0d792dd66ed | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
sys.path.append('./')
from lazyconfig import lazyconfig
def get_name():
return lazyconfig.config.name
| 12.166667 | 33 | 0.678082 |
import sys
sys.path.append('./')
from lazyconfig import lazyconfig
def get_name():
return lazyconfig.config.name
| true | true |
f7188bfb1008501bd297684979855b6ad8cfff58 | 2,432 | py | Python | Framework/Sketch/Helpers/Metrices.py | Gruschwick/ECG_PLATFORM | 4a1ee568e8593938a3b51c595d4834f861a6db6e | [
"MIT"
] | 5 | 2021-01-28T00:04:35.000Z | 2022-03-05T05:35:10.000Z | Framework/Sketch/Helpers/Metrices.py | Gruschwick/ECG_PLATFORM | 4a1ee568e8593938a3b51c595d4834f861a6db6e | [
"MIT"
] | null | null | null | Framework/Sketch/Helpers/Metrices.py | Gruschwick/ECG_PLATFORM | 4a1ee568e8593938a3b51c595d4834f861a6db6e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 11 16:56:51 2019
@author: x
"""
import numpy as np
from collections import Counter
class MetricesConstants(object):
#qrs_cutoff_distance = 0.2
qrs_cutoff_distance = 0.120 #https://www.sciencedirect.com/science/article/abs/pii/S1746809417300216
def sample_to_tim... | 37.415385 | 123 | 0.713816 |
import numpy as np
from collections import Counter
class MetricesConstants(object):
qrs_cutoff_distance = 0.120
def sample_to_time(samples, freq):
return samples/freq
def match_peaks( ref_peaks, pred_peaks, cutoff_distance = None):
from scipy.optimize import linear_sum_assignment
assert np.all(r... | true | true |
f7188c282ded875e0b10619595c7c3e809117a5a | 222 | py | Python | old_code/keras_main.py | pgruening/dlbio | 0c4e468bcd5d7e298fbecba13003bcae36889486 | [
"MIT"
] | 1 | 2020-10-08T11:14:48.000Z | 2020-10-08T11:14:48.000Z | old_code/keras_main.py | pgruening/dlbio | 0c4e468bcd5d7e298fbecba13003bcae36889486 | [
"MIT"
] | 5 | 2020-03-24T18:01:02.000Z | 2022-03-12T00:17:24.000Z | old_code/keras_main.py | pgruening/dlbio | 0c4e468bcd5d7e298fbecba13003bcae36889486 | [
"MIT"
] | 1 | 2021-11-29T10:31:28.000Z | 2021-11-29T10:31:28.000Z | from keras.utils.generic_utils import get_custom_objects
from main import IMain
class KerasMain(IMain):
def init_costum_objects(self, costum_objects):
get_custom_objects().update(
costum_objects)
| 24.666667 | 56 | 0.752252 | from keras.utils.generic_utils import get_custom_objects
from main import IMain
class KerasMain(IMain):
def init_costum_objects(self, costum_objects):
get_custom_objects().update(
costum_objects)
| true | true |
f7188d171f94cd5bbe951736476fdbef7da4879a | 7,038 | py | Python | source/conf.py | edgarriba/tutorials | 781378818dde4b1e055e9b2d3cb8ea02d66a863e | [
"Apache-2.0"
] | 1 | 2021-05-03T06:42:35.000Z | 2021-05-03T06:42:35.000Z | source/conf.py | edgarriba/tutorials | 781378818dde4b1e055e9b2d3cb8ea02d66a863e | [
"Apache-2.0"
] | null | null | null | source/conf.py | edgarriba/tutorials | 781378818dde4b1e055e9b2d3cb8ea02d66a863e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 31.004405 | 282 | 0.66624 |
project = 'Kornia Tutorials'
copyright = '2021, Kornia Authors'
author = 'Kornia Authors'
version = ''
release = ''
extensions = [
'nbsphinx',
'sphinx.ext.mathjax',
'sphinx.ext.githubpages',
]
exclude_patterns = ['_build', '**.ipynb_checkpoints']
templates_path = ['_templates']
source_suffix = [... | true | true |
f7188d70a660f168ca65fa4e5633d1e3038f23fa | 6,067 | py | Python | venv/Lib/site-packages/IPython/lib/latextools.py | Kiiwi/Syssel | 83705e3fd0edf40f09df950d5ce91c95586573f5 | [
"BSD-3-Clause"
] | 1 | 2017-12-30T20:43:28.000Z | 2017-12-30T20:43:28.000Z | venv/Lib/site-packages/IPython/lib/latextools.py | Kiiwi/Syssel | 83705e3fd0edf40f09df950d5ce91c95586573f5 | [
"BSD-3-Clause"
] | 7 | 2021-02-08T20:22:15.000Z | 2022-03-11T23:19:41.000Z | venv/Lib/site-packages/IPython/lib/latextools.py | Kiiwi/Syssel | 83705e3fd0edf40f09df950d5ce91c95586573f5 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Tools for handling LaTeX."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from io import BytesIO, open
from base64 import encodestring
import os
import tempfile
import shutil
import subprocess
from IPython.utils.process import find_cm... | 30.954082 | 82 | 0.624691 |
from io import BytesIO, open
from base64 import encodestring
import os
import tempfile
import shutil
import subprocess
from IPython.utils.process import find_cmd, FindCmdError
from IPython.config import get_config
from IPython.config.configurable import SingletonConfigurable
from IPython.utils.traitlets import List,... | true | true |
f7188e86396b3eca935897136cb622f3195ec895 | 2,702 | py | Python | eval/eval_OTB.py | Existever/PyCFTrackers | 3221e47aecca40de21ad9be875b2f8d960b4e09c | [
"MIT"
] | null | null | null | eval/eval_OTB.py | Existever/PyCFTrackers | 3221e47aecca40de21ad9be875b2f8d960b4e09c | [
"MIT"
] | null | null | null | eval/eval_OTB.py | Existever/PyCFTrackers | 3221e47aecca40de21ad9be875b2f8d960b4e09c | [
"MIT"
] | null | null | null | import argparse
import glob
from os.path import join, realpath, dirname
from tqdm import tqdm
from multiprocessing import Pool
from lib.pysot.datasets import OTBDataset
from lib.pysot.evaluation import OPEBenchmark
from lib.pysot.visualization import draw_success_precision
if __name__ == '__main__':
parser = argp... | 49.127273 | 198 | 0.620651 | import argparse
import glob
from os.path import join, realpath, dirname
from tqdm import tqdm
from multiprocessing import Pool
from lib.pysot.datasets import OTBDataset
from lib.pysot.evaluation import OPEBenchmark
from lib.pysot.visualization import draw_success_precision
if __name__ == '__main__':
parser = argp... | true | true |
f7188f40cc5531a2407a8ee908641bbb4f109aeb | 6,566 | py | Python | starthinker/task/cm_to_dv/run.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | 138 | 2018-11-28T21:42:44.000Z | 2022-03-30T17:26:35.000Z | starthinker/task/cm_to_dv/run.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | 36 | 2019-02-19T18:33:20.000Z | 2022-01-24T18:02:44.000Z | starthinker/task/cm_to_dv/run.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | 54 | 2018-12-06T05:47:32.000Z | 2022-02-21T22:01:01.000Z | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... | 32.029268 | 81 | 0.700579 |
from starthinker.util import has_values
from starthinker.util.data import get_rows
from starthinker.task.cm_to_dv.cm_account import cm_account_clear
from starthinker.task.cm_to_dv.cm_account import cm_account_load
from starthinker.task.cm_to_dv.cm_advertiser import cm_advertiser_clear
from starthinker.task.cm_to_dv.... | true | true |
f7188fdf67798b6b524e83b8873542b335c4a5b4 | 8,649 | py | Python | acq4/devices/PatchStar/patchstar.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | acq4/devices/PatchStar/patchstar.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | acq4/devices/PatchStar/patchstar.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import time
import numpy as np
from PyQt4 import QtGui, QtCore
from ..Stage import Stage, MoveFuture, StageInterface
from acq4.drivers.PatchStar import PatchStar as PatchStarDriver
from acq4.util.Mutex import Mutex
from acq4.util.Thread import Thread
from acq4.pyqtgraph import debug, ptime, Spin... | 33.01145 | 122 | 0.575327 | import time
import numpy as np
from PyQt4 import QtGui, QtCore
from ..Stage import Stage, MoveFuture, StageInterface
from acq4.drivers.PatchStar import PatchStar as PatchStarDriver
from acq4.util.Mutex import Mutex
from acq4.util.Thread import Thread
from acq4.pyqtgraph import debug, ptime, SpinBox
class PatchStar(St... | true | true |
f7188fe85522ebf6c7d8d5ad84760673a34d5f14 | 3,440 | py | Python | plusportals/client.py | DhruvBisla/PlusPortalsAPI | 606d145f1a61c474907db5b034af5c887783882a | [
"MIT"
] | 4 | 2021-02-16T23:25:08.000Z | 2022-01-04T01:11:39.000Z | plusportals/client.py | DhruvBisla/PlusPortalsAPI | 606d145f1a61c474907db5b034af5c887783882a | [
"MIT"
] | 2 | 2021-12-17T15:27:46.000Z | 2021-12-18T04:21:48.000Z | plusportals/client.py | DhruvBisla/PlusPortalsAPI | 606d145f1a61c474907db5b034af5c887783882a | [
"MIT"
] | 2 | 2021-08-01T01:39:45.000Z | 2021-12-17T15:22:51.000Z | import os
import json
import requests
from typing import Optional
from . import credentials
from . import info
from . import session
class Client(session.Session):
_SCHOOL_NAME : str = None
_EMAIL : str = None
_ID : int = None
_PASSWORD : str = None
markingPeriods : list = []
hasCachedCredenti... | 51.343284 | 572 | 0.659593 | import os
import json
import requests
from typing import Optional
from . import credentials
from . import info
from . import session
class Client(session.Session):
_SCHOOL_NAME : str = None
_EMAIL : str = None
_ID : int = None
_PASSWORD : str = None
markingPeriods : list = []
hasCachedCredenti... | true | true |
f71890129fc28aa45ba1867efbaf6e4c01b12e1b | 5,309 | py | Python | agent/DQN_agent.py | JiaXingBinggan/MSRL | fcc8b06eb1938a78549868b27f2962cb47b3d866 | [
"Apache-2.0"
] | null | null | null | agent/DQN_agent.py | JiaXingBinggan/MSRL | fcc8b06eb1938a78549868b27f2962cb47b3d866 | [
"Apache-2.0"
] | null | null | null | agent/DQN_agent.py | JiaXingBinggan/MSRL | fcc8b06eb1938a78549868b27f2962cb47b3d866 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import mindspore
from mindspore import context, ops, Tensor, nn
from mindspore.common.parameter import Parameter, ParameterTuple
import copy
context.set_context(mode=context.PYNATIVE_MODE, device_target="CPU")
_update_op = ops.MultitypeFuncGraph("update_op")
@_update_op.register("Tensor", "Tens... | 32.175758 | 117 | 0.638727 | import numpy as np
import mindspore
from mindspore import context, ops, Tensor, nn
from mindspore.common.parameter import Parameter, ParameterTuple
import copy
context.set_context(mode=context.PYNATIVE_MODE, device_target="CPU")
_update_op = ops.MultitypeFuncGraph("update_op")
@_update_op.register("Tensor", "Tens... | true | true |
f718913f5c1602a006b860d8a1473f9c5e8ad63a | 1,114 | py | Python | base/base_train.py | AndersDHenriksen/Tensorflow-Project-Template | 32dfeaaf1243587af4ceb7b378c135092ddb9258 | [
"Apache-2.0"
] | null | null | null | base/base_train.py | AndersDHenriksen/Tensorflow-Project-Template | 32dfeaaf1243587af4ceb7b378c135092ddb9258 | [
"Apache-2.0"
] | null | null | null | base/base_train.py | AndersDHenriksen/Tensorflow-Project-Template | 32dfeaaf1243587af4ceb7b378c135092ddb9258 | [
"Apache-2.0"
] | 1 | 2018-07-09T03:01:18.000Z | 2018-07-09T03:01:18.000Z | import tensorflow as tf
class BaseTrain:
def __init__(self, sess, model, data, config, logger):
self.model = model
self.logger = logger
self.config = config
self.sess = sess
self.data = data
self.init = tf.group(tf.global_variables_initializer(), tf.local_variables_... | 31.828571 | 107 | 0.630162 | import tensorflow as tf
class BaseTrain:
def __init__(self, sess, model, data, config, logger):
self.model = model
self.logger = logger
self.config = config
self.sess = sess
self.data = data
self.init = tf.group(tf.global_variables_initializer(), tf.local_variables_... | true | true |
f71891d9166196c7b6043b3a9276fa1418b86155 | 10,866 | py | Python | modules/nmt.py | tjuwlz/MachineTranslation | 6e6fc757060ccd076e0ab4313562b1c34892fc60 | [
"Apache-2.0"
] | 1 | 2019-09-26T08:23:20.000Z | 2019-09-26T08:23:20.000Z | modules/nmt.py | LindgeW/MachineTranslation | 7335c7e95d2ca23ca7e26c45d4b8b13e2ce96704 | [
"Apache-2.0"
] | null | null | null | modules/nmt.py | LindgeW/MachineTranslation | 7335c7e95d2ca23ca7e26c45d4b8b13e2ce96704 | [
"Apache-2.0"
] | null | null | null | from datautil.dataloader import batch_iter
import torch.nn.functional as F
import torch.optim as optim
import torch.nn.utils as nn_utils
import time
import torch
import numpy as np
from config.Const import *
class NMT(object):
def __init__(self, encoder, decoder):
super(NMT, self).__init__()
self.... | 44.716049 | 121 | 0.571323 | from datautil.dataloader import batch_iter
import torch.nn.functional as F
import torch.optim as optim
import torch.nn.utils as nn_utils
import time
import torch
import numpy as np
from config.Const import *
class NMT(object):
def __init__(self, encoder, decoder):
super(NMT, self).__init__()
self.... | true | true |
f71892180c36d626c06032d591d63adab692cc84 | 8,517 | py | Python | indigo-web/cdmi/models.py | pericles-project/ERMR | 99e19c476c813632d0508cdef65b4683e36f8e43 | [
"Apache-2.0"
] | null | null | null | indigo-web/cdmi/models.py | pericles-project/ERMR | 99e19c476c813632d0508cdef65b4683e36f8e43 | [
"Apache-2.0"
] | null | null | null | indigo-web/cdmi/models.py | pericles-project/ERMR | 99e19c476c813632d0508cdef65b4683e36f8e43 | [
"Apache-2.0"
] | null | null | null | """"CDMI Models
Copyright 2015 Archive Analytics Solutions - University of Liverpool
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 ... | 34.481781 | 80 | 0.633909 |
import mimetypes
from collections import OrderedDict
from indigo.models.collection import Collection
class CDMIContainer(object):
def __init__(self, indigo_container, api_root):
self.collection = indigo_container
self.api_root = api_root
def get_capabilitiesURI(self):
return (u'{0}/... | true | true |
f7189242314d212cfcbc3ba03b7ee8ad651c0080 | 6,401 | py | Python | tests/test_slot.py | glichtner/fhir.resources | 94896d8f8a0b7dd69253762aab968f4fd6eb69a0 | [
"BSD-3-Clause"
] | null | null | null | tests/test_slot.py | glichtner/fhir.resources | 94896d8f8a0b7dd69253762aab968f4fd6eb69a0 | [
"BSD-3-Clause"
] | null | null | null | tests/test_slot.py | glichtner/fhir.resources | 94896d8f8a0b7dd69253762aab968f4fd6eb69a0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/Slot
Release: R5
Version: 4.5.0
Build ID: 0d95498
Last updated: 2021-04-03T00:34:11.075+00:00
"""
from pydantic.validators import bytes_validator # noqa: F401
from fhir.resources import fhirtypes # noqa: F401
from fhir.resources import slot
... | 35.17033 | 87 | 0.675051 | from pydantic.validators import bytes_validator from fhir.resources import fhirtypes from fhir.resources import slot
def impl_slot_1(inst):
assert inst.appointmentType.coding[0].code == "WALKIN"
assert (
inst.appointmentType.coding[0].display
== "A previously unscheduled walk-in visit"
)... | true | true |
f71892bb0c58c579cec15c6e116e3bf81ee58e49 | 1,959 | py | Python | celestial/client/rootfs/__init__.py | ams-tech/celestial | 0c4c264563fe79d6838a1c40a1d114c1d6fcf23f | [
"MIT"
] | null | null | null | celestial/client/rootfs/__init__.py | ams-tech/celestial | 0c4c264563fe79d6838a1c40a1d114c1d6fcf23f | [
"MIT"
] | null | null | null | celestial/client/rootfs/__init__.py | ams-tech/celestial | 0c4c264563fe79d6838a1c40a1d114c1d6fcf23f | [
"MIT"
] | null | null | null | import os
import subprocess
from celestial.strings import Filesystems
from celestial.client.system import cmdline
def get_fs_types(path):
"""
Fetch a list of possible filesystem types
:param path:
:return: a list of strings with the possible filesystem type, else None
"""
if not os.path.exist... | 30.609375 | 100 | 0.654926 | import os
import subprocess
from celestial.strings import Filesystems
from celestial.client.system import cmdline
def get_fs_types(path):
if not os.path.exists(path):
return None
output = subprocess.check_output(
['''(eval $(blkid {} | awk ' {{ print $3 }} '); echo $TYPE)'''.format(path)],
... | true | true |
f71892da316822a589e48a3fac5a0c42deab2e4e | 22 | py | Python | raster/tester.py | xiaoyingpu/gis | 44c2ef2e604f6547e5bd29aa991e5930342adaba | [
"MIT"
] | 1 | 2019-08-20T13:29:42.000Z | 2019-08-20T13:29:42.000Z | raster/tester.py | xiaoyingpu/gis | 44c2ef2e604f6547e5bd29aa991e5930342adaba | [
"MIT"
] | null | null | null | raster/tester.py | xiaoyingpu/gis | 44c2ef2e604f6547e5bd29aa991e5930342adaba | [
"MIT"
] | null | null | null | def test():
print(ds) | 11 | 11 | 0.636364 | def test():
print(ds) | true | true |
f718935aaa88e73d7b6202df20fac852419becfe | 759 | py | Python | scripts/prepare_syllable_counts.py | voberoi/pysyllables | e1950ac306975f5d197bca7ad5ed9b0c680b0fb2 | [
"MIT"
] | null | null | null | scripts/prepare_syllable_counts.py | voberoi/pysyllables | e1950ac306975f5d197bca7ad5ed9b0c680b0fb2 | [
"MIT"
] | 3 | 2020-03-24T17:17:49.000Z | 2021-02-02T22:15:36.000Z | scripts/prepare_syllable_counts.py | voberoi/pysyllables | e1950ac306975f5d197bca7ad5ed9b0c680b0fb2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import codecs
def main():
syllable_counts = {}
filepath = sys.argv[1]
lines = codecs.open(filepath, encoding="iso-8859-1").read().split("\n")
for line in lines:
if line.startswith(";;;") or len(line) == 0 or line.isspace():
continue
w... | 26.172414 | 75 | 0.59025 |
import sys
import codecs
def main():
syllable_counts = {}
filepath = sys.argv[1]
lines = codecs.open(filepath, encoding="iso-8859-1").read().split("\n")
for line in lines:
if line.startswith(";;;") or len(line) == 0 or line.isspace():
continue
word, phonemes = line.sp... | true | true |
f7189442bf63f4b7c1154480aea820c9a1a2688c | 13,745 | py | Python | startrek/script_mixins.py | drinkfalconpunch/star-trek | 33c8155f94f11832d925a733b1f3ed6eecdcb31e | [
"MIT"
] | 1 | 2019-08-21T18:56:42.000Z | 2019-08-21T18:56:42.000Z | startrek/script_mixins.py | drinkfalconpunch/star-trek | 33c8155f94f11832d925a733b1f3ed6eecdcb31e | [
"MIT"
] | 2 | 2021-03-31T19:22:55.000Z | 2021-06-02T00:17:04.000Z | startrek/script_mixins.py | drinkfalconpunch/star-trek | 33c8155f94f11832d925a733b1f3ed6eecdcb31e | [
"MIT"
] | null | null | null | import itertools
import re
from abc import ABCMeta, abstractmethod
from collections import deque
from pathlib import Path
from typing import List
from startrek.exceptions import ScriptException
from startrek.utils import pairwise
OMITTED = 'OMITTED'
class ScriptBase(metaclass=ABCMeta):
def __init__(self, script_... | 34.276808 | 108 | 0.555838 | import itertools
import re
from abc import ABCMeta, abstractmethod
from collections import deque
from pathlib import Path
from typing import List
from startrek.exceptions import ScriptException
from startrek.utils import pairwise
OMITTED = 'OMITTED'
class ScriptBase(metaclass=ABCMeta):
def __init__(self, script_... | true | true |
f7189717d2883a50d191f134c319e5e2e641ca0c | 71 | py | Python | ddtools/_version.py | Jyyin333/DMTools | 42fed226ffc6291bc8c8438eea49b8488fb692d6 | [
"MIT"
] | null | null | null | ddtools/_version.py | Jyyin333/DMTools | 42fed226ffc6291bc8c8438eea49b8488fb692d6 | [
"MIT"
] | null | null | null | ddtools/_version.py | Jyyin333/DMTools | 42fed226ffc6291bc8c8438eea49b8488fb692d6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '1.0.0' | 17.75 | 24 | 0.549296 |
__version__ = '1.0.0' | true | true |
f71897df774811c2c7e969c6d67c5191a419a861 | 2,722 | py | Python | experimentmanager/utils.py | sciexpem/sciexpem | 6de9a8039356588a5e817f0fa6bafd948220fc8f | [
"MIT"
] | null | null | null | experimentmanager/utils.py | sciexpem/sciexpem | 6de9a8039356588a5e817f0fa6bafd948220fc8f | [
"MIT"
] | 3 | 2019-05-10T14:57:30.000Z | 2021-06-10T21:14:21.000Z | experimentmanager/utils.py | sciexpem/sciexpem | 6de9a8039356588a5e817f0fa6bafd948220fc8f | [
"MIT"
] | 1 | 2020-09-11T09:16:15.000Z | 2020-09-11T09:16:15.000Z | from . import models
import pandas as pd
import zipfile
import os
import re
# def curve_io_formatter(x_column, y_columns, y_names, x_axis, y_axis, log=False):
# curves = []
# for index, output in enumerate(y_columns):
# curve = {round(float(k), 3): round(float(v), 3) for k, v in zip(x_column, output)}
... | 34.025 | 131 | 0.640705 | from . import models
import pandas as pd
import zipfile
import os
import re
excel_colunn_pattern = re.compile("(?P<name>[A-Za-z0-9_/]*)[ \t]+\[(?P<units>[(A-Za-z0-9_/)]*)\]")
def curve_io_formatter(curves, x_axis, y_axis, logY=False):
return {"curves": curves, "x_axis": x_axis, "y_axis": y_axis, "logY": logY}
... | true | true |
f71898c3ed083524faabeea56c687bae2ca86d8e | 807 | py | Python | src/python/pants/backend/python/rules/setup_py_util_test.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/rules/setup_py_util_test.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | 1 | 2018-09-04T17:37:34.000Z | 2018-09-04T19:42:58.000Z | src/python/pants/backend/python/rules/setup_py_util_test.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.python.rules.setup_py_util import distutils_repr
testdata = {
'foo': 'bar',
'baz': {
'qux': [123, 456],
'quux': ('abc', b'xyz'),
'corge': {1, 2, 3}
}... | 16.469388 | 67 | 0.448575 |
from pants.backend.python.rules.setup_py_util import distutils_repr
testdata = {
'foo': 'bar',
'baz': {
'qux': [123, 456],
'quux': ('abc', b'xyz'),
'corge': {1, 2, 3}
},
'various_strings': [
"x'y",
'aaa\nbbb'
]
}
expected = """
{
'foo': 'bar',
'baz': {
'qux': [
... | true | true |
f71898d420e214a47c23384a2b7b0302f44ef350 | 175 | py | Python | paginas/admin.py | DSheridanmt/Safety-Life | 522578858f8e063e14d0274de008c345ef2c0a75 | [
"MIT"
] | null | null | null | paginas/admin.py | DSheridanmt/Safety-Life | 522578858f8e063e14d0274de008c345ef2c0a75 | [
"MIT"
] | null | null | null | paginas/admin.py | DSheridanmt/Safety-Life | 522578858f8e063e14d0274de008c345ef2c0a75 | [
"MIT"
] | null | null | null | from django.contrib import admin
#importar classes
from .models import Publicacao, Tag
# Register your models here.
admin.site.register(Publicacao)
admin.site.register(Tag) | 19.444444 | 35 | 0.805714 | from django.contrib import admin
from .models import Publicacao, Tag
admin.site.register(Publicacao)
admin.site.register(Tag) | true | true |
f7189913fe684be000682693e8c8998c0035fdb1 | 5,622 | py | Python | 2parser/sample.py | formalabstracts/CNL-CIC | c857ee0d52b4ba91dd06a51c8f9f3ec2749ca0eb | [
"MIT"
] | 14 | 2019-06-27T16:34:39.000Z | 2021-01-07T18:13:04.000Z | 2parser/sample.py | formalabstracts/CNL-CIC | c857ee0d52b4ba91dd06a51c8f9f3ec2749ca0eb | [
"MIT"
] | 8 | 2019-10-17T06:09:51.000Z | 2020-03-25T15:51:32.000Z | 2parser/sample.py | formalabstracts/CNL-CIC | c857ee0d52b4ba91dd06a51c8f9f3ec2749ca0eb | [
"MIT"
] | 17 | 2019-06-27T16:34:53.000Z | 2020-08-15T01:30:32.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 16 05:48:26 2021
@author: thales
Generate random samples from parsers
"""
from numpy.random import (poisson , binomial, randint)
from tokenlib import (Item , Etok, mk_stream)
import lib
import state
def bernoulli(p):
return binomial(1,p)
... | 26.394366 | 138 | 0.574173 |
from numpy.random import (poisson , binomial, randint)
from tokenlib import (Item , Etok, mk_stream)
import lib
import state
def bernoulli(p):
return binomial(1,p)
def ran(ls):
if not ls:
raise TypeError(f'ran, expected nonempty list {ls}')
return ls
return ls[randint(0,len(ls))]
def ... | true | true |
f7189aca9151d09325fd0e73daa10f100e064973 | 4,598 | py | Python | onpolicy/envs/mpe/scenarios/simple_push.py | zoeyuchao/onpolicy-release | c2cb64e59c5b1f21cce022db76c378b396fd480e | [
"MIT"
] | 1 | 2021-07-04T08:08:30.000Z | 2021-07-04T08:08:30.000Z | onpolicy/envs/mpe/scenarios/simple_push.py | zoeyuchao/onpolicy-release | c2cb64e59c5b1f21cce022db76c378b396fd480e | [
"MIT"
] | 1 | 2021-06-11T15:28:11.000Z | 2021-06-11T15:28:11.000Z | onpolicy/envs/mpe/scenarios/simple_push.py | zoeyuchao/onpolicy-release | c2cb64e59c5b1f21cce022db76c378b396fd480e | [
"MIT"
] | 1 | 2021-05-17T02:00:18.000Z | 2021-05-17T02:00:18.000Z | import numpy as np
from onpolicy.envs.mpe.core import World, Agent, Landmark
from onpolicy.envs.mpe.scenario import BaseScenario
import random
#
# # the non-ensemble version of <ensemble_push>
#
#
class Scenario(BaseScenario):
def make_world(self, args):
world = World()
world.world_length = ar... | 43.377358 | 159 | 0.61157 | import numpy as np
from onpolicy.envs.mpe.core import World, Agent, Landmark
from onpolicy.envs.mpe.scenario import BaseScenario
import random
class Scenario(BaseScenario):
def make_world(self, args):
world = World()
world.world_length = args.episode_length
world.dim_c = 2
... | true | true |
f7189bcea8006e2f10ec06aeeee0afb685dda826 | 15,186 | py | Python | pysnmp/GBOND-TDIM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/GBOND-TDIM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/GBOND-TDIM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module GBOND-TDIM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/GBOND-TDIM-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:05:16 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 140.611111 | 2,094 | 0.766298 | OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.impo... | true | true |
f7189c274d57bd65a3dbaf3a87aaaf696023de37 | 56,687 | py | Python | src/_pytest/fixtures.py | blueyed/pytest | 2b52e24a9fe013a043c36e3df3d62b4b4f6348f1 | [
"MIT"
] | 3 | 2019-11-26T02:30:12.000Z | 2020-04-15T17:49:07.000Z | src/_pytest/fixtures.py | blueyed/pytest | 2b52e24a9fe013a043c36e3df3d62b4b4f6348f1 | [
"MIT"
] | 59 | 2019-10-22T04:34:22.000Z | 2021-11-27T18:23:11.000Z | src/_pytest/fixtures.py | blueyed/pytest | 2b52e24a9fe013a043c36e3df3d62b4b4f6348f1 | [
"MIT"
] | 1 | 2019-11-14T16:47:19.000Z | 2019-11-14T16:47:19.000Z | import functools
import inspect
import itertools
import sys
import warnings
from collections import defaultdict
from collections import deque
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
import attr
import py.path
import _pytest
from _pytest._code.code import Fo... | 37.590849 | 118 | 0.622647 | import functools
import inspect
import itertools
import sys
import warnings
from collections import defaultdict
from collections import deque
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
import attr
import py.path
import _pytest
from _pytest._code.code import Fo... | true | true |
f7189cf1777438042d5eeb717699cbd063289d08 | 10,871 | py | Python | env/lib/python3.8/site-packages/plotly/validators/choroplethmapbox/_colorbar.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2 | 2021-07-07T20:16:23.000Z | 2021-07-14T14:03:09.000Z | env/lib/python3.8/site-packages/plotly/validators/choroplethmapbox/_colorbar.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 5 | 2020-06-05T20:56:21.000Z | 2021-09-22T19:12:42.000Z | env/lib/python3.8/site-packages/plotly/validators/choroplethmapbox/_colorbar.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2 | 2020-07-05T12:57:14.000Z | 2020-07-05T12:58:00.000Z | import _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="colorbar", parent_name="choroplethmapbox", **kwargs
):
super(ColorbarValidator, self).__init__(
plotly_name=plotly_name,
parent_... | 47.060606 | 78 | 0.52663 | import _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="colorbar", parent_name="choroplethmapbox", **kwargs
):
super(ColorbarValidator, self).__init__(
plotly_name=plotly_name,
parent_... | true | true |
f7189d61c476bf7a949e07d688c92793680eb5d3 | 584 | py | Python | polls/admin.py | Nachtalb/django-polls | e5f1065cdcff99c8f21ea4f211d2d6fa344b65c7 | [
"MIT"
] | null | null | null | polls/admin.py | Nachtalb/django-polls | e5f1065cdcff99c8f21ea4f211d2d6fa344b65c7 | [
"MIT"
] | null | null | null | polls/admin.py | Nachtalb/django-polls | e5f1065cdcff99c8f21ea4f211d2d6fa344b65c7 | [
"MIT"
] | null | null | null | from .models import Choice
from .models import Question
from django.contrib import admin
# Register your models here.
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 1
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date inf... | 22.461538 | 74 | 0.683219 | from .models import Choice
from .models import Question
from django.contrib import admin
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 1
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date information', {'fields': ['pub_d... | true | true |
f7189f5b921b09008dadabc0c25611488fd3ea71 | 3,408 | py | Python | lib/spack/spack/cmd/tags.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | lib/spack/spack/cmd/tags.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | lib/spack/spack/cmd/tags.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"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)
import sys
import six
import llnl.util.tty as tty
import llnl.util.tty.colify as colify
import spack.repo
import spack.... | 31.555556 | 79 | 0.649941 |
import sys
import six
import llnl.util.tty as tty
import llnl.util.tty.colify as colify
import spack.repo
import spack.store
import spack.tag
description = "Show package tags and associated packages"
section = "basic"
level = "long"
def report_tags(category, tags):
buffer = six.StringIO()
isatty = sys.st... | true | true |
f7189f8dd6f26d34536254222d1b19d45d633d5e | 602 | py | Python | ss/leads/migrations/0003_lead_owner.py | nishendra3/task_managent_tool | e228213df2c5d22e014e5efd8c7e1011160cf3ef | [
"MIT"
] | null | null | null | ss/leads/migrations/0003_lead_owner.py | nishendra3/task_managent_tool | e228213df2c5d22e014e5efd8c7e1011160cf3ef | [
"MIT"
] | null | null | null | ss/leads/migrations/0003_lead_owner.py | nishendra3/task_managent_tool | e228213df2c5d22e014e5efd8c7e1011160cf3ef | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2021-04-26 09:28
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('leads', '0002_rename_leads... | 27.363636 | 143 | 0.677741 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('leads', '0002_rename_leads_lead'),
]
operations = [
mig... | true | true |
f718a013ca7dbd568d075d456a25634b7ca18e7d | 615 | py | Python | setup.py | tavyc/lockex | e6b8d5440b21b08899785f7d97803b5b4ed16ab4 | [
"BSD-3-Clause"
] | null | null | null | setup.py | tavyc/lockex | e6b8d5440b21b08899785f7d97803b5b4ed16ab4 | [
"BSD-3-Clause"
] | null | null | null | setup.py | tavyc/lockex | e6b8d5440b21b08899785f7d97803b5b4ed16ab4 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
setup(name="lockex",
version="0.3",
description="Get lock from zookeeper and execute",
packages=find_packages(exclude=["__pycache__"]),
install_requires=['click==7.1.1', 'python_gflags==3.1.2', 'kazoo==2.8.0', 'pure-sasl==0.6.2', 'psutil==5.7.0', 'futu... | 51.25 | 135 | 0.634146 | from setuptools import setup, find_packages
setup(name="lockex",
version="0.3",
description="Get lock from zookeeper and execute",
packages=find_packages(exclude=["__pycache__"]),
install_requires=['click==7.1.1', 'python_gflags==3.1.2', 'kazoo==2.8.0', 'pure-sasl==0.6.2', 'psutil==5.7.0', 'futu... | true | true |
f718a027b0346912471874053f7c8deab0ce9e6d | 3,017 | py | Python | test/unit_tests/providers/test_vimeo.py | ourresearch/total-impact-webapp | ab0d011dc783491bc85aadc2dc9c0f204e59429e | [
"MIT"
] | 4 | 2015-10-22T10:11:01.000Z | 2017-06-04T18:08:28.000Z | test/unit_tests/providers/test_vimeo.py | Impactstory/total-impact-webapp | ab0d011dc783491bc85aadc2dc9c0f204e59429e | [
"MIT"
] | 2 | 2015-01-11T05:45:59.000Z | 2015-02-11T20:37:05.000Z | test/unit_tests/providers/test_vimeo.py | Impactstory/total-impact-webapp | ab0d011dc783491bc85aadc2dc9c0f204e59429e | [
"MIT"
] | 3 | 2015-01-10T03:23:13.000Z | 2015-10-11T15:49:41.000Z | from test.unit_tests.providers import common
from test.unit_tests.providers.common import ProviderTestCase
from totalimpact.providers.provider import Provider, ProviderContentMalformedError
from test.utils import http
import os
import collections
from nose.tools import assert_equals, assert_items_equal, raises, nottes... | 46.415385 | 214 | 0.69705 | from test.unit_tests.providers import common
from test.unit_tests.providers.common import ProviderTestCase
from totalimpact.providers.provider import Provider, ProviderContentMalformedError
from test.utils import http
import os
import collections
from nose.tools import assert_equals, assert_items_equal, raises, nottes... | false | true |
f718a0367b4270d581488b88bdf48bcb02c744fd | 3,379 | py | Python | pychron/core/ui/qt/color_map_bar_editor.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 1 | 2019-02-27T21:57:44.000Z | 2019-02-27T21:57:44.000Z | pychron/core/ui/qt/color_map_bar_editor.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 80 | 2018-07-17T20:10:20.000Z | 2021-08-17T15:38:24.000Z | pychron/core/ui/qt/color_map_bar_editor.py | AGESLDEO/pychron | 1a81e05d9fba43b797f335ceff6837c016633bcf | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2012 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | 33.455446 | 114 | 0.587452 |
from __future__ import absolute_import
from chaco.data_range_1d import DataRange1D
from chaco.default_colormaps import color_map_dict, color_map_name_dict
from pyface.qt.QtGui import QPainter, QColor, QFrame
from traits.api import Float, Int, Str
from traitsui.basic_editor_factory import BasicEditorFactory
from traits... | true | true |
f718a03a93d543af426ee374eecee7750397b95b | 8,579 | py | Python | public/code/simpleCropPredictSpektogram.py | awinawin1/prediksi | b3d552555f775d7b6a1b22077146443fe09bbf5d | [
"MIT"
] | null | null | null | public/code/simpleCropPredictSpektogram.py | awinawin1/prediksi | b3d552555f775d7b6a1b22077146443fe09bbf5d | [
"MIT"
] | null | null | null | public/code/simpleCropPredictSpektogram.py | awinawin1/prediksi | b3d552555f775d7b6a1b22077146443fe09bbf5d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat May 15 00:21:05 2021
@author: marina
"""
import os
import shutil
import pyedflib
import numpy as np
import pandas as pd
import sys
import mne
from pywt import wavedec
from sklearn.preprocessing import LabelEncoder
import matplotlib.pyplot as plt
from scipy import signal
from... | 36.198312 | 136 | 0.645879 | import os
import shutil
import pyedflib
import numpy as np
import pandas as pd
import sys
import mne
from pywt import wavedec
from sklearn.preprocessing import LabelEncoder
import matplotlib.pyplot as plt
from scipy import signal
from keras.models import Sequential
from keras.layers import Conv2D,Flatten,Dense,Max... | true | true |
f718a057f6fbb3615714ace7248ca6eec06c111c | 713 | py | Python | TPs/TP4/test_flower.py | Aympab/BigDataHadoopSparkDaskCourse | 42f9e0475cbd7c5db240ccc6dc00c19b9006012a | [
"Apache-2.0"
] | null | null | null | TPs/TP4/test_flower.py | Aympab/BigDataHadoopSparkDaskCourse | 42f9e0475cbd7c5db240ccc6dc00c19b9006012a | [
"Apache-2.0"
] | null | null | null | TPs/TP4/test_flower.py | Aympab/BigDataHadoopSparkDaskCourse | 42f9e0475cbd7c5db240ccc6dc00c19b9006012a | [
"Apache-2.0"
] | 1 | 2022-01-31T17:14:27.000Z | 2022-01-31T17:14:27.000Z | import pyspark
from pyspark import SparkContext
from pyspark.sql import Row
from pyspark.sql import SQLContext
from pyspark import SparkFiles
import os
import pandas as pd
sc =SparkContext()
sqlContext = SQLContext(sc)
data_dir="/work/irlin355_1/gratienj/ParallelProgrammingCourse/BigDataHadoopSpark/data"
file = os.p... | 26.407407 | 86 | 0.779804 | import pyspark
from pyspark import SparkContext
from pyspark.sql import Row
from pyspark.sql import SQLContext
from pyspark import SparkFiles
import os
import pandas as pd
sc =SparkContext()
sqlContext = SQLContext(sc)
data_dir="/work/irlin355_1/gratienj/ParallelProgrammingCourse/BigDataHadoopSpark/data"
file = os.p... | true | true |
f718a2b72257a97c4d973393e72a8863d380eada | 3,752 | py | Python | tests/gallery/test_raster_transform.py | krisHans3n/geoalchemy2-mysql | 38a44d51c242d867f40d4c5503c91f52a8269ff4 | [
"MIT"
] | null | null | null | tests/gallery/test_raster_transform.py | krisHans3n/geoalchemy2-mysql | 38a44d51c242d867f40d4c5503c91f52a8269ff4 | [
"MIT"
] | null | null | null | tests/gallery/test_raster_transform.py | krisHans3n/geoalchemy2-mysql | 38a44d51c242d867f40d4c5503c91f52a8269ff4 | [
"MIT"
] | null | null | null | """
Reproject a Raster using ST_Transform
=====================================
The `ST_Transform()` function (and a few others like `ST_SnapToGrid()`) can be used on
both `Geometry` and `Raster` types. In `GeoAlchemy2`, this function is only defined for
`Geometry` as it can not be defined for several types at the sam... | 32.912281 | 88 | 0.673507 | from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import Table
from sqlalchemy import func
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import Query
from geoalchemy2 import Geometry
from geoalchemy2 import Raster
from tests impo... | true | true |
f718a32adc8e23215976b6874f7a9baff2ac6fb1 | 2,262 | py | Python | acme/agents/actors_tf2_test.py | owenshen24/acme | 71434dffd3449236f9b8aaf7a53ceab515e75a2a | [
"Apache-2.0"
] | 1 | 2020-06-03T18:33:40.000Z | 2020-06-03T18:33:40.000Z | acme/agents/actors_tf2_test.py | owenshen24/acme | 71434dffd3449236f9b8aaf7a53ceab515e75a2a | [
"Apache-2.0"
] | null | null | null | acme/agents/actors_tf2_test.py | owenshen24/acme | 71434dffd3449236f9b8aaf7a53ceab515e75a2a | [
"Apache-2.0"
] | 1 | 2021-11-26T22:51:55.000Z | 2021-11-26T22:51:55.000Z | # python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 30.16 | 76 | 0.728559 |
from absl.testing import absltest
from acme import environment_loop
from acme import specs
from acme.agents import actors_tf2
from acme.testing import fakes
import dm_env
import numpy as np
import sonnet as snt
import tensorflow as tf
def _make_fake_env() -> dm_env.Environment:
env_spec = specs.EnvironmentSpec(... | true | true |
f718a32e9858f3ea9274a1aadac3baae13a0a7c1 | 64,546 | py | Python | tools/blender-dff/io_scene_dff.py | FakeYou/mashed | 902d8f514872cfa22e2a2904e215d360bf48cae1 | [
"MIT"
] | 5 | 2016-12-31T13:51:31.000Z | 2018-06-12T18:36:52.000Z | tools/blender-dff/io_scene_dff.py | andrenanninga/mashed | 902d8f514872cfa22e2a2904e215d360bf48cae1 | [
"MIT"
] | 1 | 2021-03-26T20:53:34.000Z | 2021-03-26T20:53:34.000Z | tools/blender-dff/io_scene_dff.py | FakeYou/mashed | 902d8f514872cfa22e2a2904e215d360bf48cae1 | [
"MIT"
] | 7 | 2016-10-08T15:38:30.000Z | 2019-01-25T11:34:31.000Z | bl_info = {
"name": "RenderWare importer/exporter for GTA III/VC/SA (.dff)",
"author": "Ago Allikmaa (maxorator)",
"version": (0, 9, 2),
"blender": (2, 6, 3),
"location": "File > Import-Export > Renderware (.dff) ",
"description": "RenderWare importer/exporter for GTA III/VC/SA",
"category":... | 37.724138 | 191 | 0.526043 | bl_info = {
"name": "RenderWare importer/exporter for GTA III/VC/SA (.dff)",
"author": "Ago Allikmaa (maxorator)",
"version": (0, 9, 2),
"blender": (2, 6, 3),
"location": "File > Import-Export > Renderware (.dff) ",
"description": "RenderWare importer/exporter for GTA III/VC/SA",
"category":... | true | true |
f718a33508e80df74065a9e4fa1542458bff559b | 2,125 | py | Python | formatdata/bin/extract_ref_bimf.py | lvclark/h3agwas | 5e42e60123b819d3c331a91b25ee50846e55af3b | [
"MIT"
] | 62 | 2016-08-29T11:27:35.000Z | 2022-03-10T17:16:14.000Z | formatdata/bin/extract_ref_bimf.py | lvclark/h3agwas | 5e42e60123b819d3c331a91b25ee50846e55af3b | [
"MIT"
] | 33 | 2016-12-26T13:48:19.000Z | 2021-12-05T13:34:06.000Z | formatdata/bin/extract_ref_bimf.py | lvclark/h3agwas | 5e42e60123b819d3c331a91b25ee50846e55af3b | [
"MIT"
] | 50 | 2017-04-15T04:17:43.000Z | 2022-03-30T07:26:01.000Z | #!/usr/bin/env python3
import sys
import os
import argparse
import gzip
def readfastagz(File) :
Dic={}
with gzip.open(File, "r") as ReadL :
for ligne in ReadL:
ligne=ligne.decode('utf-8').replace('\n','')
if ligne[0]=='>' :
Key=ligne.split(' ')[0].split('|')[0].split('\t')[0].replace('>','')
... | 29.513889 | 91 | 0.602353 |
import sys
import os
import argparse
import gzip
def readfastagz(File) :
Dic={}
with gzip.open(File, "r") as ReadL :
for ligne in ReadL:
ligne=ligne.decode('utf-8').replace('\n','')
if ligne[0]=='>' :
Key=ligne.split(' ')[0].split('|')[0].split('\t')[0].replace('>','')
if Key in Dic :
... | true | true |
f718a3bfab465e69af8eecdfc4731de81a8437f6 | 3,893 | py | Python | deletionwatcher.py | Floern/SmokeDetector | 2818bbd23af15440836c61c4023d063264433c66 | [
"Apache-2.0",
"MIT"
] | null | null | null | deletionwatcher.py | Floern/SmokeDetector | 2818bbd23af15440836c61c4023d063264433c66 | [
"Apache-2.0",
"MIT"
] | null | null | null | deletionwatcher.py | Floern/SmokeDetector | 2818bbd23af15440836c61c4023d063264433c66 | [
"Apache-2.0",
"MIT"
] | 1 | 2018-10-11T13:41:49.000Z | 2018-10-11T13:41:49.000Z | # coding=utf-8
import json
import requests
import time
# noinspection PyPackageRequirements
import websocket
# noinspection PyPackageRequirements
from bs4 import BeautifulSoup
from threading import Thread
from urllib.parse import urlparse
import metasmoke
from globalvars import GlobalVars
import datahandling
# noinsp... | 40.552083 | 120 | 0.599281 | import json
import requests
import time
import websocket
from bs4 import BeautifulSoup
from threading import Thread
from urllib.parse import urlparse
import metasmoke
from globalvars import GlobalVars
import datahandling
class DeletionWatcher:
@classmethod
def update_site_id_list(self):
soup = Beautif... | true | true |
f718a4274f3aa4ad39db83b7e97ebcddc1e14a69 | 3,159 | py | Python | NLP/code.py | prasadph/ga-learner-dsmp-repo | ac1cc9d96250718f2842592e643c885d54ab2903 | [
"MIT"
] | 1 | 2021-01-18T15:24:07.000Z | 2021-01-18T15:24:07.000Z | NLP/code.py | prasadph/ga-learner-dsmp-repo | ac1cc9d96250718f2842592e643c885d54ab2903 | [
"MIT"
] | null | null | null | NLP/code.py | prasadph/ga-learner-dsmp-repo | ac1cc9d96250718f2842592e643c885d54ab2903 | [
"MIT"
] | 1 | 2019-05-01T04:24:19.000Z | 2019-05-01T04:24:19.000Z | # --------------
# import packages
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import re
from nltk.corpus import stopwords
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.naiv... | 24.874016 | 115 | 0.773663 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import re
from nltk.corpus import stopwords
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB
from s... | true | true |
f718a4ee414e973fde7694a37fb7480545ae3804 | 3,814 | py | Python | onnx/backend/test/case/node/xor.py | okdshin/onnx | 31ca96ca3331d05884a71c38975d34870eb9c81d | [
"MIT"
] | 2 | 2021-07-31T20:42:42.000Z | 2021-11-17T11:01:14.000Z | onnx/backend/test/case/node/xor.py | lokitoth/onnx | 27b40225ea98f6412ae2879ed67211d49564af2a | [
"MIT"
] | null | null | null | onnx/backend/test/case/node/xor.py | lokitoth/onnx | 27b40225ea98f6412ae2879ed67211d49564af2a | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import onnx
from ..base import Base
from . import expect
class Xor(Base):
@staticmethod
def export():
node = onnx.helper.make_node(... | 28.893939 | 71 | 0.484793 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import onnx
from ..base import Base
from . import expect
class Xor(Base):
@staticmethod
def export():
node = onnx.helper.make_node(... | true | true |
f718a52a8a96bb85eb0cdd0745fb1c73e627e679 | 21,417 | py | Python | pandas/tests/io/test_common.py | kuantan/pandas | e18921eb0cc86f71c84a4aa0bd6d0c1b7de89def | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-02-20T13:36:45.000Z | 2021-02-20T13:36:45.000Z | pandas/tests/io/test_common.py | fanoway/pandas | 71312683b41b5177faf7ecd63555059504853cbd | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | 4 | 2019-12-14T16:32:46.000Z | 2022-02-12T00:32:28.000Z | pandas/tests/io/test_common.py | lithomas1/pandas | e18921eb0cc86f71c84a4aa0bd6d0c1b7de89def | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | """
Tests for the pandas.io.common functionalities
"""
import codecs
import errno
from functools import partial
from io import (
BytesIO,
StringIO,
UnsupportedOperation,
)
import mmap
import os
from pathlib import Path
import tempfile
import pytest
from pandas.compat import is_platform_windows
import pand... | 35.754591 | 88 | 0.591773 | import codecs
import errno
from functools import partial
from io import (
BytesIO,
StringIO,
UnsupportedOperation,
)
import mmap
import os
from pathlib import Path
import tempfile
import pytest
from pandas.compat import is_platform_windows
import pandas.util._test_decorators as td
import pandas as pd
imp... | true | true |
f718a539f818b3cbab4eb694387294e8a9cc035e | 54,358 | py | Python | python/ccxt/async_support/hitbtc2.py | OliverNChalk/ccxt | fcf55e88f3523d2969f905cbed3b4deec1433a5e | [
"MIT"
] | null | null | null | python/ccxt/async_support/hitbtc2.py | OliverNChalk/ccxt | fcf55e88f3523d2969f905cbed3b4deec1433a5e | [
"MIT"
] | null | null | null | python/ccxt/async_support/hitbtc2.py | OliverNChalk/ccxt | fcf55e88f3523d2969f905cbed3b4deec1433a5e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.hitbtc import hitbtc
import base64
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors imp... | 38.910523 | 189 | 0.411237 |
from ccxt.async_support.hitbtc import hitbtc
import base64
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.base.errors import OrderNotFound
from ccxt.base.errors impo... | true | true |
f718a55c5117ea9a28e1c1de9ac32377c6e29ca9 | 20,501 | py | Python | skfda/_utils/_utils.py | GAA-UAM/scikit-fda | a9953a3104195ce9796397d094b17b1b90fd090f | [
"BSD-3-Clause"
] | 147 | 2019-05-10T20:46:42.000Z | 2022-03-25T17:23:19.000Z | skfda/_utils/_utils.py | GAA-UAM/scikit-fda | a9953a3104195ce9796397d094b17b1b90fd090f | [
"BSD-3-Clause"
] | 306 | 2019-04-26T08:56:05.000Z | 2022-03-30T11:12:48.000Z | skfda/_utils/_utils.py | GAA-UAM/scikit-fda | a9953a3104195ce9796397d094b17b1b90fd090f | [
"BSD-3-Clause"
] | 38 | 2019-09-03T17:24:04.000Z | 2022-01-06T05:09:18.000Z | """Module with generic methods."""
from __future__ import annotations
import functools
import numbers
from typing import (
TYPE_CHECKING,
Any,
Callable,
Iterable,
List,
Optional,
Sequence,
Tuple,
TypeVar,
Union,
cast,
overload,
)
import numpy as np
import scipy.integra... | 26.728814 | 78 | 0.632457 |
from __future__ import annotations
import functools
import numbers
from typing import (
TYPE_CHECKING,
Any,
Callable,
Iterable,
List,
Optional,
Sequence,
Tuple,
TypeVar,
Union,
cast,
overload,
)
import numpy as np
import scipy.integrate
from numpy import ndarray
from p... | true | true |
f718a596d8438f0be366ac1bbc612312c7461493 | 671 | py | Python | tests/test_windows.py | tombackstrom/mdct | f59e708f9a7f65ee672dbf44e6f164e79c82d83a | [
"MIT"
] | 40 | 2016-11-16T14:45:36.000Z | 2021-12-02T20:56:07.000Z | tests/test_windows.py | tombackstrom/mdct | f59e708f9a7f65ee672dbf44e6f164e79c82d83a | [
"MIT"
] | 3 | 2017-06-17T11:48:30.000Z | 2021-06-28T04:47:00.000Z | tests/test_windows.py | tombackstrom/mdct | f59e708f9a7f65ee672dbf44e6f164e79c82d83a | [
"MIT"
] | 9 | 2016-10-01T20:20:40.000Z | 2021-12-09T08:56:31.000Z | import pytest
import numpy
import mdct.windows
def test_kbd():
M = 100
w = mdct.windows.kaiser_derived(M, beta=4.)
assert numpy.allclose(w[:M//2] ** 2 + w[-M//2:] ** 2, 1.)
with pytest.raises(ValueError):
mdct.windows.kaiser_derived(M + 1, beta=4.)
assert numpy.allclose(
mdct.wi... | 25.807692 | 61 | 0.630402 | import pytest
import numpy
import mdct.windows
def test_kbd():
M = 100
w = mdct.windows.kaiser_derived(M, beta=4.)
assert numpy.allclose(w[:M//2] ** 2 + w[-M//2:] ** 2, 1.)
with pytest.raises(ValueError):
mdct.windows.kaiser_derived(M + 1, beta=4.)
assert numpy.allclose(
mdct.wi... | true | true |
f718a61c448b93dcd1b999fa459d8e7cef048f93 | 22,011 | py | Python | trainer.py | dpetrini/nova | 00b7637901420f68c7d805c13ccd4c39d514efb1 | [
"MIT"
] | 1 | 2020-10-19T23:49:00.000Z | 2020-10-19T23:49:00.000Z | trainer.py | dpetrini/nova | 00b7637901420f68c7d805c13ccd4c39d514efb1 | [
"MIT"
] | null | null | null | trainer.py | dpetrini/nova | 00b7637901420f68c7d805c13ccd4c39d514efb1 | [
"MIT"
] | null | null | null | from matplotlib.pyplot import show
import torch
from torch.autograd import Variable
from torch.cuda.amp import GradScaler, autocast
import numpy as np
from sklearn.metrics import roc_auc_score
from callbacks.cb_handler import CallbackHandler
from callbacks.cb_base import BaseCB
from callbacks.cb_lr_patch_clf import LR... | 42.005725 | 159 | 0.564445 | from matplotlib.pyplot import show
import torch
from torch.autograd import Variable
from torch.cuda.amp import GradScaler, autocast
import numpy as np
from sklearn.metrics import roc_auc_score
from callbacks.cb_handler import CallbackHandler
from callbacks.cb_base import BaseCB
from callbacks.cb_lr_patch_clf import LR... | true | true |
f718a6e4efe0bc6650e570e12bb690e1b246fd8d | 315 | py | Python | data.py | thIYan-EsWar/Machine-Learning-Breast-Cancer-Prediction | 349e6be13476dcfb602ab1e6f812bc464a7affc3 | [
"Apache-2.0"
] | null | null | null | data.py | thIYan-EsWar/Machine-Learning-Breast-Cancer-Prediction | 349e6be13476dcfb602ab1e6f812bc464a7affc3 | [
"Apache-2.0"
] | null | null | null | data.py | thIYan-EsWar/Machine-Learning-Breast-Cancer-Prediction | 349e6be13476dcfb602ab1e6f812bc464a7affc3 | [
"Apache-2.0"
] | null | null | null | from random import shuffle, sample
with open('data.txt', 'r') as f:
contents = f.readlines()
contents = sample(contents, len(contents))
with open('train_data.txt', 'w') as f:
[f.write(content) for content in contents[: 601]]
with open('test_data.txt', 'w') as f:
[f.write(content) for content in contents[601:]] | 39.375 | 50 | 0.698413 | from random import shuffle, sample
with open('data.txt', 'r') as f:
contents = f.readlines()
contents = sample(contents, len(contents))
with open('train_data.txt', 'w') as f:
[f.write(content) for content in contents[: 601]]
with open('test_data.txt', 'w') as f:
[f.write(content) for content in contents[601:]] | true | true |
f718a8aa9f9b0c450e9a61914792a726a1d423d4 | 13,080 | py | Python | tests/templates/test_subroutines/test_qmc.py | QDaria/pennylane | 5a28983fc7bd950cde8a4014e54261fef4b54293 | [
"Apache-2.0"
] | null | null | null | tests/templates/test_subroutines/test_qmc.py | QDaria/pennylane | 5a28983fc7bd950cde8a4014e54261fef4b54293 | [
"Apache-2.0"
] | null | null | null | tests/templates/test_subroutines/test_qmc.py | QDaria/pennylane | 5a28983fc7bd950cde8a4014e54261fef4b54293 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 34.603175 | 100 | 0.58815 |
import numpy as np
import pytest
from scipy.stats import norm
import pennylane as qml
from pennylane.templates.subroutines.qmc import (
QuantumMonteCarlo,
_make_V,
_make_Z,
func_to_unitary,
make_Q,
probs_to_unitary,
)
from pennylane.wires import Wires
class TestProbsToUnitary:
def tes... | true | true |
f718a9f198df99720e7763bd6b2653966accd0a9 | 28,691 | py | Python | pages/tests/pages_tests.py | odyaka341/django-page-cms | eca92673f735f5ad158d5a81b72280705057bf52 | [
"BSD-3-Clause"
] | null | null | null | pages/tests/pages_tests.py | odyaka341/django-page-cms | eca92673f735f5ad158d5a81b72280705057bf52 | [
"BSD-3-Clause"
] | null | null | null | pages/tests/pages_tests.py | odyaka341/django-page-cms | eca92673f735f5ad158d5a81b72280705057bf52 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Django page CMS test suite module"""
import django
from django.conf import settings
from django.test.client import Client
from django.template import Template, RequestContext, TemplateDoesNotExist
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_t... | 41.163558 | 94 | 0.611551 | """Django page CMS test suite module"""
import django
from django.conf import settings
from django.test.client import Client
from django.template import Template, RequestContext, TemplateDoesNotExist
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from pages.m... | false | true |
f718a9f8275917290bfff9a6aebebcef23211c45 | 1,313 | py | Python | systems/chordpy/demo.py | DistributedComponents/verdi-chord | 762fe660c648d7f2a009d2beaa5cf3b8ea4ac593 | [
"BSD-2-Clause"
] | 12 | 2016-11-22T19:33:39.000Z | 2020-04-14T13:00:27.000Z | systems/chordpy/demo.py | DistributedComponents/verdi-chord | 762fe660c648d7f2a009d2beaa5cf3b8ea4ac593 | [
"BSD-2-Clause"
] | 17 | 2016-11-22T07:01:08.000Z | 2018-11-23T19:59:50.000Z | systems/chordpy/demo.py | DistributedComponents/verdi-chord | 762fe660c648d7f2a009d2beaa5cf3b8ea4ac593 | [
"BSD-2-Clause"
] | 1 | 2017-07-31T23:10:31.000Z | 2017-07-31T23:10:31.000Z | import logging
import multiprocessing
import sys
import time
from data import Pointer, SUCC_LIST_LEN
from node import Node
def launch_node(ip, pred, succ_list):
node = Node(ip=ip, pred=pred, succ_list=succ_list)
p = multiprocessing.Process(target=node.start)
p.daemon = True
p.start()
return node,... | 26.795918 | 78 | 0.642803 | import logging
import multiprocessing
import sys
import time
from data import Pointer, SUCC_LIST_LEN
from node import Node
def launch_node(ip, pred, succ_list):
node = Node(ip=ip, pred=pred, succ_list=succ_list)
p = multiprocessing.Process(target=node.start)
p.daemon = True
p.start()
return node,... | false | true |
f718aa985e504d915baf7c952316a24a64b1820b | 5,825 | py | Python | tests/test_nnet.py | kgizdov/hep_ml | 114ac9e896c3a601761092760a7b315f448d59c6 | [
"Apache-2.0"
] | null | null | null | tests/test_nnet.py | kgizdov/hep_ml | 114ac9e896c3a601761092760a7b315f448d59c6 | [
"Apache-2.0"
] | null | null | null | tests/test_nnet.py | kgizdov/hep_ml | 114ac9e896c3a601761092760a7b315f448d59c6 | [
"Apache-2.0"
] | 1 | 2020-11-11T08:39:52.000Z | 2020-11-11T08:39:52.000Z | from __future__ import division, print_function
import numpy
from sklearn.linear_model.logistic import LogisticRegression
from sklearn.metrics import roc_auc_score, mean_squared_error, log_loss
from sklearn.base import clone
from sklearn.datasets import make_blobs
from hep_ml import nnet
from hep_ml.commonutils impor... | 41.607143 | 117 | 0.687725 | from __future__ import division, print_function
import numpy
from sklearn.linear_model.logistic import LogisticRegression
from sklearn.metrics import roc_auc_score, mean_squared_error, log_loss
from sklearn.base import clone
from sklearn.datasets import make_blobs
from hep_ml import nnet
from hep_ml.commonutils impor... | true | true |
f718ab3528673e47153b5a348e4c10a0b0f010a8 | 780 | py | Python | setup.py | metabolize/harrison | 0d0f26fda1947785ee7a00a8a7bf5b6a95e06372 | [
"BSD-2-Clause"
] | 4 | 2019-10-02T03:23:04.000Z | 2021-01-26T04:25:06.000Z | setup.py | metabolize/harrison | 0d0f26fda1947785ee7a00a8a7bf5b6a95e06372 | [
"BSD-2-Clause"
] | 31 | 2019-08-29T17:13:06.000Z | 2021-06-25T15:25:18.000Z | setup.py | metabolize/harrison | 0d0f26fda1947785ee7a00a8a7bf5b6a95e06372 | [
"BSD-2-Clause"
] | 1 | 2017-10-24T23:24:48.000Z | 2017-10-24T23:24:48.000Z | from setuptools import setup
version_info = {}
exec(open("harrison/package_version.py").read(), version_info)
setup(
name="harrison",
version=version_info["__version__"],
author="Body Labs, Metabolize",
author_email="github@paulmelnikow.com",
description="Time a block of code",
long_descriptio... | 31.2 | 62 | 0.661538 | from setuptools import setup
version_info = {}
exec(open("harrison/package_version.py").read(), version_info)
setup(
name="harrison",
version=version_info["__version__"],
author="Body Labs, Metabolize",
author_email="github@paulmelnikow.com",
description="Time a block of code",
long_descriptio... | true | true |
f718abf37912a57ece457c7724017ea32c14fa31 | 8,330 | py | Python | tests/symbol_dependent_transients_test.py | Walon1998/dace | 95ddfd3e9a5c654f0f0d66d026e0b64ec0f028a0 | [
"BSD-3-Clause"
] | 1 | 2022-03-11T13:36:34.000Z | 2022-03-11T13:36:34.000Z | tests/symbol_dependent_transients_test.py | Walon1998/dace | 95ddfd3e9a5c654f0f0d66d026e0b64ec0f028a0 | [
"BSD-3-Clause"
] | null | null | null | tests/symbol_dependent_transients_test.py | Walon1998/dace | 95ddfd3e9a5c654f0f0d66d026e0b64ec0f028a0 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import dace
import numpy as np
import pytest
from dace.libraries import standard
from dace.transformation import interstate
def _make_sdfg(name, storage=dace.dtypes.StorageType.CPU_Heap, isview=False):
N = dace.symbol('N', dtype=dace.int... | 37.022222 | 118 | 0.677431 | import dace
import numpy as np
import pytest
from dace.libraries import standard
from dace.transformation import interstate
def _make_sdfg(name, storage=dace.dtypes.StorageType.CPU_Heap, isview=False):
N = dace.symbol('N', dtype=dace.int32, integer=True, positive=True)
i = dace.symbol('i', dtype=dace.int32, ... | true | true |
f718acc04225ae3f6eed972d1bf2068588023593 | 4,524 | py | Python | factory_powerstations/hooks.py | alexdali/test_factory_powerstations | d07faf7a254e7d7a11b17565d2f9236863846c79 | [
"MIT"
] | null | null | null | factory_powerstations/hooks.py | alexdali/test_factory_powerstations | d07faf7a254e7d7a11b17565d2f9236863846c79 | [
"MIT"
] | null | null | null | factory_powerstations/hooks.py | alexdali/test_factory_powerstations | d07faf7a254e7d7a11b17565d2f9236863846c79 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "factory_powerstations"
app_title = "Factory Powerstations"
app_publisher = "Alex Tas"
app_description = "Factory Management System"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_ema... | 23.936508 | 89 | 0.682803 | from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "factory_powerstations"
app_title = "Factory Powerstations"
app_publisher = "Alex Tas"
app_description = "Factory Management System"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "alextas@example.co... | true | true |
f718ad5022211872d6795c97dd3d1de6282cac0b | 10,500 | py | Python | pypy/translator/goal/richards.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | 12 | 2016-01-06T07:10:28.000Z | 2021-05-13T23:02:02.000Z | pypy/translator/goal/richards.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | pypy/translator/goal/richards.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 2 | 2016-07-29T07:09:50.000Z | 2016-10-16T08:50:26.000Z | # based on a Java version:
# Based on original version written in BCPL by Dr Martin Richards
# in 1981 at Cambridge University Computer Laboratory, England
# and a C++ version derived from a Smalltalk version written by
# L Peter Deutsch.
# Java version: Copyright (C) 1995 Sun Microsystems, Inc.
# Translation fr... | 23.809524 | 97 | 0.567524 |
I_IDLE = 1
I_WORK = 2
I_HANDLERA = 3
I_HANDLERB = 4
I_DEVA = 5
I_DEVB = 6
K_DEV = 1000
K_WORK = 1001
BUFSIZE = 4
BUFSIZE_RANGE = range(BUFSIZE)
class Packet(object):
def __init__(self,l,i,k):
self.link = l
self.ident = i
self.kind = k
self.datum = 0
self.data = [0] * BU... | false | true |
f718adc9b2a9c127df3f8b525ea928e4dd8d5e7d | 1,240 | py | Python | intro-python/parsing-json/nested_data.py | myounker/dnav3-code | fbb1e4d1d3cc642cc7089f8a9de35298c33f1ee0 | [
"MIT"
] | null | null | null | intro-python/parsing-json/nested_data.py | myounker/dnav3-code | fbb1e4d1d3cc642cc7089f8a9de35298c33f1ee0 | [
"MIT"
] | null | null | null | intro-python/parsing-json/nested_data.py | myounker/dnav3-code | fbb1e4d1d3cc642cc7089f8a9de35298c33f1ee0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Working with nested data hands-on exercise / coding challenge."""
""" code by myounker 1 Sep 2018 """
import json
import os
# Get the absolute path for the directory where this file is located "here"
here = os.path.abspath(os.path.dirname(__file__))
#open file with interfaces and import te... | 31 | 97 | 0.678226 |
import json
import os
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "interfaces.json")) as file:
json_text = file.read()
json_data = json.loads(json_text)
print("\n")
for interface in json_data["ietf-interfaces:interfaces"]["interface"]:
print(interface["name"] + ': ' +
... | true | true |
f718ae668683de5a9982de18699f332fc0998603 | 333 | py | Python | betterLogger/filter.py | GreenJon902/BetterLogger | 7333cc83d0bb9350781e5506e15fc0476e7d2791 | [
"MIT"
] | null | null | null | betterLogger/filter.py | GreenJon902/BetterLogger | 7333cc83d0bb9350781e5506e15fc0476e7d2791 | [
"MIT"
] | null | null | null | betterLogger/filter.py | GreenJon902/BetterLogger | 7333cc83d0bb9350781e5506e15fc0476e7d2791 | [
"MIT"
] | null | null | null | from logging import Filter as _Filter
from betterLogger import config
class Filter(_Filter):
def filter(self, record):
return (not config.log_whitelist_on or any(record.name.startswith(name) for name in config.log_whitelist)) and \
not any(record.name.startswith(name) for name in config.lo... | 33.3 | 120 | 0.738739 | from logging import Filter as _Filter
from betterLogger import config
class Filter(_Filter):
def filter(self, record):
return (not config.log_whitelist_on or any(record.name.startswith(name) for name in config.log_whitelist)) and \
not any(record.name.startswith(name) for name in config.lo... | true | true |
f718ae8d0d6ecee7a425e414aeeb37eb1faffce6 | 5,323 | py | Python | flexagon.py | dlp/flexagon | c8ac58e125c6f405d9942245bdaa71fab658def6 | [
"MIT"
] | null | null | null | flexagon.py | dlp/flexagon | c8ac58e125c6f405d9942245bdaa71fab658def6 | [
"MIT"
] | null | null | null | flexagon.py | dlp/flexagon | c8ac58e125c6f405d9942245bdaa71fab658def6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# Simple PIL-based flexagon generator
#
# For the time being, it creates only 2D trihexaflexagons.
#
# Daniel Prokesch <daniel.prokesch@gmail.com>
#######################################################################... | 34.79085 | 79 | 0.57956 |
from PIL import Image, ImageOps, ImageDraw
from math import sqrt, sin, cos, pi
import sys
sqrt3_2 = sqrt(3.0)/2.0
def crop_size(img):
width, height = img.size
if height > (width * sqrt3_2):
new_height = int(width * sqrt3_2)
diff_2 = (height - new_height) / 2
box ... | true | true |
f718af111d82c6f2a7d6c664a42657d4c6707646 | 5,845 | py | Python | rnacentral_pipeline/rnacentral/genome_mapping/blat.py | RNAcentral/rnacentral-import-pipeline | 238e573440c72581a051b16c15f56fcd25bece74 | [
"Apache-2.0"
] | 1 | 2018-08-09T14:41:16.000Z | 2018-08-09T14:41:16.000Z | rnacentral_pipeline/rnacentral/genome_mapping/blat.py | RNAcentral/rnacentral-import-pipeline | 238e573440c72581a051b16c15f56fcd25bece74 | [
"Apache-2.0"
] | 60 | 2015-02-04T16:43:53.000Z | 2022-01-27T10:28:43.000Z | rnacentral_pipeline/rnacentral/genome_mapping/blat.py | RNAcentral/rnacentral-import-pipeline | 238e573440c72581a051b16c15f56fcd25bece74 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
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... | 34.181287 | 203 | 0.670488 |
import csv
import json
import operator as op
import itertools as it
import logging
import attr
from attr.validators import instance_of as is_a
from rnacentral_pipeline import utils
from rnacentral_pipeline.databases.data.regions import Exon
from rnacentral_pipeline.databases.data.regions import Strand
from rnacentr... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.