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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f75388131fa695e73dcce72a06c6f08343135651 | 3,999 | py | Python | great_expectations/datasource/data_connector/inferred_asset_filesystem_data_connector.py | victorcouste/great_expectations | 9ee46d83feb87e13c769e2ae35b899b3f18d73a4 | [
"Apache-2.0"
] | 6,451 | 2017-09-11T16:32:53.000Z | 2022-03-31T23:27:49.000Z | great_expectations/datasource/data_connector/inferred_asset_filesystem_data_connector.py | victorcouste/great_expectations | 9ee46d83feb87e13c769e2ae35b899b3f18d73a4 | [
"Apache-2.0"
] | 3,892 | 2017-09-08T18:57:50.000Z | 2022-03-31T23:15:20.000Z | great_expectations/datasource/data_connector/inferred_asset_filesystem_data_connector.py | victorcouste/great_expectations | 9ee46d83feb87e13c769e2ae35b899b3f18d73a4 | [
"Apache-2.0"
] | 1,023 | 2017-09-08T15:22:05.000Z | 2022-03-31T21:17:08.000Z | import logging
from pathlib import Path
from typing import List, Optional
from great_expectations.datasource.data_connector.inferred_asset_file_path_data_connector import (
InferredAssetFilePathDataConnector,
)
from great_expectations.datasource.data_connector.util import (
get_filesystem_one_level_directory_g... | 40.806122 | 130 | 0.712428 | import logging
from pathlib import Path
from typing import List, Optional
from great_expectations.datasource.data_connector.inferred_asset_file_path_data_connector import (
InferredAssetFilePathDataConnector,
)
from great_expectations.datasource.data_connector.util import (
get_filesystem_one_level_directory_g... | true | true |
f753885b92de4eddaad45582b234c4ece33325f5 | 1,355 | py | Python | plugins/minfraud/komand_minfraud/actions/account_lookup/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/minfraud/komand_minfraud/actions/account_lookup/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/minfraud/komand_minfraud/actions/account_lookup/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Query account info"
class Input:
ADDRESS = "address"
USER_ID = "user_id"
USERNAME_MD5 = "username_md5"
class Output:
RISK_SCORE = "risk_score"
class AccountLookupInput(komand.Input):
... | 18.561644 | 57 | 0.557196 | import komand
import json
class Component:
DESCRIPTION = "Query account info"
class Input:
ADDRESS = "address"
USER_ID = "user_id"
USERNAME_MD5 = "username_md5"
class Output:
RISK_SCORE = "risk_score"
class AccountLookupInput(komand.Input):
schema = json.loads("""
{
"type": ... | true | true |
f75388be2ea3865122afa24fc8486c7a69eb79c5 | 23,480 | py | Python | test/e2e2/spec/test_api_rr.py | nart1412/desec-stack | 7519f13a624a14dc4a145cfd9441ff33677cc41a | [
"MIT"
] | null | null | null | test/e2e2/spec/test_api_rr.py | nart1412/desec-stack | 7519f13a624a14dc4a145cfd9441ff33677cc41a | [
"MIT"
] | null | null | null | test/e2e2/spec/test_api_rr.py | nart1412/desec-stack | 7519f13a624a14dc4a145cfd9441ff33677cc41a | [
"MIT"
] | null | null | null | from typing import List, Tuple
import pytest
from conftest import DeSECAPIV1Client, query_replication, NSLordClient, assert_eventually
def generate_params(dict_value_lists_by_type: dict) -> List[Tuple[str, str]]:
return [
(rr_type, value)
for rr_type in dict_value_lists_by_type.keys()
fo... | 57.268293 | 769 | 0.705196 | from typing import List, Tuple
import pytest
from conftest import DeSECAPIV1Client, query_replication, NSLordClient, assert_eventually
def generate_params(dict_value_lists_by_type: dict) -> List[Tuple[str, str]]:
return [
(rr_type, value)
for rr_type in dict_value_lists_by_type.keys()
fo... | true | true |
f75388ed90a97a175c03c41f8e61ac83804a22f9 | 58,932 | py | Python | buildscripts/idl/idl/generator.py | MartinNeupauer/mongo | 6cc2dfe7edd312b8596355edef454e15988e350e | [
"Apache-2.0"
] | null | null | null | buildscripts/idl/idl/generator.py | MartinNeupauer/mongo | 6cc2dfe7edd312b8596355edef454e15988e350e | [
"Apache-2.0"
] | 2 | 2021-03-26T00:01:11.000Z | 2021-03-26T00:02:19.000Z | buildscripts/idl/idl/generator.py | MartinNeupauer/mongo | 6cc2dfe7edd312b8596355edef454e15988e350e | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017 MongoDB Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARR... | 41.944484 | 120 | 0.605749 |
from __future__ import absolute_import, print_function, unicode_literals
from abc import ABCMeta, abstractmethod
import io
import os
import string
import sys
import textwrap
from typing import cast, List, Mapping, Union
from . import ast
from . import bson
from . import common
from . import cpp_types
from . import e... | true | true |
f753891c6c91db42c36a2337c49d34d45b7e940a | 8,479 | py | Python | test/functional/wallet_import_rescan.py | Nomadic-Official/nomadic-nomd-coin | e9f758e5d43b9024c1ef876c2888934be08d4edd | [
"MIT"
] | null | null | null | test/functional/wallet_import_rescan.py | Nomadic-Official/nomadic-nomd-coin | e9f758e5d43b9024c1ef876c2888934be08d4edd | [
"MIT"
] | null | null | null | test/functional/wallet_import_rescan.py | Nomadic-Official/nomadic-nomd-coin | e9f758e5d43b9024c1ef876c2888934be08d4edd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 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 wallet import RPCs.
Test rescan behavior of importaddress, importpubkey, importprivkey, and
impor... | 47.368715 | 116 | 0.666352 |
from test_framework.test_framework import NomadicTestFramework
from test_framework.util import (assert_raises_rpc_error, connect_nodes, sync_blocks, assert_equal, set_node_times)
import collections
import enum
import itertools
Call = enum.Enum("Call", "single")
Data = enum.Enum("Data", "address pub priv")
Rescan = e... | true | true |
f7538965798e8d969d170b517516787d2cb269bc | 3,631 | py | Python | verification/tests.py | sim00/checkio-mission-dna-split-sort | a3149c68cf3518c6184dbd0a356f5b7705b954f3 | [
"MIT"
] | null | null | null | verification/tests.py | sim00/checkio-mission-dna-split-sort | a3149c68cf3518c6184dbd0a356f5b7705b954f3 | [
"MIT"
] | null | null | null | verification/tests.py | sim00/checkio-mission-dna-split-sort | a3149c68cf3518c6184dbd0a356f5b7705b954f3 | [
"MIT"
] | null | null | null | """
TESTS is a dict with all you tests.
Keys for this will be categories' names.
Each test is dict with
"input" -- input data for user function
"answer" -- your right answer
"explanation" -- not necessary key, it's using for additional info in animation.
"""
TESTS = {
"Basics": [
{
... | 36.676768 | 119 | 0.619389 |
TESTS = {
"Basics": [
{
"input": ['ACGGCATAACCCTCGA', 3],
"answer": "ACGCCCTAATCGGCA"},
{
"input": ['ACGTTGCAACGTAGCT', 4],
"answer": "ACGTACGTAGCTTGCA"},
{
"input": ['CGTAGCA', 1],
"answer": "CGTAGCA"},
{
... | true | true |
f753899d8babe5fcd211276b346bbb6122a752fc | 2,514 | py | Python | vn_re/formats/tlg0.py | Forlos/vn_re | cce0798ad2771034cee74d1ea92d70efd2a4d27d | [
"MIT"
] | 3 | 2020-12-14T08:12:36.000Z | 2021-09-02T12:38:13.000Z | vn_re/formats/tlg0.py | Forlos/vn_re | cce0798ad2771034cee74d1ea92d70efd2a4d27d | [
"MIT"
] | null | null | null | vn_re/formats/tlg0.py | Forlos/vn_re | cce0798ad2771034cee74d1ea92d70efd2a4d27d | [
"MIT"
] | null | null | null | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
from kaitaistruct import __version__ as ks_version, KaitaiStruct, KaitaiStream, BytesIO
if parse_version(ks_version) < parse_version('0.7'):
raise Exception("Incompatible Kai... | 35.408451 | 118 | 0.651949 |
from pkg_resources import parse_version
from kaitaistruct import __version__ as ks_version, KaitaiStruct, KaitaiStream, BytesIO
if parse_version(ks_version) < parse_version('0.7'):
raise Exception("Incompatible Kaitai Struct Python API: 0.7 or later is required, but you have %s" % (ks_version))
class Tlg0(Kaita... | true | true |
f75389cb67d6953fa94f75ece564e3c4c58ed566 | 4,015 | py | Python | graphite_beacon/core.py | Asana/graphite-beacon | 9433e653ceb943f60502101ee18d347e16e3258e | [
"MIT"
] | null | null | null | graphite_beacon/core.py | Asana/graphite-beacon | 9433e653ceb943f60502101ee18d347e16e3258e | [
"MIT"
] | 1 | 2021-06-27T10:32:11.000Z | 2021-06-27T10:32:11.000Z | graphite_beacon/core.py | isabella232/graphite-beacon | 9433e653ceb943f60502101ee18d347e16e3258e | [
"MIT"
] | 1 | 2021-06-27T10:26:06.000Z | 2021-06-27T10:26:06.000Z | import os
from re import compile as re, M
import json
from tornado import ioloop, log
from .alerts import BaseAlert
from .utils import parse_interval
from .handlers import registry
LOGGER = log.gen_log
COMMENT_RE = re('//\s+.*$', M)
class Reactor(object):
""" Class description. """
defaults = {
... | 31.614173 | 91 | 0.567123 | import os
from re import compile as re, M
import json
from tornado import ioloop, log
from .alerts import BaseAlert
from .utils import parse_interval
from .handlers import registry
LOGGER = log.gen_log
COMMENT_RE = re('//\s+.*$', M)
class Reactor(object):
defaults = {
'auth_password': None,
... | true | true |
f7538af683624f6039c003c4ab362454ee98952f | 487 | py | Python | exercises/zh/solution_01_11.py | dwinston/spacy-course | af72ded52d24dd28194f82935dbce663365f485f | [
"MIT"
] | null | null | null | exercises/zh/solution_01_11.py | dwinston/spacy-course | af72ded52d24dd28194f82935dbce663365f485f | [
"MIT"
] | null | null | null | exercises/zh/solution_01_11.py | dwinston/spacy-course | af72ded52d24dd28194f82935dbce663365f485f | [
"MIT"
] | null | null | null | import spacy
# 导入Matcher
from spacy.matcher import Matcher
nlp = spacy.load("en_core_web_sm")
doc = nlp("Upcoming iPhone X release date leaked as Apple reveals pre-orders")
# 用模型分享的词汇表初始化Matcher
matcher = Matcher(nlp.vocab)
# 创建一个模板来匹配这两个词符:"iPhone"和"X"
pattern = [{"TEXT": "iPhone"}, {"TEXT": "X"}]
# 把模板加入到matcher... | 23.190476 | 78 | 0.735113 | import spacy
from spacy.matcher import Matcher
nlp = spacy.load("en_core_web_sm")
doc = nlp("Upcoming iPhone X release date leaked as Apple reveals pre-orders")
matcher = Matcher(nlp.vocab)
pattern = [{"TEXT": "iPhone"}, {"TEXT": "X"}]
matcher.add("IPHONE_X_PATTERN", None, pattern)
matches = matcher(doc)
print("M... | true | true |
f7538af9f4b00cc9068d0ea6dceca7d65c3859ee | 7,819 | py | Python | scripts/experiments/roar.py | jjbrophy47/tree_deletion | 97041d129da335de3018b3243bc81943088abf24 | [
"Apache-2.0"
] | 1 | 2020-07-16T22:25:48.000Z | 2020-07-16T22:25:48.000Z | scripts/experiments/roar.py | jjbrophy47/tree_deletion | 97041d129da335de3018b3243bc81943088abf24 | [
"Apache-2.0"
] | null | null | null | scripts/experiments/roar.py | jjbrophy47/tree_deletion | 97041d129da335de3018b3243bc81943088abf24 | [
"Apache-2.0"
] | null | null | null | """
Remove and Retrain (ROAR) experiment.
"""
import os
import sys
import time
import argparse
from datetime import datetime
import numpy as np
here = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, here + '/../../')
sys.path.insert(0, here + '/../')
import dare
from utility import data_util
from utilit... | 36.032258 | 105 | 0.650083 | import os
import sys
import time
import argparse
from datetime import datetime
import numpy as np
here = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, here + '/../../')
sys.path.insert(0, here + '/../')
import dare
from utility import data_util
from utility import exp_util
from utility import print_ut... | true | true |
f7538bf0cc6f7199ecbffee8be1e2d70a97b1524 | 3,717 | py | Python | data/dataset_utils_test.py | iostermann/deeplab2 | 68822b0c76c2c757a11402ac597711f926990f04 | [
"Apache-2.0"
] | 587 | 2021-06-21T17:10:17.000Z | 2022-03-30T11:51:38.000Z | data/dataset_utils_test.py | Niklas-AD/deeplab2 | e0f7eecfac5d35c3e9e66f061098d5f5f15a7152 | [
"Apache-2.0"
] | 73 | 2021-06-23T08:42:22.000Z | 2022-03-28T07:06:35.000Z | data/dataset_utils_test.py | Niklas-AD/deeplab2 | e0f7eecfac5d35c3e9e66f061098d5f5f15a7152 | [
"Apache-2.0"
] | 89 | 2021-06-22T02:21:32.000Z | 2022-03-29T17:51:21.000Z | # coding=utf-8
# Copyright 2021 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 40.846154 | 80 | 0.692225 |
import numpy as np
import tensorflow as tf
from deeplab2.data import dataset_utils
class DatasetUtilsTest(tf.test.TestCase):
def _get_test_labels(self, num_classes, shape, label_divisor):
num_ids_per_class = 35
semantic_labels = np.random.randint(num_classes, size=shape)
panoptic_labels = np.random.... | true | true |
f7538c1d17d2e28b5042d0597069a3b59599f0ae | 5,538 | py | Python | .last_tmp.py | Dikaeinstein/Abyteofpython_exercises | 93d78a7d2e82c10092d7e149f0a9a1e804dfd601 | [
"MIT"
] | null | null | null | .last_tmp.py | Dikaeinstein/Abyteofpython_exercises | 93d78a7d2e82c10092d7e149f0a9a1e804dfd601 | [
"MIT"
] | null | null | null | .last_tmp.py | Dikaeinstein/Abyteofpython_exercises | 93d78a7d2e82c10092d7e149f0a9a1e804dfd601 | [
"MIT"
] | null | null | null | import pickle, cwd
class Contact:
"""Represents a persons contact.
Attributes: name, phone_no, email.
"""
def __init__(self, name, number, email=None):
"""Initialize instance fields."""
self.__name = name
self.__phone_no = number
self.__email = email
def __... | 26.625 | 72 | 0.479957 | import pickle, cwd
class Contact:
def __init__(self, name, number, email=None):
self.__name = name
self.__phone_no = number
self.__email = email
def __str__(self):
return """\
Name: {0}
Phone Number: {1}
Email: {2}
""".format(self.__name, self.__phone_no, self.__email)
... | true | true |
f7538db127fc799df2b250a996be5e02d585ecb7 | 6,900 | py | Python | Exercises/search_exercises/pacman/search.py | ymazari/artificial-intelligence | b55ca58e394b5ff979fb3b82f0e8a711b78acbbd | [
"MIT"
] | null | null | null | Exercises/search_exercises/pacman/search.py | ymazari/artificial-intelligence | b55ca58e394b5ff979fb3b82f0e8a711b78acbbd | [
"MIT"
] | null | null | null | Exercises/search_exercises/pacman/search.py | ymazari/artificial-intelligence | b55ca58e394b5ff979fb3b82f0e8a711b78acbbd | [
"MIT"
] | null | null | null | # search.py
# ---------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu.
#
# A... | 34.158416 | 104 | 0.66913 |
from collections import defaultdict
import numpy as np
import util
class SearchProblem:
def getStartState(self):
util.raiseNotDefined()
def isGoalState(self, state):
util.raiseNotDefined()
def getSuccessors(self, state):
util.raiseNotDefined()
def getCostOfActions(self... | true | true |
f7538e3f798d17d39b9624244df1c0b119958cc1 | 3,076 | py | Python | github_leaderboard/users/tests/test_views.py | f0lie/github-leaderboard | b632e55311d0920ca0d1d1768758667e0459310a | [
"Apache-2.0"
] | 2 | 2021-03-01T18:28:59.000Z | 2021-03-08T18:05:55.000Z | github_leaderboard/users/tests/test_views.py | f0lie/github-leaderboard | b632e55311d0920ca0d1d1768758667e0459310a | [
"Apache-2.0"
] | 34 | 2021-02-17T18:03:56.000Z | 2022-03-01T20:09:59.000Z | github_leaderboard/users/tests/test_views.py | f0lie/github-leaderboard | b632e55311d0920ca0d1d1768758667e0459310a | [
"Apache-2.0"
] | 3 | 2021-02-17T19:52:06.000Z | 2021-08-01T12:53:48.000Z | import pytest
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import AnonymousUser
from django.contrib.messages.middleware import MessageMiddleware
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import RequestFactory
from django.url... | 31.387755 | 75 | 0.689857 | import pytest
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import AnonymousUser
from django.contrib.messages.middleware import MessageMiddleware
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import RequestFactory
from django.url... | true | true |
f7538f0837c678fec07f97acc5878e1c8153f5a3 | 148,692 | py | Python | python/tvm/relay/frontend/pytorch.py | jwfromm/relax | f120282007778706199243ee88b50697c2b9550c | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/frontend/pytorch.py | jwfromm/relax | f120282007778706199243ee88b50697c2b9550c | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/frontend/pytorch.py | jwfromm/relax | f120282007778706199243ee88b50697c2b9550c | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.425623 | 120 | 0.578599 | import functools
import itertools
import math
import sys
import logging
import numpy as np
import tvm
from tvm.ir import IRModule
from tvm.topi.utils import get_const_tuple
from .. import analysis as _analysis
from .. import expr as _expr
from .. import function as _function
from .. import op as _op
from .. import qn... | true | true |
f753912202bce4bcbdf6842ca61debd3b0815ca7 | 2,893 | py | Python | test/test_utils.py | rikroe/bimmer_connected | d77b081bc30fb6762421af49019dae876fba2b28 | [
"Apache-2.0"
] | null | null | null | test/test_utils.py | rikroe/bimmer_connected | d77b081bc30fb6762421af49019dae876fba2b28 | [
"Apache-2.0"
] | 1 | 2021-11-25T03:13:24.000Z | 2021-11-25T03:13:24.000Z | test/test_utils.py | rikroe/bimmer_connected | d77b081bc30fb6762421af49019dae876fba2b28 | [
"Apache-2.0"
] | null | null | null | """Tests for ConnectedDriveAccount."""
import datetime
import logging
import os
import time
import unittest
from unittest.mock import Mock
import time_machine
from bimmer_connected.country_selector import get_region_from_name, valid_regions
from bimmer_connected.utils import get_class_property_names, parse_datetime, ... | 32.875 | 112 | 0.637401 | import datetime
import logging
import os
import time
import unittest
from unittest.mock import Mock
import time_machine
from bimmer_connected.country_selector import get_region_from_name, valid_regions
from bimmer_connected.utils import get_class_property_names, parse_datetime, to_json
from . import RESPONSE_DIR, VI... | true | true |
f75393a21e190b1cab34abb65f87580582468fc0 | 451 | bzl | Python | nullaway/workspace.bzl | prashantsharma04/bazel_java_rules | 4f80fbe70e1778aa8e3e0ee8aa2f1efc3e44a462 | [
"Apache-2.0"
] | 1 | 2020-10-22T06:44:10.000Z | 2020-10-22T06:44:10.000Z | nullaway/workspace.bzl | prashantsharma04/bazel_java_rules | 4f80fbe70e1778aa8e3e0ee8aa2f1efc3e44a462 | [
"Apache-2.0"
] | 5 | 2020-06-01T22:33:59.000Z | 2020-11-01T17:03:06.000Z | nullaway/workspace.bzl | prashantsharma04/bazel_java_rules | 4f80fbe70e1778aa8e3e0ee8aa2f1efc3e44a462 | [
"Apache-2.0"
] | 1 | 2020-08-17T07:42:21.000Z | 2020-08-17T07:42:21.000Z | load("@rules_jvm_external//:specs.bzl", "maven")
def nullaway_workspace():
"""Defines the Nullaway dependencies, to be loaded with maven_install"""
return [
maven.artifact(
group = "com.uber.nullaway",
artifact = "nullaway",
version = "0.7.10",
),
mav... | 28.1875 | 76 | 0.518847 | load("@rules_jvm_external//:specs.bzl", "maven")
def nullaway_workspace():
return [
maven.artifact(
group = "com.uber.nullaway",
artifact = "nullaway",
version = "0.7.10",
),
maven.artifact(
group = "com.google.guava",
artifact = "... | true | true |
f75394099f20c020ca8d379fa26f9df484dca925 | 635 | py | Python | missing-data-one-hot-encoding.py | alexandresalvatierra/python-data-preprocessing | 48c3f465db0b5b5785d217d0f8c9524bb3980c48 | [
"MIT"
] | null | null | null | missing-data-one-hot-encoding.py | alexandresalvatierra/python-data-preprocessing | 48c3f465db0b5b5785d217d0f8c9524bb3980c48 | [
"MIT"
] | null | null | null | missing-data-one-hot-encoding.py | alexandresalvatierra/python-data-preprocessing | 48c3f465db0b5b5785d217d0f8c9524bb3980c48 | [
"MIT"
] | null | null | null | import pandas as pd
pd.set_option( 'display.max_columns', 24 )
file_path = 'C:/Users/profAlexandre/Desktop/inteligencia artificial/data-preprocessing/dataset/'
file_name = 'traffic-collision-data-from-2010-to-present.csv'
df = pd.read_csv( file_path + file_name )
# show head from dataset
#print( df.head() )
# show ... | 24.423077 | 96 | 0.72126 | import pandas as pd
pd.set_option( 'display.max_columns', 24 )
file_path = 'C:/Users/profAlexandre/Desktop/inteligencia artificial/data-preprocessing/dataset/'
file_name = 'traffic-collision-data-from-2010-to-present.csv'
df = pd.read_csv( file_path + file_name )
encoding = pd.get_dummies( df['Area Name'] )
conc... | true | true |
f75394efc0ca6f8c17e6a7253d88fa0b30a483f2 | 1,045 | py | Python | binyard/plot_column.py | giprayogo/binyard | c1cfa880cb9907416da2363fa0e4ca2de920543e | [
"MIT"
] | null | null | null | binyard/plot_column.py | giprayogo/binyard | c1cfa880cb9907416da2363fa0e4ca2de920543e | [
"MIT"
] | null | null | null | binyard/plot_column.py | giprayogo/binyard | c1cfa880cb9907416da2363fa0e4ca2de920543e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# for all to often task: text data file, plot single column
import matplotlib
matplotlib.rc('axes.formatter', useoffset=False)
import matplotlib.pyplot as plt
import argparse
from numpy import arange
from numpy import loadtxt
from numpy import transpose
parser = argparse.ArgumentParser()
parser.... | 26.794872 | 71 | 0.686124 |
import matplotlib
matplotlib.rc('axes.formatter', useoffset=False)
import matplotlib.pyplot as plt
import argparse
from numpy import arange
from numpy import loadtxt
from numpy import transpose
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--file', required=True, nargs='+')
parser.add_argument('-d', '... | true | true |
f7539660ce76cc9e5b6065a116e7299e582834da | 9,731 | py | Python | tests/test_browsing_context.py | GoogleChromeLabs/bidiInChromeContext | b2a0b854bb8ac2647ad5acb6166c3fe3b7a05857 | [
"Apache-2.0"
] | 21 | 2021-06-16T10:28:02.000Z | 2021-12-16T23:46:28.000Z | tests/test_browsing_context.py | GoogleChromeLabs/bidiInChromeContext | b2a0b854bb8ac2647ad5acb6166c3fe3b7a05857 | [
"Apache-2.0"
] | 65 | 2021-06-18T11:44:47.000Z | 2022-03-28T21:22:26.000Z | tests/test_browsing_context.py | GoogleChromeLabs/bidiInChromeContext | b2a0b854bb8ac2647ad5acb6166c3fe3b7a05857 | [
"Apache-2.0"
] | 4 | 2021-06-16T11:24:58.000Z | 2021-11-18T15:36:28.000Z | # Copyright 2021 Google LLC.
# Copyright (c) Microsoft 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 a... | 31.390323 | 105 | 0.643408 |
from _helpers import *
@pytest.mark.asyncio
async def test_browsingContext_getTree_contextReturned(websocket):
result = await execute_command(websocket,
{"method": "browsingContext.getTree",
"params": {}})
[context] = result['context... | true | true |
f75398a63490b37d6f1046f385b5633059c0b293 | 189 | py | Python | droptopus/config.py | ArtBIT/Droptopus | c7eb6c36ec66c88ef8c75823bfaa74f2cf53601a | [
"MIT"
] | 2 | 2018-02-13T14:42:38.000Z | 2018-02-15T12:24:24.000Z | droptopus/config.py | ArtBIT/Droptopus | c7eb6c36ec66c88ef8c75823bfaa74f2cf53601a | [
"MIT"
] | 1 | 2021-06-01T23:37:13.000Z | 2021-06-01T23:37:13.000Z | droptopus/config.py | ArtBIT/Droptopus | c7eb6c36ec66c88ef8c75823bfaa74f2cf53601a | [
"MIT"
] | null | null | null | import os
ORG_NAME = "B1T"
ORG_DOMAIN = "bit.co.rs"
APP_NAME = "Droptopus"
APP_DIR = os.path.dirname(os.path.realpath(os.path.join(__file__)))
ASSETS_DIR = os.path.join(APP_DIR, "assets")
| 23.625 | 67 | 0.730159 | import os
ORG_NAME = "B1T"
ORG_DOMAIN = "bit.co.rs"
APP_NAME = "Droptopus"
APP_DIR = os.path.dirname(os.path.realpath(os.path.join(__file__)))
ASSETS_DIR = os.path.join(APP_DIR, "assets")
| true | true |
f753995281a24f16db84e7152c5605fecda0bb32 | 18,541 | py | Python | google/cloud/language/v1beta2/language-v1beta2-py/google/cloud/language_v1beta2/services/language_service/transports/grpc_asyncio.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/language/v1beta2/language-v1beta2-py/google/cloud/language_v1beta2/services/language_service/transports/grpc_asyncio.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/language/v1beta2/language-v1beta2-py/google/cloud/language_v1beta2/services/language_service/transports/grpc_asyncio.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 46.236908 | 98 | 0.64085 | import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import gapic_v1 from google.api_core import grpc_helpers_async from google.auth import credentials as ga_credentials from google.auth.transport.grpc import SslCredentials imp... | true | true |
f753998aa3158a241a0ceec23d78f154db2b082b | 89 | py | Python | cwKen/soloApp/apps.py | cs-fullstack-2019-spring/django-intro1-cw-rsalcido | e212a5a6504169e38beb8b6b082fc1f9080c587b | [
"Apache-2.0"
] | null | null | null | cwKen/soloApp/apps.py | cs-fullstack-2019-spring/django-intro1-cw-rsalcido | e212a5a6504169e38beb8b6b082fc1f9080c587b | [
"Apache-2.0"
] | null | null | null | cwKen/soloApp/apps.py | cs-fullstack-2019-spring/django-intro1-cw-rsalcido | e212a5a6504169e38beb8b6b082fc1f9080c587b | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class SoloappConfig(AppConfig):
name = 'soloApp'
| 14.833333 | 33 | 0.752809 | from django.apps import AppConfig
class SoloappConfig(AppConfig):
name = 'soloApp'
| true | true |
f7539a2d92f94454b04b60133424c71f33f591d7 | 46,953 | py | Python | yandex/cloud/serverless/triggers/v1/trigger_service_pb2.py | korsar182/python-sdk | 873bf2a9b136a8f2faae72e86fae1f5b5c3d896a | [
"MIT"
] | 36 | 2018-12-23T13:51:50.000Z | 2022-03-25T07:48:24.000Z | yandex/cloud/serverless/triggers/v1/trigger_service_pb2.py | korsar182/python-sdk | 873bf2a9b136a8f2faae72e86fae1f5b5c3d896a | [
"MIT"
] | 15 | 2019-02-28T04:55:09.000Z | 2022-03-06T23:17:24.000Z | yandex/cloud/serverless/triggers/v1/trigger_service_pb2.py | korsar182/python-sdk | 873bf2a9b136a8f2faae72e86fae1f5b5c3d896a | [
"MIT"
] | 18 | 2019-02-23T07:10:57.000Z | 2022-03-28T14:41:08.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: yandex/cloud/serverless/triggers/v1/trigger_service.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import r... | 48.355304 | 5,462 | 0.779865 | from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from google.protobuf import field_mask_pb2 as google_dot_pro... | true | true |
f7539be820e61c661f30d5a70e101668e6921a52 | 1,535 | py | Python | src/sentry/api/endpoints/organization_release_commits.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 2 | 2019-03-04T12:45:54.000Z | 2019-03-04T12:45:55.000Z | src/sentry/api/endpoints/organization_release_commits.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 196 | 2019-06-10T08:34:10.000Z | 2022-02-22T01:26:13.000Z | src/sentry/api/endpoints/organization_release_commits.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 1 | 2017-02-09T06:36:57.000Z | 2017-02-09T06:36:57.000Z | from __future__ import absolute_import
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationReleasesBaseEndpoint
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.api.serializers import serialize
from sentry.models import Release, ReleaseCommit
class Organizat... | 34.886364 | 82 | 0.637785 | from __future__ import absolute_import
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationReleasesBaseEndpoint
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.api.serializers import serialize
from sentry.models import Release, ReleaseCommit
class Organizat... | true | true |
f7539c22b27e266faf1113b4620616237c51750a | 8,343 | py | Python | src/sentry/pipeline/__init__.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | src/sentry/pipeline/__init__.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/pipeline/__init__.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, print_function
import logging
from types import LambdaType
from sentry.models import Organization
from sentry.web.frontend.base import BaseView
from sentry.utils.session_store import RedisSessionStore
from sentry.utils.hashlib import md5_text
from sentry.web.helpers import ren... | 32.846457 | 99 | 0.659954 | from __future__ import absolute_import, print_function
import logging
from types import LambdaType
from sentry.models import Organization
from sentry.web.frontend.base import BaseView
from sentry.utils.session_store import RedisSessionStore
from sentry.utils.hashlib import md5_text
from sentry.web.helpers import ren... | true | true |
f7539ce8cc496ed24dc9d6e80ff476a216603dca | 2,229 | py | Python | tools/processing_tool_ensemble_maker/lib_utils_time.py | c-hydro/hmc | 66470234e126e4a727e1faf2fe64bd58547220ed | [
"MIT"
] | null | null | null | tools/processing_tool_ensemble_maker/lib_utils_time.py | c-hydro/hmc | 66470234e126e4a727e1faf2fe64bd58547220ed | [
"MIT"
] | 2 | 2021-07-08T13:10:33.000Z | 2021-07-08T13:11:33.000Z | tools/processing_tool_ensemble_maker/lib_utils_time.py | c-hydro/hmc | 66470234e126e4a727e1faf2fe64bd58547220ed | [
"MIT"
] | null | null | null | """
Library Features:
Name: lib_utils_time
Author(s): Fabio Delogu (fabio.delogu@cimafoundation.org)
Date: '20211208'
Version: '1.0.0'
"""
#######################################################################################
# Libraries
import logging
import pandas as pd
from datetime im... | 35.380952 | 104 | 0.551817 |
import logging
import pandas as pd
from datetime import date
from tools.processing_tool_datasets_merger.lib_info_args import logger_name
log_stream = logging.getLogger(logger_name)
def set_time(time_run_args=None, time_run_file=None, time_format='%Y-%m-%d %H:$M',
time_period=1, time_frequency='H', time... | true | true |
f7539d16f567f152b81833edbd586853ee1650dd | 4,921 | py | Python | built-in/PyTorch/Official/cv/image_object_detection/YoloV3_ID1790_for_PyTorch/mmcv_need/distributed.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | built-in/PyTorch/Official/cv/image_object_detection/YoloV3_ID1790_for_PyTorch/mmcv_need/distributed.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | built-in/PyTorch/Official/cv/image_object_detection/YoloV3_ID1790_for_PyTorch/mmcv_need/distributed.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 41.70339 | 78 | 0.623654 |
import torch
from torch.nn.parallel.distributed import (DistributedDataParallel,
_find_tensors)
from mmcv import print_log
from mmcv.utils import TORCH_VERSION
from .scatter_gather import scatter_kwargs
class MMDistributedDataParallel(DistributedDataParallel):
def sca... | true | true |
f7539df3220db631b4adebda8118a613e46fdb9e | 7,524 | py | Python | examples/contrib/message_parser.py | CS536-Modbus-QUIC/pymodbus | 337d090f04922c9440913927593f26cd9388b141 | [
"BSD-3-Clause"
] | null | null | null | examples/contrib/message_parser.py | CS536-Modbus-QUIC/pymodbus | 337d090f04922c9440913927593f26cd9388b141 | [
"BSD-3-Clause"
] | null | null | null | examples/contrib/message_parser.py | CS536-Modbus-QUIC/pymodbus | 337d090f04922c9440913927593f26cd9388b141 | [
"BSD-3-Clause"
] | 1 | 2021-04-14T17:30:19.000Z | 2021-04-14T17:30:19.000Z | #!/usr/bin/env python
"""
Modbus Message Parser
--------------------------------------------------------------------------
The following is an example of how to parse modbus messages
using the supplied framers for a number of protocols:
* tcp
* ascii
* rtu
* binary
"""
# ----------------------------------------------... | 34.2 | 79 | 0.505715 | from __future__ import print_function
import collections
import textwrap
from optparse import OptionParser
import codecs as c
from pymodbus.factory import ClientDecoder, ServerDecoder
from pymodbus.transaction import ModbusSocketFramer
from pymodbus.transaction import ModbusBinaryFramer
from pymodbus.transaction impor... | true | true |
f7539e130f6072a29629acd5217da3cf515ada6e | 1,896 | py | Python | configLane.py | calhewitt/LANE | 412c3d465e6a459714f7a4a7ca4de30e571e0220 | [
"BSD-2-Clause"
] | null | null | null | configLane.py | calhewitt/LANE | 412c3d465e6a459714f7a4a7ca4de30e571e0220 | [
"BSD-2-Clause"
] | null | null | null | configLane.py | calhewitt/LANE | 412c3d465e6a459714f7a4a7ca4de30e571e0220 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python2
# Automatically helps the user setup a lane config.ini
import sys, os
configTemplate = """\
########################THIS-FILE-IS-GENERATED-BY-CONFIGLANE###################
# A configuration file for the plugin manager to use for managing the modules
# Format is a simple windows INI style
# The... | 25.972603 | 97 | 0.720992 |
import sys, os
configTemplate = """\
########################THIS-FILE-IS-GENERATED-BY-CONFIGLANE###################
# A configuration file for the plugin manager to use for managing the modules
# Format is a simple windows INI style
# The configuration is case-sensitive
# Language is the name of the programming lan... | false | true |
f7539f946be1d5565a9e1303867c337abf15ea33 | 1,306 | py | Python | rlmolecule/tree_search/metrics.py | NREL/rlmolecule | 7e98dca49ea82bf9d14164955d82adfa8bbc2d64 | [
"BSD-3-Clause"
] | 16 | 2020-12-28T21:45:09.000Z | 2022-03-19T12:03:58.000Z | rlmolecule/tree_search/metrics.py | NREL/rlmolecule | 7e98dca49ea82bf9d14164955d82adfa8bbc2d64 | [
"BSD-3-Clause"
] | 56 | 2020-12-30T16:12:33.000Z | 2022-02-02T18:32:44.000Z | rlmolecule/tree_search/metrics.py | NREL/rlmolecule | 7e98dca49ea82bf9d14164955d82adfa8bbc2d64 | [
"BSD-3-Clause"
] | 7 | 2021-01-05T01:34:04.000Z | 2021-09-29T13:42:44.000Z | from collections import defaultdict
from functools import wraps
from time import time
from typing import Callable
class CallMetrics(object):
def __init__(self):
self.start_time = time()
self.execution_time = defaultdict(lambda: 0.)
self.execution_count = defaultdict(lambda: 0)
def res... | 29.022222 | 87 | 0.67075 | from collections import defaultdict
from functools import wraps
from time import time
from typing import Callable
class CallMetrics(object):
def __init__(self):
self.start_time = time()
self.execution_time = defaultdict(lambda: 0.)
self.execution_count = defaultdict(lambda: 0)
def res... | true | true |
f753a00c3f474def7e7c18bd1f8015d0b028b695 | 1,256 | py | Python | tests/procs/test_specs.py | hemna/xonsh | 86c4dec1bb5df1905b65ef553b06fdb5c76b20a8 | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2020-11-01T13:51:47.000Z | 2021-03-21T03:40:18.000Z | tests/procs/test_specs.py | hemna/xonsh | 86c4dec1bb5df1905b65ef553b06fdb5c76b20a8 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tests/procs/test_specs.py | hemna/xonsh | 86c4dec1bb5df1905b65ef553b06fdb5c76b20a8 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | """Tests the xonsh.procs.specs"""
from subprocess import Popen
import pytest
from xonsh.procs.specs import cmds_to_specs
from xonsh.environ import Env
from xonsh.procs.posix import PopenThread
from xonsh.procs.proxies import ProcProxy, ProcProxyThread
from .tools import skip_if_on_windows
@skip_if_on_windows
def ... | 33.052632 | 60 | 0.745223 | from subprocess import Popen
import pytest
from xonsh.procs.specs import cmds_to_specs
from xonsh.environ import Env
from xonsh.procs.posix import PopenThread
from xonsh.procs.proxies import ProcProxy, ProcProxyThread
from .tools import skip_if_on_windows
@skip_if_on_windows
def test_cmds_to_specs_thread_subproc(... | true | true |
f753a0321f5037312b92e8e8eece4c1cf3e6f223 | 32,941 | py | Python | tests/unit/test_key.py | sandboxxapp/python-ndb | 8d3ce5c6cce9055d21400aa9feebc99e66393667 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_key.py | sandboxxapp/python-ndb | 8d3ce5c6cce9055d21400aa9feebc99e66393667 | [
"Apache-2.0"
] | 3 | 2020-01-09T15:47:26.000Z | 2021-04-30T21:03:34.000Z | webhook/venv/lib/python3.7/site-packages/tests/unit/test_key.py | tlgevers/dialogflow-chatbot-python | da159cee4efee29e57a60bf8d6cf829cb2d828a6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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 agreed to in writing, ... | 33.139839 | 79 | 0.61343 |
import base64
import pickle
try:
from unittest import mock
except ImportError: import mock
from google.cloud.datastore import _app_engine_key_pb2
import google.cloud.datastore
import pytest
from google.cloud.ndb import exceptions
from google.cloud.ndb import key as key_module
from google.cloud.ndb import m... | true | true |
f753a1163a55fd080dc3cd68efc78c308c6e062e | 5,648 | py | Python | homeassistant/components/netatmo/media_source.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/netatmo/media_source.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/netatmo/media_source.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Netatmo Media Source Implementation."""
from __future__ import annotations
import datetime as dt
import logging
import re
from homeassistant.components.media_player.const import (
MEDIA_CLASS_DIRECTORY,
MEDIA_CLASS_VIDEO,
MEDIA_TYPE_VIDEO,
)
from homeassistant.components.media_player.errors import Brow... | 32.837209 | 87 | 0.615793 | from __future__ import annotations
import datetime as dt
import logging
import re
from homeassistant.components.media_player.const import (
MEDIA_CLASS_DIRECTORY,
MEDIA_CLASS_VIDEO,
MEDIA_TYPE_VIDEO,
)
from homeassistant.components.media_player.errors import BrowseError
from homeassistant.components.media... | true | true |
f753a206904e709e9723bcc297fdbf81fbde19e0 | 609 | py | Python | app/auth/email.py | sateesh2020/microblog-flask | f2d1c684d740e4df4b92abb940b8aef5f060c849 | [
"MIT"
] | null | null | null | app/auth/email.py | sateesh2020/microblog-flask | f2d1c684d740e4df4b92abb940b8aef5f060c849 | [
"MIT"
] | 1 | 2021-06-02T00:21:29.000Z | 2021-06-02T00:21:29.000Z | app/auth/email.py | pointerboy/ModHub | 5b2bdf31bdf409c677e1009f879794f91e636a7b | [
"MIT"
] | null | null | null | from flask import render_template, current_app
from flask_babel import _
from app.email import send_email
def send_password_reset_email(user):
token = user.get_reset_password_token()
send_email(_('[Microblog] Reset Your Password'),
sender=current_app.config['ADMINS'][0],
recipie... | 38.0625 | 69 | 0.609195 | from flask import render_template, current_app
from flask_babel import _
from app.email import send_email
def send_password_reset_email(user):
token = user.get_reset_password_token()
send_email(_('[Microblog] Reset Your Password'),
sender=current_app.config['ADMINS'][0],
recipie... | true | true |
f753a2b126d2019568fa39ffd3f40ff472c4a259 | 3,268 | py | Python | update_manifest.py | wfraser/dropbox-sdk-rust | 9c844b42884bcb32ba51760b7d611087fccbabf2 | [
"Apache-2.0"
] | 46 | 2019-09-08T10:57:15.000Z | 2022-01-05T09:57:46.000Z | update_manifest.py | dropbox/dropbox-sdk-rust | 9c844b42884bcb32ba51760b7d611087fccbabf2 | [
"Apache-2.0"
] | 18 | 2020-01-13T21:00:16.000Z | 2022-02-28T18:04:23.000Z | update_manifest.py | wfraser/dropbox-sdk-rust | 9c844b42884bcb32ba51760b7d611087fccbabf2 | [
"Apache-2.0"
] | 12 | 2019-09-10T21:06:31.000Z | 2022-02-17T13:02:36.000Z | #!/usr/bin/env python3
import argparse
import os
import sys
from typing import Dict, Set
from generate import spec_files
def update_manifest(stone_root: str):
stone_files = spec_files(stone_root)
deps: Dict[str, Set[str]] = {}
for filepath in stone_files:
module = None
with open(filepath... | 33.346939 | 95 | 0.48623 |
import argparse
import os
import sys
from typing import Dict, Set
from generate import spec_files
def update_manifest(stone_root: str):
stone_files = spec_files(stone_root)
deps: Dict[str, Set[str]] = {}
for filepath in stone_files:
module = None
with open(filepath) as f:
for... | true | true |
f753a5080fc68a40a6ef32fd98ddc29a3a9f83b6 | 2,339 | py | Python | src/using_multiprocessing.py | ariannasg/optimizing-python | e6c307dc694bc98c776faea1dbd7f420c2928f64 | [
"MIT"
] | null | null | null | src/using_multiprocessing.py | ariannasg/optimizing-python | e6c307dc694bc98c776faea1dbd7f420c2928f64 | [
"MIT"
] | null | null | null | src/using_multiprocessing.py | ariannasg/optimizing-python | e6c307dc694bc98c776faea1dbd7f420c2928f64 | [
"MIT"
] | null | null | null | #!usr/bin/env python3
import bz2
from concurrent.futures import ProcessPoolExecutor
def unpack(requests):
"""Unpack a list of requests compressed in bz2"""
return [bz2.decompress(request) for request in requests]
def unpack_proc(requests):
"""Unpack a list of requests compressed in bz2 using a process p... | 37.725806 | 103 | 0.637452 | import bz2
from concurrent.futures import ProcessPoolExecutor
def unpack(requests):
return [bz2.decompress(request) for request in requests]
def unpack_proc(requests):
with ProcessPoolExecutor() as pool:
return list(pool.map(bz2.decompress, requests))
if __name__ == '__main__':
with open('... | true | true |
f753a60402220d2ed3d220c14c59c94c37f81726 | 2,134 | py | Python | day11/flash.py | JurriaanBerger/AdventOfCode2021 | 666d9b36d87bfaec3da8b700832bf0a5791b840a | [
"MIT"
] | null | null | null | day11/flash.py | JurriaanBerger/AdventOfCode2021 | 666d9b36d87bfaec3da8b700832bf0a5791b840a | [
"MIT"
] | null | null | null | day11/flash.py | JurriaanBerger/AdventOfCode2021 | 666d9b36d87bfaec3da8b700832bf0a5791b840a | [
"MIT"
] | null | null | null | import numpy as np
def read_octo():
octo_map = []
file = open('octo.txt', "r")
f1 = file.read()
file.close()
f2 = f1.split("\n")
for h in f2:
list_h = []
list_h[:0] = h
octo_map.append([int(l) for l in list_h])
return np.array(octo_map)
def energy_increase(cur... | 26.675 | 89 | 0.648079 | import numpy as np
def read_octo():
octo_map = []
file = open('octo.txt', "r")
f1 = file.read()
file.close()
f2 = f1.split("\n")
for h in f2:
list_h = []
list_h[:0] = h
octo_map.append([int(l) for l in list_h])
return np.array(octo_map)
def energy_increase(cur... | true | true |
f753a634a26348d7212a75affb23ef3d4a2e928c | 3,405 | py | Python | app/models/feedbackToProduct.py | YorkL123/516-DBMS-X-Jay | 937b97752684dec46e08e67cacc0a25e57ff8662 | [
"MIT"
] | null | null | null | app/models/feedbackToProduct.py | YorkL123/516-DBMS-X-Jay | 937b97752684dec46e08e67cacc0a25e57ff8662 | [
"MIT"
] | 1 | 2022-03-14T20:49:32.000Z | 2022-03-14T20:49:32.000Z | app/models/feedbackToProduct.py | YorkL123/516-DBMS-X-Jay | 937b97752684dec46e08e67cacc0a25e57ff8662 | [
"MIT"
] | 3 | 2022-02-07T18:18:54.000Z | 2022-03-11T22:09:01.000Z | from flask import current_app as app
class feedbackToProduct():
def __init__(self, uid, pid, rate, review, time, vote):
self.uid = uid
self.pid = pid
self.rate = rate
self.review = review
self.time = time
self.vote = vote
@staticmethod
def AddFeedbackToProdu... | 25.795455 | 65 | 0.527166 | from flask import current_app as app
class feedbackToProduct():
def __init__(self, uid, pid, rate, review, time, vote):
self.uid = uid
self.pid = pid
self.rate = rate
self.review = review
self.time = time
self.vote = vote
@staticmethod
def AddFeedbackToProdu... | true | true |
f753a6685f030ef87cc7e65dae8c3e469f6ad3df | 1,337 | py | Python | src/python/is_msgs/utils/build.py | labviros/is-msgs | d06515176a3b969d4e62dfb882400e8e2b8583c5 | [
"MIT"
] | 3 | 2019-03-28T16:50:05.000Z | 2022-03-26T20:36:03.000Z | src/python/is_msgs/utils/build.py | labviros/is-msgs | d06515176a3b969d4e62dfb882400e8e2b8583c5 | [
"MIT"
] | 6 | 2018-05-16T10:55:15.000Z | 2020-04-27T15:40:54.000Z | src/python/is_msgs/utils/build.py | labviros/is-msgs | d06515176a3b969d4e62dfb882400e8e2b8583c5 | [
"MIT"
] | 12 | 2019-12-02T15:01:08.000Z | 2021-08-30T22:16:39.000Z | from __future__ import print_function
import os
import re
import sys
import shutil
import subprocess
import is_msgs
def get_include():
return os.path.split(os.path.dirname(is_msgs.__file__))[0]
if __name__ == '__main__':
if len(sys.argv) < 2:
print('Nothing to do. No *.proto files passed on arguments.... | 34.282051 | 89 | 0.581152 | from __future__ import print_function
import os
import re
import sys
import shutil
import subprocess
import is_msgs
def get_include():
return os.path.split(os.path.dirname(is_msgs.__file__))[0]
if __name__ == '__main__':
if len(sys.argv) < 2:
print('Nothing to do. No *.proto files passed on arguments.... | true | true |
f753a73a7738ceabc54d822bfbb2c244fe05f0e6 | 912 | py | Python | diayn_seq_code_revised/networks/bi_rnn_stepwise_seqwise_obs_dimension_selection.py | fgitmichael/SelfSupevisedSkillDiscovery | 60eee11cfd67046190dd2784bf40e97bdbed9d40 | [
"MIT"
] | null | null | null | diayn_seq_code_revised/networks/bi_rnn_stepwise_seqwise_obs_dimension_selection.py | fgitmichael/SelfSupevisedSkillDiscovery | 60eee11cfd67046190dd2784bf40e97bdbed9d40 | [
"MIT"
] | 6 | 2021-02-02T23:00:02.000Z | 2022-01-13T03:13:51.000Z | diayn_seq_code_revised/networks/bi_rnn_stepwise_seqwise_obs_dimension_selection.py | fgitmichael/SelfSupevisedSkillDiscovery | 60eee11cfd67046190dd2784bf40e97bdbed9d40 | [
"MIT"
] | null | null | null | from typing import Union
from diayn_rnn_seq_rnn_stepwise_classifier.networks.bi_rnn_stepwise_seqwise import \
BiRnnStepwiseSeqWiseClassifier
class RnnStepwiseSeqwiseClassifierObsDimSelect(BiRnnStepwiseSeqWiseClassifier):
def __init__(self,
*args,
input_size,
... | 30.4 | 84 | 0.631579 | from typing import Union
from diayn_rnn_seq_rnn_stepwise_classifier.networks.bi_rnn_stepwise_seqwise import \
BiRnnStepwiseSeqWiseClassifier
class RnnStepwiseSeqwiseClassifierObsDimSelect(BiRnnStepwiseSeqWiseClassifier):
def __init__(self,
*args,
input_size,
... | true | true |
f753a8000743cf6c5d252e3ed49dafbcc81bca33 | 4,582 | py | Python | ops.py | 7D24H/testGPU | d9341e1a60d51c895c7e5090990bc13920ba7257 | [
"MIT"
] | null | null | null | ops.py | 7D24H/testGPU | d9341e1a60d51c895c7e5090990bc13920ba7257 | [
"MIT"
] | null | null | null | ops.py | 7D24H/testGPU | d9341e1a60d51c895c7e5090990bc13920ba7257 | [
"MIT"
] | null | null | null |
from glob import glob
import os
import tensorflow as tf
import numpy as np
import cv2
def block_patch(input, patch_size=15, margin=5):
shape = input.get_shape().as_list()
#create patch in random size
pad_size = tf.random_uniform([2], minval=int(patch_size*0.1), maxval=patch_size, dtype=tf.int32)
patch = tf.zero... | 33.202899 | 120 | 0.709297 |
from glob import glob
import os
import tensorflow as tf
import numpy as np
import cv2
def block_patch(input, patch_size=15, margin=5):
shape = input.get_shape().as_list()
pad_size = tf.random_uniform([2], minval=int(patch_size*0.1), maxval=patch_size, dtype=tf.int32)
patch = tf.zeros([pad_size[0], pad_size[1], ... | true | true |
f753a9e2c76c975aed9c69396ce8b7736f5a3b21 | 1,584 | py | Python | src/utilities.py | ucsc-cgp/sync_agile_boards | 2f952b1d37cf301c1e4dc3d7d1240d420ca7ee5c | [
"Apache-2.0"
] | null | null | null | src/utilities.py | ucsc-cgp/sync_agile_boards | 2f952b1d37cf301c1e4dc3d7d1240d420ca7ee5c | [
"Apache-2.0"
] | 64 | 2019-02-13T19:49:33.000Z | 2019-06-26T18:21:10.000Z | src/utilities.py | ucsc-cgp/sync_agile_boards | 2f952b1d37cf301c1e4dc3d7d1240d420ca7ee5c | [
"Apache-2.0"
] | 2 | 2019-02-07T20:53:52.000Z | 2021-08-29T10:26:00.000Z | #!/usr/bin/env python3
import os
import errno
import logging
from src.issue import Issue
from settings import jira_to_zen_backlog_map, jira_to_zen_sprint_map, zen_to_jira_map, urls
logger = logging.getLogger(__name__)
def check_for_git_config(git_config_file):
"""
User must have ~/.gitconfig in home direct... | 28.285714 | 100 | 0.717172 |
import os
import errno
import logging
from src.issue import Issue
from settings import jira_to_zen_backlog_map, jira_to_zen_sprint_map, zen_to_jira_map, urls
logger = logging.getLogger(__name__)
def check_for_git_config(git_config_file):
logging.info('Checking whether .gitconfig exists on local system')
us... | true | true |
f753aa1f846e961ce28311bf770e0f514a83bf03 | 3,104 | py | Python | gui/utils.py | Lakoc/SFC_project | 00b98f0d9651138c30f567ae4775a624e511a392 | [
"Apache-2.0"
] | null | null | null | gui/utils.py | Lakoc/SFC_project | 00b98f0d9651138c30f567ae4775a624e511a392 | [
"Apache-2.0"
] | null | null | null | gui/utils.py | Lakoc/SFC_project | 00b98f0d9651138c30f567ae4775a624e511a392 | [
"Apache-2.0"
] | null | null | null | import numpy as np
def remove_values_from_list(the_list, val):
return [value for value in the_list if value != val]
def remove_values_from_list_to_float(the_list, val):
return [float(value) for value in the_list if value != val]
def load_3d_arr_from_string(arr):
arr = arr.replace('[', '').replace(']',... | 42.520548 | 120 | 0.626289 | import numpy as np
def remove_values_from_list(the_list, val):
return [value for value in the_list if value != val]
def remove_values_from_list_to_float(the_list, val):
return [float(value) for value in the_list if value != val]
def load_3d_arr_from_string(arr):
arr = arr.replace('[', '').replace(']',... | true | true |
f753ac56596df09669cb4768d27a8b3dd7aa2165 | 127 | py | Python | scripts/build_plotutils.py | 1byte2bytes/Sydney.framework | f2f390ba778397c04c168fe3072eceb8c04278a0 | [
"MIT"
] | null | null | null | scripts/build_plotutils.py | 1byte2bytes/Sydney.framework | f2f390ba778397c04c168fe3072eceb8c04278a0 | [
"MIT"
] | null | null | null | scripts/build_plotutils.py | 1byte2bytes/Sydney.framework | f2f390ba778397c04c168fe3072eceb8c04278a0 | [
"MIT"
] | null | null | null | # Copyright (c) Sydney Erickson 2017
import buildlib
import buildsettings
buildlib.build_configure("plotutils-2.6.tar.gz", "") | 25.4 | 52 | 0.787402 | import buildlib
import buildsettings
buildlib.build_configure("plotutils-2.6.tar.gz", "") | true | true |
f753acd5943a3c5943bf49e3c540ac3c622f64ae | 7,207 | py | Python | utils/Dataset.py | ASMDS/PATREC | 091df6ec20e0736340a2b2ff9a25ac81bec48259 | [
"MIT"
] | 1 | 2021-12-09T12:31:52.000Z | 2021-12-09T12:31:52.000Z | utils/Dataset.py | ASMDS/PATREC | 091df6ec20e0736340a2b2ff9a25ac81bec48259 | [
"MIT"
] | null | null | null | utils/Dataset.py | ASMDS/PATREC | 091df6ec20e0736340a2b2ff9a25ac81bec48259 | [
"MIT"
] | null | null | null |
import pandas as pd
import numpy as np
from utils.DatasetFilter import DatasetFilter
from utils.DatasetSplitter import DatasetSplitter
class Dataset:
def __init__(self, dataset_options):
self.options = dataset_options;
self.df = None;
self.columns_df = None;
self.data = None;... | 34.156398 | 144 | 0.650617 |
import pandas as pd
import numpy as np
from utils.DatasetFilter import DatasetFilter
from utils.DatasetSplitter import DatasetSplitter
class Dataset:
def __init__(self, dataset_options):
self.options = dataset_options;
self.df = None;
self.columns_df = None;
self.data = None;... | true | true |
f753aeb80a8b673012eb7b862dcecc996c0c8371 | 6,792 | py | Python | tests/nonrealtime/test_nonrealtime_misc.py | butayama/supriya | 0c197324ecee4232381221880d1f40e109bb756c | [
"MIT"
] | null | null | null | tests/nonrealtime/test_nonrealtime_misc.py | butayama/supriya | 0c197324ecee4232381221880d1f40e109bb756c | [
"MIT"
] | null | null | null | tests/nonrealtime/test_nonrealtime_misc.py | butayama/supriya | 0c197324ecee4232381221880d1f40e109bb756c | [
"MIT"
] | null | null | null | import pytest
import uqbar.strings
import supriya.assets.synthdefs
import supriya.nonrealtime
import supriya.patterns
import supriya.synthdefs
import supriya.ugens
from supriya import AddAction
with supriya.synthdefs.SynthDefBuilder(in_=0, out=0) as builder:
source = supriya.ugens.In.ar(bus=builder["in_"])
so... | 29.789474 | 77 | 0.404888 | import pytest
import uqbar.strings
import supriya.assets.synthdefs
import supriya.nonrealtime
import supriya.patterns
import supriya.synthdefs
import supriya.ugens
from supriya import AddAction
with supriya.synthdefs.SynthDefBuilder(in_=0, out=0) as builder:
source = supriya.ugens.In.ar(bus=builder["in_"])
so... | true | true |
f753b056e521cc13fd26a8144a5a287e9aeffdf2 | 85,605 | py | Python | sdk/python/pulumi_azure_nextgen/batch/v20181201/_inputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/batch/v20181201/_inputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/batch/v20181201/_inputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 53.670846 | 1,636 | 0.702844 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'ApplicationPackageReferenceArgs',
'AutoScaleSettingsArgs',
'AutoStorageBasePropertiesArgs',
'AutoUserSpecificationArgs',
'CertificateRefer... | true | true |
f753b0c9722985ffd8e27f567dde4ed39c398c77 | 8,280 | py | Python | hackerrank/2017/w28/lucky8/lucky8_2.py | bicepjai/mypuzzles | 1918700562b38320bc30f61ee2fdcf9b8f404b8d | [
"BSD-3-Clause"
] | null | null | null | hackerrank/2017/w28/lucky8/lucky8_2.py | bicepjai/mypuzzles | 1918700562b38320bc30f61ee2fdcf9b8f404b8d | [
"BSD-3-Clause"
] | null | null | null | hackerrank/2017/w28/lucky8/lucky8_2.py | bicepjai/mypuzzles | 1918700562b38320bc30f61ee2fdcf9b8f404b8d | [
"BSD-3-Clause"
] | null | null | null | from itertools import chain, combinations
from time import time
import collections
from random import randint
def powerset(iterable):
"powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)"
s = list(iterable)
return chain.from_iterable(combinations(s, r) for r in range(len(s) + 1))
... | 36 | 165 | 0.525725 | from itertools import chain, combinations
from time import time
import collections
from random import randint
def powerset(iterable):
s = list(iterable)
return chain.from_iterable(combinations(s, r) for r in range(len(s) + 1))
def lucky_8_naive(n_str):
power_set = (list(map(''.join, powerset... | true | true |
f753b0eb4aebc0ba7c5429354b5e178df404c0f6 | 71,918 | py | Python | data_generator/object_detection_2d_data_generator_custom.py | shiningsunnyday/ssd_keras | 3a2ea0ceaa676f59b1787ad5f5e8337520c7c056 | [
"Apache-2.0"
] | null | null | null | data_generator/object_detection_2d_data_generator_custom.py | shiningsunnyday/ssd_keras | 3a2ea0ceaa676f59b1787ad5f5e8337520c7c056 | [
"Apache-2.0"
] | null | null | null | data_generator/object_detection_2d_data_generator_custom.py | shiningsunnyday/ssd_keras | 3a2ea0ceaa676f59b1787ad5f5e8337520c7c056 | [
"Apache-2.0"
] | null | null | null | '''
A data generator for 2D object detection.
Copyright (C) 2018 Pierluigi Ferrari
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... | 57.858407 | 211 | 0.576629 |
from __future__ import division
import numpy as np
import inspect
from collections import defaultdict
import warnings
import sklearn.utils
from copy import deepcopy
from PIL import Image
import cv2
import csv
import os
import sys
from tqdm import tqdm, trange
try:
import h5py
except ImportError:
warnings.warn(... | true | true |
f753b2155ab8a16cd7bcf7399630ab8503588b86 | 728 | py | Python | tests/operations_test.py | GerasimovRM/influxalchemy | c6527dc99f18f58da0d2f6602759be40f24d4b44 | [
"MIT"
] | 42 | 2016-08-16T11:36:10.000Z | 2022-02-14T15:50:53.000Z | tests/operations_test.py | GerasimovRM/influxalchemy | c6527dc99f18f58da0d2f6602759be40f24d4b44 | [
"MIT"
] | 10 | 2017-02-01T16:16:06.000Z | 2022-01-21T23:25:22.000Z | tests/operations_test.py | GerasimovRM/influxalchemy | c6527dc99f18f58da0d2f6602759be40f24d4b44 | [
"MIT"
] | 6 | 2016-10-26T13:10:21.000Z | 2021-02-19T10:27:07.000Z | """ InfluxAlchemy Operations. """
from influxalchemy.operations import Operation
def test_op_init():
op = Operation(" fizz ", " buzz ")
assert op._op == " fizz "
assert op._nop == " buzz "
def test_op_str():
op = Operation(" fizz ", " buzz ")
assert str(op) == " fizz "
def test_op_repr():
... | 19.675676 | 46 | 0.56044 | from influxalchemy.operations import Operation
def test_op_init():
op = Operation(" fizz ", " buzz ")
assert op._op == " fizz "
assert op._nop == " buzz "
def test_op_str():
op = Operation(" fizz ", " buzz ")
assert str(op) == " fizz "
def test_op_repr():
op = Operation(" fizz ", " buzz ")... | true | true |
f753b2156a19046c3a177f3e633ffe6fd6b81f9f | 691 | py | Python | bigip_sdk/exceptions.py | Cloudify-PS/cloudify-bigip-plugin | 2c95003eda24c1a5678021307e0bccb4a495abee | [
"Apache-2.0"
] | null | null | null | bigip_sdk/exceptions.py | Cloudify-PS/cloudify-bigip-plugin | 2c95003eda24c1a5678021307e0bccb4a495abee | [
"Apache-2.0"
] | null | null | null | bigip_sdk/exceptions.py | Cloudify-PS/cloudify-bigip-plugin | 2c95003eda24c1a5678021307e0bccb4a495abee | [
"Apache-2.0"
] | 2 | 2018-12-03T18:58:47.000Z | 2019-04-02T21:34:34.000Z | ########
# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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... | 36.368421 | 79 | 0.735166 |
class BigipSyncException(Exception):
pass
| true | true |
f753b27c45f67944a7850c5f568f199bb2ad3651 | 173,977 | py | Python | hao/places.py | orctom/tab | 573bcaf39ad73c1ffc5532de10506ce243150f1d | [
"Apache-2.0"
] | null | null | null | hao/places.py | orctom/tab | 573bcaf39ad73c1ffc5532de10506ce243150f1d | [
"Apache-2.0"
] | null | null | null | hao/places.py | orctom/tab | 573bcaf39ad73c1ffc5532de10506ce243150f1d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import typing
TYPE_PROVINCE = 'province'
TYPE_CITY = 'city'
TYPE_DIRECT = 'direct'
TYPE_COUNTY = 'county'
class Place(object):
__slots__ = ['id', 'name', 'shorts', 'parent', 'children_type', 'children', 'enabled']
def __init__(self,
_id: str,
name: s... | 39.352409 | 131 | 0.440892 | import typing
TYPE_PROVINCE = 'province'
TYPE_CITY = 'city'
TYPE_DIRECT = 'direct'
TYPE_COUNTY = 'county'
class Place(object):
__slots__ = ['id', 'name', 'shorts', 'parent', 'children_type', 'children', 'enabled']
def __init__(self,
_id: str,
name: str,
sho... | true | true |
f753b2ee88eca648ba1ee7bcf6a8dfcd9d256538 | 804 | py | Python | evaluate.py | stevexiaofei/Worm_seg_net | 99114bb3f221baa4df4c93d6e282ae288aa63cfc | [
"MIT"
] | null | null | null | evaluate.py | stevexiaofei/Worm_seg_net | 99114bb3f221baa4df4c93d6e282ae288aa63cfc | [
"MIT"
] | null | null | null | evaluate.py | stevexiaofei/Worm_seg_net | 99114bb3f221baa4df4c93d6e282ae288aa63cfc | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import os
def eval_metric(label_path,output_path):
label = cv2.imread(label_path,0)
output = cv2.imread(output_path,0)
_, label = cv2.threshold(label,0,1,cv2.THRESH_BINARY)
_, output = cv2.threshold(output,0,1,cv2.THRESH_BINARY)
label_ = 1- label
output_ = 1-output
Dn = label_.sum(... | 36.545455 | 72 | 0.738806 | import cv2
import numpy as np
import os
def eval_metric(label_path,output_path):
label = cv2.imread(label_path,0)
output = cv2.imread(output_path,0)
_, label = cv2.threshold(label,0,1,cv2.THRESH_BINARY)
_, output = cv2.threshold(output,0,1,cv2.THRESH_BINARY)
label_ = 1- label
output_ = 1-output
Dn = label_.sum(... | true | true |
f753b44d2cc7efce76203fee9fbec9a698aa56d8 | 6,629 | py | Python | agent/indy_catalyst_agent/holder/tests/test_indy.py | nairobi222/indy-catalyst | dcbd80524ace7747ecfecd716ff932e9b571d69a | [
"Apache-2.0"
] | 1 | 2019-03-18T13:10:05.000Z | 2019-03-18T13:10:05.000Z | agent/indy_catalyst_agent/holder/tests/test_indy.py | nairobi222/indy-catalyst | dcbd80524ace7747ecfecd716ff932e9b571d69a | [
"Apache-2.0"
] | null | null | null | agent/indy_catalyst_agent/holder/tests/test_indy.py | nairobi222/indy-catalyst | dcbd80524ace7747ecfecd716ff932e9b571d69a | [
"Apache-2.0"
] | null | null | null | import json
from unittest import mock
from asynctest import TestCase as AsyncTestCase
from asynctest import mock as async_mock
from indy_catalyst_agent.holder.indy import IndyHolder
class TestIndyHolder(AsyncTestCase):
def test_init(self):
holder = IndyHolder("wallet")
assert holder.wallet == "w... | 36.423077 | 88 | 0.683059 | import json
from unittest import mock
from asynctest import TestCase as AsyncTestCase
from asynctest import mock as async_mock
from indy_catalyst_agent.holder.indy import IndyHolder
class TestIndyHolder(AsyncTestCase):
def test_init(self):
holder = IndyHolder("wallet")
assert holder.wallet == "w... | true | true |
f753b5fc75699b44596df732d429ee37dc740211 | 6,938 | py | Python | rllib/agents/dqn/dqn_torch_model.py | Yeachan-Heo/ray | a73c488c74b1e01da3961db2eb538c43c29753f5 | [
"Apache-2.0"
] | 1 | 2020-11-14T19:25:41.000Z | 2020-11-14T19:25:41.000Z | rllib/agents/dqn/dqn_torch_model.py | Yeachan-Heo/ray | a73c488c74b1e01da3961db2eb538c43c29753f5 | [
"Apache-2.0"
] | 2 | 2022-01-13T04:15:38.000Z | 2022-03-12T01:03:35.000Z | rllib/agents/dqn/dqn_torch_model.py | Yeachan-Heo/ray | a73c488c74b1e01da3961db2eb538c43c29753f5 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
from ray.rllib.utils import try_import_torch
torch, nn = try_import_torch()
class DQNTorchModel(TorchModelV2):
"""Extension of standard TorchModelV2 to provide dueling-Q functionality.
"""
def __init__(
self,
... | 41.297619 | 79 | 0.556645 | import numpy as np
from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
from ray.rllib.utils import try_import_torch
torch, nn = try_import_torch()
class DQNTorchModel(TorchModelV2):
def __init__(
self,
obs_space,
action_space,
num_outputs,
m... | true | true |
f753b660a0e8200b30de97564fff99b1d9a3fa54 | 2,448 | py | Python | launcher.py | BKleynhans-WIP/radiometer-raspberrypi | 2b372916bdd25e5021f5ac8de34323dd58ede423 | [
"Unlicense"
] | null | null | null | launcher.py | BKleynhans-WIP/radiometer-raspberrypi | 2b372916bdd25e5021f5ac8de34323dd58ede423 | [
"Unlicense"
] | null | null | null | launcher.py | BKleynhans-WIP/radiometer-raspberrypi | 2b372916bdd25e5021f5ac8de34323dd58ede423 | [
"Unlicense"
] | 2 | 2021-01-01T19:56:21.000Z | 2021-02-09T19:09:38.000Z | #!/usr/bin/env python3
###
#
#
#
# Program Description :
# Created By : Benjamin Kleynhans
# Creation Date : January 25, 2020
# Authors : Benjamin Kleynhans
#
# Last Modified By : Benjamin Kleynhans
# Last Modified Date : August 20, 2020
# Filename : launcher.py
#
###
# Syste... | 24 | 94 | 0.593546 |
import sys, os, inspect
import subprocess as sp
import pdb
from src import radiometer
ERASE_LINE = '\x1b[2k' __PROJECT_ROOT = ''
def get_module_path():
filename = inspect.getfile(inspect.currentframe())
path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
r... | true | true |
f753b672926677649d60a11fcfabcae3b859e9d9 | 4,181 | py | Python | pypureclient/pure1/Pure1_1_0/models/metric_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/pure1/Pure1_1_0/models/metric_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/pure1/Pure1_1_0/models/metric_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
Pure1 Public REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from... | 33.717742 | 522 | 0.587898 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.pure1.Pure1_1_0 import models
class MetricGetResponse(object):
swagger_types = {
'continuation_token': 'str',
'total_item_count': 'int',
'items': 'list[Me... | true | true |
f753b704822c17ac5760c26fff7a055d4849a451 | 5,087 | py | Python | onlinecourse/migrations/__init__.py | meanest13/eyebeem_django | dffd7e9b32f834122d756923f5d3e0083442747a | [
"Apache-2.0"
] | null | null | null | onlinecourse/migrations/__init__.py | meanest13/eyebeem_django | dffd7e9b32f834122d756923f5d3e0083442747a | [
"Apache-2.0"
] | null | null | null | onlinecourse/migrations/__init__.py | meanest13/eyebeem_django | dffd7e9b32f834122d756923f5d3e0083442747a | [
"Apache-2.0"
] | null | null | null | from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... | 47.990566 | 210 | 0.587576 | from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... | true | true |
f753b833abe8b2a323cf516a272a9b1dd5f7d783 | 43,414 | py | Python | src/deoxys/experiment/postprocessor.py | huynhngoc/deoxys | b2e9936b723807e129fda36d8d6131ca00db558f | [
"MIT"
] | 1 | 2021-12-28T15:48:45.000Z | 2021-12-28T15:48:45.000Z | src/deoxys/experiment/postprocessor.py | huynhngoc/deoxys | b2e9936b723807e129fda36d8d6131ca00db558f | [
"MIT"
] | 2 | 2020-06-26T11:03:53.000Z | 2020-06-26T11:05:09.000Z | src/deoxys/experiment/postprocessor.py | huynhngoc/deoxys | b2e9936b723807e129fda36d8d6131ca00db558f | [
"MIT"
] | null | null | null | from ..loaders import load_data
from ..utils import load_json_config
from deoxys_image.patch_sliding import get_patch_indice
from deoxys_vis import read_csv
import numpy as np
import h5py
import pandas as pd
import os
from time import time
import shutil
import matplotlib.pyplot as plt
import warnings
class H5Metri... | 39.041367 | 79 | 0.564518 | from ..loaders import load_data
from ..utils import load_json_config
from deoxys_image.patch_sliding import get_patch_indice
from deoxys_vis import read_csv
import numpy as np
import h5py
import pandas as pd
import os
from time import time
import shutil
import matplotlib.pyplot as plt
import warnings
class H5Metri... | true | true |
f753b844d20dee6aac1ef74f60536e4ea174625b | 7,908 | py | Python | backend/cb_ux_test_2_33170/settings.py | crowdbotics-apps/cb-ux-test-2-33170 | 3f06fb1e066ef7fc9406b12163c6c65c74bbbdde | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/cb_ux_test_2_33170/settings.py | crowdbotics-apps/cb-ux-test-2-33170 | 3f06fb1e066ef7fc9406b12163c6c65c74bbbdde | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/cb_ux_test_2_33170/settings.py | crowdbotics-apps/cb-ux-test-2-33170 | 3f06fb1e066ef7fc9406b12163c6c65c74bbbdde | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
Django settings for cb_ux_test_2_33170 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
i... | 30.415385 | 112 | 0.737102 |
import os
import io
import environ
import logging
import google.auth
from google.cloud import secretmanager
from google.auth.exceptions import DefaultCredentialsError
from google.api_core.exceptions import PermissionDenied
from modules.manifest import get_modules
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abs... | true | true |
f753b8aae017e69acaad8b9ff66c5c717f126b43 | 405 | py | Python | back-end/curso-em-video/python3/Mundo II/Desafios/46 - (Contagem Regressiva).py | gustavocamalionti/cursos-e-linguagens | 615db91aff13db5678a783aac69df11231c925e8 | [
"MIT"
] | null | null | null | back-end/curso-em-video/python3/Mundo II/Desafios/46 - (Contagem Regressiva).py | gustavocamalionti/cursos-e-linguagens | 615db91aff13db5678a783aac69df11231c925e8 | [
"MIT"
] | null | null | null | back-end/curso-em-video/python3/Mundo II/Desafios/46 - (Contagem Regressiva).py | gustavocamalionti/cursos-e-linguagens | 615db91aff13db5678a783aac69df11231c925e8 | [
"MIT"
] | null | null | null | #Desafio 046: Faça um programa que mostre na tela uma contagem regressiva para o estouro de fogos de artifício, indo de 10 até 0, com uma pausa de 1 segundo entre eles.
from time import sleep
import emoji
print('10 SEGUNDO PARA A VIRADA DO ANO!!!')
print('-=-'*20)
for c in range(10, -1, -1):
print(c)
sleep(1)... | 36.818182 | 168 | 0.716049 |
from time import sleep
import emoji
print('10 SEGUNDO PARA A VIRADA DO ANO!!!')
print('-=-'*20)
for c in range(10, -1, -1):
print(c)
sleep(1)
print(emoji.emojize(':sparkles::sparkles::sparkles::sparkles:', use_aliases = True)) | true | true |
f753ba40c6e5ff06968e048b1109deeaf92a9d12 | 6,434 | py | Python | send_to_pb/mail.py | ddobrinskiy/send-to-pb | bd3e1741691d7858224ff91fe44acc88142b47d6 | [
"Apache-2.0"
] | null | null | null | send_to_pb/mail.py | ddobrinskiy/send-to-pb | bd3e1741691d7858224ff91fe44acc88142b47d6 | [
"Apache-2.0"
] | null | null | null | send_to_pb/mail.py | ddobrinskiy/send-to-pb | bd3e1741691d7858224ff91fe44acc88142b47d6 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01_mail.ipynb (unless otherwise specified).
__all__ = ['MessageEncoded', 'SCOPES', 'Emailer']
# Cell
from dataclasses import dataclass
from typing import Optional
import base64
import os
import os.path
import pathlib
import pickle
from email.mime.application import MIM... | 33.863158 | 135 | 0.567299 |
__all__ = ['MessageEncoded', 'SCOPES', 'Emailer']
from dataclasses import dataclass
from typing import Optional
import base64
import os
import os.path
import pathlib
import pickle
from email.mime.application import MIMEApplication
from email.mime.audio import MIMEAudio
from email.mime.base import MIMEBase
from email... | true | true |
f753ba564f59e0b49d1af4725c5f70be8c40eae2 | 3,398 | py | Python | test/test_barstool.py | jorrinpollard/podcasts | d370ede187b99f5bc8bede8c77f3ebeb6581a909 | [
"MIT"
] | 1 | 2020-08-09T18:38:49.000Z | 2020-08-09T18:38:49.000Z | test/test_barstool.py | jorrinpollard/podcasts | d370ede187b99f5bc8bede8c77f3ebeb6581a909 | [
"MIT"
] | null | null | null | test/test_barstool.py | jorrinpollard/podcasts | d370ede187b99f5bc8bede8c77f3ebeb6581a909 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import division, absolute_import, print_function
import os
import sys
import unittest
cwd = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, cwd)
from podcasts import Podcast
source = os.path.join(cwd, "test", "fixtures", "barstool.xml")
_copyrig... | 52.276923 | 374 | 0.753973 | from __future__ import division, absolute_import, print_function
import os
import sys
import unittest
cwd = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, cwd)
from podcasts import Podcast
source = os.path.join(cwd, "test", "fixtures", "barstool.xml")
_copyright = "2019 Barstool Sp... | true | true |
f753bc56b08cf8372adab1966f4ab4aea3373b35 | 2,366 | py | Python | AS01/exercise3/sniffer.py | jakobudovic/NetworkSecurity2020 | 08e33a981493ad695a7c1a21f36cc37292253703 | [
"MIT"
] | 2 | 2020-05-02T21:02:40.000Z | 2020-10-13T13:03:38.000Z | AS01/exercise3/sniffer.py | jakobudovic/NetworkSecurity2020 | 08e33a981493ad695a7c1a21f36cc37292253703 | [
"MIT"
] | null | null | null | AS01/exercise3/sniffer.py | jakobudovic/NetworkSecurity2020 | 08e33a981493ad695a7c1a21f36cc37292253703 | [
"MIT"
] | 1 | 2020-10-13T13:03:42.000Z | 2020-10-13T13:03:42.000Z | #!/usr/bin/env python3
import socket
import struct
import sys
def parse_ip(packet):
header_length_in_bytes = (packet[0] & 0x0F) * 4 # 0x0F == 00001111
header = packet[:header_length_in_bytes]
# structs: https://docs.python.org/3.6/library/struct.html#module-struct
_, totalLength, _, _, protocol, _, source, desti... | 31.972973 | 110 | 0.653001 |
import socket
import struct
import sys
def parse_ip(packet):
header_length_in_bytes = (packet[0] & 0x0F) * 4 header = packet[:header_length_in_bytes]
_, totalLength, _, _, protocol, _, source, destination = struct.unpack_from("!HHLBBH4s4s", header, offset=0)
sourceIP = socket.inet_ntoa(source)
destIP = socket... | true | true |
f753bde1711e0265a477f9d97bd4c9e8739e7443 | 3,501 | py | Python | bindings/python/ensmallen/datasets/string/nitrincolalacisaponensis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/nitrincolalacisaponensis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/nitrincolalacisaponensis.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 Nitrincola lacisaponensis.
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--prot... | 33.342857 | 223 | 0.680377 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def NitrincolaLacisaponensis(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/s... | true | true |
f753bdf2556738be5caa339ea788b9c163fcd972 | 14,596 | py | Python | ppocr/modeling/heads/det_sast_head.py | listofbanned/PaddleOCR | db923736855ff5288845b867d7bce5b46acc669c | [
"Apache-2.0"
] | null | null | null | ppocr/modeling/heads/det_sast_head.py | listofbanned/PaddleOCR | db923736855ff5288845b867d7bce5b46acc669c | [
"Apache-2.0"
] | null | null | null | ppocr/modeling/heads/det_sast_head.py | listofbanned/PaddleOCR | db923736855ff5288845b867d7bce5b46acc669c | [
"Apache-2.0"
] | null | null | null | #copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
#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... | 33.248292 | 83 | 0.496369 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import paddle.fluid as fluid
from ..common_functions import conv_bn_layer, deconv_bn_layer
from collections import OrderedDict
class SASTHead(object):
def __init__(self, params):
self.model_name... | true | true |
f753be077f52292ae3b0e803edc360662e089c05 | 3,320 | py | Python | summary_statistics/stat_tools.py | agladstein/SimPrily | ac1c77b61dbf003fb8e0331597ebdb3325769480 | [
"MIT"
] | 5 | 2017-09-12T21:33:45.000Z | 2017-11-29T02:43:43.000Z | summary_statistics/stat_tools.py | agladstein/SimPrily_update | 05caea299e2a48a7fe37be68e8b1619eaaa7ac5d | [
"MIT"
] | 54 | 2017-09-06T18:19:01.000Z | 2020-02-11T22:06:15.000Z | summary_statistics/stat_tools.py | agladstein/SimPrily_update | 05caea299e2a48a7fe37be68e8b1619eaaa7ac5d | [
"MIT"
] | 9 | 2017-09-12T19:55:08.000Z | 2018-10-17T10:43:09.000Z | import sys
if (sys.version_info > (3, 0)):
import summary_statistics.afs_stats_bitarray as afs_stats_bitarray
else:
import afs_stats_bitarray
def store_segregating_site_stats(seq_list, results, head_list):
for seq in seq_list:
if seq.type == 'discovery':
current_res = afs_stats_bitarra... | 43.116883 | 128 | 0.623795 | import sys
if (sys.version_info > (3, 0)):
import summary_statistics.afs_stats_bitarray as afs_stats_bitarray
else:
import afs_stats_bitarray
def store_segregating_site_stats(seq_list, results, head_list):
for seq in seq_list:
if seq.type == 'discovery':
current_res = afs_stats_bitarra... | true | true |
f753be65f098d096412cd859ef32ccd6ea35ac66 | 8,602 | py | Python | main.py | PaulJulio/dna-pencil-holder | 8de27bfa6274c9f82ccf8a94da99134418b97979 | [
"CC0-1.0"
] | null | null | null | main.py | PaulJulio/dna-pencil-holder | 8de27bfa6274c9f82ccf8a94da99134418b97979 | [
"CC0-1.0"
] | null | null | null | main.py | PaulJulio/dna-pencil-holder | 8de27bfa6274c9f82ccf8a94da99134418b97979 | [
"CC0-1.0"
] | null | null | null | import math
import os
from solid import *
"""
The math for a helix comes from https://mathworld.wolfram.com/Helix.html
x, y and z are coordinates in 3d space
r is a constant and gives the radius of the helix
t is where we are in a turn (in radians) and is thus a number from 0 to 2 * pi
c is a constant defining the hei... | 38.923077 | 119 | 0.699605 | import math
import os
from solid import *
HELIX_HEIGHT = 200 HELIX_PENCILS = 8 # rainbow colors
HELIX_R = 50 # the pencils I'm using are ~180mm out of the box, so a 100mm diameter circle seems good to start with
PENCIL_RADIUS = 5 SEGMENT_THICKNESS = 6 # how "thick" the helix should be
TAB_THICKNESS = 2 # how thi... | true | true |
f753bfa1cd4203d25bdfbc8a4d04101d75e00e72 | 2,464 | py | Python | fearquantlib/utils.py | jwlyn/fearquantlib | 2701c3053096f9bc321d7224e00e58486cf979be | [
"Unlicense"
] | 1 | 2020-02-16T23:58:00.000Z | 2020-02-16T23:58:00.000Z | fearquantlib/utils.py | drunkpig/fearquantlib | 5ed89176aec497bfa38b91fc4e7a316793ccb371 | [
"Unlicense"
] | null | null | null | fearquantlib/utils.py | drunkpig/fearquantlib | 5ed89176aec497bfa38b91fc4e7a316793ccb371 | [
"Unlicense"
] | null | null | null | import hashlib
from datetime import datetime, timedelta
from tushare.util.dateu import trade_cal
import talib
########################################################################################################################
#
#
# 无状态公共函数
#
#
#
##################################################################... | 22 | 121 | 0.504058 | import hashlib
from datetime import datetime, timedelta
from tushare.util.dateu import trade_cal
import talib
def today():
tm_now = datetime.now()
td = tm_now.strftime("%Y-%m-%d")
return td
def n_days_ago(n_days):
tm_now = datetime.now()
delta = timedelta(days=n_days)
tm_start = tm_now - de... | true | true |
f753c0699ca176986a73a60b3e467af2e45d2c75 | 34,012 | py | Python | gdata/apps/emailsettings/data.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | gdata/apps/emailsettings/data.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | gdata/apps/emailsettings/data.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 30.072502 | 84 | 0.703193 |
__author__ = 'Claudio Cherubino <ccherubino@google.com>'
import atom.data
import gdata.apps
import gdata.apps_property
import gdata.data
pyproperty = property
# The apps:property label of the label property
LABEL_NAME = 'label'
# The apps:property from of the filter property
FILTER_FROM_NAME = 'from'
# The ap... | true | true |
f753c10cc5b4c6ab7066719ad0503fd4b9fbbdd1 | 592 | py | Python | misc_funcs.py | mak448a/discord-bot | f08fc9ac288df72d38cdfd45ce0469360da70975 | [
"MIT"
] | null | null | null | misc_funcs.py | mak448a/discord-bot | f08fc9ac288df72d38cdfd45ce0469360da70975 | [
"MIT"
] | null | null | null | misc_funcs.py | mak448a/discord-bot | f08fc9ac288df72d38cdfd45ce0469360da70975 | [
"MIT"
] | null | null | null | import os
import weather
def help1():
"""used to identify the intent help"""
pass
def hyperlink():
""" Used to identify the tag hyperlink"""
pass
async def ky_weather(message):
url = os.environ['mistsupremacyspecialurl']
weather1 = weather.weather(url=url)
await message.channel.send("Th... | 23.68 | 101 | 0.697635 | import os
import weather
def help1():
pass
def hyperlink():
pass
async def ky_weather(message):
url = os.environ['mistsupremacyspecialurl']
weather1 = weather.weather(url=url)
await message.channel.send("This weather is for the Mist Supremacy Special Members. " + weather1)
return
async de... | true | true |
f753c141908cf0b318d35552d78046f7819ab7e6 | 1,555 | py | Python | dvc/repo/checkout.py | GeorgeSabu-mec/dvc | 1e22fabece0651278c652b8b9127a832a37341ca | [
"Apache-2.0"
] | 1 | 2020-01-31T14:29:20.000Z | 2020-01-31T14:29:20.000Z | dvc/repo/checkout.py | GeorgeSabu-mec/dvc | 1e22fabece0651278c652b8b9127a832a37341ca | [
"Apache-2.0"
] | null | null | null | dvc/repo/checkout.py | GeorgeSabu-mec/dvc | 1e22fabece0651278c652b8b9127a832a37341ca | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import logging
from dvc.exceptions import CheckoutErrorSuggestGit, CheckoutError
from dvc.progress import Tqdm
logger = logging.getLogger(__name__)
def _cleanup_unused_links(self, all_stages):
used = [
out.fspath
for stage in all_stages
for out i... | 26.810345 | 79 | 0.652733 | from __future__ import unicode_literals
import logging
from dvc.exceptions import CheckoutErrorSuggestGit, CheckoutError
from dvc.progress import Tqdm
logger = logging.getLogger(__name__)
def _cleanup_unused_links(self, all_stages):
used = [
out.fspath
for stage in all_stages
for out i... | true | true |
f753c1712a2f5c02b0006e3cbf79e23bac018a79 | 8,090 | py | Python | test/functional/abc_wallet_standardness.py | ngocviet/lotusd | 769802c5db7302aa1c23cf81cf42b2e861c45732 | [
"MIT"
] | null | null | null | test/functional/abc_wallet_standardness.py | ngocviet/lotusd | 769802c5db7302aa1c23cf81cf42b2e861c45732 | [
"MIT"
] | null | null | null | test/functional/abc_wallet_standardness.py | ngocviet/lotusd | 769802c5db7302aa1c23cf81cf42b2e861c45732 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2019 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the response of wallet to a variety of weird / nonstandard coins
that it might try to spend."""
from decima... | 41.06599 | 107 | 0.619654 |
from decimal import Decimal
from test_framework.messages import (
CTransaction,
CTxOut,
FromHex,
ToHex,
)
from test_framework.script import (
CScript,
OP_1,
OP_5,
OP_CHECKSIG,
OP_CHECKMULTISIG,
OP_DUP,
OP_EQUALVERIFY,
OP_HASH160,
OP_PUSHDATA1,
hash160,
)
from tes... | true | true |
f753c20a48aaf21455e5f3763f48d905f0f62816 | 135 | py | Python | visuals/urls.py | mujeebishaque/visual-analytics | bbf5b34d336ca3498865cf357ca334b1fdd82879 | [
"MIT"
] | null | null | null | visuals/urls.py | mujeebishaque/visual-analytics | bbf5b34d336ca3498865cf357ca334b1fdd82879 | [
"MIT"
] | null | null | null | visuals/urls.py | mujeebishaque/visual-analytics | bbf5b34d336ca3498865cf357ca334b1fdd82879 | [
"MIT"
] | null | null | null | from django.urls import path
from visuals import views
urlpatterns = [
path('index/', views.IndexView.as_view(), name='index'),
]
| 19.285714 | 60 | 0.711111 | from django.urls import path
from visuals import views
urlpatterns = [
path('index/', views.IndexView.as_view(), name='index'),
]
| true | true |
f753c3049f472b256af6b64cd49934d7a42405d8 | 341 | py | Python | maro/cli/grass/lib/scripts/node/stop_node_api_server_service.py | yangboz/maro | 0973783e55ca07bf8e177910c9d47854117a4ea8 | [
"MIT"
] | 598 | 2020-09-23T00:50:22.000Z | 2022-03-31T08:12:54.000Z | maro/cli/grass/lib/scripts/node/stop_node_api_server_service.py | gx9702/maro | 38c796f0a7ed1e0f64c299d96c6e0df032401fa9 | [
"MIT"
] | 235 | 2020-09-22T10:20:48.000Z | 2022-03-31T02:10:03.000Z | maro/cli/grass/lib/scripts/node/stop_node_api_server_service.py | gx9702/maro | 38c796f0a7ed1e0f64c299d96c6e0df032401fa9 | [
"MIT"
] | 116 | 2020-09-22T09:19:04.000Z | 2022-02-12T05:04:07.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""Stop the maro-node-api-server service.
"""
from ..utils.subprocess import Subprocess
STOP_SERVICE_COMMAND = "systemctl --user stop maro-node-api-server.service"
if __name__ == "__main__":
# Stop service
_ = Subprocess.run(command=S... | 22.733333 | 75 | 0.741935 |
from ..utils.subprocess import Subprocess
STOP_SERVICE_COMMAND = "systemctl --user stop maro-node-api-server.service"
if __name__ == "__main__":
_ = Subprocess.run(command=STOP_SERVICE_COMMAND)
| true | true |
f753c4c0535e55300f50681c63aa36955fc31d5c | 2,210 | py | Python | env/env/lib/python3.6/site-packages/visitor/__init__.py | Aimee-pacy/NEWS | 2b8afa2af5e5fe5ce5e91c43bcbb7c518606a43f | [
"Unlicense"
] | null | null | null | env/env/lib/python3.6/site-packages/visitor/__init__.py | Aimee-pacy/NEWS | 2b8afa2af5e5fe5ce5e91c43bcbb7c518606a43f | [
"Unlicense"
] | null | null | null | env/env/lib/python3.6/site-packages/visitor/__init__.py | Aimee-pacy/NEWS | 2b8afa2af5e5fe5ce5e91c43bcbb7c518606a43f | [
"Unlicense"
] | null | null | null | # Copyright (c) 2015 Marc Brinkmann
# 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, copy, modify, merge, publish, ... | 42.5 | 80 | 0.662896 |
class Visitor(object):
def visit(self, node):
if isinstance(node, type):
mro = node.mro()
else:
mro = type(node).mro()
for cls in mro:
meth = getattr(self, 'visit_' + cls.__name__, None)
if meth is None:
con... | true | true |
f753c71b1f9459b9ce20dc3c063ca6b2cef1d98c | 1,496 | py | Python | utils/losses.py | jimilee/image-classification | abd07abbbf3ed2e38bb7fda6f4bfeb28dd7ffaae | [
"MIT"
] | 57 | 2021-08-23T03:36:15.000Z | 2022-03-29T14:07:10.000Z | utils/losses.py | jimilee/image-classification | abd07abbbf3ed2e38bb7fda6f4bfeb28dd7ffaae | [
"MIT"
] | null | null | null | utils/losses.py | jimilee/image-classification | abd07abbbf3ed2e38bb7fda6f4bfeb28dd7ffaae | [
"MIT"
] | 12 | 2021-08-15T17:56:02.000Z | 2022-03-31T02:26:22.000Z | from torch import nn, Tensor
from typing import Union
from torch.nn import CrossEntropyLoss
class LabelSmoothCrossEntropy(nn.Module):
def __init__(self, smoothing=0.1):
super().__init__()
assert smoothing < 1.0
self.smoothing = smoothing
self.confidence = 1. - smoothing
sel... | 38.358974 | 150 | 0.652406 | from torch import nn, Tensor
from typing import Union
from torch.nn import CrossEntropyLoss
class LabelSmoothCrossEntropy(nn.Module):
def __init__(self, smoothing=0.1):
super().__init__()
assert smoothing < 1.0
self.smoothing = smoothing
self.confidence = 1. - smoothing
sel... | true | true |
f753c8d80c51849de3e5480346435f2e4f8da168 | 3,695 | py | Python | squealy/transformers.py | devashishsharma2302/testing-heroku-deployment | c126559035fe617e0547534fe7fa055a4155387a | [
"MIT"
] | null | null | null | squealy/transformers.py | devashishsharma2302/testing-heroku-deployment | c126559035fe617e0547534fe7fa055a4155387a | [
"MIT"
] | null | null | null | squealy/transformers.py | devashishsharma2302/testing-heroku-deployment | c126559035fe617e0547534fe7fa055a4155387a | [
"MIT"
] | null | null | null | from .table import Table
class TableTransformer(object):
def transform(self, table, *args):
"""
To be implemented in inherited classes
"""
return table
class Transpose(TableTransformer):
def transform(self, table):
"""Converts rows into columns and vice versa
... | 41.055556 | 225 | 0.645467 | from .table import Table
class TableTransformer(object):
def transform(self, table, *args):
return table
class Transpose(TableTransformer):
def transform(self, table):
column_names = table.columns
table.data.insert(0, column_names)
transposed = list(zip(*table.data))
... | true | true |
f753cbff6bf1363cdbaf443783189f575071cb2e | 2,497 | py | Python | bibmatch/parse_wos.py | kasoju2712/Science_of_success | fbaa92a8d035f7869162bf45338fc9e174492b98 | [
"MIT"
] | null | null | null | bibmatch/parse_wos.py | kasoju2712/Science_of_success | fbaa92a8d035f7869162bf45338fc9e174492b98 | [
"MIT"
] | null | null | null | bibmatch/parse_wos.py | kasoju2712/Science_of_success | fbaa92a8d035f7869162bf45338fc9e174492b98 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import os
import numpy as np
import pandas as pd
from bibmatch.authorclass import author
def adf2author(aid, adf):
author_dict = {}
author_dict['all_names'] = set(adf['FullName'])
author_dict['prefered_name'] = sorted(author_dict['all_names'], key = len)[-1]
author... | 33.293333 | 150 | 0.651181 | import os
import numpy as np
import pandas as pd
from bibmatch.authorclass import author
def adf2author(aid, adf):
author_dict = {}
author_dict['all_names'] = set(adf['FullName'])
author_dict['prefered_name'] = sorted(author_dict['all_names'], key = len)[-1]
author_dict['articles'] = set([t for t in ad... | true | true |
f753cc0757c9c46acd73bd5eb278b702035d8dd5 | 5,842 | py | Python | test/test_sliprules.py | lynnmunday/neml | 2c0e3db9f849345dba01d64fc8488e2b97e477dd | [
"MIT"
] | null | null | null | test/test_sliprules.py | lynnmunday/neml | 2c0e3db9f849345dba01d64fc8488e2b97e477dd | [
"MIT"
] | null | null | null | test/test_sliprules.py | lynnmunday/neml | 2c0e3db9f849345dba01d64fc8488e2b97e477dd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from neml import history, interpolate
from neml.math import tensors, rotations
from neml.cp import crystallography, slipharden, sliprules
from common import differentiate
from nicediff import *
import unittest
import numpy as np
import numpy.linalg as la
class CommonSlipRule(object):
def te... | 35.621951 | 109 | 0.657823 |
from neml import history, interpolate
from neml.math import tensors, rotations
from neml.cp import crystallography, slipharden, sliprules
from common import differentiate
from nicediff import *
import unittest
import numpy as np
import numpy.linalg as la
class CommonSlipRule(object):
def test_d_slip_d_stress(self... | true | true |
f753cc83181ed82f8d0a918df69da3590efd6764 | 56,850 | py | Python | scipy/optimize/_linprog_util.py | hrk7531/scipy | a62bf66b2a485fbb3e08fe52feecaca765bead1f | [
"FSFAP"
] | 1 | 2021-08-18T08:40:59.000Z | 2021-08-18T08:40:59.000Z | scipy/optimize/_linprog_util.py | hrk7531/scipy | a62bf66b2a485fbb3e08fe52feecaca765bead1f | [
"FSFAP"
] | 1 | 2021-12-01T05:27:28.000Z | 2021-12-01T05:27:28.000Z | scipy/optimize/_linprog_util.py | hrk7531/scipy | a62bf66b2a485fbb3e08fe52feecaca765bead1f | [
"FSFAP"
] | 2 | 2021-05-11T09:27:32.000Z | 2021-06-08T01:00:21.000Z | """
Method agnostic utility functions for linear progamming
"""
import numpy as np
import scipy.sparse as sps
from warnings import warn
from .optimize import OptimizeWarning
from scipy.optimize._remove_redundancy import (
_remove_redundancy, _remove_redundancy_sparse, _remove_redundancy_dense
)
def _check_sp... | 40.063425 | 84 | 0.597573 |
import numpy as np
import scipy.sparse as sps
from warnings import warn
from .optimize import OptimizeWarning
from scipy.optimize._remove_redundancy import (
_remove_redundancy, _remove_redundancy_sparse, _remove_redundancy_dense
)
def _check_sparse_inputs(options, A_ub, A_eq):
_sparse_presolve = opt... | true | true |
f753cc8916839cf6f161ffaf19d1a0dde1125294 | 7,640 | py | Python | tf_agents/networks/nest_map_test.py | Francis777/agents | 24e878a697be418307cfbff69724d86be767719d | [
"Apache-2.0"
] | null | null | null | tf_agents/networks/nest_map_test.py | Francis777/agents | 24e878a697be418307cfbff69724d86be767719d | [
"Apache-2.0"
] | null | null | null | tf_agents/networks/nest_map_test.py | Francis777/agents | 24e878a697be418307cfbff69724d86be767719d | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 35.37037 | 80 | 0.632068 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from absl import flags
import tensorflow.compat.v2 as tf
from tf_agents.keras_layers import inner_reshape
from tf_agents.networks import nest_map
from tf_agents.networks import sequential
from tf_... | true | true |
f753ccff31e6c1549079dab05998d2c3b8b502fa | 35,483 | py | Python | onnxruntime/python/onnxruntime_inference_collection.py | prasanthpul/onnxruntime | d52d3c00520a10075e3bc75fe90db5b4c83ee557 | [
"MIT"
] | 25 | 2019-05-28T09:07:15.000Z | 2022-03-09T21:24:29.000Z | onnxruntime/python/onnxruntime_inference_collection.py | prasanthpul/onnxruntime | d52d3c00520a10075e3bc75fe90db5b4c83ee557 | [
"MIT"
] | 82 | 2019-06-21T20:03:46.000Z | 2022-03-27T07:33:51.000Z | onnxruntime/python/onnxruntime_inference_collection.py | prasanthpul/onnxruntime | d52d3c00520a10075e3bc75fe90db5b4c83ee557 | [
"MIT"
] | 11 | 2019-06-08T15:50:39.000Z | 2022-03-09T21:24:29.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------
import collections
import collections.abc
import os
import warnings
from... | 42.699158 | 120 | 0.653017 | import collections
import collections.abc
import os
import warnings
from onnxruntime.capi import _pybind_state as C
def get_ort_device_type(device):
device_type = device if type(device) is str else device.type.lower()
if device_type == 'cuda':
return C.OrtDevice.cuda()
elif device_type == 'cpu':
... | true | true |
f753cec5d8589934fe9e1b4b5565437f836d65f4 | 8,396 | py | Python | pytorch_lightning/accelerators/ddp_spawn_backend.py | ozen/pytorch-lightning | 3b0b402d30fa19e0fef7d150c30ff4bb14a64230 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/accelerators/ddp_spawn_backend.py | ozen/pytorch-lightning | 3b0b402d30fa19e0fef7d150c30ff4bb14a64230 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/accelerators/ddp_spawn_backend.py | ozen/pytorch-lightning | 3b0b402d30fa19e0fef7d150c30ff4bb14a64230 | [
"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... | 35.72766 | 112 | 0.681039 | import os
import re
import torch
import torch.multiprocessing as mp
import torch.distributed as torch_distrib
import torch.distributed as dist
from pytorch_lightning import _logger as log
from pytorch_lightning.accelerators.base_backend import Accelerator
from pytorch_lightning.utilities import AMPType
from pytorch_l... | true | true |
f753cf886c9dd1069652c50b9f22a327d28fa47d | 1,617 | py | Python | modules/appQuitter_module.py | Arvinth-Krishna/Reco-PC-Server | bb20df32fecb545d583f2b5a84d414e9a0d7b377 | [
"MIT"
] | 11 | 2021-02-11T11:00:37.000Z | 2022-01-23T13:47:43.000Z | modules/appQuitter_module.py | Arvinth-Krishna/Reco-PC-Server | bb20df32fecb545d583f2b5a84d414e9a0d7b377 | [
"MIT"
] | 8 | 2021-05-13T18:06:46.000Z | 2022-02-07T15:36:27.000Z | modules/appQuitter_module.py | Arvinth-Krishna/Reco-PC-Server | bb20df32fecb545d583f2b5a84d414e9a0d7b377 | [
"MIT"
] | 4 | 2021-07-28T19:39:43.000Z | 2022-01-24T02:39:16.000Z | # Module: appQuitter
# Description: Quits the application
# Usage: !appquitter "PID/Application Name" or !appquitter "PID/Application Name" minutesToQuit
# Dependencies: os
import os, asyncio, configs,subprocess
async def appquitter(ctx,appName, minutes=0):
printlist=[]
application={}
if app... | 30.509434 | 96 | 0.576994 |
import os, asyncio, configs,subprocess
async def appquitter(ctx,appName, minutes=0):
printlist=[]
application={}
if appName.isnumeric():
cmd = 'powershell "gps | where {$_.MainWindowTitle } | select Id,ProcessName'
proc = subprocess.Popen(cmd, shell=True, stdout=subpr... | true | true |
f753d0019a9dfd1c0bfc9caaeab6a9f6daee8ef5 | 3,031 | py | Python | dump/plugins/vlan.py | VenkatCisco/sonic-utilities | a395e284a6bcca337f20edf2606408f131de0b4f | [
"Apache-2.0"
] | null | null | null | dump/plugins/vlan.py | VenkatCisco/sonic-utilities | a395e284a6bcca337f20edf2606408f131de0b4f | [
"Apache-2.0"
] | 1 | 2021-01-17T11:49:34.000Z | 2021-01-28T06:27:06.000Z | dump/plugins/vlan.py | VenkatCisco/sonic-utilities | a395e284a6bcca337f20edf2606408f131de0b4f | [
"Apache-2.0"
] | null | null | null | from .executor import Executor
from dump.match_infra import MatchRequest
from dump.helper import create_template_dict
class Vlan(Executor):
ARG_NAME = "vlan_name"
def __init__(self, match_engine=None):
super().__init__(match_engine)
self.ret_temp = {}
self.ns = ''
... | 43.3 | 130 | 0.613329 | from .executor import Executor
from dump.match_infra import MatchRequest
from dump.helper import create_template_dict
class Vlan(Executor):
ARG_NAME = "vlan_name"
def __init__(self, match_engine=None):
super().__init__(match_engine)
self.ret_temp = {}
self.ns = ''
... | true | true |
f753d0c06e7907f0c964c194d88afaa752f7d531 | 524 | py | Python | tests/test_song.py | kipyin/impresario | 860aa313fb4206aacb22439e166b06d3aa974ed5 | [
"MIT"
] | null | null | null | tests/test_song.py | kipyin/impresario | 860aa313fb4206aacb22439e166b06d3aa974ed5 | [
"MIT"
] | null | null | null | tests/test_song.py | kipyin/impresario | 860aa313fb4206aacb22439e166b06d3aa974ed5 | [
"MIT"
] | null | null | null | import tablib
from impresario.song import Song, Songbook
def test_song_pinyin():
song = Song(name="歌曲")
assert song.pinyin == ["Ge", "Qu"]
def test_song_mixed_title():
song = Song(name="歌曲 some songs")
assert song.pinyin == ["Ge", "Qu", "Some", "Songs"]
def test_song_normalized_key():
song = ... | 20.96 | 64 | 0.627863 | import tablib
from impresario.song import Song, Songbook
def test_song_pinyin():
song = Song(name="歌曲")
assert song.pinyin == ["Ge", "Qu"]
def test_song_mixed_title():
song = Song(name="歌曲 some songs")
assert song.pinyin == ["Ge", "Qu", "Some", "Songs"]
def test_song_normalized_key():
song = ... | true | true |
f753d42c9751f2121055efe11ccb71f86e669787 | 1,426 | py | Python | mapclientplugins/electrodearraydetectorstep/scene/trackingpointsscene.py | mahyar-osn/mapclientplugins.electrodearraydetectorstep | c4824e3361bb8464ee19ccdf1a7ea71182d7fcfb | [
"Apache-2.0"
] | null | null | null | mapclientplugins/electrodearraydetectorstep/scene/trackingpointsscene.py | mahyar-osn/mapclientplugins.electrodearraydetectorstep | c4824e3361bb8464ee19ccdf1a7ea71182d7fcfb | [
"Apache-2.0"
] | null | null | null | mapclientplugins/electrodearraydetectorstep/scene/trackingpointsscene.py | mahyar-osn/mapclientplugins.electrodearraydetectorstep | c4824e3361bb8464ee19ccdf1a7ea71182d7fcfb | [
"Apache-2.0"
] | null | null | null |
from opencmiss.zinc.field import Field
from opencmiss.zinc.glyph import Glyph
class TrackingPointsScene(object):
def __init__(self, master_model):
self._master_model = master_model
def create_graphics(self):
tracking_points_model = self._master_model.get_tracking_points_model()
coor... | 37.526316 | 78 | 0.729313 |
from opencmiss.zinc.field import Field
from opencmiss.zinc.glyph import Glyph
class TrackingPointsScene(object):
def __init__(self, master_model):
self._master_model = master_model
def create_graphics(self):
tracking_points_model = self._master_model.get_tracking_points_model()
coor... | true | true |
f753d4497bdd250708d8eb4ef48fef980fce6539 | 43 | py | Python | spacetimeformer/mtgnn_model/__init__.py | Azerrroth/spacetimeformer | e822444a6d696a1edb9e446d6f3482a70681be3c | [
"MIT"
] | null | null | null | spacetimeformer/mtgnn_model/__init__.py | Azerrroth/spacetimeformer | e822444a6d696a1edb9e446d6f3482a70681be3c | [
"MIT"
] | null | null | null | spacetimeformer/mtgnn_model/__init__.py | Azerrroth/spacetimeformer | e822444a6d696a1edb9e446d6f3482a70681be3c | [
"MIT"
] | null | null | null | from .mtgnn_model import MTGNN_Forecaster
| 21.5 | 42 | 0.860465 | from .mtgnn_model import MTGNN_Forecaster
| true | true |
f753d4a3851fb7cad5ea563490d94024d0061b05 | 80,496 | py | Python | Kernel.py | jaredly/meerk40t | 446427e29104cb89fd2ee17ad824fc801d44afe0 | [
"MIT"
] | null | null | null | Kernel.py | jaredly/meerk40t | 446427e29104cb89fd2ee17ad824fc801d44afe0 | [
"MIT"
] | null | null | null | Kernel.py | jaredly/meerk40t | 446427e29104cb89fd2ee17ad824fc801d44afe0 | [
"MIT"
] | null | null | null | import time
from threading import Thread, Lock
from LaserOperation import *
from svgelements import Path, SVGText
STATE_UNKNOWN = -1
STATE_INITIALIZE = 0
STATE_IDLE = 1
STATE_ACTIVE = 2
STATE_BUSY = 3
STATE_PAUSE = 4
STATE_END = 5
STATE_TERMINATE = 10
INTERPRETER_STATE_RAPID = 0
INTERPRETER_STATE_FIN... | 37.146285 | 126 | 0.555667 | import time
from threading import Thread, Lock
from LaserOperation import *
from svgelements import Path, SVGText
STATE_UNKNOWN = -1
STATE_INITIALIZE = 0
STATE_IDLE = 1
STATE_ACTIVE = 2
STATE_BUSY = 3
STATE_PAUSE = 4
STATE_END = 5
STATE_TERMINATE = 10
INTERPRETER_STATE_RAPID = 0
INTERPRETER_STATE_FIN... | true | true |
f753d527a4dd6cddd34234e3b8bde3577f298566 | 786 | py | Python | ALPHABETS/CAPITAL_ALPHABETS/Q.py | charansaim1819/Python_Patterns | 02e636855003346ec84c3d69f2be174dc9e9e3cb | [
"MIT"
] | null | null | null | ALPHABETS/CAPITAL_ALPHABETS/Q.py | charansaim1819/Python_Patterns | 02e636855003346ec84c3d69f2be174dc9e9e3cb | [
"MIT"
] | null | null | null | ALPHABETS/CAPITAL_ALPHABETS/Q.py | charansaim1819/Python_Patterns | 02e636855003346ec84c3d69f2be174dc9e9e3cb | [
"MIT"
] | null | null | null | #Shape of capital Q:
def for_Q():
"""printing capital 'Q' using for loop"""
for row in range(6):
for col in range(7):
if col%5==0 and row%5!=0 or row in(0,5) and col not in(0,5,6) or row==3 and col==4 or row==5 and col==6:
print("*",end=" ")
else:
... | 27.103448 | 140 | 0.416031 | def for_Q():
for row in range(6):
for col in range(7):
if col%5==0 and row%5!=0 or row in(0,5) and col not in(0,5,6) or row==3 and col==4 or row==5 and col==6:
print("*",end=" ")
else:
print(" ",end=" ")
print()
def while_Q():
... | true | true |
f753d5b58d98abbc8b47fee9512fafcc4f2646e8 | 149 | py | Python | .history/application/__init___20191109192333.py | kerwin-wong/brand_demo | d5df3d4cdc773a221304c95ff71e7bcfce3a1603 | [
"MIT"
] | null | null | null | .history/application/__init___20191109192333.py | kerwin-wong/brand_demo | d5df3d4cdc773a221304c95ff71e7bcfce3a1603 | [
"MIT"
] | null | null | null | .history/application/__init___20191109192333.py | kerwin-wong/brand_demo | d5df3d4cdc773a221304c95ff71e7bcfce3a1603 | [
"MIT"
] | null | null | null | '''
# -*- encoding=UTF-8 —*—
from flask import Flask
app = Flask(__name__)
app.config.from_pyfile('app.conf')
from application import models,views | 16.555556 | 36 | 0.718121 | '''
# -*- encoding=UTF-8 —*—
from flask import Flask
app = Flask(__name__)
app.config.from_pyfile('app.conf')
from application import models,views | false | true |
f753d76bee136cf4d1d5f98f9fb6dbbc90e37437 | 765 | py | Python | examples/routes/delete_route.py | route4me/route4me-python-sdk | e2136c54e1ec5ed518f8eb94d5883486e0ec3afd | [
"0BSD"
] | 10 | 2016-10-17T07:14:05.000Z | 2021-12-05T02:54:41.000Z | examples/routes/delete_route.py | route4me/route4me-python-sdk | e2136c54e1ec5ed518f8eb94d5883486e0ec3afd | [
"0BSD"
] | 14 | 2017-02-26T23:52:00.000Z | 2017-09-16T19:28:49.000Z | examples/routes/delete_route.py | route4me/route4me-python-sdk | e2136c54e1ec5ed518f8eb94d5883486e0ec3afd | [
"0BSD"
] | 8 | 2017-02-23T14:27:07.000Z | 2020-05-23T14:23:55.000Z | # -*- coding: utf-8 -*-
from route4me import Route4Me
API_KEY = "11111111111111111111111111111111"
def main():
route4me = Route4Me(API_KEY)
route = route4me.route
print('Getting Last Route')
response = route.get_routes(limit=1, offset=0)
if isinstance(response, dict) and 'errors' in response.key... | 27.321429 | 70 | 0.616993 |
from route4me import Route4Me
API_KEY = "11111111111111111111111111111111"
def main():
route4me = Route4Me(API_KEY)
route = route4me.route
print('Getting Last Route')
response = route.get_routes(limit=1, offset=0)
if isinstance(response, dict) and 'errors' in response.keys():
print('. '.... | true | true |
f753d7931862afa85c35b836963feb657274ee85 | 1,532 | py | Python | tools/gwd/test_hrsc2016.py | LucasKirsten/RotationDetection | 8b4dadc8a10463a98143061929353325fee7ff4f | [
"Apache-2.0"
] | null | null | null | tools/gwd/test_hrsc2016.py | LucasKirsten/RotationDetection | 8b4dadc8a10463a98143061929353325fee7ff4f | [
"Apache-2.0"
] | null | null | null | tools/gwd/test_hrsc2016.py | LucasKirsten/RotationDetection | 8b4dadc8a10463a98143061929353325fee7ff4f | [
"Apache-2.0"
] | 1 | 2021-05-20T03:23:10.000Z | 2021-05-20T03:23:10.000Z | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
import tensorflow as tf
import time
import cv2
import pickle
import numpy as np
import argparse
from tqdm import tqdm
sys.path.append("../../")
from libs.models.det... | 28.90566 | 91 | 0.644256 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
import tensorflow as tf
import time
import cv2
import pickle
import numpy as np
import argparse
from tqdm import tqdm
sys.path.append("../../")
from libs.models.detectors.gwd import build... | true | true |
f753d85459fbf3e4b5e0292900c0657220b7d5ac | 42,612 | py | Python | ios_device/util/kperf_data.py | hhkhub/py-ios-device | dc1d5cf8ef0089fd158cc286a0c2380e7b172be2 | [
"MIT"
] | null | null | null | ios_device/util/kperf_data.py | hhkhub/py-ios-device | dc1d5cf8ef0089fd158cc286a0c2380e7b172be2 | [
"MIT"
] | null | null | null | ios_device/util/kperf_data.py | hhkhub/py-ios-device | dc1d5cf8ef0089fd158cc286a0c2380e7b172be2 | [
"MIT"
] | null | null | null | # Referenced from
# https://opensource.apple.com/tarballs/xnu-7195.60.75/bsd/kern/kdebug.c
# https://gitee.com/mirrors/darwin-xnu/blob/main/bsd/kern/kdebug.c kdebug.h
import enum
import io
from construct import Struct, Const, Padding, Int32ul, Int64ul, Array, GreedyRange, Byte, FixedSized, \
CString
KDBG_CLASS... | 42.569431 | 130 | 0.602389 |
import enum
import io
from construct import Struct, Const, Padding, Int32ul, Int64ul, Array, GreedyRange, Byte, FixedSized, \
CString
KDBG_CLASS_MASK = 0xff000000
KDBG_CLASS_OFFSET = 24
KDBG_CLASS_MAX = 0xff
KDBG_SUBCLASS_MASK = 0x00ff0000
KDBG_SUBCLASS_OFFSET = 16
KDBG_SUBCLASS_MAX = 0xff
KDBG_CSC_MASK = 0xf... | true | true |
f753d96cfc53c8dd7171651c0968725e044ed33f | 327 | py | Python | openldap/util.py | bjthorpe/cogs3 | d6f0091c41f784ff1884456037685bfabd7c1897 | [
"MIT"
] | null | null | null | openldap/util.py | bjthorpe/cogs3 | d6f0091c41f784ff1884456037685bfabd7c1897 | [
"MIT"
] | 150 | 2018-08-07T09:34:47.000Z | 2019-08-15T20:16:11.000Z | openldap/util.py | bjthorpe/cogs3 | d6f0091c41f784ff1884456037685bfabd7c1897 | [
"MIT"
] | 2 | 2019-02-20T15:40:30.000Z | 2019-07-01T15:03:55.000Z | from django.conf import settings
from security.json_web_token import JSONWebToken
def decode_response(response):
return JSONWebToken.decode(
data=response.content,
key=settings.OPENLDAP_JWT_KEY,
audience=settings.OPENLDAP_JWT_AUDIENCE,
algorithms=[settings.OPENLDAP_JWT_ALGORITHM],... | 25.153846 | 53 | 0.749235 | from django.conf import settings
from security.json_web_token import JSONWebToken
def decode_response(response):
return JSONWebToken.decode(
data=response.content,
key=settings.OPENLDAP_JWT_KEY,
audience=settings.OPENLDAP_JWT_AUDIENCE,
algorithms=[settings.OPENLDAP_JWT_ALGORITHM],... | true | true |
f753d97e1ea949802bf37cf5a629b8e2d66a4715 | 500 | py | Python | coogger/cooggerapp/urls/explorer.py | adilkhan8000/coogger | 0d9350116bec29c0c4f5229118e4045c9e64d796 | [
"MIT"
] | null | null | null | coogger/cooggerapp/urls/explorer.py | adilkhan8000/coogger | 0d9350116bec29c0c4f5229118e4045c9e64d796 | [
"MIT"
] | null | null | null | coogger/cooggerapp/urls/explorer.py | adilkhan8000/coogger | 0d9350116bec29c0c4f5229118e4045c9e64d796 | [
"MIT"
] | null | null | null | from django.conf.urls import url
# views
from cooggerapp.views import explorer
urlpatterns = [
url(r'^tags/(?P<hashtag>.+)/', explorer.Hashtag.as_view(), name="hashtag"),
url(r'^list/(?P<list_>.+)/', explorer.Userlist.as_view(), name="list"),
url(r'^language/(?P<lang_name>.+)/', explorer.Languages.as_view... | 38.461538 | 88 | 0.654 | from django.conf.urls import url
from cooggerapp.views import explorer
urlpatterns = [
url(r'^tags/(?P<hashtag>.+)/', explorer.Hashtag.as_view(), name="hashtag"),
url(r'^list/(?P<list_>.+)/', explorer.Userlist.as_view(), name="list"),
url(r'^language/(?P<lang_name>.+)/', explorer.Languages.as_view(), name... | true | true |
f753da67e867d578406a31999b64b79bdaa9726a | 11,094 | py | Python | dl/pytorch/rnn/char-lstm.py | xta0/Python-Playground | 513ebd2ad7f0a8c69f2f04b4f7524b31e76fa5bc | [
"MIT"
] | null | null | null | dl/pytorch/rnn/char-lstm.py | xta0/Python-Playground | 513ebd2ad7f0a8c69f2f04b4f7524b31e76fa5bc | [
"MIT"
] | null | null | null | dl/pytorch/rnn/char-lstm.py | xta0/Python-Playground | 513ebd2ad7f0a8c69f2f04b4f7524b31e76fa5bc | [
"MIT"
] | null | null | null | import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
# open text file and read in data as `text`
with open('data/anna.txt', 'r') as f:
text = f.read()
# print(text[:100])
# encode the text and map each character to an integer and vice versa
# we create two dictionaries:
# 1. int2... | 34.453416 | 110 | 0.585542 | import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
with open('data/anna.txt', 'r') as f:
text = f.read()
chars = tuple(set(text)) int2char = dict(enumerate(chars))
char2int = {ch: ii for ii, ch in int2char.items()}
# encode the text
encoded = np.array([char2int[ch] for ch in t... | true | true |
f753da6f579f5bcae722726f633d4dcebf5915b0 | 13,660 | py | Python | frappe/client.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | frappe/client.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | frappe/client.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import json
import os
from typing import TYPE_CHECKING
import frappe
import frappe.model
import frappe.utils
from frappe import _
from frappe.desk.reportview import validate_args
from frappe.model.db_query import check_par... | 27.157058 | 106 | 0.729502 | import json
import os
from typing import TYPE_CHECKING
import frappe
import frappe.model
import frappe.utils
from frappe import _
from frappe.desk.reportview import validate_args
from frappe.model.db_query import check_parent_permission
from frappe.utils import get_safe_filters
if TYPE_CHECKING:
from frappe.model.do... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.