hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d5f1a1c857b1d3f10679d59d69057bef09390ab4 | 9,322 | py | Python | iatikit/data/dataset.py | codeforIATI/iatik | 03e178d04a0d543495f90e485a54771ae3bdc159 | [
"MIT"
] | 4 | 2019-10-04T13:16:26.000Z | 2021-09-28T15:56:30.000Z | iatikit/data/dataset.py | codeforIATI/iatik | 03e178d04a0d543495f90e485a54771ae3bdc159 | [
"MIT"
] | 7 | 2019-07-24T14:50:36.000Z | 2021-08-10T08:24:22.000Z | iatikit/data/dataset.py | codeforIATI/iatikit | 03e178d04a0d543495f90e485a54771ae3bdc159 | [
"MIT"
] | null | null | null | from os.path import basename, exists, splitext
from glob import glob
import json
import logging
import webbrowser
from lxml import etree as ET
from ..utils.abstract import GenericSet
from ..utils.exceptions import SchemaNotFoundError, MappingsNotFoundError
from ..utils.validator import Validator, ValidationError
from... | 34.272059 | 77 | 0.587964 |
33270f7ed487f924836c2ff796f920a082856986 | 4,137 | py | Python | test.py | luost26/score-denoise | e5fc1fe0c5cfd1713271044b3df3274d561035ad | [
"MIT"
] | 31 | 2021-07-23T04:14:59.000Z | 2022-03-30T03:34:18.000Z | test.py | luost26/score-denoise | e5fc1fe0c5cfd1713271044b3df3274d561035ad | [
"MIT"
] | 5 | 2021-08-24T12:20:57.000Z | 2022-02-20T06:03:53.000Z | test.py | luost26/score-denoise | e5fc1fe0c5cfd1713271044b3df3274d561035ad | [
"MIT"
] | 6 | 2021-10-14T09:53:32.000Z | 2022-02-20T03:43:26.000Z | import os
import time
import argparse
import torch
import torch.utils.tensorboard
from torch.utils.data import DataLoader
from torch.nn.utils import clip_grad_norm_
from tqdm.auto import tqdm
from datasets import *
from utils.misc import *
from utils.transforms import *
from utils.denoise import *
from utils.evaluate ... | 36.610619 | 107 | 0.683587 |
8b5e0d4b906f6fc8b6e12c154f93e0fc5820990f | 735 | py | Python | tests/test_linkcheck.py | cehbrecht/md-ingestion | 895ae4ce36c54662301541f58a1fd3a900e0aeea | [
"Apache-2.0"
] | 4 | 2016-01-04T11:15:07.000Z | 2021-08-12T05:23:51.000Z | tests/test_linkcheck.py | cehbrecht/md-ingestion | 895ae4ce36c54662301541f58a1fd3a900e0aeea | [
"Apache-2.0"
] | 19 | 2015-06-04T10:02:53.000Z | 2020-09-21T12:46:00.000Z | tests/test_linkcheck.py | cehbrecht/md-ingestion | 895ae4ce36c54662301541f58a1fd3a900e0aeea | [
"Apache-2.0"
] | 7 | 2018-02-07T15:34:10.000Z | 2021-03-25T09:08:22.000Z | import os
from mdingestion.reader import DataCiteReader
from mdingestion.linkcheck import LinkChecker, ignore_url
from tests.common import TESTDATA_DIR
def test_linkcheck():
xml_file = os.path.join(TESTDATA_DIR, 'darus', 'raw', 'Discipline_30fec4d2-1f79-5192-9247-c67154475715.xml')
reader = DataCiteReader()... | 30.625 | 113 | 0.742857 |
73c106480ae912878576d10d9e88d1180f2f83e5 | 7,889 | py | Python | tests/test_features.py | dkajtoch/datasets | 12ef7f0d541a5aca5b29ebc2dddf5e1214f0e3e9 | [
"Apache-2.0"
] | 9 | 2021-04-26T14:43:52.000Z | 2021-11-08T09:47:24.000Z | tests/test_features.py | dkajtoch/datasets | 12ef7f0d541a5aca5b29ebc2dddf5e1214f0e3e9 | [
"Apache-2.0"
] | null | null | null | tests/test_features.py | dkajtoch/datasets | 12ef7f0d541a5aca5b29ebc2dddf5e1214f0e3e9 | [
"Apache-2.0"
] | 1 | 2021-05-04T16:54:23.000Z | 2021-05-04T16:54:23.000Z | from dataclasses import asdict
from unittest import TestCase
from unittest.mock import patch
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
from datasets import DatasetInfo
from datasets.arrow_dataset import Dataset
from datasets.features import (
ClassLabel,
Features,
Sequence,... | 43.346154 | 112 | 0.624667 |
ddab7341270cecc70bc1c675764dd880cb98335b | 409 | py | Python | plugins/trustedcoin/__init__.py | Anfauglith/fermatum | 0cd0a612d70a5fd8936404594f0f83328cf9406d | [
"MIT"
] | null | null | null | plugins/trustedcoin/__init__.py | Anfauglith/fermatum | 0cd0a612d70a5fd8936404594f0f83328cf9406d | [
"MIT"
] | null | null | null | plugins/trustedcoin/__init__.py | Anfauglith/fermatum | 0cd0a612d70a5fd8936404594f0f83328cf9406d | [
"MIT"
] | 1 | 2018-03-06T17:25:55.000Z | 2018-03-06T17:25:55.000Z | from fermatum.i18n import _
fullname = _('Two Factor Authentication')
description = ''.join([
_("This plugin adds two-factor authentication to your wallet."), '<br/>',
_("For more information, visit"),
" <a href=\"https://api.trustedcoin.com/#/fermatum-help\">https://api.trustedcoin.com/#/fermatum-help</a>... | 34.083333 | 110 | 0.689487 |
74645d756267da60cd4a8bac9100a043a587eafc | 1,321 | py | Python | tests/workup/intensity/test_intensity.py | wright-group/WrightTune | e9a4937b6fda24dfd10baf2fc674c15542861aba | [
"MIT"
] | 2 | 2020-08-20T14:26:19.000Z | 2021-07-19T22:51:19.000Z | tests/workup/intensity/test_intensity.py | wright-group/attune | 67b7e5590a11e9b09056e7d334fd7d7286a24c5f | [
"MIT"
] | 96 | 2017-10-12T01:16:01.000Z | 2022-02-23T19:43:57.000Z | tests/workup/intensity/test_intensity.py | wright-group/WrightTune | e9a4937b6fda24dfd10baf2fc674c15542861aba | [
"MIT"
] | 2 | 2021-08-17T22:22:06.000Z | 2021-09-01T02:30:06.000Z | import attune
import pathlib
import numpy as np
import WrightTools as wt
__here__ = pathlib.Path(__file__).parent
def test():
data = wt.open(__here__ / "data.wt5")
data.transform("w1=wm", "w1_Delay_2", "wa_points")
data.moment("wa_points", moment=0)
data.transform("w1=wm", "w1_Delay_2_points")
... | 27.520833 | 93 | 0.637396 |
267609fc553b28e20cf8fa689eda680c0bc9b470 | 44,923 | py | Python | src/DyldExtractor/converter/objc_fixer.py | arandomdev/DyldExtractor | 8471c9b6c7c62d97d350d89d1e0af16d01d3630d | [
"MIT"
] | 177 | 2020-11-03T21:02:45.000Z | 2022-03-26T00:01:08.000Z | src/DyldExtractor/converter/objc_fixer.py | arandomdev/DyldExtractor | 8471c9b6c7c62d97d350d89d1e0af16d01d3630d | [
"MIT"
] | 30 | 2020-11-05T09:41:16.000Z | 2022-03-30T12:27:08.000Z | src/DyldExtractor/converter/objc_fixer.py | arandomdev/DyldExtractor | 8471c9b6c7c62d97d350d89d1e0af16d01d3630d | [
"MIT"
] | 20 | 2020-11-05T08:19:12.000Z | 2022-03-26T00:01:24.000Z | import struct
import ctypes
import capstone as cp
from DyldExtractor.extraction_context import ExtractionContext
from DyldExtractor.converter import (
slide_info,
stub_fixer
)
from DyldExtractor.objc.objc_structs import (
objc_category_t,
objc_class_data_t,
objc_class_t,
objc_ivar_list_t,
objc_ivar_t,
objc_me... | 27.71314 | 228 | 0.71558 |
d15c53bdef48239aad3d34966590fd66baba7655 | 1,697 | py | Python | pieces/knight.py | retropleinad/Chess | ddce252c568012ecd380fac555b3e6762a7d93ed | [
"MIT"
] | null | null | null | pieces/knight.py | retropleinad/Chess | ddce252c568012ecd380fac555b3e6762a7d93ed | [
"MIT"
] | null | null | null | pieces/knight.py | retropleinad/Chess | ddce252c568012ecd380fac555b3e6762a7d93ed | [
"MIT"
] | null | null | null | from pieces.piece import Piece
class Knight(Piece):
# Inherited constructor
# Update the piece value
def __init__(self, color, column, row, picture):
super().__init__(color, column, row, picture)
self.val = 3
# Is the square in a 2 by 3 or a 3 by 2?
# Is there a frien... | 41.390244 | 93 | 0.507366 |
726cc9a2e148aa5b34b45bdc77d0f76ef207506b | 14,597 | py | Python | python/oneflow/nn/optimizer/optimizer.py | L-Net-1992/oneflow | 4dc08d65caea36fdd137841ac95551218897e730 | [
"Apache-2.0"
] | 1 | 2022-03-14T11:17:56.000Z | 2022-03-14T11:17:56.000Z | python/oneflow/nn/optimizer/optimizer.py | L-Net-1992/oneflow | 4dc08d65caea36fdd137841ac95551218897e730 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/optimizer/optimizer.py | L-Net-1992/oneflow | 4dc08d65caea36fdd137841ac95551218897e730 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 38.112272 | 148 | 0.607454 |
3601d6bf0a2257114da69a12a632c76c65e2ad72 | 3,734 | py | Python | driver.py | mzpqnxow/pysimplecasper | 64ab1b8fbc2e1b0277bf8c1cc1fe1ec6843a93e0 | [
"BSD-3-Clause"
] | null | null | null | driver.py | mzpqnxow/pysimplecasper | 64ab1b8fbc2e1b0277bf8c1cc1fe1ec6843a93e0 | [
"BSD-3-Clause"
] | null | null | null | driver.py | mzpqnxow/pysimplecasper | 64ab1b8fbc2e1b0277bf8c1cc1fe1ec6843a93e0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This is a sample program that utilizes the CasperAPI class
It will produce a small set of files in CSV and JSON formats
See the README.md for a summary of the content of these files
Copyright 2017, <copyright@mzpqnxow.com>
See COPYRIGHT for details
"""
from __future__ ... | 42.431818 | 121 | 0.705142 |
f1653697c06153638ddf8d4c5fa395e5bed7e87a | 9,290 | py | Python | server/test/unit/common/utils/test_type_conversion_utils.py | ElucidataInc/cellxgene | 2c2761d9ddf80d69cbe0e4d5ea2c772a5bd002ba | [
"MIT"
] | null | null | null | server/test/unit/common/utils/test_type_conversion_utils.py | ElucidataInc/cellxgene | 2c2761d9ddf80d69cbe0e4d5ea2c772a5bd002ba | [
"MIT"
] | null | null | null | server/test/unit/common/utils/test_type_conversion_utils.py | ElucidataInc/cellxgene | 2c2761d9ddf80d69cbe0e4d5ea2c772a5bd002ba | [
"MIT"
] | null | null | null | import unittest
from time import time
from unittest.mock import patch
import numpy as np
from pandas import Series, DataFrame
from server.common.utils.type_conversion_utils import can_cast_to_float32, can_cast_to_int32, get_dtype_of_array, \
get_schema_type_hint_of_array, get_dtypes_and_schemas_of_dataframe, conv... | 45.097087 | 120 | 0.710441 |
243de701ad10bc72068c3659a1dde48d41fe6a2d | 48,928 | py | Python | catalyst/data/minute_bars.py | guilhermeprokisch/catalyst | 21e096b261912d9e905584178d6ee626072c23cb | [
"Apache-2.0"
] | null | null | null | catalyst/data/minute_bars.py | guilhermeprokisch/catalyst | 21e096b261912d9e905584178d6ee626072c23cb | [
"Apache-2.0"
] | null | null | null | catalyst/data/minute_bars.py | guilhermeprokisch/catalyst | 21e096b261912d9e905584178d6ee626072c23cb | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 35.818448 | 117 | 0.587292 |
fce08a8a08d48b534301845bf8dbac8b4dc02f7e | 6,547 | py | Python | alibabacloud/clients/aas_20150701.py | wallisyan/alibabacloud-python-sdk-v2 | 6e024c97cded2403025a7dd8fea8261e41872156 | [
"Apache-2.0"
] | 21 | 2018-12-20T07:34:13.000Z | 2020-03-05T14:32:08.000Z | alibabacloud/clients/aas_20150701.py | wallisyan/alibabacloud-python-sdk-v2 | 6e024c97cded2403025a7dd8fea8261e41872156 | [
"Apache-2.0"
] | 22 | 2018-12-21T13:22:33.000Z | 2020-06-29T08:37:09.000Z | alibabacloud/clients/aas_20150701.py | wallisyan/alibabacloud-python-sdk-v2 | 6e024c97cded2403025a7dd8fea8261e41872156 | [
"Apache-2.0"
] | 12 | 2018-12-29T05:45:55.000Z | 2022-01-05T09:59:30.000Z | # Copyright 2019 Alibaba Cloud 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 applicable la... | 52.798387 | 100 | 0.703528 |
3fbc808055a3c4e51ad681e9ed900e81d6a23ee8 | 588 | py | Python | escpos/__init__.py | vakochetkov/pyqt-escpos | 026d212efd8607b4c2f273bde6157a0ce2d40121 | [
"MIT"
] | 2 | 2019-07-07T21:29:59.000Z | 2019-08-30T15:46:21.000Z | escpos/__init__.py | vakochetkov/pyqt-escpos | 026d212efd8607b4c2f273bde6157a0ce2d40121 | [
"MIT"
] | null | null | null | escpos/__init__.py | vakochetkov/pyqt-escpos | 026d212efd8607b4c2f273bde6157a0ce2d40121 | [
"MIT"
] | 1 | 2020-12-05T17:40:55.000Z | 2020-12-05T17:40:55.000Z | # -*- coding: utf-8 -*-
"""
python-escpos enables you to manipulate escpos-printers
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
__all__ = ["constants", "escpos", "exceptions", "printer"]
try:
from .version... | 29.4 | 76 | 0.715986 |
8703c10f83a2c5e7ca76641c03d2b01e829c4cb9 | 112 | py | Python | stimuli/Python/one_file_per_item/en/76_# str_for 4.py | ALFA-group/neural_program_comprehension | 0253911f376cf282af5a5627e38e0a591ad38860 | [
"MIT"
] | 6 | 2020-04-24T08:16:51.000Z | 2021-11-01T09:50:46.000Z | stimuli/Python/one_file_per_item/en/76_# str_for 4.py | ALFA-group/neural_program_comprehension | 0253911f376cf282af5a5627e38e0a591ad38860 | [
"MIT"
] | null | null | null | stimuli/Python/one_file_per_item/en/76_# str_for 4.py | ALFA-group/neural_program_comprehension | 0253911f376cf282af5a5627e38e0a591ad38860 | [
"MIT"
] | 4 | 2021-02-17T20:21:31.000Z | 2022-02-14T12:43:23.000Z | words_list = ["apple", "carrot", "orange"]
for word in words_list:
new_word = ">" + word
print(new_word)
| 14 | 42 | 0.633929 |
f1516b357bc2f35a05528b33898e6a4c12fa3f5e | 6,267 | py | Python | www/base/db.py | Yaoxin/improved_webpy | eeb47fe5105c8273211b982742fd03351ad4e672 | [
"MIT"
] | null | null | null | www/base/db.py | Yaoxin/improved_webpy | eeb47fe5105c8273211b982742fd03351ad4e672 | [
"MIT"
] | null | null | null | www/base/db.py | Yaoxin/improved_webpy | eeb47fe5105c8273211b982742fd03351ad4e672 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
a simple db connector ,with long connection
'''
__version__ = '1.0.1'
__author__ = 'cloudy'
import pymysql
import pymysql.cursors
import time, uuid
from log import logger
__all__ = ["Dict", "Database", "DBError", "DatabaseExecError", "MultiColumnsError"]
def next_... | 28.103139 | 106 | 0.52577 |
7cd2c5c8a1100cd89fa2e7a1c997e3b8bea2b7b4 | 2,697 | py | Python | mail/mail_handler.py | Wil-Peters/HomeAutomation | ab4f78d9fad42093435732233e99003f12dca5e7 | [
"MIT"
] | 2 | 2020-04-09T20:29:15.000Z | 2021-01-20T09:21:02.000Z | mail/mail_handler.py | Wil-Peters/HomeAutomation | ab4f78d9fad42093435732233e99003f12dca5e7 | [
"MIT"
] | null | null | null | mail/mail_handler.py | Wil-Peters/HomeAutomation | ab4f78d9fad42093435732233e99003f12dca5e7 | [
"MIT"
] | null | null | null | import configparser
from imap_tools import MailBox, Q
import os
from core.intent import Intent
from core.intentdefinition import IntentDefinition
from core.intenthandler import IntentHandler
class MailHandler(IntentHandler):
_new_mails = []
_current_email = None
def __init__(self):
IntentHandle... | 40.863636 | 140 | 0.640712 |
8d3cec3db97ec4bc66f947a12af117303fc37ba3 | 2,786 | py | Python | lab1/part2/detect.py | jhxie/cmput333 | 50d3c04a466466fc99b412e8f2feea69b296174a | [
"MIT"
] | null | null | null | lab1/part2/detect.py | jhxie/cmput333 | 50d3c04a466466fc99b412e8f2feea69b296174a | [
"MIT"
] | null | null | null | lab1/part2/detect.py | jhxie/cmput333 | 50d3c04a466466fc99b412e8f2feea69b296174a | [
"MIT"
] | 1 | 2021-04-12T23:32:32.000Z | 2021-04-12T23:32:32.000Z | #!/usr/bin/env python3
"""
File type detector for part 2 of lab 1.
"""
# ------------------------------- MODULE INFO ---------------------------------
__all__ = []
# ------------------------------- MODULE INFO ---------------------------------
# --------------------------------- MODULES -----------------------------... | 35.265823 | 79 | 0.491385 |
7a8f9a98f4c077a86509b1660e88f002bb3c2b39 | 15,590 | py | Python | pyquil/api/_qpu.py | kalzoo/pyquil | f37d55acb906a02c0f3320ee3990e9051ee64145 | [
"Apache-2.0"
] | null | null | null | pyquil/api/_qpu.py | kalzoo/pyquil | f37d55acb906a02c0f3320ee3990e9051ee64145 | [
"Apache-2.0"
] | null | null | null | pyquil/api/_qpu.py | kalzoo/pyquil | f37d55acb906a02c0f3320ee3990e9051ee64145 | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# Copyright 2016-2018 Rigetti Computing
#
# 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... | 42.595628 | 100 | 0.631302 |
9ff8279c74a1bfb47495ac9e3efaf71880aabf6b | 10,433 | py | Python | github_issue_summarization/demo/gh-demo-1003/ks_app/vendor/kubeflow/core/kubeform_spawner.py | qq2016/kubeflow_learning | 930706686108f997aab42ccf2fe455dcf09a4afc | [
"Apache-2.0"
] | 1,165 | 2018-03-01T01:47:14.000Z | 2022-03-31T08:35:00.000Z | github_issue_summarization/demo/gh-demo-1003/ks_app/vendor/kubeflow/core/kubeform_spawner.py | arki1/examples | c93b792d67c8c52bc91d4ccf5fbaead4e2324331 | [
"Apache-2.0"
] | 929 | 2018-02-04T18:20:16.000Z | 2022-03-31T18:20:43.000Z | github_issue_summarization/demo/gh-demo-1003/ks_app/vendor/kubeflow/core/kubeform_spawner.py | arki1/examples | c93b792d67c8c52bc91d4ccf5fbaead4e2324331 | [
"Apache-2.0"
] | 687 | 2018-02-01T21:35:30.000Z | 2022-03-29T07:47:47.000Z | import json
import os
import string
import escapism
from kubespawner.spawner import KubeSpawner
from jhub_remote_user_authenticator.remote_user_auth import RemoteUserAuthenticator
from oauthenticator.github import GitHubOAuthenticator
SERVICE_ACCOUNT_SECRET_MOUNT = '/var/run/secrets/sa'
class KubeFormSpawner(KubeSpaw... | 37.528777 | 130 | 0.62216 |
558083fdefc667931fb59da6f796de941ef02565 | 963 | py | Python | swim/render.py | alexsigaras/SWIM | 1a35df8acb26bdcb307a1b8f60e9feba68ed1715 | [
"MIT"
] | 3 | 2015-06-05T00:32:44.000Z | 2017-01-06T15:44:32.000Z | swim/render.py | alexsigaras/SWIM | 1a35df8acb26bdcb307a1b8f60e9feba68ed1715 | [
"MIT"
] | null | null | null | swim/render.py | alexsigaras/SWIM | 1a35df8acb26bdcb307a1b8f60e9feba68ed1715 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#############################################
## (C)opyright by Dirk Holtwick ##
## All rights reserved ##
#############################################
__version__ = "$Revision: 176 $"
__author__ = "$Author: kgrodzicki $"
__date__ = "$Date: 2011-01-15 10:11:47 +0... | 28.323529 | 66 | 0.551402 |
5bd124ff4a03820140962028337d2e6fd88b4396 | 7,697 | py | Python | grit/format/policy_templates/writers/adml_writer.py | MIPS/external-chromium_org-tools-grit | 646f47f4f3b103f878faabfa7f8a4cd2860822a5 | [
"BSD-2-Clause"
] | 1 | 2017-08-06T01:12:23.000Z | 2017-08-06T01:12:23.000Z | tools/grit/grit/format/policy_templates/writers/adml_writer.py | ufologist/qx | a2d64a337ecb2cd5752bd848afb2315c93e0fabe | [
"MIT"
] | null | null | null | tools/grit/grit/format/policy_templates/writers/adml_writer.py | ufologist/qx | a2d64a337ecb2cd5752bd848afb2315c93e0fabe | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from xml.dom import minidom
from grit.format.policy_templates.writers import xml_formatted_writer
def GetWriter(config):
'''Fac... | 42.524862 | 80 | 0.668312 |
d32ac6f1afe70b8b5c678d1a8eb3962c4a4fec93 | 3,627 | py | Python | system/search_answers_area/P3_par_contornos.py | gabrieluca/exams-org | 159b53b565693441ef552bf19b2b6f9b8c107fe0 | [
"MIT"
] | null | null | null | system/search_answers_area/P3_par_contornos.py | gabrieluca/exams-org | 159b53b565693441ef552bf19b2b6f9b8c107fe0 | [
"MIT"
] | null | null | null | system/search_answers_area/P3_par_contornos.py | gabrieluca/exams-org | 159b53b565693441ef552bf19b2b6f9b8c107fe0 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import os
from Normalize_and_crop import normalize_crop
def main_par(img,template,template2,Exam_pack,Page_number):
img1, img2 = normalize_crop(img,template,template2)
img_qdrp = img2[1855:2159, 790:1480]
ares1 = img1[1458:2138,5:1460]
ares2 = img2[23:2150,19:1470]
im... | 38.178947 | 128 | 0.6504 |
6e10d4c49d19edf2006dedcb9e856199b98eace7 | 9,215 | py | Python | plugins/trezor/clientbase.py | tokenchain/electrum | 3d8807436449b9534f9aa84bee84b9c534e78a90 | [
"MIT"
] | 1 | 2021-04-15T14:12:50.000Z | 2021-04-15T14:12:50.000Z | plugins/trezor/clientbase.py | tokenchain/electrum | 3d8807436449b9534f9aa84bee84b9c534e78a90 | [
"MIT"
] | 2 | 2019-01-05T17:00:00.000Z | 2019-02-28T15:33:56.000Z | plugins/trezor/clientbase.py | tokenchain/electrum | 3d8807436449b9534f9aa84bee84b9c534e78a90 | [
"MIT"
] | 5 | 2018-05-14T17:53:07.000Z | 2018-09-13T09:51:56.000Z | import time
from struct import pack
from electrum.i18n import _
from electrum.util import PrintError, UserCancelled
from electrum.keystore import bip39_normalize_passphrase
from electrum.bitcoin import serialize_xpub
class GuiMixin(object):
# Requires: self.proto, self.device
messages = {
3: _("Conf... | 38.395833 | 136 | 0.61682 |
8ad47626c4b9ecb69cc203bee4afb8043d2d7350 | 108 | py | Python | settings_example.py | cybrairai/memberlists | b25b6a64eb464cde7c9d4342ed324b2a84bf86df | [
"Unlicense"
] | 1 | 2020-06-24T19:14:01.000Z | 2020-06-24T19:14:01.000Z | settings_example.py | cybrairai/memberlists | b25b6a64eb464cde7c9d4342ed324b2a84bf86df | [
"Unlicense"
] | null | null | null | settings_example.py | cybrairai/memberlists | b25b6a64eb464cde7c9d4342ed324b2a84bf86df | [
"Unlicense"
] | null | null | null | api_url = 'https://in.cyb.no/'
api_username = ''
api_password = ''
api_client_id= ''
api_client_secret = ''
| 18 | 30 | 0.675926 |
52f0a8543ec48b4eb95849f0714dc014dc4eaa7f | 10,385 | py | Python | research/deeplab/evaluation/streaming_metrics.py | KSomi/models | cc6c45ca6b701426d35bbbab104ad32a2e80a3cf | [
"Apache-2.0"
] | 3,255 | 2016-08-18T17:53:27.000Z | 2022-03-29T19:53:43.000Z | research/deeplab/evaluation/streaming_metrics.py | KSomi/models | cc6c45ca6b701426d35bbbab104ad32a2e80a3cf | [
"Apache-2.0"
] | 141 | 2017-07-17T09:14:37.000Z | 2022-03-14T00:00:19.000Z | research/deeplab/evaluation/streaming_metrics.py | KSomi/models | cc6c45ca6b701426d35bbbab104ad32a2e80a3cf | [
"Apache-2.0"
] | 2,580 | 2017-05-14T14:33:41.000Z | 2022-03-31T15:04:14.000Z | # Copyright 2019 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 43.270833 | 80 | 0.693693 |
75e45cf5292aee4d30e2c03e9a0363cb1c55f007 | 6,351 | py | Python | Facility-Sync/generic_sde2fgdb_replicator.py | regan-sarwas/PDS-Data-Management | 1298b37c60f58cb404836b87c58accf2b7859e6a | [
"MIT"
] | 1 | 2021-04-22T18:55:34.000Z | 2021-04-22T18:55:34.000Z | Facility-Sync/generic_sde2fgdb_replicator.py | regan-sarwas/PDS-Data-Management | 1298b37c60f58cb404836b87c58accf2b7859e6a | [
"MIT"
] | 14 | 2019-05-09T20:01:59.000Z | 2019-10-21T18:26:14.000Z | Facility-Sync/generic_sde2fgdb_replicator.py | regan-sarwas/PDS-Data-Management | 1298b37c60f58cb404836b87c58accf2b7859e6a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
A generic tool to export an esri SDE database to a file geodatabase.
This tool is designed to be run as a scheduled task.
Since it is generic, it applies no special filters or transformations on the
data sets it exports.
This tool was tested with ArcGIS 10.6.1 and Pro 2.5.1
Non-standard mo... | 34.145161 | 94 | 0.607463 |
f8ae711edce4a9f9c696c05855136943ddc1563a | 3,000 | py | Python | venv/lib/python3.6/site-packages/thinc/neural/_classes/difference.py | lumierra/project-flask | 6e27148299a283c92f5d758d269f3b5fc6e2163e | [
"MIT"
] | 1 | 2018-10-30T07:19:27.000Z | 2018-10-30T07:19:27.000Z | venv/lib/python3.6/site-packages/thinc/neural/_classes/difference.py | lumierra/project-flask | 6e27148299a283c92f5d758d269f3b5fc6e2163e | [
"MIT"
] | 4 | 2020-07-26T02:10:42.000Z | 2021-03-31T18:48:58.000Z | venv/lib/python3.6/site-packages/thinc/neural/_classes/difference.py | lumierra/project-flask | 6e27148299a283c92f5d758d269f3b5fc6e2163e | [
"MIT"
] | 1 | 2020-11-18T06:18:15.000Z | 2020-11-18T06:18:15.000Z | import numpy
from thinc.api import layerize
from thinc.neural import Model
from ... import describe
from ...describe import Dimension, Synapses, Biases, Gradient
def inverse(total):
inverse = 1. / (1+total)
def backward(d_inverse):
result = d_inverse * (-1 / (total+1)**2)
return result
ret... | 33.333333 | 74 | 0.585333 |
2f3e85316dcb2f0f52310ca26bff9d92889c7cb9 | 1,178 | py | Python | project_V1/login/migrations/0001_initial.py | arnabtarwani/UCD-MSc-Project | 3ab9a8fc0a092a8dd03099d1d5fa55eb127ef3dc | [
"MIT"
] | 1 | 2019-09-13T16:09:40.000Z | 2019-09-13T16:09:40.000Z | project_V1/login/migrations/0001_initial.py | arnabtarwani/Buddyup-ucd-msc-project | 3ab9a8fc0a092a8dd03099d1d5fa55eb127ef3dc | [
"MIT"
] | 9 | 2020-03-24T17:39:10.000Z | 2022-02-10T10:09:09.000Z | project_V1/login/migrations/0001_initial.py | arnabtarwani/UCD-MSc-Project | 3ab9a8fc0a092a8dd03099d1d5fa55eb127ef3dc | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-08-09 13:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='User_detail',
fields=[
... | 35.69697 | 152 | 0.60781 |
efac26f0bf10e534aae6123ff83100dd79235ed9 | 8,838 | py | Python | rest_api/sawtooth_rest_api/rest_api.py | patricknieves/seth | 448a93077515fa647b7a9b18c70672a2d3bb1a8d | [
"Apache-2.0"
] | null | null | null | rest_api/sawtooth_rest_api/rest_api.py | patricknieves/seth | 448a93077515fa647b7a9b18c70672a2d3bb1a8d | [
"Apache-2.0"
] | null | null | null | rest_api/sawtooth_rest_api/rest_api.py | patricknieves/seth | 448a93077515fa647b7a9b18c70672a2d3bb1a8d | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 35.071429 | 80 | 0.656936 |
422b3e9bd0a6b256fedb7adb05e87ca4ee480168 | 1,059 | py | Python | uploader/ftp/views.py | cedadev/arrivals-uploader | c4281eef3a332a535ade5438331d9c3668e6f9be | [
"BSD-3-Clause"
] | null | null | null | uploader/ftp/views.py | cedadev/arrivals-uploader | c4281eef3a332a535ade5438331d9c3668e6f9be | [
"BSD-3-Clause"
] | null | null | null | uploader/ftp/views.py | cedadev/arrivals-uploader | c4281eef3a332a535ade5438331d9c3668e6f9be | [
"BSD-3-Clause"
] | null | null | null | """ Views related to rsync or FTP account access. """
__author__ = "William Tucker"
__date__ = "2018-03-13"
__copyright__ = "Copyright 2019 United Kingdom Research and Innovation"
__license__ = "BSD - see LICENSE file in top-level package directory"
from django.shortcuts import render, redirect
from uploader.ftp.fo... | 27.153846 | 78 | 0.67611 |
79c3147f62e6635d623f7a067f7756aa60999737 | 5,412 | py | Python | lenskit/algorithms_ca/tf/biasedmf.py | jacobmunson/lenskit_confidence | 2c06d81539b0a7697014e3b7164ea64695e687d5 | [
"MIT"
] | 210 | 2018-06-09T19:39:19.000Z | 2022-03-19T15:14:23.000Z | lenskit/algorithms_ca/tf/biasedmf.py | jacobmunson/lenskit_confidence | 2c06d81539b0a7697014e3b7164ea64695e687d5 | [
"MIT"
] | 301 | 2018-06-14T22:03:24.000Z | 2022-03-11T23:05:57.000Z | lenskit/algorithms_ca/tf/biasedmf.py | jacobmunson/lenskit_confidence | 2c06d81539b0a7697014e3b7164ea64695e687d5 | [
"MIT"
] | 57 | 2018-09-25T00:34:38.000Z | 2022-02-21T10:09:56.000Z | import logging
try:
import tensorflow as tf
import tensorflow.keras as k
except ImportError:
tf = None
from lenskit import util
from ..mf_common import MFPredictor
from ..bias import Bias
from .util import init_tf_rng, check_tensorflow
_log = logging.getLogger(__name__)
class BiasedMF(MFPredictor):
... | 38.935252 | 94 | 0.63544 |
0f7cac6c23fe7cb41d5876eb73702856b8376c7e | 34 | py | Python | 4_advanced/ai-py-injection-factory/src/injection/__init__.py | grecoe/teals | ea00bab4e90d3f71e3ec2d202ce596abcf006f37 | [
"MIT"
] | null | null | null | 4_advanced/ai-py-injection-factory/src/injection/__init__.py | grecoe/teals | ea00bab4e90d3f71e3ec2d202ce596abcf006f37 | [
"MIT"
] | 9 | 2019-11-21T13:12:47.000Z | 2021-02-02T14:52:52.000Z | 4_advanced/ai-py-injection-factory/src/injection/__init__.py | grecoe/teals | ea00bab4e90d3f71e3ec2d202ce596abcf006f37 | [
"MIT"
] | 2 | 2021-01-25T03:38:30.000Z | 2021-03-07T23:54:53.000Z | from .factory import ObjectFactory | 34 | 34 | 0.882353 |
dbd5a0147cb1384b9b26ed4e7204fa3c9d425749 | 969 | py | Python | music_library/migrations/0005_auto_20201216_1420.py | loictessier/weborchestra | 80a7d8e3d94b84df65e8ecc52ea8b5cd200204e0 | [
"MIT"
] | null | null | null | music_library/migrations/0005_auto_20201216_1420.py | loictessier/weborchestra | 80a7d8e3d94b84df65e8ecc52ea8b5cd200204e0 | [
"MIT"
] | 4 | 2020-12-15T11:13:59.000Z | 2021-06-10T20:28:54.000Z | music_library/migrations/0005_auto_20201216_1420.py | loictessier/weborchestra | 80a7d8e3d94b84df65e8ecc52ea8b5cd200204e0 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.9 on 2020-12-16 14:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('music_library', '0004_stand_score'),
]
operations = [
migrations.AlterField(
model_name='instrument',
name='name',
... | 30.28125 | 116 | 0.605779 |
797a669e6d74151e0b791a945a7b463636371d00 | 9,350 | py | Python | code/cifar_net.py | seba-1511/specialists | 9888e639707142db80aafe6ae7bf25f572d34505 | [
"Apache-2.0"
] | 1 | 2016-05-31T07:54:31.000Z | 2016-05-31T07:54:31.000Z | code/cifar_net.py | seba-1511/specialists | 9888e639707142db80aafe6ae7bf25f572d34505 | [
"Apache-2.0"
] | null | null | null | code/cifar_net.py | seba-1511/specialists | 9888e639707142db80aafe6ae7bf25f572d34505 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from neon.layers import (
Affine,
Conv,
Pooling,
Linear,
Dropout,
BatchNorm,
Activation,
Convolution,
Bias,
)
from neon.models import Model
from neon.optimizers import GradientDescentMomentum, Schedule, MultiOptimizer
from neon.layers im... | 41.008772 | 145 | 0.643957 |
cad78c4a5226dc0f14e8a77615abde66dcbfac5e | 381 | py | Python | backend/urls.py | kvdomingo/covid19-ph-web | 06cc83bfcbc1db925be6dede7fd051ab39056329 | [
"MIT"
] | null | null | null | backend/urls.py | kvdomingo/covid19-ph-web | 06cc83bfcbc1db925be6dede7fd051ab39056329 | [
"MIT"
] | 9 | 2021-04-06T18:24:07.000Z | 2021-09-22T19:32:56.000Z | backend/urls.py | kvdomingo/covid19-ph-web | 06cc83bfcbc1db925be6dede7fd051ab39056329 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('cases', views.cases),
path('numbers', views.numbers),
path('counts', views.delta_counts),
path('time-plot', views.time_plot),
path('delta-plot', views.delta_plot),
path('world-plot', views.world_plot),
path('age-plot', ... | 25.4 | 41 | 0.664042 |
c78493fd44df435a2d17788ba0afeff55a00d6fa | 2,378 | py | Python | airflow/api_connexion/schemas/user_schema.py | raspberryfield/airflow | 3eb67af7a3fab61b7f691da66129c228af27d95e | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2021-07-30T16:46:46.000Z | 2021-10-19T07:18:47.000Z | airflow/api_connexion/schemas/user_schema.py | raspberryfield/airflow | 3eb67af7a3fab61b7f691da66129c228af27d95e | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 6 | 2019-03-16T02:09:30.000Z | 2019-06-27T03:27:34.000Z | airflow/api_connexion/schemas/user_schema.py | raspberryfield/airflow | 3eb67af7a3fab61b7f691da66129c228af27d95e | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-10-03T10:59:50.000Z | 2020-10-03T10:59:50.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.575342 | 79 | 0.759462 |
685d2481053cecae5080f936484b92e79062fa63 | 5,178 | py | Python | 10/code/perception/models/segmention_model.py | ankit-1517/Image-Processing | 65c4e52e0857534c252aff5d449b2c5ee091eaf7 | [
"MIT"
] | 7 | 2020-05-04T13:45:19.000Z | 2022-03-11T06:30:12.000Z | 10/code/perception/models/segmention_model.py | Banhkun/Image-Processing | 65c4e52e0857534c252aff5d449b2c5ee091eaf7 | [
"MIT"
] | 1 | 2022-01-23T12:28:13.000Z | 2022-01-23T12:28:13.000Z | 10/code/perception/models/segmention_model.py | Banhkun/Image-Processing | 65c4e52e0857534c252aff5d449b2c5ee091eaf7 | [
"MIT"
] | 1 | 2022-02-25T04:25:21.000Z | 2022-02-25T04:25:21.000Z | """
Copyright (c) 2018. All rights reserved.
Created by Resnick Xing on 2018/5/11
"""
import keras,os
from keras.models import Model
from keras.layers.merge import add,multiply
from keras.layers import Lambda,Input, Conv2D,Conv2DTranspose,Conv2DTranspose, MaxPooling2D, UpSampling2D,Cropping2D, core, Dropout,normalizat... | 50.271845 | 168 | 0.690807 |
12f6f7b572108a4a133f1cc89d9d79d2e7e20340 | 28,456 | py | Python | python/paddle/fluid/tests/unittests/test_pad3d_op.py | douch/Paddle | 81c40722869935d6e897f4b1aeb6e6f67606188a | [
"Apache-2.0"
] | 1 | 2021-12-27T02:40:41.000Z | 2021-12-27T02:40:41.000Z | python/paddle/fluid/tests/unittests/test_pad3d_op.py | LiYuRio/Paddle | dbd6e2df9d074973b7ee177e2d6b96ed2318008e | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_pad3d_op.py | LiYuRio/Paddle | dbd6e2df9d074973b7ee177e2d6b96ed2318008e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 35.793711 | 80 | 0.510367 |
30b8485fa6bd7a177445633deb590dbcdc6223aa | 4,638 | py | Python | third_party/webrtc/src/chromium/src/tools/perf/benchmarks/tab_switching.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 8 | 2016-02-08T11:59:31.000Z | 2020-05-31T15:19:54.000Z | third_party/webrtc/src/chromium/src/tools/perf/benchmarks/tab_switching.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 1 | 2021-05-05T11:11:31.000Z | 2021-05-05T11:11:31.000Z | third_party/webrtc/src/chromium/src/tools/perf/benchmarks/tab_switching.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 7 | 2016-02-09T09:28:14.000Z | 2020-07-25T19:03:36.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from core import perf_benchmark
from measurements import tab_switching
import page_sets
from telemetry import benchmark
@benchmark.Enabled('has tabs')
@be... | 35.40458 | 79 | 0.772531 |
60f3f668c5298dc08dc63075645f8efa38be9d97 | 3,507 | py | Python | train.py | ypriverol/flower-recognition | 9e7ae145f68f5bb11a8133c5fb82610827586212 | [
"MIT"
] | 164 | 2017-07-16T05:53:34.000Z | 2021-11-21T12:33:30.000Z | train.py | ypriverol/flower-recognition | 9e7ae145f68f5bb11a8133c5fb82610827586212 | [
"MIT"
] | 19 | 2017-05-26T08:54:23.000Z | 2021-02-01T03:05:35.000Z | train.py | ypriverol/flower-recognition | 9e7ae145f68f5bb11a8133c5fb82610827586212 | [
"MIT"
] | 114 | 2017-05-29T03:06:24.000Z | 2022-03-22T20:00:59.000Z | # organize imports
from __future__ import print_function
from sklearn.metrics import classification_report
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import confusion_matrix
import numpy as np
import h5py
import os
import json
import pi... | 29.974359 | 86 | 0.693185 |
efafe630027793e5714c7d6523e10b4dde6408d8 | 1,662 | py | Python | modules/email_registry/email_adder.py | DenverCoder1/jct-discord-bot | e4b1df71d96a4127be27e40c9aa41dbb50c3379c | [
"MIT"
] | 10 | 2021-01-06T13:25:13.000Z | 2022-03-01T13:16:46.000Z | modules/email_registry/email_adder.py | DenverCoder1/jct-discord-bot | e4b1df71d96a4127be27e40c9aa41dbb50c3379c | [
"MIT"
] | 124 | 2021-01-06T13:29:55.000Z | 2022-03-25T14:18:59.000Z | modules/email_registry/email_adder.py | DenverCoder1/jct-discord-bot | e4b1df71d96a4127be27e40c9aa41dbb50c3379c | [
"MIT"
] | 3 | 2021-01-08T10:27:34.000Z | 2021-03-04T14:49:36.000Z | from discord.abc import Messageable
from database import sql
from ..error.friendly_error import FriendlyError
from database.person import Person
from asyncpg.exceptions import UniqueViolationError, CheckViolationError
async def add_email(person: Person, email: str, messageable: Messageable) -> Person:
"""Add an emai... | 30.777778 | 87 | 0.741877 |
9424ecee45a84647c576b2046da8b498268a8171 | 20,933 | py | Python | pythonapp/python/lib/python3.7/_sysconfigdata_m_linux_x86_64-linux-gnu.py | emteeoh/minimalappimage | 846b15424e62953756570d513de53ea0ec7bf67e | [
"MIT"
] | null | null | null | pythonapp/python/lib/python3.7/_sysconfigdata_m_linux_x86_64-linux-gnu.py | emteeoh/minimalappimage | 846b15424e62953756570d513de53ea0ec7bf67e | [
"MIT"
] | null | null | null | pythonapp/python/lib/python3.7/_sysconfigdata_m_linux_x86_64-linux-gnu.py | emteeoh/minimalappimage | 846b15424e62953756570d513de53ea0ec7bf67e | [
"MIT"
] | null | null | null | # system configuration generated and used by the sysconfig module
build_time_vars = {'ABIFLAGS': 'm',
'AC_APPLE_UNIVERSAL_BUILD': 0,
'AIX_GENUINE_CPLUSPLUS': 0,
'ANDROID_API_LEVEL': 0,
'AR': 'ar',
'ARFLAGS': 'rcs',
'BASECFLAGS': '-Wno-unused-result -Wsign-compare',
'BASECPPFLAGS': '',
'BASEMODLIBS': '',
'BINDI... | 29.650142 | 92 | 0.670234 |
6f34bbc7522e7906c082b10c9b015c11035b5049 | 5,598 | py | Python | model-optimizer/mo/utils/utils.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | null | null | null | model-optimizer/mo/utils/utils.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | 19 | 2021-03-26T08:11:00.000Z | 2022-02-21T13:06:26.000Z | model-optimizer/mo/utils/utils.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | 1 | 2021-07-28T17:30:46.000Z | 2021-07-28T17:30:46.000Z | """
Copyright (C) 2018-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 37.32 | 118 | 0.680064 |
a7c9aec6adfedb0aa5a4eaa041a294d29e9e7c89 | 344 | py | Python | zerver/lib/mention.py | Supermanu/zulip | 26f6d708c2e30cfe50d9d61031edb759e8117596 | [
"Apache-2.0"
] | null | null | null | zerver/lib/mention.py | Supermanu/zulip | 26f6d708c2e30cfe50d9d61031edb759e8117596 | [
"Apache-2.0"
] | 15 | 2020-06-05T18:44:15.000Z | 2022-03-11T23:26:03.000Z | zerver/lib/mention.py | Supermanu/zulip | 26f6d708c2e30cfe50d9d61031edb759e8117596 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from typing import Text
# Match multi-word string between @** ** or match any one-word
# sequences after @
find_mentions = r'(?<![^\s\'\"\(,:<])@(\*\*[^\*]+\*\*|\w+)'
wildcards = ['all', 'everyone']
def user_mention_matches_wildcard(mention):
# type: (Text) -> bool
retu... | 26.461538 | 62 | 0.651163 |
6413e2110a6fd41987c2da0998427048ad33c0e2 | 4,194 | py | Python | todo_flask/models/__init__.py | jean-zhou/vue-odo | 799476d8ca5b88c840c5b15c0f5bee94c5bf8a35 | [
"MIT"
] | null | null | null | todo_flask/models/__init__.py | jean-zhou/vue-odo | 799476d8ca5b88c840c5b15c0f5bee94c5bf8a35 | [
"MIT"
] | 1 | 2019-07-17T14:17:50.000Z | 2019-07-17T14:18:59.000Z | todo_flask/models/__init__.py | jean-zhou/vue-odo | 799476d8ca5b88c840c5b15c0f5bee94c5bf8a35 | [
"MIT"
] | 1 | 2020-02-14T11:52:38.000Z | 2020-02-14T11:52:38.000Z | import json
def save(data, path):
"""
data 是 dict 或者 list
path 是保存文件的路径
"""
s = json.dumps(data, indent=2, ensure_ascii=False)
with open(path, 'w+', encoding='utf-8') as f:
f.write(s)
def load(path):
with open(path, 'r', encoding='utf-8') as f:
s = f.read()
return... | 23.965714 | 80 | 0.46185 |
2a695def01ac77666e65995192993420087820c8 | 10,012 | py | Python | Module5/assignment4.py | jnduli/edx_anaconda_machine_learning | 5eb1d967c0bbff545baf86860a6bd4074840747f | [
"MIT"
] | null | null | null | Module5/assignment4.py | jnduli/edx_anaconda_machine_learning | 5eb1d967c0bbff545baf86860a6bd4074840747f | [
"MIT"
] | null | null | null | Module5/assignment4.py | jnduli/edx_anaconda_machine_learning | 5eb1d967c0bbff545baf86860a6bd4074840747f | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from sklearn import preprocessing
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
import matplotlib
#
# TODO: Parameters to play around with
PLOT_TYPE_TEXT = False # If you'd like to see indices
PLOT_VECTORS = True # If you'd like to see your origina... | 40.865306 | 116 | 0.718138 |
bc3fdd9305d02f615ef4a7e7baca45a157053225 | 2,560 | py | Python | tools/perf/page_sets/login_helpers/pinterest_login.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/perf/page_sets/login_helpers/pinterest_login.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/perf/page_sets/login_helpers/pinterest_login.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2021-01-05T23:43:46.000Z | 2021-01-07T23:36:34.000Z | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from page_sets.login_helpers import login_utils
from page_sets.helpers import override_online
def _LoginAccount(action_runner, credential, credentials_pat... | 39.384615 | 80 | 0.760547 |
90487ab2a47cf5c13b32fda6e6b7222c2871b86c | 462 | py | Python | geeup/utils.py | thipokKub/geeup | b7440685adedd41d7fff9b7c9ffcadf5a3819610 | [
"Apache-2.0"
] | null | null | null | geeup/utils.py | thipokKub/geeup | b7440685adedd41d7fff9b7c9ffcadf5a3819610 | [
"Apache-2.0"
] | null | null | null | geeup/utils.py | thipokKub/geeup | b7440685adedd41d7fff9b7c9ffcadf5a3819610 | [
"Apache-2.0"
] | null | null | null | import json
def get_credential(file_path):
"""
Read credential json file and return
username and password
"""
with open(file_path) as json_file:
config = json.load(json_file)
assert "username" in config.keys()
assert "password" in config.keys()
return config["username"]... | 23.1 | 49 | 0.634199 |
a29e144bcc21659fccc76f2cc32fa63d074b08df | 615 | py | Python | plot_segments.py | mzucker/lsystem_optimization | 74035f7a0bdc9f50da7cdb35c4a9d49f5ec9eeef | [
"MIT"
] | 8 | 2020-12-08T14:10:22.000Z | 2022-02-21T15:29:50.000Z | plot_segments.py | mzucker/lsystem_optimization | 74035f7a0bdc9f50da7cdb35c4a9d49f5ec9eeef | [
"MIT"
] | null | null | null | plot_segments.py | mzucker/lsystem_optimization | 74035f7a0bdc9f50da7cdb35c4a9d49f5ec9eeef | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
def plot_segments(segments, image_filename='segment_plot.png'):
assert len(segments.shape) == 3 and segments.shape[1:] == (2, 2)
lc = LineCollection(segments, color='b')
ax = plt.a... | 19.83871 | 68 | 0.678049 |
4307f3f935b21332b4f6084b6470b1ba393b9cb8 | 9,764 | py | Python | tests/unit/api/resources/users.py | tessia-project/tessia | b9ded8dc7f0b9a7a0ea00d95b5ccc4af4d2e7540 | [
"Apache-2.0"
] | 5 | 2020-06-04T10:20:33.000Z | 2020-10-26T15:09:19.000Z | tests/unit/api/resources/users.py | tessia-project/tessia | b9ded8dc7f0b9a7a0ea00d95b5ccc4af4d2e7540 | [
"Apache-2.0"
] | null | null | null | tests/unit/api/resources/users.py | tessia-project/tessia | b9ded8dc7f0b9a7a0ea00d95b5ccc4af4d2e7540 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016, 2017 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 32.331126 | 79 | 0.596374 |
7351e208aef4bc71852fc621ae20cf20d359265d | 253 | py | Python | scripts/item/consume_2435382.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/item/consume_2435382.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/item/consume_2435382.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 42 | 2019-04-16T23:31:40.000Z | 2022-02-01T17:57:44.000Z | # Created by MechAviv
# Secret Question Mark Damage Skin Coupon | (2435382)
if sm.addDamageSkin(2435382):
sm.chat("'Secret Question Mark Damage Skin Coupon' Damage Skin has been added to your account's damage skin collection.")
sm.consumeItem() | 50.6 | 126 | 0.754941 |
40c887fddc36e725e4ccacbb261c9b606c9d9ec1 | 114,250 | py | Python | ext/v8/upstream/scons/engine/SCons/Node/FS.py | bsingr/therubyracer | 2397cae80aa8f458c028e28bdf2bd8a93e6161a6 | [
"MIT",
"Unlicense"
] | 1 | 2015-11-05T01:29:05.000Z | 2015-11-05T01:29:05.000Z | ext/v8/upstream/scons/engine/SCons/Node/FS.py | bsingr/therubyracer | 2397cae80aa8f458c028e28bdf2bd8a93e6161a6 | [
"MIT",
"Unlicense"
] | null | null | null | ext/v8/upstream/scons/engine/SCons/Node/FS.py | bsingr/therubyracer | 2397cae80aa8f458c028e28bdf2bd8a93e6161a6 | [
"MIT",
"Unlicense"
] | null | null | null | """scons.Node.FS
File system nodes.
These Nodes represent the canonical external objects that people think
of when they think of building software: files and directories.
This holds a "default_fs" variable that should be initialized with an FS
that can be used by scripts or modules looking for the canonical default.... | 35.470351 | 120 | 0.586705 |
9142de2d718f4e72c9eddec4a9dba41dc4ca681c | 1,003 | py | Python | setup.py | navkiran/TOPSIS-project-navkiran | 0cb77b5ef797f1870a7d6a69facac082f13e6505 | [
"MIT"
] | null | null | null | setup.py | navkiran/TOPSIS-project-navkiran | 0cb77b5ef797f1870a7d6a69facac082f13e6505 | [
"MIT"
] | null | null | null | setup.py | navkiran/TOPSIS-project-navkiran | 0cb77b5ef797f1870a7d6a69facac082f13e6505 | [
"MIT"
] | 1 | 2020-03-14T17:12:37.000Z | 2020-03-14T17:12:37.000Z | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="topsis_navkiran",
version="1.1.4",
author="Navkiran Singh",
author_email="nsingh2_be17@thapar.edu",
description="TOPSIS implementation in python for multi-criteria decision making",
l... | 31.34375 | 85 | 0.644068 |
35379ea8b3fecc27e023639decdd64aecf6c4461 | 15,797 | py | Python | python/ray/tune/trial_executor.py | gilfree/ray | a8d7897a56d8dc2d2af550adee8cd5399c39dfb9 | [
"Apache-2.0"
] | null | null | null | python/ray/tune/trial_executor.py | gilfree/ray | a8d7897a56d8dc2d2af550adee8cd5399c39dfb9 | [
"Apache-2.0"
] | 39 | 2021-09-22T11:30:57.000Z | 2022-03-26T07:08:18.000Z | python/ray/tune/trial_executor.py | mvindiola1/ray | cedd8806f779b41e54ab7fd9ba2e8d3b9077ab9f | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from abc import abstractmethod
from functools import lru_cache
import logging
import os
import time
from typing import Dict, List, Optional
import warnings
import ray
from ray.tune.resources import Resources
from ray.util.annotations import DeveloperAPI
from ray.tune.trial import Trial, Checkpoint
from... | 37.257075 | 80 | 0.624739 |
b3d8b49e831c939320a32add6147bea21b19645a | 188 | py | Python | quiver_engine/layer_result_generators.py | NagiSenbon/Quiver-tf.keras | 3ada574966402b8a0088921a9db46c4c0aa92340 | [
"MIT"
] | null | null | null | quiver_engine/layer_result_generators.py | NagiSenbon/Quiver-tf.keras | 3ada574966402b8a0088921a9db46c4c0aa92340 | [
"MIT"
] | null | null | null | quiver_engine/layer_result_generators.py | NagiSenbon/Quiver-tf.keras | 3ada574966402b8a0088921a9db46c4c0aa92340 | [
"MIT"
] | null | null | null | from tensorflow.keras.models import Model
def get_outputs_generator(model, layer_name):
return Model(
inputs=model.input, outputs=model.get_layer(layer_name).output).predict
| 26.857143 | 79 | 0.776596 |
221dc1aef3853434070f197e810a2a23f728b7e0 | 830 | py | Python | 01/80.py | c344081/learning_algorithm | cb929040390015a8309588b2e9fc0cf5d9b86726 | [
"MIT"
] | null | null | null | 01/80.py | c344081/learning_algorithm | cb929040390015a8309588b2e9fc0cf5d9b86726 | [
"MIT"
] | null | null | null | 01/80.py | c344081/learning_algorithm | cb929040390015a8309588b2e9fc0cf5d9b86726 | [
"MIT"
] | null | null | null | '''
Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates":
What if duplicates are allowed at most twice?
For example,
Given sorted array nums = [1,1,1,2,2,3],
Your function should return length = 5,
with the first five elements of nums being 1, 1, 2, 2 and 3.
It doesn't matter what you leave beyo... | 24.411765 | 61 | 0.561446 |
cdb9340aa1d15229545b297711c2b8c973d06f4a | 2,265 | py | Python | app/test/test_GlobalParamaters.py | bskiefer/kong_ldap_login_endpoint | 285055fb9696509c4db0335679214f18b976be65 | [
"MIT"
] | null | null | null | app/test/test_GlobalParamaters.py | bskiefer/kong_ldap_login_endpoint | 285055fb9696509c4db0335679214f18b976be65 | [
"MIT"
] | null | null | null | app/test/test_GlobalParamaters.py | bskiefer/kong_ldap_login_endpoint | 285055fb9696509c4db0335679214f18b976be65 | [
"MIT"
] | null | null | null | from TestHelperSuperClass import testHelperSuperClass
from GlobalParamaters import GlobalParamatersClass, getInvalidEnvVarParamaterException
class testHelperSuperClass(testHelperSuperClass):
def test_badParams(self):
env = {
'APIAPP_MODE': 'DEVELOPER',
'APIAPP_VERSION': 'TEST-1.2.3',
'APIAPP_FR... | 40.446429 | 101 | 0.699779 |
e0bc8eb9a5400d831bf125290fdf53195a1131bc | 1,418 | py | Python | PassGenV2.1.py | Yasome/PassGen | 3ed042dafa28c1274686053a6c99b1727081338e | [
"MIT"
] | null | null | null | PassGenV2.1.py | Yasome/PassGen | 3ed042dafa28c1274686053a6c99b1727081338e | [
"MIT"
] | null | null | null | PassGenV2.1.py | Yasome/PassGen | 3ed042dafa28c1274686053a6c99b1727081338e | [
"MIT"
] | null | null | null | import random, os
r = random
def Occur(type, len):
temp = len // type
if not temp: return 1
return temp
def PassGen(Len, Ultra=True):
# الحروف المستعملة - Used characters
CharBank = ['abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '*!@#$%^&|+?', '123456789']
Password = ''
#... | 27.803922 | 103 | 0.564175 |
8ee880b1624955087d548e85f8ea731b2ada2488 | 10,061 | py | Python | tests/adspygoogle/dfp/dfp_utils_test.py | cherry-wb/googleads-python-lib | 24a1ecb7c1cca5af3624a3b03ebaa7f5147b4a04 | [
"Apache-2.0"
] | null | null | null | tests/adspygoogle/dfp/dfp_utils_test.py | cherry-wb/googleads-python-lib | 24a1ecb7c1cca5af3624a3b03ebaa7f5147b4a04 | [
"Apache-2.0"
] | null | null | null | tests/adspygoogle/dfp/dfp_utils_test.py | cherry-wb/googleads-python-lib | 24a1ecb7c1cca5af3624a3b03ebaa7f5147b4a04 | [
"Apache-2.0"
] | 2 | 2020-04-02T19:00:31.000Z | 2020-08-06T03:28:38.000Z | #!/usr/bin/python
#
# Copyright 2013 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 b... | 40.732794 | 80 | 0.511182 |
697f03fc6768d5f25aec29d3a2ec510e435c2a77 | 2,566 | py | Python | main_multi.py | LMikeH/ocbnn-lmikh | 23f6a3c4c668bbffda82aabdd7139eb761091c48 | [
"MIT"
] | null | null | null | main_multi.py | LMikeH/ocbnn-lmikh | 23f6a3c4c668bbffda82aabdd7139eb761091c48 | [
"MIT"
] | null | null | null | main_multi.py | LMikeH/ocbnn-lmikh | 23f6a3c4c668bbffda82aabdd7139eb761091c48 | [
"MIT"
] | null | null | null |
"""
A high-dimensional example on the "Energy Efficiency" UCI dataset: https://archive.ics.uci.edu/ml/datasets/Energy+efficiency.
This is a regression test with (standardized) 8-dimensional input and 1-dimensional output.
We use positive constraints:
- For points where dimension X_3 is in the range [-2.0, -1.0], th... | 34.675676 | 205 | 0.713172 |
86c2d9aa33af0c61dfc41800d1b4bb2ea727364d | 540 | py | Python | python_dongsite/manage.py | zld126126/MyPython | 960a75d6e3d5049ab0cba6f4c682845cdb96c341 | [
"Apache-2.0"
] | null | null | null | python_dongsite/manage.py | zld126126/MyPython | 960a75d6e3d5049ab0cba6f4c682845cdb96c341 | [
"Apache-2.0"
] | null | null | null | python_dongsite/manage.py | zld126126/MyPython | 960a75d6e3d5049ab0cba6f4c682845cdb96c341 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dongsite.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are... | 33.75 | 73 | 0.687037 |
e6cc6a9fa8dbc84fa69af5953eee4b55a1f33db5 | 2,687 | py | Python | src/dev/serial/Terminal.py | charitha22/gem5 | d7e2fb6744edbd26ce678058463fcd2a00a23b51 | [
"BSD-3-Clause"
] | 135 | 2016-10-21T03:31:49.000Z | 2022-03-25T01:22:20.000Z | src/dev/serial/Terminal.py | charitha22/gem5 | d7e2fb6744edbd26ce678058463fcd2a00a23b51 | [
"BSD-3-Clause"
] | 35 | 2017-03-10T17:57:46.000Z | 2022-02-18T17:34:16.000Z | src/dev/serial/Terminal.py | charitha22/gem5 | d7e2fb6744edbd26ce678058463fcd2a00a23b51 | [
"BSD-3-Clause"
] | 48 | 2016-12-08T12:03:13.000Z | 2022-02-16T09:16:13.000Z | # Copyright (c) 2019 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | 47.982143 | 74 | 0.778936 |
82c8f9c159531b276a18b43817c008985c23aadb | 11,378 | py | Python | fixit/common/unused_suppressions.py | Instagram/Fix | a41b6090853c0517813c0fc5c619ad405138a4d5 | [
"Apache-2.0"
] | null | null | null | fixit/common/unused_suppressions.py | Instagram/Fix | a41b6090853c0517813c0fc5c619ad405138a4d5 | [
"Apache-2.0"
] | 1 | 2021-08-20T19:03:15.000Z | 2021-08-20T19:03:15.000Z | fixit/common/unused_suppressions.py | Instagram/Fix | a41b6090853c0517813c0fc5c619ad405138a4d5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Collection, List, Sequence, cast
import libcst as cst
from libcst.metadata import ParentNodeProvider, PositionProvider
fr... | 40.204947 | 164 | 0.654157 |
1aa35100ae8d8c701d3eef7a5b8f99600ccdccd6 | 981 | py | Python | tests/test_my_first_project.py | UADDW/my_first_project | ef16db811e5dcd95eeba633ca45edba1798d317c | [
"MIT"
] | null | null | null | tests/test_my_first_project.py | UADDW/my_first_project | ef16db811e5dcd95eeba633ca45edba1798d317c | [
"MIT"
] | null | null | null | tests/test_my_first_project.py | UADDW/my_first_project | ef16db811e5dcd95eeba633ca45edba1798d317c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Tests for my_first_project package."""
import my_first_project
def test_hello_noargs():
"""Test for my_first_project.hello()."""
s = my_first_project.hello()
assert s=="Hello world"
def test_hello_me():
"""Test for my_first_project.hello('me')."""
s = my_first_projec... | 29.727273 | 80 | 0.58002 |
22e55fdef29f1a03f719f83a4cba4c8fc7afb24a | 2,316 | py | Python | tomon_sdk/events.py | tomon-world/tomon-sdk-py | d38e109800867a50d4f23f127cb75e0923c24f72 | [
"MIT"
] | 6 | 2020-08-16T08:58:50.000Z | 2020-08-27T06:21:39.000Z | tomon_sdk/events.py | tomon-world/tomon-sdk-py | d38e109800867a50d4f23f127cb75e0923c24f72 | [
"MIT"
] | null | null | null | tomon_sdk/events.py | tomon-world/tomon-sdk-py | d38e109800867a50d4f23f127cb75e0923c24f72 | [
"MIT"
] | null | null | null | # deprecate
# class EventType:
# NETWORK_CONNECTED = 1
# NETWORK_DISCONNECTED = 2
# NETWORK_RECONNECTING = 3
#
# READY = 4
# HELLO = 5
# DISPATCH = 6
# HEARTBEAT = 7
# HEARTBEAT_ACK = 8
#
# GUILD_CREATE = 9
# GUILD_DELETE = 10
# GUILD_UPDATE = 11
# GUILD_POSITION = 12
#
#... | 24.638298 | 55 | 0.687824 |
79eb73c63cb2ddb8271f2d514db3c696fb10387e | 4,968 | py | Python | PythonAPI/lgsvl/sensor.py | MaheshM99/PolyVerif | 7894bdd46796b059dc856e6058935eb294ed299a | [
"Apache-2.0"
] | 1 | 2022-03-07T05:56:21.000Z | 2022-03-07T05:56:21.000Z | PythonAPI/lgsvl/sensor.py | MaheshM99/PolyVerif | 7894bdd46796b059dc856e6058935eb294ed299a | [
"Apache-2.0"
] | null | null | null | PythonAPI/lgsvl/sensor.py | MaheshM99/PolyVerif | 7894bdd46796b059dc856e6058935eb294ed299a | [
"Apache-2.0"
] | 1 | 2021-12-31T09:35:59.000Z | 2021-12-31T09:35:59.000Z | #
# Copyright (c) 2019-2020 LG Electronics, Inc.
#
# This software contains code licensed as described in LICENSE.
#
from .geometry import Transform
from .utils import accepts
from collections import namedtuple
GpsData = namedtuple("GpsData", "latitude longitude northing easting altitude orientation")
... | 31.643312 | 116 | 0.567633 |
144f275ef7ac6836db0b08c5f01df03df7934c0e | 178 | py | Python | glitchtip/templatetags/settings.py | rh-cssre/glitchtip-backend | ae12fbd54532cff5fd3d7a72631ba18625bbf1de | [
"MIT"
] | null | null | null | glitchtip/templatetags/settings.py | rh-cssre/glitchtip-backend | ae12fbd54532cff5fd3d7a72631ba18625bbf1de | [
"MIT"
] | null | null | null | glitchtip/templatetags/settings.py | rh-cssre/glitchtip-backend | ae12fbd54532cff5fd3d7a72631ba18625bbf1de | [
"MIT"
] | null | null | null | from django import template
from django.conf import settings
register = template.Library()
@register.simple_tag()
def get_domain():
return settings.GLITCHTIP_URL.geturl()
| 17.8 | 42 | 0.780899 |
645b6b0bbb4b6c6ce3294fd47c3e63843b0bf6f1 | 21,815 | py | Python | tests/snuba/api/endpoints/test_discover_query.py | pombredanne/django-sentry | 4ad09417fb3cfa3aa4a0d4175ae49fe02837c567 | [
"BSD-3-Clause"
] | null | null | null | tests/snuba/api/endpoints/test_discover_query.py | pombredanne/django-sentry | 4ad09417fb3cfa3aa4a0d4175ae49fe02837c567 | [
"BSD-3-Clause"
] | null | null | null | tests/snuba/api/endpoints/test_discover_query.py | pombredanne/django-sentry | 4ad09417fb3cfa3aa4a0d4175ae49fe02837c567 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import pytest
from datetime import datetime, timedelta
from django.core.urlresolvers import reverse
from sentry.testutils import APITestCase, SnubaTestCase
from sentry.testutils.helpers.datetime import before_now, iso_format
class DiscoverQueryTest(APITestCase, SnubaTestCase)... | 40.249077 | 100 | 0.460876 |
b485fcf1c4ec0c8316e0500373b6af8b802bc2f7 | 2,355 | py | Python | fairseq/fairseq/modules/adaptive_input.py | skeshaw/LoReNMT | 32ffd83f38258dfffd324f811695a44ad33954f5 | [
"Apache-2.0"
] | null | null | null | fairseq/fairseq/modules/adaptive_input.py | skeshaw/LoReNMT | 32ffd83f38258dfffd324f811695a44ad33954f5 | [
"Apache-2.0"
] | null | null | null | fairseq/fairseq/modules/adaptive_input.py | skeshaw/LoReNMT | 32ffd83f38258dfffd324f811695a44ad33954f5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from torch import nn
from typing import List
class AdaptiveInput(nn.Module):
def __init__(
self,
... | 32.260274 | 81 | 0.550318 |
5e3f00b8cb9f653493b9b0fcb4471854c5e0ed44 | 2,157 | py | Python | real_estate_api/customer/urls.py | rossi1/RES | 729196bfa45cc2b47acc93c49c07c7e8f0f6ea93 | [
"MIT"
] | null | null | null | real_estate_api/customer/urls.py | rossi1/RES | 729196bfa45cc2b47acc93c49c07c7e8f0f6ea93 | [
"MIT"
] | null | null | null | real_estate_api/customer/urls.py | rossi1/RES | 729196bfa45cc2b47acc93c49c07c7e8f0f6ea93 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('update-notification/', views.NotificationAPIView.as_view(), name='notify'),
path('view-properties/', views.ViewAllProperty.as_view(), name='view_property'),
path('view-land/', views.ViewAllLand.as_view(), name='view_land'),
path('v... | 58.297297 | 104 | 0.715345 |
8ff159df7ead04600796e4b14a8e4489741ca321 | 2,063 | py | Python | train_model_v1.py | Shikhar-S/Kaggle-Speech-Recognition | 04be4a39b02a2ccac397627e7d4a7166336a562f | [
"MIT"
] | null | null | null | train_model_v1.py | Shikhar-S/Kaggle-Speech-Recognition | 04be4a39b02a2ccac397627e7d4a7166336a562f | [
"MIT"
] | null | null | null | train_model_v1.py | Shikhar-S/Kaggle-Speech-Recognition | 04be4a39b02a2ccac397627e7d4a7166336a562f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Shikhar
"""
import pickle
from random import shuffle
from keras.callbacks import ModelCheckpoint, EarlyStopping
import numpy as np
from keras.layers import Input, Dense, LSTM
from keras.models import Model
SAVED_PATH='./Processed'
num_pickles=30
data=[]
target=[]
TIMESTEP=100 #num... | 27.878378 | 133 | 0.742123 |
1165304d815f5ebe8c81a729f66d61e8e7f32ce6 | 2,211 | py | Python | lws_backend/api/routes/guides.py | AlexKLWS/lws_backend | a886073b1b0f6ab80d848fb4b6e8465de9d88317 | [
"Unlicense"
] | null | null | null | lws_backend/api/routes/guides.py | AlexKLWS/lws_backend | a886073b1b0f6ab80d848fb4b6e8465de9d88317 | [
"Unlicense"
] | null | null | null | lws_backend/api/routes/guides.py | AlexKLWS/lws_backend | a886073b1b0f6ab80d848fb4b6e8465de9d88317 | [
"Unlicense"
] | null | null | null | from fastapi import APIRouter, Depends, HTTPException, status
import uuid
from lws_backend.database import Session, get_managed_session
from lws_backend.pydantic_models.guide import Guide
from lws_backend.crud.guides import get_guide_by_id, upsert_guide
from lws_backend.pydantic_models.category import Category
from lw... | 36.245902 | 117 | 0.72863 |
67123bb3de4c450fb4c396ff9f785fafc96035a0 | 736 | py | Python | tests/test_iterators.py | aiboxlab/TSPNet | 359402151afd262857cde6fae3fc13445d73c9a7 | [
"MIT"
] | 83 | 2020-10-11T04:44:52.000Z | 2022-01-11T13:59:50.000Z | tests/test_iterators.py | aiboxlab/TSPNet | 359402151afd262857cde6fae3fc13445d73c9a7 | [
"MIT"
] | 9 | 2020-12-12T10:12:00.000Z | 2021-03-28T16:05:08.000Z | tests/test_iterators.py | aiboxlab/TSPNet | 359402151afd262857cde6fae3fc13445d73c9a7 | [
"MIT"
] | 11 | 2020-12-17T13:38:56.000Z | 2022-03-12T23:39:41.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from fairseq.data import iterators
class TestIterators(unittest.TestCase):
def test_counting_iterator(self... | 26.285714 | 66 | 0.639946 |
9de2e8f66c39968fb1ba459d32d690d3d05cacfd | 14,105 | py | Python | gslib/utils/boto_util.py | djnicolson/gsutil | 0e629ab55032b799ec728c05a71faf72cd49ff48 | [
"Apache-2.0"
] | null | null | null | gslib/utils/boto_util.py | djnicolson/gsutil | 0e629ab55032b799ec728c05a71faf72cd49ff48 | [
"Apache-2.0"
] | null | null | null | gslib/utils/boto_util.py | djnicolson/gsutil | 0e629ab55032b799ec728c05a71faf72cd49ff48 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 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 require... | 38.121622 | 80 | 0.730663 |
46e7643ff095b1c42037d4ba2e1fb684f128502f | 482 | py | Python | 4_Tran_Thi_Nhu_Huong_LOCAL/bai3.2.py | lpython2006e/exercies | 84343eae57d86708a7984aa02f77183a4688a508 | [
"MIT"
] | null | null | null | 4_Tran_Thi_Nhu_Huong_LOCAL/bai3.2.py | lpython2006e/exercies | 84343eae57d86708a7984aa02f77183a4688a508 | [
"MIT"
] | null | null | null | 4_Tran_Thi_Nhu_Huong_LOCAL/bai3.2.py | lpython2006e/exercies | 84343eae57d86708a7984aa02f77183a4688a508 | [
"MIT"
] | 8 | 2020-07-10T14:13:54.000Z | 2020-08-03T08:17:50.000Z | """Write a program that read content of a file (path) then show to screen, if the file doesn’t exist, announce user"""
def _check_existence(a):
try:
f = open(filename, "r")
except:
return False
return True
filename = input("Please input filename")
check = _check_existence(filename)
if ch... | 20.956522 | 118 | 0.645228 |
7b6db49979a943b36a055d365acd215ddca60f6b | 5,308 | py | Python | indico/modules/events/timetable/controllers/display.py | javfg/indico | 2634756ba1e9caf6dd8fc9afc3f47291fda5816d | [
"MIT"
] | 1 | 2021-12-27T17:51:27.000Z | 2021-12-27T17:51:27.000Z | indico/modules/events/timetable/controllers/display.py | javfg/indico | 2634756ba1e9caf6dd8fc9afc3f47291fda5816d | [
"MIT"
] | null | null | null | indico/modules/events/timetable/controllers/display.py | javfg/indico | 2634756ba1e9caf6dd8fc9afc3f47291fda5816d | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from io import BytesIO
from flask import jsonify, request, session
from werkzeug.exceptions import Forbid... | 49.607477 | 120 | 0.696873 |
8a3a7f2026e5ddb21d1381c248da48c0471b7c29 | 1,093 | py | Python | virtool/caches/migrate.py | ReeceHoffmann/virtool | f9befad060fe16fa29fb80124e674ac5a9c4f538 | [
"MIT"
] | 39 | 2016-10-31T23:28:59.000Z | 2022-01-15T00:00:42.000Z | virtool/caches/migrate.py | ReeceHoffmann/virtool | f9befad060fe16fa29fb80124e674ac5a9c4f538 | [
"MIT"
] | 1,690 | 2017-02-07T23:39:48.000Z | 2022-03-31T22:30:44.000Z | virtool/caches/migrate.py | ReeceHoffmann/virtool | f9befad060fe16fa29fb80124e674ac5a9c4f538 | [
"MIT"
] | 25 | 2017-02-08T18:25:31.000Z | 2021-09-20T22:55:25.000Z | """
Operation that should be performed on caches when the application starts.
"""
import os
from virtool.types import App
async def migrate_caches(app: App):
"""
Apply automatic updates to cache documents on application start.
:param app: the application object
"""
await add_missing_field(app... | 20.622642 | 93 | 0.637694 |
19ba1407443dc80e6f5de32d3f83ccc96ed26cca | 475 | py | Python | msnlp/utils/__init__.py | open-maip/ms-nlp-sdk | 683c35eaa727c916939662b40970532a61bf0c56 | [
"MIT"
] | 7 | 2020-09-09T03:36:00.000Z | 2021-07-27T08:00:14.000Z | msnlp/utils/__init__.py | open-maip/ms-nlp-sdk | 683c35eaa727c916939662b40970532a61bf0c56 | [
"MIT"
] | null | null | null | msnlp/utils/__init__.py | open-maip/ms-nlp-sdk | 683c35eaa727c916939662b40970532a61bf0c56 | [
"MIT"
] | 2 | 2020-09-09T10:59:42.000Z | 2021-06-24T07:25:24.000Z | from .predict_processing import ClassificationPredictprocess
from .predict_processing import TokenPredictprocess
from msnlp.config import TaskName
# Supported data processors
PREDICT_PROCESSOR = {
TaskName.text_classification: ClassificationPredictprocess,
TaskName.ner: TokenPredictprocess,
TaskName.simila... | 39.583333 | 63 | 0.848421 |
d735d9cffc2d48f31875f2ec3532c16e6d181eda | 10,050 | py | Python | python_by_contract_corpus/incorrect_from_recorded/ethz_eprog_2019/exercise_05/problem_03/binary_search_wrong_2.py | mristin/python-by-contract-corpus | c96ed00389c3811d7d63560ac665d410a7ee8493 | [
"MIT"
] | 8 | 2021-05-07T17:37:37.000Z | 2022-02-26T15:08:42.000Z | python_by_contract_corpus/incorrect_from_recorded/ethz_eprog_2019/exercise_05/problem_03/binary_search_wrong_2.py | mristin/python-by-contract-corpus | c96ed00389c3811d7d63560ac665d410a7ee8493 | [
"MIT"
] | 22 | 2021-04-28T21:55:48.000Z | 2022-03-04T07:41:37.000Z | python_by_contract_corpus/incorrect_from_recorded/ethz_eprog_2019/exercise_05/problem_03/binary_search_wrong_2.py | mristin/aocdbc | c96ed00389c3811d7d63560ac665d410a7ee8493 | [
"MIT"
] | 3 | 2021-03-26T22:29:12.000Z | 2021-04-11T20:45:45.000Z | """
Analyze the height data of a population.
The data is available at: http://jse.amstat.org/v11n2/datasets.heinz.html.
Given a series of measurements in centimeters, compute:
* The minimum, the maximum and average height of the population,
* A histogram of the heights given the number of bins
"""
import math
import ... | 30.828221 | 86 | 0.618806 |
0ec82743e8b951889d340d8ff636aa318a47ac7c | 10,596 | py | Python | Simulate.py | benhoff/pydial | 348f99eef12963ed0ed288a27c8c7a9296f12e36 | [
"Apache-2.0"
] | 3 | 2019-04-28T03:53:33.000Z | 2020-01-20T14:38:40.000Z | Simulate.py | lgessler/pydial | 482aacd16870b84bcad70aa59aa67098b42efff5 | [
"Apache-2.0"
] | null | null | null | Simulate.py | lgessler/pydial | 482aacd16870b84bcad70aa59aa67098b42efff5 | [
"Apache-2.0"
] | 1 | 2021-12-20T08:08:32.000Z | 2021-12-20T08:08:32.000Z | ###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################################
#
# Copyright 2015 - 2018
# Cambridge University Engineering Department Dialogue Systems Grou... | 42.725806 | 134 | 0.575972 |
9eb617d5c7c5d9113e9f3200b47bb94ed7b9e94c | 377 | py | Python | django_crud_example/users/urls.py | black-redoc/django_crud_example | 143ef8edfd5346087d1c577491460507c87e8e22 | [
"MIT"
] | null | null | null | django_crud_example/users/urls.py | black-redoc/django_crud_example | 143ef8edfd5346087d1c577491460507c87e8e22 | [
"MIT"
] | null | null | null | django_crud_example/users/urls.py | black-redoc/django_crud_example | 143ef8edfd5346087d1c577491460507c87e8e22 | [
"MIT"
] | null | null | null | from django.urls import path
from django_crud_example.users.views import (
user_detail_view,
user_redirect_view,
user_update_view,
)
app_name = "users"
urlpatterns = [
path("~redirect/", view=user_redirect_view, name="redirect"),
path("~update/", view=user_update_view, name="update"),
path("<s... | 25.133333 | 66 | 0.710875 |
b01e4f20061ad9340336f1defe2b5183fa10a3e5 | 22,441 | py | Python | src/asp/IceBridge/blend_dems.py | fenglang12345/asp20 | 565894567b58ecb72385e7bb698e318a734bed5a | [
"Apache-2.0"
] | null | null | null | src/asp/IceBridge/blend_dems.py | fenglang12345/asp20 | 565894567b58ecb72385e7bb698e318a734bed5a | [
"Apache-2.0"
] | null | null | null | src/asp/IceBridge/blend_dems.py | fenglang12345/asp20 | 565894567b58ecb72385e7bb698e318a734bed5a | [
"Apache-2.0"
] | 1 | 2020-02-04T14:34:23.000Z | 2020-02-04T14:34:23.000Z | #!/usr/bin/env python
# __BEGIN_LICENSE__
# Copyright (c) 2009-2013, United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The NGT platform is licensed under the Apache License, Version 2.0 (the
# "License"); you may not use ... | 44.614314 | 118 | 0.593913 |
e267502bcacf223d8b1f1b90196e01ed3f23dc9a | 1,026 | py | Python | tests/test_violinplot.py | basavyr/python-classes | a43ff5bd865bb6c71ea4e417e60506e2e6081d8f | [
"MIT"
] | null | null | null | tests/test_violinplot.py | basavyr/python-classes | a43ff5bd865bb6c71ea4e417e60506e2e6081d8f | [
"MIT"
] | null | null | null | tests/test_violinplot.py | basavyr/python-classes | a43ff5bd865bb6c71ea4e417e60506e2e6081d8f | [
"MIT"
] | null | null | null | from datetime import datetime
import sys
import platform as os
sys.path.append('../src/')
sys.path.append('src/')
import data_batch
import violinplot
import logger
path = '../out/violins/'
log_path = '../out/logs/'
filename = path+'violin-'+str(int(datetime.utcnow().timestamp()))+'-'+str(os.system())
log_filename = l... | 34.2 | 212 | 0.735867 |
b4c5240639b767454bb385d31d8c5a2f6a891f24 | 149,370 | py | Python | tests/tensor/test_basic.py | dfm/aesara | 7c32fc48cc971889242c8a124ea577d8618f0ef2 | [
"BSD-3-Clause"
] | 1 | 2021-11-09T10:19:46.000Z | 2021-11-09T10:19:46.000Z | tests/tensor/test_basic.py | Carlosbogo/aesara | 17594a05d4dee2574f07771b8f176e7dd60d134a | [
"BSD-3-Clause"
] | null | null | null | tests/tensor/test_basic.py | Carlosbogo/aesara | 17594a05d4dee2574f07771b8f176e7dd60d134a | [
"BSD-3-Clause"
] | null | null | null | import itertools
import warnings
from copy import copy, deepcopy
from functools import partial
from tempfile import mkstemp
import numpy as np
import pytest
from numpy.testing import assert_array_equal
import aesara
import aesara.scalar as aes
import aesara.tensor.basic as aet
import aesara.tensor.math as tm
from aes... | 35.022274 | 282 | 0.557776 |
19356a7d59ca94309fe9a915cfedcdfa9b7bb933 | 2,544 | py | Python | docs/gallery/gpts_with_missing_vals.py | ecmwf/metview-docs | cfde15232834c2d2a8393e7e6ba67ba95acd51e0 | [
"Apache-2.0"
] | 2 | 2021-07-19T09:02:33.000Z | 2021-09-01T14:29:50.000Z | docs/gallery/gpts_with_missing_vals.py | ecmwf/metview-docs | cfde15232834c2d2a8393e7e6ba67ba95acd51e0 | [
"Apache-2.0"
] | 1 | 2021-10-14T11:53:08.000Z | 2021-12-01T10:07:34.000Z | docs/gallery/gpts_with_missing_vals.py | ecmwf/metview-docs | cfde15232834c2d2a8393e7e6ba67ba95acd51e0 | [
"Apache-2.0"
] | null | null | null | """
Geopoints - Missing Values in Geopoints
"""
# (C) Copyright 2017- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted ... | 28.909091 | 78 | 0.740173 |
e5ab6204cfe8546c45ef1407accdc4dfd3936217 | 551 | bzl | Python | build_defs/internal_do_not_use/j2cl_test.bzl | VishrutMehta/j2cl | 79e21aeaa5529aee2b6490fdc1b7cfa5575db283 | [
"Apache-2.0"
] | 3 | 2019-10-21T19:35:33.000Z | 2021-10-12T10:18:53.000Z | build_defs/internal_do_not_use/j2cl_test.bzl | VishrutMehta/j2cl | 79e21aeaa5529aee2b6490fdc1b7cfa5575db283 | [
"Apache-2.0"
] | 4 | 2019-09-30T14:43:31.000Z | 2021-02-05T02:10:12.000Z | build_defs/internal_do_not_use/j2cl_test.bzl | VishrutMehta/j2cl | 79e21aeaa5529aee2b6490fdc1b7cfa5575db283 | [
"Apache-2.0"
] | 6 | 2019-09-13T14:15:54.000Z | 2020-04-22T23:23:09.000Z | """j2cl_test build macro"""
def j2cl_test(name, **kwargs):
"""Macro for running a JUnit test cross compiled as a web test"""
# No-op until unit testing support implemented for open-source.
native.genrule(
name = name,
deprecation = "\nCAUTION: This is a placeholder. " +
... | 34.4375 | 81 | 0.558984 |
6e22b803fdb17f3373986dddd3f43dd478a3d261 | 49,598 | py | Python | open-nti/open-nti-dev.py | zhanghaofeng/open-nti | 8064828d698a9664c04205fe007beedc8e1e8575 | [
"Apache-2.0"
] | null | null | null | open-nti/open-nti-dev.py | zhanghaofeng/open-nti | 8064828d698a9664c04205fe007beedc8e1e8575 | [
"Apache-2.0"
] | null | null | null | open-nti/open-nti-dev.py | zhanghaofeng/open-nti | 8064828d698a9664c04205fe007beedc8e1e8575 | [
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python
# coding: utf-8
# Authors: efrain@juniper.net psagrera@juniper.net
# Version 2.0 20160124
from datetime import datetime # In order to retreive time and timespan
from datetime import timedelta # In order to retreive time and timespan
from influxdb import InfluxDBClient
from pyez_mock import mock... | 53.102784 | 240 | 0.546897 |
d92a1b50593d4b7076262018ddcbe876f00c6d35 | 3,912 | py | Python | sfa/demo_front.py | Allendjmax/lidar | d1a8e40a9a988d615be0931005b240be0ca7a05b | [
"MIT"
] | 409 | 2020-09-10T01:13:14.000Z | 2022-03-31T22:44:51.000Z | sfa/demo_front.py | Allendjmax/lidar | d1a8e40a9a988d615be0931005b240be0ca7a05b | [
"MIT"
] | 49 | 2020-09-13T06:02:52.000Z | 2022-03-30T11:29:01.000Z | sfa/demo_front.py | Allendjmax/lidar | d1a8e40a9a988d615be0931005b240be0ca7a05b | [
"MIT"
] | 137 | 2020-09-09T14:50:42.000Z | 2022-03-29T13:54:10.000Z | """
# -*- coding: utf-8 -*-
-----------------------------------------------------------------------------------
# Author: Nguyen Mau Dung
# DoC: 2020.08.17
# email: nguyenmaudung93.kstn@gmail.com
-----------------------------------------------------------------------------------
# Description: Demonstration script for ... | 41.617021 | 112 | 0.668967 |
66c92161ef3c5eba0dd5ea2edaf5ef02afcf7582 | 342 | py | Python | time_logger/users/api/serializers.py | dmontoya1/time-logging | 4c9f04497868199a05ec694d35f1c79af548ec13 | [
"MIT"
] | null | null | null | time_logger/users/api/serializers.py | dmontoya1/time-logging | 4c9f04497868199a05ec694d35f1c79af548ec13 | [
"MIT"
] | null | null | null | time_logger/users/api/serializers.py | dmontoya1/time-logging | 4c9f04497868199a05ec694d35f1c79af548ec13 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from time_logger.users.models import User
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ["username", "email", "name", "url"]
extra_kwargs = {
"url": {"view_name": "api:user-detail", "lookup_field": ... | 24.428571 | 79 | 0.634503 |
a09b3dd49a7ea9ba54ec358b7e77939dc8d6715c | 5,377 | py | Python | homeassistant/components/toon/config_flow.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 4 | 2019-07-03T22:36:57.000Z | 2019-08-10T15:33:25.000Z | homeassistant/components/toon/config_flow.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 7 | 2019-08-23T05:26:02.000Z | 2022-03-11T23:57:18.000Z | homeassistant/components/toon/config_flow.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 3 | 2019-04-28T16:35:45.000Z | 2020-05-28T15:21:59.000Z | """Config flow to configure the Toon component."""
from collections import OrderedDict
import logging
from functools import partial
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import callback
from .const import... | 34.248408 | 78 | 0.632137 |
9f4e02e08ae8f1f7b289286e4304f7c33d5db3cb | 1,447 | py | Python | rclpy/services/minimal_client/examples_rclpy_minimal_client/client.py | peterpolidoro/ros2_examples | 35674eb17494ab3f67cc5fbe5f127c614be2220b | [
"Apache-2.0"
] | 1 | 2021-01-11T06:28:53.000Z | 2021-01-11T06:28:53.000Z | rclpy/services/minimal_client/examples_rclpy_minimal_client/client.py | peterpolidoro/ros2_examples | 35674eb17494ab3f67cc5fbe5f127c614be2220b | [
"Apache-2.0"
] | null | null | null | rclpy/services/minimal_client/examples_rclpy_minimal_client/client.py | peterpolidoro/ros2_examples | 35674eb17494ab3f67cc5fbe5f127c614be2220b | [
"Apache-2.0"
] | 3 | 2020-03-13T21:52:09.000Z | 2020-04-14T18:33:15.000Z | # Copyright 2016 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 29.530612 | 74 | 0.68763 |
984bfc763bcf38d95f4ec4cdb1914222dc3f958c | 19,025 | py | Python | xarray/tests/test_accessor_dt.py | jthielen/xarray | 10f0227a1667c5ab3c88465ff1572065322cde77 | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | xarray/tests/test_accessor_dt.py | jthielen/xarray | 10f0227a1667c5ab3c88465ff1572065322cde77 | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | xarray/tests/test_accessor_dt.py | jthielen/xarray | 10f0227a1667c5ab3c88465ff1572065322cde77 | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-07-13T07:06:10.000Z | 2021-07-13T07:06:10.000Z | from distutils.version import LooseVersion
import numpy as np
import pandas as pd
import pytest
import xarray as xr
from . import (
assert_array_equal,
assert_chunks_equal,
assert_equal,
assert_identical,
raise_if_dask_computes,
raises_regex,
requires_cftime,
requires_dask,
)
class ... | 30.342903 | 88 | 0.593587 |
ea6650fb68a0180bb709b44b8b813bda5de49f11 | 2,666 | py | Python | python/tink/daead/_deterministic_aead_key_manager_test.py | Baha-sk/tink | 285f7dd4f50d2870b3f8137291fda2def9212d63 | [
"Apache-2.0"
] | 12,366 | 2017-05-12T11:22:39.000Z | 2022-03-31T13:40:46.000Z | python/tink/daead/_deterministic_aead_key_manager_test.py | Baha-sk/tink | 285f7dd4f50d2870b3f8137291fda2def9212d63 | [
"Apache-2.0"
] | 505 | 2017-05-18T20:54:30.000Z | 2022-03-30T19:51:56.000Z | python/tink/daead/_deterministic_aead_key_manager_test.py | Baha-sk/tink | 285f7dd4f50d2870b3f8137291fda2def9212d63 | [
"Apache-2.0"
] | 1,179 | 2017-05-12T11:25:34.000Z | 2022-03-31T14:31:15.000Z | # Copyright 2019 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 agreed to in writing,... | 35.546667 | 79 | 0.776819 |
0ab167eb82b638a9dfca59fa6df2402bf73759da | 430 | py | Python | application/routes.py | sarveshkumargupta/nutrition-app | 5d9777ce21c4def310ce31975f4b2d1eba0080f8 | [
"MIT"
] | null | null | null | application/routes.py | sarveshkumargupta/nutrition-app | 5d9777ce21c4def310ce31975f4b2d1eba0080f8 | [
"MIT"
] | null | null | null | application/routes.py | sarveshkumargupta/nutrition-app | 5d9777ce21c4def310ce31975f4b2d1eba0080f8 | [
"MIT"
] | null | null | null | from flask import Blueprint
from flask import render_template
from application.control import Search, nutrition_api_call
app_bp = Blueprint('app_bp', __name__)
@app_bp.route('/', methods=['GET', 'POST'])
def home():
form = Search()
if form.validate_on_submit():
res = nutrition_api_call(form)
... | 28.666667 | 66 | 0.718605 |
f4de5cc58d12df4855fb7893f7de106c2f5a9481 | 5,409 | py | Python | octavia/controller/worker/v2/flows/flow_utils.py | zhangi/octavia | e68c851fecf55e1b5ffe7d5b849f729626af28a3 | [
"Apache-2.0"
] | 129 | 2015-06-23T08:06:23.000Z | 2022-03-31T12:38:20.000Z | octavia/controller/worker/v2/flows/flow_utils.py | zhangi/octavia | e68c851fecf55e1b5ffe7d5b849f729626af28a3 | [
"Apache-2.0"
] | 6 | 2016-05-20T11:05:27.000Z | 2021-03-23T06:05:52.000Z | octavia/controller/worker/v2/flows/flow_utils.py | zhangi/octavia | e68c851fecf55e1b5ffe7d5b849f729626af28a3 | [
"Apache-2.0"
] | 166 | 2015-07-15T16:24:05.000Z | 2022-03-02T20:54:36.000Z |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 29.396739 | 79 | 0.765391 |
cd82949bfeae2154bfbd86e8c128707a0487f104 | 6,550 | py | Python | mars/learn/contrib/xgboost/tests/test_classifier.py | snsnlou/mars | 6b8eec162eccc8bb980a98ca2cf1e6a4b866d302 | [
"Apache-2.0"
] | 1 | 2021-11-30T12:07:21.000Z | 2021-11-30T12:07:21.000Z | mars/learn/contrib/xgboost/tests/test_classifier.py | snsnlou/mars | 6b8eec162eccc8bb980a98ca2cf1e6a4b866d302 | [
"Apache-2.0"
] | null | null | null | mars/learn/contrib/xgboost/tests/test_classifier.py | snsnlou/mars | 6b8eec162eccc8bb980a98ca2cf1e6a4b866d302 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 36.388889 | 85 | 0.632824 |
7cfff8731823fd2d8fbbbd84077f0579c1058f2a | 242 | py | Python | problems/reverse_words.py | stereoabuse/codewars | d6437afaef38c3601903891b8b9cb0f84c108c54 | [
"MIT"
] | null | null | null | problems/reverse_words.py | stereoabuse/codewars | d6437afaef38c3601903891b8b9cb0f84c108c54 | [
"MIT"
] | null | null | null | problems/reverse_words.py | stereoabuse/codewars | d6437afaef38c3601903891b8b9cb0f84c108c54 | [
"MIT"
] | null | null | null | ## Reverse words
## 7 kyu
## https://www.codewars.com/kata/5259b20d6021e9e14c0010d4
def reverse_words(text):
wlr = [word[::-1] for word in text.split()]
return " ".join(wlr) if text.count(" ")>=len(wlr) else " ".join(wlr) | 30.25 | 73 | 0.619835 |
8612304fc38ee9ee9de7e12b3a70d869b9e9df45 | 341 | py | Python | address/forms.py | lkmhaqer/gtools-python | cff6d80525b78a4fadfb686566489fbe1687d889 | [
"MIT"
] | 5 | 2016-10-31T17:46:17.000Z | 2022-02-02T00:40:49.000Z | address/forms.py | lkmhaqer/gtools-python | cff6d80525b78a4fadfb686566489fbe1687d889 | [
"MIT"
] | 33 | 2018-05-09T06:07:50.000Z | 2021-09-22T17:39:56.000Z | address/forms.py | lkmhaqer/gtools-python | cff6d80525b78a4fadfb686566489fbe1687d889 | [
"MIT"
] | 1 | 2020-05-14T21:44:25.000Z | 2020-05-14T21:44:25.000Z | # file: address/forms.py
from django import forms
from address.models import ipv6_address, ipv4_address
class IPv6AddressForm(forms.ModelForm):
class Meta:
model = ipv6_address
fields = ('__all__')
class IPv4AddressForm(forms.ModelForm):
class Meta:
model = ipv4_address
... | 17.947368 | 53 | 0.680352 |
95cfd56a93e81fa39a93f96ecda4a20f886e6759 | 255 | py | Python | src/bimker/__init__.py | salotz/bimker | 46a0d7c449edba348b0ea3c6ff73ffe82da54ca0 | [
"MIT"
] | null | null | null | src/bimker/__init__.py | salotz/bimker | 46a0d7c449edba348b0ea3c6ff73ffe82da54ca0 | [
"MIT"
] | null | null | null | src/bimker/__init__.py | salotz/bimker | 46a0d7c449edba348b0ea3c6ff73ffe82da54ca0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package."""
from ._version import __version__
__author__ = "Samuel D. Lotz"
__email__ = 'samuel.lotz@salotz.info'
# module stuff
import os.path as osp
CONFIG_DIR = osp.expanduser(osp.expandvars("$HOME/.bimker"))
| 17 | 60 | 0.698039 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.