hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e30fe439a620f6aef4d8e2cc25ad9a7d64cdb376 | 1,805 | py | Python | cached_contingency/KeyValueStore.py | MrTomRod/cached-contingency | 951431218c47ed246ba1fb655b581a99a5cfde00 | [
"MIT"
] | null | null | null | cached_contingency/KeyValueStore.py | MrTomRod/cached-contingency | 951431218c47ed246ba1fb655b581a99a5cfde00 | [
"MIT"
] | null | null | null | cached_contingency/KeyValueStore.py | MrTomRod/cached-contingency | 951431218c47ed246ba1fb655b581a99a5cfde00 | [
"MIT"
] | null | null | null | import os
import logging
import sqlite3
from typing import Optional
import pandas as pd
class KeyValueStore:
table_name: str
def __init__(self, table_name, db_path: str = None):
self.table_name = table_name
if db_path is None:
if 'KEY_VALUE_STORE_DB' in os.environ:
... | 28.650794 | 112 | 0.587812 |
bff9f2de962a40707f74ad0f9200d217ab4b4d8f | 5,690 | py | Python | regionmask/tests/test_utils.py | pablosebastiasaez/regionmask | c7d797df8b2c3020bc7d045e7fea1487f75dd28b | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | regionmask/tests/test_utils.py | pablosebastiasaez/regionmask | c7d797df8b2c3020bc7d045e7fea1487f75dd28b | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | regionmask/tests/test_utils.py | pablosebastiasaez/regionmask | c7d797df8b2c3020bc7d045e7fea1487f75dd28b | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | import numpy as np
import pytest
from regionmask.core.utils import (
_create_dict_of_numbered_string,
_equally_spaced_on_split_lon,
_find_splitpoint,
_is_180,
_is_numeric,
_maybe_to_dict,
_sanitize_names_abbrevs,
create_lon_lat_dataarray_from_bounds,
equally_spaced,
)
@pytest.mark... | 28.592965 | 87 | 0.641828 |
3d1f6a69380120f6387c09eb2734310469ec6cf5 | 1,037 | py | Python | nitro/resource/base/base_responses.py | HanseMerkur/nitro-python | d03eb11f492a35a2a8b2a140322fbce22d25a8f7 | [
"Apache-2.0"
] | 2 | 2020-08-24T18:04:22.000Z | 2020-08-24T18:04:47.000Z | nitro/resource/base/base_responses.py | HanseMerkur/nitro-python | d03eb11f492a35a2a8b2a140322fbce22d25a8f7 | [
"Apache-2.0"
] | null | null | null | nitro/resource/base/base_responses.py | HanseMerkur/nitro-python | d03eb11f492a35a2a8b2a140322fbce22d25a8f7 | [
"Apache-2.0"
] | null | null | null |
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | 37.035714 | 100 | 0.698168 |
e376fc8183ea9f1da318c52d637d9ae1e3ac1689 | 2,651 | py | Python | src/common/init_argparse.py | xiaoquqi/gitlab-sync | 6b438c2a452ac7903ef331f7770d8d6dcbb0bba3 | [
"Apache-2.0"
] | 1 | 2022-03-15T07:16:53.000Z | 2022-03-15T07:16:53.000Z | src/common/init_argparse.py | bagechashu/gitlab-sync | f37ff03341dfa21dcc6492979f5b4b784baa552d | [
"Apache-2.0"
] | null | null | null | src/common/init_argparse.py | bagechashu/gitlab-sync | f37ff03341dfa21dcc6492979f5b4b784baa552d | [
"Apache-2.0"
] | 1 | 2022-03-15T07:16:44.000Z | 2022-03-15T07:16:44.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Common modules for parse script arguments"""
import argparse
import logging
import sys
def parse_sys_args(argv):
"""Parses commaond-line arguments"""
parser = argparse.ArgumentParser(
description="Gitlab backup tool in group level")
parser.add_arg... | 40.784615 | 73 | 0.596756 |
f8a65a5633d5a49888e9831960b058a9d6b73163 | 2,269 | py | Python | src/sqlfluff/rules/L027.py | fbb-oc/sqlfluff | f50e72b748dcf700483d0e937aa2abcfb0a56e9e | [
"MIT"
] | 1 | 2022-03-03T02:29:11.000Z | 2022-03-03T02:29:11.000Z | src/sqlfluff/rules/L027.py | clairetaylor352/sqlfluff | 62900332228db323da323ce20df0c5e17ba9fcbf | [
"MIT"
] | 1 | 2021-12-08T18:40:19.000Z | 2021-12-08T18:40:19.000Z | src/sqlfluff/rules/L027.py | derickl/sqlfluff | ea2341ffa5325757acfa02cc9f7a07ac78b7a6c8 | [
"MIT"
] | null | null | null | """Implementation of Rule L027."""
from sqlfluff.core.rules.base import LintResult
from sqlfluff.rules.L020 import Rule_L020
class Rule_L027(Rule_L020):
"""References should be qualified if select has more than one referenced table/view.
.. note::
Except if they're present in a ``USING`` clause.
... | 29.467532 | 88 | 0.552226 |
4e2bd4da13bca4bdfd1452b68ebf14ab11d5eb84 | 1,744 | py | Python | trainer_mask.py | salmanali88/caffe | fe8da0cbdf2a391c84e841c0623ac55cd8228794 | [
"BSD-2-Clause"
] | 3 | 2016-09-20T07:13:45.000Z | 2018-11-16T08:01:36.000Z | trainer_mask.py | salmanali88/caffe | fe8da0cbdf2a391c84e841c0623ac55cd8228794 | [
"BSD-2-Clause"
] | null | null | null | trainer_mask.py | salmanali88/caffe | fe8da0cbdf2a391c84e841c0623ac55cd8228794 | [
"BSD-2-Clause"
] | 12 | 2016-01-29T03:49:55.000Z | 2020-04-20T02:53:08.000Z | import numpy as np
import matplotlib.pyplot as plt
import caffe
from pylab import *
import vis_utils as vu
def data_unit(net, file_name):
n, c, h, w = net.blobs['data'].data.shape
plt.subplot(131)
plt.title('Original Image')
plt.axis('off')
vu.vis_square(net.blobs['data'].data.transpose(0, 2, 3, 1... | 26.830769 | 84 | 0.662844 |
983f61214ed5fbed634d51133a18c9ddf01e9950 | 5,275 | py | Python | cliffs/command.py | michalwa/py-cliffs | aaf089d1b0e05abb15e58bca7670c2632f680ae3 | [
"MIT"
] | 1 | 2020-05-28T19:52:35.000Z | 2020-05-28T19:52:35.000Z | cliffs/command.py | michalwa/py-clifford | aaf089d1b0e05abb15e58bca7670c2632f680ae3 | [
"MIT"
] | 1 | 2021-02-18T20:29:34.000Z | 2021-02-18T20:30:55.000Z | cliffs/command.py | michalwa/py-cliffs | aaf089d1b0e05abb15e58bca7670c2632f680ae3 | [
"MIT"
] | 1 | 2020-06-20T21:05:54.000Z | 2020-06-20T21:05:54.000Z | from typing import Optional, Callable, Iterable
from inspect import signature
from .utils import instance_or_kwargs
from .syntax_tree import Node
from .call_lexer import CallLexer
from .call_match import *
from .call_matcher import CallMatcher
import textwrap
class TooManyArguments(CallMatchFail):
pass
class Co... | 35.402685 | 113 | 0.576114 |
75e0666dbef14852931a8bd0701cf4670c84ac6d | 3,383 | py | Python | train.py | Mrrrat/asr_project_template | 50d264684d90bc45c59f3e9be5766fabaf090d25 | [
"MIT"
] | null | null | null | train.py | Mrrrat/asr_project_template | 50d264684d90bc45c59f3e9be5766fabaf090d25 | [
"MIT"
] | null | null | null | train.py | Mrrrat/asr_project_template | 50d264684d90bc45c59f3e9be5766fabaf090d25 | [
"MIT"
] | null | null | null | import argparse
import collections
import warnings
import numpy as np
import torch
import hw_asr.loss as module_loss
import hw_asr.metric as module_metric
import hw_asr.model as module_arch
from hw_asr.datasets.utils import get_dataloaders
from hw_asr.text_encoder.ctc_char_text_encoder import CTCCharTextEncoder
from ... | 30.477477 | 114 | 0.683713 |
df44f367025eae5ae6945328695608f1d17ff1b7 | 709 | py | Python | util/ioutil.py | toastisme/dials | 6bc8ababc33bfe334513677f8adb65c0e90003f3 | [
"BSD-3-Clause"
] | 58 | 2015-10-15T09:28:20.000Z | 2022-03-28T20:09:38.000Z | util/ioutil.py | toastisme/dials | 6bc8ababc33bfe334513677f8adb65c0e90003f3 | [
"BSD-3-Clause"
] | 1,741 | 2015-11-24T08:17:02.000Z | 2022-03-31T15:46:42.000Z | util/ioutil.py | toastisme/dials | 6bc8ababc33bfe334513677f8adb65c0e90003f3 | [
"BSD-3-Clause"
] | 45 | 2015-10-14T13:44:16.000Z | 2022-03-22T14:45:56.000Z | def get_inverse_ub_matrix_from_xparm(handle):
"""Get the inverse_ub_matrix from an xparm file handle
Params:
handle The file handle
Returns:
The inverse_ub_matrix
"""
from scitbx import matrix
return matrix.sqr(
handle.unit_cell_a_axis + handle.unit_cell_b_axis + handl... | 22.870968 | 83 | 0.691114 |
ea25d42c186c5fcb781a8d4dc9c94dab71e99096 | 5,714 | py | Python | MessagePassing/GCN.py | heming-zhang/PyTorch-Geometric-Study | 06d5217210623c8d472467949c1b74e287558e8c | [
"Apache-2.0"
] | null | null | null | MessagePassing/GCN.py | heming-zhang/PyTorch-Geometric-Study | 06d5217210623c8d472467949c1b74e287558e8c | [
"Apache-2.0"
] | null | null | null | MessagePassing/GCN.py | heming-zhang/PyTorch-Geometric-Study | 06d5217210623c8d472467949c1b74e287558e8c | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn import MessagePassing
from torch_geometric.utils import add_self_loops, degree
from torch_geometric.nn.inits import zeros
class GCNConv(MessagePassing):
def __init__(self, in_channels, out_channels):
super(GCNConv, ... | 28.009804 | 120 | 0.621106 |
ed00d4fec62885eec5625766f456ec56d8cc2b28 | 2,815 | py | Python | tests/test_backtranslation_dataset.py | beichao1314/fairseq | b1521f962e4ca670311c0cd0c8b1dadf310cb242 | [
"BSD-3-Clause"
] | 77 | 2019-04-29T01:56:04.000Z | 2022-03-19T08:05:55.000Z | tests/test_backtranslation_dataset.py | beichao1314/fairseq | b1521f962e4ca670311c0cd0c8b1dadf310cb242 | [
"BSD-3-Clause"
] | 7 | 2019-04-24T09:07:06.000Z | 2022-03-28T21:58:04.000Z | tests/test_backtranslation_dataset.py | beichao1314/fairseq | b1521f962e4ca670311c0cd0c8b1dadf310cb242 | [
"BSD-3-Clause"
] | 22 | 2019-04-28T04:39:41.000Z | 2022-03-19T03:13:16.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import unittest
import tests.util... | 37.039474 | 90 | 0.687034 |
6a38b38210b27fb24862406255d78613651af0c7 | 31,910 | py | Python | python/istio_api/mesh/v1alpha1/config_pb2.py | lei-tang/api | aa2c2a84418c5e4c5ac0719be542c1750ce41cc5 | [
"Apache-2.0"
] | null | null | null | python/istio_api/mesh/v1alpha1/config_pb2.py | lei-tang/api | aa2c2a84418c5e4c5ac0719be542c1750ce41cc5 | [
"Apache-2.0"
] | null | null | null | python/istio_api/mesh/v1alpha1/config_pb2.py | lei-tang/api | aa2c2a84418c5e4c5ac0719be542c1750ce41cc5 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mesh/v1alpha1/config.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import ... | 46.652047 | 3,662 | 0.753682 |
329e284086b62a6e1a77413ad523328211ccc0a1 | 602 | py | Python | spaces/migrations/0003_model_permissions.py | jgillick/Spaces | 96247701d530a017f10a0bd0ac6cf241d621be11 | [
"MIT"
] | 1 | 2018-08-12T23:43:45.000Z | 2018-08-12T23:43:45.000Z | spaces/migrations/0003_model_permissions.py | jgillick/Spaces | 96247701d530a017f10a0bd0ac6cf241d621be11 | [
"MIT"
] | 3 | 2016-01-13T10:12:51.000Z | 2016-01-13T10:13:15.000Z | spaces/migrations/0003_model_permissions.py | jgillick/Spaces | 96247701d530a017f10a0bd0ac6cf241d621be11 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-10 08:15
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('spaces', '0002_populate_default_spaces'),
]
operations = [
migrations.AlterModelOption... | 25.083333 | 81 | 0.596346 |
894a455bf05a7148ad722cda4e86f040255cdfbe | 3,892 | py | Python | 2_Clasification/exo2-naive.py | Focom/NLPWork2 | b83cd114b71f5be9d18a322197e4ac4fd9b094ba | [
"MIT"
] | null | null | null | 2_Clasification/exo2-naive.py | Focom/NLPWork2 | b83cd114b71f5be9d18a322197e4ac4fd9b094ba | [
"MIT"
] | null | null | null | 2_Clasification/exo2-naive.py | Focom/NLPWork2 | b83cd114b71f5be9d18a322197e4ac4fd9b094ba | [
"MIT"
] | null | null | null | import exo2, pandas, glob
from sklearn.naive_bayes import MultinomialNB as mod
from sklearn.ensemble import RandomForestClassifier as mod2
from sklearn.feature_extraction.text import CountVectorizer
#Choix du classifieurn i=1 NaivesBayes sinon RandomForest
def choiceClassifier(i):
if(i==1):
classifier=m... | 24.632911 | 130 | 0.676259 |
151877c6fea1c61308f6fbfbe50797d8f163e587 | 460 | py | Python | fluent_python/object/func_para_reference.py | helloTC/LearnPython | bd5fc977c800f3dc2d239b8cb7ad7e6e1b42fce8 | [
"MIT"
] | null | null | null | fluent_python/object/func_para_reference.py | helloTC/LearnPython | bd5fc977c800f3dc2d239b8cb7ad7e6e1b42fce8 | [
"MIT"
] | null | null | null | fluent_python/object/func_para_reference.py | helloTC/LearnPython | bd5fc977c800f3dc2d239b8cb7ad7e6e1b42fce8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
def f(a, b):
a += b
return a
if __name__ == "__main__":
x1 = 1
x2 = 2
print("integer number: {}".format(f(x1, x2)))
print("x1 = {0}, x2 = {1}".format(x1, x2))
x3 = [1,2]
x4 = [3,4]
print("list: {}".format(f(x3, x4)))
print("x3 = {0}, x4 = {... | 19.166667 | 49 | 0.463043 |
0a4a9fd3b088da30213e335da832666fbc1950a3 | 601 | py | Python | boucanpy/cli/alembic/alembic_current.py | bbhunter/boucanpy | 7d2fb105e7b1e90653a511534fb878bb62d02f17 | [
"MIT"
] | 34 | 2019-11-16T17:22:15.000Z | 2022-02-11T23:12:46.000Z | boucanpy/cli/alembic/alembic_current.py | bbhunter/boucanpy | 7d2fb105e7b1e90653a511534fb878bb62d02f17 | [
"MIT"
] | 1 | 2021-02-09T09:34:55.000Z | 2021-02-10T21:46:20.000Z | boucanpy/cli/alembic/alembic_current.py | bbhunter/boucanpy | 7d2fb105e7b1e90653a511534fb878bb62d02f17 | [
"MIT"
] | 9 | 2019-11-18T22:18:07.000Z | 2021-02-08T13:23:51.000Z | from os.path import join
from boucanpy.core.utils import db_dir
from boucanpy.db.session import session, db_register
from boucanpy.db.utils import make_db_url
from boucanpy.db.migrate.current import current
from boucanpy.cli.base import BaseCommand
class AlembicCurrent(BaseCommand):
name = "alembic-current"
a... | 27.318182 | 52 | 0.728785 |
210217c0aef4046ae47dcd7821eb79b6266489ee | 4,546 | py | Python | vfoot/runner.py | filipecn/vfoot | 3059f5bb471b6bdf92a18a7cdb6b33a2c8852046 | [
"MIT"
] | null | null | null | vfoot/runner.py | filipecn/vfoot | 3059f5bb471b6bdf92a18a7cdb6b33a2c8852046 | [
"MIT"
] | null | null | null | vfoot/runner.py | filipecn/vfoot | 3059f5bb471b6bdf92a18a7cdb6b33a2c8852046 | [
"MIT"
] | null | null | null | import graphics
import imgui
from game.game import Game, GameState
from graphics.division_round_screen import DivisionRoundScreen
from graphics.manager_screen import ManagerScreen
game = None
division_round_screen = None
manager_screens = []
current_manager_screen = 0
class ChooseCountriesScreen:
def __init__(se... | 30.306667 | 69 | 0.573471 |
f75470306c4f47a4c9f93d16757d465a2fa4d4bb | 24,470 | py | Python | depend/zcash/qa/rpc-tests/fundrawtransaction.py | ZcashFoundation/zcashconsensus | c9fbc441efd78593ba6a9828be45baf2d6469757 | [
"Apache-2.0"
] | null | null | null | depend/zcash/qa/rpc-tests/fundrawtransaction.py | ZcashFoundation/zcashconsensus | c9fbc441efd78593ba6a9828be45baf2d6469757 | [
"Apache-2.0"
] | 1 | 2020-07-17T14:09:32.000Z | 2020-07-17T14:09:32.000Z | depend/zcash/qa/rpc-tests/fundrawtransaction.py | ZcashFoundation/zcashconsensus | c9fbc441efd78593ba6a9828be45baf2d6469757 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSO... | 40.313015 | 223 | 0.555497 |
c56b66c960cb59012ea4751d6bf0e410cf392a91 | 8,777 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_images.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_images.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_images.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# (c) 2016, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 35.391129 | 115 | 0.649653 |
af20eb27938d8aea2c9c8159b9a8598d08f22bb7 | 3,380 | py | Python | tests/test_scaffold.py | abhishak3/ploomber | 6041bcd381b7fd9a7525f94edd0ae1b03b14bb8d | [
"Apache-2.0"
] | 2,141 | 2020-02-14T02:34:34.000Z | 2022-03-31T22:43:20.000Z | tests/test_scaffold.py | abhishak3/ploomber | 6041bcd381b7fd9a7525f94edd0ae1b03b14bb8d | [
"Apache-2.0"
] | 660 | 2020-02-06T16:15:57.000Z | 2022-03-31T22:55:01.000Z | tests/test_scaffold.py | abhishak3/ploomber | 6041bcd381b7fd9a7525f94edd0ae1b03b14bb8d | [
"Apache-2.0"
] | 122 | 2020-02-14T18:53:05.000Z | 2022-03-27T22:33:24.000Z | from pathlib import Path
import ast
import pytest
from ploomber import tasks
from ploomber import scaffold
@pytest.mark.parametrize('name', ['task.py', 'task.ipynb'])
@pytest.mark.parametrize('extract_upstream', [False, True])
@pytest.mark.parametrize('extract_product', [False, True])
def test_renders_valid_script(... | 30.178571 | 75 | 0.668343 |
cf1e09d73f67a4c125a5ad0c8d9129f2639bda89 | 9,640 | py | Python | aea/cli/scaffold.py | marcofavorito/agents-aea | e520f2f5d076a193514e194d94aa76c6423ac5bc | [
"Apache-2.0"
] | null | null | null | aea/cli/scaffold.py | marcofavorito/agents-aea | e520f2f5d076a193514e194d94aa76c6423ac5bc | [
"Apache-2.0"
] | null | null | null | aea/cli/scaffold.py | marcofavorito/agents-aea | e520f2f5d076a193514e194d94aa76c6423ac5bc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... | 34.551971 | 130 | 0.67832 |
da17db7c0809ec0610e6a0ca4a4af84bc300bfa6 | 1,990 | py | Python | rooms-unified/main.py | tranhoangkhuongvn/my_unified_mahrl | d9cba06427a17a7f5feb4420412c6d8195bb0e1c | [
"MIT"
] | null | null | null | rooms-unified/main.py | tranhoangkhuongvn/my_unified_mahrl | d9cba06427a17a7f5feb4420412c6d8195bb0e1c | [
"MIT"
] | null | null | null | rooms-unified/main.py | tranhoangkhuongvn/my_unified_mahrl | d9cba06427a17a7f5feb4420412c6d8195bb0e1c | [
"MIT"
] | null | null | null | import time
start_time = time.time()
from ExperienceReplayMemory import ExperienceReplayMemory
experience_memory = ExperienceReplayMemory(memory_size=10000)
from SubgoalDiscovery import SubgoalDiscovery
subgoal_discovery = SubgoalDiscovery(n_clusters=8,experience_memory=experience_memory)
import gym
from gym_rooms.e... | 31.09375 | 105 | 0.819095 |
c2cc434374970c86de0f8b3a55036da2ec975230 | 13,656 | py | Python | python/ray/tests/test_runtime_env_packaging.py | takeshi-yoshimura/ray | cc577c10edbfc8b4248e2776947e1e0d5dbf4585 | [
"Apache-2.0"
] | 1 | 2022-03-14T04:24:17.000Z | 2022-03-14T04:24:17.000Z | python/ray/tests/test_runtime_env_packaging.py | takeshi-yoshimura/ray | cc577c10edbfc8b4248e2776947e1e0d5dbf4585 | [
"Apache-2.0"
] | 21 | 2022-01-30T15:49:41.000Z | 2022-03-19T07:14:33.000Z | python/ray/tests/test_runtime_env_packaging.py | takeshi-yoshimura/ray | cc577c10edbfc8b4248e2776947e1e0d5dbf4585 | [
"Apache-2.0"
] | null | null | null | import os
from pathlib import Path
import random
from shutil import copytree, rmtree, make_archive
import string
import sys
import tempfile
from filecmp import dircmp
import uuid
import pytest
from ray.ray_constants import KV_NAMESPACE_PACKAGE
from ray.experimental.internal_kv import _internal_kv_del, _internal_kv_exi... | 36.416 | 88 | 0.634593 |
662cd7c6d6c9e30a30f7bfed2197e882005ab070 | 62,492 | py | Python | tests/mail/tests.py | qedsoftware/django | b5fc192b99ce92a7ccad08cca7b59b1a4e7ca230 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/mail/tests.py | qedsoftware/django | b5fc192b99ce92a7ccad08cca7b59b1a4e7ca230 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/mail/tests.py | qedsoftware/django | b5fc192b99ce92a7ccad08cca7b59b1a4e7ca230 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import asyncore
import base64
import mimetypes
import os
import shutil
import smtpd
import socket
import sys
import tempfile
import threading
from email.header import Header
from email.mime.text import MIMEText
from smtplib import SMTP, SMTPAuthentication... | 41.828648 | 119 | 0.626544 |
3b8163cbba806c1cf04ec6c18d98c40cd6001c65 | 14,010 | py | Python | google/cloud/aiplatform_v1beta1/services/migration_service/transports/grpc.py | connor-mccarthy/python-aiplatform | 184f7f327aa00b4c8d1acc24dcb1c4c4be6c5bcc | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/migration_service/transports/grpc.py | connor-mccarthy/python-aiplatform | 184f7f327aa00b4c8d1acc24dcb1c4c4be6c5bcc | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/migration_service/transports/grpc.py | connor-mccarthy/python-aiplatform | 184f7f327aa00b4c8d1acc24dcb1c4c4be6c5bcc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 44.47619 | 102 | 0.645967 |
199df702c3bf952ad21511a7c1775b148fc538f8 | 1,041 | py | Python | salt/pillar/cmd_yaml.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 12 | 2015-01-21T00:18:25.000Z | 2021-07-11T07:35:26.000Z | salt/pillar/cmd_yaml.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 86 | 2017-01-27T11:54:46.000Z | 2020-05-20T06:25:26.000Z | salt/pillar/cmd_yaml.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 12 | 2015-01-05T09:50:42.000Z | 2019-08-19T01:43:40.000Z | # -*- coding: utf-8 -*-
'''
Execute a command and read the output as YAML. The YAML data is then directly overlaid onto the minion's Pillar data
'''
from __future__ import absolute_import, print_function, unicode_literals
# Don't "fix" the above docstring to put it on two lines, as the sphinx
# autosummary pulls only ... | 28.916667 | 116 | 0.660903 |
eda3677d2dd559dcad5bbf2b52b53c942d2a527d | 65 | py | Python | tinynn/converter/operators/__init__.py | www516717402/TinyNeuralNetwork | 23e7931b4377462fad94a9ab0651b6d9a346252d | [
"MIT"
] | 1 | 2022-01-11T06:40:13.000Z | 2022-01-11T06:40:13.000Z | tinynn/converter/operators/__init__.py | www516717402/TinyNeuralNetwork | 23e7931b4377462fad94a9ab0651b6d9a346252d | [
"MIT"
] | null | null | null | tinynn/converter/operators/__init__.py | www516717402/TinyNeuralNetwork | 23e7931b4377462fad94a9ab0651b6d9a346252d | [
"MIT"
] | 1 | 2021-12-20T07:21:37.000Z | 2021-12-20T07:21:37.000Z | from .base import *
from .graph import *
from .optimize import *
| 16.25 | 23 | 0.723077 |
2d8abe6b9b57d08427d340d3b708d73c682b43e3 | 7,182 | py | Python | ppdet/modeling/architectures/faceboxes.py | heavengate/PaddleDetection | 84e79e8760ba2ef7fbc3972d865316af9aade014 | [
"Apache-2.0"
] | 10 | 2020-11-24T12:32:37.000Z | 2021-09-06T08:41:04.000Z | ppdet/modeling/architectures/faceboxes.py | heavengate/PaddleDetection | 84e79e8760ba2ef7fbc3972d865316af9aade014 | [
"Apache-2.0"
] | null | null | null | ppdet/modeling/architectures/faceboxes.py | heavengate/PaddleDetection | 84e79e8760ba2ef7fbc3972d865316af9aade014 | [
"Apache-2.0"
] | 2 | 2021-01-25T06:02:48.000Z | 2021-11-10T10:14:25.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 37.212435 | 85 | 0.597048 |
802d0339e515355925f14f9a157e072690af177a | 15,571 | py | Python | unstable_baselines/algo/td3/run.py | Ending2015a/unstable_baselines | 1d304115406f6e29186cedb0160811d4139e2733 | [
"MIT"
] | 10 | 2021-04-26T17:48:27.000Z | 2022-03-10T14:32:26.000Z | unstable_baselines/algo/td3/run.py | Ending2015a/unstable_baselines | 1d304115406f6e29186cedb0160811d4139e2733 | [
"MIT"
] | null | null | null | unstable_baselines/algo/td3/run.py | Ending2015a/unstable_baselines | 1d304115406f6e29186cedb0160811d4139e2733 | [
"MIT"
] | null | null | null | __copyright__ = '''
The MIT License (MIT)
Copyright (c) 2021 Joe Hsiao
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, c... | 48.058642 | 148 | 0.594759 |
f08e9fef94779e8de47ef9a93ff00a1b7906bd4b | 2,901 | py | Python | APIs/samples/ScanerAPI/EVAL_LONGITUDINAL_CTRL/python/eval_longitudinal_ctrl_pedalPos.py | AVSGuillaume/SCANeR-Samples-Pack | fb872ebb77d2faeae25e74ad11a2e947cd0e0ff5 | [
"MIT"
] | null | null | null | APIs/samples/ScanerAPI/EVAL_LONGITUDINAL_CTRL/python/eval_longitudinal_ctrl_pedalPos.py | AVSGuillaume/SCANeR-Samples-Pack | fb872ebb77d2faeae25e74ad11a2e947cd0e0ff5 | [
"MIT"
] | null | null | null | APIs/samples/ScanerAPI/EVAL_LONGITUDINAL_CTRL/python/eval_longitudinal_ctrl_pedalPos.py | AVSGuillaume/SCANeR-Samples-Pack | fb872ebb77d2faeae25e74ad11a2e947cd0e0ff5 | [
"MIT"
] | 5 | 2022-02-01T06:27:22.000Z | 2022-03-16T13:19:49.000Z | #!*****************************************************************************
#* \project : SCANeR_API *
#* \file : EVAL_LONGITUDINAL_CTRL.py *
#* \Brief : Radar sensor, targets detection with SCANeR API. *
... | 40.291667 | 98 | 0.574629 |
f61f9c1205e0e6a18102b4f63bafbab82b71903c | 37,120 | py | Python | .v/lib/python3.6/site-packages/ansible/modules/monitoring/zabbix/zabbix_host.py | binRick/ansible-callback-concise | fd7b05596b30872af3f79a32f223a0458bffbedd | [
"MIT"
] | 1 | 2020-03-22T01:04:39.000Z | 2020-03-22T01:04:39.000Z | .v/lib/python3.6/site-packages/ansible/modules/monitoring/zabbix/zabbix_host.py | binRick/ansible-callback-concise | fd7b05596b30872af3f79a32f223a0458bffbedd | [
"MIT"
] | null | null | null | .v/lib/python3.6/site-packages/ansible/modules/monitoring/zabbix/zabbix_host.py | binRick/ansible-callback-concise | fd7b05596b30872af3f79a32f223a0458bffbedd | [
"MIT"
] | 1 | 2020-03-22T01:04:48.000Z | 2020-03-22T01:04:48.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013-2014, Epic Games, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 43.11266 | 145 | 0.607462 |
0602c4ff576225a31ae3c98b25777941238ad55d | 15,215 | py | Python | django/apps/registry.py | jedie/django | 09f2cdbe1a43e79e31f5ea509b59d4c87db29832 | [
"BSD-3-Clause"
] | null | null | null | django/apps/registry.py | jedie/django | 09f2cdbe1a43e79e31f5ea509b59d4c87db29832 | [
"BSD-3-Clause"
] | null | null | null | django/apps/registry.py | jedie/django | 09f2cdbe1a43e79e31f5ea509b59d4c87db29832 | [
"BSD-3-Clause"
] | null | null | null | import sys
import threading
import warnings
from collections import Counter, OrderedDict, defaultdict
from functools import partial
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.utils import lru_cache
from .config import AppConfig
class Apps(object):
"""
A registry... | 39.725849 | 89 | 0.634045 |
b6fbe51cbaf5ede275748c926a942b625abfd7fb | 4,523 | py | Python | integration-tests/integration/write_pyarrow.py | youngsofun/parquet2 | e8a0c3576d5b43636fd16a942bc392d450344416 | [
"Apache-2.0"
] | 127 | 2021-03-30T14:18:38.000Z | 2022-03-28T09:47:39.000Z | integration-tests/integration/write_pyarrow.py | youngsofun/parquet2 | e8a0c3576d5b43636fd16a942bc392d450344416 | [
"Apache-2.0"
] | 90 | 2021-04-02T19:31:39.000Z | 2022-03-30T20:53:30.000Z | integration-tests/integration/write_pyarrow.py | youngsofun/parquet2 | e8a0c3576d5b43636fd16a942bc392d450344416 | [
"Apache-2.0"
] | 28 | 2021-04-03T07:41:36.000Z | 2022-03-12T11:18:31.000Z | import pyarrow as pa
import pyarrow.parquet
import os
PYARROW_PATH = "fixtures/pyarrow3"
def case_basic_nullable(size=1):
int64 = [0, 1, None, 3, None, 5, 6, 7, None, 9]
float64 = [0.0, 1.0, None, 3.0, None, 5.0, 6.0, 7.0, None, 9.0]
string = ["Hello", None, "aa", "", None, "abc", None, None, "def", "aaa... | 30.355705 | 84 | 0.539686 |
755d33b0e526e6ec02325d4c386976b925a6813a | 3,727 | py | Python | PlatformAgents/com/cognizant/devops/platformagents/agents/ci/spinnaker/SpinnakerAgent3.py | tamilselvansellamuthu/Insights | fb75d06df8238fbc8604e4dd7a10775dcb92ff5e | [
"Apache-2.0"
] | 49 | 2017-09-05T15:04:00.000Z | 2022-03-01T18:58:48.000Z | PlatformAgents/com/cognizant/devops/platformagents/agents/ci/spinnaker/SpinnakerAgent3.py | tamilselvansellamuthu/Insights | fb75d06df8238fbc8604e4dd7a10775dcb92ff5e | [
"Apache-2.0"
] | 153 | 2017-11-20T09:07:31.000Z | 2022-03-22T05:36:52.000Z | PlatformAgents/com/cognizant/devops/platformagents/agents/ci/spinnaker/SpinnakerAgent3.py | tamilselvansellamuthu/Insights | fb75d06df8238fbc8604e4dd7a10775dcb92ff5e | [
"Apache-2.0"
] | 85 | 2017-09-04T10:20:16.000Z | 2022-03-28T14:49:39.000Z | #-------------------------------------------------------------------------------
# Copyright 2017 Cognizant Technology Solutions
#
# 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://... | 46.012346 | 133 | 0.618997 |
e926086348465b3d926ac9a184c73101af639180 | 10,047 | py | Python | test/functional/p2p-acceptblock.py | yasirmx/Megacoin | f5066e2af768f1d8a4db84e47e1d095a0324570a | [
"MIT"
] | null | null | null | test/functional/p2p-acceptblock.py | yasirmx/Megacoin | f5066e2af768f1d8a4db84e47e1d095a0324570a | [
"MIT"
] | null | null | null | test/functional/p2p-acceptblock.py | yasirmx/Megacoin | f5066e2af768f1d8a4db84e47e1d095a0324570a | [
"MIT"
] | 1 | 2019-09-01T11:20:29.000Z | 2019-09-01T11:20:29.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test processing of unrequested blocks.
Since behavior differs when receiving unrequested blocks from w... | 44.653333 | 107 | 0.667264 |
5d946846a9879af55034593e127d7f20ac0608e3 | 1,378 | py | Python | python-new-trunk/sfapi2/sflib/profiler-stats.py | raychorn/svn_molten-magma | 8aa2ff2340707eecae6514943e86f5afba9cd54a | [
"CC0-1.0"
] | null | null | null | python-new-trunk/sfapi2/sflib/profiler-stats.py | raychorn/svn_molten-magma | 8aa2ff2340707eecae6514943e86f5afba9cd54a | [
"CC0-1.0"
] | null | null | null | python-new-trunk/sfapi2/sflib/profiler-stats.py | raychorn/svn_molten-magma | 8aa2ff2340707eecae6514943e86f5afba9cd54a | [
"CC0-1.0"
] | null | null | null | import os, sys, pstats
from stat import *
from vyperlogix.misc import _utils
from vyperlogix.daemon.daemon import Log
cmp_dates = lambda x,y:x > y
theKey = lambda x:x[-1]
_fpath = os.path.abspath('logs/profiler.txt')
fpath = _fpath if (len(sys.argv) == 1) else sys.argv[1] if (os.path.exists(sys.argv[1])) els... | 34.45 | 128 | 0.648766 |
b5ffdcf8c2ae28ab3ba428bb3e089f1edf15c1db | 25 | py | Python | src/__init__.py | bowdbeg/brat_loader | 2fe594e59e420d30436636700c6532b9291acc2f | [
"MIT"
] | null | null | null | src/__init__.py | bowdbeg/brat_loader | 2fe594e59e420d30436636700c6532b9291acc2f | [
"MIT"
] | null | null | null | src/__init__.py | bowdbeg/brat_loader | 2fe594e59e420d30436636700c6532b9291acc2f | [
"MIT"
] | null | null | null | from brat_loader import * | 25 | 25 | 0.84 |
bc869d7156fff130d55607a5bcc3edac0b3261bf | 5,531 | py | Python | Result_Window_Final.py | Sawera557/PhotoChamp-Image-Forensic-Tool | e7550a97d33cdf58a66ea0efcc451178bfd88a8d | [
"MIT"
] | null | null | null | Result_Window_Final.py | Sawera557/PhotoChamp-Image-Forensic-Tool | e7550a97d33cdf58a66ea0efcc451178bfd88a8d | [
"MIT"
] | null | null | null | Result_Window_Final.py | Sawera557/PhotoChamp-Image-Forensic-Tool | e7550a97d33cdf58a66ea0efcc451178bfd88a8d | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import QApplication, QVBoxLayout, QMessageBox, QPushButton, QDialog, QHBoxLayout
import sys
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import numpy as np
from PyQt5 import QtCore
from PyQt5 import QtGui
from PyQt5.QtWidgets import QApplication, QVBoxLayout, QMessageBox, QPushButton... | 40.97037 | 218 | 0.613813 |
5fa6a694cb6c5e6d0d1c1a8e3ebfc5441a0ad0cf | 152 | py | Python | FitNesseRoot/files/sikuliScripts/EclipseStuff.sikuli/OpenEclipseHelp.py | xebia/FitnesseSikuli | 47730bdd59e61f3462b0c40e00e9ce47fe3d1d64 | [
"Apache-2.0"
] | 1 | 2018-08-09T10:55:49.000Z | 2018-08-09T10:55:49.000Z | FitNesseRoot/files/sikuliScripts/EclipseStuff.sikuli/OpenEclipseHelp.py | xebia/FitnesseSikuli | 47730bdd59e61f3462b0c40e00e9ce47fe3d1d64 | [
"Apache-2.0"
] | 1 | 2015-03-30T07:49:48.000Z | 2015-03-30T07:49:48.000Z | FitNesseRoot/files/sikuliScripts/EclipseStuff.sikuli/OpenEclipseHelp.py | xebia/FitnesseSikuli | 47730bdd59e61f3462b0c40e00e9ce47fe3d1d64 | [
"Apache-2.0"
] | 3 | 2015-03-26T14:11:21.000Z | 2018-10-30T22:15:37.000Z | App.focus("Eclipse")
wait("Helo.png")
click("Helo.png")
hover("Eclipse")
hover("File")
click("Open file")
type("g",KeyModifier.CMD+KeyModifier.SHIFT)
| 15.2 | 43 | 0.703947 |
932915c6b08ed34966daf9e97aa663011f7ecbb2 | 10,452 | py | Python | config/settings/base.py | badri/django-sample | c8e544e79e81827c91d009ac4d73c127845597b3 | [
"MIT"
] | null | null | null | config/settings/base.py | badri/django-sample | c8e544e79e81827c91d009ac4d73c127845597b3 | [
"MIT"
] | null | null | null | config/settings/base.py | badri/django-sample | c8e544e79e81827c91d009ac4d73c127845597b3 | [
"MIT"
] | null | null | null | """
Base settings for Django Gitlab CI project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import environ
ROOT_DIR = environ.Path(__file__) - 3 # (django_git... | 37.462366 | 107 | 0.6261 |
9f216390cebbe24dcda27f8e5ba118b5f07c0a74 | 2,848 | py | Python | mmf/models/transformers/heads/wra.py | facebookresearch/pythia | 079740bee4b357a7b1b866d35e2f1fad6edba8a4 | [
"BSD-3-Clause"
] | 3,252 | 2018-07-27T02:32:24.000Z | 2020-05-07T17:54:46.000Z | mmf/models/transformers/heads/wra.py | facebookresearch/pythia | 079740bee4b357a7b1b866d35e2f1fad6edba8a4 | [
"BSD-3-Clause"
] | 209 | 2018-07-30T06:39:59.000Z | 2020-05-04T22:03:48.000Z | mmf/models/transformers/heads/wra.py | facebookresearch/pythia | 079740bee4b357a7b1b866d35e2f1fad6edba8a4 | [
"BSD-3-Clause"
] | 431 | 2018-07-27T04:17:37.000Z | 2020-05-05T13:58:02.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# Initial version was taken from https://github.com/ChenRocks/UNITER/
# and adapted for MMF.
from typing import Dict
from mmf.common.registry import registry
from mmf.modules.ot import optimal_transport_dist
from torch import nn, Tensor
@registry.register_transfor... | 33.505882 | 83 | 0.618329 |
5f6831cc8e079b6b4688376122fb5e8d7fd6d8c8 | 2,804 | py | Python | cartoon/cartoon/spiders/comic_spider.py | lhuibin/Spider | 7dfebf2f77fe1bd4ec70963f0b30e717682f5aa9 | [
"MIT"
] | 2 | 2018-08-07T16:51:30.000Z | 2018-08-09T17:52:06.000Z | cartoon/cartoon/spiders/comic_spider.py | lhuibin/Spider | 7dfebf2f77fe1bd4ec70963f0b30e717682f5aa9 | [
"MIT"
] | null | null | null | cartoon/cartoon/spiders/comic_spider.py | lhuibin/Spider | 7dfebf2f77fe1bd4ec70963f0b30e717682f5aa9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import scrapy
from scrapy import Selector
from cartoon.items import ComicItem
class ComicSpider(scrapy.Spider):
name = 'comic'
def __init__(self):
#图片链接server域名
self.server_img = 'http://n.1whour.com/'
#章节链接server域名
self.server_link = 'http://... | 34.617284 | 102 | 0.595934 |
6d936738a4c3224df6ced2dde55bae75a6406807 | 1,676 | py | Python | abc185/d.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | 1 | 2021-03-09T04:28:13.000Z | 2021-03-09T04:28:13.000Z | abc185/d.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | null | null | null | abc185/d.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | null | null | null | # included from snippets/main.py
def debug(*x, msg=""):
import sys
print(msg, *x, file=sys.stderr)
def solve(SOLVE_PARAMS):
pass
def main():
# parse input
N, M = map(int, input().split())
AS = list(map(int, input().split()))
AS.append(0)
AS.append(N + 1)
AS.sort()
# debug(AS... | 15.099099 | 59 | 0.498807 |
57e9426964e5b1a78cfefc38977d4a620f521ade | 183 | py | Python | nbpawspublic/__init__.py | toolforge/nbpawspublic | a1938ca6de0bb4087e5a47fece653f1cf4364efc | [
"BSD-2-Clause"
] | null | null | null | nbpawspublic/__init__.py | toolforge/nbpawspublic | a1938ca6de0bb4087e5a47fece653f1cf4364efc | [
"BSD-2-Clause"
] | null | null | null | nbpawspublic/__init__.py | toolforge/nbpawspublic | a1938ca6de0bb4087e5a47fece653f1cf4364efc | [
"BSD-2-Clause"
] | null | null | null | def _jupyter_nbextension_paths():
return [{
"section": "notebook",
"dest": "nbpawspublic",
"src": "static",
"require": "nbpawspublic/main"
}]
| 20.333333 | 38 | 0.535519 |
72213fcc78c70a55e3e4e6655ff6dbb0d02d51d4 | 10,295 | py | Python | procare_python_package/procare/convert.py | dominiquesydow/ProCare | f01487c07a5b5de9b7aca2cba7f6315fc7275bc7 | [
"MIT"
] | 1 | 2021-06-04T17:46:36.000Z | 2021-06-04T17:46:36.000Z | procare_python_package/procare/convert.py | dominiquesydow/ProCare | f01487c07a5b5de9b7aca2cba7f6315fc7275bc7 | [
"MIT"
] | null | null | null | procare_python_package/procare/convert.py | dominiquesydow/ProCare | f01487c07a5b5de9b7aca2cba7f6315fc7275bc7 | [
"MIT"
] | null | null | null | # ----------------------------------------------------------------------------
# < ProCare >
# ----------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2020 Merveille Eguida
#
# Permission is h... | 33.865132 | 80 | 0.45323 |
c6236482dfcda36adae0d7fe79a291a4c3cc040b | 17,487 | py | Python | main.py | zyyhhxx/convNet.pytorch | 85f65f80b6d75810077c54bd3a8c9094cc2a26f9 | [
"MIT"
] | null | null | null | main.py | zyyhhxx/convNet.pytorch | 85f65f80b6d75810077c54bd3a8c9094cc2a26f9 | [
"MIT"
] | null | null | null | main.py | zyyhhxx/convNet.pytorch | 85f65f80b6d75810077c54bd3a8c9094cc2a26f9 | [
"MIT"
] | null | null | null | import argparse
import time
import logging
import json
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import models
import torch.distributed as dist
from os import path, makedirs
from data import DataRegime, SampledDataRegime
f... | 46.261905 | 127 | 0.614171 |
7bfef390355062218bfa38c55710315a4f7fc63f | 1,281 | py | Python | baya/templatetags/baya_tags.py | hrichards/baya | f319cef5e95cd6a166265d51ae0ea236b6f65be3 | [
"MIT"
] | null | null | null | baya/templatetags/baya_tags.py | hrichards/baya | f319cef5e95cd6a166265d51ae0ea236b6f65be3 | [
"MIT"
] | 1 | 2018-12-28T16:53:42.000Z | 2018-12-28T16:53:42.000Z | baya/templatetags/baya_tags.py | hrichards/baya | f319cef5e95cd6a166265d51ae0ea236b6f65be3 | [
"MIT"
] | null | null | null | from baya.utils import has_permission
from django import template
from django.core.urlresolvers import resolve
from django.core.urlresolvers import reverse
register = template.Library()
@register.assignment_tag(takes_context=True)
def can_user_perform_action(context, action, *args, **kwargs):
"""
Assignment ... | 33.710526 | 78 | 0.708821 |
3749c9f4dff13c02363fe070f4a2155a56f424da | 4,284 | py | Python | test/functional/p2p_add_connections.py | fujicoin/fujicoin-22.0 | acdf52ee4b54ba24e904fb2ed0cb578b2d755e48 | [
"MIT"
] | 17 | 2017-03-21T11:33:12.000Z | 2021-08-10T04:11:30.000Z | test/functional/p2p_add_connections.py | fujicoin/fujicoin-22.0 | acdf52ee4b54ba24e904fb2ed0cb578b2d755e48 | [
"MIT"
] | 2 | 2018-01-20T04:45:53.000Z | 2020-01-06T19:52:13.000Z | test/functional/p2p_add_connections.py | fujicoin/fujicoin | acdf52ee4b54ba24e904fb2ed0cb578b2d755e48 | [
"MIT"
] | 7 | 2017-02-12T08:49:39.000Z | 2021-07-18T11:33:59.000Z | #!/usr/bin/env python3
# Copyright (c) 2020 The Fujicoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test add_outbound_p2p_connection test framework functionality"""
from test_framework.p2p import P2PInterfa... | 44.164948 | 120 | 0.6669 |
94c10f9c5f0aec9265d46b7273f0b45d36e03b8e | 4,218 | py | Python | src/iron_throne/pretenders.py | BernardFW/iron-throne | 23130dfdb033f12c6fce443447ee2cdb46cbdea1 | [
"Apache-2.0"
] | 1 | 2018-02-26T15:16:19.000Z | 2018-02-26T15:16:19.000Z | src/iron_throne/pretenders.py | BernardFW/iron-throne | 23130dfdb033f12c6fce443447ee2cdb46cbdea1 | [
"Apache-2.0"
] | 2 | 2018-02-08T09:08:23.000Z | 2018-02-08T09:20:22.000Z | src/iron_throne/pretenders.py | BernardFW/iron-throne | 23130dfdb033f12c6fce443447ee2cdb46cbdea1 | [
"Apache-2.0"
] | null | null | null | from collections import (
defaultdict,
)
from typing import (
Any,
Dict,
Iterator,
List,
NamedTuple,
Optional,
Text,
Tuple,
)
from iron_throne.claim import (
Proof,
)
from .claim import (
Claim,
)
from .words import (
Word,
tokenize,
)
class Pretender(object):
... | 25.877301 | 78 | 0.556899 |
a888f4a309d27bd72220edb167f006812d611001 | 4,008 | py | Python | awacs/route53.py | mprince/awacs | f6a16af326ac7fd11e2e2be3a48180475f150611 | [
"BSD-2-Clause"
] | null | null | null | awacs/route53.py | mprince/awacs | f6a16af326ac7fd11e2e2be3a48180475f150611 | [
"BSD-2-Clause"
] | null | null | null | awacs/route53.py | mprince/awacs | f6a16af326ac7fd11e2e2be3a48180475f150611 | [
"BSD-2-Clause"
] | 1 | 2020-04-03T06:37:42.000Z | 2020-04-03T06:37:42.000Z | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from aws import Action as BaseAction
from aws import BaseARN
service_name = 'Amazon Route 53'
prefix = 'route53'
class Action(BaseAction):
def __init__(self, action=None):
sup = super(Actio... | 44.533333 | 71 | 0.825349 |
3e9cf51fcf3213638dbbdca77a07c5fbe70b80b4 | 687 | py | Python | FaceRecognitionWebsite/codeDesign/myDjango02/app01/migrations/0022_teacherregister.py | ChunjunHu/FaceRecognitionLibraryWebsite | d979d410dfab52d8bda7a5328242b66d6a6b752d | [
"MIT"
] | 1 | 2021-11-05T21:04:47.000Z | 2021-11-05T21:04:47.000Z | FaceRecognitionWebsite/codeDesign/myDjango02/app01/migrations/0022_teacherregister.py | ChunjunHu/FaceRecognitionLibraryWebsite | d979d410dfab52d8bda7a5328242b66d6a6b752d | [
"MIT"
] | null | null | null | FaceRecognitionWebsite/codeDesign/myDjango02/app01/migrations/0022_teacherregister.py | ChunjunHu/FaceRecognitionLibraryWebsite | d979d410dfab52d8bda7a5328242b66d6a6b752d | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2019-01-11 15:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app01', '0021_auto_20190111_1533'),
]
operations = [
migrations.CreateModel(
name='teacherRegister',
f... | 28.625 | 78 | 0.541485 |
e16a79d02b7aa53439810709203e7f5be7491805 | 19,141 | py | Python | models/loss.py | Co1lin/RfDNet | 9a6910a0d3f8ab3bffbba9d992757d29a1d96bea | [
"MIT"
] | 143 | 2021-04-09T12:28:47.000Z | 2022-03-25T13:57:16.000Z | models/loss.py | Co1lin/RfDNet | 9a6910a0d3f8ab3bffbba9d992757d29a1d96bea | [
"MIT"
] | 10 | 2021-04-12T08:24:17.000Z | 2022-01-02T22:33:01.000Z | models/loss.py | Co1lin/RfDNet | 9a6910a0d3f8ab3bffbba9d992757d29a1d96bea | [
"MIT"
] | 22 | 2021-04-10T06:05:44.000Z | 2022-03-31T09:08:50.000Z | # loss function library.
# author: ynie
# date: Feb, 2020
import numpy as np
import torch
import torch.nn as nn
from external.pyTorchChamferDistance.chamfer_distance import ChamferDistance
from models.registers import LOSSES
from net_utils.nn_distance import nn_distance, huber_loss
chamfer_func = ChamferDistance()
... | 46.2343 | 183 | 0.677446 |
6b7f6253e67eaa8c64f3ba0b691e1fe34855f7f1 | 1,277 | py | Python | artists/models.py | flannerykj/urbanapplause | c9b6c0f9a2f65b869fe1e6fa921972e7236e4fe5 | [
"MIT"
] | null | null | null | artists/models.py | flannerykj/urbanapplause | c9b6c0f9a2f65b869fe1e6fa921972e7236e4fe5 | [
"MIT"
] | null | null | null | artists/models.py | flannerykj/urbanapplause | c9b6c0f9a2f65b869fe1e6fa921972e7236e4fe5 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.contrib.auth.models import User
import datetime
from django.utils import timezone
from geoposition.fields import GeopositionField
from django.conf import settings
from taggit.m... | 32.74359 | 98 | 0.768207 |
04c777fd7c421d19c5da564359623c6dcb4e3b7f | 3,843 | py | Python | src/securityAbandonerAndInjector/NonpublicVarAccessdByPublicFunc/main.py | xf97/HuangGai | 40a349be6102d5eb63893fb914659405ae162d93 | [
"MIT"
] | 23 | 2020-09-20T02:10:44.000Z | 2022-03-22T12:58:13.000Z | src/securityAbandonerAndInjector/NonpublicVarAccessdByPublicFunc/main.py | contractshark/HuangGai | 1b26f77b043aa5903774420964c61ab370eb6c7a | [
"MIT"
] | 3 | 2020-09-22T15:28:33.000Z | 2022-01-22T07:48:53.000Z | src/securityAbandonerAndInjector/NonpublicVarAccessdByPublicFunc/main.py | contractshark/HuangGai | 1b26f77b043aa5903774420964c61ab370eb6c7a | [
"MIT"
] | 5 | 2021-07-15T02:45:09.000Z | 2022-03-21T13:36:40.000Z | #!/usr/bin/python
#-*- coding: utf-8 -*-
#cache路径
CACHE_PATH = "./cache/"
#缓存合约路径
CACHE_CONTRACT_PATH = "./cache/temp.sol"
#缓存路径信息文件
CACHE_PATHINFO_PATH = "./cache/temp_sol.json"
#缓存抽象语法树文件
CACHE_AST_PATH = "./cache/temp.sol_json.ast"
#源代码保存路径
CONTRACT_PATH = "../../contractExtractor/NonpublicVarAccessdByPublicFuncExt... | 30.991935 | 143 | 0.733021 |
043a3eafcaef83a163556f238ca9590cd1b1953f | 358 | py | Python | scripts/figures/figure5/pipeswitch_inception_v3/remote_run_data.py | CcTtry/PipeSwitch | c6d632ee20b6dbbaea9a6fb95b9ea0ed4bbbf67e | [
"Apache-2.0"
] | null | null | null | scripts/figures/figure5/pipeswitch_inception_v3/remote_run_data.py | CcTtry/PipeSwitch | c6d632ee20b6dbbaea9a6fb95b9ea0ed4bbbf67e | [
"Apache-2.0"
] | null | null | null | scripts/figures/figure5/pipeswitch_inception_v3/remote_run_data.py | CcTtry/PipeSwitch | c6d632ee20b6dbbaea9a6fb95b9ea0ed4bbbf67e | [
"Apache-2.0"
] | null | null | null | import os
import sys
from scripts.common.util import RunDocker
def main():
with RunDocker('pipeswitch:pipeswitch', 'figure5_pipeswitch_inception_v3') as rd:
# Start the server: pipeswitch
rd.run('python PipeSwitch/scripts/run_data.py')
# Get and return the data point
... | 25.571429 | 86 | 0.659218 |
8e4efe5d5a222cebdec85a1463c382d34ab22321 | 257 | py | Python | lab@home2.py | Harijith/Web-Scrapping | c474071e4e929ec3c44d63484251c3d0096a7836 | [
"bzip2-1.0.6"
] | null | null | null | lab@home2.py | Harijith/Web-Scrapping | c474071e4e929ec3c44d63484251c3d0096a7836 | [
"bzip2-1.0.6"
] | null | null | null | lab@home2.py | Harijith/Web-Scrapping | c474071e4e929ec3c44d63484251c3d0096a7836 | [
"bzip2-1.0.6"
] | null | null | null | x=float(input("\n Enter the Score"))
if(x>=0.9 and x<=1):
print("A")
elif(x>=0.8 and x<=1):
print("B")
elif(x>=0.7 and x<=1):
print("C")
elif(x>=0.6 and x<=1):
print("D")
elif(x<0.6):
print("F")
else:
print("Bad Score")
| 18.357143 | 37 | 0.486381 |
999b8020ed4727d7ca8aa40296d5fee3b62e178a | 326 | py | Python | robonomicsinterface/exceptions.py | Multi-Agent-io/robonomics-interface | 139276c93b25e39ff0bf537cf6e5632234dbbc50 | [
"Apache-2.0"
] | 3 | 2022-01-14T13:50:01.000Z | 2022-02-19T19:02:47.000Z | robonomicsinterface/exceptions.py | Multi-Agent-io/robonomics-interface | 139276c93b25e39ff0bf537cf6e5632234dbbc50 | [
"Apache-2.0"
] | 18 | 2021-11-10T12:11:26.000Z | 2022-03-23T14:17:37.000Z | robonomicsinterface/exceptions.py | Multi-Agent-io/robonomics-interface | 139276c93b25e39ff0bf537cf6e5632234dbbc50 | [
"Apache-2.0"
] | 2 | 2021-12-29T09:17:16.000Z | 2022-03-18T14:06:03.000Z | class NoPrivateKeyException(Exception):
"""
No private key was provided so unable to perform any operations requiring message signing.
"""
pass
class DigitalTwinMapException(Exception):
"""
No Digital Twin was created with this index or there is no such topic in Digital Twin map.
"""
... | 21.733333 | 94 | 0.699387 |
83499540ad2b4e26c25948c04eb624afa5113656 | 1,731 | py | Python | tests/test_causal_frames.py | solalatus/justcause | af6240cbcf33ba42b8e784703fb0d92e1396f937 | [
"MIT"
] | 114 | 2019-09-24T07:47:05.000Z | 2022-02-19T09:37:12.000Z | tests/test_causal_frames.py | solalatus/justcause | af6240cbcf33ba42b8e784703fb0d92e1396f937 | [
"MIT"
] | 29 | 2019-10-22T07:15:49.000Z | 2020-11-30T10:13:24.000Z | tests/test_causal_frames.py | solalatus/justcause | af6240cbcf33ba42b8e784703fb0d92e1396f937 | [
"MIT"
] | 12 | 2020-01-20T12:56:35.000Z | 2022-02-05T17:44:47.000Z | import pytest
import numpy as np
import pandas as pd
from numpy.testing import assert_array_equal
from justcause.data.frames import CausalFrame
def test_create_causal_frame(dummy_df):
CausalFrame(dummy_df, covariates=["a", "b"])
with pytest.raises(AssertionError):
CausalFrame(dummy_df)
with py... | 25.455882 | 58 | 0.675332 |
21bf7a642554503be05c6e86767f11b9aad0c165 | 3,182 | py | Python | src/pyspark_utilities/feature/weights_of_evidence.py | gbisschoff/pyspark-utilities | e234a5de75a6ab975f4feccfbeaf5c9170a74ca4 | [
"MIT"
] | null | null | null | src/pyspark_utilities/feature/weights_of_evidence.py | gbisschoff/pyspark-utilities | e234a5de75a6ab975f4feccfbeaf5c9170a74ca4 | [
"MIT"
] | null | null | null | src/pyspark_utilities/feature/weights_of_evidence.py | gbisschoff/pyspark-utilities | e234a5de75a6ab975f4feccfbeaf5c9170a74ca4 | [
"MIT"
] | null | null | null | from pyspark import keyword_only ## < 2.0 -> pyspark.ml.util.keyword_only
from pyspark.ml.param.shared import HasInputCols, HasOutputCols, Param, Params, TypeConverters, HasLabelCol
# Available in PySpark >= 2.3.0
from pyspark.ml.util import DefaultParamsReadable, DefaultParamsWritable
from pyspark.ml.pipeline impo... | 41.324675 | 173 | 0.655248 |
f537d38b258da626d236b9de56fd54f84fdd290a | 477 | py | Python | 02 - Curso Em Video/Aula 14/E - 061.py | GabrielTrentino/Python_Basico | f13f6448c275c14896337d2018b04cbf5a54efd3 | [
"MIT"
] | null | null | null | 02 - Curso Em Video/Aula 14/E - 061.py | GabrielTrentino/Python_Basico | f13f6448c275c14896337d2018b04cbf5a54efd3 | [
"MIT"
] | null | null | null | 02 - Curso Em Video/Aula 14/E - 061.py | GabrielTrentino/Python_Basico | f13f6448c275c14896337d2018b04cbf5a54efd3 | [
"MIT"
] | null | null | null | print('Gerador de PA')
print('-='*10)
termo1 = int(input('Digite o primeiro termo: '))
razao = int(input('Digite a razão da PA: '))
termos = 10
ant = termo1
while termos != 0:
prox = ant + razao
print('{} -> '.format(ant) if termos > 1 else '{} '.format(ant), end = '')
ant = prox
termos -= 1
... | 29.8125 | 88 | 0.557652 |
21e8862cbf811e0df0fa904a0fbe6d06613c14f1 | 2,810 | py | Python | src/main.py | shigarus/NewsParser | b373f7c047b032e761a3a02f6036c8b3c7107761 | [
"MIT"
] | null | null | null | src/main.py | shigarus/NewsParser | b373f7c047b032e761a3a02f6036c8b3c7107761 | [
"MIT"
] | null | null | null | src/main.py | shigarus/NewsParser | b373f7c047b032e761a3a02f6036c8b3c7107761 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import argparse
import codecs
import json
import logging
import os
import htmltoreadable
import toolkit
def write_to_file(url, text):
"""
Write text to path like
default.ru/news/2013/03/dtp/index.html => [CUR_DIR]/default.ru/news/2013/03/dtp/index.txt
:param url: basestri... | 24.017094 | 97 | 0.569751 |
143fff24bb199d4e2198279bfb0d474f015a51b3 | 140 | py | Python | search.py | yatharthgeek/wikipedia-search | 966d363f1e4ec14cc44b2b420653849f325b1da0 | [
"MIT"
] | 1 | 2021-10-03T16:21:18.000Z | 2021-10-03T16:21:18.000Z | search.py | yatharthgeek/wikipedia-search | 966d363f1e4ec14cc44b2b420653849f325b1da0 | [
"MIT"
] | null | null | null | search.py | yatharthgeek/wikipedia-search | 966d363f1e4ec14cc44b2b420653849f325b1da0 | [
"MIT"
] | null | null | null | import wikipedia
bash= input("Ask Question ==>>> ")
result = wikipedia.summary(bash, sentences = 2)
# printing the result
print(result)
| 14 | 47 | 0.707143 |
f19e3258713dd7b3ccf8f85643cc19156c3d4167 | 1,242 | py | Python | lambda/mynotes/adapter/s3_bucket_adapter.py | scalasm/my-notes | f023baad2908d9fe010490deb1891e409fb498a8 | [
"MIT"
] | null | null | null | lambda/mynotes/adapter/s3_bucket_adapter.py | scalasm/my-notes | f023baad2908d9fe010490deb1891e409fb498a8 | [
"MIT"
] | 10 | 2022-03-14T22:26:25.000Z | 2022-03-25T00:00:31.000Z | lambda/mynotes/adapter/s3_bucket_adapter.py | scalasm/my-notes | f023baad2908d9fe010490deb1891e409fb498a8 | [
"MIT"
] | null | null | null | from typing import Any
from mynotes.core.architecture import ContentUploadException, ObjectStore
class S3BucketAdapter(ObjectStore):
"""
Adapter implementation for the S3 object store.
"""
bucket_name: str
s3_resource: Any
def __init__(self, s3_resource: Any, bucket_name: str) -> None:
... | 34.5 | 109 | 0.669887 |
8487ba2d9d10b4962a9d232b23a42b7d0f26bd73 | 3,529 | py | Python | bindings/python/ensmallen/datasets/string/haloferaxvolcanii.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/haloferaxvolcanii.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/haloferaxvolcanii.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Haloferax volcanii.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein ass... | 32.675926 | 223 | 0.675829 |
4768ce6134ad73c9a6e6b696623d54969f7c6e15 | 1,022 | py | Python | common/ClassificationMetrics.py | sum-coderepo/HadoopApp | 0e8d48c5d541b5935c9054fb1335d829d67d7b59 | [
"Apache-2.0"
] | 2 | 2020-05-26T23:58:32.000Z | 2020-11-01T20:45:30.000Z | common/ClassificationMetrics.py | sum-coderepo/HadoopApp | 0e8d48c5d541b5935c9054fb1335d829d67d7b59 | [
"Apache-2.0"
] | null | null | null | common/ClassificationMetrics.py | sum-coderepo/HadoopApp | 0e8d48c5d541b5935c9054fb1335d829d67d7b59 | [
"Apache-2.0"
] | null | null | null | from sklearn.metrics import *
class ClassificationMetrics(object):
"""description of class"""
def __init__(self, yPredict,yActual):
self.yPredict = yPredict
self.yActual= yActual
if(self.yPredict is None or self.yActual is None):
raise(Exception('yPredict and yActual cannot ... | 34.066667 | 74 | 0.709393 |
5733b355dd94b2bc98c901eef0933a81a8efa490 | 515 | py | Python | src/bdbd_common/messageSingle.py | rkent/bdbd_common | 0d6f2cd40f5e83f05d6a2620c00a3b492bbe9ff4 | [
"MIT"
] | null | null | null | src/bdbd_common/messageSingle.py | rkent/bdbd_common | 0d6f2cd40f5e83f05d6a2620c00a3b492bbe9ff4 | [
"MIT"
] | null | null | null | src/bdbd_common/messageSingle.py | rkent/bdbd_common | 0d6f2cd40f5e83f05d6a2620c00a3b492bbe9ff4 | [
"MIT"
] | null | null | null | try:
from Queue import Queue
except:
from queue import Queue
import rospy
def messageSingle(topic, type):
responseQueue = Queue()
sub = rospy.Subscriber(topic, type, lambda msg:responseQueue.put(msg))
result = responseQueue.get()
sub.unregister()
return result
if __name__ == '__main__':
... | 25.75 | 76 | 0.700971 |
a76960a76610a44d5f8f1401e7d3b73fb4660c56 | 6,185 | py | Python | aws-inventory/lambda/inventory-client-vpn.py | dkeppel626/antiope | c8a540e92878cb220be9918c20bb9458d4541d1a | [
"Apache-2.0"
] | 210 | 2019-01-11T20:58:23.000Z | 2022-03-16T18:51:17.000Z | aws-inventory/lambda/inventory-client-vpn.py | dkeppel626/antiope | c8a540e92878cb220be9918c20bb9458d4541d1a | [
"Apache-2.0"
] | 13 | 2018-11-23T19:06:05.000Z | 2020-08-19T20:05:28.000Z | aws-inventory/lambda/inventory-client-vpn.py | dkeppel626/antiope | c8a540e92878cb220be9918c20bb9458d4541d1a | [
"Apache-2.0"
] | 44 | 2018-11-21T15:51:24.000Z | 2022-03-11T01:21:24.000Z | import boto3
from botocore.exceptions import ClientError
import json
import os
import time
from datetime import datetime, timezone
from dateutil import tz
from antiope.aws_account import *
from common import *
import logging
logger = logging.getLogger()
logger.setLevel(getattr(logging, os.getenv('LOG_LEVEL', default=... | 46.856061 | 172 | 0.645918 |
86b3071fef2f820ebb726caf3bf3b35512c9382b | 5,890 | py | Python | train.py | chiemenz/nd00333_AZMLND_Optimizing_a_Pipeline_in_Azure-Starter_Files | e33d7321511bc4d39fdc406eacb29305d94bf9a7 | [
"MIT"
] | null | null | null | train.py | chiemenz/nd00333_AZMLND_Optimizing_a_Pipeline_in_Azure-Starter_Files | e33d7321511bc4d39fdc406eacb29305d94bf9a7 | [
"MIT"
] | null | null | null | train.py | chiemenz/nd00333_AZMLND_Optimizing_a_Pipeline_in_Azure-Starter_Files | e33d7321511bc4d39fdc406eacb29305d94bf9a7 | [
"MIT"
] | null | null | null | {
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from sklearn.linear_model import LogisticRegression\n",
"import argparse\n",
"import os\n",
"import numpy as np\n",
"from sklearn.metrics import mean_squared_error\n",
"impo... | 30.837696 | 199 | 0.550934 |
bc0397691b57a3a8e2710bc76dd06700f122e002 | 50,898 | py | Python | parlai/tasks/task_list.py | min942773/parlai_wandb | 1d9ba1a0df2199d0247cee8c4929a2598ac7e41a | [
"MIT"
] | null | null | null | parlai/tasks/task_list.py | min942773/parlai_wandb | 1d9ba1a0df2199d0247cee8c4929a2598ac7e41a | [
"MIT"
] | 7 | 2021-01-12T01:07:03.000Z | 2022-03-12T00:50:45.000Z | parlai/tasks/task_list.py | min942773/parlai_wandb | 1d9ba1a0df2199d0247cee8c4929a2598ac7e41a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
This file contains a list of all the tasks, their id and task name, description and the
tags associated with them.
""... | 37.842379 | 120 | 0.537231 |
a93e1d69f0379d0e76357f7dcd4fc4d912fff707 | 2,580 | py | Python | netket/nn/__init__.py | inailuig/netket | ab57a6fb019edb9ac298969950724781f2ae2b22 | [
"Apache-2.0"
] | null | null | null | netket/nn/__init__.py | inailuig/netket | ab57a6fb019edb9ac298969950724781f2ae2b22 | [
"Apache-2.0"
] | 2 | 2022-02-16T10:57:01.000Z | 2022-02-16T10:57:10.000Z | netket/nn/__init__.py | inailuig/netket | ab57a6fb019edb9ac298969950724781f2ae2b22 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The NetKet Authors - All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 23.669725 | 86 | 0.668605 |
72db496cb4bb2099e0caef9a8a35d09f0babb0ef | 4,394 | py | Python | src/bq_test_kit/data_literal_transformers/dsv_data_literal_transformer.py | tiboun/python-bigquery-test-kit | 8f62bdf21122b615f56088a8e2701e0bb4c71f3b | [
"MIT"
] | 31 | 2021-03-03T21:07:44.000Z | 2022-03-20T22:00:45.000Z | src/bq_test_kit/data_literal_transformers/dsv_data_literal_transformer.py | tiboun/python-bq-test-kit | 8f62bdf21122b615f56088a8e2701e0bb4c71f3b | [
"MIT"
] | 14 | 2020-11-25T20:45:31.000Z | 2021-01-29T13:06:28.000Z | src/bq_test_kit/data_literal_transformers/dsv_data_literal_transformer.py | tiboun/python-bq-test-kit | 8f62bdf21122b615f56088a8e2701e0bb4c71f3b | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Bounkong Khamphousone
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# C0114 disabled because this module contains only one class
# pylint: disable=C0114
import csv
from copy import deepcopy
from typing import Callable, List, Optional, Union
from googl... | 34.328125 | 115 | 0.641557 |
e692bf925ba0352186dcf08de03c0ddd5087542d | 137 | py | Python | botlistbot/api/config.py | anandpskerala/BotListBot | 4ac1b1f7c4f4d251c80a24306542001f40b85216 | [
"MIT"
] | 66 | 2017-07-21T07:16:14.000Z | 2022-02-13T03:52:52.000Z | botlistbot/api/config.py | anandpskerala/BotListBot | 4ac1b1f7c4f4d251c80a24306542001f40b85216 | [
"MIT"
] | 10 | 2017-10-20T00:51:43.000Z | 2021-06-02T00:07:32.000Z | botlistbot/api/config.py | anandpskerala/BotListBot | 4ac1b1f7c4f4d251c80a24306542001f40b85216 | [
"MIT"
] | 44 | 2018-01-05T15:01:47.000Z | 2022-02-10T20:32:41.000Z | SECURITY_PASSWORD_HASH = 'pbkdf2_sha512'
SECURITY_TRACKABLE = True
SECURITY_PASSWORD_SALT = 'something_super_secret_change_in_production' | 45.666667 | 70 | 0.890511 |
2c74c14c2cba44b6c01bf4a660a27564374d28de | 2,195 | py | Python | datasette_git_importer/git_utils.py | brandonrobertz/datasette-git-importer | f2b367dba56dcba1355dfd5dc18e237c6320925d | [
"Apache-2.0"
] | null | null | null | datasette_git_importer/git_utils.py | brandonrobertz/datasette-git-importer | f2b367dba56dcba1355dfd5dc18e237c6320925d | [
"Apache-2.0"
] | null | null | null | datasette_git_importer/git_utils.py | brandonrobertz/datasette-git-importer | f2b367dba56dcba1355dfd5dc18e237c6320925d | [
"Apache-2.0"
] | null | null | null | # from datetime import datetime
import os
from git import Repo
def get_repo_remote(repo_owner, repo_name, github_user, github_token):
return f"https://{github_user}:{github_token}@github.com/{repo_owner}/{repo_name}"
def write_csv_to_repo(filename, data, plugin_config):
url = get_repo_remote(
plugi... | 30.068493 | 86 | 0.66287 |
ad0de2076d5a3964b148c2945cf1ca2f84f52905 | 16,669 | py | Python | indico/modules/events/registration/controllers/display.py | uxmaster/indico | ecd19f17ef6fdc9f5584f59c87ec647319ce5d31 | [
"MIT"
] | 1 | 2019-11-03T11:34:16.000Z | 2019-11-03T11:34:16.000Z | indico/modules/events/registration/controllers/display.py | NP-compete/indico | 80db7ca0ef9d1f3240a16b9ff2d84bf0bf26c549 | [
"MIT"
] | null | null | null | indico/modules/events/registration/controllers/display.py | NP-compete/indico | 80db7ca0ef9d1f3240a16b9ff2d84bf0bf26c549 | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from operator import attrgetter
from uuid import UUID
from flask... | 48.597668 | 120 | 0.655348 |
b58fbb5c7db7407f9bf00286d00aac34cb085c39 | 1,748 | py | Python | hikari/urls.py | 81CuongVn/hikaki | 5e4ccffaccf411ea5c13fd64264cadda72d197fb | [
"MIT"
] | 2 | 2021-09-18T18:43:11.000Z | 2021-12-30T11:54:26.000Z | hikari/urls.py | 81CuongVn/hikaki | 5e4ccffaccf411ea5c13fd64264cadda72d197fb | [
"MIT"
] | null | null | null | hikari/urls.py | 81CuongVn/hikaki | 5e4ccffaccf411ea5c13fd64264cadda72d197fb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# cython: language_level=3
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021-present davfsa
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, inc... | 38.844444 | 85 | 0.744851 |
404d5a5e1d824652360c9dda569e73eb7c0b7fb6 | 1,201 | py | Python | pipeline/scripts/ttest.py | SherineAwad/ribofilio | 4dea38692e7715f07df3ee074e2adc5380f4d6e9 | [
"MIT"
] | null | null | null | pipeline/scripts/ttest.py | SherineAwad/ribofilio | 4dea38692e7715f07df3ee074e2adc5380f4d6e9 | [
"MIT"
] | null | null | null | pipeline/scripts/ttest.py | SherineAwad/ribofilio | 4dea38692e7715f07df3ee074e2adc5380f4d6e9 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import sys
import argparse
import screed
import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import os.path
from scipy.stats import t
def getstats(infile1, infile2):
sample1 = []
sample2 = []
count = 0
for line in open(infile1):
... | 25.553191 | 96 | 0.586178 |
306d8a23394d2f1aa4f800e6a39a39a9416308e6 | 6,816 | py | Python | tests/unit/providers/test_dict_py2_py3.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | tests/unit/providers/test_dict_py2_py3.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | tests/unit/providers/test_dict_py2_py3.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | """Dict provider tests."""
import sys
from dependency_injector import providers
def test_is_provider():
assert providers.is_provider(providers.Dict()) is True
def test_provided_instance_provider():
provider = providers.Dict()
assert isinstance(provider.provided, providers.ProvidedInstance)
def test_... | 27.707317 | 89 | 0.671215 |
151f12714aa41019071fa480878554d44bbbb0bb | 5,727 | py | Python | contrib/seeds/makeseeds.py | PERSHYANCOIN/PERSHYANCOIN | bbadf90495732ecdbf5ab9a27e84e1dbdaff117d | [
"MIT"
] | 1 | 2018-02-21T07:10:01.000Z | 2018-02-21T07:10:01.000Z | contrib/seeds/makeseeds.py | pershyancoin/pershyancoin | bbadf90495732ecdbf5ab9a27e84e1dbdaff117d | [
"MIT"
] | 2 | 2018-02-12T22:00:38.000Z | 2018-02-12T22:01:03.000Z | contrib/seeds/makeseeds.py | PERSHYANCOIN/PERSHYANCOIN | bbadf90495732ecdbf5ab9a27e84e1dbdaff117d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2013-2017 The Pershyancoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 3376... | 33.104046 | 186 | 0.570107 |
5ea0345f63bc57baa0d0dcc554ff3fbf143ca5f2 | 7,914 | py | Python | storage/emulated/0/qpython/lib/python3.2/site-packages/aip/base.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/lib/python3.2/site-packages/aip/base.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/lib/python3.2/site-packages/aip/base.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
AipBase
"""
import hmac
import json
import hashlib
import datetime
import base64
import time
import sys
import requests
requests.packages.urllib3.disable_warnings()
if sys.version_info.major == 2:
from urllib import urlencode
from urllib import quote
fro... | 28.365591 | 93 | 0.504296 |
810fd1bdc346c4399f18d1edbe0c8ed683392e38 | 16,418 | py | Python | contrastive/models/contrastive_learner_with_labels.py | neurospin-projects/2022_jchavas_cingulate_inhibitory_control | 30e63f0af62fa83abd3858720ce3f3a15a3fbaea | [
"MIT"
] | null | null | null | contrastive/models/contrastive_learner_with_labels.py | neurospin-projects/2022_jchavas_cingulate_inhibitory_control | 30e63f0af62fa83abd3858720ce3f3a15a3fbaea | [
"MIT"
] | null | null | null | contrastive/models/contrastive_learner_with_labels.py | neurospin-projects/2022_jchavas_cingulate_inhibitory_control | 30e63f0af62fa83abd3858720ce3f3a15a3fbaea | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This software and supporting documentation are distributed by
# Institut Federatif de Recherche 49
# CEA/NeuroSpin, Batiment 145,
# 91191 Gif-sur-Yvette cedex
# France
#
# This software is governed by the CeCILL license version 2 under
# French law ... | 39.561446 | 86 | 0.604459 |
e0a56d468f9b6270babbef3a1eafcd01d629ed1a | 1,945 | py | Python | cauldron/test/cli/commands/test_reload.py | JohnnyPeng18/cauldron | 09120c2a4cef65df46f8c0c94f5d79395b3298cd | [
"MIT"
] | 90 | 2016-09-02T15:11:10.000Z | 2022-01-02T11:37:57.000Z | cauldron/test/cli/commands/test_reload.py | JohnnyPeng18/cauldron | 09120c2a4cef65df46f8c0c94f5d79395b3298cd | [
"MIT"
] | 86 | 2016-09-23T16:52:22.000Z | 2022-03-31T21:39:56.000Z | cauldron/test/cli/commands/test_reload.py | JohnnyPeng18/cauldron | 09120c2a4cef65df46f8c0c94f5d79395b3298cd | [
"MIT"
] | 261 | 2016-12-22T05:36:48.000Z | 2021-11-26T12:40:42.000Z | from unittest.mock import patch
from cauldron.test import support
from cauldron.test.support import scaffolds
class TestReload(scaffolds.ResultsTest):
"""..."""
def test_reload(self):
"""Should reload the currently opened project."""
support.run_command('open @examples:hello_cauldron --forge... | 38.137255 | 75 | 0.672494 |
105ea140070ba362676f80d83f3968a9d3e05a21 | 491 | py | Python | vilya/views/api/v1/projects/commits.py | mubashshirjamal/code | d9c7adf7efed8e9c1ab3ff8cdeb94e7eb1a45382 | [
"BSD-3-Clause"
] | 1,582 | 2015-01-05T02:41:44.000Z | 2022-03-30T20:03:22.000Z | vilya/views/api/v1/projects/commits.py | mubashshirjamal/code | d9c7adf7efed8e9c1ab3ff8cdeb94e7eb1a45382 | [
"BSD-3-Clause"
] | 66 | 2015-01-23T07:58:04.000Z | 2021-11-12T02:23:27.000Z | vilya/views/api/v1/projects/commits.py | mubashshirjamal/code | d9c7adf7efed8e9c1ab3ff8cdeb94e7eb1a45382 | [
"BSD-3-Clause"
] | 347 | 2015-01-05T07:47:07.000Z | 2021-09-20T21:22:32.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from vilya.views.api.utils import RestAPIUI
class CommitsUI(RestAPIUI):
_q_exports = []
_q_methods = ['get']
def __init__(self, project):
self.project = project
def get(self, request):
repo = self.project.repo
co... | 24.55 | 69 | 0.627291 |
4fe8cc91954aaeb34bbe8aaed64c6a646d649096 | 3,926 | py | Python | datadog_checks_dev/datadog_checks/dev/tooling/commands/env/test.py | jessehub/integrations-core | 76955b6e55beae7bc5c2fd25867955d2a3c8d5ef | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_dev/datadog_checks/dev/tooling/commands/env/test.py | jessehub/integrations-core | 76955b6e55beae7bc5c2fd25867955d2a3c8d5ef | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_dev/datadog_checks/dev/tooling/commands/env/test.py | jessehub/integrations-core | 76955b6e55beae7bc5c2fd25867955d2a3c8d5ef | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2019
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import click
from .... import EnvVars
from ...e2e import create_interface, get_configured_envs
from ...e2e.agent import DEFAULT_PYTHON_VERSION
from ...testing import get_tox_envs
from ..console import CONTEXT_SET... | 35.690909 | 118 | 0.611055 |
4ea25bea64693efbd67e1d8d1323dd7e269f115f | 4,472 | py | Python | advent_of_code/year2019/day7/intcode.py | Tenebrar/codebase | 59c9a35289fb29afedad0e3edd0519b67372ef9f | [
"Unlicense"
] | 1 | 2020-04-21T11:39:25.000Z | 2020-04-21T11:39:25.000Z | advent_of_code/year2019/day7/intcode.py | Tenebrar/codebase | 59c9a35289fb29afedad0e3edd0519b67372ef9f | [
"Unlicense"
] | 7 | 2020-02-12T01:08:01.000Z | 2022-02-10T11:56:56.000Z | advent_of_code/year2019/day7/intcode.py | Tenebrar/codebase | 59c9a35289fb29afedad0e3edd0519b67372ef9f | [
"Unlicense"
] | null | null | null | from abc import ABC, abstractmethod
from typing import List, Dict, Callable
class Operation(ABC):
@abstractmethod
def execute(self, computer: 'IntcodeComputer', parameter_modes: str):
...
class ReadReadWriteOperation(Operation, ABC):
def execute(self, computer: 'IntcodeComputer', parameter_modes... | 30.841379 | 110 | 0.658318 |
df0b2e4277553e0202d0deafaca1109e8d615173 | 328 | py | Python | davidgoliath/project/modelling/21_geometric.py | spideynolove/Other-repo | 34066f177994415d031183ab9dd219d787e6e13a | [
"MIT"
] | null | null | null | davidgoliath/project/modelling/21_geometric.py | spideynolove/Other-repo | 34066f177994415d031183ab9dd219d787e6e13a | [
"MIT"
] | null | null | null | davidgoliath/project/modelling/21_geometric.py | spideynolove/Other-repo | 34066f177994415d031183ab9dd219d787e6e13a | [
"MIT"
] | null | null | null | # Geometric distribution python
# https://www.google.com/search?q=Geometric+distribution+python&oq=Geometric+distribution+python&aqs=chrome..69i57j0l2j0i22i30l7.2540j0j4&sourceid=chrome&ie=UTF-8
''' Discrete distributions
# https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.geom.html#scipy.stats.ge... | 46.857143 | 162 | 0.801829 |
4a291b8e70dede11468340319d091a45004a5d19 | 849 | py | Python | FPLManager/caching.py | twhi/fpl_price_change_predictor | 0cf0de11af7637d6cd83fdadf9ff381fc6d172f5 | [
"MIT"
] | 1 | 2019-02-15T13:48:48.000Z | 2019-02-15T13:48:48.000Z | FPLManager/caching.py | twhi/fpl_price_change_predictor | 0cf0de11af7637d6cd83fdadf9ff381fc6d172f5 | [
"MIT"
] | 1 | 2021-06-01T23:15:32.000Z | 2021-06-01T23:15:32.000Z | FPLManager/caching.py | twhi/FPLManager | 0cf0de11af7637d6cd83fdadf9ff381fc6d172f5 | [
"MIT"
] | null | null | null | import pickle
def save_to_pickle(variable, filename):
with open(filename, 'wb') as handle:
pickle.dump(variable, handle)
def open_pickle(path_to_file):
with open(path_to_file, 'rb') as handle:
f = pickle.load(handle)
return f
class Caching:
def __init__(self):
self.access_list... | 24.970588 | 58 | 0.580683 |
7cdba495eeabbf8e4018da3efd9849838949ee9e | 2,231 | py | Python | tools/copy_partitions.py | yuzi40277738/openHASP | e5332a3aad19a399194bcf31add3bcacf3e2c130 | [
"MIT"
] | 191 | 2021-04-02T18:20:34.000Z | 2022-03-27T23:37:22.000Z | tools/copy_partitions.py | yuzi40277738/openHASP | e5332a3aad19a399194bcf31add3bcacf3e2c130 | [
"MIT"
] | 82 | 2021-04-02T14:37:32.000Z | 2022-03-31T23:33:37.000Z | tools/copy_partitions.py | yuzi40277738/openHASP | e5332a3aad19a399194bcf31add3bcacf3e2c130 | [
"MIT"
] | 72 | 2021-04-11T14:46:02.000Z | 2022-03-31T14:33:15.000Z | #This script is based on the Tasmota rename-firmware.py script. https://github.com/arendst/Tasmota
Import('env')
import os
import shutil
buildFlags = env.ParseFlags(env['BUILD_FLAGS'])
OUTPUT_DIR = "build_output{}".format(os.path.sep)
platform = env.PioPlatform()
FRAMEWORK_DIR = platform.get_package_dir("framework-a... | 31.871429 | 127 | 0.66831 |
f75b3271013111802187c197e90c5479823898ca | 8,262 | py | Python | pymagnitude/third_party/allennlp/semparse/worlds/atis_world.py | tpeng/magnitude | aec98628b5547773ca8c4114ec6d1ad51e21b230 | [
"MIT"
] | 1,520 | 2018-03-01T13:37:49.000Z | 2022-03-25T11:40:20.000Z | pymagnitude/third_party/allennlp/semparse/worlds/atis_world.py | tpeng/magnitude | aec98628b5547773ca8c4114ec6d1ad51e21b230 | [
"MIT"
] | 87 | 2018-03-03T15:12:50.000Z | 2022-02-21T15:24:12.000Z | pymagnitude/third_party/allennlp/semparse/worlds/atis_world.py | tpeng/magnitude | aec98628b5547773ca8c4114ec6d1ad51e21b230 | [
"MIT"
] | 121 | 2018-03-03T08:40:53.000Z | 2022-03-16T05:19:38.000Z |
from __future__ import absolute_import
from copy import deepcopy
#typing
import numpy
from parsimonious.grammar import Grammar
from allennlp.semparse.contexts.atis_tables import * # pylint: disable=wildcard-import,unused-wildcard-import
from allennlp.semparse.contexts.sql_table_context import\
SqlTableContex... | 46.156425 | 109 | 0.659647 |
03ab7df3acb6025094fae83201ad97007d831665 | 5,900 | py | Python | notebooks/forrester2007/function_defs.py | sjvrijn/multi-level-co-surrogates | 04a071eb4360bed6f1a517531690beec7857e3e5 | [
"MIT"
] | null | null | null | notebooks/forrester2007/function_defs.py | sjvrijn/multi-level-co-surrogates | 04a071eb4360bed6f1a517531690beec7857e3e5 | [
"MIT"
] | 2 | 2021-02-25T14:07:50.000Z | 2021-02-25T14:12:35.000Z | notebooks/forrester2007/function_defs.py | sjvrijn/multi-level-co-surrogates | 04a071eb4360bed6f1a517531690beec7857e3e5 | [
"MIT"
] | null | null | null | import sys
from itertools import product
import matplotlib.pyplot as plt
import numpy as np
from IPython.core.display import clear_output
from matplotlib import colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
from pyDOE import lhs
from pyprojroot import here
module_path = str(here())
if module_path not... | 35.97561 | 128 | 0.682373 |
79d9b1d5bd657c57090e7baddbc06970988e428d | 661 | py | Python | setup.py | apparentlymart/python-tfplugin | 9f1e5c463df9368928bb79188058bc474386b5ba | [
"MIT"
] | 2 | 2019-09-08T23:33:56.000Z | 2022-01-19T01:29:20.000Z | setup.py | apparentlymart/python-tfplugin | 9f1e5c463df9368928bb79188058bc474386b5ba | [
"MIT"
] | null | null | null | setup.py | apparentlymart/python-tfplugin | 9f1e5c463df9368928bb79188058bc474386b5ba | [
"MIT"
] | null | null | null |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name="tfplugin",
version="dev",
author="Martin Atkins",
author_email="mart@degeneration.co.uk",
description="Implement Terraform plugins in Python",
packages=['tfplugin'],
install_require... | 19.441176 | 56 | 0.574887 |
5e4217ecb1548dfbf5f3509dd6285b89e9baada5 | 3,457 | py | Python | main_pretraining.py | cypressd1999/FYP_2021 | d836a355b1513bbca1f1429650ddf670f7b13994 | [
"Apache-2.0"
] | null | null | null | main_pretraining.py | cypressd1999/FYP_2021 | d836a355b1513bbca1f1429650ddf670f7b13994 | [
"Apache-2.0"
] | null | null | null | main_pretraining.py | cypressd1999/FYP_2021 | d836a355b1513bbca1f1429650ddf670f7b13994 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 27 11:16:26 2019
@author: weetee
"""
from src.preprocessing_funcs import load_dataloaders
from src.trainer import train_and_fit
import logging
from argparse import ArgumentParser
'''
This trains the BERT model on matching the blanks
'''
logging.b... | 56.672131 | 157 | 0.534278 |
dc63cd77835e1c34e3162b25c11d58ac3fa88ed4 | 2,847 | py | Python | Halloween_Countdown_Matrix/code.py | albinger/Adafruit_Learning_System_Guides | 4fe2da261fe5d1ca282b86bd3b93ee1466346fa7 | [
"MIT"
] | null | null | null | Halloween_Countdown_Matrix/code.py | albinger/Adafruit_Learning_System_Guides | 4fe2da261fe5d1ca282b86bd3b93ee1466346fa7 | [
"MIT"
] | null | null | null | Halloween_Countdown_Matrix/code.py | albinger/Adafruit_Learning_System_Guides | 4fe2da261fe5d1ca282b86bd3b93ee1466346fa7 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2020 John Park for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import board
from adafruit_matrixportal.matrixportal import MatrixPortal
EVENT_YEAR = 2021
EVENT_MONTH = 10
EVENT_DAY = 31
EVENT_HOUR = 17
EVENT_MINUTE = 0
FRAME_DURATION = 3
FRAMES = (
"bmps/jack.bmp",
... | 24.333333 | 71 | 0.638918 |
6adaf398cefef7ea1034a99b20566fee93459175 | 1,298 | py | Python | modelzoo/DIEN/data/script/history_behavior_list.py | aalbersk/DeepRec | f673a950780959b44dcda99398880a1d883ab338 | [
"Apache-2.0"
] | 292 | 2021-12-24T03:24:33.000Z | 2022-03-31T15:41:05.000Z | modelzoo/DIEN/data/script/history_behavior_list.py | aalbersk/DeepRec | f673a950780959b44dcda99398880a1d883ab338 | [
"Apache-2.0"
] | 54 | 2021-12-24T06:40:09.000Z | 2022-03-30T07:57:24.000Z | modelzoo/DIEN/data/script/history_behavior_list.py | aalbersk/DeepRec | f673a950780959b44dcda99398880a1d883ab338 | [
"Apache-2.0"
] | 75 | 2021-12-24T04:48:21.000Z | 2022-03-29T10:13:39.000Z | item_to_cate_map = {}
with open('item2catmap.txt', 'r') as f:
for line in f:
linelist = line.strip().split('\t')
item = linelist[0]
cate = linelist[1]
item_to_cate_map[item] = cate
user_history_behavior = {}
with open('reviews-info', 'r') as f:
for line in f:
linelist = ... | 30.904762 | 65 | 0.501541 |
d5d9223ed0e9922501535057cea298170d33ec43 | 33,184 | py | Python | tests/test_secretsmanager/test_server.py | thomassross/moto | 407d5c853dbee9b9e132d97b41414b7dca475765 | [
"Apache-2.0"
] | null | null | null | tests/test_secretsmanager/test_server.py | thomassross/moto | 407d5c853dbee9b9e132d97b41414b7dca475765 | [
"Apache-2.0"
] | 4 | 2017-09-30T07:52:52.000Z | 2021-12-13T06:56:55.000Z | tests/test_secretsmanager/test_server.py | thomassross/moto | 407d5c853dbee9b9e132d97b41414b7dca475765 | [
"Apache-2.0"
] | 2 | 2021-11-24T08:05:43.000Z | 2021-11-25T16:18:48.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import boto3
import pytest
import sure # noqa
import moto.server as server
from moto import mock_secretsmanager, mock_lambda, mock_iam, mock_logs, settings
from tests.test_awslambda.test_lambda import get_test_zip_file1
"""
Test the differ... | 33.826707 | 98 | 0.62271 |
169ba1a32e401a532b258c5965c12379f6f58bbe | 3,359 | py | Python | douglas/tests/test_entries.py | willkg/douglas | 7e46919d0baefecba414f41980cbe9c0529a884e | [
"MIT"
] | 1 | 2016-02-12T15:26:24.000Z | 2016-02-12T15:26:24.000Z | douglas/tests/test_entries.py | willkg/douglas | 7e46919d0baefecba414f41980cbe9c0529a884e | [
"MIT"
] | 1 | 2015-04-20T13:33:39.000Z | 2015-04-20T13:33:39.000Z | douglas/tests/test_entries.py | willkg/douglas | 7e46919d0baefecba414f41980cbe9c0529a884e | [
"MIT"
] | null | null | null | import time
from os import environ
from nose.tools import eq_, raises
from douglas.entries.base import EntryBase, generate_entry
from douglas.tests import req_, UnitTestBase
TIME1 = (2008, 7, 21, 12, 51, 47, 0, 203, 1)
class TestEntryBase(UnitTestBase):
def force_tz(self):
"""
Force time zone ... | 27.760331 | 77 | 0.51682 |
c3ed367f89be0160137704dcb23dc7d1906f9ed0 | 6,382 | py | Python | pymodbus/events.py | vmacari/pymodbus | ec97e2f2b50c6db0a932f44e550a5dee60bf0970 | [
"BSD-3-Clause"
] | 1,125 | 2017-05-11T06:11:36.000Z | 2022-03-31T02:59:45.000Z | pymodbus/events.py | vmacari/pymodbus | ec97e2f2b50c6db0a932f44e550a5dee60bf0970 | [
"BSD-3-Clause"
] | 575 | 2017-05-12T02:46:55.000Z | 2022-03-31T16:00:33.000Z | pymodbus/events.py | vmacari/pymodbus | ec97e2f2b50c6db0a932f44e550a5dee60bf0970 | [
"BSD-3-Clause"
] | 516 | 2017-05-19T14:06:06.000Z | 2022-03-31T06:10:13.000Z | '''
Modbus Remote Events
------------------------------------------------------------
An event byte returned by the Get Communications Event Log function
can be any one of four types. The type is defined by bit 7
(the high-order bit) in each byte. It may be further defined by bit 6.
'''
from pymodbus.exceptions import... | 32.232323 | 79 | 0.618145 |
a2a577a0753f7554ca86ee32be2a9a735fe0d983 | 25,151 | py | Python | pandas/tests/io/formats/test_to_html.py | sofiane87/pandas | 0de99558b497c5611cbe5d35d504763bd7692275 | [
"BSD-3-Clause"
] | 2 | 2019-11-13T18:20:29.000Z | 2020-04-18T02:58:39.000Z | pandas/tests/io/formats/test_to_html.py | ivan-vasilev/pandas | 4071dde86e33434e1bee8304fa62074949f813cc | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/io/formats/test_to_html.py | ivan-vasilev/pandas | 4071dde86e33434e1bee8304fa62074949f813cc | [
"BSD-3-Clause"
] | 2 | 2019-12-21T21:17:43.000Z | 2019-12-26T10:34:36.000Z | from datetime import datetime
from io import StringIO
import re
import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame, Index, MultiIndex, option_context
import pandas.util.testing as tm
import pandas.io.formats.format as fmt
lorem_ipsum = (
"Lorem ipsum dolor sit amet, consectetur ad... | 31.87706 | 88 | 0.615522 |
d527f4372310ee4c76af52e21eca48e6eabf354d | 6,417 | py | Python | src/python/pants/backend/python/tasks/checkstyle/import_order.py | qma/pants | 604f58a366b66bc5cfa83e7250cb8af8130832cf | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/tasks/checkstyle/import_order.py | qma/pants | 604f58a366b66bc5cfa83e7250cb8af8130832cf | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/tasks/checkstyle/import_order.py | qma/pants | 604f58a366b66bc5cfa83e7250cb8af8130832cf | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import ast
import os... | 32.739796 | 98 | 0.661212 |
bad30b629f3d91fa5a6817139503733829f1d0f5 | 41,037 | py | Python | src/transformers/models/vision_encoder_decoder/modeling_flax_vision_encoder_decoder.py | changwangss/transformers | 321eb56222b1655a06a993a473becf467d6e2034 | [
"Apache-2.0"
] | 1 | 2021-12-12T12:55:50.000Z | 2021-12-12T12:55:50.000Z | src/transformers/models/vision_encoder_decoder/modeling_flax_vision_encoder_decoder.py | changwangss/transformers | 321eb56222b1655a06a993a473becf467d6e2034 | [
"Apache-2.0"
] | null | null | null | src/transformers/models/vision_encoder_decoder/modeling_flax_vision_encoder_decoder.py | changwangss/transformers | 321eb56222b1655a06a993a473becf467d6e2034 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 48.853571 | 156 | 0.669932 |
3cb94c973371cf72eec089d03c0077caa8625f24 | 127,950 | py | Python | nova/tests/unit/virt/vmwareapi/test_vmops.py | hyphon81/nova-for-gpu-passthrough | 7c164980d7355d8fc40a6b155e31e325191b6a5e | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/vmwareapi/test_vmops.py | hyphon81/nova-for-gpu-passthrough | 7c164980d7355d8fc40a6b155e31e325191b6a5e | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/vmwareapi/test_vmops.py | hyphon81/nova-for-gpu-passthrough | 7c164980d7355d8fc40a6b155e31e325191b6a5e | [
"Apache-2.0"
] | 1 | 2020-07-24T00:41:18.000Z | 2020-07-24T00:41:18.000Z | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 48.283019 | 79 | 0.581016 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.