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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72f33b9736a53f5a2d0f2502ca8c3c7b2c0d2fa | 1,601 | py | Python | neural_compressor/ux/utils/yaml_utils.py | intel/neural-compressor | 16a4a12045fcb468da4d33769aff2c1a5e2ba6ba | [
"Apache-2.0"
] | 172 | 2021-09-14T18:34:17.000Z | 2022-03-30T06:49:53.000Z | neural_compressor/ux/utils/yaml_utils.py | intel/lp-opt-tool | 130eefa3586b38df6c0ff78cc8807ae273f6a63f | [
"Apache-2.0"
] | 40 | 2021-09-14T02:26:12.000Z | 2022-03-29T08:34:04.000Z | neural_compressor/ux/utils/yaml_utils.py | intel/neural-compressor | 16a4a12045fcb468da4d33769aff2c1a5e2ba6ba | [
"Apache-2.0"
] | 33 | 2021-09-15T07:27:25.000Z | 2022-03-25T08:30:57.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021-2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 33.354167 | 74 | 0.690194 |
from typing import Any
from neural_compressor.conf.config import Pruner
def float_representer(dumper: Any, value: float) -> Any:
if value.is_integer():
float_out = f"{int(value)}.0"
else:
float_out = f"{value}"
return dumper.represent_scalar("tag:yaml.org,2002:float", float_out)
def pr... | true | true |
f72f3403b78785de5709a2d85b9f6807eb47d1ee | 5,584 | py | Python | im2scene/camera.py | miramirakim227/SwapNeRF_single_GT | 55a842ec4155fa782ca1c48b5c6863aeca8ca295 | [
"MIT"
] | null | null | null | im2scene/camera.py | miramirakim227/SwapNeRF_single_GT | 55a842ec4155fa782ca1c48b5c6863aeca8ca295 | [
"MIT"
] | null | null | null | im2scene/camera.py | miramirakim227/SwapNeRF_single_GT | 55a842ec4155fa782ca1c48b5c6863aeca8ca295 | [
"MIT"
] | 2 | 2021-12-07T04:02:02.000Z | 2021-12-30T04:44:50.000Z | import numpy as np
import torch
from scipy.spatial.transform import Rotation as Rot
import pdb
import math
def get_camera_mat(fov=49.13, invert=True):
# fov = 2 * arctan( sensor / (2 * focal))
# focal = (sensor / 2) * 1 / (tan(0.5 * fov))
# in our case, sensor = 2 as pixels are in [-1, 1]
focal = 1.... | 33.238095 | 89 | 0.530802 | import numpy as np
import torch
from scipy.spatial.transform import Rotation as Rot
import pdb
import math
def get_camera_mat(fov=49.13, invert=True):
focal = 1. / np.tan(0.5 * fov * np.pi/180.)
focal = focal.astype(np.float32)
mat = torch.tensor([
[focal, 0., 0., 0.],
[0., fo... | true | true |
f72f348a5b9935ce6a4cb36600f5af78d9693402 | 4,948 | py | Python | 01_process_reads/at_combo_lib_ex58/01_usearch_merge.py | ddingding/coevolution_mechanism | 4a03f7a105a2606e812dd8a4fa88272519ddab86 | [
"MIT"
] | 1 | 2022-01-16T09:32:33.000Z | 2022-01-16T09:32:33.000Z | 01_process_reads/at_combo_lib_ex58/01_usearch_merge.py | ddingding/coevolution_mechanism | 4a03f7a105a2606e812dd8a4fa88272519ddab86 | [
"MIT"
] | null | null | null | 01_process_reads/at_combo_lib_ex58/01_usearch_merge.py | ddingding/coevolution_mechanism | 4a03f7a105a2606e812dd8a4fa88272519ddab86 | [
"MIT"
] | null | null | null | '''
## using flash 1.2.11 to merge paired end reads
# at combo mutant files
# the sample identified is in the middle of the filename: 'D21-169', refer to ex58_config.csv for description of that
# sample
# each paired end read are split in the files ending in '1_sequence.fastq' and '2_sequence.fastq'
"210105Lau_D21-169... | 55.595506 | 119 | 0.818108 |
import os
from os import listdir
from os.path import isfile, join
from constants import AT_COMBO_RAW_DIR, AT_COMBO_MERGED_DIR, FLASH_PATH
fastqPath = AT_COMBO_RAW_DIR
outputDir = AT_COMBO_MERGED_DIR
n_to_do = 1000
c = 0
with open(outputDir + 'cmdsUsed.txt', 'w') as fout:
done_nums = [f.rstrip('-_merged.fastq... | true | true |
f72f34ca09732af9330ae8c7aad9a5737ef4a76b | 3,985 | py | Python | server/rake.py | arpit73/ad-recommendation | 6409e437215f192bbce3235d070b642705ef75cd | [
"Apache-2.0"
] | 1 | 2021-12-27T08:45:35.000Z | 2021-12-27T08:45:35.000Z | server/rake.py | arpit73/ad-recommendation | 6409e437215f192bbce3235d070b642705ef75cd | [
"Apache-2.0"
] | 2 | 2021-03-10T14:26:51.000Z | 2021-05-11T10:20:20.000Z | server/rake.py | onygami/ad-recommendation | 6409e437215f192bbce3235d070b642705ef75cd | [
"Apache-2.0"
] | null | null | null | import re
def is_number(s):
try:
float(s) if "." in s else int(s)
return True
except ValueError:
return False
def load_stop_words(stop_word_file, regex):
with open(stop_word_file, "r") as stop_word_file:
stop_words = re.split(regex, stop_word_file.read())
return [
... | 31.88 | 114 | 0.636637 | import re
def is_number(s):
try:
float(s) if "." in s else int(s)
return True
except ValueError:
return False
def load_stop_words(stop_word_file, regex):
with open(stop_word_file, "r") as stop_word_file:
stop_words = re.split(regex, stop_word_file.read())
return [
... | true | true |
f72f354e1adca42e4471f5b1917ec8f37ef9888a | 13,156 | py | Python | src/game.py | mapto/4oBe4e | e3b11ad4ac5c5f4f7462b2066ca3a3851b07230f | [
"MIT"
] | 2 | 2020-04-02T19:44:12.000Z | 2020-04-08T19:18:17.000Z | src/game.py | mapto/4oBe4e | e3b11ad4ac5c5f4f7462b2066ca3a3851b07230f | [
"MIT"
] | 5 | 2020-04-26T15:36:52.000Z | 2020-05-14T19:21:29.000Z | src/game.py | mapto/4oBe4e | e3b11ad4ac5c5f4f7462b2066ca3a3851b07230f | [
"MIT"
] | 2 | 2020-04-07T18:03:25.000Z | 2020-04-21T09:05:34.000Z | #!/usr/bin/env python3
# coding: utf-8
"""The game logic.
This should be independent of media used to interact with player."""
from typing import Tuple, List, Set, Dict
from const import PLAYER_SHIFT, LAST_ON_PATH, END_PROGRESS
from piece import Piece
from player import Player
from util import progress_to_positio... | 27.408333 | 100 | 0.54363 |
from typing import Tuple, List, Set, Dict
from const import PLAYER_SHIFT, LAST_ON_PATH, END_PROGRESS
from piece import Piece
from player import Player
from util import progress_to_position
from action import roll_dice
def set_board(num_players: int, num_pieces: int):
pieces: List[Piece] = []
for player_... | true | true |
f72f3647e3f3d20d8cbdf1ce0a5a0bce8e752cca | 3,615 | py | Python | VisCostCallback.py | halalyon/mxnet_workshop | 0cf83051e639893c8b4a04b90d91d93bf55f0f5b | [
"Apache-2.0"
] | null | null | null | VisCostCallback.py | halalyon/mxnet_workshop | 0cf83051e639893c8b4a04b90d91d93bf55f0f5b | [
"Apache-2.0"
] | null | null | null | VisCostCallback.py | halalyon/mxnet_workshop | 0cf83051e639893c8b4a04b90d91d93bf55f0f5b | [
"Apache-2.0"
] | null | null | null | from bokeh.plotting import output_notebook, figure, ColumnDataSource, show
from bokeh.io import push_notebook
from timeit import default_timer
import math
from collections import deque
class CostVisCallback(object):
"""
Callback providing a live updating console based progress bar.
"""
def __init__(se... | 33.785047 | 107 | 0.562656 | from bokeh.plotting import output_notebook, figure, ColumnDataSource, show
from bokeh.io import push_notebook
from timeit import default_timer
import math
from collections import deque
class CostVisCallback(object):
def __init__(self, epoch_freq=1, y_range=(0, 4.5), fig=None, handle=None,
update_... | true | true |
f72f36daaa65d5a7d57ac806a3e885a93cc7e16f | 2,218 | py | Python | nipype/interfaces/mrtrix3/tests/test_auto_DWIBiasCorrect.py | vferat/nipype | 536c57da150d157dcb5c121af43aaeab71cdbd5f | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/mrtrix3/tests/test_auto_DWIBiasCorrect.py | vferat/nipype | 536c57da150d157dcb5c121af43aaeab71cdbd5f | [
"Apache-2.0"
] | 2 | 2018-04-17T19:18:16.000Z | 2020-03-04T22:05:02.000Z | nipype/interfaces/mrtrix3/tests/test_auto_DWIBiasCorrect.py | oesteban/nipype | c14f24eba1da08711bbb894e049ee858ed740096 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..preprocess import DWIBiasCorrect
def test_DWIBiasCorrect_inputs():
input_map = dict(
args=dict(argstr='%s', ),
bias=dict(
argstr='-bias %s',
extensions=None,
),
... | 27.382716 | 67 | 0.506763 | from __future__ import unicode_literals
from ..preprocess import DWIBiasCorrect
def test_DWIBiasCorrect_inputs():
input_map = dict(
args=dict(argstr='%s', ),
bias=dict(
argstr='-bias %s',
extensions=None,
),
bval_scale=dict(argstr='-bvalue_scaling %s', ),
... | true | true |
f72f3823ff02324815fc7e4ba4d736a76c0e7db7 | 1,123 | py | Python | src/tests/part1/q380_test_ins_del_rand_const.py | hychrisli/PyAlgorithms | 71e537180f3b371d0d2cc47b11cb68ec13a8ac68 | [
"Apache-2.0"
] | null | null | null | src/tests/part1/q380_test_ins_del_rand_const.py | hychrisli/PyAlgorithms | 71e537180f3b371d0d2cc47b11cb68ec13a8ac68 | [
"Apache-2.0"
] | null | null | null | src/tests/part1/q380_test_ins_del_rand_const.py | hychrisli/PyAlgorithms | 71e537180f3b371d0d2cc47b11cb68ec13a8ac68 | [
"Apache-2.0"
] | null | null | null | from src.base.test_cases import TestCases
from src.utility.constants import INSERT, REMOVE, GET_RANDOM
class InsDelRandConstTestCases(TestCases):
def __init__(self):
super(InsDelRandConstTestCases, self).__init__()
self.__add_test_case__('Test Insert 1', (INSERT, 1), True)
self.__add_test_... | 46.791667 | 72 | 0.672306 | from src.base.test_cases import TestCases
from src.utility.constants import INSERT, REMOVE, GET_RANDOM
class InsDelRandConstTestCases(TestCases):
def __init__(self):
super(InsDelRandConstTestCases, self).__init__()
self.__add_test_case__('Test Insert 1', (INSERT, 1), True)
self.__add_test_... | true | true |
f72f3832ba1149229f6c76d9070a1eb9a4a8c2c8 | 2,496 | py | Python | tests/token/TestUtil.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | 3 | 2021-12-12T04:28:03.000Z | 2022-03-10T03:29:18.000Z | tests/token/TestUtil.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 33 | 2021-06-16T20:44:36.000Z | 2022-03-30T14:55:06.000Z | tests/token/TestUtil.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 7 | 2021-06-03T09:30:23.000Z | 2022-03-08T19:51:33.000Z | # -*- coding: utf-8 -*-
"""
Copyright 2019 eBay Inc.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | 30.439024 | 98 | 0.679087 | import os, logging, json, time, urllib, re, yaml
from selenium import webdriver
sandbox_key = "sandbox-user"
production_key = "production-user"
_user_credential_list = {}
def read_user_info(conf=None):
logging.info("Loading user credential configuration file at: %s", conf)
with open(conf, 'r') as f:
... | true | true |
f72f39431d58d174acc8a451fc3f5024a7a67581 | 3,474 | py | Python | scrapy/contrib/downloadermiddleware/retry.py | h4ck3rm1k3/scrapy | 59dcdbe84769c9d204f552a2b545b1e096a2d42c | [
"BSD-3-Clause"
] | 26 | 2015-02-07T17:35:26.000Z | 2020-04-27T21:11:00.000Z | scrapy/contrib/downloadermiddleware/retry.py | h4ck3rm1k3/scrapy | 59dcdbe84769c9d204f552a2b545b1e096a2d42c | [
"BSD-3-Clause"
] | 2 | 2021-09-20T19:54:29.000Z | 2022-03-22T21:47:39.000Z | scrapy/contrib/downloadermiddleware/retry.py | h4ck3rm1k3/scrapy | 59dcdbe84769c9d204f552a2b545b1e096a2d42c | [
"BSD-3-Clause"
] | 9 | 2015-09-21T08:17:20.000Z | 2021-02-07T02:31:36.000Z | """
An extension to retry failed requests that are potentially caused by temporary
problems such as a connection timeout or HTTP 500 error.
You can change the behaviour of this middleware by modifing the scraping settings:
RETRY_TIMES - how many times to retry a failed page
RETRY_HTTP_CODES - which HTTP response codes... | 43.974684 | 100 | 0.704088 |
from twisted.internet import defer
from twisted.internet.error import TimeoutError, DNSLookupError, \
ConnectionRefusedError, ConnectionDone, ConnectError, \
ConnectionLost, TCPTimedOutError
from scrapy import log
from scrapy.exceptions import NotConfigured
from scrapy.utils.response import response_s... | true | true |
f72f39ea13255cbce714cd52ecd6820c01e3e27b | 10,487 | py | Python | tests/test_phase_change.py | volpatto/chemicals | 721904ee17604f5e8685b0e5fff12e0bac567f73 | [
"MIT"
] | null | null | null | tests/test_phase_change.py | volpatto/chemicals | 721904ee17604f5e8685b0e5fff12e0bac567f73 | [
"MIT"
] | null | null | null | tests/test_phase_change.py | volpatto/chemicals | 721904ee17604f5e8685b0e5fff12e0bac567f73 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... | 34.840532 | 143 | 0.685229 |
import pytest
from fluids.numerics import assert_close, assert_close1d
from chemicals.phase_change import *
from chemicals.phase_change import (Hvap_data_CRC, Hfus_data_CRC,
Hvap_data_Gharagheizi, Hsub_data_Gharagheizi,
Tb_data_Yaws, Tm_ON_data,
... | true | true |
f72f3a0ab9d913c2109ddb7b9fece41c54d596c4 | 11,902 | py | Python | typhon/retrieval/common.py | gerritholl/typhon | dbde147be12922ec730bd072dc4797c9da9a6d6b | [
"MIT"
] | null | null | null | typhon/retrieval/common.py | gerritholl/typhon | dbde147be12922ec730bd072dc4797c9da9a6d6b | [
"MIT"
] | null | null | null | typhon/retrieval/common.py | gerritholl/typhon | dbde147be12922ec730bd072dc4797c9da9a6d6b | [
"MIT"
] | null | null | null | from ast import literal_eval
import copy
from importlib import import_module
import json
import numpy as np
import pandas as pd
from sklearn.pipeline import Pipeline
from typhon.utils import to_array
__all__ = [
'RetrievalProduct',
]
class NotTrainedError(Exception):
"""Should be raised if someone runs a no... | 31.075718 | 77 | 0.582423 | from ast import literal_eval
import copy
from importlib import import_module
import json
import numpy as np
import pandas as pd
from sklearn.pipeline import Pipeline
from typhon.utils import to_array
__all__ = [
'RetrievalProduct',
]
class NotTrainedError(Exception):
def __init__(self, *args):
messa... | true | true |
f72f3abecda24bf11d5273a5655eafa5f2c18ecb | 10,729 | py | Python | src/minescrubber/mainwindow.py | alok1974/minescrubber | 0c18d960b385a4a59ac0cf38bc69271a23c667e7 | [
"MIT"
] | 1 | 2020-08-11T23:08:34.000Z | 2020-08-11T23:08:34.000Z | src/minescrubber/mainwindow.py | alok1974/minescrubber | 0c18d960b385a4a59ac0cf38bc69271a23c667e7 | [
"MIT"
] | null | null | null | src/minescrubber/mainwindow.py | alok1974/minescrubber | 0c18d960b385a4a59ac0cf38bc69271a23c667e7 | [
"MIT"
] | null | null | null | import os
import random
from . import imager, conf, animator
from .qt import BaseDialog, QtWidgets, QtCore, QtGui
class MainWidget(BaseDialog):
CELL_SELECTED_SIGNAL = QtCore.Signal(tuple)
CELL_FLAGGED_SIGNAL = QtCore.Signal(tuple)
NEW_GAME_SIGNAL = QtCore.Signal(tuple)
def __init__(self, parent=Non... | 36.246622 | 79 | 0.654208 | import os
import random
from . import imager, conf, animator
from .qt import BaseDialog, QtWidgets, QtCore, QtGui
class MainWidget(BaseDialog):
CELL_SELECTED_SIGNAL = QtCore.Signal(tuple)
CELL_FLAGGED_SIGNAL = QtCore.Signal(tuple)
NEW_GAME_SIGNAL = QtCore.Signal(tuple)
def __init__(self, parent=Non... | true | true |
f72f3b30d80ddaeb33b04d28e7f95a0cabbea8cd | 2,075 | py | Python | integrations/tensorflow/e2e/broadcasting_test.py | BernhardRiemann/iree | 471349762b316f7d6b83eb5f9089255d78052758 | [
"Apache-2.0"
] | 1 | 2021-03-15T13:53:30.000Z | 2021-03-15T13:53:30.000Z | integrations/tensorflow/e2e/broadcasting_test.py | BernhardRiemann/iree | 471349762b316f7d6b83eb5f9089255d78052758 | [
"Apache-2.0"
] | null | null | null | integrations/tensorflow/e2e/broadcasting_test.py | BernhardRiemann/iree | 471349762b316f7d6b83eb5f9089255d78052758 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 26.948052 | 74 | 0.723855 |
from absl import app
import numpy as np
from pyiree.tf.support import tf_test_utils
from pyiree.tf.support import tf_utils
import tensorflow.compat.v2 as tf
class BroadcastingModule(tf.Module):
@tf.function(input_signature=[
tf.TensorSpec([None], tf.float32),
tf.TensorSpec([None], tf.float32),
])
... | true | true |
f72f3cd14665268a7017d487decd2770a51a8acf | 42,710 | py | Python | tests/tx_test.py | iterumllc/afdko | 42ad89290a42015dcdf2dfd778d826e928bf9b9b | [
"Apache-2.0"
] | null | null | null | tests/tx_test.py | iterumllc/afdko | 42ad89290a42015dcdf2dfd778d826e928bf9b9b | [
"Apache-2.0"
] | null | null | null | tests/tx_test.py | iterumllc/afdko | 42ad89290a42015dcdf2dfd778d826e928bf9b9b | [
"Apache-2.0"
] | null | null | null | import os
import pytest
import re
import subprocess
import time
from afdko.fdkutils import (
get_temp_file_path,
get_temp_dir_path,
)
from test_utils import (
get_input_path,
get_bad_input_path,
get_expected_path,
generate_ps_dump,
)
from runner import main as runner
from differ import main as ... | 36.787252 | 79 | 0.624959 | import os
import pytest
import re
import subprocess
import time
from afdko.fdkutils import (
get_temp_file_path,
get_temp_dir_path,
)
from test_utils import (
get_input_path,
get_bad_input_path,
get_expected_path,
generate_ps_dump,
)
from runner import main as runner
from differ import main as ... | true | true |
f72f3d1c6a35bd919b59685338374f45d915640f | 2,886 | py | Python | python/init_db.py | arenadata/adcm | a499caa30adc2a53e7b3f46c96a865f9e4079e4e | [
"Apache-2.0"
] | 16 | 2019-11-28T18:05:21.000Z | 2021-12-08T18:09:18.000Z | python/init_db.py | arenadata/adcm | a499caa30adc2a53e7b3f46c96a865f9e4079e4e | [
"Apache-2.0"
] | 1,127 | 2019-11-29T08:57:25.000Z | 2022-03-31T20:21:32.000Z | python/init_db.py | arenadata/adcm | a499caa30adc2a53e7b3f46c96a865f9e4079e4e | [
"Apache-2.0"
] | 10 | 2019-11-28T18:05:06.000Z | 2022-01-13T06:16:40.000Z | #!/usr/bin/env python3
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwar... | 26.722222 | 88 | 0.700277 |
import json
import random
import string
from itertools import chain
import adcm.init_django
from django.contrib.auth.models import User
from cm import issue
from cm.logger import log
from cm.models import (
UserProfile,
DummyData,
CheckLog,
GroupCheckLog,
Cluster,
HostProvider,
ConcernTy... | true | true |
f72f3d6d80d945c5a335c62637d517ade6bb22c6 | 234 | py | Python | t/unit/test_exceptions.py | nlundquist/kombu | 483cadced77d82a6ecd0be553b91ce92f04f9617 | [
"BSD-3-Clause"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/kombu-4.3.0/t/unit/test_exceptions.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/kombu-4.3.0/t/unit/test_exceptions.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | from __future__ import absolute_import, unicode_literals
from case import Mock
from kombu.exceptions import HttpError
class test_HttpError:
def test_str(self):
assert str(HttpError(200, 'msg', Mock(name='response')))
| 19.5 | 64 | 0.75641 | from __future__ import absolute_import, unicode_literals
from case import Mock
from kombu.exceptions import HttpError
class test_HttpError:
def test_str(self):
assert str(HttpError(200, 'msg', Mock(name='response')))
| true | true |
f72f3d7c4544ede280f22ec01cd308bf34c32e57 | 1,686 | py | Python | certbot-runner/setup.py | gerrito333/letsencrypt-cert-manager | 957ea555cc0f18fc3af9c275dc2fc5a8ab0a1668 | [
"MIT"
] | 2 | 2020-07-08T17:36:11.000Z | 2020-07-08T18:20:59.000Z | certbot-runner/setup.py | gerrito333/letsencrypt-cert-manager | 957ea555cc0f18fc3af9c275dc2fc5a8ab0a1668 | [
"MIT"
] | 2 | 2020-07-08T17:57:19.000Z | 2020-07-08T18:00:38.000Z | certbot-runner/setup.py | gerrito333/letsencrypt-cert-manager | 957ea555cc0f18fc3af9c275dc2fc5a8ab0a1668 | [
"MIT"
] | 1 | 2020-12-18T21:49:10.000Z | 2020-12-18T21:49:10.000Z | """Configure package."""
import os
from setuptools import setup, find_packages
# -----------------------------------------------------------------------------
# For information on this file, see:
# https://packaging.python.org/distributing/#setup-args
#
# For examples, look here:
# https://gitlab.pixsystem.net/groups/... | 29.578947 | 119 | 0.651839 | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
version = {}
with open(os.path.join(here, "lambda_function", "_version.py")) as ver_file:
exec(ver_file.read(), version)
packages = [
package
for package in find_packages()
if package.startswith(... | true | true |
f72f3e3c530fb085acf757d2eb07052013668b0a | 105,967 | py | Python | tests/system_tests_link_routes.py | santosh653/qpid-dispatch | cd35c975340f248ea46d35e8a709c0fb585be15c | [
"Apache-2.0"
] | null | null | null | tests/system_tests_link_routes.py | santosh653/qpid-dispatch | cd35c975340f248ea46d35e8a709c0fb585be15c | [
"Apache-2.0"
] | 121 | 2020-09-16T06:03:53.000Z | 2022-03-30T13:03:23.000Z | tests/system_tests_link_routes.py | astitcher/qpid-dispatch | b01c5a7286849c053db9548dbb7586713211eed3 | [
"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... | 42.437725 | 166 | 0.577038 |
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import os
from time import sleep, time
from threading import Event
from subprocess import PIPE, STDOUT
from system_test import TestCase, Qdrouterd, main_module, TIMEOUT... | true | true |
f72f3f14c41617165cb68986338ef49ad0c75ee8 | 3,116 | py | Python | python_implementation/example/example7.py | mannyray/sort | f0ee0488aa4e7213d30ff50bcb848a843fedde42 | [
"MIT"
] | 2 | 2021-11-08T09:25:23.000Z | 2022-03-14T08:44:09.000Z | python_implementation/example/example7.py | mannyray/sort | f0ee0488aa4e7213d30ff50bcb848a843fedde42 | [
"MIT"
] | null | null | null | python_implementation/example/example7.py | mannyray/sort | f0ee0488aa4e7213d30ff50bcb848a843fedde42 | [
"MIT"
] | null | null | null | import commonExample
import math
import sys
sys.path.insert(0,'..')
import generate
import constants
from numpy import random
import intersection
from PIL import Image, ImageDraw, ImageFont
gif_file="example7"
xcoords = [constants.width,constants.width,constants.width,100,400,700,1000,1300]
ycoords = [50,350,700,con... | 34.622222 | 160 | 0.652118 | import commonExample
import math
import sys
sys.path.insert(0,'..')
import generate
import constants
from numpy import random
import intersection
from PIL import Image, ImageDraw, ImageFont
gif_file="example7"
xcoords = [constants.width,constants.width,constants.width,100,400,700,1000,1300]
ycoords = [50,350,700,con... | true | true |
f72f3f9773cb57978179d7d03d2f532c34dbe335 | 869 | py | Python | setup.py | ngoet/markdowndocs | 8154276bd943c8a641d1c5ef6e3aa07395beee1c | [
"MIT"
] | null | null | null | setup.py | ngoet/markdowndocs | 8154276bd943c8a641d1c5ef6e3aa07395beee1c | [
"MIT"
] | null | null | null | setup.py | ngoet/markdowndocs | 8154276bd943c8a641d1c5ef6e3aa07395beee1c | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="markdowndocs",
version="0.1.0",
author="ngoet",
author_email="ndgoet@gmail.com",
description="A light-weight markdown code documentation generator",
install_requires=[
... | 29.965517 | 79 | 0.650173 | from setuptools import find_packages, setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="markdowndocs",
version="0.1.0",
author="ngoet",
author_email="ndgoet@gmail.com",
description="A light-weight markdown code documentation generator",
install_requires=[
... | true | true |
f72f3f991d29cfcde8c404665347a2b2067bd01a | 3,145 | py | Python | tests/test_game_map.py | brittleshinpass/mossbread | 6a225e5d11fdf1957d1bfe74c5a76d105561e12e | [
"MIT"
] | 1 | 2020-05-30T19:45:58.000Z | 2020-05-30T19:45:58.000Z | tests/test_game_map.py | brittleshinpass/mossbread | 6a225e5d11fdf1957d1bfe74c5a76d105561e12e | [
"MIT"
] | null | null | null | tests/test_game_map.py | brittleshinpass/mossbread | 6a225e5d11fdf1957d1bfe74c5a76d105561e12e | [
"MIT"
] | null | null | null | import pytest
from array import array
from game_map import GameMap
from tests.conftest import get_relative_path
sample_map_data = tuple(
reversed(
(
array("I", (0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0)),
array("I", (0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0... | 46.25 | 88 | 0.475994 | import pytest
from array import array
from game_map import GameMap
from tests.conftest import get_relative_path
sample_map_data = tuple(
reversed(
(
array("I", (0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0)),
array("I", (0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0... | true | true |
f72f3fcfa3fab2976c56d4dd80f662765c94c4d1 | 700 | py | Python | src/owmpy/utils/_classes.py | ernieIzde8ski/open_weather_mappy | c50629065de85f6d2f4fcf46b741ff3320182a55 | [
"MIT"
] | null | null | null | src/owmpy/utils/_classes.py | ernieIzde8ski/open_weather_mappy | c50629065de85f6d2f4fcf46b741ff3320182a55 | [
"MIT"
] | null | null | null | src/owmpy/utils/_classes.py | ernieIzde8ski/open_weather_mappy | c50629065de85f6d2f4fcf46b741ff3320182a55 | [
"MIT"
] | null | null | null | from typing import NamedTuple
import aiohttp as _aiohttp
Number = int | float
class ShortLong(NamedTuple):
"""Represents shorthand and longhand of a unit."""
short: str
"""Shorthand form, eg '°C'"""
long: str
"""Longhandform, eg 'Celsius'"""
class _AutomaticClient:
client: _aiohttp.Client... | 22.580645 | 103 | 0.651429 | from typing import NamedTuple
import aiohttp as _aiohttp
Number = int | float
class ShortLong(NamedTuple):
short: str
long: str
class _AutomaticClient:
client: _aiohttp.ClientSession
appid: str | None
def __init__(self, client: _aiohttp.ClientSession | None = None, appid: str | None = None) ... | true | true |
f72f409ee17d5e96bd756971f13976c6028fd85e | 6,212 | py | Python | models/00_db.py | samsruti/eden | 8f6bdd070fa8435dafea6e8fb65db246280bb3ea | [
"MIT"
] | null | null | null | models/00_db.py | samsruti/eden | 8f6bdd070fa8435dafea6e8fb65db246280bb3ea | [
"MIT"
] | null | null | null | models/00_db.py | samsruti/eden | 8f6bdd070fa8435dafea6e8fb65db246280bb3ea | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Import Modules
Configure the Database
Instantiate Classes
"""
if settings.get_L10n_languages_readonly():
# Make the Language files read-only for improved performance
T.is_writable = False
get_vars = request.get_vars
# Are we running in debug mode?
settings.check_debug... | 29.028037 | 86 | 0.609627 |
if settings.get_L10n_languages_readonly():
T.is_writable = False
get_vars = request.get_vars
settings.check_debug()
import datetime
try:
import json except ImportError:
try:
import simplejson as json except:
import gluon.contrib.simplejson as json
migrate = settings.get_base_... | true | true |
f72f40b797e835bc5608be07f220c5da9a9c3a64 | 37,904 | py | Python | LAD-AMA-Common/telegraf_utils/telegraf_config_handler.py | shridpant/azure-linux-extensions | 4b5e66f33d5b93b15b427a9438931f0414f12a6e | [
"Apache-2.0"
] | null | null | null | LAD-AMA-Common/telegraf_utils/telegraf_config_handler.py | shridpant/azure-linux-extensions | 4b5e66f33d5b93b15b427a9438931f0414f12a6e | [
"Apache-2.0"
] | null | null | null | LAD-AMA-Common/telegraf_utils/telegraf_config_handler.py | shridpant/azure-linux-extensions | 4b5e66f33d5b93b15b427a9438931f0414f12a6e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Azure Linux extension
#
# Copyright (c) Microsoft Corporation
# All rights reserved.
# MIT License
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the ""Software""), to deal in the Software without restrictio... | 48.594872 | 293 | 0.627454 |
import sys
if sys.version_info[0] < 3:
from future import standard_library
standard_library.install_aliases()
from builtins import str
import json
import os
from telegraf_utils.telegraf_name_map import name_map
import subprocess
import signal
import urllib.request, urllib.error, urllib.parse
from shutil i... | true | true |
f72f41ca497f6677baaabda57723b11c6743caad | 7,901 | py | Python | unitTests.py | JDVDev/TaskRelay | 20213d31c90c0420e62f1e75c138ca1cb89211ee | [
"Apache-2.0"
] | null | null | null | unitTests.py | JDVDev/TaskRelay | 20213d31c90c0420e62f1e75c138ca1cb89211ee | [
"Apache-2.0"
] | null | null | null | unitTests.py | JDVDev/TaskRelay | 20213d31c90c0420e62f1e75c138ca1cb89211ee | [
"Apache-2.0"
] | null | null | null | import unittest
import pebble
from libpebble2.protocol import AppMessageACK, AppMessageNACK
from mock import Mock, patch, MagicMock
from libpebble2.services.appmessage import AppMessageService
from libpebble2.communication.transports import BaseTransport
from libpebble2.communication.transports.serial import Seri... | 39.90404 | 158 | 0.709657 | import unittest
import pebble
from libpebble2.protocol import AppMessageACK, AppMessageNACK
from mock import Mock, patch, MagicMock
from libpebble2.services.appmessage import AppMessageService
from libpebble2.communication.transports import BaseTransport
from libpebble2.communication.transports.serial import Seri... | false | true |
f72f41e99b9e572abeb953f1f643d46f46a98281 | 8,713 | py | Python | ros2_ws/src/utils/logger/logger/logger.py | FastSense/rosbot-ros2 | c2d274ce179534fec5b2786a6f96b6d638019ac4 | [
"MIT"
] | null | null | null | ros2_ws/src/utils/logger/logger/logger.py | FastSense/rosbot-ros2 | c2d274ce179534fec5b2786a6f96b6d638019ac4 | [
"MIT"
] | 2 | 2021-07-05T14:50:09.000Z | 2021-09-14T15:21:11.000Z | ros2_ws/src/utils/logger/logger/logger.py | FastSense/metalbot | 063c897a16129d9aa88c2c7c52bdf6547af894e4 | [
"MIT"
] | null | null | null | import os
import pandas as pd
from matplotlib import pyplot as plt
import rclpy
import numpy as np
from rclpy.node import Node
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
from std_srvs.srv import Empty
from logger.utils import convert_ros2_time_to_float
from logger.create_graphs import build... | 32.033088 | 111 | 0.596236 | import os
import pandas as pd
from matplotlib import pyplot as plt
import rclpy
import numpy as np
from rclpy.node import Node
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
from std_srvs.srv import Empty
from logger.utils import convert_ros2_time_to_float
from logger.create_graphs import build... | true | true |
f72f437483431e8f3efc25864bfdb0b9a97d1f2b | 195,406 | py | Python | yggdrasil/drivers/ModelDriver.py | cropsinsilico/yggdrasil | 466a4f77605a6f461d57ef7b165a6db7eec4d1fd | [
"BSD-3-Clause"
] | 22 | 2019-02-05T15:20:07.000Z | 2022-02-25T09:00:40.000Z | yggdrasil/drivers/ModelDriver.py | cropsinsilico/yggdrasil | 466a4f77605a6f461d57ef7b165a6db7eec4d1fd | [
"BSD-3-Clause"
] | 48 | 2019-02-15T20:41:24.000Z | 2022-03-16T20:52:02.000Z | yggdrasil/drivers/ModelDriver.py | cropsinsilico/yggdrasil | 466a4f77605a6f461d57ef7b165a6db7eec4d1fd | [
"BSD-3-Clause"
] | 16 | 2019-04-27T03:36:40.000Z | 2021-12-02T09:47:06.000Z | import os
import re
import sys
import copy
import logging
import warnings
import subprocess
import shutil
import uuid
import tempfile
import asyncio
from collections import OrderedDict
from pprint import pformat
from yggdrasil import platform, tools, languages, multitasking, constants
from yggdrasil.components import i... | 44.62343 | 88 | 0.555684 | import os
import re
import sys
import copy
import logging
import warnings
import subprocess
import shutil
import uuid
import tempfile
import asyncio
from collections import OrderedDict
from pprint import pformat
from yggdrasil import platform, tools, languages, multitasking, constants
from yggdrasil.components import i... | true | true |
f72f43ba26b309b9c8f2aba4f79737b3f52bf7d2 | 931 | py | Python | tasks.py | glyph/cryptography | 43cf688e885668198bc966b1cf3a4a425a60f1a6 | [
"Apache-2.0"
] | null | null | null | tasks.py | glyph/cryptography | 43cf688e885668198bc966b1cf3a4a425a60f1a6 | [
"Apache-2.0"
] | null | null | null | tasks.py | glyph/cryptography | 43cf688e885668198bc966b1cf3a4a425a60f1a6 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 33.25 | 72 | 0.721805 | from __future__ import absolute_import, division, print_function
import invoke
@invoke.task
def release(version):
invoke.run("git tag -s {0}".format(version))
invoke.run("git push --tags")
invoke.run("python setup.py sdist")
invoke.run("twine upload -s dist/cryptography-{0}*".format(version))
| true | true |
f72f446798e695312ccfcdbcfe2f24b2c49bcbdc | 47,910 | py | Python | desktop/core/ext-py/SQLAlchemy-1.3.17/test/sql/test_defaults.py | yetsun/hue | 2e48f0cc70e233ee0e1b40733d4b2a18d8836c66 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/SQLAlchemy-1.3.17/test/sql/test_defaults.py | yetsun/hue | 2e48f0cc70e233ee0e1b40733d4b2a18d8836c66 | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/SQLAlchemy-1.3.17/test/sql/test_defaults.py | yetsun/hue | 2e48f0cc70e233ee0e1b40733d4b2a18d8836c66 | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | import datetime
import itertools
import sqlalchemy as sa
from sqlalchemy import Boolean
from sqlalchemy import cast
from sqlalchemy import DateTime
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import Integer
from sqlalchemy import literal
from sqlalchemy impo... | 30.554847 | 79 | 0.501378 | import datetime
import itertools
import sqlalchemy as sa
from sqlalchemy import Boolean
from sqlalchemy import cast
from sqlalchemy import DateTime
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import Integer
from sqlalchemy import literal
from sqlalchemy impo... | true | true |
f72f453170f50aa25b6ab839bd6aa24c9b63bd4a | 2,169 | py | Python | pkgInfo.py | smanschi/Rcs | a54980a44c7fb0e925b091cd3c29297e940af39c | [
"BSD-4-Clause"
] | null | null | null | pkgInfo.py | smanschi/Rcs | a54980a44c7fb0e925b091cd3c29297e940af39c | [
"BSD-4-Clause"
] | null | null | null | pkgInfo.py | smanschi/Rcs | a54980a44c7fb0e925b091cd3c29297e940af39c | [
"BSD-4-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2020, Honda Research Institute Europe GmbH.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the abo... | 40.924528 | 100 | 0.717842 | name = "Rcs"
version = "1.0"
category="Libraries"
sqLevel = "basic"
sqOptOutRules = [ 'GEN04', 'C02', 'C06' ]
sqComments = { 'GEN04': 'Copyright header with BSD license not recognized by quality checker',
'C02': 'Link guards not to be used in Cpp headers ',
'C06':... | true | true |
f72f454dc859e851e69564b7be10690a0e9e6c87 | 154 | py | Python | opencyb/filestorage/apps.py | Open-Cybernetics/opencyb-site | c79d61ed2d508edf304dee92d93dfbc101188c0f | [
"BSD-3-Clause"
] | 3 | 2021-07-05T15:29:42.000Z | 2021-07-22T13:11:06.000Z | opencyb/filestorage/apps.py | open-cyb/website | c79d61ed2d508edf304dee92d93dfbc101188c0f | [
"BSD-3-Clause"
] | null | null | null | opencyb/filestorage/apps.py | open-cyb/website | c79d61ed2d508edf304dee92d93dfbc101188c0f | [
"BSD-3-Clause"
] | null | null | null | from django.apps import AppConfig
class FilestorageConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'filestorage'
| 22 | 56 | 0.772727 | from django.apps import AppConfig
class FilestorageConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'filestorage'
| true | true |
f72f45f0aeacc8d7741dbd968eb4854f4f2508c2 | 1,606 | py | Python | tests/task/test_claim.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | tests/task/test_claim.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | tests/task/test_claim.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest.mock
import pytest
import pycamunda.task
from tests.mock import raise_requests_exception_mock, not_ok_response_mock
def test_claim_params(engine_url):
claim_task = pycamunda.task.Claim(url=engine_url, id_='anId', user_id='anUserId')
assert claim_task.url == engine_u... | 32.12 | 85 | 0.754047 |
import unittest.mock
import pytest
import pycamunda.task
from tests.mock import raise_requests_exception_mock, not_ok_response_mock
def test_claim_params(engine_url):
claim_task = pycamunda.task.Claim(url=engine_url, id_='anId', user_id='anUserId')
assert claim_task.url == engine_url + '/task/anId/claim'
... | true | true |
f72f47b979d68d0a61e3e6a98a9950c6cfd94e50 | 9,604 | py | Python | qcelemental/util/misc.py | bgpeyton/QCElemental | 34c259f0c759e53c2bad9aa0da1126500fe6cf75 | [
"BSD-3-Clause"
] | null | null | null | qcelemental/util/misc.py | bgpeyton/QCElemental | 34c259f0c759e53c2bad9aa0da1126500fe6cf75 | [
"BSD-3-Clause"
] | 1 | 2021-03-05T19:06:09.000Z | 2021-03-05T19:06:09.000Z | qcelemental/util/misc.py | Andrew-AbiMansour/QCElemental | 2e84cd686d5fff0fc79accb28ffa985de4684704 | [
"BSD-3-Clause"
] | null | null | null | import math
import re
from typing import Dict, List
import numpy as np
from ..physical_constants import constants
def distance_matrix(a: np.ndarray, b: np.ndarray) -> np.ndarray:
"""Euclidean distance matrix between rows of arrays `a` and `b`. Equivalent to
`scipy.spatial.distance.cdist(a, b, 'euclidean')`.... | 29.919003 | 126 | 0.585173 | import math
import re
from typing import Dict, List
import numpy as np
from ..physical_constants import constants
def distance_matrix(a: np.ndarray, b: np.ndarray) -> np.ndarray:
assert a.shape[1] == b.shape[1], """Inner dimensions do not match"""
distm = np.zeros([a.shape[0], b.shape[0]])
for i in rang... | true | true |
f72f47d34b25fb540a99e2e2b836f2ad27836c97 | 3,066 | py | Python | tools/model_converters/regnet2mmdet.py | hyperlist/mmdetection | ba4918de7fb21a96edc373584fa21a17d098a843 | [
"Apache-2.0"
] | null | null | null | tools/model_converters/regnet2mmdet.py | hyperlist/mmdetection | ba4918de7fb21a96edc373584fa21a17d098a843 | [
"Apache-2.0"
] | null | null | null | tools/model_converters/regnet2mmdet.py | hyperlist/mmdetection | ba4918de7fb21a96edc373584fa21a17d098a843 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
from collections import OrderedDict
import paddle
def convert_stem(model_key, model_weight, state_dict, converted_names):
new_key = model_key.replace('stem.conv', 'conv1')
new_key = new_key.replace('stem.bn', 'bn1')
state_dict[new_key] = mod... | 33.692308 | 77 | 0.647097 | import argparse
from collections import OrderedDict
import paddle
def convert_stem(model_key, model_weight, state_dict, converted_names):
new_key = model_key.replace('stem.conv', 'conv1')
new_key = new_key.replace('stem.bn', 'bn1')
state_dict[new_key] = model_weight
converted_names.add(model_key)
... | true | true |
f72f47e775fcad2df9a2fb96e48014dd4b9267f7 | 1,543 | py | Python | src/py_mplus/objects/manga/title/__init__.py | SThomasP/py_mplus | 6d9c3075ae10b30a2482f3367f83f58037a04116 | [
"MIT"
] | null | null | null | src/py_mplus/objects/manga/title/__init__.py | SThomasP/py_mplus | 6d9c3075ae10b30a2482f3367f83f58037a04116 | [
"MIT"
] | null | null | null | src/py_mplus/objects/manga/title/__init__.py | SThomasP/py_mplus | 6d9c3075ae10b30a2482f3367f83f58037a04116 | [
"MIT"
] | null | null | null | from py_mplus.objects import MPObject
LANGUAGES = ['ENGLISH', 'SPANISH']
class Title(MPObject):
def _decode(self, buffer, category, skip):
if category == 1:
self.title_id = buffer.uint32()
elif category == 2:
self.name = buffer.string()
elif category == 3:
... | 25.716667 | 63 | 0.480233 | from py_mplus.objects import MPObject
LANGUAGES = ['ENGLISH', 'SPANISH']
class Title(MPObject):
def _decode(self, buffer, category, skip):
if category == 1:
self.title_id = buffer.uint32()
elif category == 2:
self.name = buffer.string()
elif category == 3:
... | true | true |
f72f487d46b2bfc1cb13b07d80c29f8c53395833 | 66 | py | Python | agents/agent_mct/__init__.py | elena-rae/connect4_bccn_pcp | ffa1c1fbd61a28901d67bdeb33250ae52c35c296 | [
"MIT"
] | null | null | null | agents/agent_mct/__init__.py | elena-rae/connect4_bccn_pcp | ffa1c1fbd61a28901d67bdeb33250ae52c35c296 | [
"MIT"
] | null | null | null | agents/agent_mct/__init__.py | elena-rae/connect4_bccn_pcp | ffa1c1fbd61a28901d67bdeb33250ae52c35c296 | [
"MIT"
] | null | null | null | from .montecarlo import generate_move_montecarlo as generate_move
| 33 | 65 | 0.893939 | from .montecarlo import generate_move_montecarlo as generate_move
| true | true |
f72f48c024608bb44e33fab35985d824af006978 | 6,490 | py | Python | conduit/fair/models/gpd.py | DavidHurst/palbolts | 72f9ca3f82499b532f14d0e797426e1b425d3efe | [
"MIT"
] | null | null | null | conduit/fair/models/gpd.py | DavidHurst/palbolts | 72f9ca3f82499b532f14d0e797426e1b425d3efe | [
"MIT"
] | null | null | null | conduit/fair/models/gpd.py | DavidHurst/palbolts | 72f9ca3f82499b532f14d0e797426e1b425d3efe | [
"MIT"
] | 1 | 2021-09-07T14:55:16.000Z | 2021-09-07T14:55:16.000Z | """Zhang Gradient Projection Debiasing Baseline Model."""
from __future__ import annotations
from typing import NamedTuple, cast
import ethicml as em
from kit import implements
from kit.torch import CrossEntropyLoss, TrainingMode
import pandas as pd
import pytorch_lightning as pl
from pytorch_lightning.utilities.types... | 35.271739 | 98 | 0.643297 | from __future__ import annotations
from typing import NamedTuple, cast
import ethicml as em
from kit import implements
from kit.torch import CrossEntropyLoss, TrainingMode
import pandas as pd
import pytorch_lightning as pl
from pytorch_lightning.utilities.types import EPOCH_OUTPUT
import torch
from torch import Tensor... | true | true |
f72f48f63a9e50aa08098b1af4f5cdfbb2e721f6 | 2,491 | py | Python | chessbot/r2_chess_pgn.py | amjadmajid/rosbook | 20d4ab94d910adc62c4aecb471ceac13b5cef5ad | [
"Apache-2.0"
] | 442 | 2015-12-11T02:59:16.000Z | 2022-03-31T22:10:25.000Z | chessbot/r2_chess_pgn.py | amjadmajid/rosbook | 20d4ab94d910adc62c4aecb471ceac13b5cef5ad | [
"Apache-2.0"
] | 41 | 2016-01-07T19:15:29.000Z | 2021-12-03T01:52:58.000Z | chessbot/r2_chess_pgn.py | amjadmajid/rosbook | 20d4ab94d910adc62c4aecb471ceac13b5cef5ad | [
"Apache-2.0"
] | 249 | 2015-11-27T10:22:33.000Z | 2022-03-28T09:52:05.000Z | #!/usr/bin/env python
import sys, rospy, tf, moveit_commander, random
from geometry_msgs.msg import Pose, Point, Quaternion
import pgn
class R2ChessboardPGN:
def __init__(self):
self.left_arm = moveit_commander.MoveGroupCommander("left_arm")
self.left_hand = moveit_commander.MoveGroupCommander("left_hand")
... | 33.662162 | 76 | 0.602569 | import sys, rospy, tf, moveit_commander, random
from geometry_msgs.msg import Pose, Point, Quaternion
import pgn
class R2ChessboardPGN:
def __init__(self):
self.left_arm = moveit_commander.MoveGroupCommander("left_arm")
self.left_hand = moveit_commander.MoveGroupCommander("left_hand")
def setGrasp(self, s... | false | true |
f72f4a6eaf811e134acc43e15c1fe1b2c788076f | 1,416 | py | Python | src/GUI_Elements/Entries.py | cedric-romain/lins | 1ccae895a8393b90422ff859a756a2c11ee585b0 | [
"MIT"
] | null | null | null | src/GUI_Elements/Entries.py | cedric-romain/lins | 1ccae895a8393b90422ff859a756a2c11ee585b0 | [
"MIT"
] | null | null | null | src/GUI_Elements/Entries.py | cedric-romain/lins | 1ccae895a8393b90422ff859a756a2c11ee585b0 | [
"MIT"
] | null | null | null | import tkinter as tk
class MyEntry:
def __init__(self, root, **kwargs):
self.root = root
self.value = None
self.frame = tk.Frame(self.root)
self.frame.pack(anchor="nw")
self.kwargs = kwargs
self.title_label = tk.Label(self.frame, text=self.parse_title(), anchor='w... | 30.782609 | 94 | 0.610876 | import tkinter as tk
class MyEntry:
def __init__(self, root, **kwargs):
self.root = root
self.value = None
self.frame = tk.Frame(self.root)
self.frame.pack(anchor="nw")
self.kwargs = kwargs
self.title_label = tk.Label(self.frame, text=self.parse_title(), anchor='w... | true | true |
f72f4a775d0236aea7d4fb2265ce24f07fab6865 | 22,040 | py | Python | primary_info.py | Tulioas/dfp_analyser | d66ff94ba0b88a5d421a992ad27661011db36091 | [
"MIT"
] | 2 | 2022-02-09T03:27:17.000Z | 2022-02-09T03:27:23.000Z | primary_info.py | Tulioas/dfp_analyser | d66ff94ba0b88a5d421a992ad27661011db36091 | [
"MIT"
] | null | null | null | primary_info.py | Tulioas/dfp_analyser | d66ff94ba0b88a5d421a992ad27661011db36091 | [
"MIT"
] | null | null | null | import pandas as pd
from zipfile import ZipFile
import numpy as np
import re
import os
def year_identifier(file_name):
'''
Abstrait: identify the year of the file
'''
folder_regex = re.compile(r'20\d\d')
match = folder_regex.search(str(file_name))
year = match.group()
return year
def d... | 46.108787 | 513 | 0.614338 | import pandas as pd
from zipfile import ZipFile
import numpy as np
import re
import os
def year_identifier(file_name):
folder_regex = re.compile(r'20\d\d')
match = folder_regex.search(str(file_name))
year = match.group()
return year
def debt_correction(dataframe):
debt_ident_list = ['Emprésti... | true | true |
f72f4aa4e427e9d3ee2d0c986960f64ae8d9cdb5 | 1,029 | py | Python | pyfatfs/__init__.py | abrasive/pyfatfs | a35586bfa2b1d3f8d4638142407db68f9318b86d | [
"MIT"
] | null | null | null | pyfatfs/__init__.py | abrasive/pyfatfs | a35586bfa2b1d3f8d4638142407db68f9318b86d | [
"MIT"
] | null | null | null | pyfatfs/__init__.py | abrasive/pyfatfs | a35586bfa2b1d3f8d4638142407db68f9318b86d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Python FAT filesystem module with :doc:`PyFilesystem2 <pyfilesystem2:index>` \
compatibility.
pyfatfs allows interaction with FAT12/16/32 filesystems, either via
:doc:`PyFilesystem2 <pyfilesystem2:index>` for file-level abstraction
or direct interaction with the filesystem for low-level ac... | 27.810811 | 78 | 0.696793 |
__name__ = 'pyfatfs'
__author__ = 'Nathan-J. Hirschauer'
__author_email__ = 'nathanhi@deepserve.info'
__license__ = 'MIT License'
from pyfatfs._exceptions import PyFATException
FAT_OEM_ENCODING = 'ibm437'
FAT_LFN_ENCODING = 'utf-16-le'
def _init_check(func):
def _wrapper(*args, **kwargs):
initialized... | true | true |
f72f4ab59584f2bc1d9c3a2887905b90bc8c7022 | 314 | py | Python | fwrap/__init__.py | wilsonify/fwrap | f2e20eb55eaa3de72905e2ef28198da00eebe262 | [
"BSD-3-Clause"
] | 23 | 2015-02-25T00:24:15.000Z | 2021-09-08T01:35:45.000Z | fwrap/__init__.py | fwrap/fwrap | 61a56f2d0050096b4973d88e5f11cfac2ef01a4b | [
"BSD-3-Clause"
] | 1 | 2021-09-08T01:45:02.000Z | 2021-09-08T01:45:02.000Z | fwrap/__init__.py | fwrap/fwrap | 61a56f2d0050096b4973d88e5f11cfac2ef01a4b | [
"BSD-3-Clause"
] | 4 | 2015-03-22T01:33:39.000Z | 2021-09-09T15:25:44.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2010, Kurt W. Smith
# All rights reserved. See LICENSE.txt.
#------------------------------------------------------------------------------
#!/usr/bin/env python
# encoding: utf-8
import os
import sys
__all__ = []
| 22.428571 | 79 | 0.334395 |
import os
import sys
__all__ = []
| true | true |
f72f4aeb1f0ee56032043a5cf920adea699c69c9 | 120 | py | Python | src/django_website/contact_us/urls.py | jdheinz/project-ordo_ab_chao | 4063f93b297bab43cff6ca64fa5ba103f0c75158 | [
"MIT"
] | 2 | 2019-09-23T18:42:32.000Z | 2019-09-27T00:33:38.000Z | src/django_website/contact_us/urls.py | jdheinz/project-ordo_ab_chao | 4063f93b297bab43cff6ca64fa5ba103f0c75158 | [
"MIT"
] | 6 | 2021-03-19T03:25:33.000Z | 2022-02-10T08:48:14.000Z | src/django_website/contact_us/urls.py | jdheinz/project-ordo_ab_chao | 4063f93b297bab43cff6ca64fa5ba103f0c75158 | [
"MIT"
] | 6 | 2019-09-23T18:53:41.000Z | 2020-02-06T00:20:06.000Z | from django.urls import path
from . import views
urlpatterns = [
path('', views.contact_page, name='contact'),
] | 17.142857 | 51 | 0.683333 | from django.urls import path
from . import views
urlpatterns = [
path('', views.contact_page, name='contact'),
] | true | true |
f72f4b412f1dfb0ca6e24370f06424fb77c77d93 | 353 | py | Python | pylinkage/output_arch.py | Drumato/pylinkage | 2033112c95a15722efcd9271c08fd919df635eae | [
"MIT"
] | null | null | null | pylinkage/output_arch.py | Drumato/pylinkage | 2033112c95a15722efcd9271c08fd919df635eae | [
"MIT"
] | null | null | null | pylinkage/output_arch.py | Drumato/pylinkage | 2033112c95a15722efcd9271c08fd919df635eae | [
"MIT"
] | null | null | null | import enum
class OutputArch(enum.Enum):
"""Machine architecture"""
X86_64 = enum.auto()
I386 = enum.auto()
NONE = enum.auto()
def to_string(self) -> str:
if self == OutputArch.X86_64:
return "i386:x86-64"
elif self == OutputArch.I386:
return "i386"
... | 20.764706 | 37 | 0.543909 | import enum
class OutputArch(enum.Enum):
X86_64 = enum.auto()
I386 = enum.auto()
NONE = enum.auto()
def to_string(self) -> str:
if self == OutputArch.X86_64:
return "i386:x86-64"
elif self == OutputArch.I386:
return "i386"
else:
return "NON... | true | true |
f72f4b5ce8a8b8deb81b605df4f7eb7f50221c03 | 3,678 | py | Python | mezzanine/utils/html.py | Cajoline/mezzanine | 54260343eec90f8c93e963465c4fdac55f66ec4c | [
"BSD-2-Clause"
] | null | null | null | mezzanine/utils/html.py | Cajoline/mezzanine | 54260343eec90f8c93e963465c4fdac55f66ec4c | [
"BSD-2-Clause"
] | null | null | null | mezzanine/utils/html.py | Cajoline/mezzanine | 54260343eec90f8c93e963465c4fdac55f66ec4c | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from future.builtins import chr, int, str
try:
from html.parser import HTMLParser, HTMLParseError
from html.entities import name2codepoint
except ImportError: # Python 2
from HTMLParser import HTMLParser, HTMLParseError
from htmlentitydefs impor... | 30.907563 | 75 | 0.605492 | from __future__ import absolute_import, unicode_literals
from future.builtins import chr, int, str
try:
from html.parser import HTMLParser, HTMLParseError
from html.entities import name2codepoint
except ImportError: from HTMLParser import HTMLParser, HTMLParseError
from htmlentitydefs import name2code... | true | true |
f72f4b7f8e1c3322d2100f5a273305db28e010d9 | 12,114 | py | Python | Tweet2Story/text2story/core/annotator.py | LIAAD/Tweet2Story | 1340c01bbc68915d51d67973f87325265b71f2dd | [
"MIT"
] | 5 | 2021-07-29T15:53:32.000Z | 2022-03-07T02:46:52.000Z | Tweet2Story/text2story/core/annotator.py | LIAAD/Tweet2Story | 1340c01bbc68915d51d67973f87325265b71f2dd | [
"MIT"
] | null | null | null | Tweet2Story/text2story/core/annotator.py | LIAAD/Tweet2Story | 1340c01bbc68915d51d67973f87325265b71f2dd | [
"MIT"
] | 1 | 2022-01-30T17:46:51.000Z | 2022-01-30T17:46:51.000Z | """
package.text2story.core.annotator
META-annotator
"""
from text2story.annotators import ACTOR_EXTRACTION_TOOLS, TIME_EXTRACTION_TOOLS, OBJECTAL_LINKS_RESOLUTION_TOOLS
from text2story.annotators import EVENT_EXTRACTION_TOOLS, SEMANTIC_ROLE_LABELLING_TOOLS
from text2story.annotators import extract_actors, extract_... | 45.541353 | 237 | 0.623411 |
from text2story.annotators import ACTOR_EXTRACTION_TOOLS, TIME_EXTRACTION_TOOLS, OBJECTAL_LINKS_RESOLUTION_TOOLS
from text2story.annotators import EVENT_EXTRACTION_TOOLS, SEMANTIC_ROLE_LABELLING_TOOLS
from text2story.annotators import extract_actors, extract_times, extract_objectal_links, extract_events
from text2stor... | true | true |
f72f4b9dc809d48633312a591811a639fb492796 | 8,934 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_backend_address_pools_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_backend_address_pools_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/_load_balancer_backend_address_pools_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.291892 | 218 | 0.671032 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
f72f4c43e27a41f58a040e1b5bf6c7a3a262c3ec | 745 | py | Python | trypython/stdlib/re_/re03.py | devlights/try-python | 67d1d26476794da81c8c76662486108ce03f8fb4 | [
"MIT"
] | 4 | 2019-10-21T11:42:11.000Z | 2020-03-12T16:35:51.000Z | trypython/stdlib/re_/re03.py | devlights/try-python | 67d1d26476794da81c8c76662486108ce03f8fb4 | [
"MIT"
] | 80 | 2017-02-08T07:55:37.000Z | 2021-10-06T06:30:30.000Z | trypython/stdlib/re_/re03.py | devlights/try-python | 67d1d26476794da81c8c76662486108ce03f8fb4 | [
"MIT"
] | 1 | 2020-03-12T04:37:17.000Z | 2020-03-12T04:37:17.000Z | """
正規表現のサンプルです。
最長一致と最短一致について
"""
import re
from trypython.common.commoncls import SampleBase
from trypython.stdlib.re_ import util
class Sample(SampleBase):
def exec(self):
# ---------------------------------------------
# 正規表現 (最長一致と最短一致)
#
# 正規表現はデフォルトで閉包を表すメタキャラクタ「*」は
... | 20.135135 | 55 | 0.485906 | import re
from trypython.common.commoncls import SampleBase
from trypython.stdlib.re_ import util
class Sample(SampleBase):
def exec(self):
message = 'hello world hello world'
pattern = r'h.*d'
m = re.match(pattern, message)... | true | true |
f72f4dfc280dbab31721c4c7456f8993a0b4131e | 142 | py | Python | code/abc110_c_03.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | 3 | 2019-08-16T16:55:48.000Z | 2021-04-11T10:21:40.000Z | code/abc110_c_03.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | code/abc110_c_03.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | from collections import Counter
S=Counter(input())
T=Counter(input())
s=S.values()
t=T.values()
print("Yes" if sorted(s)==sorted(t) else "No") | 23.666667 | 46 | 0.704225 | from collections import Counter
S=Counter(input())
T=Counter(input())
s=S.values()
t=T.values()
print("Yes" if sorted(s)==sorted(t) else "No") | true | true |
f72f4f61c468d6cc2a2a7fa806aa36b41325acaa | 4,969 | py | Python | readwrite.py | ciakkig/book-snake | a5aa783b31029981cb4e302d6ff213c0ace828ba | [
"MIT"
] | null | null | null | readwrite.py | ciakkig/book-snake | a5aa783b31029981cb4e302d6ff213c0ace828ba | [
"MIT"
] | null | null | null | readwrite.py | ciakkig/book-snake | a5aa783b31029981cb4e302d6ff213c0ace828ba | [
"MIT"
] | null | null | null | ### functions for reading from and writing to input files
def read_books(books_file='data/input/books.txt'):
# reads the file containing the books
# ('books.txt' by default)
# and returns the list of tuples:
# [(author, title), ...]
books = []
try:
with open(books_file) as file:
... | 35.241135 | 162 | 0.555041 |
def read_books(books_file='data/input/books.txt'):
books = []
try:
with open(books_file) as file:
for line in file:
line = line.strip()
if len(line) != 0:
line = line
book = line.split(',')
... | true | true |
f72f50b7cc2ce56f0c04120d8d35bdd4ff992462 | 26,731 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/fCoEGIET_template.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/fCoEGIET_template.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/fCoEGIET_template.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class FCoEGIET(Base):
__slots__ = ()
_SDM_NAME = 'fCoEGIET'
_SDM_ATT_MAP = {
'FcoeHeaderVersion': 'fCoEGIET.header.fcoeHeader.version-1',
'FcoeHeaderReserved': 'fCoEGIET.header.fcoeHeader.reserved-2',
'... | 39.542899 | 519 | 0.669036 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class FCoEGIET(Base):
__slots__ = ()
_SDM_NAME = 'fCoEGIET'
_SDM_ATT_MAP = {
'FcoeHeaderVersion': 'fCoEGIET.header.fcoeHeader.version-1',
'FcoeHeaderReserved': 'fCoEGIET.header.fcoeHeader.reserved-2',
'... | true | true |
f72f50c81d90829c24e33e5d2edfbdaff1582b9e | 1,241 | py | Python | test/core_variables_in_actions.py | sdarwin/build | 2c4217ebb6bdeb5001b33a5d0d6718420aef988c | [
"BSL-1.0"
] | 215 | 2015-01-10T17:16:34.000Z | 2022-02-23T15:22:08.000Z | test/core_variables_in_actions.py | sdarwin/build | 2c4217ebb6bdeb5001b33a5d0d6718420aef988c | [
"BSL-1.0"
] | 594 | 2015-01-22T16:17:55.000Z | 2022-02-26T22:11:01.000Z | test/core_variables_in_actions.py | sdarwin/build | 2c4217ebb6bdeb5001b33a5d0d6718420aef988c | [
"BSL-1.0"
] | 302 | 2015-02-03T01:20:29.000Z | 2022-02-12T07:01:28.000Z | #!/usr/bin/python
# Copyright 2012. Jurko Gospodnetic
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at
# https://www.bfgroup.xyz/b2/LICENSE.txt)
# Tests that variables in actions get expanded but double quote characters
# get treated as regular characters ... | 31.025 | 76 | 0.724416 |
import BoostBuild
t = BoostBuild.Tester(pass_toolset=0)
t.write("file.jam", """\
rule dummy ( i )
{
local a = 1 2 3 ;
ECHO From "rule:" $(a)" seconds" ;
a on $(i) = $(a) ;
}
actions dummy
{
echo 'From action: $(a)" seconds"'
}
dummy all ;
""")
t.run_build_system(["-ffile.jam", "-d1"])
t.expect_out... | true | true |
f72f50dbed30f0bd6003af7d51ecda8a8bc11fb9 | 2,355 | py | Python | setup.py | Anthchirp/pika | 55557c9172edb04256a5e49b7faf13078d5a0f66 | [
"BSD-3-Clause"
] | 2,479 | 2015-01-01T20:06:23.000Z | 2022-03-31T13:29:19.000Z | setup.py | Anthchirp/pika | 55557c9172edb04256a5e49b7faf13078d5a0f66 | [
"BSD-3-Clause"
] | 813 | 2015-01-07T07:13:49.000Z | 2022-03-28T05:05:06.000Z | setup.py | Anthchirp/pika | 55557c9172edb04256a5e49b7faf13078d5a0f66 | [
"BSD-3-Clause"
] | 763 | 2015-01-10T04:38:33.000Z | 2022-03-31T07:24:57.000Z | import setuptools
import os
# Conditionally include additional modules for docs
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
requirements = list()
if on_rtd:
requirements.append('gevent')
requirements.append('tornado')
requirements.append('twisted')
long_description = ('Pika is a pure-Python imp... | 39.915254 | 78 | 0.609766 | import setuptools
import os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
requirements = list()
if on_rtd:
requirements.append('gevent')
requirements.append('tornado')
requirements.append('twisted')
long_description = ('Pika is a pure-Python implementation of the AMQP 0-9-1 '
... | true | true |
f72f5124f0b9c2a565e817ba853281a8aa8ce924 | 3,278 | py | Python | src/dev/amdgpu/AMDGPU.py | zinob15/gem5 | fb2946e314ea9e63c7696ee8023150ed13956582 | [
"BSD-3-Clause"
] | 19 | 2018-07-20T15:08:50.000Z | 2022-03-26T16:15:59.000Z | src/dev/amdgpu/AMDGPU.py | zinob15/gem5 | fb2946e314ea9e63c7696ee8023150ed13956582 | [
"BSD-3-Clause"
] | 148 | 2018-07-20T00:58:36.000Z | 2021-11-16T01:52:33.000Z | src/dev/amdgpu/AMDGPU.py | zinob15/gem5 | fb2946e314ea9e63c7696ee8023150ed13956582 | [
"BSD-3-Clause"
] | 10 | 2019-01-10T03:01:30.000Z | 2022-01-21T18:36:18.000Z | # Copyright (c) 2021 Advanced Micro Devices, Inc.
# All rights reserved.
#
# For use for simulation and test purposes only
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retai... | 43.131579 | 79 | 0.744356 |
from m5.params import *
from m5.objects.PciDevice import PciDevice
from m5.objects.PciDevice import PciMemBar, PciMemUpperBar, PciLegacyIoBar
class AMDGPUDevice(PciDevice):
type = 'AMDGPUDevice'
cxx_header = "dev/amdgpu/amdgpu_device.hh"
cxx_class = 'gem5::AMDGPUDevice'
VendorID = 0x1002
Devi... | true | true |
f72f51bdd43655bb4de8a16aeea91f20e47a985f | 5,576 | py | Python | qiskit/circuit/library/blueprintcircuit.py | apcarrik/qiskit-terra | 456d036ade0e66f391f8932a944a1dd73d6354dd | [
"Apache-2.0"
] | 1 | 2021-07-06T09:07:47.000Z | 2021-07-06T09:07:47.000Z | qiskit/circuit/library/blueprintcircuit.py | evercodes/qiskit-terra | 649fec2cd1644c43eabc39b0a588c0a9347a2b50 | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/library/blueprintcircuit.py | evercodes/qiskit-terra | 649fec2cd1644c43eabc39b0a588c0a9347a2b50 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 32.231214 | 98 | 0.638989 |
from typing import Optional
from abc import ABC, abstractmethod
from qiskit.circuit import QuantumCircuit
from qiskit.circuit.parametertable import ParameterTable, ParameterView
class BlueprintCircuit(QuantumCircuit, ABC):
def __init__(self, *regs, name: Optional[str] = None) -> None:
super().__init__(... | true | true |
f72f536f5857554bc8e9d0890cb64eaae718c843 | 163 | py | Python | practice/3_basic_tensorflow/Keras/Example_simpleLinearRegression.py | rabbitsun2/toy_python | 32f84b4d15b13c4daa4fa212a40e685abc0d2a5d | [
"Apache-2.0"
] | null | null | null | practice/3_basic_tensorflow/Keras/Example_simpleLinearRegression.py | rabbitsun2/toy_python | 32f84b4d15b13c4daa4fa212a40e685abc0d2a5d | [
"Apache-2.0"
] | null | null | null | practice/3_basic_tensorflow/Keras/Example_simpleLinearRegression.py | rabbitsun2/toy_python | 32f84b4d15b13c4daa4fa212a40e685abc0d2a5d | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
x = np.arange(1, 6)
y = 3 * x + 2
print(x)
print(y)
# 시각화
plt.plot(x, y)
plt.title('y = 3x + 2')
plt.show()
| 10.866667 | 31 | 0.613497 | import numpy as np
import matplotlib.pyplot as plt
x = np.arange(1, 6)
y = 3 * x + 2
print(x)
print(y)
plt.plot(x, y)
plt.title('y = 3x + 2')
plt.show()
| true | true |
f72f5401fcba40741973080a187ab1412d11d4bb | 5,623 | py | Python | util/config.py | chunbolang/HPA | 645971c21519937ecbacf15e674e83e452eb1afc | [
"MIT"
] | 3 | 2021-09-01T13:04:09.000Z | 2021-12-19T16:25:01.000Z | util/config.py | chunbolang/HPA | 645971c21519937ecbacf15e674e83e452eb1afc | [
"MIT"
] | null | null | null | util/config.py | chunbolang/HPA | 645971c21519937ecbacf15e674e83e452eb1afc | [
"MIT"
] | null | null | null | # -----------------------------------------------------------------------------
# Functions for parsing args
# -----------------------------------------------------------------------------
import yaml
import os
from ast import literal_eval
import copy
class CfgNode(dict):
"""
CfgNode represents an internal no... | 32.316092 | 88 | 0.591677 | import yaml
import os
from ast import literal_eval
import copy
class CfgNode(dict):
def __init__(self, init_dict=None, key_list=None, new_allowed=False):
init_dict = {} if init_dict is None else init_dict
key_list = [] if key_list is None else key_list
for k, v in init_dict.items(... | true | true |
f72f5481f416e2393998f35e9846ad33ded113b8 | 32,028 | py | Python | src/align/align_seq_with_structure_multithread.py | nurmians/StructureMapper | a759cee2a49ea83d9932ef72f7d967dd60f723fb | [
"MIT"
] | 1 | 2019-09-01T04:55:01.000Z | 2019-09-01T04:55:01.000Z | src/align/align_seq_with_structure_multithread.py | nurmians/StructureMapper | a759cee2a49ea83d9932ef72f7d967dd60f723fb | [
"MIT"
] | null | null | null | src/align/align_seq_with_structure_multithread.py | nurmians/StructureMapper | a759cee2a49ea83d9932ef72f7d967dd60f723fb | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding=UTF-8
# -*- coding: UTF-8 -*-
# This file is part of the StructureMapper algorithm.
# Please cite the authors if you find this software useful
#
# https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/bty086/4857361
# MIT License
#
# Copyright 2018 Anssi Nurmin... | 38.495192 | 317 | 0.620769 |
import sys
import os
import traceback
import re
import time
import random
import signal
import glob
import textwrap
import getopt
import string
import gc
import itertools
from subprocess import call
from datetime import datetime, timedelta
from multiprocessing import Process, Pool, Array, Lock, Value, cpu_count,... | false | true |
f72f5537eacc861c1d47288d0342e45f60ac7392 | 1,053 | py | Python | crypto_balancer/order.py | GRTTX/crypto_balancer | a1c862cd6d01065a059664da605f03d972585418 | [
"MIT"
] | 28 | 2019-05-13T12:25:43.000Z | 2022-03-11T06:57:21.000Z | crypto_balancer/order.py | timff/crypto_balancer | cc5ed85b4f1f7222d6532f8f0ba46dac329bac7b | [
"MIT"
] | 5 | 2019-03-10T15:39:34.000Z | 2021-06-13T05:39:14.000Z | crypto_balancer/order.py | timff/crypto_balancer | cc5ed85b4f1f7222d6532f8f0ba46dac329bac7b | [
"MIT"
] | 17 | 2019-03-10T15:14:20.000Z | 2022-03-11T06:57:06.000Z | class Order():
def __init__(self, pair, direction, amount, price):
if direction.upper() not in ['BUY', 'SELL']:
raise ValueError("{} is not a valid direction".format(direction))
self.pair = pair
self.direction = direction
self.amount = float(amount)
self.price = f... | 35.1 | 87 | 0.60019 | class Order():
def __init__(self, pair, direction, amount, price):
if direction.upper() not in ['BUY', 'SELL']:
raise ValueError("{} is not a valid direction".format(direction))
self.pair = pair
self.direction = direction
self.amount = float(amount)
self.price = f... | true | true |
f72f55f3741f5c542c00c1b9f62273c35e1f6038 | 1,864 | py | Python | get_swa_model.py | Mr-GJ/PaddleDetection | 5fc2ce62d9b8f0bcc3d1c436b502d0371dec2a35 | [
"Apache-2.0"
] | null | null | null | get_swa_model.py | Mr-GJ/PaddleDetection | 5fc2ce62d9b8f0bcc3d1c436b502d0371dec2a35 | [
"Apache-2.0"
] | null | null | null | get_swa_model.py | Mr-GJ/PaddleDetection | 5fc2ce62d9b8f0bcc3d1c436b502d0371dec2a35 | [
"Apache-2.0"
] | null | null | null | import os
from argparse import ArgumentParser
import paddle
def main():
parser = ArgumentParser()
parser.add_argument(
'--model_dir', help='the directory where checkpoints are saved',default="output/swa_test")
parser.add_argument(
'--starting_model_id',
default=0,
type=int... | 31.066667 | 98 | 0.636266 | import os
from argparse import ArgumentParser
import paddle
def main():
parser = ArgumentParser()
parser.add_argument(
'--model_dir', help='the directory where checkpoints are saved',default="output/swa_test")
parser.add_argument(
'--starting_model_id',
default=0,
type=int... | true | true |
f72f56c346bc5ea495160905b6c7b1cd1bad0d4b | 4,664 | py | Python | pysnmp-with-texts/COSINE-GLOBAL-REG.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/COSINE-GLOBAL-REG.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/COSINE-GLOBAL-REG.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 COSINE-GLOBAL-REG (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/COSINE-GLOBAL-REG
# Produced by pysmi-0.3.4 at Wed May 1 12:27:00 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... | 86.37037 | 505 | 0.78066 | OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.impo... | true | true |
f72f580eceb7de94295ce579304c454df2d18703 | 640 | py | Python | printto/management/commands/cleanprinteddocs.py | starofrainnight/vswprinter | b88591c44da545913a5a238bf4b8cd30bb1eeac8 | [
"Apache-2.0"
] | null | null | null | printto/management/commands/cleanprinteddocs.py | starofrainnight/vswprinter | b88591c44da545913a5a238bf4b8cd30bb1eeac8 | [
"Apache-2.0"
] | null | null | null | printto/management/commands/cleanprinteddocs.py | starofrainnight/vswprinter | b88591c44da545913a5a238bf4b8cd30bb1eeac8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import arrow
from django.core.management.base import BaseCommand
from printto.models import UploadedFileModel
class Command(BaseCommand):
help = 'Clean all printed docs after 3 minutes'
def handle(self, *args, **options):
now_time = arrow.now()
now_time = no... | 24.615385 | 73 | 0.621875 |
import os
import arrow
from django.core.management.base import BaseCommand
from printto.models import UploadedFileModel
class Command(BaseCommand):
help = 'Clean all printed docs after 3 minutes'
def handle(self, *args, **options):
now_time = arrow.now()
now_time = now_time.shift(minutes=-3)... | true | true |
f72f594f8368ca86790fb4ec321791290b22fa4b | 7,735 | py | Python | deepspeed/runtime/zero/linear.py | manuelciosici/DeepSpeed | 3da841853ca07abf3a09e7bd325a576c4e642c11 | [
"MIT"
] | null | null | null | deepspeed/runtime/zero/linear.py | manuelciosici/DeepSpeed | 3da841853ca07abf3a09e7bd325a576c4e642c11 | [
"MIT"
] | null | null | null | deepspeed/runtime/zero/linear.py | manuelciosici/DeepSpeed | 3da841853ca07abf3a09e7bd325a576c4e642c11 | [
"MIT"
] | null | null | null | #Linear Module to use with ZeRO Stage 3 to allow for parameter memory release
#after the module execution during forward
#Instead of saving variables using save_for_backward, we save variable ids
#Allowing us to retrieve the variable without creating pointer to it
#Which allows for underlying tensor to be garbage colle... | 41.363636 | 162 | 0.644473 |
import math
import torch
from torch import Tensor
from torch.nn.parameter import Parameter
from torch.nn import init
from torch.nn.modules.module import Module
from deepspeed.runtime.utils import noop_decorator
tensor_map = {}
def print_rank_0(message, debug=False, force=False):
if torch.distributed.get_rank()... | true | true |
f72f59c3cfb5739da698e3f5202cc2b3d8fead0a | 3,006 | py | Python | utilities/modify_torsions.py | slochower/host-guest-benchmarks | c398b499fe6dbae39523278946c0e25eb78d6d66 | [
"MIT"
] | null | null | null | utilities/modify_torsions.py | slochower/host-guest-benchmarks | c398b499fe6dbae39523278946c0e25eb78d6d66 | [
"MIT"
] | 8 | 2019-07-05T17:55:27.000Z | 2022-03-21T18:59:50.000Z | utilities/modify_torsions.py | slochower/host-guest-benchmarks | c398b499fe6dbae39523278946c0e25eb78d6d66 | [
"MIT"
] | 1 | 2020-05-05T22:51:21.000Z | 2020-05-05T22:51:21.000Z | from openforcefield.typing.engines import smirnoff
from simtk import unit
force_field = smirnoff.ForceField('smirnoff99Frosst_experimental.offxml')
# t9
# [#1:1]-[#6X4:2]-[#6X4:3]-[#8X2:4]
# H1-C1-C2-O2
# GAFF v2.1
# k = 0.16 per = 3
# SMIRNOFF99Frosst
# k = 0.25 per = 1
# k = 0.00 per = 3
#
# < Prope... | 27.081081 | 115 | 0.627412 | from openforcefield.typing.engines import smirnoff
from simtk import unit
force_field = smirnoff.ForceField('smirnoff99Frosst_experimental.offxml')
parameter = force_field.get_parameter_handler('ProperTorsions').parameters["[#1:1]-[#6X4:2]-[#6X4:3]-[#8X2:4]"]
assert(parameter.k[0] == 0.0 * unit.kilocalorie_per_mole... | true | true |
f72f59f6d7bf39d04bcaac65bd6d4197dac899ac | 2,250 | py | Python | sourcecode/VaspTestKPOINT.py | yizhiwoniu/VaspCZ | 44b890cf18d649c428c21e3f8fadc3222453d84d | [
"MIT"
] | 1 | 2021-01-10T04:01:57.000Z | 2021-01-10T04:01:57.000Z | sourcecode/VaspTestKPOINT.py | yizhiwoniu/VaspCZ | 44b890cf18d649c428c21e3f8fadc3222453d84d | [
"MIT"
] | null | null | null | sourcecode/VaspTestKPOINT.py | yizhiwoniu/VaspCZ | 44b890cf18d649c428c21e3f8fadc3222453d84d | [
"MIT"
] | null | null | null | #!/home/zhangzhengde/bin/bin/python3
#coding=utf-8
import os
import argparse
import VaspCZ.zzdlib as zzd
def modify_vasp_sh(jobname, nodes, ppn):
with open('./Vasp.sh', 'r') as f:
data = f.readlines()
new_data = []
for line in data:
if ' #PBS -N' in line:
new_data.append(f' #PBS -N {jobname}\n')
elif ' #P... | 29.605263 | 114 | 0.643556 |
import os
import argparse
import VaspCZ.zzdlib as zzd
def modify_vasp_sh(jobname, nodes, ppn):
with open('./Vasp.sh', 'r') as f:
data = f.readlines()
new_data = []
for line in data:
if ' #PBS -N' in line:
new_data.append(f' #PBS -N {jobname}\n')
elif ' #PBS -l nodes' in line:
new_data.append(f' #PBS -l... | true | true |
f72f5a8790c8b9fe823eb02d854fed6e481d1477 | 4,519 | py | Python | sciencebeam_gym/convert/grobid/grobid_xml_enhancer.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 25 | 2017-07-25T12:44:55.000Z | 2020-09-30T22:16:50.000Z | sciencebeam_gym/convert/grobid/grobid_xml_enhancer.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 192 | 2017-11-29T08:57:03.000Z | 2022-03-29T18:44:41.000Z | sciencebeam_gym/convert/grobid/grobid_xml_enhancer.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 6 | 2019-02-01T18:49:33.000Z | 2020-07-26T08:18:46.000Z | import logging
from io import BytesIO
from lxml import etree
from lxml.builder import E
from sciencebeam_gym.inference_model.extract_to_xml import (
XmlPaths,
create_node_recursive,
rsplit_xml_path
)
from .grobid_service import (
grobid_service,
GrobidApiPaths
)
TEI_NS = 'http://www.tei-c.org/ns... | 39.295652 | 96 | 0.614516 | import logging
from io import BytesIO
from lxml import etree
from lxml.builder import E
from sciencebeam_gym.inference_model.extract_to_xml import (
XmlPaths,
create_node_recursive,
rsplit_xml_path
)
from .grobid_service import (
grobid_service,
GrobidApiPaths
)
TEI_NS = 'http://www.tei-c.org/ns... | true | true |
f72f5ada789609c9da8c75cf0cc91f4f7569b058 | 19,098 | py | Python | python/test/function/refs.py | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 2,792 | 2017-06-26T13:05:44.000Z | 2022-03-28T07:55:26.000Z | python/test/function/refs.py | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 138 | 2017-06-27T07:04:44.000Z | 2022-02-28T01:37:15.000Z | python/test/function/refs.py | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 380 | 2017-06-26T13:23:52.000Z | 2022-03-25T16:51:30.000Z | # Copyright 2017,2018,2019,2020,2021 Sony Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 37.817822 | 120 | 0.48869 |
from __future__ import division
from six.moves import range
import itertools
import numpy as np
def get_conv_out_size(w, k, p, s, d=1):
return (w + 2 * p - (d * (k - 1) + 1)) // s + 1
def get_deconv_out_size(w, k, p, s, d):
return s * (w - 1) - 2 * p + (d * (k - 1) + 1)
def get_pool_out_size(w, k, p, s,... | true | true |
f72f5b0f93cd1cae45d411cdbf0b9862569cbd4a | 14,421 | py | Python | models/wc3.py | prannayk/MSRASI17 | f7277d90ffdd062c1ba94391b7f82c621e619743 | [
"MIT"
] | null | null | null | models/wc3.py | prannayk/MSRASI17 | f7277d90ffdd062c1ba94391b7f82c621e619743 | [
"MIT"
] | null | null | null | models/wc3.py | prannayk/MSRASI17 | f7277d90ffdd062c1ba94391b7f82c621e619743 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import operator
import collections
import math
import time
import os
import random
import zipfile
import time
import numpy as np
import sys
from six.moves import urllib
from six.moves import xrange # pylint: di... | 60.592437 | 434 | 0.776437 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import operator
import collections
import math
import time
import os
import random
import zipfile
import time
import numpy as np
import sys
from six.moves import urllib
from six.moves import xrange import tenso... | true | true |
f72f5be70b1693d04dec3b426552809513564ddf | 1,188 | py | Python | Python-Basic/open-data.py | dicksonlam1011/python-training | ea43cae118081e607f7767c165eeda64b2a64d77 | [
"MIT"
] | null | null | null | Python-Basic/open-data.py | dicksonlam1011/python-training | ea43cae118081e607f7767c165eeda64b2a64d77 | [
"MIT"
] | null | null | null | Python-Basic/open-data.py | dicksonlam1011/python-training | ea43cae118081e607f7767c165eeda64b2a64d77 | [
"MIT"
] | null | null | null | # Connect to the internet (webpage)
import urllib.request as request
import json
##########################################################################################
# Set Proxy for Urllib
proxy="https://llm234:85167787887Ss!@proxy.ha.org.hk:8080"
proxy_support=request.ProxyHandler({'https':proxy}) # Build Prox... | 39.6 | 94 | 0.608586 |
import urllib.request as request
import json
proxy="https://llm234:85167787887Ss!@proxy.ha.org.hk:8080"
proxy_support=request.ProxyHandler({'https':proxy}) opener = request.build_opener(proxy_support) request.install_opener(opener)
src="https://geodata.gov.hk/gs/api/v1.0.0/locationSearch?q=cultural%20centre"
with r... | true | true |
f72f5c5da9321919ee315fed0547bbb36ffd0ef4 | 1,569 | py | Python | devind_helpers/utils.py | devind-team/devind-django-helpers | 5c64d46a12802bbe0b70e44aa9d19bf975511b6e | [
"MIT"
] | null | null | null | devind_helpers/utils.py | devind-team/devind-django-helpers | 5c64d46a12802bbe0b70e44aa9d19bf975511b6e | [
"MIT"
] | 4 | 2022-02-18T09:24:05.000Z | 2022-03-31T16:46:29.000Z | devind_helpers/utils.py | devind-team/devind-django-helpers | 5c64d46a12802bbe0b70e44aa9d19bf975511b6e | [
"MIT"
] | null | null | null | """Модуль со вспомогательными функциями."""
from argparse import ArgumentTypeError
from random import choice
from string import ascii_letters
from typing import Optional, Tuple, Union
from graphql_relay import from_global_id
def gid2int(gid: Union[str, int]) -> Optional[int]:
try:
return int(gid)
ex... | 27.051724 | 86 | 0.643722 |
from argparse import ArgumentTypeError
from random import choice
from string import ascii_letters
from typing import Optional, Tuple, Union
from graphql_relay import from_global_id
def gid2int(gid: Union[str, int]) -> Optional[int]:
try:
return int(gid)
except ValueError:
try:
re... | true | true |
f72f5d5830c20fa73cabbf8a7fe2538bbbde66c2 | 1,208 | py | Python | src/tests/base/__init__.py | abrock/pretix | cd9c048458afce1198276e5936bf583578855a4f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-06-23T07:44:54.000Z | 2021-06-23T07:44:54.000Z | src/tests/base/__init__.py | awg24/pretix | b1d67a48601838bac0d4e498cbe8bdcd16013d60 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/tests/base/__init__.py | awg24/pretix | b1d67a48601838bac0d4e498cbe8bdcd16013d60 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import os
import sys
import time
from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
# could use Chrome, Firefox, etc... here
BROWSER = os.environ.get('TEST_BROWSER', 'PhantomJS')
class BrowserTest(StaticLiveServerTestCase):
de... | 28.761905 | 74 | 0.653974 | import os
import sys
import time
from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
BROWSER = os.environ.get('TEST_BROWSER', 'PhantomJS')
class BrowserTest(StaticLiveServerTestCase):
def __init__(self, *args, **kwargs):
... | true | true |
f72f5da82bf29e795a9aadab84dc4c93b8d191f1 | 3,776 | py | Python | pyro/distributions/relaxed_straight_through.py | ruohoruotsi/pyro | b54a4b42b9474eb3ecee11505e45fde85b1cdc54 | [
"MIT"
] | null | null | null | pyro/distributions/relaxed_straight_through.py | ruohoruotsi/pyro | b54a4b42b9474eb3ecee11505e45fde85b1cdc54 | [
"MIT"
] | null | null | null | pyro/distributions/relaxed_straight_through.py | ruohoruotsi/pyro | b54a4b42b9474eb3ecee11505e45fde85b1cdc54 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
import torch
from pyro.distributions.torch import RelaxedOneHotCategorical, RelaxedBernoulli
from pyro.distributions.util import copy_docs_from
from torch.distributions.utils import clamp_probs
@copy_docs_from(RelaxedOneHotCategorical)
class RelaxedOn... | 37.386139 | 96 | 0.736229 | from __future__ import absolute_import, division, print_function
import torch
from pyro.distributions.torch import RelaxedOneHotCategorical, RelaxedBernoulli
from pyro.distributions.util import copy_docs_from
from torch.distributions.utils import clamp_probs
@copy_docs_from(RelaxedOneHotCategorical)
class RelaxedOn... | true | true |
f72f5f8cda52fd057ea9bad187ca38a2d6bf5f2a | 1,783 | py | Python | compsocsite/appauth/urls.py | ReedyChen/opra | 86ce88c7219d92e321cd9aa3d0bc2bf631e4b90f | [
"MIT"
] | 8 | 2017-03-07T19:46:51.000Z | 2021-06-01T01:41:37.000Z | compsocsite/appauth/urls.py | ReedyChen/opra | 86ce88c7219d92e321cd9aa3d0bc2bf631e4b90f | [
"MIT"
] | null | null | null | compsocsite/appauth/urls.py | ReedyChen/opra | 86ce88c7219d92e321cd9aa3d0bc2bf631e4b90f | [
"MIT"
] | 9 | 2016-06-09T03:36:20.000Z | 2019-09-11T20:56:23.000Z | from django.conf.urls import url
#import cas.middleware
from . import views
app_name = 'appauth'
urlpatterns = [
url(r'^register/$', views.register, name='register'),
url(r'^login/$', views.user_login, name='login'),
url(r'^login/forgetpassword/$', views.forgetPassword, name='forgetpassword'),
url(r'^... | 61.482759 | 106 | 0.693214 | from django.conf.urls import url
from . import views
app_name = 'appauth'
urlpatterns = [
url(r'^register/$', views.register, name='register'),
url(r'^login/$', views.user_login, name='login'),
url(r'^login/forgetpassword/$', views.forgetPassword, name='forgetpassword'),
url(r'^login/forgetpasswordvie... | true | true |
f72f5ff661ebbd7baa4fdc30f0fe55a852bc6baf | 1,660 | py | Python | pycondor/geodesic_test_proj.py | kant/pycondor | ee87854504e8f4023feda860d8a9ddbecc7a70da | [
"BSD-3-Clause"
] | 6 | 2015-04-17T08:25:30.000Z | 2020-04-11T23:58:16.000Z | pycondor/geodesic_test_proj.py | kant/pycondor | ee87854504e8f4023feda860d8a9ddbecc7a70da | [
"BSD-3-Clause"
] | 3 | 2015-12-22T07:40:02.000Z | 2019-01-21T15:07:00.000Z | pycondor/geodesic_test_proj.py | kant/pycondor | ee87854504e8f4023feda860d8a9ddbecc7a70da | [
"BSD-3-Clause"
] | 6 | 2015-11-13T18:55:22.000Z | 2020-03-12T19:32:56.000Z | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import click
import os
#import json
import pandas as pd
import numpy as np
import pyproj
import matplotlib.pyplot as plt
from geodesic import plot_geodesic
@click.command()
@click.argument('xls_filename')
@click.option('--outdir', default='', help="Output directory - d... | 26.349206 | 98 | 0.605422 |
import click
import os
import pandas as pd
import numpy as np
import pyproj
import matplotlib.pyplot as plt
from geodesic import plot_geodesic
@click.command()
@click.argument('xls_filename')
@click.option('--outdir', default='', help="Output directory - default is 'script_directory\out'")
def main(xls_filename,... | false | true |
f72f5ffdbac0e1ccb48e304d2117456cfe4a1190 | 1,709 | py | Python | app/core/migrations/0001_initial.py | rahulnegi20/recipie-api | 9e99d3c6803fe87cb64eae6980e9e0817f643f5f | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | rahulnegi20/recipie-api | 9e99d3c6803fe87cb64eae6980e9e0817f643f5f | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | rahulnegi20/recipie-api | 9e99d3c6803fe87cb64eae6980e9e0817f643f5f | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2021-04-08 16:02
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... | 50.264706 | 266 | 0.63897 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.Aut... | true | true |
f72f6072b1970e61514fd8c68fbcfd4ee3ad6383 | 479 | py | Python | data/scripts/templates/object/draft_schematic/space/weapon/missile/shared_countermeasure_decoy_launcher.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/draft_schematic/space/weapon/missile/shared_countermeasure_decoy_launcher.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/draft_schematic/space/weapon/missile/shared_countermeasure_decoy_launcher.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/space/weapon/missile/shared_countermeasure_decoy_launcher.i... | 28.176471 | 105 | 0.741127 |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/space/weapon/missile/shared_countermeasure_decoy_launcher.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
return result | true | true |
f72f6097ff6b8bf50e05a8eb8b55115b810bdf61 | 2,663 | py | Python | flash/__init__.py | ibraheemmmoosa/lightning-flash | c60fef81b27174543d7ad3a4d841faf71ad8536c | [
"Apache-2.0"
] | 2 | 2021-06-25T08:42:36.000Z | 2021-06-25T08:49:29.000Z | flash/__init__.py | edenlightning/lightning-flash | 841986aa0081bdeaf785d1ed4c48dd108fa69a78 | [
"Apache-2.0"
] | null | null | null | flash/__init__.py | edenlightning/lightning-flash | 841986aa0081bdeaf785d1ed4c48dd108fa69a78 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 43.655738 | 119 | 0.763049 | import os
__version__ = "0.1.1"
__author__ = "PyTorchLightning et al."
__author_email__ = "name@pytorchlightning.ai"
__license__ = 'Apache-2.0'
__copyright__ = f"Copyright (c) 2020-2021, f{__author__}."
__homepage__ = "https://github.com/PyTorchLightning/lightning-flash"
__docs__ = "Flash is a framework for fast proto... | true | true |
f72f61d6f01b861b890955c4432bbf116ba0dd95 | 85 | py | Python | torchio/transforms/augmentation/__init__.py | siahuat0727/torchio | fc33ea9bd21dc60ba6c5fed46ca96ef63cae2179 | [
"Apache-2.0"
] | 1,340 | 2019-12-03T20:53:17.000Z | 2022-03-30T08:47:54.000Z | torchio/transforms/augmentation/__init__.py | siahuat0727/torchio | fc33ea9bd21dc60ba6c5fed46ca96ef63cae2179 | [
"Apache-2.0"
] | 532 | 2019-12-06T10:37:55.000Z | 2022-03-29T10:14:34.000Z | torchio/transforms/augmentation/__init__.py | siahuat0727/torchio | fc33ea9bd21dc60ba6c5fed46ca96ef63cae2179 | [
"Apache-2.0"
] | 193 | 2019-12-05T10:21:13.000Z | 2022-03-15T22:44:26.000Z | from .random_transform import RandomTransform
__all__ = [
'RandomTransform',
]
| 12.142857 | 45 | 0.741176 | from .random_transform import RandomTransform
__all__ = [
'RandomTransform',
]
| true | true |
f72f61f695ce68f2683e7c2c27eca4c02c50be0a | 1,920 | py | Python | make-test.py | todorokit/tensorflow_cnn_image_sample | 5f8dee00eebcbada9e03de7742026b2a37963860 | [
"Apache-1.1"
] | null | null | null | make-test.py | todorokit/tensorflow_cnn_image_sample | 5f8dee00eebcbada9e03de7742026b2a37963860 | [
"Apache-1.1"
] | null | null | null | make-test.py | todorokit/tensorflow_cnn_image_sample | 5f8dee00eebcbada9e03de7742026b2a37963860 | [
"Apache-1.1"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
import random
sourceDir = '/data/deresute-face'
trFile = 'train.txt'
teFile = 'test.txt'
mapFile = 'config/classes.py'
if len(sys.argv) != 3:
print ("usage %s trainNum testNum" % (sys.argv[0]))
exit()
datanum = int(sys.argv[1])
testnum = int(sys.argv[2])
def lis... | 20.869565 | 57 | 0.563021 |
import os
import sys
import random
sourceDir = '/data/deresute-face'
trFile = 'train.txt'
teFile = 'test.txt'
mapFile = 'config/classes.py'
if len(sys.argv) != 3:
print ("usage %s trainNum testNum" % (sys.argv[0]))
exit()
datanum = int(sys.argv[1])
testnum = int(sys.argv[2])
def listClass(dir):
ret = [... | true | true |
f72f62ec9ae934fb7e5b8a0c424979616160c47e | 3,343 | py | Python | src/oci/devops/models/compute_instance_group_failure_policy_by_count.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/devops/models/compute_instance_group_failure_policy_by_count.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/devops/models/compute_instance_group_failure_policy_by_count.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 41.271605 | 245 | 0.718516 |
from .compute_instance_group_failure_policy import ComputeInstanceGroupFailurePolicy
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class ComputeInstanceGroupFailurePolicyByCount(Compu... | true | true |
f72f6465f3130c96ec06ef148837cd9b01ea7937 | 9,957 | py | Python | app/recipe/tests/test_recipe_api.py | catzzz/recipe-app-api | 4da3bcc40da44cf2afa36a7ccf149f2a5f713292 | [
"MIT"
] | null | null | null | app/recipe/tests/test_recipe_api.py | catzzz/recipe-app-api | 4da3bcc40da44cf2afa36a7ccf149f2a5f713292 | [
"MIT"
] | null | null | null | app/recipe/tests/test_recipe_api.py | catzzz/recipe-app-api | 4da3bcc40da44cf2afa36a7ccf149f2a5f713292 | [
"MIT"
] | null | null | null | import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from recipe.serializers import ... | 34.814685 | 78 | 0.645676 | import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from recipe.serializers import ... | true | true |
f72f65029479ff22dec38237529146bb2d013655 | 6,561 | py | Python | ltr/dataset/lasot.py | tsingqguo/ABA | c32edbbe5705b0332a08951b5ee436b5f58c2e70 | [
"MIT"
] | 12 | 2021-07-27T07:18:24.000Z | 2022-03-09T13:52:20.000Z | ltr/dataset/lasot.py | tsingqguo/ABA | c32edbbe5705b0332a08951b5ee436b5f58c2e70 | [
"MIT"
] | 2 | 2021-08-03T09:21:33.000Z | 2021-12-29T14:25:30.000Z | ltr/dataset/lasot.py | tsingqguo/ABA | c32edbbe5705b0332a08951b5ee436b5f58c2e70 | [
"MIT"
] | 3 | 2021-11-18T14:46:40.000Z | 2022-01-03T15:47:23.000Z | import os
import os.path
import torch
import numpy as np
import pandas
import csv
import random
from collections import OrderedDict
from .base_video_dataset import BaseVideoDataset
from ltr.data.image_loader import jpeg4py_loader
from ltr.admin.environment import env_settings
class Lasot(BaseVideoDataset):
""" La... | 38.822485 | 130 | 0.63405 | import os
import os.path
import torch
import numpy as np
import pandas
import csv
import random
from collections import OrderedDict
from .base_video_dataset import BaseVideoDataset
from ltr.data.image_loader import jpeg4py_loader
from ltr.admin.environment import env_settings
class Lasot(BaseVideoDataset):
def _... | true | true |
f72f653e32796b549710c1e842206983ea462fda | 30,603 | py | Python | model-optimizer/mo/middle/passes/fusing/decomposition_test.py | anton-potapov/openvino | 84119afe9a8c965e0a0cd920fff53aee67b05108 | [
"Apache-2.0"
] | 1 | 2020-06-21T09:51:42.000Z | 2020-06-21T09:51:42.000Z | model-optimizer/mo/middle/passes/fusing/decomposition_test.py | anton-potapov/openvino | 84119afe9a8c965e0a0cd920fff53aee67b05108 | [
"Apache-2.0"
] | 4 | 2021-04-01T08:29:48.000Z | 2021-08-30T16:12:52.000Z | model-optimizer/mo/middle/passes/fusing/decomposition_test.py | anton-potapov/openvino | 84119afe9a8c965e0a0cd920fff53aee67b05108 | [
"Apache-2.0"
] | 3 | 2021-03-09T08:27:29.000Z | 2021-04-07T04:58:54.000Z | """
Copyright (C) 2018-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 59.30814 | 119 | 0.424109 |
import unittest
import numpy as np
from mo.middle.passes.fusing.decomposition import convert_scale_shift_to_mul_add, convert_batch_norm
from mo.utils.ir_engine.compare_graphs import compare_graphs
from mo.utils.unittest.graph import build_graph
nodes_attributes = {
'placeholder_1': {'shape': None, 'type': 'Para... | true | true |
f72f6568dca744bd5665beedd6e8518fdef41379 | 417 | py | Python | shopping_mall_server/wsgi.py | ninemilli-song/shopping-mall-server | 140fbcba2afbab59eda6ca95da59a5ba6945beb4 | [
"MIT"
] | null | null | null | shopping_mall_server/wsgi.py | ninemilli-song/shopping-mall-server | 140fbcba2afbab59eda6ca95da59a5ba6945beb4 | [
"MIT"
] | 2 | 2019-02-12T02:06:53.000Z | 2019-02-12T04:10:10.000Z | shopping_mall_server/wsgi.py | ninemilli-song/shopping-mall-server | 140fbcba2afbab59eda6ca95da59a5ba6945beb4 | [
"MIT"
] | null | null | null | """
WSGI config for shopping_mall_server project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault(... | 24.529412 | 80 | 0.798561 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'shopping_mall_server.settings')
application = get_wsgi_application()
| true | true |
f72f66a98c1753c49fed08e7baf30b625045fe66 | 6,505 | py | Python | tests/conftest.py | omstrumpf/redis-py | a890532cbb93a85f6ae0bc23e014e6749d39b43b | [
"MIT"
] | null | null | null | tests/conftest.py | omstrumpf/redis-py | a890532cbb93a85f6ae0bc23e014e6749d39b43b | [
"MIT"
] | null | null | null | tests/conftest.py | omstrumpf/redis-py | a890532cbb93a85f6ae0bc23e014e6749d39b43b | [
"MIT"
] | null | null | null | import pytest
import redis
from mock import Mock
from distutils.version import StrictVersion
REDIS_INFO = {}
default_redis_host = "localhost"
default_redis_port = "6379"
default_cluster_master_host = "127.0.0.1"
default_cluster_master_port = "6379"
def pytest_addoption(parser):
parser.addoption('--redis-host',... | 35.353261 | 78 | 0.654112 | import pytest
import redis
from mock import Mock
from distutils.version import StrictVersion
REDIS_INFO = {}
default_redis_host = "localhost"
default_redis_port = "6379"
default_cluster_master_host = "127.0.0.1"
default_cluster_master_port = "6379"
def pytest_addoption(parser):
parser.addoption('--redis-host',... | true | true |
f72f66ea355573925b4529312b9cec90130e327d | 9,984 | py | Python | recipes/recipe_modules/bot_update/examples/full.py | xing133/webrtc_depot_tools | ddcba7ca3c7f0432aee6bd9740c21f785c32a982 | [
"BSD-3-Clause"
] | 1 | 2021-11-22T05:43:42.000Z | 2021-11-22T05:43:42.000Z | recipes/recipe_modules/bot_update/examples/full.py | xing133/webrtc_depot_tools | ddcba7ca3c7f0432aee6bd9740c21f785c32a982 | [
"BSD-3-Clause"
] | null | null | null | recipes/recipe_modules/bot_update/examples/full.py | xing133/webrtc_depot_tools | ddcba7ca3c7f0432aee6bd9740c21f785c32a982 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'bot_update',
'gclient',
'gerrit',
'tryserver',
'recipe_engine/buildbucket',
'recipe_engine/json',
'recipe_engine/path',
'recipe_eng... | 30.072289 | 80 | 0.610176 |
DEPS = [
'bot_update',
'gclient',
'gerrit',
'tryserver',
'recipe_engine/buildbucket',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/runtime',
]
from recipe_engine import types
from PB.go.chromium.org.luci.buildbucket.proto.build i... | true | true |
f72f6715be74f9e455639ec030a0fc6854fa6348 | 47,986 | py | Python | vistrails/db/versions/v0_5_0/persistence/xml/auto_gen.py | remram44/VisTrails-mybinder | ee7477b471920d738f3ac430932f01901b56ed44 | [
"BSD-3-Clause"
] | 83 | 2015-01-05T14:50:50.000Z | 2021-09-17T19:45:26.000Z | vistrails/db/versions/v0_5_0/persistence/xml/auto_gen.py | remram44/VisTrails-mybinder | ee7477b471920d738f3ac430932f01901b56ed44 | [
"BSD-3-Clause"
] | 254 | 2015-01-02T20:39:19.000Z | 2018-11-28T17:16:44.000Z | vistrails/db/versions/v0_5_0/persistence/xml/auto_gen.py | remram44/VisTrails-mybinder | ee7477b471920d738f3ac430932f01901b56ed44 | [
"BSD-3-Clause"
] | 40 | 2015-04-17T16:46:36.000Z | 2021-09-28T22:43:24.000Z | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | 37.784252 | 92 | 0.576501 | ## modification, are permitted provided that the following conditions are met:
##
## - Redistributions of source code must retain the above copyright notice,
## this list of conditions and the following disclaimer.
## - Redistributions in binary form must reproduce the above copyright
## notice, this list of co... | false | true |
f72f675f782fe8125b53198e49770a42ec655291 | 2,434 | py | Python | examples/test_chromedriver.py | tomejorge/SeleniumBase | e3e50bbd80594c52131b0d88ca3e2c2f7692e340 | [
"MIT"
] | 2,745 | 2016-07-20T09:13:15.000Z | 2022-03-29T15:07:31.000Z | examples/test_chromedriver.py | tomejorge/SeleniumBase | e3e50bbd80594c52131b0d88ca3e2c2f7692e340 | [
"MIT"
] | 384 | 2016-07-17T20:45:26.000Z | 2022-03-31T22:35:35.000Z | examples/test_chromedriver.py | tomejorge/SeleniumBase | e3e50bbd80594c52131b0d88ca3e2c2f7692e340 | [
"MIT"
] | 704 | 2016-07-17T20:47:04.000Z | 2022-03-31T04:32:35.000Z | """
This test is only for Chrome!
(Verify that your chromedriver is compatible with your version of Chrome.)
"""
import colorama
from seleniumbase import BaseCase
class ChromedriverTests(BaseCase):
def test_chromedriver_matches_chrome(self):
if self.browser != "chrome":
print("\n This test is... | 42.701754 | 77 | 0.601068 | import colorama
from seleniumbase import BaseCase
class ChromedriverTests(BaseCase):
def test_chromedriver_matches_chrome(self):
if self.browser != "chrome":
print("\n This test is only for Chrome!")
print(' (Run with: "--browser=chrome")')
self.skip("This test is onl... | true | true |
f72f6791764c1d39d3340e5dce5ad5a3a904b8e3 | 1,230 | py | Python | tflite-onnx/onnx_tflite/tflite/ArgMinOptions.py | jwj04ok/ONNX_Convertor | 067a17e16dfc8aa80e36f44c4523959daf7359f5 | [
"MIT"
] | 193 | 2017-12-20T16:46:20.000Z | 2022-03-29T07:40:54.000Z | tinyengine/tflite/ArgMinOptions.py | liuyy3364/mcunet | f53f9e20e8e912bdb111b4c32da75e71e9a59597 | [
"Apache-2.0"
] | 141 | 2017-12-21T08:00:20.000Z | 2021-06-15T14:53:03.000Z | tinyengine/tflite/ArgMinOptions.py | liuyy3364/mcunet | f53f9e20e8e912bdb111b4c32da75e71e9a59597 | [
"Apache-2.0"
] | 55 | 2017-12-22T18:40:13.000Z | 2022-01-17T05:43:51.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class ArgMinOptions(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsArgMinOptions(cls, buf, offset):
n = flatbuffers... | 33.243243 | 114 | 0.717073 |
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class ArgMinOptions(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsArgMinOptions(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = ArgMinOptions()
... | true | true |
f72f68b943a4b5db8edb14eb15f9a5472cbdde4a | 1,052 | py | Python | watchdog_kj_kultura/users/models.py | watchdogpolska/watchdog-kj-kultura | ea1a5c52ef2a174c012cc08eff5fdd7aa3b911b0 | [
"MIT"
] | null | null | null | watchdog_kj_kultura/users/models.py | watchdogpolska/watchdog-kj-kultura | ea1a5c52ef2a174c012cc08eff5fdd7aa3b911b0 | [
"MIT"
] | 138 | 2016-12-10T19:18:18.000Z | 2019-06-10T19:32:40.000Z | watchdog_kj_kultura/users/models.py | watchdogpolska/watchdog-kj-kultura | ea1a5c52ef2a174c012cc08eff5fdd7aa3b911b0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.contrib.auth.models import AbstractUser
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy... | 38.962963 | 100 | 0.664449 | from __future__ import unicode_literals, absolute_import
from django.contrib.auth.models import AbstractUser
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
@python_2_unicod... | true | true |
f72f69278791826313821144226481332bfd9cf5 | 14,156 | py | Python | pynger/fingerprint/FVC_utilities.py | DottD/pynger | 9a24b43a2170234e5059a54ed20329e036260b0a | [
"MIT"
] | 1 | 2021-11-10T16:37:28.000Z | 2021-11-10T16:37:28.000Z | pynger/fingerprint/FVC_utilities.py | DottD/pynger | 9a24b43a2170234e5059a54ed20329e036260b0a | [
"MIT"
] | null | null | null | pynger/fingerprint/FVC_utilities.py | DottD/pynger | 9a24b43a2170234e5059a54ed20329e036260b0a | [
"MIT"
] | null | null | null | import os
import re
import io
import numpy as np
import PIL.Image
import typing
from pynger.types import Image, Mask, Field
from pynger.fingerprint.tuning_lro import LROEstimator
from pynger.fingerprint.sampling import convert_to_full, subsample
from pynger.field.manipulation import polar2cart
from pynger.misc import r... | 42.383234 | 258 | 0.596355 | import os
import re
import io
import numpy as np
import PIL.Image
import typing
from pynger.types import Image, Mask, Field
from pynger.fingerprint.tuning_lro import LROEstimator
from pynger.fingerprint.sampling import convert_to_full, subsample
from pynger.field.manipulation import polar2cart
from pynger.misc import r... | true | true |
f72f69d7416486496c8233c0c189ee6defb0f939 | 834 | py | Python | sketches/automata_00/components.py | heerdyes/raspi-art | 2e38c1926b6a6f4c745e0629b193d9c3c15acc22 | [
"MIT"
] | 1 | 2021-02-02T12:36:07.000Z | 2021-02-02T12:36:07.000Z | sketches/automata_00/components.py | heerdyes/raspi-art | 2e38c1926b6a6f4c745e0629b193d9c3c15acc22 | [
"MIT"
] | null | null | null | sketches/automata_00/components.py | heerdyes/raspi-art | 2e38c1926b6a6f4c745e0629b193d9c3c15acc22 | [
"MIT"
] | null | null | null | class FSM:
def __init__(self,states,alphabet,transitionmatrix,currstate):
self.S=states
self.A=alphabet
self.TM=transitionmatrix
self.currstate=currstate
def accept(self,sym):
if sym not in self.A:
return
symi=self.A.index(sym)
if self.TM[... | 23.828571 | 85 | 0.551559 | class FSM:
def __init__(self,states,alphabet,transitionmatrix,currstate):
self.S=states
self.A=alphabet
self.TM=transitionmatrix
self.currstate=currstate
def accept(self,sym):
if sym not in self.A:
return
symi=self.A.index(sym)
if self.TM[... | true | true |
f72f6b94236d1a6cd8a9243530cbeedf5ab82dd6 | 763 | py | Python | yaml/anchors-and-aliases/yaml_same_ids.py | progala/ttl255.com | 100ae0e96ab7a9f72d0c18d985de2311a517878f | [
"MIT"
] | 32 | 2018-05-28T13:35:49.000Z | 2022-03-05T23:18:32.000Z | yaml/anchors-and-aliases/yaml_same_ids.py | progala/ttl255.com | 100ae0e96ab7a9f72d0c18d985de2311a517878f | [
"MIT"
] | 1 | 2021-09-23T23:32:50.000Z | 2021-09-23T23:32:50.000Z | yaml/anchors-and-aliases/yaml_same_ids.py | progala/ttl255.com | 100ae0e96ab7a9f72d0c18d985de2311a517878f | [
"MIT"
] | 18 | 2019-02-19T22:36:45.000Z | 2022-02-12T19:13:35.000Z | # yaml_same_ids.py
import yaml
interfaces = dict(
Ethernet1=dict(description="Uplink to core-1", speed=1000, mtu=9000),
Ethernet2=dict(description="Uplink to core-2", speed=1000, mtu=9000),
)
prop_vals = ["pim", "ptp", "lldp"]
interfaces["Ethernet1"]["properties"] = prop_vals
interfaces["Ethernet2"]["proper... | 28.259259 | 83 | 0.720839 | import yaml
interfaces = dict(
Ethernet1=dict(description="Uplink to core-1", speed=1000, mtu=9000),
Ethernet2=dict(description="Uplink to core-2", speed=1000, mtu=9000),
)
prop_vals = ["pim", "ptp", "lldp"]
interfaces["Ethernet1"]["properties"] = prop_vals
interfaces["Ethernet2"]["properties"] = prop_vals
... | true | true |
f72f6d12c31fc8108305490ba1c038179074925b | 1,624 | py | Python | leet_code_array/mid_questions/3sum_cloest.py | IvanFan/leetcode-python | 72a12a107681cc5f09f1f88537c5b0741f0818a4 | [
"MIT"
] | null | null | null | leet_code_array/mid_questions/3sum_cloest.py | IvanFan/leetcode-python | 72a12a107681cc5f09f1f88537c5b0741f0818a4 | [
"MIT"
] | null | null | null | leet_code_array/mid_questions/3sum_cloest.py | IvanFan/leetcode-python | 72a12a107681cc5f09f1f88537c5b0741f0818a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class Solution:
def threeSumClosest(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
cand = 0
mindis = 9999
nl = len(nums)
if nl == 3:
return sum(nums)
... | 32.48 | 58 | 0.404557 | class Solution:
def threeSumClosest(self, nums, target):
cand = 0
mindis = 9999
nl = len(nums)
if nl == 3:
return sum(nums)
nums.sort()
for x in range(nl-2):
print('x:',x)
l = x+1
r = nl -1
curmax = nums[x] +... | true | true |
f72f6ddb7ac453475965a5a9f8b29db1c31fc185 | 3,126 | py | Python | keyboardRunCar.py | Adhunikr13/FORCAS | 1569a09f146df525b98caa631cb2c806346ba16b | [
"CC0-1.0",
"MIT"
] | null | null | null | keyboardRunCar.py | Adhunikr13/FORCAS | 1569a09f146df525b98caa631cb2c806346ba16b | [
"CC0-1.0",
"MIT"
] | null | null | null | keyboardRunCar.py | Adhunikr13/FORCAS | 1569a09f146df525b98caa631cb2c806346ba16b | [
"CC0-1.0",
"MIT"
] | null | null | null | import time
import RPi.GPIO as GPIO
import sys
from pynput import keyboard
import csv
##from termios import tcflush, TCIOFLUSH, TCIFLUSH
from multiprocessing import Process
from datetime import datetime
GPIO.cleanup()
Forward = 17
Backward = 27
Left = 23
Right = 24
sleeptime = 0.25
speed = 0.5
mode=GPIO.getmode()
G... | 25.622951 | 80 | 0.546065 | import time
import RPi.GPIO as GPIO
import sys
from pynput import keyboard
import csv
from multiprocessing import Process
from datetime import datetime
GPIO.cleanup()
Forward = 17
Backward = 27
Left = 23
Right = 24
sleeptime = 0.25
speed = 0.5
mode=GPIO.getmode()
GPIO.setmode(GPIO.BCM)
GPIO.setup(Forward, GPIO.OUT)... | true | true |
f72f6e019ee2fd66663eb569edbe38804ab04fd3 | 575 | py | Python | submissions/tenka1-2012-qualC/i.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 1 | 2021-05-10T01:16:28.000Z | 2021-05-10T01:16:28.000Z | submissions/tenka1-2012-qualC/i.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 3 | 2021-05-11T06:14:15.000Z | 2021-06-19T08:18:36.000Z | submissions/tenka1-2012-qualC/i.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | null | null | null | import sys
import math
input = sys.stdin.readline
def eratosthenes(limit):
if limit == 1:
return []
A = [i for i in range(2, limit + 1)]
P = []
for i in range(limit):
prime = min(A)
if prime > math.sqrt(limit):
break
P.append(prime)
for j in range... | 16.428571 | 40 | 0.464348 | import sys
import math
input = sys.stdin.readline
def eratosthenes(limit):
if limit == 1:
return []
A = [i for i in range(2, limit + 1)]
P = []
for i in range(limit):
prime = min(A)
if prime > math.sqrt(limit):
break
P.append(prime)
for j in range... | true | true |
f72f6ffa418102f76a422d0fa5ffd49e955a5898 | 6,071 | py | Python | SSWs.py | rhwhite/rhwhitepackages3 | 91d5677ea57d7cc9a3643708cd8c82a74fb6188d | [
"MIT"
] | null | null | null | SSWs.py | rhwhite/rhwhitepackages3 | 91d5677ea57d7cc9a3643708cd8c82a74fb6188d | [
"MIT"
] | null | null | null | SSWs.py | rhwhite/rhwhitepackages3 | 91d5677ea57d7cc9a3643708cd8c82a74fb6188d | [
"MIT"
] | null | null | null | # Module to search for and get data on SSWs
# Using the definition of Charlton and Polvani (2007):
# Author rachel.white@cantab.net
# Created July 2017
import numpy as np
import xarray as xr
import math
import sys
def adddays(U,itime,ndays):
# Find ndays consecutive days with easterlies
numcons = 0
toru... | 32.465241 | 90 | 0.530555 |
import numpy as np
import xarray as xr
import math
import sys
def adddays(U,itime,ndays):
numcons = 0
torun = True
while itime < len(U.time):
if U[itime] > 0:
numcons += 1
else:
numcons = 0
if numcons >= ndays:
return(itime,numcons,False)
... | true | true |
f72f7245256e6106b683dd052df2b3c12248710d | 3,127 | py | Python | billy/web/api/urls.py | backwardn/billy | 07ac788d25a6c79d03dd0e3d55459bbb55e22439 | [
"BSD-3-Clause"
] | 33 | 2016-11-05T07:25:48.000Z | 2022-01-31T03:40:43.000Z | billy/web/api/urls.py | backwardn/billy | 07ac788d25a6c79d03dd0e3d55459bbb55e22439 | [
"BSD-3-Clause"
] | 16 | 2015-02-05T21:25:58.000Z | 2015-09-18T20:27:06.000Z | billy/web/api/urls.py | backwardn/billy | 07ac788d25a6c79d03dd0e3d55459bbb55e22439 | [
"BSD-3-Clause"
] | 22 | 2015-03-23T07:13:20.000Z | 2016-06-10T04:41:06.000Z | import datetime
from django.conf import settings
from django.conf.urls import url
from django.http import HttpResponse
import piston.resource
from piston.emitters import Emitter
from billy.web.api import handlers
from billy.web.api.emitters import BillyJSONEmitter
class CORSResource(piston.resource.Resource):
d... | 39.582278 | 77 | 0.657179 | import datetime
from django.conf import settings
from django.conf.urls import url
from django.http import HttpResponse
import piston.resource
from piston.emitters import Emitter
from billy.web.api import handlers
from billy.web.api.emitters import BillyJSONEmitter
class CORSResource(piston.resource.Resource):
d... | true | true |
f72f74c949c35b437d4684648a5f2909b9268826 | 2,083 | py | Python | generated/nifake/setup.py | kurtp-ni/nimi-python | 4f0bccce67a69ca9f46a8ab9b07dc26ca0049729 | [
"MIT"
] | 88 | 2017-08-03T18:07:27.000Z | 2022-01-28T13:55:06.000Z | generated/nifake/setup.py | kurtp-ni/nimi-python | 4f0bccce67a69ca9f46a8ab9b07dc26ca0049729 | [
"MIT"
] | 1,310 | 2017-07-11T18:42:44.000Z | 2022-03-28T21:03:57.000Z | generated/nifake/setup.py | kurtp-ni/nimi-python | 4f0bccce67a69ca9f46a8ab9b07dc26ca0049729 | [
"MIT"
] | 70 | 2017-07-25T14:52:53.000Z | 2022-03-31T14:14:23.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file was generated
from setuptools.command.test import test as test_command
from setuptools import setup
class PyTest(test_command):
def finalize_options(self):
test_command.finalize_options(self)
self.test_args = []
self.test_suite = True... | 28.534247 | 70 | 0.62698 |
from setuptools.command.test import test as test_command
from setuptools import setup
class PyTest(test_command):
def finalize_options(self):
test_command.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
pytest.main... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.